@firecms/collection_editor 3.0.0-alpha.30 → 3.0.0-alpha.31
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/templates/blog_template.d.ts +2 -10
- package/dist/components/collection_editor/templates/products_template.d.ts +2 -12
- package/dist/components/collection_editor/templates/users_template.d.ts +2 -7
- package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +1 -1
- package/dist/index.es.js +817 -817
- 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 +4 -4
- package/src/components/collection_editor/CollectionEditorDialog.tsx +1 -1
- package/src/components/collection_editor/templates/blog_template.ts +9 -9
- package/src/components/collection_editor/templates/products_template.ts +3 -3
- package/src/components/collection_editor/templates/users_template.ts +3 -3
- package/src/components/collection_editor/utils/update_property_for_widget.ts +51 -41
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as B, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import R, { useState as
|
|
4
|
-
import { iconKeys as
|
|
5
|
-
import
|
|
6
|
-
import { useFormikContext as L, Field as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import { extractEnumFromValues as
|
|
10
|
-
import { DragDropContext as
|
|
11
|
-
import { ImportFileUpload as
|
|
12
|
-
import { useNavigate as
|
|
13
|
-
const
|
|
14
|
-
name:
|
|
15
|
-
path:
|
|
16
|
-
}),
|
|
2
|
+
import * as ve from "react";
|
|
3
|
+
import R, { useState as Y, useCallback as Q, useEffect as pe, useMemo as Ut, useRef as $e, useDeferredValue as ga, useContext as $t } from "react";
|
|
4
|
+
import { iconKeys as Lt, debounce as fa, SearchBar as ba, Tooltip as ae, IconButton as me, Icon as rt, coolIconKeys as wt, Typography as P, getIconForView as ot, useAutoComplete as ya, Container as dt, Chip as nt, TextField as Ve, cn as _e, DebouncedTextField as G, Autocomplete as va, AutocompleteItem as wa, ExpandablePanel as kt, SettingsIcon as Ke, Select as je, SelectItem as ye, BooleanSwitchWithLabel as Kt, Dialog as Me, toSnakeCase as Yt, singular as _a, ListIcon as ka, Button as E, CircularProgress as Ye, AutoAwesomeIcon as pt, Paper as Pe, FormikArrayContainer as xa, DialogContent as He, DialogActions as Ge, SwitchControl as ue, serializeRegExp as Ca, isValidRegExp as Oa, RuleIcon as Pa, useSnackbarController as Qe, resolveEnumValues as Na, FileUploadIcon as Sa, MultiSelect as qa, MultiSelectItem as St, Checkbox as qt, isPropertyBuilder as le, useFireCMSContext as qe, getFieldConfig as Ze, ErrorBoundary as Ce, FieldConfigBadge as Je, cardMixin as Ht, cardClickableMixin as Gt, cardSelectedMixin as Qt, RemoveCircleIcon as Zt, FunctionsIcon as Aa, defaultBorderMixin as xt, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ne, useNavigationContext as De, SelectGroup as At, mergeDeep as $, getFieldId as Jt, DEFAULT_FIELD_CONFIGS as _t, InfoLabel as Wt, DeleteIcon as st, DeleteConfirmationDialog as lt, useLargeLayout as Va, makePropertiesEditable as Xt, resolveEntityView as ja, Table as zt, TableBody as Tt, TableRow as ft, TableCell as Ue, unslugify as Ct, Card as ea, useSelectionController as Fa, EntityCollectionTable as Ia, slugify as Ea, useAuthController as Re, CircularProgressCenter as Vt, Tabs as Ba, Tab as bt, removeUndefined as Ma, ErrorView as ta, ArrowBackIcon as tt, LoadingButton as jt, DoneIcon as Da, SaveIcon as Ra, Menu as Ua, MoreVertIcon as $a, MenuItem as La, Collapse as Ka, sortProperties as Ya, getDefaultPropertiesOrder as Ha } from "@firecms/core";
|
|
5
|
+
import ct from "react-fast-compare";
|
|
6
|
+
import { useFormikContext as L, Field as ge, getIn as N, Formik as Ot, FastField as ce, Form as Ga } from "formik";
|
|
7
|
+
import * as yt from "yup";
|
|
8
|
+
import * as Qa from "js-search";
|
|
9
|
+
import { extractEnumFromValues as Za, buildPropertyFromData as Ja, buildEntityPropertiesFromData as Wa } from "@firecms/schema_inference";
|
|
10
|
+
import { DragDropContext as Xa, Droppable as ei, Draggable as ti } from "@hello-pangea/dnd";
|
|
11
|
+
import { ImportFileUpload as ai, DataNewPropertiesMapping as ii, ImportNewPropertyFieldPreview as ri, getInferenceType as aa, getPropertiesMapping as oi, convertDataToEntity as ni, useImportConfig as si, ImportSaveInProgress as li } from "@firecms/data_import";
|
|
12
|
+
import { useNavigate as ci } from "react-router";
|
|
13
|
+
const di = yt.object().shape({
|
|
14
|
+
name: yt.string().required("Required"),
|
|
15
|
+
path: yt.string().required("Required")
|
|
16
|
+
}), ia = {
|
|
17
17
|
abc: "alphabet character font letter symbol text type",
|
|
18
18
|
access_alarm: "clock time",
|
|
19
19
|
access_alarms: "clock time",
|
|
@@ -1962,34 +1962,34 @@ const mi = vt.object().shape({
|
|
|
1962
1962
|
zoom_in_map: "arrows destination location maps move place stop",
|
|
1963
1963
|
zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
|
|
1964
1964
|
zoom_out_map: "arrows destination location maps move place stop"
|
|
1965
|
-
},
|
|
1966
|
-
|
|
1967
|
-
|
|
1965
|
+
}, Pt = new Qa.Search("key");
|
|
1966
|
+
Pt.addIndex("synonyms");
|
|
1967
|
+
Pt.addDocuments(Lt.map((t) => ({
|
|
1968
1968
|
key: t,
|
|
1969
1969
|
// @ts-ignore
|
|
1970
|
-
synonyms:
|
|
1970
|
+
synonyms: ia[t] ?? []
|
|
1971
1971
|
})));
|
|
1972
|
-
const
|
|
1973
|
-
process.env.NODE_ENV !== "production" && Object.keys(
|
|
1974
|
-
|
|
1972
|
+
const pi = 220;
|
|
1973
|
+
process.env.NODE_ENV !== "production" && Object.keys(ia).forEach((t) => {
|
|
1974
|
+
Lt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
|
|
1975
1975
|
});
|
|
1976
|
-
function
|
|
1977
|
-
const [r, i] =
|
|
1978
|
-
() =>
|
|
1976
|
+
function mi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
1977
|
+
const [r, i] = ve.useState(null), [s, o] = ve.useState(""), l = ve.useMemo(
|
|
1978
|
+
() => fa((m) => {
|
|
1979
1979
|
if (!m || m === "")
|
|
1980
1980
|
i(null);
|
|
1981
1981
|
else {
|
|
1982
|
-
const u =
|
|
1982
|
+
const u = Pt.search(m);
|
|
1983
1983
|
i(u.map((c) => c.key));
|
|
1984
1984
|
}
|
|
1985
|
-
},
|
|
1985
|
+
}, pi),
|
|
1986
1986
|
[]
|
|
1987
1987
|
);
|
|
1988
|
-
return
|
|
1988
|
+
return ve.useEffect(() => (l(s), () => {
|
|
1989
1989
|
l.clear();
|
|
1990
1990
|
}), [s, l]), /* @__PURE__ */ n(B, { children: [
|
|
1991
1991
|
/* @__PURE__ */ e(
|
|
1992
|
-
|
|
1992
|
+
ba,
|
|
1993
1993
|
{
|
|
1994
1994
|
autoFocus: !0,
|
|
1995
1995
|
className: "w-full sticky top-0 z-10",
|
|
@@ -1997,25 +1997,25 @@ function hi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
|
1997
1997
|
placeholder: "Search for more icons…"
|
|
1998
1998
|
}
|
|
1999
1999
|
),
|
|
2000
|
-
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ?
|
|
2001
|
-
|
|
2000
|
+
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? wt : r).map((m) => /* @__PURE__ */ e(ae, { title: m, children: /* @__PURE__ */ e(
|
|
2001
|
+
me,
|
|
2002
2002
|
{
|
|
2003
2003
|
shape: "square",
|
|
2004
2004
|
toggled: t === m,
|
|
2005
2005
|
onClick: () => a(m),
|
|
2006
2006
|
className: "box-content m-1",
|
|
2007
|
-
children: /* @__PURE__ */ e(
|
|
2007
|
+
children: /* @__PURE__ */ e(rt, { iconKey: m, size: 24 })
|
|
2008
2008
|
}
|
|
2009
2009
|
) }, m)) })
|
|
2010
2010
|
] });
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function ee({
|
|
2013
2013
|
error: t,
|
|
2014
2014
|
children: a
|
|
2015
2015
|
}) {
|
|
2016
2016
|
return a ? /* @__PURE__ */ e(P, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function ui({
|
|
2019
2019
|
isNewCollection: t,
|
|
2020
2020
|
reservedGroups: a,
|
|
2021
2021
|
existingPaths: r,
|
|
@@ -2032,12 +2032,12 @@ function gi({
|
|
|
2032
2032
|
setFieldTouched: g,
|
|
2033
2033
|
isSubmitting: f,
|
|
2034
2034
|
submitCount: y
|
|
2035
|
-
} = L(), [k, _] =
|
|
2036
|
-
m("name", x), !N(c, "path") && t && x && m("path",
|
|
2037
|
-
}, h =
|
|
2035
|
+
} = L(), [k, _] = Y(!1), O = (x) => {
|
|
2036
|
+
m("name", x), !N(c, "path") && t && x && m("path", Yt(x)), !N(c, "singularName") && t && x && m("singularName", _a(x));
|
|
2037
|
+
}, h = ot(d), w = Q((x) => {
|
|
2038
2038
|
let C;
|
|
2039
2039
|
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 =
|
|
2040
|
+
}, [t, i, r, d.alias]), b = Q((x) => {
|
|
2041
2041
|
if (!x)
|
|
2042
2042
|
return;
|
|
2043
2043
|
let C;
|
|
@@ -2046,10 +2046,10 @@ function gi({
|
|
|
2046
2046
|
inputFocused: T,
|
|
2047
2047
|
autoCompleteOpen: I,
|
|
2048
2048
|
setAutoCompleteOpen: A
|
|
2049
|
-
} =
|
|
2049
|
+
} = ya({
|
|
2050
2050
|
ref: l
|
|
2051
2051
|
}), S = !!o;
|
|
2052
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(
|
|
2052
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(dt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
2053
2053
|
/* @__PURE__ */ n("div", { children: [
|
|
2054
2054
|
/* @__PURE__ */ n(
|
|
2055
2055
|
"div",
|
|
@@ -2057,8 +2057,8 @@ function gi({
|
|
|
2057
2057
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
2058
2058
|
children: [
|
|
2059
2059
|
/* @__PURE__ */ e(P, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${d.name} collection` }),
|
|
2060
|
-
/* @__PURE__ */ e(
|
|
2061
|
-
|
|
2060
|
+
/* @__PURE__ */ e(ae, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
2061
|
+
me,
|
|
2062
2062
|
{
|
|
2063
2063
|
shape: "square",
|
|
2064
2064
|
onClick: () => _(!0),
|
|
@@ -2068,7 +2068,7 @@ function gi({
|
|
|
2068
2068
|
]
|
|
2069
2069
|
}
|
|
2070
2070
|
),
|
|
2071
|
-
o && /* @__PURE__ */ e(
|
|
2071
|
+
o && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
|
|
2072
2072
|
"This is a subcollection of ",
|
|
2073
2073
|
/* @__PURE__ */ e("b", { children: o.name })
|
|
2074
2074
|
] }) })
|
|
@@ -2076,7 +2076,7 @@ function gi({
|
|
|
2076
2076
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
2077
2077
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2078
2078
|
/* @__PURE__ */ e(
|
|
2079
|
-
|
|
2079
|
+
Ve,
|
|
2080
2080
|
{
|
|
2081
2081
|
value: d.name ?? "",
|
|
2082
2082
|
onChange: (x) => O(x.target.value),
|
|
@@ -2085,14 +2085,14 @@ function gi({
|
|
|
2085
2085
|
error: c.name && !!p.name
|
|
2086
2086
|
}
|
|
2087
2087
|
),
|
|
2088
|
-
/* @__PURE__ */ e(
|
|
2088
|
+
/* @__PURE__ */ e(ee, { 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
2089
|
] }),
|
|
2090
|
-
/* @__PURE__ */ n("div", { className:
|
|
2090
|
+
/* @__PURE__ */ n("div", { className: _e("col-span-12 ", S ? "" : "sm:col-span-8"), children: [
|
|
2091
2091
|
/* @__PURE__ */ e(
|
|
2092
|
-
|
|
2092
|
+
ge,
|
|
2093
2093
|
{
|
|
2094
2094
|
name: "path",
|
|
2095
|
-
as:
|
|
2095
|
+
as: G,
|
|
2096
2096
|
label: "Path",
|
|
2097
2097
|
validate: w,
|
|
2098
2098
|
disabled: !t,
|
|
@@ -2100,11 +2100,11 @@ function gi({
|
|
|
2100
2100
|
error: c.path && !!p.path
|
|
2101
2101
|
}
|
|
2102
2102
|
),
|
|
2103
|
-
/* @__PURE__ */ e(
|
|
2103
|
+
/* @__PURE__ */ e(ee, { error: c.path && !!p.path, children: c.path && p.path ? p.path : "Path that this collection is stored in" })
|
|
2104
2104
|
] }),
|
|
2105
2105
|
!S && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
2106
2106
|
/* @__PURE__ */ e(
|
|
2107
|
-
|
|
2107
|
+
Ve,
|
|
2108
2108
|
{
|
|
2109
2109
|
error: c.group && !!p.group,
|
|
2110
2110
|
disabled: f,
|
|
@@ -2117,12 +2117,12 @@ function gi({
|
|
|
2117
2117
|
}
|
|
2118
2118
|
),
|
|
2119
2119
|
/* @__PURE__ */ e(
|
|
2120
|
-
|
|
2120
|
+
va,
|
|
2121
2121
|
{
|
|
2122
2122
|
open: I && (v ?? []).length > 0,
|
|
2123
2123
|
setOpen: A,
|
|
2124
2124
|
children: v?.map((x, C) => /* @__PURE__ */ e(
|
|
2125
|
-
|
|
2125
|
+
wa,
|
|
2126
2126
|
{
|
|
2127
2127
|
onClick: () => {
|
|
2128
2128
|
A(!1), m("group", x ?? null);
|
|
@@ -2133,13 +2133,13 @@ function gi({
|
|
|
2133
2133
|
))
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
|
-
/* @__PURE__ */ e(
|
|
2136
|
+
/* @__PURE__ */ e(ee, { children: c.group && p.group ? p.group : "Group of the collection" })
|
|
2137
2137
|
] }),
|
|
2138
2138
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2139
|
-
|
|
2139
|
+
kt,
|
|
2140
2140
|
{
|
|
2141
2141
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2142
|
-
/* @__PURE__ */ e(
|
|
2142
|
+
/* @__PURE__ */ e(Ke, {}),
|
|
2143
2143
|
/* @__PURE__ */ e(
|
|
2144
2144
|
P,
|
|
2145
2145
|
{
|
|
@@ -2153,7 +2153,7 @@ function gi({
|
|
|
2153
2153
|
children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
|
|
2154
2154
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2155
2155
|
/* @__PURE__ */ e(
|
|
2156
|
-
|
|
2156
|
+
Ve,
|
|
2157
2157
|
{
|
|
2158
2158
|
error: c.singularName && !!p.singularName,
|
|
2159
2159
|
id: "singularName",
|
|
@@ -2163,11 +2163,11 @@ function gi({
|
|
|
2163
2163
|
label: "Singular name"
|
|
2164
2164
|
}
|
|
2165
2165
|
),
|
|
2166
|
-
/* @__PURE__ */ e(
|
|
2166
|
+
/* @__PURE__ */ e(ee, { error: c.singularName && !!p.singularName, children: c.singularName && p.singularName ? p.singularName : "Optionally define a singular name for your entities" })
|
|
2167
2167
|
] }),
|
|
2168
2168
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2169
2169
|
/* @__PURE__ */ e(
|
|
2170
|
-
|
|
2170
|
+
Ve,
|
|
2171
2171
|
{
|
|
2172
2172
|
error: c.description && !!p.description,
|
|
2173
2173
|
id: "description",
|
|
@@ -2179,24 +2179,24 @@ function gi({
|
|
|
2179
2179
|
label: "Description"
|
|
2180
2180
|
}
|
|
2181
2181
|
),
|
|
2182
|
-
/* @__PURE__ */ e(
|
|
2182
|
+
/* @__PURE__ */ e(ee, { error: c.description && !!p.description, children: c.description && p.description ? p.description : "Description of the collection, you can use markdown" })
|
|
2183
2183
|
] }),
|
|
2184
2184
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2185
2185
|
/* @__PURE__ */ e(
|
|
2186
|
-
|
|
2186
|
+
ge,
|
|
2187
2187
|
{
|
|
2188
2188
|
name: "alias",
|
|
2189
|
-
as:
|
|
2189
|
+
as: G,
|
|
2190
2190
|
disabled: !t,
|
|
2191
2191
|
label: "Alias",
|
|
2192
2192
|
validate: b,
|
|
2193
2193
|
error: c.alias && !!p.alias
|
|
2194
2194
|
}
|
|
2195
2195
|
),
|
|
2196
|
-
/* @__PURE__ */ e(
|
|
2196
|
+
/* @__PURE__ */ e(ee, { 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
2197
|
] }),
|
|
2198
2198
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2199
|
-
|
|
2199
|
+
je,
|
|
2200
2200
|
{
|
|
2201
2201
|
name: "defaultSize",
|
|
2202
2202
|
label: "Default row size",
|
|
@@ -2205,7 +2205,7 @@ function gi({
|
|
|
2205
2205
|
value: d.defaultSize ?? "",
|
|
2206
2206
|
renderValue: (x) => x.toUpperCase(),
|
|
2207
2207
|
children: ["xs", "s", "m", "l", "xl"].map((x) => /* @__PURE__ */ e(
|
|
2208
|
-
|
|
2208
|
+
ye,
|
|
2209
2209
|
{
|
|
2210
2210
|
value: x,
|
|
2211
2211
|
children: x.toUpperCase()
|
|
@@ -2216,7 +2216,7 @@ function gi({
|
|
|
2216
2216
|
) }),
|
|
2217
2217
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2218
2218
|
/* @__PURE__ */ e(
|
|
2219
|
-
|
|
2219
|
+
Kt,
|
|
2220
2220
|
{
|
|
2221
2221
|
position: "start",
|
|
2222
2222
|
label: "Collection group",
|
|
@@ -2224,7 +2224,7 @@ function gi({
|
|
|
2224
2224
|
value: d.collectionGroup ?? !1
|
|
2225
2225
|
}
|
|
2226
2226
|
),
|
|
2227
|
-
/* @__PURE__ */ e(
|
|
2227
|
+
/* @__PURE__ */ e(ee, { children: "A collection group consists of all collections with the same ID. This allows you to query over multiple collections at once." })
|
|
2228
2228
|
] })
|
|
2229
2229
|
] })
|
|
2230
2230
|
}
|
|
@@ -2232,14 +2232,14 @@ function gi({
|
|
|
2232
2232
|
] }),
|
|
2233
2233
|
/* @__PURE__ */ e("div", { style: { height: "52px" } }),
|
|
2234
2234
|
/* @__PURE__ */ e(
|
|
2235
|
-
|
|
2235
|
+
Me,
|
|
2236
2236
|
{
|
|
2237
2237
|
open: k,
|
|
2238
2238
|
onOpenChange: _,
|
|
2239
2239
|
maxWidth: "xl",
|
|
2240
2240
|
fullWidth: !0,
|
|
2241
2241
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
2242
|
-
|
|
2242
|
+
mi,
|
|
2243
2243
|
{
|
|
2244
2244
|
selectedIcon: d.icon,
|
|
2245
2245
|
onIconSelected: (x) => {
|
|
@@ -2251,19 +2251,19 @@ function gi({
|
|
|
2251
2251
|
)
|
|
2252
2252
|
] }) });
|
|
2253
2253
|
}
|
|
2254
|
-
function
|
|
2254
|
+
function we(t) {
|
|
2255
2255
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
2256
2256
|
}
|
|
2257
|
-
function
|
|
2257
|
+
function hi(t) {
|
|
2258
2258
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2260
|
+
function Oe(t) {
|
|
2261
2261
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
2262
2262
|
}
|
|
2263
|
-
function
|
|
2263
|
+
function se(t, a) {
|
|
2264
2264
|
return a ? `${a}.${t}` : t;
|
|
2265
2265
|
}
|
|
2266
|
-
const
|
|
2266
|
+
const gi = R.memo(
|
|
2267
2267
|
function({
|
|
2268
2268
|
enumValues: a,
|
|
2269
2269
|
onValuesChanged: r,
|
|
@@ -2274,7 +2274,7 @@ const bi = R.memo(
|
|
|
2274
2274
|
getData: d
|
|
2275
2275
|
}) {
|
|
2276
2276
|
return /* @__PURE__ */ e(
|
|
2277
|
-
|
|
2277
|
+
Ot,
|
|
2278
2278
|
{
|
|
2279
2279
|
initialValues: { enumValues: a },
|
|
2280
2280
|
validateOnMount: !0,
|
|
@@ -2283,12 +2283,12 @@ const bi = R.memo(
|
|
|
2283
2283
|
children: ({
|
|
2284
2284
|
values: m,
|
|
2285
2285
|
errors: u
|
|
2286
|
-
}) => (
|
|
2286
|
+
}) => (pe(() => {
|
|
2287
2287
|
r && r(m.enumValues);
|
|
2288
|
-
}, [m.enumValues]),
|
|
2288
|
+
}, [m.enumValues]), pe(() => {
|
|
2289
2289
|
i && i(!!(u?.enumValues ?? !1));
|
|
2290
2290
|
}, [u]), /* @__PURE__ */ e(
|
|
2291
|
-
|
|
2291
|
+
fi,
|
|
2292
2292
|
{
|
|
2293
2293
|
enumValuesPath: "enumValues",
|
|
2294
2294
|
values: m,
|
|
@@ -2306,7 +2306,7 @@ const bi = R.memo(
|
|
|
2306
2306
|
return a.enumValues.length === r.enumValues.length && a.onValuesChanged === r.onValuesChanged && a.getData === r.getData;
|
|
2307
2307
|
}
|
|
2308
2308
|
);
|
|
2309
|
-
function
|
|
2309
|
+
function fi({
|
|
2310
2310
|
values: t,
|
|
2311
2311
|
errors: a,
|
|
2312
2312
|
disabled: r,
|
|
@@ -2320,7 +2320,7 @@ function yi({
|
|
|
2320
2320
|
} = L(), [m, u] = R.useState(), [c, p] = R.useState(), [g, f] = R.useState(!1), k = R.useRef(/* @__PURE__ */ new Set()).current, _ = (h, w) => {
|
|
2321
2321
|
const b = m === w;
|
|
2322
2322
|
return /* @__PURE__ */ e(
|
|
2323
|
-
|
|
2323
|
+
bi,
|
|
2324
2324
|
{
|
|
2325
2325
|
index: h,
|
|
2326
2326
|
disabled: r,
|
|
@@ -2335,7 +2335,7 @@ function yi({
|
|
|
2335
2335
|
};
|
|
2336
2336
|
return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2337
2337
|
/* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
|
|
2338
|
-
/* @__PURE__ */ e(
|
|
2338
|
+
/* @__PURE__ */ e(ka, {}),
|
|
2339
2339
|
/* @__PURE__ */ e(
|
|
2340
2340
|
P,
|
|
2341
2341
|
{
|
|
@@ -2355,7 +2355,7 @@ function yi({
|
|
|
2355
2355
|
l && (f(!0), l?.().then((h) => {
|
|
2356
2356
|
if (!h)
|
|
2357
2357
|
return;
|
|
2358
|
-
const w = h.flat(), b = Array.from(new Set(w)), v = t.enumValues, I =
|
|
2358
|
+
const w = h.flat(), b = Array.from(new Set(w)), v = t.enumValues, I = Za(b).filter((A) => !v?.some((S) => S.id === A.id));
|
|
2359
2359
|
I.forEach((A) => {
|
|
2360
2360
|
k.add(A.id);
|
|
2361
2361
|
}), d(i, [...I, ...v]);
|
|
@@ -2364,15 +2364,15 @@ function yi({
|
|
|
2364
2364
|
}).finally(() => f(!1)));
|
|
2365
2365
|
},
|
|
2366
2366
|
children: [
|
|
2367
|
-
g ? /* @__PURE__ */ e(
|
|
2367
|
+
g ? /* @__PURE__ */ e(Ye, { size: "small" }) : /* @__PURE__ */ e(pt, {}),
|
|
2368
2368
|
"Infer values from data"
|
|
2369
2369
|
]
|
|
2370
2370
|
}
|
|
2371
2371
|
)
|
|
2372
2372
|
] }),
|
|
2373
|
-
/* @__PURE__ */ n(
|
|
2373
|
+
/* @__PURE__ */ n(Pe, { className: "p-4 m-1", children: [
|
|
2374
2374
|
/* @__PURE__ */ e(
|
|
2375
|
-
|
|
2375
|
+
xa,
|
|
2376
2376
|
{
|
|
2377
2377
|
value: t.enumValues,
|
|
2378
2378
|
addLabel: "Add enum value",
|
|
@@ -2386,7 +2386,7 @@ function yi({
|
|
|
2386
2386
|
}
|
|
2387
2387
|
),
|
|
2388
2388
|
/* @__PURE__ */ e(
|
|
2389
|
-
|
|
2389
|
+
yi,
|
|
2390
2390
|
{
|
|
2391
2391
|
index: c,
|
|
2392
2392
|
open: c !== void 0,
|
|
@@ -2397,7 +2397,7 @@ function yi({
|
|
|
2397
2397
|
] })
|
|
2398
2398
|
] });
|
|
2399
2399
|
}
|
|
2400
|
-
const
|
|
2400
|
+
const bi = R.memo(
|
|
2401
2401
|
function({
|
|
2402
2402
|
index: a,
|
|
2403
2403
|
shouldUpdateId: r,
|
|
@@ -2418,29 +2418,29 @@ const vi = R.memo(
|
|
|
2418
2418
|
(h.current === k || !k) && y && p(`${i}[${a}].id`, _), h.current = _;
|
|
2419
2419
|
}, [_]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
|
|
2420
2420
|
/* @__PURE__ */ e(
|
|
2421
|
-
|
|
2421
|
+
ce,
|
|
2422
2422
|
{
|
|
2423
2423
|
name: `${i}[${a}].label`,
|
|
2424
|
-
as:
|
|
2424
|
+
as: G,
|
|
2425
2425
|
className: "flex-grow",
|
|
2426
2426
|
required: !0,
|
|
2427
2427
|
disabled: l,
|
|
2428
2428
|
size: "small",
|
|
2429
|
-
validate:
|
|
2429
|
+
validate: vi,
|
|
2430
2430
|
autoFocus: s,
|
|
2431
2431
|
autoComplete: "off",
|
|
2432
|
-
endAdornment: d && /* @__PURE__ */ e(
|
|
2432
|
+
endAdornment: d && /* @__PURE__ */ e(pt, { size: "small" }),
|
|
2433
2433
|
error: !!O
|
|
2434
2434
|
}
|
|
2435
2435
|
),
|
|
2436
2436
|
!l && /* @__PURE__ */ e(
|
|
2437
|
-
|
|
2437
|
+
me,
|
|
2438
2438
|
{
|
|
2439
2439
|
size: "small",
|
|
2440
2440
|
"aria-label": "edit",
|
|
2441
2441
|
className: "m-1",
|
|
2442
2442
|
onClick: () => o(),
|
|
2443
|
-
children: /* @__PURE__ */ e(
|
|
2443
|
+
children: /* @__PURE__ */ e(Ke, { size: "small" })
|
|
2444
2444
|
}
|
|
2445
2445
|
)
|
|
2446
2446
|
] });
|
|
@@ -2449,7 +2449,7 @@ const vi = R.memo(
|
|
|
2449
2449
|
return a.index === r.index && a.enumValuesPath === r.enumValuesPath && a.shouldUpdateId === r.shouldUpdateId && a.inferredEntry === r.inferredEntry && a.autoFocus === r.autoFocus;
|
|
2450
2450
|
}
|
|
2451
2451
|
);
|
|
2452
|
-
function
|
|
2452
|
+
function yi({
|
|
2453
2453
|
index: t,
|
|
2454
2454
|
open: a,
|
|
2455
2455
|
onClose: r,
|
|
@@ -2463,30 +2463,30 @@ function wi({
|
|
|
2463
2463
|
touched: m
|
|
2464
2464
|
} = L(), u = t !== void 0 ? N(l, `${i}[${t}].id`) : void 0;
|
|
2465
2465
|
return /* @__PURE__ */ n(
|
|
2466
|
-
|
|
2466
|
+
Me,
|
|
2467
2467
|
{
|
|
2468
2468
|
maxWidth: "md",
|
|
2469
2469
|
"aria-labelledby": "enum-edit-dialog",
|
|
2470
2470
|
open: a,
|
|
2471
2471
|
onOpenChange: (c) => c ? void 0 : r(),
|
|
2472
2472
|
children: [
|
|
2473
|
-
/* @__PURE__ */ e(
|
|
2473
|
+
/* @__PURE__ */ e(He, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
|
|
2474
2474
|
/* @__PURE__ */ e(
|
|
2475
|
-
|
|
2475
|
+
ce,
|
|
2476
2476
|
{
|
|
2477
2477
|
name: `${i}[${t}]id`,
|
|
2478
|
-
as:
|
|
2478
|
+
as: G,
|
|
2479
2479
|
required: !0,
|
|
2480
|
-
validate:
|
|
2480
|
+
validate: wi,
|
|
2481
2481
|
label: "ID",
|
|
2482
2482
|
size: "small",
|
|
2483
2483
|
autoComplete: "off",
|
|
2484
2484
|
error: !!u
|
|
2485
2485
|
}
|
|
2486
2486
|
),
|
|
2487
|
-
/* @__PURE__ */ e(
|
|
2487
|
+
/* @__PURE__ */ e(ee, { error: !!u, children: u ?? "Value saved in the data source" })
|
|
2488
2488
|
] }) }),
|
|
2489
|
-
/* @__PURE__ */ e(
|
|
2489
|
+
/* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(
|
|
2490
2490
|
E,
|
|
2491
2491
|
{
|
|
2492
2492
|
autoFocus: !0,
|
|
@@ -2500,41 +2500,41 @@ function wi({
|
|
|
2500
2500
|
}
|
|
2501
2501
|
);
|
|
2502
2502
|
}
|
|
2503
|
-
function
|
|
2503
|
+
function vi(t) {
|
|
2504
2504
|
let a;
|
|
2505
2505
|
return t || (a = "You must specify a label"), a;
|
|
2506
2506
|
}
|
|
2507
|
-
function
|
|
2507
|
+
function wi(t) {
|
|
2508
2508
|
let a;
|
|
2509
2509
|
return t || (a = "You must specify an ID"), a;
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2511
|
+
function Ie({ disabled: t }) {
|
|
2512
2512
|
const { values: a, handleChange: r } = L(), i = "validation.required", s = "validation.requiredMessage";
|
|
2513
2513
|
return /* @__PURE__ */ n(B, { children: [
|
|
2514
2514
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2515
|
-
|
|
2515
|
+
ce,
|
|
2516
2516
|
{
|
|
2517
2517
|
type: "checkbox",
|
|
2518
2518
|
disabled: t,
|
|
2519
2519
|
name: i,
|
|
2520
2520
|
label: "Required",
|
|
2521
2521
|
tooltip: "You won't be able to save this entity if this value is not set",
|
|
2522
|
-
component:
|
|
2522
|
+
component: ue
|
|
2523
2523
|
}
|
|
2524
2524
|
) }),
|
|
2525
2525
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2526
|
-
|
|
2526
|
+
ce,
|
|
2527
2527
|
{
|
|
2528
2528
|
type: "checkbox",
|
|
2529
2529
|
disabled: t,
|
|
2530
2530
|
name: "validation.unique",
|
|
2531
2531
|
label: "Unique",
|
|
2532
2532
|
tooltip: "There cannot be multiple entities with the same value",
|
|
2533
|
-
component:
|
|
2533
|
+
component: ue
|
|
2534
2534
|
}
|
|
2535
2535
|
) }),
|
|
2536
2536
|
N(a, i) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2537
|
-
|
|
2537
|
+
G,
|
|
2538
2538
|
{
|
|
2539
2539
|
disabled: t,
|
|
2540
2540
|
value: N(a, s),
|
|
@@ -2546,7 +2546,7 @@ function Ee({ disabled: t }) {
|
|
|
2546
2546
|
) })
|
|
2547
2547
|
] });
|
|
2548
2548
|
}
|
|
2549
|
-
function
|
|
2549
|
+
function Be({
|
|
2550
2550
|
length: t,
|
|
2551
2551
|
lowercase: a,
|
|
2552
2552
|
matches: r,
|
|
@@ -2561,44 +2561,44 @@ function Me({
|
|
|
2561
2561
|
values: u,
|
|
2562
2562
|
handleChange: c,
|
|
2563
2563
|
errors: p
|
|
2564
|
-
} = L(), 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 :
|
|
2564
|
+
} = L(), 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 : Ca(b);
|
|
2565
2565
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2566
|
-
/* @__PURE__ */ e(
|
|
2566
|
+
/* @__PURE__ */ e(Ie, { disabled: d }),
|
|
2567
2567
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2568
2568
|
a && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2569
|
-
|
|
2569
|
+
ce,
|
|
2570
2570
|
{
|
|
2571
2571
|
type: "checkbox",
|
|
2572
2572
|
name: O,
|
|
2573
2573
|
label: "Lowercase",
|
|
2574
2574
|
disabled: d,
|
|
2575
|
-
component:
|
|
2575
|
+
component: ue
|
|
2576
2576
|
}
|
|
2577
2577
|
) }),
|
|
2578
2578
|
l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2579
|
-
|
|
2579
|
+
ce,
|
|
2580
2580
|
{
|
|
2581
2581
|
type: "checkbox",
|
|
2582
2582
|
name: h,
|
|
2583
2583
|
label: "Uppercase",
|
|
2584
2584
|
disabled: d,
|
|
2585
|
-
component:
|
|
2585
|
+
component: ue
|
|
2586
2586
|
}
|
|
2587
2587
|
) }),
|
|
2588
2588
|
o && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2589
|
-
|
|
2589
|
+
ce,
|
|
2590
2590
|
{
|
|
2591
2591
|
type: "checkbox",
|
|
2592
2592
|
name: k,
|
|
2593
2593
|
label: "Trim",
|
|
2594
2594
|
disabled: d,
|
|
2595
|
-
component:
|
|
2595
|
+
component: ue
|
|
2596
2596
|
}
|
|
2597
2597
|
) })
|
|
2598
2598
|
] }),
|
|
2599
2599
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2600
2600
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2601
|
-
|
|
2601
|
+
G,
|
|
2602
2602
|
{
|
|
2603
2603
|
value: N(u, g),
|
|
2604
2604
|
label: "Exact length",
|
|
@@ -2610,7 +2610,7 @@ function Me({
|
|
|
2610
2610
|
}
|
|
2611
2611
|
) }),
|
|
2612
2612
|
s && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2613
|
-
|
|
2613
|
+
G,
|
|
2614
2614
|
{
|
|
2615
2615
|
value: N(u, f),
|
|
2616
2616
|
label: "Min length",
|
|
@@ -2622,7 +2622,7 @@ function Me({
|
|
|
2622
2622
|
}
|
|
2623
2623
|
) }),
|
|
2624
2624
|
i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2625
|
-
|
|
2625
|
+
G,
|
|
2626
2626
|
{
|
|
2627
2627
|
value: N(u, y),
|
|
2628
2628
|
label: "Max length",
|
|
@@ -2636,11 +2636,11 @@ function Me({
|
|
|
2636
2636
|
] }),
|
|
2637
2637
|
r && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2638
2638
|
/* @__PURE__ */ e(
|
|
2639
|
-
|
|
2639
|
+
ce,
|
|
2640
2640
|
{
|
|
2641
2641
|
name: _,
|
|
2642
|
-
as:
|
|
2643
|
-
validate: (T) => T && !
|
|
2642
|
+
as: G,
|
|
2643
|
+
validate: (T) => T && !Oa(T),
|
|
2644
2644
|
label: "Matches regex",
|
|
2645
2645
|
size: "small",
|
|
2646
2646
|
disabled: d,
|
|
@@ -2648,11 +2648,11 @@ function Me({
|
|
|
2648
2648
|
error: !!w
|
|
2649
2649
|
}
|
|
2650
2650
|
),
|
|
2651
|
-
/* @__PURE__ */ e(
|
|
2651
|
+
/* @__PURE__ */ e(ee, { error: !!w, children: w ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
|
|
2652
2652
|
] })
|
|
2653
2653
|
] });
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function Nt({
|
|
2656
2656
|
max: t = !0,
|
|
2657
2657
|
min: a = !0,
|
|
2658
2658
|
disabled: r
|
|
@@ -2662,9 +2662,9 @@ function qt({
|
|
|
2662
2662
|
handleChange: s
|
|
2663
2663
|
} = L(), o = "validation.min", l = "validation.max";
|
|
2664
2664
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2665
|
-
/* @__PURE__ */ e(
|
|
2665
|
+
/* @__PURE__ */ e(Ie, { disabled: r }),
|
|
2666
2666
|
a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2667
|
-
|
|
2667
|
+
G,
|
|
2668
2668
|
{
|
|
2669
2669
|
value: N(i, o),
|
|
2670
2670
|
disabled: r,
|
|
@@ -2676,7 +2676,7 @@ function qt({
|
|
|
2676
2676
|
}
|
|
2677
2677
|
) }),
|
|
2678
2678
|
t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2679
|
-
|
|
2679
|
+
G,
|
|
2680
2680
|
{
|
|
2681
2681
|
value: N(i, l),
|
|
2682
2682
|
disabled: r,
|
|
@@ -2689,17 +2689,17 @@ function qt({
|
|
|
2689
2689
|
) })
|
|
2690
2690
|
] });
|
|
2691
2691
|
}
|
|
2692
|
-
function
|
|
2692
|
+
function Ae({
|
|
2693
2693
|
children: t
|
|
2694
2694
|
}) {
|
|
2695
2695
|
return /* @__PURE__ */ e(
|
|
2696
|
-
|
|
2696
|
+
kt,
|
|
2697
2697
|
{
|
|
2698
2698
|
initiallyExpanded: !1,
|
|
2699
2699
|
asField: !0,
|
|
2700
2700
|
className: "p-4",
|
|
2701
2701
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2702
|
-
/* @__PURE__ */ e(
|
|
2702
|
+
/* @__PURE__ */ e(Pa, {}),
|
|
2703
2703
|
/* @__PURE__ */ e(
|
|
2704
2704
|
P,
|
|
2705
2705
|
{
|
|
@@ -2713,7 +2713,7 @@ function ze({
|
|
|
2713
2713
|
}
|
|
2714
2714
|
);
|
|
2715
2715
|
}
|
|
2716
|
-
function
|
|
2716
|
+
function Ft({
|
|
2717
2717
|
multiselect: t,
|
|
2718
2718
|
updateIds: a,
|
|
2719
2719
|
disabled: r,
|
|
@@ -2728,10 +2728,10 @@ function Et({
|
|
|
2728
2728
|
touched: u,
|
|
2729
2729
|
setFieldError: c,
|
|
2730
2730
|
setFieldValue: p
|
|
2731
|
-
} = L(), g =
|
|
2731
|
+
} = L(), g = Qe(), f = t ? "of.enumValues" : "enumValues", y = N(l, "defaultValue"), k = N(l, f), _ = Ut(() => !k || typeof k == "boolean" ? [] : Na(k) ?? [], [k]);
|
|
2732
2732
|
return /* @__PURE__ */ n(B, { children: [
|
|
2733
2733
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2734
|
-
|
|
2734
|
+
gi,
|
|
2735
2735
|
{
|
|
2736
2736
|
enumValues: _,
|
|
2737
2737
|
updateIds: a,
|
|
@@ -2752,18 +2752,18 @@ function Et({
|
|
|
2752
2752
|
}
|
|
2753
2753
|
}
|
|
2754
2754
|
) }),
|
|
2755
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2755
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
|
|
2756
2756
|
!t && /* @__PURE__ */ e(
|
|
2757
|
-
|
|
2757
|
+
Be,
|
|
2758
2758
|
{
|
|
2759
2759
|
disabled: r,
|
|
2760
2760
|
showErrors: i
|
|
2761
2761
|
}
|
|
2762
2762
|
),
|
|
2763
|
-
t && /* @__PURE__ */ e(
|
|
2763
|
+
t && /* @__PURE__ */ e(Nt, { disabled: r })
|
|
2764
2764
|
] }) }),
|
|
2765
2765
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2766
|
-
|
|
2766
|
+
je,
|
|
2767
2767
|
{
|
|
2768
2768
|
disabled: r,
|
|
2769
2769
|
position: "item-aligned",
|
|
@@ -2773,7 +2773,7 @@ function Et({
|
|
|
2773
2773
|
label: "Default value",
|
|
2774
2774
|
value: y ?? "",
|
|
2775
2775
|
children: _.filter((h) => !!h?.id).map((h) => /* @__PURE__ */ e(
|
|
2776
|
-
|
|
2776
|
+
ye,
|
|
2777
2777
|
{
|
|
2778
2778
|
value: h.id?.toString(),
|
|
2779
2779
|
children: h.label
|
|
@@ -2784,14 +2784,14 @@ function Et({
|
|
|
2784
2784
|
) })
|
|
2785
2785
|
] });
|
|
2786
2786
|
}
|
|
2787
|
-
const
|
|
2787
|
+
const at = {
|
|
2788
2788
|
"image/*": "Images",
|
|
2789
2789
|
"video/*": "Videos",
|
|
2790
2790
|
"audio/*": "Audio files",
|
|
2791
2791
|
"application/*": "Files (pdf, zip, csv, excel...)",
|
|
2792
2792
|
"text/*": "Text files"
|
|
2793
2793
|
};
|
|
2794
|
-
function
|
|
2794
|
+
function It({
|
|
2795
2795
|
multiple: t,
|
|
2796
2796
|
existing: a,
|
|
2797
2797
|
disabled: r
|
|
@@ -2800,14 +2800,14 @@ function Bt({
|
|
|
2800
2800
|
values: i,
|
|
2801
2801
|
setFieldValue: s
|
|
2802
2802
|
} = L(), 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) => {
|
|
2803
|
-
h ? h.includes("all") || h.length >= Object.keys(
|
|
2803
|
+
h ? h.includes("all") || h.length >= Object.keys(at).length ? s(l, void 0) : y ? s(l, Object.keys(at).filter((w) => !h.includes(w))) : s(l, h) : s(l, void 0);
|
|
2804
2804
|
}, _ = typeof c == "function", O = typeof p == "function";
|
|
2805
2805
|
return /* @__PURE__ */ n(B, { children: [
|
|
2806
2806
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2807
|
-
|
|
2807
|
+
kt,
|
|
2808
2808
|
{
|
|
2809
2809
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2810
|
-
/* @__PURE__ */ e(
|
|
2810
|
+
/* @__PURE__ */ e(Sa, {}),
|
|
2811
2811
|
/* @__PURE__ */ e(
|
|
2812
2812
|
P,
|
|
2813
2813
|
{
|
|
@@ -2819,27 +2819,27 @@ function Bt({
|
|
|
2819
2819
|
] }),
|
|
2820
2820
|
children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
|
|
2821
2821
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2822
|
-
|
|
2822
|
+
qa,
|
|
2823
2823
|
{
|
|
2824
2824
|
disabled: r,
|
|
2825
2825
|
name: l,
|
|
2826
2826
|
value: f ?? [],
|
|
2827
2827
|
onMultiValueChange: k,
|
|
2828
2828
|
label: y ? void 0 : "Allowed file types",
|
|
2829
|
-
renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((w) =>
|
|
2829
|
+
renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((w) => at[w]).filter((w) => !!w).join(", "),
|
|
2830
2830
|
children: [
|
|
2831
|
-
/* @__PURE__ */ n(
|
|
2831
|
+
/* @__PURE__ */ n(St, { value: "all", className: "flex items-center gap-2", children: [
|
|
2832
2832
|
/* @__PURE__ */ e(
|
|
2833
|
-
|
|
2833
|
+
qt,
|
|
2834
2834
|
{
|
|
2835
2835
|
checked: !f
|
|
2836
2836
|
}
|
|
2837
2837
|
),
|
|
2838
2838
|
"All"
|
|
2839
2839
|
] }, "all"),
|
|
2840
|
-
Object.entries(
|
|
2840
|
+
Object.entries(at).map(([h, w]) => /* @__PURE__ */ n(St, { value: h, className: "flex items-center gap-2", children: [
|
|
2841
2841
|
/* @__PURE__ */ e(
|
|
2842
|
-
|
|
2842
|
+
qt,
|
|
2843
2843
|
{
|
|
2844
2844
|
checked: y || f.indexOf(h) > -1
|
|
2845
2845
|
}
|
|
@@ -2859,10 +2859,10 @@ function Bt({
|
|
|
2859
2859
|
}
|
|
2860
2860
|
) }),
|
|
2861
2861
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2862
|
-
|
|
2862
|
+
ge,
|
|
2863
2863
|
{
|
|
2864
2864
|
name: d,
|
|
2865
|
-
as:
|
|
2865
|
+
as: G,
|
|
2866
2866
|
label: "File name",
|
|
2867
2867
|
size: "small",
|
|
2868
2868
|
disabled: _ || r,
|
|
@@ -2871,10 +2871,10 @@ function Bt({
|
|
|
2871
2871
|
) }),
|
|
2872
2872
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2873
2873
|
/* @__PURE__ */ e(
|
|
2874
|
-
|
|
2874
|
+
ge,
|
|
2875
2875
|
{
|
|
2876
2876
|
name: m,
|
|
2877
|
-
as:
|
|
2877
|
+
as: G,
|
|
2878
2878
|
label: "Storage path",
|
|
2879
2879
|
disabled: O || r,
|
|
2880
2880
|
size: "small",
|
|
@@ -2894,13 +2894,13 @@ function Bt({
|
|
|
2894
2894
|
] })
|
|
2895
2895
|
] }),
|
|
2896
2896
|
/* @__PURE__ */ e(
|
|
2897
|
-
|
|
2897
|
+
ge,
|
|
2898
2898
|
{
|
|
2899
2899
|
type: "checkbox",
|
|
2900
2900
|
name: u,
|
|
2901
2901
|
label: "Save URL instead of storage path",
|
|
2902
2902
|
disabled: a || r,
|
|
2903
|
-
component:
|
|
2903
|
+
component: ue
|
|
2904
2904
|
}
|
|
2905
2905
|
),
|
|
2906
2906
|
/* @__PURE__ */ e("br", {}),
|
|
@@ -2909,33 +2909,33 @@ function Bt({
|
|
|
2909
2909
|
] })
|
|
2910
2910
|
}
|
|
2911
2911
|
) }),
|
|
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(
|
|
2912
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
|
|
2913
|
+
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ie, { disabled: r }) }),
|
|
2914
|
+
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Nt, { disabled: r }) })
|
|
2915
2915
|
] }) })
|
|
2916
2916
|
] });
|
|
2917
2917
|
}
|
|
2918
|
-
function
|
|
2919
|
-
if (
|
|
2918
|
+
function Le(t) {
|
|
2919
|
+
if (le(t) || le(t))
|
|
2920
2920
|
return !1;
|
|
2921
2921
|
{
|
|
2922
2922
|
const a = t;
|
|
2923
2923
|
return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
|
|
2924
2924
|
}
|
|
2925
2925
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return Object.entries(t).filter(([a, r]) =>
|
|
2926
|
+
function _i(t) {
|
|
2927
|
+
return Object.entries(t).filter(([a, r]) => Le(r)).map(([a, r]) => {
|
|
2928
2928
|
const i = r;
|
|
2929
|
-
if (
|
|
2929
|
+
if (Le(i))
|
|
2930
2930
|
return i.dataType === "map" && i.properties ? {
|
|
2931
2931
|
[a]: {
|
|
2932
2932
|
...i,
|
|
2933
|
-
properties:
|
|
2933
|
+
properties: _i(i.properties)
|
|
2934
2934
|
}
|
|
2935
2935
|
} : { [a]: i };
|
|
2936
2936
|
}).filter((a) => !!a).reduce((a, r) => ({ ...a, ...r }), {});
|
|
2937
2937
|
}
|
|
2938
|
-
function
|
|
2938
|
+
function ra({
|
|
2939
2939
|
property: t,
|
|
2940
2940
|
onClick: a,
|
|
2941
2941
|
hasError: r,
|
|
@@ -2943,28 +2943,28 @@ function na({
|
|
|
2943
2943
|
includeEditButton: s,
|
|
2944
2944
|
selected: o
|
|
2945
2945
|
}) {
|
|
2946
|
-
const { fields: l } =
|
|
2947
|
-
return /* @__PURE__ */ e(
|
|
2946
|
+
const { fields: l } = qe(), d = Ze(t, l), m = !Le(t);
|
|
2947
|
+
return /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
2948
2948
|
"div",
|
|
2949
2949
|
{
|
|
2950
2950
|
onClick: a,
|
|
2951
2951
|
className: "flex flex-row w-full cursor-pointer",
|
|
2952
2952
|
children: [
|
|
2953
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(
|
|
2953
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Je, { propertyConfig: d }) }),
|
|
2954
2954
|
/* @__PURE__ */ n(
|
|
2955
|
-
|
|
2955
|
+
Pe,
|
|
2956
2956
|
{
|
|
2957
|
-
className:
|
|
2957
|
+
className: _e(
|
|
2958
2958
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
2959
|
-
|
|
2960
|
-
a ?
|
|
2961
|
-
o ?
|
|
2959
|
+
Ht,
|
|
2960
|
+
a ? Gt : "",
|
|
2961
|
+
o ? Qt : "",
|
|
2962
2962
|
"flex-grow p-4 border transition-colors duration-200",
|
|
2963
2963
|
r ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
|
|
2964
2964
|
),
|
|
2965
2965
|
children: [
|
|
2966
2966
|
/* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
|
|
2967
|
-
i && /* @__PURE__ */ e(
|
|
2967
|
+
i && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
2968
2968
|
P,
|
|
2969
2969
|
{
|
|
2970
2970
|
variant: "body1",
|
|
@@ -2974,7 +2974,7 @@ function na({
|
|
|
2974
2974
|
}
|
|
2975
2975
|
) }),
|
|
2976
2976
|
/* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
|
|
2977
|
-
/* @__PURE__ */ e(
|
|
2977
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
2978
2978
|
P,
|
|
2979
2979
|
{
|
|
2980
2980
|
className: "flex-grow pr-2",
|
|
@@ -2984,7 +2984,7 @@ function na({
|
|
|
2984
2984
|
children: d?.name
|
|
2985
2985
|
}
|
|
2986
2986
|
) }),
|
|
2987
|
-
/* @__PURE__ */ e(
|
|
2987
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
2988
2988
|
P,
|
|
2989
2989
|
{
|
|
2990
2990
|
variant: "body2",
|
|
@@ -2997,7 +2997,7 @@ function na({
|
|
|
2997
2997
|
"div",
|
|
2998
2998
|
{
|
|
2999
2999
|
className: "text-xs h-3 ml-0.5",
|
|
3000
|
-
children: /* @__PURE__ */ e(
|
|
3000
|
+
children: /* @__PURE__ */ e(Zt, { color: "disabled" })
|
|
3001
3001
|
}
|
|
3002
3002
|
)
|
|
3003
3003
|
] })
|
|
@@ -3010,13 +3010,13 @@ function na({
|
|
|
3010
3010
|
}
|
|
3011
3011
|
) });
|
|
3012
3012
|
}
|
|
3013
|
-
function
|
|
3013
|
+
function ki({
|
|
3014
3014
|
name: t,
|
|
3015
3015
|
selected: a,
|
|
3016
3016
|
onClick: r,
|
|
3017
3017
|
property: i
|
|
3018
3018
|
}) {
|
|
3019
|
-
const { fields: s } =
|
|
3019
|
+
const { fields: s } = qe(), o = !le(i) && i ? Ze(i, s) : void 0;
|
|
3020
3020
|
return /* @__PURE__ */ n(
|
|
3021
3021
|
"div",
|
|
3022
3022
|
{
|
|
@@ -3024,24 +3024,24 @@ function Ci({
|
|
|
3024
3024
|
className: "flex flex-row w-full cursor-pointer",
|
|
3025
3025
|
children: [
|
|
3026
3026
|
/* @__PURE__ */ n("div", { className: "relative m-4", children: [
|
|
3027
|
-
o && /* @__PURE__ */ e(
|
|
3027
|
+
o && /* @__PURE__ */ e(Je, { propertyConfig: o }),
|
|
3028
3028
|
!o && /* @__PURE__ */ e(
|
|
3029
3029
|
"div",
|
|
3030
3030
|
{
|
|
3031
3031
|
className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
|
|
3032
|
-
children: /* @__PURE__ */ e(
|
|
3032
|
+
children: /* @__PURE__ */ e(Aa, { color: "inherit", size: "medium" })
|
|
3033
3033
|
}
|
|
3034
3034
|
),
|
|
3035
|
-
/* @__PURE__ */ e(
|
|
3035
|
+
/* @__PURE__ */ e(Zt, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
3036
3036
|
] }),
|
|
3037
3037
|
/* @__PURE__ */ e(
|
|
3038
|
-
|
|
3038
|
+
Pe,
|
|
3039
3039
|
{
|
|
3040
|
-
className:
|
|
3040
|
+
className: _e(
|
|
3041
3041
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
3042
|
-
|
|
3043
|
-
r ?
|
|
3044
|
-
a ?
|
|
3042
|
+
Ht,
|
|
3043
|
+
r ? Gt : "",
|
|
3044
|
+
a ? Qt : "",
|
|
3045
3045
|
"flex-grow p-4 border transition-colors duration-200",
|
|
3046
3046
|
a ? "border-blue-500" : "border-transparent"
|
|
3047
3047
|
),
|
|
@@ -3066,7 +3066,7 @@ function Ci({
|
|
|
3066
3066
|
children: o?.name
|
|
3067
3067
|
}
|
|
3068
3068
|
),
|
|
3069
|
-
i && !
|
|
3069
|
+
i && !le(i) && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
3070
3070
|
P,
|
|
3071
3071
|
{
|
|
3072
3072
|
variant: "body2",
|
|
@@ -3075,7 +3075,7 @@ function Ci({
|
|
|
3075
3075
|
children: i.dataType
|
|
3076
3076
|
}
|
|
3077
3077
|
) }),
|
|
3078
|
-
i &&
|
|
3078
|
+
i && le(i) && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
3079
3079
|
P,
|
|
3080
3080
|
{
|
|
3081
3081
|
variant: "body2",
|
|
@@ -3084,7 +3084,7 @@ function Ci({
|
|
|
3084
3084
|
children: "This property is defined as a property builder in code"
|
|
3085
3085
|
}
|
|
3086
3086
|
) }),
|
|
3087
|
-
!i && /* @__PURE__ */ e(
|
|
3087
|
+
!i && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
3088
3088
|
P,
|
|
3089
3089
|
{
|
|
3090
3090
|
variant: "body2",
|
|
@@ -3101,7 +3101,7 @@ function Ci({
|
|
|
3101
3101
|
}
|
|
3102
3102
|
);
|
|
3103
3103
|
}
|
|
3104
|
-
function
|
|
3104
|
+
function mt({
|
|
3105
3105
|
namespace: t,
|
|
3106
3106
|
selectedPropertyKey: a,
|
|
3107
3107
|
onPropertyClick: r,
|
|
@@ -3115,13 +3115,13 @@ function ut({
|
|
|
3115
3115
|
inferredPropertyKeys: c,
|
|
3116
3116
|
collectionEditable: p
|
|
3117
3117
|
}) {
|
|
3118
|
-
const g = s ?? Object.keys(i), f =
|
|
3118
|
+
const g = s ?? Object.keys(i), f = Q((y) => {
|
|
3119
3119
|
if (!y.destination)
|
|
3120
3120
|
return;
|
|
3121
3121
|
const k = y.source.index, _ = y.destination.index, O = Array.from(g), [h] = O.splice(k, 1);
|
|
3122
3122
|
O.splice(_, 0, h), d && d(O, t);
|
|
3123
3123
|
}, [t, d, g]);
|
|
3124
|
-
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
3124
|
+
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(Xa, { onDragEnd: f, children: /* @__PURE__ */ e(ei, { droppableId: `droppable_${t}`, children: (y, k) => /* @__PURE__ */ n(
|
|
3125
3125
|
"div",
|
|
3126
3126
|
{
|
|
3127
3127
|
...y.droppableProps,
|
|
@@ -3131,12 +3131,12 @@ function ut({
|
|
|
3131
3131
|
g && g.map((_, O) => {
|
|
3132
3132
|
const h = i[_], w = o?.find((b) => b.id === _);
|
|
3133
3133
|
return !h && !w ? (console.warn(`Property ${_} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
3134
|
-
|
|
3134
|
+
ti,
|
|
3135
3135
|
{
|
|
3136
3136
|
draggableId: `array_field_${t}_${_}}`,
|
|
3137
3137
|
index: O,
|
|
3138
|
-
children: (b, v) => /* @__PURE__ */ e(
|
|
3139
|
-
|
|
3138
|
+
children: (b, v) => /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
3139
|
+
xi,
|
|
3140
3140
|
{
|
|
3141
3141
|
propertyKey: _,
|
|
3142
3142
|
propertyOrBuilder: h,
|
|
@@ -3161,7 +3161,7 @@ function ut({
|
|
|
3161
3161
|
}
|
|
3162
3162
|
) }) }) });
|
|
3163
3163
|
}
|
|
3164
|
-
function
|
|
3164
|
+
function xi({
|
|
3165
3165
|
propertyKey: t,
|
|
3166
3166
|
namespace: a,
|
|
3167
3167
|
propertyOrBuilder: r,
|
|
@@ -3175,12 +3175,12 @@ function Oi({
|
|
|
3175
3175
|
inferredPropertyKeys: c,
|
|
3176
3176
|
collectionEditable: p
|
|
3177
3177
|
}) {
|
|
3178
|
-
const g = c?.includes(a ? `${a}.${t}` : t), f =
|
|
3178
|
+
const g = c?.includes(a ? `${a}.${t}` : t), f = se(t, a);
|
|
3179
3179
|
let y;
|
|
3180
3180
|
if (typeof r == "object") {
|
|
3181
3181
|
const h = r;
|
|
3182
3182
|
h.dataType === "map" && h.properties && (y = /* @__PURE__ */ e(
|
|
3183
|
-
|
|
3183
|
+
mt,
|
|
3184
3184
|
{
|
|
3185
3185
|
selectedPropertyKey: o,
|
|
3186
3186
|
namespace: f,
|
|
@@ -3194,7 +3194,7 @@ function Oi({
|
|
|
3194
3194
|
}
|
|
3195
3195
|
));
|
|
3196
3196
|
}
|
|
3197
|
-
const k = f ? N(l,
|
|
3197
|
+
const k = f ? N(l, we(f)) : !1, _ = o === f, O = r && (p && !le(r) || Le(r));
|
|
3198
3198
|
return /* @__PURE__ */ n(
|
|
3199
3199
|
"div",
|
|
3200
3200
|
{
|
|
@@ -3206,7 +3206,7 @@ function Oi({
|
|
|
3206
3206
|
y && /* @__PURE__ */ e(
|
|
3207
3207
|
"div",
|
|
3208
3208
|
{
|
|
3209
|
-
className: "absolute border-l " +
|
|
3209
|
+
className: "absolute border-l " + xt,
|
|
3210
3210
|
style: {
|
|
3211
3211
|
left: "32px",
|
|
3212
3212
|
top: "64px",
|
|
@@ -3214,8 +3214,8 @@ function Oi({
|
|
|
3214
3214
|
}
|
|
3215
3215
|
}
|
|
3216
3216
|
),
|
|
3217
|
-
!
|
|
3218
|
-
|
|
3217
|
+
!le(r) && !i && O ? /* @__PURE__ */ e(
|
|
3218
|
+
ra,
|
|
3219
3219
|
{
|
|
3220
3220
|
property: r,
|
|
3221
3221
|
onClick: d ? () => d(t, a) : void 0,
|
|
@@ -3224,7 +3224,7 @@ function Oi({
|
|
|
3224
3224
|
hasError: k
|
|
3225
3225
|
}
|
|
3226
3226
|
) : /* @__PURE__ */ e(
|
|
3227
|
-
|
|
3227
|
+
ki,
|
|
3228
3228
|
{
|
|
3229
3229
|
name: t,
|
|
3230
3230
|
property: r,
|
|
@@ -3233,22 +3233,22 @@ function Oi({
|
|
|
3233
3233
|
}
|
|
3234
3234
|
),
|
|
3235
3235
|
/* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
3236
|
-
g && /* @__PURE__ */ e(
|
|
3237
|
-
u && /* @__PURE__ */ e(
|
|
3238
|
-
|
|
3236
|
+
g && /* @__PURE__ */ e(ae, { title: "Inferred property", children: /* @__PURE__ */ e(pt, { size: "small", className: "p-2" }) }),
|
|
3237
|
+
u && /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3238
|
+
me,
|
|
3239
3239
|
{
|
|
3240
3240
|
size: "small",
|
|
3241
3241
|
color: "inherit",
|
|
3242
3242
|
onClick: () => u(t, a),
|
|
3243
|
-
children: /* @__PURE__ */ e(
|
|
3243
|
+
children: /* @__PURE__ */ e(za, { size: "small" })
|
|
3244
3244
|
}
|
|
3245
3245
|
) }),
|
|
3246
|
-
m && /* @__PURE__ */ e(
|
|
3247
|
-
|
|
3246
|
+
m && /* @__PURE__ */ e(ae, { title: "Move", children: /* @__PURE__ */ e(
|
|
3247
|
+
me,
|
|
3248
3248
|
{
|
|
3249
3249
|
component: "span",
|
|
3250
3250
|
size: "small",
|
|
3251
|
-
children: /* @__PURE__ */ e(
|
|
3251
|
+
children: /* @__PURE__ */ e(Ta, { size: "small" })
|
|
3252
3252
|
}
|
|
3253
3253
|
) })
|
|
3254
3254
|
] }),
|
|
@@ -3257,11 +3257,11 @@ function Oi({
|
|
|
3257
3257
|
}
|
|
3258
3258
|
);
|
|
3259
3259
|
}
|
|
3260
|
-
function
|
|
3260
|
+
function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
|
|
3261
3261
|
const {
|
|
3262
3262
|
values: o,
|
|
3263
3263
|
setFieldValue: l
|
|
3264
|
-
} = L(), [d, m] =
|
|
3264
|
+
} = L(), [d, m] = Y(!1), [u, c] = Y(), [p, g] = Y(), f = o.propertiesOrder ?? Object.keys(o.properties ?? {}), y = Q(({
|
|
3265
3265
|
id: v,
|
|
3266
3266
|
property: T
|
|
3267
3267
|
}) => {
|
|
@@ -3271,26 +3271,26 @@ function Pi({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3271
3271
|
...o.properties ?? {},
|
|
3272
3272
|
[v]: T
|
|
3273
3273
|
}, !1), l("propertiesOrder", [...f, v], !1), m(!1);
|
|
3274
|
-
}, [o.properties, f]), k =
|
|
3275
|
-
const I = v ?
|
|
3274
|
+
}, [o.properties, f]), k = Q((v, T) => {
|
|
3275
|
+
const I = v ? se(v, T) : void 0;
|
|
3276
3276
|
if (!I)
|
|
3277
3277
|
throw Error("collection editor miss config");
|
|
3278
|
-
const A =
|
|
3278
|
+
const A = we(I), S = Oe(T), x = N(o, S) ?? Object.keys(N(o, hi(T)));
|
|
3279
3279
|
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 ?
|
|
3280
|
+
}, [l, o]), _ = u ? se(u, p) : void 0, O = _ ? N(o.properties, _.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
|
|
3281
3281
|
E,
|
|
3282
3282
|
{
|
|
3283
3283
|
color: "primary",
|
|
3284
3284
|
variant: "outlined",
|
|
3285
3285
|
onClick: () => m(!0),
|
|
3286
|
-
startIcon: /* @__PURE__ */ e(
|
|
3286
|
+
startIcon: /* @__PURE__ */ e(Ne, {}),
|
|
3287
3287
|
children: [
|
|
3288
3288
|
"Add property to ",
|
|
3289
3289
|
o.name ?? "this group"
|
|
3290
3290
|
]
|
|
3291
3291
|
}
|
|
3292
|
-
), w = !f || f.length < 1, b =
|
|
3293
|
-
l(
|
|
3292
|
+
), w = !f || f.length < 1, b = Q((v, T) => {
|
|
3293
|
+
l(Oe(T), v, !1);
|
|
3294
3294
|
}, []);
|
|
3295
3295
|
return /* @__PURE__ */ n(B, { children: [
|
|
3296
3296
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
@@ -3298,9 +3298,9 @@ function Pi({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3298
3298
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this group" }),
|
|
3299
3299
|
h
|
|
3300
3300
|
] }),
|
|
3301
|
-
/* @__PURE__ */ n(
|
|
3301
|
+
/* @__PURE__ */ n(Pe, { className: "p-2 pl-8", children: [
|
|
3302
3302
|
/* @__PURE__ */ e(
|
|
3303
|
-
|
|
3303
|
+
mt,
|
|
3304
3304
|
{
|
|
3305
3305
|
properties: o.properties ?? {},
|
|
3306
3306
|
propertiesOrder: f,
|
|
@@ -3324,7 +3324,7 @@ function Pi({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3324
3324
|
] }),
|
|
3325
3325
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3326
3326
|
/* @__PURE__ */ e(
|
|
3327
|
-
|
|
3327
|
+
Kt,
|
|
3328
3328
|
{
|
|
3329
3329
|
position: "start",
|
|
3330
3330
|
size: "small",
|
|
@@ -3333,10 +3333,10 @@ function Pi({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3333
3333
|
value: o.spreadChildren ?? !1
|
|
3334
3334
|
}
|
|
3335
3335
|
),
|
|
3336
|
-
/* @__PURE__ */ e(
|
|
3336
|
+
/* @__PURE__ */ e(ee, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
|
|
3337
3337
|
] }),
|
|
3338
3338
|
/* @__PURE__ */ e(
|
|
3339
|
-
|
|
3339
|
+
Fe,
|
|
3340
3340
|
{
|
|
3341
3341
|
inArray: !1,
|
|
3342
3342
|
forceShowErrors: !1,
|
|
@@ -3364,7 +3364,7 @@ function Pi({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3364
3364
|
)
|
|
3365
3365
|
] });
|
|
3366
3366
|
}
|
|
3367
|
-
function
|
|
3367
|
+
function Oi({
|
|
3368
3368
|
showErrors: t,
|
|
3369
3369
|
existing: a,
|
|
3370
3370
|
disabled: r,
|
|
@@ -3373,27 +3373,27 @@ function Ni({
|
|
|
3373
3373
|
customFields: o,
|
|
3374
3374
|
collectionEditable: l
|
|
3375
3375
|
}) {
|
|
3376
|
-
const { fields: d } =
|
|
3376
|
+
const { fields: d } = qe(), {
|
|
3377
3377
|
values: m,
|
|
3378
3378
|
handleChange: u,
|
|
3379
3379
|
errors: c,
|
|
3380
3380
|
setFieldValue: p,
|
|
3381
3381
|
touched: g
|
|
3382
|
-
} = L(), [f, y] =
|
|
3382
|
+
} = L(), [f, y] = Y(!1), k = N(m, "of"), _ = N(g, "of") && N(c, "of"), O = Q(({ id: w, property: b, namespace: v }) => {
|
|
3383
3383
|
p("of", b);
|
|
3384
|
-
}, []), h = k &&
|
|
3384
|
+
}, []), h = k && Ze(k, d);
|
|
3385
3385
|
return /* @__PURE__ */ n(B, { children: [
|
|
3386
3386
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3387
3387
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Repeat component" }),
|
|
3388
3388
|
/* @__PURE__ */ e(
|
|
3389
|
-
|
|
3389
|
+
ge,
|
|
3390
3390
|
{
|
|
3391
3391
|
name: "of",
|
|
3392
3392
|
value: k,
|
|
3393
3393
|
validate: (w) => w?.dataType ? void 0 : "You need to specify a repeat field",
|
|
3394
|
-
children: () => /* @__PURE__ */ n(
|
|
3394
|
+
children: () => /* @__PURE__ */ n(Pe, { className: "p-2 mt-4", children: [
|
|
3395
3395
|
k && /* @__PURE__ */ e(
|
|
3396
|
-
|
|
3396
|
+
ra,
|
|
3397
3397
|
{
|
|
3398
3398
|
property: k,
|
|
3399
3399
|
onClick: r ? void 0 : () => y(!0),
|
|
@@ -3417,7 +3417,7 @@ function Ni({
|
|
|
3417
3417
|
}
|
|
3418
3418
|
),
|
|
3419
3419
|
/* @__PURE__ */ e(
|
|
3420
|
-
|
|
3420
|
+
Fe,
|
|
3421
3421
|
{
|
|
3422
3422
|
inArray: !0,
|
|
3423
3423
|
open: f,
|
|
@@ -3439,10 +3439,10 @@ function Ni({
|
|
|
3439
3439
|
}
|
|
3440
3440
|
)
|
|
3441
3441
|
] }),
|
|
3442
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3442
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Nt, { disabled: r }) }) })
|
|
3443
3443
|
] });
|
|
3444
3444
|
}
|
|
3445
|
-
const
|
|
3445
|
+
const Pi = R.forwardRef(
|
|
3446
3446
|
function({
|
|
3447
3447
|
showErrors: a,
|
|
3448
3448
|
disabledId: r,
|
|
@@ -3456,71 +3456,71 @@ const Si = R.forwardRef(
|
|
|
3456
3456
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
3457
3457
|
/* @__PURE__ */ n("div", { children: [
|
|
3458
3458
|
/* @__PURE__ */ e(
|
|
3459
|
-
|
|
3459
|
+
ge,
|
|
3460
3460
|
{
|
|
3461
3461
|
inputRef: l,
|
|
3462
3462
|
name: m,
|
|
3463
|
-
as:
|
|
3463
|
+
as: G,
|
|
3464
3464
|
style: { fontSize: 20 },
|
|
3465
|
-
validate:
|
|
3465
|
+
validate: qi,
|
|
3466
3466
|
placeholder: "Field name",
|
|
3467
3467
|
required: !0,
|
|
3468
3468
|
disabled: s,
|
|
3469
3469
|
error: !!u
|
|
3470
3470
|
}
|
|
3471
3471
|
),
|
|
3472
|
-
/* @__PURE__ */ e(
|
|
3472
|
+
/* @__PURE__ */ e(ee, { error: !!u, children: u })
|
|
3473
3473
|
] }),
|
|
3474
3474
|
/* @__PURE__ */ n("div", { children: [
|
|
3475
3475
|
/* @__PURE__ */ e(
|
|
3476
|
-
|
|
3476
|
+
ge,
|
|
3477
3477
|
{
|
|
3478
3478
|
name: c,
|
|
3479
|
-
as:
|
|
3479
|
+
as: Ve,
|
|
3480
3480
|
label: "ID",
|
|
3481
|
-
validate: (y) =>
|
|
3481
|
+
validate: (y) => Si(y, i),
|
|
3482
3482
|
disabled: r || s,
|
|
3483
3483
|
required: !0,
|
|
3484
3484
|
size: "small",
|
|
3485
3485
|
error: !!p
|
|
3486
3486
|
}
|
|
3487
3487
|
),
|
|
3488
|
-
/* @__PURE__ */ e(
|
|
3488
|
+
/* @__PURE__ */ e(ee, { error: !!p, children: p })
|
|
3489
3489
|
] }),
|
|
3490
3490
|
/* @__PURE__ */ n("div", { children: [
|
|
3491
3491
|
/* @__PURE__ */ e(
|
|
3492
|
-
|
|
3492
|
+
ge,
|
|
3493
3493
|
{
|
|
3494
3494
|
name: g,
|
|
3495
|
-
as:
|
|
3495
|
+
as: G,
|
|
3496
3496
|
label: "Description",
|
|
3497
3497
|
disabled: s,
|
|
3498
3498
|
error: !!f
|
|
3499
3499
|
}
|
|
3500
3500
|
),
|
|
3501
|
-
/* @__PURE__ */ e(
|
|
3501
|
+
/* @__PURE__ */ e(ee, { error: !!f, children: f })
|
|
3502
3502
|
] })
|
|
3503
3503
|
] });
|
|
3504
3504
|
}
|
|
3505
|
-
),
|
|
3506
|
-
function
|
|
3505
|
+
), Ni = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
3506
|
+
function Si(t, a) {
|
|
3507
3507
|
let r;
|
|
3508
|
-
return t || (r = "You must specify an id for the field"), t && !t.match(
|
|
3508
|
+
return t || (r = "You must specify an id for the field"), t && !t.match(Ni) && (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
3509
|
}
|
|
3510
|
-
function
|
|
3510
|
+
function qi(t) {
|
|
3511
3511
|
let a;
|
|
3512
3512
|
return t || (a = "You must specify a title for the field"), a;
|
|
3513
3513
|
}
|
|
3514
|
-
function
|
|
3514
|
+
function Ai({
|
|
3515
3515
|
widgetId: t,
|
|
3516
3516
|
disabled: a,
|
|
3517
3517
|
showErrors: r
|
|
3518
3518
|
}) {
|
|
3519
3519
|
const { values: i, setFieldValue: s } = L();
|
|
3520
3520
|
return /* @__PURE__ */ n(B, { children: [
|
|
3521
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
3521
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
|
|
3522
3522
|
t === "text_field" && /* @__PURE__ */ e(
|
|
3523
|
-
|
|
3523
|
+
Be,
|
|
3524
3524
|
{
|
|
3525
3525
|
disabled: a,
|
|
3526
3526
|
length: !0,
|
|
@@ -3534,7 +3534,7 @@ function Ti({
|
|
|
3534
3534
|
}
|
|
3535
3535
|
),
|
|
3536
3536
|
t === "multiline" && /* @__PURE__ */ e(
|
|
3537
|
-
|
|
3537
|
+
Be,
|
|
3538
3538
|
{
|
|
3539
3539
|
disabled: a,
|
|
3540
3540
|
length: !0,
|
|
@@ -3547,7 +3547,7 @@ function Ti({
|
|
|
3547
3547
|
}
|
|
3548
3548
|
),
|
|
3549
3549
|
t === "markdown" && /* @__PURE__ */ e(
|
|
3550
|
-
|
|
3550
|
+
Be,
|
|
3551
3551
|
{
|
|
3552
3552
|
disabled: a,
|
|
3553
3553
|
length: !0,
|
|
@@ -3560,7 +3560,7 @@ function Ti({
|
|
|
3560
3560
|
}
|
|
3561
3561
|
),
|
|
3562
3562
|
t === "url" && /* @__PURE__ */ e(
|
|
3563
|
-
|
|
3563
|
+
Be,
|
|
3564
3564
|
{
|
|
3565
3565
|
disabled: a,
|
|
3566
3566
|
max: !0,
|
|
@@ -3570,7 +3570,7 @@ function Ti({
|
|
|
3570
3570
|
}
|
|
3571
3571
|
),
|
|
3572
3572
|
t === "email" && /* @__PURE__ */ e(
|
|
3573
|
-
|
|
3573
|
+
Be,
|
|
3574
3574
|
{
|
|
3575
3575
|
disabled: a,
|
|
3576
3576
|
max: !0,
|
|
@@ -3581,7 +3581,7 @@ function Ti({
|
|
|
3581
3581
|
)
|
|
3582
3582
|
] }) }),
|
|
3583
3583
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3584
|
-
|
|
3584
|
+
Ve,
|
|
3585
3585
|
{
|
|
3586
3586
|
name: "defaultValue",
|
|
3587
3587
|
disabled: a,
|
|
@@ -3594,28 +3594,28 @@ function Ti({
|
|
|
3594
3594
|
) })
|
|
3595
3595
|
] });
|
|
3596
3596
|
}
|
|
3597
|
-
function
|
|
3597
|
+
function zi({ disabled: t }) {
|
|
3598
3598
|
const { values: a } = L(), r = N(a, "defaultValue");
|
|
3599
3599
|
return /* @__PURE__ */ n(B, { children: [
|
|
3600
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3600
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Ie, { disabled: t }) }) }),
|
|
3601
3601
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3602
|
-
|
|
3602
|
+
ce,
|
|
3603
3603
|
{
|
|
3604
3604
|
type: "checkbox",
|
|
3605
3605
|
name: "defaultValue",
|
|
3606
3606
|
label: r == null ? "Default value not set" : "Default value is " + r.toString(),
|
|
3607
3607
|
disabled: t,
|
|
3608
3608
|
allowIndeterminate: !0,
|
|
3609
|
-
component:
|
|
3609
|
+
component: ue
|
|
3610
3610
|
}
|
|
3611
3611
|
) })
|
|
3612
3612
|
] });
|
|
3613
3613
|
}
|
|
3614
|
-
function
|
|
3614
|
+
function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
|
|
3615
3615
|
const {
|
|
3616
3616
|
values: o,
|
|
3617
3617
|
setFieldValue: l
|
|
3618
|
-
} = L(), [d, m] =
|
|
3618
|
+
} = L(), [d, m] = Y(!1), [u, c] = Y(), [p, g] = Y(), f = Q(({
|
|
3619
3619
|
id: w,
|
|
3620
3620
|
property: b
|
|
3621
3621
|
}) => {
|
|
@@ -3625,12 +3625,12 @@ function ji({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3625
3625
|
...o.oneOf?.properties ?? {},
|
|
3626
3626
|
[w]: b
|
|
3627
3627
|
}, !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 ?
|
|
3628
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? se(u, p) : void 0, k = y ? N(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, _ = Q((w, b) => {
|
|
3629
|
+
const v = w ? se(w, b) : void 0;
|
|
3630
3630
|
if (!v)
|
|
3631
3631
|
throw Error("collection editor miss config");
|
|
3632
|
-
l(`oneOf.${
|
|
3633
|
-
const T = `oneOf.${
|
|
3632
|
+
l(`oneOf.${we(v)}`, void 0, !1);
|
|
3633
|
+
const T = `oneOf.${Oe(b)}`, I = N(o, T);
|
|
3634
3634
|
l(T, I.filter((A) => A !== w), !1), m(!1), c(void 0), g(void 0);
|
|
3635
3635
|
}, [l, o]), O = /* @__PURE__ */ n(
|
|
3636
3636
|
E,
|
|
@@ -3638,14 +3638,14 @@ function ji({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3638
3638
|
autoFocus: !0,
|
|
3639
3639
|
color: "primary",
|
|
3640
3640
|
onClick: () => m(!0),
|
|
3641
|
-
startIcon: /* @__PURE__ */ e(
|
|
3641
|
+
startIcon: /* @__PURE__ */ e(Ne, {}),
|
|
3642
3642
|
children: [
|
|
3643
3643
|
"Add property to ",
|
|
3644
3644
|
o.name ?? "this block"
|
|
3645
3645
|
]
|
|
3646
3646
|
}
|
|
3647
|
-
), h =
|
|
3648
|
-
l(`oneOf.${
|
|
3647
|
+
), h = Q((w, b) => {
|
|
3648
|
+
l(`oneOf.${Oe(b)}`, w, !1);
|
|
3649
3649
|
}, []);
|
|
3650
3650
|
return /* @__PURE__ */ n(B, { children: [
|
|
3651
3651
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
@@ -3653,9 +3653,9 @@ function ji({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3653
3653
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this block" }),
|
|
3654
3654
|
O
|
|
3655
3655
|
] }),
|
|
3656
|
-
/* @__PURE__ */ n(
|
|
3656
|
+
/* @__PURE__ */ n(Pe, { className: "p-2 pl-8", children: [
|
|
3657
3657
|
/* @__PURE__ */ e(
|
|
3658
|
-
|
|
3658
|
+
mt,
|
|
3659
3659
|
{
|
|
3660
3660
|
properties: o.oneOf?.properties ?? {},
|
|
3661
3661
|
propertiesOrder: o.oneOf?.propertiesOrder,
|
|
@@ -3671,7 +3671,7 @@ function ji({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3671
3671
|
] })
|
|
3672
3672
|
] }),
|
|
3673
3673
|
!t && /* @__PURE__ */ e(
|
|
3674
|
-
|
|
3674
|
+
Fe,
|
|
3675
3675
|
{
|
|
3676
3676
|
inArray: !1,
|
|
3677
3677
|
forceShowErrors: !1,
|
|
@@ -3699,15 +3699,15 @@ function ji({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
|
|
|
3699
3699
|
)
|
|
3700
3700
|
] });
|
|
3701
3701
|
}
|
|
3702
|
-
function
|
|
3702
|
+
function Vi({ disabled: t }) {
|
|
3703
3703
|
const {
|
|
3704
3704
|
values: a,
|
|
3705
3705
|
handleChange: r
|
|
3706
3706
|
} = L(), i = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", d = "validation.positive", m = "validation.negative", u = "validation.integer";
|
|
3707
3707
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
3708
|
-
/* @__PURE__ */ e(
|
|
3708
|
+
/* @__PURE__ */ e(Ie, { disabled: t }),
|
|
3709
3709
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3710
|
-
|
|
3710
|
+
G,
|
|
3711
3711
|
{
|
|
3712
3712
|
value: N(a, i),
|
|
3713
3713
|
label: "Min value",
|
|
@@ -3719,7 +3719,7 @@ function Fi({ disabled: t }) {
|
|
|
3719
3719
|
}
|
|
3720
3720
|
) }),
|
|
3721
3721
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3722
|
-
|
|
3722
|
+
G,
|
|
3723
3723
|
{
|
|
3724
3724
|
value: N(a, s),
|
|
3725
3725
|
label: "Max value",
|
|
@@ -3731,7 +3731,7 @@ function Fi({ disabled: t }) {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
) }),
|
|
3733
3733
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3734
|
-
|
|
3734
|
+
G,
|
|
3735
3735
|
{
|
|
3736
3736
|
value: N(a, o),
|
|
3737
3737
|
label: "Less than",
|
|
@@ -3743,7 +3743,7 @@ function Fi({ disabled: t }) {
|
|
|
3743
3743
|
}
|
|
3744
3744
|
) }),
|
|
3745
3745
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3746
|
-
|
|
3746
|
+
G,
|
|
3747
3747
|
{
|
|
3748
3748
|
value: N(a, l),
|
|
3749
3749
|
label: "More than",
|
|
@@ -3755,43 +3755,43 @@ function Fi({ disabled: t }) {
|
|
|
3755
3755
|
}
|
|
3756
3756
|
) }),
|
|
3757
3757
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3758
|
-
|
|
3758
|
+
ce,
|
|
3759
3759
|
{
|
|
3760
3760
|
type: "checkbox",
|
|
3761
3761
|
name: d,
|
|
3762
3762
|
label: "Positive value",
|
|
3763
3763
|
disabled: t,
|
|
3764
|
-
component:
|
|
3764
|
+
component: ue
|
|
3765
3765
|
}
|
|
3766
3766
|
) }),
|
|
3767
3767
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3768
|
-
|
|
3768
|
+
ce,
|
|
3769
3769
|
{
|
|
3770
3770
|
type: "checkbox",
|
|
3771
3771
|
name: m,
|
|
3772
3772
|
label: "Negative value",
|
|
3773
3773
|
disabled: t,
|
|
3774
|
-
component:
|
|
3774
|
+
component: ue
|
|
3775
3775
|
}
|
|
3776
3776
|
) }),
|
|
3777
3777
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3778
|
-
|
|
3778
|
+
ce,
|
|
3779
3779
|
{
|
|
3780
3780
|
type: "checkbox",
|
|
3781
3781
|
name: u,
|
|
3782
3782
|
label: "Integer value",
|
|
3783
3783
|
disabled: t,
|
|
3784
|
-
component:
|
|
3784
|
+
component: ue
|
|
3785
3785
|
}
|
|
3786
3786
|
) })
|
|
3787
3787
|
] });
|
|
3788
3788
|
}
|
|
3789
|
-
function
|
|
3789
|
+
function ji({ disabled: t }) {
|
|
3790
3790
|
const { values: a, setFieldValue: r } = L();
|
|
3791
3791
|
return /* @__PURE__ */ n(B, { children: [
|
|
3792
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3792
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Vi, { disabled: t }) }) }),
|
|
3793
3793
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3794
|
-
|
|
3794
|
+
Ve,
|
|
3795
3795
|
{
|
|
3796
3796
|
name: "defaultValue",
|
|
3797
3797
|
disabled: t,
|
|
@@ -3805,7 +3805,7 @@ function Ii({ disabled: t }) {
|
|
|
3805
3805
|
) })
|
|
3806
3806
|
] });
|
|
3807
3807
|
}
|
|
3808
|
-
function
|
|
3808
|
+
function Et({
|
|
3809
3809
|
existing: t,
|
|
3810
3810
|
multiple: a,
|
|
3811
3811
|
disabled: r,
|
|
@@ -3819,30 +3819,30 @@ function Mt({
|
|
|
3819
3819
|
setFieldError: m,
|
|
3820
3820
|
setFieldValue: u
|
|
3821
3821
|
} = L();
|
|
3822
|
-
if (!
|
|
3823
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3822
|
+
if (!De())
|
|
3823
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ye, {}) });
|
|
3824
3824
|
const p = a ? "of.path" : "path", g = N(s, p), f = i && N(l, p);
|
|
3825
3825
|
return console.log("pathError", l, f), /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3826
|
-
|
|
3826
|
+
ge,
|
|
3827
3827
|
{
|
|
3828
3828
|
required: !0,
|
|
3829
3829
|
name: p,
|
|
3830
3830
|
pathPath: p,
|
|
3831
3831
|
type: "select",
|
|
3832
|
-
validate:
|
|
3832
|
+
validate: Fi,
|
|
3833
3833
|
disabled: t || r,
|
|
3834
3834
|
value: g,
|
|
3835
3835
|
error: f,
|
|
3836
3836
|
handleChange: o,
|
|
3837
|
-
component:
|
|
3837
|
+
component: Ii
|
|
3838
3838
|
}
|
|
3839
3839
|
) }) });
|
|
3840
3840
|
}
|
|
3841
|
-
function
|
|
3841
|
+
function Fi(t) {
|
|
3842
3842
|
let a;
|
|
3843
3843
|
return t || (a = "You must specify a target collection for the field"), a;
|
|
3844
3844
|
}
|
|
3845
|
-
function
|
|
3845
|
+
function Ii({
|
|
3846
3846
|
disabled: t,
|
|
3847
3847
|
pathPath: a,
|
|
3848
3848
|
value: r,
|
|
@@ -3851,15 +3851,15 @@ function Bi({
|
|
|
3851
3851
|
...o
|
|
3852
3852
|
}) {
|
|
3853
3853
|
console.log("error", s);
|
|
3854
|
-
const l =
|
|
3854
|
+
const l = De();
|
|
3855
3855
|
if (!l)
|
|
3856
|
-
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3856
|
+
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ye, {}) });
|
|
3857
3857
|
const d = l?.collections ?? [], m = Array.from(new Set(
|
|
3858
3858
|
Object.values(d).map((c) => c.group).filter(Boolean)
|
|
3859
3859
|
).values()), u = d.filter((c) => !c.group);
|
|
3860
3860
|
return /* @__PURE__ */ n(B, { children: [
|
|
3861
3861
|
/* @__PURE__ */ n(
|
|
3862
|
-
|
|
3862
|
+
je,
|
|
3863
3863
|
{
|
|
3864
3864
|
error: !!s,
|
|
3865
3865
|
disabled: t,
|
|
@@ -3872,7 +3872,7 @@ function Bi({
|
|
|
3872
3872
|
const p = d.find((f) => f.alias === c || f.path === c);
|
|
3873
3873
|
if (!p)
|
|
3874
3874
|
return null;
|
|
3875
|
-
const g =
|
|
3875
|
+
const g = ot(p);
|
|
3876
3876
|
return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3877
3877
|
g,
|
|
3878
3878
|
/* @__PURE__ */ e(
|
|
@@ -3888,13 +3888,13 @@ function Bi({
|
|
|
3888
3888
|
...o,
|
|
3889
3889
|
children: [
|
|
3890
3890
|
m.flatMap((c) => /* @__PURE__ */ e(
|
|
3891
|
-
|
|
3891
|
+
At,
|
|
3892
3892
|
{
|
|
3893
3893
|
label: c || "Views",
|
|
3894
3894
|
children: d.filter((p) => p.group === c).map((p) => {
|
|
3895
|
-
const g =
|
|
3895
|
+
const g = ot(p);
|
|
3896
3896
|
return /* @__PURE__ */ e(
|
|
3897
|
-
|
|
3897
|
+
ye,
|
|
3898
3898
|
{
|
|
3899
3899
|
value: p.alias ?? p.path,
|
|
3900
3900
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
@@ -3915,10 +3915,10 @@ function Bi({
|
|
|
3915
3915
|
},
|
|
3916
3916
|
`group_${c}`
|
|
3917
3917
|
)),
|
|
3918
|
-
u && /* @__PURE__ */ e(
|
|
3919
|
-
const p =
|
|
3918
|
+
u && /* @__PURE__ */ e(At, { label: "Views", children: u.map((c) => {
|
|
3919
|
+
const p = ot(c);
|
|
3920
3920
|
return /* @__PURE__ */ e(
|
|
3921
|
-
|
|
3921
|
+
ye,
|
|
3922
3922
|
{
|
|
3923
3923
|
value: c.alias ?? c.path,
|
|
3924
3924
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
@@ -3939,10 +3939,10 @@ function Bi({
|
|
|
3939
3939
|
]
|
|
3940
3940
|
}
|
|
3941
3941
|
),
|
|
3942
|
-
/* @__PURE__ */ e(
|
|
3942
|
+
/* @__PURE__ */ e(ee, { children: "You can only edit the reference collection upon field creation." })
|
|
3943
3943
|
] });
|
|
3944
3944
|
}
|
|
3945
|
-
function
|
|
3945
|
+
function Ei({ disabled: t }) {
|
|
3946
3946
|
const {
|
|
3947
3947
|
values: a,
|
|
3948
3948
|
errors: r,
|
|
@@ -3952,7 +3952,7 @@ function Mi({ disabled: t }) {
|
|
|
3952
3952
|
return /* @__PURE__ */ n(B, { children: [
|
|
3953
3953
|
/* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
|
|
3954
3954
|
/* @__PURE__ */ n(
|
|
3955
|
-
|
|
3955
|
+
je,
|
|
3956
3956
|
{
|
|
3957
3957
|
name: o,
|
|
3958
3958
|
value: l ?? "date",
|
|
@@ -3971,14 +3971,14 @@ function Mi({ disabled: t }) {
|
|
|
3971
3971
|
},
|
|
3972
3972
|
disabled: t,
|
|
3973
3973
|
children: [
|
|
3974
|
-
/* @__PURE__ */ e(
|
|
3975
|
-
/* @__PURE__ */ e(
|
|
3974
|
+
/* @__PURE__ */ e(ye, { value: "date_time", children: " Date/Time " }),
|
|
3975
|
+
/* @__PURE__ */ e(ye, { value: "date", children: " Date " })
|
|
3976
3976
|
]
|
|
3977
3977
|
}
|
|
3978
3978
|
),
|
|
3979
|
-
/* @__PURE__ */ e(
|
|
3979
|
+
/* @__PURE__ */ e(ee, { error: !!d, children: d }),
|
|
3980
3980
|
/* @__PURE__ */ n(
|
|
3981
|
-
|
|
3981
|
+
je,
|
|
3982
3982
|
{
|
|
3983
3983
|
name: m,
|
|
3984
3984
|
disabled: t,
|
|
@@ -3997,51 +3997,51 @@ function Mi({ disabled: t }) {
|
|
|
3997
3997
|
error: !!c,
|
|
3998
3998
|
label: "Automatic value",
|
|
3999
3999
|
children: [
|
|
4000
|
-
/* @__PURE__ */ e(
|
|
4001
|
-
/* @__PURE__ */ e(
|
|
4002
|
-
/* @__PURE__ */ e(
|
|
4000
|
+
/* @__PURE__ */ e(ye, { value: "", children: " None " }),
|
|
4001
|
+
/* @__PURE__ */ e(ye, { value: "on_create", children: " On create " }),
|
|
4002
|
+
/* @__PURE__ */ e(ye, { value: "on_update", children: " On any update " })
|
|
4003
4003
|
]
|
|
4004
4004
|
}
|
|
4005
4005
|
),
|
|
4006
|
-
/* @__PURE__ */ e(
|
|
4006
|
+
/* @__PURE__ */ e(ee, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
|
|
4007
4007
|
] }),
|
|
4008
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4008
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Ie, { disabled: t }) }) })
|
|
4009
4009
|
] });
|
|
4010
4010
|
}
|
|
4011
|
-
function
|
|
4011
|
+
function Bi({ disabled: t }) {
|
|
4012
4012
|
return L(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
4013
4013
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4014
|
-
|
|
4014
|
+
ce,
|
|
4015
4015
|
{
|
|
4016
4016
|
type: "checkbox",
|
|
4017
4017
|
name: "hideFromCollection",
|
|
4018
4018
|
label: "Hide from collection",
|
|
4019
4019
|
disabled: t,
|
|
4020
4020
|
tooltip: "Hide this field from the collection view. It will still be visible in the form view",
|
|
4021
|
-
component:
|
|
4021
|
+
component: ue
|
|
4022
4022
|
}
|
|
4023
4023
|
) }),
|
|
4024
4024
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4025
|
-
|
|
4025
|
+
ce,
|
|
4026
4026
|
{
|
|
4027
4027
|
type: "checkbox",
|
|
4028
4028
|
name: "readOnly",
|
|
4029
4029
|
label: "Read only",
|
|
4030
4030
|
disabled: t,
|
|
4031
4031
|
tooltip: "Is this a read only field. Display only as a preview",
|
|
4032
|
-
component:
|
|
4032
|
+
component: ue
|
|
4033
4033
|
}
|
|
4034
4034
|
) })
|
|
4035
4035
|
] });
|
|
4036
4036
|
}
|
|
4037
|
-
function
|
|
4038
|
-
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4037
|
+
function Mi({ disabled: t }) {
|
|
4038
|
+
return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Ie, { disabled: t }) }) }) });
|
|
4039
4039
|
}
|
|
4040
|
-
function
|
|
4040
|
+
function oa(t, a, r) {
|
|
4041
4041
|
let i;
|
|
4042
4042
|
return a === "text_field" ? i = $(
|
|
4043
4043
|
t,
|
|
4044
|
-
|
|
4044
|
+
{
|
|
4045
4045
|
dataType: "string",
|
|
4046
4046
|
propertyConfig: "text_field",
|
|
4047
4047
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4051,10 +4051,10 @@ function sa(t, a, r) {
|
|
|
4051
4051
|
email: void 0,
|
|
4052
4052
|
url: void 0,
|
|
4053
4053
|
enumValues: void 0
|
|
4054
|
-
}
|
|
4054
|
+
}
|
|
4055
4055
|
) : a === "multiline" ? i = $(
|
|
4056
4056
|
t,
|
|
4057
|
-
|
|
4057
|
+
{
|
|
4058
4058
|
dataType: "string",
|
|
4059
4059
|
propertyConfig: "multiline",
|
|
4060
4060
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4064,10 +4064,10 @@ function sa(t, a, r) {
|
|
|
4064
4064
|
email: void 0,
|
|
4065
4065
|
url: void 0,
|
|
4066
4066
|
enumValues: void 0
|
|
4067
|
-
}
|
|
4067
|
+
}
|
|
4068
4068
|
) : a === "markdown" ? i = $(
|
|
4069
4069
|
t,
|
|
4070
|
-
|
|
4070
|
+
{
|
|
4071
4071
|
dataType: "string",
|
|
4072
4072
|
propertyConfig: "markdown",
|
|
4073
4073
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4076,10 +4076,10 @@ function sa(t, a, r) {
|
|
|
4076
4076
|
markdown: !0,
|
|
4077
4077
|
email: void 0,
|
|
4078
4078
|
url: void 0
|
|
4079
|
-
}
|
|
4079
|
+
}
|
|
4080
4080
|
) : a === "url" ? i = $(
|
|
4081
4081
|
t,
|
|
4082
|
-
|
|
4082
|
+
{
|
|
4083
4083
|
dataType: "string",
|
|
4084
4084
|
propertyConfig: "url",
|
|
4085
4085
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4089,10 +4089,10 @@ function sa(t, a, r) {
|
|
|
4089
4089
|
email: void 0,
|
|
4090
4090
|
url: !0,
|
|
4091
4091
|
enumValues: void 0
|
|
4092
|
-
}
|
|
4092
|
+
}
|
|
4093
4093
|
) : a === "email" ? i = $(
|
|
4094
4094
|
t,
|
|
4095
|
-
|
|
4095
|
+
{
|
|
4096
4096
|
dataType: "string",
|
|
4097
4097
|
propertyConfig: "email",
|
|
4098
4098
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4102,10 +4102,10 @@ function sa(t, a, r) {
|
|
|
4102
4102
|
email: !0,
|
|
4103
4103
|
url: void 0,
|
|
4104
4104
|
enumValues: void 0
|
|
4105
|
-
}
|
|
4105
|
+
}
|
|
4106
4106
|
) : a === "select" ? i = $(
|
|
4107
4107
|
t,
|
|
4108
|
-
|
|
4108
|
+
{
|
|
4109
4109
|
dataType: "string",
|
|
4110
4110
|
propertyConfig: "select",
|
|
4111
4111
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4115,10 +4115,10 @@ function sa(t, a, r) {
|
|
|
4115
4115
|
email: void 0,
|
|
4116
4116
|
url: void 0,
|
|
4117
4117
|
enumValues: t.enumValues ?? []
|
|
4118
|
-
}
|
|
4118
|
+
}
|
|
4119
4119
|
) : a === "multi_select" ? i = $(
|
|
4120
4120
|
t,
|
|
4121
|
-
|
|
4121
|
+
{
|
|
4122
4122
|
dataType: "array",
|
|
4123
4123
|
propertyConfig: "multi_select",
|
|
4124
4124
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4126,26 +4126,26 @@ function sa(t, a, r) {
|
|
|
4126
4126
|
dataType: "string",
|
|
4127
4127
|
enumValues: t.of?.enumValues ?? []
|
|
4128
4128
|
}
|
|
4129
|
-
}
|
|
4129
|
+
}
|
|
4130
4130
|
) : a === "number_input" ? i = $(
|
|
4131
4131
|
t,
|
|
4132
|
-
|
|
4132
|
+
{
|
|
4133
4133
|
dataType: "number",
|
|
4134
4134
|
propertyConfig: "number_input",
|
|
4135
4135
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4136
4136
|
enumValues: void 0
|
|
4137
|
-
}
|
|
4137
|
+
}
|
|
4138
4138
|
) : a === "number_select" ? i = $(
|
|
4139
4139
|
t,
|
|
4140
|
-
|
|
4140
|
+
{
|
|
4141
4141
|
dataType: "number",
|
|
4142
4142
|
propertyConfig: "number_select",
|
|
4143
4143
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4144
4144
|
enumValues: t.enumValues ?? []
|
|
4145
|
-
}
|
|
4145
|
+
}
|
|
4146
4146
|
) : a === "multi_number_select" ? i = $(
|
|
4147
4147
|
t,
|
|
4148
|
-
|
|
4148
|
+
{
|
|
4149
4149
|
dataType: "array",
|
|
4150
4150
|
propertyConfig: "multi_number_select",
|
|
4151
4151
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4153,20 +4153,20 @@ function sa(t, a, r) {
|
|
|
4153
4153
|
dataType: "number",
|
|
4154
4154
|
enumValues: t.of?.enumValues ?? []
|
|
4155
4155
|
}
|
|
4156
|
-
}
|
|
4156
|
+
}
|
|
4157
4157
|
) : a === "file_upload" ? i = $(
|
|
4158
4158
|
t,
|
|
4159
|
-
|
|
4159
|
+
{
|
|
4160
4160
|
dataType: "string",
|
|
4161
4161
|
propertyConfig: "file_upload",
|
|
4162
4162
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4163
4163
|
storage: {
|
|
4164
4164
|
storagePath: "/"
|
|
4165
4165
|
}
|
|
4166
|
-
}
|
|
4166
|
+
}
|
|
4167
4167
|
) : a === "multi_file_upload" ? i = $(
|
|
4168
4168
|
t,
|
|
4169
|
-
|
|
4169
|
+
{
|
|
4170
4170
|
dataType: "array",
|
|
4171
4171
|
propertyConfig: "multi_file_upload",
|
|
4172
4172
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4176,79 +4176,79 @@ function sa(t, a, r) {
|
|
|
4176
4176
|
storagePath: "/"
|
|
4177
4177
|
}
|
|
4178
4178
|
}
|
|
4179
|
-
}
|
|
4179
|
+
}
|
|
4180
4180
|
) : a === "group" ? i = $(
|
|
4181
4181
|
t,
|
|
4182
|
-
|
|
4182
|
+
{
|
|
4183
4183
|
dataType: "map",
|
|
4184
4184
|
propertyConfig: "group",
|
|
4185
4185
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4186
4186
|
keyValue: !1,
|
|
4187
4187
|
properties: t.properties ?? {}
|
|
4188
|
-
}
|
|
4188
|
+
}
|
|
4189
4189
|
) : a === "key_value" ? i = $(
|
|
4190
4190
|
t,
|
|
4191
|
-
|
|
4191
|
+
{
|
|
4192
4192
|
dataType: "map",
|
|
4193
4193
|
propertyConfig: "key_value",
|
|
4194
4194
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4195
4195
|
keyValue: !0,
|
|
4196
4196
|
properties: void 0
|
|
4197
|
-
}
|
|
4197
|
+
}
|
|
4198
4198
|
) : a === "reference" ? i = $(
|
|
4199
4199
|
t,
|
|
4200
|
-
|
|
4200
|
+
{
|
|
4201
4201
|
dataType: "reference",
|
|
4202
4202
|
propertyConfig: "reference",
|
|
4203
4203
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4204
|
-
}
|
|
4204
|
+
}
|
|
4205
4205
|
) : a === "multi_references" ? i = $(
|
|
4206
4206
|
t,
|
|
4207
|
-
|
|
4207
|
+
{
|
|
4208
4208
|
dataType: "array",
|
|
4209
4209
|
propertyConfig: "multi_references",
|
|
4210
4210
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4211
4211
|
of: {
|
|
4212
4212
|
dataType: "reference"
|
|
4213
4213
|
}
|
|
4214
|
-
}
|
|
4214
|
+
}
|
|
4215
4215
|
) : a === "switch" ? i = $(
|
|
4216
4216
|
t,
|
|
4217
|
-
|
|
4217
|
+
{
|
|
4218
4218
|
dataType: "boolean",
|
|
4219
4219
|
propertyConfig: "switch",
|
|
4220
4220
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4221
|
-
}
|
|
4221
|
+
}
|
|
4222
4222
|
) : a === "date_time" ? i = $(
|
|
4223
4223
|
t,
|
|
4224
|
-
|
|
4224
|
+
{
|
|
4225
4225
|
dataType: "date",
|
|
4226
4226
|
propertyConfig: "date_time",
|
|
4227
4227
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4228
4228
|
mode: "date_time"
|
|
4229
|
-
}
|
|
4229
|
+
}
|
|
4230
4230
|
) : a === "repeat" ? i = $(
|
|
4231
4231
|
t,
|
|
4232
|
-
|
|
4232
|
+
{
|
|
4233
4233
|
dataType: "array",
|
|
4234
4234
|
propertyConfig: "repeat",
|
|
4235
4235
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4236
|
-
}
|
|
4236
|
+
}
|
|
4237
4237
|
) : a === "block" ? i = $(
|
|
4238
4238
|
t,
|
|
4239
|
-
|
|
4239
|
+
{
|
|
4240
4240
|
dataType: "array",
|
|
4241
4241
|
propertyConfig: "block",
|
|
4242
4242
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4243
4243
|
oneOf: {
|
|
4244
4244
|
properties: {}
|
|
4245
4245
|
}
|
|
4246
|
-
}
|
|
4246
|
+
}
|
|
4247
4247
|
) : a && r[a] && (i = { ...r[a].property, propertyConfig: a }), i;
|
|
4248
4248
|
}
|
|
4249
|
-
function
|
|
4249
|
+
function na({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
|
|
4250
4250
|
return /* @__PURE__ */ e(
|
|
4251
|
-
|
|
4251
|
+
ye,
|
|
4252
4252
|
{
|
|
4253
4253
|
value: t,
|
|
4254
4254
|
disabled: a,
|
|
@@ -4256,12 +4256,12 @@ function la({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
|
|
|
4256
4256
|
children: /* @__PURE__ */ n(
|
|
4257
4257
|
"div",
|
|
4258
4258
|
{
|
|
4259
|
-
className:
|
|
4259
|
+
className: _e(
|
|
4260
4260
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
4261
4261
|
a ? "w-full" : ""
|
|
4262
4262
|
),
|
|
4263
4263
|
children: [
|
|
4264
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
4264
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Je, { propertyConfig: r }) }),
|
|
4265
4265
|
/* @__PURE__ */ n("div", { children: [
|
|
4266
4266
|
/* @__PURE__ */ e("div", { children: r.name }),
|
|
4267
4267
|
/* @__PURE__ */ e(
|
|
@@ -4280,7 +4280,7 @@ function la({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
|
|
|
4280
4280
|
}
|
|
4281
4281
|
);
|
|
4282
4282
|
}
|
|
4283
|
-
const
|
|
4283
|
+
const sa = R.memo(
|
|
4284
4284
|
function({
|
|
4285
4285
|
includeIdAndName: a = !0,
|
|
4286
4286
|
autoOpenTypeSelect: r,
|
|
@@ -4306,9 +4306,9 @@ const ca = R.memo(
|
|
|
4306
4306
|
const v = {
|
|
4307
4307
|
id: "",
|
|
4308
4308
|
name: ""
|
|
4309
|
-
}, T = !!(m && !
|
|
4309
|
+
}, T = !!(m && !Le(m)) && !b;
|
|
4310
4310
|
console.log("PropertyForm disabled", T);
|
|
4311
|
-
const I =
|
|
4311
|
+
const I = $e(m ? {
|
|
4312
4312
|
id: l,
|
|
4313
4313
|
previousId: l,
|
|
4314
4314
|
property: m
|
|
@@ -4325,7 +4325,7 @@ const ca = R.memo(
|
|
|
4325
4325
|
I.current = C, u?.(C);
|
|
4326
4326
|
};
|
|
4327
4327
|
return /* @__PURE__ */ e(
|
|
4328
|
-
|
|
4328
|
+
Ot,
|
|
4329
4329
|
{
|
|
4330
4330
|
initialErrors: f,
|
|
4331
4331
|
initialValues: m ? { id: l, ...m } : v,
|
|
@@ -4340,10 +4340,10 @@ const ca = R.memo(
|
|
|
4340
4340
|
property: { ...j, editable: j.editable ?? !0 }
|
|
4341
4341
|
}), i || x.resetForm({ values: v });
|
|
4342
4342
|
},
|
|
4343
|
-
children: (S) => (
|
|
4343
|
+
children: (S) => (pe(() => {
|
|
4344
4344
|
O?.(S);
|
|
4345
4345
|
}, [S]), /* @__PURE__ */ e(
|
|
4346
|
-
|
|
4346
|
+
Di,
|
|
4347
4347
|
{
|
|
4348
4348
|
onPropertyChanged: c ? A : void 0,
|
|
4349
4349
|
onDelete: p,
|
|
@@ -4370,7 +4370,7 @@ const ca = R.memo(
|
|
|
4370
4370
|
},
|
|
4371
4371
|
(t, a) => t.getData === a.getData && t.includeIdAndName === a.includeIdAndName && t.autoOpenTypeSelect === a.autoOpenTypeSelect && t.autoUpdateId === a.autoUpdateId && t.existingProperty === a.existingProperty
|
|
4372
4372
|
);
|
|
4373
|
-
function
|
|
4373
|
+
function Fe({
|
|
4374
4374
|
open: t,
|
|
4375
4375
|
onCancel: a,
|
|
4376
4376
|
onOkClicked: r,
|
|
@@ -4379,16 +4379,16 @@ function Ie({
|
|
|
4379
4379
|
collectionEditable: o,
|
|
4380
4380
|
...l
|
|
4381
4381
|
}) {
|
|
4382
|
-
const d =
|
|
4382
|
+
const d = $e();
|
|
4383
4383
|
return /* @__PURE__ */ n(
|
|
4384
|
-
|
|
4384
|
+
Me,
|
|
4385
4385
|
{
|
|
4386
4386
|
open: t ?? !1,
|
|
4387
4387
|
maxWidth: "xl",
|
|
4388
4388
|
fullWidth: !0,
|
|
4389
4389
|
children: [
|
|
4390
|
-
/* @__PURE__ */ e(
|
|
4391
|
-
|
|
4390
|
+
/* @__PURE__ */ e(He, { children: /* @__PURE__ */ e(
|
|
4391
|
+
sa,
|
|
4392
4392
|
{
|
|
4393
4393
|
...l,
|
|
4394
4394
|
onPropertyChanged: (u) => {
|
|
@@ -4402,7 +4402,7 @@ function Ie({
|
|
|
4402
4402
|
getData: s
|
|
4403
4403
|
}
|
|
4404
4404
|
) }),
|
|
4405
|
-
/* @__PURE__ */ n(
|
|
4405
|
+
/* @__PURE__ */ n(Ge, { children: [
|
|
4406
4406
|
a && /* @__PURE__ */ e(
|
|
4407
4407
|
E,
|
|
4408
4408
|
{
|
|
@@ -4427,7 +4427,7 @@ function Ie({
|
|
|
4427
4427
|
}
|
|
4428
4428
|
);
|
|
4429
4429
|
}
|
|
4430
|
-
function
|
|
4430
|
+
function Di({
|
|
4431
4431
|
values: t,
|
|
4432
4432
|
errors: a,
|
|
4433
4433
|
touched: r,
|
|
@@ -4450,39 +4450,39 @@ function Ui({
|
|
|
4450
4450
|
customFields: w,
|
|
4451
4451
|
collectionEditable: b
|
|
4452
4452
|
}) {
|
|
4453
|
-
const [v, T] =
|
|
4454
|
-
|
|
4455
|
-
!N(r,
|
|
4456
|
-
}, [l, r, t?.name]),
|
|
4457
|
-
if (u && (!m ||
|
|
4453
|
+
const [v, T] = Y(d), [I, A] = Y(!1), [S, x] = Y(t?.dataType ? Jt(t) : void 0), C = Object.entries(_t).concat(Object.entries(w)), j = k ? C.filter(([Z, te]) => !le(te.property) && te.property?.dataType !== "array") : C, J = ga(t), q = $e(null), U = $e(t), ie = "id", ke = f && N(a, "selectedWidget");
|
|
4454
|
+
pe(() => {
|
|
4455
|
+
!N(r, ie) && l && t?.name && s(ie, Yt(t.name));
|
|
4456
|
+
}, [l, r, t?.name]), pe(() => {
|
|
4457
|
+
if (u && (!m || J.id)) {
|
|
4458
4458
|
const {
|
|
4459
|
-
id:
|
|
4460
|
-
...
|
|
4461
|
-
} =
|
|
4462
|
-
|
|
4463
|
-
id:
|
|
4464
|
-
property:
|
|
4459
|
+
id: Z,
|
|
4460
|
+
...te
|
|
4461
|
+
} = J;
|
|
4462
|
+
ct(J, U.current) || (u({
|
|
4463
|
+
id: Z,
|
|
4464
|
+
property: te,
|
|
4465
4465
|
namespace: p
|
|
4466
|
-
}), U.current =
|
|
4466
|
+
}), U.current = J);
|
|
4467
4467
|
}
|
|
4468
|
-
}, [
|
|
4468
|
+
}, [J, m, u, p]), pe(() => {
|
|
4469
4469
|
t?.id && g && Object.keys(a).length > 0 && g(t?.id, p, a);
|
|
4470
4470
|
}, [a, g, p, t?.id]);
|
|
4471
|
-
const
|
|
4472
|
-
x(
|
|
4471
|
+
const he = (Z) => {
|
|
4472
|
+
x(Z), i(oa(t, Z, w)), setTimeout(() => {
|
|
4473
4473
|
q.current?.focus();
|
|
4474
4474
|
}, 0);
|
|
4475
4475
|
};
|
|
4476
4476
|
let M;
|
|
4477
4477
|
return S === "text_field" || S === "multiline" || S === "markdown" || S === "url" || S === "email" ? M = /* @__PURE__ */ e(
|
|
4478
|
-
|
|
4478
|
+
Ai,
|
|
4479
4479
|
{
|
|
4480
4480
|
widgetId: S,
|
|
4481
4481
|
disabled: y,
|
|
4482
4482
|
showErrors: f
|
|
4483
4483
|
}
|
|
4484
4484
|
) : S === "select" || S === "number_select" ? M = /* @__PURE__ */ e(
|
|
4485
|
-
|
|
4485
|
+
Ft,
|
|
4486
4486
|
{
|
|
4487
4487
|
multiselect: !1,
|
|
4488
4488
|
allowDataInference: h,
|
|
@@ -4492,7 +4492,7 @@ function Ui({
|
|
|
4492
4492
|
showErrors: f
|
|
4493
4493
|
}
|
|
4494
4494
|
) : S === "multi_select" || S === "multi_number_select" ? M = /* @__PURE__ */ e(
|
|
4495
|
-
|
|
4495
|
+
Ft,
|
|
4496
4496
|
{
|
|
4497
4497
|
multiselect: !0,
|
|
4498
4498
|
updateIds: !o,
|
|
@@ -4502,21 +4502,21 @@ function Ui({
|
|
|
4502
4502
|
showErrors: f
|
|
4503
4503
|
}
|
|
4504
4504
|
) : S === "file_upload" ? M = /* @__PURE__ */ e(
|
|
4505
|
-
|
|
4505
|
+
It,
|
|
4506
4506
|
{
|
|
4507
4507
|
existing: o,
|
|
4508
4508
|
multiple: !1,
|
|
4509
4509
|
disabled: y
|
|
4510
4510
|
}
|
|
4511
4511
|
) : S === "multi_file_upload" ? M = /* @__PURE__ */ e(
|
|
4512
|
-
|
|
4512
|
+
It,
|
|
4513
4513
|
{
|
|
4514
4514
|
existing: o,
|
|
4515
4515
|
multiple: !0,
|
|
4516
4516
|
disabled: y
|
|
4517
4517
|
}
|
|
4518
|
-
) : S === "switch" ? M = /* @__PURE__ */ e(
|
|
4519
|
-
|
|
4518
|
+
) : S === "switch" ? M = /* @__PURE__ */ e(zi, { disabled: y }) : S === "number_input" ? M = /* @__PURE__ */ e(ji, { disabled: y }) : S === "group" ? M = /* @__PURE__ */ e(
|
|
4519
|
+
Ci,
|
|
4520
4520
|
{
|
|
4521
4521
|
disabled: y,
|
|
4522
4522
|
getData: O,
|
|
@@ -4525,7 +4525,7 @@ function Ui({
|
|
|
4525
4525
|
customFields: w
|
|
4526
4526
|
}
|
|
4527
4527
|
) : S === "block" ? M = /* @__PURE__ */ e(
|
|
4528
|
-
|
|
4528
|
+
Ti,
|
|
4529
4529
|
{
|
|
4530
4530
|
disabled: y,
|
|
4531
4531
|
getData: O,
|
|
@@ -4534,15 +4534,15 @@ function Ui({
|
|
|
4534
4534
|
customFields: w
|
|
4535
4535
|
}
|
|
4536
4536
|
) : S === "reference" ? M = /* @__PURE__ */ e(
|
|
4537
|
-
|
|
4537
|
+
Et,
|
|
4538
4538
|
{
|
|
4539
4539
|
showErrors: f,
|
|
4540
4540
|
existing: o,
|
|
4541
4541
|
multiple: !1,
|
|
4542
4542
|
disabled: y
|
|
4543
4543
|
}
|
|
4544
|
-
) : S === "date_time" ? M = /* @__PURE__ */ e(
|
|
4545
|
-
|
|
4544
|
+
) : S === "date_time" ? M = /* @__PURE__ */ e(Ei, { disabled: y }) : S === "multi_references" ? M = /* @__PURE__ */ e(
|
|
4545
|
+
Et,
|
|
4546
4546
|
{
|
|
4547
4547
|
showErrors: f,
|
|
4548
4548
|
existing: o,
|
|
@@ -4550,7 +4550,7 @@ function Ui({
|
|
|
4550
4550
|
disabled: y
|
|
4551
4551
|
}
|
|
4552
4552
|
) : S === "repeat" ? M = /* @__PURE__ */ e(
|
|
4553
|
-
|
|
4553
|
+
Oi,
|
|
4554
4554
|
{
|
|
4555
4555
|
showErrors: f,
|
|
4556
4556
|
existing: o,
|
|
@@ -4560,8 +4560,8 @@ function Ui({
|
|
|
4560
4560
|
collectionEditable: b,
|
|
4561
4561
|
customFields: w
|
|
4562
4562
|
}
|
|
4563
|
-
) : S === "key_value" ? M = /* @__PURE__ */ e(
|
|
4564
|
-
y && /* @__PURE__ */ n(
|
|
4563
|
+
) : S === "key_value" ? M = /* @__PURE__ */ e(Mi, { disabled: y }) : M = null, /* @__PURE__ */ n(B, { children: [
|
|
4564
|
+
y && /* @__PURE__ */ n(Wt, { mode: "warn", children: [
|
|
4565
4565
|
/* @__PURE__ */ e(P, { children: "This property can't be edited" }),
|
|
4566
4566
|
/* @__PURE__ */ n(P, { variant: "caption", children: [
|
|
4567
4567
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
@@ -4572,40 +4572,40 @@ function Ui({
|
|
|
4572
4572
|
/* @__PURE__ */ n("div", { className: "flex mt-2 justify-between", children: [
|
|
4573
4573
|
/* @__PURE__ */ n("div", { className: "w-full flex flex-col gap-2", children: [
|
|
4574
4574
|
/* @__PURE__ */ e(
|
|
4575
|
-
|
|
4575
|
+
je,
|
|
4576
4576
|
{
|
|
4577
4577
|
className: "w-full",
|
|
4578
|
-
error: !!
|
|
4578
|
+
error: !!ke,
|
|
4579
4579
|
value: S ?? "",
|
|
4580
4580
|
placeholder: "Select a property widget",
|
|
4581
4581
|
open: v,
|
|
4582
4582
|
onOpenChange: T,
|
|
4583
4583
|
position: "item-aligned",
|
|
4584
4584
|
disabled: y,
|
|
4585
|
-
renderValue: (
|
|
4586
|
-
if (!
|
|
4585
|
+
renderValue: (Z) => {
|
|
4586
|
+
if (!Z)
|
|
4587
4587
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
4588
|
-
const
|
|
4588
|
+
const te = Z, re = _t[te] ?? w[te], de = re.property, Se = de && !le(de) ? Ze(de, w) : void 0, xe = le(de) || o && de.dataType !== t?.dataType, W = Se ? $(Se, re) : re;
|
|
4589
4589
|
return /* @__PURE__ */ n(
|
|
4590
4590
|
"div",
|
|
4591
4591
|
{
|
|
4592
|
-
onClick: (
|
|
4593
|
-
|
|
4592
|
+
onClick: (fe) => {
|
|
4593
|
+
xe && (fe.stopPropagation(), fe.preventDefault());
|
|
4594
4594
|
},
|
|
4595
|
-
className:
|
|
4595
|
+
className: _e(
|
|
4596
4596
|
"flex items-center",
|
|
4597
|
-
|
|
4597
|
+
xe ? "w-full pointer-events-none opacity-50" : ""
|
|
4598
4598
|
),
|
|
4599
4599
|
children: [
|
|
4600
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
4600
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Je, { propertyConfig: W }) }),
|
|
4601
4601
|
/* @__PURE__ */ n("div", { className: "flex flex-col items-start text-base text-left", children: [
|
|
4602
|
-
/* @__PURE__ */ e("div", { children:
|
|
4602
|
+
/* @__PURE__ */ e("div", { children: W.name }),
|
|
4603
4603
|
/* @__PURE__ */ e(
|
|
4604
4604
|
P,
|
|
4605
4605
|
{
|
|
4606
4606
|
variant: "caption",
|
|
4607
4607
|
color: "disabled",
|
|
4608
|
-
children:
|
|
4608
|
+
children: xe ? "You can only switch to widgets that use the same data type" : W.description
|
|
4609
4609
|
}
|
|
4610
4610
|
)
|
|
4611
4611
|
] })
|
|
@@ -4613,25 +4613,25 @@ function Ui({
|
|
|
4613
4613
|
}
|
|
4614
4614
|
);
|
|
4615
4615
|
},
|
|
4616
|
-
onValueChange: (
|
|
4617
|
-
|
|
4616
|
+
onValueChange: (Z) => {
|
|
4617
|
+
he(Z);
|
|
4618
4618
|
},
|
|
4619
|
-
children: j.map(([
|
|
4620
|
-
const
|
|
4619
|
+
children: j.map(([Z, te]) => {
|
|
4620
|
+
const re = te.property, de = o && !le(re) && re.dataType !== t?.dataType;
|
|
4621
4621
|
return /* @__PURE__ */ e(
|
|
4622
|
-
|
|
4622
|
+
na,
|
|
4623
4623
|
{
|
|
4624
|
-
value:
|
|
4625
|
-
optionDisabled:
|
|
4626
|
-
propertyConfig:
|
|
4624
|
+
value: Z,
|
|
4625
|
+
optionDisabled: de,
|
|
4626
|
+
propertyConfig: te,
|
|
4627
4627
|
existing: o
|
|
4628
4628
|
},
|
|
4629
|
-
|
|
4629
|
+
Z
|
|
4630
4630
|
);
|
|
4631
4631
|
})
|
|
4632
4632
|
}
|
|
4633
4633
|
),
|
|
4634
|
-
|
|
4634
|
+
ke && /* @__PURE__ */ e(
|
|
4635
4635
|
P,
|
|
4636
4636
|
{
|
|
4637
4637
|
variant: "caption",
|
|
@@ -4642,19 +4642,19 @@ function Ui({
|
|
|
4642
4642
|
)
|
|
4643
4643
|
] }),
|
|
4644
4644
|
c && t?.id && /* @__PURE__ */ e(
|
|
4645
|
-
|
|
4645
|
+
me,
|
|
4646
4646
|
{
|
|
4647
4647
|
variant: "ghost",
|
|
4648
4648
|
className: "m-4",
|
|
4649
4649
|
disabled: y,
|
|
4650
4650
|
onClick: () => A(!0),
|
|
4651
|
-
children: /* @__PURE__ */ e(
|
|
4651
|
+
children: /* @__PURE__ */ e(st, {})
|
|
4652
4652
|
}
|
|
4653
4653
|
)
|
|
4654
4654
|
] }),
|
|
4655
4655
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
4656
4656
|
m && /* @__PURE__ */ e(
|
|
4657
|
-
|
|
4657
|
+
Pi,
|
|
4658
4658
|
{
|
|
4659
4659
|
showErrors: f,
|
|
4660
4660
|
disabledId: o,
|
|
@@ -4665,10 +4665,10 @@ function Ui({
|
|
|
4665
4665
|
}
|
|
4666
4666
|
),
|
|
4667
4667
|
M,
|
|
4668
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4668
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Bi, { disabled: y }) })
|
|
4669
4669
|
] }),
|
|
4670
4670
|
c && /* @__PURE__ */ e(
|
|
4671
|
-
|
|
4671
|
+
lt,
|
|
4672
4672
|
{
|
|
4673
4673
|
open: I,
|
|
4674
4674
|
onAccept: () => c(t?.id, p),
|
|
@@ -4683,7 +4683,7 @@ function Ui({
|
|
|
4683
4683
|
)
|
|
4684
4684
|
] });
|
|
4685
4685
|
}
|
|
4686
|
-
function
|
|
4686
|
+
function Ri({
|
|
4687
4687
|
showErrors: t,
|
|
4688
4688
|
isNewCollection: a,
|
|
4689
4689
|
propertyErrorsRef: r,
|
|
@@ -4704,20 +4704,20 @@ function $i({
|
|
|
4704
4704
|
setFieldTouched: k,
|
|
4705
4705
|
errors: _,
|
|
4706
4706
|
dirty: O
|
|
4707
|
-
} = L(), h =
|
|
4708
|
-
|
|
4707
|
+
} = L(), h = Qe(), w = Va("lg"), b = !w, [v, T] = Y(), [I, A] = Y(), [S, x] = Y(), C = I ? se(I, S) : void 0, j = C ? N(g.properties, C.replaceAll(".", ".properties.")) : void 0, [J, q] = Y(!1), [U, ie] = Y(!1), [ke, he] = Y([]), M = R.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
|
|
4708
|
+
pe(() => {
|
|
4709
4709
|
s && s(O);
|
|
4710
4710
|
}, [O]);
|
|
4711
|
-
const
|
|
4711
|
+
const Z = u ? () => {
|
|
4712
4712
|
u && (q(!0), u(g).then((V) => {
|
|
4713
|
-
if (V &&
|
|
4713
|
+
if (V && Xt(V.properties), !V) {
|
|
4714
4714
|
h.open({
|
|
4715
4715
|
type: "error",
|
|
4716
4716
|
message: "Could not infer properties from data"
|
|
4717
4717
|
});
|
|
4718
4718
|
return;
|
|
4719
4719
|
}
|
|
4720
|
-
const F = Object.keys(V.properties).filter((
|
|
4720
|
+
const F = Object.keys(V.properties).filter((ne) => !g.properties[ne]);
|
|
4721
4721
|
if (F.length === 0) {
|
|
4722
4722
|
h.open({
|
|
4723
4723
|
type: "info",
|
|
@@ -4725,30 +4725,30 @@ function $i({
|
|
|
4725
4725
|
});
|
|
4726
4726
|
return;
|
|
4727
4727
|
}
|
|
4728
|
-
const
|
|
4729
|
-
...F.reduce((
|
|
4728
|
+
const H = {
|
|
4729
|
+
...F.reduce((ne, be) => (ne[be] = V.properties[be], ne), {}),
|
|
4730
4730
|
...g.properties
|
|
4731
|
-
},
|
|
4731
|
+
}, oe = [
|
|
4732
4732
|
...F,
|
|
4733
4733
|
...g.propertiesOrder ?? []
|
|
4734
4734
|
];
|
|
4735
|
-
f("properties",
|
|
4735
|
+
f("properties", H, !1), re(oe), he(F);
|
|
4736
4736
|
}).finally(() => {
|
|
4737
4737
|
q(!1);
|
|
4738
4738
|
}));
|
|
4739
|
-
} : void 0,
|
|
4740
|
-
const
|
|
4741
|
-
f(
|
|
4742
|
-
},
|
|
4743
|
-
const
|
|
4744
|
-
if (!
|
|
4739
|
+
} : void 0, te = (V) => V ? M.current[V] ?? N(g, Oe(V)) : M.current[""], re = (V, F) => {
|
|
4740
|
+
const H = Oe(F);
|
|
4741
|
+
f(H, V, !1), M.current[F ?? ""] = V;
|
|
4742
|
+
}, de = (V, F) => {
|
|
4743
|
+
const H = V ? se(V, F) : void 0;
|
|
4744
|
+
if (!H)
|
|
4745
4745
|
throw Error("collection editor miss config");
|
|
4746
|
-
f(
|
|
4747
|
-
const
|
|
4748
|
-
|
|
4749
|
-
},
|
|
4750
|
-
f(
|
|
4751
|
-
},
|
|
4746
|
+
f(we(H), void 0, !1);
|
|
4747
|
+
const ne = te(F).filter((be) => be !== V);
|
|
4748
|
+
re(ne, F), ie(!1), T(void 0), A(void 0), x(void 0);
|
|
4749
|
+
}, Se = (V, F) => {
|
|
4750
|
+
f(Oe(F), V, !1);
|
|
4751
|
+
}, xe = ({
|
|
4752
4752
|
id: V,
|
|
4753
4753
|
property: F
|
|
4754
4754
|
}) => {
|
|
@@ -4761,50 +4761,50 @@ function $i({
|
|
|
4761
4761
|
...g.properties ?? {},
|
|
4762
4762
|
[V]: F
|
|
4763
4763
|
}, !1);
|
|
4764
|
-
const
|
|
4764
|
+
const H = [...g.propertiesOrder ?? Object.keys(g.properties), V];
|
|
4765
4765
|
console.log("onPropertyCreated", {
|
|
4766
4766
|
id: V,
|
|
4767
4767
|
property: F,
|
|
4768
|
-
newPropertiesOrder:
|
|
4769
|
-
}),
|
|
4770
|
-
},
|
|
4768
|
+
newPropertiesOrder: H
|
|
4769
|
+
}), re(H), ie(!1), w && (T(H.indexOf(V)), A(V)), x(void 0);
|
|
4770
|
+
}, W = ({
|
|
4771
4771
|
id: V,
|
|
4772
4772
|
property: F,
|
|
4773
|
-
previousId:
|
|
4774
|
-
namespace:
|
|
4773
|
+
previousId: H,
|
|
4774
|
+
namespace: oe
|
|
4775
4775
|
}) => {
|
|
4776
|
-
const
|
|
4777
|
-
if (
|
|
4778
|
-
const
|
|
4779
|
-
|
|
4776
|
+
const ne = V ? se(V, oe) : void 0, be = ne ? we(ne) : void 0;
|
|
4777
|
+
if (H && H !== V) {
|
|
4778
|
+
const ht = se(H, oe), et = we(ht), X = te(oe).map((ze) => ze === H ? V : ze).filter((ze) => ze !== void 0);
|
|
4779
|
+
re(X, oe), V && (T(X.indexOf(V)), A(V)), f(et, void 0, !1), k(et, !1, !1);
|
|
4780
4780
|
}
|
|
4781
|
-
|
|
4782
|
-
},
|
|
4783
|
-
const
|
|
4781
|
+
be && (f(be, F, !1), k(be, !0, !1));
|
|
4782
|
+
}, fe = (V, F, H) => {
|
|
4783
|
+
const oe = V ? se(V, F) : void 0;
|
|
4784
4784
|
if (console.warn("onPropertyErrorInternal", {
|
|
4785
4785
|
id: V,
|
|
4786
4786
|
namespace: F,
|
|
4787
|
-
error:
|
|
4788
|
-
propertyPath:
|
|
4789
|
-
}),
|
|
4790
|
-
const
|
|
4791
|
-
i(V, F,
|
|
4787
|
+
error: H,
|
|
4788
|
+
propertyPath: oe
|
|
4789
|
+
}), oe) {
|
|
4790
|
+
const ne = H && Object.keys(H).length > 0;
|
|
4791
|
+
i(V, F, ne ? H : void 0), y(we(oe), ne ? "Property error" : void 0);
|
|
4792
4792
|
}
|
|
4793
|
-
},
|
|
4793
|
+
}, ut = () => {
|
|
4794
4794
|
T(void 0), A(void 0);
|
|
4795
|
-
},
|
|
4796
|
-
/* @__PURE__ */ n("div", { className:
|
|
4795
|
+
}, We = I && r?.current?.properties ? r.current.properties[I] : void 0, z = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, K = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), D = Ut(() => d(g.ownerId), [d, g.ownerId]), Xe = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
4796
|
+
/* @__PURE__ */ n("div", { className: _e(
|
|
4797
4797
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
4798
4798
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
4799
|
-
!b && "border-r " +
|
|
4799
|
+
!b && "border-r " + xt
|
|
4800
4800
|
), children: [
|
|
4801
4801
|
/* @__PURE__ */ n("div", { className: "flex my-2", children: [
|
|
4802
4802
|
/* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
|
|
4803
4803
|
/* @__PURE__ */ e(
|
|
4804
|
-
|
|
4804
|
+
ge,
|
|
4805
4805
|
{
|
|
4806
4806
|
name: "name",
|
|
4807
|
-
as:
|
|
4807
|
+
as: G,
|
|
4808
4808
|
invisible: !0,
|
|
4809
4809
|
className: "-ml-1",
|
|
4810
4810
|
inputClassName: "text-2xl font-headers",
|
|
@@ -4829,39 +4829,39 @@ function $i({
|
|
|
4829
4829
|
] }),
|
|
4830
4830
|
l && /* @__PURE__ */ e("div", { className: "ml-4", children: l }),
|
|
4831
4831
|
/* @__PURE__ */ n("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
|
|
4832
|
-
|
|
4832
|
+
Z && /* @__PURE__ */ e(ae, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
4833
4833
|
E,
|
|
4834
4834
|
{
|
|
4835
4835
|
variant: "text",
|
|
4836
|
-
disabled:
|
|
4837
|
-
onClick:
|
|
4838
|
-
children:
|
|
4836
|
+
disabled: J,
|
|
4837
|
+
onClick: Z,
|
|
4838
|
+
children: J ? /* @__PURE__ */ e(Ye, { size: "small" }) : /* @__PURE__ */ e(pt, {})
|
|
4839
4839
|
}
|
|
4840
4840
|
) }),
|
|
4841
|
-
/* @__PURE__ */ e(
|
|
4841
|
+
/* @__PURE__ */ e(ae, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
4842
4842
|
E,
|
|
4843
4843
|
{
|
|
4844
4844
|
variant: "outlined",
|
|
4845
|
-
onClick: () =>
|
|
4846
|
-
children: /* @__PURE__ */ e(
|
|
4845
|
+
onClick: () => ie(!0),
|
|
4846
|
+
children: /* @__PURE__ */ e(Ne, {})
|
|
4847
4847
|
}
|
|
4848
4848
|
) })
|
|
4849
4849
|
] })
|
|
4850
4850
|
] }),
|
|
4851
|
-
/* @__PURE__ */ e(
|
|
4852
|
-
|
|
4851
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
|
|
4852
|
+
mt,
|
|
4853
4853
|
{
|
|
4854
4854
|
className: "pl-8",
|
|
4855
4855
|
onPropertyClick: (V, F) => {
|
|
4856
4856
|
T(K.indexOf(V)), A(V), x(F);
|
|
4857
4857
|
},
|
|
4858
|
-
inferredPropertyKeys:
|
|
4859
|
-
selectedPropertyKey: I ?
|
|
4858
|
+
inferredPropertyKeys: ke,
|
|
4859
|
+
selectedPropertyKey: I ? se(I, S) : void 0,
|
|
4860
4860
|
properties: g.properties,
|
|
4861
4861
|
additionalFields: g.additionalFields,
|
|
4862
4862
|
propertiesOrder: K,
|
|
4863
|
-
onPropertyMove:
|
|
4864
|
-
onPropertyRemove: a ?
|
|
4863
|
+
onPropertyMove: Se,
|
|
4864
|
+
onPropertyRemove: a ? de : void 0,
|
|
4865
4865
|
collectionEditable: p,
|
|
4866
4866
|
errors: t ? _ : {}
|
|
4867
4867
|
}
|
|
@@ -4873,19 +4873,19 @@ function $i({
|
|
|
4873
4873
|
color: "primary",
|
|
4874
4874
|
variant: "outlined",
|
|
4875
4875
|
size: "large",
|
|
4876
|
-
onClick: () =>
|
|
4877
|
-
startIcon: /* @__PURE__ */ e(
|
|
4876
|
+
onClick: () => ie(!0),
|
|
4877
|
+
startIcon: /* @__PURE__ */ e(Ne, {}),
|
|
4878
4878
|
children: "Add new property"
|
|
4879
4879
|
}
|
|
4880
4880
|
)
|
|
4881
4881
|
] }),
|
|
4882
4882
|
!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
|
-
|
|
4883
|
+
Pe,
|
|
4884
4884
|
{
|
|
4885
4885
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
4886
4886
|
children: [
|
|
4887
|
-
C && j && !
|
|
4888
|
-
|
|
4887
|
+
C && j && !le(j) && /* @__PURE__ */ e(
|
|
4888
|
+
sa,
|
|
4889
4889
|
{
|
|
4890
4890
|
inArray: !1,
|
|
4891
4891
|
existingProperty: !a,
|
|
@@ -4895,11 +4895,11 @@ function $i({
|
|
|
4895
4895
|
propertyKey: I,
|
|
4896
4896
|
propertyNamespace: S,
|
|
4897
4897
|
property: j,
|
|
4898
|
-
onPropertyChanged:
|
|
4899
|
-
onDelete:
|
|
4900
|
-
onError:
|
|
4898
|
+
onPropertyChanged: W,
|
|
4899
|
+
onDelete: de,
|
|
4900
|
+
onError: fe,
|
|
4901
4901
|
forceShowErrors: t,
|
|
4902
|
-
initialErrors:
|
|
4902
|
+
initialErrors: We,
|
|
4903
4903
|
getData: m,
|
|
4904
4904
|
customFields: c,
|
|
4905
4905
|
collectionEditable: p
|
|
@@ -4907,12 +4907,12 @@ function $i({
|
|
|
4907
4907
|
`edit_view_${v}`
|
|
4908
4908
|
),
|
|
4909
4909
|
!j && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center h-full", children: z ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
4910
|
-
j &&
|
|
4910
|
+
j && le(j) && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
4911
4911
|
]
|
|
4912
4912
|
}
|
|
4913
4913
|
) }),
|
|
4914
4914
|
b && /* @__PURE__ */ e(
|
|
4915
|
-
|
|
4915
|
+
Fe,
|
|
4916
4916
|
{
|
|
4917
4917
|
inArray: !1,
|
|
4918
4918
|
open: v !== void 0,
|
|
@@ -4923,23 +4923,23 @@ function $i({
|
|
|
4923
4923
|
propertyKey: I,
|
|
4924
4924
|
propertyNamespace: S,
|
|
4925
4925
|
property: j,
|
|
4926
|
-
onPropertyChanged:
|
|
4927
|
-
onDelete:
|
|
4928
|
-
onError:
|
|
4926
|
+
onPropertyChanged: W,
|
|
4927
|
+
onDelete: de,
|
|
4928
|
+
onError: fe,
|
|
4929
4929
|
forceShowErrors: t,
|
|
4930
|
-
initialErrors:
|
|
4930
|
+
initialErrors: We,
|
|
4931
4931
|
getData: m,
|
|
4932
4932
|
customFields: c,
|
|
4933
4933
|
collectionEditable: p,
|
|
4934
|
-
onOkClicked: b ?
|
|
4934
|
+
onOkClicked: b ? ut : void 0
|
|
4935
4935
|
},
|
|
4936
4936
|
`edit_view_${v}`
|
|
4937
4937
|
)
|
|
4938
4938
|
] });
|
|
4939
4939
|
return /* @__PURE__ */ n(B, { children: [
|
|
4940
|
-
|
|
4940
|
+
Xe,
|
|
4941
4941
|
/* @__PURE__ */ e(
|
|
4942
|
-
|
|
4942
|
+
Fe,
|
|
4943
4943
|
{
|
|
4944
4944
|
inArray: !1,
|
|
4945
4945
|
existingProperty: !1,
|
|
@@ -4947,8 +4947,8 @@ function $i({
|
|
|
4947
4947
|
autoUpdateId: !0,
|
|
4948
4948
|
forceShowErrors: t,
|
|
4949
4949
|
open: U,
|
|
4950
|
-
onCancel: () =>
|
|
4951
|
-
onPropertyChanged:
|
|
4950
|
+
onCancel: () => ie(!1),
|
|
4951
|
+
onPropertyChanged: xe,
|
|
4952
4952
|
getData: m,
|
|
4953
4953
|
allowDataInference: !a,
|
|
4954
4954
|
customFields: c,
|
|
@@ -4958,7 +4958,7 @@ function $i({
|
|
|
4958
4958
|
)
|
|
4959
4959
|
] });
|
|
4960
4960
|
}
|
|
4961
|
-
function
|
|
4961
|
+
function Ui({
|
|
4962
4962
|
open: t,
|
|
4963
4963
|
handleOk: a,
|
|
4964
4964
|
handleCancel: r,
|
|
@@ -4966,19 +4966,19 @@ function Li({
|
|
|
4966
4966
|
title: s
|
|
4967
4967
|
}) {
|
|
4968
4968
|
return /* @__PURE__ */ n(
|
|
4969
|
-
|
|
4969
|
+
Me,
|
|
4970
4970
|
{
|
|
4971
4971
|
open: t,
|
|
4972
4972
|
onOpenChange: (o) => o ? r() : a(),
|
|
4973
4973
|
"aria-labelledby": "alert-dialog-title",
|
|
4974
4974
|
"aria-describedby": "alert-dialog-description",
|
|
4975
4975
|
children: [
|
|
4976
|
-
/* @__PURE__ */ n(
|
|
4976
|
+
/* @__PURE__ */ n(He, { children: [
|
|
4977
4977
|
/* @__PURE__ */ e(P, { variant: "h6", children: s ?? "Unsaved changes" }),
|
|
4978
4978
|
i && /* @__PURE__ */ e(P, { children: i }),
|
|
4979
4979
|
/* @__PURE__ */ e(P, { children: "Are you sure?" })
|
|
4980
4980
|
] }),
|
|
4981
|
-
/* @__PURE__ */ n(
|
|
4981
|
+
/* @__PURE__ */ n(Ge, { children: [
|
|
4982
4982
|
/* @__PURE__ */ e(E, { variant: "text", onClick: r, autoFocus: !0, children: " Cancel " }),
|
|
4983
4983
|
/* @__PURE__ */ e(E, { onClick: a, children: " Ok " })
|
|
4984
4984
|
] })
|
|
@@ -4986,15 +4986,15 @@ function Li({
|
|
|
4986
4986
|
}
|
|
4987
4987
|
);
|
|
4988
4988
|
}
|
|
4989
|
-
function
|
|
4990
|
-
const { entityViews: r } =
|
|
4989
|
+
function $i({ open: t, onClose: a }) {
|
|
4990
|
+
const { entityViews: r } = qe();
|
|
4991
4991
|
return /* @__PURE__ */ n(
|
|
4992
|
-
|
|
4992
|
+
Me,
|
|
4993
4993
|
{
|
|
4994
4994
|
maxWidth: "md",
|
|
4995
4995
|
open: t,
|
|
4996
4996
|
children: [
|
|
4997
|
-
/* @__PURE__ */ n(
|
|
4997
|
+
/* @__PURE__ */ n(He, { children: [
|
|
4998
4998
|
/* @__PURE__ */ e(P, { variant: "h6", children: "Select view" }),
|
|
4999
4999
|
r?.map((i) => /* @__PURE__ */ n(
|
|
5000
5000
|
E,
|
|
@@ -5012,12 +5012,12 @@ function Ki({ open: t, onClose: a }) {
|
|
|
5012
5012
|
i.key
|
|
5013
5013
|
))
|
|
5014
5014
|
] }),
|
|
5015
|
-
/* @__PURE__ */ e(
|
|
5015
|
+
/* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(E, { onClick: () => a(), children: "Cancel" }) })
|
|
5016
5016
|
]
|
|
5017
5017
|
}
|
|
5018
5018
|
);
|
|
5019
5019
|
}
|
|
5020
|
-
function
|
|
5020
|
+
function Li({
|
|
5021
5021
|
collection: t,
|
|
5022
5022
|
parentCollection: a,
|
|
5023
5023
|
configController: r,
|
|
@@ -5025,19 +5025,19 @@ function Yi({
|
|
|
5025
5025
|
getUser: s,
|
|
5026
5026
|
parentPathSegments: o
|
|
5027
5027
|
}) {
|
|
5028
|
-
const { entityViews: l } =
|
|
5028
|
+
const { entityViews: l } = qe(), [d, m] = R.useState(), [u, c] = R.useState(!1), [p, g] = R.useState(), [f, y] = R.useState(), {
|
|
5029
5029
|
values: k,
|
|
5030
5030
|
setFieldValue: _
|
|
5031
|
-
} = L(), O = t.subcollections ?? [], h = k.entityViews?.filter((v) => typeof v == "string").map((v) =>
|
|
5031
|
+
} = L(), O = t.subcollections ?? [], h = k.entityViews?.filter((v) => typeof v == "string").map((v) => ja(v, l)).filter(Boolean) ?? [], w = t.entityViews?.filter((v) => typeof v != "string") ?? [], b = h.length + w.length;
|
|
5032
5032
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
|
|
5033
|
-
/* @__PURE__ */ e(
|
|
5033
|
+
/* @__PURE__ */ e(dt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
|
|
5034
5034
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
5035
5035
|
/* @__PURE__ */ n(P, { variant: "h5", children: [
|
|
5036
5036
|
"Subcollections of ",
|
|
5037
5037
|
k.name
|
|
5038
5038
|
] }),
|
|
5039
|
-
O && O.length > 0 && /* @__PURE__ */ e(
|
|
5040
|
-
|
|
5039
|
+
O && O.length > 0 && /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(Tt, { children: O.map((v) => /* @__PURE__ */ n(
|
|
5040
|
+
ft,
|
|
5041
5041
|
{
|
|
5042
5042
|
onClick: () => y({
|
|
5043
5043
|
isNewCollection: !1,
|
|
@@ -5045,25 +5045,25 @@ function Yi({
|
|
|
5045
5045
|
}),
|
|
5046
5046
|
children: [
|
|
5047
5047
|
/* @__PURE__ */ e(
|
|
5048
|
-
|
|
5048
|
+
Ue,
|
|
5049
5049
|
{
|
|
5050
5050
|
align: "left",
|
|
5051
5051
|
children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: v.name })
|
|
5052
5052
|
}
|
|
5053
5053
|
),
|
|
5054
5054
|
/* @__PURE__ */ e(
|
|
5055
|
-
|
|
5055
|
+
Ue,
|
|
5056
5056
|
{
|
|
5057
5057
|
align: "right",
|
|
5058
|
-
children: /* @__PURE__ */ e(
|
|
5059
|
-
|
|
5058
|
+
children: /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5059
|
+
me,
|
|
5060
5060
|
{
|
|
5061
5061
|
size: "small",
|
|
5062
5062
|
onClick: (T) => {
|
|
5063
5063
|
T.preventDefault(), T.stopPropagation(), m(v.path);
|
|
5064
5064
|
},
|
|
5065
5065
|
color: "inherit",
|
|
5066
|
-
children: /* @__PURE__ */ e(
|
|
5066
|
+
children: /* @__PURE__ */ e(st, { size: "small" })
|
|
5067
5067
|
}
|
|
5068
5068
|
) })
|
|
5069
5069
|
}
|
|
@@ -5081,42 +5081,42 @@ function Yi({
|
|
|
5081
5081
|
});
|
|
5082
5082
|
},
|
|
5083
5083
|
variant: "outlined",
|
|
5084
|
-
startIcon: /* @__PURE__ */ e(
|
|
5084
|
+
startIcon: /* @__PURE__ */ e(Ne, {}),
|
|
5085
5085
|
children: "Add subcollection"
|
|
5086
5086
|
}
|
|
5087
5087
|
)
|
|
5088
5088
|
] }),
|
|
5089
5089
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
5090
5090
|
/* @__PURE__ */ e(P, { variant: "h5", children: "Custom views" }),
|
|
5091
|
-
b > 0 && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
5092
|
-
h.map((v) => /* @__PURE__ */ n(
|
|
5091
|
+
b > 0 && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ n(Tt, { children: [
|
|
5092
|
+
h.map((v) => /* @__PURE__ */ n(ft, { children: [
|
|
5093
5093
|
/* @__PURE__ */ e(
|
|
5094
|
-
|
|
5094
|
+
Ue,
|
|
5095
5095
|
{
|
|
5096
5096
|
align: "left",
|
|
5097
5097
|
children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: v.name })
|
|
5098
5098
|
}
|
|
5099
5099
|
),
|
|
5100
5100
|
/* @__PURE__ */ e(
|
|
5101
|
-
|
|
5101
|
+
Ue,
|
|
5102
5102
|
{
|
|
5103
5103
|
align: "right",
|
|
5104
|
-
children: /* @__PURE__ */ e(
|
|
5105
|
-
|
|
5104
|
+
children: /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5105
|
+
me,
|
|
5106
5106
|
{
|
|
5107
5107
|
size: "small",
|
|
5108
5108
|
onClick: (T) => {
|
|
5109
5109
|
T.preventDefault(), T.stopPropagation(), g(v.key);
|
|
5110
5110
|
},
|
|
5111
5111
|
color: "inherit",
|
|
5112
|
-
children: /* @__PURE__ */ e(
|
|
5112
|
+
children: /* @__PURE__ */ e(st, { size: "small" })
|
|
5113
5113
|
}
|
|
5114
5114
|
) })
|
|
5115
5115
|
}
|
|
5116
5116
|
)
|
|
5117
5117
|
] }, v.key)),
|
|
5118
|
-
w.map((v) => /* @__PURE__ */ e(
|
|
5119
|
-
|
|
5118
|
+
w.map((v) => /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ n(
|
|
5119
|
+
Ue,
|
|
5120
5120
|
{
|
|
5121
5121
|
align: "left",
|
|
5122
5122
|
children: [
|
|
@@ -5129,7 +5129,7 @@ function Yi({
|
|
|
5129
5129
|
}
|
|
5130
5130
|
) }, v.key))
|
|
5131
5131
|
] }) }) }) }),
|
|
5132
|
-
b === 0 && /* @__PURE__ */ e(
|
|
5132
|
+
b === 0 && /* @__PURE__ */ e(Wt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
|
|
5133
5133
|
/* @__PURE__ */ e(
|
|
5134
5134
|
E,
|
|
5135
5135
|
{
|
|
@@ -5137,14 +5137,14 @@ function Yi({
|
|
|
5137
5137
|
c(!0);
|
|
5138
5138
|
},
|
|
5139
5139
|
variant: "outlined",
|
|
5140
|
-
startIcon: /* @__PURE__ */ e(
|
|
5140
|
+
startIcon: /* @__PURE__ */ e(Ne, {}),
|
|
5141
5141
|
children: "Add custom entity view"
|
|
5142
5142
|
}
|
|
5143
5143
|
)
|
|
5144
5144
|
] })
|
|
5145
5145
|
] }) }),
|
|
5146
5146
|
d && /* @__PURE__ */ e(
|
|
5147
|
-
|
|
5147
|
+
lt,
|
|
5148
5148
|
{
|
|
5149
5149
|
open: !!d,
|
|
5150
5150
|
onAccept: () => {
|
|
@@ -5163,7 +5163,7 @@ function Yi({
|
|
|
5163
5163
|
}
|
|
5164
5164
|
),
|
|
5165
5165
|
p && /* @__PURE__ */ e(
|
|
5166
|
-
|
|
5166
|
+
lt,
|
|
5167
5167
|
{
|
|
5168
5168
|
open: !!p,
|
|
5169
5169
|
onAccept: () => {
|
|
@@ -5179,7 +5179,7 @@ function Yi({
|
|
|
5179
5179
|
}
|
|
5180
5180
|
),
|
|
5181
5181
|
/* @__PURE__ */ e(
|
|
5182
|
-
|
|
5182
|
+
ca,
|
|
5183
5183
|
{
|
|
5184
5184
|
open: !!f,
|
|
5185
5185
|
configController: r,
|
|
@@ -5195,7 +5195,7 @@ function Yi({
|
|
|
5195
5195
|
}
|
|
5196
5196
|
),
|
|
5197
5197
|
/* @__PURE__ */ e(
|
|
5198
|
-
|
|
5198
|
+
$i,
|
|
5199
5199
|
{
|
|
5200
5200
|
open: u,
|
|
5201
5201
|
onClose: (v) => {
|
|
@@ -5205,7 +5205,7 @@ function Yi({
|
|
|
5205
5205
|
)
|
|
5206
5206
|
] });
|
|
5207
5207
|
}
|
|
5208
|
-
const
|
|
5208
|
+
const Bt = {
|
|
5209
5209
|
path: "products",
|
|
5210
5210
|
name: "Products",
|
|
5211
5211
|
singularName: "Product",
|
|
@@ -5290,7 +5290,7 @@ const Dt = Ot({
|
|
|
5290
5290
|
autoValue: "on_create"
|
|
5291
5291
|
}
|
|
5292
5292
|
}
|
|
5293
|
-
}
|
|
5293
|
+
}, Mt = {
|
|
5294
5294
|
path: "blog",
|
|
5295
5295
|
name: "Blog",
|
|
5296
5296
|
singularName: "Blog entry",
|
|
@@ -5299,12 +5299,12 @@ const Dt = Ot({
|
|
|
5299
5299
|
description: "A collection of blog entries",
|
|
5300
5300
|
defaultSize: "l",
|
|
5301
5301
|
properties: {
|
|
5302
|
-
name:
|
|
5302
|
+
name: {
|
|
5303
5303
|
name: "Name",
|
|
5304
5304
|
validation: { required: !0 },
|
|
5305
5305
|
dataType: "string"
|
|
5306
|
-
}
|
|
5307
|
-
header_image:
|
|
5306
|
+
},
|
|
5307
|
+
header_image: {
|
|
5308
5308
|
name: "Header image",
|
|
5309
5309
|
dataType: "string",
|
|
5310
5310
|
storage: {
|
|
@@ -5314,8 +5314,8 @@ const Dt = Ot({
|
|
|
5314
5314
|
cacheControl: "max-age=1000000"
|
|
5315
5315
|
}
|
|
5316
5316
|
}
|
|
5317
|
-
}
|
|
5318
|
-
content:
|
|
5317
|
+
},
|
|
5318
|
+
content: {
|
|
5319
5319
|
name: "Content",
|
|
5320
5320
|
description: "Content blocks for the blog entry",
|
|
5321
5321
|
validation: { required: !0 },
|
|
@@ -5361,7 +5361,7 @@ const Dt = Ot({
|
|
|
5361
5361
|
},
|
|
5362
5362
|
propertiesOrder: ["text", "quote", "images", "products"]
|
|
5363
5363
|
}
|
|
5364
|
-
}
|
|
5364
|
+
},
|
|
5365
5365
|
created_on: {
|
|
5366
5366
|
name: "Created on",
|
|
5367
5367
|
dataType: "date",
|
|
@@ -5402,7 +5402,7 @@ const Dt = Ot({
|
|
|
5402
5402
|
initialFilter: {
|
|
5403
5403
|
status: ["==", "published"]
|
|
5404
5404
|
}
|
|
5405
|
-
}
|
|
5405
|
+
}, Dt = {
|
|
5406
5406
|
path: "users",
|
|
5407
5407
|
name: "Users",
|
|
5408
5408
|
singularName: "User",
|
|
@@ -5433,16 +5433,16 @@ const Dt = Ot({
|
|
|
5433
5433
|
url: "image"
|
|
5434
5434
|
}
|
|
5435
5435
|
}
|
|
5436
|
-
}
|
|
5437
|
-
function
|
|
5436
|
+
};
|
|
5437
|
+
function Ki({
|
|
5438
5438
|
path: t,
|
|
5439
5439
|
pathSuggestions: a,
|
|
5440
5440
|
parentCollection: r,
|
|
5441
5441
|
onContinue: i,
|
|
5442
5442
|
collections: s
|
|
5443
5443
|
}) {
|
|
5444
|
-
const [o, l] =
|
|
5445
|
-
|
|
5444
|
+
const [o, l] = Y(!1), [d, m] = Y();
|
|
5445
|
+
pe(() => {
|
|
5446
5446
|
a && s && (l(!0), a(t).then((h) => {
|
|
5447
5447
|
const w = h.filter((b) => !s.find((v) => v.path.trim().toLowerCase() === b.trim().toLowerCase()));
|
|
5448
5448
|
m(w);
|
|
@@ -5459,7 +5459,7 @@ function Hi({
|
|
|
5459
5459
|
isSubmitting: _,
|
|
5460
5460
|
submitCount: O
|
|
5461
5461
|
} = L();
|
|
5462
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(
|
|
5462
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(dt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5463
5463
|
/* @__PURE__ */ e(
|
|
5464
5464
|
"div",
|
|
5465
5465
|
{
|
|
@@ -5467,7 +5467,7 @@ function Hi({
|
|
|
5467
5467
|
children: /* @__PURE__ */ e(P, { variant: "h4", className: "flex-grow", children: "New collection" })
|
|
5468
5468
|
}
|
|
5469
5469
|
),
|
|
5470
|
-
r && /* @__PURE__ */ e(
|
|
5470
|
+
r && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
|
|
5471
5471
|
"This is a subcollection of ",
|
|
5472
5472
|
/* @__PURE__ */ e("b", { children: r.name })
|
|
5473
5473
|
] }) }),
|
|
@@ -5481,13 +5481,13 @@ function Hi({
|
|
|
5481
5481
|
}
|
|
5482
5482
|
),
|
|
5483
5483
|
/* @__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(
|
|
5484
|
+
o && !d && /* @__PURE__ */ e(Ye, { size: "small" }),
|
|
5485
5485
|
d?.map((h, w) => /* @__PURE__ */ e(
|
|
5486
|
-
|
|
5486
|
+
nt,
|
|
5487
5487
|
{
|
|
5488
5488
|
colorScheme: "cyanLighter",
|
|
5489
5489
|
onClick: () => {
|
|
5490
|
-
c("name",
|
|
5490
|
+
c("name", Ct(h)), c("path", h), c("properties", void 0), i();
|
|
5491
5491
|
},
|
|
5492
5492
|
size: "small",
|
|
5493
5493
|
children: h
|
|
@@ -5508,35 +5508,35 @@ function Hi({
|
|
|
5508
5508
|
),
|
|
5509
5509
|
/* @__PURE__ */ n("div", { className: "flex gap-4", children: [
|
|
5510
5510
|
/* @__PURE__ */ e(
|
|
5511
|
-
|
|
5511
|
+
vt,
|
|
5512
5512
|
{
|
|
5513
5513
|
title: "Products",
|
|
5514
5514
|
subtitle: "A collection of products with images, prices and stock",
|
|
5515
|
-
icon: /* @__PURE__ */ e(
|
|
5515
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Bt.icon }),
|
|
5516
5516
|
onClick: () => {
|
|
5517
|
-
p(
|
|
5517
|
+
p(Bt), i();
|
|
5518
5518
|
}
|
|
5519
5519
|
}
|
|
5520
5520
|
),
|
|
5521
5521
|
/* @__PURE__ */ e(
|
|
5522
|
-
|
|
5522
|
+
vt,
|
|
5523
5523
|
{
|
|
5524
5524
|
title: "Blog posts",
|
|
5525
5525
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
5526
|
-
icon: /* @__PURE__ */ e(
|
|
5526
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Mt.icon }),
|
|
5527
5527
|
onClick: () => {
|
|
5528
|
-
p(
|
|
5528
|
+
p(Mt), i();
|
|
5529
5529
|
}
|
|
5530
5530
|
}
|
|
5531
5531
|
),
|
|
5532
5532
|
/* @__PURE__ */ e(
|
|
5533
|
-
|
|
5533
|
+
vt,
|
|
5534
5534
|
{
|
|
5535
5535
|
title: "Users",
|
|
5536
5536
|
subtitle: "A collection of users with emails, names and roles",
|
|
5537
|
-
icon: /* @__PURE__ */ e(
|
|
5537
|
+
icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Dt.icon }),
|
|
5538
5538
|
onClick: () => {
|
|
5539
|
-
p(
|
|
5539
|
+
p(Dt), i();
|
|
5540
5540
|
}
|
|
5541
5541
|
}
|
|
5542
5542
|
)
|
|
@@ -5552,22 +5552,22 @@ function Hi({
|
|
|
5552
5552
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
5553
5553
|
}
|
|
5554
5554
|
),
|
|
5555
|
-
/* @__PURE__ */ e(
|
|
5555
|
+
/* @__PURE__ */ e(ai, { onDataAdded: (h) => i(h) })
|
|
5556
5556
|
] }),
|
|
5557
5557
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(E, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
|
|
5558
5558
|
] }) });
|
|
5559
5559
|
}
|
|
5560
|
-
function
|
|
5560
|
+
function vt({
|
|
5561
5561
|
title: t,
|
|
5562
5562
|
subtitle: a,
|
|
5563
5563
|
icon: r,
|
|
5564
5564
|
onClick: i
|
|
5565
5565
|
}) {
|
|
5566
|
-
return /* @__PURE__ */ e(
|
|
5567
|
-
|
|
5566
|
+
return /* @__PURE__ */ e(ae, { title: a, children: /* @__PURE__ */ n(
|
|
5567
|
+
ea,
|
|
5568
5568
|
{
|
|
5569
5569
|
onClick: i,
|
|
5570
|
-
className:
|
|
5570
|
+
className: _e(
|
|
5571
5571
|
"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
5572
|
"text-gray-700 dark:text-gray-300",
|
|
5573
5573
|
"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 +5588,7 @@ function wt({
|
|
|
5588
5588
|
}
|
|
5589
5589
|
) });
|
|
5590
5590
|
}
|
|
5591
|
-
const
|
|
5591
|
+
const Yi = [
|
|
5592
5592
|
"text_field",
|
|
5593
5593
|
"multiline",
|
|
5594
5594
|
"markdown",
|
|
@@ -5609,10 +5609,10 @@ const Gi = [
|
|
|
5609
5609
|
"date_time",
|
|
5610
5610
|
"repeat",
|
|
5611
5611
|
"block"
|
|
5612
|
-
],
|
|
5613
|
-
([t]) =>
|
|
5612
|
+
], Hi = Object.entries(_t).filter(
|
|
5613
|
+
([t]) => Yi.includes(t)
|
|
5614
5614
|
);
|
|
5615
|
-
function
|
|
5615
|
+
function Gi({
|
|
5616
5616
|
importConfig: t,
|
|
5617
5617
|
customFields: a,
|
|
5618
5618
|
collectionEditable: r
|
|
@@ -5621,18 +5621,18 @@ function Zi({
|
|
|
5621
5621
|
setFieldValue: i,
|
|
5622
5622
|
setFieldTouched: s,
|
|
5623
5623
|
values: o
|
|
5624
|
-
} = L(), [l, d] =
|
|
5624
|
+
} = L(), [l, d] = Y(void 0), m = R.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, p = ({
|
|
5625
5625
|
id: f,
|
|
5626
5626
|
property: y,
|
|
5627
5627
|
previousId: k,
|
|
5628
5628
|
namespace: _
|
|
5629
5629
|
}) => {
|
|
5630
|
-
const O = f ?
|
|
5631
|
-
const I =
|
|
5630
|
+
const O = f ? se(f, _) : void 0, h = O ? we(O) : void 0, w = (v) => v ? m.current[v] ?? N(o, Oe(v)) : m.current[""], b = (v, T) => {
|
|
5631
|
+
const I = Oe(T);
|
|
5632
5632
|
i(I, v, !1), m.current[T ?? ""] = v;
|
|
5633
5633
|
};
|
|
5634
5634
|
if (k && k !== f) {
|
|
5635
|
-
const v =
|
|
5635
|
+
const v = se(k, _), T = we(v), A = w(_).map((x) => x === k ? f : x).filter((x) => x !== void 0);
|
|
5636
5636
|
b(A, _);
|
|
5637
5637
|
const S = { ...t.headersMapping };
|
|
5638
5638
|
Object.keys(S).forEach((x) => {
|
|
@@ -5646,8 +5646,8 @@ function Zi({
|
|
|
5646
5646
|
property: k,
|
|
5647
5647
|
namespace: _
|
|
5648
5648
|
}) => {
|
|
5649
|
-
const O = f ?
|
|
5650
|
-
...
|
|
5649
|
+
const O = f ? se(f, _) : void 0, h = O ? we(O) : void 0, w = t.importData.map((v) => N(v, y)), b = {
|
|
5650
|
+
...Ja(w, k, aa),
|
|
5651
5651
|
editable: !0
|
|
5652
5652
|
};
|
|
5653
5653
|
h && (b ? (console.log("updating inferredNewProperty", {
|
|
@@ -5656,10 +5656,10 @@ function Zi({
|
|
|
5656
5656
|
}), i(h, b, !1)) : i(h, k, !1), s(h, !0, !1));
|
|
5657
5657
|
};
|
|
5658
5658
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
|
|
5659
|
-
/* @__PURE__ */ n(
|
|
5659
|
+
/* @__PURE__ */ n(dt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5660
5660
|
/* @__PURE__ */ e(P, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
|
|
5661
5661
|
/* @__PURE__ */ e(
|
|
5662
|
-
|
|
5662
|
+
ii,
|
|
5663
5663
|
{
|
|
5664
5664
|
headersMapping: t.headersMapping,
|
|
5665
5665
|
idColumn: t.idColumn,
|
|
@@ -5671,7 +5671,7 @@ function Zi({
|
|
|
5671
5671
|
propertyKey: y,
|
|
5672
5672
|
importKey: k
|
|
5673
5673
|
}) => /* @__PURE__ */ e(
|
|
5674
|
-
|
|
5674
|
+
ri,
|
|
5675
5675
|
{
|
|
5676
5676
|
property: f,
|
|
5677
5677
|
propertyKey: y,
|
|
@@ -5684,7 +5684,7 @@ function Zi({
|
|
|
5684
5684
|
});
|
|
5685
5685
|
},
|
|
5686
5686
|
propertyTypeView: /* @__PURE__ */ e(
|
|
5687
|
-
|
|
5687
|
+
Qi,
|
|
5688
5688
|
{
|
|
5689
5689
|
property: f,
|
|
5690
5690
|
disabled: !1,
|
|
@@ -5702,7 +5702,7 @@ function Zi({
|
|
|
5702
5702
|
)
|
|
5703
5703
|
] }),
|
|
5704
5704
|
/* @__PURE__ */ e(
|
|
5705
|
-
|
|
5705
|
+
Fe,
|
|
5706
5706
|
{
|
|
5707
5707
|
open: l !== void 0,
|
|
5708
5708
|
propertyKey: u,
|
|
@@ -5726,21 +5726,21 @@ function Zi({
|
|
|
5726
5726
|
/* @__PURE__ */ e("div", { style: { height: "52px" } })
|
|
5727
5727
|
] });
|
|
5728
5728
|
}
|
|
5729
|
-
function
|
|
5729
|
+
function Qi({
|
|
5730
5730
|
property: t,
|
|
5731
5731
|
onPropertyChanged: a,
|
|
5732
5732
|
propertyKey: r,
|
|
5733
5733
|
customFields: i,
|
|
5734
5734
|
disabled: s
|
|
5735
5735
|
}) {
|
|
5736
|
-
const { fields: o } =
|
|
5736
|
+
const { fields: o } = qe(), l = t ? Jt(t) : null, d = t ? Ze(t, o) : null, [m, u] = Y(!1);
|
|
5737
5737
|
return /* @__PURE__ */ e(
|
|
5738
|
-
|
|
5738
|
+
ae,
|
|
5739
5739
|
{
|
|
5740
5740
|
title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
|
|
5741
5741
|
open: m ? !1 : void 0,
|
|
5742
5742
|
children: /* @__PURE__ */ e(
|
|
5743
|
-
|
|
5743
|
+
je,
|
|
5744
5744
|
{
|
|
5745
5745
|
open: m,
|
|
5746
5746
|
onOpenChange: u,
|
|
@@ -5751,9 +5751,9 @@ function Ji({
|
|
|
5751
5751
|
value: l ?? "",
|
|
5752
5752
|
placeholder: "Select a property widget",
|
|
5753
5753
|
position: "item-aligned",
|
|
5754
|
-
renderValue: (c) => d ? /* @__PURE__ */ e(
|
|
5754
|
+
renderValue: (c) => d ? /* @__PURE__ */ e(Je, { propertyConfig: d }) : null,
|
|
5755
5755
|
onValueChange: (c) => {
|
|
5756
|
-
const p =
|
|
5756
|
+
const p = oa(t, c, i);
|
|
5757
5757
|
r && (a({
|
|
5758
5758
|
id: r,
|
|
5759
5759
|
property: p,
|
|
@@ -5761,8 +5761,8 @@ function Ji({
|
|
|
5761
5761
|
namespace: void 0
|
|
5762
5762
|
}), console.log("newSelectedWidgetId", c));
|
|
5763
5763
|
},
|
|
5764
|
-
children:
|
|
5765
|
-
|
|
5764
|
+
children: Hi.map(([c, p]) => /* @__PURE__ */ e(
|
|
5765
|
+
na,
|
|
5766
5766
|
{
|
|
5767
5767
|
value: c,
|
|
5768
5768
|
optionDisabled: !1,
|
|
@@ -5776,14 +5776,14 @@ function Ji({
|
|
|
5776
5776
|
}
|
|
5777
5777
|
);
|
|
5778
5778
|
}
|
|
5779
|
-
function
|
|
5780
|
-
|
|
5781
|
-
const s =
|
|
5779
|
+
function Zi({ importConfig: t, properties: a, propertiesOrder: r }) {
|
|
5780
|
+
pe(() => {
|
|
5781
|
+
const s = oi(t.originProperties, a), o = t.importData.map((l) => ni(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
|
|
5782
5782
|
t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
|
|
5783
5783
|
}, []);
|
|
5784
|
-
const i =
|
|
5784
|
+
const i = Fa();
|
|
5785
5785
|
return /* @__PURE__ */ e(
|
|
5786
|
-
|
|
5786
|
+
Ia,
|
|
5787
5787
|
{
|
|
5788
5788
|
title: /* @__PURE__ */ n("div", { children: [
|
|
5789
5789
|
/* @__PURE__ */ e(P, { variant: "subtitle2", children: "Imported data preview" }),
|
|
@@ -5803,11 +5803,11 @@ function Wi({ importConfig: t, properties: a, propertiesOrder: r }) {
|
|
|
5803
5803
|
}
|
|
5804
5804
|
);
|
|
5805
5805
|
}
|
|
5806
|
-
function
|
|
5806
|
+
function la(t, a = "") {
|
|
5807
5807
|
const r = Object.keys(t).reduce((o, l) => {
|
|
5808
|
-
const d = t[l], m =
|
|
5808
|
+
const d = t[l], m = Ea(l), u = a ? `${a}.${m}` : m;
|
|
5809
5809
|
if (d.dataType === "map" && d.properties) {
|
|
5810
|
-
const g =
|
|
5810
|
+
const g = la(d.properties, u);
|
|
5811
5811
|
return {
|
|
5812
5812
|
headersMapping: { ...o.headersMapping, [l]: u },
|
|
5813
5813
|
properties: {
|
|
@@ -5835,14 +5835,14 @@ function da(t, a = "") {
|
|
|
5835
5835
|
idColumn: s
|
|
5836
5836
|
};
|
|
5837
5837
|
}
|
|
5838
|
-
function
|
|
5839
|
-
const a = t.open, [r, i] =
|
|
5838
|
+
function ca(t) {
|
|
5839
|
+
const a = t.open, [r, i] = ve.useState(!1), [s, o] = ve.useState(!1), l = Q(() => {
|
|
5840
5840
|
r ? o(!0) : t.handleClose(void 0);
|
|
5841
5841
|
}, [r, t.handleClose]);
|
|
5842
|
-
return
|
|
5842
|
+
return pe(() => {
|
|
5843
5843
|
a || (i(!1), o(!1));
|
|
5844
5844
|
}, [a]), /* @__PURE__ */ n(
|
|
5845
|
-
|
|
5845
|
+
Me,
|
|
5846
5846
|
{
|
|
5847
5847
|
open: a,
|
|
5848
5848
|
fullWidth: !0,
|
|
@@ -5852,7 +5852,7 @@ function pa(t) {
|
|
|
5852
5852
|
onOpenChange: (d) => d ? void 0 : l(),
|
|
5853
5853
|
children: [
|
|
5854
5854
|
a && /* @__PURE__ */ e(
|
|
5855
|
-
|
|
5855
|
+
Ji,
|
|
5856
5856
|
{
|
|
5857
5857
|
...t,
|
|
5858
5858
|
handleCancel: l,
|
|
@@ -5860,7 +5860,7 @@ function pa(t) {
|
|
|
5860
5860
|
}
|
|
5861
5861
|
),
|
|
5862
5862
|
/* @__PURE__ */ e(
|
|
5863
|
-
|
|
5863
|
+
Ui,
|
|
5864
5864
|
{
|
|
5865
5865
|
open: s,
|
|
5866
5866
|
handleOk: () => t.handleClose(void 0),
|
|
@@ -5872,7 +5872,7 @@ function pa(t) {
|
|
|
5872
5872
|
}
|
|
5873
5873
|
);
|
|
5874
5874
|
}
|
|
5875
|
-
function
|
|
5875
|
+
function Ji({
|
|
5876
5876
|
isNewCollection: t,
|
|
5877
5877
|
initialValues: a,
|
|
5878
5878
|
configController: r,
|
|
@@ -5890,51 +5890,51 @@ function Xi({
|
|
|
5890
5890
|
parentCollection: y,
|
|
5891
5891
|
getData: k
|
|
5892
5892
|
}) {
|
|
5893
|
-
const { fields: _ } =
|
|
5893
|
+
const { fields: _ } = qe(), O = De(), {
|
|
5894
5894
|
topLevelNavigation: h,
|
|
5895
5895
|
collections: w
|
|
5896
|
-
} = O, b = !a?.path && (s ?? []).length === 0, v = (y ? y.subcollections : w) ?? [], T = v.map((z) => z.path.trim().toLowerCase()), I = v.map((z) => z.alias?.trim().toLowerCase()).filter(Boolean), A =
|
|
5896
|
+
} = O, b = !a?.path && (s ?? []).length === 0, v = (y ? y.subcollections : w) ?? [], T = v.map((z) => z.path.trim().toLowerCase()), I = v.map((z) => z.alias?.trim().toLowerCase()).filter(Boolean), A = si();
|
|
5897
5897
|
if (!h)
|
|
5898
5898
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
5899
5899
|
const {
|
|
5900
5900
|
groups: S
|
|
5901
|
-
} = h, x =
|
|
5902
|
-
|
|
5901
|
+
} = h, x = Qe(), C = Re(), j = $e({}), J = t ? b ? "welcome" : "details" : "properties", [q, U] = Y(J), [ie, ke] = ve.useState(), [he, M] = ve.useState(), [Z, te] = ve.useState(!1), [re, de] = ve.useState();
|
|
5902
|
+
pe(() => {
|
|
5903
5903
|
try {
|
|
5904
|
-
O.initialised && (M(i ? O.getCollectionFromPaths([...s ?? [], i]) : void 0),
|
|
5904
|
+
O.initialised && (M(i ? O.getCollectionFromPaths([...s ?? [], i]) : void 0), te(!0));
|
|
5905
5905
|
} catch (z) {
|
|
5906
|
-
console.error(z),
|
|
5906
|
+
console.error(z), de(re);
|
|
5907
5907
|
}
|
|
5908
|
-
}, [O.getCollectionFromPaths, i,
|
|
5909
|
-
const
|
|
5908
|
+
}, [O.getCollectionFromPaths, i, re, O.initialised]);
|
|
5909
|
+
const Se = (z) => {
|
|
5910
5910
|
const K = z.alias || z.path;
|
|
5911
5911
|
return r.saveCollection({
|
|
5912
5912
|
path: K,
|
|
5913
5913
|
collectionData: z,
|
|
5914
5914
|
previousPath: i,
|
|
5915
5915
|
parentPathSegments: s
|
|
5916
|
-
}).then(() => (
|
|
5916
|
+
}).then(() => (ke(void 0), !0)).catch((D) => (ke(D), console.error(D), x.open({
|
|
5917
5917
|
type: "error",
|
|
5918
5918
|
message: "Error persisting collection: " + (D.message ?? "Details in the console")
|
|
5919
5919
|
}), !1));
|
|
5920
|
-
},
|
|
5920
|
+
}, xe = he ?? {
|
|
5921
5921
|
path: a?.path ?? "",
|
|
5922
5922
|
name: a?.name ?? "",
|
|
5923
5923
|
group: a?.group ?? "",
|
|
5924
5924
|
properties: {},
|
|
5925
5925
|
propertiesOrder: [],
|
|
5926
|
-
icon:
|
|
5926
|
+
icon: wt[Math.floor(Math.random() * wt.length)],
|
|
5927
5927
|
ownerId: C.user?.uid ?? ""
|
|
5928
|
-
},
|
|
5928
|
+
}, W = Q(() => {
|
|
5929
5929
|
q === "details" ? A.inUse ? U("import_data_saving") : U(u ? "extra_view" : "properties") : U(q === "welcome" ? "details" : q === "import_data_mapping" ? "import_data_preview" : q === "import_data_preview" ? "details" : q === "extra_view" ? "properties" : "details");
|
|
5930
|
-
}, [q, A.inUse, u]),
|
|
5930
|
+
}, [q, A.inUse, u]), fe = Q((z) => {
|
|
5931
5931
|
if (l)
|
|
5932
5932
|
return l?.(z.path, z.collectionGroup ?? !1, s ?? []);
|
|
5933
|
-
}, [l, s]),
|
|
5934
|
-
if (!
|
|
5933
|
+
}, [l, s]), ut = Q(async (z) => {
|
|
5934
|
+
if (!fe)
|
|
5935
5935
|
return M(z), Promise.resolve(z);
|
|
5936
5936
|
U("loading");
|
|
5937
|
-
const K = await
|
|
5937
|
+
const K = await fe?.(z);
|
|
5938
5938
|
if (!K)
|
|
5939
5939
|
return M(z), Promise.resolve(z);
|
|
5940
5940
|
const D = {
|
|
@@ -5944,15 +5944,15 @@ function Xi({
|
|
|
5944
5944
|
newCollection: z ?? {},
|
|
5945
5945
|
values: D
|
|
5946
5946
|
}), D) : (D.propertiesOrder = Object.keys(D.properties), D);
|
|
5947
|
-
}, [s,
|
|
5947
|
+
}, [s, fe]), We = (z, K) => {
|
|
5948
5948
|
try {
|
|
5949
5949
|
if (console.log("Submitting collection", z), !t) {
|
|
5950
|
-
|
|
5951
|
-
K.resetForm({ values:
|
|
5950
|
+
Se(z).then(() => {
|
|
5951
|
+
K.resetForm({ values: xe }), d(z);
|
|
5952
5952
|
});
|
|
5953
5953
|
return;
|
|
5954
5954
|
}
|
|
5955
|
-
q === "welcome" ? (
|
|
5955
|
+
q === "welcome" ? (W(), K.resetForm({ values: z })) : q === "details" ? u || A.inUse ? (K.resetForm({ values: z }), W()) : t ? ut(z).then((D) => {
|
|
5956
5956
|
K.resetForm({
|
|
5957
5957
|
values: D ?? z,
|
|
5958
5958
|
touched: {
|
|
@@ -5961,10 +5961,10 @@ function Xi({
|
|
|
5961
5961
|
}
|
|
5962
5962
|
});
|
|
5963
5963
|
}).finally(() => {
|
|
5964
|
-
|
|
5965
|
-
}) : (K.resetForm({ values: z }),
|
|
5966
|
-
K.resetForm({ values:
|
|
5967
|
-
}) : (
|
|
5964
|
+
W();
|
|
5965
|
+
}) : (K.resetForm({ values: z }), W()) : q === "extra_view" ? (W(), K.resetForm({ values: z })) : q === "import_data_mapping" || q === "import_data_preview" ? W() : q === "properties" ? Se(z).then(() => {
|
|
5966
|
+
K.resetForm({ values: xe }), W(), d(z);
|
|
5967
|
+
}) : (W(), K.resetForm({ values: z }));
|
|
5968
5968
|
} catch (D) {
|
|
5969
5969
|
x.open({
|
|
5970
5970
|
type: "error",
|
|
@@ -5972,71 +5972,71 @@ function Xi({
|
|
|
5972
5972
|
}), console.error(D), K.resetForm({ values: z });
|
|
5973
5973
|
}
|
|
5974
5974
|
};
|
|
5975
|
-
return !t && (!O.initialised || !
|
|
5976
|
-
|
|
5975
|
+
return !t && (!O.initialised || !Z) ? /* @__PURE__ */ e(Vt, {}) : /* @__PURE__ */ e(He, { fullHeight: !0, children: /* @__PURE__ */ e(
|
|
5976
|
+
Ot,
|
|
5977
5977
|
{
|
|
5978
|
-
initialValues:
|
|
5979
|
-
validationSchema: (q === "properties" || q === "subcollections" || q === "details") &&
|
|
5978
|
+
initialValues: xe,
|
|
5979
|
+
validationSchema: (q === "properties" || q === "subcollections" || q === "details") && di,
|
|
5980
5980
|
validate: () => {
|
|
5981
5981
|
if (q === "properties")
|
|
5982
5982
|
return j.current;
|
|
5983
5983
|
},
|
|
5984
|
-
onSubmit:
|
|
5984
|
+
onSubmit: We,
|
|
5985
5985
|
children: ({
|
|
5986
5986
|
values: z,
|
|
5987
5987
|
setFieldValue: K,
|
|
5988
5988
|
isSubmitting: D,
|
|
5989
|
-
dirty:
|
|
5989
|
+
dirty: Xe,
|
|
5990
5990
|
submitCount: V
|
|
5991
5991
|
}) => {
|
|
5992
|
-
const F = z.path ?? i,
|
|
5993
|
-
|
|
5994
|
-
p(
|
|
5995
|
-
}, [
|
|
5996
|
-
function
|
|
5997
|
-
A.setInUse(!0),
|
|
5998
|
-
const
|
|
5999
|
-
K("properties",
|
|
5992
|
+
const F = z.path ?? i, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + F : F, oe = O.resolveAliasesFrom(H), ne = oe && k ? () => k(oe) : void 0;
|
|
5993
|
+
pe(() => {
|
|
5994
|
+
p(Xe);
|
|
5995
|
+
}, [Xe]);
|
|
5996
|
+
function be(X) {
|
|
5997
|
+
A.setInUse(!0), Wa(X, aa).then((ze) => {
|
|
5998
|
+
const Te = la(ze);
|
|
5999
|
+
K("properties", Te.properties), K("propertiesOrder", Object.keys(Te.properties)), A.setIdColumn(Te.idColumn), A.setImportData(X), A.setHeadersMapping(Te.headersMapping), A.setOriginProperties(Te.properties);
|
|
6000
6000
|
});
|
|
6001
6001
|
}
|
|
6002
|
-
const
|
|
6003
|
-
const
|
|
6004
|
-
A.idColumn && delete
|
|
6002
|
+
const ht = !!z.name && !!z.path, et = () => {
|
|
6003
|
+
const X = { ...z.properties };
|
|
6004
|
+
A.idColumn && delete X[A.idColumn], K("properties", X), W(), console.log("onImportMappingComplete", {
|
|
6005
6005
|
importConfig: A,
|
|
6006
|
-
properties:
|
|
6006
|
+
properties: X
|
|
6007
6007
|
});
|
|
6008
|
-
},
|
|
6008
|
+
}, gt = he?.editable || t;
|
|
6009
6009
|
return /* @__PURE__ */ n(B, { children: [
|
|
6010
6010
|
!t && /* @__PURE__ */ n(
|
|
6011
|
-
|
|
6011
|
+
Ba,
|
|
6012
6012
|
{
|
|
6013
6013
|
value: q,
|
|
6014
|
-
className:
|
|
6015
|
-
onValueChange: (
|
|
6014
|
+
className: _e(xt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
6015
|
+
onValueChange: (X) => U(X),
|
|
6016
6016
|
children: [
|
|
6017
|
-
/* @__PURE__ */ e(
|
|
6018
|
-
/* @__PURE__ */ e(
|
|
6019
|
-
/* @__PURE__ */ e(
|
|
6017
|
+
/* @__PURE__ */ e(bt, { value: "details", children: "Details" }),
|
|
6018
|
+
/* @__PURE__ */ e(bt, { value: "properties", children: "Properties" }),
|
|
6019
|
+
/* @__PURE__ */ e(bt, { value: "subcollections", children: "Additional views" })
|
|
6020
6020
|
]
|
|
6021
6021
|
}
|
|
6022
6022
|
),
|
|
6023
6023
|
/* @__PURE__ */ n(
|
|
6024
|
-
|
|
6024
|
+
Ga,
|
|
6025
6025
|
{
|
|
6026
6026
|
noValidate: !0,
|
|
6027
|
-
className:
|
|
6027
|
+
className: _e(
|
|
6028
6028
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
6029
6029
|
"flex-grow flex flex-col relative"
|
|
6030
6030
|
),
|
|
6031
6031
|
children: [
|
|
6032
|
-
q === "loading" && /* @__PURE__ */ e(
|
|
6032
|
+
q === "loading" && /* @__PURE__ */ e(Vt, {}),
|
|
6033
6033
|
q === "extra_view" && F && u?.View && /* @__PURE__ */ e(u.View, { path: F }),
|
|
6034
6034
|
q === "welcome" && /* @__PURE__ */ e(
|
|
6035
|
-
|
|
6035
|
+
Ki,
|
|
6036
6036
|
{
|
|
6037
6037
|
path: F,
|
|
6038
|
-
onContinue: (
|
|
6039
|
-
|
|
6038
|
+
onContinue: (X) => {
|
|
6039
|
+
X ? (be(X), U("import_data_mapping")) : U("details");
|
|
6040
6040
|
},
|
|
6041
6041
|
collections: w,
|
|
6042
6042
|
parentCollection: y,
|
|
@@ -6044,15 +6044,15 @@ function Xi({
|
|
|
6044
6044
|
}
|
|
6045
6045
|
),
|
|
6046
6046
|
q === "import_data_mapping" && A && /* @__PURE__ */ e(
|
|
6047
|
-
|
|
6047
|
+
Gi,
|
|
6048
6048
|
{
|
|
6049
6049
|
importConfig: A,
|
|
6050
|
-
collectionEditable:
|
|
6050
|
+
collectionEditable: gt,
|
|
6051
6051
|
customFields: _
|
|
6052
6052
|
}
|
|
6053
6053
|
),
|
|
6054
6054
|
q === "import_data_preview" && A && /* @__PURE__ */ e(
|
|
6055
|
-
|
|
6055
|
+
Zi,
|
|
6056
6056
|
{
|
|
6057
6057
|
importConfig: A,
|
|
6058
6058
|
properties: z.properties,
|
|
@@ -6060,12 +6060,12 @@ function Xi({
|
|
|
6060
6060
|
}
|
|
6061
6061
|
),
|
|
6062
6062
|
q === "import_data_saving" && A && /* @__PURE__ */ e(
|
|
6063
|
-
|
|
6063
|
+
li,
|
|
6064
6064
|
{
|
|
6065
6065
|
importConfig: A,
|
|
6066
6066
|
collection: z,
|
|
6067
|
-
onImportSuccess: (
|
|
6068
|
-
d(
|
|
6067
|
+
onImportSuccess: (X) => {
|
|
6068
|
+
d(X), x.open({
|
|
6069
6069
|
type: "info",
|
|
6070
6070
|
message: "Data imported successfully"
|
|
6071
6071
|
});
|
|
@@ -6073,7 +6073,7 @@ function Xi({
|
|
|
6073
6073
|
}
|
|
6074
6074
|
),
|
|
6075
6075
|
q === "details" && /* @__PURE__ */ e(
|
|
6076
|
-
|
|
6076
|
+
ui,
|
|
6077
6077
|
{
|
|
6078
6078
|
existingPaths: T,
|
|
6079
6079
|
existingAliases: I,
|
|
@@ -6082,36 +6082,36 @@ function Xi({
|
|
|
6082
6082
|
isNewCollection: t
|
|
6083
6083
|
}
|
|
6084
6084
|
),
|
|
6085
|
-
q === "subcollections" &&
|
|
6086
|
-
|
|
6085
|
+
q === "subcollections" && he && /* @__PURE__ */ e(
|
|
6086
|
+
Li,
|
|
6087
6087
|
{
|
|
6088
6088
|
parentCollection: y,
|
|
6089
6089
|
configController: r,
|
|
6090
6090
|
getUser: f,
|
|
6091
6091
|
collectionInference: l,
|
|
6092
6092
|
parentPathSegments: s,
|
|
6093
|
-
collection:
|
|
6093
|
+
collection: he
|
|
6094
6094
|
}
|
|
6095
6095
|
),
|
|
6096
6096
|
q === "properties" && /* @__PURE__ */ e(
|
|
6097
|
-
|
|
6097
|
+
Ri,
|
|
6098
6098
|
{
|
|
6099
6099
|
showErrors: V > 0,
|
|
6100
6100
|
isNewCollection: t,
|
|
6101
6101
|
reservedGroups: m,
|
|
6102
|
-
onPropertyError: (
|
|
6103
|
-
j.current =
|
|
6102
|
+
onPropertyError: (X, ze, Te) => {
|
|
6103
|
+
j.current = Ma({
|
|
6104
6104
|
...j.current,
|
|
6105
|
-
[
|
|
6105
|
+
[X]: Te
|
|
6106
6106
|
}, !0);
|
|
6107
6107
|
},
|
|
6108
6108
|
getUser: f,
|
|
6109
|
-
getData:
|
|
6110
|
-
doCollectionInference:
|
|
6109
|
+
getData: ne,
|
|
6110
|
+
doCollectionInference: fe,
|
|
6111
6111
|
customFields: _,
|
|
6112
|
-
collectionEditable:
|
|
6112
|
+
collectionEditable: gt,
|
|
6113
6113
|
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
6114
|
-
|
|
6114
|
+
me,
|
|
6115
6115
|
{
|
|
6116
6116
|
color: "primary",
|
|
6117
6117
|
onClick: () => U("extra_view"),
|
|
@@ -6121,11 +6121,11 @@ function Xi({
|
|
|
6121
6121
|
}
|
|
6122
6122
|
),
|
|
6123
6123
|
q !== "welcome" && /* @__PURE__ */ n(
|
|
6124
|
-
|
|
6124
|
+
Ge,
|
|
6125
6125
|
{
|
|
6126
6126
|
position: "absolute",
|
|
6127
6127
|
children: [
|
|
6128
|
-
|
|
6128
|
+
ie && /* @__PURE__ */ e(ta, { error: ie }),
|
|
6129
6129
|
t && b && q === "import_data_mapping" && /* @__PURE__ */ n(
|
|
6130
6130
|
E,
|
|
6131
6131
|
{
|
|
@@ -6133,7 +6133,7 @@ function Xi({
|
|
|
6133
6133
|
type: "button",
|
|
6134
6134
|
onClick: () => (A.setInUse(!1), U("welcome")),
|
|
6135
6135
|
children: [
|
|
6136
|
-
/* @__PURE__ */ e(
|
|
6136
|
+
/* @__PURE__ */ e(tt, {}),
|
|
6137
6137
|
"Back"
|
|
6138
6138
|
]
|
|
6139
6139
|
}
|
|
@@ -6144,10 +6144,10 @@ function Xi({
|
|
|
6144
6144
|
variant: "text",
|
|
6145
6145
|
type: "button",
|
|
6146
6146
|
onClick: () => {
|
|
6147
|
-
|
|
6147
|
+
Se(z), U("import_data_mapping");
|
|
6148
6148
|
},
|
|
6149
6149
|
children: [
|
|
6150
|
-
/* @__PURE__ */ e(
|
|
6150
|
+
/* @__PURE__ */ e(tt, {}),
|
|
6151
6151
|
"Back"
|
|
6152
6152
|
]
|
|
6153
6153
|
}
|
|
@@ -6159,7 +6159,7 @@ function Xi({
|
|
|
6159
6159
|
type: "button",
|
|
6160
6160
|
onClick: () => U("welcome"),
|
|
6161
6161
|
children: [
|
|
6162
|
-
/* @__PURE__ */ e(
|
|
6162
|
+
/* @__PURE__ */ e(tt, {}),
|
|
6163
6163
|
"Back"
|
|
6164
6164
|
]
|
|
6165
6165
|
}
|
|
@@ -6171,7 +6171,7 @@ function Xi({
|
|
|
6171
6171
|
type: "button",
|
|
6172
6172
|
onClick: () => U("details"),
|
|
6173
6173
|
children: [
|
|
6174
|
-
/* @__PURE__ */ e(
|
|
6174
|
+
/* @__PURE__ */ e(tt, {}),
|
|
6175
6175
|
"Back"
|
|
6176
6176
|
]
|
|
6177
6177
|
}
|
|
@@ -6191,7 +6191,7 @@ function Xi({
|
|
|
6191
6191
|
{
|
|
6192
6192
|
variant: "filled",
|
|
6193
6193
|
color: "primary",
|
|
6194
|
-
onClick:
|
|
6194
|
+
onClick: et,
|
|
6195
6195
|
children: "Next"
|
|
6196
6196
|
}
|
|
6197
6197
|
),
|
|
@@ -6201,20 +6201,20 @@ function Xi({
|
|
|
6201
6201
|
variant: "filled",
|
|
6202
6202
|
color: "primary",
|
|
6203
6203
|
onClick: () => {
|
|
6204
|
-
|
|
6204
|
+
W();
|
|
6205
6205
|
},
|
|
6206
6206
|
children: "Next"
|
|
6207
6207
|
}
|
|
6208
6208
|
),
|
|
6209
6209
|
t && (q === "details" || q === "properties") && /* @__PURE__ */ n(
|
|
6210
|
-
|
|
6210
|
+
jt,
|
|
6211
6211
|
{
|
|
6212
6212
|
variant: "filled",
|
|
6213
6213
|
color: "primary",
|
|
6214
6214
|
type: "submit",
|
|
6215
6215
|
loading: D,
|
|
6216
|
-
disabled: D || q === "details" && !
|
|
6217
|
-
startIcon: q === "properties" ? /* @__PURE__ */ e(
|
|
6216
|
+
disabled: D || q === "details" && !ht,
|
|
6217
|
+
startIcon: q === "properties" ? /* @__PURE__ */ e(Da, {}) : void 0,
|
|
6218
6218
|
children: [
|
|
6219
6219
|
q === "details" && "Next",
|
|
6220
6220
|
q === "properties" && "Create collection"
|
|
@@ -6222,7 +6222,7 @@ function Xi({
|
|
|
6222
6222
|
}
|
|
6223
6223
|
),
|
|
6224
6224
|
!t && /* @__PURE__ */ e(
|
|
6225
|
-
|
|
6225
|
+
jt,
|
|
6226
6226
|
{
|
|
6227
6227
|
variant: "filled",
|
|
6228
6228
|
color: "primary",
|
|
@@ -6242,7 +6242,7 @@ function Xi({
|
|
|
6242
6242
|
}
|
|
6243
6243
|
) });
|
|
6244
6244
|
}
|
|
6245
|
-
const
|
|
6245
|
+
const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
|
|
6246
6246
|
function({
|
|
6247
6247
|
children: a,
|
|
6248
6248
|
collectionConfigController: r,
|
|
@@ -6254,66 +6254,66 @@ const ma = R.createContext({}), ua = R.createContext({}), er = R.memo(
|
|
|
6254
6254
|
getUser: m,
|
|
6255
6255
|
getData: u
|
|
6256
6256
|
}) {
|
|
6257
|
-
const c =
|
|
6257
|
+
const c = De(), p = ci(), g = Qe(), { fields: f } = qe(), {
|
|
6258
6258
|
collections: y
|
|
6259
6259
|
} = c, k = y.map((C) => C.path.trim().toLowerCase()), [_, O] = R.useState();
|
|
6260
|
-
|
|
6260
|
+
pe(() => {
|
|
6261
6261
|
d && d().then((C) => {
|
|
6262
6262
|
O(C.filter((j) => !k.includes(j.trim().toLowerCase())));
|
|
6263
6263
|
});
|
|
6264
6264
|
}, [d]);
|
|
6265
|
-
const [h, w] = R.useState(), [b, v] = R.useState(), T =
|
|
6265
|
+
const [h, w] = R.useState(), [b, v] = R.useState(), T = Q(() => ({
|
|
6266
6266
|
createCollections: !0,
|
|
6267
6267
|
editCollections: !0,
|
|
6268
6268
|
deleteCollections: !0
|
|
6269
|
-
}), []), I =
|
|
6269
|
+
}), []), I = Q(({
|
|
6270
6270
|
path: C,
|
|
6271
6271
|
fullPath: j,
|
|
6272
|
-
parentPathSegments:
|
|
6272
|
+
parentPathSegments: J,
|
|
6273
6273
|
parentCollection: q
|
|
6274
6274
|
}) => {
|
|
6275
6275
|
w({
|
|
6276
6276
|
editedCollectionPath: C,
|
|
6277
6277
|
fullPath: j,
|
|
6278
|
-
parentPathSegments:
|
|
6278
|
+
parentPathSegments: J,
|
|
6279
6279
|
isNewCollection: !1,
|
|
6280
6280
|
parentCollection: q,
|
|
6281
6281
|
redirect: !1
|
|
6282
6282
|
});
|
|
6283
|
-
}, []), A =
|
|
6283
|
+
}, []), A = Q(({
|
|
6284
6284
|
propertyKey: C,
|
|
6285
6285
|
property: j,
|
|
6286
|
-
editedCollectionPath:
|
|
6286
|
+
editedCollectionPath: J,
|
|
6287
6287
|
currentPropertiesOrder: q,
|
|
6288
6288
|
parentPathSegments: U,
|
|
6289
|
-
collection:
|
|
6289
|
+
collection: ie
|
|
6290
6290
|
}) => {
|
|
6291
|
-
const
|
|
6292
|
-
console.log("edit property",
|
|
6293
|
-
propertyKey:
|
|
6291
|
+
const ke = C && C.includes(".") ? C.substring(0, C.lastIndexOf(".")) : void 0, he = C && C.includes(".") ? C.substring(C.lastIndexOf(".") + 1) : C;
|
|
6292
|
+
console.log("edit property", he, ie), v({
|
|
6293
|
+
propertyKey: he,
|
|
6294
6294
|
property: j,
|
|
6295
|
-
namespace:
|
|
6295
|
+
namespace: ke,
|
|
6296
6296
|
currentPropertiesOrder: q,
|
|
6297
|
-
editedCollectionPath:
|
|
6297
|
+
editedCollectionPath: J,
|
|
6298
6298
|
parentPathSegments: U,
|
|
6299
|
-
collectionEditable:
|
|
6299
|
+
collectionEditable: ie?.editable ?? !1
|
|
6300
6300
|
});
|
|
6301
6301
|
}, []), S = R.useCallback(({
|
|
6302
6302
|
parentPathSegments: C,
|
|
6303
6303
|
parentCollection: j,
|
|
6304
|
-
initialValues:
|
|
6304
|
+
initialValues: J,
|
|
6305
6305
|
redirect: q
|
|
6306
6306
|
}) => {
|
|
6307
6307
|
w({
|
|
6308
6308
|
isNewCollection: !0,
|
|
6309
6309
|
parentPathSegments: C,
|
|
6310
6310
|
parentCollection: j,
|
|
6311
|
-
initialValues:
|
|
6311
|
+
initialValues: J,
|
|
6312
6312
|
redirect: q
|
|
6313
6313
|
});
|
|
6314
6314
|
}, []), x = d ? (C) => !C && _ ? Promise.resolve(_) : d?.(C) : void 0;
|
|
6315
|
-
return /* @__PURE__ */ e(
|
|
6316
|
-
|
|
6315
|
+
return /* @__PURE__ */ e(da.Provider, { value: r, children: /* @__PURE__ */ n(
|
|
6316
|
+
pa.Provider,
|
|
6317
6317
|
{
|
|
6318
6318
|
value: {
|
|
6319
6319
|
editCollection: I,
|
|
@@ -6325,7 +6325,7 @@ const ma = R.createContext({}), ua = R.createContext({}), er = R.memo(
|
|
|
6325
6325
|
children: [
|
|
6326
6326
|
a,
|
|
6327
6327
|
/* @__PURE__ */ e(
|
|
6328
|
-
|
|
6328
|
+
ca,
|
|
6329
6329
|
{
|
|
6330
6330
|
open: !!h,
|
|
6331
6331
|
configController: r,
|
|
@@ -6347,7 +6347,7 @@ const ma = R.createContext({}), ua = R.createContext({}), er = R.memo(
|
|
|
6347
6347
|
}
|
|
6348
6348
|
),
|
|
6349
6349
|
/* @__PURE__ */ e(
|
|
6350
|
-
|
|
6350
|
+
Fe,
|
|
6351
6351
|
{
|
|
6352
6352
|
open: !!b,
|
|
6353
6353
|
includeIdAndName: !0,
|
|
@@ -6366,12 +6366,12 @@ const ma = R.createContext({}), ua = R.createContext({}), er = R.memo(
|
|
|
6366
6366
|
}) => {
|
|
6367
6367
|
if (!b || !C)
|
|
6368
6368
|
return;
|
|
6369
|
-
const
|
|
6369
|
+
const J = !b.propertyKey;
|
|
6370
6370
|
return r.saveProperty({
|
|
6371
6371
|
path: b?.editedCollectionPath,
|
|
6372
6372
|
property: j,
|
|
6373
6373
|
propertyKey: C,
|
|
6374
|
-
newPropertiesOrder:
|
|
6374
|
+
newPropertiesOrder: J && b.currentPropertiesOrder ? [...b.currentPropertiesOrder, C] : void 0,
|
|
6375
6375
|
namespace: b.namespace,
|
|
6376
6376
|
parentPathSegments: b.parentPathSegments
|
|
6377
6377
|
}).catch((q) => (console.error(q), g.open({
|
|
@@ -6418,21 +6418,21 @@ const ma = R.createContext({}), ua = R.createContext({}), er = R.memo(
|
|
|
6418
6418
|
}
|
|
6419
6419
|
) });
|
|
6420
6420
|
},
|
|
6421
|
-
|
|
6422
|
-
),
|
|
6423
|
-
function
|
|
6421
|
+
ct
|
|
6422
|
+
), Ee = () => $t(pa), ma = () => $t(da);
|
|
6423
|
+
function Xi({
|
|
6424
6424
|
path: t,
|
|
6425
6425
|
parentPathSegments: a,
|
|
6426
6426
|
collection: r,
|
|
6427
6427
|
tableController: i
|
|
6428
6428
|
}) {
|
|
6429
|
-
const s =
|
|
6429
|
+
const s = Re(), o = De(), l = Ee(), d = ma(), m = Qe(), u = o.getCollectionFromPaths(a), c = l.configPermissions ? l.configPermissions({
|
|
6430
6430
|
user: s.user,
|
|
6431
6431
|
collection: r
|
|
6432
6432
|
}).editCollections : !0;
|
|
6433
6433
|
let p = null;
|
|
6434
|
-
return (!
|
|
6435
|
-
|
|
6434
|
+
return (!ct(it(i.filterValues), it(r.initialFilter)) || !ct(it(i.sortBy), it(r.initialSort))) && (p = /* @__PURE__ */ e(
|
|
6435
|
+
ae,
|
|
6436
6436
|
{
|
|
6437
6437
|
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
6438
6438
|
children: /* @__PURE__ */ e(
|
|
@@ -6457,70 +6457,70 @@ function tr({
|
|
|
6457
6457
|
message: "Default config saved"
|
|
6458
6458
|
});
|
|
6459
6459
|
}),
|
|
6460
|
-
children: /* @__PURE__ */ e(
|
|
6460
|
+
children: /* @__PURE__ */ e(Ra, {})
|
|
6461
6461
|
}
|
|
6462
6462
|
)
|
|
6463
6463
|
}
|
|
6464
6464
|
)), /* @__PURE__ */ n(B, { children: [
|
|
6465
6465
|
c && p,
|
|
6466
6466
|
/* @__PURE__ */ e(
|
|
6467
|
-
|
|
6467
|
+
ae,
|
|
6468
6468
|
{
|
|
6469
6469
|
title: c ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
6470
6470
|
children: /* @__PURE__ */ e(
|
|
6471
|
-
|
|
6471
|
+
me,
|
|
6472
6472
|
{
|
|
6473
6473
|
color: "primary",
|
|
6474
6474
|
disabled: !c,
|
|
6475
6475
|
onClick: c ? () => l?.editCollection({ path: r.path, fullPath: t, parentPathSegments: a, parentCollection: u }) : void 0,
|
|
6476
|
-
children: /* @__PURE__ */ e(
|
|
6476
|
+
children: /* @__PURE__ */ e(Ke, {})
|
|
6477
6477
|
}
|
|
6478
6478
|
)
|
|
6479
6479
|
}
|
|
6480
6480
|
)
|
|
6481
6481
|
] });
|
|
6482
6482
|
}
|
|
6483
|
-
function
|
|
6483
|
+
function it(t) {
|
|
6484
6484
|
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
6485
6485
|
}
|
|
6486
|
-
function
|
|
6486
|
+
function er({
|
|
6487
6487
|
path: t,
|
|
6488
6488
|
collection: a
|
|
6489
6489
|
}) {
|
|
6490
|
-
const r =
|
|
6490
|
+
const r = Re(), i = ma(), s = Ee(), o = s.configPermissions({
|
|
6491
6491
|
user: r.user,
|
|
6492
6492
|
collection: a
|
|
6493
|
-
}), l =
|
|
6493
|
+
}), l = Q(() => {
|
|
6494
6494
|
s?.editCollection({ path: t, parentPathSegments: [] });
|
|
6495
|
-
}, [s, t]), [d, m] =
|
|
6495
|
+
}, [s, t]), [d, m] = Y(!1), u = Q(() => {
|
|
6496
6496
|
i?.deleteCollection({ path: t });
|
|
6497
6497
|
}, [t, i]);
|
|
6498
6498
|
return /* @__PURE__ */ n(B, { children: [
|
|
6499
6499
|
/* @__PURE__ */ n("div", { children: [
|
|
6500
6500
|
o.deleteCollections && /* @__PURE__ */ e(
|
|
6501
|
-
|
|
6501
|
+
Ua,
|
|
6502
6502
|
{
|
|
6503
|
-
trigger: /* @__PURE__ */ e(
|
|
6504
|
-
children: /* @__PURE__ */ n(
|
|
6503
|
+
trigger: /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e($a, { size: "small" }) }),
|
|
6504
|
+
children: /* @__PURE__ */ n(La, { onClick: (c) => {
|
|
6505
6505
|
c.preventDefault(), c.stopPropagation(), m(!0);
|
|
6506
6506
|
}, children: [
|
|
6507
|
-
/* @__PURE__ */ e(
|
|
6507
|
+
/* @__PURE__ */ e(st, {}),
|
|
6508
6508
|
"Delete"
|
|
6509
6509
|
] })
|
|
6510
6510
|
}
|
|
6511
6511
|
),
|
|
6512
6512
|
o.editCollections && /* @__PURE__ */ e(
|
|
6513
|
-
|
|
6513
|
+
me,
|
|
6514
6514
|
{
|
|
6515
6515
|
onClick: (c) => {
|
|
6516
6516
|
l();
|
|
6517
6517
|
},
|
|
6518
|
-
children: /* @__PURE__ */ e(
|
|
6518
|
+
children: /* @__PURE__ */ e(Ke, { size: "small" })
|
|
6519
6519
|
}
|
|
6520
6520
|
)
|
|
6521
6521
|
] }),
|
|
6522
6522
|
/* @__PURE__ */ e(
|
|
6523
|
-
|
|
6523
|
+
lt,
|
|
6524
6524
|
{
|
|
6525
6525
|
open: d,
|
|
6526
6526
|
onAccept: u,
|
|
@@ -6535,19 +6535,19 @@ function ar({
|
|
|
6535
6535
|
)
|
|
6536
6536
|
] });
|
|
6537
6537
|
}
|
|
6538
|
-
function
|
|
6538
|
+
function tr({
|
|
6539
6539
|
group: t,
|
|
6540
6540
|
context: a
|
|
6541
6541
|
}) {
|
|
6542
6542
|
if (!a.navigation.topLevelNavigation)
|
|
6543
6543
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
6544
|
-
const r =
|
|
6544
|
+
const r = Re(), i = Ee(), s = i.configPermissions ? i.configPermissions({
|
|
6545
6545
|
user: r.user
|
|
6546
6546
|
}).createCollections : !0;
|
|
6547
6547
|
return /* @__PURE__ */ e(
|
|
6548
|
-
|
|
6548
|
+
ea,
|
|
6549
6549
|
{
|
|
6550
|
-
className:
|
|
6550
|
+
className: _e("h-full p-4 min-h-[124px]"),
|
|
6551
6551
|
onClick: i && s ? () => i.createCollection({
|
|
6552
6552
|
initialValues: t ? { group: t } : void 0,
|
|
6553
6553
|
parentPathSegments: [],
|
|
@@ -6558,7 +6558,7 @@ function ir({
|
|
|
6558
6558
|
{
|
|
6559
6559
|
className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
|
|
6560
6560
|
children: [
|
|
6561
|
-
/* @__PURE__ */ e(
|
|
6561
|
+
/* @__PURE__ */ e(Ne, { color: "primary" }),
|
|
6562
6562
|
/* @__PURE__ */ e(
|
|
6563
6563
|
P,
|
|
6564
6564
|
{
|
|
@@ -6575,12 +6575,12 @@ function ir({
|
|
|
6575
6575
|
}
|
|
6576
6576
|
);
|
|
6577
6577
|
}
|
|
6578
|
-
function
|
|
6579
|
-
const t =
|
|
6578
|
+
function ar() {
|
|
6579
|
+
const t = Re(), a = De(), r = Ee(), i = r.configPermissions ? r.configPermissions({
|
|
6580
6580
|
user: t.user
|
|
6581
6581
|
}).createCollections : !0, s = r.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
|
|
6582
6582
|
return /* @__PURE__ */ e(
|
|
6583
|
-
|
|
6583
|
+
Ka,
|
|
6584
6584
|
{
|
|
6585
6585
|
in: o,
|
|
6586
6586
|
children: /* @__PURE__ */ n(
|
|
@@ -6594,12 +6594,12 @@ function rr() {
|
|
|
6594
6594
|
{
|
|
6595
6595
|
className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
|
|
6596
6596
|
children: s.map((l) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
6597
|
-
|
|
6597
|
+
nt,
|
|
6598
6598
|
{
|
|
6599
|
-
icon: /* @__PURE__ */ e(
|
|
6599
|
+
icon: /* @__PURE__ */ e(Ne, { size: "small" }),
|
|
6600
6600
|
colorScheme: "cyanLighter",
|
|
6601
6601
|
onClick: r && i ? () => r.createCollection({
|
|
6602
|
-
initialValues: { path: l, name:
|
|
6602
|
+
initialValues: { path: l, name: Ct(l) },
|
|
6603
6603
|
parentPathSegments: [],
|
|
6604
6604
|
redirect: !0
|
|
6605
6605
|
}) : void 0,
|
|
@@ -6615,30 +6615,30 @@ function rr() {
|
|
|
6615
6615
|
}
|
|
6616
6616
|
);
|
|
6617
6617
|
}
|
|
6618
|
-
function
|
|
6618
|
+
function ua(t, a) {
|
|
6619
6619
|
const r = (a ?? []).map((s) => {
|
|
6620
6620
|
const o = t?.find((l) => l.path === s.path || l.alias && s.alias && l.alias === s.alias);
|
|
6621
|
-
return o ?
|
|
6621
|
+
return o ? ir(o, s) : s;
|
|
6622
6622
|
}), i = t.filter((s) => !r.map((o) => o.path).includes(s.path) || !r.map((o) => o.alias).includes(s.alias));
|
|
6623
6623
|
return [...r, ...i];
|
|
6624
6624
|
}
|
|
6625
|
-
function
|
|
6626
|
-
const r =
|
|
6625
|
+
function ir(t, a) {
|
|
6626
|
+
const r = ua(t?.subcollections ?? [], a?.subcollections ?? []), i = { ...t.properties };
|
|
6627
6627
|
Object.keys(a.properties).forEach((u) => {
|
|
6628
6628
|
const c = t.properties[u];
|
|
6629
|
-
c ? i[u] =
|
|
6629
|
+
c ? i[u] = ha(c, a.properties[u]) : i[u] = a.properties[u];
|
|
6630
6630
|
});
|
|
6631
|
-
const s = $(t, a), o =
|
|
6631
|
+
const s = $(t, a), o = Rt(t), l = Rt(a), d = [.../* @__PURE__ */ new Set([...o, ...l])], m = [.../* @__PURE__ */ new Set([...t.entityViews ?? [], ...a.entityViews ?? []])];
|
|
6632
6632
|
return {
|
|
6633
6633
|
...s,
|
|
6634
6634
|
subcollections: r,
|
|
6635
|
-
properties:
|
|
6635
|
+
properties: Ya(i, d),
|
|
6636
6636
|
propertiesOrder: d,
|
|
6637
6637
|
entityViews: m
|
|
6638
6638
|
};
|
|
6639
6639
|
}
|
|
6640
|
-
function
|
|
6641
|
-
if (
|
|
6640
|
+
function ha(t, a) {
|
|
6641
|
+
if (le(a))
|
|
6642
6642
|
return a;
|
|
6643
6643
|
{
|
|
6644
6644
|
const r = $(t, a), i = !!t.editable, s = !!a.editable;
|
|
@@ -6646,19 +6646,19 @@ function fa(t, a) {
|
|
|
6646
6646
|
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
6647
|
return Object.keys(a.properties).forEach((p) => {
|
|
6648
6648
|
const g = o[p];
|
|
6649
|
-
g && (c[p] =
|
|
6649
|
+
g && (c[p] = ha(g, l[p]));
|
|
6650
6650
|
}), { ...r, editable: i && s, properties: c, propertiesOrder: u };
|
|
6651
6651
|
}
|
|
6652
6652
|
return { ...r, editable: i && s };
|
|
6653
6653
|
}
|
|
6654
6654
|
}
|
|
6655
|
-
function
|
|
6655
|
+
function Rt(t) {
|
|
6656
6656
|
return t.propertiesOrder && t.propertiesOrder.length > 0 ? t.propertiesOrder : [
|
|
6657
6657
|
...Object.keys(t.properties),
|
|
6658
6658
|
...(t.additionalFields ?? [])?.map((a) => a.id)
|
|
6659
6659
|
];
|
|
6660
6660
|
}
|
|
6661
|
-
function
|
|
6661
|
+
function rr({
|
|
6662
6662
|
propertyKey: t,
|
|
6663
6663
|
onHover: a,
|
|
6664
6664
|
property: r,
|
|
@@ -6666,9 +6666,9 @@ function nr({
|
|
|
6666
6666
|
parentPathSegments: s,
|
|
6667
6667
|
collection: o
|
|
6668
6668
|
}) {
|
|
6669
|
-
const l =
|
|
6670
|
-
return /* @__PURE__ */ e(
|
|
6671
|
-
|
|
6669
|
+
const l = Ee();
|
|
6670
|
+
return /* @__PURE__ */ e(ae, { title: "Edit", children: /* @__PURE__ */ e(
|
|
6671
|
+
me,
|
|
6672
6672
|
{
|
|
6673
6673
|
className: a ? "bg-white dark:bg-gray-950" : "hidden",
|
|
6674
6674
|
onClick: () => {
|
|
@@ -6681,20 +6681,20 @@ function nr({
|
|
|
6681
6681
|
});
|
|
6682
6682
|
},
|
|
6683
6683
|
size: "small",
|
|
6684
|
-
children: /* @__PURE__ */ e(
|
|
6684
|
+
children: /* @__PURE__ */ e(Ke, { size: "small" })
|
|
6685
6685
|
}
|
|
6686
6686
|
) });
|
|
6687
6687
|
}
|
|
6688
|
-
function
|
|
6688
|
+
function or({
|
|
6689
6689
|
fullPath: t,
|
|
6690
6690
|
parentPathSegments: a,
|
|
6691
6691
|
collection: r
|
|
6692
6692
|
}) {
|
|
6693
|
-
const i =
|
|
6693
|
+
const i = Re(), s = Ee(), o = s.configPermissions ? s.configPermissions({
|
|
6694
6694
|
user: i.user,
|
|
6695
6695
|
collection: r
|
|
6696
6696
|
}).editCollections : !0;
|
|
6697
|
-
return /* @__PURE__ */ e(
|
|
6697
|
+
return /* @__PURE__ */ e(ae, { title: o ? "Add new property" : "You don't have permission to add new properties", children: /* @__PURE__ */ e(
|
|
6698
6698
|
"div",
|
|
6699
6699
|
{
|
|
6700
6700
|
className: "p-0.5 w-20 h-full flex items-center justify-center cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-950",
|
|
@@ -6702,15 +6702,15 @@ function sr({
|
|
|
6702
6702
|
s.editProperty({
|
|
6703
6703
|
editedCollectionPath: t,
|
|
6704
6704
|
parentPathSegments: a,
|
|
6705
|
-
currentPropertiesOrder:
|
|
6705
|
+
currentPropertiesOrder: Ha(r),
|
|
6706
6706
|
collection: r
|
|
6707
6707
|
});
|
|
6708
6708
|
},
|
|
6709
|
-
children: /* @__PURE__ */ e(
|
|
6709
|
+
children: /* @__PURE__ */ e(Ne, { color: "inherit" })
|
|
6710
6710
|
}
|
|
6711
6711
|
) });
|
|
6712
6712
|
}
|
|
6713
|
-
function
|
|
6713
|
+
function br({
|
|
6714
6714
|
collectionConfigController: t,
|
|
6715
6715
|
configPermissions: a,
|
|
6716
6716
|
reservedGroups: r,
|
|
@@ -6720,12 +6720,12 @@ function vr({
|
|
|
6720
6720
|
collectionInference: l,
|
|
6721
6721
|
getData: d
|
|
6722
6722
|
}) {
|
|
6723
|
-
const m =
|
|
6723
|
+
const m = Q(
|
|
6724
6724
|
(u) => {
|
|
6725
6725
|
const c = (g) => {
|
|
6726
|
-
|
|
6726
|
+
Xt(g.properties), g.subcollections?.forEach(c);
|
|
6727
6727
|
}, p = t.collections ?? [];
|
|
6728
|
-
return p.forEach(c), console.debug("Injecting collections", { editableCollections: p, collections: u }),
|
|
6728
|
+
return p.forEach(c), console.debug("Injecting collections", { editableCollections: p, collections: u }), ua(p, u);
|
|
6729
6729
|
},
|
|
6730
6730
|
[t.collections]
|
|
6731
6731
|
);
|
|
@@ -6734,10 +6734,10 @@ function vr({
|
|
|
6734
6734
|
loading: t.loading,
|
|
6735
6735
|
collections: {
|
|
6736
6736
|
injectCollections: m,
|
|
6737
|
-
CollectionActions:
|
|
6737
|
+
CollectionActions: Xi
|
|
6738
6738
|
},
|
|
6739
6739
|
provider: {
|
|
6740
|
-
Component:
|
|
6740
|
+
Component: Wi,
|
|
6741
6741
|
props: {
|
|
6742
6742
|
collectionConfigController: t,
|
|
6743
6743
|
configPermissions: a,
|
|
@@ -6750,20 +6750,20 @@ function vr({
|
|
|
6750
6750
|
}
|
|
6751
6751
|
},
|
|
6752
6752
|
homePage: {
|
|
6753
|
-
additionalChildrenStart: /* @__PURE__ */ e(
|
|
6754
|
-
CollectionActions:
|
|
6755
|
-
AdditionalCards:
|
|
6753
|
+
additionalChildrenStart: /* @__PURE__ */ e(ar, {}),
|
|
6754
|
+
CollectionActions: er,
|
|
6755
|
+
AdditionalCards: tr
|
|
6756
6756
|
},
|
|
6757
6757
|
collectionView: {
|
|
6758
|
-
HeaderAction:
|
|
6759
|
-
AddColumnComponent:
|
|
6758
|
+
HeaderAction: rr,
|
|
6759
|
+
AddColumnComponent: or
|
|
6760
6760
|
}
|
|
6761
6761
|
};
|
|
6762
6762
|
}
|
|
6763
|
-
function
|
|
6764
|
-
const a =
|
|
6763
|
+
function yr({ path: t }) {
|
|
6764
|
+
const a = sr(t), r = nr(t), i = Ee();
|
|
6765
6765
|
return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
|
|
6766
|
-
/* @__PURE__ */ e(
|
|
6766
|
+
/* @__PURE__ */ e(ta, { error: "No collection for path: " + a }),
|
|
6767
6767
|
/* @__PURE__ */ e(
|
|
6768
6768
|
E,
|
|
6769
6769
|
{
|
|
@@ -6772,7 +6772,7 @@ function wr({ path: t }) {
|
|
|
6772
6772
|
size: "small",
|
|
6773
6773
|
onClick: () => {
|
|
6774
6774
|
i.createCollection({
|
|
6775
|
-
initialValues: { path: a, name:
|
|
6775
|
+
initialValues: { path: a, name: Ct(a) },
|
|
6776
6776
|
parentPathSegments: r,
|
|
6777
6777
|
redirect: !1
|
|
6778
6778
|
});
|
|
@@ -6782,24 +6782,24 @@ function wr({ path: t }) {
|
|
|
6782
6782
|
)
|
|
6783
6783
|
] });
|
|
6784
6784
|
}
|
|
6785
|
-
function
|
|
6785
|
+
function nr(t) {
|
|
6786
6786
|
const a = t.split("/");
|
|
6787
6787
|
return a.filter((r, i) => i % 2 === 0 && i !== a.length - 1);
|
|
6788
6788
|
}
|
|
6789
|
-
function
|
|
6789
|
+
function sr(t) {
|
|
6790
6790
|
const a = t.split("/");
|
|
6791
6791
|
return a[a.length - 1];
|
|
6792
6792
|
}
|
|
6793
6793
|
export {
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6794
|
+
yr as MissingReferenceWidget,
|
|
6795
|
+
Le as editableProperty,
|
|
6796
|
+
se as getFullId,
|
|
6797
|
+
we as idToPropertiesPath,
|
|
6798
|
+
Oe as namespaceToPropertiesOrderPath,
|
|
6799
|
+
hi as namespaceToPropertiesPath,
|
|
6800
|
+
_i as removeNonEditableProperties,
|
|
6801
|
+
Ee as useCollectionEditorController,
|
|
6802
|
+
br as useCollectionEditorPlugin,
|
|
6803
|
+
ma as useCollectionsConfigController
|
|
6804
6804
|
};
|
|
6805
6805
|
//# sourceMappingURL=index.es.js.map
|