@firecms/collection_editor 3.0.0-alpha.50 → 3.0.0-alpha.52
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/ConfigControllerProvider.d.ts +1 -0
- package/dist/index.es.js +1169 -1168
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/ui/collection_editor/utils/supported_fields.d.ts +2 -2
- package/dist/useCollectionEditorPlugin.d.ts +2 -1
- package/package.json +4 -4
- package/src/ConfigControllerProvider.tsx +10 -1
- package/src/ui/collection_editor/PropertyEditView.tsx +2 -1
- package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +1 -1
- package/src/ui/collection_editor/utils/supported_fields.tsx +7 -6
- package/src/useCollectionEditorPlugin.tsx +7 -4
package/dist/index.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { iconKeys as
|
|
1
|
+
import { jsxs as n, Fragment as $, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as _e from "react";
|
|
3
|
+
import K, { useState as L, useEffect as pe, useMemo as Kt, useCallback as Z, useRef as He, useDeferredValue as ba, useContext as Yt } from "react";
|
|
4
|
+
import { iconKeys as Gt, debounce as ya, SearchBar as va, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as wa, Container as ht, Chip as dt, TextField as Te, cn as xe, DebouncedTextField as J, Autocomplete as _a, AutocompleteItem as ka, ExpandablePanel as Ot, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Ht, Dialog as Ee, toSnakeCase as Ct, singular as xa, ListIcon as Ca, Button as U, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Oa, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Na, isValidRegExp as Pa, RuleIcon as Sa, useSnackbarController as De, resolveEnumValues as qa, FileUploadIcon as Aa, MultiSelect as za, MultiSelectItem as zt, Checkbox as Tt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Ne, FieldConfigBadge as Xe, cardMixin as Jt, cardClickableMixin as Qt, cardSelectedMixin as Wt, FunctionsIcon as Ta, RemoveCircleIcon as Va, defaultBorderMixin as Nt, RemoveIcon as Ia, DragHandleIcon as Fa, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as G, DEFAULT_FIELD_CONFIGS as Zt, getFieldId as Xt, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as ja, useLargeLayout as Ea, CodeIcon as Da, makePropertiesEditable as et, resolveEntityView as Ba, Table as It, TableBody as Ft, TableRow as wt, TableCell as Ge, unslugify as Pt, Card as ta, useSelectionController as Ma, EntityCollectionTable as Ra, slugify as Ua, useAuthController as Ye, randomString as jt, CircularProgressCenter as Et, Tabs as $a, Tab as _t, removeUndefined as La, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Dt, DoneIcon as Ka, SaveIcon as Ya, Menu as Ga, MoreVertIcon as Ha, MenuItem as Ja, Collapse as Qa, getDefaultPropertiesOrder as Wa, joinCollectionLists as Za } from "@firecms/core";
|
|
5
5
|
import ut from "react-fast-compare";
|
|
6
|
-
import { useFormikContext as
|
|
6
|
+
import { useFormikContext as Y, Field as ye, getIn as P, Formik as St, FastField as de, Form as Xa } from "formik";
|
|
7
7
|
import * as ot from "yup";
|
|
8
|
-
import * as
|
|
9
|
-
import { extractEnumFromValues as
|
|
10
|
-
import { DragDropContext as
|
|
11
|
-
import
|
|
12
|
-
import { Highlight as
|
|
13
|
-
import { ImportFileUpload as
|
|
14
|
-
import { useNavigate as
|
|
15
|
-
const
|
|
8
|
+
import * as ei from "js-search";
|
|
9
|
+
import { extractEnumFromValues as ti, buildPropertyFromData as ai, buildEntityPropertiesFromData as ii } from "@firecms/schema_inference";
|
|
10
|
+
import { DragDropContext as ri, Droppable as oi, Draggable as ni } from "@hello-pangea/dnd";
|
|
11
|
+
import si from "json5";
|
|
12
|
+
import { Highlight as li, themes as ci } from "prism-react-renderer";
|
|
13
|
+
import { ImportFileUpload as di, DataNewPropertiesMapping as pi, ImportNewPropertyFieldPreview as mi, getInferenceType as ia, getPropertiesMapping as ui, convertDataToEntity as hi, useImportConfig as gi, ImportSaveInProgress as fi } from "@firecms/data_import_export";
|
|
14
|
+
import { useNavigate as bi } from "react-router";
|
|
15
|
+
const yi = ot.object().shape({
|
|
16
16
|
id: ot.string().required("Required"),
|
|
17
17
|
name: ot.string().required("Required"),
|
|
18
18
|
path: ot.string().required("Required")
|
|
@@ -1965,34 +1965,34 @@ const bi = ot.object().shape({
|
|
|
1965
1965
|
zoom_in_map: "arrows destination location maps move place stop",
|
|
1966
1966
|
zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
|
|
1967
1967
|
zoom_out_map: "arrows destination location maps move place stop"
|
|
1968
|
-
},
|
|
1969
|
-
|
|
1970
|
-
|
|
1968
|
+
}, qt = new ei.Search("key");
|
|
1969
|
+
qt.addIndex("synonyms");
|
|
1970
|
+
qt.addDocuments(Gt.map((t) => ({
|
|
1971
1971
|
key: t,
|
|
1972
1972
|
// @ts-ignore
|
|
1973
1973
|
synonyms: ra[t] ?? []
|
|
1974
1974
|
})));
|
|
1975
|
-
const
|
|
1975
|
+
const vi = 220;
|
|
1976
1976
|
process.env.NODE_ENV !== "production" && Object.keys(ra).forEach((t) => {
|
|
1977
|
-
|
|
1977
|
+
Gt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
|
|
1978
1978
|
});
|
|
1979
|
-
function
|
|
1980
|
-
const [i, r] =
|
|
1981
|
-
() =>
|
|
1979
|
+
function wi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
1980
|
+
const [i, r] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
|
|
1981
|
+
() => ya((m) => {
|
|
1982
1982
|
if (!m || m === "")
|
|
1983
1983
|
r(null);
|
|
1984
1984
|
else {
|
|
1985
|
-
const u =
|
|
1986
|
-
r(u.map((
|
|
1985
|
+
const u = qt.search(m);
|
|
1986
|
+
r(u.map((d) => d.key));
|
|
1987
1987
|
}
|
|
1988
|
-
},
|
|
1988
|
+
}, vi),
|
|
1989
1989
|
[]
|
|
1990
1990
|
);
|
|
1991
|
-
return
|
|
1991
|
+
return _e.useEffect(() => (l(s), () => {
|
|
1992
1992
|
l.clear();
|
|
1993
|
-
}), [s, l]), /* @__PURE__ */ n(
|
|
1993
|
+
}), [s, l]), /* @__PURE__ */ n($, { children: [
|
|
1994
1994
|
/* @__PURE__ */ e(
|
|
1995
|
-
|
|
1995
|
+
va,
|
|
1996
1996
|
{
|
|
1997
1997
|
autoFocus: !0,
|
|
1998
1998
|
className: "w-full sticky top-0 z-10",
|
|
@@ -2018,7 +2018,7 @@ function ie({
|
|
|
2018
2018
|
}) {
|
|
2019
2019
|
return a ? /* @__PURE__ */ e(C, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2021
|
+
function _i({
|
|
2022
2022
|
isNewCollection: t,
|
|
2023
2023
|
reservedGroups: a,
|
|
2024
2024
|
existingPaths: i,
|
|
@@ -2026,29 +2026,29 @@ function wi({
|
|
|
2026
2026
|
groups: s,
|
|
2027
2027
|
parentCollection: o
|
|
2028
2028
|
}) {
|
|
2029
|
-
const l =
|
|
2029
|
+
const l = K.useRef(null), {
|
|
2030
2030
|
values: p,
|
|
2031
2031
|
setFieldValue: m,
|
|
2032
2032
|
handleChange: u,
|
|
2033
|
-
touched:
|
|
2034
|
-
errors:
|
|
2035
|
-
setFieldTouched:
|
|
2033
|
+
touched: d,
|
|
2034
|
+
errors: c,
|
|
2035
|
+
setFieldTouched: y,
|
|
2036
2036
|
isSubmitting: g,
|
|
2037
2037
|
submitCount: b
|
|
2038
|
-
} =
|
|
2039
|
-
m("name",
|
|
2038
|
+
} = Y(), [O, w] = L(!1), [k, f] = L(!1), v = (S) => {
|
|
2039
|
+
m("name", S), !P(d, "path") && t && S && m("path", Ct(S)), !P(d, "id") && t && S && m("id", Ct(S)), !P(d, "singularName") && t && S && m("singularName", xa(S));
|
|
2040
2040
|
};
|
|
2041
2041
|
pe(() => {
|
|
2042
|
-
|
|
2043
|
-
}, [
|
|
2044
|
-
const
|
|
2045
|
-
inputFocused:
|
|
2046
|
-
autoCompleteOpen:
|
|
2047
|
-
setAutoCompleteOpen:
|
|
2048
|
-
} =
|
|
2042
|
+
c.id && f(!0);
|
|
2043
|
+
}, [c.id]);
|
|
2044
|
+
const _ = ct(p), h = s?.filter((S) => !a?.includes(S)), {
|
|
2045
|
+
inputFocused: A,
|
|
2046
|
+
autoCompleteOpen: E,
|
|
2047
|
+
setAutoCompleteOpen: z
|
|
2048
|
+
} = wa({
|
|
2049
2049
|
ref: l
|
|
2050
|
-
}),
|
|
2051
|
-
let
|
|
2050
|
+
}), q = !!o;
|
|
2051
|
+
let B;
|
|
2052
2052
|
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
2053
2053
|
/* @__PURE__ */ n("div", { children: [
|
|
2054
2054
|
/* @__PURE__ */ n(
|
|
@@ -2061,8 +2061,8 @@ function wi({
|
|
|
2061
2061
|
ne,
|
|
2062
2062
|
{
|
|
2063
2063
|
shape: "square",
|
|
2064
|
-
onClick: () =>
|
|
2065
|
-
children:
|
|
2064
|
+
onClick: () => w(!0),
|
|
2065
|
+
children: _
|
|
2066
2066
|
}
|
|
2067
2067
|
) })
|
|
2068
2068
|
]
|
|
@@ -2079,66 +2079,66 @@ function wi({
|
|
|
2079
2079
|
Te,
|
|
2080
2080
|
{
|
|
2081
2081
|
value: p.name ?? "",
|
|
2082
|
-
onChange: (
|
|
2082
|
+
onChange: (S) => v(S.target.value),
|
|
2083
2083
|
label: "Name",
|
|
2084
2084
|
required: !0,
|
|
2085
|
-
error:
|
|
2085
|
+
error: d.name && !!c.name
|
|
2086
2086
|
}
|
|
2087
2087
|
),
|
|
2088
|
-
/* @__PURE__ */ e(ie, { error:
|
|
2088
|
+
/* @__PURE__ */ e(ie, { error: d.name && !!c.name, children: d.name && c.name ? c.name : "Name of in this collection, usually a plural name (e.g. Products)" })
|
|
2089
2089
|
] }),
|
|
2090
|
-
/* @__PURE__ */ n("div", { className:
|
|
2090
|
+
/* @__PURE__ */ n("div", { className: xe("col-span-12 ", q ? "" : "sm:col-span-8"), children: [
|
|
2091
2091
|
/* @__PURE__ */ e(
|
|
2092
|
-
|
|
2092
|
+
ye,
|
|
2093
2093
|
{
|
|
2094
2094
|
name: "path",
|
|
2095
|
-
as:
|
|
2095
|
+
as: J,
|
|
2096
2096
|
label: "Path",
|
|
2097
2097
|
disabled: !t,
|
|
2098
2098
|
required: !0,
|
|
2099
|
-
error:
|
|
2099
|
+
error: d.path && !!c.path
|
|
2100
2100
|
}
|
|
2101
2101
|
),
|
|
2102
|
-
/* @__PURE__ */ e(ie, { error:
|
|
2102
|
+
/* @__PURE__ */ e(ie, { error: d.path && !!c.path, children: d.path && c.path ? c.path : "Path that this collection is stored in, in the database" })
|
|
2103
2103
|
] }),
|
|
2104
|
-
!
|
|
2104
|
+
!q && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
2105
2105
|
/* @__PURE__ */ e(
|
|
2106
2106
|
Te,
|
|
2107
2107
|
{
|
|
2108
|
-
error:
|
|
2108
|
+
error: d.group && !!c.group,
|
|
2109
2109
|
disabled: g,
|
|
2110
2110
|
value: p.group ?? "",
|
|
2111
2111
|
autoComplete: "off",
|
|
2112
|
-
onChange: (
|
|
2112
|
+
onChange: (S) => m("group", S.target.value),
|
|
2113
2113
|
name: "group",
|
|
2114
2114
|
inputRef: l,
|
|
2115
2115
|
label: "Group"
|
|
2116
2116
|
}
|
|
2117
2117
|
),
|
|
2118
2118
|
/* @__PURE__ */ e(
|
|
2119
|
-
|
|
2119
|
+
_a,
|
|
2120
2120
|
{
|
|
2121
|
-
open:
|
|
2122
|
-
setOpen:
|
|
2123
|
-
children:
|
|
2124
|
-
|
|
2121
|
+
open: E && (h ?? []).length > 0,
|
|
2122
|
+
setOpen: z,
|
|
2123
|
+
children: h?.map((S, N) => /* @__PURE__ */ e(
|
|
2124
|
+
ka,
|
|
2125
2125
|
{
|
|
2126
2126
|
onClick: () => {
|
|
2127
|
-
|
|
2127
|
+
z(!1), m("group", S ?? null);
|
|
2128
2128
|
},
|
|
2129
|
-
children: /* @__PURE__ */ e("div", { className: "flex-grow", children:
|
|
2129
|
+
children: /* @__PURE__ */ e("div", { className: "flex-grow", children: S })
|
|
2130
2130
|
},
|
|
2131
|
-
|
|
2131
|
+
N + "_" + S
|
|
2132
2132
|
))
|
|
2133
2133
|
}
|
|
2134
2134
|
),
|
|
2135
|
-
/* @__PURE__ */ e(ie, { children:
|
|
2135
|
+
/* @__PURE__ */ e(ie, { children: d.group && c.group ? c.group : "Group of the collection" })
|
|
2136
2136
|
] }),
|
|
2137
2137
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2138
|
-
|
|
2138
|
+
Ot,
|
|
2139
2139
|
{
|
|
2140
|
-
expanded:
|
|
2141
|
-
onExpandedChange:
|
|
2140
|
+
expanded: k,
|
|
2141
|
+
onExpandedChange: f,
|
|
2142
2142
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2143
2143
|
/* @__PURE__ */ e(Qe, {}),
|
|
2144
2144
|
/* @__PURE__ */ e(
|
|
@@ -2156,21 +2156,21 @@ function wi({
|
|
|
2156
2156
|
/* @__PURE__ */ e(
|
|
2157
2157
|
Te,
|
|
2158
2158
|
{
|
|
2159
|
-
error:
|
|
2159
|
+
error: d.singularName && !!c.singularName,
|
|
2160
2160
|
id: "singularName",
|
|
2161
2161
|
"aria-describedby": "singularName-helper",
|
|
2162
|
-
onChange: (
|
|
2162
|
+
onChange: (S) => (y("singularName", !0), u(S)),
|
|
2163
2163
|
value: p.singularName ?? "",
|
|
2164
2164
|
label: "Singular name"
|
|
2165
2165
|
}
|
|
2166
2166
|
),
|
|
2167
|
-
/* @__PURE__ */ e(ie, { error:
|
|
2167
|
+
/* @__PURE__ */ e(ie, { error: d.singularName && !!c.singularName, children: d.singularName && c.singularName ? c.singularName : "Optionally define a singular name for your entities" })
|
|
2168
2168
|
] }),
|
|
2169
2169
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2170
2170
|
/* @__PURE__ */ e(
|
|
2171
2171
|
Te,
|
|
2172
2172
|
{
|
|
2173
|
-
error:
|
|
2173
|
+
error: d.description && !!c.description,
|
|
2174
2174
|
id: "description",
|
|
2175
2175
|
value: p.description ?? "",
|
|
2176
2176
|
onChange: u,
|
|
@@ -2180,20 +2180,20 @@ function wi({
|
|
|
2180
2180
|
label: "Description"
|
|
2181
2181
|
}
|
|
2182
2182
|
),
|
|
2183
|
-
/* @__PURE__ */ e(ie, { error:
|
|
2183
|
+
/* @__PURE__ */ e(ie, { error: d.description && !!c.description, children: d.description && c.description ? c.description : "Description of the collection, you can use markdown" })
|
|
2184
2184
|
] }),
|
|
2185
2185
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2186
2186
|
/* @__PURE__ */ e(
|
|
2187
|
-
|
|
2187
|
+
ye,
|
|
2188
2188
|
{
|
|
2189
2189
|
name: "id",
|
|
2190
|
-
as:
|
|
2190
|
+
as: J,
|
|
2191
2191
|
disabled: !t,
|
|
2192
2192
|
label: "Collection id",
|
|
2193
|
-
error:
|
|
2193
|
+
error: d.id && !!c.id
|
|
2194
2194
|
}
|
|
2195
2195
|
),
|
|
2196
|
-
/* @__PURE__ */ e(ie, { error:
|
|
2196
|
+
/* @__PURE__ */ e(ie, { error: d.id && !!c.id, children: d.id && c.id ? c.id : "This id identifies this collection" })
|
|
2197
2197
|
] }),
|
|
2198
2198
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2199
2199
|
Se,
|
|
@@ -2203,14 +2203,14 @@ function wi({
|
|
|
2203
2203
|
position: "item-aligned",
|
|
2204
2204
|
onChange: u,
|
|
2205
2205
|
value: p.defaultSize ?? "",
|
|
2206
|
-
renderValue: (
|
|
2207
|
-
children: ["xs", "s", "m", "l", "xl"].map((
|
|
2206
|
+
renderValue: (S) => S.toUpperCase(),
|
|
2207
|
+
children: ["xs", "s", "m", "l", "xl"].map((S) => /* @__PURE__ */ e(
|
|
2208
2208
|
ee,
|
|
2209
2209
|
{
|
|
2210
|
-
value:
|
|
2211
|
-
children:
|
|
2210
|
+
value: S,
|
|
2211
|
+
children: S.toUpperCase()
|
|
2212
2212
|
},
|
|
2213
|
-
`size-select-${
|
|
2213
|
+
`size-select-${S}`
|
|
2214
2214
|
))
|
|
2215
2215
|
}
|
|
2216
2216
|
) }),
|
|
@@ -2220,14 +2220,14 @@ function wi({
|
|
|
2220
2220
|
name: "customId",
|
|
2221
2221
|
label: "Data IDs generation",
|
|
2222
2222
|
position: "item-aligned",
|
|
2223
|
-
disabled:
|
|
2224
|
-
onValueChange: (
|
|
2225
|
-
if (
|
|
2223
|
+
disabled: B === "code_defined",
|
|
2224
|
+
onValueChange: (S) => {
|
|
2225
|
+
if (S === "code_defined")
|
|
2226
2226
|
throw new Error("This should not happen");
|
|
2227
|
-
|
|
2227
|
+
S === "true" ? m("customId", !0) : S === "false" ? m("customId", !1) : S === "optional" && m("customId", "optional");
|
|
2228
2228
|
},
|
|
2229
2229
|
value: "",
|
|
2230
|
-
renderValue: (
|
|
2230
|
+
renderValue: (S) => S === "code_defined" ? "Code defined" : S === "true" ? "Users must define an ID" : S === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
|
|
2231
2231
|
children: [
|
|
2232
2232
|
/* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
|
|
2233
2233
|
/* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
|
|
@@ -2237,11 +2237,11 @@ function wi({
|
|
|
2237
2237
|
) }),
|
|
2238
2238
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2239
2239
|
/* @__PURE__ */ e(
|
|
2240
|
-
|
|
2240
|
+
Ht,
|
|
2241
2241
|
{
|
|
2242
2242
|
position: "start",
|
|
2243
2243
|
label: "Collection group",
|
|
2244
|
-
onValueChange: (
|
|
2244
|
+
onValueChange: (S) => m("collectionGroup", S),
|
|
2245
2245
|
value: p.collectionGroup ?? !1
|
|
2246
2246
|
}
|
|
2247
2247
|
),
|
|
@@ -2256,15 +2256,15 @@ function wi({
|
|
|
2256
2256
|
Ee,
|
|
2257
2257
|
{
|
|
2258
2258
|
open: O,
|
|
2259
|
-
onOpenChange:
|
|
2259
|
+
onOpenChange: w,
|
|
2260
2260
|
maxWidth: "xl",
|
|
2261
2261
|
fullWidth: !0,
|
|
2262
2262
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
2263
|
-
|
|
2263
|
+
wi,
|
|
2264
2264
|
{
|
|
2265
2265
|
selectedIcon: p.icon,
|
|
2266
|
-
onIconSelected: (
|
|
2267
|
-
|
|
2266
|
+
onIconSelected: (S) => {
|
|
2267
|
+
w(!1), m("icon", S);
|
|
2268
2268
|
}
|
|
2269
2269
|
}
|
|
2270
2270
|
) })
|
|
@@ -2272,19 +2272,19 @@ function wi({
|
|
|
2272
2272
|
)
|
|
2273
2273
|
] }) });
|
|
2274
2274
|
}
|
|
2275
|
-
function
|
|
2275
|
+
function ke(t) {
|
|
2276
2276
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
2277
2277
|
}
|
|
2278
|
-
function
|
|
2278
|
+
function ki(t) {
|
|
2279
2279
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
2280
2280
|
}
|
|
2281
|
-
function
|
|
2281
|
+
function Pe(t) {
|
|
2282
2282
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
2283
2283
|
}
|
|
2284
2284
|
function ce(t, a) {
|
|
2285
2285
|
return a ? `${a}.${t}` : t;
|
|
2286
2286
|
}
|
|
2287
|
-
const
|
|
2287
|
+
const xi = K.memo(
|
|
2288
2288
|
function({
|
|
2289
2289
|
enumValues: a,
|
|
2290
2290
|
onValuesChanged: i,
|
|
@@ -2295,7 +2295,7 @@ const ki = L.memo(
|
|
|
2295
2295
|
getData: p
|
|
2296
2296
|
}) {
|
|
2297
2297
|
return /* @__PURE__ */ e(
|
|
2298
|
-
|
|
2298
|
+
St,
|
|
2299
2299
|
{
|
|
2300
2300
|
initialValues: { enumValues: a },
|
|
2301
2301
|
validateOnMount: !0,
|
|
@@ -2309,7 +2309,7 @@ const ki = L.memo(
|
|
|
2309
2309
|
}, [m.enumValues]), pe(() => {
|
|
2310
2310
|
r && r(!!(u?.enumValues ?? !1));
|
|
2311
2311
|
}, [u]), /* @__PURE__ */ e(
|
|
2312
|
-
|
|
2312
|
+
Ci,
|
|
2313
2313
|
{
|
|
2314
2314
|
enumValuesPath: "enumValues",
|
|
2315
2315
|
values: m,
|
|
@@ -2327,7 +2327,7 @@ const ki = L.memo(
|
|
|
2327
2327
|
return a.enumValues.length === i.enumValues.length && a.onValuesChanged === i.onValuesChanged && a.getData === i.getData;
|
|
2328
2328
|
}
|
|
2329
2329
|
);
|
|
2330
|
-
function
|
|
2330
|
+
function Ci({
|
|
2331
2331
|
values: t,
|
|
2332
2332
|
errors: a,
|
|
2333
2333
|
disabled: i,
|
|
@@ -2338,25 +2338,25 @@ function xi({
|
|
|
2338
2338
|
}) {
|
|
2339
2339
|
const {
|
|
2340
2340
|
setFieldValue: p
|
|
2341
|
-
} =
|
|
2342
|
-
const
|
|
2341
|
+
} = Y(), [m, u] = K.useState(), [d, c] = K.useState(), [y, g] = K.useState(!1), O = K.useRef(/* @__PURE__ */ new Set()).current, w = (f, v) => {
|
|
2342
|
+
const _ = m === v;
|
|
2343
2343
|
return /* @__PURE__ */ e(
|
|
2344
|
-
|
|
2344
|
+
Oi,
|
|
2345
2345
|
{
|
|
2346
|
-
index:
|
|
2346
|
+
index: f,
|
|
2347
2347
|
disabled: i,
|
|
2348
2348
|
enumValuesPath: r,
|
|
2349
|
-
autoFocus:
|
|
2350
|
-
shouldUpdateId: s ||
|
|
2351
|
-
onDialogOpen: () =>
|
|
2352
|
-
inferredEntry: O.has(t.enumValues[
|
|
2349
|
+
autoFocus: _,
|
|
2350
|
+
shouldUpdateId: s || _,
|
|
2351
|
+
onDialogOpen: () => c(f),
|
|
2352
|
+
inferredEntry: O.has(t.enumValues[f]?.id)
|
|
2353
2353
|
},
|
|
2354
|
-
`${
|
|
2354
|
+
`${v}`
|
|
2355
2355
|
);
|
|
2356
2356
|
};
|
|
2357
2357
|
return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2358
2358
|
/* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
|
|
2359
|
-
/* @__PURE__ */ e(
|
|
2359
|
+
/* @__PURE__ */ e(Ca, {}),
|
|
2360
2360
|
/* @__PURE__ */ e(
|
|
2361
2361
|
C,
|
|
2362
2362
|
{
|
|
@@ -2366,26 +2366,26 @@ function xi({
|
|
|
2366
2366
|
}
|
|
2367
2367
|
),
|
|
2368
2368
|
o && /* @__PURE__ */ n(
|
|
2369
|
-
|
|
2369
|
+
U,
|
|
2370
2370
|
{
|
|
2371
|
-
loading:
|
|
2372
|
-
disabled: i ||
|
|
2371
|
+
loading: y,
|
|
2372
|
+
disabled: i || y,
|
|
2373
2373
|
variant: "text",
|
|
2374
2374
|
size: "small",
|
|
2375
2375
|
onClick: async () => {
|
|
2376
|
-
l && (g(!0), l?.().then((
|
|
2377
|
-
if (!
|
|
2376
|
+
l && (g(!0), l?.().then((f) => {
|
|
2377
|
+
if (!f)
|
|
2378
2378
|
return;
|
|
2379
|
-
const
|
|
2380
|
-
|
|
2381
|
-
O.add(
|
|
2382
|
-
}), p(r, [...
|
|
2383
|
-
}).catch((
|
|
2384
|
-
console.error(
|
|
2379
|
+
const v = f.flat(), _ = Array.from(new Set(v)), h = t.enumValues, E = ti(_).filter((z) => !h?.some((q) => q.id === z.id));
|
|
2380
|
+
E.forEach((z) => {
|
|
2381
|
+
O.add(z.id);
|
|
2382
|
+
}), p(r, [...E, ...h]);
|
|
2383
|
+
}).catch((f) => {
|
|
2384
|
+
console.error(f);
|
|
2385
2385
|
}).finally(() => g(!1)));
|
|
2386
2386
|
},
|
|
2387
2387
|
children: [
|
|
2388
|
-
|
|
2388
|
+
y ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {}),
|
|
2389
2389
|
"Infer values from data"
|
|
2390
2390
|
]
|
|
2391
2391
|
}
|
|
@@ -2393,12 +2393,12 @@ function xi({
|
|
|
2393
2393
|
] }),
|
|
2394
2394
|
/* @__PURE__ */ n(qe, { className: "p-4 m-1", children: [
|
|
2395
2395
|
/* @__PURE__ */ e(
|
|
2396
|
-
|
|
2396
|
+
Oa,
|
|
2397
2397
|
{
|
|
2398
2398
|
value: t.enumValues,
|
|
2399
2399
|
addLabel: "Add enum value",
|
|
2400
2400
|
name: r,
|
|
2401
|
-
buildEntry:
|
|
2401
|
+
buildEntry: w,
|
|
2402
2402
|
disabled: i,
|
|
2403
2403
|
onInternalIdAdded: u,
|
|
2404
2404
|
small: !0,
|
|
@@ -2407,18 +2407,18 @@ function xi({
|
|
|
2407
2407
|
}
|
|
2408
2408
|
),
|
|
2409
2409
|
/* @__PURE__ */ e(
|
|
2410
|
-
|
|
2410
|
+
Ni,
|
|
2411
2411
|
{
|
|
2412
|
-
index:
|
|
2413
|
-
open:
|
|
2412
|
+
index: d,
|
|
2413
|
+
open: d !== void 0,
|
|
2414
2414
|
enumValuesPath: r,
|
|
2415
|
-
onClose: () =>
|
|
2415
|
+
onClose: () => c(void 0)
|
|
2416
2416
|
}
|
|
2417
2417
|
)
|
|
2418
2418
|
] })
|
|
2419
2419
|
] });
|
|
2420
2420
|
}
|
|
2421
|
-
const
|
|
2421
|
+
const Oi = K.memo(
|
|
2422
2422
|
function({
|
|
2423
2423
|
index: a,
|
|
2424
2424
|
shouldUpdateId: i,
|
|
@@ -2431,18 +2431,18 @@ const Ci = L.memo(
|
|
|
2431
2431
|
const {
|
|
2432
2432
|
values: m,
|
|
2433
2433
|
handleChange: u,
|
|
2434
|
-
errors:
|
|
2435
|
-
setFieldValue:
|
|
2436
|
-
touched:
|
|
2437
|
-
} =
|
|
2438
|
-
return
|
|
2439
|
-
(
|
|
2440
|
-
}, [
|
|
2434
|
+
errors: d,
|
|
2435
|
+
setFieldValue: c,
|
|
2436
|
+
touched: y
|
|
2437
|
+
} = Y(), g = K.useRef(!P(m, `${r}[${a}].id`)), b = i || g.current, O = P(m, `${r}[${a}].id`), w = P(m, `${r}[${a}].label`), k = P(d, `${r}[${a}].label`), f = K.useRef(w);
|
|
2438
|
+
return K.useEffect(() => {
|
|
2439
|
+
(f.current === O || !O) && b && c(`${r}[${a}].id`, w), f.current = w;
|
|
2440
|
+
}, [w]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
|
|
2441
2441
|
/* @__PURE__ */ e(
|
|
2442
2442
|
de,
|
|
2443
2443
|
{
|
|
2444
2444
|
name: `${r}[${a}].label`,
|
|
2445
|
-
as:
|
|
2445
|
+
as: J,
|
|
2446
2446
|
className: "flex-grow",
|
|
2447
2447
|
required: !0,
|
|
2448
2448
|
disabled: l,
|
|
@@ -2451,7 +2451,7 @@ const Ci = L.memo(
|
|
|
2451
2451
|
autoFocus: s,
|
|
2452
2452
|
autoComplete: "off",
|
|
2453
2453
|
endAdornment: p && /* @__PURE__ */ e(gt, { size: "small" }),
|
|
2454
|
-
error: !!
|
|
2454
|
+
error: !!k
|
|
2455
2455
|
}
|
|
2456
2456
|
),
|
|
2457
2457
|
!l && /* @__PURE__ */ e(
|
|
@@ -2470,7 +2470,7 @@ const Ci = L.memo(
|
|
|
2470
2470
|
return a.index === i.index && a.enumValuesPath === i.enumValuesPath && a.shouldUpdateId === i.shouldUpdateId && a.inferredEntry === i.inferredEntry && a.autoFocus === i.autoFocus;
|
|
2471
2471
|
}
|
|
2472
2472
|
);
|
|
2473
|
-
function
|
|
2473
|
+
function Ni({
|
|
2474
2474
|
index: t,
|
|
2475
2475
|
open: a,
|
|
2476
2476
|
onClose: i,
|
|
@@ -2482,23 +2482,23 @@ function Oi({
|
|
|
2482
2482
|
errors: l,
|
|
2483
2483
|
setFieldValue: p,
|
|
2484
2484
|
touched: m
|
|
2485
|
-
} =
|
|
2485
|
+
} = Y(), u = t !== void 0 ? P(l, `${r}[${t}].id`) : void 0;
|
|
2486
2486
|
return /* @__PURE__ */ n(
|
|
2487
2487
|
Ee,
|
|
2488
2488
|
{
|
|
2489
2489
|
maxWidth: "md",
|
|
2490
2490
|
"aria-labelledby": "enum-edit-dialog",
|
|
2491
2491
|
open: a,
|
|
2492
|
-
onOpenChange: (
|
|
2492
|
+
onOpenChange: (d) => d ? void 0 : i(),
|
|
2493
2493
|
children: [
|
|
2494
2494
|
/* @__PURE__ */ e($e, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
|
|
2495
2495
|
/* @__PURE__ */ e(
|
|
2496
2496
|
de,
|
|
2497
2497
|
{
|
|
2498
2498
|
name: `${r}[${t}]id`,
|
|
2499
|
-
as:
|
|
2499
|
+
as: J,
|
|
2500
2500
|
required: !0,
|
|
2501
|
-
validate:
|
|
2501
|
+
validate: Si,
|
|
2502
2502
|
label: "ID",
|
|
2503
2503
|
size: "small",
|
|
2504
2504
|
autoComplete: "off",
|
|
@@ -2508,7 +2508,7 @@ function Oi({
|
|
|
2508
2508
|
/* @__PURE__ */ e(ie, { error: !!u, children: u ?? "Value saved in the data source" })
|
|
2509
2509
|
] }) }),
|
|
2510
2510
|
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(
|
|
2511
|
-
|
|
2511
|
+
U,
|
|
2512
2512
|
{
|
|
2513
2513
|
autoFocus: !0,
|
|
2514
2514
|
variant: "outlined",
|
|
@@ -2525,13 +2525,13 @@ function Pi(t) {
|
|
|
2525
2525
|
let a;
|
|
2526
2526
|
return t || (a = "You must specify a label"), a;
|
|
2527
2527
|
}
|
|
2528
|
-
function
|
|
2528
|
+
function Si(t) {
|
|
2529
2529
|
let a;
|
|
2530
2530
|
return t || (a = "You must specify an ID"), a;
|
|
2531
2531
|
}
|
|
2532
2532
|
function Me({ disabled: t }) {
|
|
2533
|
-
const { values: a, handleChange: i } =
|
|
2534
|
-
return /* @__PURE__ */ n(
|
|
2533
|
+
const { values: a, handleChange: i } = Y(), r = "validation.required", s = "validation.requiredMessage";
|
|
2534
|
+
return /* @__PURE__ */ n($, { children: [
|
|
2535
2535
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2536
2536
|
de,
|
|
2537
2537
|
{
|
|
@@ -2555,7 +2555,7 @@ function Me({ disabled: t }) {
|
|
|
2555
2555
|
}
|
|
2556
2556
|
) }),
|
|
2557
2557
|
P(a, r) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2558
|
-
|
|
2558
|
+
J,
|
|
2559
2559
|
{
|
|
2560
2560
|
disabled: t,
|
|
2561
2561
|
value: P(a, s),
|
|
@@ -2580,9 +2580,9 @@ function Ue({
|
|
|
2580
2580
|
}) {
|
|
2581
2581
|
const {
|
|
2582
2582
|
values: u,
|
|
2583
|
-
handleChange:
|
|
2584
|
-
errors:
|
|
2585
|
-
} =
|
|
2583
|
+
handleChange: d,
|
|
2584
|
+
errors: c
|
|
2585
|
+
} = Y(), y = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", w = "validation.matches", k = "validation.lowercase", f = "validation.uppercase", v = P(c, w), _ = P(u, w), h = typeof _ == "string" ? _ : Na(_);
|
|
2586
2586
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2587
2587
|
/* @__PURE__ */ e(Me, { disabled: p }),
|
|
2588
2588
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
@@ -2590,7 +2590,7 @@ function Ue({
|
|
|
2590
2590
|
de,
|
|
2591
2591
|
{
|
|
2592
2592
|
type: "checkbox",
|
|
2593
|
-
name:
|
|
2593
|
+
name: k,
|
|
2594
2594
|
label: "Lowercase",
|
|
2595
2595
|
disabled: p,
|
|
2596
2596
|
component: he
|
|
@@ -2600,7 +2600,7 @@ function Ue({
|
|
|
2600
2600
|
de,
|
|
2601
2601
|
{
|
|
2602
2602
|
type: "checkbox",
|
|
2603
|
-
name:
|
|
2603
|
+
name: f,
|
|
2604
2604
|
label: "Uppercase",
|
|
2605
2605
|
disabled: p,
|
|
2606
2606
|
component: he
|
|
@@ -2619,19 +2619,19 @@ function Ue({
|
|
|
2619
2619
|
] }),
|
|
2620
2620
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2621
2621
|
t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2622
|
-
|
|
2622
|
+
J,
|
|
2623
2623
|
{
|
|
2624
|
-
value: P(u,
|
|
2624
|
+
value: P(u, y),
|
|
2625
2625
|
label: "Exact length",
|
|
2626
|
-
name:
|
|
2626
|
+
name: y,
|
|
2627
2627
|
type: "number",
|
|
2628
2628
|
size: "small",
|
|
2629
2629
|
disabled: p,
|
|
2630
|
-
onChange:
|
|
2630
|
+
onChange: d
|
|
2631
2631
|
}
|
|
2632
2632
|
) }),
|
|
2633
2633
|
s && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2634
|
-
|
|
2634
|
+
J,
|
|
2635
2635
|
{
|
|
2636
2636
|
value: P(u, g),
|
|
2637
2637
|
label: "Min length",
|
|
@@ -2639,11 +2639,11 @@ function Ue({
|
|
|
2639
2639
|
type: "number",
|
|
2640
2640
|
size: "small",
|
|
2641
2641
|
disabled: p,
|
|
2642
|
-
onChange:
|
|
2642
|
+
onChange: d
|
|
2643
2643
|
}
|
|
2644
2644
|
) }),
|
|
2645
2645
|
r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2646
|
-
|
|
2646
|
+
J,
|
|
2647
2647
|
{
|
|
2648
2648
|
value: P(u, b),
|
|
2649
2649
|
label: "Max length",
|
|
@@ -2651,7 +2651,7 @@ function Ue({
|
|
|
2651
2651
|
type: "number",
|
|
2652
2652
|
size: "small",
|
|
2653
2653
|
disabled: p,
|
|
2654
|
-
onChange:
|
|
2654
|
+
onChange: d
|
|
2655
2655
|
}
|
|
2656
2656
|
) })
|
|
2657
2657
|
] }),
|
|
@@ -2659,21 +2659,21 @@ function Ue({
|
|
|
2659
2659
|
/* @__PURE__ */ e(
|
|
2660
2660
|
de,
|
|
2661
2661
|
{
|
|
2662
|
-
name:
|
|
2663
|
-
as:
|
|
2664
|
-
validate: (
|
|
2662
|
+
name: w,
|
|
2663
|
+
as: J,
|
|
2664
|
+
validate: (A) => A && !Pa(A),
|
|
2665
2665
|
label: "Matches regex",
|
|
2666
2666
|
size: "small",
|
|
2667
2667
|
disabled: p,
|
|
2668
|
-
value:
|
|
2669
|
-
error: !!
|
|
2668
|
+
value: h,
|
|
2669
|
+
error: !!v
|
|
2670
2670
|
}
|
|
2671
2671
|
),
|
|
2672
|
-
/* @__PURE__ */ e(ie, { error: !!
|
|
2672
|
+
/* @__PURE__ */ e(ie, { error: !!v, children: v ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
|
|
2673
2673
|
] })
|
|
2674
2674
|
] });
|
|
2675
2675
|
}
|
|
2676
|
-
function
|
|
2676
|
+
function At({
|
|
2677
2677
|
max: t = !0,
|
|
2678
2678
|
min: a = !0,
|
|
2679
2679
|
disabled: i
|
|
@@ -2681,11 +2681,11 @@ function zt({
|
|
|
2681
2681
|
const {
|
|
2682
2682
|
values: r,
|
|
2683
2683
|
handleChange: s
|
|
2684
|
-
} =
|
|
2684
|
+
} = Y(), o = "validation.min", l = "validation.max";
|
|
2685
2685
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
2686
2686
|
/* @__PURE__ */ e(Me, { disabled: i }),
|
|
2687
2687
|
a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2688
|
-
|
|
2688
|
+
J,
|
|
2689
2689
|
{
|
|
2690
2690
|
value: P(r, o),
|
|
2691
2691
|
disabled: i,
|
|
@@ -2697,7 +2697,7 @@ function zt({
|
|
|
2697
2697
|
}
|
|
2698
2698
|
) }),
|
|
2699
2699
|
t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2700
|
-
|
|
2700
|
+
J,
|
|
2701
2701
|
{
|
|
2702
2702
|
value: P(r, l),
|
|
2703
2703
|
disabled: i,
|
|
@@ -2714,13 +2714,13 @@ function ze({
|
|
|
2714
2714
|
children: t
|
|
2715
2715
|
}) {
|
|
2716
2716
|
return /* @__PURE__ */ e(
|
|
2717
|
-
|
|
2717
|
+
Ot,
|
|
2718
2718
|
{
|
|
2719
2719
|
initiallyExpanded: !1,
|
|
2720
2720
|
asField: !0,
|
|
2721
2721
|
className: "p-4",
|
|
2722
2722
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2723
|
-
/* @__PURE__ */ e(
|
|
2723
|
+
/* @__PURE__ */ e(Sa, {}),
|
|
2724
2724
|
/* @__PURE__ */ e(
|
|
2725
2725
|
C,
|
|
2726
2726
|
{
|
|
@@ -2734,7 +2734,7 @@ function ze({
|
|
|
2734
2734
|
}
|
|
2735
2735
|
);
|
|
2736
2736
|
}
|
|
2737
|
-
function
|
|
2737
|
+
function Bt({
|
|
2738
2738
|
multiselect: t,
|
|
2739
2739
|
updateIds: a,
|
|
2740
2740
|
disabled: i,
|
|
@@ -2747,25 +2747,25 @@ function Mt({
|
|
|
2747
2747
|
handleChange: p,
|
|
2748
2748
|
errors: m,
|
|
2749
2749
|
touched: u,
|
|
2750
|
-
setFieldError:
|
|
2751
|
-
setFieldValue:
|
|
2752
|
-
} =
|
|
2753
|
-
return /* @__PURE__ */ n(
|
|
2750
|
+
setFieldError: d,
|
|
2751
|
+
setFieldValue: c
|
|
2752
|
+
} = Y(), y = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), w = Kt(() => !O || typeof O == "boolean" ? [] : qa(O) ?? [], [O]);
|
|
2753
|
+
return /* @__PURE__ */ n($, { children: [
|
|
2754
2754
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2755
|
-
|
|
2755
|
+
xi,
|
|
2756
2756
|
{
|
|
2757
|
-
enumValues:
|
|
2757
|
+
enumValues: w,
|
|
2758
2758
|
updateIds: a,
|
|
2759
2759
|
disabled: i,
|
|
2760
2760
|
allowDataInference: s,
|
|
2761
|
-
onError: (
|
|
2762
|
-
|
|
2761
|
+
onError: (f) => {
|
|
2762
|
+
d(g, f ? "" : void 0);
|
|
2763
2763
|
},
|
|
2764
|
-
getData: o ? () => o().then((
|
|
2765
|
-
onValuesChanged: (
|
|
2766
|
-
if (l && (
|
|
2767
|
-
const
|
|
2768
|
-
b && !
|
|
2764
|
+
getData: o ? () => o().then((f) => f.map((v) => l.id && P(v, l.id)).filter(Boolean)) : void 0,
|
|
2765
|
+
onValuesChanged: (f) => {
|
|
2766
|
+
if (l && (c(g, f), !t)) {
|
|
2767
|
+
const v = f.filter((_) => !!_?.id).map((_) => _.id);
|
|
2768
|
+
b && !v.includes(b) && (c("defaultValue", void 0), y.open({
|
|
2769
2769
|
type: "warning",
|
|
2770
2770
|
message: "Default value was cleared"
|
|
2771
2771
|
}));
|
|
@@ -2781,25 +2781,25 @@ function Mt({
|
|
|
2781
2781
|
showErrors: r
|
|
2782
2782
|
}
|
|
2783
2783
|
),
|
|
2784
|
-
t && /* @__PURE__ */ e(
|
|
2784
|
+
t && /* @__PURE__ */ e(At, { disabled: i })
|
|
2785
2785
|
] }) }),
|
|
2786
2786
|
!t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2787
2787
|
Se,
|
|
2788
2788
|
{
|
|
2789
2789
|
disabled: i,
|
|
2790
2790
|
position: "item-aligned",
|
|
2791
|
-
onValueChange: (
|
|
2792
|
-
|
|
2791
|
+
onValueChange: (f) => {
|
|
2792
|
+
c("defaultValue", f);
|
|
2793
2793
|
},
|
|
2794
2794
|
label: "Default value",
|
|
2795
2795
|
value: b ?? "",
|
|
2796
|
-
children:
|
|
2796
|
+
children: w.filter((f) => !!f?.id).map((f) => /* @__PURE__ */ e(
|
|
2797
2797
|
ee,
|
|
2798
2798
|
{
|
|
2799
|
-
value:
|
|
2800
|
-
children:
|
|
2799
|
+
value: f.id?.toString(),
|
|
2800
|
+
children: f.label
|
|
2801
2801
|
},
|
|
2802
|
-
|
|
2802
|
+
f.id
|
|
2803
2803
|
))
|
|
2804
2804
|
}
|
|
2805
2805
|
) })
|
|
@@ -2812,7 +2812,7 @@ const nt = {
|
|
|
2812
2812
|
"application/*": "Files (pdf, zip, csv, excel...)",
|
|
2813
2813
|
"text/*": "Text files"
|
|
2814
2814
|
};
|
|
2815
|
-
function
|
|
2815
|
+
function Mt({
|
|
2816
2816
|
multiple: t,
|
|
2817
2817
|
existing: a,
|
|
2818
2818
|
disabled: i
|
|
@@ -2820,15 +2820,15 @@ function Rt({
|
|
|
2820
2820
|
const {
|
|
2821
2821
|
values: r,
|
|
2822
2822
|
setFieldValue: s
|
|
2823
|
-
} =
|
|
2824
|
-
|
|
2825
|
-
},
|
|
2826
|
-
return /* @__PURE__ */ n(
|
|
2823
|
+
} = Y(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, p = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, d = P(r, p) ?? "{rand}_{file}", c = P(r, m) ?? "/", y = P(r, l), g = Array.isArray(y) ? y : void 0, b = !g || g.length === 0, O = (f) => {
|
|
2824
|
+
f ? f.includes("all") || f.length >= Object.keys(nt).length ? s(l, void 0) : b ? s(l, Object.keys(nt).filter((v) => !f.includes(v))) : s(l, f) : s(l, void 0);
|
|
2825
|
+
}, w = typeof d == "function", k = typeof c == "function";
|
|
2826
|
+
return /* @__PURE__ */ n($, { children: [
|
|
2827
2827
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2828
|
-
|
|
2828
|
+
Ot,
|
|
2829
2829
|
{
|
|
2830
2830
|
title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
|
|
2831
|
-
/* @__PURE__ */ e(
|
|
2831
|
+
/* @__PURE__ */ e(Aa, {}),
|
|
2832
2832
|
/* @__PURE__ */ e(
|
|
2833
2833
|
C,
|
|
2834
2834
|
{
|
|
@@ -2840,66 +2840,66 @@ function Rt({
|
|
|
2840
2840
|
] }),
|
|
2841
2841
|
children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
|
|
2842
2842
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
2843
|
-
|
|
2843
|
+
za,
|
|
2844
2844
|
{
|
|
2845
2845
|
disabled: i,
|
|
2846
2846
|
name: l,
|
|
2847
2847
|
value: g ?? [],
|
|
2848
2848
|
onMultiValueChange: O,
|
|
2849
2849
|
label: b ? void 0 : "Allowed file types",
|
|
2850
|
-
renderValues: (
|
|
2850
|
+
renderValues: (f) => !f || f.length === 0 ? "All file types allowed" : f.map((v) => nt[v]).filter((v) => !!v).join(", "),
|
|
2851
2851
|
children: [
|
|
2852
|
-
/* @__PURE__ */ n(
|
|
2852
|
+
/* @__PURE__ */ n(zt, { value: "all", className: "flex items-center gap-2", children: [
|
|
2853
2853
|
/* @__PURE__ */ e(
|
|
2854
|
-
|
|
2854
|
+
Tt,
|
|
2855
2855
|
{
|
|
2856
2856
|
checked: !g
|
|
2857
2857
|
}
|
|
2858
2858
|
),
|
|
2859
2859
|
"All"
|
|
2860
2860
|
] }, "all"),
|
|
2861
|
-
Object.entries(nt).map(([
|
|
2861
|
+
Object.entries(nt).map(([f, v]) => /* @__PURE__ */ n(zt, { value: f, className: "flex items-center gap-2", children: [
|
|
2862
2862
|
/* @__PURE__ */ e(
|
|
2863
|
-
|
|
2863
|
+
Tt,
|
|
2864
2864
|
{
|
|
2865
|
-
checked: b || g.indexOf(
|
|
2865
|
+
checked: b || g.indexOf(f) > -1
|
|
2866
2866
|
}
|
|
2867
2867
|
),
|
|
2868
|
-
/* @__PURE__ */ e("div", { className: "flex-grow", children:
|
|
2868
|
+
/* @__PURE__ */ e("div", { className: "flex-grow", children: v }),
|
|
2869
2869
|
/* @__PURE__ */ e(
|
|
2870
|
-
|
|
2870
|
+
U,
|
|
2871
2871
|
{
|
|
2872
2872
|
size: "small",
|
|
2873
2873
|
variant: "outlined",
|
|
2874
|
-
onClick: (
|
|
2874
|
+
onClick: (_) => (_.preventDefault(), _.stopPropagation(), s(l, [f])),
|
|
2875
2875
|
children: "Only"
|
|
2876
2876
|
}
|
|
2877
2877
|
)
|
|
2878
|
-
] },
|
|
2878
|
+
] }, f))
|
|
2879
2879
|
]
|
|
2880
2880
|
}
|
|
2881
2881
|
) }),
|
|
2882
2882
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2883
|
-
|
|
2883
|
+
ye,
|
|
2884
2884
|
{
|
|
2885
2885
|
name: p,
|
|
2886
|
-
as:
|
|
2886
|
+
as: J,
|
|
2887
2887
|
label: "File name",
|
|
2888
2888
|
size: "small",
|
|
2889
|
-
disabled:
|
|
2890
|
-
value:
|
|
2889
|
+
disabled: w || i,
|
|
2890
|
+
value: w ? "-" : d
|
|
2891
2891
|
}
|
|
2892
2892
|
) }),
|
|
2893
2893
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2894
2894
|
/* @__PURE__ */ e(
|
|
2895
|
-
|
|
2895
|
+
ye,
|
|
2896
2896
|
{
|
|
2897
2897
|
name: m,
|
|
2898
|
-
as:
|
|
2898
|
+
as: J,
|
|
2899
2899
|
label: "Storage path",
|
|
2900
|
-
disabled:
|
|
2900
|
+
disabled: k || i,
|
|
2901
2901
|
size: "small",
|
|
2902
|
-
value:
|
|
2902
|
+
value: k ? "-" : c
|
|
2903
2903
|
}
|
|
2904
2904
|
),
|
|
2905
2905
|
/* @__PURE__ */ n(C, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
|
|
@@ -2915,7 +2915,7 @@ function Rt({
|
|
|
2915
2915
|
] })
|
|
2916
2916
|
] }),
|
|
2917
2917
|
/* @__PURE__ */ e(
|
|
2918
|
-
|
|
2918
|
+
ye,
|
|
2919
2919
|
{
|
|
2920
2920
|
type: "checkbox",
|
|
2921
2921
|
name: u,
|
|
@@ -2932,7 +2932,7 @@ function Rt({
|
|
|
2932
2932
|
) }),
|
|
2933
2933
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
|
|
2934
2934
|
!t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Me, { disabled: i }) }),
|
|
2935
|
-
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2935
|
+
t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(At, { disabled: i }) })
|
|
2936
2936
|
] }) })
|
|
2937
2937
|
] });
|
|
2938
2938
|
}
|
|
@@ -2944,14 +2944,14 @@ function Je(t) {
|
|
|
2944
2944
|
return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
|
|
2945
2945
|
}
|
|
2946
2946
|
}
|
|
2947
|
-
function
|
|
2947
|
+
function qi(t) {
|
|
2948
2948
|
return Object.entries(t).filter(([a, i]) => Je(i)).map(([a, i]) => {
|
|
2949
2949
|
const r = i;
|
|
2950
2950
|
if (Je(r))
|
|
2951
2951
|
return r.dataType === "map" && r.properties ? {
|
|
2952
2952
|
[a]: {
|
|
2953
2953
|
...r,
|
|
2954
|
-
properties:
|
|
2954
|
+
properties: qi(r.properties)
|
|
2955
2955
|
}
|
|
2956
2956
|
} : { [a]: r };
|
|
2957
2957
|
}).filter((a) => !!a).reduce((a, i) => ({ ...a, ...i }), {});
|
|
@@ -2965,7 +2965,7 @@ function oa({
|
|
|
2965
2965
|
selected: o
|
|
2966
2966
|
}) {
|
|
2967
2967
|
const { propertyConfigs: l } = Ke(), p = Ze(t, l);
|
|
2968
|
-
return Je(t), /* @__PURE__ */ e(
|
|
2968
|
+
return Je(t), /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ n(
|
|
2969
2969
|
"div",
|
|
2970
2970
|
{
|
|
2971
2971
|
onClick: a,
|
|
@@ -2975,17 +2975,17 @@ function oa({
|
|
|
2975
2975
|
/* @__PURE__ */ n(
|
|
2976
2976
|
qe,
|
|
2977
2977
|
{
|
|
2978
|
-
className:
|
|
2978
|
+
className: xe(
|
|
2979
2979
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
2980
|
-
|
|
2981
|
-
a ?
|
|
2982
|
-
o ?
|
|
2980
|
+
Jt,
|
|
2981
|
+
a ? Qt : "",
|
|
2982
|
+
o ? Wt : "",
|
|
2983
2983
|
"flex-grow p-4 border transition-colors duration-200",
|
|
2984
2984
|
i ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
|
|
2985
2985
|
),
|
|
2986
2986
|
children: [
|
|
2987
2987
|
/* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
|
|
2988
|
-
r && /* @__PURE__ */ e(
|
|
2988
|
+
r && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
2989
2989
|
C,
|
|
2990
2990
|
{
|
|
2991
2991
|
variant: "body1",
|
|
@@ -2995,7 +2995,7 @@ function oa({
|
|
|
2995
2995
|
}
|
|
2996
2996
|
) }),
|
|
2997
2997
|
/* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
|
|
2998
|
-
/* @__PURE__ */ e(
|
|
2998
|
+
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
2999
2999
|
C,
|
|
3000
3000
|
{
|
|
3001
3001
|
className: "flex-grow pr-2",
|
|
@@ -3005,7 +3005,7 @@ function oa({
|
|
|
3005
3005
|
children: p?.name
|
|
3006
3006
|
}
|
|
3007
3007
|
) }),
|
|
3008
|
-
/* @__PURE__ */ e(
|
|
3008
|
+
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3009
3009
|
C,
|
|
3010
3010
|
{
|
|
3011
3011
|
variant: "body2",
|
|
@@ -3024,7 +3024,7 @@ function oa({
|
|
|
3024
3024
|
}
|
|
3025
3025
|
) });
|
|
3026
3026
|
}
|
|
3027
|
-
function
|
|
3027
|
+
function Ai({
|
|
3028
3028
|
name: t,
|
|
3029
3029
|
selected: a,
|
|
3030
3030
|
onClick: i,
|
|
@@ -3043,19 +3043,19 @@ function qi({
|
|
|
3043
3043
|
"div",
|
|
3044
3044
|
{
|
|
3045
3045
|
className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
|
|
3046
|
-
children: /* @__PURE__ */ e(
|
|
3046
|
+
children: /* @__PURE__ */ e(Ta, { color: "inherit", size: "medium" })
|
|
3047
3047
|
}
|
|
3048
3048
|
),
|
|
3049
|
-
/* @__PURE__ */ e(
|
|
3049
|
+
/* @__PURE__ */ e(Va, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
|
|
3050
3050
|
] }),
|
|
3051
3051
|
/* @__PURE__ */ e(
|
|
3052
3052
|
qe,
|
|
3053
3053
|
{
|
|
3054
|
-
className:
|
|
3054
|
+
className: xe(
|
|
3055
3055
|
"pl-2 w-full flex flex-row gap-4 items-center",
|
|
3056
|
-
|
|
3057
|
-
i ?
|
|
3058
|
-
a ?
|
|
3056
|
+
Jt,
|
|
3057
|
+
i ? Qt : "",
|
|
3058
|
+
a ? Wt : "",
|
|
3059
3059
|
"flex-grow p-4 border transition-colors duration-200",
|
|
3060
3060
|
a ? "border-blue-500" : "border-transparent"
|
|
3061
3061
|
),
|
|
@@ -3080,7 +3080,7 @@ function qi({
|
|
|
3080
3080
|
children: o?.name
|
|
3081
3081
|
}
|
|
3082
3082
|
),
|
|
3083
|
-
r && !oe(r) && /* @__PURE__ */ e(
|
|
3083
|
+
r && !oe(r) && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3084
3084
|
C,
|
|
3085
3085
|
{
|
|
3086
3086
|
variant: "body2",
|
|
@@ -3089,7 +3089,7 @@ function qi({
|
|
|
3089
3089
|
children: r.dataType
|
|
3090
3090
|
}
|
|
3091
3091
|
) }),
|
|
3092
|
-
r && oe(r) && /* @__PURE__ */ e(
|
|
3092
|
+
r && oe(r) && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3093
3093
|
C,
|
|
3094
3094
|
{
|
|
3095
3095
|
variant: "body2",
|
|
@@ -3098,7 +3098,7 @@ function qi({
|
|
|
3098
3098
|
children: "This property is defined as a property builder in code"
|
|
3099
3099
|
}
|
|
3100
3100
|
) }),
|
|
3101
|
-
!r && /* @__PURE__ */ e(
|
|
3101
|
+
!r && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3102
3102
|
C,
|
|
3103
3103
|
{
|
|
3104
3104
|
variant: "body2",
|
|
@@ -3126,48 +3126,48 @@ function ft({
|
|
|
3126
3126
|
onPropertyMove: p,
|
|
3127
3127
|
onPropertyRemove: m,
|
|
3128
3128
|
className: u,
|
|
3129
|
-
inferredPropertyKeys:
|
|
3130
|
-
collectionEditable:
|
|
3129
|
+
inferredPropertyKeys: d,
|
|
3130
|
+
collectionEditable: c
|
|
3131
3131
|
}) {
|
|
3132
|
-
const
|
|
3132
|
+
const y = s ?? Object.keys(r), g = Z((b) => {
|
|
3133
3133
|
if (!b.destination)
|
|
3134
3134
|
return;
|
|
3135
|
-
const O = b.source.index,
|
|
3136
|
-
|
|
3137
|
-
}, [t, p,
|
|
3138
|
-
return /* @__PURE__ */ e(
|
|
3135
|
+
const O = b.source.index, w = b.destination.index, k = Array.from(y), [f] = k.splice(O, 1);
|
|
3136
|
+
k.splice(w, 0, f), p && p(k, t);
|
|
3137
|
+
}, [t, p, y]);
|
|
3138
|
+
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(ri, { onDragEnd: g, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
|
|
3139
3139
|
"div",
|
|
3140
3140
|
{
|
|
3141
3141
|
...b.droppableProps,
|
|
3142
3142
|
ref: b.innerRef,
|
|
3143
3143
|
className: u,
|
|
3144
3144
|
children: [
|
|
3145
|
-
|
|
3146
|
-
const
|
|
3147
|
-
return !
|
|
3148
|
-
|
|
3145
|
+
y && y.map((w, k) => {
|
|
3146
|
+
const f = r[w], v = o?.find((_) => _.key === w);
|
|
3147
|
+
return !f && !v ? (console.warn(`Property ${w} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
3148
|
+
ni,
|
|
3149
3149
|
{
|
|
3150
|
-
draggableId: `array_field_${t}_${
|
|
3151
|
-
index:
|
|
3152
|
-
children: (
|
|
3153
|
-
|
|
3150
|
+
draggableId: `array_field_${t}_${w}}`,
|
|
3151
|
+
index: k,
|
|
3152
|
+
children: (_, h) => /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
3153
|
+
zi,
|
|
3154
3154
|
{
|
|
3155
|
-
propertyKey:
|
|
3156
|
-
propertyOrBuilder:
|
|
3157
|
-
additionalField:
|
|
3158
|
-
provided:
|
|
3155
|
+
propertyKey: w,
|
|
3156
|
+
propertyOrBuilder: f,
|
|
3157
|
+
additionalField: v,
|
|
3158
|
+
provided: _,
|
|
3159
3159
|
errors: l,
|
|
3160
3160
|
namespace: t,
|
|
3161
|
-
inferredPropertyKeys:
|
|
3161
|
+
inferredPropertyKeys: d,
|
|
3162
3162
|
onPropertyMove: p,
|
|
3163
3163
|
onPropertyRemove: m,
|
|
3164
|
-
onPropertyClick:
|
|
3164
|
+
onPropertyClick: h.isDragging ? void 0 : i,
|
|
3165
3165
|
selectedPropertyKey: a,
|
|
3166
|
-
collectionEditable:
|
|
3166
|
+
collectionEditable: c
|
|
3167
3167
|
}
|
|
3168
3168
|
) })
|
|
3169
3169
|
},
|
|
3170
|
-
`array_field_${t}_${
|
|
3170
|
+
`array_field_${t}_${w}}`
|
|
3171
3171
|
);
|
|
3172
3172
|
}).filter(Boolean),
|
|
3173
3173
|
b.placeholder
|
|
@@ -3175,7 +3175,7 @@ function ft({
|
|
|
3175
3175
|
}
|
|
3176
3176
|
) }) }) });
|
|
3177
3177
|
}
|
|
3178
|
-
function
|
|
3178
|
+
function zi({
|
|
3179
3179
|
propertyKey: t,
|
|
3180
3180
|
namespace: a,
|
|
3181
3181
|
propertyOrBuilder: i,
|
|
@@ -3186,29 +3186,29 @@ function Ai({
|
|
|
3186
3186
|
onPropertyClick: p,
|
|
3187
3187
|
onPropertyMove: m,
|
|
3188
3188
|
onPropertyRemove: u,
|
|
3189
|
-
inferredPropertyKeys:
|
|
3190
|
-
collectionEditable:
|
|
3189
|
+
inferredPropertyKeys: d,
|
|
3190
|
+
collectionEditable: c
|
|
3191
3191
|
}) {
|
|
3192
|
-
const
|
|
3192
|
+
const y = d?.includes(a ? `${a}.${t}` : t), g = ce(t, a);
|
|
3193
3193
|
let b;
|
|
3194
3194
|
if (typeof i == "object") {
|
|
3195
|
-
const
|
|
3196
|
-
|
|
3195
|
+
const f = i;
|
|
3196
|
+
f.dataType === "map" && f.properties && (b = /* @__PURE__ */ e(
|
|
3197
3197
|
ft,
|
|
3198
3198
|
{
|
|
3199
3199
|
selectedPropertyKey: o,
|
|
3200
3200
|
namespace: g,
|
|
3201
|
-
properties:
|
|
3202
|
-
propertiesOrder:
|
|
3201
|
+
properties: f.properties,
|
|
3202
|
+
propertiesOrder: f.propertiesOrder,
|
|
3203
3203
|
errors: l,
|
|
3204
3204
|
onPropertyClick: p,
|
|
3205
3205
|
onPropertyMove: m,
|
|
3206
3206
|
onPropertyRemove: u,
|
|
3207
|
-
collectionEditable:
|
|
3207
|
+
collectionEditable: c
|
|
3208
3208
|
}
|
|
3209
3209
|
));
|
|
3210
3210
|
}
|
|
3211
|
-
const O = g ? P(l,
|
|
3211
|
+
const O = g ? P(l, ke(g)) : !1, w = o === g, k = i && (c && !oe(i) || Je(i));
|
|
3212
3212
|
return /* @__PURE__ */ n(
|
|
3213
3213
|
"div",
|
|
3214
3214
|
{
|
|
@@ -3228,33 +3228,33 @@ function Ai({
|
|
|
3228
3228
|
}
|
|
3229
3229
|
}
|
|
3230
3230
|
),
|
|
3231
|
-
!oe(i) && !r &&
|
|
3231
|
+
!oe(i) && !r && k ? /* @__PURE__ */ e(
|
|
3232
3232
|
oa,
|
|
3233
3233
|
{
|
|
3234
3234
|
property: i,
|
|
3235
3235
|
onClick: p ? () => p(t, a) : void 0,
|
|
3236
3236
|
includeName: !0,
|
|
3237
|
-
selected:
|
|
3237
|
+
selected: w,
|
|
3238
3238
|
hasError: O
|
|
3239
3239
|
}
|
|
3240
3240
|
) : /* @__PURE__ */ e(
|
|
3241
|
-
|
|
3241
|
+
Ai,
|
|
3242
3242
|
{
|
|
3243
3243
|
name: t,
|
|
3244
3244
|
property: i,
|
|
3245
3245
|
onClick: p ? () => p(t, a) : void 0,
|
|
3246
|
-
selected:
|
|
3246
|
+
selected: w
|
|
3247
3247
|
}
|
|
3248
3248
|
),
|
|
3249
3249
|
/* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
3250
|
-
|
|
3250
|
+
y && /* @__PURE__ */ e(re, { title: "Inferred property", children: /* @__PURE__ */ e(gt, { size: "small", className: "p-2" }) }),
|
|
3251
3251
|
u && /* @__PURE__ */ e(re, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3252
3252
|
ne,
|
|
3253
3253
|
{
|
|
3254
3254
|
size: "small",
|
|
3255
3255
|
color: "inherit",
|
|
3256
3256
|
onClick: () => u(t, a),
|
|
3257
|
-
children: /* @__PURE__ */ e(
|
|
3257
|
+
children: /* @__PURE__ */ e(Ia, { size: "small" })
|
|
3258
3258
|
}
|
|
3259
3259
|
) }),
|
|
3260
3260
|
m && /* @__PURE__ */ e(re, { title: "Move", children: /* @__PURE__ */ e(
|
|
@@ -3262,7 +3262,7 @@ function Ai({
|
|
|
3262
3262
|
{
|
|
3263
3263
|
component: "span",
|
|
3264
3264
|
size: "small",
|
|
3265
|
-
children: /* @__PURE__ */ e(
|
|
3265
|
+
children: /* @__PURE__ */ e(Fa, { size: "small" })
|
|
3266
3266
|
}
|
|
3267
3267
|
) })
|
|
3268
3268
|
] }),
|
|
@@ -3271,28 +3271,28 @@ function Ai({
|
|
|
3271
3271
|
}
|
|
3272
3272
|
);
|
|
3273
3273
|
}
|
|
3274
|
-
function
|
|
3274
|
+
function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
|
|
3275
3275
|
const {
|
|
3276
3276
|
values: o,
|
|
3277
3277
|
setFieldValue: l
|
|
3278
|
-
} =
|
|
3279
|
-
id:
|
|
3280
|
-
property:
|
|
3278
|
+
} = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = Z(({
|
|
3279
|
+
id: h,
|
|
3280
|
+
property: A
|
|
3281
3281
|
}) => {
|
|
3282
|
-
if (!
|
|
3282
|
+
if (!h)
|
|
3283
3283
|
throw Error();
|
|
3284
3284
|
l("properties", {
|
|
3285
3285
|
...o.properties ?? {},
|
|
3286
|
-
[
|
|
3287
|
-
}, !1), l("propertiesOrder", [...g,
|
|
3288
|
-
}, [o.properties, g]), O =
|
|
3289
|
-
const
|
|
3290
|
-
if (!
|
|
3286
|
+
[h]: A
|
|
3287
|
+
}, !1), l("propertiesOrder", [...g, h], !1), m(!1);
|
|
3288
|
+
}, [o.properties, g]), O = Z((h, A) => {
|
|
3289
|
+
const E = h ? ce(h, A) : void 0;
|
|
3290
|
+
if (!E)
|
|
3291
3291
|
throw Error("collection editor miss config");
|
|
3292
|
-
const
|
|
3293
|
-
l(
|
|
3294
|
-
}, [l, o]),
|
|
3295
|
-
|
|
3292
|
+
const z = ke(E), q = Pe(A), B = P(o, q) ?? Object.keys(P(o, ki(A)));
|
|
3293
|
+
l(z, void 0, !1), l(q, B.filter((S) => S !== h), !1), m(!1), d(void 0), y(void 0);
|
|
3294
|
+
}, [l, o]), w = u ? ce(u, c) : void 0, k = w ? P(o.properties, w.replaceAll(".", ".properties.")) : void 0, f = /* @__PURE__ */ n(
|
|
3295
|
+
U,
|
|
3296
3296
|
{
|
|
3297
3297
|
color: "primary",
|
|
3298
3298
|
variant: "outlined",
|
|
@@ -3303,14 +3303,14 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3303
3303
|
o.name ?? "this group"
|
|
3304
3304
|
]
|
|
3305
3305
|
}
|
|
3306
|
-
),
|
|
3307
|
-
l(
|
|
3306
|
+
), v = !g || g.length < 1, _ = Z((h, A) => {
|
|
3307
|
+
l(Pe(A), h, !1);
|
|
3308
3308
|
}, []);
|
|
3309
|
-
return /* @__PURE__ */ n(
|
|
3309
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3310
3310
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3311
3311
|
/* @__PURE__ */ n("div", { className: "flex justify-between items-end my-4", children: [
|
|
3312
3312
|
/* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this group" }),
|
|
3313
|
-
|
|
3313
|
+
f
|
|
3314
3314
|
] }),
|
|
3315
3315
|
/* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
|
|
3316
3316
|
/* @__PURE__ */ e(
|
|
@@ -3320,13 +3320,13 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3320
3320
|
propertiesOrder: g,
|
|
3321
3321
|
errors: {},
|
|
3322
3322
|
collectionEditable: s,
|
|
3323
|
-
onPropertyClick: (
|
|
3324
|
-
|
|
3323
|
+
onPropertyClick: (h, A) => {
|
|
3324
|
+
d(h), y(A), m(!0);
|
|
3325
3325
|
},
|
|
3326
|
-
onPropertyMove:
|
|
3326
|
+
onPropertyMove: _
|
|
3327
3327
|
}
|
|
3328
3328
|
),
|
|
3329
|
-
|
|
3329
|
+
v && /* @__PURE__ */ e(
|
|
3330
3330
|
C,
|
|
3331
3331
|
{
|
|
3332
3332
|
variant: "label",
|
|
@@ -3338,12 +3338,12 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3338
3338
|
] }),
|
|
3339
3339
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3340
3340
|
/* @__PURE__ */ e(
|
|
3341
|
-
|
|
3341
|
+
Ht,
|
|
3342
3342
|
{
|
|
3343
3343
|
position: "start",
|
|
3344
3344
|
size: "small",
|
|
3345
3345
|
label: "Spread children as columns",
|
|
3346
|
-
onValueChange: (
|
|
3346
|
+
onValueChange: (h) => l("spreadChildren", h),
|
|
3347
3347
|
value: o.spreadChildren ?? !1
|
|
3348
3348
|
}
|
|
3349
3349
|
),
|
|
@@ -3358,16 +3358,16 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3358
3358
|
allowDataInference: i,
|
|
3359
3359
|
collectionEditable: s,
|
|
3360
3360
|
onCancel: () => {
|
|
3361
|
-
m(!1),
|
|
3361
|
+
m(!1), d(void 0), y(void 0);
|
|
3362
3362
|
},
|
|
3363
3363
|
onOkClicked: () => {
|
|
3364
|
-
m(!1),
|
|
3364
|
+
m(!1), d(void 0), y(void 0);
|
|
3365
3365
|
},
|
|
3366
3366
|
getData: a,
|
|
3367
3367
|
onDelete: O,
|
|
3368
3368
|
propertyKey: u,
|
|
3369
|
-
propertyNamespace:
|
|
3370
|
-
property:
|
|
3369
|
+
propertyNamespace: c,
|
|
3370
|
+
property: k,
|
|
3371
3371
|
existingProperty: !!u,
|
|
3372
3372
|
autoUpdateId: !u,
|
|
3373
3373
|
autoOpenTypeSelect: !u,
|
|
@@ -3378,7 +3378,7 @@ function zi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3378
3378
|
)
|
|
3379
3379
|
] });
|
|
3380
3380
|
}
|
|
3381
|
-
function
|
|
3381
|
+
function Vi({
|
|
3382
3382
|
showErrors: t,
|
|
3383
3383
|
existing: a,
|
|
3384
3384
|
disabled: i,
|
|
@@ -3391,20 +3391,20 @@ function Ti({
|
|
|
3391
3391
|
values: p,
|
|
3392
3392
|
handleChange: m,
|
|
3393
3393
|
errors: u,
|
|
3394
|
-
setFieldValue:
|
|
3395
|
-
touched:
|
|
3396
|
-
} =
|
|
3397
|
-
|
|
3398
|
-
}, []),
|
|
3399
|
-
return /* @__PURE__ */ n(
|
|
3394
|
+
setFieldValue: d,
|
|
3395
|
+
touched: c
|
|
3396
|
+
} = Y(), [y, g] = L(!1), b = P(p, "of"), O = P(c, "of") && P(u, "of"), w = Z(({ id: f, property: v, namespace: _ }) => {
|
|
3397
|
+
d("of", v);
|
|
3398
|
+
}, []), k = b && Ze(b, o);
|
|
3399
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3400
3400
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3401
3401
|
/* @__PURE__ */ e(C, { variant: "subtitle2", children: "Repeat component" }),
|
|
3402
3402
|
/* @__PURE__ */ e(
|
|
3403
|
-
|
|
3403
|
+
ye,
|
|
3404
3404
|
{
|
|
3405
3405
|
name: "of",
|
|
3406
3406
|
value: b,
|
|
3407
|
-
validate: (
|
|
3407
|
+
validate: (f) => f?.dataType ? void 0 : "You need to specify a repeat field",
|
|
3408
3408
|
children: () => /* @__PURE__ */ n(qe, { className: "p-2 mt-4", children: [
|
|
3409
3409
|
b && /* @__PURE__ */ e(
|
|
3410
3410
|
oa,
|
|
@@ -3418,7 +3418,7 @@ function Ti({
|
|
|
3418
3418
|
}
|
|
3419
3419
|
),
|
|
3420
3420
|
!i && !b && /* @__PURE__ */ n(
|
|
3421
|
-
|
|
3421
|
+
U,
|
|
3422
3422
|
{
|
|
3423
3423
|
variant: "text",
|
|
3424
3424
|
size: "large",
|
|
@@ -3426,7 +3426,7 @@ function Ti({
|
|
|
3426
3426
|
onClick: () => g(!0),
|
|
3427
3427
|
children: [
|
|
3428
3428
|
"Edit ",
|
|
3429
|
-
`${
|
|
3429
|
+
`${k ? k.name : "repeat component"}`
|
|
3430
3430
|
]
|
|
3431
3431
|
}
|
|
3432
3432
|
),
|
|
@@ -3434,7 +3434,7 @@ function Ti({
|
|
|
3434
3434
|
je,
|
|
3435
3435
|
{
|
|
3436
3436
|
inArray: !0,
|
|
3437
|
-
open:
|
|
3437
|
+
open: y,
|
|
3438
3438
|
existingProperty: a,
|
|
3439
3439
|
getData: r,
|
|
3440
3440
|
autoUpdateId: !a,
|
|
@@ -3443,7 +3443,7 @@ function Ti({
|
|
|
3443
3443
|
allowDataInference: s,
|
|
3444
3444
|
property: b,
|
|
3445
3445
|
includeIdAndName: !1,
|
|
3446
|
-
onPropertyChanged:
|
|
3446
|
+
onPropertyChanged: w,
|
|
3447
3447
|
forceShowErrors: t,
|
|
3448
3448
|
propertyConfigs: o,
|
|
3449
3449
|
collectionEditable: l
|
|
@@ -3453,10 +3453,10 @@ function Ti({
|
|
|
3453
3453
|
}
|
|
3454
3454
|
)
|
|
3455
3455
|
] }),
|
|
3456
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
|
|
3456
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(At, { disabled: i }) }) })
|
|
3457
3457
|
] });
|
|
3458
3458
|
}
|
|
3459
|
-
const
|
|
3459
|
+
const Ii = K.forwardRef(
|
|
3460
3460
|
function({
|
|
3461
3461
|
showErrors: a,
|
|
3462
3462
|
disabledId: i,
|
|
@@ -3466,17 +3466,17 @@ const Vi = L.forwardRef(
|
|
|
3466
3466
|
}, l) {
|
|
3467
3467
|
const {
|
|
3468
3468
|
errors: p
|
|
3469
|
-
} =
|
|
3469
|
+
} = Y(), m = "name", u = a && P(p, m), d = "id", c = a && P(p, d), y = "description", g = a && P(p, y);
|
|
3470
3470
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
|
|
3471
3471
|
/* @__PURE__ */ n("div", { children: [
|
|
3472
3472
|
/* @__PURE__ */ e(
|
|
3473
|
-
|
|
3473
|
+
ye,
|
|
3474
3474
|
{
|
|
3475
3475
|
inputRef: l,
|
|
3476
3476
|
name: m,
|
|
3477
|
-
as:
|
|
3477
|
+
as: J,
|
|
3478
3478
|
style: { fontSize: 20 },
|
|
3479
|
-
validate:
|
|
3479
|
+
validate: Ei,
|
|
3480
3480
|
placeholder: "Field name",
|
|
3481
3481
|
required: !0,
|
|
3482
3482
|
disabled: s,
|
|
@@ -3487,26 +3487,26 @@ const Vi = L.forwardRef(
|
|
|
3487
3487
|
] }),
|
|
3488
3488
|
/* @__PURE__ */ n("div", { children: [
|
|
3489
3489
|
/* @__PURE__ */ e(
|
|
3490
|
-
|
|
3490
|
+
ye,
|
|
3491
3491
|
{
|
|
3492
|
-
name:
|
|
3492
|
+
name: d,
|
|
3493
3493
|
as: Te,
|
|
3494
3494
|
label: "ID",
|
|
3495
|
-
validate: (b) =>
|
|
3495
|
+
validate: (b) => ji(b, r),
|
|
3496
3496
|
disabled: i || s,
|
|
3497
3497
|
required: !0,
|
|
3498
3498
|
size: "small",
|
|
3499
|
-
error: !!
|
|
3499
|
+
error: !!c
|
|
3500
3500
|
}
|
|
3501
3501
|
),
|
|
3502
|
-
/* @__PURE__ */ e(ie, { error: !!
|
|
3502
|
+
/* @__PURE__ */ e(ie, { error: !!c, children: c })
|
|
3503
3503
|
] }),
|
|
3504
3504
|
/* @__PURE__ */ n("div", { children: [
|
|
3505
3505
|
/* @__PURE__ */ e(
|
|
3506
|
-
|
|
3506
|
+
ye,
|
|
3507
3507
|
{
|
|
3508
|
-
name:
|
|
3509
|
-
as:
|
|
3508
|
+
name: y,
|
|
3509
|
+
as: J,
|
|
3510
3510
|
label: "Description",
|
|
3511
3511
|
disabled: s,
|
|
3512
3512
|
error: !!g
|
|
@@ -3516,22 +3516,22 @@ const Vi = L.forwardRef(
|
|
|
3516
3516
|
] })
|
|
3517
3517
|
] });
|
|
3518
3518
|
}
|
|
3519
|
-
),
|
|
3520
|
-
function
|
|
3519
|
+
), Fi = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
3520
|
+
function ji(t, a) {
|
|
3521
3521
|
let i;
|
|
3522
|
-
return t || (i = "You must specify an id for the field"), t && !t.match(
|
|
3522
|
+
return t || (i = "You must specify an id for the field"), t && !t.match(Fi) && (i = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (i = "There is another field with this ID already"), i;
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function Ei(t) {
|
|
3525
3525
|
let a;
|
|
3526
3526
|
return t || (a = "You must specify a title for the field"), a;
|
|
3527
3527
|
}
|
|
3528
|
-
function
|
|
3528
|
+
function Di({
|
|
3529
3529
|
widgetId: t,
|
|
3530
3530
|
disabled: a,
|
|
3531
3531
|
showErrors: i
|
|
3532
3532
|
}) {
|
|
3533
|
-
const { values: r, setFieldValue: s } =
|
|
3534
|
-
return /* @__PURE__ */ n(
|
|
3533
|
+
const { values: r, setFieldValue: s } = Y();
|
|
3534
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3535
3535
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
|
|
3536
3536
|
t === "text_field" && /* @__PURE__ */ e(
|
|
3537
3537
|
Ue,
|
|
@@ -3598,9 +3598,9 @@ function Ei({
|
|
|
3598
3598
|
) })
|
|
3599
3599
|
] });
|
|
3600
3600
|
}
|
|
3601
|
-
function
|
|
3602
|
-
const { values: a } =
|
|
3603
|
-
return /* @__PURE__ */ n(
|
|
3601
|
+
function Bi({ disabled: t }) {
|
|
3602
|
+
const { values: a } = Y(), i = P(a, "defaultValue");
|
|
3603
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3604
3604
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }),
|
|
3605
3605
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3606
3606
|
de,
|
|
@@ -3615,29 +3615,29 @@ function Di({ disabled: t }) {
|
|
|
3615
3615
|
) })
|
|
3616
3616
|
] });
|
|
3617
3617
|
}
|
|
3618
|
-
function
|
|
3618
|
+
function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
|
|
3619
3619
|
const {
|
|
3620
3620
|
values: o,
|
|
3621
3621
|
setFieldValue: l
|
|
3622
|
-
} =
|
|
3623
|
-
id:
|
|
3624
|
-
property:
|
|
3622
|
+
} = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), g = Z(({
|
|
3623
|
+
id: v,
|
|
3624
|
+
property: _
|
|
3625
3625
|
}) => {
|
|
3626
|
-
if (!
|
|
3626
|
+
if (!v)
|
|
3627
3627
|
throw Error();
|
|
3628
3628
|
l("oneOf.properties", {
|
|
3629
3629
|
...o.oneOf?.properties ?? {},
|
|
3630
|
-
[
|
|
3631
|
-
}, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}),
|
|
3632
|
-
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u,
|
|
3633
|
-
const
|
|
3634
|
-
if (!
|
|
3630
|
+
[v]: _
|
|
3631
|
+
}, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), v], !1), m(!1);
|
|
3632
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, c) : void 0, O = b ? P(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, w = Z((v, _) => {
|
|
3633
|
+
const h = v ? ce(v, _) : void 0;
|
|
3634
|
+
if (!h)
|
|
3635
3635
|
throw Error("collection editor miss config");
|
|
3636
|
-
l(`oneOf.${
|
|
3637
|
-
const
|
|
3638
|
-
l(
|
|
3639
|
-
}, [l, o]),
|
|
3640
|
-
|
|
3636
|
+
l(`oneOf.${ke(h)}`, void 0, !1);
|
|
3637
|
+
const A = `oneOf.${Pe(_)}`, E = P(o, A);
|
|
3638
|
+
l(A, E.filter((z) => z !== v), !1), m(!1), d(void 0), y(void 0);
|
|
3639
|
+
}, [l, o]), k = /* @__PURE__ */ n(
|
|
3640
|
+
U,
|
|
3641
3641
|
{
|
|
3642
3642
|
autoFocus: !0,
|
|
3643
3643
|
color: "primary",
|
|
@@ -3648,14 +3648,14 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3648
3648
|
o.name ?? "this block"
|
|
3649
3649
|
]
|
|
3650
3650
|
}
|
|
3651
|
-
),
|
|
3652
|
-
l(`oneOf.${
|
|
3651
|
+
), f = Z((v, _) => {
|
|
3652
|
+
l(`oneOf.${Pe(_)}`, v, !1);
|
|
3653
3653
|
}, []);
|
|
3654
|
-
return /* @__PURE__ */ n(
|
|
3654
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3655
3655
|
/* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
3656
3656
|
/* @__PURE__ */ n("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
|
|
3657
3657
|
/* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this block" }),
|
|
3658
|
-
|
|
3658
|
+
k
|
|
3659
3659
|
] }),
|
|
3660
3660
|
/* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
|
|
3661
3661
|
/* @__PURE__ */ e(
|
|
@@ -3665,10 +3665,10 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3665
3665
|
propertiesOrder: o.oneOf?.propertiesOrder,
|
|
3666
3666
|
errors: {},
|
|
3667
3667
|
collectionEditable: s,
|
|
3668
|
-
onPropertyClick: t ? void 0 : (
|
|
3669
|
-
|
|
3668
|
+
onPropertyClick: t ? void 0 : (v, _) => {
|
|
3669
|
+
d(v), y(_), m(!0);
|
|
3670
3670
|
},
|
|
3671
|
-
onPropertyMove: t ? void 0 :
|
|
3671
|
+
onPropertyMove: t ? void 0 : f
|
|
3672
3672
|
}
|
|
3673
3673
|
),
|
|
3674
3674
|
!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" })
|
|
@@ -3683,15 +3683,15 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3683
3683
|
getData: a,
|
|
3684
3684
|
allowDataInference: i,
|
|
3685
3685
|
onCancel: () => {
|
|
3686
|
-
m(!1),
|
|
3686
|
+
m(!1), d(void 0), y(void 0);
|
|
3687
3687
|
},
|
|
3688
3688
|
onOkClicked: () => {
|
|
3689
|
-
m(!1),
|
|
3689
|
+
m(!1), d(void 0), y(void 0);
|
|
3690
3690
|
},
|
|
3691
3691
|
collectionEditable: s,
|
|
3692
|
-
onDelete:
|
|
3692
|
+
onDelete: w,
|
|
3693
3693
|
propertyKey: u,
|
|
3694
|
-
propertyNamespace:
|
|
3694
|
+
propertyNamespace: c,
|
|
3695
3695
|
property: O,
|
|
3696
3696
|
existingProperty: !!u,
|
|
3697
3697
|
autoUpdateId: !u,
|
|
@@ -3703,15 +3703,15 @@ function Bi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3703
3703
|
)
|
|
3704
3704
|
] });
|
|
3705
3705
|
}
|
|
3706
|
-
function
|
|
3706
|
+
function Ri({ disabled: t }) {
|
|
3707
3707
|
const {
|
|
3708
3708
|
values: a,
|
|
3709
3709
|
handleChange: i
|
|
3710
|
-
} =
|
|
3710
|
+
} = Y(), r = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", p = "validation.positive", m = "validation.negative", u = "validation.integer";
|
|
3711
3711
|
return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
3712
3712
|
/* @__PURE__ */ e(Me, { disabled: t }),
|
|
3713
3713
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3714
|
-
|
|
3714
|
+
J,
|
|
3715
3715
|
{
|
|
3716
3716
|
value: P(a, r),
|
|
3717
3717
|
label: "Min value",
|
|
@@ -3723,7 +3723,7 @@ function Mi({ disabled: t }) {
|
|
|
3723
3723
|
}
|
|
3724
3724
|
) }),
|
|
3725
3725
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3726
|
-
|
|
3726
|
+
J,
|
|
3727
3727
|
{
|
|
3728
3728
|
value: P(a, s),
|
|
3729
3729
|
label: "Max value",
|
|
@@ -3735,7 +3735,7 @@ function Mi({ disabled: t }) {
|
|
|
3735
3735
|
}
|
|
3736
3736
|
) }),
|
|
3737
3737
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3738
|
-
|
|
3738
|
+
J,
|
|
3739
3739
|
{
|
|
3740
3740
|
value: P(a, o),
|
|
3741
3741
|
label: "Less than",
|
|
@@ -3747,7 +3747,7 @@ function Mi({ disabled: t }) {
|
|
|
3747
3747
|
}
|
|
3748
3748
|
) }),
|
|
3749
3749
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
3750
|
-
|
|
3750
|
+
J,
|
|
3751
3751
|
{
|
|
3752
3752
|
value: P(a, l),
|
|
3753
3753
|
label: "More than",
|
|
@@ -3790,10 +3790,10 @@ function Mi({ disabled: t }) {
|
|
|
3790
3790
|
) })
|
|
3791
3791
|
] });
|
|
3792
3792
|
}
|
|
3793
|
-
function
|
|
3794
|
-
const { values: a, setFieldValue: i } =
|
|
3795
|
-
return /* @__PURE__ */ n(
|
|
3796
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
|
|
3793
|
+
function Ui({ disabled: t }) {
|
|
3794
|
+
const { values: a, setFieldValue: i } = Y();
|
|
3795
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3796
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ri, { disabled: t }) }) }),
|
|
3797
3797
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3798
3798
|
Te,
|
|
3799
3799
|
{
|
|
@@ -3809,7 +3809,7 @@ function Ri({ disabled: t }) {
|
|
|
3809
3809
|
) })
|
|
3810
3810
|
] });
|
|
3811
3811
|
}
|
|
3812
|
-
function
|
|
3812
|
+
function Rt({
|
|
3813
3813
|
existing: t,
|
|
3814
3814
|
multiple: a,
|
|
3815
3815
|
disabled: i,
|
|
@@ -3822,31 +3822,31 @@ function Ut({
|
|
|
3822
3822
|
touched: p,
|
|
3823
3823
|
setFieldError: m,
|
|
3824
3824
|
setFieldValue: u
|
|
3825
|
-
} =
|
|
3825
|
+
} = Y();
|
|
3826
3826
|
if (!Be())
|
|
3827
3827
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(We, {}) });
|
|
3828
|
-
const
|
|
3829
|
-
return console.log("pathError", l, g), /* @__PURE__ */ e(
|
|
3830
|
-
|
|
3828
|
+
const c = a ? "of.path" : "path", y = P(s, c), g = r && P(l, c);
|
|
3829
|
+
return console.log("pathError", l, g), /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3830
|
+
ye,
|
|
3831
3831
|
{
|
|
3832
3832
|
required: !0,
|
|
3833
|
-
name:
|
|
3834
|
-
pathPath:
|
|
3833
|
+
name: c,
|
|
3834
|
+
pathPath: c,
|
|
3835
3835
|
type: "select",
|
|
3836
|
-
validate:
|
|
3836
|
+
validate: $i,
|
|
3837
3837
|
disabled: t || i,
|
|
3838
|
-
value:
|
|
3838
|
+
value: y,
|
|
3839
3839
|
error: g,
|
|
3840
3840
|
handleChange: o,
|
|
3841
|
-
component:
|
|
3841
|
+
component: Li
|
|
3842
3842
|
}
|
|
3843
3843
|
) }) });
|
|
3844
3844
|
}
|
|
3845
|
-
function
|
|
3845
|
+
function $i(t) {
|
|
3846
3846
|
let a;
|
|
3847
3847
|
return t || (a = "You must specify a target collection for the field"), a;
|
|
3848
3848
|
}
|
|
3849
|
-
function
|
|
3849
|
+
function Li({
|
|
3850
3850
|
disabled: t,
|
|
3851
3851
|
pathPath: a,
|
|
3852
3852
|
value: i,
|
|
@@ -3859,9 +3859,9 @@ function $i({
|
|
|
3859
3859
|
if (!l)
|
|
3860
3860
|
return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(We, {}) });
|
|
3861
3861
|
const p = l?.collections ?? [], m = Array.from(new Set(
|
|
3862
|
-
Object.values(p).map((
|
|
3863
|
-
).values()), u = p.filter((
|
|
3864
|
-
return /* @__PURE__ */ n(
|
|
3862
|
+
Object.values(p).map((d) => d.group).filter(Boolean)
|
|
3863
|
+
).values()), u = p.filter((d) => !d.group);
|
|
3864
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3865
3865
|
/* @__PURE__ */ n(
|
|
3866
3866
|
Se,
|
|
3867
3867
|
{
|
|
@@ -3872,72 +3872,72 @@ function $i({
|
|
|
3872
3872
|
name: a,
|
|
3873
3873
|
onChange: r,
|
|
3874
3874
|
label: "Target collection",
|
|
3875
|
-
renderValue: (
|
|
3876
|
-
const
|
|
3877
|
-
if (!
|
|
3875
|
+
renderValue: (d) => {
|
|
3876
|
+
const c = p.find((g) => g.id === d || g.path === d);
|
|
3877
|
+
if (!c)
|
|
3878
3878
|
return null;
|
|
3879
|
-
const
|
|
3879
|
+
const y = ct(c);
|
|
3880
3880
|
return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3881
|
-
|
|
3881
|
+
y,
|
|
3882
3882
|
/* @__PURE__ */ e(
|
|
3883
3883
|
C,
|
|
3884
3884
|
{
|
|
3885
3885
|
variant: "subtitle2",
|
|
3886
3886
|
className: "font-medium ml-4",
|
|
3887
|
-
children:
|
|
3887
|
+
children: c?.name.toUpperCase()
|
|
3888
3888
|
}
|
|
3889
3889
|
)
|
|
3890
3890
|
] });
|
|
3891
3891
|
},
|
|
3892
3892
|
...o,
|
|
3893
3893
|
children: [
|
|
3894
|
-
m.flatMap((
|
|
3895
|
-
|
|
3894
|
+
m.flatMap((d) => /* @__PURE__ */ e(
|
|
3895
|
+
Vt,
|
|
3896
3896
|
{
|
|
3897
|
-
label:
|
|
3898
|
-
children: p.filter((
|
|
3899
|
-
const
|
|
3897
|
+
label: d || "Views",
|
|
3898
|
+
children: p.filter((c) => c.group === d).map((c) => {
|
|
3899
|
+
const y = ct(c);
|
|
3900
3900
|
return /* @__PURE__ */ e(
|
|
3901
3901
|
ee,
|
|
3902
3902
|
{
|
|
3903
|
-
value:
|
|
3903
|
+
value: c.id ?? c.path,
|
|
3904
3904
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3905
|
-
|
|
3905
|
+
y,
|
|
3906
3906
|
/* @__PURE__ */ e(
|
|
3907
3907
|
C,
|
|
3908
3908
|
{
|
|
3909
3909
|
variant: "subtitle2",
|
|
3910
3910
|
className: "font-medium ml-4",
|
|
3911
|
-
children:
|
|
3911
|
+
children: c?.name.toUpperCase()
|
|
3912
3912
|
}
|
|
3913
3913
|
)
|
|
3914
3914
|
] })
|
|
3915
3915
|
},
|
|
3916
|
-
`${
|
|
3916
|
+
`${c.id ?? c.path}-${d}`
|
|
3917
3917
|
);
|
|
3918
3918
|
})
|
|
3919
3919
|
},
|
|
3920
|
-
`group_${
|
|
3920
|
+
`group_${d}`
|
|
3921
3921
|
)),
|
|
3922
|
-
u && /* @__PURE__ */ e(
|
|
3923
|
-
const
|
|
3922
|
+
u && /* @__PURE__ */ e(Vt, { label: "Views", children: u.map((d) => {
|
|
3923
|
+
const c = ct(d);
|
|
3924
3924
|
return /* @__PURE__ */ e(
|
|
3925
3925
|
ee,
|
|
3926
3926
|
{
|
|
3927
|
-
value:
|
|
3927
|
+
value: d.id ?? d.path,
|
|
3928
3928
|
children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
|
|
3929
|
-
|
|
3929
|
+
c,
|
|
3930
3930
|
/* @__PURE__ */ e(
|
|
3931
3931
|
C,
|
|
3932
3932
|
{
|
|
3933
3933
|
variant: "subtitle2",
|
|
3934
3934
|
className: "font-medium ml-4",
|
|
3935
|
-
children:
|
|
3935
|
+
children: d?.name.toUpperCase()
|
|
3936
3936
|
}
|
|
3937
3937
|
)
|
|
3938
3938
|
] })
|
|
3939
3939
|
},
|
|
3940
|
-
|
|
3940
|
+
d.id ?? d.path
|
|
3941
3941
|
);
|
|
3942
3942
|
}) })
|
|
3943
3943
|
]
|
|
@@ -3946,14 +3946,14 @@ function $i({
|
|
|
3946
3946
|
/* @__PURE__ */ e(ie, { children: "You can only edit the reference collection upon field creation." })
|
|
3947
3947
|
] });
|
|
3948
3948
|
}
|
|
3949
|
-
function
|
|
3949
|
+
function Ki({ disabled: t }) {
|
|
3950
3950
|
const {
|
|
3951
3951
|
values: a,
|
|
3952
3952
|
errors: i,
|
|
3953
3953
|
touched: r,
|
|
3954
3954
|
setFieldValue: s
|
|
3955
|
-
} =
|
|
3956
|
-
return /* @__PURE__ */ n(
|
|
3955
|
+
} = Y(), o = "mode", l = P(a, o), p = P(r, o) && P(i, o), m = "autoValue", u = P(a, m), d = P(r, m) && P(i, m);
|
|
3956
|
+
return /* @__PURE__ */ n($, { children: [
|
|
3957
3957
|
/* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
|
|
3958
3958
|
/* @__PURE__ */ n(
|
|
3959
3959
|
Se,
|
|
@@ -3961,10 +3961,10 @@ function Li({ disabled: t }) {
|
|
|
3961
3961
|
name: o,
|
|
3962
3962
|
value: l ?? "date",
|
|
3963
3963
|
error: !!p,
|
|
3964
|
-
onValueChange: (
|
|
3964
|
+
onValueChange: (c) => s(o, c),
|
|
3965
3965
|
label: "Mode",
|
|
3966
|
-
renderValue: (
|
|
3967
|
-
switch (
|
|
3966
|
+
renderValue: (c) => {
|
|
3967
|
+
switch (c) {
|
|
3968
3968
|
case "date_time":
|
|
3969
3969
|
return "Date/Time";
|
|
3970
3970
|
case "date":
|
|
@@ -3987,9 +3987,9 @@ function Li({ disabled: t }) {
|
|
|
3987
3987
|
name: m,
|
|
3988
3988
|
disabled: t,
|
|
3989
3989
|
value: u ?? "",
|
|
3990
|
-
onValueChange: (
|
|
3991
|
-
renderValue: (
|
|
3992
|
-
switch (
|
|
3990
|
+
onValueChange: (c) => s(m, c),
|
|
3991
|
+
renderValue: (c) => {
|
|
3992
|
+
switch (c) {
|
|
3993
3993
|
case "on_create":
|
|
3994
3994
|
return "On create";
|
|
3995
3995
|
case "on_update":
|
|
@@ -3998,7 +3998,7 @@ function Li({ disabled: t }) {
|
|
|
3998
3998
|
return "None";
|
|
3999
3999
|
}
|
|
4000
4000
|
},
|
|
4001
|
-
error: !!
|
|
4001
|
+
error: !!d,
|
|
4002
4002
|
label: "Automatic value",
|
|
4003
4003
|
children: [
|
|
4004
4004
|
/* @__PURE__ */ e(ee, { value: "", children: " None " }),
|
|
@@ -4007,13 +4007,13 @@ function Li({ disabled: t }) {
|
|
|
4007
4007
|
]
|
|
4008
4008
|
}
|
|
4009
4009
|
),
|
|
4010
|
-
/* @__PURE__ */ e(ie, { error: !!
|
|
4010
|
+
/* @__PURE__ */ e(ie, { error: !!d, children: d ?? "Update this field automatically when creating or updating the entity" })
|
|
4011
4011
|
] }),
|
|
4012
4012
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) })
|
|
4013
4013
|
] });
|
|
4014
4014
|
}
|
|
4015
|
-
function
|
|
4016
|
-
return
|
|
4015
|
+
function Yi({ disabled: t }) {
|
|
4016
|
+
return Y(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
4017
4017
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4018
4018
|
de,
|
|
4019
4019
|
{
|
|
@@ -4038,12 +4038,12 @@ function Ki({ disabled: t }) {
|
|
|
4038
4038
|
) })
|
|
4039
4039
|
] });
|
|
4040
4040
|
}
|
|
4041
|
-
function
|
|
4042
|
-
return /* @__PURE__ */ e(
|
|
4041
|
+
function Gi({ disabled: t }) {
|
|
4042
|
+
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }) });
|
|
4043
4043
|
}
|
|
4044
4044
|
function na(t, a, i) {
|
|
4045
4045
|
let r;
|
|
4046
|
-
return a === "text_field" ? r =
|
|
4046
|
+
return a === "text_field" ? r = G(
|
|
4047
4047
|
t,
|
|
4048
4048
|
{
|
|
4049
4049
|
dataType: "string",
|
|
@@ -4056,7 +4056,7 @@ function na(t, a, i) {
|
|
|
4056
4056
|
url: void 0,
|
|
4057
4057
|
enumValues: void 0
|
|
4058
4058
|
}
|
|
4059
|
-
) : a === "multiline" ? r =
|
|
4059
|
+
) : a === "multiline" ? r = G(
|
|
4060
4060
|
t,
|
|
4061
4061
|
{
|
|
4062
4062
|
dataType: "string",
|
|
@@ -4069,7 +4069,7 @@ function na(t, a, i) {
|
|
|
4069
4069
|
url: void 0,
|
|
4070
4070
|
enumValues: void 0
|
|
4071
4071
|
}
|
|
4072
|
-
) : a === "markdown" ? r =
|
|
4072
|
+
) : a === "markdown" ? r = G(
|
|
4073
4073
|
t,
|
|
4074
4074
|
{
|
|
4075
4075
|
dataType: "string",
|
|
@@ -4081,7 +4081,7 @@ function na(t, a, i) {
|
|
|
4081
4081
|
email: void 0,
|
|
4082
4082
|
url: void 0
|
|
4083
4083
|
}
|
|
4084
|
-
) : a === "url" ? r =
|
|
4084
|
+
) : a === "url" ? r = G(
|
|
4085
4085
|
t,
|
|
4086
4086
|
{
|
|
4087
4087
|
dataType: "string",
|
|
@@ -4094,7 +4094,7 @@ function na(t, a, i) {
|
|
|
4094
4094
|
url: !0,
|
|
4095
4095
|
enumValues: void 0
|
|
4096
4096
|
}
|
|
4097
|
-
) : a === "email" ? r =
|
|
4097
|
+
) : a === "email" ? r = G(
|
|
4098
4098
|
t,
|
|
4099
4099
|
{
|
|
4100
4100
|
dataType: "string",
|
|
@@ -4107,7 +4107,7 @@ function na(t, a, i) {
|
|
|
4107
4107
|
url: void 0,
|
|
4108
4108
|
enumValues: void 0
|
|
4109
4109
|
}
|
|
4110
|
-
) : a === "select" ? r =
|
|
4110
|
+
) : a === "select" ? r = G(
|
|
4111
4111
|
t,
|
|
4112
4112
|
{
|
|
4113
4113
|
dataType: "string",
|
|
@@ -4120,7 +4120,7 @@ function na(t, a, i) {
|
|
|
4120
4120
|
url: void 0,
|
|
4121
4121
|
enumValues: t.enumValues ?? []
|
|
4122
4122
|
}
|
|
4123
|
-
) : a === "multi_select" ? r =
|
|
4123
|
+
) : a === "multi_select" ? r = G(
|
|
4124
4124
|
t,
|
|
4125
4125
|
{
|
|
4126
4126
|
dataType: "array",
|
|
@@ -4131,7 +4131,7 @@ function na(t, a, i) {
|
|
|
4131
4131
|
enumValues: t.of?.enumValues ?? []
|
|
4132
4132
|
}
|
|
4133
4133
|
}
|
|
4134
|
-
) : a === "number_input" ? r =
|
|
4134
|
+
) : a === "number_input" ? r = G(
|
|
4135
4135
|
t,
|
|
4136
4136
|
{
|
|
4137
4137
|
dataType: "number",
|
|
@@ -4139,7 +4139,7 @@ function na(t, a, i) {
|
|
|
4139
4139
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4140
4140
|
enumValues: void 0
|
|
4141
4141
|
}
|
|
4142
|
-
) : a === "number_select" ? r =
|
|
4142
|
+
) : a === "number_select" ? r = G(
|
|
4143
4143
|
t,
|
|
4144
4144
|
{
|
|
4145
4145
|
dataType: "number",
|
|
@@ -4147,7 +4147,7 @@ function na(t, a, i) {
|
|
|
4147
4147
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4148
4148
|
enumValues: t.enumValues ?? []
|
|
4149
4149
|
}
|
|
4150
|
-
) : a === "multi_number_select" ? r =
|
|
4150
|
+
) : a === "multi_number_select" ? r = G(
|
|
4151
4151
|
t,
|
|
4152
4152
|
{
|
|
4153
4153
|
dataType: "array",
|
|
@@ -4158,7 +4158,7 @@ function na(t, a, i) {
|
|
|
4158
4158
|
enumValues: t.of?.enumValues ?? []
|
|
4159
4159
|
}
|
|
4160
4160
|
}
|
|
4161
|
-
) : a === "file_upload" ? r =
|
|
4161
|
+
) : a === "file_upload" ? r = G(
|
|
4162
4162
|
t,
|
|
4163
4163
|
{
|
|
4164
4164
|
dataType: "string",
|
|
@@ -4168,7 +4168,7 @@ function na(t, a, i) {
|
|
|
4168
4168
|
storagePath: "/"
|
|
4169
4169
|
}
|
|
4170
4170
|
}
|
|
4171
|
-
) : a === "multi_file_upload" ? r =
|
|
4171
|
+
) : a === "multi_file_upload" ? r = G(
|
|
4172
4172
|
t,
|
|
4173
4173
|
{
|
|
4174
4174
|
dataType: "array",
|
|
@@ -4181,7 +4181,7 @@ function na(t, a, i) {
|
|
|
4181
4181
|
}
|
|
4182
4182
|
}
|
|
4183
4183
|
}
|
|
4184
|
-
) : a === "group" ? r =
|
|
4184
|
+
) : a === "group" ? r = G(
|
|
4185
4185
|
t,
|
|
4186
4186
|
{
|
|
4187
4187
|
dataType: "map",
|
|
@@ -4190,7 +4190,7 @@ function na(t, a, i) {
|
|
|
4190
4190
|
keyValue: !1,
|
|
4191
4191
|
properties: t.properties ?? {}
|
|
4192
4192
|
}
|
|
4193
|
-
) : a === "key_value" ? r =
|
|
4193
|
+
) : a === "key_value" ? r = G(
|
|
4194
4194
|
t,
|
|
4195
4195
|
{
|
|
4196
4196
|
dataType: "map",
|
|
@@ -4199,14 +4199,14 @@ function na(t, a, i) {
|
|
|
4199
4199
|
keyValue: !0,
|
|
4200
4200
|
properties: void 0
|
|
4201
4201
|
}
|
|
4202
|
-
) : a === "reference" ? r =
|
|
4202
|
+
) : a === "reference" ? r = G(
|
|
4203
4203
|
t,
|
|
4204
4204
|
{
|
|
4205
4205
|
dataType: "reference",
|
|
4206
4206
|
propertyConfig: "reference",
|
|
4207
4207
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4208
4208
|
}
|
|
4209
|
-
) : a === "multi_references" ? r =
|
|
4209
|
+
) : a === "multi_references" ? r = G(
|
|
4210
4210
|
t,
|
|
4211
4211
|
{
|
|
4212
4212
|
dataType: "array",
|
|
@@ -4216,14 +4216,14 @@ function na(t, a, i) {
|
|
|
4216
4216
|
dataType: "reference"
|
|
4217
4217
|
}
|
|
4218
4218
|
}
|
|
4219
|
-
) : a === "switch" ? r =
|
|
4219
|
+
) : a === "switch" ? r = G(
|
|
4220
4220
|
t,
|
|
4221
4221
|
{
|
|
4222
4222
|
dataType: "boolean",
|
|
4223
4223
|
propertyConfig: "switch",
|
|
4224
4224
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4225
4225
|
}
|
|
4226
|
-
) : a === "date_time" ? r =
|
|
4226
|
+
) : a === "date_time" ? r = G(
|
|
4227
4227
|
t,
|
|
4228
4228
|
{
|
|
4229
4229
|
dataType: "date",
|
|
@@ -4231,14 +4231,14 @@ function na(t, a, i) {
|
|
|
4231
4231
|
editable: t.editable !== void 0 ? t.editable : !0,
|
|
4232
4232
|
mode: "date_time"
|
|
4233
4233
|
}
|
|
4234
|
-
) : a === "repeat" ? r =
|
|
4234
|
+
) : a === "repeat" ? r = G(
|
|
4235
4235
|
t,
|
|
4236
4236
|
{
|
|
4237
4237
|
dataType: "array",
|
|
4238
4238
|
propertyConfig: "repeat",
|
|
4239
4239
|
editable: t.editable !== void 0 ? t.editable : !0
|
|
4240
4240
|
}
|
|
4241
|
-
) : a === "block" ? r =
|
|
4241
|
+
) : a === "block" ? r = G(
|
|
4242
4242
|
t,
|
|
4243
4243
|
{
|
|
4244
4244
|
dataType: "array",
|
|
@@ -4263,7 +4263,7 @@ function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
|
|
|
4263
4263
|
children: /* @__PURE__ */ n(
|
|
4264
4264
|
"div",
|
|
4265
4265
|
{
|
|
4266
|
-
className:
|
|
4266
|
+
className: xe(
|
|
4267
4267
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
4268
4268
|
a ? "w-full" : ""
|
|
4269
4269
|
),
|
|
@@ -4287,12 +4287,12 @@ function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
|
|
|
4287
4287
|
}
|
|
4288
4288
|
);
|
|
4289
4289
|
}
|
|
4290
|
-
function
|
|
4290
|
+
function Hi({
|
|
4291
4291
|
disabled: t,
|
|
4292
4292
|
showErrors: a
|
|
4293
4293
|
}) {
|
|
4294
|
-
const { values: i, setFieldValue: r } =
|
|
4295
|
-
return /* @__PURE__ */ n(
|
|
4294
|
+
const { values: i, setFieldValue: r } = Y(), s = P(i, "url");
|
|
4295
|
+
return /* @__PURE__ */ n($, { children: [
|
|
4296
4296
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
|
|
4297
4297
|
Se,
|
|
4298
4298
|
{
|
|
@@ -4347,7 +4347,28 @@ function Gi({
|
|
|
4347
4347
|
) })
|
|
4348
4348
|
] });
|
|
4349
4349
|
}
|
|
4350
|
-
const
|
|
4350
|
+
const Ji = [
|
|
4351
|
+
"text_field",
|
|
4352
|
+
"multiline",
|
|
4353
|
+
"markdown",
|
|
4354
|
+
"url",
|
|
4355
|
+
"email",
|
|
4356
|
+
"select",
|
|
4357
|
+
"multi_select",
|
|
4358
|
+
"number_input",
|
|
4359
|
+
"number_select",
|
|
4360
|
+
"multi_number_select",
|
|
4361
|
+
"file_upload",
|
|
4362
|
+
"multi_file_upload",
|
|
4363
|
+
"reference",
|
|
4364
|
+
"multi_references",
|
|
4365
|
+
"switch",
|
|
4366
|
+
"date_time",
|
|
4367
|
+
"group",
|
|
4368
|
+
"key_value",
|
|
4369
|
+
"repeat",
|
|
4370
|
+
"block"
|
|
4371
|
+
], la = Object.entries(Zt).filter(([t]) => Ji.includes(t)).map(([t, a]) => ({ [t]: a })).reduce((t, a) => ({ ...t, ...a }), {}), ca = K.memo(
|
|
4351
4372
|
function({
|
|
4352
4373
|
includeIdAndName: a = !0,
|
|
4353
4374
|
autoOpenTypeSelect: i,
|
|
@@ -4358,75 +4379,75 @@ const la = L.memo(
|
|
|
4358
4379
|
propertyNamespace: p,
|
|
4359
4380
|
property: m,
|
|
4360
4381
|
onPropertyChanged: u,
|
|
4361
|
-
onPropertyChangedImmediate:
|
|
4362
|
-
onDelete:
|
|
4363
|
-
onError:
|
|
4382
|
+
onPropertyChangedImmediate: d = !0,
|
|
4383
|
+
onDelete: c,
|
|
4384
|
+
onError: y,
|
|
4364
4385
|
initialErrors: g,
|
|
4365
4386
|
forceShowErrors: b,
|
|
4366
4387
|
existingPropertyKeys: O,
|
|
4367
|
-
allowDataInference:
|
|
4368
|
-
getHelpers:
|
|
4369
|
-
getData:
|
|
4370
|
-
propertyConfigs:
|
|
4371
|
-
collectionEditable:
|
|
4388
|
+
allowDataInference: w,
|
|
4389
|
+
getHelpers: k,
|
|
4390
|
+
getData: f,
|
|
4391
|
+
propertyConfigs: v,
|
|
4392
|
+
collectionEditable: _
|
|
4372
4393
|
}) {
|
|
4373
|
-
const
|
|
4394
|
+
const h = {
|
|
4374
4395
|
id: "",
|
|
4375
4396
|
name: ""
|
|
4376
|
-
},
|
|
4397
|
+
}, A = !!(m && !Je(m)) && !_, E = He(m ? {
|
|
4377
4398
|
id: l,
|
|
4378
4399
|
previousId: l,
|
|
4379
4400
|
property: m
|
|
4380
|
-
} : void 0),
|
|
4381
|
-
id:
|
|
4382
|
-
property:
|
|
4401
|
+
} : void 0), z = ({
|
|
4402
|
+
id: q,
|
|
4403
|
+
property: B
|
|
4383
4404
|
}) => {
|
|
4384
|
-
const
|
|
4385
|
-
id:
|
|
4386
|
-
previousId:
|
|
4387
|
-
property:
|
|
4405
|
+
const S = {
|
|
4406
|
+
id: q,
|
|
4407
|
+
previousId: E.current?.id,
|
|
4408
|
+
property: B,
|
|
4388
4409
|
namespace: p
|
|
4389
4410
|
};
|
|
4390
|
-
|
|
4411
|
+
E.current = S, u?.(S);
|
|
4391
4412
|
};
|
|
4392
4413
|
return /* @__PURE__ */ e(
|
|
4393
|
-
|
|
4414
|
+
St,
|
|
4394
4415
|
{
|
|
4395
4416
|
initialErrors: g,
|
|
4396
|
-
initialValues: m ? { id: l, ...m } :
|
|
4397
|
-
onSubmit: (
|
|
4398
|
-
console.log("Submitting property",
|
|
4417
|
+
initialValues: m ? { id: l, ...m } : h,
|
|
4418
|
+
onSubmit: (q, B) => {
|
|
4419
|
+
console.log("Submitting property", q);
|
|
4399
4420
|
const {
|
|
4400
|
-
id:
|
|
4401
|
-
...
|
|
4402
|
-
} =
|
|
4403
|
-
|
|
4404
|
-
id:
|
|
4405
|
-
property: { ...
|
|
4406
|
-
}), r ||
|
|
4421
|
+
id: S,
|
|
4422
|
+
...N
|
|
4423
|
+
} = q;
|
|
4424
|
+
z({
|
|
4425
|
+
id: S,
|
|
4426
|
+
property: { ...N, editable: N.editable ?? !0 }
|
|
4427
|
+
}), r || B.resetForm({ values: h });
|
|
4407
4428
|
},
|
|
4408
|
-
children: (
|
|
4409
|
-
|
|
4410
|
-
}, [
|
|
4411
|
-
|
|
4429
|
+
children: (q) => (pe(() => {
|
|
4430
|
+
k?.(q);
|
|
4431
|
+
}, [q]), /* @__PURE__ */ e(
|
|
4432
|
+
Qi,
|
|
4412
4433
|
{
|
|
4413
|
-
onPropertyChanged:
|
|
4414
|
-
onDelete:
|
|
4434
|
+
onPropertyChanged: d ? z : void 0,
|
|
4435
|
+
onDelete: c,
|
|
4415
4436
|
includeIdAndTitle: a,
|
|
4416
4437
|
propertyNamespace: p,
|
|
4417
|
-
onError:
|
|
4418
|
-
showErrors: b ||
|
|
4438
|
+
onError: y,
|
|
4439
|
+
showErrors: b || q.submitCount > 0,
|
|
4419
4440
|
existing: r,
|
|
4420
4441
|
autoUpdateId: s,
|
|
4421
4442
|
inArray: o,
|
|
4422
4443
|
autoOpenTypeSelect: i,
|
|
4423
4444
|
existingPropertyKeys: O,
|
|
4424
|
-
disabled:
|
|
4425
|
-
getData:
|
|
4426
|
-
allowDataInference:
|
|
4427
|
-
propertyConfigs:
|
|
4428
|
-
collectionEditable:
|
|
4429
|
-
...
|
|
4445
|
+
disabled: A,
|
|
4446
|
+
getData: f,
|
|
4447
|
+
allowDataInference: w,
|
|
4448
|
+
propertyConfigs: v,
|
|
4449
|
+
collectionEditable: _,
|
|
4450
|
+
...q
|
|
4430
4451
|
}
|
|
4431
4452
|
))
|
|
4432
4453
|
},
|
|
@@ -4453,7 +4474,7 @@ function je({
|
|
|
4453
4474
|
fullWidth: !0,
|
|
4454
4475
|
children: [
|
|
4455
4476
|
/* @__PURE__ */ e($e, { children: /* @__PURE__ */ e(
|
|
4456
|
-
|
|
4477
|
+
ca,
|
|
4457
4478
|
{
|
|
4458
4479
|
...l,
|
|
4459
4480
|
onPropertyChanged: (u) => {
|
|
@@ -4469,7 +4490,7 @@ function je({
|
|
|
4469
4490
|
) }),
|
|
4470
4491
|
/* @__PURE__ */ n(Le, { children: [
|
|
4471
4492
|
a && /* @__PURE__ */ e(
|
|
4472
|
-
|
|
4493
|
+
U,
|
|
4473
4494
|
{
|
|
4474
4495
|
variant: "text",
|
|
4475
4496
|
onClick: () => {
|
|
@@ -4479,7 +4500,7 @@ function je({
|
|
|
4479
4500
|
}
|
|
4480
4501
|
),
|
|
4481
4502
|
/* @__PURE__ */ e(
|
|
4482
|
-
|
|
4503
|
+
U,
|
|
4483
4504
|
{
|
|
4484
4505
|
variant: "outlined",
|
|
4485
4506
|
color: "primary",
|
|
@@ -4492,7 +4513,7 @@ function je({
|
|
|
4492
4513
|
}
|
|
4493
4514
|
);
|
|
4494
4515
|
}
|
|
4495
|
-
function
|
|
4516
|
+
function Qi({
|
|
4496
4517
|
values: t,
|
|
4497
4518
|
errors: a,
|
|
4498
4519
|
touched: i,
|
|
@@ -4503,135 +4524,135 @@ function Hi({
|
|
|
4503
4524
|
autoOpenTypeSelect: p,
|
|
4504
4525
|
includeIdAndTitle: m,
|
|
4505
4526
|
onPropertyChanged: u,
|
|
4506
|
-
onDelete:
|
|
4507
|
-
propertyNamespace:
|
|
4508
|
-
onError:
|
|
4527
|
+
onDelete: d,
|
|
4528
|
+
propertyNamespace: c,
|
|
4529
|
+
onError: y,
|
|
4509
4530
|
showErrors: g,
|
|
4510
4531
|
disabled: b,
|
|
4511
4532
|
inArray: O,
|
|
4512
|
-
existingPropertyKeys:
|
|
4513
|
-
getData:
|
|
4514
|
-
allowDataInference:
|
|
4515
|
-
propertyConfigs:
|
|
4516
|
-
collectionEditable:
|
|
4533
|
+
existingPropertyKeys: w,
|
|
4534
|
+
getData: k,
|
|
4535
|
+
allowDataInference: f,
|
|
4536
|
+
propertyConfigs: v,
|
|
4537
|
+
collectionEditable: _
|
|
4517
4538
|
}) {
|
|
4518
|
-
const [
|
|
4539
|
+
const [h, A] = L(p), [E, z] = L(!1), [q, B] = L(t?.dataType ? Xt(t) : void 0), S = Object.entries(la).concat(Object.entries(v)), N = O ? S.filter(([Q, te]) => !oe(te.property) && te.property?.dataType !== "array") : S, j = ba(t), x = He(null), I = He(t), ge = "id", fe = g && P(a, "selectedWidget");
|
|
4519
4540
|
pe(() => {
|
|
4520
4541
|
!P(i, ge) && l && t?.name && s(ge, Ct(t.name));
|
|
4521
4542
|
}, [l, i, t?.name]), pe(() => {
|
|
4522
|
-
if (u && (!m ||
|
|
4543
|
+
if (u && (!m || j.id)) {
|
|
4523
4544
|
const {
|
|
4524
|
-
id:
|
|
4545
|
+
id: Q,
|
|
4525
4546
|
...te
|
|
4526
|
-
} =
|
|
4527
|
-
ut(
|
|
4528
|
-
id:
|
|
4547
|
+
} = j;
|
|
4548
|
+
ut(j, I.current) || (u({
|
|
4549
|
+
id: Q,
|
|
4529
4550
|
property: te,
|
|
4530
|
-
namespace:
|
|
4531
|
-
}),
|
|
4551
|
+
namespace: c
|
|
4552
|
+
}), I.current = j);
|
|
4532
4553
|
}
|
|
4533
|
-
}, [
|
|
4534
|
-
t?.id &&
|
|
4535
|
-
}, [a,
|
|
4536
|
-
const
|
|
4537
|
-
|
|
4538
|
-
|
|
4554
|
+
}, [j, m, u, c]), pe(() => {
|
|
4555
|
+
t?.id && y && Object.keys(a).length > 0 && y(t?.id, c, a);
|
|
4556
|
+
}, [a, y, c, t?.id]);
|
|
4557
|
+
const X = (Q) => {
|
|
4558
|
+
B(Q), r(na(t, Q, v)), setTimeout(() => {
|
|
4559
|
+
x.current?.focus();
|
|
4539
4560
|
}, 0);
|
|
4540
4561
|
};
|
|
4541
|
-
let
|
|
4542
|
-
return
|
|
4543
|
-
|
|
4562
|
+
let M;
|
|
4563
|
+
return q === "text_field" || q === "multiline" || q === "markdown" || q === "email" ? M = /* @__PURE__ */ e(
|
|
4564
|
+
Di,
|
|
4544
4565
|
{
|
|
4545
|
-
widgetId:
|
|
4566
|
+
widgetId: q,
|
|
4546
4567
|
disabled: b,
|
|
4547
4568
|
showErrors: g
|
|
4548
4569
|
}
|
|
4549
|
-
) :
|
|
4550
|
-
|
|
4570
|
+
) : q === "url" ? M = /* @__PURE__ */ e(
|
|
4571
|
+
Hi,
|
|
4551
4572
|
{
|
|
4552
4573
|
disabled: b,
|
|
4553
4574
|
showErrors: g
|
|
4554
4575
|
}
|
|
4555
|
-
) :
|
|
4556
|
-
|
|
4576
|
+
) : q === "select" || q === "number_select" ? M = /* @__PURE__ */ e(
|
|
4577
|
+
Bt,
|
|
4557
4578
|
{
|
|
4558
4579
|
multiselect: !1,
|
|
4559
|
-
allowDataInference:
|
|
4580
|
+
allowDataInference: f,
|
|
4560
4581
|
updateIds: !o,
|
|
4561
4582
|
disabled: b,
|
|
4562
|
-
getData:
|
|
4583
|
+
getData: k,
|
|
4563
4584
|
showErrors: g
|
|
4564
4585
|
}
|
|
4565
|
-
) :
|
|
4566
|
-
|
|
4586
|
+
) : q === "multi_select" || q === "multi_number_select" ? M = /* @__PURE__ */ e(
|
|
4587
|
+
Bt,
|
|
4567
4588
|
{
|
|
4568
4589
|
multiselect: !0,
|
|
4569
4590
|
updateIds: !o,
|
|
4570
4591
|
disabled: b,
|
|
4571
|
-
allowDataInference:
|
|
4572
|
-
getData:
|
|
4592
|
+
allowDataInference: f,
|
|
4593
|
+
getData: k,
|
|
4573
4594
|
showErrors: g
|
|
4574
4595
|
}
|
|
4575
|
-
) :
|
|
4576
|
-
|
|
4596
|
+
) : q === "file_upload" ? M = /* @__PURE__ */ e(
|
|
4597
|
+
Mt,
|
|
4577
4598
|
{
|
|
4578
4599
|
existing: o,
|
|
4579
4600
|
multiple: !1,
|
|
4580
4601
|
disabled: b
|
|
4581
4602
|
}
|
|
4582
|
-
) :
|
|
4583
|
-
|
|
4603
|
+
) : q === "multi_file_upload" ? M = /* @__PURE__ */ e(
|
|
4604
|
+
Mt,
|
|
4584
4605
|
{
|
|
4585
4606
|
existing: o,
|
|
4586
4607
|
multiple: !0,
|
|
4587
4608
|
disabled: b
|
|
4588
4609
|
}
|
|
4589
|
-
) :
|
|
4590
|
-
|
|
4610
|
+
) : q === "switch" ? M = /* @__PURE__ */ e(Bi, { disabled: b }) : q === "number_input" ? M = /* @__PURE__ */ e(Ui, { disabled: b }) : q === "group" ? M = /* @__PURE__ */ e(
|
|
4611
|
+
Ti,
|
|
4591
4612
|
{
|
|
4592
4613
|
disabled: b,
|
|
4593
|
-
getData:
|
|
4594
|
-
allowDataInference:
|
|
4595
|
-
collectionEditable:
|
|
4596
|
-
propertyConfigs:
|
|
4614
|
+
getData: k,
|
|
4615
|
+
allowDataInference: f,
|
|
4616
|
+
collectionEditable: _,
|
|
4617
|
+
propertyConfigs: v
|
|
4597
4618
|
}
|
|
4598
|
-
) :
|
|
4599
|
-
|
|
4619
|
+
) : q === "block" ? M = /* @__PURE__ */ e(
|
|
4620
|
+
Mi,
|
|
4600
4621
|
{
|
|
4601
4622
|
disabled: b,
|
|
4602
|
-
getData:
|
|
4603
|
-
allowDataInference:
|
|
4604
|
-
collectionEditable:
|
|
4605
|
-
propertyConfigs:
|
|
4623
|
+
getData: k,
|
|
4624
|
+
allowDataInference: f,
|
|
4625
|
+
collectionEditable: _,
|
|
4626
|
+
propertyConfigs: v
|
|
4606
4627
|
}
|
|
4607
|
-
) :
|
|
4608
|
-
|
|
4628
|
+
) : q === "reference" ? M = /* @__PURE__ */ e(
|
|
4629
|
+
Rt,
|
|
4609
4630
|
{
|
|
4610
4631
|
showErrors: g,
|
|
4611
4632
|
existing: o,
|
|
4612
4633
|
multiple: !1,
|
|
4613
4634
|
disabled: b
|
|
4614
4635
|
}
|
|
4615
|
-
) :
|
|
4616
|
-
|
|
4636
|
+
) : q === "date_time" ? M = /* @__PURE__ */ e(Ki, { disabled: b }) : q === "multi_references" ? M = /* @__PURE__ */ e(
|
|
4637
|
+
Rt,
|
|
4617
4638
|
{
|
|
4618
4639
|
showErrors: g,
|
|
4619
4640
|
existing: o,
|
|
4620
4641
|
multiple: !0,
|
|
4621
4642
|
disabled: b
|
|
4622
4643
|
}
|
|
4623
|
-
) :
|
|
4624
|
-
|
|
4644
|
+
) : q === "repeat" ? M = /* @__PURE__ */ e(
|
|
4645
|
+
Vi,
|
|
4625
4646
|
{
|
|
4626
4647
|
showErrors: g,
|
|
4627
4648
|
existing: o,
|
|
4628
|
-
getData:
|
|
4629
|
-
allowDataInference:
|
|
4649
|
+
getData: k,
|
|
4650
|
+
allowDataInference: f,
|
|
4630
4651
|
disabled: b,
|
|
4631
|
-
collectionEditable:
|
|
4632
|
-
propertyConfigs:
|
|
4652
|
+
collectionEditable: _,
|
|
4653
|
+
propertyConfigs: v
|
|
4633
4654
|
}
|
|
4634
|
-
) :
|
|
4655
|
+
) : q === "key_value" ? M = /* @__PURE__ */ e(Gi, { disabled: b }) : M = null, /* @__PURE__ */ n($, { children: [
|
|
4635
4656
|
b && /* @__PURE__ */ n(ea, { mode: "warn", children: [
|
|
4636
4657
|
/* @__PURE__ */ e(C, { children: "This property can't be edited" }),
|
|
4637
4658
|
/* @__PURE__ */ n(C, { variant: "caption", children: [
|
|
@@ -4645,26 +4666,26 @@ function Hi({
|
|
|
4645
4666
|
/* @__PURE__ */ e(
|
|
4646
4667
|
Se,
|
|
4647
4668
|
{
|
|
4648
|
-
error: !!
|
|
4649
|
-
value:
|
|
4669
|
+
error: !!fe,
|
|
4670
|
+
value: q ?? "",
|
|
4650
4671
|
placeholder: "Select a property widget",
|
|
4651
|
-
open:
|
|
4652
|
-
onOpenChange:
|
|
4672
|
+
open: h,
|
|
4673
|
+
onOpenChange: A,
|
|
4653
4674
|
position: "item-aligned",
|
|
4654
4675
|
disabled: b,
|
|
4655
|
-
renderValue: (
|
|
4656
|
-
if (!
|
|
4676
|
+
renderValue: (Q) => {
|
|
4677
|
+
if (!Q)
|
|
4657
4678
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
4658
|
-
const te =
|
|
4679
|
+
const te = Q, me = Zt[te] ?? v[te], ue = me.property, be = ue && !oe(ue) ? Ze(ue, v) : void 0, ve = oe(ue) || o && ue.dataType !== t?.dataType, Ce = be ? G(be, me) : me;
|
|
4659
4680
|
return /* @__PURE__ */ n(
|
|
4660
4681
|
"div",
|
|
4661
4682
|
{
|
|
4662
4683
|
onClick: (ae) => {
|
|
4663
|
-
|
|
4684
|
+
ve && (ae.stopPropagation(), ae.preventDefault());
|
|
4664
4685
|
},
|
|
4665
|
-
className:
|
|
4686
|
+
className: xe(
|
|
4666
4687
|
"flex items-center",
|
|
4667
|
-
|
|
4688
|
+
ve ? "w-full pointer-events-none opacity-50" : ""
|
|
4668
4689
|
),
|
|
4669
4690
|
children: [
|
|
4670
4691
|
/* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Xe, { propertyConfig: Ce }) }),
|
|
@@ -4675,7 +4696,7 @@ function Hi({
|
|
|
4675
4696
|
{
|
|
4676
4697
|
variant: "caption",
|
|
4677
4698
|
color: "disabled",
|
|
4678
|
-
children:
|
|
4699
|
+
children: ve ? "You can only switch to widgets that use the same data type" : Ce.description
|
|
4679
4700
|
}
|
|
4680
4701
|
)
|
|
4681
4702
|
] })
|
|
@@ -4683,25 +4704,25 @@ function Hi({
|
|
|
4683
4704
|
}
|
|
4684
4705
|
);
|
|
4685
4706
|
},
|
|
4686
|
-
onValueChange: (
|
|
4687
|
-
Q
|
|
4707
|
+
onValueChange: (Q) => {
|
|
4708
|
+
X(Q);
|
|
4688
4709
|
},
|
|
4689
|
-
children:
|
|
4710
|
+
children: N.map(([Q, te]) => {
|
|
4690
4711
|
const me = te.property, ue = o && !oe(me) && me.dataType !== t?.dataType;
|
|
4691
4712
|
return /* @__PURE__ */ e(
|
|
4692
4713
|
sa,
|
|
4693
4714
|
{
|
|
4694
|
-
value:
|
|
4715
|
+
value: Q,
|
|
4695
4716
|
optionDisabled: ue,
|
|
4696
4717
|
propertyConfig: te,
|
|
4697
4718
|
existing: o
|
|
4698
4719
|
},
|
|
4699
|
-
|
|
4720
|
+
Q
|
|
4700
4721
|
);
|
|
4701
4722
|
})
|
|
4702
4723
|
}
|
|
4703
4724
|
),
|
|
4704
|
-
|
|
4725
|
+
fe && /* @__PURE__ */ e(
|
|
4705
4726
|
C,
|
|
4706
4727
|
{
|
|
4707
4728
|
variant: "caption",
|
|
@@ -4711,38 +4732,38 @@ function Hi({
|
|
|
4711
4732
|
}
|
|
4712
4733
|
)
|
|
4713
4734
|
] }),
|
|
4714
|
-
|
|
4735
|
+
d && t?.id && /* @__PURE__ */ e(
|
|
4715
4736
|
ne,
|
|
4716
4737
|
{
|
|
4717
4738
|
variant: "ghost",
|
|
4718
4739
|
className: "m-4",
|
|
4719
4740
|
disabled: b,
|
|
4720
|
-
onClick: () =>
|
|
4741
|
+
onClick: () => z(!0),
|
|
4721
4742
|
children: /* @__PURE__ */ e(pt, {})
|
|
4722
4743
|
}
|
|
4723
4744
|
)
|
|
4724
4745
|
] }),
|
|
4725
4746
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
4726
4747
|
m && /* @__PURE__ */ e(
|
|
4727
|
-
|
|
4748
|
+
Ii,
|
|
4728
4749
|
{
|
|
4729
4750
|
showErrors: g,
|
|
4730
4751
|
disabledId: o,
|
|
4731
4752
|
isNewProperty: !o,
|
|
4732
|
-
existingPropertyKeys:
|
|
4753
|
+
existingPropertyKeys: w,
|
|
4733
4754
|
disabled: b,
|
|
4734
|
-
ref:
|
|
4755
|
+
ref: x
|
|
4735
4756
|
}
|
|
4736
4757
|
),
|
|
4737
|
-
|
|
4738
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4758
|
+
M,
|
|
4759
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Yi, { disabled: b }) })
|
|
4739
4760
|
] }),
|
|
4740
|
-
|
|
4761
|
+
d && /* @__PURE__ */ e(
|
|
4741
4762
|
mt,
|
|
4742
4763
|
{
|
|
4743
|
-
open:
|
|
4744
|
-
onAccept: () =>
|
|
4745
|
-
onCancel: () =>
|
|
4764
|
+
open: E,
|
|
4765
|
+
onAccept: () => d(t?.id, c),
|
|
4766
|
+
onCancel: () => z(!1),
|
|
4746
4767
|
title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
|
|
4747
4768
|
body: /* @__PURE__ */ n("div", { children: [
|
|
4748
4769
|
" This will ",
|
|
@@ -4753,13 +4774,13 @@ function Hi({
|
|
|
4753
4774
|
)
|
|
4754
4775
|
] });
|
|
4755
4776
|
}
|
|
4756
|
-
function
|
|
4777
|
+
function Wi(t) {
|
|
4757
4778
|
return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, i) => a + i[0].toUpperCase() + i.substring(1));
|
|
4758
4779
|
}
|
|
4759
|
-
function
|
|
4780
|
+
function Zi({ collection: t, onOpenChange: a, open: i }) {
|
|
4760
4781
|
const r = De(), s = `import { EntityCollection } from "firecms";
|
|
4761
4782
|
|
|
4762
|
-
const ` +
|
|
4783
|
+
const ` + Wi(t.name) + "Collection:EntityCollection = " + si.stringify(da(t), null, " ");
|
|
4763
4784
|
return /* @__PURE__ */ n(
|
|
4764
4785
|
Ee,
|
|
4765
4786
|
{
|
|
@@ -4785,18 +4806,18 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
|
|
|
4785
4806
|
"."
|
|
4786
4807
|
] }),
|
|
4787
4808
|
/* @__PURE__ */ e(
|
|
4788
|
-
|
|
4809
|
+
li,
|
|
4789
4810
|
{
|
|
4790
|
-
theme:
|
|
4811
|
+
theme: ci.vsDark,
|
|
4791
4812
|
code: s,
|
|
4792
4813
|
language: "typescript",
|
|
4793
|
-
children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((
|
|
4814
|
+
children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((d, c) => /* @__PURE__ */ e("div", { ...m({ line: d }), children: d.map((y, g) => /* @__PURE__ */ e("span", { ...u({ token: y }) }, g)) }, c)) })
|
|
4794
4815
|
}
|
|
4795
4816
|
)
|
|
4796
4817
|
] }),
|
|
4797
4818
|
/* @__PURE__ */ n(Le, { children: [
|
|
4798
4819
|
/* @__PURE__ */ n(
|
|
4799
|
-
|
|
4820
|
+
U,
|
|
4800
4821
|
{
|
|
4801
4822
|
variant: "text",
|
|
4802
4823
|
size: "small",
|
|
@@ -4805,18 +4826,18 @@ const ` + Ji(t.name) + "Collection:EntityCollection = " + ni.stringify(ca(t), nu
|
|
|
4805
4826
|
message: "Copied"
|
|
4806
4827
|
}), navigator.clipboard.writeText(s)),
|
|
4807
4828
|
children: [
|
|
4808
|
-
/* @__PURE__ */ e(
|
|
4829
|
+
/* @__PURE__ */ e(ja, { size: "small" }),
|
|
4809
4830
|
"Copy to clipboard"
|
|
4810
4831
|
]
|
|
4811
4832
|
}
|
|
4812
4833
|
),
|
|
4813
|
-
/* @__PURE__ */ e(
|
|
4834
|
+
/* @__PURE__ */ e(U, { onClick: () => a(!1), children: "Close" })
|
|
4814
4835
|
] })
|
|
4815
4836
|
]
|
|
4816
4837
|
}
|
|
4817
4838
|
);
|
|
4818
4839
|
}
|
|
4819
|
-
function
|
|
4840
|
+
function da(t) {
|
|
4820
4841
|
const a = (i) => {
|
|
4821
4842
|
const r = {
|
|
4822
4843
|
...i
|
|
@@ -4842,10 +4863,10 @@ function ca(t) {
|
|
|
4842
4863
|
properties: Object.entries(t.properties).map(([i, r]) => ({
|
|
4843
4864
|
[i]: a(r)
|
|
4844
4865
|
})).reduce((i, r) => ({ ...i, ...r }), {}),
|
|
4845
|
-
subcollections: (t.subcollections ?? []).map(
|
|
4866
|
+
subcollections: (t.subcollections ?? []).map(da)
|
|
4846
4867
|
};
|
|
4847
4868
|
}
|
|
4848
|
-
function
|
|
4869
|
+
function Xi({
|
|
4849
4870
|
showErrors: t,
|
|
4850
4871
|
isNewCollection: a,
|
|
4851
4872
|
propertyErrorsRef: i,
|
|
@@ -4856,124 +4877,124 @@ function Wi({
|
|
|
4856
4877
|
getUser: p,
|
|
4857
4878
|
getData: m,
|
|
4858
4879
|
doCollectionInference: u,
|
|
4859
|
-
propertyConfigs:
|
|
4860
|
-
collectionEditable:
|
|
4880
|
+
propertyConfigs: d,
|
|
4881
|
+
collectionEditable: c
|
|
4861
4882
|
}) {
|
|
4862
4883
|
const {
|
|
4863
|
-
values:
|
|
4884
|
+
values: y,
|
|
4864
4885
|
setFieldValue: g,
|
|
4865
4886
|
setFieldError: b,
|
|
4866
4887
|
setFieldTouched: O,
|
|
4867
|
-
errors:
|
|
4868
|
-
dirty:
|
|
4869
|
-
} =
|
|
4888
|
+
errors: w,
|
|
4889
|
+
dirty: k
|
|
4890
|
+
} = Y(), f = De(), v = Ea("lg"), _ = !v, [h, A] = L(), [E, z] = L(), [q, B] = L(), S = E ? ce(E, q) : void 0, N = S ? P(y.properties, S.replaceAll(".", ".properties.")) : void 0, [j, x] = L(!1), [I, ge] = L(!1), [fe, X] = L(!1), [M, Q] = L([]), te = K.useRef(y.propertiesOrder ? { "": y.propertiesOrder } : {});
|
|
4870
4891
|
pe(() => {
|
|
4871
|
-
s && s(
|
|
4872
|
-
}, [
|
|
4892
|
+
s && s(k);
|
|
4893
|
+
}, [k]);
|
|
4873
4894
|
const me = u ? () => {
|
|
4874
|
-
u && (ge(!0), u(
|
|
4875
|
-
if (
|
|
4876
|
-
|
|
4895
|
+
u && (ge(!0), u(y).then((T) => {
|
|
4896
|
+
if (T && et(T.properties), !T) {
|
|
4897
|
+
f.open({
|
|
4877
4898
|
type: "error",
|
|
4878
4899
|
message: "Could not infer properties from data"
|
|
4879
4900
|
});
|
|
4880
4901
|
return;
|
|
4881
4902
|
}
|
|
4882
|
-
const
|
|
4883
|
-
if (
|
|
4884
|
-
|
|
4903
|
+
const D = (T.properties ? Object.keys(T.properties) : []).filter((le) => !y.properties[le]);
|
|
4904
|
+
if (D.length === 0) {
|
|
4905
|
+
f.open({
|
|
4885
4906
|
type: "info",
|
|
4886
4907
|
message: "No new properties found in existing data"
|
|
4887
4908
|
});
|
|
4888
4909
|
return;
|
|
4889
4910
|
}
|
|
4890
|
-
const
|
|
4891
|
-
...
|
|
4892
|
-
...
|
|
4911
|
+
const H = {
|
|
4912
|
+
...D.reduce((le, we) => (le[we] = (T.properties ?? {})[we], le), {}),
|
|
4913
|
+
...y.properties
|
|
4893
4914
|
}, se = [
|
|
4894
|
-
...
|
|
4895
|
-
...
|
|
4915
|
+
...D,
|
|
4916
|
+
...y.propertiesOrder ?? []
|
|
4896
4917
|
];
|
|
4897
|
-
g("properties",
|
|
4918
|
+
g("properties", H, !1), be(se), Q(D);
|
|
4898
4919
|
}).finally(() => {
|
|
4899
4920
|
ge(!1);
|
|
4900
4921
|
}));
|
|
4901
|
-
} : void 0, ue = (
|
|
4902
|
-
const
|
|
4903
|
-
g(
|
|
4904
|
-
},
|
|
4905
|
-
const
|
|
4906
|
-
if (!
|
|
4922
|
+
} : void 0, ue = (T) => T ? te.current[T] ?? P(y, Pe(T)) : te.current[""], be = (T, D) => {
|
|
4923
|
+
const H = Pe(D);
|
|
4924
|
+
g(H, T, !1), te.current[D ?? ""] = T;
|
|
4925
|
+
}, ve = (T, D) => {
|
|
4926
|
+
const H = T ? ce(T, D) : void 0;
|
|
4927
|
+
if (!H)
|
|
4907
4928
|
throw Error("collection editor miss config");
|
|
4908
|
-
g(
|
|
4909
|
-
const le = ue(
|
|
4910
|
-
|
|
4911
|
-
}, Ce = (
|
|
4912
|
-
g(
|
|
4929
|
+
g(ke(H), void 0, !1);
|
|
4930
|
+
const le = ue(D).filter((we) => we !== T);
|
|
4931
|
+
be(le, D), X(!1), A(void 0), z(void 0), B(void 0);
|
|
4932
|
+
}, Ce = (T, D) => {
|
|
4933
|
+
g(Pe(D), T, !1);
|
|
4913
4934
|
}, ae = ({
|
|
4914
|
-
id:
|
|
4915
|
-
property:
|
|
4935
|
+
id: T,
|
|
4936
|
+
property: D
|
|
4916
4937
|
}) => {
|
|
4917
4938
|
if (console.log("onPropertyCreated", {
|
|
4918
|
-
id:
|
|
4919
|
-
property:
|
|
4920
|
-
}), !
|
|
4939
|
+
id: T,
|
|
4940
|
+
property: D
|
|
4941
|
+
}), !T)
|
|
4921
4942
|
throw Error("Need to include an ID when creating a new property");
|
|
4922
4943
|
g("properties", {
|
|
4923
|
-
...
|
|
4924
|
-
[
|
|
4944
|
+
...y.properties ?? {},
|
|
4945
|
+
[T]: D
|
|
4925
4946
|
}, !1);
|
|
4926
|
-
const
|
|
4947
|
+
const H = [...y.propertiesOrder ?? Object.keys(y.properties), T];
|
|
4927
4948
|
console.log("onPropertyCreated", {
|
|
4928
|
-
id:
|
|
4929
|
-
property:
|
|
4930
|
-
newPropertiesOrder:
|
|
4931
|
-
}),
|
|
4949
|
+
id: T,
|
|
4950
|
+
property: D,
|
|
4951
|
+
newPropertiesOrder: H
|
|
4952
|
+
}), be(H), X(!1), v && (A(H.indexOf(T)), z(T)), B(void 0);
|
|
4932
4953
|
}, Ve = ({
|
|
4933
|
-
id:
|
|
4934
|
-
property:
|
|
4935
|
-
previousId:
|
|
4954
|
+
id: T,
|
|
4955
|
+
property: D,
|
|
4956
|
+
previousId: H,
|
|
4936
4957
|
namespace: se
|
|
4937
4958
|
}) => {
|
|
4938
|
-
const le =
|
|
4939
|
-
if (
|
|
4940
|
-
const yt = ce(
|
|
4941
|
-
|
|
4959
|
+
const le = T ? ce(T, se) : void 0, we = le ? ke(le) : void 0;
|
|
4960
|
+
if (H && H !== T) {
|
|
4961
|
+
const yt = ce(H, se), it = ke(yt), W = ue(se).map((Ie) => Ie === H ? T : Ie).filter((Ie) => Ie !== void 0);
|
|
4962
|
+
be(W, se), T && (A(W.indexOf(T)), z(T)), g(it, void 0, !1), O(it, !1, !1);
|
|
4942
4963
|
}
|
|
4943
|
-
|
|
4944
|
-
}, tt = (
|
|
4945
|
-
const se =
|
|
4964
|
+
we && (g(we, D, !1), O(we, !0, !1));
|
|
4965
|
+
}, tt = (T, D, H) => {
|
|
4966
|
+
const se = T ? ce(T, D) : void 0;
|
|
4946
4967
|
if (console.warn("onPropertyErrorInternal", {
|
|
4947
|
-
id:
|
|
4948
|
-
namespace:
|
|
4949
|
-
error:
|
|
4968
|
+
id: T,
|
|
4969
|
+
namespace: D,
|
|
4970
|
+
error: H,
|
|
4950
4971
|
propertyPath: se
|
|
4951
4972
|
}), se) {
|
|
4952
|
-
const le =
|
|
4953
|
-
r(
|
|
4973
|
+
const le = H && Object.keys(H).length > 0;
|
|
4974
|
+
r(T, D, le ? H : void 0), b(ke(se), le ? "Property error" : void 0);
|
|
4954
4975
|
}
|
|
4955
4976
|
}, bt = () => {
|
|
4956
|
-
|
|
4957
|
-
},
|
|
4958
|
-
/* @__PURE__ */ n("div", { className:
|
|
4977
|
+
A(void 0), z(void 0);
|
|
4978
|
+
}, V = E && i?.current?.properties ? i.current.properties[E] : void 0, F = y?.propertiesOrder === void 0 || y.propertiesOrder.length === 0, R = y.propertiesOrder ? y.propertiesOrder : Object.keys(y.properties), Oe = Kt(() => p(y.ownerId), [p, y.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
4979
|
+
/* @__PURE__ */ n("div", { className: xe(
|
|
4959
4980
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
4960
4981
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
4961
|
-
!
|
|
4982
|
+
!_ && "border-r " + Nt
|
|
4962
4983
|
), children: [
|
|
4963
4984
|
/* @__PURE__ */ n("div", { className: "flex my-2", children: [
|
|
4964
4985
|
/* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
|
|
4965
4986
|
/* @__PURE__ */ e(
|
|
4966
|
-
|
|
4987
|
+
ye,
|
|
4967
4988
|
{
|
|
4968
4989
|
name: "name",
|
|
4969
|
-
as:
|
|
4990
|
+
as: J,
|
|
4970
4991
|
invisible: !0,
|
|
4971
4992
|
className: "-ml-1",
|
|
4972
4993
|
inputClassName: "text-2xl font-headers",
|
|
4973
4994
|
placeholder: "Collection name",
|
|
4974
4995
|
size: "small",
|
|
4975
4996
|
required: !0,
|
|
4976
|
-
error: !!
|
|
4997
|
+
error: !!w?.name
|
|
4977
4998
|
}
|
|
4978
4999
|
),
|
|
4979
5000
|
Oe && /* @__PURE__ */ n(
|
|
@@ -4995,119 +5016,119 @@ function Wi({
|
|
|
4995
5016
|
ne,
|
|
4996
5017
|
{
|
|
4997
5018
|
variant: "filled",
|
|
4998
|
-
disabled:
|
|
4999
|
-
onClick: () =>
|
|
5000
|
-
children: /* @__PURE__ */ e(
|
|
5019
|
+
disabled: I,
|
|
5020
|
+
onClick: () => x(!0),
|
|
5021
|
+
children: /* @__PURE__ */ e(Da, {})
|
|
5001
5022
|
}
|
|
5002
5023
|
) }),
|
|
5003
5024
|
me && /* @__PURE__ */ e(re, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
5004
5025
|
ne,
|
|
5005
5026
|
{
|
|
5006
5027
|
variant: "filled",
|
|
5007
|
-
disabled:
|
|
5028
|
+
disabled: I,
|
|
5008
5029
|
onClick: me,
|
|
5009
|
-
children:
|
|
5030
|
+
children: I ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {})
|
|
5010
5031
|
}
|
|
5011
5032
|
) }),
|
|
5012
5033
|
/* @__PURE__ */ e(re, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
5013
|
-
|
|
5034
|
+
U,
|
|
5014
5035
|
{
|
|
5015
5036
|
variant: "outlined",
|
|
5016
|
-
onClick: () =>
|
|
5037
|
+
onClick: () => X(!0),
|
|
5017
5038
|
children: /* @__PURE__ */ e(Ae, {})
|
|
5018
5039
|
}
|
|
5019
5040
|
) })
|
|
5020
5041
|
] })
|
|
5021
5042
|
] }),
|
|
5022
|
-
/* @__PURE__ */ e(
|
|
5043
|
+
/* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
5023
5044
|
ft,
|
|
5024
5045
|
{
|
|
5025
5046
|
className: "pl-8",
|
|
5026
|
-
onPropertyClick: (
|
|
5027
|
-
|
|
5047
|
+
onPropertyClick: (T, D) => {
|
|
5048
|
+
A(R.indexOf(T)), z(T), B(D);
|
|
5028
5049
|
},
|
|
5029
|
-
inferredPropertyKeys:
|
|
5030
|
-
selectedPropertyKey:
|
|
5031
|
-
properties:
|
|
5032
|
-
additionalFields:
|
|
5033
|
-
propertiesOrder:
|
|
5050
|
+
inferredPropertyKeys: M,
|
|
5051
|
+
selectedPropertyKey: E ? ce(E, q) : void 0,
|
|
5052
|
+
properties: y.properties,
|
|
5053
|
+
additionalFields: y.additionalFields,
|
|
5054
|
+
propertiesOrder: R,
|
|
5034
5055
|
onPropertyMove: Ce,
|
|
5035
|
-
onPropertyRemove: a ?
|
|
5036
|
-
collectionEditable:
|
|
5037
|
-
errors: t ?
|
|
5056
|
+
onPropertyRemove: a ? ve : void 0,
|
|
5057
|
+
collectionEditable: c,
|
|
5058
|
+
errors: t ? w : {}
|
|
5038
5059
|
}
|
|
5039
5060
|
) }),
|
|
5040
5061
|
/* @__PURE__ */ e(
|
|
5041
|
-
|
|
5062
|
+
U,
|
|
5042
5063
|
{
|
|
5043
5064
|
className: "mt-8 w-full",
|
|
5044
5065
|
color: "primary",
|
|
5045
5066
|
variant: "outlined",
|
|
5046
5067
|
size: "large",
|
|
5047
|
-
onClick: () =>
|
|
5068
|
+
onClick: () => X(!0),
|
|
5048
5069
|
startIcon: /* @__PURE__ */ e(Ae, {}),
|
|
5049
5070
|
children: "Add new property"
|
|
5050
5071
|
}
|
|
5051
5072
|
)
|
|
5052
5073
|
] }),
|
|
5053
|
-
!
|
|
5074
|
+
!_ && /* @__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(
|
|
5054
5075
|
qe,
|
|
5055
5076
|
{
|
|
5056
5077
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
5057
5078
|
children: [
|
|
5058
|
-
|
|
5059
|
-
|
|
5079
|
+
S && N && !oe(N) && /* @__PURE__ */ e(
|
|
5080
|
+
ca,
|
|
5060
5081
|
{
|
|
5061
5082
|
inArray: !1,
|
|
5062
5083
|
existingProperty: !a,
|
|
5063
5084
|
autoUpdateId: !1,
|
|
5064
5085
|
allowDataInference: !a,
|
|
5065
5086
|
autoOpenTypeSelect: !1,
|
|
5066
|
-
propertyKey:
|
|
5067
|
-
propertyNamespace:
|
|
5068
|
-
property:
|
|
5087
|
+
propertyKey: E,
|
|
5088
|
+
propertyNamespace: q,
|
|
5089
|
+
property: N,
|
|
5069
5090
|
onPropertyChanged: Ve,
|
|
5070
|
-
onDelete:
|
|
5091
|
+
onDelete: ve,
|
|
5071
5092
|
onError: tt,
|
|
5072
5093
|
forceShowErrors: t,
|
|
5073
|
-
initialErrors:
|
|
5094
|
+
initialErrors: V,
|
|
5074
5095
|
getData: m,
|
|
5075
|
-
propertyConfigs:
|
|
5076
|
-
collectionEditable:
|
|
5096
|
+
propertyConfigs: d,
|
|
5097
|
+
collectionEditable: c
|
|
5077
5098
|
},
|
|
5078
|
-
`edit_view_${
|
|
5099
|
+
`edit_view_${h}`
|
|
5079
5100
|
),
|
|
5080
|
-
!
|
|
5081
|
-
|
|
5101
|
+
!N && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: F ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
5102
|
+
N && oe(N) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
5082
5103
|
]
|
|
5083
5104
|
}
|
|
5084
5105
|
) }),
|
|
5085
|
-
|
|
5106
|
+
_ && /* @__PURE__ */ e(
|
|
5086
5107
|
je,
|
|
5087
5108
|
{
|
|
5088
5109
|
inArray: !1,
|
|
5089
|
-
open:
|
|
5110
|
+
open: h !== void 0,
|
|
5090
5111
|
autoUpdateId: a,
|
|
5091
5112
|
allowDataInference: !a,
|
|
5092
5113
|
existingProperty: !0,
|
|
5093
5114
|
autoOpenTypeSelect: !1,
|
|
5094
|
-
propertyKey:
|
|
5095
|
-
propertyNamespace:
|
|
5096
|
-
property:
|
|
5115
|
+
propertyKey: E,
|
|
5116
|
+
propertyNamespace: q,
|
|
5117
|
+
property: N,
|
|
5097
5118
|
onPropertyChanged: Ve,
|
|
5098
|
-
onDelete:
|
|
5119
|
+
onDelete: ve,
|
|
5099
5120
|
onError: tt,
|
|
5100
5121
|
forceShowErrors: t,
|
|
5101
|
-
initialErrors:
|
|
5122
|
+
initialErrors: V,
|
|
5102
5123
|
getData: m,
|
|
5103
|
-
propertyConfigs:
|
|
5104
|
-
collectionEditable:
|
|
5105
|
-
onOkClicked:
|
|
5124
|
+
propertyConfigs: d,
|
|
5125
|
+
collectionEditable: c,
|
|
5126
|
+
onOkClicked: _ ? bt : void 0
|
|
5106
5127
|
},
|
|
5107
|
-
`edit_view_${
|
|
5128
|
+
`edit_view_${h}`
|
|
5108
5129
|
)
|
|
5109
5130
|
] });
|
|
5110
|
-
return /* @__PURE__ */ n(
|
|
5131
|
+
return /* @__PURE__ */ n($, { children: [
|
|
5111
5132
|
at,
|
|
5112
5133
|
/* @__PURE__ */ e(
|
|
5113
5134
|
je,
|
|
@@ -5117,27 +5138,27 @@ function Wi({
|
|
|
5117
5138
|
autoOpenTypeSelect: !0,
|
|
5118
5139
|
autoUpdateId: !0,
|
|
5119
5140
|
forceShowErrors: t,
|
|
5120
|
-
open:
|
|
5121
|
-
onCancel: () =>
|
|
5141
|
+
open: fe,
|
|
5142
|
+
onCancel: () => X(!1),
|
|
5122
5143
|
onPropertyChanged: ae,
|
|
5123
5144
|
getData: m,
|
|
5124
5145
|
allowDataInference: !a,
|
|
5125
|
-
propertyConfigs:
|
|
5126
|
-
collectionEditable:
|
|
5127
|
-
existingPropertyKeys:
|
|
5146
|
+
propertyConfigs: d,
|
|
5147
|
+
collectionEditable: c,
|
|
5148
|
+
existingPropertyKeys: y.propertiesOrder
|
|
5128
5149
|
}
|
|
5129
5150
|
),
|
|
5130
5151
|
/* @__PURE__ */ e(
|
|
5131
|
-
|
|
5152
|
+
Zi,
|
|
5132
5153
|
{
|
|
5133
|
-
collection:
|
|
5134
|
-
open:
|
|
5135
|
-
onOpenChange:
|
|
5154
|
+
collection: y,
|
|
5155
|
+
open: j,
|
|
5156
|
+
onOpenChange: x
|
|
5136
5157
|
}
|
|
5137
5158
|
)
|
|
5138
5159
|
] });
|
|
5139
5160
|
}
|
|
5140
|
-
function
|
|
5161
|
+
function er({
|
|
5141
5162
|
open: t,
|
|
5142
5163
|
handleOk: a,
|
|
5143
5164
|
handleCancel: i,
|
|
@@ -5158,14 +5179,14 @@ function Zi({
|
|
|
5158
5179
|
/* @__PURE__ */ e(C, { children: "Are you sure?" })
|
|
5159
5180
|
] }),
|
|
5160
5181
|
/* @__PURE__ */ n(Le, { children: [
|
|
5161
|
-
/* @__PURE__ */ e(
|
|
5162
|
-
/* @__PURE__ */ e(
|
|
5182
|
+
/* @__PURE__ */ e(U, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
|
|
5183
|
+
/* @__PURE__ */ e(U, { onClick: a, children: " Ok " })
|
|
5163
5184
|
] })
|
|
5164
5185
|
]
|
|
5165
5186
|
}
|
|
5166
5187
|
);
|
|
5167
5188
|
}
|
|
5168
|
-
function
|
|
5189
|
+
function tr({ open: t, onClose: a }) {
|
|
5169
5190
|
const {
|
|
5170
5191
|
entityViews: i
|
|
5171
5192
|
} = Ke();
|
|
@@ -5178,7 +5199,7 @@ function Xi({ open: t, onClose: a }) {
|
|
|
5178
5199
|
/* @__PURE__ */ n($e, { children: [
|
|
5179
5200
|
/* @__PURE__ */ e(C, { variant: "h6", children: "Select view" }),
|
|
5180
5201
|
i?.map((r) => /* @__PURE__ */ n(
|
|
5181
|
-
|
|
5202
|
+
U,
|
|
5182
5203
|
{
|
|
5183
5204
|
onClick: () => a(r.key),
|
|
5184
5205
|
fullWidth: !0,
|
|
@@ -5194,12 +5215,12 @@ function Xi({ open: t, onClose: a }) {
|
|
|
5194
5215
|
)),
|
|
5195
5216
|
(i ?? []).length === 0 && /* @__PURE__ */ e(C, { variant: "body2", children: "No custom views defined" })
|
|
5196
5217
|
] }),
|
|
5197
|
-
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(
|
|
5218
|
+
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(U, { onClick: () => a(), children: "Cancel" }) })
|
|
5198
5219
|
]
|
|
5199
5220
|
}
|
|
5200
5221
|
);
|
|
5201
5222
|
}
|
|
5202
|
-
function
|
|
5223
|
+
function ar({
|
|
5203
5224
|
collection: t,
|
|
5204
5225
|
parentCollection: a,
|
|
5205
5226
|
configController: i,
|
|
@@ -5207,10 +5228,10 @@ function er({
|
|
|
5207
5228
|
getUser: s,
|
|
5208
5229
|
parentCollectionIds: o
|
|
5209
5230
|
}) {
|
|
5210
|
-
const { entityViews: l } = Ke(), [p, m] =
|
|
5231
|
+
const { entityViews: l } = Ke(), [p, m] = K.useState(), [u, d] = K.useState(!1), [c, y] = K.useState(), [g, b] = K.useState(), {
|
|
5211
5232
|
values: O,
|
|
5212
|
-
setFieldValue:
|
|
5213
|
-
} =
|
|
5233
|
+
setFieldValue: w
|
|
5234
|
+
} = Y(), k = t.subcollections ?? [], f = O.entityViews?.filter((h) => typeof h == "string").map((h) => Ba(h, l)).filter(Boolean) ?? [], v = t.entityViews?.filter((h) => typeof h != "string") ?? [], _ = f.length + v.length;
|
|
5214
5235
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
|
|
5215
5236
|
/* @__PURE__ */ e(ht, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
|
|
5216
5237
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
@@ -5218,19 +5239,19 @@ function er({
|
|
|
5218
5239
|
"Subcollections of ",
|
|
5219
5240
|
O.name
|
|
5220
5241
|
] }),
|
|
5221
|
-
|
|
5242
|
+
k && k.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(Ft, { children: k.map((h) => /* @__PURE__ */ n(
|
|
5222
5243
|
wt,
|
|
5223
5244
|
{
|
|
5224
5245
|
onClick: () => b({
|
|
5225
5246
|
isNewCollection: !1,
|
|
5226
|
-
editedCollectionPath:
|
|
5247
|
+
editedCollectionPath: h.path
|
|
5227
5248
|
}),
|
|
5228
5249
|
children: [
|
|
5229
5250
|
/* @__PURE__ */ e(
|
|
5230
5251
|
Ge,
|
|
5231
5252
|
{
|
|
5232
5253
|
align: "left",
|
|
5233
|
-
children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children:
|
|
5254
|
+
children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name })
|
|
5234
5255
|
}
|
|
5235
5256
|
),
|
|
5236
5257
|
/* @__PURE__ */ e(
|
|
@@ -5241,8 +5262,8 @@ function er({
|
|
|
5241
5262
|
ne,
|
|
5242
5263
|
{
|
|
5243
5264
|
size: "small",
|
|
5244
|
-
onClick: (
|
|
5245
|
-
|
|
5265
|
+
onClick: (A) => {
|
|
5266
|
+
A.preventDefault(), A.stopPropagation(), m(h.path);
|
|
5246
5267
|
},
|
|
5247
5268
|
color: "inherit",
|
|
5248
5269
|
children: /* @__PURE__ */ e(pt, { size: "small" })
|
|
@@ -5252,10 +5273,10 @@ function er({
|
|
|
5252
5273
|
)
|
|
5253
5274
|
]
|
|
5254
5275
|
},
|
|
5255
|
-
|
|
5276
|
+
h.path
|
|
5256
5277
|
)) }) }) }),
|
|
5257
5278
|
/* @__PURE__ */ e(
|
|
5258
|
-
|
|
5279
|
+
U,
|
|
5259
5280
|
{
|
|
5260
5281
|
onClick: () => {
|
|
5261
5282
|
b({
|
|
@@ -5270,13 +5291,13 @@ function er({
|
|
|
5270
5291
|
] }),
|
|
5271
5292
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
5272
5293
|
/* @__PURE__ */ e(C, { variant: "h5", children: "Custom views" }),
|
|
5273
|
-
|
|
5274
|
-
|
|
5294
|
+
_ > 0 && /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ n(Ft, { children: [
|
|
5295
|
+
f.map((h) => /* @__PURE__ */ n(wt, { children: [
|
|
5275
5296
|
/* @__PURE__ */ e(
|
|
5276
5297
|
Ge,
|
|
5277
5298
|
{
|
|
5278
5299
|
align: "left",
|
|
5279
|
-
children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children:
|
|
5300
|
+
children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name })
|
|
5280
5301
|
}
|
|
5281
5302
|
),
|
|
5282
5303
|
/* @__PURE__ */ e(
|
|
@@ -5287,8 +5308,8 @@ function er({
|
|
|
5287
5308
|
ne,
|
|
5288
5309
|
{
|
|
5289
5310
|
size: "small",
|
|
5290
|
-
onClick: (
|
|
5291
|
-
|
|
5311
|
+
onClick: (A) => {
|
|
5312
|
+
A.preventDefault(), A.stopPropagation(), y(h.key);
|
|
5292
5313
|
},
|
|
5293
5314
|
color: "inherit",
|
|
5294
5315
|
children: /* @__PURE__ */ e(pt, { size: "small" })
|
|
@@ -5296,30 +5317,30 @@ function er({
|
|
|
5296
5317
|
) })
|
|
5297
5318
|
}
|
|
5298
5319
|
)
|
|
5299
|
-
] },
|
|
5300
|
-
|
|
5320
|
+
] }, h.key)),
|
|
5321
|
+
v.map((h) => /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ n(
|
|
5301
5322
|
Ge,
|
|
5302
5323
|
{
|
|
5303
5324
|
align: "left",
|
|
5304
5325
|
children: [
|
|
5305
|
-
/* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children:
|
|
5326
|
+
/* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name }),
|
|
5306
5327
|
/* @__PURE__ */ n(C, { variant: "caption", className: "flex-grow", children: [
|
|
5307
5328
|
"This view is defined in code with key ",
|
|
5308
|
-
/* @__PURE__ */ e("code", { children:
|
|
5329
|
+
/* @__PURE__ */ e("code", { children: h.key })
|
|
5309
5330
|
] })
|
|
5310
5331
|
]
|
|
5311
5332
|
}
|
|
5312
|
-
) },
|
|
5333
|
+
) }, h.key))
|
|
5313
5334
|
] }) }) }) }),
|
|
5314
|
-
|
|
5335
|
+
_ === 0 && /* @__PURE__ */ n(ea, { children: [
|
|
5315
5336
|
/* @__PURE__ */ e("b", { children: "COMING SOON" }),
|
|
5316
5337
|
" Define your own custom views by uploading it with the CLI"
|
|
5317
5338
|
] }),
|
|
5318
5339
|
/* @__PURE__ */ e(
|
|
5319
|
-
|
|
5340
|
+
U,
|
|
5320
5341
|
{
|
|
5321
5342
|
onClick: () => {
|
|
5322
|
-
|
|
5343
|
+
d(!0);
|
|
5323
5344
|
},
|
|
5324
5345
|
variant: "outlined",
|
|
5325
5346
|
startIcon: /* @__PURE__ */ e(Ae, {}),
|
|
@@ -5340,24 +5361,24 @@ function er({
|
|
|
5340
5361
|
}), m(void 0);
|
|
5341
5362
|
},
|
|
5342
5363
|
onCancel: () => m(void 0),
|
|
5343
|
-
title: /* @__PURE__ */ e(
|
|
5344
|
-
body: /* @__PURE__ */ n(
|
|
5364
|
+
title: /* @__PURE__ */ e($, { children: "Delete this subcollection?" }),
|
|
5365
|
+
body: /* @__PURE__ */ n($, { children: [
|
|
5345
5366
|
" This will ",
|
|
5346
5367
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5347
5368
|
", only the collection in the CMS"
|
|
5348
5369
|
] })
|
|
5349
5370
|
}
|
|
5350
5371
|
),
|
|
5351
|
-
|
|
5372
|
+
c && /* @__PURE__ */ e(
|
|
5352
5373
|
mt,
|
|
5353
5374
|
{
|
|
5354
|
-
open: !!
|
|
5375
|
+
open: !!c,
|
|
5355
5376
|
onAccept: () => {
|
|
5356
|
-
|
|
5377
|
+
w("entityViews", O.entityViews?.filter((h) => h !== c)), y(void 0);
|
|
5357
5378
|
},
|
|
5358
|
-
onCancel: () =>
|
|
5359
|
-
title: /* @__PURE__ */ e(
|
|
5360
|
-
body: /* @__PURE__ */ n(
|
|
5379
|
+
onCancel: () => y(void 0),
|
|
5380
|
+
title: /* @__PURE__ */ e($, { children: "Remove this view?" }),
|
|
5381
|
+
body: /* @__PURE__ */ n($, { children: [
|
|
5361
5382
|
"This will ",
|
|
5362
5383
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
5363
5384
|
", only the view in the CMS"
|
|
@@ -5365,7 +5386,7 @@ function er({
|
|
|
5365
5386
|
}
|
|
5366
5387
|
),
|
|
5367
5388
|
/* @__PURE__ */ e(
|
|
5368
|
-
|
|
5389
|
+
ma,
|
|
5369
5390
|
{
|
|
5370
5391
|
open: !!g,
|
|
5371
5392
|
configController: i,
|
|
@@ -5381,17 +5402,17 @@ function er({
|
|
|
5381
5402
|
}
|
|
5382
5403
|
),
|
|
5383
5404
|
/* @__PURE__ */ e(
|
|
5384
|
-
|
|
5405
|
+
tr,
|
|
5385
5406
|
{
|
|
5386
5407
|
open: u,
|
|
5387
|
-
onClose: (
|
|
5388
|
-
|
|
5408
|
+
onClose: (h) => {
|
|
5409
|
+
h && (console.log("selectedViewKey", h), w("entityViews", [...O.entityViews ?? [], h])), d(!1);
|
|
5389
5410
|
}
|
|
5390
5411
|
}
|
|
5391
5412
|
)
|
|
5392
5413
|
] });
|
|
5393
5414
|
}
|
|
5394
|
-
const
|
|
5415
|
+
const Ut = {
|
|
5395
5416
|
id: "products",
|
|
5396
5417
|
path: "products",
|
|
5397
5418
|
name: "Products",
|
|
@@ -5476,7 +5497,7 @@ const $t = {
|
|
|
5476
5497
|
autoValue: "on_create"
|
|
5477
5498
|
}
|
|
5478
5499
|
})
|
|
5479
|
-
},
|
|
5500
|
+
}, $t = {
|
|
5480
5501
|
id: "blog",
|
|
5481
5502
|
path: "blog",
|
|
5482
5503
|
name: "Blog",
|
|
@@ -5588,7 +5609,7 @@ const $t = {
|
|
|
5588
5609
|
initialFilter: {
|
|
5589
5610
|
status: ["==", "published"]
|
|
5590
5611
|
}
|
|
5591
|
-
},
|
|
5612
|
+
}, Lt = {
|
|
5592
5613
|
id: "users",
|
|
5593
5614
|
path: "users",
|
|
5594
5615
|
name: "Users",
|
|
@@ -5620,31 +5641,31 @@ const $t = {
|
|
|
5620
5641
|
}
|
|
5621
5642
|
})
|
|
5622
5643
|
};
|
|
5623
|
-
function
|
|
5644
|
+
function ir({
|
|
5624
5645
|
path: t,
|
|
5625
5646
|
pathSuggestions: a,
|
|
5626
5647
|
parentCollection: i,
|
|
5627
5648
|
onContinue: r,
|
|
5628
5649
|
collections: s
|
|
5629
5650
|
}) {
|
|
5630
|
-
const [o, l] =
|
|
5651
|
+
const [o, l] = L(!1), [p, m] = L();
|
|
5631
5652
|
pe(() => {
|
|
5632
|
-
a && s && (l(!0), a(t).then((
|
|
5633
|
-
const
|
|
5634
|
-
m(
|
|
5653
|
+
a && s && (l(!0), a(t).then((f) => {
|
|
5654
|
+
const v = f.filter((_) => !s.find((h) => h.path.trim().toLowerCase() === _.trim().toLowerCase()));
|
|
5655
|
+
m(v);
|
|
5635
5656
|
}).finally(() => l(!1)));
|
|
5636
5657
|
}, [s, t, a]);
|
|
5637
5658
|
const {
|
|
5638
5659
|
values: u,
|
|
5639
|
-
setFieldValue:
|
|
5640
|
-
setValues:
|
|
5641
|
-
handleChange:
|
|
5660
|
+
setFieldValue: d,
|
|
5661
|
+
setValues: c,
|
|
5662
|
+
handleChange: y,
|
|
5642
5663
|
touched: g,
|
|
5643
5664
|
errors: b,
|
|
5644
5665
|
setFieldTouched: O,
|
|
5645
|
-
isSubmitting:
|
|
5646
|
-
submitCount:
|
|
5647
|
-
} =
|
|
5666
|
+
isSubmitting: w,
|
|
5667
|
+
submitCount: k
|
|
5668
|
+
} = Y();
|
|
5648
5669
|
return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5649
5670
|
/* @__PURE__ */ e(
|
|
5650
5671
|
"div",
|
|
@@ -5668,17 +5689,17 @@ function tr({
|
|
|
5668
5689
|
),
|
|
5669
5690
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
|
|
5670
5691
|
o && !p && /* @__PURE__ */ e(We, { size: "small" }),
|
|
5671
|
-
p?.map((
|
|
5692
|
+
p?.map((f, v) => /* @__PURE__ */ e(
|
|
5672
5693
|
dt,
|
|
5673
5694
|
{
|
|
5674
5695
|
colorScheme: "cyanLighter",
|
|
5675
5696
|
onClick: () => {
|
|
5676
|
-
|
|
5697
|
+
d("name", Pt(f)), d("path", f), d("properties", void 0), r();
|
|
5677
5698
|
},
|
|
5678
5699
|
size: "small",
|
|
5679
|
-
children:
|
|
5700
|
+
children: f
|
|
5680
5701
|
},
|
|
5681
|
-
|
|
5702
|
+
f
|
|
5682
5703
|
)),
|
|
5683
5704
|
!o && p?.length === 0 && /* @__PURE__ */ e(C, { variant: "caption", children: "No suggestions" })
|
|
5684
5705
|
] })
|
|
@@ -5698,9 +5719,9 @@ function tr({
|
|
|
5698
5719
|
{
|
|
5699
5720
|
title: "Products",
|
|
5700
5721
|
subtitle: "A collection of products with images, prices and stock",
|
|
5701
|
-
icon: /* @__PURE__ */ e(lt, { size: "small", iconKey:
|
|
5722
|
+
icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Ut.icon }),
|
|
5702
5723
|
onClick: () => {
|
|
5703
|
-
|
|
5724
|
+
c(Ut), r();
|
|
5704
5725
|
}
|
|
5705
5726
|
}
|
|
5706
5727
|
),
|
|
@@ -5709,9 +5730,9 @@ function tr({
|
|
|
5709
5730
|
{
|
|
5710
5731
|
title: "Blog posts",
|
|
5711
5732
|
subtitle: "A collection of blog posts with images, authors and complex content",
|
|
5712
|
-
icon: /* @__PURE__ */ e(lt, { size: "small", iconKey:
|
|
5733
|
+
icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: $t.icon }),
|
|
5713
5734
|
onClick: () => {
|
|
5714
|
-
|
|
5735
|
+
c($t), r();
|
|
5715
5736
|
}
|
|
5716
5737
|
}
|
|
5717
5738
|
),
|
|
@@ -5720,9 +5741,9 @@ function tr({
|
|
|
5720
5741
|
{
|
|
5721
5742
|
title: "Users",
|
|
5722
5743
|
subtitle: "A collection of users with emails, names and roles",
|
|
5723
|
-
icon: /* @__PURE__ */ e(lt, { size: "small", iconKey:
|
|
5744
|
+
icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Lt.icon }),
|
|
5724
5745
|
onClick: () => {
|
|
5725
|
-
|
|
5746
|
+
c(Lt), r();
|
|
5726
5747
|
}
|
|
5727
5748
|
}
|
|
5728
5749
|
)
|
|
@@ -5738,9 +5759,9 @@ function tr({
|
|
|
5738
5759
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
5739
5760
|
}
|
|
5740
5761
|
),
|
|
5741
|
-
/* @__PURE__ */ e(
|
|
5762
|
+
/* @__PURE__ */ e(di, { onDataAdded: (f) => r(f) })
|
|
5742
5763
|
] }),
|
|
5743
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
5764
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
|
|
5744
5765
|
] }) });
|
|
5745
5766
|
}
|
|
5746
5767
|
function kt({
|
|
@@ -5753,7 +5774,7 @@ function kt({
|
|
|
5753
5774
|
ta,
|
|
5754
5775
|
{
|
|
5755
5776
|
onClick: r,
|
|
5756
|
-
className:
|
|
5777
|
+
className: xe(
|
|
5757
5778
|
"my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
|
|
5758
5779
|
"text-gray-700 dark:text-gray-300",
|
|
5759
5780
|
"hover:border-blue-600 hover:text-blue-600 dark:hover:text-blue-400 focus:ring-blue-400 hover:ring-1 hover:ring-primary",
|
|
@@ -5774,30 +5795,6 @@ function kt({
|
|
|
5774
5795
|
}
|
|
5775
5796
|
) });
|
|
5776
5797
|
}
|
|
5777
|
-
const ar = [
|
|
5778
|
-
"text_field",
|
|
5779
|
-
"multiline",
|
|
5780
|
-
"markdown",
|
|
5781
|
-
"url",
|
|
5782
|
-
"email",
|
|
5783
|
-
"select",
|
|
5784
|
-
"multi_select",
|
|
5785
|
-
"number_input",
|
|
5786
|
-
"number_select",
|
|
5787
|
-
"multi_number_select",
|
|
5788
|
-
"file_upload",
|
|
5789
|
-
"multi_file_upload",
|
|
5790
|
-
"group",
|
|
5791
|
-
"key_value",
|
|
5792
|
-
"reference",
|
|
5793
|
-
"multi_references",
|
|
5794
|
-
"switch",
|
|
5795
|
-
"date_time",
|
|
5796
|
-
"repeat",
|
|
5797
|
-
"block"
|
|
5798
|
-
], ir = Object.entries(Ot).filter(
|
|
5799
|
-
([t]) => ar.includes(t)
|
|
5800
|
-
);
|
|
5801
5798
|
function rr({
|
|
5802
5799
|
importConfig: t,
|
|
5803
5800
|
propertyConfigs: a,
|
|
@@ -5807,45 +5804,45 @@ function rr({
|
|
|
5807
5804
|
setFieldValue: r,
|
|
5808
5805
|
setFieldTouched: s,
|
|
5809
5806
|
values: o
|
|
5810
|
-
} =
|
|
5807
|
+
} = Y(), [l, p] = L(void 0), m = K.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, d = l || void 0, c = ({
|
|
5811
5808
|
id: g,
|
|
5812
5809
|
property: b,
|
|
5813
5810
|
previousId: O,
|
|
5814
|
-
namespace:
|
|
5811
|
+
namespace: w
|
|
5815
5812
|
}) => {
|
|
5816
|
-
const
|
|
5817
|
-
const
|
|
5818
|
-
r(
|
|
5813
|
+
const k = g ? ce(g, w) : void 0, f = k ? ke(k) : void 0, v = (h) => h ? m.current[h] ?? P(o, Pe(h)) : m.current[""], _ = (h, A) => {
|
|
5814
|
+
const E = Pe(A);
|
|
5815
|
+
r(E, h, !1), m.current[A ?? ""] = h;
|
|
5819
5816
|
};
|
|
5820
5817
|
if (O && O !== g) {
|
|
5821
|
-
const
|
|
5822
|
-
|
|
5823
|
-
const
|
|
5824
|
-
Object.keys(
|
|
5825
|
-
|
|
5826
|
-
}), t.setHeadersMapping(
|
|
5818
|
+
const h = ce(O, w), A = ke(h), z = v(w).map((B) => B === O ? g : B).filter((B) => B !== void 0);
|
|
5819
|
+
_(z, w);
|
|
5820
|
+
const q = { ...t.headersMapping };
|
|
5821
|
+
Object.keys(q).forEach((B) => {
|
|
5822
|
+
q[B] === O && (q[B] = g ?? "");
|
|
5823
|
+
}), t.setHeadersMapping(q), r(A, void 0, !1), s(A, !1, !1);
|
|
5827
5824
|
}
|
|
5828
|
-
|
|
5829
|
-
},
|
|
5825
|
+
f && (r(f, b, !1), s(f, !0, !1));
|
|
5826
|
+
}, y = async ({
|
|
5830
5827
|
id: g,
|
|
5831
5828
|
importKey: b,
|
|
5832
5829
|
property: O,
|
|
5833
|
-
namespace:
|
|
5830
|
+
namespace: w
|
|
5834
5831
|
}) => {
|
|
5835
|
-
const
|
|
5836
|
-
...
|
|
5832
|
+
const k = g ? ce(g, w) : void 0, f = k ? ke(k) : void 0, v = t.importData.map((h) => P(h, b)), _ = {
|
|
5833
|
+
...ai(v, O, ia),
|
|
5837
5834
|
editable: !0
|
|
5838
5835
|
};
|
|
5839
|
-
|
|
5836
|
+
f && (_ ? (console.log("updating inferredNewProperty", {
|
|
5840
5837
|
property: O,
|
|
5841
|
-
inferredNewProperty:
|
|
5842
|
-
}), r(
|
|
5838
|
+
inferredNewProperty: _
|
|
5839
|
+
}), r(f, _, !1)) : r(f, O, !1), s(f, !0, !1));
|
|
5843
5840
|
};
|
|
5844
5841
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
|
|
5845
5842
|
/* @__PURE__ */ n(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5846
5843
|
/* @__PURE__ */ e(C, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
|
|
5847
5844
|
/* @__PURE__ */ e(
|
|
5848
|
-
|
|
5845
|
+
pi,
|
|
5849
5846
|
{
|
|
5850
5847
|
headersMapping: t.headersMapping,
|
|
5851
5848
|
idColumn: t.idColumn,
|
|
@@ -5857,11 +5854,11 @@ function rr({
|
|
|
5857
5854
|
propertyKey: b,
|
|
5858
5855
|
importKey: O
|
|
5859
5856
|
}) => /* @__PURE__ */ e(
|
|
5860
|
-
|
|
5857
|
+
mi,
|
|
5861
5858
|
{
|
|
5862
5859
|
property: g,
|
|
5863
5860
|
propertyKey: b,
|
|
5864
|
-
onPropertyNameChanged: (
|
|
5861
|
+
onPropertyNameChanged: (w, k) => r(`properties.${w}.name`, k, !1),
|
|
5865
5862
|
onEditClick: () => {
|
|
5866
5863
|
!b || !g || p({
|
|
5867
5864
|
...g,
|
|
@@ -5874,8 +5871,8 @@ function rr({
|
|
|
5874
5871
|
{
|
|
5875
5872
|
property: g,
|
|
5876
5873
|
disabled: !1,
|
|
5877
|
-
onPropertyChanged: (
|
|
5878
|
-
...
|
|
5874
|
+
onPropertyChanged: (w) => y({
|
|
5875
|
+
...w,
|
|
5879
5876
|
importKey: O
|
|
5880
5877
|
}),
|
|
5881
5878
|
propertyKey: b,
|
|
@@ -5892,10 +5889,10 @@ function rr({
|
|
|
5892
5889
|
{
|
|
5893
5890
|
open: l !== void 0,
|
|
5894
5891
|
propertyKey: u,
|
|
5895
|
-
property:
|
|
5892
|
+
property: d,
|
|
5896
5893
|
inArray: !1,
|
|
5897
5894
|
autoUpdateId: !1,
|
|
5898
|
-
onPropertyChanged:
|
|
5895
|
+
onPropertyChanged: c,
|
|
5899
5896
|
allowDataInference: !1,
|
|
5900
5897
|
collectionEditable: i,
|
|
5901
5898
|
onOkClicked: () => {
|
|
@@ -5919,7 +5916,7 @@ function or({
|
|
|
5919
5916
|
propertyConfigs: r,
|
|
5920
5917
|
disabled: s
|
|
5921
5918
|
}) {
|
|
5922
|
-
const o = t ? Xt(t) : null, l = t ? Ze(t, r) : null, [p, m] =
|
|
5919
|
+
const o = t ? Xt(t) : null, l = t ? Ze(t, r) : null, [p, m] = L(!1);
|
|
5923
5920
|
return /* @__PURE__ */ e(
|
|
5924
5921
|
re,
|
|
5925
5922
|
{
|
|
@@ -5939,20 +5936,20 @@ function or({
|
|
|
5939
5936
|
position: "item-aligned",
|
|
5940
5937
|
renderValue: (u) => l ? /* @__PURE__ */ e(Xe, { propertyConfig: l }) : null,
|
|
5941
5938
|
onValueChange: (u) => {
|
|
5942
|
-
const
|
|
5939
|
+
const d = na(t, u, r);
|
|
5943
5940
|
i && (a({
|
|
5944
5941
|
id: i,
|
|
5945
|
-
property:
|
|
5942
|
+
property: d,
|
|
5946
5943
|
previousId: i,
|
|
5947
5944
|
namespace: void 0
|
|
5948
5945
|
}), console.log("newSelectedWidgetId", u));
|
|
5949
5946
|
},
|
|
5950
|
-
children:
|
|
5947
|
+
children: Object.entries(la).map(([u, d]) => /* @__PURE__ */ e(
|
|
5951
5948
|
sa,
|
|
5952
5949
|
{
|
|
5953
5950
|
value: u,
|
|
5954
5951
|
optionDisabled: !1,
|
|
5955
|
-
propertyConfig:
|
|
5952
|
+
propertyConfig: d,
|
|
5956
5953
|
existing: !1
|
|
5957
5954
|
},
|
|
5958
5955
|
u
|
|
@@ -5964,12 +5961,12 @@ function or({
|
|
|
5964
5961
|
}
|
|
5965
5962
|
function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
|
|
5966
5963
|
pe(() => {
|
|
5967
|
-
const s =
|
|
5964
|
+
const s = ui(t.originProperties, a), o = t.importData.map((l) => hi(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
|
|
5968
5965
|
t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
|
|
5969
5966
|
}, []);
|
|
5970
|
-
const r =
|
|
5967
|
+
const r = Ma();
|
|
5971
5968
|
return /* @__PURE__ */ e(
|
|
5972
|
-
|
|
5969
|
+
Ra,
|
|
5973
5970
|
{
|
|
5974
5971
|
title: /* @__PURE__ */ n("div", { children: [
|
|
5975
5972
|
/* @__PURE__ */ e(C, { variant: "subtitle2", children: "Imported data preview" }),
|
|
@@ -5989,30 +5986,30 @@ function nr({ importConfig: t, properties: a, propertiesOrder: i }) {
|
|
|
5989
5986
|
}
|
|
5990
5987
|
);
|
|
5991
5988
|
}
|
|
5992
|
-
function
|
|
5989
|
+
function pa(t, a = "") {
|
|
5993
5990
|
const i = Object.keys(t).reduce((o, l) => {
|
|
5994
|
-
const p = t[l], m =
|
|
5991
|
+
const p = t[l], m = Ua(l), u = a ? `${a}.${m}` : m;
|
|
5995
5992
|
if (p.dataType === "map" && p.properties) {
|
|
5996
|
-
const
|
|
5993
|
+
const y = pa(p.properties, u);
|
|
5997
5994
|
return {
|
|
5998
5995
|
headersMapping: { ...o.headersMapping, [l]: u },
|
|
5999
5996
|
properties: {
|
|
6000
5997
|
...o.properties,
|
|
6001
5998
|
[m]: {
|
|
6002
5999
|
...p,
|
|
6003
|
-
properties:
|
|
6004
|
-
propertiesOrder: Object.keys(
|
|
6000
|
+
properties: y.properties,
|
|
6001
|
+
propertiesOrder: Object.keys(y.properties)
|
|
6005
6002
|
}
|
|
6006
6003
|
}
|
|
6007
6004
|
};
|
|
6008
6005
|
}
|
|
6009
|
-
const
|
|
6006
|
+
const d = {
|
|
6010
6007
|
...o.properties,
|
|
6011
6008
|
[m]: p
|
|
6012
6009
|
};
|
|
6013
6010
|
return {
|
|
6014
6011
|
headersMapping: { ...o.headersMapping, [l]: u },
|
|
6015
|
-
properties:
|
|
6012
|
+
properties: d
|
|
6016
6013
|
};
|
|
6017
6014
|
}, { headersMapping: {}, properties: {} }), r = Object.keys(i.headersMapping)?.[0];
|
|
6018
6015
|
let s;
|
|
@@ -6021,8 +6018,8 @@ function da(t, a = "") {
|
|
|
6021
6018
|
idColumn: s
|
|
6022
6019
|
};
|
|
6023
6020
|
}
|
|
6024
|
-
function
|
|
6025
|
-
const a = t.open, [i, r] =
|
|
6021
|
+
function ma(t) {
|
|
6022
|
+
const a = t.open, [i, r] = _e.useState(!1), [s, o] = _e.useState(!1), l = Z(() => {
|
|
6026
6023
|
i ? o(!0) : t.handleClose(void 0);
|
|
6027
6024
|
}, [i, t.handleClose]);
|
|
6028
6025
|
return pe(() => {
|
|
@@ -6046,7 +6043,7 @@ function pa(t) {
|
|
|
6046
6043
|
}
|
|
6047
6044
|
),
|
|
6048
6045
|
/* @__PURE__ */ e(
|
|
6049
|
-
|
|
6046
|
+
er,
|
|
6050
6047
|
{
|
|
6051
6048
|
open: s,
|
|
6052
6049
|
handleOk: () => t.handleClose(void 0),
|
|
@@ -6069,89 +6066,89 @@ function sr({
|
|
|
6069
6066
|
handleClose: p,
|
|
6070
6067
|
reservedGroups: m,
|
|
6071
6068
|
extraView: u,
|
|
6072
|
-
handleCancel:
|
|
6073
|
-
setFormDirty:
|
|
6074
|
-
pathSuggestions:
|
|
6069
|
+
handleCancel: d,
|
|
6070
|
+
setFormDirty: c,
|
|
6071
|
+
pathSuggestions: y,
|
|
6075
6072
|
getUser: g,
|
|
6076
6073
|
parentCollection: b,
|
|
6077
6074
|
getData: O
|
|
6078
6075
|
}) {
|
|
6079
|
-
const { propertyConfigs:
|
|
6080
|
-
topLevelNavigation:
|
|
6081
|
-
collections:
|
|
6082
|
-
} =
|
|
6083
|
-
if (!
|
|
6076
|
+
const { propertyConfigs: w } = Ke(), k = Be(), {
|
|
6077
|
+
topLevelNavigation: f,
|
|
6078
|
+
collections: v
|
|
6079
|
+
} = k, _ = !a?.path && (s ?? []).length === 0, h = (b ? b.subcollections : v) ?? [], A = h.map((V) => V.path.trim().toLowerCase()), E = h.map((V) => V.id?.trim().toLowerCase()).filter(Boolean), z = gi();
|
|
6080
|
+
if (!f)
|
|
6084
6081
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
6085
6082
|
const {
|
|
6086
|
-
groups:
|
|
6087
|
-
} =
|
|
6083
|
+
groups: q
|
|
6084
|
+
} = f, B = De(), S = Ye(), N = He({}), j = t ? _ ? "welcome" : "details" : "properties", [x, I] = L(j), [ge, fe] = _e.useState(), [X, M] = _e.useState(), [Q, te] = _e.useState(!1), [me, ue] = _e.useState();
|
|
6088
6085
|
pe(() => {
|
|
6089
6086
|
try {
|
|
6090
|
-
|
|
6091
|
-
} catch (
|
|
6092
|
-
console.error(
|
|
6087
|
+
k.initialised && (M(r ? k.getCollectionFromPaths([...s ?? [], r]) : void 0), te(!0));
|
|
6088
|
+
} catch (V) {
|
|
6089
|
+
console.error(V), ue(me);
|
|
6093
6090
|
}
|
|
6094
|
-
}, [
|
|
6095
|
-
const
|
|
6096
|
-
const
|
|
6091
|
+
}, [k.getCollectionFromPaths, r, me, k.initialised]);
|
|
6092
|
+
const be = (V) => {
|
|
6093
|
+
const F = V.id || V.path;
|
|
6097
6094
|
return i.saveCollection({
|
|
6098
|
-
id:
|
|
6099
|
-
collectionData:
|
|
6095
|
+
id: F,
|
|
6096
|
+
collectionData: V,
|
|
6100
6097
|
previousPath: r,
|
|
6101
6098
|
parentCollectionIds: s
|
|
6102
|
-
}).then(() => (
|
|
6099
|
+
}).then(() => (fe(void 0), !0)).catch((R) => (fe(R), console.error(R), B.open({
|
|
6103
6100
|
type: "error",
|
|
6104
|
-
message: "Error persisting collection: " + (
|
|
6101
|
+
message: "Error persisting collection: " + (R.message ?? "Details in the console")
|
|
6105
6102
|
}), !1));
|
|
6106
|
-
},
|
|
6107
|
-
...
|
|
6108
|
-
id:
|
|
6109
|
-
} : void 0, Ce =
|
|
6110
|
-
id: a?.path ??
|
|
6103
|
+
}, ve = X ? {
|
|
6104
|
+
...X,
|
|
6105
|
+
id: X.id ?? X.path ?? jt(16)
|
|
6106
|
+
} : void 0, Ce = ve ? lr(ve, w) : {
|
|
6107
|
+
id: a?.path ?? jt(16),
|
|
6111
6108
|
path: a?.path ?? "",
|
|
6112
6109
|
name: a?.name ?? "",
|
|
6113
6110
|
group: a?.group ?? "",
|
|
6114
6111
|
properties: {},
|
|
6115
6112
|
propertiesOrder: [],
|
|
6116
6113
|
icon: xt[Math.floor(Math.random() * xt.length)],
|
|
6117
|
-
ownerId:
|
|
6118
|
-
}, ae =
|
|
6119
|
-
|
|
6120
|
-
}, [
|
|
6114
|
+
ownerId: S.user?.uid ?? ""
|
|
6115
|
+
}, ae = Z(() => {
|
|
6116
|
+
x === "details" ? z.inUse ? I("import_data_saving") : I(u ? "extra_view" : "properties") : I(x === "welcome" ? "details" : x === "import_data_mapping" ? "import_data_preview" : x === "import_data_preview" ? "details" : x === "extra_view" ? "properties" : "details");
|
|
6117
|
+
}, [x, z.inUse, u]), Ve = Z((V) => {
|
|
6121
6118
|
if (l)
|
|
6122
|
-
return l?.(
|
|
6123
|
-
}, [l, s]), tt =
|
|
6119
|
+
return l?.(V.path, V.collectionGroup ?? !1, s ?? []);
|
|
6120
|
+
}, [l, s]), tt = Z(async (V) => {
|
|
6124
6121
|
try {
|
|
6125
6122
|
if (!Ve)
|
|
6126
|
-
return
|
|
6127
|
-
|
|
6128
|
-
const
|
|
6129
|
-
if (!
|
|
6130
|
-
return
|
|
6131
|
-
const
|
|
6132
|
-
...
|
|
6123
|
+
return M(V), Promise.resolve(V);
|
|
6124
|
+
I("loading");
|
|
6125
|
+
const F = await Ve?.(V);
|
|
6126
|
+
if (!F)
|
|
6127
|
+
return M(V), Promise.resolve(V);
|
|
6128
|
+
const R = {
|
|
6129
|
+
...V ?? {}
|
|
6133
6130
|
};
|
|
6134
|
-
return Object.keys(
|
|
6135
|
-
newCollection:
|
|
6136
|
-
values:
|
|
6137
|
-
}),
|
|
6138
|
-
} catch (
|
|
6139
|
-
return console.error(
|
|
6131
|
+
return Object.keys(F.properties ?? {}).length > 0 && (R.properties = F.properties, R.propertiesOrder = F.propertiesOrder), R.propertiesOrder ? (M(R), console.log("Inferred collection", {
|
|
6132
|
+
newCollection: V ?? {},
|
|
6133
|
+
values: R
|
|
6134
|
+
}), R) : (R.propertiesOrder = Object.keys(R.properties), R);
|
|
6135
|
+
} catch (F) {
|
|
6136
|
+
return console.error(F), B.open({
|
|
6140
6137
|
type: "error",
|
|
6141
|
-
message: "Error inferring collection: " + (
|
|
6142
|
-
}),
|
|
6138
|
+
message: "Error inferring collection: " + (F.message ?? "Details in the console")
|
|
6139
|
+
}), V;
|
|
6143
6140
|
}
|
|
6144
|
-
}, [s, Ve]), bt = (
|
|
6141
|
+
}, [s, Ve]), bt = (V, F) => {
|
|
6145
6142
|
try {
|
|
6146
|
-
if (console.log("Submitting collection",
|
|
6147
|
-
|
|
6148
|
-
|
|
6143
|
+
if (console.log("Submitting collection", V), !t) {
|
|
6144
|
+
be(V).then(() => {
|
|
6145
|
+
F.resetForm({ values: Ce }), p(V);
|
|
6149
6146
|
});
|
|
6150
6147
|
return;
|
|
6151
6148
|
}
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
values:
|
|
6149
|
+
x === "welcome" ? (ae(), F.resetForm({ values: V })) : x === "details" ? u || z.inUse ? (F.resetForm({ values: V }), ae()) : t ? tt(V).then((R) => {
|
|
6150
|
+
F.resetForm({
|
|
6151
|
+
values: R ?? V,
|
|
6155
6152
|
touched: {
|
|
6156
6153
|
path: !0,
|
|
6157
6154
|
name: !0
|
|
@@ -6159,65 +6156,65 @@ function sr({
|
|
|
6159
6156
|
});
|
|
6160
6157
|
}).finally(() => {
|
|
6161
6158
|
ae();
|
|
6162
|
-
}) : (
|
|
6163
|
-
|
|
6164
|
-
}) : (ae(),
|
|
6165
|
-
} catch (
|
|
6166
|
-
|
|
6159
|
+
}) : (F.resetForm({ values: V }), ae()) : x === "extra_view" ? (ae(), F.resetForm({ values: V })) : x === "import_data_mapping" || x === "import_data_preview" ? ae() : x === "properties" ? be(V).then(() => {
|
|
6160
|
+
F.resetForm({ values: Ce }), ae(), p(V);
|
|
6161
|
+
}) : (ae(), F.resetForm({ values: V }));
|
|
6162
|
+
} catch (R) {
|
|
6163
|
+
B.open({
|
|
6167
6164
|
type: "error",
|
|
6168
|
-
message: "Error persisting collection: " + (
|
|
6169
|
-
}), console.error(
|
|
6165
|
+
message: "Error persisting collection: " + (R.message ?? "Details in the console")
|
|
6166
|
+
}), console.error(R), F.resetForm({ values: V });
|
|
6170
6167
|
}
|
|
6171
6168
|
};
|
|
6172
|
-
return !t && (!
|
|
6173
|
-
|
|
6169
|
+
return !t && (!k.initialised || !Q) ? /* @__PURE__ */ e(Et, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
|
|
6170
|
+
St,
|
|
6174
6171
|
{
|
|
6175
6172
|
initialValues: Ce,
|
|
6176
|
-
validationSchema: (
|
|
6177
|
-
validate: (
|
|
6178
|
-
if (
|
|
6179
|
-
return
|
|
6180
|
-
const
|
|
6181
|
-
if (
|
|
6182
|
-
const
|
|
6183
|
-
|
|
6184
|
-
const Oe = dr(
|
|
6185
|
-
Oe && (
|
|
6173
|
+
validationSchema: (x === "properties" || x === "subcollections" || x === "details") && yi,
|
|
6174
|
+
validate: (V) => {
|
|
6175
|
+
if (x === "properties")
|
|
6176
|
+
return N.current;
|
|
6177
|
+
const F = {};
|
|
6178
|
+
if (x === "details") {
|
|
6179
|
+
const R = cr(V.path, t, A, V.id);
|
|
6180
|
+
R && (F.path = R);
|
|
6181
|
+
const Oe = dr(V.id, t, A, E);
|
|
6182
|
+
Oe && (F.id = Oe);
|
|
6186
6183
|
}
|
|
6187
|
-
return
|
|
6184
|
+
return F;
|
|
6188
6185
|
},
|
|
6189
6186
|
onSubmit: bt,
|
|
6190
|
-
children: (
|
|
6187
|
+
children: (V) => {
|
|
6191
6188
|
const {
|
|
6192
|
-
values:
|
|
6193
|
-
setFieldValue:
|
|
6189
|
+
values: F,
|
|
6190
|
+
setFieldValue: R,
|
|
6194
6191
|
isSubmitting: Oe,
|
|
6195
6192
|
dirty: at,
|
|
6196
|
-
submitCount:
|
|
6197
|
-
} =
|
|
6193
|
+
submitCount: T
|
|
6194
|
+
} = V, D = F.path ?? r, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + D : D, se = k.resolveAliasesFrom(H), le = se && O ? () => O(se) : void 0;
|
|
6198
6195
|
pe(() => {
|
|
6199
|
-
|
|
6196
|
+
c(at);
|
|
6200
6197
|
}, [at]);
|
|
6201
|
-
function
|
|
6202
|
-
|
|
6203
|
-
const Fe =
|
|
6204
|
-
|
|
6198
|
+
function we(W) {
|
|
6199
|
+
z.setInUse(!0), ii(W, ia).then((Ie) => {
|
|
6200
|
+
const Fe = pa(Ie);
|
|
6201
|
+
R("properties", Fe.properties), R("propertiesOrder", Object.keys(Fe.properties)), z.setIdColumn(Fe.idColumn), z.setImportData(W), z.setHeadersMapping(Fe.headersMapping), z.setOriginProperties(Fe.properties);
|
|
6205
6202
|
});
|
|
6206
6203
|
}
|
|
6207
|
-
const yt = !!
|
|
6208
|
-
const
|
|
6209
|
-
|
|
6210
|
-
importConfig:
|
|
6211
|
-
properties:
|
|
6204
|
+
const yt = !!F.name && !!F.id, it = () => {
|
|
6205
|
+
const W = { ...F.properties };
|
|
6206
|
+
z.idColumn && delete W[z.idColumn], R("properties", W), ae(), console.log("onImportMappingComplete", {
|
|
6207
|
+
importConfig: z,
|
|
6208
|
+
properties: W
|
|
6212
6209
|
});
|
|
6213
|
-
}, vt =
|
|
6214
|
-
return /* @__PURE__ */ n(
|
|
6210
|
+
}, vt = X?.editable || t;
|
|
6211
|
+
return /* @__PURE__ */ n($, { children: [
|
|
6215
6212
|
!t && /* @__PURE__ */ n(
|
|
6216
|
-
|
|
6213
|
+
$a,
|
|
6217
6214
|
{
|
|
6218
|
-
value:
|
|
6219
|
-
className:
|
|
6220
|
-
onValueChange: (
|
|
6215
|
+
value: x,
|
|
6216
|
+
className: xe(Nt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
6217
|
+
onValueChange: (W) => I(W),
|
|
6221
6218
|
children: [
|
|
6222
6219
|
/* @__PURE__ */ e(_t, { value: "details", children: "Details" }),
|
|
6223
6220
|
/* @__PURE__ */ e(_t, { value: "properties", children: "Properties" }),
|
|
@@ -6226,130 +6223,130 @@ function sr({
|
|
|
6226
6223
|
}
|
|
6227
6224
|
),
|
|
6228
6225
|
/* @__PURE__ */ n(
|
|
6229
|
-
|
|
6226
|
+
Xa,
|
|
6230
6227
|
{
|
|
6231
6228
|
noValidate: !0,
|
|
6232
|
-
className:
|
|
6229
|
+
className: xe(
|
|
6233
6230
|
t ? "h-full" : "h-[calc(100%-48px)]",
|
|
6234
6231
|
"flex-grow flex flex-col relative"
|
|
6235
6232
|
),
|
|
6236
6233
|
children: [
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6234
|
+
x === "loading" && /* @__PURE__ */ e(Et, {}),
|
|
6235
|
+
x === "extra_view" && D && u?.View && /* @__PURE__ */ e(u.View, { path: D }),
|
|
6236
|
+
x === "welcome" && /* @__PURE__ */ e(
|
|
6237
|
+
ir,
|
|
6241
6238
|
{
|
|
6242
|
-
path:
|
|
6243
|
-
onContinue: (
|
|
6244
|
-
|
|
6239
|
+
path: D,
|
|
6240
|
+
onContinue: (W) => {
|
|
6241
|
+
W ? (we(W), I("import_data_mapping")) : I("details");
|
|
6245
6242
|
},
|
|
6246
|
-
collections:
|
|
6243
|
+
collections: v,
|
|
6247
6244
|
parentCollection: b,
|
|
6248
|
-
pathSuggestions:
|
|
6245
|
+
pathSuggestions: y
|
|
6249
6246
|
}
|
|
6250
6247
|
),
|
|
6251
|
-
|
|
6248
|
+
x === "import_data_mapping" && z && /* @__PURE__ */ e(
|
|
6252
6249
|
rr,
|
|
6253
6250
|
{
|
|
6254
|
-
importConfig:
|
|
6251
|
+
importConfig: z,
|
|
6255
6252
|
collectionEditable: vt,
|
|
6256
|
-
propertyConfigs:
|
|
6253
|
+
propertyConfigs: w
|
|
6257
6254
|
}
|
|
6258
6255
|
),
|
|
6259
|
-
|
|
6256
|
+
x === "import_data_preview" && z && /* @__PURE__ */ e(
|
|
6260
6257
|
nr,
|
|
6261
6258
|
{
|
|
6262
|
-
importConfig:
|
|
6263
|
-
properties:
|
|
6264
|
-
propertiesOrder:
|
|
6259
|
+
importConfig: z,
|
|
6260
|
+
properties: F.properties,
|
|
6261
|
+
propertiesOrder: F.propertiesOrder
|
|
6265
6262
|
}
|
|
6266
6263
|
),
|
|
6267
|
-
|
|
6268
|
-
|
|
6264
|
+
x === "import_data_saving" && z && /* @__PURE__ */ e(
|
|
6265
|
+
fi,
|
|
6269
6266
|
{
|
|
6270
|
-
importConfig:
|
|
6271
|
-
collection:
|
|
6272
|
-
onImportSuccess: (
|
|
6273
|
-
p(
|
|
6267
|
+
importConfig: z,
|
|
6268
|
+
collection: F,
|
|
6269
|
+
onImportSuccess: (W) => {
|
|
6270
|
+
p(W), B.open({
|
|
6274
6271
|
type: "info",
|
|
6275
6272
|
message: "Data imported successfully"
|
|
6276
6273
|
});
|
|
6277
6274
|
}
|
|
6278
6275
|
}
|
|
6279
6276
|
),
|
|
6280
|
-
|
|
6281
|
-
|
|
6277
|
+
x === "details" && /* @__PURE__ */ e(
|
|
6278
|
+
_i,
|
|
6282
6279
|
{
|
|
6283
|
-
existingPaths:
|
|
6284
|
-
existingIds:
|
|
6285
|
-
groups:
|
|
6280
|
+
existingPaths: A,
|
|
6281
|
+
existingIds: E,
|
|
6282
|
+
groups: q,
|
|
6286
6283
|
parentCollection: b,
|
|
6287
6284
|
isNewCollection: t
|
|
6288
6285
|
}
|
|
6289
6286
|
),
|
|
6290
|
-
|
|
6291
|
-
|
|
6287
|
+
x === "subcollections" && X && /* @__PURE__ */ e(
|
|
6288
|
+
ar,
|
|
6292
6289
|
{
|
|
6293
6290
|
parentCollection: b,
|
|
6294
6291
|
configController: i,
|
|
6295
6292
|
getUser: g,
|
|
6296
6293
|
collectionInference: l,
|
|
6297
6294
|
parentCollectionIds: s,
|
|
6298
|
-
collection:
|
|
6295
|
+
collection: X
|
|
6299
6296
|
}
|
|
6300
6297
|
),
|
|
6301
|
-
|
|
6302
|
-
|
|
6298
|
+
x === "properties" && /* @__PURE__ */ e(
|
|
6299
|
+
Xi,
|
|
6303
6300
|
{
|
|
6304
|
-
showErrors:
|
|
6301
|
+
showErrors: T > 0,
|
|
6305
6302
|
isNewCollection: t,
|
|
6306
6303
|
reservedGroups: m,
|
|
6307
|
-
onPropertyError: (
|
|
6308
|
-
|
|
6309
|
-
...
|
|
6310
|
-
[
|
|
6304
|
+
onPropertyError: (W, Ie, Fe) => {
|
|
6305
|
+
N.current = La({
|
|
6306
|
+
...N.current,
|
|
6307
|
+
[W]: Fe
|
|
6311
6308
|
}, !0);
|
|
6312
6309
|
},
|
|
6313
6310
|
getUser: g,
|
|
6314
6311
|
getData: le,
|
|
6315
6312
|
doCollectionInference: Ve,
|
|
6316
|
-
propertyConfigs:
|
|
6313
|
+
propertyConfigs: w,
|
|
6317
6314
|
collectionEditable: vt,
|
|
6318
6315
|
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
6319
6316
|
ne,
|
|
6320
6317
|
{
|
|
6321
6318
|
color: "primary",
|
|
6322
|
-
onClick: () =>
|
|
6319
|
+
onClick: () => I("extra_view"),
|
|
6323
6320
|
children: u.icon
|
|
6324
6321
|
}
|
|
6325
6322
|
)
|
|
6326
6323
|
}
|
|
6327
6324
|
),
|
|
6328
|
-
|
|
6325
|
+
x !== "welcome" && /* @__PURE__ */ n(
|
|
6329
6326
|
Le,
|
|
6330
6327
|
{
|
|
6331
6328
|
position: "absolute",
|
|
6332
6329
|
children: [
|
|
6333
6330
|
ge && /* @__PURE__ */ e(aa, { error: ge }),
|
|
6334
|
-
t &&
|
|
6335
|
-
|
|
6331
|
+
t && _ && x === "import_data_mapping" && /* @__PURE__ */ n(
|
|
6332
|
+
U,
|
|
6336
6333
|
{
|
|
6337
6334
|
variant: "text",
|
|
6338
6335
|
type: "button",
|
|
6339
|
-
onClick: () => (
|
|
6336
|
+
onClick: () => (z.setInUse(!1), I("welcome")),
|
|
6340
6337
|
children: [
|
|
6341
6338
|
/* @__PURE__ */ e(rt, {}),
|
|
6342
6339
|
"Back"
|
|
6343
6340
|
]
|
|
6344
6341
|
}
|
|
6345
6342
|
),
|
|
6346
|
-
t &&
|
|
6347
|
-
|
|
6343
|
+
t && _ && x === "import_data_preview" && /* @__PURE__ */ n(
|
|
6344
|
+
U,
|
|
6348
6345
|
{
|
|
6349
6346
|
variant: "text",
|
|
6350
6347
|
type: "button",
|
|
6351
6348
|
onClick: () => {
|
|
6352
|
-
|
|
6349
|
+
be(F), I("import_data_mapping");
|
|
6353
6350
|
},
|
|
6354
6351
|
children: [
|
|
6355
6352
|
/* @__PURE__ */ e(rt, {}),
|
|
@@ -6357,24 +6354,24 @@ function sr({
|
|
|
6357
6354
|
]
|
|
6358
6355
|
}
|
|
6359
6356
|
),
|
|
6360
|
-
t &&
|
|
6361
|
-
|
|
6357
|
+
t && _ && x === "details" && /* @__PURE__ */ n(
|
|
6358
|
+
U,
|
|
6362
6359
|
{
|
|
6363
6360
|
variant: "text",
|
|
6364
6361
|
type: "button",
|
|
6365
|
-
onClick: () =>
|
|
6362
|
+
onClick: () => I("welcome"),
|
|
6366
6363
|
children: [
|
|
6367
6364
|
/* @__PURE__ */ e(rt, {}),
|
|
6368
6365
|
"Back"
|
|
6369
6366
|
]
|
|
6370
6367
|
}
|
|
6371
6368
|
),
|
|
6372
|
-
t &&
|
|
6373
|
-
|
|
6369
|
+
t && x === "properties" && /* @__PURE__ */ n(
|
|
6370
|
+
U,
|
|
6374
6371
|
{
|
|
6375
6372
|
variant: "text",
|
|
6376
6373
|
type: "button",
|
|
6377
|
-
onClick: () =>
|
|
6374
|
+
onClick: () => I("details"),
|
|
6378
6375
|
children: [
|
|
6379
6376
|
/* @__PURE__ */ e(rt, {}),
|
|
6380
6377
|
"Back"
|
|
@@ -6382,17 +6379,17 @@ function sr({
|
|
|
6382
6379
|
}
|
|
6383
6380
|
),
|
|
6384
6381
|
/* @__PURE__ */ e(
|
|
6385
|
-
|
|
6382
|
+
U,
|
|
6386
6383
|
{
|
|
6387
6384
|
variant: "text",
|
|
6388
6385
|
onClick: () => {
|
|
6389
|
-
|
|
6386
|
+
d();
|
|
6390
6387
|
},
|
|
6391
6388
|
children: "Cancel"
|
|
6392
6389
|
}
|
|
6393
6390
|
),
|
|
6394
|
-
t &&
|
|
6395
|
-
|
|
6391
|
+
t && x === "import_data_mapping" && /* @__PURE__ */ e(
|
|
6392
|
+
U,
|
|
6396
6393
|
{
|
|
6397
6394
|
variant: "filled",
|
|
6398
6395
|
color: "primary",
|
|
@@ -6400,8 +6397,8 @@ function sr({
|
|
|
6400
6397
|
children: "Next"
|
|
6401
6398
|
}
|
|
6402
6399
|
),
|
|
6403
|
-
t &&
|
|
6404
|
-
|
|
6400
|
+
t && x === "import_data_preview" && /* @__PURE__ */ e(
|
|
6401
|
+
U,
|
|
6405
6402
|
{
|
|
6406
6403
|
variant: "filled",
|
|
6407
6404
|
color: "primary",
|
|
@@ -6411,23 +6408,23 @@ function sr({
|
|
|
6411
6408
|
children: "Next"
|
|
6412
6409
|
}
|
|
6413
6410
|
),
|
|
6414
|
-
t && (
|
|
6415
|
-
|
|
6411
|
+
t && (x === "details" || x === "properties") && /* @__PURE__ */ n(
|
|
6412
|
+
Dt,
|
|
6416
6413
|
{
|
|
6417
6414
|
variant: "filled",
|
|
6418
6415
|
color: "primary",
|
|
6419
6416
|
type: "submit",
|
|
6420
6417
|
loading: Oe,
|
|
6421
|
-
disabled: Oe ||
|
|
6422
|
-
startIcon:
|
|
6418
|
+
disabled: Oe || x === "details" && !yt,
|
|
6419
|
+
startIcon: x === "properties" ? /* @__PURE__ */ e(Ka, {}) : void 0,
|
|
6423
6420
|
children: [
|
|
6424
|
-
|
|
6425
|
-
|
|
6421
|
+
x === "details" && "Next",
|
|
6422
|
+
x === "properties" && "Create collection"
|
|
6426
6423
|
]
|
|
6427
6424
|
}
|
|
6428
6425
|
),
|
|
6429
6426
|
!t && /* @__PURE__ */ e(
|
|
6430
|
-
|
|
6427
|
+
Dt,
|
|
6431
6428
|
{
|
|
6432
6429
|
variant: "filled",
|
|
6433
6430
|
color: "primary",
|
|
@@ -6450,19 +6447,19 @@ function sr({
|
|
|
6450
6447
|
function lr(t, a) {
|
|
6451
6448
|
const { properties: i, ...r } = t, s = {};
|
|
6452
6449
|
return Object.keys(i).forEach((o) => {
|
|
6453
|
-
s[o] =
|
|
6450
|
+
s[o] = ua(i[o], a);
|
|
6454
6451
|
}), { ...r, properties: s };
|
|
6455
6452
|
}
|
|
6456
|
-
function
|
|
6453
|
+
function ua(t, a) {
|
|
6457
6454
|
let i = t;
|
|
6458
6455
|
if (a && typeof i == "object" && i.propertyConfig) {
|
|
6459
6456
|
const r = a[i.propertyConfig];
|
|
6460
6457
|
if (r && oe(r.property))
|
|
6461
6458
|
i = r.property;
|
|
6462
|
-
else if (r && (i =
|
|
6459
|
+
else if (r && (i = G(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
|
|
6463
6460
|
const s = {};
|
|
6464
6461
|
Object.keys(i.properties).forEach((o) => {
|
|
6465
|
-
s[o] =
|
|
6462
|
+
s[o] = ua(i.properties[o], a);
|
|
6466
6463
|
}), i = { ...i, properties: s };
|
|
6467
6464
|
}
|
|
6468
6465
|
}
|
|
@@ -6476,7 +6473,7 @@ const cr = (t, a, i, r) => {
|
|
|
6476
6473
|
return;
|
|
6477
6474
|
let s;
|
|
6478
6475
|
return a && i?.includes(t.trim().toLowerCase()) && (s = "There is already a collection that uses this value as a path"), a && r?.includes(t.trim().toLowerCase()) && (s = "There is already a collection which uses this id"), s;
|
|
6479
|
-
},
|
|
6476
|
+
}, ha = K.createContext({}), ga = K.createContext({}), pr = K.memo(
|
|
6480
6477
|
function({
|
|
6481
6478
|
children: a,
|
|
6482
6479
|
collectionConfigController: i,
|
|
@@ -6486,95 +6483,97 @@ const cr = (t, a, i, r) => {
|
|
|
6486
6483
|
extraView: l,
|
|
6487
6484
|
pathSuggestions: p,
|
|
6488
6485
|
getUser: m,
|
|
6489
|
-
getData: u
|
|
6486
|
+
getData: u,
|
|
6487
|
+
onAnalyticsEvent: d
|
|
6490
6488
|
}) {
|
|
6491
|
-
const c = Be(),
|
|
6492
|
-
collections:
|
|
6493
|
-
} = c,
|
|
6489
|
+
const c = Be(), y = bi(), g = De(), { propertyConfigs: b } = Ke(), {
|
|
6490
|
+
collections: O
|
|
6491
|
+
} = c, w = O.map((N) => N.path.trim().toLowerCase()), [k, f] = K.useState();
|
|
6494
6492
|
pe(() => {
|
|
6495
|
-
p && p().then((
|
|
6496
|
-
|
|
6493
|
+
p && p().then((N) => {
|
|
6494
|
+
f(N.filter((j) => !w.includes(j.trim().toLowerCase())));
|
|
6497
6495
|
});
|
|
6498
6496
|
}, [p]);
|
|
6499
|
-
const [
|
|
6497
|
+
const [v, _] = K.useState(), [h, A] = K.useState(), E = Z(() => ({
|
|
6500
6498
|
createCollections: !0,
|
|
6501
6499
|
editCollections: !0,
|
|
6502
6500
|
deleteCollections: !0
|
|
6503
|
-
}), []),
|
|
6504
|
-
path:
|
|
6505
|
-
fullPath:
|
|
6506
|
-
parentCollectionIds:
|
|
6507
|
-
parentCollection:
|
|
6501
|
+
}), []), z = Z(({
|
|
6502
|
+
path: N,
|
|
6503
|
+
fullPath: j,
|
|
6504
|
+
parentCollectionIds: x,
|
|
6505
|
+
parentCollection: I
|
|
6508
6506
|
}) => {
|
|
6509
|
-
_({
|
|
6510
|
-
editedCollectionPath:
|
|
6511
|
-
fullPath:
|
|
6512
|
-
parentCollectionIds:
|
|
6507
|
+
console.debug("edit collection", N, j, x, I), d?.("edit_collection", { path: N, fullPath: j }), _({
|
|
6508
|
+
editedCollectionPath: N,
|
|
6509
|
+
fullPath: j,
|
|
6510
|
+
parentCollectionIds: x,
|
|
6513
6511
|
isNewCollection: !1,
|
|
6514
|
-
parentCollection:
|
|
6512
|
+
parentCollection: I,
|
|
6515
6513
|
redirect: !1
|
|
6516
6514
|
});
|
|
6517
|
-
}, []),
|
|
6518
|
-
propertyKey:
|
|
6519
|
-
property:
|
|
6520
|
-
editedCollectionPath:
|
|
6521
|
-
currentPropertiesOrder:
|
|
6522
|
-
parentCollectionIds:
|
|
6523
|
-
collection:
|
|
6515
|
+
}, []), q = Z(({
|
|
6516
|
+
propertyKey: N,
|
|
6517
|
+
property: j,
|
|
6518
|
+
editedCollectionPath: x,
|
|
6519
|
+
currentPropertiesOrder: I,
|
|
6520
|
+
parentCollectionIds: ge,
|
|
6521
|
+
collection: fe
|
|
6524
6522
|
}) => {
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6523
|
+
console.debug("edit property", N, j, x, I, ge, fe), d?.("edit_property", { propertyKey: N, editedCollectionPath: x });
|
|
6524
|
+
const X = N && N.includes(".") ? N.substring(0, N.lastIndexOf(".")) : void 0, M = N && N.includes(".") ? N.substring(N.lastIndexOf(".") + 1) : N;
|
|
6525
|
+
console.log("edit property", M, fe), A({
|
|
6526
|
+
propertyKey: M,
|
|
6527
|
+
property: j,
|
|
6528
|
+
namespace: X,
|
|
6529
|
+
currentPropertiesOrder: I,
|
|
6530
|
+
editedCollectionPath: x,
|
|
6531
|
+
parentCollectionIds: ge,
|
|
6532
|
+
collectionEditable: fe?.editable ?? !1
|
|
6534
6533
|
});
|
|
6535
|
-
}, []),
|
|
6536
|
-
parentCollectionIds:
|
|
6537
|
-
parentCollection:
|
|
6538
|
-
initialValues:
|
|
6539
|
-
redirect:
|
|
6534
|
+
}, []), B = K.useCallback(({
|
|
6535
|
+
parentCollectionIds: N,
|
|
6536
|
+
parentCollection: j,
|
|
6537
|
+
initialValues: x,
|
|
6538
|
+
redirect: I
|
|
6540
6539
|
}) => {
|
|
6541
|
-
_({
|
|
6540
|
+
console.debug("create collection", N, j, x, I), d?.("create_collection", { parentCollectionIds: N, parentCollection: j, initialValues: x, redirect: I }), _({
|
|
6542
6541
|
isNewCollection: !0,
|
|
6543
|
-
parentCollectionIds:
|
|
6544
|
-
parentCollection:
|
|
6545
|
-
initialValues:
|
|
6546
|
-
redirect:
|
|
6542
|
+
parentCollectionIds: N,
|
|
6543
|
+
parentCollection: j,
|
|
6544
|
+
initialValues: x,
|
|
6545
|
+
redirect: I
|
|
6547
6546
|
});
|
|
6548
|
-
}, []),
|
|
6549
|
-
return /* @__PURE__ */ e(
|
|
6550
|
-
|
|
6547
|
+
}, []), S = p ? (N) => !N && k ? Promise.resolve(k) : p?.(N) : void 0;
|
|
6548
|
+
return /* @__PURE__ */ e(ha.Provider, { value: i, children: /* @__PURE__ */ n(
|
|
6549
|
+
ga.Provider,
|
|
6551
6550
|
{
|
|
6552
6551
|
value: {
|
|
6553
|
-
editCollection:
|
|
6554
|
-
createCollection:
|
|
6555
|
-
editProperty:
|
|
6556
|
-
configPermissions: r ??
|
|
6552
|
+
editCollection: z,
|
|
6553
|
+
createCollection: B,
|
|
6554
|
+
editProperty: q,
|
|
6555
|
+
configPermissions: r ?? E,
|
|
6557
6556
|
rootPathSuggestions: k
|
|
6558
6557
|
},
|
|
6559
6558
|
children: [
|
|
6560
6559
|
a,
|
|
6561
6560
|
/* @__PURE__ */ e(
|
|
6562
|
-
|
|
6561
|
+
ma,
|
|
6563
6562
|
{
|
|
6564
|
-
open: !!
|
|
6563
|
+
open: !!v,
|
|
6565
6564
|
configController: i,
|
|
6566
6565
|
isNewCollection: !1,
|
|
6567
6566
|
collectionInference: o,
|
|
6568
|
-
...
|
|
6567
|
+
...v,
|
|
6569
6568
|
getData: u,
|
|
6570
6569
|
reservedGroups: s,
|
|
6571
6570
|
extraView: l,
|
|
6572
|
-
pathSuggestions:
|
|
6571
|
+
pathSuggestions: S,
|
|
6573
6572
|
getUser: m,
|
|
6574
|
-
handleClose: (
|
|
6575
|
-
if (
|
|
6576
|
-
const
|
|
6577
|
-
|
|
6573
|
+
handleClose: (N) => {
|
|
6574
|
+
if (v?.redirect && N && v?.isNewCollection && !v.parentCollectionIds.length) {
|
|
6575
|
+
const j = c.buildUrlCollectionPath(N.id ?? N.path);
|
|
6576
|
+
y(j);
|
|
6578
6577
|
}
|
|
6579
6578
|
_(void 0);
|
|
6580
6579
|
}
|
|
@@ -6583,69 +6582,69 @@ const cr = (t, a, i, r) => {
|
|
|
6583
6582
|
/* @__PURE__ */ e(
|
|
6584
6583
|
je,
|
|
6585
6584
|
{
|
|
6586
|
-
open: !!
|
|
6585
|
+
open: !!h,
|
|
6587
6586
|
includeIdAndName: !0,
|
|
6588
|
-
existingProperty: !!
|
|
6589
|
-
autoUpdateId:
|
|
6590
|
-
autoOpenTypeSelect:
|
|
6587
|
+
existingProperty: !!h?.propertyKey,
|
|
6588
|
+
autoUpdateId: h ? !h?.propertyKey : !1,
|
|
6589
|
+
autoOpenTypeSelect: h ? !h?.propertyKey : !1,
|
|
6591
6590
|
inArray: !1,
|
|
6592
|
-
collectionEditable:
|
|
6593
|
-
getData: u &&
|
|
6594
|
-
const
|
|
6595
|
-
return u(
|
|
6591
|
+
collectionEditable: h?.collectionEditable ?? !1,
|
|
6592
|
+
getData: u && h?.editedCollectionPath ? () => {
|
|
6593
|
+
const N = c.resolveAliasesFrom(h.editedCollectionPath);
|
|
6594
|
+
return u(N);
|
|
6596
6595
|
} : void 0,
|
|
6597
6596
|
onPropertyChanged: ({
|
|
6598
|
-
id:
|
|
6599
|
-
property:
|
|
6597
|
+
id: N,
|
|
6598
|
+
property: j
|
|
6600
6599
|
}) => {
|
|
6601
|
-
if (!
|
|
6600
|
+
if (!h || !N)
|
|
6602
6601
|
return;
|
|
6603
|
-
const
|
|
6602
|
+
const x = !h.propertyKey;
|
|
6604
6603
|
return i.saveProperty({
|
|
6605
|
-
path:
|
|
6606
|
-
property:
|
|
6607
|
-
propertyKey:
|
|
6608
|
-
newPropertiesOrder:
|
|
6609
|
-
namespace:
|
|
6610
|
-
parentCollectionIds:
|
|
6611
|
-
}).catch((
|
|
6604
|
+
path: h?.editedCollectionPath,
|
|
6605
|
+
property: j,
|
|
6606
|
+
propertyKey: N,
|
|
6607
|
+
newPropertiesOrder: x && h.currentPropertiesOrder ? [...h.currentPropertiesOrder, N] : void 0,
|
|
6608
|
+
namespace: h.namespace,
|
|
6609
|
+
parentCollectionIds: h.parentCollectionIds
|
|
6610
|
+
}).catch((I) => (console.error(I), g.open({
|
|
6612
6611
|
type: "error",
|
|
6613
|
-
message: "Error persisting property: " + (
|
|
6612
|
+
message: "Error persisting property: " + (I.message ?? "Details in the console")
|
|
6614
6613
|
}), !1));
|
|
6615
6614
|
},
|
|
6616
6615
|
onPropertyChangedImmediate: !1,
|
|
6617
6616
|
onDelete: () => {
|
|
6618
|
-
if (!
|
|
6617
|
+
if (!h?.propertyKey)
|
|
6619
6618
|
return;
|
|
6620
|
-
const
|
|
6619
|
+
const N = h?.currentPropertiesOrder?.filter((j) => j !== h?.propertyKey);
|
|
6621
6620
|
return i.deleteProperty({
|
|
6622
|
-
path:
|
|
6623
|
-
propertyKey:
|
|
6624
|
-
namespace:
|
|
6625
|
-
newPropertiesOrder:
|
|
6626
|
-
parentCollectionIds:
|
|
6621
|
+
path: h?.editedCollectionPath,
|
|
6622
|
+
propertyKey: h?.propertyKey,
|
|
6623
|
+
namespace: h?.namespace,
|
|
6624
|
+
newPropertiesOrder: N,
|
|
6625
|
+
parentCollectionIds: h?.parentCollectionIds
|
|
6627
6626
|
}).then(() => {
|
|
6628
|
-
|
|
6629
|
-
}).catch((
|
|
6627
|
+
A(void 0);
|
|
6628
|
+
}).catch((j) => (console.error(j), g.open({
|
|
6630
6629
|
type: "error",
|
|
6631
|
-
message: "Error deleting property: " + (
|
|
6630
|
+
message: "Error deleting property: " + (j.message ?? "Details in the console")
|
|
6632
6631
|
}), !1));
|
|
6633
6632
|
},
|
|
6634
6633
|
onError: () => {
|
|
6635
6634
|
},
|
|
6636
6635
|
onOkClicked: () => {
|
|
6637
|
-
|
|
6636
|
+
A(void 0);
|
|
6638
6637
|
},
|
|
6639
6638
|
onCancel: () => {
|
|
6640
|
-
|
|
6639
|
+
A(void 0);
|
|
6641
6640
|
},
|
|
6642
6641
|
initialErrors: {},
|
|
6643
6642
|
forceShowErrors: !1,
|
|
6644
6643
|
existingPropertyKeys: [],
|
|
6645
6644
|
allowDataInference: !0,
|
|
6646
|
-
propertyConfigs:
|
|
6647
|
-
property:
|
|
6648
|
-
propertyKey:
|
|
6645
|
+
propertyConfigs: b,
|
|
6646
|
+
property: h?.property,
|
|
6647
|
+
propertyKey: h?.propertyKey
|
|
6649
6648
|
}
|
|
6650
6649
|
)
|
|
6651
6650
|
]
|
|
@@ -6653,24 +6652,24 @@ const cr = (t, a, i, r) => {
|
|
|
6653
6652
|
) });
|
|
6654
6653
|
},
|
|
6655
6654
|
ut
|
|
6656
|
-
), Re = () =>
|
|
6655
|
+
), Re = () => Yt(ga), fa = () => Yt(ha);
|
|
6657
6656
|
function mr({
|
|
6658
6657
|
path: t,
|
|
6659
6658
|
parentCollectionIds: a,
|
|
6660
6659
|
collection: i,
|
|
6661
6660
|
tableController: r
|
|
6662
6661
|
}) {
|
|
6663
|
-
const s = Ye(), o = Be(), l = Re(), p =
|
|
6662
|
+
const s = Ye(), o = Be(), l = Re(), p = fa(), m = De(), u = o.getCollectionFromIds(a), d = l.configPermissions ? l.configPermissions({
|
|
6664
6663
|
user: s.user,
|
|
6665
6664
|
collection: i
|
|
6666
6665
|
}).editCollections : !0;
|
|
6667
|
-
let
|
|
6668
|
-
return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (
|
|
6666
|
+
let c = null;
|
|
6667
|
+
return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (c = /* @__PURE__ */ e(
|
|
6669
6668
|
re,
|
|
6670
6669
|
{
|
|
6671
6670
|
title: r.sortBy || r.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
6672
6671
|
children: /* @__PURE__ */ e(
|
|
6673
|
-
|
|
6672
|
+
U,
|
|
6674
6673
|
{
|
|
6675
6674
|
color: "primary",
|
|
6676
6675
|
size: "small",
|
|
@@ -6678,7 +6677,7 @@ function mr({
|
|
|
6678
6677
|
onClick: () => p?.saveCollection({
|
|
6679
6678
|
id: i.path,
|
|
6680
6679
|
parentCollectionIds: a,
|
|
6681
|
-
collectionData:
|
|
6680
|
+
collectionData: G(
|
|
6682
6681
|
i,
|
|
6683
6682
|
{
|
|
6684
6683
|
initialFilter: r.filterValues ?? null,
|
|
@@ -6691,22 +6690,22 @@ function mr({
|
|
|
6691
6690
|
message: "Default config saved"
|
|
6692
6691
|
});
|
|
6693
6692
|
}),
|
|
6694
|
-
children: /* @__PURE__ */ e(
|
|
6693
|
+
children: /* @__PURE__ */ e(Ya, {})
|
|
6695
6694
|
}
|
|
6696
6695
|
)
|
|
6697
6696
|
}
|
|
6698
|
-
)), /* @__PURE__ */ n(
|
|
6699
|
-
|
|
6697
|
+
)), /* @__PURE__ */ n($, { children: [
|
|
6698
|
+
d && c,
|
|
6700
6699
|
/* @__PURE__ */ e(
|
|
6701
6700
|
re,
|
|
6702
6701
|
{
|
|
6703
|
-
title:
|
|
6702
|
+
title: d ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
6704
6703
|
children: /* @__PURE__ */ e(
|
|
6705
6704
|
ne,
|
|
6706
6705
|
{
|
|
6707
6706
|
color: "primary",
|
|
6708
|
-
disabled: !
|
|
6709
|
-
onClick:
|
|
6707
|
+
disabled: !d,
|
|
6708
|
+
onClick: d ? () => l?.editCollection({ path: i.path, fullPath: t, parentCollectionIds: a, parentCollection: u }) : void 0,
|
|
6710
6709
|
children: /* @__PURE__ */ e(Qe, {})
|
|
6711
6710
|
}
|
|
6712
6711
|
)
|
|
@@ -6721,12 +6720,12 @@ function ur({
|
|
|
6721
6720
|
path: t,
|
|
6722
6721
|
collection: a
|
|
6723
6722
|
}) {
|
|
6724
|
-
const i = De(), r = Ye(), s =
|
|
6723
|
+
const i = De(), r = Ye(), s = fa(), o = Re(), l = o.configPermissions({
|
|
6725
6724
|
user: r.user,
|
|
6726
6725
|
collection: a
|
|
6727
|
-
}), p =
|
|
6726
|
+
}), p = Z(() => {
|
|
6728
6727
|
o?.editCollection({ path: t, parentCollectionIds: [] });
|
|
6729
|
-
}, [o, t]), [m, u] =
|
|
6728
|
+
}, [o, t]), [m, u] = L(!1), d = Z(() => {
|
|
6730
6729
|
s?.deleteCollection({ path: t }).then(() => {
|
|
6731
6730
|
u(!1), i.open({
|
|
6732
6731
|
message: "Collection deleted",
|
|
@@ -6734,14 +6733,14 @@ function ur({
|
|
|
6734
6733
|
});
|
|
6735
6734
|
});
|
|
6736
6735
|
}, [t, s]);
|
|
6737
|
-
return /* @__PURE__ */ n(
|
|
6736
|
+
return /* @__PURE__ */ n($, { children: [
|
|
6738
6737
|
/* @__PURE__ */ n("div", { children: [
|
|
6739
6738
|
l.deleteCollections && /* @__PURE__ */ e(
|
|
6740
|
-
|
|
6739
|
+
Ga,
|
|
6741
6740
|
{
|
|
6742
|
-
trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
6743
|
-
children: /* @__PURE__ */ n(
|
|
6744
|
-
|
|
6741
|
+
trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ha, { size: "small" }) }),
|
|
6742
|
+
children: /* @__PURE__ */ n(Ja, { onClick: (c) => {
|
|
6743
|
+
c.preventDefault(), c.stopPropagation(), u(!0);
|
|
6745
6744
|
}, children: [
|
|
6746
6745
|
/* @__PURE__ */ e(pt, {}),
|
|
6747
6746
|
"Delete"
|
|
@@ -6751,7 +6750,7 @@ function ur({
|
|
|
6751
6750
|
l.editCollections && /* @__PURE__ */ e(
|
|
6752
6751
|
ne,
|
|
6753
6752
|
{
|
|
6754
|
-
onClick: (
|
|
6753
|
+
onClick: (c) => {
|
|
6755
6754
|
p();
|
|
6756
6755
|
},
|
|
6757
6756
|
children: /* @__PURE__ */ e(Qe, { size: "small" })
|
|
@@ -6762,10 +6761,10 @@ function ur({
|
|
|
6762
6761
|
mt,
|
|
6763
6762
|
{
|
|
6764
6763
|
open: m,
|
|
6765
|
-
onAccept:
|
|
6764
|
+
onAccept: d,
|
|
6766
6765
|
onCancel: () => u(!1),
|
|
6767
|
-
title: /* @__PURE__ */ e(
|
|
6768
|
-
body: /* @__PURE__ */ n(
|
|
6766
|
+
title: /* @__PURE__ */ e($, { children: "Delete this collection?" }),
|
|
6767
|
+
body: /* @__PURE__ */ n($, { children: [
|
|
6769
6768
|
" This will ",
|
|
6770
6769
|
/* @__PURE__ */ e("b", { children: "not delete any data" }),
|
|
6771
6770
|
", only the collection in the CMS"
|
|
@@ -6786,7 +6785,7 @@ function hr({
|
|
|
6786
6785
|
return /* @__PURE__ */ e(
|
|
6787
6786
|
ta,
|
|
6788
6787
|
{
|
|
6789
|
-
className:
|
|
6788
|
+
className: xe("h-full p-4 min-h-[124px]"),
|
|
6790
6789
|
onClick: r && s ? () => r.createCollection({
|
|
6791
6790
|
initialValues: t ? { group: t } : void 0,
|
|
6792
6791
|
parentCollectionIds: [],
|
|
@@ -6819,7 +6818,7 @@ function gr() {
|
|
|
6819
6818
|
user: t.user
|
|
6820
6819
|
}).createCollections : !0, s = i.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
|
|
6821
6820
|
return /* @__PURE__ */ e(
|
|
6822
|
-
|
|
6821
|
+
Qa,
|
|
6823
6822
|
{
|
|
6824
6823
|
in: o,
|
|
6825
6824
|
children: /* @__PURE__ */ n(
|
|
@@ -6838,7 +6837,7 @@ function gr() {
|
|
|
6838
6837
|
icon: /* @__PURE__ */ e(Ae, { size: "small" }),
|
|
6839
6838
|
colorScheme: "cyanLighter",
|
|
6840
6839
|
onClick: i && r ? () => i.createCollection({
|
|
6841
|
-
initialValues: { path: l, name:
|
|
6840
|
+
initialValues: { path: l, name: Pt(l) },
|
|
6842
6841
|
parentCollectionIds: [],
|
|
6843
6842
|
redirect: !0
|
|
6844
6843
|
}) : void 0,
|
|
@@ -6898,7 +6897,7 @@ function br({
|
|
|
6898
6897
|
s.editProperty({
|
|
6899
6898
|
editedCollectionPath: t,
|
|
6900
6899
|
parentCollectionIds: a,
|
|
6901
|
-
currentPropertiesOrder:
|
|
6900
|
+
currentPropertiesOrder: Wa(i),
|
|
6902
6901
|
collection: i
|
|
6903
6902
|
});
|
|
6904
6903
|
},
|
|
@@ -6915,14 +6914,15 @@ function Ar({
|
|
|
6915
6914
|
pathSuggestions: o,
|
|
6916
6915
|
getUser: l,
|
|
6917
6916
|
collectionInference: p,
|
|
6918
|
-
getData: m
|
|
6917
|
+
getData: m,
|
|
6918
|
+
onAnalyticsEvent: u
|
|
6919
6919
|
}) {
|
|
6920
|
-
const
|
|
6920
|
+
const d = Z(
|
|
6921
6921
|
(c) => {
|
|
6922
|
-
const
|
|
6923
|
-
et(
|
|
6924
|
-
},
|
|
6925
|
-
return
|
|
6922
|
+
const y = (b) => {
|
|
6923
|
+
et(b.properties), b.subcollections?.forEach(y);
|
|
6924
|
+
}, g = t.collections ?? [];
|
|
6925
|
+
return g.forEach(y), Za(c, g, [], a);
|
|
6926
6926
|
},
|
|
6927
6927
|
[t.collections, a]
|
|
6928
6928
|
);
|
|
@@ -6930,7 +6930,7 @@ function Ar({
|
|
|
6930
6930
|
name: "Collection Editor",
|
|
6931
6931
|
loading: t.loading,
|
|
6932
6932
|
collections: {
|
|
6933
|
-
injectCollections:
|
|
6933
|
+
injectCollections: d,
|
|
6934
6934
|
CollectionActions: mr
|
|
6935
6935
|
},
|
|
6936
6936
|
provider: {
|
|
@@ -6943,7 +6943,8 @@ function Ar({
|
|
|
6943
6943
|
extraView: s,
|
|
6944
6944
|
pathSuggestions: o,
|
|
6945
6945
|
getUser: l,
|
|
6946
|
-
getData: m
|
|
6946
|
+
getData: m,
|
|
6947
|
+
onAnalyticsEvent: u
|
|
6947
6948
|
}
|
|
6948
6949
|
},
|
|
6949
6950
|
homePage: {
|
|
@@ -6962,14 +6963,14 @@ function zr({ path: t }) {
|
|
|
6962
6963
|
return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
|
|
6963
6964
|
/* @__PURE__ */ e(aa, { error: "No collection for path: " + i }),
|
|
6964
6965
|
/* @__PURE__ */ e(
|
|
6965
|
-
|
|
6966
|
+
U,
|
|
6966
6967
|
{
|
|
6967
6968
|
className: "mx-2",
|
|
6968
6969
|
variant: "outlined",
|
|
6969
6970
|
size: "small",
|
|
6970
6971
|
onClick: () => {
|
|
6971
6972
|
s.createCollection({
|
|
6972
|
-
initialValues: { path: i, name:
|
|
6973
|
+
initialValues: { path: i, name: Pt(i) },
|
|
6973
6974
|
parentCollectionIds: r,
|
|
6974
6975
|
redirect: !1
|
|
6975
6976
|
});
|
|
@@ -6987,12 +6988,12 @@ export {
|
|
|
6987
6988
|
zr as MissingReferenceWidget,
|
|
6988
6989
|
Je as editableProperty,
|
|
6989
6990
|
ce as getFullId,
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6991
|
+
ke as idToPropertiesPath,
|
|
6992
|
+
Pe as namespaceToPropertiesOrderPath,
|
|
6993
|
+
ki as namespaceToPropertiesPath,
|
|
6994
|
+
qi as removeNonEditableProperties,
|
|
6994
6995
|
Re as useCollectionEditorController,
|
|
6995
6996
|
Ar as useCollectionEditorPlugin,
|
|
6996
|
-
|
|
6997
|
+
fa as useCollectionsConfigController
|
|
6997
6998
|
};
|
|
6998
6999
|
//# sourceMappingURL=index.es.js.map
|