@firecms/collection_editor 3.0.0-alpha.20 → 3.0.0-alpha.24
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/MissingReferenceWidget.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1119 -1106
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +1 -0
- package/dist/types/persisted_collection.d.ts +2 -1
- package/dist/utils/join_collections.d.ts +2 -3
- package/package.json +6 -5
- package/src/ConfigControllerProvider.tsx +131 -8
- package/src/components/CollectionViewHeaderAction.tsx +38 -0
- package/src/components/MissingReferenceWidget.tsx +33 -0
- package/src/components/NewCollectionCard.tsx +2 -1
- package/src/components/PropertyAddColumnComponent.tsx +39 -0
- package/src/components/RootCollectionSuggestions.tsx +2 -1
- package/src/components/collection_editor/CollectionEditorDialog.tsx +1 -1
- package/src/components/collection_editor/CollectionPropertiesEditorForm.tsx +4 -14
- package/src/components/collection_editor/PropertyEditView.tsx +105 -97
- package/src/components/collection_editor/SubcollectionsEditTab.tsx +14 -3
- package/src/components/collection_editor/import/CollectionEditorImportMapping.tsx +1 -1
- package/src/components/collection_editor/properties/BlockPropertyField.tsx +1 -1
- package/src/components/collection_editor/properties/CommonPropertyFields.tsx +0 -1
- package/src/components/collection_editor/properties/MapPropertyField.tsx +1 -1
- package/src/components/collection_editor/properties/RepeatPropertyField.tsx +1 -1
- package/src/index.ts +3 -0
- package/src/types/collection_editor_controller.tsx +11 -2
- package/src/types/config_controller.tsx +13 -2
- package/src/types/persisted_collection.ts +2 -1
- package/src/useCollectionEditorController.tsx +1 -1
- package/src/useCollectionEditorPlugin.tsx +22 -2
- package/src/utils/join_collections.ts +11 -48
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, Fragment as F, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as be from "react";
|
|
3
|
-
import R, { useState as
|
|
4
|
-
import tt from "
|
|
5
|
-
import
|
|
6
|
-
import { useFormikContext as U, Field as me, getIn as
|
|
3
|
+
import R, { useState as K, useCallback as Z, useEffect as ne, useMemo as Ut, useRef as Re, useDeferredValue as fa, useContext as $t } from "react";
|
|
4
|
+
import { iconKeys as Lt, debounce as ba, SearchBar as ya, Tooltip as se, IconButton as pe, Icon as et, coolIconKeys as vt, Typography as N, getIconForView as tt, useAutoComplete as va, Container as nt, Chip as at, TextField as Se, cn as ve, DebouncedTextField as H, Autocomplete as wa, AutocompleteItem as _a, ExpandablePanel as kt, SettingsIcon as st, Select as qe, SelectItem as fe, BooleanSwitchWithLabel as Yt, Dialog as Ee, toSnakeCase as Kt, singular as ka, ListIcon as xa, LoadingButton as wt, CircularProgress as $e, AutoAwesomeIcon as lt, Paper as Ce, FormikArrayContainer as Ca, DialogContent as Le, DialogActions as Ye, Button as B, SwitchControl as ce, serializeRegExp as Oa, isValidRegExp as Na, RuleIcon as Pa, useSnackbarController as ct, resolveEnumValues as Sa, FileUploadIcon as qa, MultiSelect as Aa, MultiSelectItem as qt, Checkbox as At, isPropertyBuilder as de, useFireCMSContext as Ae, getFieldConfig as dt, ErrorBoundary as ke, FieldConfigBadge as Ke, cardMixin as Gt, cardClickableMixin as Ht, cardSelectedMixin as Qt, RemoveCircleIcon as Zt, FunctionsIcon as za, defaultBorderMixin as xt, RemoveIcon as Ta, DragHandleIcon as Va, AddIcon as Oe, useNavigationContext as Ie, SelectGroup as zt, mergeDeep as L, buildProperty as Y, getFieldId as Jt, DEFAULT_FIELD_CONFIGS as _t, InfoLabel as Xt, DeleteIcon as it, DeleteConfirmationDialog as rt, useLargeLayout as ja, makePropertiesEditable as Wt, resolveEntityView as Fa, Table as Tt, TableBody as Vt, TableRow as gt, TableCell as De, buildCollection as Ct, unslugify as Ot, Card as ea, useSelectionController as Ea, EntityCollectionTable as Ia, slugify as Ba, useAuthController as Ge, CircularProgressCenter as jt, Tabs as Ma, Tab as ft, removeUndefined as Da, ErrorView as ta, ArrowBackIcon as Je, DoneIcon as Ra, SaveIcon as Ua, Menu as $a, MoreVertIcon as La, MenuItem as Ya, Collapse as Ka, sortProperties as Ga } from "@firecms/core";
|
|
5
|
+
import ot from "react-fast-compare";
|
|
6
|
+
import { useFormikContext as U, Field as me, getIn as S, Formik as Nt, FastField as oe, Form as aa } from "formik";
|
|
7
7
|
import * as bt from "yup";
|
|
8
|
-
import * as
|
|
9
|
-
import { extractEnumFromValues as
|
|
10
|
-
import { DragDropContext as
|
|
11
|
-
import { ImportFileUpload as
|
|
12
|
-
import { useNavigate as
|
|
13
|
-
const
|
|
8
|
+
import * as Ha from "js-search";
|
|
9
|
+
import { extractEnumFromValues as Qa, buildPropertyFromData as Za, buildEntityPropertiesFromData as Ja } from "@firecms/schema_inference";
|
|
10
|
+
import { DragDropContext as Xa, Droppable as Wa, Draggable as ei } from "@hello-pangea/dnd";
|
|
11
|
+
import { ImportFileUpload as ti, DataNewPropertiesMapping as ai, ImportNewPropertyFieldPreview as ii, getInferenceType as ia, getPropertiesMapping as ri, convertDataToEntity as oi, useImportConfig as ni, ImportSaveInProgress as si } from "@firecms/data_import";
|
|
12
|
+
import { useNavigate as li } from "react-router";
|
|
13
|
+
const ci = bt.object().shape({
|
|
14
14
|
name: bt.string().required("Required"),
|
|
15
15
|
path: bt.string().required("Required")
|
|
16
|
-
}),
|
|
16
|
+
}), ra = {
|
|
17
17
|
abc: "alphabet character font letter symbol text type",
|
|
18
18
|
access_alarm: "clock time",
|
|
19
19
|
access_alarms: "clock time",
|
|
@@ -1962,49 +1962,49 @@ const di = bt.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 Ha.Search("key");
|
|
1966
|
+
Pt.addIndex("synonyms");
|
|
1967
|
+
Pt.addDocuments(Lt.map((t) => ({
|
|
1968
1968
|
key: t,
|
|
1969
1969
|
// @ts-ignore
|
|
1970
|
-
synonyms:
|
|
1970
|
+
synonyms: ra[t] ?? []
|
|
1971
1971
|
})));
|
|
1972
|
-
const
|
|
1973
|
-
process.env.NODE_ENV !== "production" && Object.keys(
|
|
1974
|
-
|
|
1972
|
+
const di = 220;
|
|
1973
|
+
process.env.NODE_ENV !== "production" && Object.keys(ra).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] = be.useState(null), [
|
|
1978
|
-
() =>
|
|
1976
|
+
function pi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
1977
|
+
const [r, i] = be.useState(null), [o, s] = be.useState(""), p = be.useMemo(
|
|
1978
|
+
() => ba((m) => {
|
|
1979
1979
|
if (!m || m === "")
|
|
1980
1980
|
i(null);
|
|
1981
1981
|
else {
|
|
1982
|
-
const u =
|
|
1983
|
-
i(u.map((
|
|
1982
|
+
const u = Pt.search(m);
|
|
1983
|
+
i(u.map((d) => d.key));
|
|
1984
1984
|
}
|
|
1985
|
-
},
|
|
1985
|
+
}, di),
|
|
1986
1986
|
[]
|
|
1987
1987
|
);
|
|
1988
|
-
return be.useEffect(() => (
|
|
1989
|
-
|
|
1990
|
-
}), [
|
|
1988
|
+
return be.useEffect(() => (p(o), () => {
|
|
1989
|
+
p.clear();
|
|
1990
|
+
}), [o, p]), /* @__PURE__ */ n(F, { children: [
|
|
1991
1991
|
/* @__PURE__ */ e(
|
|
1992
|
-
|
|
1992
|
+
ya,
|
|
1993
1993
|
{
|
|
1994
1994
|
autoFocus: !0,
|
|
1995
1995
|
className: "w-full sticky top-0 z-10",
|
|
1996
|
-
onTextSearch: (m) =>
|
|
1996
|
+
onTextSearch: (m) => s(m ?? ""),
|
|
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 ? vt : r).map((m) => /* @__PURE__ */ e(
|
|
2000
|
+
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? vt : r).map((m) => /* @__PURE__ */ e(se, { title: m, children: /* @__PURE__ */ e(
|
|
2001
2001
|
pe,
|
|
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(et, { iconKey: m, size: 24 })
|
|
2008
2008
|
}
|
|
2009
2009
|
) }, m)) })
|
|
2010
2010
|
] });
|
|
@@ -2015,49 +2015,49 @@ function ee({
|
|
|
2015
2015
|
}) {
|
|
2016
2016
|
return a ? /* @__PURE__ */ e(N, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function mi({
|
|
2019
2019
|
isNewCollection: t,
|
|
2020
2020
|
reservedGroups: a,
|
|
2021
2021
|
existingPaths: r,
|
|
2022
2022
|
existingAliases: i,
|
|
2023
|
-
groups:
|
|
2024
|
-
parentCollection:
|
|
2023
|
+
groups: o,
|
|
2024
|
+
parentCollection: s
|
|
2025
2025
|
}) {
|
|
2026
|
-
const
|
|
2026
|
+
const p = R.useRef(null), {
|
|
2027
2027
|
values: c,
|
|
2028
2028
|
setFieldValue: m,
|
|
2029
2029
|
handleChange: u,
|
|
2030
|
-
touched:
|
|
2030
|
+
touched: d,
|
|
2031
2031
|
errors: l,
|
|
2032
2032
|
setFieldTouched: g,
|
|
2033
2033
|
isSubmitting: b,
|
|
2034
2034
|
submitCount: f
|
|
2035
|
-
} = U(), [k, C] =
|
|
2036
|
-
m("name", O), !
|
|
2037
|
-
}, h =
|
|
2038
|
-
let
|
|
2039
|
-
return O || (
|
|
2040
|
-
}, [t, i, r, c.alias]),
|
|
2035
|
+
} = U(), [k, C] = K(!1), x = (O) => {
|
|
2036
|
+
m("name", O), !S(d, "path") && t && O && m("path", Kt(O)), !S(d, "singularName") && t && O && m("singularName", ka(O));
|
|
2037
|
+
}, h = tt(c), y = Z((O) => {
|
|
2038
|
+
let E;
|
|
2039
|
+
return O || (E = "You must specify a path in the database for this collection"), t && i?.includes(O.trim().toLowerCase()) && (E = "There is already a collection which uses this path as an alias"), t && r?.includes(O.trim().toLowerCase()) && !c.alias && (E = "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"), E;
|
|
2040
|
+
}, [t, i, r, c.alias]), w = Z((O) => {
|
|
2041
2041
|
if (!O)
|
|
2042
2042
|
return;
|
|
2043
|
-
let
|
|
2044
|
-
return t && r?.includes(O.trim().toLowerCase()) && (
|
|
2045
|
-
}, [t, r, i]),
|
|
2043
|
+
let E;
|
|
2044
|
+
return t && r?.includes(O.trim().toLowerCase()) && (E = "There is already a collection that uses this value as a path"), t && i?.includes(O.trim().toLowerCase()) && (E = "There is already a collection which uses this alias"), E;
|
|
2045
|
+
}, [t, r, i]), _ = o?.filter((O) => !a?.includes(O)), {
|
|
2046
2046
|
inputFocused: v,
|
|
2047
2047
|
autoCompleteOpen: T,
|
|
2048
2048
|
setAutoCompleteOpen: P
|
|
2049
|
-
} =
|
|
2050
|
-
ref:
|
|
2051
|
-
}), V = !!
|
|
2052
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
/* @__PURE__ */
|
|
2049
|
+
} = va({
|
|
2050
|
+
ref: p
|
|
2051
|
+
}), V = !!s;
|
|
2052
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(nt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
2053
|
+
/* @__PURE__ */ n("div", { children: [
|
|
2054
|
+
/* @__PURE__ */ n(
|
|
2055
2055
|
"div",
|
|
2056
2056
|
{
|
|
2057
2057
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
2058
2058
|
children: [
|
|
2059
2059
|
/* @__PURE__ */ e(N, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${c.name} collection` }),
|
|
2060
|
-
/* @__PURE__ */ e(
|
|
2060
|
+
/* @__PURE__ */ e(se, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
2061
2061
|
pe,
|
|
2062
2062
|
{
|
|
2063
2063
|
shape: "square",
|
|
@@ -2068,78 +2068,78 @@ function ui({
|
|
|
2068
2068
|
]
|
|
2069
2069
|
}
|
|
2070
2070
|
),
|
|
2071
|
-
|
|
2071
|
+
s && /* @__PURE__ */ e(at, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(N, { variant: "caption", children: [
|
|
2072
2072
|
"This is a subcollection of ",
|
|
2073
|
-
/* @__PURE__ */ e("b", { children:
|
|
2073
|
+
/* @__PURE__ */ e("b", { children: s.name })
|
|
2074
2074
|
] }) })
|
|
2075
2075
|
] }),
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2076
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-4", children: [
|
|
2077
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2078
2078
|
/* @__PURE__ */ e(
|
|
2079
|
-
|
|
2079
|
+
Se,
|
|
2080
2080
|
{
|
|
2081
2081
|
value: c.name ?? "",
|
|
2082
2082
|
onChange: (O) => x(O.target.value),
|
|
2083
2083
|
label: "Name",
|
|
2084
2084
|
required: !0,
|
|
2085
|
-
error:
|
|
2085
|
+
error: d.name && !!l.name
|
|
2086
2086
|
}
|
|
2087
2087
|
),
|
|
2088
|
-
/* @__PURE__ */ e(ee, { error:
|
|
2088
|
+
/* @__PURE__ */ e(ee, { error: d.name && !!l.name, children: d.name && l.name ? l.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
2089
2089
|
] }),
|
|
2090
|
-
/* @__PURE__ */
|
|
2090
|
+
/* @__PURE__ */ n("div", { className: ve("col-span-12 ", V ? "" : "sm:col-span-8"), children: [
|
|
2091
2091
|
/* @__PURE__ */ e(
|
|
2092
2092
|
me,
|
|
2093
2093
|
{
|
|
2094
2094
|
name: "path",
|
|
2095
|
-
as:
|
|
2095
|
+
as: H,
|
|
2096
2096
|
label: "Path",
|
|
2097
2097
|
validate: y,
|
|
2098
2098
|
disabled: !t,
|
|
2099
2099
|
required: !0,
|
|
2100
|
-
error:
|
|
2100
|
+
error: d.path && !!l.path
|
|
2101
2101
|
}
|
|
2102
2102
|
),
|
|
2103
|
-
/* @__PURE__ */ e(ee, { error:
|
|
2103
|
+
/* @__PURE__ */ e(ee, { error: d.path && !!l.path, children: d.path && l.path ? l.path : "Path that this collection is stored in" })
|
|
2104
2104
|
] }),
|
|
2105
|
-
!V && /* @__PURE__ */
|
|
2105
|
+
!V && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
2106
2106
|
/* @__PURE__ */ e(
|
|
2107
|
-
|
|
2107
|
+
Se,
|
|
2108
2108
|
{
|
|
2109
|
-
error:
|
|
2109
|
+
error: d.group && !!l.group,
|
|
2110
2110
|
disabled: b,
|
|
2111
2111
|
value: c.group ?? "",
|
|
2112
2112
|
autoComplete: "off",
|
|
2113
2113
|
onChange: (O) => m("group", O.target.value),
|
|
2114
2114
|
name: "group",
|
|
2115
|
-
inputRef:
|
|
2115
|
+
inputRef: p,
|
|
2116
2116
|
label: "Group"
|
|
2117
2117
|
}
|
|
2118
2118
|
),
|
|
2119
2119
|
/* @__PURE__ */ e(
|
|
2120
|
-
|
|
2120
|
+
wa,
|
|
2121
2121
|
{
|
|
2122
|
-
open: T && (
|
|
2122
|
+
open: T && (_ ?? []).length > 0,
|
|
2123
2123
|
setOpen: P,
|
|
2124
|
-
children:
|
|
2125
|
-
|
|
2124
|
+
children: _?.map((O, E) => /* @__PURE__ */ e(
|
|
2125
|
+
_a,
|
|
2126
2126
|
{
|
|
2127
2127
|
onClick: () => {
|
|
2128
2128
|
P(!1), m("group", O ?? null);
|
|
2129
2129
|
},
|
|
2130
2130
|
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: O })
|
|
2131
2131
|
},
|
|
2132
|
-
|
|
2132
|
+
E + "_" + O
|
|
2133
2133
|
))
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
|
-
/* @__PURE__ */ e(ee, { children:
|
|
2136
|
+
/* @__PURE__ */ e(ee, { children: d.group && l.group ? l.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
|
-
title: /* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */ e(
|
|
2141
|
+
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2142
|
+
/* @__PURE__ */ e(st, {}),
|
|
2143
2143
|
/* @__PURE__ */ e(
|
|
2144
2144
|
N,
|
|
2145
2145
|
{
|
|
@@ -2150,12 +2150,12 @@ function ui({
|
|
|
2150
2150
|
)
|
|
2151
2151
|
] }),
|
|
2152
2152
|
initiallyExpanded: !1,
|
|
2153
|
-
children: /* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
|
|
2154
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2155
2155
|
/* @__PURE__ */ e(
|
|
2156
|
-
|
|
2156
|
+
Se,
|
|
2157
2157
|
{
|
|
2158
|
-
error:
|
|
2158
|
+
error: d.singularName && !!l.singularName,
|
|
2159
2159
|
id: "singularName",
|
|
2160
2160
|
"aria-describedby": "singularName-helper",
|
|
2161
2161
|
onChange: (O) => (g("singularName", !0), u(O)),
|
|
@@ -2163,13 +2163,13 @@ function ui({
|
|
|
2163
2163
|
label: "Singular name"
|
|
2164
2164
|
}
|
|
2165
2165
|
),
|
|
2166
|
-
/* @__PURE__ */ e(ee, { error:
|
|
2166
|
+
/* @__PURE__ */ e(ee, { error: d.singularName && !!l.singularName, children: d.singularName && l.singularName ? l.singularName : "Optionally define a singular name for your entities" })
|
|
2167
2167
|
] }),
|
|
2168
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2169
2169
|
/* @__PURE__ */ e(
|
|
2170
|
-
|
|
2170
|
+
Se,
|
|
2171
2171
|
{
|
|
2172
|
-
error:
|
|
2172
|
+
error: d.description && !!l.description,
|
|
2173
2173
|
id: "description",
|
|
2174
2174
|
value: c.description ?? "",
|
|
2175
2175
|
onChange: u,
|
|
@@ -2179,23 +2179,23 @@ function ui({
|
|
|
2179
2179
|
label: "Description"
|
|
2180
2180
|
}
|
|
2181
2181
|
),
|
|
2182
|
-
/* @__PURE__ */ e(ee, { error:
|
|
2182
|
+
/* @__PURE__ */ e(ee, { error: d.description && !!l.description, children: d.description && l.description ? l.description : "Description of the collection, you can use markdown" })
|
|
2183
2183
|
] }),
|
|
2184
|
-
/* @__PURE__ */
|
|
2184
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2185
2185
|
/* @__PURE__ */ e(
|
|
2186
2186
|
me,
|
|
2187
2187
|
{
|
|
2188
2188
|
name: "alias",
|
|
2189
|
-
as:
|
|
2189
|
+
as: H,
|
|
2190
2190
|
label: "Alias",
|
|
2191
|
-
validate:
|
|
2192
|
-
error:
|
|
2191
|
+
validate: w,
|
|
2192
|
+
error: d.alias && !!l.alias
|
|
2193
2193
|
}
|
|
2194
2194
|
),
|
|
2195
|
-
/* @__PURE__ */ e(ee, { error:
|
|
2195
|
+
/* @__PURE__ */ e(ee, { error: d.alias && !!l.alias, children: d.alias && l.alias ? l.alias : "Use an alias as an ID when you have multiple collections located in the same path" })
|
|
2196
2196
|
] }),
|
|
2197
2197
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2198
|
-
|
|
2198
|
+
qe,
|
|
2199
2199
|
{
|
|
2200
2200
|
name: "defaultSize",
|
|
2201
2201
|
label: "Default row size",
|
|
@@ -2213,9 +2213,9 @@ function ui({
|
|
|
2213
2213
|
))
|
|
2214
2214
|
}
|
|
2215
2215
|
) }),
|
|
2216
|
-
/* @__PURE__ */
|
|
2216
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2217
2217
|
/* @__PURE__ */ e(
|
|
2218
|
-
|
|
2218
|
+
Yt,
|
|
2219
2219
|
{
|
|
2220
2220
|
position: "start",
|
|
2221
2221
|
label: "Collection group",
|
|
@@ -2238,7 +2238,7 @@ function ui({
|
|
|
2238
2238
|
maxWidth: "xl",
|
|
2239
2239
|
fullWidth: !0,
|
|
2240
2240
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
2241
|
-
|
|
2241
|
+
pi,
|
|
2242
2242
|
{
|
|
2243
2243
|
selectedIcon: c.icon,
|
|
2244
2244
|
onIconSelected: (O) => {
|
|
@@ -2253,7 +2253,7 @@ function ui({
|
|
|
2253
2253
|
function ye(t) {
|
|
2254
2254
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2256
|
+
function ui(t) {
|
|
2257
2257
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
2258
2258
|
}
|
|
2259
2259
|
function xe(t) {
|
|
@@ -2262,18 +2262,18 @@ function xe(t) {
|
|
|
2262
2262
|
function re(t, a) {
|
|
2263
2263
|
return a ? `${a}.${t}` : t;
|
|
2264
2264
|
}
|
|
2265
|
-
const
|
|
2265
|
+
const hi = R.memo(
|
|
2266
2266
|
function({
|
|
2267
2267
|
enumValues: a,
|
|
2268
2268
|
onValuesChanged: r,
|
|
2269
2269
|
onError: i,
|
|
2270
|
-
updateIds:
|
|
2271
|
-
disabled:
|
|
2272
|
-
allowDataInference:
|
|
2270
|
+
updateIds: o,
|
|
2271
|
+
disabled: s,
|
|
2272
|
+
allowDataInference: p,
|
|
2273
2273
|
getData: c
|
|
2274
2274
|
}) {
|
|
2275
2275
|
return /* @__PURE__ */ e(
|
|
2276
|
-
|
|
2276
|
+
Nt,
|
|
2277
2277
|
{
|
|
2278
2278
|
initialValues: { enumValues: a },
|
|
2279
2279
|
validateOnMount: !0,
|
|
@@ -2282,19 +2282,19 @@ const gi = R.memo(
|
|
|
2282
2282
|
children: ({
|
|
2283
2283
|
values: m,
|
|
2284
2284
|
errors: u
|
|
2285
|
-
}) => (
|
|
2285
|
+
}) => (ne(() => {
|
|
2286
2286
|
r && r(m.enumValues);
|
|
2287
|
-
}, [m.enumValues]),
|
|
2287
|
+
}, [m.enumValues]), ne(() => {
|
|
2288
2288
|
i && i(!!(u?.enumValues ?? !1));
|
|
2289
2289
|
}, [u]), /* @__PURE__ */ e(
|
|
2290
|
-
|
|
2290
|
+
gi,
|
|
2291
2291
|
{
|
|
2292
2292
|
enumValuesPath: "enumValues",
|
|
2293
2293
|
values: m,
|
|
2294
2294
|
errors: u,
|
|
2295
|
-
shouldUpdateId:
|
|
2296
|
-
disabled:
|
|
2297
|
-
allowDataInference:
|
|
2295
|
+
shouldUpdateId: o,
|
|
2296
|
+
disabled: s,
|
|
2297
|
+
allowDataInference: p,
|
|
2298
2298
|
getData: c
|
|
2299
2299
|
}
|
|
2300
2300
|
))
|
|
@@ -2305,36 +2305,36 @@ const gi = R.memo(
|
|
|
2305
2305
|
return a.enumValues.length === r.enumValues.length && a.onValuesChanged === r.onValuesChanged && a.getData === r.getData;
|
|
2306
2306
|
}
|
|
2307
2307
|
);
|
|
2308
|
-
function
|
|
2308
|
+
function gi({
|
|
2309
2309
|
values: t,
|
|
2310
2310
|
errors: a,
|
|
2311
2311
|
disabled: r,
|
|
2312
2312
|
enumValuesPath: i,
|
|
2313
|
-
shouldUpdateId:
|
|
2314
|
-
allowDataInference:
|
|
2315
|
-
getData:
|
|
2313
|
+
shouldUpdateId: o,
|
|
2314
|
+
allowDataInference: s,
|
|
2315
|
+
getData: p
|
|
2316
2316
|
}) {
|
|
2317
2317
|
const {
|
|
2318
2318
|
setFieldValue: c
|
|
2319
|
-
} = U(), [m, u] = R.useState(), [
|
|
2320
|
-
const
|
|
2319
|
+
} = U(), [m, u] = R.useState(), [d, l] = R.useState(), [g, b] = R.useState(!1), k = R.useRef(/* @__PURE__ */ new Set()).current, C = (h, y) => {
|
|
2320
|
+
const w = m === y;
|
|
2321
2321
|
return /* @__PURE__ */ e(
|
|
2322
|
-
|
|
2322
|
+
fi,
|
|
2323
2323
|
{
|
|
2324
2324
|
index: h,
|
|
2325
2325
|
disabled: r,
|
|
2326
2326
|
enumValuesPath: i,
|
|
2327
|
-
autoFocus:
|
|
2328
|
-
shouldUpdateId:
|
|
2327
|
+
autoFocus: w,
|
|
2328
|
+
shouldUpdateId: o || w,
|
|
2329
2329
|
onDialogOpen: () => l(h),
|
|
2330
2330
|
inferredEntry: k.has(t.enumValues[h]?.id)
|
|
2331
2331
|
},
|
|
2332
2332
|
`${y}`
|
|
2333
2333
|
);
|
|
2334
2334
|
};
|
|
2335
|
-
return /* @__PURE__ */
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */ e(
|
|
2335
|
+
return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2336
|
+
/* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
|
|
2337
|
+
/* @__PURE__ */ e(xa, {}),
|
|
2338
2338
|
/* @__PURE__ */ e(
|
|
2339
2339
|
N,
|
|
2340
2340
|
{
|
|
@@ -2343,7 +2343,7 @@ function fi({
|
|
|
2343
2343
|
children: "Values"
|
|
2344
2344
|
}
|
|
2345
2345
|
),
|
|
2346
|
-
|
|
2346
|
+
s && /* @__PURE__ */ n(
|
|
2347
2347
|
wt,
|
|
2348
2348
|
{
|
|
2349
2349
|
loading: g,
|
|
@@ -2351,27 +2351,27 @@ function fi({
|
|
|
2351
2351
|
variant: "text",
|
|
2352
2352
|
size: "small",
|
|
2353
2353
|
onClick: async () => {
|
|
2354
|
-
b(!0),
|
|
2354
|
+
b(!0), p?.().then((h) => {
|
|
2355
2355
|
if (!h)
|
|
2356
2356
|
return;
|
|
2357
|
-
const y = h.flat(),
|
|
2357
|
+
const y = h.flat(), w = Array.from(new Set(y)), _ = t.enumValues, T = Qa(w).filter((P) => !_?.some((V) => V.id === P.id));
|
|
2358
2358
|
T.forEach((P) => {
|
|
2359
2359
|
k.add(P.id);
|
|
2360
|
-
}), c(i, [...T, ...
|
|
2360
|
+
}), c(i, [...T, ..._]);
|
|
2361
2361
|
}).catch((h) => {
|
|
2362
2362
|
console.error(h);
|
|
2363
2363
|
}).finally(() => b(!1));
|
|
2364
2364
|
},
|
|
2365
2365
|
children: [
|
|
2366
|
-
g ? /* @__PURE__ */ e($e, { size: "small" }) : /* @__PURE__ */ e(
|
|
2366
|
+
g ? /* @__PURE__ */ e($e, { size: "small" }) : /* @__PURE__ */ e(lt, {}),
|
|
2367
2367
|
"Infer values from data"
|
|
2368
2368
|
]
|
|
2369
2369
|
}
|
|
2370
2370
|
)
|
|
2371
2371
|
] }),
|
|
2372
|
-
/* @__PURE__ */
|
|
2372
|
+
/* @__PURE__ */ n(Ce, { className: "p-4 m-1", children: [
|
|
2373
2373
|
/* @__PURE__ */ e(
|
|
2374
|
-
|
|
2374
|
+
Ca,
|
|
2375
2375
|
{
|
|
2376
2376
|
value: t.enumValues,
|
|
2377
2377
|
addLabel: "Add enum value",
|
|
@@ -2385,10 +2385,10 @@ function fi({
|
|
|
2385
2385
|
}
|
|
2386
2386
|
),
|
|
2387
2387
|
/* @__PURE__ */ e(
|
|
2388
|
-
|
|
2388
|
+
bi,
|
|
2389
2389
|
{
|
|
2390
|
-
index:
|
|
2391
|
-
open:
|
|
2390
|
+
index: d,
|
|
2391
|
+
open: d !== void 0,
|
|
2392
2392
|
enumValuesPath: i,
|
|
2393
2393
|
onClose: () => l(void 0)
|
|
2394
2394
|
}
|
|
@@ -2396,50 +2396,50 @@ function fi({
|
|
|
2396
2396
|
] })
|
|
2397
2397
|
] });
|
|
2398
2398
|
}
|
|
2399
|
-
const
|
|
2399
|
+
const fi = R.memo(
|
|
2400
2400
|
function({
|
|
2401
2401
|
index: a,
|
|
2402
2402
|
shouldUpdateId: r,
|
|
2403
2403
|
enumValuesPath: i,
|
|
2404
|
-
autoFocus:
|
|
2405
|
-
onDialogOpen:
|
|
2406
|
-
disabled:
|
|
2404
|
+
autoFocus: o,
|
|
2405
|
+
onDialogOpen: s,
|
|
2406
|
+
disabled: p,
|
|
2407
2407
|
inferredEntry: c
|
|
2408
2408
|
}) {
|
|
2409
2409
|
const {
|
|
2410
2410
|
values: m,
|
|
2411
2411
|
handleChange: u,
|
|
2412
|
-
errors:
|
|
2412
|
+
errors: d,
|
|
2413
2413
|
setFieldValue: l,
|
|
2414
2414
|
touched: g
|
|
2415
|
-
} = U(), b = R.useRef(!
|
|
2415
|
+
} = U(), b = R.useRef(!S(m, `${i}[${a}].id`)), f = r || b.current, k = S(m, `${i}[${a}].id`), C = S(m, `${i}[${a}].label`), x = S(d, `${i}[${a}].label`), h = R.useRef(C);
|
|
2416
2416
|
return R.useEffect(() => {
|
|
2417
2417
|
(h.current === k || !k) && f && l(`${i}[${a}].id`, C), h.current = C;
|
|
2418
|
-
}, [C]), /* @__PURE__ */
|
|
2418
|
+
}, [C]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
|
|
2419
2419
|
/* @__PURE__ */ e(
|
|
2420
2420
|
oe,
|
|
2421
2421
|
{
|
|
2422
2422
|
name: `${i}[${a}].label`,
|
|
2423
|
-
as:
|
|
2423
|
+
as: H,
|
|
2424
2424
|
className: "flex-grow",
|
|
2425
2425
|
required: !0,
|
|
2426
|
-
disabled:
|
|
2426
|
+
disabled: p,
|
|
2427
2427
|
size: "small",
|
|
2428
|
-
validate:
|
|
2429
|
-
autoFocus:
|
|
2428
|
+
validate: yi,
|
|
2429
|
+
autoFocus: o,
|
|
2430
2430
|
autoComplete: "off",
|
|
2431
|
-
endAdornment: c && /* @__PURE__ */ e(
|
|
2431
|
+
endAdornment: c && /* @__PURE__ */ e(lt, { size: "small" }),
|
|
2432
2432
|
error: !!x
|
|
2433
2433
|
}
|
|
2434
2434
|
),
|
|
2435
|
-
!
|
|
2435
|
+
!p && /* @__PURE__ */ e(
|
|
2436
2436
|
pe,
|
|
2437
2437
|
{
|
|
2438
2438
|
size: "small",
|
|
2439
2439
|
"aria-label": "edit",
|
|
2440
2440
|
className: "m-1",
|
|
2441
|
-
onClick: () =>
|
|
2442
|
-
children: /* @__PURE__ */ e(
|
|
2441
|
+
onClick: () => s(),
|
|
2442
|
+
children: /* @__PURE__ */ e(st, { size: "small" })
|
|
2443
2443
|
}
|
|
2444
2444
|
)
|
|
2445
2445
|
] });
|
|
@@ -2448,35 +2448,35 @@ const bi = R.memo(
|
|
|
2448
2448
|
return a.index === r.index && a.enumValuesPath === r.enumValuesPath && a.shouldUpdateId === r.shouldUpdateId && a.inferredEntry === r.inferredEntry && a.autoFocus === r.autoFocus;
|
|
2449
2449
|
}
|
|
2450
2450
|
);
|
|
2451
|
-
function
|
|
2451
|
+
function bi({
|
|
2452
2452
|
index: t,
|
|
2453
2453
|
open: a,
|
|
2454
2454
|
onClose: r,
|
|
2455
2455
|
enumValuesPath: i
|
|
2456
2456
|
}) {
|
|
2457
2457
|
const {
|
|
2458
|
-
values:
|
|
2459
|
-
handleChange:
|
|
2460
|
-
errors:
|
|
2458
|
+
values: o,
|
|
2459
|
+
handleChange: s,
|
|
2460
|
+
errors: p,
|
|
2461
2461
|
setFieldValue: c,
|
|
2462
2462
|
touched: m
|
|
2463
|
-
} = U(), u = t !== void 0 ?
|
|
2464
|
-
return /* @__PURE__ */
|
|
2463
|
+
} = U(), u = t !== void 0 ? S(p, `${i}[${t}].id`) : void 0;
|
|
2464
|
+
return /* @__PURE__ */ n(
|
|
2465
2465
|
Ee,
|
|
2466
2466
|
{
|
|
2467
2467
|
maxWidth: "md",
|
|
2468
2468
|
"aria-labelledby": "enum-edit-dialog",
|
|
2469
2469
|
open: a,
|
|
2470
|
-
onOpenChange: (
|
|
2470
|
+
onOpenChange: (d) => d ? void 0 : r(),
|
|
2471
2471
|
children: [
|
|
2472
|
-
/* @__PURE__ */ e(Le, { children: t !== void 0 && /* @__PURE__ */
|
|
2472
|
+
/* @__PURE__ */ e(Le, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
|
|
2473
2473
|
/* @__PURE__ */ e(
|
|
2474
2474
|
oe,
|
|
2475
2475
|
{
|
|
2476
2476
|
name: `${i}[${t}]id`,
|
|
2477
|
-
as:
|
|
2477
|
+
as: H,
|
|
2478
2478
|
required: !0,
|
|
2479
|
-
validate:
|
|
2479
|
+
validate: vi,
|
|
2480
2480
|
label: "ID",
|
|
2481
2481
|
size: "small",
|
|
2482
2482
|
autoComplete: "off",
|
|
@@ -2485,8 +2485,8 @@ function yi({
|
|
|
2485
2485
|
),
|
|
2486
2486
|
/* @__PURE__ */ e(ee, { error: !!u, children: u ?? "Value saved in the data source" })
|
|
2487
2487
|
] }) }),
|
|
2488
|
-
/* @__PURE__ */ e(
|
|
2489
|
-
|
|
2488
|
+
/* @__PURE__ */ e(Ye, { children: /* @__PURE__ */ e(
|
|
2489
|
+
B,
|
|
2490
2490
|
{
|
|
2491
2491
|
autoFocus: !0,
|
|
2492
2492
|
variant: "outlined",
|
|
@@ -2499,17 +2499,17 @@ function yi({
|
|
|
2499
2499
|
}
|
|
2500
2500
|
);
|
|
2501
2501
|
}
|
|
2502
|
-
function
|
|
2502
|
+
function yi(t) {
|
|
2503
2503
|
let a;
|
|
2504
2504
|
return t || (a = "You must specify a label"), a;
|
|
2505
2505
|
}
|
|
2506
|
-
function
|
|
2506
|
+
function vi(t) {
|
|
2507
2507
|
let a;
|
|
2508
2508
|
return t || (a = "You must specify an ID"), a;
|
|
2509
2509
|
}
|
|
2510
2510
|
function ze({ disabled: t }) {
|
|
2511
|
-
const { values: a, handleChange: r } = U(), i = "validation.required",
|
|
2512
|
-
return /* @__PURE__ */
|
|
2511
|
+
const { values: a, handleChange: r } = U(), i = "validation.required", o = "validation.requiredMessage";
|
|
2512
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
2513
2513
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2514
2514
|
oe,
|
|
2515
2515
|
{
|
|
@@ -2518,7 +2518,7 @@ function ze({ disabled: t }) {
|
|
|
2518
2518
|
name: i,
|
|
2519
2519
|
label: "Required",
|
|
2520
2520
|
tooltip: "You won't be able to save this entity if this value is not set",
|
|
2521
|
-
component:
|
|
2521
|
+
component: ce
|
|
2522
2522
|
}
|
|
2523
2523
|
) }),
|
|
2524
2524
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
@@ -2529,16 +2529,16 @@ function ze({ disabled: t }) {
|
|
|
2529
2529
|
name: "validation.unique",
|
|
2530
2530
|
label: "Unique",
|
|
2531
2531
|
tooltip: "There cannot be multiple entities with the same value",
|
|
2532
|
-
component:
|
|
2532
|
+
component: ce
|
|
2533
2533
|
}
|
|
2534
2534
|
) }),
|
|
2535
|
-
|
|
2536
|
-
|
|
2535
|
+
S(a, i) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2536
|
+
H,
|
|
2537
2537
|
{
|
|
2538
2538
|
disabled: t,
|
|
2539
|
-
value:
|
|
2539
|
+
value: S(a, o),
|
|
2540
2540
|
label: "Required message",
|
|
2541
|
-
name:
|
|
2541
|
+
name: o,
|
|
2542
2542
|
size: "small",
|
|
2543
2543
|
onChange: r
|
|
2544
2544
|
}
|
|
@@ -2550,20 +2550,20 @@ function je({
|
|
|
2550
2550
|
lowercase: a,
|
|
2551
2551
|
matches: r,
|
|
2552
2552
|
max: i,
|
|
2553
|
-
min:
|
|
2554
|
-
trim:
|
|
2555
|
-
uppercase:
|
|
2553
|
+
min: o,
|
|
2554
|
+
trim: s,
|
|
2555
|
+
uppercase: p,
|
|
2556
2556
|
disabled: c,
|
|
2557
2557
|
showErrors: m
|
|
2558
2558
|
}) {
|
|
2559
2559
|
const {
|
|
2560
2560
|
values: u,
|
|
2561
|
-
handleChange:
|
|
2561
|
+
handleChange: d,
|
|
2562
2562
|
errors: l
|
|
2563
|
-
} = U(), g = "validation.length", b = "validation.min", f = "validation.max", k = "validation.trim", C = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", y =
|
|
2564
|
-
return /* @__PURE__ */
|
|
2563
|
+
} = U(), g = "validation.length", b = "validation.min", f = "validation.max", k = "validation.trim", C = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", y = S(l, C), w = S(u, C), _ = typeof w == "string" ? w : Oa(w);
|
|
2564
|
+
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2565
2565
|
/* @__PURE__ */ e(ze, { disabled: c }),
|
|
2566
|
-
/* @__PURE__ */
|
|
2566
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2567
2567
|
a && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2568
2568
|
oe,
|
|
2569
2569
|
{
|
|
@@ -2571,79 +2571,79 @@ function je({
|
|
|
2571
2571
|
name: x,
|
|
2572
2572
|
label: "Lowercase",
|
|
2573
2573
|
disabled: c,
|
|
2574
|
-
component:
|
|
2574
|
+
component: ce
|
|
2575
2575
|
}
|
|
2576
2576
|
) }),
|
|
2577
|
-
|
|
2577
|
+
p && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2578
2578
|
oe,
|
|
2579
2579
|
{
|
|
2580
2580
|
type: "checkbox",
|
|
2581
2581
|
name: h,
|
|
2582
2582
|
label: "Uppercase",
|
|
2583
2583
|
disabled: c,
|
|
2584
|
-
component:
|
|
2584
|
+
component: ce
|
|
2585
2585
|
}
|
|
2586
2586
|
) }),
|
|
2587
|
-
|
|
2587
|
+
s && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2588
2588
|
oe,
|
|
2589
2589
|
{
|
|
2590
2590
|
type: "checkbox",
|
|
2591
2591
|
name: k,
|
|
2592
2592
|
label: "Trim",
|
|
2593
2593
|
disabled: c,
|
|
2594
|
-
component:
|
|
2594
|
+
component: ce
|
|
2595
2595
|
}
|
|
2596
2596
|
) })
|
|
2597
2597
|
] }),
|
|
2598
|
-
/* @__PURE__ */
|
|
2598
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2599
2599
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2600
|
-
|
|
2600
|
+
H,
|
|
2601
2601
|
{
|
|
2602
|
-
value:
|
|
2602
|
+
value: S(u, g),
|
|
2603
2603
|
label: "Exact length",
|
|
2604
2604
|
name: g,
|
|
2605
2605
|
type: "number",
|
|
2606
2606
|
size: "small",
|
|
2607
2607
|
disabled: c,
|
|
2608
|
-
onChange:
|
|
2608
|
+
onChange: d
|
|
2609
2609
|
}
|
|
2610
2610
|
) }),
|
|
2611
|
-
|
|
2612
|
-
|
|
2611
|
+
o && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2612
|
+
H,
|
|
2613
2613
|
{
|
|
2614
|
-
value:
|
|
2614
|
+
value: S(u, b),
|
|
2615
2615
|
label: "Min length",
|
|
2616
2616
|
name: b,
|
|
2617
2617
|
type: "number",
|
|
2618
2618
|
size: "small",
|
|
2619
2619
|
disabled: c,
|
|
2620
|
-
onChange:
|
|
2620
|
+
onChange: d
|
|
2621
2621
|
}
|
|
2622
2622
|
) }),
|
|
2623
2623
|
i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2624
|
-
|
|
2624
|
+
H,
|
|
2625
2625
|
{
|
|
2626
|
-
value:
|
|
2626
|
+
value: S(u, f),
|
|
2627
2627
|
label: "Max length",
|
|
2628
2628
|
name: f,
|
|
2629
2629
|
type: "number",
|
|
2630
2630
|
size: "small",
|
|
2631
2631
|
disabled: c,
|
|
2632
|
-
onChange:
|
|
2632
|
+
onChange: d
|
|
2633
2633
|
}
|
|
2634
2634
|
) })
|
|
2635
2635
|
] }),
|
|
2636
|
-
r && /* @__PURE__ */
|
|
2636
|
+
r && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2637
2637
|
/* @__PURE__ */ e(
|
|
2638
2638
|
oe,
|
|
2639
2639
|
{
|
|
2640
2640
|
name: C,
|
|
2641
|
-
as:
|
|
2642
|
-
validate: (v) => v && !
|
|
2641
|
+
as: H,
|
|
2642
|
+
validate: (v) => v && !Na(v),
|
|
2643
2643
|
label: "Matches regex",
|
|
2644
2644
|
size: "small",
|
|
2645
2645
|
disabled: c,
|
|
2646
|
-
value:
|
|
2646
|
+
value: _,
|
|
2647
2647
|
error: !!y
|
|
2648
2648
|
}
|
|
2649
2649
|
),
|
|
@@ -2651,39 +2651,39 @@ function je({
|
|
|
2651
2651
|
] })
|
|
2652
2652
|
] });
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2654
|
+
function St({
|
|
2655
2655
|
max: t = !0,
|
|
2656
2656
|
min: a = !0,
|
|
2657
2657
|
disabled: r
|
|
2658
2658
|
}) {
|
|
2659
2659
|
const {
|
|
2660
2660
|
values: i,
|
|
2661
|
-
handleChange:
|
|
2662
|
-
} = U(),
|
|
2663
|
-
return /* @__PURE__ */
|
|
2661
|
+
handleChange: o
|
|
2662
|
+
} = U(), s = "validation.min", p = "validation.max";
|
|
2663
|
+
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2664
2664
|
/* @__PURE__ */ e(ze, { disabled: r }),
|
|
2665
2665
|
a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2666
|
-
|
|
2666
|
+
H,
|
|
2667
2667
|
{
|
|
2668
|
-
value:
|
|
2668
|
+
value: S(i, s),
|
|
2669
2669
|
disabled: r,
|
|
2670
2670
|
label: "Min length",
|
|
2671
|
-
name:
|
|
2671
|
+
name: s,
|
|
2672
2672
|
type: "number",
|
|
2673
2673
|
size: "small",
|
|
2674
|
-
onChange:
|
|
2674
|
+
onChange: o
|
|
2675
2675
|
}
|
|
2676
2676
|
) }),
|
|
2677
2677
|
t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2678
|
-
|
|
2678
|
+
H,
|
|
2679
2679
|
{
|
|
2680
|
-
value:
|
|
2680
|
+
value: S(i, p),
|
|
2681
2681
|
disabled: r,
|
|
2682
2682
|
label: "Max length",
|
|
2683
|
-
name:
|
|
2683
|
+
name: p,
|
|
2684
2684
|
type: "number",
|
|
2685
2685
|
size: "small",
|
|
2686
|
-
onChange:
|
|
2686
|
+
onChange: o
|
|
2687
2687
|
}
|
|
2688
2688
|
) })
|
|
2689
2689
|
] });
|
|
@@ -2697,8 +2697,8 @@ function Ne({
|
|
|
2697
2697
|
initiallyExpanded: !1,
|
|
2698
2698
|
asField: !0,
|
|
2699
2699
|
className: "p-4",
|
|
2700
|
-
title: /* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */ e(
|
|
2700
|
+
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2701
|
+
/* @__PURE__ */ e(Pa, {}),
|
|
2702
2702
|
/* @__PURE__ */ e(
|
|
2703
2703
|
N,
|
|
2704
2704
|
{
|
|
@@ -2712,37 +2712,37 @@ function Ne({
|
|
|
2712
2712
|
}
|
|
2713
2713
|
);
|
|
2714
2714
|
}
|
|
2715
|
-
function
|
|
2715
|
+
function Ft({
|
|
2716
2716
|
multiselect: t,
|
|
2717
2717
|
updateIds: a,
|
|
2718
2718
|
disabled: r,
|
|
2719
2719
|
showErrors: i,
|
|
2720
|
-
allowDataInference:
|
|
2721
|
-
getData:
|
|
2720
|
+
allowDataInference: o,
|
|
2721
|
+
getData: s
|
|
2722
2722
|
}) {
|
|
2723
2723
|
const {
|
|
2724
|
-
values:
|
|
2724
|
+
values: p,
|
|
2725
2725
|
handleChange: c,
|
|
2726
2726
|
errors: m,
|
|
2727
2727
|
touched: u,
|
|
2728
|
-
setFieldError:
|
|
2728
|
+
setFieldError: d,
|
|
2729
2729
|
setFieldValue: l
|
|
2730
|
-
} = U(), g =
|
|
2731
|
-
return /* @__PURE__ */
|
|
2730
|
+
} = U(), g = ct(), b = t ? "of.enumValues" : "enumValues", f = S(p, "defaultValue"), k = S(p, b), C = Ut(() => !k || typeof k == "boolean" ? [] : Sa(k) ?? [], [k]);
|
|
2731
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
2732
2732
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2733
|
-
|
|
2733
|
+
hi,
|
|
2734
2734
|
{
|
|
2735
2735
|
enumValues: C,
|
|
2736
2736
|
updateIds: a,
|
|
2737
2737
|
disabled: r,
|
|
2738
|
-
allowDataInference:
|
|
2738
|
+
allowDataInference: o,
|
|
2739
2739
|
onError: (h) => {
|
|
2740
|
-
|
|
2740
|
+
d(b, h ? "" : void 0);
|
|
2741
2741
|
},
|
|
2742
|
-
getData:
|
|
2742
|
+
getData: s ? () => s().then((h) => h.map((y) => p.id && S(y, p.id)).filter(Boolean)) : void 0,
|
|
2743
2743
|
onValuesChanged: (h) => {
|
|
2744
|
-
if (
|
|
2745
|
-
const y = h.filter((
|
|
2744
|
+
if (p && (l(b, h), !t)) {
|
|
2745
|
+
const y = h.filter((w) => !!w?.id).map((w) => w.id);
|
|
2746
2746
|
f && !y.includes(f) && (l("defaultValue", void 0), g.open({
|
|
2747
2747
|
type: "warning",
|
|
2748
2748
|
message: "Default value was cleared"
|
|
@@ -2751,7 +2751,7 @@ function jt({
|
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
2753
|
) }),
|
|
2754
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */
|
|
2754
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ne, { children: [
|
|
2755
2755
|
!t && /* @__PURE__ */ e(
|
|
2756
2756
|
je,
|
|
2757
2757
|
{
|
|
@@ -2759,10 +2759,10 @@ function jt({
|
|
|
2759
2759
|
showErrors: i
|
|
2760
2760
|
}
|
|
2761
2761
|
),
|
|
2762
|
-
t && /* @__PURE__ */ e(
|
|
2762
|
+
t && /* @__PURE__ */ e(St, { disabled: r })
|
|
2763
2763
|
] }) }),
|
|
2764
2764
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2765
|
-
|
|
2765
|
+
qe,
|
|
2766
2766
|
{
|
|
2767
2767
|
disabled: r,
|
|
2768
2768
|
position: "item-aligned",
|
|
@@ -2783,29 +2783,29 @@ function jt({
|
|
|
2783
2783
|
) })
|
|
2784
2784
|
] });
|
|
2785
2785
|
}
|
|
2786
|
-
const
|
|
2786
|
+
const Xe = {
|
|
2787
2787
|
"image/*": "Images",
|
|
2788
2788
|
"video/*": "Videos",
|
|
2789
2789
|
"audio/*": "Audio files",
|
|
2790
2790
|
"application/*": "Files (pdf, zip, csv, excel...)",
|
|
2791
2791
|
"text/*": "Text files"
|
|
2792
2792
|
};
|
|
2793
|
-
function
|
|
2793
|
+
function Et({
|
|
2794
2794
|
multiple: t,
|
|
2795
2795
|
existing: a,
|
|
2796
2796
|
disabled: r
|
|
2797
2797
|
}) {
|
|
2798
2798
|
const {
|
|
2799
2799
|
values: i,
|
|
2800
|
-
setFieldValue:
|
|
2801
|
-
} = U(),
|
|
2802
|
-
h ? h.includes("all") || h.length >= Object.keys(
|
|
2803
|
-
}, C = typeof
|
|
2804
|
-
return /* @__PURE__ */
|
|
2800
|
+
setFieldValue: o
|
|
2801
|
+
} = U(), s = t ? "of.storage" : "storage", p = `${s}.acceptedFiles`, c = `${s}.fileName`, m = `${s}.storagePath`, u = `${s}.storeUrl`, d = S(i, c) ?? "{rand}_{file}", l = S(i, m) ?? "/", g = S(i, p), b = Array.isArray(g) ? g : void 0, f = !b || b.length === 0, k = (h) => {
|
|
2802
|
+
h ? h.includes("all") || h.length >= Object.keys(Xe).length ? o(p, void 0) : f ? o(p, Object.keys(Xe).filter((y) => !h.includes(y))) : o(p, h) : o(p, void 0);
|
|
2803
|
+
}, C = typeof d == "function", x = typeof l == "function";
|
|
2804
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
2805
2805
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2806
2806
|
kt,
|
|
2807
2807
|
{
|
|
2808
|
-
title: /* @__PURE__ */
|
|
2808
|
+
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2809
2809
|
/* @__PURE__ */ e(qa, {}),
|
|
2810
2810
|
/* @__PURE__ */ e(
|
|
2811
2811
|
N,
|
|
@@ -2816,40 +2816,40 @@ function Ft({
|
|
|
2816
2816
|
}
|
|
2817
2817
|
)
|
|
2818
2818
|
] }),
|
|
2819
|
-
children: /* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */
|
|
2821
|
-
|
|
2819
|
+
children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
|
|
2820
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2821
|
+
Aa,
|
|
2822
2822
|
{
|
|
2823
2823
|
disabled: r,
|
|
2824
|
-
name:
|
|
2824
|
+
name: p,
|
|
2825
2825
|
value: b ?? [],
|
|
2826
2826
|
onMultiValueChange: k,
|
|
2827
2827
|
label: f ? void 0 : "Allowed file types",
|
|
2828
|
-
renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((y) =>
|
|
2828
|
+
renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((y) => Xe[y]).filter((y) => !!y).join(", "),
|
|
2829
2829
|
children: [
|
|
2830
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ n(qt, { value: "all", className: "flex items-center gap-2", children: [
|
|
2831
2831
|
/* @__PURE__ */ e(
|
|
2832
|
-
|
|
2832
|
+
At,
|
|
2833
2833
|
{
|
|
2834
2834
|
checked: !b
|
|
2835
2835
|
}
|
|
2836
2836
|
),
|
|
2837
2837
|
"All"
|
|
2838
2838
|
] }, "all"),
|
|
2839
|
-
Object.entries(
|
|
2839
|
+
Object.entries(Xe).map(([h, y]) => /* @__PURE__ */ n(qt, { value: h, className: "flex items-center gap-2", children: [
|
|
2840
2840
|
/* @__PURE__ */ e(
|
|
2841
|
-
|
|
2841
|
+
At,
|
|
2842
2842
|
{
|
|
2843
2843
|
checked: f || b.indexOf(h) > -1
|
|
2844
2844
|
}
|
|
2845
2845
|
),
|
|
2846
2846
|
/* @__PURE__ */ e("div", { className: "flex-grow", children: y }),
|
|
2847
2847
|
/* @__PURE__ */ e(
|
|
2848
|
-
|
|
2848
|
+
B,
|
|
2849
2849
|
{
|
|
2850
2850
|
size: "small",
|
|
2851
2851
|
variant: "outlined",
|
|
2852
|
-
onClick: (
|
|
2852
|
+
onClick: (w) => (w.preventDefault(), w.stopPropagation(), o(p, [h])),
|
|
2853
2853
|
children: "Only"
|
|
2854
2854
|
}
|
|
2855
2855
|
)
|
|
@@ -2861,28 +2861,28 @@ function Ft({
|
|
|
2861
2861
|
me,
|
|
2862
2862
|
{
|
|
2863
2863
|
name: c,
|
|
2864
|
-
as:
|
|
2864
|
+
as: H,
|
|
2865
2865
|
label: "File name",
|
|
2866
2866
|
size: "small",
|
|
2867
2867
|
disabled: C || r,
|
|
2868
|
-
value: C ? "-" :
|
|
2868
|
+
value: C ? "-" : d
|
|
2869
2869
|
}
|
|
2870
2870
|
) }),
|
|
2871
|
-
/* @__PURE__ */
|
|
2871
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2872
2872
|
/* @__PURE__ */ e(
|
|
2873
2873
|
me,
|
|
2874
2874
|
{
|
|
2875
2875
|
name: m,
|
|
2876
|
-
as:
|
|
2876
|
+
as: H,
|
|
2877
2877
|
label: "Storage path",
|
|
2878
2878
|
disabled: x || r,
|
|
2879
2879
|
size: "small",
|
|
2880
2880
|
value: x ? "-" : l
|
|
2881
2881
|
}
|
|
2882
2882
|
),
|
|
2883
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ n(N, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
|
|
2884
2884
|
/* @__PURE__ */ e("p", { children: "You can use the following placeholders in the file name and storage path values:" }),
|
|
2885
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ n("ul", { children: [
|
|
2886
2886
|
/* @__PURE__ */ e("li", { children: "{file} - Full name of the uploaded file" }),
|
|
2887
2887
|
/* @__PURE__ */ e("li", { children: "{file.name} - Name of the uploaded file without extension" }),
|
|
2888
2888
|
/* @__PURE__ */ e("li", { children: "{file.ext} - Extension of the uploaded file" }),
|
|
@@ -2899,7 +2899,7 @@ function Ft({
|
|
|
2899
2899
|
name: u,
|
|
2900
2900
|
label: "Save URL instead of storage path",
|
|
2901
2901
|
disabled: a || r,
|
|
2902
|
-
component:
|
|
2902
|
+
component: ce
|
|
2903
2903
|
}
|
|
2904
2904
|
),
|
|
2905
2905
|
/* @__PURE__ */ e("br", {}),
|
|
@@ -2908,61 +2908,61 @@ function Ft({
|
|
|
2908
2908
|
] })
|
|
2909
2909
|
}
|
|
2910
2910
|
) }),
|
|
2911
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */
|
|
2911
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ne, { children: [
|
|
2912
2912
|
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(ze, { disabled: r }) }),
|
|
2913
|
-
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2913
|
+
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(St, { disabled: r }) })
|
|
2914
2914
|
] }) })
|
|
2915
2915
|
] });
|
|
2916
2916
|
}
|
|
2917
2917
|
function Ue(t) {
|
|
2918
|
-
if (
|
|
2918
|
+
if (de(t) || de(t))
|
|
2919
2919
|
return !1;
|
|
2920
2920
|
{
|
|
2921
2921
|
const a = t;
|
|
2922
2922
|
return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
|
|
2923
2923
|
}
|
|
2924
2924
|
}
|
|
2925
|
-
function
|
|
2925
|
+
function wi(t) {
|
|
2926
2926
|
return Object.entries(t).filter(([a, r]) => Ue(r)).map(([a, r]) => {
|
|
2927
2927
|
const i = r;
|
|
2928
2928
|
if (Ue(i))
|
|
2929
2929
|
return i.dataType === "map" && i.properties ? {
|
|
2930
2930
|
[a]: {
|
|
2931
2931
|
...i,
|
|
2932
|
-
properties:
|
|
2932
|
+
properties: wi(i.properties)
|
|
2933
2933
|
}
|
|
2934
2934
|
} : { [a]: i };
|
|
2935
2935
|
}).filter((a) => !!a).reduce((a, r) => ({ ...a, ...r }), {});
|
|
2936
2936
|
}
|
|
2937
|
-
function
|
|
2937
|
+
function oa({
|
|
2938
2938
|
property: t,
|
|
2939
2939
|
onClick: a,
|
|
2940
2940
|
hasError: r,
|
|
2941
2941
|
includeName: i,
|
|
2942
|
-
includeEditButton:
|
|
2943
|
-
selected:
|
|
2942
|
+
includeEditButton: o,
|
|
2943
|
+
selected: s
|
|
2944
2944
|
}) {
|
|
2945
|
-
const { fields:
|
|
2946
|
-
return /* @__PURE__ */ e(ke, { children: /* @__PURE__ */
|
|
2945
|
+
const { fields: p } = Ae(), c = dt(t, p), m = !Ue(t);
|
|
2946
|
+
return /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ n(
|
|
2947
2947
|
"div",
|
|
2948
2948
|
{
|
|
2949
2949
|
onClick: a,
|
|
2950
2950
|
className: "flex flex-row w-full cursor-pointer",
|
|
2951
2951
|
children: [
|
|
2952
|
-
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(
|
|
2953
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ke, { fieldConfig: c }) }),
|
|
2953
|
+
/* @__PURE__ */ n(
|
|
2954
2954
|
Ce,
|
|
2955
2955
|
{
|
|
2956
2956
|
className: ve(
|
|
2957
2957
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
2958
|
-
|
|
2958
|
+
Gt,
|
|
2959
2959
|
a ? Ht : "",
|
|
2960
|
-
|
|
2960
|
+
s ? Qt : "",
|
|
2961
2961
|
"flex-grow p-4 border transition-colors duration-200",
|
|
2962
|
-
r ? "border-red-500" :
|
|
2962
|
+
r ? "border-red-500" : s ? "border-blue-500" : "border-transparent"
|
|
2963
2963
|
),
|
|
2964
2964
|
children: [
|
|
2965
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
|
|
2966
2966
|
i && /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(
|
|
2967
2967
|
N,
|
|
2968
2968
|
{
|
|
@@ -2972,7 +2972,7 @@ function aa({
|
|
|
2972
2972
|
children: t.name ? t.name : " "
|
|
2973
2973
|
}
|
|
2974
2974
|
) }),
|
|
2975
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
|
|
2976
2976
|
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(
|
|
2977
2977
|
N,
|
|
2978
2978
|
{
|
|
@@ -2996,12 +2996,12 @@ function aa({
|
|
|
2996
2996
|
"div",
|
|
2997
2997
|
{
|
|
2998
2998
|
className: "text-xs h-3 ml-0.5",
|
|
2999
|
-
children: /* @__PURE__ */ e(
|
|
2999
|
+
children: /* @__PURE__ */ e(Zt, { color: "disabled" })
|
|
3000
3000
|
}
|
|
3001
3001
|
)
|
|
3002
3002
|
] })
|
|
3003
3003
|
] }),
|
|
3004
|
-
|
|
3004
|
+
o && /* @__PURE__ */ e(N, { variant: "button", children: "EDIT" })
|
|
3005
3005
|
]
|
|
3006
3006
|
}
|
|
3007
3007
|
)
|
|
@@ -3009,42 +3009,42 @@ function aa({
|
|
|
3009
3009
|
}
|
|
3010
3010
|
) });
|
|
3011
3011
|
}
|
|
3012
|
-
function
|
|
3012
|
+
function _i({
|
|
3013
3013
|
name: t,
|
|
3014
3014
|
selected: a,
|
|
3015
3015
|
onClick: r,
|
|
3016
3016
|
property: i
|
|
3017
3017
|
}) {
|
|
3018
|
-
const { fields:
|
|
3019
|
-
return /* @__PURE__ */
|
|
3018
|
+
const { fields: o } = Ae(), s = !de(i) && i ? dt(i, o) : void 0;
|
|
3019
|
+
return /* @__PURE__ */ n(
|
|
3020
3020
|
"div",
|
|
3021
3021
|
{
|
|
3022
3022
|
onClick: r,
|
|
3023
3023
|
className: "flex flex-row w-full cursor-pointer",
|
|
3024
3024
|
children: [
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
|
|
3027
|
-
!
|
|
3025
|
+
/* @__PURE__ */ n("div", { className: "relative m-4", children: [
|
|
3026
|
+
s && /* @__PURE__ */ e(Ke, { fieldConfig: s }),
|
|
3027
|
+
!s && /* @__PURE__ */ e(
|
|
3028
3028
|
"div",
|
|
3029
3029
|
{
|
|
3030
3030
|
className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
|
|
3031
|
-
children: /* @__PURE__ */ e(
|
|
3031
|
+
children: /* @__PURE__ */ e(za, { color: "inherit", size: "medium" })
|
|
3032
3032
|
}
|
|
3033
3033
|
),
|
|
3034
|
-
/* @__PURE__ */ e(
|
|
3034
|
+
/* @__PURE__ */ e(Zt, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
3035
3035
|
] }),
|
|
3036
3036
|
/* @__PURE__ */ e(
|
|
3037
3037
|
Ce,
|
|
3038
3038
|
{
|
|
3039
3039
|
className: ve(
|
|
3040
3040
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
3041
|
-
|
|
3041
|
+
Gt,
|
|
3042
3042
|
r ? Ht : "",
|
|
3043
|
-
a ?
|
|
3043
|
+
a ? Qt : "",
|
|
3044
3044
|
"flex-grow p-4 border transition-colors duration-200",
|
|
3045
3045
|
a ? "border-blue-500" : "border-transparent"
|
|
3046
3046
|
),
|
|
3047
|
-
children: /* @__PURE__ */
|
|
3047
|
+
children: /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
|
|
3048
3048
|
/* @__PURE__ */ e(
|
|
3049
3049
|
N,
|
|
3050
3050
|
{
|
|
@@ -3054,18 +3054,18 @@ function ki({
|
|
|
3054
3054
|
children: i?.name ? i.name : t
|
|
3055
3055
|
}
|
|
3056
3056
|
),
|
|
3057
|
-
/* @__PURE__ */
|
|
3058
|
-
|
|
3057
|
+
/* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
|
|
3058
|
+
s && /* @__PURE__ */ e(
|
|
3059
3059
|
N,
|
|
3060
3060
|
{
|
|
3061
3061
|
className: "flex-grow pr-2",
|
|
3062
3062
|
variant: "body2",
|
|
3063
3063
|
component: "span",
|
|
3064
3064
|
color: "secondary",
|
|
3065
|
-
children:
|
|
3065
|
+
children: s?.name
|
|
3066
3066
|
}
|
|
3067
3067
|
),
|
|
3068
|
-
i && !
|
|
3068
|
+
i && !de(i) && /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(
|
|
3069
3069
|
N,
|
|
3070
3070
|
{
|
|
3071
3071
|
variant: "body2",
|
|
@@ -3074,7 +3074,7 @@ function ki({
|
|
|
3074
3074
|
children: i.dataType
|
|
3075
3075
|
}
|
|
3076
3076
|
) }),
|
|
3077
|
-
i &&
|
|
3077
|
+
i && de(i) && /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(
|
|
3078
3078
|
N,
|
|
3079
3079
|
{
|
|
3080
3080
|
variant: "body2",
|
|
@@ -3100,26 +3100,26 @@ function ki({
|
|
|
3100
3100
|
}
|
|
3101
3101
|
);
|
|
3102
3102
|
}
|
|
3103
|
-
function
|
|
3103
|
+
function pt({
|
|
3104
3104
|
namespace: t,
|
|
3105
3105
|
selectedPropertyKey: a,
|
|
3106
3106
|
onPropertyClick: r,
|
|
3107
3107
|
properties: i,
|
|
3108
|
-
propertiesOrder:
|
|
3109
|
-
additionalFields:
|
|
3110
|
-
errors:
|
|
3108
|
+
propertiesOrder: o,
|
|
3109
|
+
additionalFields: s,
|
|
3110
|
+
errors: p,
|
|
3111
3111
|
onPropertyMove: c,
|
|
3112
3112
|
onPropertyRemove: m,
|
|
3113
3113
|
className: u,
|
|
3114
|
-
inferredPropertyKeys:
|
|
3114
|
+
inferredPropertyKeys: d
|
|
3115
3115
|
}) {
|
|
3116
|
-
const l =
|
|
3116
|
+
const l = o ?? Object.keys(i), g = Z((b) => {
|
|
3117
3117
|
if (!b.destination)
|
|
3118
3118
|
return;
|
|
3119
3119
|
const f = b.source.index, k = b.destination.index, C = Array.from(l), [x] = C.splice(f, 1);
|
|
3120
3120
|
C.splice(k, 0, x), c && c(C, t);
|
|
3121
3121
|
}, [t, c, l]);
|
|
3122
|
-
return /* @__PURE__ */ e(
|
|
3122
|
+
return /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Xa, { onDragEnd: g, children: /* @__PURE__ */ e(Wa, { droppableId: `droppable_${t}`, children: (b, f) => /* @__PURE__ */ n(
|
|
3123
3123
|
"div",
|
|
3124
3124
|
{
|
|
3125
3125
|
...b.droppableProps,
|
|
@@ -3127,25 +3127,25 @@ function dt({
|
|
|
3127
3127
|
className: u,
|
|
3128
3128
|
children: [
|
|
3129
3129
|
l && l.map((k, C) => {
|
|
3130
|
-
const x = i[k], h =
|
|
3130
|
+
const x = i[k], h = s?.find((y) => y.id === k);
|
|
3131
3131
|
return !x && !h ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
3132
|
-
|
|
3132
|
+
ei,
|
|
3133
3133
|
{
|
|
3134
3134
|
draggableId: `array_field_${t}_${k}}`,
|
|
3135
3135
|
index: C,
|
|
3136
|
-
children: (y,
|
|
3137
|
-
|
|
3136
|
+
children: (y, w) => /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(
|
|
3137
|
+
ki,
|
|
3138
3138
|
{
|
|
3139
3139
|
propertyKey: k,
|
|
3140
3140
|
propertyOrBuilder: x,
|
|
3141
3141
|
additionalField: h,
|
|
3142
3142
|
provided: y,
|
|
3143
|
-
errors:
|
|
3143
|
+
errors: p,
|
|
3144
3144
|
namespace: t,
|
|
3145
|
-
inferredPropertyKeys:
|
|
3145
|
+
inferredPropertyKeys: d,
|
|
3146
3146
|
onPropertyMove: c,
|
|
3147
3147
|
onPropertyRemove: m,
|
|
3148
|
-
onPropertyClick:
|
|
3148
|
+
onPropertyClick: w.isDragging ? void 0 : r,
|
|
3149
3149
|
selectedPropertyKey: a
|
|
3150
3150
|
}
|
|
3151
3151
|
) })
|
|
@@ -3158,44 +3158,44 @@ function dt({
|
|
|
3158
3158
|
}
|
|
3159
3159
|
) }) }) });
|
|
3160
3160
|
}
|
|
3161
|
-
function
|
|
3161
|
+
function ki({
|
|
3162
3162
|
propertyKey: t,
|
|
3163
3163
|
namespace: a,
|
|
3164
3164
|
propertyOrBuilder: r,
|
|
3165
3165
|
additionalField: i,
|
|
3166
|
-
provided:
|
|
3167
|
-
selectedPropertyKey:
|
|
3168
|
-
errors:
|
|
3166
|
+
provided: o,
|
|
3167
|
+
selectedPropertyKey: s,
|
|
3168
|
+
errors: p,
|
|
3169
3169
|
onPropertyClick: c,
|
|
3170
3170
|
onPropertyMove: m,
|
|
3171
3171
|
onPropertyRemove: u,
|
|
3172
|
-
inferredPropertyKeys:
|
|
3172
|
+
inferredPropertyKeys: d
|
|
3173
3173
|
}) {
|
|
3174
|
-
const l =
|
|
3174
|
+
const l = d?.includes(a ? `${a}.${t}` : t), g = re(t, a);
|
|
3175
3175
|
let b;
|
|
3176
3176
|
if (typeof r == "object") {
|
|
3177
3177
|
const x = r;
|
|
3178
3178
|
x.dataType === "map" && x.properties && (b = /* @__PURE__ */ e(
|
|
3179
|
-
|
|
3179
|
+
pt,
|
|
3180
3180
|
{
|
|
3181
|
-
selectedPropertyKey:
|
|
3181
|
+
selectedPropertyKey: s,
|
|
3182
3182
|
namespace: g,
|
|
3183
3183
|
properties: x.properties,
|
|
3184
3184
|
propertiesOrder: x.propertiesOrder,
|
|
3185
|
-
errors:
|
|
3185
|
+
errors: p,
|
|
3186
3186
|
onPropertyClick: c,
|
|
3187
3187
|
onPropertyMove: m,
|
|
3188
3188
|
onPropertyRemove: u
|
|
3189
3189
|
}
|
|
3190
3190
|
));
|
|
3191
3191
|
}
|
|
3192
|
-
const f = g ?
|
|
3193
|
-
return /* @__PURE__ */
|
|
3192
|
+
const f = g ? S(p, ye(g)) : !1, k = s === g, C = r && Ue(r);
|
|
3193
|
+
return /* @__PURE__ */ n(
|
|
3194
3194
|
"div",
|
|
3195
3195
|
{
|
|
3196
|
-
ref:
|
|
3197
|
-
...
|
|
3198
|
-
...
|
|
3196
|
+
ref: o.innerRef,
|
|
3197
|
+
...o.draggableProps,
|
|
3198
|
+
...o.dragHandleProps,
|
|
3199
3199
|
className: "relative -ml-8",
|
|
3200
3200
|
children: [
|
|
3201
3201
|
b && /* @__PURE__ */ e(
|
|
@@ -3209,8 +3209,8 @@ function xi({
|
|
|
3209
3209
|
}
|
|
3210
3210
|
}
|
|
3211
3211
|
),
|
|
3212
|
-
!
|
|
3213
|
-
|
|
3212
|
+
!de(r) && !i && C ? /* @__PURE__ */ e(
|
|
3213
|
+
oa,
|
|
3214
3214
|
{
|
|
3215
3215
|
property: r,
|
|
3216
3216
|
onClick: c ? () => c(t, a) : void 0,
|
|
@@ -3219,7 +3219,7 @@ function xi({
|
|
|
3219
3219
|
hasError: f
|
|
3220
3220
|
}
|
|
3221
3221
|
) : /* @__PURE__ */ e(
|
|
3222
|
-
|
|
3222
|
+
_i,
|
|
3223
3223
|
{
|
|
3224
3224
|
name: t,
|
|
3225
3225
|
property: r,
|
|
@@ -3227,23 +3227,23 @@ function xi({
|
|
|
3227
3227
|
selected: k
|
|
3228
3228
|
}
|
|
3229
3229
|
),
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
l && /* @__PURE__ */ e(
|
|
3232
|
-
u && /* @__PURE__ */ e(
|
|
3230
|
+
/* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
3231
|
+
l && /* @__PURE__ */ e(se, { title: "Inferred property", children: /* @__PURE__ */ e(lt, { size: "small", className: "p-2" }) }),
|
|
3232
|
+
u && /* @__PURE__ */ e(se, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3233
3233
|
pe,
|
|
3234
3234
|
{
|
|
3235
3235
|
size: "small",
|
|
3236
3236
|
color: "inherit",
|
|
3237
3237
|
onClick: () => u(t, a),
|
|
3238
|
-
children: /* @__PURE__ */ e(
|
|
3238
|
+
children: /* @__PURE__ */ e(Ta, { size: "small" })
|
|
3239
3239
|
}
|
|
3240
3240
|
) }),
|
|
3241
|
-
m && /* @__PURE__ */ e(
|
|
3241
|
+
m && /* @__PURE__ */ e(se, { title: "Move", children: /* @__PURE__ */ e(
|
|
3242
3242
|
pe,
|
|
3243
3243
|
{
|
|
3244
3244
|
component: "span",
|
|
3245
3245
|
size: "small",
|
|
3246
|
-
children: /* @__PURE__ */ e(
|
|
3246
|
+
children: /* @__PURE__ */ e(Va, { size: "small" })
|
|
3247
3247
|
}
|
|
3248
3248
|
) })
|
|
3249
3249
|
] }),
|
|
@@ -3252,28 +3252,28 @@ function xi({
|
|
|
3252
3252
|
}
|
|
3253
3253
|
);
|
|
3254
3254
|
}
|
|
3255
|
-
function
|
|
3255
|
+
function xi({ disabled: t, getData: a, allowDataInference: r, customFields: i }) {
|
|
3256
3256
|
const {
|
|
3257
|
-
values:
|
|
3258
|
-
setFieldValue:
|
|
3259
|
-
} = U(), [
|
|
3260
|
-
id:
|
|
3261
|
-
property:
|
|
3257
|
+
values: o,
|
|
3258
|
+
setFieldValue: s
|
|
3259
|
+
} = U(), [p, c] = K(!1), [m, u] = K(), [d, l] = K(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = Z(({
|
|
3260
|
+
id: w,
|
|
3261
|
+
property: _
|
|
3262
3262
|
}) => {
|
|
3263
|
-
if (!
|
|
3263
|
+
if (!w)
|
|
3264
3264
|
throw Error();
|
|
3265
|
-
|
|
3266
|
-
...
|
|
3267
|
-
[
|
|
3268
|
-
}, !1),
|
|
3269
|
-
}, [
|
|
3270
|
-
const v =
|
|
3265
|
+
s("properties", {
|
|
3266
|
+
...o.properties ?? {},
|
|
3267
|
+
[w]: _
|
|
3268
|
+
}, !1), s("propertiesOrder", [...g, w], !1), c(!1);
|
|
3269
|
+
}, [o.properties, g]), f = Z((w, _) => {
|
|
3270
|
+
const v = w ? re(w, _) : void 0;
|
|
3271
3271
|
if (!v)
|
|
3272
3272
|
throw Error("collection editor miss config");
|
|
3273
|
-
const T = ye(v), P = xe(
|
|
3274
|
-
|
|
3275
|
-
}, [
|
|
3276
|
-
|
|
3273
|
+
const T = ye(v), P = xe(_), V = S(o, P) ?? Object.keys(S(o, ui(_)));
|
|
3274
|
+
s(T, void 0, !1), s(P, V.filter((O) => O !== w), !1), c(!1), u(void 0), l(void 0);
|
|
3275
|
+
}, [s, o]), k = m ? re(m, d) : void 0, C = k ? S(o.properties, k.replaceAll(".", ".properties.")) : void 0, x = /* @__PURE__ */ n(
|
|
3276
|
+
B,
|
|
3277
3277
|
{
|
|
3278
3278
|
color: "primary",
|
|
3279
3279
|
variant: "outlined",
|
|
@@ -3281,27 +3281,27 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3281
3281
|
startIcon: /* @__PURE__ */ e(Oe, {}),
|
|
3282
3282
|
children: [
|
|
3283
3283
|
"Add property to ",
|
|
3284
|
-
|
|
3284
|
+
o.name ?? "this group"
|
|
3285
3285
|
]
|
|
3286
3286
|
}
|
|
3287
|
-
), h = !g || g.length < 1, y = Z((
|
|
3288
|
-
|
|
3287
|
+
), h = !g || g.length < 1, y = Z((w, _) => {
|
|
3288
|
+
s(xe(_), w, !1);
|
|
3289
3289
|
}, []);
|
|
3290
|
-
return /* @__PURE__ */
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
/* @__PURE__ */
|
|
3290
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3291
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3292
|
+
/* @__PURE__ */ n("div", { className: "flex justify-between items-end my-4", children: [
|
|
3293
3293
|
/* @__PURE__ */ e(N, { variant: "subtitle2", children: "Properties in this group" }),
|
|
3294
3294
|
x
|
|
3295
3295
|
] }),
|
|
3296
|
-
/* @__PURE__ */
|
|
3296
|
+
/* @__PURE__ */ n(Ce, { className: "p-2 pl-8", children: [
|
|
3297
3297
|
/* @__PURE__ */ e(
|
|
3298
|
-
|
|
3298
|
+
pt,
|
|
3299
3299
|
{
|
|
3300
|
-
properties:
|
|
3300
|
+
properties: o.properties ?? {},
|
|
3301
3301
|
propertiesOrder: g,
|
|
3302
3302
|
errors: {},
|
|
3303
|
-
onPropertyClick: (
|
|
3304
|
-
u(
|
|
3303
|
+
onPropertyClick: (w, _) => {
|
|
3304
|
+
u(w), l(_), c(!0);
|
|
3305
3305
|
},
|
|
3306
3306
|
onPropertyMove: y
|
|
3307
3307
|
}
|
|
@@ -3316,15 +3316,15 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3316
3316
|
)
|
|
3317
3317
|
] })
|
|
3318
3318
|
] }),
|
|
3319
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3320
3320
|
/* @__PURE__ */ e(
|
|
3321
|
-
|
|
3321
|
+
Yt,
|
|
3322
3322
|
{
|
|
3323
3323
|
position: "start",
|
|
3324
3324
|
size: "small",
|
|
3325
3325
|
label: "Spread children as columns",
|
|
3326
|
-
onValueChange: (
|
|
3327
|
-
value:
|
|
3326
|
+
onValueChange: (w) => s("spreadChildren", w),
|
|
3327
|
+
value: o.spreadChildren ?? !1
|
|
3328
3328
|
}
|
|
3329
3329
|
),
|
|
3330
3330
|
/* @__PURE__ */ e(ee, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
|
|
@@ -3334,7 +3334,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3334
3334
|
{
|
|
3335
3335
|
inArray: !1,
|
|
3336
3336
|
forceShowErrors: !1,
|
|
3337
|
-
open:
|
|
3337
|
+
open: p,
|
|
3338
3338
|
allowDataInference: r,
|
|
3339
3339
|
onCancel: () => {
|
|
3340
3340
|
c(!1), u(void 0), l(void 0);
|
|
@@ -3345,7 +3345,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3345
3345
|
getData: a,
|
|
3346
3346
|
onDelete: f,
|
|
3347
3347
|
propertyKey: m,
|
|
3348
|
-
propertyNamespace:
|
|
3348
|
+
propertyNamespace: d,
|
|
3349
3349
|
property: C,
|
|
3350
3350
|
existing: !!m,
|
|
3351
3351
|
autoUpdateId: !m,
|
|
@@ -3357,25 +3357,25 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3357
3357
|
)
|
|
3358
3358
|
] });
|
|
3359
3359
|
}
|
|
3360
|
-
function
|
|
3360
|
+
function Ci({
|
|
3361
3361
|
showErrors: t,
|
|
3362
3362
|
existing: a,
|
|
3363
3363
|
disabled: r,
|
|
3364
3364
|
getData: i,
|
|
3365
|
-
allowDataInference:
|
|
3366
|
-
customFields:
|
|
3365
|
+
allowDataInference: o,
|
|
3366
|
+
customFields: s
|
|
3367
3367
|
}) {
|
|
3368
|
-
const { fields:
|
|
3368
|
+
const { fields: p } = Ae(), {
|
|
3369
3369
|
values: c,
|
|
3370
3370
|
handleChange: m,
|
|
3371
3371
|
errors: u,
|
|
3372
|
-
setFieldValue:
|
|
3372
|
+
setFieldValue: d,
|
|
3373
3373
|
touched: l
|
|
3374
|
-
} = U(), [g, b] =
|
|
3375
|
-
|
|
3376
|
-
}, []), x = f &&
|
|
3377
|
-
return /* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3374
|
+
} = U(), [g, b] = K(!1), f = S(c, "of"), k = S(l, "of") && S(u, "of"), C = Z(({ id: h, property: y, namespace: w }) => {
|
|
3375
|
+
d("of", y);
|
|
3376
|
+
}, []), x = f && dt(f, p);
|
|
3377
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3378
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3379
3379
|
/* @__PURE__ */ e(N, { variant: "subtitle2", children: "Repeat component" }),
|
|
3380
3380
|
/* @__PURE__ */ e(
|
|
3381
3381
|
me,
|
|
@@ -3383,9 +3383,9 @@ function Oi({
|
|
|
3383
3383
|
name: "of",
|
|
3384
3384
|
value: f,
|
|
3385
3385
|
validate: (h) => h?.dataType ? void 0 : "You need to specify a repeat field",
|
|
3386
|
-
children: () => /* @__PURE__ */
|
|
3386
|
+
children: () => /* @__PURE__ */ n(Ce, { className: "p-2 mt-4", children: [
|
|
3387
3387
|
f && /* @__PURE__ */ e(
|
|
3388
|
-
|
|
3388
|
+
oa,
|
|
3389
3389
|
{
|
|
3390
3390
|
property: f,
|
|
3391
3391
|
onClick: r ? void 0 : () => b(!0),
|
|
@@ -3395,8 +3395,8 @@ function Oi({
|
|
|
3395
3395
|
hasError: !1
|
|
3396
3396
|
}
|
|
3397
3397
|
),
|
|
3398
|
-
!r && !f && /* @__PURE__ */
|
|
3399
|
-
|
|
3398
|
+
!r && !f && /* @__PURE__ */ n(
|
|
3399
|
+
B,
|
|
3400
3400
|
{
|
|
3401
3401
|
variant: "text",
|
|
3402
3402
|
size: "large",
|
|
@@ -3418,60 +3418,60 @@ function Oi({
|
|
|
3418
3418
|
autoUpdateId: !a,
|
|
3419
3419
|
autoOpenTypeSelect: !a,
|
|
3420
3420
|
onOkClicked: () => b(!1),
|
|
3421
|
-
allowDataInference:
|
|
3421
|
+
allowDataInference: o,
|
|
3422
3422
|
property: f,
|
|
3423
3423
|
includeIdAndName: !1,
|
|
3424
3424
|
onPropertyChanged: C,
|
|
3425
3425
|
forceShowErrors: t,
|
|
3426
|
-
customFields:
|
|
3426
|
+
customFields: s
|
|
3427
3427
|
}
|
|
3428
3428
|
)
|
|
3429
3429
|
] })
|
|
3430
3430
|
}
|
|
3431
3431
|
)
|
|
3432
3432
|
] }),
|
|
3433
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3433
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(St, { disabled: r }) }) })
|
|
3434
3434
|
] });
|
|
3435
3435
|
}
|
|
3436
|
-
const
|
|
3436
|
+
const Oi = R.forwardRef(
|
|
3437
3437
|
function({
|
|
3438
3438
|
showErrors: a,
|
|
3439
3439
|
disabledId: r,
|
|
3440
3440
|
existingPropertyKeys: i,
|
|
3441
|
-
disabled:
|
|
3442
|
-
isNewProperty:
|
|
3443
|
-
},
|
|
3441
|
+
disabled: o,
|
|
3442
|
+
isNewProperty: s
|
|
3443
|
+
}, p) {
|
|
3444
3444
|
const {
|
|
3445
3445
|
errors: c
|
|
3446
|
-
} = U(), m = "name", u = a &&
|
|
3447
|
-
return /* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */
|
|
3446
|
+
} = U(), m = "name", u = a && S(c, m), d = "id", l = a && S(c, d), g = "description", b = a && S(c, g);
|
|
3447
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
3448
|
+
/* @__PURE__ */ n("div", { children: [
|
|
3449
3449
|
/* @__PURE__ */ e(
|
|
3450
3450
|
me,
|
|
3451
3451
|
{
|
|
3452
|
-
inputRef:
|
|
3452
|
+
inputRef: p,
|
|
3453
3453
|
name: m,
|
|
3454
|
-
as:
|
|
3455
|
-
invisible: !
|
|
3454
|
+
as: H,
|
|
3455
|
+
invisible: !s,
|
|
3456
3456
|
style: { fontSize: 20 },
|
|
3457
3457
|
validate: Si,
|
|
3458
3458
|
placeholder: "Field name",
|
|
3459
3459
|
required: !0,
|
|
3460
|
-
disabled:
|
|
3460
|
+
disabled: o,
|
|
3461
3461
|
error: !!u
|
|
3462
3462
|
}
|
|
3463
3463
|
),
|
|
3464
3464
|
/* @__PURE__ */ e(ee, { error: !!u, children: u })
|
|
3465
3465
|
] }),
|
|
3466
|
-
/* @__PURE__ */
|
|
3466
|
+
/* @__PURE__ */ n("div", { children: [
|
|
3467
3467
|
/* @__PURE__ */ e(
|
|
3468
3468
|
me,
|
|
3469
3469
|
{
|
|
3470
|
-
name:
|
|
3471
|
-
as:
|
|
3470
|
+
name: d,
|
|
3471
|
+
as: Se,
|
|
3472
3472
|
label: "ID",
|
|
3473
|
-
validate: (f) =>
|
|
3474
|
-
disabled: r ||
|
|
3473
|
+
validate: (f) => Pi(f, i),
|
|
3474
|
+
disabled: r || o,
|
|
3475
3475
|
required: !0,
|
|
3476
3476
|
size: "small",
|
|
3477
3477
|
error: !!l
|
|
@@ -3479,14 +3479,14 @@ const Ni = R.forwardRef(
|
|
|
3479
3479
|
),
|
|
3480
3480
|
/* @__PURE__ */ e(ee, { error: !!l, children: l })
|
|
3481
3481
|
] }),
|
|
3482
|
-
/* @__PURE__ */
|
|
3482
|
+
/* @__PURE__ */ n("div", { children: [
|
|
3483
3483
|
/* @__PURE__ */ e(
|
|
3484
3484
|
me,
|
|
3485
3485
|
{
|
|
3486
3486
|
name: g,
|
|
3487
|
-
as:
|
|
3487
|
+
as: H,
|
|
3488
3488
|
label: "Description",
|
|
3489
|
-
disabled:
|
|
3489
|
+
disabled: o,
|
|
3490
3490
|
error: !!b
|
|
3491
3491
|
}
|
|
3492
3492
|
),
|
|
@@ -3494,23 +3494,23 @@ const Ni = R.forwardRef(
|
|
|
3494
3494
|
] })
|
|
3495
3495
|
] });
|
|
3496
3496
|
}
|
|
3497
|
-
),
|
|
3498
|
-
function
|
|
3497
|
+
), Ni = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
3498
|
+
function Pi(t, a) {
|
|
3499
3499
|
let r;
|
|
3500
|
-
return t || (r = "You must specify an id for the field"), t && !t.match(
|
|
3500
|
+
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;
|
|
3501
3501
|
}
|
|
3502
3502
|
function Si(t) {
|
|
3503
3503
|
let a;
|
|
3504
3504
|
return t || (a = "You must specify a title for the field"), a;
|
|
3505
3505
|
}
|
|
3506
|
-
function
|
|
3506
|
+
function qi({
|
|
3507
3507
|
widgetId: t,
|
|
3508
3508
|
disabled: a,
|
|
3509
3509
|
showErrors: r
|
|
3510
3510
|
}) {
|
|
3511
|
-
const { values: i, setFieldValue:
|
|
3512
|
-
return /* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */
|
|
3511
|
+
const { values: i, setFieldValue: o } = U();
|
|
3512
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3513
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ne, { children: [
|
|
3514
3514
|
t === "text_field" && /* @__PURE__ */ e(
|
|
3515
3515
|
je,
|
|
3516
3516
|
{
|
|
@@ -3573,22 +3573,22 @@ function Ai({
|
|
|
3573
3573
|
)
|
|
3574
3574
|
] }) }),
|
|
3575
3575
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3576
|
-
|
|
3576
|
+
Se,
|
|
3577
3577
|
{
|
|
3578
3578
|
name: "defaultValue",
|
|
3579
3579
|
disabled: a,
|
|
3580
|
-
onChange: (
|
|
3581
|
-
|
|
3580
|
+
onChange: (s) => {
|
|
3581
|
+
o("defaultValue", s.target.value === "" ? void 0 : s.target.value);
|
|
3582
3582
|
},
|
|
3583
3583
|
label: "Default value",
|
|
3584
|
-
value:
|
|
3584
|
+
value: S(i, "defaultValue") ?? ""
|
|
3585
3585
|
}
|
|
3586
3586
|
) })
|
|
3587
3587
|
] });
|
|
3588
3588
|
}
|
|
3589
|
-
function
|
|
3590
|
-
const { values: a } = U(), r =
|
|
3591
|
-
return /* @__PURE__ */
|
|
3589
|
+
function Ai({ disabled: t }) {
|
|
3590
|
+
const { values: a } = U(), r = S(a, "defaultValue");
|
|
3591
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3592
3592
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(ze, { disabled: t }) }) }),
|
|
3593
3593
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3594
3594
|
oe,
|
|
@@ -3598,34 +3598,34 @@ function zi({ disabled: t }) {
|
|
|
3598
3598
|
label: r == null ? "Default value not set" : "Default value is " + r.toString(),
|
|
3599
3599
|
disabled: t,
|
|
3600
3600
|
allowIndeterminate: !0,
|
|
3601
|
-
component:
|
|
3601
|
+
component: ce
|
|
3602
3602
|
}
|
|
3603
3603
|
) })
|
|
3604
3604
|
] });
|
|
3605
3605
|
}
|
|
3606
|
-
function
|
|
3606
|
+
function zi({ disabled: t, getData: a, allowDataInference: r, customFields: i }) {
|
|
3607
3607
|
const {
|
|
3608
|
-
values:
|
|
3609
|
-
setFieldValue:
|
|
3610
|
-
} = U(), [
|
|
3608
|
+
values: o,
|
|
3609
|
+
setFieldValue: s
|
|
3610
|
+
} = U(), [p, c] = K(!1), [m, u] = K(), [d, l] = K(), g = Z(({
|
|
3611
3611
|
id: h,
|
|
3612
3612
|
property: y
|
|
3613
3613
|
}) => {
|
|
3614
3614
|
if (!h)
|
|
3615
3615
|
throw Error();
|
|
3616
|
-
|
|
3617
|
-
...
|
|
3616
|
+
s("oneOf.properties", {
|
|
3617
|
+
...o.oneOf?.properties ?? {},
|
|
3618
3618
|
[h]: y
|
|
3619
|
-
}, !1),
|
|
3620
|
-
}, [
|
|
3621
|
-
const
|
|
3622
|
-
if (!
|
|
3619
|
+
}, !1), s("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), h], !1), c(!1);
|
|
3620
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = m ? re(m, d) : void 0, f = b ? S(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, k = Z((h, y) => {
|
|
3621
|
+
const w = h ? re(h, y) : void 0;
|
|
3622
|
+
if (!w)
|
|
3623
3623
|
throw Error("collection editor miss config");
|
|
3624
|
-
|
|
3625
|
-
const
|
|
3626
|
-
|
|
3627
|
-
}, [
|
|
3628
|
-
|
|
3624
|
+
s(`oneOf.${ye(w)}`, void 0, !1);
|
|
3625
|
+
const _ = `oneOf.${xe(y)}`, v = S(o, _);
|
|
3626
|
+
s(_, v.filter((T) => T !== h), !1), c(!1), u(void 0), l(void 0);
|
|
3627
|
+
}, [s, o]), C = /* @__PURE__ */ n(
|
|
3628
|
+
B,
|
|
3629
3629
|
{
|
|
3630
3630
|
autoFocus: !0,
|
|
3631
3631
|
color: "primary",
|
|
@@ -3633,24 +3633,24 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3633
3633
|
startIcon: /* @__PURE__ */ e(Oe, {}),
|
|
3634
3634
|
children: [
|
|
3635
3635
|
"Add property to ",
|
|
3636
|
-
|
|
3636
|
+
o.name ?? "this block"
|
|
3637
3637
|
]
|
|
3638
3638
|
}
|
|
3639
3639
|
), x = Z((h, y) => {
|
|
3640
|
-
|
|
3640
|
+
s(`oneOf.${xe(y)}`, h, !1);
|
|
3641
3641
|
}, []);
|
|
3642
|
-
return /* @__PURE__ */
|
|
3643
|
-
/* @__PURE__ */
|
|
3644
|
-
/* @__PURE__ */
|
|
3642
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3643
|
+
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3644
|
+
/* @__PURE__ */ n("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
|
|
3645
3645
|
/* @__PURE__ */ e(N, { variant: "subtitle2", children: "Properties in this block" }),
|
|
3646
3646
|
C
|
|
3647
3647
|
] }),
|
|
3648
|
-
/* @__PURE__ */
|
|
3648
|
+
/* @__PURE__ */ n(Ce, { className: "p-2 pl-8", children: [
|
|
3649
3649
|
/* @__PURE__ */ e(
|
|
3650
|
-
|
|
3650
|
+
pt,
|
|
3651
3651
|
{
|
|
3652
|
-
properties:
|
|
3653
|
-
propertiesOrder:
|
|
3652
|
+
properties: o.oneOf?.properties ?? {},
|
|
3653
|
+
propertiesOrder: o.oneOf?.propertiesOrder,
|
|
3654
3654
|
errors: {},
|
|
3655
3655
|
onPropertyClick: t ? void 0 : (h, y) => {
|
|
3656
3656
|
u(h), l(y), c(!0);
|
|
@@ -3658,7 +3658,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3658
3658
|
onPropertyMove: t ? void 0 : x
|
|
3659
3659
|
}
|
|
3660
3660
|
),
|
|
3661
|
-
!t && !
|
|
3661
|
+
!t && !o.oneOf?.propertiesOrder?.length && /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center p-4", children: "Add the first property to this block" })
|
|
3662
3662
|
] })
|
|
3663
3663
|
] }),
|
|
3664
3664
|
!t && /* @__PURE__ */ e(
|
|
@@ -3666,7 +3666,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3666
3666
|
{
|
|
3667
3667
|
inArray: !1,
|
|
3668
3668
|
forceShowErrors: !1,
|
|
3669
|
-
open:
|
|
3669
|
+
open: p,
|
|
3670
3670
|
getData: a,
|
|
3671
3671
|
allowDataInference: r,
|
|
3672
3672
|
onCancel: () => {
|
|
@@ -3677,29 +3677,29 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i })
|
|
|
3677
3677
|
},
|
|
3678
3678
|
onDelete: k,
|
|
3679
3679
|
propertyKey: m,
|
|
3680
|
-
propertyNamespace:
|
|
3680
|
+
propertyNamespace: d,
|
|
3681
3681
|
property: f,
|
|
3682
3682
|
existing: !!m,
|
|
3683
3683
|
autoUpdateId: !m,
|
|
3684
3684
|
autoOpenTypeSelect: !m,
|
|
3685
3685
|
onPropertyChanged: g,
|
|
3686
|
-
existingPropertyKeys: m ? void 0 :
|
|
3686
|
+
existingPropertyKeys: m ? void 0 : o.oneOf?.propertiesOrder,
|
|
3687
3687
|
customFields: i
|
|
3688
3688
|
}
|
|
3689
3689
|
)
|
|
3690
3690
|
] });
|
|
3691
3691
|
}
|
|
3692
|
-
function
|
|
3692
|
+
function Ti({ disabled: t }) {
|
|
3693
3693
|
const {
|
|
3694
3694
|
values: a,
|
|
3695
3695
|
handleChange: r
|
|
3696
|
-
} = U(), i = "validation.min",
|
|
3697
|
-
return /* @__PURE__ */
|
|
3696
|
+
} = U(), i = "validation.min", o = "validation.max", s = "validation.lessThan", p = "validation.moreThan", c = "validation.positive", m = "validation.negative", u = "validation.integer";
|
|
3697
|
+
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
3698
3698
|
/* @__PURE__ */ e(ze, { disabled: t }),
|
|
3699
3699
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3700
|
-
|
|
3700
|
+
H,
|
|
3701
3701
|
{
|
|
3702
|
-
value:
|
|
3702
|
+
value: S(a, i),
|
|
3703
3703
|
label: "Min value",
|
|
3704
3704
|
name: i,
|
|
3705
3705
|
type: "number",
|
|
@@ -3709,11 +3709,11 @@ function Vi({ disabled: t }) {
|
|
|
3709
3709
|
}
|
|
3710
3710
|
) }),
|
|
3711
3711
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3712
|
-
|
|
3712
|
+
H,
|
|
3713
3713
|
{
|
|
3714
|
-
value:
|
|
3714
|
+
value: S(a, o),
|
|
3715
3715
|
label: "Max value",
|
|
3716
|
-
name:
|
|
3716
|
+
name: o,
|
|
3717
3717
|
type: "number",
|
|
3718
3718
|
size: "small",
|
|
3719
3719
|
disabled: t,
|
|
@@ -3721,11 +3721,11 @@ function Vi({ disabled: t }) {
|
|
|
3721
3721
|
}
|
|
3722
3722
|
) }),
|
|
3723
3723
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3724
|
-
|
|
3724
|
+
H,
|
|
3725
3725
|
{
|
|
3726
|
-
value:
|
|
3726
|
+
value: S(a, s),
|
|
3727
3727
|
label: "Less than",
|
|
3728
|
-
name:
|
|
3728
|
+
name: s,
|
|
3729
3729
|
type: "number",
|
|
3730
3730
|
size: "small",
|
|
3731
3731
|
disabled: t,
|
|
@@ -3733,11 +3733,11 @@ function Vi({ disabled: t }) {
|
|
|
3733
3733
|
}
|
|
3734
3734
|
) }),
|
|
3735
3735
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3736
|
-
|
|
3736
|
+
H,
|
|
3737
3737
|
{
|
|
3738
|
-
value:
|
|
3738
|
+
value: S(a, p),
|
|
3739
3739
|
label: "More than",
|
|
3740
|
-
name:
|
|
3740
|
+
name: p,
|
|
3741
3741
|
type: "number",
|
|
3742
3742
|
size: "small",
|
|
3743
3743
|
disabled: t,
|
|
@@ -3751,7 +3751,7 @@ function Vi({ disabled: t }) {
|
|
|
3751
3751
|
name: c,
|
|
3752
3752
|
label: "Positive value",
|
|
3753
3753
|
disabled: t,
|
|
3754
|
-
component:
|
|
3754
|
+
component: ce
|
|
3755
3755
|
}
|
|
3756
3756
|
) }),
|
|
3757
3757
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
@@ -3761,7 +3761,7 @@ function Vi({ disabled: t }) {
|
|
|
3761
3761
|
name: m,
|
|
3762
3762
|
label: "Negative value",
|
|
3763
3763
|
disabled: t,
|
|
3764
|
-
component:
|
|
3764
|
+
component: ce
|
|
3765
3765
|
}
|
|
3766
3766
|
) }),
|
|
3767
3767
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
@@ -3771,17 +3771,17 @@ function Vi({ disabled: t }) {
|
|
|
3771
3771
|
name: u,
|
|
3772
3772
|
label: "Integer value",
|
|
3773
3773
|
disabled: t,
|
|
3774
|
-
component:
|
|
3774
|
+
component: ce
|
|
3775
3775
|
}
|
|
3776
3776
|
) })
|
|
3777
3777
|
] });
|
|
3778
3778
|
}
|
|
3779
|
-
function
|
|
3779
|
+
function Vi({ disabled: t }) {
|
|
3780
3780
|
const { values: a, setFieldValue: r } = U();
|
|
3781
|
-
return /* @__PURE__ */
|
|
3782
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3781
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3782
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(Ti, { disabled: t }) }) }),
|
|
3783
3783
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3784
|
-
|
|
3784
|
+
Se,
|
|
3785
3785
|
{
|
|
3786
3786
|
name: "defaultValue",
|
|
3787
3787
|
disabled: t,
|
|
@@ -3790,80 +3790,80 @@ function ji({ disabled: t }) {
|
|
|
3790
3790
|
r("defaultValue", i.target.value === "" ? void 0 : parseFloat(i.target.value));
|
|
3791
3791
|
},
|
|
3792
3792
|
label: "Default value",
|
|
3793
|
-
value:
|
|
3793
|
+
value: S(a, "defaultValue") ?? ""
|
|
3794
3794
|
}
|
|
3795
3795
|
) })
|
|
3796
3796
|
] });
|
|
3797
3797
|
}
|
|
3798
|
-
function
|
|
3798
|
+
function It({
|
|
3799
3799
|
existing: t,
|
|
3800
3800
|
multiple: a,
|
|
3801
3801
|
disabled: r,
|
|
3802
3802
|
showErrors: i
|
|
3803
3803
|
}) {
|
|
3804
3804
|
const {
|
|
3805
|
-
values:
|
|
3806
|
-
handleChange:
|
|
3807
|
-
errors:
|
|
3805
|
+
values: o,
|
|
3806
|
+
handleChange: s,
|
|
3807
|
+
errors: p,
|
|
3808
3808
|
touched: c,
|
|
3809
3809
|
setFieldError: m,
|
|
3810
3810
|
setFieldValue: u
|
|
3811
3811
|
} = U();
|
|
3812
3812
|
if (!Ie())
|
|
3813
3813
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($e, {}) });
|
|
3814
|
-
const l = a ? "of.path" : "path", g =
|
|
3815
|
-
return console.log("pathError",
|
|
3814
|
+
const l = a ? "of.path" : "path", g = S(o, l), b = i && S(p, l);
|
|
3815
|
+
return console.log("pathError", p, b), /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3816
3816
|
me,
|
|
3817
3817
|
{
|
|
3818
3818
|
required: !0,
|
|
3819
3819
|
name: l,
|
|
3820
3820
|
pathPath: l,
|
|
3821
3821
|
type: "select",
|
|
3822
|
-
validate:
|
|
3822
|
+
validate: ji,
|
|
3823
3823
|
disabled: t || r,
|
|
3824
3824
|
value: g,
|
|
3825
3825
|
error: b,
|
|
3826
|
-
handleChange:
|
|
3827
|
-
component:
|
|
3826
|
+
handleChange: s,
|
|
3827
|
+
component: Fi
|
|
3828
3828
|
}
|
|
3829
3829
|
) }) });
|
|
3830
3830
|
}
|
|
3831
|
-
function
|
|
3831
|
+
function ji(t) {
|
|
3832
3832
|
let a;
|
|
3833
3833
|
return t || (a = "You must specify a target collection for the field"), a;
|
|
3834
3834
|
}
|
|
3835
|
-
function
|
|
3835
|
+
function Fi({
|
|
3836
3836
|
disabled: t,
|
|
3837
3837
|
pathPath: a,
|
|
3838
3838
|
value: r,
|
|
3839
3839
|
handleChange: i,
|
|
3840
|
-
error:
|
|
3841
|
-
...
|
|
3840
|
+
error: o,
|
|
3841
|
+
...s
|
|
3842
3842
|
}) {
|
|
3843
|
-
console.log("error",
|
|
3844
|
-
const
|
|
3845
|
-
if (!
|
|
3843
|
+
console.log("error", o);
|
|
3844
|
+
const p = Ie();
|
|
3845
|
+
if (!p)
|
|
3846
3846
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($e, {}) });
|
|
3847
|
-
const c =
|
|
3848
|
-
Object.values(c).map((
|
|
3849
|
-
).values()), u = c.filter((
|
|
3850
|
-
return /* @__PURE__ */
|
|
3851
|
-
/* @__PURE__ */
|
|
3852
|
-
|
|
3847
|
+
const c = p?.collections ?? [], m = Array.from(new Set(
|
|
3848
|
+
Object.values(c).map((d) => d.group).filter(Boolean)
|
|
3849
|
+
).values()), u = c.filter((d) => !d.group);
|
|
3850
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3851
|
+
/* @__PURE__ */ n(
|
|
3852
|
+
qe,
|
|
3853
3853
|
{
|
|
3854
|
-
error: !!
|
|
3854
|
+
error: !!o,
|
|
3855
3855
|
disabled: t,
|
|
3856
3856
|
value: r ?? "",
|
|
3857
3857
|
position: "item-aligned",
|
|
3858
3858
|
name: a,
|
|
3859
3859
|
onChange: i,
|
|
3860
3860
|
label: "Target collection",
|
|
3861
|
-
renderValue: (
|
|
3862
|
-
const l = c.find((b) => b.alias ===
|
|
3861
|
+
renderValue: (d) => {
|
|
3862
|
+
const l = c.find((b) => b.alias === d || b.path === d);
|
|
3863
3863
|
if (!l)
|
|
3864
3864
|
return null;
|
|
3865
|
-
const g =
|
|
3866
|
-
return /* @__PURE__ */
|
|
3865
|
+
const g = tt(l);
|
|
3866
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3867
3867
|
g,
|
|
3868
3868
|
/* @__PURE__ */ e(
|
|
3869
3869
|
N,
|
|
@@ -3875,19 +3875,19 @@ function Ei({
|
|
|
3875
3875
|
)
|
|
3876
3876
|
] });
|
|
3877
3877
|
},
|
|
3878
|
-
...
|
|
3878
|
+
...s,
|
|
3879
3879
|
children: [
|
|
3880
|
-
m.flatMap((
|
|
3881
|
-
|
|
3880
|
+
m.flatMap((d) => /* @__PURE__ */ e(
|
|
3881
|
+
zt,
|
|
3882
3882
|
{
|
|
3883
|
-
label:
|
|
3884
|
-
children: c.filter((l) => l.group ===
|
|
3885
|
-
const g =
|
|
3883
|
+
label: d || "Views",
|
|
3884
|
+
children: c.filter((l) => l.group === d).map((l) => {
|
|
3885
|
+
const g = tt(l);
|
|
3886
3886
|
return /* @__PURE__ */ e(
|
|
3887
3887
|
fe,
|
|
3888
3888
|
{
|
|
3889
3889
|
value: l.alias ?? l.path,
|
|
3890
|
-
children: /* @__PURE__ */
|
|
3890
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3891
3891
|
g,
|
|
3892
3892
|
/* @__PURE__ */ e(
|
|
3893
3893
|
N,
|
|
@@ -3899,31 +3899,31 @@ function Ei({
|
|
|
3899
3899
|
)
|
|
3900
3900
|
] })
|
|
3901
3901
|
},
|
|
3902
|
-
`${l.alias ?? l.path}-${
|
|
3902
|
+
`${l.alias ?? l.path}-${d}`
|
|
3903
3903
|
);
|
|
3904
3904
|
})
|
|
3905
3905
|
},
|
|
3906
|
-
`group_${
|
|
3906
|
+
`group_${d}`
|
|
3907
3907
|
)),
|
|
3908
|
-
u && /* @__PURE__ */ e(
|
|
3909
|
-
const l =
|
|
3908
|
+
u && /* @__PURE__ */ e(zt, { label: "Views", children: u.map((d) => {
|
|
3909
|
+
const l = tt(d);
|
|
3910
3910
|
return /* @__PURE__ */ e(
|
|
3911
3911
|
fe,
|
|
3912
3912
|
{
|
|
3913
|
-
value:
|
|
3914
|
-
children: /* @__PURE__ */
|
|
3913
|
+
value: d.alias ?? d.path,
|
|
3914
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3915
3915
|
l,
|
|
3916
3916
|
/* @__PURE__ */ e(
|
|
3917
3917
|
N,
|
|
3918
3918
|
{
|
|
3919
3919
|
variant: "subtitle2",
|
|
3920
3920
|
className: "font-medium ml-4",
|
|
3921
|
-
children:
|
|
3921
|
+
children: d?.name.toUpperCase()
|
|
3922
3922
|
}
|
|
3923
3923
|
)
|
|
3924
3924
|
] })
|
|
3925
3925
|
},
|
|
3926
|
-
|
|
3926
|
+
d.alias ?? d.path
|
|
3927
3927
|
);
|
|
3928
3928
|
}) })
|
|
3929
3929
|
]
|
|
@@ -3932,22 +3932,22 @@ function Ei({
|
|
|
3932
3932
|
/* @__PURE__ */ e(ee, { children: "You can only edit the reference collection upon field creation." })
|
|
3933
3933
|
] });
|
|
3934
3934
|
}
|
|
3935
|
-
function
|
|
3935
|
+
function Ei({ disabled: t }) {
|
|
3936
3936
|
const {
|
|
3937
3937
|
values: a,
|
|
3938
3938
|
errors: r,
|
|
3939
3939
|
touched: i,
|
|
3940
|
-
setFieldValue:
|
|
3941
|
-
} = U(),
|
|
3942
|
-
return /* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
3945
|
-
|
|
3940
|
+
setFieldValue: o
|
|
3941
|
+
} = U(), s = "mode", p = S(a, s), c = S(i, s) && S(r, s), m = "autoValue", u = S(a, m), d = S(i, m) && S(r, m);
|
|
3942
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
3943
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
|
|
3944
|
+
/* @__PURE__ */ n(
|
|
3945
|
+
qe,
|
|
3946
3946
|
{
|
|
3947
|
-
name:
|
|
3948
|
-
value:
|
|
3947
|
+
name: s,
|
|
3948
|
+
value: p ?? "date",
|
|
3949
3949
|
error: !!c,
|
|
3950
|
-
onValueChange: (l) => s
|
|
3950
|
+
onValueChange: (l) => o(s, l),
|
|
3951
3951
|
label: "Mode",
|
|
3952
3952
|
renderValue: (l) => {
|
|
3953
3953
|
switch (l) {
|
|
@@ -3967,13 +3967,13 @@ function Ii({ disabled: t }) {
|
|
|
3967
3967
|
}
|
|
3968
3968
|
),
|
|
3969
3969
|
/* @__PURE__ */ e(ee, { error: !!c, children: c }),
|
|
3970
|
-
/* @__PURE__ */
|
|
3971
|
-
|
|
3970
|
+
/* @__PURE__ */ n(
|
|
3971
|
+
qe,
|
|
3972
3972
|
{
|
|
3973
3973
|
name: m,
|
|
3974
3974
|
disabled: t,
|
|
3975
3975
|
value: u ?? "",
|
|
3976
|
-
onValueChange: (l) =>
|
|
3976
|
+
onValueChange: (l) => o(m, l),
|
|
3977
3977
|
renderValue: (l) => {
|
|
3978
3978
|
switch (l) {
|
|
3979
3979
|
case "on_create":
|
|
@@ -3984,7 +3984,7 @@ function Ii({ disabled: t }) {
|
|
|
3984
3984
|
return "None";
|
|
3985
3985
|
}
|
|
3986
3986
|
},
|
|
3987
|
-
error: !!
|
|
3987
|
+
error: !!d,
|
|
3988
3988
|
label: "Automatic value",
|
|
3989
3989
|
children: [
|
|
3990
3990
|
/* @__PURE__ */ e(fe, { value: "", children: " None " }),
|
|
@@ -3993,13 +3993,13 @@ function Ii({ disabled: t }) {
|
|
|
3993
3993
|
]
|
|
3994
3994
|
}
|
|
3995
3995
|
),
|
|
3996
|
-
/* @__PURE__ */ e(ee, { error: !!
|
|
3996
|
+
/* @__PURE__ */ e(ee, { error: !!d, children: d ?? "Update this field automatically when creating or updating the entity" })
|
|
3997
3997
|
] }),
|
|
3998
3998
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(ze, { disabled: t }) }) })
|
|
3999
3999
|
] });
|
|
4000
4000
|
}
|
|
4001
|
-
function
|
|
4002
|
-
return U(), /* @__PURE__ */
|
|
4001
|
+
function Ii({ disabled: t }) {
|
|
4002
|
+
return U(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
4003
4003
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4004
4004
|
oe,
|
|
4005
4005
|
{
|
|
@@ -4008,7 +4008,7 @@ function Bi({ disabled: t }) {
|
|
|
4008
4008
|
label: "Hide from collection",
|
|
4009
4009
|
disabled: t,
|
|
4010
4010
|
tooltip: "Hide this field from the collection view. It will still be visible in the form view",
|
|
4011
|
-
component:
|
|
4011
|
+
component: ce
|
|
4012
4012
|
}
|
|
4013
4013
|
) }),
|
|
4014
4014
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
@@ -4019,19 +4019,19 @@ function Bi({ disabled: t }) {
|
|
|
4019
4019
|
label: "Read only",
|
|
4020
4020
|
disabled: t,
|
|
4021
4021
|
tooltip: "Is this a read only field. Display only as a preview",
|
|
4022
|
-
component:
|
|
4022
|
+
component: ce
|
|
4023
4023
|
}
|
|
4024
4024
|
) })
|
|
4025
4025
|
] });
|
|
4026
4026
|
}
|
|
4027
|
-
function
|
|
4028
|
-
return /* @__PURE__ */ e(
|
|
4027
|
+
function Bi({ disabled: t }) {
|
|
4028
|
+
return /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(ze, { disabled: t }) }) }) });
|
|
4029
4029
|
}
|
|
4030
|
-
function
|
|
4030
|
+
function na(t, a, r) {
|
|
4031
4031
|
let i;
|
|
4032
4032
|
return a === "text_field" ? i = L(
|
|
4033
4033
|
t,
|
|
4034
|
-
|
|
4034
|
+
Y({
|
|
4035
4035
|
dataType: "string",
|
|
4036
4036
|
fieldConfig: "text_field",
|
|
4037
4037
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4044,7 +4044,7 @@ function ia(t, a, r) {
|
|
|
4044
4044
|
})
|
|
4045
4045
|
) : a === "multiline" ? i = L(
|
|
4046
4046
|
t,
|
|
4047
|
-
|
|
4047
|
+
Y({
|
|
4048
4048
|
dataType: "string",
|
|
4049
4049
|
fieldConfig: "multiline",
|
|
4050
4050
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4057,7 +4057,7 @@ function ia(t, a, r) {
|
|
|
4057
4057
|
})
|
|
4058
4058
|
) : a === "markdown" ? i = L(
|
|
4059
4059
|
t,
|
|
4060
|
-
|
|
4060
|
+
Y({
|
|
4061
4061
|
dataType: "string",
|
|
4062
4062
|
fieldConfig: "markdown",
|
|
4063
4063
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4069,7 +4069,7 @@ function ia(t, a, r) {
|
|
|
4069
4069
|
})
|
|
4070
4070
|
) : a === "url" ? i = L(
|
|
4071
4071
|
t,
|
|
4072
|
-
|
|
4072
|
+
Y({
|
|
4073
4073
|
dataType: "string",
|
|
4074
4074
|
fieldConfig: "url",
|
|
4075
4075
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4082,7 +4082,7 @@ function ia(t, a, r) {
|
|
|
4082
4082
|
})
|
|
4083
4083
|
) : a === "email" ? i = L(
|
|
4084
4084
|
t,
|
|
4085
|
-
|
|
4085
|
+
Y({
|
|
4086
4086
|
dataType: "string",
|
|
4087
4087
|
fieldConfig: "email",
|
|
4088
4088
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4095,7 +4095,7 @@ function ia(t, a, r) {
|
|
|
4095
4095
|
})
|
|
4096
4096
|
) : a === "select" ? i = L(
|
|
4097
4097
|
t,
|
|
4098
|
-
|
|
4098
|
+
Y({
|
|
4099
4099
|
dataType: "string",
|
|
4100
4100
|
fieldConfig: "select",
|
|
4101
4101
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4108,7 +4108,7 @@ function ia(t, a, r) {
|
|
|
4108
4108
|
})
|
|
4109
4109
|
) : a === "multi_select" ? i = L(
|
|
4110
4110
|
t,
|
|
4111
|
-
|
|
4111
|
+
Y({
|
|
4112
4112
|
dataType: "array",
|
|
4113
4113
|
fieldConfig: "multi_select",
|
|
4114
4114
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4119,7 +4119,7 @@ function ia(t, a, r) {
|
|
|
4119
4119
|
})
|
|
4120
4120
|
) : a === "number_input" ? i = L(
|
|
4121
4121
|
t,
|
|
4122
|
-
|
|
4122
|
+
Y({
|
|
4123
4123
|
dataType: "number",
|
|
4124
4124
|
fieldConfig: "number_input",
|
|
4125
4125
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4127,7 +4127,7 @@ function ia(t, a, r) {
|
|
|
4127
4127
|
})
|
|
4128
4128
|
) : a === "number_select" ? i = L(
|
|
4129
4129
|
t,
|
|
4130
|
-
|
|
4130
|
+
Y({
|
|
4131
4131
|
dataType: "number",
|
|
4132
4132
|
fieldConfig: "number_select",
|
|
4133
4133
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4135,7 +4135,7 @@ function ia(t, a, r) {
|
|
|
4135
4135
|
})
|
|
4136
4136
|
) : a === "multi_number_select" ? i = L(
|
|
4137
4137
|
t,
|
|
4138
|
-
|
|
4138
|
+
Y({
|
|
4139
4139
|
dataType: "array",
|
|
4140
4140
|
fieldConfig: "multi_number_select",
|
|
4141
4141
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4146,7 +4146,7 @@ function ia(t, a, r) {
|
|
|
4146
4146
|
})
|
|
4147
4147
|
) : a === "file_upload" ? i = L(
|
|
4148
4148
|
t,
|
|
4149
|
-
|
|
4149
|
+
Y({
|
|
4150
4150
|
dataType: "string",
|
|
4151
4151
|
fieldConfig: "file_upload",
|
|
4152
4152
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4156,7 +4156,7 @@ function ia(t, a, r) {
|
|
|
4156
4156
|
})
|
|
4157
4157
|
) : a === "multi_file_upload" ? i = L(
|
|
4158
4158
|
t,
|
|
4159
|
-
|
|
4159
|
+
Y({
|
|
4160
4160
|
dataType: "array",
|
|
4161
4161
|
fieldConfig: "multi_file_upload",
|
|
4162
4162
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4169,7 +4169,7 @@ function ia(t, a, r) {
|
|
|
4169
4169
|
})
|
|
4170
4170
|
) : a === "group" ? i = L(
|
|
4171
4171
|
t,
|
|
4172
|
-
|
|
4172
|
+
Y({
|
|
4173
4173
|
dataType: "map",
|
|
4174
4174
|
fieldConfig: "group",
|
|
4175
4175
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4178,7 +4178,7 @@ function ia(t, a, r) {
|
|
|
4178
4178
|
})
|
|
4179
4179
|
) : a === "key_value" ? i = L(
|
|
4180
4180
|
t,
|
|
4181
|
-
|
|
4181
|
+
Y({
|
|
4182
4182
|
dataType: "map",
|
|
4183
4183
|
fieldConfig: "key_value",
|
|
4184
4184
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4187,14 +4187,14 @@ function ia(t, a, r) {
|
|
|
4187
4187
|
})
|
|
4188
4188
|
) : a === "reference" ? i = L(
|
|
4189
4189
|
t,
|
|
4190
|
-
|
|
4190
|
+
Y({
|
|
4191
4191
|
dataType: "reference",
|
|
4192
4192
|
fieldConfig: "reference",
|
|
4193
4193
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4194
4194
|
})
|
|
4195
4195
|
) : a === "multi_references" ? i = L(
|
|
4196
4196
|
t,
|
|
4197
|
-
|
|
4197
|
+
Y({
|
|
4198
4198
|
dataType: "array",
|
|
4199
4199
|
fieldConfig: "multi_references",
|
|
4200
4200
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4204,14 +4204,14 @@ function ia(t, a, r) {
|
|
|
4204
4204
|
})
|
|
4205
4205
|
) : a === "switch" ? i = L(
|
|
4206
4206
|
t,
|
|
4207
|
-
|
|
4207
|
+
Y({
|
|
4208
4208
|
dataType: "boolean",
|
|
4209
4209
|
fieldConfig: "switch",
|
|
4210
4210
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4211
4211
|
})
|
|
4212
4212
|
) : a === "date_time" ? i = L(
|
|
4213
4213
|
t,
|
|
4214
|
-
|
|
4214
|
+
Y({
|
|
4215
4215
|
dataType: "date",
|
|
4216
4216
|
fieldConfig: "date_time",
|
|
4217
4217
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4219,14 +4219,14 @@ function ia(t, a, r) {
|
|
|
4219
4219
|
})
|
|
4220
4220
|
) : a === "repeat" ? i = L(
|
|
4221
4221
|
t,
|
|
4222
|
-
|
|
4222
|
+
Y({
|
|
4223
4223
|
dataType: "array",
|
|
4224
4224
|
fieldConfig: "repeat",
|
|
4225
4225
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4226
4226
|
})
|
|
4227
4227
|
) : a === "block" ? i = L(
|
|
4228
4228
|
t,
|
|
4229
|
-
|
|
4229
|
+
Y({
|
|
4230
4230
|
dataType: "array",
|
|
4231
4231
|
fieldConfig: "block",
|
|
4232
4232
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
@@ -4236,14 +4236,14 @@ function ia(t, a, r) {
|
|
|
4236
4236
|
})
|
|
4237
4237
|
) : a && r[a] && (i = { ...r[a].property, fieldConfig: a }), i;
|
|
4238
4238
|
}
|
|
4239
|
-
function
|
|
4239
|
+
function sa({ value: t, optionDisabled: a, fieldConfig: r, existing: i }) {
|
|
4240
4240
|
return /* @__PURE__ */ e(
|
|
4241
4241
|
fe,
|
|
4242
4242
|
{
|
|
4243
4243
|
value: t,
|
|
4244
4244
|
disabled: a,
|
|
4245
4245
|
className: "flex flex-row items-center",
|
|
4246
|
-
children: /* @__PURE__ */
|
|
4246
|
+
children: /* @__PURE__ */ n(
|
|
4247
4247
|
"div",
|
|
4248
4248
|
{
|
|
4249
4249
|
className: ve(
|
|
@@ -4251,8 +4251,8 @@ function ra({ value: t, optionDisabled: a, fieldConfig: r, existing: i }) {
|
|
|
4251
4251
|
a ? "w-full" : ""
|
|
4252
4252
|
),
|
|
4253
4253
|
children: [
|
|
4254
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
4255
|
-
/* @__PURE__ */
|
|
4254
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ke, { fieldConfig: r }) }),
|
|
4255
|
+
/* @__PURE__ */ n("div", { children: [
|
|
4256
4256
|
/* @__PURE__ */ e("div", { children: r.name }),
|
|
4257
4257
|
/* @__PURE__ */ e(
|
|
4258
4258
|
N,
|
|
@@ -4270,18 +4270,18 @@ function ra({ value: t, optionDisabled: a, fieldConfig: r, existing: i }) {
|
|
|
4270
4270
|
}
|
|
4271
4271
|
);
|
|
4272
4272
|
}
|
|
4273
|
-
const
|
|
4273
|
+
const la = R.memo(
|
|
4274
4274
|
function({
|
|
4275
4275
|
includeIdAndName: a = !0,
|
|
4276
4276
|
autoOpenTypeSelect: r,
|
|
4277
4277
|
existing: i,
|
|
4278
|
-
autoUpdateId:
|
|
4279
|
-
inArray:
|
|
4280
|
-
propertyKey:
|
|
4278
|
+
autoUpdateId: o,
|
|
4279
|
+
inArray: s,
|
|
4280
|
+
propertyKey: p,
|
|
4281
4281
|
propertyNamespace: c,
|
|
4282
4282
|
property: m,
|
|
4283
4283
|
onPropertyChanged: u,
|
|
4284
|
-
onPropertyChangedImmediate:
|
|
4284
|
+
onPropertyChangedImmediate: d = !0,
|
|
4285
4285
|
onDelete: l,
|
|
4286
4286
|
onError: g,
|
|
4287
4287
|
initialErrors: b,
|
|
@@ -4292,12 +4292,12 @@ const oa = R.memo(
|
|
|
4292
4292
|
getData: h,
|
|
4293
4293
|
customFields: y
|
|
4294
4294
|
}) {
|
|
4295
|
-
const
|
|
4295
|
+
const w = {
|
|
4296
4296
|
id: "",
|
|
4297
4297
|
name: ""
|
|
4298
|
-
},
|
|
4299
|
-
id:
|
|
4300
|
-
previousId:
|
|
4298
|
+
}, _ = (m && !Ue(m)) ?? !1, v = Re(m ? {
|
|
4299
|
+
id: p,
|
|
4300
|
+
previousId: p,
|
|
4301
4301
|
property: m
|
|
4302
4302
|
} : void 0), T = ({
|
|
4303
4303
|
id: P,
|
|
@@ -4312,38 +4312,38 @@ const oa = R.memo(
|
|
|
4312
4312
|
v.current = O, u?.(O);
|
|
4313
4313
|
};
|
|
4314
4314
|
return /* @__PURE__ */ e(
|
|
4315
|
-
|
|
4315
|
+
Nt,
|
|
4316
4316
|
{
|
|
4317
4317
|
initialErrors: b,
|
|
4318
|
-
initialValues: m ? { id:
|
|
4318
|
+
initialValues: m ? { id: p, ...m } : w,
|
|
4319
4319
|
onSubmit: (P, V) => {
|
|
4320
4320
|
console.log("Submitting property", P);
|
|
4321
4321
|
const {
|
|
4322
4322
|
id: O,
|
|
4323
|
-
...
|
|
4323
|
+
...E
|
|
4324
4324
|
} = P;
|
|
4325
4325
|
T({
|
|
4326
4326
|
id: O,
|
|
4327
|
-
property:
|
|
4328
|
-
}), i || V.resetForm({ values:
|
|
4327
|
+
property: E
|
|
4328
|
+
}), i || V.resetForm({ values: w });
|
|
4329
4329
|
},
|
|
4330
|
-
children: (P) => (
|
|
4330
|
+
children: (P) => (ne(() => {
|
|
4331
4331
|
x?.(P);
|
|
4332
4332
|
}, [P]), /* @__PURE__ */ e(
|
|
4333
|
-
|
|
4333
|
+
Mi,
|
|
4334
4334
|
{
|
|
4335
|
-
onPropertyChanged:
|
|
4335
|
+
onPropertyChanged: d ? T : void 0,
|
|
4336
4336
|
onDelete: l,
|
|
4337
4337
|
includeIdAndTitle: a,
|
|
4338
4338
|
propertyNamespace: c,
|
|
4339
4339
|
onError: g,
|
|
4340
4340
|
showErrors: f || P.submitCount > 0,
|
|
4341
4341
|
existing: i,
|
|
4342
|
-
autoUpdateId:
|
|
4343
|
-
inArray:
|
|
4342
|
+
autoUpdateId: o,
|
|
4343
|
+
inArray: s,
|
|
4344
4344
|
autoOpenTypeSelect: r,
|
|
4345
4345
|
existingPropertyKeys: k,
|
|
4346
|
-
disabled:
|
|
4346
|
+
disabled: _,
|
|
4347
4347
|
getData: h,
|
|
4348
4348
|
allowDataInference: C,
|
|
4349
4349
|
customFields: y,
|
|
@@ -4351,7 +4351,7 @@ const oa = R.memo(
|
|
|
4351
4351
|
}
|
|
4352
4352
|
))
|
|
4353
4353
|
},
|
|
4354
|
-
`property_view_${
|
|
4354
|
+
`property_view_${p}`
|
|
4355
4355
|
);
|
|
4356
4356
|
},
|
|
4357
4357
|
(t, a) => t.getData === a.getData && t.includeIdAndName === a.includeIdAndName && t.autoOpenTypeSelect === a.autoOpenTypeSelect && t.autoUpdateId === a.autoUpdateId && t.existing === a.existing
|
|
@@ -4361,48 +4361,48 @@ function Fe({
|
|
|
4361
4361
|
onCancel: a,
|
|
4362
4362
|
onOkClicked: r,
|
|
4363
4363
|
onPropertyChanged: i,
|
|
4364
|
-
getData:
|
|
4365
|
-
...
|
|
4364
|
+
getData: o,
|
|
4365
|
+
...s
|
|
4366
4366
|
}) {
|
|
4367
|
-
const
|
|
4367
|
+
const p = Re();
|
|
4368
4368
|
return /* @__PURE__ */ e(
|
|
4369
4369
|
Ee,
|
|
4370
4370
|
{
|
|
4371
4371
|
open: t ?? !1,
|
|
4372
4372
|
maxWidth: "xl",
|
|
4373
4373
|
fullWidth: !0,
|
|
4374
|
-
children: /* @__PURE__ */
|
|
4374
|
+
children: /* @__PURE__ */ n(aa, { noValidate: !0, style: { height: "100%" }, children: [
|
|
4375
4375
|
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(
|
|
4376
|
-
|
|
4376
|
+
la,
|
|
4377
4377
|
{
|
|
4378
|
-
...
|
|
4378
|
+
...s,
|
|
4379
4379
|
onPropertyChanged: (m) => {
|
|
4380
4380
|
i?.(m), r?.();
|
|
4381
4381
|
},
|
|
4382
4382
|
onPropertyChangedImmediate: !1,
|
|
4383
4383
|
getHelpers: (m) => {
|
|
4384
|
-
|
|
4384
|
+
p.current = m;
|
|
4385
4385
|
},
|
|
4386
|
-
getData:
|
|
4386
|
+
getData: o
|
|
4387
4387
|
}
|
|
4388
4388
|
) }),
|
|
4389
|
-
/* @__PURE__ */
|
|
4389
|
+
/* @__PURE__ */ n(Ye, { children: [
|
|
4390
4390
|
a && /* @__PURE__ */ e(
|
|
4391
|
-
|
|
4391
|
+
B,
|
|
4392
4392
|
{
|
|
4393
4393
|
variant: "text",
|
|
4394
4394
|
onClick: () => {
|
|
4395
|
-
a(),
|
|
4395
|
+
a(), p.current?.resetForm();
|
|
4396
4396
|
},
|
|
4397
4397
|
children: "Cancel"
|
|
4398
4398
|
}
|
|
4399
4399
|
),
|
|
4400
4400
|
/* @__PURE__ */ e(
|
|
4401
|
-
|
|
4401
|
+
B,
|
|
4402
4402
|
{
|
|
4403
4403
|
variant: "outlined",
|
|
4404
4404
|
color: "primary",
|
|
4405
|
-
onClick: () =>
|
|
4405
|
+
onClick: () => p.current?.submitForm(),
|
|
4406
4406
|
children: "Ok"
|
|
4407
4407
|
}
|
|
4408
4408
|
)
|
|
@@ -4411,18 +4411,18 @@ function Fe({
|
|
|
4411
4411
|
}
|
|
4412
4412
|
);
|
|
4413
4413
|
}
|
|
4414
|
-
function
|
|
4414
|
+
function Mi({
|
|
4415
4415
|
values: t,
|
|
4416
4416
|
errors: a,
|
|
4417
4417
|
touched: r,
|
|
4418
4418
|
setValues: i,
|
|
4419
|
-
setFieldValue:
|
|
4420
|
-
existing:
|
|
4421
|
-
autoUpdateId:
|
|
4419
|
+
setFieldValue: o,
|
|
4420
|
+
existing: s,
|
|
4421
|
+
autoUpdateId: p = !1,
|
|
4422
4422
|
autoOpenTypeSelect: c,
|
|
4423
4423
|
includeIdAndTitle: m,
|
|
4424
4424
|
onPropertyChanged: u,
|
|
4425
|
-
onDelete:
|
|
4425
|
+
onDelete: d,
|
|
4426
4426
|
propertyNamespace: l,
|
|
4427
4427
|
onError: g,
|
|
4428
4428
|
showErrors: b,
|
|
@@ -4433,109 +4433,109 @@ function Di({
|
|
|
4433
4433
|
allowDataInference: h,
|
|
4434
4434
|
customFields: y
|
|
4435
4435
|
}) {
|
|
4436
|
-
const [
|
|
4437
|
-
|
|
4438
|
-
!
|
|
4439
|
-
}, [
|
|
4436
|
+
const [w, _] = K(!1), [v, T] = K(t?.dataType ? Jt(t) : void 0), P = Object.entries(y).concat(Object.entries(_t)), V = k ? P.filter(([Q, J]) => !de(J.property) && J.property?.dataType !== "array") : P, O = fa(t), E = Re(null), ue = Re(t), Pe = "id", z = b && S(a, "selectedWidget");
|
|
4437
|
+
ne(() => {
|
|
4438
|
+
!S(r, Pe) && p && t?.name && o(Pe, Kt(t.name));
|
|
4439
|
+
}, [p, r, t?.name]), ne(() => {
|
|
4440
4440
|
if (u && (!m || O.id)) {
|
|
4441
4441
|
const {
|
|
4442
4442
|
id: Q,
|
|
4443
4443
|
...J
|
|
4444
4444
|
} = O;
|
|
4445
|
-
|
|
4445
|
+
ot(O, ue.current) || (u({
|
|
4446
4446
|
id: Q,
|
|
4447
4447
|
property: J,
|
|
4448
4448
|
namespace: l
|
|
4449
4449
|
}), ue.current = O);
|
|
4450
4450
|
}
|
|
4451
|
-
}, [O, m, u, l]),
|
|
4451
|
+
}, [O, m, u, l]), ne(() => {
|
|
4452
4452
|
t?.id && g && Object.keys(a).length > 0 && g(t?.id, l, a);
|
|
4453
4453
|
}, [a, g, l, t?.id]);
|
|
4454
|
-
const
|
|
4455
|
-
T(Q), i(
|
|
4456
|
-
|
|
4454
|
+
const M = (Q) => {
|
|
4455
|
+
T(Q), i(na(t, Q, y)), setTimeout(() => {
|
|
4456
|
+
E.current?.focus();
|
|
4457
4457
|
}, 0);
|
|
4458
4458
|
};
|
|
4459
|
-
let
|
|
4460
|
-
return v === "text_field" || v === "multiline" || v === "markdown" || v === "url" || v === "email" ?
|
|
4461
|
-
|
|
4459
|
+
let G;
|
|
4460
|
+
return v === "text_field" || v === "multiline" || v === "markdown" || v === "url" || v === "email" ? G = /* @__PURE__ */ e(
|
|
4461
|
+
qi,
|
|
4462
4462
|
{
|
|
4463
4463
|
widgetId: v,
|
|
4464
4464
|
disabled: f,
|
|
4465
4465
|
showErrors: b
|
|
4466
4466
|
}
|
|
4467
|
-
) : v === "select" || v === "number_select" ?
|
|
4468
|
-
|
|
4467
|
+
) : v === "select" || v === "number_select" ? G = /* @__PURE__ */ e(
|
|
4468
|
+
Ft,
|
|
4469
4469
|
{
|
|
4470
4470
|
multiselect: !1,
|
|
4471
4471
|
allowDataInference: h,
|
|
4472
|
-
updateIds: !
|
|
4472
|
+
updateIds: !s,
|
|
4473
4473
|
disabled: f,
|
|
4474
4474
|
getData: x,
|
|
4475
4475
|
showErrors: b
|
|
4476
4476
|
}
|
|
4477
|
-
) : v === "multi_select" || v === "multi_number_select" ?
|
|
4478
|
-
|
|
4477
|
+
) : v === "multi_select" || v === "multi_number_select" ? G = /* @__PURE__ */ e(
|
|
4478
|
+
Ft,
|
|
4479
4479
|
{
|
|
4480
4480
|
multiselect: !0,
|
|
4481
|
-
updateIds: !
|
|
4481
|
+
updateIds: !s,
|
|
4482
4482
|
disabled: f,
|
|
4483
4483
|
allowDataInference: h,
|
|
4484
4484
|
getData: x,
|
|
4485
4485
|
showErrors: b
|
|
4486
4486
|
}
|
|
4487
|
-
) : v === "file_upload" ?
|
|
4488
|
-
|
|
4487
|
+
) : v === "file_upload" ? G = /* @__PURE__ */ e(
|
|
4488
|
+
Et,
|
|
4489
4489
|
{
|
|
4490
|
-
existing:
|
|
4490
|
+
existing: s,
|
|
4491
4491
|
multiple: !1,
|
|
4492
4492
|
disabled: f
|
|
4493
4493
|
}
|
|
4494
|
-
) : v === "multi_file_upload" ?
|
|
4495
|
-
|
|
4494
|
+
) : v === "multi_file_upload" ? G = /* @__PURE__ */ e(
|
|
4495
|
+
Et,
|
|
4496
4496
|
{
|
|
4497
|
-
existing:
|
|
4497
|
+
existing: s,
|
|
4498
4498
|
multiple: !0,
|
|
4499
4499
|
disabled: f
|
|
4500
4500
|
}
|
|
4501
|
-
) : v === "switch" ?
|
|
4502
|
-
|
|
4501
|
+
) : v === "switch" ? G = /* @__PURE__ */ e(Ai, { disabled: f }) : v === "number_input" ? G = /* @__PURE__ */ e(Vi, { disabled: f }) : v === "group" ? G = /* @__PURE__ */ e(xi, { disabled: f, getData: x, allowDataInference: h, customFields: y }) : v === "block" ? G = /* @__PURE__ */ e(zi, { disabled: f, getData: x, allowDataInference: h, customFields: y }) : v === "reference" ? G = /* @__PURE__ */ e(
|
|
4502
|
+
It,
|
|
4503
4503
|
{
|
|
4504
4504
|
showErrors: b,
|
|
4505
|
-
existing:
|
|
4505
|
+
existing: s,
|
|
4506
4506
|
multiple: !1,
|
|
4507
4507
|
disabled: f
|
|
4508
4508
|
}
|
|
4509
|
-
) : v === "date_time" ?
|
|
4510
|
-
|
|
4509
|
+
) : v === "date_time" ? G = /* @__PURE__ */ e(Ei, { disabled: f }) : v === "multi_references" ? G = /* @__PURE__ */ e(
|
|
4510
|
+
It,
|
|
4511
4511
|
{
|
|
4512
4512
|
showErrors: b,
|
|
4513
|
-
existing:
|
|
4513
|
+
existing: s,
|
|
4514
4514
|
multiple: !0,
|
|
4515
4515
|
disabled: f
|
|
4516
4516
|
}
|
|
4517
|
-
) : v === "repeat" ?
|
|
4518
|
-
|
|
4517
|
+
) : v === "repeat" ? G = /* @__PURE__ */ e(
|
|
4518
|
+
Ci,
|
|
4519
4519
|
{
|
|
4520
4520
|
showErrors: b,
|
|
4521
|
-
existing:
|
|
4521
|
+
existing: s,
|
|
4522
4522
|
getData: x,
|
|
4523
4523
|
allowDataInference: h,
|
|
4524
4524
|
disabled: f,
|
|
4525
4525
|
customFields: y
|
|
4526
4526
|
}
|
|
4527
|
-
) : v === "key_value" ?
|
|
4528
|
-
f && /* @__PURE__ */
|
|
4527
|
+
) : v === "key_value" ? G = /* @__PURE__ */ e(Bi, { disabled: f }) : G = null, /* @__PURE__ */ n(F, { children: [
|
|
4528
|
+
f && /* @__PURE__ */ n(Xt, { mode: "warn", children: [
|
|
4529
4529
|
/* @__PURE__ */ e(N, { children: "This property can't be edited" }),
|
|
4530
|
-
/* @__PURE__ */
|
|
4530
|
+
/* @__PURE__ */ n(N, { variant: "caption", children: [
|
|
4531
4531
|
"You may not have permission to edit it or it is defined in code with no ",
|
|
4532
4532
|
/* @__PURE__ */ e("code", { children: "editable" }),
|
|
4533
4533
|
" flag"
|
|
4534
4534
|
] })
|
|
4535
4535
|
] }),
|
|
4536
|
-
/* @__PURE__ */
|
|
4536
|
+
/* @__PURE__ */ n("div", { className: "flex mt-2 justify-between", children: [
|
|
4537
4537
|
/* @__PURE__ */ e(
|
|
4538
|
-
|
|
4538
|
+
qe,
|
|
4539
4539
|
{
|
|
4540
4540
|
className: "w-full",
|
|
4541
4541
|
error: !!z,
|
|
@@ -4547,8 +4547,8 @@ function Di({
|
|
|
4547
4547
|
renderValue: (Q) => {
|
|
4548
4548
|
if (!Q)
|
|
4549
4549
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
4550
|
-
const J = Q, X = _t[J] ?? y[J], we = X.property, he =
|
|
4551
|
-
return /* @__PURE__ */
|
|
4550
|
+
const J = Q, X = _t[J] ?? y[J], we = X.property, he = de(we) || s && we.dataType !== t?.dataType;
|
|
4551
|
+
return /* @__PURE__ */ n(
|
|
4552
4552
|
"div",
|
|
4553
4553
|
{
|
|
4554
4554
|
onClick: (_e) => {
|
|
@@ -4559,8 +4559,8 @@ function Di({
|
|
|
4559
4559
|
he ? "w-full pointer-events-none opacity-50" : ""
|
|
4560
4560
|
),
|
|
4561
4561
|
children: [
|
|
4562
|
-
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(
|
|
4563
|
-
/* @__PURE__ */
|
|
4562
|
+
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ke, { fieldConfig: X }) }),
|
|
4563
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col items-start text-base text-left", children: [
|
|
4564
4564
|
/* @__PURE__ */ e("div", { children: X.name }),
|
|
4565
4565
|
/* @__PURE__ */ e(
|
|
4566
4566
|
N,
|
|
@@ -4576,17 +4576,17 @@ function Di({
|
|
|
4576
4576
|
);
|
|
4577
4577
|
},
|
|
4578
4578
|
onValueChange: (Q) => {
|
|
4579
|
-
|
|
4579
|
+
M(Q);
|
|
4580
4580
|
},
|
|
4581
4581
|
children: V.map(([Q, J]) => {
|
|
4582
|
-
const X = J.property, we =
|
|
4582
|
+
const X = J.property, we = s && !de(X) && X.dataType !== t?.dataType;
|
|
4583
4583
|
return /* @__PURE__ */ e(
|
|
4584
|
-
|
|
4584
|
+
sa,
|
|
4585
4585
|
{
|
|
4586
4586
|
value: Q,
|
|
4587
4587
|
optionDisabled: we,
|
|
4588
4588
|
fieldConfig: J,
|
|
4589
|
-
existing:
|
|
4589
|
+
existing: s
|
|
4590
4590
|
},
|
|
4591
4591
|
Q
|
|
4592
4592
|
);
|
|
@@ -4594,40 +4594,40 @@ function Di({
|
|
|
4594
4594
|
}
|
|
4595
4595
|
),
|
|
4596
4596
|
z && /* @__PURE__ */ e(N, { variant: "caption", color: "error", children: "Required" }),
|
|
4597
|
-
|
|
4597
|
+
d && t?.id && /* @__PURE__ */ e(
|
|
4598
4598
|
pe,
|
|
4599
4599
|
{
|
|
4600
4600
|
variant: "ghost",
|
|
4601
4601
|
className: "m-4",
|
|
4602
4602
|
disabled: f,
|
|
4603
|
-
onClick: () =>
|
|
4603
|
+
onClick: () => _(!0),
|
|
4604
4604
|
children: /* @__PURE__ */ e(it, {})
|
|
4605
4605
|
}
|
|
4606
4606
|
)
|
|
4607
4607
|
] }),
|
|
4608
|
-
/* @__PURE__ */
|
|
4608
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
4609
4609
|
m && /* @__PURE__ */ e(
|
|
4610
|
-
|
|
4610
|
+
Oi,
|
|
4611
4611
|
{
|
|
4612
4612
|
showErrors: b,
|
|
4613
|
-
disabledId:
|
|
4614
|
-
isNewProperty: !
|
|
4613
|
+
disabledId: s,
|
|
4614
|
+
isNewProperty: !s,
|
|
4615
4615
|
existingPropertyKeys: C,
|
|
4616
4616
|
disabled: f,
|
|
4617
|
-
ref:
|
|
4617
|
+
ref: E
|
|
4618
4618
|
}
|
|
4619
4619
|
),
|
|
4620
|
-
|
|
4621
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4620
|
+
G,
|
|
4621
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ii, { disabled: f }) })
|
|
4622
4622
|
] }),
|
|
4623
|
-
|
|
4623
|
+
d && /* @__PURE__ */ e(
|
|
4624
4624
|
rt,
|
|
4625
4625
|
{
|
|
4626
|
-
open:
|
|
4627
|
-
onAccept: () =>
|
|
4628
|
-
onCancel: () =>
|
|
4626
|
+
open: w,
|
|
4627
|
+
onAccept: () => d(t?.id, l),
|
|
4628
|
+
onCancel: () => _(!1),
|
|
4629
4629
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
4630
|
-
body: /* @__PURE__ */
|
|
4630
|
+
body: /* @__PURE__ */ n("div", { children: [
|
|
4631
4631
|
" This will ",
|
|
4632
4632
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
4633
4633
|
", only modify the collection."
|
|
@@ -4636,18 +4636,18 @@ function Di({
|
|
|
4636
4636
|
)
|
|
4637
4637
|
] });
|
|
4638
4638
|
}
|
|
4639
|
-
function
|
|
4639
|
+
function Di({
|
|
4640
4640
|
showErrors: t,
|
|
4641
4641
|
isNewCollection: a,
|
|
4642
4642
|
propertyErrorsRef: r,
|
|
4643
4643
|
onPropertyError: i,
|
|
4644
|
-
setDirty:
|
|
4645
|
-
reservedGroups:
|
|
4646
|
-
extraIcon:
|
|
4644
|
+
setDirty: o,
|
|
4645
|
+
reservedGroups: s,
|
|
4646
|
+
extraIcon: p,
|
|
4647
4647
|
getUser: c,
|
|
4648
4648
|
getData: m,
|
|
4649
4649
|
doCollectionInference: u,
|
|
4650
|
-
customFields:
|
|
4650
|
+
customFields: d
|
|
4651
4651
|
}) {
|
|
4652
4652
|
const {
|
|
4653
4653
|
values: l,
|
|
@@ -4656,13 +4656,13 @@ function Ri({
|
|
|
4656
4656
|
setFieldTouched: f,
|
|
4657
4657
|
errors: k,
|
|
4658
4658
|
dirty: C
|
|
4659
|
-
} = U(), x =
|
|
4660
|
-
|
|
4661
|
-
|
|
4659
|
+
} = U(), x = ct(), h = ja("lg"), y = !h, [w, _] = K(), [v, T] = K(), [P, V] = K(), O = v ? re(v, P) : void 0, E = O ? S(l.properties, O.replaceAll(".", ".properties.")) : void 0, [ue, Pe] = K(!1), [z, M] = K(!1), [G, Q] = K([]), J = R.useRef(l.propertiesOrder ? { "": l.propertiesOrder } : {});
|
|
4660
|
+
ne(() => {
|
|
4661
|
+
o && o(C);
|
|
4662
4662
|
}, [C]);
|
|
4663
4663
|
const X = u ? () => {
|
|
4664
4664
|
u && (Pe(!0), u(l).then((A) => {
|
|
4665
|
-
if (A &&
|
|
4665
|
+
if (A && Wt(A.properties), !A) {
|
|
4666
4666
|
x.open({
|
|
4667
4667
|
type: "error",
|
|
4668
4668
|
message: "Could not infer properties from data"
|
|
@@ -4677,27 +4677,27 @@ function Ri({
|
|
|
4677
4677
|
});
|
|
4678
4678
|
return;
|
|
4679
4679
|
}
|
|
4680
|
-
const
|
|
4680
|
+
const I = {
|
|
4681
4681
|
...j.reduce((ie, ge) => (ie[ge] = A.properties[ge], ie), {}),
|
|
4682
4682
|
...l.properties
|
|
4683
4683
|
}, ae = [
|
|
4684
4684
|
...j,
|
|
4685
4685
|
...l.propertiesOrder ?? []
|
|
4686
4686
|
];
|
|
4687
|
-
g("properties",
|
|
4687
|
+
g("properties", I, !1), he(ae), Q(j);
|
|
4688
4688
|
}).finally(() => {
|
|
4689
4689
|
Pe(!1);
|
|
4690
4690
|
}));
|
|
4691
|
-
} : void 0, we = (A) => A ? J.current[A] ??
|
|
4692
|
-
const
|
|
4693
|
-
g(
|
|
4691
|
+
} : void 0, we = (A) => A ? J.current[A] ?? S(l, xe(A)) : J.current[""], he = (A, j) => {
|
|
4692
|
+
const I = xe(j);
|
|
4693
|
+
g(I, A, !1), J.current[j ?? ""] = A;
|
|
4694
4694
|
}, _e = (A, j) => {
|
|
4695
|
-
const
|
|
4696
|
-
if (!
|
|
4695
|
+
const I = A ? re(A, j) : void 0;
|
|
4696
|
+
if (!I)
|
|
4697
4697
|
throw Error("collection editor miss config");
|
|
4698
|
-
g(ye(
|
|
4698
|
+
g(ye(I), void 0, !1);
|
|
4699
4699
|
const ie = we(j).filter((ge) => ge !== A);
|
|
4700
|
-
he(ie, j),
|
|
4700
|
+
he(ie, j), M(!1), _(void 0), T(void 0), V(void 0);
|
|
4701
4701
|
}, mt = (A, j) => {
|
|
4702
4702
|
g(xe(j), A, !1);
|
|
4703
4703
|
}, Be = ({
|
|
@@ -4713,50 +4713,50 @@ function Ri({
|
|
|
4713
4713
|
...l.properties ?? {},
|
|
4714
4714
|
[A]: j
|
|
4715
4715
|
}, !1);
|
|
4716
|
-
const
|
|
4716
|
+
const I = [...l.propertiesOrder ?? Object.keys(l.properties), A];
|
|
4717
4717
|
console.log("onPropertyCreated", {
|
|
4718
4718
|
id: A,
|
|
4719
4719
|
property: j,
|
|
4720
|
-
newPropertiesOrder:
|
|
4721
|
-
}), he(
|
|
4720
|
+
newPropertiesOrder: I
|
|
4721
|
+
}), he(I), M(!1), h && (_(I.indexOf(A)), T(A)), V(void 0);
|
|
4722
4722
|
}, Te = ({
|
|
4723
4723
|
id: A,
|
|
4724
4724
|
property: j,
|
|
4725
|
-
previousId:
|
|
4725
|
+
previousId: I,
|
|
4726
4726
|
namespace: ae
|
|
4727
4727
|
}) => {
|
|
4728
4728
|
const ie = A ? re(A, ae) : void 0, ge = ie ? ye(ie) : void 0;
|
|
4729
|
-
if (
|
|
4730
|
-
const ht = re(
|
|
4731
|
-
he(Me, ae), A && (
|
|
4729
|
+
if (I && I !== A) {
|
|
4730
|
+
const ht = re(I, ae), Ze = ye(ht), Me = we(ae).map((le) => le === I ? A : le).filter((le) => le !== void 0);
|
|
4731
|
+
he(Me, ae), A && (_(Me.indexOf(A)), T(A)), g(Ze, void 0, !1), f(Ze, !1, !1);
|
|
4732
4732
|
}
|
|
4733
4733
|
ge && (g(ge, j, !1), f(ge, !0, !1));
|
|
4734
|
-
}, te = (A, j,
|
|
4734
|
+
}, te = (A, j, I) => {
|
|
4735
4735
|
const ae = A ? re(A, j) : void 0;
|
|
4736
4736
|
if (console.warn("onPropertyErrorInternal", {
|
|
4737
4737
|
id: A,
|
|
4738
4738
|
namespace: j,
|
|
4739
|
-
error:
|
|
4739
|
+
error: I,
|
|
4740
4740
|
propertyPath: ae
|
|
4741
4741
|
}), ae) {
|
|
4742
|
-
const ie =
|
|
4743
|
-
i(A, j, ie ?
|
|
4742
|
+
const ie = I && Object.keys(I).length > 0;
|
|
4743
|
+
i(A, j, ie ? I : void 0), b(ye(ae), ie ? "Property error" : void 0);
|
|
4744
4744
|
}
|
|
4745
4745
|
}, Ve = () => {
|
|
4746
|
-
|
|
4747
|
-
},
|
|
4748
|
-
/* @__PURE__ */
|
|
4746
|
+
_(void 0), T(void 0);
|
|
4747
|
+
}, Qe = v && r?.current?.properties ? r.current.properties[v] : void 0, ut = l?.propertiesOrder === void 0 || l.propertiesOrder.length === 0, q = l.propertiesOrder ? l.propertiesOrder : Object.keys(l.properties), $ = Ut(() => c(l.ownerId), [c, l.ownerId]), D = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
4748
|
+
/* @__PURE__ */ n("div", { className: ve(
|
|
4749
4749
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
4750
4750
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
4751
4751
|
!y && "border-r " + xt
|
|
4752
4752
|
), children: [
|
|
4753
|
-
/* @__PURE__ */
|
|
4754
|
-
/* @__PURE__ */
|
|
4753
|
+
/* @__PURE__ */ n("div", { className: "flex my-2", children: [
|
|
4754
|
+
/* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
|
|
4755
4755
|
/* @__PURE__ */ e(
|
|
4756
4756
|
me,
|
|
4757
4757
|
{
|
|
4758
4758
|
name: "name",
|
|
4759
|
-
as:
|
|
4759
|
+
as: H,
|
|
4760
4760
|
invisible: !0,
|
|
4761
4761
|
className: "-ml-1",
|
|
4762
4762
|
inputClassName: "text-2xl font-headers",
|
|
@@ -4766,7 +4766,7 @@ function Ri({
|
|
|
4766
4766
|
error: !!k.name
|
|
4767
4767
|
}
|
|
4768
4768
|
),
|
|
4769
|
-
$ && /* @__PURE__ */
|
|
4769
|
+
$ && /* @__PURE__ */ n(
|
|
4770
4770
|
N,
|
|
4771
4771
|
{
|
|
4772
4772
|
variant: "body2",
|
|
@@ -4779,64 +4779,64 @@ function Ri({
|
|
|
4779
4779
|
}
|
|
4780
4780
|
)
|
|
4781
4781
|
] }),
|
|
4782
|
-
|
|
4783
|
-
/* @__PURE__ */
|
|
4784
|
-
X && /* @__PURE__ */ e(
|
|
4785
|
-
|
|
4782
|
+
p && /* @__PURE__ */ e("div", { className: "ml-4", children: p }),
|
|
4783
|
+
/* @__PURE__ */ n("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
|
|
4784
|
+
X && /* @__PURE__ */ e(se, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
4785
|
+
B,
|
|
4786
4786
|
{
|
|
4787
4787
|
variant: "text",
|
|
4788
4788
|
disabled: ue,
|
|
4789
4789
|
onClick: X,
|
|
4790
|
-
children: ue ? /* @__PURE__ */ e($e, { size: "small" }) : /* @__PURE__ */ e(
|
|
4790
|
+
children: ue ? /* @__PURE__ */ e($e, { size: "small" }) : /* @__PURE__ */ e(lt, {})
|
|
4791
4791
|
}
|
|
4792
4792
|
) }),
|
|
4793
|
-
/* @__PURE__ */ e(
|
|
4794
|
-
|
|
4793
|
+
/* @__PURE__ */ e(se, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
4794
|
+
B,
|
|
4795
4795
|
{
|
|
4796
4796
|
variant: "outlined",
|
|
4797
|
-
onClick: () =>
|
|
4797
|
+
onClick: () => M(!0),
|
|
4798
4798
|
children: /* @__PURE__ */ e(Oe, {})
|
|
4799
4799
|
}
|
|
4800
4800
|
) })
|
|
4801
4801
|
] })
|
|
4802
4802
|
] }),
|
|
4803
4803
|
/* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(
|
|
4804
|
-
|
|
4804
|
+
pt,
|
|
4805
4805
|
{
|
|
4806
4806
|
className: "pl-8",
|
|
4807
4807
|
onPropertyClick: (A, j) => {
|
|
4808
|
-
|
|
4808
|
+
_(q.indexOf(A)), T(A), V(j);
|
|
4809
4809
|
},
|
|
4810
|
-
inferredPropertyKeys:
|
|
4810
|
+
inferredPropertyKeys: G,
|
|
4811
4811
|
selectedPropertyKey: v ? re(v, P) : void 0,
|
|
4812
4812
|
properties: l.properties,
|
|
4813
4813
|
additionalFields: l.additionalFields,
|
|
4814
|
-
propertiesOrder:
|
|
4814
|
+
propertiesOrder: q,
|
|
4815
4815
|
onPropertyMove: mt,
|
|
4816
4816
|
onPropertyRemove: a ? _e : void 0,
|
|
4817
4817
|
errors: t ? k : {}
|
|
4818
4818
|
}
|
|
4819
4819
|
) }),
|
|
4820
4820
|
/* @__PURE__ */ e(
|
|
4821
|
-
|
|
4821
|
+
B,
|
|
4822
4822
|
{
|
|
4823
4823
|
className: "mt-8 w-full",
|
|
4824
4824
|
color: "primary",
|
|
4825
4825
|
variant: "outlined",
|
|
4826
4826
|
size: "large",
|
|
4827
|
-
onClick: () =>
|
|
4827
|
+
onClick: () => M(!0),
|
|
4828
4828
|
startIcon: /* @__PURE__ */ e(Oe, {}),
|
|
4829
4829
|
children: "Add new property"
|
|
4830
4830
|
}
|
|
4831
4831
|
)
|
|
4832
4832
|
] }),
|
|
4833
|
-
!y && /* @__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__ */
|
|
4833
|
+
!y && /* @__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(
|
|
4834
4834
|
Ce,
|
|
4835
4835
|
{
|
|
4836
4836
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
4837
4837
|
children: [
|
|
4838
|
-
O &&
|
|
4839
|
-
|
|
4838
|
+
O && E && !de(E) && /* @__PURE__ */ e(
|
|
4839
|
+
la,
|
|
4840
4840
|
{
|
|
4841
4841
|
inArray: !1,
|
|
4842
4842
|
existing: !a,
|
|
@@ -4845,19 +4845,19 @@ function Ri({
|
|
|
4845
4845
|
autoOpenTypeSelect: !1,
|
|
4846
4846
|
propertyKey: v,
|
|
4847
4847
|
propertyNamespace: P,
|
|
4848
|
-
property:
|
|
4848
|
+
property: E,
|
|
4849
4849
|
onPropertyChanged: Te,
|
|
4850
4850
|
onDelete: _e,
|
|
4851
4851
|
onError: te,
|
|
4852
4852
|
forceShowErrors: t,
|
|
4853
|
-
initialErrors:
|
|
4853
|
+
initialErrors: Qe,
|
|
4854
4854
|
getData: m,
|
|
4855
|
-
customFields:
|
|
4855
|
+
customFields: d
|
|
4856
4856
|
},
|
|
4857
|
-
`edit_view_${
|
|
4857
|
+
`edit_view_${w}`
|
|
4858
4858
|
),
|
|
4859
|
-
!
|
|
4860
|
-
|
|
4859
|
+
!E && /* @__PURE__ */ e(N, { variant: "label", className: "flex items-center justify-center h-full", children: ut ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
4860
|
+
E && de(E) && /* @__PURE__ */ e(N, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
4861
4861
|
]
|
|
4862
4862
|
}
|
|
4863
4863
|
) }),
|
|
@@ -4865,27 +4865,27 @@ function Ri({
|
|
|
4865
4865
|
Fe,
|
|
4866
4866
|
{
|
|
4867
4867
|
inArray: !1,
|
|
4868
|
-
open:
|
|
4868
|
+
open: w !== void 0,
|
|
4869
4869
|
autoUpdateId: a,
|
|
4870
4870
|
allowDataInference: !a,
|
|
4871
4871
|
existing: !0,
|
|
4872
4872
|
autoOpenTypeSelect: !1,
|
|
4873
4873
|
propertyKey: v,
|
|
4874
4874
|
propertyNamespace: P,
|
|
4875
|
-
property:
|
|
4875
|
+
property: E,
|
|
4876
4876
|
onPropertyChanged: Te,
|
|
4877
4877
|
onDelete: _e,
|
|
4878
4878
|
onError: te,
|
|
4879
4879
|
forceShowErrors: t,
|
|
4880
|
-
initialErrors:
|
|
4880
|
+
initialErrors: Qe,
|
|
4881
4881
|
getData: m,
|
|
4882
|
-
customFields:
|
|
4882
|
+
customFields: d,
|
|
4883
4883
|
onOkClicked: y ? Ve : void 0
|
|
4884
4884
|
},
|
|
4885
|
-
`edit_view_${
|
|
4885
|
+
`edit_view_${w}`
|
|
4886
4886
|
)
|
|
4887
4887
|
] });
|
|
4888
|
-
return /* @__PURE__ */
|
|
4888
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
4889
4889
|
D,
|
|
4890
4890
|
/* @__PURE__ */ e(
|
|
4891
4891
|
Fe,
|
|
@@ -4896,62 +4896,56 @@ function Ri({
|
|
|
4896
4896
|
autoUpdateId: !0,
|
|
4897
4897
|
forceShowErrors: t,
|
|
4898
4898
|
open: z,
|
|
4899
|
-
onCancel: () =>
|
|
4899
|
+
onCancel: () => M(!1),
|
|
4900
4900
|
onPropertyChanged: Be,
|
|
4901
4901
|
getData: m,
|
|
4902
4902
|
allowDataInference: !a,
|
|
4903
|
-
customFields:
|
|
4903
|
+
customFields: d,
|
|
4904
4904
|
existingPropertyKeys: l.propertiesOrder
|
|
4905
4905
|
}
|
|
4906
4906
|
)
|
|
4907
4907
|
] });
|
|
4908
4908
|
}
|
|
4909
|
-
function
|
|
4910
|
-
Object.keys(t).forEach((a) => {
|
|
4911
|
-
const r = t[a];
|
|
4912
|
-
r.editable = !0, r.dataType === "map" && r.properties && na(r.properties);
|
|
4913
|
-
});
|
|
4914
|
-
}
|
|
4915
|
-
function Ui({
|
|
4909
|
+
function Ri({
|
|
4916
4910
|
open: t,
|
|
4917
4911
|
handleOk: a,
|
|
4918
4912
|
handleCancel: r,
|
|
4919
4913
|
body: i,
|
|
4920
|
-
title:
|
|
4914
|
+
title: o
|
|
4921
4915
|
}) {
|
|
4922
|
-
return /* @__PURE__ */
|
|
4916
|
+
return /* @__PURE__ */ n(
|
|
4923
4917
|
Ee,
|
|
4924
4918
|
{
|
|
4925
4919
|
open: t,
|
|
4926
|
-
onOpenChange: (
|
|
4920
|
+
onOpenChange: (s) => s ? r() : a(),
|
|
4927
4921
|
"aria-labelledby": "alert-dialog-title",
|
|
4928
4922
|
"aria-describedby": "alert-dialog-description",
|
|
4929
4923
|
children: [
|
|
4930
|
-
/* @__PURE__ */
|
|
4931
|
-
/* @__PURE__ */ e(N, { variant: "h6", children:
|
|
4924
|
+
/* @__PURE__ */ n(Le, { children: [
|
|
4925
|
+
/* @__PURE__ */ e(N, { variant: "h6", children: o ?? "Unsaved changes" }),
|
|
4932
4926
|
i && /* @__PURE__ */ e(N, { children: i }),
|
|
4933
4927
|
/* @__PURE__ */ e(N, { children: "Are you sure?" })
|
|
4934
4928
|
] }),
|
|
4935
|
-
/* @__PURE__ */
|
|
4936
|
-
/* @__PURE__ */ e(
|
|
4937
|
-
/* @__PURE__ */ e(
|
|
4929
|
+
/* @__PURE__ */ n(Ye, { children: [
|
|
4930
|
+
/* @__PURE__ */ e(B, { variant: "text", onClick: r, autoFocus: !0, children: " Cancel " }),
|
|
4931
|
+
/* @__PURE__ */ e(B, { onClick: a, children: " Ok " })
|
|
4938
4932
|
] })
|
|
4939
4933
|
]
|
|
4940
4934
|
}
|
|
4941
4935
|
);
|
|
4942
4936
|
}
|
|
4943
|
-
function
|
|
4937
|
+
function Ui({ open: t, onClose: a }) {
|
|
4944
4938
|
const { entityViews: r } = Ae();
|
|
4945
|
-
return /* @__PURE__ */
|
|
4939
|
+
return /* @__PURE__ */ n(
|
|
4946
4940
|
Ee,
|
|
4947
4941
|
{
|
|
4948
4942
|
maxWidth: "md",
|
|
4949
4943
|
open: t,
|
|
4950
4944
|
children: [
|
|
4951
|
-
/* @__PURE__ */
|
|
4945
|
+
/* @__PURE__ */ n(Le, { children: [
|
|
4952
4946
|
/* @__PURE__ */ e(N, { variant: "h6", children: "Select view" }),
|
|
4953
|
-
r?.map((i) => /* @__PURE__ */
|
|
4954
|
-
|
|
4947
|
+
r?.map((i) => /* @__PURE__ */ n(
|
|
4948
|
+
B,
|
|
4955
4949
|
{
|
|
4956
4950
|
onClick: () => a(i.key),
|
|
4957
4951
|
fullWidth: !0,
|
|
@@ -4966,55 +4960,55 @@ function $i({ open: t, onClose: a }) {
|
|
|
4966
4960
|
i.key
|
|
4967
4961
|
))
|
|
4968
4962
|
] }),
|
|
4969
|
-
/* @__PURE__ */ e(
|
|
4963
|
+
/* @__PURE__ */ e(Ye, { children: /* @__PURE__ */ e(B, { onClick: () => a(), children: "Cancel" }) })
|
|
4970
4964
|
]
|
|
4971
4965
|
}
|
|
4972
4966
|
);
|
|
4973
4967
|
}
|
|
4974
|
-
function
|
|
4968
|
+
function $i({
|
|
4975
4969
|
collection: t,
|
|
4976
4970
|
parentCollection: a,
|
|
4977
4971
|
configController: r,
|
|
4978
4972
|
collectionInference: i,
|
|
4979
|
-
getUser:
|
|
4980
|
-
parentPathSegments:
|
|
4973
|
+
getUser: o,
|
|
4974
|
+
parentPathSegments: s
|
|
4981
4975
|
}) {
|
|
4982
|
-
const { entityViews:
|
|
4976
|
+
const { entityViews: p } = Ae(), [c, m] = R.useState(), [u, d] = R.useState(!1), [l, g] = R.useState(), [b, f] = R.useState(), {
|
|
4983
4977
|
values: k,
|
|
4984
4978
|
setFieldValue: C
|
|
4985
|
-
} = U(), x = t.subcollections ?? [], h = k.entityViews?.filter((
|
|
4986
|
-
return /* @__PURE__ */
|
|
4987
|
-
/* @__PURE__ */ e(
|
|
4988
|
-
/* @__PURE__ */
|
|
4989
|
-
/* @__PURE__ */
|
|
4979
|
+
} = U(), x = t.subcollections ?? [], h = k.entityViews?.filter((_) => typeof _ == "string").map((_) => Fa(_, p)).filter(Boolean) ?? [], y = t.entityViews?.filter((_) => typeof _ != "string") ?? [], w = h.length + y.length;
|
|
4980
|
+
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
|
|
4981
|
+
/* @__PURE__ */ e(nt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
|
|
4982
|
+
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
4983
|
+
/* @__PURE__ */ n(N, { variant: "h5", children: [
|
|
4990
4984
|
"Subcollections of ",
|
|
4991
4985
|
k.name
|
|
4992
4986
|
] }),
|
|
4993
|
-
x && x.length > 0 && /* @__PURE__ */ e(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(
|
|
4987
|
+
x && x.length > 0 && /* @__PURE__ */ e(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(Vt, { children: x.map((_) => /* @__PURE__ */ n(
|
|
4994
4988
|
gt,
|
|
4995
4989
|
{
|
|
4996
4990
|
onClick: () => f({
|
|
4997
4991
|
isNewCollection: !1,
|
|
4998
|
-
editedCollectionPath:
|
|
4992
|
+
editedCollectionPath: _.path
|
|
4999
4993
|
}),
|
|
5000
4994
|
children: [
|
|
5001
4995
|
/* @__PURE__ */ e(
|
|
5002
4996
|
De,
|
|
5003
4997
|
{
|
|
5004
4998
|
align: "left",
|
|
5005
|
-
children: /* @__PURE__ */ e(N, { variant: "subtitle2", className: "flex-grow", children:
|
|
4999
|
+
children: /* @__PURE__ */ e(N, { variant: "subtitle2", className: "flex-grow", children: _.name })
|
|
5006
5000
|
}
|
|
5007
5001
|
),
|
|
5008
5002
|
/* @__PURE__ */ e(
|
|
5009
5003
|
De,
|
|
5010
5004
|
{
|
|
5011
5005
|
align: "right",
|
|
5012
|
-
children: /* @__PURE__ */ e(
|
|
5006
|
+
children: /* @__PURE__ */ e(se, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5013
5007
|
pe,
|
|
5014
5008
|
{
|
|
5015
5009
|
size: "small",
|
|
5016
5010
|
onClick: (v) => {
|
|
5017
|
-
v.preventDefault(), v.stopPropagation(), m(
|
|
5011
|
+
v.preventDefault(), v.stopPropagation(), m(_.path);
|
|
5018
5012
|
},
|
|
5019
5013
|
color: "inherit",
|
|
5020
5014
|
children: /* @__PURE__ */ e(it, { size: "small" })
|
|
@@ -5024,10 +5018,10 @@ function Li({
|
|
|
5024
5018
|
)
|
|
5025
5019
|
]
|
|
5026
5020
|
},
|
|
5027
|
-
|
|
5021
|
+
_.path
|
|
5028
5022
|
)) }) }) }),
|
|
5029
5023
|
/* @__PURE__ */ e(
|
|
5030
|
-
|
|
5024
|
+
B,
|
|
5031
5025
|
{
|
|
5032
5026
|
onClick: () => {
|
|
5033
5027
|
f({
|
|
@@ -5040,27 +5034,27 @@ function Li({
|
|
|
5040
5034
|
}
|
|
5041
5035
|
)
|
|
5042
5036
|
] }),
|
|
5043
|
-
/* @__PURE__ */
|
|
5037
|
+
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
5044
5038
|
/* @__PURE__ */ e(N, { variant: "h5", children: "Custom views" }),
|
|
5045
|
-
|
|
5046
|
-
h.map((
|
|
5039
|
+
w > 0 && /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(Ce, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ n(Vt, { children: [
|
|
5040
|
+
h.map((_) => /* @__PURE__ */ n(gt, { children: [
|
|
5047
5041
|
/* @__PURE__ */ e(
|
|
5048
5042
|
De,
|
|
5049
5043
|
{
|
|
5050
5044
|
align: "left",
|
|
5051
|
-
children: /* @__PURE__ */ e(N, { variant: "subtitle2", className: "flex-grow", children:
|
|
5045
|
+
children: /* @__PURE__ */ e(N, { variant: "subtitle2", className: "flex-grow", children: _.name })
|
|
5052
5046
|
}
|
|
5053
5047
|
),
|
|
5054
5048
|
/* @__PURE__ */ e(
|
|
5055
5049
|
De,
|
|
5056
5050
|
{
|
|
5057
5051
|
align: "right",
|
|
5058
|
-
children: /* @__PURE__ */ e(
|
|
5052
|
+
children: /* @__PURE__ */ e(se, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5059
5053
|
pe,
|
|
5060
5054
|
{
|
|
5061
5055
|
size: "small",
|
|
5062
5056
|
onClick: (v) => {
|
|
5063
|
-
v.preventDefault(), v.stopPropagation(), g(
|
|
5057
|
+
v.preventDefault(), v.stopPropagation(), g(_.key);
|
|
5064
5058
|
},
|
|
5065
5059
|
color: "inherit",
|
|
5066
5060
|
children: /* @__PURE__ */ e(it, { size: "small" })
|
|
@@ -5068,26 +5062,27 @@ function Li({
|
|
|
5068
5062
|
) })
|
|
5069
5063
|
}
|
|
5070
5064
|
)
|
|
5071
|
-
] },
|
|
5072
|
-
y.map((
|
|
5065
|
+
] }, _.key)),
|
|
5066
|
+
y.map((_) => /* @__PURE__ */ e(gt, { children: /* @__PURE__ */ n(
|
|
5073
5067
|
De,
|
|
5074
5068
|
{
|
|
5075
5069
|
align: "left",
|
|
5076
5070
|
children: [
|
|
5077
|
-
/* @__PURE__ */ e(N, { variant: "subtitle2", className: "flex-grow", children:
|
|
5078
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ e(N, { variant: "subtitle2", className: "flex-grow", children: _.name }),
|
|
5072
|
+
/* @__PURE__ */ n(N, { variant: "caption", className: "flex-grow", children: [
|
|
5079
5073
|
"This view is defined in code with key ",
|
|
5080
|
-
/* @__PURE__ */ e("code", { children:
|
|
5074
|
+
/* @__PURE__ */ e("code", { children: _.key })
|
|
5081
5075
|
] })
|
|
5082
5076
|
]
|
|
5083
5077
|
}
|
|
5084
|
-
) },
|
|
5085
|
-
] }) }) }),
|
|
5078
|
+
) }, _.key))
|
|
5079
|
+
] }) }) }) }),
|
|
5080
|
+
w === 0 && /* @__PURE__ */ e(Xt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
|
|
5086
5081
|
/* @__PURE__ */ e(
|
|
5087
|
-
|
|
5082
|
+
B,
|
|
5088
5083
|
{
|
|
5089
5084
|
onClick: () => {
|
|
5090
|
-
|
|
5085
|
+
d(!0);
|
|
5091
5086
|
},
|
|
5092
5087
|
variant: "outlined",
|
|
5093
5088
|
startIcon: /* @__PURE__ */ e(Oe, {}),
|
|
@@ -5103,12 +5098,12 @@ function Li({
|
|
|
5103
5098
|
onAccept: () => {
|
|
5104
5099
|
r.deleteCollection({
|
|
5105
5100
|
path: c,
|
|
5106
|
-
parentPathSegments: [...
|
|
5101
|
+
parentPathSegments: [...s ?? [], t.path]
|
|
5107
5102
|
}), m(void 0);
|
|
5108
5103
|
},
|
|
5109
5104
|
onCancel: () => m(void 0),
|
|
5110
|
-
title: /* @__PURE__ */ e(
|
|
5111
|
-
body: /* @__PURE__ */
|
|
5105
|
+
title: /* @__PURE__ */ e(F, { children: "Delete this subcollection?" }),
|
|
5106
|
+
body: /* @__PURE__ */ n(F, { children: [
|
|
5112
5107
|
" This will ",
|
|
5113
5108
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5114
5109
|
", only the collection in the CMS"
|
|
@@ -5120,11 +5115,11 @@ function Li({
|
|
|
5120
5115
|
{
|
|
5121
5116
|
open: !!l,
|
|
5122
5117
|
onAccept: () => {
|
|
5123
|
-
C("entityViews", k.entityViews?.filter((
|
|
5118
|
+
C("entityViews", k.entityViews?.filter((_) => _ !== l)), g(void 0);
|
|
5124
5119
|
},
|
|
5125
5120
|
onCancel: () => g(void 0),
|
|
5126
|
-
title: /* @__PURE__ */ e(
|
|
5127
|
-
body: /* @__PURE__ */
|
|
5121
|
+
title: /* @__PURE__ */ e(F, { children: "Remove this view?" }),
|
|
5122
|
+
body: /* @__PURE__ */ n(F, { children: [
|
|
5128
5123
|
"This will ",
|
|
5129
5124
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5130
5125
|
", only the view in the CMS"
|
|
@@ -5132,33 +5127,33 @@ function Li({
|
|
|
5132
5127
|
}
|
|
5133
5128
|
),
|
|
5134
5129
|
/* @__PURE__ */ e(
|
|
5135
|
-
|
|
5130
|
+
da,
|
|
5136
5131
|
{
|
|
5137
5132
|
open: !!b,
|
|
5138
5133
|
configController: r,
|
|
5139
5134
|
parentCollection: t,
|
|
5140
5135
|
collectionInference: i,
|
|
5141
|
-
parentPathSegments: [...
|
|
5136
|
+
parentPathSegments: [...s ?? [], k.path],
|
|
5142
5137
|
isNewCollection: !1,
|
|
5143
5138
|
...b,
|
|
5144
|
-
getUser:
|
|
5139
|
+
getUser: o,
|
|
5145
5140
|
handleClose: () => {
|
|
5146
5141
|
f(void 0);
|
|
5147
5142
|
}
|
|
5148
5143
|
}
|
|
5149
5144
|
),
|
|
5150
5145
|
/* @__PURE__ */ e(
|
|
5151
|
-
|
|
5146
|
+
Ui,
|
|
5152
5147
|
{
|
|
5153
5148
|
open: u,
|
|
5154
|
-
onClose: (
|
|
5155
|
-
|
|
5149
|
+
onClose: (_) => {
|
|
5150
|
+
_ && (console.log("selectedViewKey", _), C("entityViews", [...k.entityViews ?? [], _])), d(!1);
|
|
5156
5151
|
}
|
|
5157
5152
|
}
|
|
5158
5153
|
)
|
|
5159
5154
|
] });
|
|
5160
5155
|
}
|
|
5161
|
-
const
|
|
5156
|
+
const Bt = Ct({
|
|
5162
5157
|
path: "products",
|
|
5163
5158
|
name: "Products",
|
|
5164
5159
|
singularName: "Product",
|
|
@@ -5243,7 +5238,7 @@ const It = Ct({
|
|
|
5243
5238
|
autoValue: "on_create"
|
|
5244
5239
|
}
|
|
5245
5240
|
}
|
|
5246
|
-
}),
|
|
5241
|
+
}), Mt = Ct({
|
|
5247
5242
|
path: "blog",
|
|
5248
5243
|
name: "Blog",
|
|
5249
5244
|
singularName: "Blog entry",
|
|
@@ -5252,12 +5247,12 @@ const It = Ct({
|
|
|
5252
5247
|
description: "A collection of blog entries",
|
|
5253
5248
|
defaultSize: "l",
|
|
5254
5249
|
properties: {
|
|
5255
|
-
name:
|
|
5250
|
+
name: Y({
|
|
5256
5251
|
name: "Name",
|
|
5257
5252
|
validation: { required: !0 },
|
|
5258
5253
|
dataType: "string"
|
|
5259
5254
|
}),
|
|
5260
|
-
header_image:
|
|
5255
|
+
header_image: Y({
|
|
5261
5256
|
name: "Header image",
|
|
5262
5257
|
dataType: "string",
|
|
5263
5258
|
storage: {
|
|
@@ -5268,7 +5263,7 @@ const It = Ct({
|
|
|
5268
5263
|
}
|
|
5269
5264
|
}
|
|
5270
5265
|
}),
|
|
5271
|
-
content:
|
|
5266
|
+
content: Y({
|
|
5272
5267
|
name: "Content",
|
|
5273
5268
|
description: "Content blocks for the blog entry",
|
|
5274
5269
|
validation: { required: !0 },
|
|
@@ -5355,7 +5350,7 @@ const It = Ct({
|
|
|
5355
5350
|
initialFilter: {
|
|
5356
5351
|
status: ["==", "published"]
|
|
5357
5352
|
}
|
|
5358
|
-
}),
|
|
5353
|
+
}), Dt = Ct({
|
|
5359
5354
|
path: "users",
|
|
5360
5355
|
name: "Users",
|
|
5361
5356
|
singularName: "User",
|
|
@@ -5387,23 +5382,23 @@ const It = Ct({
|
|
|
5387
5382
|
}
|
|
5388
5383
|
}
|
|
5389
5384
|
});
|
|
5390
|
-
function
|
|
5385
|
+
function Li({
|
|
5391
5386
|
path: t,
|
|
5392
5387
|
pathSuggestions: a,
|
|
5393
5388
|
parentCollection: r,
|
|
5394
5389
|
onContinue: i,
|
|
5395
|
-
collections:
|
|
5390
|
+
collections: o
|
|
5396
5391
|
}) {
|
|
5397
|
-
const [
|
|
5398
|
-
|
|
5399
|
-
a &&
|
|
5400
|
-
const y = h.filter((
|
|
5392
|
+
const [s, p] = K(!1), [c, m] = K();
|
|
5393
|
+
ne(() => {
|
|
5394
|
+
a && o && (p(!0), a(t).then((h) => {
|
|
5395
|
+
const y = h.filter((w) => !o.find((_) => _.path.trim().toLowerCase() === w.trim().toLowerCase()));
|
|
5401
5396
|
m(y);
|
|
5402
|
-
}).finally(() =>
|
|
5403
|
-
}, [
|
|
5397
|
+
}).finally(() => p(!1)));
|
|
5398
|
+
}, [o, t, a]);
|
|
5404
5399
|
const {
|
|
5405
5400
|
values: u,
|
|
5406
|
-
setFieldValue:
|
|
5401
|
+
setFieldValue: d,
|
|
5407
5402
|
setValues: l,
|
|
5408
5403
|
handleChange: g,
|
|
5409
5404
|
touched: b,
|
|
@@ -5412,7 +5407,7 @@ function Ki({
|
|
|
5412
5407
|
isSubmitting: C,
|
|
5413
5408
|
submitCount: x
|
|
5414
5409
|
} = U();
|
|
5415
|
-
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */
|
|
5410
|
+
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(nt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5416
5411
|
/* @__PURE__ */ e(
|
|
5417
5412
|
"div",
|
|
5418
5413
|
{
|
|
@@ -5420,11 +5415,11 @@ function Ki({
|
|
|
5420
5415
|
children: /* @__PURE__ */ e(N, { variant: "h4", className: "flex-grow", children: "New collection" })
|
|
5421
5416
|
}
|
|
5422
5417
|
),
|
|
5423
|
-
r && /* @__PURE__ */ e(at, { colorScheme: "tealDarker", children: /* @__PURE__ */
|
|
5418
|
+
r && /* @__PURE__ */ e(at, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(N, { variant: "caption", children: [
|
|
5424
5419
|
"This is a subcollection of ",
|
|
5425
5420
|
/* @__PURE__ */ e("b", { children: r.name })
|
|
5426
5421
|
] }) }),
|
|
5427
|
-
/* @__PURE__ */
|
|
5422
|
+
/* @__PURE__ */ n("div", { className: "my-2", children: [
|
|
5428
5423
|
/* @__PURE__ */ e(
|
|
5429
5424
|
N,
|
|
5430
5425
|
{
|
|
@@ -5433,24 +5428,24 @@ function Ki({
|
|
|
5433
5428
|
children: "● Use one of the existing paths in your database:"
|
|
5434
5429
|
}
|
|
5435
5430
|
),
|
|
5436
|
-
/* @__PURE__ */
|
|
5437
|
-
|
|
5431
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
5432
|
+
s && !c && /* @__PURE__ */ e($e, { size: "small" }),
|
|
5438
5433
|
c?.map((h, y) => /* @__PURE__ */ e(
|
|
5439
5434
|
at,
|
|
5440
5435
|
{
|
|
5441
5436
|
colorScheme: "cyanLighter",
|
|
5442
5437
|
onClick: () => {
|
|
5443
|
-
|
|
5438
|
+
d("name", Ot(h)), d("path", h), d("properties", void 0), i();
|
|
5444
5439
|
},
|
|
5445
5440
|
size: "small",
|
|
5446
5441
|
children: h
|
|
5447
5442
|
},
|
|
5448
5443
|
h
|
|
5449
5444
|
)),
|
|
5450
|
-
!
|
|
5445
|
+
!s && c?.length === 0 && /* @__PURE__ */ e(N, { variant: "caption", children: "No suggestions" })
|
|
5451
5446
|
] })
|
|
5452
5447
|
] }),
|
|
5453
|
-
/* @__PURE__ */
|
|
5448
|
+
/* @__PURE__ */ n("div", { className: "my-2", children: [
|
|
5454
5449
|
/* @__PURE__ */ e(
|
|
5455
5450
|
N,
|
|
5456
5451
|
{
|
|
@@ -5459,15 +5454,15 @@ function Ki({
|
|
|
5459
5454
|
children: "● Select a template:"
|
|
5460
5455
|
}
|
|
5461
5456
|
),
|
|
5462
|
-
/* @__PURE__ */
|
|
5457
|
+
/* @__PURE__ */ n("div", { className: "flex gap-4", children: [
|
|
5463
5458
|
/* @__PURE__ */ e(
|
|
5464
5459
|
yt,
|
|
5465
5460
|
{
|
|
5466
5461
|
title: "Products",
|
|
5467
5462
|
subtitle: "A collection of products with images, prices and stock",
|
|
5468
|
-
icon: /* @__PURE__ */ e(
|
|
5463
|
+
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Bt.icon }),
|
|
5469
5464
|
onClick: () => {
|
|
5470
|
-
l(
|
|
5465
|
+
l(Bt), i();
|
|
5471
5466
|
}
|
|
5472
5467
|
}
|
|
5473
5468
|
),
|
|
@@ -5476,9 +5471,9 @@ function Ki({
|
|
|
5476
5471
|
{
|
|
5477
5472
|
title: "Blog posts",
|
|
5478
5473
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
5479
|
-
icon: /* @__PURE__ */ e(
|
|
5474
|
+
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Mt.icon }),
|
|
5480
5475
|
onClick: () => {
|
|
5481
|
-
l(
|
|
5476
|
+
l(Mt), i();
|
|
5482
5477
|
}
|
|
5483
5478
|
}
|
|
5484
5479
|
),
|
|
@@ -5487,15 +5482,15 @@ function Ki({
|
|
|
5487
5482
|
{
|
|
5488
5483
|
title: "Users",
|
|
5489
5484
|
subtitle: "A collection of users with emails, names and roles",
|
|
5490
|
-
icon: /* @__PURE__ */ e(
|
|
5485
|
+
icon: /* @__PURE__ */ e(et, { size: "small", iconKey: Dt.icon }),
|
|
5491
5486
|
onClick: () => {
|
|
5492
|
-
l(
|
|
5487
|
+
l(Dt), i();
|
|
5493
5488
|
}
|
|
5494
5489
|
}
|
|
5495
5490
|
)
|
|
5496
5491
|
] })
|
|
5497
5492
|
] }),
|
|
5498
|
-
!r && /* @__PURE__ */
|
|
5493
|
+
!r && /* @__PURE__ */ n("div", { children: [
|
|
5499
5494
|
/* @__PURE__ */ e(
|
|
5500
5495
|
N,
|
|
5501
5496
|
{
|
|
@@ -5505,9 +5500,9 @@ function Ki({
|
|
|
5505
5500
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
5506
5501
|
}
|
|
5507
5502
|
),
|
|
5508
|
-
/* @__PURE__ */ e(
|
|
5503
|
+
/* @__PURE__ */ e(ti, { onDataAdded: (h) => i(h) })
|
|
5509
5504
|
] }),
|
|
5510
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
5505
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(B, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
|
|
5511
5506
|
] }) });
|
|
5512
5507
|
}
|
|
5513
5508
|
function yt({
|
|
@@ -5516,8 +5511,8 @@ function yt({
|
|
|
5516
5511
|
icon: r,
|
|
5517
5512
|
onClick: i
|
|
5518
5513
|
}) {
|
|
5519
|
-
return /* @__PURE__ */ e(
|
|
5520
|
-
|
|
5514
|
+
return /* @__PURE__ */ e(se, { title: a, children: /* @__PURE__ */ n(
|
|
5515
|
+
ea,
|
|
5521
5516
|
{
|
|
5522
5517
|
onClick: i,
|
|
5523
5518
|
className: ve(
|
|
@@ -5562,7 +5557,7 @@ const Yi = [
|
|
|
5562
5557
|
"date_time",
|
|
5563
5558
|
"repeat",
|
|
5564
5559
|
"block"
|
|
5565
|
-
],
|
|
5560
|
+
], Ki = Object.entries(_t).filter(
|
|
5566
5561
|
([t]) => Yi.includes(t)
|
|
5567
5562
|
);
|
|
5568
5563
|
function Gi({
|
|
@@ -5572,24 +5567,24 @@ function Gi({
|
|
|
5572
5567
|
const {
|
|
5573
5568
|
setFieldValue: r,
|
|
5574
5569
|
setFieldTouched: i,
|
|
5575
|
-
values:
|
|
5576
|
-
} = U(), [
|
|
5570
|
+
values: o
|
|
5571
|
+
} = U(), [s, p] = K(void 0), c = R.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), m = s ? s.id : void 0, u = s || void 0, d = ({
|
|
5577
5572
|
id: g,
|
|
5578
5573
|
property: b,
|
|
5579
5574
|
previousId: f,
|
|
5580
5575
|
namespace: k
|
|
5581
5576
|
}) => {
|
|
5582
|
-
const C = g ? re(g, k) : void 0, x = C ? ye(C) : void 0, h = (
|
|
5583
|
-
const v = xe(
|
|
5584
|
-
r(v,
|
|
5577
|
+
const C = g ? re(g, k) : void 0, x = C ? ye(C) : void 0, h = (w) => w ? c.current[w] ?? S(o, xe(w)) : c.current[""], y = (w, _) => {
|
|
5578
|
+
const v = xe(_);
|
|
5579
|
+
r(v, w, !1), c.current[_ ?? ""] = w;
|
|
5585
5580
|
};
|
|
5586
5581
|
if (f && f !== g) {
|
|
5587
|
-
const
|
|
5582
|
+
const w = re(f, k), _ = ye(w), T = h(k).map((V) => V === f ? g : V).filter((V) => V !== void 0);
|
|
5588
5583
|
y(T, k);
|
|
5589
5584
|
const P = { ...t.headersMapping };
|
|
5590
5585
|
Object.keys(P).forEach((V) => {
|
|
5591
5586
|
P[V] === f && (P[V] = g ?? "");
|
|
5592
|
-
}), t.setHeadersMapping(P), r(
|
|
5587
|
+
}), t.setHeadersMapping(P), r(_, void 0, !1), i(_, !1, !1);
|
|
5593
5588
|
}
|
|
5594
5589
|
x && (r(x, b, !1), i(x, !0, !1));
|
|
5595
5590
|
}, l = async ({
|
|
@@ -5598,8 +5593,8 @@ function Gi({
|
|
|
5598
5593
|
property: f,
|
|
5599
5594
|
namespace: k
|
|
5600
5595
|
}) => {
|
|
5601
|
-
const C = g ? re(g, k) : void 0, x = C ? ye(C) : void 0, h = t.importData.map((
|
|
5602
|
-
...
|
|
5596
|
+
const C = g ? re(g, k) : void 0, x = C ? ye(C) : void 0, h = t.importData.map((w) => S(w, b)), y = {
|
|
5597
|
+
...Za(h, f, ia),
|
|
5603
5598
|
editable: !0
|
|
5604
5599
|
};
|
|
5605
5600
|
x && (y ? (console.log("updating inferredNewProperty", {
|
|
@@ -5607,36 +5602,36 @@ function Gi({
|
|
|
5607
5602
|
inferredNewProperty: y
|
|
5608
5603
|
}), r(x, y, !1)) : r(x, f, !1), i(x, !0, !1));
|
|
5609
5604
|
};
|
|
5610
|
-
return /* @__PURE__ */
|
|
5611
|
-
/* @__PURE__ */
|
|
5605
|
+
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
|
|
5606
|
+
/* @__PURE__ */ n(nt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5612
5607
|
/* @__PURE__ */ e(N, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
|
|
5613
5608
|
/* @__PURE__ */ e(
|
|
5614
|
-
|
|
5609
|
+
ai,
|
|
5615
5610
|
{
|
|
5616
5611
|
headersMapping: t.headersMapping,
|
|
5617
5612
|
idColumn: t.idColumn,
|
|
5618
5613
|
originProperties: t.originProperties,
|
|
5619
|
-
destinationProperties:
|
|
5614
|
+
destinationProperties: o.properties,
|
|
5620
5615
|
onIdPropertyChanged: (g) => t.setIdColumn(g),
|
|
5621
5616
|
buildPropertyView: ({
|
|
5622
5617
|
property: g,
|
|
5623
5618
|
propertyKey: b,
|
|
5624
5619
|
importKey: f
|
|
5625
5620
|
}) => /* @__PURE__ */ e(
|
|
5626
|
-
|
|
5621
|
+
ii,
|
|
5627
5622
|
{
|
|
5628
5623
|
property: g,
|
|
5629
5624
|
propertyKey: b,
|
|
5630
5625
|
onPropertyNameChanged: (k, C) => r(`properties.${k}.name`, C, !1),
|
|
5631
5626
|
onEditClick: () => {
|
|
5632
|
-
!b || !g ||
|
|
5627
|
+
!b || !g || p({
|
|
5633
5628
|
...g,
|
|
5634
5629
|
id: b,
|
|
5635
5630
|
editable: !0
|
|
5636
5631
|
});
|
|
5637
5632
|
},
|
|
5638
5633
|
propertyTypeView: /* @__PURE__ */ e(
|
|
5639
|
-
|
|
5634
|
+
Hi,
|
|
5640
5635
|
{
|
|
5641
5636
|
property: g,
|
|
5642
5637
|
disabled: !1,
|
|
@@ -5656,18 +5651,18 @@ function Gi({
|
|
|
5656
5651
|
/* @__PURE__ */ e(
|
|
5657
5652
|
Fe,
|
|
5658
5653
|
{
|
|
5659
|
-
open:
|
|
5654
|
+
open: s !== void 0,
|
|
5660
5655
|
propertyKey: m,
|
|
5661
5656
|
property: u,
|
|
5662
5657
|
inArray: !1,
|
|
5663
5658
|
autoUpdateId: !1,
|
|
5664
|
-
onPropertyChanged:
|
|
5659
|
+
onPropertyChanged: d,
|
|
5665
5660
|
allowDataInference: !1,
|
|
5666
5661
|
onOkClicked: () => {
|
|
5667
|
-
|
|
5662
|
+
p(void 0);
|
|
5668
5663
|
},
|
|
5669
5664
|
onCancel: () => {
|
|
5670
|
-
|
|
5665
|
+
p(void 0);
|
|
5671
5666
|
},
|
|
5672
5667
|
autoOpenTypeSelect: !1,
|
|
5673
5668
|
existing: !1,
|
|
@@ -5677,66 +5672,66 @@ function Gi({
|
|
|
5677
5672
|
/* @__PURE__ */ e("div", { style: { height: "52px" } })
|
|
5678
5673
|
] });
|
|
5679
5674
|
}
|
|
5680
|
-
function
|
|
5675
|
+
function Hi({
|
|
5681
5676
|
property: t,
|
|
5682
5677
|
onPropertyChanged: a,
|
|
5683
5678
|
propertyKey: r,
|
|
5684
5679
|
customFields: i,
|
|
5685
|
-
disabled:
|
|
5680
|
+
disabled: o
|
|
5686
5681
|
}) {
|
|
5687
|
-
const { fields:
|
|
5682
|
+
const { fields: s } = Ae(), p = t ? Jt(t) : null, c = t ? dt(t, s) : null, [m, u] = K(!1);
|
|
5688
5683
|
return /* @__PURE__ */ e(
|
|
5689
|
-
|
|
5684
|
+
se,
|
|
5690
5685
|
{
|
|
5691
5686
|
title: t && c ? `${c?.name} - ${t.dataType}` : void 0,
|
|
5692
5687
|
open: m ? !1 : void 0,
|
|
5693
5688
|
children: /* @__PURE__ */ e(
|
|
5694
|
-
|
|
5689
|
+
qe,
|
|
5695
5690
|
{
|
|
5696
5691
|
open: m,
|
|
5697
5692
|
onOpenChange: u,
|
|
5698
5693
|
invisible: !0,
|
|
5699
5694
|
className: "w-full",
|
|
5700
|
-
disabled:
|
|
5695
|
+
disabled: o,
|
|
5701
5696
|
error: !c,
|
|
5702
|
-
value:
|
|
5697
|
+
value: p ?? "",
|
|
5703
5698
|
placeholder: "Select a property widget",
|
|
5704
5699
|
position: "item-aligned",
|
|
5705
|
-
renderValue: (
|
|
5706
|
-
onValueChange: (
|
|
5707
|
-
const l =
|
|
5700
|
+
renderValue: (d) => c ? /* @__PURE__ */ e(Ke, { fieldConfig: c }) : null,
|
|
5701
|
+
onValueChange: (d) => {
|
|
5702
|
+
const l = na(t, d, i);
|
|
5708
5703
|
r && (a({
|
|
5709
5704
|
id: r,
|
|
5710
5705
|
property: l,
|
|
5711
5706
|
previousId: r,
|
|
5712
5707
|
namespace: void 0
|
|
5713
|
-
}), console.log("newSelectedWidgetId",
|
|
5708
|
+
}), console.log("newSelectedWidgetId", d));
|
|
5714
5709
|
},
|
|
5715
|
-
children:
|
|
5716
|
-
|
|
5710
|
+
children: Ki.map(([d, l]) => /* @__PURE__ */ e(
|
|
5711
|
+
sa,
|
|
5717
5712
|
{
|
|
5718
|
-
value:
|
|
5713
|
+
value: d,
|
|
5719
5714
|
optionDisabled: !1,
|
|
5720
5715
|
fieldConfig: l,
|
|
5721
5716
|
existing: !1
|
|
5722
5717
|
},
|
|
5723
|
-
|
|
5718
|
+
d
|
|
5724
5719
|
))
|
|
5725
5720
|
}
|
|
5726
5721
|
)
|
|
5727
5722
|
}
|
|
5728
5723
|
);
|
|
5729
5724
|
}
|
|
5730
|
-
function
|
|
5731
|
-
|
|
5732
|
-
const
|
|
5733
|
-
t.setEntities(
|
|
5725
|
+
function Qi({ importConfig: t, properties: a, propertiesOrder: r }) {
|
|
5726
|
+
ne(() => {
|
|
5727
|
+
const o = ri(t.originProperties, a), s = t.importData.map((p) => oi(p, t.idColumn, t.headersMapping, a, o, "TEMP_PATH"));
|
|
5728
|
+
t.setEntities(s), console.log("res", { propertiesMapping: o, mappedData: s });
|
|
5734
5729
|
}, []);
|
|
5735
5730
|
const i = Ea();
|
|
5736
5731
|
return /* @__PURE__ */ e(
|
|
5737
5732
|
Ia,
|
|
5738
5733
|
{
|
|
5739
|
-
title: /* @__PURE__ */
|
|
5734
|
+
title: /* @__PURE__ */ n("div", { children: [
|
|
5740
5735
|
/* @__PURE__ */ e(N, { variant: "subtitle2", children: "Imported data preview" }),
|
|
5741
5736
|
/* @__PURE__ */ e(N, { variant: "caption", children: "Entities with the same id will be overwritten" })
|
|
5742
5737
|
] }),
|
|
@@ -5749,20 +5744,20 @@ function Zi({ importConfig: t, properties: a, propertiesOrder: r }) {
|
|
|
5749
5744
|
filterable: !1,
|
|
5750
5745
|
sortable: !1,
|
|
5751
5746
|
selectionController: i,
|
|
5752
|
-
displayedColumnIds: r.map((
|
|
5747
|
+
displayedColumnIds: r.map((o) => ({ key: o, disabled: !1 })),
|
|
5753
5748
|
properties: a
|
|
5754
5749
|
}
|
|
5755
5750
|
);
|
|
5756
5751
|
}
|
|
5757
|
-
function
|
|
5758
|
-
const r = Object.keys(t).reduce((
|
|
5759
|
-
const c = t[
|
|
5752
|
+
function ca(t, a = "") {
|
|
5753
|
+
const r = Object.keys(t).reduce((s, p) => {
|
|
5754
|
+
const c = t[p], m = Ba(p), u = a ? `${a}.${m}` : m;
|
|
5760
5755
|
if (c.dataType === "map" && c.properties) {
|
|
5761
|
-
const g =
|
|
5756
|
+
const g = ca(c.properties, u);
|
|
5762
5757
|
return {
|
|
5763
|
-
headersMapping: { ...
|
|
5758
|
+
headersMapping: { ...s.headersMapping, [p]: u },
|
|
5764
5759
|
properties: {
|
|
5765
|
-
...
|
|
5760
|
+
...s.properties,
|
|
5766
5761
|
[m]: {
|
|
5767
5762
|
...c,
|
|
5768
5763
|
properties: g.properties,
|
|
@@ -5771,28 +5766,28 @@ function sa(t, a = "") {
|
|
|
5771
5766
|
}
|
|
5772
5767
|
};
|
|
5773
5768
|
}
|
|
5774
|
-
const
|
|
5775
|
-
...
|
|
5769
|
+
const d = {
|
|
5770
|
+
...s.properties,
|
|
5776
5771
|
[m]: c
|
|
5777
5772
|
};
|
|
5778
5773
|
return {
|
|
5779
|
-
headersMapping: { ...
|
|
5780
|
-
properties:
|
|
5774
|
+
headersMapping: { ...s.headersMapping, [p]: u },
|
|
5775
|
+
properties: d
|
|
5781
5776
|
};
|
|
5782
5777
|
}, { headersMapping: {}, properties: {} }), i = Object.keys(r.headersMapping)?.[0];
|
|
5783
|
-
let
|
|
5784
|
-
return (i?.includes("id") || i?.includes("key")) && (
|
|
5778
|
+
let o;
|
|
5779
|
+
return (i?.includes("id") || i?.includes("key")) && (o = i), {
|
|
5785
5780
|
...r,
|
|
5786
|
-
idColumn:
|
|
5781
|
+
idColumn: o
|
|
5787
5782
|
};
|
|
5788
5783
|
}
|
|
5789
|
-
function
|
|
5790
|
-
const a = t.open, [r, i] = be.useState(!1), [
|
|
5791
|
-
r ?
|
|
5784
|
+
function da(t) {
|
|
5785
|
+
const a = t.open, [r, i] = be.useState(!1), [o, s] = be.useState(!1), p = Z(() => {
|
|
5786
|
+
r ? s(!0) : t.handleClose(void 0);
|
|
5792
5787
|
}, [r, t.handleClose]);
|
|
5793
|
-
return
|
|
5794
|
-
a || (i(!1),
|
|
5795
|
-
}, [a]), /* @__PURE__ */
|
|
5788
|
+
return ne(() => {
|
|
5789
|
+
a || (i(!1), s(!1));
|
|
5790
|
+
}, [a]), /* @__PURE__ */ n(
|
|
5796
5791
|
Ee,
|
|
5797
5792
|
{
|
|
5798
5793
|
open: a,
|
|
@@ -5800,22 +5795,22 @@ function la(t) {
|
|
|
5800
5795
|
fullHeight: !0,
|
|
5801
5796
|
scrollable: !1,
|
|
5802
5797
|
maxWidth: "7xl",
|
|
5803
|
-
onOpenChange: (c) => c ? void 0 :
|
|
5798
|
+
onOpenChange: (c) => c ? void 0 : p(),
|
|
5804
5799
|
children: [
|
|
5805
5800
|
a && /* @__PURE__ */ e(
|
|
5806
|
-
|
|
5801
|
+
Zi,
|
|
5807
5802
|
{
|
|
5808
5803
|
...t,
|
|
5809
|
-
handleCancel:
|
|
5804
|
+
handleCancel: p,
|
|
5810
5805
|
setFormDirty: i
|
|
5811
5806
|
}
|
|
5812
5807
|
),
|
|
5813
5808
|
/* @__PURE__ */ e(
|
|
5814
|
-
|
|
5809
|
+
Ri,
|
|
5815
5810
|
{
|
|
5816
|
-
open:
|
|
5811
|
+
open: o,
|
|
5817
5812
|
handleOk: () => t.handleClose(void 0),
|
|
5818
|
-
handleCancel: () =>
|
|
5813
|
+
handleCancel: () => s(!1),
|
|
5819
5814
|
body: "There are unsaved changes in this collection"
|
|
5820
5815
|
}
|
|
5821
5816
|
)
|
|
@@ -5823,18 +5818,18 @@ function la(t) {
|
|
|
5823
5818
|
}
|
|
5824
5819
|
);
|
|
5825
5820
|
}
|
|
5826
|
-
function
|
|
5821
|
+
function Zi({
|
|
5827
5822
|
isNewCollection: t,
|
|
5828
5823
|
initialValues: a,
|
|
5829
5824
|
configController: r,
|
|
5830
5825
|
editedCollectionPath: i,
|
|
5831
|
-
parentPathSegments:
|
|
5832
|
-
fullPath:
|
|
5833
|
-
collectionInference:
|
|
5826
|
+
parentPathSegments: o,
|
|
5827
|
+
fullPath: s,
|
|
5828
|
+
collectionInference: p,
|
|
5834
5829
|
handleClose: c,
|
|
5835
5830
|
reservedGroups: m,
|
|
5836
5831
|
extraView: u,
|
|
5837
|
-
handleCancel:
|
|
5832
|
+
handleCancel: d,
|
|
5838
5833
|
setFormDirty: l,
|
|
5839
5834
|
pathSuggestions: g,
|
|
5840
5835
|
getUser: b,
|
|
@@ -5844,26 +5839,26 @@ function Ji({
|
|
|
5844
5839
|
const { fields: C } = Ae(), x = Ie(), {
|
|
5845
5840
|
topLevelNavigation: h,
|
|
5846
5841
|
collections: y
|
|
5847
|
-
} = x,
|
|
5842
|
+
} = x, w = !a?.path && (o ?? []).length === 0, _ = (f ? f.subcollections : y) ?? [], v = _.map((q) => q.path.trim().toLowerCase()), T = _.map((q) => q.alias?.trim().toLowerCase()).filter(Boolean), P = ni();
|
|
5848
5843
|
if (!h)
|
|
5849
5844
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
5850
5845
|
const {
|
|
5851
5846
|
groups: V
|
|
5852
|
-
} = h, O =
|
|
5853
|
-
|
|
5847
|
+
} = h, O = ct(), E = Ge(), ue = Re({}), Pe = t ? w ? "welcome" : "details" : "properties", [z, M] = K(Pe), [G, Q] = be.useState(), [J, X] = be.useState(), [we, he] = be.useState(!1), [_e, mt] = be.useState();
|
|
5848
|
+
ne(() => {
|
|
5854
5849
|
try {
|
|
5855
|
-
x.initialised && (X(i ? x.getCollectionFromPaths([...
|
|
5856
|
-
} catch (
|
|
5857
|
-
console.error(
|
|
5850
|
+
x.initialised && (X(i ? x.getCollectionFromPaths([...o ?? [], i]) : void 0), he(!0));
|
|
5851
|
+
} catch (q) {
|
|
5852
|
+
console.error(q), mt(_e);
|
|
5858
5853
|
}
|
|
5859
5854
|
}, [x.getCollectionFromPaths, i, _e, x.initialised]);
|
|
5860
|
-
const Be = (
|
|
5861
|
-
const $ =
|
|
5855
|
+
const Be = (q) => {
|
|
5856
|
+
const $ = q.alias || q.path;
|
|
5862
5857
|
return r.saveCollection({
|
|
5863
5858
|
path: $,
|
|
5864
|
-
collectionData:
|
|
5859
|
+
collectionData: q,
|
|
5865
5860
|
previousPath: i,
|
|
5866
|
-
parentPathSegments:
|
|
5861
|
+
parentPathSegments: o
|
|
5867
5862
|
}).then(() => (Q(void 0), !0)).catch((D) => (Q(D), console.error(D), O.open({
|
|
5868
5863
|
type: "error",
|
|
5869
5864
|
message: "Error persisting collection: " + (D.message ?? "Details in the console")
|
|
@@ -5875,37 +5870,37 @@ function Ji({
|
|
|
5875
5870
|
properties: {},
|
|
5876
5871
|
propertiesOrder: [],
|
|
5877
5872
|
icon: vt[Math.floor(Math.random() * vt.length)],
|
|
5878
|
-
ownerId:
|
|
5873
|
+
ownerId: E.user?.uid ?? ""
|
|
5879
5874
|
}, te = Z(() => {
|
|
5880
|
-
z === "details" ? P.inUse ?
|
|
5881
|
-
}, [z, P.inUse, u]), Ve = Z((
|
|
5882
|
-
if (
|
|
5883
|
-
return
|
|
5884
|
-
}, [
|
|
5875
|
+
z === "details" ? P.inUse ? M("import_data_saving") : M(u ? "extra_view" : "properties") : M(z === "welcome" ? "details" : z === "import_data_mapping" ? "import_data_preview" : z === "import_data_preview" ? "details" : z === "extra_view" ? "properties" : "details");
|
|
5876
|
+
}, [z, P.inUse, u]), Ve = Z((q) => {
|
|
5877
|
+
if (p)
|
|
5878
|
+
return p?.(q.path, q.collectionGroup ?? !1, o ?? []);
|
|
5879
|
+
}, [p, o]), Qe = Z(async (q) => {
|
|
5885
5880
|
if (!Ve)
|
|
5886
|
-
return X(
|
|
5887
|
-
|
|
5888
|
-
const $ = await Ve?.(
|
|
5881
|
+
return X(q), Promise.resolve(q);
|
|
5882
|
+
M("loading");
|
|
5883
|
+
const $ = await Ve?.(q);
|
|
5889
5884
|
if (!$)
|
|
5890
|
-
return X(
|
|
5885
|
+
return X(q), Promise.resolve(q);
|
|
5891
5886
|
const D = {
|
|
5892
|
-
...
|
|
5887
|
+
...q ?? {}
|
|
5893
5888
|
};
|
|
5894
5889
|
return Object.keys($.properties ?? {}).length > 0 && (D.properties = $.properties, D.propertiesOrder = $.propertiesOrder), D.propertiesOrder ? (X(D), console.log("Inferred collection", {
|
|
5895
|
-
newCollection:
|
|
5890
|
+
newCollection: q ?? {},
|
|
5896
5891
|
values: D
|
|
5897
5892
|
}), D) : (D.propertiesOrder = Object.keys(D.properties), D);
|
|
5898
|
-
}, [
|
|
5893
|
+
}, [o, Ve]), ut = (q, $) => {
|
|
5899
5894
|
try {
|
|
5900
|
-
if (console.log("Submitting collection",
|
|
5901
|
-
Be(
|
|
5902
|
-
$.resetForm({ values: Te }),
|
|
5895
|
+
if (console.log("Submitting collection", q), !t) {
|
|
5896
|
+
Be(q).then(() => {
|
|
5897
|
+
$.resetForm({ values: Te }), c(q);
|
|
5903
5898
|
});
|
|
5904
5899
|
return;
|
|
5905
5900
|
}
|
|
5906
|
-
z === "welcome" ? (te(), $.resetForm({ values:
|
|
5901
|
+
z === "welcome" ? (te(), $.resetForm({ values: q })) : z === "details" ? u || P.inUse ? ($.resetForm({ values: q }), te()) : t ? Qe(q).then((D) => {
|
|
5907
5902
|
$.resetForm({
|
|
5908
|
-
values: D ??
|
|
5903
|
+
values: D ?? q,
|
|
5909
5904
|
touched: {
|
|
5910
5905
|
path: !0,
|
|
5911
5906
|
name: !0
|
|
@@ -5913,57 +5908,57 @@ function Ji({
|
|
|
5913
5908
|
});
|
|
5914
5909
|
}).finally(() => {
|
|
5915
5910
|
te();
|
|
5916
|
-
}) : ($.resetForm({ values:
|
|
5917
|
-
$.resetForm({ values: Te }), te(), c(
|
|
5918
|
-
}) : (te(), $.resetForm({ values:
|
|
5911
|
+
}) : ($.resetForm({ values: q }), te()) : z === "extra_view" ? (te(), $.resetForm({ values: q })) : z === "import_data_mapping" || z === "import_data_preview" ? te() : z === "properties" ? Be(q).then(() => {
|
|
5912
|
+
$.resetForm({ values: Te }), te(), c(q);
|
|
5913
|
+
}) : (te(), $.resetForm({ values: q }));
|
|
5919
5914
|
} catch (D) {
|
|
5920
5915
|
O.open({
|
|
5921
5916
|
type: "error",
|
|
5922
5917
|
message: "Error persisting collection: " + (D.message ?? "Details in the console")
|
|
5923
|
-
}), console.error(D), $.resetForm({ values:
|
|
5918
|
+
}), console.error(D), $.resetForm({ values: q });
|
|
5924
5919
|
}
|
|
5925
5920
|
};
|
|
5926
|
-
return !t && (!x.initialised || !we) ? /* @__PURE__ */ e(
|
|
5927
|
-
|
|
5921
|
+
return !t && (!x.initialised || !we) ? /* @__PURE__ */ e(jt, {}) : /* @__PURE__ */ e(Le, { fullHeight: !0, children: /* @__PURE__ */ e(
|
|
5922
|
+
Nt,
|
|
5928
5923
|
{
|
|
5929
5924
|
initialValues: Te,
|
|
5930
|
-
validationSchema: (z === "properties" || z === "subcollections" || z === "details") &&
|
|
5925
|
+
validationSchema: (z === "properties" || z === "subcollections" || z === "details") && ci,
|
|
5931
5926
|
validate: () => {
|
|
5932
5927
|
if (z === "properties")
|
|
5933
5928
|
return ue.current;
|
|
5934
5929
|
},
|
|
5935
5930
|
onSubmit: ut,
|
|
5936
5931
|
children: ({
|
|
5937
|
-
values:
|
|
5932
|
+
values: q,
|
|
5938
5933
|
setFieldValue: $,
|
|
5939
5934
|
isSubmitting: D,
|
|
5940
5935
|
dirty: A,
|
|
5941
5936
|
submitCount: j
|
|
5942
5937
|
}) => {
|
|
5943
|
-
const
|
|
5944
|
-
|
|
5938
|
+
const I = q.path ?? i, ae = s?.includes("/") ? s?.split("/").slice(0, -1).join("/") + "/" + I : I, ie = ae && k ? () => k(ae) : void 0;
|
|
5939
|
+
ne(() => {
|
|
5945
5940
|
l(A);
|
|
5946
5941
|
}, [A]);
|
|
5947
5942
|
function ge(W) {
|
|
5948
|
-
P.setInUse(!0),
|
|
5949
|
-
const
|
|
5950
|
-
$("properties",
|
|
5943
|
+
P.setInUse(!0), Ja(W, ia).then((Me) => {
|
|
5944
|
+
const le = ca(Me);
|
|
5945
|
+
$("properties", le.properties), $("propertiesOrder", Object.keys(le.properties)), P.setIdColumn(le.idColumn), P.setImportData(W), P.setHeadersMapping(le.headersMapping), P.setOriginProperties(le.properties);
|
|
5951
5946
|
});
|
|
5952
5947
|
}
|
|
5953
|
-
const ht = !!
|
|
5954
|
-
const W = { ...
|
|
5948
|
+
const ht = !!q.name && !!q.path, Ze = () => {
|
|
5949
|
+
const W = { ...q.properties };
|
|
5955
5950
|
P.idColumn && delete W[P.idColumn], $("properties", W), te(), console.log("onImportMappingComplete", {
|
|
5956
5951
|
importConfig: P,
|
|
5957
5952
|
properties: W
|
|
5958
5953
|
});
|
|
5959
5954
|
};
|
|
5960
|
-
return /* @__PURE__ */
|
|
5961
|
-
!t && /* @__PURE__ */
|
|
5955
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
5956
|
+
!t && /* @__PURE__ */ n(
|
|
5962
5957
|
Ma,
|
|
5963
5958
|
{
|
|
5964
5959
|
value: z,
|
|
5965
5960
|
className: ve(xt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
5966
|
-
onValueChange: (W) =>
|
|
5961
|
+
onValueChange: (W) => M(W),
|
|
5967
5962
|
children: [
|
|
5968
5963
|
/* @__PURE__ */ e(ft, { value: "details", children: "Details" }),
|
|
5969
5964
|
/* @__PURE__ */ e(ft, { value: "properties", children: "Properties" }),
|
|
@@ -5971,8 +5966,8 @@ function Ji({
|
|
|
5971
5966
|
]
|
|
5972
5967
|
}
|
|
5973
5968
|
),
|
|
5974
|
-
/* @__PURE__ */
|
|
5975
|
-
|
|
5969
|
+
/* @__PURE__ */ n(
|
|
5970
|
+
aa,
|
|
5976
5971
|
{
|
|
5977
5972
|
noValidate: !0,
|
|
5978
5973
|
className: ve(
|
|
@@ -5980,14 +5975,14 @@ function Ji({
|
|
|
5980
5975
|
"flex-grow flex flex-col relative"
|
|
5981
5976
|
),
|
|
5982
5977
|
children: [
|
|
5983
|
-
z === "loading" && /* @__PURE__ */ e(
|
|
5984
|
-
z === "extra_view" &&
|
|
5978
|
+
z === "loading" && /* @__PURE__ */ e(jt, {}),
|
|
5979
|
+
z === "extra_view" && I && u?.View && /* @__PURE__ */ e(u.View, { path: I }),
|
|
5985
5980
|
z === "welcome" && /* @__PURE__ */ e(
|
|
5986
|
-
|
|
5981
|
+
Li,
|
|
5987
5982
|
{
|
|
5988
|
-
path:
|
|
5983
|
+
path: I,
|
|
5989
5984
|
onContinue: (W) => {
|
|
5990
|
-
W ? (ge(W),
|
|
5985
|
+
W ? (ge(W), M("import_data_mapping")) : M("details");
|
|
5991
5986
|
},
|
|
5992
5987
|
collections: y,
|
|
5993
5988
|
parentCollection: f,
|
|
@@ -6002,18 +5997,18 @@ function Ji({
|
|
|
6002
5997
|
}
|
|
6003
5998
|
),
|
|
6004
5999
|
z === "import_data_preview" && P && /* @__PURE__ */ e(
|
|
6005
|
-
|
|
6000
|
+
Qi,
|
|
6006
6001
|
{
|
|
6007
6002
|
importConfig: P,
|
|
6008
|
-
properties:
|
|
6009
|
-
propertiesOrder:
|
|
6003
|
+
properties: q.properties,
|
|
6004
|
+
propertiesOrder: q.propertiesOrder
|
|
6010
6005
|
}
|
|
6011
6006
|
),
|
|
6012
6007
|
z === "import_data_saving" && P && /* @__PURE__ */ e(
|
|
6013
|
-
|
|
6008
|
+
si,
|
|
6014
6009
|
{
|
|
6015
6010
|
importConfig: P,
|
|
6016
|
-
collection:
|
|
6011
|
+
collection: q,
|
|
6017
6012
|
onImportSuccess: (W) => {
|
|
6018
6013
|
c(W), O.open({
|
|
6019
6014
|
type: "info",
|
|
@@ -6023,7 +6018,7 @@ function Ji({
|
|
|
6023
6018
|
}
|
|
6024
6019
|
),
|
|
6025
6020
|
z === "details" && /* @__PURE__ */ e(
|
|
6026
|
-
|
|
6021
|
+
mi,
|
|
6027
6022
|
{
|
|
6028
6023
|
existingPaths: v,
|
|
6029
6024
|
existingAliases: T,
|
|
@@ -6033,26 +6028,26 @@ function Ji({
|
|
|
6033
6028
|
}
|
|
6034
6029
|
),
|
|
6035
6030
|
z === "subcollections" && J && /* @__PURE__ */ e(
|
|
6036
|
-
|
|
6031
|
+
$i,
|
|
6037
6032
|
{
|
|
6038
6033
|
parentCollection: f,
|
|
6039
6034
|
configController: r,
|
|
6040
6035
|
getUser: b,
|
|
6041
|
-
collectionInference:
|
|
6042
|
-
parentPathSegments:
|
|
6036
|
+
collectionInference: p,
|
|
6037
|
+
parentPathSegments: o,
|
|
6043
6038
|
collection: J
|
|
6044
6039
|
}
|
|
6045
6040
|
),
|
|
6046
6041
|
z === "properties" && /* @__PURE__ */ e(
|
|
6047
|
-
|
|
6042
|
+
Di,
|
|
6048
6043
|
{
|
|
6049
6044
|
showErrors: j > 0,
|
|
6050
6045
|
isNewCollection: t,
|
|
6051
6046
|
reservedGroups: m,
|
|
6052
|
-
onPropertyError: (W, Me,
|
|
6047
|
+
onPropertyError: (W, Me, le) => {
|
|
6053
6048
|
ue.current = Da({
|
|
6054
6049
|
...ue.current,
|
|
6055
|
-
[W]:
|
|
6050
|
+
[W]: le
|
|
6056
6051
|
}, !0);
|
|
6057
6052
|
},
|
|
6058
6053
|
getUser: b,
|
|
@@ -6063,89 +6058,89 @@ function Ji({
|
|
|
6063
6058
|
pe,
|
|
6064
6059
|
{
|
|
6065
6060
|
color: "primary",
|
|
6066
|
-
onClick: () =>
|
|
6061
|
+
onClick: () => M("extra_view"),
|
|
6067
6062
|
children: u.icon
|
|
6068
6063
|
}
|
|
6069
6064
|
)
|
|
6070
6065
|
}
|
|
6071
6066
|
),
|
|
6072
|
-
z !== "welcome" && /* @__PURE__ */
|
|
6073
|
-
|
|
6067
|
+
z !== "welcome" && /* @__PURE__ */ n(
|
|
6068
|
+
Ye,
|
|
6074
6069
|
{
|
|
6075
6070
|
position: "absolute",
|
|
6076
6071
|
children: [
|
|
6077
|
-
|
|
6078
|
-
t &&
|
|
6079
|
-
|
|
6072
|
+
G && /* @__PURE__ */ e(ta, { error: G }),
|
|
6073
|
+
t && w && z === "import_data_mapping" && /* @__PURE__ */ n(
|
|
6074
|
+
B,
|
|
6080
6075
|
{
|
|
6081
6076
|
variant: "text",
|
|
6082
6077
|
type: "button",
|
|
6083
|
-
onClick: () => (P.setInUse(!1),
|
|
6078
|
+
onClick: () => (P.setInUse(!1), M("welcome")),
|
|
6084
6079
|
children: [
|
|
6085
|
-
/* @__PURE__ */ e(
|
|
6080
|
+
/* @__PURE__ */ e(Je, {}),
|
|
6086
6081
|
"Back"
|
|
6087
6082
|
]
|
|
6088
6083
|
}
|
|
6089
6084
|
),
|
|
6090
|
-
t &&
|
|
6091
|
-
|
|
6085
|
+
t && w && z === "import_data_preview" && /* @__PURE__ */ n(
|
|
6086
|
+
B,
|
|
6092
6087
|
{
|
|
6093
6088
|
variant: "text",
|
|
6094
6089
|
type: "button",
|
|
6095
6090
|
onClick: () => {
|
|
6096
|
-
Be(
|
|
6091
|
+
Be(q), M("import_data_mapping");
|
|
6097
6092
|
},
|
|
6098
6093
|
children: [
|
|
6099
|
-
/* @__PURE__ */ e(
|
|
6094
|
+
/* @__PURE__ */ e(Je, {}),
|
|
6100
6095
|
"Back"
|
|
6101
6096
|
]
|
|
6102
6097
|
}
|
|
6103
6098
|
),
|
|
6104
|
-
t &&
|
|
6105
|
-
|
|
6099
|
+
t && w && z === "details" && /* @__PURE__ */ n(
|
|
6100
|
+
B,
|
|
6106
6101
|
{
|
|
6107
6102
|
variant: "text",
|
|
6108
6103
|
type: "button",
|
|
6109
|
-
onClick: () =>
|
|
6104
|
+
onClick: () => M("welcome"),
|
|
6110
6105
|
children: [
|
|
6111
|
-
/* @__PURE__ */ e(
|
|
6106
|
+
/* @__PURE__ */ e(Je, {}),
|
|
6112
6107
|
"Back"
|
|
6113
6108
|
]
|
|
6114
6109
|
}
|
|
6115
6110
|
),
|
|
6116
|
-
t && z === "properties" && /* @__PURE__ */
|
|
6117
|
-
|
|
6111
|
+
t && z === "properties" && /* @__PURE__ */ n(
|
|
6112
|
+
B,
|
|
6118
6113
|
{
|
|
6119
6114
|
variant: "text",
|
|
6120
6115
|
type: "button",
|
|
6121
|
-
onClick: () =>
|
|
6116
|
+
onClick: () => M("details"),
|
|
6122
6117
|
children: [
|
|
6123
|
-
/* @__PURE__ */ e(
|
|
6118
|
+
/* @__PURE__ */ e(Je, {}),
|
|
6124
6119
|
"Back"
|
|
6125
6120
|
]
|
|
6126
6121
|
}
|
|
6127
6122
|
),
|
|
6128
6123
|
/* @__PURE__ */ e(
|
|
6129
|
-
|
|
6124
|
+
B,
|
|
6130
6125
|
{
|
|
6131
6126
|
variant: "text",
|
|
6132
6127
|
onClick: () => {
|
|
6133
|
-
|
|
6128
|
+
d();
|
|
6134
6129
|
},
|
|
6135
6130
|
children: "Cancel"
|
|
6136
6131
|
}
|
|
6137
6132
|
),
|
|
6138
6133
|
t && z === "import_data_mapping" && /* @__PURE__ */ e(
|
|
6139
|
-
|
|
6134
|
+
B,
|
|
6140
6135
|
{
|
|
6141
6136
|
variant: "filled",
|
|
6142
6137
|
color: "primary",
|
|
6143
|
-
onClick:
|
|
6138
|
+
onClick: Ze,
|
|
6144
6139
|
children: "Next"
|
|
6145
6140
|
}
|
|
6146
6141
|
),
|
|
6147
6142
|
t && z === "import_data_preview" && /* @__PURE__ */ e(
|
|
6148
|
-
|
|
6143
|
+
B,
|
|
6149
6144
|
{
|
|
6150
6145
|
variant: "filled",
|
|
6151
6146
|
color: "primary",
|
|
@@ -6155,7 +6150,7 @@ function Ji({
|
|
|
6155
6150
|
children: "Next"
|
|
6156
6151
|
}
|
|
6157
6152
|
),
|
|
6158
|
-
t && (z === "details" || z === "properties") && /* @__PURE__ */
|
|
6153
|
+
t && (z === "details" || z === "properties") && /* @__PURE__ */ n(
|
|
6159
6154
|
wt,
|
|
6160
6155
|
{
|
|
6161
6156
|
variant: "filled",
|
|
@@ -6163,7 +6158,7 @@ function Ji({
|
|
|
6163
6158
|
type: "submit",
|
|
6164
6159
|
loading: D,
|
|
6165
6160
|
disabled: D || z === "details" && !ht,
|
|
6166
|
-
startIcon: z === "properties" ? /* @__PURE__ */ e(
|
|
6161
|
+
startIcon: z === "properties" ? /* @__PURE__ */ e(Ra, {}) : void 0,
|
|
6167
6162
|
children: [
|
|
6168
6163
|
z === "details" && "Next",
|
|
6169
6164
|
z === "properties" && "Create collection"
|
|
@@ -6191,22 +6186,22 @@ function Ji({
|
|
|
6191
6186
|
}
|
|
6192
6187
|
) });
|
|
6193
6188
|
}
|
|
6194
|
-
const
|
|
6189
|
+
const pa = R.createContext({}), ma = R.createContext({}), Ji = R.memo(
|
|
6195
6190
|
function({
|
|
6196
6191
|
children: a,
|
|
6197
6192
|
collectionConfigController: r,
|
|
6198
6193
|
configPermissions: i,
|
|
6199
|
-
reservedGroups:
|
|
6200
|
-
collectionInference:
|
|
6201
|
-
extraView:
|
|
6194
|
+
reservedGroups: o,
|
|
6195
|
+
collectionInference: s,
|
|
6196
|
+
extraView: p,
|
|
6202
6197
|
pathSuggestions: c,
|
|
6203
6198
|
getUser: m,
|
|
6204
6199
|
getData: u
|
|
6205
6200
|
}) {
|
|
6206
|
-
const
|
|
6201
|
+
const d = Ie(), l = li(), {
|
|
6207
6202
|
collections: g
|
|
6208
|
-
} =
|
|
6209
|
-
|
|
6203
|
+
} = d, b = g.map((v) => v.path.trim().toLowerCase()), [f, k] = R.useState();
|
|
6204
|
+
ne(() => {
|
|
6210
6205
|
c && c().then((v) => {
|
|
6211
6206
|
k(v.filter((T) => !b.includes(T.trim().toLowerCase())));
|
|
6212
6207
|
});
|
|
@@ -6221,43 +6216,45 @@ const ca = R.createContext({}), da = R.createContext({}), Xi = R.memo(
|
|
|
6221
6216
|
fullPath: T,
|
|
6222
6217
|
parentPathSegments: P,
|
|
6223
6218
|
isNewCollection: !1,
|
|
6224
|
-
parentCollection: V
|
|
6219
|
+
parentCollection: V,
|
|
6220
|
+
redirect: !1
|
|
6225
6221
|
});
|
|
6226
|
-
}, []),
|
|
6222
|
+
}, []), w = R.useCallback(({ parentPathSegments: v, parentCollection: T, initialValues: P, redirect: V }) => {
|
|
6227
6223
|
x({
|
|
6228
6224
|
isNewCollection: !0,
|
|
6229
6225
|
parentPathSegments: v,
|
|
6230
6226
|
parentCollection: T,
|
|
6231
|
-
initialValues: P
|
|
6227
|
+
initialValues: P,
|
|
6228
|
+
redirect: V
|
|
6232
6229
|
});
|
|
6233
|
-
}, []),
|
|
6234
|
-
return /* @__PURE__ */ e(
|
|
6235
|
-
|
|
6230
|
+
}, []), _ = c ? (v) => !v && f ? Promise.resolve(f) : c?.(v) : void 0;
|
|
6231
|
+
return /* @__PURE__ */ e(pa.Provider, { value: r, children: /* @__PURE__ */ n(
|
|
6232
|
+
ma.Provider,
|
|
6236
6233
|
{
|
|
6237
6234
|
value: {
|
|
6238
6235
|
editCollection: y,
|
|
6239
|
-
createCollection:
|
|
6236
|
+
createCollection: w,
|
|
6240
6237
|
configPermissions: i ?? h,
|
|
6241
6238
|
rootPathSuggestions: f
|
|
6242
6239
|
},
|
|
6243
6240
|
children: [
|
|
6244
6241
|
a,
|
|
6245
6242
|
/* @__PURE__ */ e(
|
|
6246
|
-
|
|
6243
|
+
da,
|
|
6247
6244
|
{
|
|
6248
6245
|
open: !!C,
|
|
6249
6246
|
configController: r,
|
|
6250
6247
|
isNewCollection: !1,
|
|
6251
|
-
collectionInference:
|
|
6248
|
+
collectionInference: s,
|
|
6252
6249
|
...C,
|
|
6253
6250
|
getData: u,
|
|
6254
|
-
reservedGroups:
|
|
6255
|
-
extraView:
|
|
6256
|
-
pathSuggestions:
|
|
6251
|
+
reservedGroups: o,
|
|
6252
|
+
extraView: p,
|
|
6253
|
+
pathSuggestions: _,
|
|
6257
6254
|
getUser: m,
|
|
6258
6255
|
handleClose: (v) => {
|
|
6259
|
-
if (v && C?.isNewCollection && !C.parentPathSegments.length) {
|
|
6260
|
-
const T =
|
|
6256
|
+
if (C?.redirect && v && C?.isNewCollection && !C.parentPathSegments.length) {
|
|
6257
|
+
const T = d.buildUrlCollectionPath(v.alias ?? v.path);
|
|
6261
6258
|
l(T);
|
|
6262
6259
|
}
|
|
6263
6260
|
x(void 0);
|
|
@@ -6268,25 +6265,25 @@ const ca = R.createContext({}), da = R.createContext({}), Xi = R.memo(
|
|
|
6268
6265
|
}
|
|
6269
6266
|
) });
|
|
6270
6267
|
},
|
|
6271
|
-
|
|
6272
|
-
),
|
|
6273
|
-
function
|
|
6268
|
+
ot
|
|
6269
|
+
), He = () => $t(ma), ua = () => $t(pa);
|
|
6270
|
+
function Xi({
|
|
6274
6271
|
path: t,
|
|
6275
6272
|
parentPathSegments: a,
|
|
6276
6273
|
collection: r,
|
|
6277
6274
|
tableController: i
|
|
6278
6275
|
}) {
|
|
6279
|
-
const
|
|
6280
|
-
user:
|
|
6276
|
+
const o = Ge(), s = Ie(), p = He(), c = ua(), m = ct(), u = s.getCollectionFromPaths(a), d = p.configPermissions ? p.configPermissions({
|
|
6277
|
+
user: o.user,
|
|
6281
6278
|
collection: r
|
|
6282
6279
|
}).editCollections : !0;
|
|
6283
6280
|
let l = null;
|
|
6284
|
-
return (!
|
|
6285
|
-
|
|
6281
|
+
return (!ot(We(i.filterValues), We(r.initialFilter)) || !ot(We(i.sortBy), We(r.initialSort))) && (l = /* @__PURE__ */ e(
|
|
6282
|
+
se,
|
|
6286
6283
|
{
|
|
6287
6284
|
title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
6288
6285
|
children: /* @__PURE__ */ e(
|
|
6289
|
-
|
|
6286
|
+
B,
|
|
6290
6287
|
{
|
|
6291
6288
|
color: "primary",
|
|
6292
6289
|
size: "small",
|
|
@@ -6307,65 +6304,65 @@ function Wi({
|
|
|
6307
6304
|
message: "Default config saved"
|
|
6308
6305
|
});
|
|
6309
6306
|
}),
|
|
6310
|
-
children: /* @__PURE__ */ e(
|
|
6307
|
+
children: /* @__PURE__ */ e(Ua, {})
|
|
6311
6308
|
}
|
|
6312
6309
|
)
|
|
6313
6310
|
}
|
|
6314
|
-
)), /* @__PURE__ */
|
|
6315
|
-
|
|
6311
|
+
)), /* @__PURE__ */ n(F, { children: [
|
|
6312
|
+
d && l,
|
|
6316
6313
|
/* @__PURE__ */ e(
|
|
6317
|
-
|
|
6314
|
+
se,
|
|
6318
6315
|
{
|
|
6319
|
-
title:
|
|
6316
|
+
title: d ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
6320
6317
|
children: /* @__PURE__ */ e(
|
|
6321
6318
|
pe,
|
|
6322
6319
|
{
|
|
6323
6320
|
color: "primary",
|
|
6324
|
-
disabled: !
|
|
6325
|
-
onClick:
|
|
6326
|
-
children: /* @__PURE__ */ e(
|
|
6321
|
+
disabled: !d,
|
|
6322
|
+
onClick: d ? () => p?.editCollection({ path: r.path, fullPath: t, parentPathSegments: a, parentCollection: u }) : void 0,
|
|
6323
|
+
children: /* @__PURE__ */ e(st, {})
|
|
6327
6324
|
}
|
|
6328
6325
|
)
|
|
6329
6326
|
}
|
|
6330
6327
|
)
|
|
6331
6328
|
] });
|
|
6332
6329
|
}
|
|
6333
|
-
function
|
|
6330
|
+
function We(t) {
|
|
6334
6331
|
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
6335
6332
|
}
|
|
6336
|
-
function
|
|
6333
|
+
function Wi({
|
|
6337
6334
|
path: t,
|
|
6338
6335
|
collection: a
|
|
6339
6336
|
}) {
|
|
6340
|
-
const r =
|
|
6337
|
+
const r = Ge(), i = ua(), o = He(), s = o.configPermissions({
|
|
6341
6338
|
user: r.user,
|
|
6342
6339
|
collection: a
|
|
6343
|
-
}),
|
|
6344
|
-
|
|
6345
|
-
}, [
|
|
6340
|
+
}), p = Z(() => {
|
|
6341
|
+
o?.editCollection({ path: t, parentPathSegments: [] });
|
|
6342
|
+
}, [o, t]), [c, m] = K(!1), u = Z(() => {
|
|
6346
6343
|
i?.deleteCollection({ path: t });
|
|
6347
6344
|
}, [t, i]);
|
|
6348
|
-
return /* @__PURE__ */
|
|
6349
|
-
/* @__PURE__ */
|
|
6350
|
-
|
|
6351
|
-
|
|
6345
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
6346
|
+
/* @__PURE__ */ n("div", { children: [
|
|
6347
|
+
s.deleteCollections && /* @__PURE__ */ e(
|
|
6348
|
+
$a,
|
|
6352
6349
|
{
|
|
6353
|
-
trigger: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
|
|
6354
|
-
children: /* @__PURE__ */
|
|
6355
|
-
|
|
6350
|
+
trigger: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(La, { size: "small" }) }),
|
|
6351
|
+
children: /* @__PURE__ */ n(Ya, { onClick: (d) => {
|
|
6352
|
+
d.preventDefault(), d.stopPropagation(), m(!0);
|
|
6356
6353
|
}, children: [
|
|
6357
6354
|
/* @__PURE__ */ e(it, {}),
|
|
6358
6355
|
"Delete"
|
|
6359
6356
|
] })
|
|
6360
6357
|
}
|
|
6361
6358
|
),
|
|
6362
|
-
|
|
6359
|
+
s.editCollections && /* @__PURE__ */ e(
|
|
6363
6360
|
pe,
|
|
6364
6361
|
{
|
|
6365
|
-
onClick: (
|
|
6366
|
-
|
|
6362
|
+
onClick: (d) => {
|
|
6363
|
+
p();
|
|
6367
6364
|
},
|
|
6368
|
-
children: /* @__PURE__ */ e(
|
|
6365
|
+
children: /* @__PURE__ */ e(st, { size: "small" })
|
|
6369
6366
|
}
|
|
6370
6367
|
)
|
|
6371
6368
|
] }),
|
|
@@ -6375,8 +6372,8 @@ function er({
|
|
|
6375
6372
|
open: c,
|
|
6376
6373
|
onAccept: u,
|
|
6377
6374
|
onCancel: () => m(!1),
|
|
6378
|
-
title: /* @__PURE__ */ e(
|
|
6379
|
-
body: /* @__PURE__ */
|
|
6375
|
+
title: /* @__PURE__ */ e(F, { children: "Delete this collection?" }),
|
|
6376
|
+
body: /* @__PURE__ */ n(F, { children: [
|
|
6380
6377
|
" This will ",
|
|
6381
6378
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
6382
6379
|
", only the collection in the CMS"
|
|
@@ -6385,24 +6382,25 @@ function er({
|
|
|
6385
6382
|
)
|
|
6386
6383
|
] });
|
|
6387
6384
|
}
|
|
6388
|
-
function
|
|
6385
|
+
function er({
|
|
6389
6386
|
group: t,
|
|
6390
6387
|
context: a
|
|
6391
6388
|
}) {
|
|
6392
6389
|
if (!a.navigation.topLevelNavigation)
|
|
6393
6390
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
6394
|
-
const r =
|
|
6391
|
+
const r = Ge(), i = He(), o = i.configPermissions ? i.configPermissions({
|
|
6395
6392
|
user: r.user
|
|
6396
6393
|
}).createCollections : !0;
|
|
6397
6394
|
return /* @__PURE__ */ e(
|
|
6398
|
-
|
|
6395
|
+
ea,
|
|
6399
6396
|
{
|
|
6400
6397
|
className: ve("h-full p-4 min-h-[124px]"),
|
|
6401
|
-
onClick: i &&
|
|
6398
|
+
onClick: i && o ? () => i.createCollection({
|
|
6402
6399
|
initialValues: t ? { group: t } : void 0,
|
|
6403
|
-
parentPathSegments: []
|
|
6400
|
+
parentPathSegments: [],
|
|
6401
|
+
redirect: !0
|
|
6404
6402
|
}) : void 0,
|
|
6405
|
-
children: /* @__PURE__ */
|
|
6403
|
+
children: /* @__PURE__ */ n(
|
|
6406
6404
|
"div",
|
|
6407
6405
|
{
|
|
6408
6406
|
className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
|
|
@@ -6417,22 +6415,22 @@ function tr({
|
|
|
6417
6415
|
children: "Add new collection".toUpperCase()
|
|
6418
6416
|
}
|
|
6419
6417
|
),
|
|
6420
|
-
!
|
|
6418
|
+
!o && /* @__PURE__ */ e(N, { variant: "caption", children: "You don't have permissions to create collections" })
|
|
6421
6419
|
]
|
|
6422
6420
|
}
|
|
6423
6421
|
)
|
|
6424
6422
|
}
|
|
6425
6423
|
);
|
|
6426
6424
|
}
|
|
6427
|
-
function
|
|
6428
|
-
const t =
|
|
6425
|
+
function tr() {
|
|
6426
|
+
const t = Ge(), a = Ie(), r = He(), i = r.configPermissions ? r.configPermissions({
|
|
6429
6427
|
user: t.user
|
|
6430
|
-
}).createCollections : !0,
|
|
6428
|
+
}).createCollections : !0, o = r.rootPathSuggestions ?? [], s = o.length > 3 || a.collections.length === 0 && o.length > 0;
|
|
6431
6429
|
return /* @__PURE__ */ e(
|
|
6432
|
-
|
|
6430
|
+
Ka,
|
|
6433
6431
|
{
|
|
6434
|
-
in:
|
|
6435
|
-
children: /* @__PURE__ */
|
|
6432
|
+
in: s,
|
|
6433
|
+
children: /* @__PURE__ */ n(
|
|
6436
6434
|
"div",
|
|
6437
6435
|
{
|
|
6438
6436
|
className: "flex flex-col gap-1 p-2",
|
|
@@ -6442,19 +6440,20 @@ function ar() {
|
|
|
6442
6440
|
"div",
|
|
6443
6441
|
{
|
|
6444
6442
|
className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
|
|
6445
|
-
children:
|
|
6443
|
+
children: o.map((p) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
6446
6444
|
at,
|
|
6447
6445
|
{
|
|
6448
6446
|
icon: /* @__PURE__ */ e(Oe, { size: "small" }),
|
|
6449
6447
|
colorScheme: "cyanLighter",
|
|
6450
6448
|
onClick: r && i ? () => r.createCollection({
|
|
6451
|
-
initialValues: { path:
|
|
6452
|
-
parentPathSegments: []
|
|
6449
|
+
initialValues: { path: p, name: Ot(p) },
|
|
6450
|
+
parentPathSegments: [],
|
|
6451
|
+
redirect: !0
|
|
6453
6452
|
}) : void 0,
|
|
6454
6453
|
size: "small",
|
|
6455
|
-
children:
|
|
6454
|
+
children: p
|
|
6456
6455
|
}
|
|
6457
|
-
) },
|
|
6456
|
+
) }, p))
|
|
6458
6457
|
}
|
|
6459
6458
|
)
|
|
6460
6459
|
]
|
|
@@ -6463,83 +6462,66 @@ function ar() {
|
|
|
6463
6462
|
}
|
|
6464
6463
|
);
|
|
6465
6464
|
}
|
|
6466
|
-
function
|
|
6467
|
-
const r =
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
const d = r?.find((c) => c.path === n.path || c.alias && n.alias && c.alias === n.alias);
|
|
6473
|
-
return d ? (Object.values(d.properties).forEach((m) => {
|
|
6474
|
-
m.editable = !0;
|
|
6475
|
-
}), { ...ua(d, n), deletable: !1 }) : {
|
|
6476
|
-
...n,
|
|
6477
|
-
properties: ma(n.properties),
|
|
6478
|
-
deletable: !1
|
|
6479
|
-
};
|
|
6480
|
-
}), s = r.filter((n) => !i.map((d) => d.path).includes(n.path) || !i.map((d) => d.alias).includes(n.alias));
|
|
6481
|
-
return [...i, ...s];
|
|
6482
|
-
}
|
|
6483
|
-
function ma(t) {
|
|
6484
|
-
return Object.entries(t).reduce((a, [r, i]) => {
|
|
6485
|
-
if (!ne(i) && i.dataType === "map" && i.properties) {
|
|
6486
|
-
const s = { ...i, properties: ma(i.properties) };
|
|
6487
|
-
a[r] = s;
|
|
6488
|
-
}
|
|
6489
|
-
return ne(i) ? a[r] = i : a[r] = { ...i, editable: !1 }, a;
|
|
6490
|
-
}, {});
|
|
6465
|
+
function ha(t, a) {
|
|
6466
|
+
const r = (a ?? []).map((o) => {
|
|
6467
|
+
const s = t?.find((p) => p.path === o.path || p.alias && o.alias && p.alias === o.alias);
|
|
6468
|
+
return s ? ar(s, o) : o;
|
|
6469
|
+
}), i = t.filter((o) => !r.map((s) => s.path).includes(o.path) || !r.map((s) => s.alias).includes(o.alias));
|
|
6470
|
+
return [...r, ...i];
|
|
6491
6471
|
}
|
|
6492
|
-
function
|
|
6493
|
-
const r = t
|
|
6494
|
-
const p = a.subcollections?.find((l) => l.path === u.path) ?? a.subcollections?.find((l) => l.alias === u.alias);
|
|
6495
|
-
return p ? ua(u, p) : u;
|
|
6496
|
-
}), i = { ...t.properties };
|
|
6472
|
+
function ar(t, a) {
|
|
6473
|
+
const r = ha(t?.subcollections ?? [], a?.subcollections ?? []), i = { ...t.properties };
|
|
6497
6474
|
Object.keys(a.properties).forEach((u) => {
|
|
6498
|
-
const
|
|
6499
|
-
|
|
6475
|
+
const d = t.properties[u];
|
|
6476
|
+
d ? i[u] = ga(d, a.properties[u]) : i[u] = a.properties[u];
|
|
6500
6477
|
});
|
|
6501
|
-
const
|
|
6478
|
+
const o = L(t, a), s = Rt(t), p = Rt(a), c = [.../* @__PURE__ */ new Set([...s, ...p])], m = [.../* @__PURE__ */ new Set([...t.entityViews ?? [], ...a.entityViews ?? []])];
|
|
6502
6479
|
return {
|
|
6503
|
-
...
|
|
6480
|
+
...o,
|
|
6504
6481
|
subcollections: r,
|
|
6505
6482
|
properties: Ga(i, c),
|
|
6506
6483
|
propertiesOrder: c,
|
|
6507
6484
|
entityViews: m
|
|
6508
6485
|
};
|
|
6509
6486
|
}
|
|
6510
|
-
function
|
|
6511
|
-
if (
|
|
6487
|
+
function ga(t, a) {
|
|
6488
|
+
if (de(a))
|
|
6512
6489
|
return a;
|
|
6513
6490
|
{
|
|
6514
|
-
const r = L(t, a), i = !!t.editable,
|
|
6491
|
+
const r = L(t, a), i = !!t.editable, o = !!a.editable;
|
|
6515
6492
|
if (a.dataType === "map" && a.properties) {
|
|
6516
|
-
const
|
|
6493
|
+
const s = "properties" in t ? t.properties : {}, p = "properties" in a ? a.properties : {}, c = "propertiesOrder" in t && t.propertiesOrder ? t.propertiesOrder : Object.keys(s), m = "propertiesOrder" in a && a.propertiesOrder ? a.propertiesOrder : "properties" in a ? Object.keys(a.properties) : [], u = [.../* @__PURE__ */ new Set([...c, ...m])], d = { ...s };
|
|
6517
6494
|
return Object.keys(a.properties).forEach((l) => {
|
|
6518
|
-
const g =
|
|
6519
|
-
g && (
|
|
6520
|
-
}), { ...r, editable: i &&
|
|
6495
|
+
const g = s[l];
|
|
6496
|
+
g && (d[l] = ga(g, p[l]));
|
|
6497
|
+
}), { ...r, editable: i && o, properties: d, propertiesOrder: u };
|
|
6521
6498
|
}
|
|
6522
|
-
return { ...r, editable: i &&
|
|
6499
|
+
return { ...r, editable: i && o };
|
|
6523
6500
|
}
|
|
6524
6501
|
}
|
|
6525
|
-
function
|
|
6502
|
+
function Rt(t) {
|
|
6526
6503
|
return t.propertiesOrder && t.propertiesOrder.length > 0 ? t.propertiesOrder : [
|
|
6527
6504
|
...Object.keys(t.properties),
|
|
6528
6505
|
...(t.additionalFields ?? [])?.map((a) => a.id)
|
|
6529
6506
|
];
|
|
6530
6507
|
}
|
|
6531
|
-
function
|
|
6508
|
+
function hr({
|
|
6532
6509
|
collectionConfigController: t,
|
|
6533
6510
|
configPermissions: a,
|
|
6534
6511
|
reservedGroups: r,
|
|
6535
6512
|
extraView: i,
|
|
6536
|
-
pathSuggestions:
|
|
6537
|
-
getUser:
|
|
6538
|
-
collectionInference:
|
|
6513
|
+
pathSuggestions: o,
|
|
6514
|
+
getUser: s,
|
|
6515
|
+
collectionInference: p,
|
|
6539
6516
|
getData: c
|
|
6540
6517
|
}) {
|
|
6541
6518
|
const m = Z(
|
|
6542
|
-
(u) =>
|
|
6519
|
+
(u) => {
|
|
6520
|
+
const d = (g) => {
|
|
6521
|
+
Wt(g.properties), g.subcollections?.forEach(d);
|
|
6522
|
+
}, l = t.collections ?? [];
|
|
6523
|
+
return l.forEach(d), ha(l, u);
|
|
6524
|
+
},
|
|
6543
6525
|
[t.collections]
|
|
6544
6526
|
);
|
|
6545
6527
|
return {
|
|
@@ -6547,33 +6529,64 @@ function ur({
|
|
|
6547
6529
|
loading: t.loading,
|
|
6548
6530
|
collections: {
|
|
6549
6531
|
injectCollections: m,
|
|
6550
|
-
CollectionActions:
|
|
6532
|
+
CollectionActions: Xi
|
|
6551
6533
|
},
|
|
6552
6534
|
provider: {
|
|
6553
|
-
Component:
|
|
6535
|
+
Component: Ji,
|
|
6554
6536
|
props: {
|
|
6555
6537
|
collectionConfigController: t,
|
|
6556
6538
|
configPermissions: a,
|
|
6557
|
-
collectionInference:
|
|
6539
|
+
collectionInference: p,
|
|
6558
6540
|
reservedGroups: r,
|
|
6559
6541
|
extraView: i,
|
|
6560
|
-
pathSuggestions:
|
|
6561
|
-
getUser:
|
|
6542
|
+
pathSuggestions: o,
|
|
6543
|
+
getUser: s,
|
|
6562
6544
|
getData: c
|
|
6563
6545
|
}
|
|
6564
6546
|
},
|
|
6565
6547
|
homePage: {
|
|
6566
|
-
additionalChildrenStart: /* @__PURE__ */ e(
|
|
6567
|
-
CollectionActions:
|
|
6568
|
-
AdditionalCards:
|
|
6548
|
+
additionalChildrenStart: /* @__PURE__ */ e(tr, {}),
|
|
6549
|
+
CollectionActions: Wi,
|
|
6550
|
+
AdditionalCards: er
|
|
6569
6551
|
}
|
|
6570
6552
|
};
|
|
6571
6553
|
}
|
|
6554
|
+
function gr({ path: t }) {
|
|
6555
|
+
const a = rr(t), r = ir(t), i = He();
|
|
6556
|
+
return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
|
|
6557
|
+
/* @__PURE__ */ e(ta, { error: "No collection for path: " + a }),
|
|
6558
|
+
/* @__PURE__ */ e(
|
|
6559
|
+
B,
|
|
6560
|
+
{
|
|
6561
|
+
className: "mx-2",
|
|
6562
|
+
variant: "outlined",
|
|
6563
|
+
size: "small",
|
|
6564
|
+
onClick: () => {
|
|
6565
|
+
i.createCollection({
|
|
6566
|
+
initialValues: { path: a, name: Ot(a) },
|
|
6567
|
+
parentPathSegments: r,
|
|
6568
|
+
redirect: !1
|
|
6569
|
+
});
|
|
6570
|
+
},
|
|
6571
|
+
children: "Create"
|
|
6572
|
+
}
|
|
6573
|
+
)
|
|
6574
|
+
] });
|
|
6575
|
+
}
|
|
6576
|
+
function ir(t) {
|
|
6577
|
+
const a = t.split("/");
|
|
6578
|
+
return a.filter((r, i) => i % 2 === 0 && i !== a.length - 1);
|
|
6579
|
+
}
|
|
6580
|
+
function rr(t) {
|
|
6581
|
+
const a = t.split("/");
|
|
6582
|
+
return a[a.length - 1];
|
|
6583
|
+
}
|
|
6572
6584
|
export {
|
|
6585
|
+
gr as MissingReferenceWidget,
|
|
6573
6586
|
Ue as editableProperty,
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6587
|
+
wi as removeNonEditableProperties,
|
|
6588
|
+
He as useCollectionEditorController,
|
|
6589
|
+
hr as useCollectionEditorPlugin,
|
|
6590
|
+
ua as useCollectionsConfigController
|
|
6578
6591
|
};
|
|
6579
6592
|
//# sourceMappingURL=index.es.js.map
|