@firecms/collection_editor 3.0.0-alpha.31 → 3.0.0-alpha.32
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/components/collection_editor/utils/strings.d.ts +1 -0
- package/dist/index.es.js +848 -785
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -4
- package/src/components/collection_editor/CollectionPropertiesEditorForm.tsx +72 -8
- package/src/components/collection_editor/utils/strings.ts +8 -0
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { iconKeys as
|
|
5
|
-
import
|
|
6
|
-
import { useFormikContext as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import * as _e from "react";
|
|
3
|
+
import D, { useState as L, useCallback as J, useEffect as de, useMemo as $t, useRef as Ye, useDeferredValue as fa, useContext as Lt } from "react";
|
|
4
|
+
import { iconKeys as Kt, debounce as ba, SearchBar as ya, Tooltip as ae, IconButton as re, Icon as st, coolIconKeys as _t, Typography as P, getIconForView as lt, useAutoComplete as va, Container as ut, Chip as ct, TextField as Ve, cn as xe, DebouncedTextField as G, Autocomplete as wa, AutocompleteItem as _a, ExpandablePanel as xt, SettingsIcon as Ge, Select as je, SelectItem as we, BooleanSwitchWithLabel as Yt, Dialog as Ie, toSnakeCase as Ht, singular as ka, ListIcon as xa, Button as E, CircularProgress as Je, AutoAwesomeIcon as ht, Paper as Se, FormikArrayContainer as Ca, DialogContent as De, DialogActions as Re, SwitchControl as ue, serializeRegExp as Oa, isValidRegExp as Pa, RuleIcon as Na, useSnackbarController as Qe, resolveEnumValues as Sa, FileUploadIcon as qa, MultiSelect as Aa, MultiSelectItem as qt, Checkbox as At, isPropertyBuilder as se, useFireCMSContext as Ae, getFieldConfig as We, ErrorBoundary as Pe, FieldConfigBadge as Ze, cardMixin as Gt, cardClickableMixin as Jt, cardSelectedMixin as Qt, RemoveCircleIcon as Wt, FunctionsIcon as za, defaultBorderMixin as Ct, RemoveIcon as Ta, DragHandleIcon as Va, AddIcon as qe, useNavigationContext as Ue, SelectGroup as zt, mergeDeep as $, getFieldId as Zt, DEFAULT_FIELD_CONFIGS as kt, InfoLabel as Xt, DeleteIcon as dt, DeleteConfirmationDialog as pt, useLargeLayout as ja, CodeIcon as Fa, makePropertiesEditable as ea, resolveEntityView as Ia, Table as Tt, TableBody as Vt, TableRow as bt, TableCell as Ke, unslugify as Ot, Card as ta, useSelectionController as Ea, EntityCollectionTable as Ba, slugify as Ma, useAuthController as $e, CircularProgressCenter as jt, Tabs as Da, Tab as yt, removeUndefined as Ra, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Ft, DoneIcon as Ua, SaveIcon as $a, Menu as La, MoreVertIcon as Ka, MenuItem as Ya, Collapse as Ha, sortProperties as Ga, getDefaultPropertiesOrder as Ja } from "@firecms/core";
|
|
5
|
+
import mt from "react-fast-compare";
|
|
6
|
+
import { useFormikContext as K, Field as be, getIn as N, Formik as Pt, FastField as le, Form as Qa } from "formik";
|
|
7
|
+
import * as vt from "yup";
|
|
8
|
+
import * as Wa from "js-search";
|
|
9
|
+
import Za from "json5";
|
|
10
|
+
import { Highlight as Xa, themes as ei } from "prism-react-renderer";
|
|
11
|
+
import { extractEnumFromValues as ti, buildPropertyFromData as ai, buildEntityPropertiesFromData as ii } from "@firecms/schema_inference";
|
|
12
|
+
import { DragDropContext as ri, Droppable as oi, Draggable as ni } from "@hello-pangea/dnd";
|
|
13
|
+
import { ImportFileUpload as si, DataNewPropertiesMapping as li, ImportNewPropertyFieldPreview as ci, getInferenceType as ia, getPropertiesMapping as di, convertDataToEntity as pi, useImportConfig as mi, ImportSaveInProgress as ui } from "@firecms/data_import";
|
|
14
|
+
import { useNavigate as hi } from "react-router";
|
|
15
|
+
const gi = vt.object().shape({
|
|
16
|
+
name: vt.string().required("Required"),
|
|
17
|
+
path: vt.string().required("Required")
|
|
18
|
+
}), ra = {
|
|
17
19
|
abc: "alphabet character font letter symbol text type",
|
|
18
20
|
access_alarm: "clock time",
|
|
19
21
|
access_alarms: "clock time",
|
|
@@ -1962,34 +1964,34 @@ const di = yt.object().shape({
|
|
|
1962
1964
|
zoom_in_map: "arrows destination location maps move place stop",
|
|
1963
1965
|
zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
|
|
1964
1966
|
zoom_out_map: "arrows destination location maps move place stop"
|
|
1965
|
-
},
|
|
1966
|
-
|
|
1967
|
-
|
|
1967
|
+
}, Nt = new Wa.Search("key");
|
|
1968
|
+
Nt.addIndex("synonyms");
|
|
1969
|
+
Nt.addDocuments(Kt.map((t) => ({
|
|
1968
1970
|
key: t,
|
|
1969
1971
|
// @ts-ignore
|
|
1970
|
-
synonyms:
|
|
1972
|
+
synonyms: ra[t] ?? []
|
|
1971
1973
|
})));
|
|
1972
|
-
const
|
|
1973
|
-
process.env.NODE_ENV !== "production" && Object.keys(
|
|
1974
|
-
|
|
1974
|
+
const fi = 220;
|
|
1975
|
+
process.env.NODE_ENV !== "production" && Object.keys(ra).forEach((t) => {
|
|
1976
|
+
Kt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
|
|
1975
1977
|
});
|
|
1976
|
-
function
|
|
1977
|
-
const [r, i] =
|
|
1978
|
-
() =>
|
|
1978
|
+
function bi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
1979
|
+
const [r, i] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
|
|
1980
|
+
() => ba((m) => {
|
|
1979
1981
|
if (!m || m === "")
|
|
1980
1982
|
i(null);
|
|
1981
1983
|
else {
|
|
1982
|
-
const u =
|
|
1984
|
+
const u = Nt.search(m);
|
|
1983
1985
|
i(u.map((c) => c.key));
|
|
1984
1986
|
}
|
|
1985
|
-
},
|
|
1987
|
+
}, fi),
|
|
1986
1988
|
[]
|
|
1987
1989
|
);
|
|
1988
|
-
return
|
|
1990
|
+
return _e.useEffect(() => (l(s), () => {
|
|
1989
1991
|
l.clear();
|
|
1990
1992
|
}), [s, l]), /* @__PURE__ */ n(B, { children: [
|
|
1991
1993
|
/* @__PURE__ */ e(
|
|
1992
|
-
|
|
1994
|
+
ya,
|
|
1993
1995
|
{
|
|
1994
1996
|
autoFocus: !0,
|
|
1995
1997
|
className: "w-full sticky top-0 z-10",
|
|
@@ -1997,25 +1999,25 @@ function mi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
|
1997
1999
|
placeholder: "Search for more icons…"
|
|
1998
2000
|
}
|
|
1999
2001
|
),
|
|
2000
|
-
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ?
|
|
2001
|
-
|
|
2002
|
+
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? _t : r).map((m) => /* @__PURE__ */ e(ae, { title: m, children: /* @__PURE__ */ e(
|
|
2003
|
+
re,
|
|
2002
2004
|
{
|
|
2003
2005
|
shape: "square",
|
|
2004
2006
|
toggled: t === m,
|
|
2005
2007
|
onClick: () => a(m),
|
|
2006
2008
|
className: "box-content m-1",
|
|
2007
|
-
children: /* @__PURE__ */ e(
|
|
2009
|
+
children: /* @__PURE__ */ e(st, { iconKey: m, size: 24 })
|
|
2008
2010
|
}
|
|
2009
2011
|
) }, m)) })
|
|
2010
2012
|
] });
|
|
2011
2013
|
}
|
|
2012
|
-
function
|
|
2014
|
+
function te({
|
|
2013
2015
|
error: t,
|
|
2014
2016
|
children: a
|
|
2015
2017
|
}) {
|
|
2016
2018
|
return a ? /* @__PURE__ */ e(P, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
|
|
2017
2019
|
}
|
|
2018
|
-
function
|
|
2020
|
+
function yi({
|
|
2019
2021
|
isNewCollection: t,
|
|
2020
2022
|
reservedGroups: a,
|
|
2021
2023
|
existingPaths: r,
|
|
@@ -2023,7 +2025,7 @@ function ui({
|
|
|
2023
2025
|
groups: s,
|
|
2024
2026
|
parentCollection: o
|
|
2025
2027
|
}) {
|
|
2026
|
-
const l =
|
|
2028
|
+
const l = D.useRef(null), {
|
|
2027
2029
|
values: d,
|
|
2028
2030
|
setFieldValue: m,
|
|
2029
2031
|
handleChange: u,
|
|
@@ -2032,24 +2034,24 @@ function ui({
|
|
|
2032
2034
|
setFieldTouched: g,
|
|
2033
2035
|
isSubmitting: f,
|
|
2034
2036
|
submitCount: y
|
|
2035
|
-
} =
|
|
2036
|
-
m("name", x), !N(c, "path") && t && x && m("path",
|
|
2037
|
-
}, h =
|
|
2037
|
+
} = K(), [k, _] = L(!1), O = (x) => {
|
|
2038
|
+
m("name", x), !N(c, "path") && t && x && m("path", Ht(x)), !N(c, "singularName") && t && x && m("singularName", ka(x));
|
|
2039
|
+
}, h = lt(d), w = J((x) => {
|
|
2038
2040
|
let C;
|
|
2039
2041
|
return x || (C = "You must specify a path in the database for this collection"), t && i?.includes(x.trim().toLowerCase()) && (C = "There is already a collection which uses this path as an alias"), t && r?.includes(x.trim().toLowerCase()) && !d.alias && (C = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"), C;
|
|
2040
|
-
}, [t, i, r, d.alias]), b =
|
|
2042
|
+
}, [t, i, r, d.alias]), b = J((x) => {
|
|
2041
2043
|
if (!x)
|
|
2042
2044
|
return;
|
|
2043
2045
|
let C;
|
|
2044
2046
|
return t && r?.includes(x.trim().toLowerCase()) && (C = "There is already a collection that uses this value as a path"), t && i?.includes(x.trim().toLowerCase()) && (C = "There is already a collection which uses this alias"), C;
|
|
2045
2047
|
}, [t, r, i]), v = s?.filter((x) => !a?.includes(x)), {
|
|
2046
2048
|
inputFocused: T,
|
|
2047
|
-
autoCompleteOpen:
|
|
2049
|
+
autoCompleteOpen: F,
|
|
2048
2050
|
setAutoCompleteOpen: A
|
|
2049
|
-
} =
|
|
2051
|
+
} = va({
|
|
2050
2052
|
ref: l
|
|
2051
2053
|
}), S = !!o;
|
|
2052
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(
|
|
2054
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ut, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
2053
2055
|
/* @__PURE__ */ n("div", { children: [
|
|
2054
2056
|
/* @__PURE__ */ n(
|
|
2055
2057
|
"div",
|
|
@@ -2058,7 +2060,7 @@ function ui({
|
|
|
2058
2060
|
children: [
|
|
2059
2061
|
/* @__PURE__ */ e(P, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${d.name} collection` }),
|
|
2060
2062
|
/* @__PURE__ */ e(ae, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
2061
|
-
|
|
2063
|
+
re,
|
|
2062
2064
|
{
|
|
2063
2065
|
shape: "square",
|
|
2064
2066
|
onClick: () => _(!0),
|
|
@@ -2068,7 +2070,7 @@ function ui({
|
|
|
2068
2070
|
]
|
|
2069
2071
|
}
|
|
2070
2072
|
),
|
|
2071
|
-
o && /* @__PURE__ */ e(
|
|
2073
|
+
o && /* @__PURE__ */ e(ct, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
|
|
2072
2074
|
"This is a subcollection of ",
|
|
2073
2075
|
/* @__PURE__ */ e("b", { children: o.name })
|
|
2074
2076
|
] }) })
|
|
@@ -2085,11 +2087,11 @@ function ui({
|
|
|
2085
2087
|
error: c.name && !!p.name
|
|
2086
2088
|
}
|
|
2087
2089
|
),
|
|
2088
|
-
/* @__PURE__ */ e(
|
|
2090
|
+
/* @__PURE__ */ e(te, { error: c.name && !!p.name, children: c.name && p.name ? p.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
2089
2091
|
] }),
|
|
2090
|
-
/* @__PURE__ */ n("div", { className:
|
|
2092
|
+
/* @__PURE__ */ n("div", { className: xe("col-span-12 ", S ? "" : "sm:col-span-8"), children: [
|
|
2091
2093
|
/* @__PURE__ */ e(
|
|
2092
|
-
|
|
2094
|
+
be,
|
|
2093
2095
|
{
|
|
2094
2096
|
name: "path",
|
|
2095
2097
|
as: G,
|
|
@@ -2100,7 +2102,7 @@ function ui({
|
|
|
2100
2102
|
error: c.path && !!p.path
|
|
2101
2103
|
}
|
|
2102
2104
|
),
|
|
2103
|
-
/* @__PURE__ */ e(
|
|
2105
|
+
/* @__PURE__ */ e(te, { error: c.path && !!p.path, children: c.path && p.path ? p.path : "Path that this collection is stored in" })
|
|
2104
2106
|
] }),
|
|
2105
2107
|
!S && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
2106
2108
|
/* @__PURE__ */ e(
|
|
@@ -2117,12 +2119,12 @@ function ui({
|
|
|
2117
2119
|
}
|
|
2118
2120
|
),
|
|
2119
2121
|
/* @__PURE__ */ e(
|
|
2120
|
-
|
|
2122
|
+
wa,
|
|
2121
2123
|
{
|
|
2122
|
-
open:
|
|
2124
|
+
open: F && (v ?? []).length > 0,
|
|
2123
2125
|
setOpen: A,
|
|
2124
2126
|
children: v?.map((x, C) => /* @__PURE__ */ e(
|
|
2125
|
-
|
|
2127
|
+
_a,
|
|
2126
2128
|
{
|
|
2127
2129
|
onClick: () => {
|
|
2128
2130
|
A(!1), m("group", x ?? null);
|
|
@@ -2133,13 +2135,13 @@ function ui({
|
|
|
2133
2135
|
))
|
|
2134
2136
|
}
|
|
2135
2137
|
),
|
|
2136
|
-
/* @__PURE__ */ e(
|
|
2138
|
+
/* @__PURE__ */ e(te, { children: c.group && p.group ? p.group : "Group of the collection" })
|
|
2137
2139
|
] }),
|
|
2138
2140
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2139
|
-
|
|
2141
|
+
xt,
|
|
2140
2142
|
{
|
|
2141
2143
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2142
|
-
/* @__PURE__ */ e(
|
|
2144
|
+
/* @__PURE__ */ e(Ge, {}),
|
|
2143
2145
|
/* @__PURE__ */ e(
|
|
2144
2146
|
P,
|
|
2145
2147
|
{
|
|
@@ -2163,7 +2165,7 @@ function ui({
|
|
|
2163
2165
|
label: "Singular name"
|
|
2164
2166
|
}
|
|
2165
2167
|
),
|
|
2166
|
-
/* @__PURE__ */ e(
|
|
2168
|
+
/* @__PURE__ */ e(te, { error: c.singularName && !!p.singularName, children: c.singularName && p.singularName ? p.singularName : "Optionally define a singular name for your entities" })
|
|
2167
2169
|
] }),
|
|
2168
2170
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2169
2171
|
/* @__PURE__ */ e(
|
|
@@ -2179,11 +2181,11 @@ function ui({
|
|
|
2179
2181
|
label: "Description"
|
|
2180
2182
|
}
|
|
2181
2183
|
),
|
|
2182
|
-
/* @__PURE__ */ e(
|
|
2184
|
+
/* @__PURE__ */ e(te, { error: c.description && !!p.description, children: c.description && p.description ? p.description : "Description of the collection, you can use markdown" })
|
|
2183
2185
|
] }),
|
|
2184
2186
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2185
2187
|
/* @__PURE__ */ e(
|
|
2186
|
-
|
|
2188
|
+
be,
|
|
2187
2189
|
{
|
|
2188
2190
|
name: "alias",
|
|
2189
2191
|
as: G,
|
|
@@ -2193,7 +2195,7 @@ function ui({
|
|
|
2193
2195
|
error: c.alias && !!p.alias
|
|
2194
2196
|
}
|
|
2195
2197
|
),
|
|
2196
|
-
/* @__PURE__ */ e(
|
|
2198
|
+
/* @__PURE__ */ e(te, { error: c.alias && !!p.alias, children: c.alias && p.alias ? p.alias : "Use an alias as an ID when you have multiple collections located in the same path" })
|
|
2197
2199
|
] }),
|
|
2198
2200
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2199
2201
|
je,
|
|
@@ -2205,7 +2207,7 @@ function ui({
|
|
|
2205
2207
|
value: d.defaultSize ?? "",
|
|
2206
2208
|
renderValue: (x) => x.toUpperCase(),
|
|
2207
2209
|
children: ["xs", "s", "m", "l", "xl"].map((x) => /* @__PURE__ */ e(
|
|
2208
|
-
|
|
2210
|
+
we,
|
|
2209
2211
|
{
|
|
2210
2212
|
value: x,
|
|
2211
2213
|
children: x.toUpperCase()
|
|
@@ -2216,7 +2218,7 @@ function ui({
|
|
|
2216
2218
|
) }),
|
|
2217
2219
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2218
2220
|
/* @__PURE__ */ e(
|
|
2219
|
-
|
|
2221
|
+
Yt,
|
|
2220
2222
|
{
|
|
2221
2223
|
position: "start",
|
|
2222
2224
|
label: "Collection group",
|
|
@@ -2224,7 +2226,7 @@ function ui({
|
|
|
2224
2226
|
value: d.collectionGroup ?? !1
|
|
2225
2227
|
}
|
|
2226
2228
|
),
|
|
2227
|
-
/* @__PURE__ */ e(
|
|
2229
|
+
/* @__PURE__ */ e(te, { children: "A collection group consists of all collections with the same ID. This allows you to query over multiple collections at once." })
|
|
2228
2230
|
] })
|
|
2229
2231
|
] })
|
|
2230
2232
|
}
|
|
@@ -2232,14 +2234,14 @@ function ui({
|
|
|
2232
2234
|
] }),
|
|
2233
2235
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
2234
2236
|
/* @__PURE__ */ e(
|
|
2235
|
-
|
|
2237
|
+
Ie,
|
|
2236
2238
|
{
|
|
2237
2239
|
open: k,
|
|
2238
2240
|
onOpenChange: _,
|
|
2239
2241
|
maxWidth: "xl",
|
|
2240
2242
|
fullWidth: !0,
|
|
2241
2243
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
2242
|
-
|
|
2244
|
+
bi,
|
|
2243
2245
|
{
|
|
2244
2246
|
selectedIcon: d.icon,
|
|
2245
2247
|
onIconSelected: (x) => {
|
|
@@ -2251,19 +2253,19 @@ function ui({
|
|
|
2251
2253
|
)
|
|
2252
2254
|
] }) });
|
|
2253
2255
|
}
|
|
2254
|
-
function
|
|
2256
|
+
function ke(t) {
|
|
2255
2257
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
2256
2258
|
}
|
|
2257
|
-
function
|
|
2259
|
+
function vi(t) {
|
|
2258
2260
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
2259
2261
|
}
|
|
2260
|
-
function
|
|
2262
|
+
function Ne(t) {
|
|
2261
2263
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
2262
2264
|
}
|
|
2263
|
-
function
|
|
2265
|
+
function ne(t, a) {
|
|
2264
2266
|
return a ? `${a}.${t}` : t;
|
|
2265
2267
|
}
|
|
2266
|
-
const
|
|
2268
|
+
const wi = D.memo(
|
|
2267
2269
|
function({
|
|
2268
2270
|
enumValues: a,
|
|
2269
2271
|
onValuesChanged: r,
|
|
@@ -2274,7 +2276,7 @@ const gi = R.memo(
|
|
|
2274
2276
|
getData: d
|
|
2275
2277
|
}) {
|
|
2276
2278
|
return /* @__PURE__ */ e(
|
|
2277
|
-
|
|
2279
|
+
Pt,
|
|
2278
2280
|
{
|
|
2279
2281
|
initialValues: { enumValues: a },
|
|
2280
2282
|
validateOnMount: !0,
|
|
@@ -2283,12 +2285,12 @@ const gi = R.memo(
|
|
|
2283
2285
|
children: ({
|
|
2284
2286
|
values: m,
|
|
2285
2287
|
errors: u
|
|
2286
|
-
}) => (
|
|
2288
|
+
}) => (de(() => {
|
|
2287
2289
|
r && r(m.enumValues);
|
|
2288
|
-
}, [m.enumValues]),
|
|
2290
|
+
}, [m.enumValues]), de(() => {
|
|
2289
2291
|
i && i(!!(u?.enumValues ?? !1));
|
|
2290
2292
|
}, [u]), /* @__PURE__ */ e(
|
|
2291
|
-
|
|
2293
|
+
_i,
|
|
2292
2294
|
{
|
|
2293
2295
|
enumValuesPath: "enumValues",
|
|
2294
2296
|
values: m,
|
|
@@ -2306,7 +2308,7 @@ const gi = R.memo(
|
|
|
2306
2308
|
return a.enumValues.length === r.enumValues.length && a.onValuesChanged === r.onValuesChanged && a.getData === r.getData;
|
|
2307
2309
|
}
|
|
2308
2310
|
);
|
|
2309
|
-
function
|
|
2311
|
+
function _i({
|
|
2310
2312
|
values: t,
|
|
2311
2313
|
errors: a,
|
|
2312
2314
|
disabled: r,
|
|
@@ -2317,10 +2319,10 @@ function fi({
|
|
|
2317
2319
|
}) {
|
|
2318
2320
|
const {
|
|
2319
2321
|
setFieldValue: d
|
|
2320
|
-
} =
|
|
2322
|
+
} = K(), [m, u] = D.useState(), [c, p] = D.useState(), [g, f] = D.useState(!1), k = D.useRef(/* @__PURE__ */ new Set()).current, _ = (h, w) => {
|
|
2321
2323
|
const b = m === w;
|
|
2322
2324
|
return /* @__PURE__ */ e(
|
|
2323
|
-
|
|
2325
|
+
ki,
|
|
2324
2326
|
{
|
|
2325
2327
|
index: h,
|
|
2326
2328
|
disabled: r,
|
|
@@ -2335,7 +2337,7 @@ function fi({
|
|
|
2335
2337
|
};
|
|
2336
2338
|
return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2337
2339
|
/* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
|
|
2338
|
-
/* @__PURE__ */ e(
|
|
2340
|
+
/* @__PURE__ */ e(xa, {}),
|
|
2339
2341
|
/* @__PURE__ */ e(
|
|
2340
2342
|
P,
|
|
2341
2343
|
{
|
|
@@ -2355,24 +2357,24 @@ function fi({
|
|
|
2355
2357
|
l && (f(!0), l?.().then((h) => {
|
|
2356
2358
|
if (!h)
|
|
2357
2359
|
return;
|
|
2358
|
-
const w = h.flat(), b = Array.from(new Set(w)), v = t.enumValues,
|
|
2359
|
-
|
|
2360
|
+
const w = h.flat(), b = Array.from(new Set(w)), v = t.enumValues, F = ti(b).filter((A) => !v?.some((S) => S.id === A.id));
|
|
2361
|
+
F.forEach((A) => {
|
|
2360
2362
|
k.add(A.id);
|
|
2361
|
-
}), d(i, [...
|
|
2363
|
+
}), d(i, [...F, ...v]);
|
|
2362
2364
|
}).catch((h) => {
|
|
2363
2365
|
console.error(h);
|
|
2364
2366
|
}).finally(() => f(!1)));
|
|
2365
2367
|
},
|
|
2366
2368
|
children: [
|
|
2367
|
-
g ? /* @__PURE__ */ e(
|
|
2369
|
+
g ? /* @__PURE__ */ e(Je, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
|
|
2368
2370
|
"Infer values from data"
|
|
2369
2371
|
]
|
|
2370
2372
|
}
|
|
2371
2373
|
)
|
|
2372
2374
|
] }),
|
|
2373
|
-
/* @__PURE__ */ n(
|
|
2375
|
+
/* @__PURE__ */ n(Se, { className: "p-4 m-1", children: [
|
|
2374
2376
|
/* @__PURE__ */ e(
|
|
2375
|
-
|
|
2377
|
+
Ca,
|
|
2376
2378
|
{
|
|
2377
2379
|
value: t.enumValues,
|
|
2378
2380
|
addLabel: "Add enum value",
|
|
@@ -2386,7 +2388,7 @@ function fi({
|
|
|
2386
2388
|
}
|
|
2387
2389
|
),
|
|
2388
2390
|
/* @__PURE__ */ e(
|
|
2389
|
-
|
|
2391
|
+
xi,
|
|
2390
2392
|
{
|
|
2391
2393
|
index: c,
|
|
2392
2394
|
open: c !== void 0,
|
|
@@ -2397,7 +2399,7 @@ function fi({
|
|
|
2397
2399
|
] })
|
|
2398
2400
|
] });
|
|
2399
2401
|
}
|
|
2400
|
-
const
|
|
2402
|
+
const ki = D.memo(
|
|
2401
2403
|
function({
|
|
2402
2404
|
index: a,
|
|
2403
2405
|
shouldUpdateId: r,
|
|
@@ -2413,12 +2415,12 @@ const bi = R.memo(
|
|
|
2413
2415
|
errors: c,
|
|
2414
2416
|
setFieldValue: p,
|
|
2415
2417
|
touched: g
|
|
2416
|
-
} =
|
|
2417
|
-
return
|
|
2418
|
+
} = K(), f = D.useRef(!N(m, `${i}[${a}].id`)), y = r || f.current, k = N(m, `${i}[${a}].id`), _ = N(m, `${i}[${a}].label`), O = N(c, `${i}[${a}].label`), h = D.useRef(_);
|
|
2419
|
+
return D.useEffect(() => {
|
|
2418
2420
|
(h.current === k || !k) && y && p(`${i}[${a}].id`, _), h.current = _;
|
|
2419
2421
|
}, [_]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
|
|
2420
2422
|
/* @__PURE__ */ e(
|
|
2421
|
-
|
|
2423
|
+
le,
|
|
2422
2424
|
{
|
|
2423
2425
|
name: `${i}[${a}].label`,
|
|
2424
2426
|
as: G,
|
|
@@ -2426,21 +2428,21 @@ const bi = R.memo(
|
|
|
2426
2428
|
required: !0,
|
|
2427
2429
|
disabled: l,
|
|
2428
2430
|
size: "small",
|
|
2429
|
-
validate:
|
|
2431
|
+
validate: Ci,
|
|
2430
2432
|
autoFocus: s,
|
|
2431
2433
|
autoComplete: "off",
|
|
2432
|
-
endAdornment: d && /* @__PURE__ */ e(
|
|
2434
|
+
endAdornment: d && /* @__PURE__ */ e(ht, { size: "small" }),
|
|
2433
2435
|
error: !!O
|
|
2434
2436
|
}
|
|
2435
2437
|
),
|
|
2436
2438
|
!l && /* @__PURE__ */ e(
|
|
2437
|
-
|
|
2439
|
+
re,
|
|
2438
2440
|
{
|
|
2439
2441
|
size: "small",
|
|
2440
2442
|
"aria-label": "edit",
|
|
2441
2443
|
className: "m-1",
|
|
2442
2444
|
onClick: () => o(),
|
|
2443
|
-
children: /* @__PURE__ */ e(
|
|
2445
|
+
children: /* @__PURE__ */ e(Ge, { size: "small" })
|
|
2444
2446
|
}
|
|
2445
2447
|
)
|
|
2446
2448
|
] });
|
|
@@ -2449,7 +2451,7 @@ const bi = R.memo(
|
|
|
2449
2451
|
return a.index === r.index && a.enumValuesPath === r.enumValuesPath && a.shouldUpdateId === r.shouldUpdateId && a.inferredEntry === r.inferredEntry && a.autoFocus === r.autoFocus;
|
|
2450
2452
|
}
|
|
2451
2453
|
);
|
|
2452
|
-
function
|
|
2454
|
+
function xi({
|
|
2453
2455
|
index: t,
|
|
2454
2456
|
open: a,
|
|
2455
2457
|
onClose: r,
|
|
@@ -2461,32 +2463,32 @@ function yi({
|
|
|
2461
2463
|
errors: l,
|
|
2462
2464
|
setFieldValue: d,
|
|
2463
2465
|
touched: m
|
|
2464
|
-
} =
|
|
2466
|
+
} = K(), u = t !== void 0 ? N(l, `${i}[${t}].id`) : void 0;
|
|
2465
2467
|
return /* @__PURE__ */ n(
|
|
2466
|
-
|
|
2468
|
+
Ie,
|
|
2467
2469
|
{
|
|
2468
2470
|
maxWidth: "md",
|
|
2469
2471
|
"aria-labelledby": "enum-edit-dialog",
|
|
2470
2472
|
open: a,
|
|
2471
2473
|
onOpenChange: (c) => c ? void 0 : r(),
|
|
2472
2474
|
children: [
|
|
2473
|
-
/* @__PURE__ */ e(
|
|
2475
|
+
/* @__PURE__ */ e(De, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
|
|
2474
2476
|
/* @__PURE__ */ e(
|
|
2475
|
-
|
|
2477
|
+
le,
|
|
2476
2478
|
{
|
|
2477
2479
|
name: `${i}[${t}]id`,
|
|
2478
2480
|
as: G,
|
|
2479
2481
|
required: !0,
|
|
2480
|
-
validate:
|
|
2482
|
+
validate: Oi,
|
|
2481
2483
|
label: "ID",
|
|
2482
2484
|
size: "small",
|
|
2483
2485
|
autoComplete: "off",
|
|
2484
2486
|
error: !!u
|
|
2485
2487
|
}
|
|
2486
2488
|
),
|
|
2487
|
-
/* @__PURE__ */ e(
|
|
2489
|
+
/* @__PURE__ */ e(te, { error: !!u, children: u ?? "Value saved in the data source" })
|
|
2488
2490
|
] }) }),
|
|
2489
|
-
/* @__PURE__ */ e(
|
|
2491
|
+
/* @__PURE__ */ e(Re, { children: /* @__PURE__ */ e(
|
|
2490
2492
|
E,
|
|
2491
2493
|
{
|
|
2492
2494
|
autoFocus: !0,
|
|
@@ -2500,19 +2502,19 @@ function yi({
|
|
|
2500
2502
|
}
|
|
2501
2503
|
);
|
|
2502
2504
|
}
|
|
2503
|
-
function
|
|
2505
|
+
function Ci(t) {
|
|
2504
2506
|
let a;
|
|
2505
2507
|
return t || (a = "You must specify a label"), a;
|
|
2506
2508
|
}
|
|
2507
|
-
function
|
|
2509
|
+
function Oi(t) {
|
|
2508
2510
|
let a;
|
|
2509
2511
|
return t || (a = "You must specify an ID"), a;
|
|
2510
2512
|
}
|
|
2511
|
-
function
|
|
2512
|
-
const { values: a, handleChange: r } =
|
|
2513
|
+
function Ee({ disabled: t }) {
|
|
2514
|
+
const { values: a, handleChange: r } = K(), i = "validation.required", s = "validation.requiredMessage";
|
|
2513
2515
|
return /* @__PURE__ */ n(B, { children: [
|
|
2514
2516
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2515
|
-
|
|
2517
|
+
le,
|
|
2516
2518
|
{
|
|
2517
2519
|
type: "checkbox",
|
|
2518
2520
|
disabled: t,
|
|
@@ -2523,7 +2525,7 @@ function Ie({ disabled: t }) {
|
|
|
2523
2525
|
}
|
|
2524
2526
|
) }),
|
|
2525
2527
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2526
|
-
|
|
2528
|
+
le,
|
|
2527
2529
|
{
|
|
2528
2530
|
type: "checkbox",
|
|
2529
2531
|
disabled: t,
|
|
@@ -2546,7 +2548,7 @@ function Ie({ disabled: t }) {
|
|
|
2546
2548
|
) })
|
|
2547
2549
|
] });
|
|
2548
2550
|
}
|
|
2549
|
-
function
|
|
2551
|
+
function Me({
|
|
2550
2552
|
length: t,
|
|
2551
2553
|
lowercase: a,
|
|
2552
2554
|
matches: r,
|
|
@@ -2561,12 +2563,12 @@ function Be({
|
|
|
2561
2563
|
values: u,
|
|
2562
2564
|
handleChange: c,
|
|
2563
2565
|
errors: p
|
|
2564
|
-
} =
|
|
2566
|
+
} = K(), g = "validation.length", f = "validation.min", y = "validation.max", k = "validation.trim", _ = "validation.matches", O = "validation.lowercase", h = "validation.uppercase", w = N(p, _), b = N(u, _), v = typeof b == "string" ? b : Oa(b);
|
|
2565
2567
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2566
|
-
/* @__PURE__ */ e(
|
|
2568
|
+
/* @__PURE__ */ e(Ee, { disabled: d }),
|
|
2567
2569
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2568
2570
|
a && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2569
|
-
|
|
2571
|
+
le,
|
|
2570
2572
|
{
|
|
2571
2573
|
type: "checkbox",
|
|
2572
2574
|
name: O,
|
|
@@ -2576,7 +2578,7 @@ function Be({
|
|
|
2576
2578
|
}
|
|
2577
2579
|
) }),
|
|
2578
2580
|
l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2579
|
-
|
|
2581
|
+
le,
|
|
2580
2582
|
{
|
|
2581
2583
|
type: "checkbox",
|
|
2582
2584
|
name: h,
|
|
@@ -2586,7 +2588,7 @@ function Be({
|
|
|
2586
2588
|
}
|
|
2587
2589
|
) }),
|
|
2588
2590
|
o && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2589
|
-
|
|
2591
|
+
le,
|
|
2590
2592
|
{
|
|
2591
2593
|
type: "checkbox",
|
|
2592
2594
|
name: k,
|
|
@@ -2636,11 +2638,11 @@ function Be({
|
|
|
2636
2638
|
] }),
|
|
2637
2639
|
r && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2638
2640
|
/* @__PURE__ */ e(
|
|
2639
|
-
|
|
2641
|
+
le,
|
|
2640
2642
|
{
|
|
2641
2643
|
name: _,
|
|
2642
2644
|
as: G,
|
|
2643
|
-
validate: (T) => T && !
|
|
2645
|
+
validate: (T) => T && !Pa(T),
|
|
2644
2646
|
label: "Matches regex",
|
|
2645
2647
|
size: "small",
|
|
2646
2648
|
disabled: d,
|
|
@@ -2648,11 +2650,11 @@ function Be({
|
|
|
2648
2650
|
error: !!w
|
|
2649
2651
|
}
|
|
2650
2652
|
),
|
|
2651
|
-
/* @__PURE__ */ e(
|
|
2653
|
+
/* @__PURE__ */ e(te, { error: !!w, children: w ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
|
|
2652
2654
|
] })
|
|
2653
2655
|
] });
|
|
2654
2656
|
}
|
|
2655
|
-
function
|
|
2657
|
+
function St({
|
|
2656
2658
|
max: t = !0,
|
|
2657
2659
|
min: a = !0,
|
|
2658
2660
|
disabled: r
|
|
@@ -2660,9 +2662,9 @@ function Nt({
|
|
|
2660
2662
|
const {
|
|
2661
2663
|
values: i,
|
|
2662
2664
|
handleChange: s
|
|
2663
|
-
} =
|
|
2665
|
+
} = K(), o = "validation.min", l = "validation.max";
|
|
2664
2666
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2665
|
-
/* @__PURE__ */ e(
|
|
2667
|
+
/* @__PURE__ */ e(Ee, { disabled: r }),
|
|
2666
2668
|
a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2667
2669
|
G,
|
|
2668
2670
|
{
|
|
@@ -2689,17 +2691,17 @@ function Nt({
|
|
|
2689
2691
|
) })
|
|
2690
2692
|
] });
|
|
2691
2693
|
}
|
|
2692
|
-
function
|
|
2694
|
+
function ze({
|
|
2693
2695
|
children: t
|
|
2694
2696
|
}) {
|
|
2695
2697
|
return /* @__PURE__ */ e(
|
|
2696
|
-
|
|
2698
|
+
xt,
|
|
2697
2699
|
{
|
|
2698
2700
|
initiallyExpanded: !1,
|
|
2699
2701
|
asField: !0,
|
|
2700
2702
|
className: "p-4",
|
|
2701
2703
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2702
|
-
/* @__PURE__ */ e(
|
|
2704
|
+
/* @__PURE__ */ e(Na, {}),
|
|
2703
2705
|
/* @__PURE__ */ e(
|
|
2704
2706
|
P,
|
|
2705
2707
|
{
|
|
@@ -2713,7 +2715,7 @@ function Ae({
|
|
|
2713
2715
|
}
|
|
2714
2716
|
);
|
|
2715
2717
|
}
|
|
2716
|
-
function
|
|
2718
|
+
function It({
|
|
2717
2719
|
multiselect: t,
|
|
2718
2720
|
updateIds: a,
|
|
2719
2721
|
disabled: r,
|
|
@@ -2728,10 +2730,10 @@ function Ft({
|
|
|
2728
2730
|
touched: u,
|
|
2729
2731
|
setFieldError: c,
|
|
2730
2732
|
setFieldValue: p
|
|
2731
|
-
} =
|
|
2733
|
+
} = K(), g = Qe(), f = t ? "of.enumValues" : "enumValues", y = N(l, "defaultValue"), k = N(l, f), _ = $t(() => !k || typeof k == "boolean" ? [] : Sa(k) ?? [], [k]);
|
|
2732
2734
|
return /* @__PURE__ */ n(B, { children: [
|
|
2733
2735
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2734
|
-
|
|
2736
|
+
wi,
|
|
2735
2737
|
{
|
|
2736
2738
|
enumValues: _,
|
|
2737
2739
|
updateIds: a,
|
|
@@ -2752,15 +2754,15 @@ function Ft({
|
|
|
2752
2754
|
}
|
|
2753
2755
|
}
|
|
2754
2756
|
) }),
|
|
2755
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2757
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
|
|
2756
2758
|
!t && /* @__PURE__ */ e(
|
|
2757
|
-
|
|
2759
|
+
Me,
|
|
2758
2760
|
{
|
|
2759
2761
|
disabled: r,
|
|
2760
2762
|
showErrors: i
|
|
2761
2763
|
}
|
|
2762
2764
|
),
|
|
2763
|
-
t && /* @__PURE__ */ e(
|
|
2765
|
+
t && /* @__PURE__ */ e(St, { disabled: r })
|
|
2764
2766
|
] }) }),
|
|
2765
2767
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2766
2768
|
je,
|
|
@@ -2773,7 +2775,7 @@ function Ft({
|
|
|
2773
2775
|
label: "Default value",
|
|
2774
2776
|
value: y ?? "",
|
|
2775
2777
|
children: _.filter((h) => !!h?.id).map((h) => /* @__PURE__ */ e(
|
|
2776
|
-
|
|
2778
|
+
we,
|
|
2777
2779
|
{
|
|
2778
2780
|
value: h.id?.toString(),
|
|
2779
2781
|
children: h.label
|
|
@@ -2784,14 +2786,14 @@ function Ft({
|
|
|
2784
2786
|
) })
|
|
2785
2787
|
] });
|
|
2786
2788
|
}
|
|
2787
|
-
const
|
|
2789
|
+
const ot = {
|
|
2788
2790
|
"image/*": "Images",
|
|
2789
2791
|
"video/*": "Videos",
|
|
2790
2792
|
"audio/*": "Audio files",
|
|
2791
2793
|
"application/*": "Files (pdf, zip, csv, excel...)",
|
|
2792
2794
|
"text/*": "Text files"
|
|
2793
2795
|
};
|
|
2794
|
-
function
|
|
2796
|
+
function Et({
|
|
2795
2797
|
multiple: t,
|
|
2796
2798
|
existing: a,
|
|
2797
2799
|
disabled: r
|
|
@@ -2799,15 +2801,15 @@ function It({
|
|
|
2799
2801
|
const {
|
|
2800
2802
|
values: i,
|
|
2801
2803
|
setFieldValue: s
|
|
2802
|
-
} =
|
|
2803
|
-
h ? h.includes("all") || h.length >= Object.keys(
|
|
2804
|
+
} = K(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, d = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, c = N(i, d) ?? "{rand}_{file}", p = N(i, m) ?? "/", g = N(i, l), f = Array.isArray(g) ? g : void 0, y = !f || f.length === 0, k = (h) => {
|
|
2805
|
+
h ? h.includes("all") || h.length >= Object.keys(ot).length ? s(l, void 0) : y ? s(l, Object.keys(ot).filter((w) => !h.includes(w))) : s(l, h) : s(l, void 0);
|
|
2804
2806
|
}, _ = typeof c == "function", O = typeof p == "function";
|
|
2805
2807
|
return /* @__PURE__ */ n(B, { children: [
|
|
2806
2808
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2807
|
-
|
|
2809
|
+
xt,
|
|
2808
2810
|
{
|
|
2809
2811
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2810
|
-
/* @__PURE__ */ e(
|
|
2812
|
+
/* @__PURE__ */ e(qa, {}),
|
|
2811
2813
|
/* @__PURE__ */ e(
|
|
2812
2814
|
P,
|
|
2813
2815
|
{
|
|
@@ -2819,27 +2821,27 @@ function It({
|
|
|
2819
2821
|
] }),
|
|
2820
2822
|
children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
|
|
2821
2823
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2822
|
-
|
|
2824
|
+
Aa,
|
|
2823
2825
|
{
|
|
2824
2826
|
disabled: r,
|
|
2825
2827
|
name: l,
|
|
2826
2828
|
value: f ?? [],
|
|
2827
2829
|
onMultiValueChange: k,
|
|
2828
2830
|
label: y ? void 0 : "Allowed file types",
|
|
2829
|
-
renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((w) =>
|
|
2831
|
+
renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((w) => ot[w]).filter((w) => !!w).join(", "),
|
|
2830
2832
|
children: [
|
|
2831
|
-
/* @__PURE__ */ n(
|
|
2833
|
+
/* @__PURE__ */ n(qt, { value: "all", className: "flex items-center gap-2", children: [
|
|
2832
2834
|
/* @__PURE__ */ e(
|
|
2833
|
-
|
|
2835
|
+
At,
|
|
2834
2836
|
{
|
|
2835
2837
|
checked: !f
|
|
2836
2838
|
}
|
|
2837
2839
|
),
|
|
2838
2840
|
"All"
|
|
2839
2841
|
] }, "all"),
|
|
2840
|
-
Object.entries(
|
|
2842
|
+
Object.entries(ot).map(([h, w]) => /* @__PURE__ */ n(qt, { value: h, className: "flex items-center gap-2", children: [
|
|
2841
2843
|
/* @__PURE__ */ e(
|
|
2842
|
-
|
|
2844
|
+
At,
|
|
2843
2845
|
{
|
|
2844
2846
|
checked: y || f.indexOf(h) > -1
|
|
2845
2847
|
}
|
|
@@ -2859,7 +2861,7 @@ function It({
|
|
|
2859
2861
|
}
|
|
2860
2862
|
) }),
|
|
2861
2863
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2862
|
-
|
|
2864
|
+
be,
|
|
2863
2865
|
{
|
|
2864
2866
|
name: d,
|
|
2865
2867
|
as: G,
|
|
@@ -2871,7 +2873,7 @@ function It({
|
|
|
2871
2873
|
) }),
|
|
2872
2874
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2873
2875
|
/* @__PURE__ */ e(
|
|
2874
|
-
|
|
2876
|
+
be,
|
|
2875
2877
|
{
|
|
2876
2878
|
name: m,
|
|
2877
2879
|
as: G,
|
|
@@ -2894,7 +2896,7 @@ function It({
|
|
|
2894
2896
|
] })
|
|
2895
2897
|
] }),
|
|
2896
2898
|
/* @__PURE__ */ e(
|
|
2897
|
-
|
|
2899
|
+
be,
|
|
2898
2900
|
{
|
|
2899
2901
|
type: "checkbox",
|
|
2900
2902
|
name: u,
|
|
@@ -2909,33 +2911,33 @@ function It({
|
|
|
2909
2911
|
] })
|
|
2910
2912
|
}
|
|
2911
2913
|
) }),
|
|
2912
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2913
|
-
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(
|
|
2914
|
-
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2914
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
|
|
2915
|
+
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ee, { disabled: r }) }),
|
|
2916
|
+
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(St, { disabled: r }) })
|
|
2915
2917
|
] }) })
|
|
2916
2918
|
] });
|
|
2917
2919
|
}
|
|
2918
|
-
function
|
|
2919
|
-
if (
|
|
2920
|
+
function He(t) {
|
|
2921
|
+
if (se(t) || se(t))
|
|
2920
2922
|
return !1;
|
|
2921
2923
|
{
|
|
2922
2924
|
const a = t;
|
|
2923
2925
|
return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
|
|
2924
2926
|
}
|
|
2925
2927
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return Object.entries(t).filter(([a, r]) =>
|
|
2928
|
+
function Pi(t) {
|
|
2929
|
+
return Object.entries(t).filter(([a, r]) => He(r)).map(([a, r]) => {
|
|
2928
2930
|
const i = r;
|
|
2929
|
-
if (
|
|
2931
|
+
if (He(i))
|
|
2930
2932
|
return i.dataType === "map" && i.properties ? {
|
|
2931
2933
|
[a]: {
|
|
2932
2934
|
...i,
|
|
2933
|
-
properties:
|
|
2935
|
+
properties: Pi(i.properties)
|
|
2934
2936
|
}
|
|
2935
2937
|
} : { [a]: i };
|
|
2936
2938
|
}).filter((a) => !!a).reduce((a, r) => ({ ...a, ...r }), {});
|
|
2937
2939
|
}
|
|
2938
|
-
function
|
|
2940
|
+
function oa({
|
|
2939
2941
|
property: t,
|
|
2940
2942
|
onClick: a,
|
|
2941
2943
|
hasError: r,
|
|
@@ -2943,28 +2945,28 @@ function ra({
|
|
|
2943
2945
|
includeEditButton: s,
|
|
2944
2946
|
selected: o
|
|
2945
2947
|
}) {
|
|
2946
|
-
const { fields: l } =
|
|
2947
|
-
return /* @__PURE__ */ e(
|
|
2948
|
+
const { fields: l } = Ae(), d = We(t, l), m = !He(t);
|
|
2949
|
+
return /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ n(
|
|
2948
2950
|
"div",
|
|
2949
2951
|
{
|
|
2950
2952
|
onClick: a,
|
|
2951
2953
|
className: "flex flex-row w-full cursor-pointer",
|
|
2952
2954
|
children: [
|
|
2953
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(
|
|
2955
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ze, { propertyConfig: d }) }),
|
|
2954
2956
|
/* @__PURE__ */ n(
|
|
2955
|
-
|
|
2957
|
+
Se,
|
|
2956
2958
|
{
|
|
2957
|
-
className:
|
|
2959
|
+
className: xe(
|
|
2958
2960
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
2959
|
-
|
|
2960
|
-
a ?
|
|
2961
|
+
Gt,
|
|
2962
|
+
a ? Jt : "",
|
|
2961
2963
|
o ? Qt : "",
|
|
2962
2964
|
"flex-grow p-4 border transition-colors duration-200",
|
|
2963
2965
|
r ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
|
|
2964
2966
|
),
|
|
2965
2967
|
children: [
|
|
2966
2968
|
/* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
|
|
2967
|
-
i && /* @__PURE__ */ e(
|
|
2969
|
+
i && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
2968
2970
|
P,
|
|
2969
2971
|
{
|
|
2970
2972
|
variant: "body1",
|
|
@@ -2974,7 +2976,7 @@ function ra({
|
|
|
2974
2976
|
}
|
|
2975
2977
|
) }),
|
|
2976
2978
|
/* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
|
|
2977
|
-
/* @__PURE__ */ e(
|
|
2979
|
+
/* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
2978
2980
|
P,
|
|
2979
2981
|
{
|
|
2980
2982
|
className: "flex-grow pr-2",
|
|
@@ -2984,7 +2986,7 @@ function ra({
|
|
|
2984
2986
|
children: d?.name
|
|
2985
2987
|
}
|
|
2986
2988
|
) }),
|
|
2987
|
-
/* @__PURE__ */ e(
|
|
2989
|
+
/* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
2988
2990
|
P,
|
|
2989
2991
|
{
|
|
2990
2992
|
variant: "body2",
|
|
@@ -2997,7 +2999,7 @@ function ra({
|
|
|
2997
2999
|
"div",
|
|
2998
3000
|
{
|
|
2999
3001
|
className: "text-xs h-3 ml-0.5",
|
|
3000
|
-
children: /* @__PURE__ */ e(
|
|
3002
|
+
children: /* @__PURE__ */ e(Wt, { color: "disabled" })
|
|
3001
3003
|
}
|
|
3002
3004
|
)
|
|
3003
3005
|
] })
|
|
@@ -3010,13 +3012,13 @@ function ra({
|
|
|
3010
3012
|
}
|
|
3011
3013
|
) });
|
|
3012
3014
|
}
|
|
3013
|
-
function
|
|
3015
|
+
function Ni({
|
|
3014
3016
|
name: t,
|
|
3015
3017
|
selected: a,
|
|
3016
3018
|
onClick: r,
|
|
3017
3019
|
property: i
|
|
3018
3020
|
}) {
|
|
3019
|
-
const { fields: s } =
|
|
3021
|
+
const { fields: s } = Ae(), o = !se(i) && i ? We(i, s) : void 0;
|
|
3020
3022
|
return /* @__PURE__ */ n(
|
|
3021
3023
|
"div",
|
|
3022
3024
|
{
|
|
@@ -3024,23 +3026,23 @@ function ki({
|
|
|
3024
3026
|
className: "flex flex-row w-full cursor-pointer",
|
|
3025
3027
|
children: [
|
|
3026
3028
|
/* @__PURE__ */ n("div", { className: "relative m-4", children: [
|
|
3027
|
-
o && /* @__PURE__ */ e(
|
|
3029
|
+
o && /* @__PURE__ */ e(Ze, { propertyConfig: o }),
|
|
3028
3030
|
!o && /* @__PURE__ */ e(
|
|
3029
3031
|
"div",
|
|
3030
3032
|
{
|
|
3031
3033
|
className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
|
|
3032
|
-
children: /* @__PURE__ */ e(
|
|
3034
|
+
children: /* @__PURE__ */ e(za, { color: "inherit", size: "medium" })
|
|
3033
3035
|
}
|
|
3034
3036
|
),
|
|
3035
|
-
/* @__PURE__ */ e(
|
|
3037
|
+
/* @__PURE__ */ e(Wt, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
3036
3038
|
] }),
|
|
3037
3039
|
/* @__PURE__ */ e(
|
|
3038
|
-
|
|
3040
|
+
Se,
|
|
3039
3041
|
{
|
|
3040
|
-
className:
|
|
3042
|
+
className: xe(
|
|
3041
3043
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
3042
|
-
|
|
3043
|
-
r ?
|
|
3044
|
+
Gt,
|
|
3045
|
+
r ? Jt : "",
|
|
3044
3046
|
a ? Qt : "",
|
|
3045
3047
|
"flex-grow p-4 border transition-colors duration-200",
|
|
3046
3048
|
a ? "border-blue-500" : "border-transparent"
|
|
@@ -3066,7 +3068,7 @@ function ki({
|
|
|
3066
3068
|
children: o?.name
|
|
3067
3069
|
}
|
|
3068
3070
|
),
|
|
3069
|
-
i && !
|
|
3071
|
+
i && !se(i) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3070
3072
|
P,
|
|
3071
3073
|
{
|
|
3072
3074
|
variant: "body2",
|
|
@@ -3075,7 +3077,7 @@ function ki({
|
|
|
3075
3077
|
children: i.dataType
|
|
3076
3078
|
}
|
|
3077
3079
|
) }),
|
|
3078
|
-
i &&
|
|
3080
|
+
i && se(i) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3079
3081
|
P,
|
|
3080
3082
|
{
|
|
3081
3083
|
variant: "body2",
|
|
@@ -3084,7 +3086,7 @@ function ki({
|
|
|
3084
3086
|
children: "This property is defined as a property builder in code"
|
|
3085
3087
|
}
|
|
3086
3088
|
) }),
|
|
3087
|
-
!i && /* @__PURE__ */ e(
|
|
3089
|
+
!i && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3088
3090
|
P,
|
|
3089
3091
|
{
|
|
3090
3092
|
variant: "body2",
|
|
@@ -3101,7 +3103,7 @@ function ki({
|
|
|
3101
3103
|
}
|
|
3102
3104
|
);
|
|
3103
3105
|
}
|
|
3104
|
-
function
|
|
3106
|
+
function gt({
|
|
3105
3107
|
namespace: t,
|
|
3106
3108
|
selectedPropertyKey: a,
|
|
3107
3109
|
onPropertyClick: r,
|
|
@@ -3115,13 +3117,13 @@ function mt({
|
|
|
3115
3117
|
inferredPropertyKeys: c,
|
|
3116
3118
|
collectionEditable: p
|
|
3117
3119
|
}) {
|
|
3118
|
-
const g = s ?? Object.keys(i), f =
|
|
3120
|
+
const g = s ?? Object.keys(i), f = J((y) => {
|
|
3119
3121
|
if (!y.destination)
|
|
3120
3122
|
return;
|
|
3121
3123
|
const k = y.source.index, _ = y.destination.index, O = Array.from(g), [h] = O.splice(k, 1);
|
|
3122
3124
|
O.splice(_, 0, h), d && d(O, t);
|
|
3123
3125
|
}, [t, d, g]);
|
|
3124
|
-
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
3126
|
+
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(ri, { onDragEnd: f, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${t}`, children: (y, k) => /* @__PURE__ */ n(
|
|
3125
3127
|
"div",
|
|
3126
3128
|
{
|
|
3127
3129
|
...y.droppableProps,
|
|
@@ -3131,12 +3133,12 @@ function mt({
|
|
|
3131
3133
|
g && g.map((_, O) => {
|
|
3132
3134
|
const h = i[_], w = o?.find((b) => b.id === _);
|
|
3133
3135
|
return !h && !w ? (console.warn(`Property ${_} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
3134
|
-
|
|
3136
|
+
ni,
|
|
3135
3137
|
{
|
|
3136
3138
|
draggableId: `array_field_${t}_${_}}`,
|
|
3137
3139
|
index: O,
|
|
3138
|
-
children: (b, v) => /* @__PURE__ */ e(
|
|
3139
|
-
|
|
3140
|
+
children: (b, v) => /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3141
|
+
Si,
|
|
3140
3142
|
{
|
|
3141
3143
|
propertyKey: _,
|
|
3142
3144
|
propertyOrBuilder: h,
|
|
@@ -3161,7 +3163,7 @@ function mt({
|
|
|
3161
3163
|
}
|
|
3162
3164
|
) }) }) });
|
|
3163
3165
|
}
|
|
3164
|
-
function
|
|
3166
|
+
function Si({
|
|
3165
3167
|
propertyKey: t,
|
|
3166
3168
|
namespace: a,
|
|
3167
3169
|
propertyOrBuilder: r,
|
|
@@ -3175,12 +3177,12 @@ function xi({
|
|
|
3175
3177
|
inferredPropertyKeys: c,
|
|
3176
3178
|
collectionEditable: p
|
|
3177
3179
|
}) {
|
|
3178
|
-
const g = c?.includes(a ? `${a}.${t}` : t), f =
|
|
3180
|
+
const g = c?.includes(a ? `${a}.${t}` : t), f = ne(t, a);
|
|
3179
3181
|
let y;
|
|
3180
3182
|
if (typeof r == "object") {
|
|
3181
3183
|
const h = r;
|
|
3182
3184
|
h.dataType === "map" && h.properties && (y = /* @__PURE__ */ e(
|
|
3183
|
-
|
|
3185
|
+
gt,
|
|
3184
3186
|
{
|
|
3185
3187
|
selectedPropertyKey: o,
|
|
3186
3188
|
namespace: f,
|
|
@@ -3194,7 +3196,7 @@ function xi({
|
|
|
3194
3196
|
}
|
|
3195
3197
|
));
|
|
3196
3198
|
}
|
|
3197
|
-
const k = f ? N(l,
|
|
3199
|
+
const k = f ? N(l, ke(f)) : !1, _ = o === f, O = r && (p && !se(r) || He(r));
|
|
3198
3200
|
return /* @__PURE__ */ n(
|
|
3199
3201
|
"div",
|
|
3200
3202
|
{
|
|
@@ -3206,7 +3208,7 @@ function xi({
|
|
|
3206
3208
|
y && /* @__PURE__ */ e(
|
|
3207
3209
|
"div",
|
|
3208
3210
|
{
|
|
3209
|
-
className: "absolute border-l " +
|
|
3211
|
+
className: "absolute border-l " + Ct,
|
|
3210
3212
|
style: {
|
|
3211
3213
|
left: "32px",
|
|
3212
3214
|
top: "64px",
|
|
@@ -3214,8 +3216,8 @@ function xi({
|
|
|
3214
3216
|
}
|
|
3215
3217
|
}
|
|
3216
3218
|
),
|
|
3217
|
-
!
|
|
3218
|
-
|
|
3219
|
+
!se(r) && !i && O ? /* @__PURE__ */ e(
|
|
3220
|
+
oa,
|
|
3219
3221
|
{
|
|
3220
3222
|
property: r,
|
|
3221
3223
|
onClick: d ? () => d(t, a) : void 0,
|
|
@@ -3224,7 +3226,7 @@ function xi({
|
|
|
3224
3226
|
hasError: k
|
|
3225
3227
|
}
|
|
3226
3228
|
) : /* @__PURE__ */ e(
|
|
3227
|
-
|
|
3229
|
+
Ni,
|
|
3228
3230
|
{
|
|
3229
3231
|
name: t,
|
|
3230
3232
|
property: r,
|
|
@@ -3233,22 +3235,22 @@ function xi({
|
|
|
3233
3235
|
}
|
|
3234
3236
|
),
|
|
3235
3237
|
/* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
3236
|
-
g && /* @__PURE__ */ e(ae, { title: "Inferred property", children: /* @__PURE__ */ e(
|
|
3238
|
+
g && /* @__PURE__ */ e(ae, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
|
|
3237
3239
|
u && /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3238
|
-
|
|
3240
|
+
re,
|
|
3239
3241
|
{
|
|
3240
3242
|
size: "small",
|
|
3241
3243
|
color: "inherit",
|
|
3242
3244
|
onClick: () => u(t, a),
|
|
3243
|
-
children: /* @__PURE__ */ e(
|
|
3245
|
+
children: /* @__PURE__ */ e(Ta, { size: "small" })
|
|
3244
3246
|
}
|
|
3245
3247
|
) }),
|
|
3246
3248
|
m && /* @__PURE__ */ e(ae, { title: "Move", children: /* @__PURE__ */ e(
|
|
3247
|
-
|
|
3249
|
+
re,
|
|
3248
3250
|
{
|
|
3249
3251
|
component: "span",
|
|
3250
3252
|
size: "small",
|
|
3251
|
-
children: /* @__PURE__ */ e(
|
|
3253
|
+
children: /* @__PURE__ */ e(Va, { size: "small" })
|
|
3252
3254
|
}
|
|
3253
3255
|
) })
|
|
3254
3256
|
] }),
|
|
@@ -3257,11 +3259,11 @@ function xi({
|
|
|
3257
3259
|
}
|
|
3258
3260
|
);
|
|
3259
3261
|
}
|
|
3260
|
-
function
|
|
3262
|
+
function qi({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
|
|
3261
3263
|
const {
|
|
3262
3264
|
values: o,
|
|
3263
3265
|
setFieldValue: l
|
|
3264
|
-
} =
|
|
3266
|
+
} = K(), [d, m] = L(!1), [u, c] = L(), [p, g] = L(), f = o.propertiesOrder ?? Object.keys(o.properties ?? {}), y = J(({
|
|
3265
3267
|
id: v,
|
|
3266
3268
|
property: T
|
|
3267
3269
|
}) => {
|
|
@@ -3271,26 +3273,26 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3271
3273
|
...o.properties ?? {},
|
|
3272
3274
|
[v]: T
|
|
3273
3275
|
}, !1), l("propertiesOrder", [...f, v], !1), m(!1);
|
|
3274
|
-
}, [o.properties, f]), k =
|
|
3275
|
-
const
|
|
3276
|
-
if (!
|
|
3276
|
+
}, [o.properties, f]), k = J((v, T) => {
|
|
3277
|
+
const F = v ? ne(v, T) : void 0;
|
|
3278
|
+
if (!F)
|
|
3277
3279
|
throw Error("collection editor miss config");
|
|
3278
|
-
const A =
|
|
3280
|
+
const A = ke(F), S = Ne(T), x = N(o, S) ?? Object.keys(N(o, vi(T)));
|
|
3279
3281
|
l(A, void 0, !1), l(S, x.filter((C) => C !== v), !1), m(!1), c(void 0), g(void 0);
|
|
3280
|
-
}, [l, o]), _ = u ?
|
|
3282
|
+
}, [l, o]), _ = u ? ne(u, p) : void 0, O = _ ? N(o.properties, _.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
|
|
3281
3283
|
E,
|
|
3282
3284
|
{
|
|
3283
3285
|
color: "primary",
|
|
3284
3286
|
variant: "outlined",
|
|
3285
3287
|
onClick: () => m(!0),
|
|
3286
|
-
startIcon: /* @__PURE__ */ e(
|
|
3288
|
+
startIcon: /* @__PURE__ */ e(qe, {}),
|
|
3287
3289
|
children: [
|
|
3288
3290
|
"Add property to ",
|
|
3289
3291
|
o.name ?? "this group"
|
|
3290
3292
|
]
|
|
3291
3293
|
}
|
|
3292
|
-
), w = !f || f.length < 1, b =
|
|
3293
|
-
l(
|
|
3294
|
+
), w = !f || f.length < 1, b = J((v, T) => {
|
|
3295
|
+
l(Ne(T), v, !1);
|
|
3294
3296
|
}, []);
|
|
3295
3297
|
return /* @__PURE__ */ n(B, { children: [
|
|
3296
3298
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
@@ -3298,9 +3300,9 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3298
3300
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this group" }),
|
|
3299
3301
|
h
|
|
3300
3302
|
] }),
|
|
3301
|
-
/* @__PURE__ */ n(
|
|
3303
|
+
/* @__PURE__ */ n(Se, { className: "p-2 pl-8", children: [
|
|
3302
3304
|
/* @__PURE__ */ e(
|
|
3303
|
-
|
|
3305
|
+
gt,
|
|
3304
3306
|
{
|
|
3305
3307
|
properties: o.properties ?? {},
|
|
3306
3308
|
propertiesOrder: f,
|
|
@@ -3324,7 +3326,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3324
3326
|
] }),
|
|
3325
3327
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3326
3328
|
/* @__PURE__ */ e(
|
|
3327
|
-
|
|
3329
|
+
Yt,
|
|
3328
3330
|
{
|
|
3329
3331
|
position: "start",
|
|
3330
3332
|
size: "small",
|
|
@@ -3333,7 +3335,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3333
3335
|
value: o.spreadChildren ?? !1
|
|
3334
3336
|
}
|
|
3335
3337
|
),
|
|
3336
|
-
/* @__PURE__ */ e(
|
|
3338
|
+
/* @__PURE__ */ e(te, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
|
|
3337
3339
|
] }),
|
|
3338
3340
|
/* @__PURE__ */ e(
|
|
3339
3341
|
Fe,
|
|
@@ -3364,7 +3366,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3364
3366
|
)
|
|
3365
3367
|
] });
|
|
3366
3368
|
}
|
|
3367
|
-
function
|
|
3369
|
+
function Ai({
|
|
3368
3370
|
showErrors: t,
|
|
3369
3371
|
existing: a,
|
|
3370
3372
|
disabled: r,
|
|
@@ -3373,27 +3375,27 @@ function Oi({
|
|
|
3373
3375
|
customFields: o,
|
|
3374
3376
|
collectionEditable: l
|
|
3375
3377
|
}) {
|
|
3376
|
-
const { fields: d } =
|
|
3378
|
+
const { fields: d } = Ae(), {
|
|
3377
3379
|
values: m,
|
|
3378
3380
|
handleChange: u,
|
|
3379
3381
|
errors: c,
|
|
3380
3382
|
setFieldValue: p,
|
|
3381
3383
|
touched: g
|
|
3382
|
-
} =
|
|
3384
|
+
} = K(), [f, y] = L(!1), k = N(m, "of"), _ = N(g, "of") && N(c, "of"), O = J(({ id: w, property: b, namespace: v }) => {
|
|
3383
3385
|
p("of", b);
|
|
3384
|
-
}, []), h = k &&
|
|
3386
|
+
}, []), h = k && We(k, d);
|
|
3385
3387
|
return /* @__PURE__ */ n(B, { children: [
|
|
3386
3388
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3387
3389
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Repeat component" }),
|
|
3388
3390
|
/* @__PURE__ */ e(
|
|
3389
|
-
|
|
3391
|
+
be,
|
|
3390
3392
|
{
|
|
3391
3393
|
name: "of",
|
|
3392
3394
|
value: k,
|
|
3393
3395
|
validate: (w) => w?.dataType ? void 0 : "You need to specify a repeat field",
|
|
3394
|
-
children: () => /* @__PURE__ */ n(
|
|
3396
|
+
children: () => /* @__PURE__ */ n(Se, { className: "p-2 mt-4", children: [
|
|
3395
3397
|
k && /* @__PURE__ */ e(
|
|
3396
|
-
|
|
3398
|
+
oa,
|
|
3397
3399
|
{
|
|
3398
3400
|
property: k,
|
|
3399
3401
|
onClick: r ? void 0 : () => y(!0),
|
|
@@ -3439,10 +3441,10 @@ function Oi({
|
|
|
3439
3441
|
}
|
|
3440
3442
|
)
|
|
3441
3443
|
] }),
|
|
3442
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3444
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(St, { disabled: r }) }) })
|
|
3443
3445
|
] });
|
|
3444
3446
|
}
|
|
3445
|
-
const
|
|
3447
|
+
const zi = D.forwardRef(
|
|
3446
3448
|
function({
|
|
3447
3449
|
showErrors: a,
|
|
3448
3450
|
disabledId: r,
|
|
@@ -3452,44 +3454,44 @@ const Pi = R.forwardRef(
|
|
|
3452
3454
|
}, l) {
|
|
3453
3455
|
const {
|
|
3454
3456
|
errors: d
|
|
3455
|
-
} =
|
|
3457
|
+
} = K(), m = "name", u = a && N(d, m), c = "id", p = a && N(d, c), g = "description", f = a && N(d, g);
|
|
3456
3458
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
3457
3459
|
/* @__PURE__ */ n("div", { children: [
|
|
3458
3460
|
/* @__PURE__ */ e(
|
|
3459
|
-
|
|
3461
|
+
be,
|
|
3460
3462
|
{
|
|
3461
3463
|
inputRef: l,
|
|
3462
3464
|
name: m,
|
|
3463
3465
|
as: G,
|
|
3464
3466
|
style: { fontSize: 20 },
|
|
3465
|
-
validate:
|
|
3467
|
+
validate: ji,
|
|
3466
3468
|
placeholder: "Field name",
|
|
3467
3469
|
required: !0,
|
|
3468
3470
|
disabled: s,
|
|
3469
3471
|
error: !!u
|
|
3470
3472
|
}
|
|
3471
3473
|
),
|
|
3472
|
-
/* @__PURE__ */ e(
|
|
3474
|
+
/* @__PURE__ */ e(te, { error: !!u, children: u })
|
|
3473
3475
|
] }),
|
|
3474
3476
|
/* @__PURE__ */ n("div", { children: [
|
|
3475
3477
|
/* @__PURE__ */ e(
|
|
3476
|
-
|
|
3478
|
+
be,
|
|
3477
3479
|
{
|
|
3478
3480
|
name: c,
|
|
3479
3481
|
as: Ve,
|
|
3480
3482
|
label: "ID",
|
|
3481
|
-
validate: (y) =>
|
|
3483
|
+
validate: (y) => Vi(y, i),
|
|
3482
3484
|
disabled: r || s,
|
|
3483
3485
|
required: !0,
|
|
3484
3486
|
size: "small",
|
|
3485
3487
|
error: !!p
|
|
3486
3488
|
}
|
|
3487
3489
|
),
|
|
3488
|
-
/* @__PURE__ */ e(
|
|
3490
|
+
/* @__PURE__ */ e(te, { error: !!p, children: p })
|
|
3489
3491
|
] }),
|
|
3490
3492
|
/* @__PURE__ */ n("div", { children: [
|
|
3491
3493
|
/* @__PURE__ */ e(
|
|
3492
|
-
|
|
3494
|
+
be,
|
|
3493
3495
|
{
|
|
3494
3496
|
name: g,
|
|
3495
3497
|
as: G,
|
|
@@ -3498,29 +3500,29 @@ const Pi = R.forwardRef(
|
|
|
3498
3500
|
error: !!f
|
|
3499
3501
|
}
|
|
3500
3502
|
),
|
|
3501
|
-
/* @__PURE__ */ e(
|
|
3503
|
+
/* @__PURE__ */ e(te, { error: !!f, children: f })
|
|
3502
3504
|
] })
|
|
3503
3505
|
] });
|
|
3504
3506
|
}
|
|
3505
|
-
),
|
|
3506
|
-
function
|
|
3507
|
+
), Ti = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
3508
|
+
function Vi(t, a) {
|
|
3507
3509
|
let r;
|
|
3508
|
-
return t || (r = "You must specify an id for the field"), t && !t.match(
|
|
3510
|
+
return t || (r = "You must specify an id for the field"), t && !t.match(Ti) && (r = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (r = "There is another field with this ID already"), r;
|
|
3509
3511
|
}
|
|
3510
|
-
function
|
|
3512
|
+
function ji(t) {
|
|
3511
3513
|
let a;
|
|
3512
3514
|
return t || (a = "You must specify a title for the field"), a;
|
|
3513
3515
|
}
|
|
3514
|
-
function
|
|
3516
|
+
function Fi({
|
|
3515
3517
|
widgetId: t,
|
|
3516
3518
|
disabled: a,
|
|
3517
3519
|
showErrors: r
|
|
3518
3520
|
}) {
|
|
3519
|
-
const { values: i, setFieldValue: s } =
|
|
3521
|
+
const { values: i, setFieldValue: s } = K();
|
|
3520
3522
|
return /* @__PURE__ */ n(B, { children: [
|
|
3521
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
3523
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
|
|
3522
3524
|
t === "text_field" && /* @__PURE__ */ e(
|
|
3523
|
-
|
|
3525
|
+
Me,
|
|
3524
3526
|
{
|
|
3525
3527
|
disabled: a,
|
|
3526
3528
|
length: !0,
|
|
@@ -3534,7 +3536,7 @@ function Ai({
|
|
|
3534
3536
|
}
|
|
3535
3537
|
),
|
|
3536
3538
|
t === "multiline" && /* @__PURE__ */ e(
|
|
3537
|
-
|
|
3539
|
+
Me,
|
|
3538
3540
|
{
|
|
3539
3541
|
disabled: a,
|
|
3540
3542
|
length: !0,
|
|
@@ -3547,7 +3549,7 @@ function Ai({
|
|
|
3547
3549
|
}
|
|
3548
3550
|
),
|
|
3549
3551
|
t === "markdown" && /* @__PURE__ */ e(
|
|
3550
|
-
|
|
3552
|
+
Me,
|
|
3551
3553
|
{
|
|
3552
3554
|
disabled: a,
|
|
3553
3555
|
length: !0,
|
|
@@ -3560,7 +3562,7 @@ function Ai({
|
|
|
3560
3562
|
}
|
|
3561
3563
|
),
|
|
3562
3564
|
t === "url" && /* @__PURE__ */ e(
|
|
3563
|
-
|
|
3565
|
+
Me,
|
|
3564
3566
|
{
|
|
3565
3567
|
disabled: a,
|
|
3566
3568
|
max: !0,
|
|
@@ -3570,7 +3572,7 @@ function Ai({
|
|
|
3570
3572
|
}
|
|
3571
3573
|
),
|
|
3572
3574
|
t === "email" && /* @__PURE__ */ e(
|
|
3573
|
-
|
|
3575
|
+
Me,
|
|
3574
3576
|
{
|
|
3575
3577
|
disabled: a,
|
|
3576
3578
|
max: !0,
|
|
@@ -3594,12 +3596,12 @@ function Ai({
|
|
|
3594
3596
|
) })
|
|
3595
3597
|
] });
|
|
3596
3598
|
}
|
|
3597
|
-
function
|
|
3598
|
-
const { values: a } =
|
|
3599
|
+
function Ii({ disabled: t }) {
|
|
3600
|
+
const { values: a } = K(), r = N(a, "defaultValue");
|
|
3599
3601
|
return /* @__PURE__ */ n(B, { children: [
|
|
3600
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3602
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
|
|
3601
3603
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3602
|
-
|
|
3604
|
+
le,
|
|
3603
3605
|
{
|
|
3604
3606
|
type: "checkbox",
|
|
3605
3607
|
name: "defaultValue",
|
|
@@ -3611,11 +3613,11 @@ function zi({ disabled: t }) {
|
|
|
3611
3613
|
) })
|
|
3612
3614
|
] });
|
|
3613
3615
|
}
|
|
3614
|
-
function
|
|
3616
|
+
function Ei({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
|
|
3615
3617
|
const {
|
|
3616
3618
|
values: o,
|
|
3617
3619
|
setFieldValue: l
|
|
3618
|
-
} =
|
|
3620
|
+
} = K(), [d, m] = L(!1), [u, c] = L(), [p, g] = L(), f = J(({
|
|
3619
3621
|
id: w,
|
|
3620
3622
|
property: b
|
|
3621
3623
|
}) => {
|
|
@@ -3625,27 +3627,27 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3625
3627
|
...o.oneOf?.properties ?? {},
|
|
3626
3628
|
[w]: b
|
|
3627
3629
|
}, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w], !1), m(!1);
|
|
3628
|
-
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ?
|
|
3629
|
-
const v = w ?
|
|
3630
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? ne(u, p) : void 0, k = y ? N(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, _ = J((w, b) => {
|
|
3631
|
+
const v = w ? ne(w, b) : void 0;
|
|
3630
3632
|
if (!v)
|
|
3631
3633
|
throw Error("collection editor miss config");
|
|
3632
|
-
l(`oneOf.${
|
|
3633
|
-
const T = `oneOf.${
|
|
3634
|
-
l(T,
|
|
3634
|
+
l(`oneOf.${ke(v)}`, void 0, !1);
|
|
3635
|
+
const T = `oneOf.${Ne(b)}`, F = N(o, T);
|
|
3636
|
+
l(T, F.filter((A) => A !== w), !1), m(!1), c(void 0), g(void 0);
|
|
3635
3637
|
}, [l, o]), O = /* @__PURE__ */ n(
|
|
3636
3638
|
E,
|
|
3637
3639
|
{
|
|
3638
3640
|
autoFocus: !0,
|
|
3639
3641
|
color: "primary",
|
|
3640
3642
|
onClick: () => m(!0),
|
|
3641
|
-
startIcon: /* @__PURE__ */ e(
|
|
3643
|
+
startIcon: /* @__PURE__ */ e(qe, {}),
|
|
3642
3644
|
children: [
|
|
3643
3645
|
"Add property to ",
|
|
3644
3646
|
o.name ?? "this block"
|
|
3645
3647
|
]
|
|
3646
3648
|
}
|
|
3647
|
-
), h =
|
|
3648
|
-
l(`oneOf.${
|
|
3649
|
+
), h = J((w, b) => {
|
|
3650
|
+
l(`oneOf.${Ne(b)}`, w, !1);
|
|
3649
3651
|
}, []);
|
|
3650
3652
|
return /* @__PURE__ */ n(B, { children: [
|
|
3651
3653
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
@@ -3653,9 +3655,9 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3653
3655
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this block" }),
|
|
3654
3656
|
O
|
|
3655
3657
|
] }),
|
|
3656
|
-
/* @__PURE__ */ n(
|
|
3658
|
+
/* @__PURE__ */ n(Se, { className: "p-2 pl-8", children: [
|
|
3657
3659
|
/* @__PURE__ */ e(
|
|
3658
|
-
|
|
3660
|
+
gt,
|
|
3659
3661
|
{
|
|
3660
3662
|
properties: o.oneOf?.properties ?? {},
|
|
3661
3663
|
propertiesOrder: o.oneOf?.propertiesOrder,
|
|
@@ -3699,13 +3701,13 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3699
3701
|
)
|
|
3700
3702
|
] });
|
|
3701
3703
|
}
|
|
3702
|
-
function
|
|
3704
|
+
function Bi({ disabled: t }) {
|
|
3703
3705
|
const {
|
|
3704
3706
|
values: a,
|
|
3705
3707
|
handleChange: r
|
|
3706
|
-
} =
|
|
3708
|
+
} = K(), i = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", d = "validation.positive", m = "validation.negative", u = "validation.integer";
|
|
3707
3709
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
3708
|
-
/* @__PURE__ */ e(
|
|
3710
|
+
/* @__PURE__ */ e(Ee, { disabled: t }),
|
|
3709
3711
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3710
3712
|
G,
|
|
3711
3713
|
{
|
|
@@ -3755,7 +3757,7 @@ function Vi({ disabled: t }) {
|
|
|
3755
3757
|
}
|
|
3756
3758
|
) }),
|
|
3757
3759
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3758
|
-
|
|
3760
|
+
le,
|
|
3759
3761
|
{
|
|
3760
3762
|
type: "checkbox",
|
|
3761
3763
|
name: d,
|
|
@@ -3765,7 +3767,7 @@ function Vi({ disabled: t }) {
|
|
|
3765
3767
|
}
|
|
3766
3768
|
) }),
|
|
3767
3769
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3768
|
-
|
|
3770
|
+
le,
|
|
3769
3771
|
{
|
|
3770
3772
|
type: "checkbox",
|
|
3771
3773
|
name: m,
|
|
@@ -3775,7 +3777,7 @@ function Vi({ disabled: t }) {
|
|
|
3775
3777
|
}
|
|
3776
3778
|
) }),
|
|
3777
3779
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3778
|
-
|
|
3780
|
+
le,
|
|
3779
3781
|
{
|
|
3780
3782
|
type: "checkbox",
|
|
3781
3783
|
name: u,
|
|
@@ -3786,10 +3788,10 @@ function Vi({ disabled: t }) {
|
|
|
3786
3788
|
) })
|
|
3787
3789
|
] });
|
|
3788
3790
|
}
|
|
3789
|
-
function
|
|
3790
|
-
const { values: a, setFieldValue: r } =
|
|
3791
|
+
function Mi({ disabled: t }) {
|
|
3792
|
+
const { values: a, setFieldValue: r } = K();
|
|
3791
3793
|
return /* @__PURE__ */ n(B, { children: [
|
|
3792
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3794
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Bi, { disabled: t }) }) }),
|
|
3793
3795
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3794
3796
|
Ve,
|
|
3795
3797
|
{
|
|
@@ -3805,7 +3807,7 @@ function ji({ disabled: t }) {
|
|
|
3805
3807
|
) })
|
|
3806
3808
|
] });
|
|
3807
3809
|
}
|
|
3808
|
-
function
|
|
3810
|
+
function Bt({
|
|
3809
3811
|
existing: t,
|
|
3810
3812
|
multiple: a,
|
|
3811
3813
|
disabled: r,
|
|
@@ -3818,31 +3820,31 @@ function Et({
|
|
|
3818
3820
|
touched: d,
|
|
3819
3821
|
setFieldError: m,
|
|
3820
3822
|
setFieldValue: u
|
|
3821
|
-
} =
|
|
3822
|
-
if (!
|
|
3823
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3823
|
+
} = K();
|
|
3824
|
+
if (!Ue())
|
|
3825
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Je, {}) });
|
|
3824
3826
|
const p = a ? "of.path" : "path", g = N(s, p), f = i && N(l, p);
|
|
3825
3827
|
return console.log("pathError", l, f), /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3826
|
-
|
|
3828
|
+
be,
|
|
3827
3829
|
{
|
|
3828
3830
|
required: !0,
|
|
3829
3831
|
name: p,
|
|
3830
3832
|
pathPath: p,
|
|
3831
3833
|
type: "select",
|
|
3832
|
-
validate:
|
|
3834
|
+
validate: Di,
|
|
3833
3835
|
disabled: t || r,
|
|
3834
3836
|
value: g,
|
|
3835
3837
|
error: f,
|
|
3836
3838
|
handleChange: o,
|
|
3837
|
-
component:
|
|
3839
|
+
component: Ri
|
|
3838
3840
|
}
|
|
3839
3841
|
) }) });
|
|
3840
3842
|
}
|
|
3841
|
-
function
|
|
3843
|
+
function Di(t) {
|
|
3842
3844
|
let a;
|
|
3843
3845
|
return t || (a = "You must specify a target collection for the field"), a;
|
|
3844
3846
|
}
|
|
3845
|
-
function
|
|
3847
|
+
function Ri({
|
|
3846
3848
|
disabled: t,
|
|
3847
3849
|
pathPath: a,
|
|
3848
3850
|
value: r,
|
|
@@ -3851,9 +3853,9 @@ function Ii({
|
|
|
3851
3853
|
...o
|
|
3852
3854
|
}) {
|
|
3853
3855
|
console.log("error", s);
|
|
3854
|
-
const l =
|
|
3856
|
+
const l = Ue();
|
|
3855
3857
|
if (!l)
|
|
3856
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3858
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Je, {}) });
|
|
3857
3859
|
const d = l?.collections ?? [], m = Array.from(new Set(
|
|
3858
3860
|
Object.values(d).map((c) => c.group).filter(Boolean)
|
|
3859
3861
|
).values()), u = d.filter((c) => !c.group);
|
|
@@ -3872,7 +3874,7 @@ function Ii({
|
|
|
3872
3874
|
const p = d.find((f) => f.alias === c || f.path === c);
|
|
3873
3875
|
if (!p)
|
|
3874
3876
|
return null;
|
|
3875
|
-
const g =
|
|
3877
|
+
const g = lt(p);
|
|
3876
3878
|
return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3877
3879
|
g,
|
|
3878
3880
|
/* @__PURE__ */ e(
|
|
@@ -3888,13 +3890,13 @@ function Ii({
|
|
|
3888
3890
|
...o,
|
|
3889
3891
|
children: [
|
|
3890
3892
|
m.flatMap((c) => /* @__PURE__ */ e(
|
|
3891
|
-
|
|
3893
|
+
zt,
|
|
3892
3894
|
{
|
|
3893
3895
|
label: c || "Views",
|
|
3894
3896
|
children: d.filter((p) => p.group === c).map((p) => {
|
|
3895
|
-
const g =
|
|
3897
|
+
const g = lt(p);
|
|
3896
3898
|
return /* @__PURE__ */ e(
|
|
3897
|
-
|
|
3899
|
+
we,
|
|
3898
3900
|
{
|
|
3899
3901
|
value: p.alias ?? p.path,
|
|
3900
3902
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
@@ -3915,10 +3917,10 @@ function Ii({
|
|
|
3915
3917
|
},
|
|
3916
3918
|
`group_${c}`
|
|
3917
3919
|
)),
|
|
3918
|
-
u && /* @__PURE__ */ e(
|
|
3919
|
-
const p =
|
|
3920
|
+
u && /* @__PURE__ */ e(zt, { label: "Views", children: u.map((c) => {
|
|
3921
|
+
const p = lt(c);
|
|
3920
3922
|
return /* @__PURE__ */ e(
|
|
3921
|
-
|
|
3923
|
+
we,
|
|
3922
3924
|
{
|
|
3923
3925
|
value: c.alias ?? c.path,
|
|
3924
3926
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
@@ -3939,16 +3941,16 @@ function Ii({
|
|
|
3939
3941
|
]
|
|
3940
3942
|
}
|
|
3941
3943
|
),
|
|
3942
|
-
/* @__PURE__ */ e(
|
|
3944
|
+
/* @__PURE__ */ e(te, { children: "You can only edit the reference collection upon field creation." })
|
|
3943
3945
|
] });
|
|
3944
3946
|
}
|
|
3945
|
-
function
|
|
3947
|
+
function Ui({ disabled: t }) {
|
|
3946
3948
|
const {
|
|
3947
3949
|
values: a,
|
|
3948
3950
|
errors: r,
|
|
3949
3951
|
touched: i,
|
|
3950
3952
|
setFieldValue: s
|
|
3951
|
-
} =
|
|
3953
|
+
} = K(), o = "mode", l = N(a, o), d = N(i, o) && N(r, o), m = "autoValue", u = N(a, m), c = N(i, m) && N(r, m);
|
|
3952
3954
|
return /* @__PURE__ */ n(B, { children: [
|
|
3953
3955
|
/* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
|
|
3954
3956
|
/* @__PURE__ */ n(
|
|
@@ -3971,12 +3973,12 @@ function Ei({ disabled: t }) {
|
|
|
3971
3973
|
},
|
|
3972
3974
|
disabled: t,
|
|
3973
3975
|
children: [
|
|
3974
|
-
/* @__PURE__ */ e(
|
|
3975
|
-
/* @__PURE__ */ e(
|
|
3976
|
+
/* @__PURE__ */ e(we, { value: "date_time", children: " Date/Time " }),
|
|
3977
|
+
/* @__PURE__ */ e(we, { value: "date", children: " Date " })
|
|
3976
3978
|
]
|
|
3977
3979
|
}
|
|
3978
3980
|
),
|
|
3979
|
-
/* @__PURE__ */ e(
|
|
3981
|
+
/* @__PURE__ */ e(te, { error: !!d, children: d }),
|
|
3980
3982
|
/* @__PURE__ */ n(
|
|
3981
3983
|
je,
|
|
3982
3984
|
{
|
|
@@ -3997,21 +3999,21 @@ function Ei({ disabled: t }) {
|
|
|
3997
3999
|
error: !!c,
|
|
3998
4000
|
label: "Automatic value",
|
|
3999
4001
|
children: [
|
|
4000
|
-
/* @__PURE__ */ e(
|
|
4001
|
-
/* @__PURE__ */ e(
|
|
4002
|
-
/* @__PURE__ */ e(
|
|
4002
|
+
/* @__PURE__ */ e(we, { value: "", children: " None " }),
|
|
4003
|
+
/* @__PURE__ */ e(we, { value: "on_create", children: " On create " }),
|
|
4004
|
+
/* @__PURE__ */ e(we, { value: "on_update", children: " On any update " })
|
|
4003
4005
|
]
|
|
4004
4006
|
}
|
|
4005
4007
|
),
|
|
4006
|
-
/* @__PURE__ */ e(
|
|
4008
|
+
/* @__PURE__ */ e(te, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
|
|
4007
4009
|
] }),
|
|
4008
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4010
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
|
|
4009
4011
|
] });
|
|
4010
4012
|
}
|
|
4011
|
-
function
|
|
4012
|
-
return
|
|
4013
|
+
function $i({ disabled: t }) {
|
|
4014
|
+
return K(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
4013
4015
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4014
|
-
|
|
4016
|
+
le,
|
|
4015
4017
|
{
|
|
4016
4018
|
type: "checkbox",
|
|
4017
4019
|
name: "hideFromCollection",
|
|
@@ -4022,7 +4024,7 @@ function Bi({ disabled: t }) {
|
|
|
4022
4024
|
}
|
|
4023
4025
|
) }),
|
|
4024
4026
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4025
|
-
|
|
4027
|
+
le,
|
|
4026
4028
|
{
|
|
4027
4029
|
type: "checkbox",
|
|
4028
4030
|
name: "readOnly",
|
|
@@ -4034,10 +4036,10 @@ function Bi({ disabled: t }) {
|
|
|
4034
4036
|
) })
|
|
4035
4037
|
] });
|
|
4036
4038
|
}
|
|
4037
|
-
function
|
|
4038
|
-
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4039
|
+
function Li({ disabled: t }) {
|
|
4040
|
+
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }) });
|
|
4039
4041
|
}
|
|
4040
|
-
function
|
|
4042
|
+
function na(t, a, r) {
|
|
4041
4043
|
let i;
|
|
4042
4044
|
return a === "text_field" ? i = $(
|
|
4043
4045
|
t,
|
|
@@ -4246,9 +4248,9 @@ function oa(t, a, r) {
|
|
|
4246
4248
|
}
|
|
4247
4249
|
) : a && r[a] && (i = { ...r[a].property, propertyConfig: a }), i;
|
|
4248
4250
|
}
|
|
4249
|
-
function
|
|
4251
|
+
function sa({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
|
|
4250
4252
|
return /* @__PURE__ */ e(
|
|
4251
|
-
|
|
4253
|
+
we,
|
|
4252
4254
|
{
|
|
4253
4255
|
value: t,
|
|
4254
4256
|
disabled: a,
|
|
@@ -4256,12 +4258,12 @@ function na({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
|
|
|
4256
4258
|
children: /* @__PURE__ */ n(
|
|
4257
4259
|
"div",
|
|
4258
4260
|
{
|
|
4259
|
-
className:
|
|
4261
|
+
className: xe(
|
|
4260
4262
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
4261
4263
|
a ? "w-full" : ""
|
|
4262
4264
|
),
|
|
4263
4265
|
children: [
|
|
4264
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
4266
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ze, { propertyConfig: r }) }),
|
|
4265
4267
|
/* @__PURE__ */ n("div", { children: [
|
|
4266
4268
|
/* @__PURE__ */ e("div", { children: r.name }),
|
|
4267
4269
|
/* @__PURE__ */ e(
|
|
@@ -4280,7 +4282,7 @@ function na({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
|
|
|
4280
4282
|
}
|
|
4281
4283
|
);
|
|
4282
4284
|
}
|
|
4283
|
-
const
|
|
4285
|
+
const la = D.memo(
|
|
4284
4286
|
function({
|
|
4285
4287
|
includeIdAndName: a = !0,
|
|
4286
4288
|
autoOpenTypeSelect: r,
|
|
@@ -4306,9 +4308,9 @@ const sa = R.memo(
|
|
|
4306
4308
|
const v = {
|
|
4307
4309
|
id: "",
|
|
4308
4310
|
name: ""
|
|
4309
|
-
}, T = !!(m && !
|
|
4311
|
+
}, T = !!(m && !He(m)) && !b;
|
|
4310
4312
|
console.log("PropertyForm disabled", T);
|
|
4311
|
-
const
|
|
4313
|
+
const F = Ye(m ? {
|
|
4312
4314
|
id: l,
|
|
4313
4315
|
previousId: l,
|
|
4314
4316
|
property: m
|
|
@@ -4318,14 +4320,14 @@ const sa = R.memo(
|
|
|
4318
4320
|
}) => {
|
|
4319
4321
|
const C = {
|
|
4320
4322
|
id: S,
|
|
4321
|
-
previousId:
|
|
4323
|
+
previousId: F.current?.id,
|
|
4322
4324
|
property: x,
|
|
4323
4325
|
namespace: d
|
|
4324
4326
|
};
|
|
4325
|
-
|
|
4327
|
+
F.current = C, u?.(C);
|
|
4326
4328
|
};
|
|
4327
4329
|
return /* @__PURE__ */ e(
|
|
4328
|
-
|
|
4330
|
+
Pt,
|
|
4329
4331
|
{
|
|
4330
4332
|
initialErrors: f,
|
|
4331
4333
|
initialValues: m ? { id: l, ...m } : v,
|
|
@@ -4340,10 +4342,10 @@ const sa = R.memo(
|
|
|
4340
4342
|
property: { ...j, editable: j.editable ?? !0 }
|
|
4341
4343
|
}), i || x.resetForm({ values: v });
|
|
4342
4344
|
},
|
|
4343
|
-
children: (S) => (
|
|
4345
|
+
children: (S) => (de(() => {
|
|
4344
4346
|
O?.(S);
|
|
4345
4347
|
}, [S]), /* @__PURE__ */ e(
|
|
4346
|
-
|
|
4348
|
+
Ki,
|
|
4347
4349
|
{
|
|
4348
4350
|
onPropertyChanged: c ? A : void 0,
|
|
4349
4351
|
onDelete: p,
|
|
@@ -4379,16 +4381,16 @@ function Fe({
|
|
|
4379
4381
|
collectionEditable: o,
|
|
4380
4382
|
...l
|
|
4381
4383
|
}) {
|
|
4382
|
-
const d =
|
|
4384
|
+
const d = Ye();
|
|
4383
4385
|
return /* @__PURE__ */ n(
|
|
4384
|
-
|
|
4386
|
+
Ie,
|
|
4385
4387
|
{
|
|
4386
4388
|
open: t ?? !1,
|
|
4387
4389
|
maxWidth: "xl",
|
|
4388
4390
|
fullWidth: !0,
|
|
4389
4391
|
children: [
|
|
4390
|
-
/* @__PURE__ */ e(
|
|
4391
|
-
|
|
4392
|
+
/* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
|
|
4393
|
+
la,
|
|
4392
4394
|
{
|
|
4393
4395
|
...l,
|
|
4394
4396
|
onPropertyChanged: (u) => {
|
|
@@ -4402,7 +4404,7 @@ function Fe({
|
|
|
4402
4404
|
getData: s
|
|
4403
4405
|
}
|
|
4404
4406
|
) }),
|
|
4405
|
-
/* @__PURE__ */ n(
|
|
4407
|
+
/* @__PURE__ */ n(Re, { children: [
|
|
4406
4408
|
a && /* @__PURE__ */ e(
|
|
4407
4409
|
E,
|
|
4408
4410
|
{
|
|
@@ -4427,7 +4429,7 @@ function Fe({
|
|
|
4427
4429
|
}
|
|
4428
4430
|
);
|
|
4429
4431
|
}
|
|
4430
|
-
function
|
|
4432
|
+
function Ki({
|
|
4431
4433
|
values: t,
|
|
4432
4434
|
errors: a,
|
|
4433
4435
|
touched: r,
|
|
@@ -4450,39 +4452,39 @@ function Di({
|
|
|
4450
4452
|
customFields: w,
|
|
4451
4453
|
collectionEditable: b
|
|
4452
4454
|
}) {
|
|
4453
|
-
const [v, T] =
|
|
4454
|
-
|
|
4455
|
-
!N(r,
|
|
4456
|
-
}, [l, r, t?.name]),
|
|
4457
|
-
if (u && (!m ||
|
|
4455
|
+
const [v, T] = L(d), [F, A] = L(!1), [S, x] = L(t?.dataType ? Zt(t) : void 0), C = Object.entries(kt).concat(Object.entries(w)), j = k ? C.filter(([Q, ee]) => !se(ee.property) && ee.property?.dataType !== "array") : C, Z = fa(t), q = Ye(null), M = Ye(t), he = "id", Ce = f && N(a, "selectedWidget");
|
|
4456
|
+
de(() => {
|
|
4457
|
+
!N(r, he) && l && t?.name && s(he, Ht(t.name));
|
|
4458
|
+
}, [l, r, t?.name]), de(() => {
|
|
4459
|
+
if (u && (!m || Z.id)) {
|
|
4458
4460
|
const {
|
|
4459
|
-
id:
|
|
4460
|
-
...
|
|
4461
|
-
} =
|
|
4462
|
-
|
|
4463
|
-
id:
|
|
4464
|
-
property:
|
|
4461
|
+
id: Q,
|
|
4462
|
+
...ee
|
|
4463
|
+
} = Z;
|
|
4464
|
+
mt(Z, M.current) || (u({
|
|
4465
|
+
id: Q,
|
|
4466
|
+
property: ee,
|
|
4465
4467
|
namespace: p
|
|
4466
|
-
}),
|
|
4468
|
+
}), M.current = Z);
|
|
4467
4469
|
}
|
|
4468
|
-
}, [
|
|
4470
|
+
}, [Z, m, u, p]), de(() => {
|
|
4469
4471
|
t?.id && g && Object.keys(a).length > 0 && g(t?.id, p, a);
|
|
4470
4472
|
}, [a, g, p, t?.id]);
|
|
4471
|
-
const
|
|
4472
|
-
x(
|
|
4473
|
+
const ie = (Q) => {
|
|
4474
|
+
x(Q), i(na(t, Q, w)), setTimeout(() => {
|
|
4473
4475
|
q.current?.focus();
|
|
4474
4476
|
}, 0);
|
|
4475
4477
|
};
|
|
4476
|
-
let
|
|
4477
|
-
return S === "text_field" || S === "multiline" || S === "markdown" || S === "url" || S === "email" ?
|
|
4478
|
-
|
|
4478
|
+
let R;
|
|
4479
|
+
return S === "text_field" || S === "multiline" || S === "markdown" || S === "url" || S === "email" ? R = /* @__PURE__ */ e(
|
|
4480
|
+
Fi,
|
|
4479
4481
|
{
|
|
4480
4482
|
widgetId: S,
|
|
4481
4483
|
disabled: y,
|
|
4482
4484
|
showErrors: f
|
|
4483
4485
|
}
|
|
4484
|
-
) : S === "select" || S === "number_select" ?
|
|
4485
|
-
|
|
4486
|
+
) : S === "select" || S === "number_select" ? R = /* @__PURE__ */ e(
|
|
4487
|
+
It,
|
|
4486
4488
|
{
|
|
4487
4489
|
multiselect: !1,
|
|
4488
4490
|
allowDataInference: h,
|
|
@@ -4491,8 +4493,8 @@ function Di({
|
|
|
4491
4493
|
getData: O,
|
|
4492
4494
|
showErrors: f
|
|
4493
4495
|
}
|
|
4494
|
-
) : S === "multi_select" || S === "multi_number_select" ?
|
|
4495
|
-
|
|
4496
|
+
) : S === "multi_select" || S === "multi_number_select" ? R = /* @__PURE__ */ e(
|
|
4497
|
+
It,
|
|
4496
4498
|
{
|
|
4497
4499
|
multiselect: !0,
|
|
4498
4500
|
updateIds: !o,
|
|
@@ -4501,22 +4503,22 @@ function Di({
|
|
|
4501
4503
|
getData: O,
|
|
4502
4504
|
showErrors: f
|
|
4503
4505
|
}
|
|
4504
|
-
) : S === "file_upload" ?
|
|
4505
|
-
|
|
4506
|
+
) : S === "file_upload" ? R = /* @__PURE__ */ e(
|
|
4507
|
+
Et,
|
|
4506
4508
|
{
|
|
4507
4509
|
existing: o,
|
|
4508
4510
|
multiple: !1,
|
|
4509
4511
|
disabled: y
|
|
4510
4512
|
}
|
|
4511
|
-
) : S === "multi_file_upload" ?
|
|
4512
|
-
|
|
4513
|
+
) : S === "multi_file_upload" ? R = /* @__PURE__ */ e(
|
|
4514
|
+
Et,
|
|
4513
4515
|
{
|
|
4514
4516
|
existing: o,
|
|
4515
4517
|
multiple: !0,
|
|
4516
4518
|
disabled: y
|
|
4517
4519
|
}
|
|
4518
|
-
) : S === "switch" ?
|
|
4519
|
-
|
|
4520
|
+
) : S === "switch" ? R = /* @__PURE__ */ e(Ii, { disabled: y }) : S === "number_input" ? R = /* @__PURE__ */ e(Mi, { disabled: y }) : S === "group" ? R = /* @__PURE__ */ e(
|
|
4521
|
+
qi,
|
|
4520
4522
|
{
|
|
4521
4523
|
disabled: y,
|
|
4522
4524
|
getData: O,
|
|
@@ -4524,8 +4526,8 @@ function Di({
|
|
|
4524
4526
|
collectionEditable: b,
|
|
4525
4527
|
customFields: w
|
|
4526
4528
|
}
|
|
4527
|
-
) : S === "block" ?
|
|
4528
|
-
|
|
4529
|
+
) : S === "block" ? R = /* @__PURE__ */ e(
|
|
4530
|
+
Ei,
|
|
4529
4531
|
{
|
|
4530
4532
|
disabled: y,
|
|
4531
4533
|
getData: O,
|
|
@@ -4533,24 +4535,24 @@ function Di({
|
|
|
4533
4535
|
collectionEditable: b,
|
|
4534
4536
|
customFields: w
|
|
4535
4537
|
}
|
|
4536
|
-
) : S === "reference" ?
|
|
4537
|
-
|
|
4538
|
+
) : S === "reference" ? R = /* @__PURE__ */ e(
|
|
4539
|
+
Bt,
|
|
4538
4540
|
{
|
|
4539
4541
|
showErrors: f,
|
|
4540
4542
|
existing: o,
|
|
4541
4543
|
multiple: !1,
|
|
4542
4544
|
disabled: y
|
|
4543
4545
|
}
|
|
4544
|
-
) : S === "date_time" ?
|
|
4545
|
-
|
|
4546
|
+
) : S === "date_time" ? R = /* @__PURE__ */ e(Ui, { disabled: y }) : S === "multi_references" ? R = /* @__PURE__ */ e(
|
|
4547
|
+
Bt,
|
|
4546
4548
|
{
|
|
4547
4549
|
showErrors: f,
|
|
4548
4550
|
existing: o,
|
|
4549
4551
|
multiple: !0,
|
|
4550
4552
|
disabled: y
|
|
4551
4553
|
}
|
|
4552
|
-
) : S === "repeat" ?
|
|
4553
|
-
|
|
4554
|
+
) : S === "repeat" ? R = /* @__PURE__ */ e(
|
|
4555
|
+
Ai,
|
|
4554
4556
|
{
|
|
4555
4557
|
showErrors: f,
|
|
4556
4558
|
existing: o,
|
|
@@ -4560,8 +4562,8 @@ function Di({
|
|
|
4560
4562
|
collectionEditable: b,
|
|
4561
4563
|
customFields: w
|
|
4562
4564
|
}
|
|
4563
|
-
) : S === "key_value" ?
|
|
4564
|
-
y && /* @__PURE__ */ n(
|
|
4565
|
+
) : S === "key_value" ? R = /* @__PURE__ */ e(Li, { disabled: y }) : R = null, /* @__PURE__ */ n(B, { children: [
|
|
4566
|
+
y && /* @__PURE__ */ n(Xt, { mode: "warn", children: [
|
|
4565
4567
|
/* @__PURE__ */ e(P, { children: "This property can't be edited" }),
|
|
4566
4568
|
/* @__PURE__ */ n(P, { variant: "caption", children: [
|
|
4567
4569
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
@@ -4575,37 +4577,37 @@ function Di({
|
|
|
4575
4577
|
je,
|
|
4576
4578
|
{
|
|
4577
4579
|
className: "w-full",
|
|
4578
|
-
error: !!
|
|
4580
|
+
error: !!Ce,
|
|
4579
4581
|
value: S ?? "",
|
|
4580
4582
|
placeholder: "Select a property widget",
|
|
4581
4583
|
open: v,
|
|
4582
4584
|
onOpenChange: T,
|
|
4583
4585
|
position: "item-aligned",
|
|
4584
4586
|
disabled: y,
|
|
4585
|
-
renderValue: (
|
|
4586
|
-
if (!
|
|
4587
|
+
renderValue: (Q) => {
|
|
4588
|
+
if (!Q)
|
|
4587
4589
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
4588
|
-
const
|
|
4590
|
+
const ee = Q, pe = kt[ee] ?? w[ee], me = pe.property, ge = me && !se(me) ? We(me, w) : void 0, fe = se(me) || o && me.dataType !== t?.dataType, X = ge ? $(ge, pe) : pe;
|
|
4589
4591
|
return /* @__PURE__ */ n(
|
|
4590
4592
|
"div",
|
|
4591
4593
|
{
|
|
4592
|
-
onClick: (
|
|
4593
|
-
|
|
4594
|
+
onClick: (Oe) => {
|
|
4595
|
+
fe && (Oe.stopPropagation(), Oe.preventDefault());
|
|
4594
4596
|
},
|
|
4595
|
-
className:
|
|
4597
|
+
className: xe(
|
|
4596
4598
|
"flex items-center",
|
|
4597
|
-
|
|
4599
|
+
fe ? "w-full pointer-events-none opacity-50" : ""
|
|
4598
4600
|
),
|
|
4599
4601
|
children: [
|
|
4600
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
4602
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ze, { propertyConfig: X }) }),
|
|
4601
4603
|
/* @__PURE__ */ n("div", { className: "flex flex-col items-start text-base text-left", children: [
|
|
4602
|
-
/* @__PURE__ */ e("div", { children:
|
|
4604
|
+
/* @__PURE__ */ e("div", { children: X.name }),
|
|
4603
4605
|
/* @__PURE__ */ e(
|
|
4604
4606
|
P,
|
|
4605
4607
|
{
|
|
4606
4608
|
variant: "caption",
|
|
4607
4609
|
color: "disabled",
|
|
4608
|
-
children:
|
|
4610
|
+
children: fe ? "You can only switch to widgets that use the same data type" : X.description
|
|
4609
4611
|
}
|
|
4610
4612
|
)
|
|
4611
4613
|
] })
|
|
@@ -4613,25 +4615,25 @@ function Di({
|
|
|
4613
4615
|
}
|
|
4614
4616
|
);
|
|
4615
4617
|
},
|
|
4616
|
-
onValueChange: (
|
|
4617
|
-
|
|
4618
|
+
onValueChange: (Q) => {
|
|
4619
|
+
ie(Q);
|
|
4618
4620
|
},
|
|
4619
|
-
children: j.map(([
|
|
4620
|
-
const
|
|
4621
|
+
children: j.map(([Q, ee]) => {
|
|
4622
|
+
const pe = ee.property, me = o && !se(pe) && pe.dataType !== t?.dataType;
|
|
4621
4623
|
return /* @__PURE__ */ e(
|
|
4622
|
-
|
|
4624
|
+
sa,
|
|
4623
4625
|
{
|
|
4624
|
-
value:
|
|
4625
|
-
optionDisabled:
|
|
4626
|
-
propertyConfig:
|
|
4626
|
+
value: Q,
|
|
4627
|
+
optionDisabled: me,
|
|
4628
|
+
propertyConfig: ee,
|
|
4627
4629
|
existing: o
|
|
4628
4630
|
},
|
|
4629
|
-
|
|
4631
|
+
Q
|
|
4630
4632
|
);
|
|
4631
4633
|
})
|
|
4632
4634
|
}
|
|
4633
4635
|
),
|
|
4634
|
-
|
|
4636
|
+
Ce && /* @__PURE__ */ e(
|
|
4635
4637
|
P,
|
|
4636
4638
|
{
|
|
4637
4639
|
variant: "caption",
|
|
@@ -4642,19 +4644,19 @@ function Di({
|
|
|
4642
4644
|
)
|
|
4643
4645
|
] }),
|
|
4644
4646
|
c && t?.id && /* @__PURE__ */ e(
|
|
4645
|
-
|
|
4647
|
+
re,
|
|
4646
4648
|
{
|
|
4647
4649
|
variant: "ghost",
|
|
4648
4650
|
className: "m-4",
|
|
4649
4651
|
disabled: y,
|
|
4650
4652
|
onClick: () => A(!0),
|
|
4651
|
-
children: /* @__PURE__ */ e(
|
|
4653
|
+
children: /* @__PURE__ */ e(dt, {})
|
|
4652
4654
|
}
|
|
4653
4655
|
)
|
|
4654
4656
|
] }),
|
|
4655
4657
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
4656
4658
|
m && /* @__PURE__ */ e(
|
|
4657
|
-
|
|
4659
|
+
zi,
|
|
4658
4660
|
{
|
|
4659
4661
|
showErrors: f,
|
|
4660
4662
|
disabledId: o,
|
|
@@ -4664,13 +4666,13 @@ function Di({
|
|
|
4664
4666
|
ref: q
|
|
4665
4667
|
}
|
|
4666
4668
|
),
|
|
4667
|
-
|
|
4668
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4669
|
+
R,
|
|
4670
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($i, { disabled: y }) })
|
|
4669
4671
|
] }),
|
|
4670
4672
|
c && /* @__PURE__ */ e(
|
|
4671
|
-
|
|
4673
|
+
pt,
|
|
4672
4674
|
{
|
|
4673
|
-
open:
|
|
4675
|
+
open: F,
|
|
4674
4676
|
onAccept: () => c(t?.id, p),
|
|
4675
4677
|
onCancel: () => A(!1),
|
|
4676
4678
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
@@ -4683,7 +4685,51 @@ function Di({
|
|
|
4683
4685
|
)
|
|
4684
4686
|
] });
|
|
4685
4687
|
}
|
|
4686
|
-
function
|
|
4688
|
+
function Yi(t) {
|
|
4689
|
+
return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, r) => a + r[0].toUpperCase() + r.substring(1));
|
|
4690
|
+
}
|
|
4691
|
+
function Hi({ collection: t, onOpenChange: a, open: r }) {
|
|
4692
|
+
const i = "const " + Yi(t.name) + "Collection = " + Za.stringify(t, null, " ");
|
|
4693
|
+
return /* @__PURE__ */ n(
|
|
4694
|
+
Ie,
|
|
4695
|
+
{
|
|
4696
|
+
open: r,
|
|
4697
|
+
onOpenChange: a,
|
|
4698
|
+
maxWidth: "4xl",
|
|
4699
|
+
children: [
|
|
4700
|
+
/* @__PURE__ */ n(De, { children: [
|
|
4701
|
+
/* @__PURE__ */ n(P, { variant: "h6", className: "my-4", children: [
|
|
4702
|
+
"Code for ",
|
|
4703
|
+
t.name
|
|
4704
|
+
] }),
|
|
4705
|
+
/* @__PURE__ */ n(P, { variant: "body2", className: "my-4 mb-8", children: [
|
|
4706
|
+
"If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
|
|
4707
|
+
/* @__PURE__ */ e(
|
|
4708
|
+
"a",
|
|
4709
|
+
{
|
|
4710
|
+
rel: "noopener noreferrer",
|
|
4711
|
+
href: "https://firecms.co/docs/customization_quickstart",
|
|
4712
|
+
children: "docs"
|
|
4713
|
+
}
|
|
4714
|
+
),
|
|
4715
|
+
"."
|
|
4716
|
+
] }),
|
|
4717
|
+
/* @__PURE__ */ e(
|
|
4718
|
+
Xa,
|
|
4719
|
+
{
|
|
4720
|
+
theme: ei.vsDark,
|
|
4721
|
+
code: i,
|
|
4722
|
+
language: "typescript",
|
|
4723
|
+
children: ({ className: s, style: o, tokens: l, getLineProps: d, getTokenProps: m }) => /* @__PURE__ */ e("pre", { style: o, className: "p-4 rounded", children: l.map((u, c) => /* @__PURE__ */ e("div", { ...d({ line: u }), children: u.map((p, g) => /* @__PURE__ */ e("span", { ...m({ token: p }) }, g)) }, c)) })
|
|
4724
|
+
}
|
|
4725
|
+
)
|
|
4726
|
+
] }),
|
|
4727
|
+
/* @__PURE__ */ e(Re, { children: /* @__PURE__ */ e(E, { onClick: () => a(!1), children: "Close" }) })
|
|
4728
|
+
]
|
|
4729
|
+
}
|
|
4730
|
+
);
|
|
4731
|
+
}
|
|
4732
|
+
function Gi({
|
|
4687
4733
|
showErrors: t,
|
|
4688
4734
|
isNewCollection: a,
|
|
4689
4735
|
propertyErrorsRef: r,
|
|
@@ -4704,21 +4750,21 @@ function Ri({
|
|
|
4704
4750
|
setFieldTouched: k,
|
|
4705
4751
|
errors: _,
|
|
4706
4752
|
dirty: O
|
|
4707
|
-
} =
|
|
4708
|
-
|
|
4753
|
+
} = K(), h = Qe(), w = ja("lg"), b = !w, [v, T] = L(), [F, A] = L(), [S, x] = L(), C = F ? ne(F, S) : void 0, j = C ? N(g.properties, C.replaceAll(".", ".properties.")) : void 0, [Z, q] = L(!1), [M, he] = L(!1), [Ce, ie] = L(!1), [R, Q] = L([]), ee = D.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
|
|
4754
|
+
de(() => {
|
|
4709
4755
|
s && s(O);
|
|
4710
4756
|
}, [O]);
|
|
4711
|
-
const
|
|
4712
|
-
u && (
|
|
4713
|
-
if (V &&
|
|
4757
|
+
const pe = u ? () => {
|
|
4758
|
+
u && (he(!0), u(g).then((V) => {
|
|
4759
|
+
if (V && ea(V.properties), !V) {
|
|
4714
4760
|
h.open({
|
|
4715
4761
|
type: "error",
|
|
4716
4762
|
message: "Could not infer properties from data"
|
|
4717
4763
|
});
|
|
4718
4764
|
return;
|
|
4719
4765
|
}
|
|
4720
|
-
const
|
|
4721
|
-
if (
|
|
4766
|
+
const I = Object.keys(V.properties).filter((oe) => !g.properties[oe]);
|
|
4767
|
+
if (I.length === 0) {
|
|
4722
4768
|
h.open({
|
|
4723
4769
|
type: "info",
|
|
4724
4770
|
message: "No new properties found"
|
|
@@ -4726,82 +4772,82 @@ function Ri({
|
|
|
4726
4772
|
return;
|
|
4727
4773
|
}
|
|
4728
4774
|
const H = {
|
|
4729
|
-
...
|
|
4775
|
+
...I.reduce((oe, ye) => (oe[ye] = V.properties[ye], oe), {}),
|
|
4730
4776
|
...g.properties
|
|
4731
|
-
},
|
|
4732
|
-
...
|
|
4777
|
+
}, ce = [
|
|
4778
|
+
...I,
|
|
4733
4779
|
...g.propertiesOrder ?? []
|
|
4734
4780
|
];
|
|
4735
|
-
f("properties", H, !1),
|
|
4781
|
+
f("properties", H, !1), ge(ce), Q(I);
|
|
4736
4782
|
}).finally(() => {
|
|
4737
|
-
|
|
4783
|
+
he(!1);
|
|
4738
4784
|
}));
|
|
4739
|
-
} : void 0,
|
|
4740
|
-
const H =
|
|
4741
|
-
f(H, V, !1),
|
|
4742
|
-
},
|
|
4743
|
-
const H = V ?
|
|
4785
|
+
} : void 0, me = (V) => V ? ee.current[V] ?? N(g, Ne(V)) : ee.current[""], ge = (V, I) => {
|
|
4786
|
+
const H = Ne(I);
|
|
4787
|
+
f(H, V, !1), ee.current[I ?? ""] = V;
|
|
4788
|
+
}, fe = (V, I) => {
|
|
4789
|
+
const H = V ? ne(V, I) : void 0;
|
|
4744
4790
|
if (!H)
|
|
4745
4791
|
throw Error("collection editor miss config");
|
|
4746
|
-
f(
|
|
4747
|
-
const
|
|
4748
|
-
|
|
4749
|
-
},
|
|
4750
|
-
f(
|
|
4751
|
-
},
|
|
4792
|
+
f(ke(H), void 0, !1);
|
|
4793
|
+
const oe = me(I).filter((ye) => ye !== V);
|
|
4794
|
+
ge(oe, I), ie(!1), T(void 0), A(void 0), x(void 0);
|
|
4795
|
+
}, X = (V, I) => {
|
|
4796
|
+
f(Ne(I), V, !1);
|
|
4797
|
+
}, Oe = ({
|
|
4752
4798
|
id: V,
|
|
4753
|
-
property:
|
|
4799
|
+
property: I
|
|
4754
4800
|
}) => {
|
|
4755
4801
|
if (console.log("onPropertyCreated", {
|
|
4756
4802
|
id: V,
|
|
4757
|
-
property:
|
|
4803
|
+
property: I
|
|
4758
4804
|
}), !V)
|
|
4759
4805
|
throw Error("Need to include an ID when creating a new property");
|
|
4760
4806
|
f("properties", {
|
|
4761
4807
|
...g.properties ?? {},
|
|
4762
|
-
[V]:
|
|
4808
|
+
[V]: I
|
|
4763
4809
|
}, !1);
|
|
4764
4810
|
const H = [...g.propertiesOrder ?? Object.keys(g.properties), V];
|
|
4765
4811
|
console.log("onPropertyCreated", {
|
|
4766
4812
|
id: V,
|
|
4767
|
-
property:
|
|
4813
|
+
property: I,
|
|
4768
4814
|
newPropertiesOrder: H
|
|
4769
|
-
}),
|
|
4770
|
-
},
|
|
4815
|
+
}), ge(H), ie(!1), w && (T(H.indexOf(V)), A(V)), x(void 0);
|
|
4816
|
+
}, Xe = ({
|
|
4771
4817
|
id: V,
|
|
4772
|
-
property:
|
|
4818
|
+
property: I,
|
|
4773
4819
|
previousId: H,
|
|
4774
|
-
namespace:
|
|
4820
|
+
namespace: ce
|
|
4775
4821
|
}) => {
|
|
4776
|
-
const
|
|
4822
|
+
const oe = V ? ne(V, ce) : void 0, ye = oe ? ke(oe) : void 0;
|
|
4777
4823
|
if (H && H !== V) {
|
|
4778
|
-
const
|
|
4779
|
-
|
|
4824
|
+
const at = ne(H, ce), W = ke(at), ve = me(ce).map((it) => it === H ? V : it).filter((it) => it !== void 0);
|
|
4825
|
+
ge(ve, ce), V && (T(ve.indexOf(V)), A(V)), f(W, void 0, !1), k(W, !1, !1);
|
|
4780
4826
|
}
|
|
4781
|
-
|
|
4782
|
-
},
|
|
4783
|
-
const
|
|
4827
|
+
ye && (f(ye, I, !1), k(ye, !0, !1));
|
|
4828
|
+
}, et = (V, I, H) => {
|
|
4829
|
+
const ce = V ? ne(V, I) : void 0;
|
|
4784
4830
|
if (console.warn("onPropertyErrorInternal", {
|
|
4785
4831
|
id: V,
|
|
4786
|
-
namespace:
|
|
4832
|
+
namespace: I,
|
|
4787
4833
|
error: H,
|
|
4788
|
-
propertyPath:
|
|
4789
|
-
}),
|
|
4790
|
-
const
|
|
4791
|
-
i(V,
|
|
4834
|
+
propertyPath: ce
|
|
4835
|
+
}), ce) {
|
|
4836
|
+
const oe = H && Object.keys(H).length > 0;
|
|
4837
|
+
i(V, I, oe ? H : void 0), y(ke(ce), oe ? "Property error" : void 0);
|
|
4792
4838
|
}
|
|
4793
|
-
},
|
|
4839
|
+
}, z = () => {
|
|
4794
4840
|
T(void 0), A(void 0);
|
|
4795
|
-
},
|
|
4796
|
-
/* @__PURE__ */ n("div", { className:
|
|
4841
|
+
}, Y = F && r?.current?.properties ? r.current.properties[F] : void 0, U = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, Le = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), tt = $t(() => d(g.ownerId), [d, g.ownerId]), Te = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
4842
|
+
/* @__PURE__ */ n("div", { className: xe(
|
|
4797
4843
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
4798
4844
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
4799
|
-
!b && "border-r " +
|
|
4845
|
+
!b && "border-r " + Ct
|
|
4800
4846
|
), children: [
|
|
4801
4847
|
/* @__PURE__ */ n("div", { className: "flex my-2", children: [
|
|
4802
4848
|
/* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
|
|
4803
4849
|
/* @__PURE__ */ e(
|
|
4804
|
-
|
|
4850
|
+
be,
|
|
4805
4851
|
{
|
|
4806
4852
|
name: "name",
|
|
4807
4853
|
as: G,
|
|
@@ -4814,7 +4860,7 @@ function Ri({
|
|
|
4814
4860
|
error: !!_.name
|
|
4815
4861
|
}
|
|
4816
4862
|
),
|
|
4817
|
-
|
|
4863
|
+
tt && /* @__PURE__ */ n(
|
|
4818
4864
|
P,
|
|
4819
4865
|
{
|
|
4820
4866
|
variant: "body2",
|
|
@@ -4822,20 +4868,29 @@ function Ri({
|
|
|
4822
4868
|
color: "secondary",
|
|
4823
4869
|
children: [
|
|
4824
4870
|
"Created by ",
|
|
4825
|
-
|
|
4871
|
+
tt.displayName
|
|
4826
4872
|
]
|
|
4827
4873
|
}
|
|
4828
4874
|
)
|
|
4829
4875
|
] }),
|
|
4830
4876
|
l && /* @__PURE__ */ e("div", { className: "ml-4", children: l }),
|
|
4831
4877
|
/* @__PURE__ */ n("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
|
|
4832
|
-
|
|
4833
|
-
|
|
4878
|
+
/* @__PURE__ */ e(ae, { title: "Get the code of this collection", children: /* @__PURE__ */ e(
|
|
4879
|
+
re,
|
|
4834
4880
|
{
|
|
4835
|
-
variant: "
|
|
4836
|
-
disabled:
|
|
4837
|
-
onClick:
|
|
4838
|
-
children:
|
|
4881
|
+
variant: "filled",
|
|
4882
|
+
disabled: M,
|
|
4883
|
+
onClick: () => q(!0),
|
|
4884
|
+
children: /* @__PURE__ */ e(Fa, {})
|
|
4885
|
+
}
|
|
4886
|
+
) }),
|
|
4887
|
+
pe && /* @__PURE__ */ e(ae, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
4888
|
+
re,
|
|
4889
|
+
{
|
|
4890
|
+
variant: "filled",
|
|
4891
|
+
disabled: M,
|
|
4892
|
+
onClick: pe,
|
|
4893
|
+
children: M ? /* @__PURE__ */ e(Je, { size: "small" }) : /* @__PURE__ */ e(ht, {})
|
|
4839
4894
|
}
|
|
4840
4895
|
) }),
|
|
4841
4896
|
/* @__PURE__ */ e(ae, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
@@ -4843,25 +4898,25 @@ function Ri({
|
|
|
4843
4898
|
{
|
|
4844
4899
|
variant: "outlined",
|
|
4845
4900
|
onClick: () => ie(!0),
|
|
4846
|
-
children: /* @__PURE__ */ e(
|
|
4901
|
+
children: /* @__PURE__ */ e(qe, {})
|
|
4847
4902
|
}
|
|
4848
4903
|
) })
|
|
4849
4904
|
] })
|
|
4850
4905
|
] }),
|
|
4851
|
-
/* @__PURE__ */ e(
|
|
4852
|
-
|
|
4906
|
+
/* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
4907
|
+
gt,
|
|
4853
4908
|
{
|
|
4854
4909
|
className: "pl-8",
|
|
4855
|
-
onPropertyClick: (V,
|
|
4856
|
-
T(
|
|
4910
|
+
onPropertyClick: (V, I) => {
|
|
4911
|
+
T(Le.indexOf(V)), A(V), x(I);
|
|
4857
4912
|
},
|
|
4858
|
-
inferredPropertyKeys:
|
|
4859
|
-
selectedPropertyKey:
|
|
4913
|
+
inferredPropertyKeys: R,
|
|
4914
|
+
selectedPropertyKey: F ? ne(F, S) : void 0,
|
|
4860
4915
|
properties: g.properties,
|
|
4861
4916
|
additionalFields: g.additionalFields,
|
|
4862
|
-
propertiesOrder:
|
|
4863
|
-
onPropertyMove:
|
|
4864
|
-
onPropertyRemove: a ?
|
|
4917
|
+
propertiesOrder: Le,
|
|
4918
|
+
onPropertyMove: X,
|
|
4919
|
+
onPropertyRemove: a ? fe : void 0,
|
|
4865
4920
|
collectionEditable: p,
|
|
4866
4921
|
errors: t ? _ : {}
|
|
4867
4922
|
}
|
|
@@ -4874,40 +4929,40 @@ function Ri({
|
|
|
4874
4929
|
variant: "outlined",
|
|
4875
4930
|
size: "large",
|
|
4876
4931
|
onClick: () => ie(!0),
|
|
4877
|
-
startIcon: /* @__PURE__ */ e(
|
|
4932
|
+
startIcon: /* @__PURE__ */ e(qe, {}),
|
|
4878
4933
|
children: "Add new property"
|
|
4879
4934
|
}
|
|
4880
4935
|
)
|
|
4881
4936
|
] }),
|
|
4882
4937
|
!b && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ n(
|
|
4883
|
-
|
|
4938
|
+
Se,
|
|
4884
4939
|
{
|
|
4885
4940
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
4886
4941
|
children: [
|
|
4887
|
-
C && j && !
|
|
4888
|
-
|
|
4942
|
+
C && j && !se(j) && /* @__PURE__ */ e(
|
|
4943
|
+
la,
|
|
4889
4944
|
{
|
|
4890
4945
|
inArray: !1,
|
|
4891
4946
|
existingProperty: !a,
|
|
4892
4947
|
autoUpdateId: !1,
|
|
4893
4948
|
allowDataInference: !a,
|
|
4894
4949
|
autoOpenTypeSelect: !1,
|
|
4895
|
-
propertyKey:
|
|
4950
|
+
propertyKey: F,
|
|
4896
4951
|
propertyNamespace: S,
|
|
4897
4952
|
property: j,
|
|
4898
|
-
onPropertyChanged:
|
|
4899
|
-
onDelete:
|
|
4900
|
-
onError:
|
|
4953
|
+
onPropertyChanged: Xe,
|
|
4954
|
+
onDelete: fe,
|
|
4955
|
+
onError: et,
|
|
4901
4956
|
forceShowErrors: t,
|
|
4902
|
-
initialErrors:
|
|
4957
|
+
initialErrors: Y,
|
|
4903
4958
|
getData: m,
|
|
4904
4959
|
customFields: c,
|
|
4905
4960
|
collectionEditable: p
|
|
4906
4961
|
},
|
|
4907
4962
|
`edit_view_${v}`
|
|
4908
4963
|
),
|
|
4909
|
-
!j && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center h-full", children:
|
|
4910
|
-
j &&
|
|
4964
|
+
!j && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center h-full", children: U ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
4965
|
+
j && se(j) && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
4911
4966
|
]
|
|
4912
4967
|
}
|
|
4913
4968
|
) }),
|
|
@@ -4920,24 +4975,24 @@ function Ri({
|
|
|
4920
4975
|
allowDataInference: !a,
|
|
4921
4976
|
existingProperty: !0,
|
|
4922
4977
|
autoOpenTypeSelect: !1,
|
|
4923
|
-
propertyKey:
|
|
4978
|
+
propertyKey: F,
|
|
4924
4979
|
propertyNamespace: S,
|
|
4925
4980
|
property: j,
|
|
4926
|
-
onPropertyChanged:
|
|
4927
|
-
onDelete:
|
|
4928
|
-
onError:
|
|
4981
|
+
onPropertyChanged: Xe,
|
|
4982
|
+
onDelete: fe,
|
|
4983
|
+
onError: et,
|
|
4929
4984
|
forceShowErrors: t,
|
|
4930
|
-
initialErrors:
|
|
4985
|
+
initialErrors: Y,
|
|
4931
4986
|
getData: m,
|
|
4932
4987
|
customFields: c,
|
|
4933
4988
|
collectionEditable: p,
|
|
4934
|
-
onOkClicked: b ?
|
|
4989
|
+
onOkClicked: b ? z : void 0
|
|
4935
4990
|
},
|
|
4936
4991
|
`edit_view_${v}`
|
|
4937
4992
|
)
|
|
4938
4993
|
] });
|
|
4939
4994
|
return /* @__PURE__ */ n(B, { children: [
|
|
4940
|
-
|
|
4995
|
+
Te,
|
|
4941
4996
|
/* @__PURE__ */ e(
|
|
4942
4997
|
Fe,
|
|
4943
4998
|
{
|
|
@@ -4946,19 +5001,27 @@ function Ri({
|
|
|
4946
5001
|
autoOpenTypeSelect: !0,
|
|
4947
5002
|
autoUpdateId: !0,
|
|
4948
5003
|
forceShowErrors: t,
|
|
4949
|
-
open:
|
|
5004
|
+
open: Ce,
|
|
4950
5005
|
onCancel: () => ie(!1),
|
|
4951
|
-
onPropertyChanged:
|
|
5006
|
+
onPropertyChanged: Oe,
|
|
4952
5007
|
getData: m,
|
|
4953
5008
|
allowDataInference: !a,
|
|
4954
5009
|
customFields: c,
|
|
4955
5010
|
collectionEditable: p,
|
|
4956
5011
|
existingPropertyKeys: g.propertiesOrder
|
|
4957
5012
|
}
|
|
5013
|
+
),
|
|
5014
|
+
/* @__PURE__ */ e(
|
|
5015
|
+
Hi,
|
|
5016
|
+
{
|
|
5017
|
+
collection: g,
|
|
5018
|
+
open: Z,
|
|
5019
|
+
onOpenChange: q
|
|
5020
|
+
}
|
|
4958
5021
|
)
|
|
4959
5022
|
] });
|
|
4960
5023
|
}
|
|
4961
|
-
function
|
|
5024
|
+
function Ji({
|
|
4962
5025
|
open: t,
|
|
4963
5026
|
handleOk: a,
|
|
4964
5027
|
handleCancel: r,
|
|
@@ -4966,19 +5029,19 @@ function Ui({
|
|
|
4966
5029
|
title: s
|
|
4967
5030
|
}) {
|
|
4968
5031
|
return /* @__PURE__ */ n(
|
|
4969
|
-
|
|
5032
|
+
Ie,
|
|
4970
5033
|
{
|
|
4971
5034
|
open: t,
|
|
4972
5035
|
onOpenChange: (o) => o ? r() : a(),
|
|
4973
5036
|
"aria-labelledby": "alert-dialog-title",
|
|
4974
5037
|
"aria-describedby": "alert-dialog-description",
|
|
4975
5038
|
children: [
|
|
4976
|
-
/* @__PURE__ */ n(
|
|
5039
|
+
/* @__PURE__ */ n(De, { children: [
|
|
4977
5040
|
/* @__PURE__ */ e(P, { variant: "h6", children: s ?? "Unsaved changes" }),
|
|
4978
5041
|
i && /* @__PURE__ */ e(P, { children: i }),
|
|
4979
5042
|
/* @__PURE__ */ e(P, { children: "Are you sure?" })
|
|
4980
5043
|
] }),
|
|
4981
|
-
/* @__PURE__ */ n(
|
|
5044
|
+
/* @__PURE__ */ n(Re, { children: [
|
|
4982
5045
|
/* @__PURE__ */ e(E, { variant: "text", onClick: r, autoFocus: !0, children: " Cancel " }),
|
|
4983
5046
|
/* @__PURE__ */ e(E, { onClick: a, children: " Ok " })
|
|
4984
5047
|
] })
|
|
@@ -4986,15 +5049,15 @@ function Ui({
|
|
|
4986
5049
|
}
|
|
4987
5050
|
);
|
|
4988
5051
|
}
|
|
4989
|
-
function
|
|
4990
|
-
const { entityViews: r } =
|
|
5052
|
+
function Qi({ open: t, onClose: a }) {
|
|
5053
|
+
const { entityViews: r } = Ae();
|
|
4991
5054
|
return /* @__PURE__ */ n(
|
|
4992
|
-
|
|
5055
|
+
Ie,
|
|
4993
5056
|
{
|
|
4994
5057
|
maxWidth: "md",
|
|
4995
5058
|
open: t,
|
|
4996
5059
|
children: [
|
|
4997
|
-
/* @__PURE__ */ n(
|
|
5060
|
+
/* @__PURE__ */ n(De, { children: [
|
|
4998
5061
|
/* @__PURE__ */ e(P, { variant: "h6", children: "Select view" }),
|
|
4999
5062
|
r?.map((i) => /* @__PURE__ */ n(
|
|
5000
5063
|
E,
|
|
@@ -5012,12 +5075,12 @@ function $i({ open: t, onClose: a }) {
|
|
|
5012
5075
|
i.key
|
|
5013
5076
|
))
|
|
5014
5077
|
] }),
|
|
5015
|
-
/* @__PURE__ */ e(
|
|
5078
|
+
/* @__PURE__ */ e(Re, { children: /* @__PURE__ */ e(E, { onClick: () => a(), children: "Cancel" }) })
|
|
5016
5079
|
]
|
|
5017
5080
|
}
|
|
5018
5081
|
);
|
|
5019
5082
|
}
|
|
5020
|
-
function
|
|
5083
|
+
function Wi({
|
|
5021
5084
|
collection: t,
|
|
5022
5085
|
parentCollection: a,
|
|
5023
5086
|
configController: r,
|
|
@@ -5025,19 +5088,19 @@ function Li({
|
|
|
5025
5088
|
getUser: s,
|
|
5026
5089
|
parentPathSegments: o
|
|
5027
5090
|
}) {
|
|
5028
|
-
const { entityViews: l } =
|
|
5091
|
+
const { entityViews: l } = Ae(), [d, m] = D.useState(), [u, c] = D.useState(!1), [p, g] = D.useState(), [f, y] = D.useState(), {
|
|
5029
5092
|
values: k,
|
|
5030
5093
|
setFieldValue: _
|
|
5031
|
-
} =
|
|
5094
|
+
} = K(), O = t.subcollections ?? [], h = k.entityViews?.filter((v) => typeof v == "string").map((v) => Ia(v, l)).filter(Boolean) ?? [], w = t.entityViews?.filter((v) => typeof v != "string") ?? [], b = h.length + w.length;
|
|
5032
5095
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
|
|
5033
|
-
/* @__PURE__ */ e(
|
|
5096
|
+
/* @__PURE__ */ e(ut, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
|
|
5034
5097
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
5035
5098
|
/* @__PURE__ */ n(P, { variant: "h5", children: [
|
|
5036
5099
|
"Subcollections of ",
|
|
5037
5100
|
k.name
|
|
5038
5101
|
] }),
|
|
5039
|
-
O && O.length > 0 && /* @__PURE__ */ e(
|
|
5040
|
-
|
|
5102
|
+
O && O.length > 0 && /* @__PURE__ */ e(Se, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(Vt, { children: O.map((v) => /* @__PURE__ */ n(
|
|
5103
|
+
bt,
|
|
5041
5104
|
{
|
|
5042
5105
|
onClick: () => y({
|
|
5043
5106
|
isNewCollection: !1,
|
|
@@ -5045,25 +5108,25 @@ function Li({
|
|
|
5045
5108
|
}),
|
|
5046
5109
|
children: [
|
|
5047
5110
|
/* @__PURE__ */ e(
|
|
5048
|
-
|
|
5111
|
+
Ke,
|
|
5049
5112
|
{
|
|
5050
5113
|
align: "left",
|
|
5051
5114
|
children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: v.name })
|
|
5052
5115
|
}
|
|
5053
5116
|
),
|
|
5054
5117
|
/* @__PURE__ */ e(
|
|
5055
|
-
|
|
5118
|
+
Ke,
|
|
5056
5119
|
{
|
|
5057
5120
|
align: "right",
|
|
5058
5121
|
children: /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5059
|
-
|
|
5122
|
+
re,
|
|
5060
5123
|
{
|
|
5061
5124
|
size: "small",
|
|
5062
5125
|
onClick: (T) => {
|
|
5063
5126
|
T.preventDefault(), T.stopPropagation(), m(v.path);
|
|
5064
5127
|
},
|
|
5065
5128
|
color: "inherit",
|
|
5066
|
-
children: /* @__PURE__ */ e(
|
|
5129
|
+
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
5067
5130
|
}
|
|
5068
5131
|
) })
|
|
5069
5132
|
}
|
|
@@ -5081,42 +5144,42 @@ function Li({
|
|
|
5081
5144
|
});
|
|
5082
5145
|
},
|
|
5083
5146
|
variant: "outlined",
|
|
5084
|
-
startIcon: /* @__PURE__ */ e(
|
|
5147
|
+
startIcon: /* @__PURE__ */ e(qe, {}),
|
|
5085
5148
|
children: "Add subcollection"
|
|
5086
5149
|
}
|
|
5087
5150
|
)
|
|
5088
5151
|
] }),
|
|
5089
5152
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
5090
5153
|
/* @__PURE__ */ e(P, { variant: "h5", children: "Custom views" }),
|
|
5091
|
-
b > 0 && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
5092
|
-
h.map((v) => /* @__PURE__ */ n(
|
|
5154
|
+
b > 0 && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(Se, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ n(Vt, { children: [
|
|
5155
|
+
h.map((v) => /* @__PURE__ */ n(bt, { children: [
|
|
5093
5156
|
/* @__PURE__ */ e(
|
|
5094
|
-
|
|
5157
|
+
Ke,
|
|
5095
5158
|
{
|
|
5096
5159
|
align: "left",
|
|
5097
5160
|
children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: v.name })
|
|
5098
5161
|
}
|
|
5099
5162
|
),
|
|
5100
5163
|
/* @__PURE__ */ e(
|
|
5101
|
-
|
|
5164
|
+
Ke,
|
|
5102
5165
|
{
|
|
5103
5166
|
align: "right",
|
|
5104
5167
|
children: /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5105
|
-
|
|
5168
|
+
re,
|
|
5106
5169
|
{
|
|
5107
5170
|
size: "small",
|
|
5108
5171
|
onClick: (T) => {
|
|
5109
5172
|
T.preventDefault(), T.stopPropagation(), g(v.key);
|
|
5110
5173
|
},
|
|
5111
5174
|
color: "inherit",
|
|
5112
|
-
children: /* @__PURE__ */ e(
|
|
5175
|
+
children: /* @__PURE__ */ e(dt, { size: "small" })
|
|
5113
5176
|
}
|
|
5114
5177
|
) })
|
|
5115
5178
|
}
|
|
5116
5179
|
)
|
|
5117
5180
|
] }, v.key)),
|
|
5118
|
-
w.map((v) => /* @__PURE__ */ e(
|
|
5119
|
-
|
|
5181
|
+
w.map((v) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ n(
|
|
5182
|
+
Ke,
|
|
5120
5183
|
{
|
|
5121
5184
|
align: "left",
|
|
5122
5185
|
children: [
|
|
@@ -5129,7 +5192,7 @@ function Li({
|
|
|
5129
5192
|
}
|
|
5130
5193
|
) }, v.key))
|
|
5131
5194
|
] }) }) }) }),
|
|
5132
|
-
b === 0 && /* @__PURE__ */ e(
|
|
5195
|
+
b === 0 && /* @__PURE__ */ e(Xt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
|
|
5133
5196
|
/* @__PURE__ */ e(
|
|
5134
5197
|
E,
|
|
5135
5198
|
{
|
|
@@ -5137,14 +5200,14 @@ function Li({
|
|
|
5137
5200
|
c(!0);
|
|
5138
5201
|
},
|
|
5139
5202
|
variant: "outlined",
|
|
5140
|
-
startIcon: /* @__PURE__ */ e(
|
|
5203
|
+
startIcon: /* @__PURE__ */ e(qe, {}),
|
|
5141
5204
|
children: "Add custom entity view"
|
|
5142
5205
|
}
|
|
5143
5206
|
)
|
|
5144
5207
|
] })
|
|
5145
5208
|
] }) }),
|
|
5146
5209
|
d && /* @__PURE__ */ e(
|
|
5147
|
-
|
|
5210
|
+
pt,
|
|
5148
5211
|
{
|
|
5149
5212
|
open: !!d,
|
|
5150
5213
|
onAccept: () => {
|
|
@@ -5163,7 +5226,7 @@ function Li({
|
|
|
5163
5226
|
}
|
|
5164
5227
|
),
|
|
5165
5228
|
p && /* @__PURE__ */ e(
|
|
5166
|
-
|
|
5229
|
+
pt,
|
|
5167
5230
|
{
|
|
5168
5231
|
open: !!p,
|
|
5169
5232
|
onAccept: () => {
|
|
@@ -5179,7 +5242,7 @@ function Li({
|
|
|
5179
5242
|
}
|
|
5180
5243
|
),
|
|
5181
5244
|
/* @__PURE__ */ e(
|
|
5182
|
-
|
|
5245
|
+
da,
|
|
5183
5246
|
{
|
|
5184
5247
|
open: !!f,
|
|
5185
5248
|
configController: r,
|
|
@@ -5195,7 +5258,7 @@ function Li({
|
|
|
5195
5258
|
}
|
|
5196
5259
|
),
|
|
5197
5260
|
/* @__PURE__ */ e(
|
|
5198
|
-
|
|
5261
|
+
Qi,
|
|
5199
5262
|
{
|
|
5200
5263
|
open: u,
|
|
5201
5264
|
onClose: (v) => {
|
|
@@ -5205,7 +5268,7 @@ function Li({
|
|
|
5205
5268
|
)
|
|
5206
5269
|
] });
|
|
5207
5270
|
}
|
|
5208
|
-
const
|
|
5271
|
+
const Mt = {
|
|
5209
5272
|
path: "products",
|
|
5210
5273
|
name: "Products",
|
|
5211
5274
|
singularName: "Product",
|
|
@@ -5290,7 +5353,7 @@ const Bt = {
|
|
|
5290
5353
|
autoValue: "on_create"
|
|
5291
5354
|
}
|
|
5292
5355
|
}
|
|
5293
|
-
},
|
|
5356
|
+
}, Dt = {
|
|
5294
5357
|
path: "blog",
|
|
5295
5358
|
name: "Blog",
|
|
5296
5359
|
singularName: "Blog entry",
|
|
@@ -5402,7 +5465,7 @@ const Bt = {
|
|
|
5402
5465
|
initialFilter: {
|
|
5403
5466
|
status: ["==", "published"]
|
|
5404
5467
|
}
|
|
5405
|
-
},
|
|
5468
|
+
}, Rt = {
|
|
5406
5469
|
path: "users",
|
|
5407
5470
|
name: "Users",
|
|
5408
5471
|
singularName: "User",
|
|
@@ -5434,15 +5497,15 @@ const Bt = {
|
|
|
5434
5497
|
}
|
|
5435
5498
|
}
|
|
5436
5499
|
};
|
|
5437
|
-
function
|
|
5500
|
+
function Zi({
|
|
5438
5501
|
path: t,
|
|
5439
5502
|
pathSuggestions: a,
|
|
5440
5503
|
parentCollection: r,
|
|
5441
5504
|
onContinue: i,
|
|
5442
5505
|
collections: s
|
|
5443
5506
|
}) {
|
|
5444
|
-
const [o, l] =
|
|
5445
|
-
|
|
5507
|
+
const [o, l] = L(!1), [d, m] = L();
|
|
5508
|
+
de(() => {
|
|
5446
5509
|
a && s && (l(!0), a(t).then((h) => {
|
|
5447
5510
|
const w = h.filter((b) => !s.find((v) => v.path.trim().toLowerCase() === b.trim().toLowerCase()));
|
|
5448
5511
|
m(w);
|
|
@@ -5458,8 +5521,8 @@ function Ki({
|
|
|
5458
5521
|
setFieldTouched: k,
|
|
5459
5522
|
isSubmitting: _,
|
|
5460
5523
|
submitCount: O
|
|
5461
|
-
} =
|
|
5462
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(
|
|
5524
|
+
} = K();
|
|
5525
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ut, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5463
5526
|
/* @__PURE__ */ e(
|
|
5464
5527
|
"div",
|
|
5465
5528
|
{
|
|
@@ -5467,7 +5530,7 @@ function Ki({
|
|
|
5467
5530
|
children: /* @__PURE__ */ e(P, { variant: "h4", className: "flex-grow", children: "New collection" })
|
|
5468
5531
|
}
|
|
5469
5532
|
),
|
|
5470
|
-
r && /* @__PURE__ */ e(
|
|
5533
|
+
r && /* @__PURE__ */ e(ct, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
|
|
5471
5534
|
"This is a subcollection of ",
|
|
5472
5535
|
/* @__PURE__ */ e("b", { children: r.name })
|
|
5473
5536
|
] }) }),
|
|
@@ -5481,13 +5544,13 @@ function Ki({
|
|
|
5481
5544
|
}
|
|
5482
5545
|
),
|
|
5483
5546
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
5484
|
-
o && !d && /* @__PURE__ */ e(
|
|
5547
|
+
o && !d && /* @__PURE__ */ e(Je, { size: "small" }),
|
|
5485
5548
|
d?.map((h, w) => /* @__PURE__ */ e(
|
|
5486
|
-
|
|
5549
|
+
ct,
|
|
5487
5550
|
{
|
|
5488
5551
|
colorScheme: "cyanLighter",
|
|
5489
5552
|
onClick: () => {
|
|
5490
|
-
c("name",
|
|
5553
|
+
c("name", Ot(h)), c("path", h), c("properties", void 0), i();
|
|
5491
5554
|
},
|
|
5492
5555
|
size: "small",
|
|
5493
5556
|
children: h
|
|
@@ -5508,35 +5571,35 @@ function Ki({
|
|
|
5508
5571
|
),
|
|
5509
5572
|
/* @__PURE__ */ n("div", { className: "flex gap-4", children: [
|
|
5510
5573
|
/* @__PURE__ */ e(
|
|
5511
|
-
|
|
5574
|
+
wt,
|
|
5512
5575
|
{
|
|
5513
5576
|
title: "Products",
|
|
5514
5577
|
subtitle: "A collection of products with images, prices and stock",
|
|
5515
|
-
icon: /* @__PURE__ */ e(
|
|
5578
|
+
icon: /* @__PURE__ */ e(st, { size: "small", iconKey: Mt.icon }),
|
|
5516
5579
|
onClick: () => {
|
|
5517
|
-
p(
|
|
5580
|
+
p(Mt), i();
|
|
5518
5581
|
}
|
|
5519
5582
|
}
|
|
5520
5583
|
),
|
|
5521
5584
|
/* @__PURE__ */ e(
|
|
5522
|
-
|
|
5585
|
+
wt,
|
|
5523
5586
|
{
|
|
5524
5587
|
title: "Blog posts",
|
|
5525
5588
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
5526
|
-
icon: /* @__PURE__ */ e(
|
|
5589
|
+
icon: /* @__PURE__ */ e(st, { size: "small", iconKey: Dt.icon }),
|
|
5527
5590
|
onClick: () => {
|
|
5528
|
-
p(
|
|
5591
|
+
p(Dt), i();
|
|
5529
5592
|
}
|
|
5530
5593
|
}
|
|
5531
5594
|
),
|
|
5532
5595
|
/* @__PURE__ */ e(
|
|
5533
|
-
|
|
5596
|
+
wt,
|
|
5534
5597
|
{
|
|
5535
5598
|
title: "Users",
|
|
5536
5599
|
subtitle: "A collection of users with emails, names and roles",
|
|
5537
|
-
icon: /* @__PURE__ */ e(
|
|
5600
|
+
icon: /* @__PURE__ */ e(st, { size: "small", iconKey: Rt.icon }),
|
|
5538
5601
|
onClick: () => {
|
|
5539
|
-
p(
|
|
5602
|
+
p(Rt), i();
|
|
5540
5603
|
}
|
|
5541
5604
|
}
|
|
5542
5605
|
)
|
|
@@ -5552,22 +5615,22 @@ function Ki({
|
|
|
5552
5615
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
5553
5616
|
}
|
|
5554
5617
|
),
|
|
5555
|
-
/* @__PURE__ */ e(
|
|
5618
|
+
/* @__PURE__ */ e(si, { onDataAdded: (h) => i(h) })
|
|
5556
5619
|
] }),
|
|
5557
5620
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(E, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
|
|
5558
5621
|
] }) });
|
|
5559
5622
|
}
|
|
5560
|
-
function
|
|
5623
|
+
function wt({
|
|
5561
5624
|
title: t,
|
|
5562
5625
|
subtitle: a,
|
|
5563
5626
|
icon: r,
|
|
5564
5627
|
onClick: i
|
|
5565
5628
|
}) {
|
|
5566
5629
|
return /* @__PURE__ */ e(ae, { title: a, children: /* @__PURE__ */ n(
|
|
5567
|
-
|
|
5630
|
+
ta,
|
|
5568
5631
|
{
|
|
5569
5632
|
onClick: i,
|
|
5570
|
-
className:
|
|
5633
|
+
className: xe(
|
|
5571
5634
|
"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",
|
|
5572
5635
|
"text-gray-700 dark:text-gray-300",
|
|
5573
5636
|
"hover:border-blue-600 hover:text-blue-600 dark:hover:text-blue-400 focus:ring-blue-400 hover:ring-1 hover:ring-primary",
|
|
@@ -5588,7 +5651,7 @@ function vt({
|
|
|
5588
5651
|
}
|
|
5589
5652
|
) });
|
|
5590
5653
|
}
|
|
5591
|
-
const
|
|
5654
|
+
const Xi = [
|
|
5592
5655
|
"text_field",
|
|
5593
5656
|
"multiline",
|
|
5594
5657
|
"markdown",
|
|
@@ -5609,10 +5672,10 @@ const Yi = [
|
|
|
5609
5672
|
"date_time",
|
|
5610
5673
|
"repeat",
|
|
5611
5674
|
"block"
|
|
5612
|
-
],
|
|
5613
|
-
([t]) =>
|
|
5675
|
+
], er = Object.entries(kt).filter(
|
|
5676
|
+
([t]) => Xi.includes(t)
|
|
5614
5677
|
);
|
|
5615
|
-
function
|
|
5678
|
+
function tr({
|
|
5616
5679
|
importConfig: t,
|
|
5617
5680
|
customFields: a,
|
|
5618
5681
|
collectionEditable: r
|
|
@@ -5621,18 +5684,18 @@ function Gi({
|
|
|
5621
5684
|
setFieldValue: i,
|
|
5622
5685
|
setFieldTouched: s,
|
|
5623
5686
|
values: o
|
|
5624
|
-
} =
|
|
5687
|
+
} = K(), [l, d] = L(void 0), m = D.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, p = ({
|
|
5625
5688
|
id: f,
|
|
5626
5689
|
property: y,
|
|
5627
5690
|
previousId: k,
|
|
5628
5691
|
namespace: _
|
|
5629
5692
|
}) => {
|
|
5630
|
-
const O = f ?
|
|
5631
|
-
const
|
|
5632
|
-
i(
|
|
5693
|
+
const O = f ? ne(f, _) : void 0, h = O ? ke(O) : void 0, w = (v) => v ? m.current[v] ?? N(o, Ne(v)) : m.current[""], b = (v, T) => {
|
|
5694
|
+
const F = Ne(T);
|
|
5695
|
+
i(F, v, !1), m.current[T ?? ""] = v;
|
|
5633
5696
|
};
|
|
5634
5697
|
if (k && k !== f) {
|
|
5635
|
-
const v =
|
|
5698
|
+
const v = ne(k, _), T = ke(v), A = w(_).map((x) => x === k ? f : x).filter((x) => x !== void 0);
|
|
5636
5699
|
b(A, _);
|
|
5637
5700
|
const S = { ...t.headersMapping };
|
|
5638
5701
|
Object.keys(S).forEach((x) => {
|
|
@@ -5646,8 +5709,8 @@ function Gi({
|
|
|
5646
5709
|
property: k,
|
|
5647
5710
|
namespace: _
|
|
5648
5711
|
}) => {
|
|
5649
|
-
const O = f ?
|
|
5650
|
-
...
|
|
5712
|
+
const O = f ? ne(f, _) : void 0, h = O ? ke(O) : void 0, w = t.importData.map((v) => N(v, y)), b = {
|
|
5713
|
+
...ai(w, k, ia),
|
|
5651
5714
|
editable: !0
|
|
5652
5715
|
};
|
|
5653
5716
|
h && (b ? (console.log("updating inferredNewProperty", {
|
|
@@ -5656,10 +5719,10 @@ function Gi({
|
|
|
5656
5719
|
}), i(h, b, !1)) : i(h, k, !1), s(h, !0, !1));
|
|
5657
5720
|
};
|
|
5658
5721
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
|
|
5659
|
-
/* @__PURE__ */ n(
|
|
5722
|
+
/* @__PURE__ */ n(ut, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5660
5723
|
/* @__PURE__ */ e(P, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
|
|
5661
5724
|
/* @__PURE__ */ e(
|
|
5662
|
-
|
|
5725
|
+
li,
|
|
5663
5726
|
{
|
|
5664
5727
|
headersMapping: t.headersMapping,
|
|
5665
5728
|
idColumn: t.idColumn,
|
|
@@ -5671,7 +5734,7 @@ function Gi({
|
|
|
5671
5734
|
propertyKey: y,
|
|
5672
5735
|
importKey: k
|
|
5673
5736
|
}) => /* @__PURE__ */ e(
|
|
5674
|
-
|
|
5737
|
+
ci,
|
|
5675
5738
|
{
|
|
5676
5739
|
property: f,
|
|
5677
5740
|
propertyKey: y,
|
|
@@ -5684,7 +5747,7 @@ function Gi({
|
|
|
5684
5747
|
});
|
|
5685
5748
|
},
|
|
5686
5749
|
propertyTypeView: /* @__PURE__ */ e(
|
|
5687
|
-
|
|
5750
|
+
ar,
|
|
5688
5751
|
{
|
|
5689
5752
|
property: f,
|
|
5690
5753
|
disabled: !1,
|
|
@@ -5726,14 +5789,14 @@ function Gi({
|
|
|
5726
5789
|
/* @__PURE__ */ e("div", { style: { height: "52px" } })
|
|
5727
5790
|
] });
|
|
5728
5791
|
}
|
|
5729
|
-
function
|
|
5792
|
+
function ar({
|
|
5730
5793
|
property: t,
|
|
5731
5794
|
onPropertyChanged: a,
|
|
5732
5795
|
propertyKey: r,
|
|
5733
5796
|
customFields: i,
|
|
5734
5797
|
disabled: s
|
|
5735
5798
|
}) {
|
|
5736
|
-
const { fields: o } =
|
|
5799
|
+
const { fields: o } = Ae(), l = t ? Zt(t) : null, d = t ? We(t, o) : null, [m, u] = L(!1);
|
|
5737
5800
|
return /* @__PURE__ */ e(
|
|
5738
5801
|
ae,
|
|
5739
5802
|
{
|
|
@@ -5751,9 +5814,9 @@ function Qi({
|
|
|
5751
5814
|
value: l ?? "",
|
|
5752
5815
|
placeholder: "Select a property widget",
|
|
5753
5816
|
position: "item-aligned",
|
|
5754
|
-
renderValue: (c) => d ? /* @__PURE__ */ e(
|
|
5817
|
+
renderValue: (c) => d ? /* @__PURE__ */ e(Ze, { propertyConfig: d }) : null,
|
|
5755
5818
|
onValueChange: (c) => {
|
|
5756
|
-
const p =
|
|
5819
|
+
const p = na(t, c, i);
|
|
5757
5820
|
r && (a({
|
|
5758
5821
|
id: r,
|
|
5759
5822
|
property: p,
|
|
@@ -5761,8 +5824,8 @@ function Qi({
|
|
|
5761
5824
|
namespace: void 0
|
|
5762
5825
|
}), console.log("newSelectedWidgetId", c));
|
|
5763
5826
|
},
|
|
5764
|
-
children:
|
|
5765
|
-
|
|
5827
|
+
children: er.map(([c, p]) => /* @__PURE__ */ e(
|
|
5828
|
+
sa,
|
|
5766
5829
|
{
|
|
5767
5830
|
value: c,
|
|
5768
5831
|
optionDisabled: !1,
|
|
@@ -5776,14 +5839,14 @@ function Qi({
|
|
|
5776
5839
|
}
|
|
5777
5840
|
);
|
|
5778
5841
|
}
|
|
5779
|
-
function
|
|
5780
|
-
|
|
5781
|
-
const s =
|
|
5842
|
+
function ir({ importConfig: t, properties: a, propertiesOrder: r }) {
|
|
5843
|
+
de(() => {
|
|
5844
|
+
const s = di(t.originProperties, a), o = t.importData.map((l) => pi(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
|
|
5782
5845
|
t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
|
|
5783
5846
|
}, []);
|
|
5784
|
-
const i =
|
|
5847
|
+
const i = Ea();
|
|
5785
5848
|
return /* @__PURE__ */ e(
|
|
5786
|
-
|
|
5849
|
+
Ba,
|
|
5787
5850
|
{
|
|
5788
5851
|
title: /* @__PURE__ */ n("div", { children: [
|
|
5789
5852
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Imported data preview" }),
|
|
@@ -5803,11 +5866,11 @@ function Zi({ importConfig: t, properties: a, propertiesOrder: r }) {
|
|
|
5803
5866
|
}
|
|
5804
5867
|
);
|
|
5805
5868
|
}
|
|
5806
|
-
function
|
|
5869
|
+
function ca(t, a = "") {
|
|
5807
5870
|
const r = Object.keys(t).reduce((o, l) => {
|
|
5808
|
-
const d = t[l], m =
|
|
5871
|
+
const d = t[l], m = Ma(l), u = a ? `${a}.${m}` : m;
|
|
5809
5872
|
if (d.dataType === "map" && d.properties) {
|
|
5810
|
-
const g =
|
|
5873
|
+
const g = ca(d.properties, u);
|
|
5811
5874
|
return {
|
|
5812
5875
|
headersMapping: { ...o.headersMapping, [l]: u },
|
|
5813
5876
|
properties: {
|
|
@@ -5835,14 +5898,14 @@ function la(t, a = "") {
|
|
|
5835
5898
|
idColumn: s
|
|
5836
5899
|
};
|
|
5837
5900
|
}
|
|
5838
|
-
function
|
|
5839
|
-
const a = t.open, [r, i] =
|
|
5901
|
+
function da(t) {
|
|
5902
|
+
const a = t.open, [r, i] = _e.useState(!1), [s, o] = _e.useState(!1), l = J(() => {
|
|
5840
5903
|
r ? o(!0) : t.handleClose(void 0);
|
|
5841
5904
|
}, [r, t.handleClose]);
|
|
5842
|
-
return
|
|
5905
|
+
return de(() => {
|
|
5843
5906
|
a || (i(!1), o(!1));
|
|
5844
5907
|
}, [a]), /* @__PURE__ */ n(
|
|
5845
|
-
|
|
5908
|
+
Ie,
|
|
5846
5909
|
{
|
|
5847
5910
|
open: a,
|
|
5848
5911
|
fullWidth: !0,
|
|
@@ -5852,7 +5915,7 @@ function ca(t) {
|
|
|
5852
5915
|
onOpenChange: (d) => d ? void 0 : l(),
|
|
5853
5916
|
children: [
|
|
5854
5917
|
a && /* @__PURE__ */ e(
|
|
5855
|
-
|
|
5918
|
+
rr,
|
|
5856
5919
|
{
|
|
5857
5920
|
...t,
|
|
5858
5921
|
handleCancel: l,
|
|
@@ -5860,7 +5923,7 @@ function ca(t) {
|
|
|
5860
5923
|
}
|
|
5861
5924
|
),
|
|
5862
5925
|
/* @__PURE__ */ e(
|
|
5863
|
-
|
|
5926
|
+
Ji,
|
|
5864
5927
|
{
|
|
5865
5928
|
open: s,
|
|
5866
5929
|
handleOk: () => t.handleClose(void 0),
|
|
@@ -5872,7 +5935,7 @@ function ca(t) {
|
|
|
5872
5935
|
}
|
|
5873
5936
|
);
|
|
5874
5937
|
}
|
|
5875
|
-
function
|
|
5938
|
+
function rr({
|
|
5876
5939
|
isNewCollection: t,
|
|
5877
5940
|
initialValues: a,
|
|
5878
5941
|
configController: r,
|
|
@@ -5890,153 +5953,153 @@ function Ji({
|
|
|
5890
5953
|
parentCollection: y,
|
|
5891
5954
|
getData: k
|
|
5892
5955
|
}) {
|
|
5893
|
-
const { fields: _ } =
|
|
5956
|
+
const { fields: _ } = Ae(), O = Ue(), {
|
|
5894
5957
|
topLevelNavigation: h,
|
|
5895
5958
|
collections: w
|
|
5896
|
-
} = O, b = !a?.path && (s ?? []).length === 0, v = (y ? y.subcollections : w) ?? [], T = v.map((z) => z.path.trim().toLowerCase()),
|
|
5959
|
+
} = O, b = !a?.path && (s ?? []).length === 0, v = (y ? y.subcollections : w) ?? [], T = v.map((z) => z.path.trim().toLowerCase()), F = v.map((z) => z.alias?.trim().toLowerCase()).filter(Boolean), A = mi();
|
|
5897
5960
|
if (!h)
|
|
5898
5961
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
5899
5962
|
const {
|
|
5900
5963
|
groups: S
|
|
5901
|
-
} = h, x = Qe(), C =
|
|
5902
|
-
|
|
5964
|
+
} = h, x = Qe(), C = $e(), j = Ye({}), Z = t ? b ? "welcome" : "details" : "properties", [q, M] = L(Z), [he, Ce] = _e.useState(), [ie, R] = _e.useState(), [Q, ee] = _e.useState(!1), [pe, me] = _e.useState();
|
|
5965
|
+
de(() => {
|
|
5903
5966
|
try {
|
|
5904
|
-
O.initialised && (
|
|
5967
|
+
O.initialised && (R(i ? O.getCollectionFromPaths([...s ?? [], i]) : void 0), ee(!0));
|
|
5905
5968
|
} catch (z) {
|
|
5906
|
-
console.error(z),
|
|
5969
|
+
console.error(z), me(pe);
|
|
5907
5970
|
}
|
|
5908
|
-
}, [O.getCollectionFromPaths, i,
|
|
5909
|
-
const
|
|
5910
|
-
const
|
|
5971
|
+
}, [O.getCollectionFromPaths, i, pe, O.initialised]);
|
|
5972
|
+
const ge = (z) => {
|
|
5973
|
+
const Y = z.alias || z.path;
|
|
5911
5974
|
return r.saveCollection({
|
|
5912
|
-
path:
|
|
5975
|
+
path: Y,
|
|
5913
5976
|
collectionData: z,
|
|
5914
5977
|
previousPath: i,
|
|
5915
5978
|
parentPathSegments: s
|
|
5916
|
-
}).then(() => (
|
|
5979
|
+
}).then(() => (Ce(void 0), !0)).catch((U) => (Ce(U), console.error(U), x.open({
|
|
5917
5980
|
type: "error",
|
|
5918
|
-
message: "Error persisting collection: " + (
|
|
5981
|
+
message: "Error persisting collection: " + (U.message ?? "Details in the console")
|
|
5919
5982
|
}), !1));
|
|
5920
|
-
},
|
|
5983
|
+
}, fe = ie ?? {
|
|
5921
5984
|
path: a?.path ?? "",
|
|
5922
5985
|
name: a?.name ?? "",
|
|
5923
5986
|
group: a?.group ?? "",
|
|
5924
5987
|
properties: {},
|
|
5925
5988
|
propertiesOrder: [],
|
|
5926
|
-
icon:
|
|
5989
|
+
icon: _t[Math.floor(Math.random() * _t.length)],
|
|
5927
5990
|
ownerId: C.user?.uid ?? ""
|
|
5928
|
-
},
|
|
5929
|
-
q === "details" ? A.inUse ?
|
|
5930
|
-
}, [q, A.inUse, u]),
|
|
5991
|
+
}, X = J(() => {
|
|
5992
|
+
q === "details" ? A.inUse ? M("import_data_saving") : M(u ? "extra_view" : "properties") : M(q === "welcome" ? "details" : q === "import_data_mapping" ? "import_data_preview" : q === "import_data_preview" ? "details" : q === "extra_view" ? "properties" : "details");
|
|
5993
|
+
}, [q, A.inUse, u]), Oe = J((z) => {
|
|
5931
5994
|
if (l)
|
|
5932
5995
|
return l?.(z.path, z.collectionGroup ?? !1, s ?? []);
|
|
5933
|
-
}, [l, s]),
|
|
5934
|
-
if (!
|
|
5935
|
-
return
|
|
5936
|
-
|
|
5937
|
-
const
|
|
5938
|
-
if (!
|
|
5939
|
-
return
|
|
5940
|
-
const
|
|
5996
|
+
}, [l, s]), Xe = J(async (z) => {
|
|
5997
|
+
if (!Oe)
|
|
5998
|
+
return R(z), Promise.resolve(z);
|
|
5999
|
+
M("loading");
|
|
6000
|
+
const Y = await Oe?.(z);
|
|
6001
|
+
if (!Y)
|
|
6002
|
+
return R(z), Promise.resolve(z);
|
|
6003
|
+
const U = {
|
|
5941
6004
|
...z ?? {}
|
|
5942
6005
|
};
|
|
5943
|
-
return Object.keys(
|
|
6006
|
+
return Object.keys(Y.properties ?? {}).length > 0 && (U.properties = Y.properties, U.propertiesOrder = Y.propertiesOrder), U.propertiesOrder ? (R(U), console.log("Inferred collection", {
|
|
5944
6007
|
newCollection: z ?? {},
|
|
5945
|
-
values:
|
|
5946
|
-
}),
|
|
5947
|
-
}, [s,
|
|
6008
|
+
values: U
|
|
6009
|
+
}), U) : (U.propertiesOrder = Object.keys(U.properties), U);
|
|
6010
|
+
}, [s, Oe]), et = (z, Y) => {
|
|
5948
6011
|
try {
|
|
5949
6012
|
if (console.log("Submitting collection", z), !t) {
|
|
5950
|
-
|
|
5951
|
-
|
|
6013
|
+
ge(z).then(() => {
|
|
6014
|
+
Y.resetForm({ values: fe }), d(z);
|
|
5952
6015
|
});
|
|
5953
6016
|
return;
|
|
5954
6017
|
}
|
|
5955
|
-
q === "welcome" ? (
|
|
5956
|
-
|
|
5957
|
-
values:
|
|
6018
|
+
q === "welcome" ? (X(), Y.resetForm({ values: z })) : q === "details" ? u || A.inUse ? (Y.resetForm({ values: z }), X()) : t ? Xe(z).then((U) => {
|
|
6019
|
+
Y.resetForm({
|
|
6020
|
+
values: U ?? z,
|
|
5958
6021
|
touched: {
|
|
5959
6022
|
path: !0,
|
|
5960
6023
|
name: !0
|
|
5961
6024
|
}
|
|
5962
6025
|
});
|
|
5963
6026
|
}).finally(() => {
|
|
5964
|
-
|
|
5965
|
-
}) : (
|
|
5966
|
-
|
|
5967
|
-
}) : (
|
|
5968
|
-
} catch (
|
|
6027
|
+
X();
|
|
6028
|
+
}) : (Y.resetForm({ values: z }), X()) : q === "extra_view" ? (X(), Y.resetForm({ values: z })) : q === "import_data_mapping" || q === "import_data_preview" ? X() : q === "properties" ? ge(z).then(() => {
|
|
6029
|
+
Y.resetForm({ values: fe }), X(), d(z);
|
|
6030
|
+
}) : (X(), Y.resetForm({ values: z }));
|
|
6031
|
+
} catch (U) {
|
|
5969
6032
|
x.open({
|
|
5970
6033
|
type: "error",
|
|
5971
|
-
message: "Error persisting collection: " + (
|
|
5972
|
-
}), console.error(
|
|
6034
|
+
message: "Error persisting collection: " + (U.message ?? "Details in the console")
|
|
6035
|
+
}), console.error(U), Y.resetForm({ values: z });
|
|
5973
6036
|
}
|
|
5974
6037
|
};
|
|
5975
|
-
return !t && (!O.initialised || !
|
|
5976
|
-
|
|
6038
|
+
return !t && (!O.initialised || !Q) ? /* @__PURE__ */ e(jt, {}) : /* @__PURE__ */ e(De, { fullHeight: !0, children: /* @__PURE__ */ e(
|
|
6039
|
+
Pt,
|
|
5977
6040
|
{
|
|
5978
|
-
initialValues:
|
|
5979
|
-
validationSchema: (q === "properties" || q === "subcollections" || q === "details") &&
|
|
6041
|
+
initialValues: fe,
|
|
6042
|
+
validationSchema: (q === "properties" || q === "subcollections" || q === "details") && gi,
|
|
5980
6043
|
validate: () => {
|
|
5981
6044
|
if (q === "properties")
|
|
5982
6045
|
return j.current;
|
|
5983
6046
|
},
|
|
5984
|
-
onSubmit:
|
|
6047
|
+
onSubmit: et,
|
|
5985
6048
|
children: ({
|
|
5986
6049
|
values: z,
|
|
5987
|
-
setFieldValue:
|
|
5988
|
-
isSubmitting:
|
|
5989
|
-
dirty:
|
|
5990
|
-
submitCount:
|
|
6050
|
+
setFieldValue: Y,
|
|
6051
|
+
isSubmitting: U,
|
|
6052
|
+
dirty: Le,
|
|
6053
|
+
submitCount: tt
|
|
5991
6054
|
}) => {
|
|
5992
|
-
const
|
|
5993
|
-
|
|
5994
|
-
p(
|
|
5995
|
-
}, [
|
|
5996
|
-
function
|
|
5997
|
-
A.setInUse(!0),
|
|
5998
|
-
const
|
|
5999
|
-
|
|
6055
|
+
const Te = z.path ?? i, V = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + Te : Te, I = O.resolveAliasesFrom(V), H = I && k ? () => k(I) : void 0;
|
|
6056
|
+
de(() => {
|
|
6057
|
+
p(Le);
|
|
6058
|
+
}, [Le]);
|
|
6059
|
+
function ce(W) {
|
|
6060
|
+
A.setInUse(!0), ii(W, ia).then((ft) => {
|
|
6061
|
+
const ve = ca(ft);
|
|
6062
|
+
Y("properties", ve.properties), Y("propertiesOrder", Object.keys(ve.properties)), A.setIdColumn(ve.idColumn), A.setImportData(W), A.setHeadersMapping(ve.headersMapping), A.setOriginProperties(ve.properties);
|
|
6000
6063
|
});
|
|
6001
6064
|
}
|
|
6002
|
-
const
|
|
6003
|
-
const
|
|
6004
|
-
A.idColumn && delete
|
|
6065
|
+
const oe = !!z.name && !!z.path, ye = () => {
|
|
6066
|
+
const W = { ...z.properties };
|
|
6067
|
+
A.idColumn && delete W[A.idColumn], Y("properties", W), X(), console.log("onImportMappingComplete", {
|
|
6005
6068
|
importConfig: A,
|
|
6006
|
-
properties:
|
|
6069
|
+
properties: W
|
|
6007
6070
|
});
|
|
6008
|
-
},
|
|
6071
|
+
}, at = ie?.editable || t;
|
|
6009
6072
|
return /* @__PURE__ */ n(B, { children: [
|
|
6010
6073
|
!t && /* @__PURE__ */ n(
|
|
6011
|
-
|
|
6074
|
+
Da,
|
|
6012
6075
|
{
|
|
6013
6076
|
value: q,
|
|
6014
|
-
className:
|
|
6015
|
-
onValueChange: (
|
|
6077
|
+
className: xe(Ct, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
6078
|
+
onValueChange: (W) => M(W),
|
|
6016
6079
|
children: [
|
|
6017
|
-
/* @__PURE__ */ e(
|
|
6018
|
-
/* @__PURE__ */ e(
|
|
6019
|
-
/* @__PURE__ */ e(
|
|
6080
|
+
/* @__PURE__ */ e(yt, { value: "details", children: "Details" }),
|
|
6081
|
+
/* @__PURE__ */ e(yt, { value: "properties", children: "Properties" }),
|
|
6082
|
+
/* @__PURE__ */ e(yt, { value: "subcollections", children: "Additional views" })
|
|
6020
6083
|
]
|
|
6021
6084
|
}
|
|
6022
6085
|
),
|
|
6023
6086
|
/* @__PURE__ */ n(
|
|
6024
|
-
|
|
6087
|
+
Qa,
|
|
6025
6088
|
{
|
|
6026
6089
|
noValidate: !0,
|
|
6027
|
-
className:
|
|
6090
|
+
className: xe(
|
|
6028
6091
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
6029
6092
|
"flex-grow flex flex-col relative"
|
|
6030
6093
|
),
|
|
6031
6094
|
children: [
|
|
6032
|
-
q === "loading" && /* @__PURE__ */ e(
|
|
6033
|
-
q === "extra_view" &&
|
|
6095
|
+
q === "loading" && /* @__PURE__ */ e(jt, {}),
|
|
6096
|
+
q === "extra_view" && Te && u?.View && /* @__PURE__ */ e(u.View, { path: Te }),
|
|
6034
6097
|
q === "welcome" && /* @__PURE__ */ e(
|
|
6035
|
-
|
|
6098
|
+
Zi,
|
|
6036
6099
|
{
|
|
6037
|
-
path:
|
|
6038
|
-
onContinue: (
|
|
6039
|
-
|
|
6100
|
+
path: Te,
|
|
6101
|
+
onContinue: (W) => {
|
|
6102
|
+
W ? (ce(W), M("import_data_mapping")) : M("details");
|
|
6040
6103
|
},
|
|
6041
6104
|
collections: w,
|
|
6042
6105
|
parentCollection: y,
|
|
@@ -6044,15 +6107,15 @@ function Ji({
|
|
|
6044
6107
|
}
|
|
6045
6108
|
),
|
|
6046
6109
|
q === "import_data_mapping" && A && /* @__PURE__ */ e(
|
|
6047
|
-
|
|
6110
|
+
tr,
|
|
6048
6111
|
{
|
|
6049
6112
|
importConfig: A,
|
|
6050
|
-
collectionEditable:
|
|
6113
|
+
collectionEditable: at,
|
|
6051
6114
|
customFields: _
|
|
6052
6115
|
}
|
|
6053
6116
|
),
|
|
6054
6117
|
q === "import_data_preview" && A && /* @__PURE__ */ e(
|
|
6055
|
-
|
|
6118
|
+
ir,
|
|
6056
6119
|
{
|
|
6057
6120
|
importConfig: A,
|
|
6058
6121
|
properties: z.properties,
|
|
@@ -6060,12 +6123,12 @@ function Ji({
|
|
|
6060
6123
|
}
|
|
6061
6124
|
),
|
|
6062
6125
|
q === "import_data_saving" && A && /* @__PURE__ */ e(
|
|
6063
|
-
|
|
6126
|
+
ui,
|
|
6064
6127
|
{
|
|
6065
6128
|
importConfig: A,
|
|
6066
6129
|
collection: z,
|
|
6067
|
-
onImportSuccess: (
|
|
6068
|
-
d(
|
|
6130
|
+
onImportSuccess: (W) => {
|
|
6131
|
+
d(W), x.open({
|
|
6069
6132
|
type: "info",
|
|
6070
6133
|
message: "Data imported successfully"
|
|
6071
6134
|
});
|
|
@@ -6073,67 +6136,67 @@ function Ji({
|
|
|
6073
6136
|
}
|
|
6074
6137
|
),
|
|
6075
6138
|
q === "details" && /* @__PURE__ */ e(
|
|
6076
|
-
|
|
6139
|
+
yi,
|
|
6077
6140
|
{
|
|
6078
6141
|
existingPaths: T,
|
|
6079
|
-
existingAliases:
|
|
6142
|
+
existingAliases: F,
|
|
6080
6143
|
groups: S,
|
|
6081
6144
|
parentCollection: y,
|
|
6082
6145
|
isNewCollection: t
|
|
6083
6146
|
}
|
|
6084
6147
|
),
|
|
6085
|
-
q === "subcollections" &&
|
|
6086
|
-
|
|
6148
|
+
q === "subcollections" && ie && /* @__PURE__ */ e(
|
|
6149
|
+
Wi,
|
|
6087
6150
|
{
|
|
6088
6151
|
parentCollection: y,
|
|
6089
6152
|
configController: r,
|
|
6090
6153
|
getUser: f,
|
|
6091
6154
|
collectionInference: l,
|
|
6092
6155
|
parentPathSegments: s,
|
|
6093
|
-
collection:
|
|
6156
|
+
collection: ie
|
|
6094
6157
|
}
|
|
6095
6158
|
),
|
|
6096
6159
|
q === "properties" && /* @__PURE__ */ e(
|
|
6097
|
-
|
|
6160
|
+
Gi,
|
|
6098
6161
|
{
|
|
6099
|
-
showErrors:
|
|
6162
|
+
showErrors: tt > 0,
|
|
6100
6163
|
isNewCollection: t,
|
|
6101
6164
|
reservedGroups: m,
|
|
6102
|
-
onPropertyError: (
|
|
6103
|
-
j.current =
|
|
6165
|
+
onPropertyError: (W, ft, ve) => {
|
|
6166
|
+
j.current = Ra({
|
|
6104
6167
|
...j.current,
|
|
6105
|
-
[
|
|
6168
|
+
[W]: ve
|
|
6106
6169
|
}, !0);
|
|
6107
6170
|
},
|
|
6108
6171
|
getUser: f,
|
|
6109
|
-
getData:
|
|
6110
|
-
doCollectionInference:
|
|
6172
|
+
getData: H,
|
|
6173
|
+
doCollectionInference: Oe,
|
|
6111
6174
|
customFields: _,
|
|
6112
|
-
collectionEditable:
|
|
6175
|
+
collectionEditable: at,
|
|
6113
6176
|
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
6114
|
-
|
|
6177
|
+
re,
|
|
6115
6178
|
{
|
|
6116
6179
|
color: "primary",
|
|
6117
|
-
onClick: () =>
|
|
6180
|
+
onClick: () => M("extra_view"),
|
|
6118
6181
|
children: u.icon
|
|
6119
6182
|
}
|
|
6120
6183
|
)
|
|
6121
6184
|
}
|
|
6122
6185
|
),
|
|
6123
6186
|
q !== "welcome" && /* @__PURE__ */ n(
|
|
6124
|
-
|
|
6187
|
+
Re,
|
|
6125
6188
|
{
|
|
6126
6189
|
position: "absolute",
|
|
6127
6190
|
children: [
|
|
6128
|
-
|
|
6191
|
+
he && /* @__PURE__ */ e(aa, { error: he }),
|
|
6129
6192
|
t && b && q === "import_data_mapping" && /* @__PURE__ */ n(
|
|
6130
6193
|
E,
|
|
6131
6194
|
{
|
|
6132
6195
|
variant: "text",
|
|
6133
6196
|
type: "button",
|
|
6134
|
-
onClick: () => (A.setInUse(!1),
|
|
6197
|
+
onClick: () => (A.setInUse(!1), M("welcome")),
|
|
6135
6198
|
children: [
|
|
6136
|
-
/* @__PURE__ */ e(
|
|
6199
|
+
/* @__PURE__ */ e(rt, {}),
|
|
6137
6200
|
"Back"
|
|
6138
6201
|
]
|
|
6139
6202
|
}
|
|
@@ -6144,10 +6207,10 @@ function Ji({
|
|
|
6144
6207
|
variant: "text",
|
|
6145
6208
|
type: "button",
|
|
6146
6209
|
onClick: () => {
|
|
6147
|
-
|
|
6210
|
+
ge(z), M("import_data_mapping");
|
|
6148
6211
|
},
|
|
6149
6212
|
children: [
|
|
6150
|
-
/* @__PURE__ */ e(
|
|
6213
|
+
/* @__PURE__ */ e(rt, {}),
|
|
6151
6214
|
"Back"
|
|
6152
6215
|
]
|
|
6153
6216
|
}
|
|
@@ -6157,9 +6220,9 @@ function Ji({
|
|
|
6157
6220
|
{
|
|
6158
6221
|
variant: "text",
|
|
6159
6222
|
type: "button",
|
|
6160
|
-
onClick: () =>
|
|
6223
|
+
onClick: () => M("welcome"),
|
|
6161
6224
|
children: [
|
|
6162
|
-
/* @__PURE__ */ e(
|
|
6225
|
+
/* @__PURE__ */ e(rt, {}),
|
|
6163
6226
|
"Back"
|
|
6164
6227
|
]
|
|
6165
6228
|
}
|
|
@@ -6169,9 +6232,9 @@ function Ji({
|
|
|
6169
6232
|
{
|
|
6170
6233
|
variant: "text",
|
|
6171
6234
|
type: "button",
|
|
6172
|
-
onClick: () =>
|
|
6235
|
+
onClick: () => M("details"),
|
|
6173
6236
|
children: [
|
|
6174
|
-
/* @__PURE__ */ e(
|
|
6237
|
+
/* @__PURE__ */ e(rt, {}),
|
|
6175
6238
|
"Back"
|
|
6176
6239
|
]
|
|
6177
6240
|
}
|
|
@@ -6191,7 +6254,7 @@ function Ji({
|
|
|
6191
6254
|
{
|
|
6192
6255
|
variant: "filled",
|
|
6193
6256
|
color: "primary",
|
|
6194
|
-
onClick:
|
|
6257
|
+
onClick: ye,
|
|
6195
6258
|
children: "Next"
|
|
6196
6259
|
}
|
|
6197
6260
|
),
|
|
@@ -6201,20 +6264,20 @@ function Ji({
|
|
|
6201
6264
|
variant: "filled",
|
|
6202
6265
|
color: "primary",
|
|
6203
6266
|
onClick: () => {
|
|
6204
|
-
|
|
6267
|
+
X();
|
|
6205
6268
|
},
|
|
6206
6269
|
children: "Next"
|
|
6207
6270
|
}
|
|
6208
6271
|
),
|
|
6209
6272
|
t && (q === "details" || q === "properties") && /* @__PURE__ */ n(
|
|
6210
|
-
|
|
6273
|
+
Ft,
|
|
6211
6274
|
{
|
|
6212
6275
|
variant: "filled",
|
|
6213
6276
|
color: "primary",
|
|
6214
6277
|
type: "submit",
|
|
6215
|
-
loading:
|
|
6216
|
-
disabled:
|
|
6217
|
-
startIcon: q === "properties" ? /* @__PURE__ */ e(
|
|
6278
|
+
loading: U,
|
|
6279
|
+
disabled: U || q === "details" && !oe,
|
|
6280
|
+
startIcon: q === "properties" ? /* @__PURE__ */ e(Ua, {}) : void 0,
|
|
6218
6281
|
children: [
|
|
6219
6282
|
q === "details" && "Next",
|
|
6220
6283
|
q === "properties" && "Create collection"
|
|
@@ -6222,12 +6285,12 @@ function Ji({
|
|
|
6222
6285
|
}
|
|
6223
6286
|
),
|
|
6224
6287
|
!t && /* @__PURE__ */ e(
|
|
6225
|
-
|
|
6288
|
+
Ft,
|
|
6226
6289
|
{
|
|
6227
6290
|
variant: "filled",
|
|
6228
6291
|
color: "primary",
|
|
6229
6292
|
type: "submit",
|
|
6230
|
-
loading:
|
|
6293
|
+
loading: U,
|
|
6231
6294
|
children: "Update collection"
|
|
6232
6295
|
}
|
|
6233
6296
|
)
|
|
@@ -6242,7 +6305,7 @@ function Ji({
|
|
|
6242
6305
|
}
|
|
6243
6306
|
) });
|
|
6244
6307
|
}
|
|
6245
|
-
const
|
|
6308
|
+
const pa = D.createContext({}), ma = D.createContext({}), or = D.memo(
|
|
6246
6309
|
function({
|
|
6247
6310
|
children: a,
|
|
6248
6311
|
collectionConfigController: r,
|
|
@@ -6254,69 +6317,69 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
|
|
|
6254
6317
|
getUser: m,
|
|
6255
6318
|
getData: u
|
|
6256
6319
|
}) {
|
|
6257
|
-
const c =
|
|
6320
|
+
const c = Ue(), p = hi(), g = Qe(), { fields: f } = Ae(), {
|
|
6258
6321
|
collections: y
|
|
6259
|
-
} = c, k = y.map((C) => C.path.trim().toLowerCase()), [_, O] =
|
|
6260
|
-
|
|
6322
|
+
} = c, k = y.map((C) => C.path.trim().toLowerCase()), [_, O] = D.useState();
|
|
6323
|
+
de(() => {
|
|
6261
6324
|
d && d().then((C) => {
|
|
6262
6325
|
O(C.filter((j) => !k.includes(j.trim().toLowerCase())));
|
|
6263
6326
|
});
|
|
6264
6327
|
}, [d]);
|
|
6265
|
-
const [h, w] =
|
|
6328
|
+
const [h, w] = D.useState(), [b, v] = D.useState(), T = J(() => ({
|
|
6266
6329
|
createCollections: !0,
|
|
6267
6330
|
editCollections: !0,
|
|
6268
6331
|
deleteCollections: !0
|
|
6269
|
-
}), []),
|
|
6332
|
+
}), []), F = J(({
|
|
6270
6333
|
path: C,
|
|
6271
6334
|
fullPath: j,
|
|
6272
|
-
parentPathSegments:
|
|
6335
|
+
parentPathSegments: Z,
|
|
6273
6336
|
parentCollection: q
|
|
6274
6337
|
}) => {
|
|
6275
6338
|
w({
|
|
6276
6339
|
editedCollectionPath: C,
|
|
6277
6340
|
fullPath: j,
|
|
6278
|
-
parentPathSegments:
|
|
6341
|
+
parentPathSegments: Z,
|
|
6279
6342
|
isNewCollection: !1,
|
|
6280
6343
|
parentCollection: q,
|
|
6281
6344
|
redirect: !1
|
|
6282
6345
|
});
|
|
6283
|
-
}, []), A =
|
|
6346
|
+
}, []), A = J(({
|
|
6284
6347
|
propertyKey: C,
|
|
6285
6348
|
property: j,
|
|
6286
|
-
editedCollectionPath:
|
|
6349
|
+
editedCollectionPath: Z,
|
|
6287
6350
|
currentPropertiesOrder: q,
|
|
6288
|
-
parentPathSegments:
|
|
6289
|
-
collection:
|
|
6351
|
+
parentPathSegments: M,
|
|
6352
|
+
collection: he
|
|
6290
6353
|
}) => {
|
|
6291
|
-
const
|
|
6292
|
-
console.log("edit property",
|
|
6293
|
-
propertyKey:
|
|
6354
|
+
const Ce = C && C.includes(".") ? C.substring(0, C.lastIndexOf(".")) : void 0, ie = C && C.includes(".") ? C.substring(C.lastIndexOf(".") + 1) : C;
|
|
6355
|
+
console.log("edit property", ie, he), v({
|
|
6356
|
+
propertyKey: ie,
|
|
6294
6357
|
property: j,
|
|
6295
|
-
namespace:
|
|
6358
|
+
namespace: Ce,
|
|
6296
6359
|
currentPropertiesOrder: q,
|
|
6297
|
-
editedCollectionPath:
|
|
6298
|
-
parentPathSegments:
|
|
6299
|
-
collectionEditable:
|
|
6360
|
+
editedCollectionPath: Z,
|
|
6361
|
+
parentPathSegments: M,
|
|
6362
|
+
collectionEditable: he?.editable ?? !1
|
|
6300
6363
|
});
|
|
6301
|
-
}, []), S =
|
|
6364
|
+
}, []), S = D.useCallback(({
|
|
6302
6365
|
parentPathSegments: C,
|
|
6303
6366
|
parentCollection: j,
|
|
6304
|
-
initialValues:
|
|
6367
|
+
initialValues: Z,
|
|
6305
6368
|
redirect: q
|
|
6306
6369
|
}) => {
|
|
6307
6370
|
w({
|
|
6308
6371
|
isNewCollection: !0,
|
|
6309
6372
|
parentPathSegments: C,
|
|
6310
6373
|
parentCollection: j,
|
|
6311
|
-
initialValues:
|
|
6374
|
+
initialValues: Z,
|
|
6312
6375
|
redirect: q
|
|
6313
6376
|
});
|
|
6314
6377
|
}, []), x = d ? (C) => !C && _ ? Promise.resolve(_) : d?.(C) : void 0;
|
|
6315
|
-
return /* @__PURE__ */ e(
|
|
6316
|
-
|
|
6378
|
+
return /* @__PURE__ */ e(pa.Provider, { value: r, children: /* @__PURE__ */ n(
|
|
6379
|
+
ma.Provider,
|
|
6317
6380
|
{
|
|
6318
6381
|
value: {
|
|
6319
|
-
editCollection:
|
|
6382
|
+
editCollection: F,
|
|
6320
6383
|
createCollection: S,
|
|
6321
6384
|
editProperty: A,
|
|
6322
6385
|
configPermissions: i ?? T,
|
|
@@ -6325,7 +6388,7 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
|
|
|
6325
6388
|
children: [
|
|
6326
6389
|
a,
|
|
6327
6390
|
/* @__PURE__ */ e(
|
|
6328
|
-
|
|
6391
|
+
da,
|
|
6329
6392
|
{
|
|
6330
6393
|
open: !!h,
|
|
6331
6394
|
configController: r,
|
|
@@ -6366,12 +6429,12 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
|
|
|
6366
6429
|
}) => {
|
|
6367
6430
|
if (!b || !C)
|
|
6368
6431
|
return;
|
|
6369
|
-
const
|
|
6432
|
+
const Z = !b.propertyKey;
|
|
6370
6433
|
return r.saveProperty({
|
|
6371
6434
|
path: b?.editedCollectionPath,
|
|
6372
6435
|
property: j,
|
|
6373
6436
|
propertyKey: C,
|
|
6374
|
-
newPropertiesOrder:
|
|
6437
|
+
newPropertiesOrder: Z && b.currentPropertiesOrder ? [...b.currentPropertiesOrder, C] : void 0,
|
|
6375
6438
|
namespace: b.namespace,
|
|
6376
6439
|
parentPathSegments: b.parentPathSegments
|
|
6377
6440
|
}).catch((q) => (console.error(q), g.open({
|
|
@@ -6418,20 +6481,20 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
|
|
|
6418
6481
|
}
|
|
6419
6482
|
) });
|
|
6420
6483
|
},
|
|
6421
|
-
|
|
6422
|
-
),
|
|
6423
|
-
function
|
|
6484
|
+
mt
|
|
6485
|
+
), Be = () => Lt(ma), ua = () => Lt(pa);
|
|
6486
|
+
function nr({
|
|
6424
6487
|
path: t,
|
|
6425
6488
|
parentPathSegments: a,
|
|
6426
6489
|
collection: r,
|
|
6427
6490
|
tableController: i
|
|
6428
6491
|
}) {
|
|
6429
|
-
const s =
|
|
6492
|
+
const s = $e(), o = Ue(), l = Be(), d = ua(), m = Qe(), u = o.getCollectionFromPaths(a), c = l.configPermissions ? l.configPermissions({
|
|
6430
6493
|
user: s.user,
|
|
6431
6494
|
collection: r
|
|
6432
6495
|
}).editCollections : !0;
|
|
6433
6496
|
let p = null;
|
|
6434
|
-
return (!
|
|
6497
|
+
return (!mt(nt(i.filterValues), nt(r.initialFilter)) || !mt(nt(i.sortBy), nt(r.initialSort))) && (p = /* @__PURE__ */ e(
|
|
6435
6498
|
ae,
|
|
6436
6499
|
{
|
|
6437
6500
|
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
@@ -6457,7 +6520,7 @@ function Xi({
|
|
|
6457
6520
|
message: "Default config saved"
|
|
6458
6521
|
});
|
|
6459
6522
|
}),
|
|
6460
|
-
children: /* @__PURE__ */ e(
|
|
6523
|
+
children: /* @__PURE__ */ e($a, {})
|
|
6461
6524
|
}
|
|
6462
6525
|
)
|
|
6463
6526
|
}
|
|
@@ -6468,59 +6531,59 @@ function Xi({
|
|
|
6468
6531
|
{
|
|
6469
6532
|
title: c ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
6470
6533
|
children: /* @__PURE__ */ e(
|
|
6471
|
-
|
|
6534
|
+
re,
|
|
6472
6535
|
{
|
|
6473
6536
|
color: "primary",
|
|
6474
6537
|
disabled: !c,
|
|
6475
6538
|
onClick: c ? () => l?.editCollection({ path: r.path, fullPath: t, parentPathSegments: a, parentCollection: u }) : void 0,
|
|
6476
|
-
children: /* @__PURE__ */ e(
|
|
6539
|
+
children: /* @__PURE__ */ e(Ge, {})
|
|
6477
6540
|
}
|
|
6478
6541
|
)
|
|
6479
6542
|
}
|
|
6480
6543
|
)
|
|
6481
6544
|
] });
|
|
6482
6545
|
}
|
|
6483
|
-
function
|
|
6546
|
+
function nt(t) {
|
|
6484
6547
|
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
6485
6548
|
}
|
|
6486
|
-
function
|
|
6549
|
+
function sr({
|
|
6487
6550
|
path: t,
|
|
6488
6551
|
collection: a
|
|
6489
6552
|
}) {
|
|
6490
|
-
const r =
|
|
6553
|
+
const r = $e(), i = ua(), s = Be(), o = s.configPermissions({
|
|
6491
6554
|
user: r.user,
|
|
6492
6555
|
collection: a
|
|
6493
|
-
}), l =
|
|
6556
|
+
}), l = J(() => {
|
|
6494
6557
|
s?.editCollection({ path: t, parentPathSegments: [] });
|
|
6495
|
-
}, [s, t]), [d, m] =
|
|
6558
|
+
}, [s, t]), [d, m] = L(!1), u = J(() => {
|
|
6496
6559
|
i?.deleteCollection({ path: t });
|
|
6497
6560
|
}, [t, i]);
|
|
6498
6561
|
return /* @__PURE__ */ n(B, { children: [
|
|
6499
6562
|
/* @__PURE__ */ n("div", { children: [
|
|
6500
6563
|
o.deleteCollections && /* @__PURE__ */ e(
|
|
6501
|
-
|
|
6564
|
+
La,
|
|
6502
6565
|
{
|
|
6503
|
-
trigger: /* @__PURE__ */ e(
|
|
6504
|
-
children: /* @__PURE__ */ n(
|
|
6566
|
+
trigger: /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(Ka, { size: "small" }) }),
|
|
6567
|
+
children: /* @__PURE__ */ n(Ya, { onClick: (c) => {
|
|
6505
6568
|
c.preventDefault(), c.stopPropagation(), m(!0);
|
|
6506
6569
|
}, children: [
|
|
6507
|
-
/* @__PURE__ */ e(
|
|
6570
|
+
/* @__PURE__ */ e(dt, {}),
|
|
6508
6571
|
"Delete"
|
|
6509
6572
|
] })
|
|
6510
6573
|
}
|
|
6511
6574
|
),
|
|
6512
6575
|
o.editCollections && /* @__PURE__ */ e(
|
|
6513
|
-
|
|
6576
|
+
re,
|
|
6514
6577
|
{
|
|
6515
6578
|
onClick: (c) => {
|
|
6516
6579
|
l();
|
|
6517
6580
|
},
|
|
6518
|
-
children: /* @__PURE__ */ e(
|
|
6581
|
+
children: /* @__PURE__ */ e(Ge, { size: "small" })
|
|
6519
6582
|
}
|
|
6520
6583
|
)
|
|
6521
6584
|
] }),
|
|
6522
6585
|
/* @__PURE__ */ e(
|
|
6523
|
-
|
|
6586
|
+
pt,
|
|
6524
6587
|
{
|
|
6525
6588
|
open: d,
|
|
6526
6589
|
onAccept: u,
|
|
@@ -6535,19 +6598,19 @@ function er({
|
|
|
6535
6598
|
)
|
|
6536
6599
|
] });
|
|
6537
6600
|
}
|
|
6538
|
-
function
|
|
6601
|
+
function lr({
|
|
6539
6602
|
group: t,
|
|
6540
6603
|
context: a
|
|
6541
6604
|
}) {
|
|
6542
6605
|
if (!a.navigation.topLevelNavigation)
|
|
6543
6606
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
6544
|
-
const r =
|
|
6607
|
+
const r = $e(), i = Be(), s = i.configPermissions ? i.configPermissions({
|
|
6545
6608
|
user: r.user
|
|
6546
6609
|
}).createCollections : !0;
|
|
6547
6610
|
return /* @__PURE__ */ e(
|
|
6548
|
-
|
|
6611
|
+
ta,
|
|
6549
6612
|
{
|
|
6550
|
-
className:
|
|
6613
|
+
className: xe("h-full p-4 min-h-[124px]"),
|
|
6551
6614
|
onClick: i && s ? () => i.createCollection({
|
|
6552
6615
|
initialValues: t ? { group: t } : void 0,
|
|
6553
6616
|
parentPathSegments: [],
|
|
@@ -6558,7 +6621,7 @@ function tr({
|
|
|
6558
6621
|
{
|
|
6559
6622
|
className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
|
|
6560
6623
|
children: [
|
|
6561
|
-
/* @__PURE__ */ e(
|
|
6624
|
+
/* @__PURE__ */ e(qe, { color: "primary" }),
|
|
6562
6625
|
/* @__PURE__ */ e(
|
|
6563
6626
|
P,
|
|
6564
6627
|
{
|
|
@@ -6575,12 +6638,12 @@ function tr({
|
|
|
6575
6638
|
}
|
|
6576
6639
|
);
|
|
6577
6640
|
}
|
|
6578
|
-
function
|
|
6579
|
-
const t =
|
|
6641
|
+
function cr() {
|
|
6642
|
+
const t = $e(), a = Ue(), r = Be(), i = r.configPermissions ? r.configPermissions({
|
|
6580
6643
|
user: t.user
|
|
6581
6644
|
}).createCollections : !0, s = r.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
|
|
6582
6645
|
return /* @__PURE__ */ e(
|
|
6583
|
-
|
|
6646
|
+
Ha,
|
|
6584
6647
|
{
|
|
6585
6648
|
in: o,
|
|
6586
6649
|
children: /* @__PURE__ */ n(
|
|
@@ -6594,12 +6657,12 @@ function ar() {
|
|
|
6594
6657
|
{
|
|
6595
6658
|
className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
|
|
6596
6659
|
children: s.map((l) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
6597
|
-
|
|
6660
|
+
ct,
|
|
6598
6661
|
{
|
|
6599
|
-
icon: /* @__PURE__ */ e(
|
|
6662
|
+
icon: /* @__PURE__ */ e(qe, { size: "small" }),
|
|
6600
6663
|
colorScheme: "cyanLighter",
|
|
6601
6664
|
onClick: r && i ? () => r.createCollection({
|
|
6602
|
-
initialValues: { path: l, name:
|
|
6665
|
+
initialValues: { path: l, name: Ot(l) },
|
|
6603
6666
|
parentPathSegments: [],
|
|
6604
6667
|
redirect: !0
|
|
6605
6668
|
}) : void 0,
|
|
@@ -6615,30 +6678,30 @@ function ar() {
|
|
|
6615
6678
|
}
|
|
6616
6679
|
);
|
|
6617
6680
|
}
|
|
6618
|
-
function
|
|
6681
|
+
function ha(t, a) {
|
|
6619
6682
|
const r = (a ?? []).map((s) => {
|
|
6620
6683
|
const o = t?.find((l) => l.path === s.path || l.alias && s.alias && l.alias === s.alias);
|
|
6621
|
-
return o ?
|
|
6684
|
+
return o ? dr(o, s) : s;
|
|
6622
6685
|
}), i = t.filter((s) => !r.map((o) => o.path).includes(s.path) || !r.map((o) => o.alias).includes(s.alias));
|
|
6623
6686
|
return [...r, ...i];
|
|
6624
6687
|
}
|
|
6625
|
-
function
|
|
6626
|
-
const r =
|
|
6688
|
+
function dr(t, a) {
|
|
6689
|
+
const r = ha(t?.subcollections ?? [], a?.subcollections ?? []), i = { ...t.properties };
|
|
6627
6690
|
Object.keys(a.properties).forEach((u) => {
|
|
6628
6691
|
const c = t.properties[u];
|
|
6629
|
-
c ? i[u] =
|
|
6692
|
+
c ? i[u] = ga(c, a.properties[u]) : i[u] = a.properties[u];
|
|
6630
6693
|
});
|
|
6631
|
-
const s = $(t, a), o =
|
|
6694
|
+
const s = $(t, a), o = Ut(t), l = Ut(a), d = [.../* @__PURE__ */ new Set([...o, ...l])], m = [.../* @__PURE__ */ new Set([...t.entityViews ?? [], ...a.entityViews ?? []])];
|
|
6632
6695
|
return {
|
|
6633
6696
|
...s,
|
|
6634
6697
|
subcollections: r,
|
|
6635
|
-
properties:
|
|
6698
|
+
properties: Ga(i, d),
|
|
6636
6699
|
propertiesOrder: d,
|
|
6637
6700
|
entityViews: m
|
|
6638
6701
|
};
|
|
6639
6702
|
}
|
|
6640
|
-
function
|
|
6641
|
-
if (
|
|
6703
|
+
function ga(t, a) {
|
|
6704
|
+
if (se(a))
|
|
6642
6705
|
return a;
|
|
6643
6706
|
{
|
|
6644
6707
|
const r = $(t, a), i = !!t.editable, s = !!a.editable;
|
|
@@ -6646,19 +6709,19 @@ function ha(t, a) {
|
|
|
6646
6709
|
const o = "properties" in t ? t.properties : {}, l = "properties" in a ? a.properties : {}, d = "propertiesOrder" in t && t.propertiesOrder ? t.propertiesOrder : Object.keys(o), m = "propertiesOrder" in a && a.propertiesOrder ? a.propertiesOrder : "properties" in a ? Object.keys(a.properties) : [], u = [.../* @__PURE__ */ new Set([...d, ...m])], c = { ...o };
|
|
6647
6710
|
return Object.keys(a.properties).forEach((p) => {
|
|
6648
6711
|
const g = o[p];
|
|
6649
|
-
g && (c[p] =
|
|
6712
|
+
g && (c[p] = ga(g, l[p]));
|
|
6650
6713
|
}), { ...r, editable: i && s, properties: c, propertiesOrder: u };
|
|
6651
6714
|
}
|
|
6652
6715
|
return { ...r, editable: i && s };
|
|
6653
6716
|
}
|
|
6654
6717
|
}
|
|
6655
|
-
function
|
|
6718
|
+
function Ut(t) {
|
|
6656
6719
|
return t.propertiesOrder && t.propertiesOrder.length > 0 ? t.propertiesOrder : [
|
|
6657
6720
|
...Object.keys(t.properties),
|
|
6658
6721
|
...(t.additionalFields ?? [])?.map((a) => a.id)
|
|
6659
6722
|
];
|
|
6660
6723
|
}
|
|
6661
|
-
function
|
|
6724
|
+
function pr({
|
|
6662
6725
|
propertyKey: t,
|
|
6663
6726
|
onHover: a,
|
|
6664
6727
|
property: r,
|
|
@@ -6666,9 +6729,9 @@ function rr({
|
|
|
6666
6729
|
parentPathSegments: s,
|
|
6667
6730
|
collection: o
|
|
6668
6731
|
}) {
|
|
6669
|
-
const l =
|
|
6732
|
+
const l = Be();
|
|
6670
6733
|
return /* @__PURE__ */ e(ae, { title: "Edit", children: /* @__PURE__ */ e(
|
|
6671
|
-
|
|
6734
|
+
re,
|
|
6672
6735
|
{
|
|
6673
6736
|
className: a ? "bg-white dark:bg-gray-950" : "hidden",
|
|
6674
6737
|
onClick: () => {
|
|
@@ -6681,16 +6744,16 @@ function rr({
|
|
|
6681
6744
|
});
|
|
6682
6745
|
},
|
|
6683
6746
|
size: "small",
|
|
6684
|
-
children: /* @__PURE__ */ e(
|
|
6747
|
+
children: /* @__PURE__ */ e(Ge, { size: "small" })
|
|
6685
6748
|
}
|
|
6686
6749
|
) });
|
|
6687
6750
|
}
|
|
6688
|
-
function
|
|
6751
|
+
function mr({
|
|
6689
6752
|
fullPath: t,
|
|
6690
6753
|
parentPathSegments: a,
|
|
6691
6754
|
collection: r
|
|
6692
6755
|
}) {
|
|
6693
|
-
const i =
|
|
6756
|
+
const i = $e(), s = Be(), o = s.configPermissions ? s.configPermissions({
|
|
6694
6757
|
user: i.user,
|
|
6695
6758
|
collection: r
|
|
6696
6759
|
}).editCollections : !0;
|
|
@@ -6702,15 +6765,15 @@ function or({
|
|
|
6702
6765
|
s.editProperty({
|
|
6703
6766
|
editedCollectionPath: t,
|
|
6704
6767
|
parentPathSegments: a,
|
|
6705
|
-
currentPropertiesOrder:
|
|
6768
|
+
currentPropertiesOrder: Ja(r),
|
|
6706
6769
|
collection: r
|
|
6707
6770
|
});
|
|
6708
6771
|
},
|
|
6709
|
-
children: /* @__PURE__ */ e(
|
|
6772
|
+
children: /* @__PURE__ */ e(qe, { color: "inherit" })
|
|
6710
6773
|
}
|
|
6711
6774
|
) });
|
|
6712
6775
|
}
|
|
6713
|
-
function
|
|
6776
|
+
function Pr({
|
|
6714
6777
|
collectionConfigController: t,
|
|
6715
6778
|
configPermissions: a,
|
|
6716
6779
|
reservedGroups: r,
|
|
@@ -6720,12 +6783,12 @@ function br({
|
|
|
6720
6783
|
collectionInference: l,
|
|
6721
6784
|
getData: d
|
|
6722
6785
|
}) {
|
|
6723
|
-
const m =
|
|
6786
|
+
const m = J(
|
|
6724
6787
|
(u) => {
|
|
6725
6788
|
const c = (g) => {
|
|
6726
|
-
|
|
6789
|
+
ea(g.properties), g.subcollections?.forEach(c);
|
|
6727
6790
|
}, p = t.collections ?? [];
|
|
6728
|
-
return p.forEach(c), console.debug("Injecting collections", { editableCollections: p, collections: u }),
|
|
6791
|
+
return p.forEach(c), console.debug("Injecting collections", { editableCollections: p, collections: u }), ha(p, u);
|
|
6729
6792
|
},
|
|
6730
6793
|
[t.collections]
|
|
6731
6794
|
);
|
|
@@ -6734,10 +6797,10 @@ function br({
|
|
|
6734
6797
|
loading: t.loading,
|
|
6735
6798
|
collections: {
|
|
6736
6799
|
injectCollections: m,
|
|
6737
|
-
CollectionActions:
|
|
6800
|
+
CollectionActions: nr
|
|
6738
6801
|
},
|
|
6739
6802
|
provider: {
|
|
6740
|
-
Component:
|
|
6803
|
+
Component: or,
|
|
6741
6804
|
props: {
|
|
6742
6805
|
collectionConfigController: t,
|
|
6743
6806
|
configPermissions: a,
|
|
@@ -6750,20 +6813,20 @@ function br({
|
|
|
6750
6813
|
}
|
|
6751
6814
|
},
|
|
6752
6815
|
homePage: {
|
|
6753
|
-
additionalChildrenStart: /* @__PURE__ */ e(
|
|
6754
|
-
CollectionActions:
|
|
6755
|
-
AdditionalCards:
|
|
6816
|
+
additionalChildrenStart: /* @__PURE__ */ e(cr, {}),
|
|
6817
|
+
CollectionActions: sr,
|
|
6818
|
+
AdditionalCards: lr
|
|
6756
6819
|
},
|
|
6757
6820
|
collectionView: {
|
|
6758
|
-
HeaderAction:
|
|
6759
|
-
AddColumnComponent:
|
|
6821
|
+
HeaderAction: pr,
|
|
6822
|
+
AddColumnComponent: mr
|
|
6760
6823
|
}
|
|
6761
6824
|
};
|
|
6762
6825
|
}
|
|
6763
|
-
function
|
|
6764
|
-
const a =
|
|
6826
|
+
function Nr({ path: t }) {
|
|
6827
|
+
const a = hr(t), r = ur(t), i = Be();
|
|
6765
6828
|
return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
|
|
6766
|
-
/* @__PURE__ */ e(
|
|
6829
|
+
/* @__PURE__ */ e(aa, { error: "No collection for path: " + a }),
|
|
6767
6830
|
/* @__PURE__ */ e(
|
|
6768
6831
|
E,
|
|
6769
6832
|
{
|
|
@@ -6772,7 +6835,7 @@ function yr({ path: t }) {
|
|
|
6772
6835
|
size: "small",
|
|
6773
6836
|
onClick: () => {
|
|
6774
6837
|
i.createCollection({
|
|
6775
|
-
initialValues: { path: a, name:
|
|
6838
|
+
initialValues: { path: a, name: Ot(a) },
|
|
6776
6839
|
parentPathSegments: r,
|
|
6777
6840
|
redirect: !1
|
|
6778
6841
|
});
|
|
@@ -6782,24 +6845,24 @@ function yr({ path: t }) {
|
|
|
6782
6845
|
)
|
|
6783
6846
|
] });
|
|
6784
6847
|
}
|
|
6785
|
-
function
|
|
6848
|
+
function ur(t) {
|
|
6786
6849
|
const a = t.split("/");
|
|
6787
6850
|
return a.filter((r, i) => i % 2 === 0 && i !== a.length - 1);
|
|
6788
6851
|
}
|
|
6789
|
-
function
|
|
6852
|
+
function hr(t) {
|
|
6790
6853
|
const a = t.split("/");
|
|
6791
6854
|
return a[a.length - 1];
|
|
6792
6855
|
}
|
|
6793
6856
|
export {
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6857
|
+
Nr as MissingReferenceWidget,
|
|
6858
|
+
He as editableProperty,
|
|
6859
|
+
ne as getFullId,
|
|
6860
|
+
ke as idToPropertiesPath,
|
|
6861
|
+
Ne as namespaceToPropertiesOrderPath,
|
|
6862
|
+
vi as namespaceToPropertiesPath,
|
|
6863
|
+
Pi as removeNonEditableProperties,
|
|
6864
|
+
Be as useCollectionEditorController,
|
|
6865
|
+
Pr as useCollectionEditorPlugin,
|
|
6866
|
+
ua as useCollectionsConfigController
|
|
6804
6867
|
};
|
|
6805
6868
|
//# sourceMappingURL=index.es.js.map
|