@firecms/collection_editor 3.0.0-alpha.45 → 3.0.0-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as D, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as _e from "react";
|
|
3
3
|
import U, { useState as K, useCallback as J, useEffect as pe, useMemo as $t, useRef as Ge, useDeferredValue as ha, useContext as Lt } from "react";
|
|
4
|
-
import { iconKeys as Kt, debounce as ga, SearchBar as fa, Tooltip as
|
|
4
|
+
import { iconKeys as Kt, debounce as ga, SearchBar as fa, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as kt, Typography as C, getIconForView as ct, useAutoComplete as ba, Container as ht, Chip as dt, TextField as Te, cn as xe, DebouncedTextField as H, Autocomplete as ya, AutocompleteItem as va, ExpandablePanel as Ct, SettingsIcon as Je, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Yt, Dialog as Fe, toSnakeCase as Gt, singular as wa, ListIcon as _a, Button as E, CircularProgress as Qe, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as ka, DialogContent as Be, DialogActions as Me, SwitchControl as he, serializeRegExp as xa, isValidRegExp as Ca, RuleIcon as Oa, useSnackbarController as Re, resolveEnumValues as Pa, FileUploadIcon as Na, MultiSelect as Sa, MultiSelectItem as At, Checkbox as zt, isPropertyBuilder as oe, useFireCMSContext as Ue, getFieldConfig as We, ErrorBoundary as Pe, FieldConfigBadge as Ze, cardMixin as Ht, cardClickableMixin as Jt, cardSelectedMixin as Qt, FunctionsIcon as qa, RemoveCircleIcon as Aa, defaultBorderMixin as Ot, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ae, useNavigationController as $e, SelectGroup as Tt, mergeDeep as Y, getFieldId as Wt, DEFAULT_FIELD_CONFIGS as xt, InfoLabel as Zt, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as Va, useLargeLayout as Ia, CodeIcon as Fa, makePropertiesEditable as Xe, resolveEntityView as ja, Table as Vt, TableBody as It, TableRow as yt, TableCell as Ye, unslugify as Pt, Card as Xt, useSelectionController as Ea, EntityCollectionTable as Da, slugify as Ba, useAuthController as Le, CircularProgressCenter as Ft, Tabs as Ma, Tab as vt, removeUndefined as Ra, ErrorView as ea, ArrowBackIcon as ot, LoadingButton as jt, DoneIcon as Ua, SaveIcon as $a, Menu as La, MoreVertIcon as Ka, MenuItem as Ya, Collapse as Ga, getDefaultPropertiesOrder as Ha, joinCollectionLists as Ja } from "@firecms/core";
|
|
5
5
|
import ut from "react-fast-compare";
|
|
6
|
-
import { useFormikContext as $, Field as ye, getIn as P, Formik as Nt, FastField as
|
|
6
|
+
import { useFormikContext as $, Field as ye, getIn as P, Formik as Nt, FastField as ce, Form as Qa } from "formik";
|
|
7
7
|
import * as wt 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 Wa from "js-search";
|
|
9
|
+
import { extractEnumFromValues as Za, buildPropertyFromData as Xa, buildEntityPropertiesFromData as ei } from "@firecms/schema_inference";
|
|
10
|
+
import { DragDropContext as ti, Droppable as ai, Draggable as ii } from "@hello-pangea/dnd";
|
|
11
|
+
import ri from "json5";
|
|
12
|
+
import { Highlight as oi, themes as ni } from "prism-react-renderer";
|
|
13
|
+
import { ImportFileUpload as si, DataNewPropertiesMapping as li, ImportNewPropertyFieldPreview as ci, getInferenceType as ta, getPropertiesMapping as di, convertDataToEntity as pi, useImportConfig as mi, ImportSaveInProgress as ui } from "@firecms/data_import_export";
|
|
14
|
+
import { useNavigate as hi } from "react-router";
|
|
15
|
+
const gi = wt.object().shape({
|
|
16
16
|
name: wt.string().required("Required"),
|
|
17
17
|
path: wt.string().required("Required")
|
|
18
18
|
}), aa = {
|
|
@@ -1964,18 +1964,18 @@ const hi = wt.object().shape({
|
|
|
1964
1964
|
zoom_in_map: "arrows destination location maps move place stop",
|
|
1965
1965
|
zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
|
|
1966
1966
|
zoom_out_map: "arrows destination location maps move place stop"
|
|
1967
|
-
}, St = new
|
|
1967
|
+
}, St = new Wa.Search("key");
|
|
1968
1968
|
St.addIndex("synonyms");
|
|
1969
1969
|
St.addDocuments(Kt.map((t) => ({
|
|
1970
1970
|
key: t,
|
|
1971
1971
|
// @ts-ignore
|
|
1972
1972
|
synonyms: aa[t] ?? []
|
|
1973
1973
|
})));
|
|
1974
|
-
const
|
|
1974
|
+
const fi = 220;
|
|
1975
1975
|
process.env.NODE_ENV !== "production" && Object.keys(aa).forEach((t) => {
|
|
1976
1976
|
Kt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
|
|
1977
1977
|
});
|
|
1978
|
-
function
|
|
1978
|
+
function bi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
1979
1979
|
const [i, r] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
|
|
1980
1980
|
() => ga((p) => {
|
|
1981
1981
|
if (!p || p === "")
|
|
@@ -1984,7 +1984,7 @@ function fi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
|
1984
1984
|
const u = St.search(p);
|
|
1985
1985
|
r(u.map((c) => c.key));
|
|
1986
1986
|
}
|
|
1987
|
-
},
|
|
1987
|
+
}, fi),
|
|
1988
1988
|
[]
|
|
1989
1989
|
);
|
|
1990
1990
|
return _e.useEffect(() => (l(s), () => {
|
|
@@ -1999,8 +1999,8 @@ function fi({ selectedIcon: t = "", onIconSelected: a }) {
|
|
|
1999
1999
|
placeholder: "Search for more icons…"
|
|
2000
2000
|
}
|
|
2001
2001
|
),
|
|
2002
|
-
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (i === null ? kt : i).map((p) => /* @__PURE__ */ e(
|
|
2003
|
-
|
|
2002
|
+
/* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (i === null ? kt : i).map((p) => /* @__PURE__ */ e(re, { title: p, children: /* @__PURE__ */ e(
|
|
2003
|
+
ne,
|
|
2004
2004
|
{
|
|
2005
2005
|
shape: "square",
|
|
2006
2006
|
toggled: t === p,
|
|
@@ -2017,7 +2017,7 @@ function ie({
|
|
|
2017
2017
|
}) {
|
|
2018
2018
|
return a ? /* @__PURE__ */ e(C, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2020
|
+
function yi({
|
|
2021
2021
|
isNewCollection: t,
|
|
2022
2022
|
reservedGroups: a,
|
|
2023
2023
|
existingPaths: i,
|
|
@@ -2060,8 +2060,8 @@ function bi({
|
|
|
2060
2060
|
className: "flex flex-row py-2 pt-3 items-center",
|
|
2061
2061
|
children: [
|
|
2062
2062
|
/* @__PURE__ */ e(C, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${d?.name} collection` }),
|
|
2063
|
-
/* @__PURE__ */ e(
|
|
2064
|
-
|
|
2063
|
+
/* @__PURE__ */ e(re, { title: "Change icon", children: /* @__PURE__ */ e(
|
|
2064
|
+
ne,
|
|
2065
2065
|
{
|
|
2066
2066
|
shape: "square",
|
|
2067
2067
|
onClick: () => k(!0),
|
|
@@ -2263,7 +2263,7 @@ function bi({
|
|
|
2263
2263
|
maxWidth: "xl",
|
|
2264
2264
|
fullWidth: !0,
|
|
2265
2265
|
children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
|
|
2266
|
-
|
|
2266
|
+
bi,
|
|
2267
2267
|
{
|
|
2268
2268
|
selectedIcon: d.icon,
|
|
2269
2269
|
onIconSelected: (f) => {
|
|
@@ -2278,16 +2278,16 @@ function bi({
|
|
|
2278
2278
|
function ke(t) {
|
|
2279
2279
|
return "properties." + t.replaceAll(".", ".properties.");
|
|
2280
2280
|
}
|
|
2281
|
-
function
|
|
2281
|
+
function vi(t) {
|
|
2282
2282
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
|
|
2283
2283
|
}
|
|
2284
2284
|
function Ne(t) {
|
|
2285
2285
|
return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2287
|
+
function le(t, a) {
|
|
2288
2288
|
return a ? `${a}.${t}` : t;
|
|
2289
2289
|
}
|
|
2290
|
-
const
|
|
2290
|
+
const wi = U.memo(
|
|
2291
2291
|
function({
|
|
2292
2292
|
enumValues: a,
|
|
2293
2293
|
onValuesChanged: i,
|
|
@@ -2312,7 +2312,7 @@ const vi = U.memo(
|
|
|
2312
2312
|
}, [p.enumValues]), pe(() => {
|
|
2313
2313
|
r && r(!!(u?.enumValues ?? !1));
|
|
2314
2314
|
}, [u]), /* @__PURE__ */ e(
|
|
2315
|
-
|
|
2315
|
+
_i,
|
|
2316
2316
|
{
|
|
2317
2317
|
enumValuesPath: "enumValues",
|
|
2318
2318
|
values: p,
|
|
@@ -2330,7 +2330,7 @@ const vi = U.memo(
|
|
|
2330
2330
|
return a.enumValues.length === i.enumValues.length && a.onValuesChanged === i.onValuesChanged && a.getData === i.getData;
|
|
2331
2331
|
}
|
|
2332
2332
|
);
|
|
2333
|
-
function
|
|
2333
|
+
function _i({
|
|
2334
2334
|
values: t,
|
|
2335
2335
|
errors: a,
|
|
2336
2336
|
disabled: i,
|
|
@@ -2344,7 +2344,7 @@ function wi({
|
|
|
2344
2344
|
} = $(), [p, u] = U.useState(), [c, m] = U.useState(), [b, g] = U.useState(!1), O = U.useRef(/* @__PURE__ */ new Set()).current, k = (h, _) => {
|
|
2345
2345
|
const v = p === _;
|
|
2346
2346
|
return /* @__PURE__ */ e(
|
|
2347
|
-
|
|
2347
|
+
ki,
|
|
2348
2348
|
{
|
|
2349
2349
|
index: h,
|
|
2350
2350
|
disabled: i,
|
|
@@ -2379,7 +2379,7 @@ function wi({
|
|
|
2379
2379
|
l && (g(!0), l?.().then((h) => {
|
|
2380
2380
|
if (!h)
|
|
2381
2381
|
return;
|
|
2382
|
-
const _ = h.flat(), v = Array.from(new Set(_)), w = t.enumValues, I =
|
|
2382
|
+
const _ = h.flat(), v = Array.from(new Set(_)), w = t.enumValues, I = Za(v).filter((A) => !w?.some((N) => N.id === A.id));
|
|
2383
2383
|
I.forEach((A) => {
|
|
2384
2384
|
O.add(A.id);
|
|
2385
2385
|
}), d(r, [...I, ...w]);
|
|
@@ -2410,7 +2410,7 @@ function wi({
|
|
|
2410
2410
|
}
|
|
2411
2411
|
),
|
|
2412
2412
|
/* @__PURE__ */ e(
|
|
2413
|
-
|
|
2413
|
+
xi,
|
|
2414
2414
|
{
|
|
2415
2415
|
index: c,
|
|
2416
2416
|
open: c !== void 0,
|
|
@@ -2421,7 +2421,7 @@ function wi({
|
|
|
2421
2421
|
] })
|
|
2422
2422
|
] });
|
|
2423
2423
|
}
|
|
2424
|
-
const
|
|
2424
|
+
const ki = U.memo(
|
|
2425
2425
|
function({
|
|
2426
2426
|
index: a,
|
|
2427
2427
|
shouldUpdateId: i,
|
|
@@ -2442,7 +2442,7 @@ const _i = U.memo(
|
|
|
2442
2442
|
(h.current === O || !O) && y && m(`${r}[${a}].id`, k), h.current = k;
|
|
2443
2443
|
}, [k]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
|
|
2444
2444
|
/* @__PURE__ */ e(
|
|
2445
|
-
|
|
2445
|
+
ce,
|
|
2446
2446
|
{
|
|
2447
2447
|
name: `${r}[${a}].label`,
|
|
2448
2448
|
as: H,
|
|
@@ -2450,7 +2450,7 @@ const _i = U.memo(
|
|
|
2450
2450
|
required: !0,
|
|
2451
2451
|
disabled: l,
|
|
2452
2452
|
size: "small",
|
|
2453
|
-
validate:
|
|
2453
|
+
validate: Ci,
|
|
2454
2454
|
autoFocus: s,
|
|
2455
2455
|
autoComplete: "off",
|
|
2456
2456
|
endAdornment: d && /* @__PURE__ */ e(gt, { size: "small" }),
|
|
@@ -2458,7 +2458,7 @@ const _i = U.memo(
|
|
|
2458
2458
|
}
|
|
2459
2459
|
),
|
|
2460
2460
|
!l && /* @__PURE__ */ e(
|
|
2461
|
-
|
|
2461
|
+
ne,
|
|
2462
2462
|
{
|
|
2463
2463
|
size: "small",
|
|
2464
2464
|
"aria-label": "edit",
|
|
@@ -2473,7 +2473,7 @@ const _i = U.memo(
|
|
|
2473
2473
|
return a.index === i.index && a.enumValuesPath === i.enumValuesPath && a.shouldUpdateId === i.shouldUpdateId && a.inferredEntry === i.inferredEntry && a.autoFocus === i.autoFocus;
|
|
2474
2474
|
}
|
|
2475
2475
|
);
|
|
2476
|
-
function
|
|
2476
|
+
function xi({
|
|
2477
2477
|
index: t,
|
|
2478
2478
|
open: a,
|
|
2479
2479
|
onClose: i,
|
|
@@ -2496,12 +2496,12 @@ function ki({
|
|
|
2496
2496
|
children: [
|
|
2497
2497
|
/* @__PURE__ */ e(Be, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
|
|
2498
2498
|
/* @__PURE__ */ e(
|
|
2499
|
-
|
|
2499
|
+
ce,
|
|
2500
2500
|
{
|
|
2501
2501
|
name: `${r}[${t}]id`,
|
|
2502
2502
|
as: H,
|
|
2503
2503
|
required: !0,
|
|
2504
|
-
validate:
|
|
2504
|
+
validate: Oi,
|
|
2505
2505
|
label: "ID",
|
|
2506
2506
|
size: "small",
|
|
2507
2507
|
autoComplete: "off",
|
|
@@ -2524,11 +2524,11 @@ function ki({
|
|
|
2524
2524
|
}
|
|
2525
2525
|
);
|
|
2526
2526
|
}
|
|
2527
|
-
function
|
|
2527
|
+
function Ci(t) {
|
|
2528
2528
|
let a;
|
|
2529
2529
|
return t || (a = "You must specify a label"), a;
|
|
2530
2530
|
}
|
|
2531
|
-
function
|
|
2531
|
+
function Oi(t) {
|
|
2532
2532
|
let a;
|
|
2533
2533
|
return t || (a = "You must specify an ID"), a;
|
|
2534
2534
|
}
|
|
@@ -2536,7 +2536,7 @@ function je({ disabled: t }) {
|
|
|
2536
2536
|
const { values: a, handleChange: i } = $(), r = "validation.required", s = "validation.requiredMessage";
|
|
2537
2537
|
return /* @__PURE__ */ n(D, { children: [
|
|
2538
2538
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2539
|
-
|
|
2539
|
+
ce,
|
|
2540
2540
|
{
|
|
2541
2541
|
type: "checkbox",
|
|
2542
2542
|
disabled: t,
|
|
@@ -2547,7 +2547,7 @@ function je({ disabled: t }) {
|
|
|
2547
2547
|
}
|
|
2548
2548
|
) }),
|
|
2549
2549
|
/* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
|
|
2550
|
-
|
|
2550
|
+
ce,
|
|
2551
2551
|
{
|
|
2552
2552
|
type: "checkbox",
|
|
2553
2553
|
disabled: t,
|
|
@@ -2590,7 +2590,7 @@ function De({
|
|
|
2590
2590
|
/* @__PURE__ */ e(je, { disabled: d }),
|
|
2591
2591
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
|
|
2592
2592
|
a && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2593
|
-
|
|
2593
|
+
ce,
|
|
2594
2594
|
{
|
|
2595
2595
|
type: "checkbox",
|
|
2596
2596
|
name: x,
|
|
@@ -2600,7 +2600,7 @@ function De({
|
|
|
2600
2600
|
}
|
|
2601
2601
|
) }),
|
|
2602
2602
|
l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2603
|
-
|
|
2603
|
+
ce,
|
|
2604
2604
|
{
|
|
2605
2605
|
type: "checkbox",
|
|
2606
2606
|
name: h,
|
|
@@ -2610,7 +2610,7 @@ function De({
|
|
|
2610
2610
|
}
|
|
2611
2611
|
) }),
|
|
2612
2612
|
o && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
2613
|
-
|
|
2613
|
+
ce,
|
|
2614
2614
|
{
|
|
2615
2615
|
type: "checkbox",
|
|
2616
2616
|
name: O,
|
|
@@ -2660,7 +2660,7 @@ function De({
|
|
|
2660
2660
|
] }),
|
|
2661
2661
|
i && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
|
|
2662
2662
|
/* @__PURE__ */ e(
|
|
2663
|
-
|
|
2663
|
+
ce,
|
|
2664
2664
|
{
|
|
2665
2665
|
name: k,
|
|
2666
2666
|
as: H,
|
|
@@ -2755,7 +2755,7 @@ function Et({
|
|
|
2755
2755
|
} = $(), b = Re(), g = t ? "of.enumValues" : "enumValues", y = P(l, "defaultValue"), O = P(l, g), k = $t(() => !O || typeof O == "boolean" ? [] : Pa(O) ?? [], [O]);
|
|
2756
2756
|
return /* @__PURE__ */ n(D, { children: [
|
|
2757
2757
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
2758
|
-
|
|
2758
|
+
wi,
|
|
2759
2759
|
{
|
|
2760
2760
|
enumValues: k,
|
|
2761
2761
|
updateIds: a,
|
|
@@ -2940,21 +2940,21 @@ function Dt({
|
|
|
2940
2940
|
] });
|
|
2941
2941
|
}
|
|
2942
2942
|
function He(t) {
|
|
2943
|
-
if (
|
|
2943
|
+
if (oe(t) || oe(t))
|
|
2944
2944
|
return !1;
|
|
2945
2945
|
{
|
|
2946
2946
|
const a = t;
|
|
2947
2947
|
return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
|
-
function
|
|
2950
|
+
function Pi(t) {
|
|
2951
2951
|
return Object.entries(t).filter(([a, i]) => He(i)).map(([a, i]) => {
|
|
2952
2952
|
const r = i;
|
|
2953
2953
|
if (He(r))
|
|
2954
2954
|
return r.dataType === "map" && r.properties ? {
|
|
2955
2955
|
[a]: {
|
|
2956
2956
|
...r,
|
|
2957
|
-
properties:
|
|
2957
|
+
properties: Pi(r.properties)
|
|
2958
2958
|
}
|
|
2959
2959
|
} : { [a]: r };
|
|
2960
2960
|
}).filter((a) => !!a).reduce((a, i) => ({ ...a, ...i }), {});
|
|
@@ -3027,13 +3027,13 @@ function ia({
|
|
|
3027
3027
|
}
|
|
3028
3028
|
) });
|
|
3029
3029
|
}
|
|
3030
|
-
function
|
|
3030
|
+
function Ni({
|
|
3031
3031
|
name: t,
|
|
3032
3032
|
selected: a,
|
|
3033
3033
|
onClick: i,
|
|
3034
3034
|
property: r
|
|
3035
3035
|
}) {
|
|
3036
|
-
const { propertyConfigs: s } = Ue(), o = !
|
|
3036
|
+
const { propertyConfigs: s } = Ue(), o = !oe(r) && r ? We(r, s) : void 0;
|
|
3037
3037
|
return /* @__PURE__ */ n(
|
|
3038
3038
|
"div",
|
|
3039
3039
|
{
|
|
@@ -3083,7 +3083,7 @@ function Pi({
|
|
|
3083
3083
|
children: o?.name
|
|
3084
3084
|
}
|
|
3085
3085
|
),
|
|
3086
|
-
r && !
|
|
3086
|
+
r && !oe(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3087
3087
|
C,
|
|
3088
3088
|
{
|
|
3089
3089
|
variant: "body2",
|
|
@@ -3092,7 +3092,7 @@ function Pi({
|
|
|
3092
3092
|
children: r.dataType
|
|
3093
3093
|
}
|
|
3094
3094
|
) }),
|
|
3095
|
-
r &&
|
|
3095
|
+
r && oe(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3096
3096
|
C,
|
|
3097
3097
|
{
|
|
3098
3098
|
variant: "body2",
|
|
@@ -3138,7 +3138,7 @@ function ft({
|
|
|
3138
3138
|
const O = y.source.index, k = y.destination.index, x = Array.from(b), [h] = x.splice(O, 1);
|
|
3139
3139
|
x.splice(k, 0, h), d && d(x, t);
|
|
3140
3140
|
}, [t, d, b]);
|
|
3141
|
-
return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
|
|
3141
|
+
return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(ti, { onDragEnd: g, children: /* @__PURE__ */ e(ai, { droppableId: `droppable_${t}`, children: (y, O) => /* @__PURE__ */ n(
|
|
3142
3142
|
"div",
|
|
3143
3143
|
{
|
|
3144
3144
|
...y.droppableProps,
|
|
@@ -3148,12 +3148,12 @@ function ft({
|
|
|
3148
3148
|
b && b.map((k, x) => {
|
|
3149
3149
|
const h = r[k], _ = o?.find((v) => v.key === k);
|
|
3150
3150
|
return !h && !_ ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
|
|
3151
|
-
|
|
3151
|
+
ii,
|
|
3152
3152
|
{
|
|
3153
3153
|
draggableId: `array_field_${t}_${k}}`,
|
|
3154
3154
|
index: x,
|
|
3155
3155
|
children: (v, w) => /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
|
|
3156
|
-
|
|
3156
|
+
Si,
|
|
3157
3157
|
{
|
|
3158
3158
|
propertyKey: k,
|
|
3159
3159
|
propertyOrBuilder: h,
|
|
@@ -3178,7 +3178,7 @@ function ft({
|
|
|
3178
3178
|
}
|
|
3179
3179
|
) }) }) });
|
|
3180
3180
|
}
|
|
3181
|
-
function
|
|
3181
|
+
function Si({
|
|
3182
3182
|
propertyKey: t,
|
|
3183
3183
|
namespace: a,
|
|
3184
3184
|
propertyOrBuilder: i,
|
|
@@ -3192,7 +3192,7 @@ function Ni({
|
|
|
3192
3192
|
inferredPropertyKeys: c,
|
|
3193
3193
|
collectionEditable: m
|
|
3194
3194
|
}) {
|
|
3195
|
-
const b = c?.includes(a ? `${a}.${t}` : t), g =
|
|
3195
|
+
const b = c?.includes(a ? `${a}.${t}` : t), g = le(t, a);
|
|
3196
3196
|
let y;
|
|
3197
3197
|
if (typeof i == "object") {
|
|
3198
3198
|
const h = i;
|
|
@@ -3211,7 +3211,7 @@ function Ni({
|
|
|
3211
3211
|
}
|
|
3212
3212
|
));
|
|
3213
3213
|
}
|
|
3214
|
-
const O = g ? P(l, ke(g)) : !1, k = o === g, x = i && (m && !
|
|
3214
|
+
const O = g ? P(l, ke(g)) : !1, k = o === g, x = i && (m && !oe(i) || He(i));
|
|
3215
3215
|
return /* @__PURE__ */ n(
|
|
3216
3216
|
"div",
|
|
3217
3217
|
{
|
|
@@ -3231,7 +3231,7 @@ function Ni({
|
|
|
3231
3231
|
}
|
|
3232
3232
|
}
|
|
3233
3233
|
),
|
|
3234
|
-
!
|
|
3234
|
+
!oe(i) && !r && x ? /* @__PURE__ */ e(
|
|
3235
3235
|
ia,
|
|
3236
3236
|
{
|
|
3237
3237
|
property: i,
|
|
@@ -3241,7 +3241,7 @@ function Ni({
|
|
|
3241
3241
|
hasError: O
|
|
3242
3242
|
}
|
|
3243
3243
|
) : /* @__PURE__ */ e(
|
|
3244
|
-
|
|
3244
|
+
Ni,
|
|
3245
3245
|
{
|
|
3246
3246
|
name: t,
|
|
3247
3247
|
property: i,
|
|
@@ -3250,9 +3250,9 @@ function Ni({
|
|
|
3250
3250
|
}
|
|
3251
3251
|
),
|
|
3252
3252
|
/* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
|
|
3253
|
-
b && /* @__PURE__ */ e(
|
|
3254
|
-
u && /* @__PURE__ */ e(
|
|
3255
|
-
|
|
3253
|
+
b && /* @__PURE__ */ e(re, { title: "Inferred property", children: /* @__PURE__ */ e(gt, { size: "small", className: "p-2" }) }),
|
|
3254
|
+
u && /* @__PURE__ */ e(re, { title: "Remove", children: /* @__PURE__ */ e(
|
|
3255
|
+
ne,
|
|
3256
3256
|
{
|
|
3257
3257
|
size: "small",
|
|
3258
3258
|
color: "inherit",
|
|
@@ -3260,8 +3260,8 @@ function Ni({
|
|
|
3260
3260
|
children: /* @__PURE__ */ e(za, { size: "small" })
|
|
3261
3261
|
}
|
|
3262
3262
|
) }),
|
|
3263
|
-
p && /* @__PURE__ */ e(
|
|
3264
|
-
|
|
3263
|
+
p && /* @__PURE__ */ e(re, { title: "Move", children: /* @__PURE__ */ e(
|
|
3264
|
+
ne,
|
|
3265
3265
|
{
|
|
3266
3266
|
component: "span",
|
|
3267
3267
|
size: "small",
|
|
@@ -3274,7 +3274,7 @@ function Ni({
|
|
|
3274
3274
|
}
|
|
3275
3275
|
);
|
|
3276
3276
|
}
|
|
3277
|
-
function
|
|
3277
|
+
function qi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
|
|
3278
3278
|
const {
|
|
3279
3279
|
values: o,
|
|
3280
3280
|
setFieldValue: l
|
|
@@ -3289,12 +3289,12 @@ function Si({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3289
3289
|
[w]: V
|
|
3290
3290
|
}, !1), l("propertiesOrder", [...g, w], !1), p(!1);
|
|
3291
3291
|
}, [o.properties, g]), O = J((w, V) => {
|
|
3292
|
-
const I = w ?
|
|
3292
|
+
const I = w ? le(w, V) : void 0;
|
|
3293
3293
|
if (!I)
|
|
3294
3294
|
throw Error("collection editor miss config");
|
|
3295
|
-
const A = ke(I), N = Ne(V), F = P(o, N) ?? Object.keys(P(o,
|
|
3295
|
+
const A = ke(I), N = Ne(V), F = P(o, N) ?? Object.keys(P(o, vi(V)));
|
|
3296
3296
|
l(A, void 0, !1), l(N, F.filter((f) => f !== w), !1), p(!1), c(void 0), b(void 0);
|
|
3297
|
-
}, [l, o]), k = u ?
|
|
3297
|
+
}, [l, o]), k = u ? le(u, m) : void 0, x = k ? P(o.properties, k.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
|
|
3298
3298
|
E,
|
|
3299
3299
|
{
|
|
3300
3300
|
color: "primary",
|
|
@@ -3381,7 +3381,7 @@ function Si({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3381
3381
|
)
|
|
3382
3382
|
] });
|
|
3383
3383
|
}
|
|
3384
|
-
function
|
|
3384
|
+
function Ai({
|
|
3385
3385
|
showErrors: t,
|
|
3386
3386
|
existing: a,
|
|
3387
3387
|
disabled: i,
|
|
@@ -3459,7 +3459,7 @@ function qi({
|
|
|
3459
3459
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(qt, { disabled: i }) }) })
|
|
3460
3460
|
] });
|
|
3461
3461
|
}
|
|
3462
|
-
const
|
|
3462
|
+
const zi = U.forwardRef(
|
|
3463
3463
|
function({
|
|
3464
3464
|
showErrors: a,
|
|
3465
3465
|
disabledId: i,
|
|
@@ -3479,7 +3479,7 @@ const Ai = U.forwardRef(
|
|
|
3479
3479
|
name: p,
|
|
3480
3480
|
as: H,
|
|
3481
3481
|
style: { fontSize: 20 },
|
|
3482
|
-
validate:
|
|
3482
|
+
validate: Ii,
|
|
3483
3483
|
placeholder: "Field name",
|
|
3484
3484
|
required: !0,
|
|
3485
3485
|
disabled: s,
|
|
@@ -3495,7 +3495,7 @@ const Ai = U.forwardRef(
|
|
|
3495
3495
|
name: c,
|
|
3496
3496
|
as: Te,
|
|
3497
3497
|
label: "ID",
|
|
3498
|
-
validate: (y) =>
|
|
3498
|
+
validate: (y) => Vi(y, r),
|
|
3499
3499
|
disabled: i || s,
|
|
3500
3500
|
required: !0,
|
|
3501
3501
|
size: "small",
|
|
@@ -3519,16 +3519,16 @@ const Ai = U.forwardRef(
|
|
|
3519
3519
|
] })
|
|
3520
3520
|
] });
|
|
3521
3521
|
}
|
|
3522
|
-
),
|
|
3523
|
-
function
|
|
3522
|
+
), Ti = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
3523
|
+
function Vi(t, a) {
|
|
3524
3524
|
let i;
|
|
3525
|
-
return t || (i = "You must specify an id for the field"), t && !t.match(
|
|
3525
|
+
return t || (i = "You must specify an id for the field"), t && !t.match(Ti) && (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;
|
|
3526
3526
|
}
|
|
3527
|
-
function
|
|
3527
|
+
function Ii(t) {
|
|
3528
3528
|
let a;
|
|
3529
3529
|
return t || (a = "You must specify a title for the field"), a;
|
|
3530
3530
|
}
|
|
3531
|
-
function
|
|
3531
|
+
function Fi({
|
|
3532
3532
|
widgetId: t,
|
|
3533
3533
|
disabled: a,
|
|
3534
3534
|
showErrors: i
|
|
@@ -3601,12 +3601,12 @@ function Ii({
|
|
|
3601
3601
|
) })
|
|
3602
3602
|
] });
|
|
3603
3603
|
}
|
|
3604
|
-
function
|
|
3604
|
+
function ji({ disabled: t }) {
|
|
3605
3605
|
const { values: a } = $(), i = P(a, "defaultValue");
|
|
3606
3606
|
return /* @__PURE__ */ n(D, { children: [
|
|
3607
3607
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }),
|
|
3608
3608
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3609
|
-
|
|
3609
|
+
ce,
|
|
3610
3610
|
{
|
|
3611
3611
|
type: "checkbox",
|
|
3612
3612
|
name: "defaultValue",
|
|
@@ -3618,7 +3618,7 @@ function Fi({ disabled: t }) {
|
|
|
3618
3618
|
) })
|
|
3619
3619
|
] });
|
|
3620
3620
|
}
|
|
3621
|
-
function
|
|
3621
|
+
function Ei({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r, collectionEditable: s }) {
|
|
3622
3622
|
const {
|
|
3623
3623
|
values: o,
|
|
3624
3624
|
setFieldValue: l
|
|
@@ -3632,8 +3632,8 @@ function ji({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3632
3632
|
...o.oneOf?.properties ?? {},
|
|
3633
3633
|
[_]: v
|
|
3634
3634
|
}, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), _], !1), p(!1);
|
|
3635
|
-
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ?
|
|
3636
|
-
const w = _ ?
|
|
3635
|
+
}, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? le(u, m) : void 0, O = y ? P(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, k = J((_, v) => {
|
|
3636
|
+
const w = _ ? le(_, v) : void 0;
|
|
3637
3637
|
if (!w)
|
|
3638
3638
|
throw Error("collection editor miss config");
|
|
3639
3639
|
l(`oneOf.${ke(w)}`, void 0, !1);
|
|
@@ -3706,7 +3706,7 @@ function ji({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
|
|
|
3706
3706
|
)
|
|
3707
3707
|
] });
|
|
3708
3708
|
}
|
|
3709
|
-
function
|
|
3709
|
+
function Di({ disabled: t }) {
|
|
3710
3710
|
const {
|
|
3711
3711
|
values: a,
|
|
3712
3712
|
handleChange: i
|
|
@@ -3762,7 +3762,7 @@ function Ei({ disabled: t }) {
|
|
|
3762
3762
|
}
|
|
3763
3763
|
) }),
|
|
3764
3764
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3765
|
-
|
|
3765
|
+
ce,
|
|
3766
3766
|
{
|
|
3767
3767
|
type: "checkbox",
|
|
3768
3768
|
name: d,
|
|
@@ -3772,7 +3772,7 @@ function Ei({ disabled: t }) {
|
|
|
3772
3772
|
}
|
|
3773
3773
|
) }),
|
|
3774
3774
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3775
|
-
|
|
3775
|
+
ce,
|
|
3776
3776
|
{
|
|
3777
3777
|
type: "checkbox",
|
|
3778
3778
|
name: p,
|
|
@@ -3782,7 +3782,7 @@ function Ei({ disabled: t }) {
|
|
|
3782
3782
|
}
|
|
3783
3783
|
) }),
|
|
3784
3784
|
/* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
|
|
3785
|
-
|
|
3785
|
+
ce,
|
|
3786
3786
|
{
|
|
3787
3787
|
type: "checkbox",
|
|
3788
3788
|
name: u,
|
|
@@ -3793,10 +3793,10 @@ function Ei({ disabled: t }) {
|
|
|
3793
3793
|
) })
|
|
3794
3794
|
] });
|
|
3795
3795
|
}
|
|
3796
|
-
function
|
|
3796
|
+
function Bi({ disabled: t }) {
|
|
3797
3797
|
const { values: a, setFieldValue: i } = $();
|
|
3798
3798
|
return /* @__PURE__ */ n(D, { children: [
|
|
3799
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
|
|
3799
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Di, { disabled: t }) }) }),
|
|
3800
3800
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
3801
3801
|
Te,
|
|
3802
3802
|
{
|
|
@@ -3836,20 +3836,20 @@ function Bt({
|
|
|
3836
3836
|
name: m,
|
|
3837
3837
|
pathPath: m,
|
|
3838
3838
|
type: "select",
|
|
3839
|
-
validate:
|
|
3839
|
+
validate: Mi,
|
|
3840
3840
|
disabled: t || i,
|
|
3841
3841
|
value: b,
|
|
3842
3842
|
error: g,
|
|
3843
3843
|
handleChange: o,
|
|
3844
|
-
component:
|
|
3844
|
+
component: Ri
|
|
3845
3845
|
}
|
|
3846
3846
|
) }) });
|
|
3847
3847
|
}
|
|
3848
|
-
function
|
|
3848
|
+
function Mi(t) {
|
|
3849
3849
|
let a;
|
|
3850
3850
|
return t || (a = "You must specify a target collection for the field"), a;
|
|
3851
3851
|
}
|
|
3852
|
-
function
|
|
3852
|
+
function Ri({
|
|
3853
3853
|
disabled: t,
|
|
3854
3854
|
pathPath: a,
|
|
3855
3855
|
value: i,
|
|
@@ -3949,7 +3949,7 @@ function Mi({
|
|
|
3949
3949
|
/* @__PURE__ */ e(ie, { children: "You can only edit the reference collection upon field creation." })
|
|
3950
3950
|
] });
|
|
3951
3951
|
}
|
|
3952
|
-
function
|
|
3952
|
+
function Ui({ disabled: t }) {
|
|
3953
3953
|
const {
|
|
3954
3954
|
values: a,
|
|
3955
3955
|
errors: i,
|
|
@@ -4015,10 +4015,10 @@ function Ri({ disabled: t }) {
|
|
|
4015
4015
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(je, { disabled: t }) }) })
|
|
4016
4016
|
] });
|
|
4017
4017
|
}
|
|
4018
|
-
function
|
|
4018
|
+
function $i({ disabled: t }) {
|
|
4019
4019
|
return $(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
|
|
4020
4020
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4021
|
-
|
|
4021
|
+
ce,
|
|
4022
4022
|
{
|
|
4023
4023
|
type: "checkbox",
|
|
4024
4024
|
name: "hideFromCollection",
|
|
@@ -4029,7 +4029,7 @@ function Ui({ disabled: t }) {
|
|
|
4029
4029
|
}
|
|
4030
4030
|
) }),
|
|
4031
4031
|
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4032
|
-
|
|
4032
|
+
ce,
|
|
4033
4033
|
{
|
|
4034
4034
|
type: "checkbox",
|
|
4035
4035
|
name: "readOnly",
|
|
@@ -4041,7 +4041,7 @@ function Ui({ disabled: t }) {
|
|
|
4041
4041
|
) })
|
|
4042
4042
|
] });
|
|
4043
4043
|
}
|
|
4044
|
-
function
|
|
4044
|
+
function Li({ disabled: t }) {
|
|
4045
4045
|
return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(je, { disabled: t }) }) }) });
|
|
4046
4046
|
}
|
|
4047
4047
|
function ra(t, a, i) {
|
|
@@ -4290,7 +4290,7 @@ function oa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
|
|
|
4290
4290
|
}
|
|
4291
4291
|
);
|
|
4292
4292
|
}
|
|
4293
|
-
function
|
|
4293
|
+
function Ki({
|
|
4294
4294
|
disabled: t,
|
|
4295
4295
|
showErrors: a
|
|
4296
4296
|
}) {
|
|
@@ -4411,7 +4411,7 @@ const na = U.memo(
|
|
|
4411
4411
|
children: (N) => (pe(() => {
|
|
4412
4412
|
x?.(N);
|
|
4413
4413
|
}, [N]), /* @__PURE__ */ e(
|
|
4414
|
-
|
|
4414
|
+
Yi,
|
|
4415
4415
|
{
|
|
4416
4416
|
onPropertyChanged: c ? A : void 0,
|
|
4417
4417
|
onDelete: m,
|
|
@@ -4495,7 +4495,7 @@ function Ie({
|
|
|
4495
4495
|
}
|
|
4496
4496
|
);
|
|
4497
4497
|
}
|
|
4498
|
-
function
|
|
4498
|
+
function Yi({
|
|
4499
4499
|
values: t,
|
|
4500
4500
|
errors: a,
|
|
4501
4501
|
touched: i,
|
|
@@ -4518,7 +4518,7 @@ function Ki({
|
|
|
4518
4518
|
propertyConfigs: _,
|
|
4519
4519
|
collectionEditable: v
|
|
4520
4520
|
}) {
|
|
4521
|
-
const [w, V] = K(d), [I, A] = K(!1), [N, F] = K(t?.dataType ? Wt(t) : void 0), f = Object.entries(xt).concat(Object.entries(_)), z = O ? f.filter(([W, ae]) => !
|
|
4521
|
+
const [w, V] = K(d), [I, A] = K(!1), [N, F] = K(t?.dataType ? Wt(t) : void 0), f = Object.entries(xt).concat(Object.entries(_)), z = O ? f.filter(([W, ae]) => !oe(ae.property) && ae.property?.dataType !== "array") : f, Q = ha(t), S = Ge(null), B = Ge(t), ge = "id", Ce = g && P(a, "selectedWidget");
|
|
4522
4522
|
pe(() => {
|
|
4523
4523
|
!P(i, ge) && l && t?.name && s(ge, Gt(t.name));
|
|
4524
4524
|
}, [l, i, t?.name]), pe(() => {
|
|
@@ -4527,11 +4527,11 @@ function Ki({
|
|
|
4527
4527
|
id: W,
|
|
4528
4528
|
...ae
|
|
4529
4529
|
} = Q;
|
|
4530
|
-
ut(Q,
|
|
4530
|
+
ut(Q, B.current) || (u({
|
|
4531
4531
|
id: W,
|
|
4532
4532
|
property: ae,
|
|
4533
4533
|
namespace: m
|
|
4534
|
-
}),
|
|
4534
|
+
}), B.current = Q);
|
|
4535
4535
|
}
|
|
4536
4536
|
}, [Q, p, u, m]), pe(() => {
|
|
4537
4537
|
t?.id && b && Object.keys(a).length > 0 && b(t?.id, m, a);
|
|
@@ -4543,14 +4543,14 @@ function Ki({
|
|
|
4543
4543
|
};
|
|
4544
4544
|
let R;
|
|
4545
4545
|
return N === "text_field" || N === "multiline" || N === "markdown" || N === "email" ? R = /* @__PURE__ */ e(
|
|
4546
|
-
|
|
4546
|
+
Fi,
|
|
4547
4547
|
{
|
|
4548
4548
|
widgetId: N,
|
|
4549
4549
|
disabled: y,
|
|
4550
4550
|
showErrors: g
|
|
4551
4551
|
}
|
|
4552
4552
|
) : N === "url" ? R = /* @__PURE__ */ e(
|
|
4553
|
-
|
|
4553
|
+
Ki,
|
|
4554
4554
|
{
|
|
4555
4555
|
disabled: y,
|
|
4556
4556
|
showErrors: g
|
|
@@ -4589,8 +4589,8 @@ function Ki({
|
|
|
4589
4589
|
multiple: !0,
|
|
4590
4590
|
disabled: y
|
|
4591
4591
|
}
|
|
4592
|
-
) : N === "switch" ? R = /* @__PURE__ */ e(
|
|
4593
|
-
|
|
4592
|
+
) : N === "switch" ? R = /* @__PURE__ */ e(ji, { disabled: y }) : N === "number_input" ? R = /* @__PURE__ */ e(Bi, { disabled: y }) : N === "group" ? R = /* @__PURE__ */ e(
|
|
4593
|
+
qi,
|
|
4594
4594
|
{
|
|
4595
4595
|
disabled: y,
|
|
4596
4596
|
getData: x,
|
|
@@ -4599,7 +4599,7 @@ function Ki({
|
|
|
4599
4599
|
propertyConfigs: _
|
|
4600
4600
|
}
|
|
4601
4601
|
) : N === "block" ? R = /* @__PURE__ */ e(
|
|
4602
|
-
|
|
4602
|
+
Ei,
|
|
4603
4603
|
{
|
|
4604
4604
|
disabled: y,
|
|
4605
4605
|
getData: x,
|
|
@@ -4615,7 +4615,7 @@ function Ki({
|
|
|
4615
4615
|
multiple: !1,
|
|
4616
4616
|
disabled: y
|
|
4617
4617
|
}
|
|
4618
|
-
) : N === "date_time" ? R = /* @__PURE__ */ e(
|
|
4618
|
+
) : N === "date_time" ? R = /* @__PURE__ */ e(Ui, { disabled: y }) : N === "multi_references" ? R = /* @__PURE__ */ e(
|
|
4619
4619
|
Bt,
|
|
4620
4620
|
{
|
|
4621
4621
|
showErrors: g,
|
|
@@ -4624,7 +4624,7 @@ function Ki({
|
|
|
4624
4624
|
disabled: y
|
|
4625
4625
|
}
|
|
4626
4626
|
) : N === "repeat" ? R = /* @__PURE__ */ e(
|
|
4627
|
-
|
|
4627
|
+
Ai,
|
|
4628
4628
|
{
|
|
4629
4629
|
showErrors: g,
|
|
4630
4630
|
existing: o,
|
|
@@ -4634,7 +4634,7 @@ function Ki({
|
|
|
4634
4634
|
collectionEditable: v,
|
|
4635
4635
|
propertyConfigs: _
|
|
4636
4636
|
}
|
|
4637
|
-
) : N === "key_value" ? R = /* @__PURE__ */ e(
|
|
4637
|
+
) : N === "key_value" ? R = /* @__PURE__ */ e(Li, { disabled: y }) : R = null, /* @__PURE__ */ n(D, { children: [
|
|
4638
4638
|
y && /* @__PURE__ */ n(Zt, { mode: "warn", children: [
|
|
4639
4639
|
/* @__PURE__ */ e(C, { children: "This property can't be edited" }),
|
|
4640
4640
|
/* @__PURE__ */ n(C, { variant: "caption", children: [
|
|
@@ -4658,7 +4658,7 @@ function Ki({
|
|
|
4658
4658
|
renderValue: (W) => {
|
|
4659
4659
|
if (!W)
|
|
4660
4660
|
return /* @__PURE__ */ e("em", { children: "Select a property widget" });
|
|
4661
|
-
const ae = W, me = xt[ae] ?? _[ae], ue = me.property, fe = ue && !
|
|
4661
|
+
const ae = W, me = xt[ae] ?? _[ae], ue = me.property, fe = ue && !oe(ue) ? We(ue, _) : void 0, be = oe(ue) || o && ue.dataType !== t?.dataType, X = fe ? Y(fe, me) : me;
|
|
4662
4662
|
return /* @__PURE__ */ n(
|
|
4663
4663
|
"div",
|
|
4664
4664
|
{
|
|
@@ -4690,7 +4690,7 @@ function Ki({
|
|
|
4690
4690
|
te(W);
|
|
4691
4691
|
},
|
|
4692
4692
|
children: z.map(([W, ae]) => {
|
|
4693
|
-
const me = ae.property, ue = o && !
|
|
4693
|
+
const me = ae.property, ue = o && !oe(me) && me.dataType !== t?.dataType;
|
|
4694
4694
|
return /* @__PURE__ */ e(
|
|
4695
4695
|
oa,
|
|
4696
4696
|
{
|
|
@@ -4715,7 +4715,7 @@ function Ki({
|
|
|
4715
4715
|
)
|
|
4716
4716
|
] }),
|
|
4717
4717
|
c && t?.id && /* @__PURE__ */ e(
|
|
4718
|
-
|
|
4718
|
+
ne,
|
|
4719
4719
|
{
|
|
4720
4720
|
variant: "ghost",
|
|
4721
4721
|
className: "m-4",
|
|
@@ -4727,7 +4727,7 @@ function Ki({
|
|
|
4727
4727
|
] }),
|
|
4728
4728
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
|
|
4729
4729
|
p && /* @__PURE__ */ e(
|
|
4730
|
-
|
|
4730
|
+
zi,
|
|
4731
4731
|
{
|
|
4732
4732
|
showErrors: g,
|
|
4733
4733
|
disabledId: o,
|
|
@@ -4738,7 +4738,7 @@ function Ki({
|
|
|
4738
4738
|
}
|
|
4739
4739
|
),
|
|
4740
4740
|
R,
|
|
4741
|
-
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
|
|
4741
|
+
/* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($i, { disabled: y }) })
|
|
4742
4742
|
] }),
|
|
4743
4743
|
c && /* @__PURE__ */ e(
|
|
4744
4744
|
mt,
|
|
@@ -4756,11 +4756,11 @@ function Ki({
|
|
|
4756
4756
|
)
|
|
4757
4757
|
] });
|
|
4758
4758
|
}
|
|
4759
|
-
function
|
|
4759
|
+
function Gi(t) {
|
|
4760
4760
|
return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, i) => a + i[0].toUpperCase() + i.substring(1));
|
|
4761
4761
|
}
|
|
4762
|
-
function
|
|
4763
|
-
const r = Re(), s = "const " +
|
|
4762
|
+
function Hi({ collection: t, onOpenChange: a, open: i }) {
|
|
4763
|
+
const r = Re(), s = "const " + Gi(t.name) + "Collection = " + ri.stringify(sa(t), null, " ");
|
|
4764
4764
|
return /* @__PURE__ */ n(
|
|
4765
4765
|
Fe,
|
|
4766
4766
|
{
|
|
@@ -4786,9 +4786,9 @@ function Gi({ collection: t, onOpenChange: a, open: i }) {
|
|
|
4786
4786
|
"."
|
|
4787
4787
|
] }),
|
|
4788
4788
|
/* @__PURE__ */ e(
|
|
4789
|
-
|
|
4789
|
+
oi,
|
|
4790
4790
|
{
|
|
4791
|
-
theme:
|
|
4791
|
+
theme: ni.vsDark,
|
|
4792
4792
|
code: s,
|
|
4793
4793
|
language: "typescript",
|
|
4794
4794
|
children: ({ className: o, style: l, tokens: d, getLineProps: p, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: d.map((c, m) => /* @__PURE__ */ e("div", { ...p({ line: c }), children: c.map((b, g) => /* @__PURE__ */ e("span", { ...u({ token: b }) }, g)) }, m)) })
|
|
@@ -4846,7 +4846,7 @@ function sa(t) {
|
|
|
4846
4846
|
subcollections: (t.subcollections ?? []).map(sa)
|
|
4847
4847
|
};
|
|
4848
4848
|
}
|
|
4849
|
-
function
|
|
4849
|
+
function Ji({
|
|
4850
4850
|
showErrors: t,
|
|
4851
4851
|
isNewCollection: a,
|
|
4852
4852
|
propertyErrorsRef: i,
|
|
@@ -4867,7 +4867,7 @@ function Hi({
|
|
|
4867
4867
|
setFieldTouched: O,
|
|
4868
4868
|
errors: k,
|
|
4869
4869
|
dirty: x
|
|
4870
|
-
} = $(), h = Re(), _ = Ia("lg"), v = !_, [w, V] = K(), [I, A] = K(), [N, F] = K(), f = I ?
|
|
4870
|
+
} = $(), h = Re(), _ = Ia("lg"), v = !_, [w, V] = K(), [I, A] = K(), [N, F] = K(), f = I ? le(I, N) : void 0, z = f ? P(b.properties, f.replaceAll(".", ".properties.")) : void 0, [Q, S] = K(!1), [B, ge] = K(!1), [Ce, te] = K(!1), [R, W] = K([]), ae = U.useRef(b.propertiesOrder ? { "": b.propertiesOrder } : {});
|
|
4871
4871
|
pe(() => {
|
|
4872
4872
|
s && s(x);
|
|
4873
4873
|
}, [x]);
|
|
@@ -4880,7 +4880,7 @@ function Hi({
|
|
|
4880
4880
|
});
|
|
4881
4881
|
return;
|
|
4882
4882
|
}
|
|
4883
|
-
const j = Object.keys(T.properties).filter((
|
|
4883
|
+
const j = Object.keys(T.properties).filter((se) => !b.properties[se]);
|
|
4884
4884
|
if (j.length === 0) {
|
|
4885
4885
|
h.open({
|
|
4886
4886
|
type: "info",
|
|
@@ -4889,7 +4889,7 @@ function Hi({
|
|
|
4889
4889
|
return;
|
|
4890
4890
|
}
|
|
4891
4891
|
const G = {
|
|
4892
|
-
...j.reduce((
|
|
4892
|
+
...j.reduce((se, ve) => (se[ve] = T.properties[ve], se), {}),
|
|
4893
4893
|
...b.properties
|
|
4894
4894
|
}, de = [
|
|
4895
4895
|
...j,
|
|
@@ -4903,12 +4903,12 @@ function Hi({
|
|
|
4903
4903
|
const G = Ne(j);
|
|
4904
4904
|
g(G, T, !1), ae.current[j ?? ""] = T;
|
|
4905
4905
|
}, be = (T, j) => {
|
|
4906
|
-
const G = T ?
|
|
4906
|
+
const G = T ? le(T, j) : void 0;
|
|
4907
4907
|
if (!G)
|
|
4908
4908
|
throw Error("collection editor miss config");
|
|
4909
4909
|
g(ke(G), void 0, !1);
|
|
4910
|
-
const
|
|
4911
|
-
fe(
|
|
4910
|
+
const se = ue(j).filter((ve) => ve !== T);
|
|
4911
|
+
fe(se, j), te(!1), V(void 0), A(void 0), F(void 0);
|
|
4912
4912
|
}, X = (T, j) => {
|
|
4913
4913
|
g(Ne(j), T, !1);
|
|
4914
4914
|
}, Oe = ({
|
|
@@ -4936,26 +4936,26 @@ function Hi({
|
|
|
4936
4936
|
previousId: G,
|
|
4937
4937
|
namespace: de
|
|
4938
4938
|
}) => {
|
|
4939
|
-
const
|
|
4939
|
+
const se = T ? le(T, de) : void 0, ve = se ? ke(se) : void 0;
|
|
4940
4940
|
if (G && G !== T) {
|
|
4941
|
-
const it =
|
|
4941
|
+
const it = le(G, de), Z = ke(it), we = ue(de).map((rt) => rt === G ? T : rt).filter((rt) => rt !== void 0);
|
|
4942
4942
|
fe(we, de), T && (V(we.indexOf(T)), A(T)), g(Z, void 0, !1), O(Z, !1, !1);
|
|
4943
4943
|
}
|
|
4944
4944
|
ve && (g(ve, j, !1), O(ve, !0, !1));
|
|
4945
4945
|
}, tt = (T, j, G) => {
|
|
4946
|
-
const de = T ?
|
|
4946
|
+
const de = T ? le(T, j) : void 0;
|
|
4947
4947
|
if (console.warn("onPropertyErrorInternal", {
|
|
4948
4948
|
id: T,
|
|
4949
4949
|
namespace: j,
|
|
4950
4950
|
error: G,
|
|
4951
4951
|
propertyPath: de
|
|
4952
4952
|
}), de) {
|
|
4953
|
-
const
|
|
4954
|
-
r(T, j,
|
|
4953
|
+
const se = G && Object.keys(G).length > 0;
|
|
4954
|
+
r(T, j, se ? G : void 0), y(ke(de), se ? "Property error" : void 0);
|
|
4955
4955
|
}
|
|
4956
4956
|
}, q = () => {
|
|
4957
4957
|
V(void 0), A(void 0);
|
|
4958
|
-
},
|
|
4958
|
+
}, M = I && i?.current?.properties ? i.current.properties[I] : void 0, L = b?.propertiesOrder === void 0 || b.propertiesOrder.length === 0, Ke = b.propertiesOrder ? b.propertiesOrder : Object.keys(b.properties), at = $t(() => d(b.ownerId), [d, b.ownerId]), Ve = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
|
|
4959
4959
|
/* @__PURE__ */ n("div", { className: xe(
|
|
4960
4960
|
"p-4 md:p-8 pb-20 md:pb-20",
|
|
4961
4961
|
"col-span-12 lg:col-span-5 h-full overflow-auto",
|
|
@@ -4992,16 +4992,25 @@ function Hi({
|
|
|
4992
4992
|
] }),
|
|
4993
4993
|
l && /* @__PURE__ */ e("div", { className: "ml-4", children: l }),
|
|
4994
4994
|
/* @__PURE__ */ n("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
|
|
4995
|
-
|
|
4996
|
-
|
|
4995
|
+
/* @__PURE__ */ e(re, { title: "Get the code for this collection", children: /* @__PURE__ */ e(
|
|
4996
|
+
ne,
|
|
4997
4997
|
{
|
|
4998
4998
|
variant: "filled",
|
|
4999
|
-
disabled:
|
|
4999
|
+
disabled: B,
|
|
5000
|
+
onClick: () => S(!0),
|
|
5001
|
+
children: /* @__PURE__ */ e(Fa, {})
|
|
5002
|
+
}
|
|
5003
|
+
) }),
|
|
5004
|
+
me && /* @__PURE__ */ e(re, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
|
|
5005
|
+
ne,
|
|
5006
|
+
{
|
|
5007
|
+
variant: "filled",
|
|
5008
|
+
disabled: B,
|
|
5000
5009
|
onClick: me,
|
|
5001
|
-
children:
|
|
5010
|
+
children: B ? /* @__PURE__ */ e(Qe, { size: "small" }) : /* @__PURE__ */ e(gt, {})
|
|
5002
5011
|
}
|
|
5003
5012
|
) }),
|
|
5004
|
-
/* @__PURE__ */ e(
|
|
5013
|
+
/* @__PURE__ */ e(re, { title: "Add new property", children: /* @__PURE__ */ e(
|
|
5005
5014
|
E,
|
|
5006
5015
|
{
|
|
5007
5016
|
variant: "outlined",
|
|
@@ -5019,7 +5028,7 @@ function Hi({
|
|
|
5019
5028
|
V(Ke.indexOf(T)), A(T), F(j);
|
|
5020
5029
|
},
|
|
5021
5030
|
inferredPropertyKeys: R,
|
|
5022
|
-
selectedPropertyKey: I ?
|
|
5031
|
+
selectedPropertyKey: I ? le(I, N) : void 0,
|
|
5023
5032
|
properties: b.properties,
|
|
5024
5033
|
additionalFields: b.additionalFields,
|
|
5025
5034
|
propertiesOrder: Ke,
|
|
@@ -5047,7 +5056,7 @@ function Hi({
|
|
|
5047
5056
|
{
|
|
5048
5057
|
className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
|
|
5049
5058
|
children: [
|
|
5050
|
-
f && z && !
|
|
5059
|
+
f && z && !oe(z) && /* @__PURE__ */ e(
|
|
5051
5060
|
na,
|
|
5052
5061
|
{
|
|
5053
5062
|
inArray: !1,
|
|
@@ -5062,7 +5071,7 @@ function Hi({
|
|
|
5062
5071
|
onDelete: be,
|
|
5063
5072
|
onError: tt,
|
|
5064
5073
|
forceShowErrors: t,
|
|
5065
|
-
initialErrors:
|
|
5074
|
+
initialErrors: M,
|
|
5066
5075
|
getData: p,
|
|
5067
5076
|
propertyConfigs: c,
|
|
5068
5077
|
collectionEditable: m
|
|
@@ -5070,7 +5079,7 @@ function Hi({
|
|
|
5070
5079
|
`edit_view_${w}`
|
|
5071
5080
|
),
|
|
5072
5081
|
!z && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: L ? "Now you can add your first property" : "Select a property to edit it" }),
|
|
5073
|
-
z &&
|
|
5082
|
+
z && oe(z) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
|
|
5074
5083
|
]
|
|
5075
5084
|
}
|
|
5076
5085
|
) }),
|
|
@@ -5090,7 +5099,7 @@ function Hi({
|
|
|
5090
5099
|
onDelete: be,
|
|
5091
5100
|
onError: tt,
|
|
5092
5101
|
forceShowErrors: t,
|
|
5093
|
-
initialErrors:
|
|
5102
|
+
initialErrors: M,
|
|
5094
5103
|
getData: p,
|
|
5095
5104
|
propertyConfigs: c,
|
|
5096
5105
|
collectionEditable: m,
|
|
@@ -5120,7 +5129,7 @@ function Hi({
|
|
|
5120
5129
|
}
|
|
5121
5130
|
),
|
|
5122
5131
|
/* @__PURE__ */ e(
|
|
5123
|
-
|
|
5132
|
+
Hi,
|
|
5124
5133
|
{
|
|
5125
5134
|
collection: b,
|
|
5126
5135
|
open: Q,
|
|
@@ -5129,7 +5138,7 @@ function Hi({
|
|
|
5129
5138
|
)
|
|
5130
5139
|
] });
|
|
5131
5140
|
}
|
|
5132
|
-
function
|
|
5141
|
+
function Qi({
|
|
5133
5142
|
open: t,
|
|
5134
5143
|
handleOk: a,
|
|
5135
5144
|
handleCancel: i,
|
|
@@ -5157,7 +5166,7 @@ function Ji({
|
|
|
5157
5166
|
}
|
|
5158
5167
|
);
|
|
5159
5168
|
}
|
|
5160
|
-
function
|
|
5169
|
+
function Wi({ open: t, onClose: a }) {
|
|
5161
5170
|
const {
|
|
5162
5171
|
entityViews: i
|
|
5163
5172
|
} = Ue();
|
|
@@ -5191,7 +5200,7 @@ function Qi({ open: t, onClose: a }) {
|
|
|
5191
5200
|
}
|
|
5192
5201
|
);
|
|
5193
5202
|
}
|
|
5194
|
-
function
|
|
5203
|
+
function Zi({
|
|
5195
5204
|
collection: t,
|
|
5196
5205
|
parentCollection: a,
|
|
5197
5206
|
configController: i,
|
|
@@ -5202,7 +5211,7 @@ function Wi({
|
|
|
5202
5211
|
const { entityViews: l } = Ue(), [d, p] = U.useState(), [u, c] = U.useState(!1), [m, b] = U.useState(), [g, y] = U.useState(), {
|
|
5203
5212
|
values: O,
|
|
5204
5213
|
setFieldValue: k
|
|
5205
|
-
} = $(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) =>
|
|
5214
|
+
} = $(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) => ja(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], v = h.length + _.length;
|
|
5206
5215
|
return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
|
|
5207
5216
|
/* @__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: [
|
|
5208
5217
|
/* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
|
|
@@ -5229,8 +5238,8 @@ function Wi({
|
|
|
5229
5238
|
Ye,
|
|
5230
5239
|
{
|
|
5231
5240
|
align: "right",
|
|
5232
|
-
children: /* @__PURE__ */ e(
|
|
5233
|
-
|
|
5241
|
+
children: /* @__PURE__ */ e(re, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5242
|
+
ne,
|
|
5234
5243
|
{
|
|
5235
5244
|
size: "small",
|
|
5236
5245
|
onClick: (V) => {
|
|
@@ -5275,8 +5284,8 @@ function Wi({
|
|
|
5275
5284
|
Ye,
|
|
5276
5285
|
{
|
|
5277
5286
|
align: "right",
|
|
5278
|
-
children: /* @__PURE__ */ e(
|
|
5279
|
-
|
|
5287
|
+
children: /* @__PURE__ */ e(re, { title: "Remove", children: /* @__PURE__ */ e(
|
|
5288
|
+
ne,
|
|
5280
5289
|
{
|
|
5281
5290
|
size: "small",
|
|
5282
5291
|
onClick: (V) => {
|
|
@@ -5372,7 +5381,7 @@ function Wi({
|
|
|
5372
5381
|
}
|
|
5373
5382
|
),
|
|
5374
5383
|
/* @__PURE__ */ e(
|
|
5375
|
-
|
|
5384
|
+
Wi,
|
|
5376
5385
|
{
|
|
5377
5386
|
open: u,
|
|
5378
5387
|
onClose: (w) => {
|
|
@@ -5608,7 +5617,7 @@ const Mt = {
|
|
|
5608
5617
|
}
|
|
5609
5618
|
})
|
|
5610
5619
|
};
|
|
5611
|
-
function
|
|
5620
|
+
function Xi({
|
|
5612
5621
|
path: t,
|
|
5613
5622
|
pathSuggestions: a,
|
|
5614
5623
|
parentCollection: i,
|
|
@@ -5726,7 +5735,7 @@ function Zi({
|
|
|
5726
5735
|
children: "● Create a collection from a file (csv, json, xls, xslx...)"
|
|
5727
5736
|
}
|
|
5728
5737
|
),
|
|
5729
|
-
/* @__PURE__ */ e(
|
|
5738
|
+
/* @__PURE__ */ e(si, { onDataAdded: (h) => r(h) })
|
|
5730
5739
|
] }),
|
|
5731
5740
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(E, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
|
|
5732
5741
|
] }) });
|
|
@@ -5737,7 +5746,7 @@ function _t({
|
|
|
5737
5746
|
icon: i,
|
|
5738
5747
|
onClick: r
|
|
5739
5748
|
}) {
|
|
5740
|
-
return /* @__PURE__ */ e(
|
|
5749
|
+
return /* @__PURE__ */ e(re, { title: a, children: /* @__PURE__ */ n(
|
|
5741
5750
|
Xt,
|
|
5742
5751
|
{
|
|
5743
5752
|
onClick: r,
|
|
@@ -5762,7 +5771,7 @@ function _t({
|
|
|
5762
5771
|
}
|
|
5763
5772
|
) });
|
|
5764
5773
|
}
|
|
5765
|
-
const
|
|
5774
|
+
const er = [
|
|
5766
5775
|
"text_field",
|
|
5767
5776
|
"multiline",
|
|
5768
5777
|
"markdown",
|
|
@@ -5783,10 +5792,10 @@ const Xi = [
|
|
|
5783
5792
|
"date_time",
|
|
5784
5793
|
"repeat",
|
|
5785
5794
|
"block"
|
|
5786
|
-
],
|
|
5787
|
-
([t]) =>
|
|
5795
|
+
], tr = Object.entries(xt).filter(
|
|
5796
|
+
([t]) => er.includes(t)
|
|
5788
5797
|
);
|
|
5789
|
-
function
|
|
5798
|
+
function ar({
|
|
5790
5799
|
importConfig: t,
|
|
5791
5800
|
propertyConfigs: a,
|
|
5792
5801
|
collectionEditable: i
|
|
@@ -5801,12 +5810,12 @@ function tr({
|
|
|
5801
5810
|
previousId: O,
|
|
5802
5811
|
namespace: k
|
|
5803
5812
|
}) => {
|
|
5804
|
-
const x = g ?
|
|
5813
|
+
const x = g ? le(g, k) : void 0, h = x ? ke(x) : void 0, _ = (w) => w ? p.current[w] ?? P(o, Ne(w)) : p.current[""], v = (w, V) => {
|
|
5805
5814
|
const I = Ne(V);
|
|
5806
5815
|
r(I, w, !1), p.current[V ?? ""] = w;
|
|
5807
5816
|
};
|
|
5808
5817
|
if (O && O !== g) {
|
|
5809
|
-
const w =
|
|
5818
|
+
const w = le(O, k), V = ke(w), A = _(k).map((F) => F === O ? g : F).filter((F) => F !== void 0);
|
|
5810
5819
|
v(A, k);
|
|
5811
5820
|
const N = { ...t.headersMapping };
|
|
5812
5821
|
Object.keys(N).forEach((F) => {
|
|
@@ -5820,8 +5829,8 @@ function tr({
|
|
|
5820
5829
|
property: O,
|
|
5821
5830
|
namespace: k
|
|
5822
5831
|
}) => {
|
|
5823
|
-
const x = g ?
|
|
5824
|
-
...
|
|
5832
|
+
const x = g ? le(g, k) : void 0, h = x ? ke(x) : void 0, _ = t.importData.map((w) => P(w, y)), v = {
|
|
5833
|
+
...Xa(_, O, ta),
|
|
5825
5834
|
editable: !0
|
|
5826
5835
|
};
|
|
5827
5836
|
h && (v ? (console.log("updating inferredNewProperty", {
|
|
@@ -5833,7 +5842,7 @@ function tr({
|
|
|
5833
5842
|
/* @__PURE__ */ n(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
|
|
5834
5843
|
/* @__PURE__ */ e(C, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
|
|
5835
5844
|
/* @__PURE__ */ e(
|
|
5836
|
-
|
|
5845
|
+
li,
|
|
5837
5846
|
{
|
|
5838
5847
|
headersMapping: t.headersMapping,
|
|
5839
5848
|
idColumn: t.idColumn,
|
|
@@ -5845,7 +5854,7 @@ function tr({
|
|
|
5845
5854
|
propertyKey: y,
|
|
5846
5855
|
importKey: O
|
|
5847
5856
|
}) => /* @__PURE__ */ e(
|
|
5848
|
-
|
|
5857
|
+
ci,
|
|
5849
5858
|
{
|
|
5850
5859
|
property: g,
|
|
5851
5860
|
propertyKey: y,
|
|
@@ -5858,7 +5867,7 @@ function tr({
|
|
|
5858
5867
|
});
|
|
5859
5868
|
},
|
|
5860
5869
|
propertyTypeView: /* @__PURE__ */ e(
|
|
5861
|
-
|
|
5870
|
+
ir,
|
|
5862
5871
|
{
|
|
5863
5872
|
property: g,
|
|
5864
5873
|
disabled: !1,
|
|
@@ -5900,7 +5909,7 @@ function tr({
|
|
|
5900
5909
|
/* @__PURE__ */ e("div", { style: { height: "52px" } })
|
|
5901
5910
|
] });
|
|
5902
5911
|
}
|
|
5903
|
-
function
|
|
5912
|
+
function ir({
|
|
5904
5913
|
property: t,
|
|
5905
5914
|
onPropertyChanged: a,
|
|
5906
5915
|
propertyKey: i,
|
|
@@ -5909,7 +5918,7 @@ function ar({
|
|
|
5909
5918
|
}) {
|
|
5910
5919
|
const o = t ? Wt(t) : null, l = t ? We(t, r) : null, [d, p] = K(!1);
|
|
5911
5920
|
return /* @__PURE__ */ e(
|
|
5912
|
-
|
|
5921
|
+
re,
|
|
5913
5922
|
{
|
|
5914
5923
|
title: t && l ? `${l?.name} - ${t.dataType}` : void 0,
|
|
5915
5924
|
open: d ? !1 : void 0,
|
|
@@ -5935,7 +5944,7 @@ function ar({
|
|
|
5935
5944
|
namespace: void 0
|
|
5936
5945
|
}), console.log("newSelectedWidgetId", u));
|
|
5937
5946
|
},
|
|
5938
|
-
children:
|
|
5947
|
+
children: tr.map(([u, c]) => /* @__PURE__ */ e(
|
|
5939
5948
|
oa,
|
|
5940
5949
|
{
|
|
5941
5950
|
value: u,
|
|
@@ -5950,14 +5959,14 @@ function ar({
|
|
|
5950
5959
|
}
|
|
5951
5960
|
);
|
|
5952
5961
|
}
|
|
5953
|
-
function
|
|
5962
|
+
function rr({ importConfig: t, properties: a, propertiesOrder: i }) {
|
|
5954
5963
|
pe(() => {
|
|
5955
|
-
const s =
|
|
5964
|
+
const s = di(t.originProperties, a), o = t.importData.map((l) => pi(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
|
|
5956
5965
|
t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
|
|
5957
5966
|
}, []);
|
|
5958
|
-
const r =
|
|
5967
|
+
const r = Ea();
|
|
5959
5968
|
return /* @__PURE__ */ e(
|
|
5960
|
-
|
|
5969
|
+
Da,
|
|
5961
5970
|
{
|
|
5962
5971
|
title: /* @__PURE__ */ n("div", { children: [
|
|
5963
5972
|
/* @__PURE__ */ e(C, { variant: "subtitle2", children: "Imported data preview" }),
|
|
@@ -5979,7 +5988,7 @@ function ir({ importConfig: t, properties: a, propertiesOrder: i }) {
|
|
|
5979
5988
|
}
|
|
5980
5989
|
function la(t, a = "") {
|
|
5981
5990
|
const i = Object.keys(t).reduce((o, l) => {
|
|
5982
|
-
const d = t[l], p =
|
|
5991
|
+
const d = t[l], p = Ba(l), u = a ? `${a}.${p}` : p;
|
|
5983
5992
|
if (d.dataType === "map" && d.properties) {
|
|
5984
5993
|
const b = la(d.properties, u);
|
|
5985
5994
|
return {
|
|
@@ -6026,7 +6035,7 @@ function ca(t) {
|
|
|
6026
6035
|
onOpenChange: (d) => d ? void 0 : l(),
|
|
6027
6036
|
children: [
|
|
6028
6037
|
a && /* @__PURE__ */ e(
|
|
6029
|
-
|
|
6038
|
+
or,
|
|
6030
6039
|
{
|
|
6031
6040
|
...t,
|
|
6032
6041
|
handleCancel: l,
|
|
@@ -6034,7 +6043,7 @@ function ca(t) {
|
|
|
6034
6043
|
}
|
|
6035
6044
|
),
|
|
6036
6045
|
/* @__PURE__ */ e(
|
|
6037
|
-
|
|
6046
|
+
Qi,
|
|
6038
6047
|
{
|
|
6039
6048
|
open: s,
|
|
6040
6049
|
handleOk: () => t.handleClose(void 0),
|
|
@@ -6046,7 +6055,7 @@ function ca(t) {
|
|
|
6046
6055
|
}
|
|
6047
6056
|
);
|
|
6048
6057
|
}
|
|
6049
|
-
function
|
|
6058
|
+
function or({
|
|
6050
6059
|
isNewCollection: t,
|
|
6051
6060
|
initialValues: a,
|
|
6052
6061
|
configController: i,
|
|
@@ -6067,12 +6076,12 @@ function rr({
|
|
|
6067
6076
|
const { propertyConfigs: k } = Ue(), x = $e(), {
|
|
6068
6077
|
topLevelNavigation: h,
|
|
6069
6078
|
collections: _
|
|
6070
|
-
} = x, v = !a?.path && (s ?? []).length === 0, w = (y ? y.subcollections : _) ?? [], V = w.map((q) => q.path.trim().toLowerCase()), I = w.map((q) => q.alias?.trim().toLowerCase()).filter(Boolean), A =
|
|
6079
|
+
} = x, v = !a?.path && (s ?? []).length === 0, w = (y ? y.subcollections : _) ?? [], V = w.map((q) => q.path.trim().toLowerCase()), I = w.map((q) => q.alias?.trim().toLowerCase()).filter(Boolean), A = mi();
|
|
6071
6080
|
if (!h)
|
|
6072
6081
|
throw Error("Internal: Navigation not ready in collection editor");
|
|
6073
6082
|
const {
|
|
6074
6083
|
groups: N
|
|
6075
|
-
} = h, F = Re(), f = Le(), z = Ge({}), Q = t ? v ? "welcome" : "details" : "properties", [S,
|
|
6084
|
+
} = h, F = Re(), f = Le(), z = Ge({}), Q = t ? v ? "welcome" : "details" : "properties", [S, B] = K(Q), [ge, Ce] = _e.useState(), [te, R] = _e.useState(), [W, ae] = _e.useState(!1), [me, ue] = _e.useState();
|
|
6076
6085
|
pe(() => {
|
|
6077
6086
|
try {
|
|
6078
6087
|
x.initialised && (R(r ? x.getCollectionFromPaths([...s ?? [], r]) : void 0), ae(!0));
|
|
@@ -6081,9 +6090,9 @@ function rr({
|
|
|
6081
6090
|
}
|
|
6082
6091
|
}, [x.getCollectionFromPaths, r, me, x.initialised]);
|
|
6083
6092
|
const fe = (q) => {
|
|
6084
|
-
const
|
|
6093
|
+
const M = q.alias || q.path;
|
|
6085
6094
|
return i.saveCollection({
|
|
6086
|
-
path:
|
|
6095
|
+
path: M,
|
|
6087
6096
|
collectionData: q,
|
|
6088
6097
|
previousPath: r,
|
|
6089
6098
|
parentPathSegments: s
|
|
@@ -6091,7 +6100,7 @@ function rr({
|
|
|
6091
6100
|
type: "error",
|
|
6092
6101
|
message: "Error persisting collection: " + (L.message ?? "Details in the console")
|
|
6093
6102
|
}), !1));
|
|
6094
|
-
}, be = te ?
|
|
6103
|
+
}, be = te ? nr(te, k) : {
|
|
6095
6104
|
path: a?.path ?? "",
|
|
6096
6105
|
name: a?.name ?? "",
|
|
6097
6106
|
group: a?.group ?? "",
|
|
@@ -6100,7 +6109,7 @@ function rr({
|
|
|
6100
6109
|
icon: kt[Math.floor(Math.random() * kt.length)],
|
|
6101
6110
|
ownerId: f.user?.uid ?? ""
|
|
6102
6111
|
}, X = J(() => {
|
|
6103
|
-
S === "details" ? A.inUse ?
|
|
6112
|
+
S === "details" ? A.inUse ? B("import_data_saving") : B(u ? "extra_view" : "properties") : B(S === "welcome" ? "details" : S === "import_data_mapping" ? "import_data_preview" : S === "import_data_preview" ? "details" : S === "extra_view" ? "properties" : "details");
|
|
6104
6113
|
}, [S, A.inUse, u]), Oe = J((q) => {
|
|
6105
6114
|
if (l)
|
|
6106
6115
|
return l?.(q.path, q.collectionGroup ?? !1, s ?? []);
|
|
@@ -6108,33 +6117,33 @@ function rr({
|
|
|
6108
6117
|
try {
|
|
6109
6118
|
if (!Oe)
|
|
6110
6119
|
return R(q), Promise.resolve(q);
|
|
6111
|
-
|
|
6112
|
-
const
|
|
6113
|
-
if (!
|
|
6120
|
+
B("loading");
|
|
6121
|
+
const M = await Oe?.(q);
|
|
6122
|
+
if (!M)
|
|
6114
6123
|
return R(q), Promise.resolve(q);
|
|
6115
6124
|
const L = {
|
|
6116
6125
|
...q ?? {}
|
|
6117
6126
|
};
|
|
6118
|
-
return Object.keys(
|
|
6127
|
+
return Object.keys(M.properties ?? {}).length > 0 && (L.properties = M.properties, L.propertiesOrder = M.propertiesOrder), L.propertiesOrder ? (R(L), console.log("Inferred collection", {
|
|
6119
6128
|
newCollection: q ?? {},
|
|
6120
6129
|
values: L
|
|
6121
6130
|
}), L) : (L.propertiesOrder = Object.keys(L.properties), L);
|
|
6122
|
-
} catch (
|
|
6123
|
-
return console.error(
|
|
6131
|
+
} catch (M) {
|
|
6132
|
+
return console.error(M), F.open({
|
|
6124
6133
|
type: "error",
|
|
6125
|
-
message: "Error inferring collection: " + (
|
|
6134
|
+
message: "Error inferring collection: " + (M.message ?? "Details in the console")
|
|
6126
6135
|
}), q;
|
|
6127
6136
|
}
|
|
6128
|
-
}, [s, Oe]), tt = (q,
|
|
6137
|
+
}, [s, Oe]), tt = (q, M) => {
|
|
6129
6138
|
try {
|
|
6130
6139
|
if (console.log("Submitting collection", q), !t) {
|
|
6131
6140
|
fe(q).then(() => {
|
|
6132
|
-
|
|
6141
|
+
M.resetForm({ values: be }), d(q);
|
|
6133
6142
|
});
|
|
6134
6143
|
return;
|
|
6135
6144
|
}
|
|
6136
|
-
S === "welcome" ? (X(),
|
|
6137
|
-
|
|
6145
|
+
S === "welcome" ? (X(), M.resetForm({ values: q })) : S === "details" ? u || A.inUse ? (M.resetForm({ values: q }), X()) : t ? et(q).then((L) => {
|
|
6146
|
+
M.resetForm({
|
|
6138
6147
|
values: L ?? q,
|
|
6139
6148
|
touched: {
|
|
6140
6149
|
path: !0,
|
|
@@ -6143,21 +6152,21 @@ function rr({
|
|
|
6143
6152
|
});
|
|
6144
6153
|
}).finally(() => {
|
|
6145
6154
|
X();
|
|
6146
|
-
}) : (
|
|
6147
|
-
|
|
6148
|
-
}) : (X(),
|
|
6155
|
+
}) : (M.resetForm({ values: q }), X()) : S === "extra_view" ? (X(), M.resetForm({ values: q })) : S === "import_data_mapping" || S === "import_data_preview" ? X() : S === "properties" ? fe(q).then(() => {
|
|
6156
|
+
M.resetForm({ values: be }), X(), d(q);
|
|
6157
|
+
}) : (X(), M.resetForm({ values: q }));
|
|
6149
6158
|
} catch (L) {
|
|
6150
6159
|
F.open({
|
|
6151
6160
|
type: "error",
|
|
6152
6161
|
message: "Error persisting collection: " + (L.message ?? "Details in the console")
|
|
6153
|
-
}), console.error(L),
|
|
6162
|
+
}), console.error(L), M.resetForm({ values: q });
|
|
6154
6163
|
}
|
|
6155
6164
|
};
|
|
6156
6165
|
return !t && (!x.initialised || !W) ? /* @__PURE__ */ e(Ft, {}) : /* @__PURE__ */ e(Be, { fullHeight: !0, children: /* @__PURE__ */ e(
|
|
6157
6166
|
Nt,
|
|
6158
6167
|
{
|
|
6159
6168
|
initialValues: be,
|
|
6160
|
-
validationSchema: (S === "properties" || S === "subcollections" || S === "details") &&
|
|
6169
|
+
validationSchema: (S === "properties" || S === "subcollections" || S === "details") && gi,
|
|
6161
6170
|
validate: () => {
|
|
6162
6171
|
if (S === "properties")
|
|
6163
6172
|
return z.current;
|
|
@@ -6165,7 +6174,7 @@ function rr({
|
|
|
6165
6174
|
onSubmit: tt,
|
|
6166
6175
|
children: ({
|
|
6167
6176
|
values: q,
|
|
6168
|
-
setFieldValue:
|
|
6177
|
+
setFieldValue: M,
|
|
6169
6178
|
isSubmitting: L,
|
|
6170
6179
|
dirty: Ke,
|
|
6171
6180
|
submitCount: at
|
|
@@ -6175,25 +6184,25 @@ function rr({
|
|
|
6175
6184
|
m(Ke);
|
|
6176
6185
|
}, [Ke]);
|
|
6177
6186
|
function de(Z) {
|
|
6178
|
-
A.setInUse(!0),
|
|
6187
|
+
A.setInUse(!0), ei(Z, ta).then((bt) => {
|
|
6179
6188
|
const we = la(bt);
|
|
6180
|
-
|
|
6189
|
+
M("properties", we.properties), M("propertiesOrder", Object.keys(we.properties)), A.setIdColumn(we.idColumn), A.setImportData(Z), A.setHeadersMapping(we.headersMapping), A.setOriginProperties(we.properties);
|
|
6181
6190
|
});
|
|
6182
6191
|
}
|
|
6183
|
-
const
|
|
6192
|
+
const se = !!q.name && !!q.path, ve = () => {
|
|
6184
6193
|
const Z = { ...q.properties };
|
|
6185
|
-
A.idColumn && delete Z[A.idColumn],
|
|
6194
|
+
A.idColumn && delete Z[A.idColumn], M("properties", Z), X(), console.log("onImportMappingComplete", {
|
|
6186
6195
|
importConfig: A,
|
|
6187
6196
|
properties: Z
|
|
6188
6197
|
});
|
|
6189
6198
|
}, it = te?.editable || t;
|
|
6190
6199
|
return /* @__PURE__ */ n(D, { children: [
|
|
6191
6200
|
!t && /* @__PURE__ */ n(
|
|
6192
|
-
|
|
6201
|
+
Ma,
|
|
6193
6202
|
{
|
|
6194
6203
|
value: S,
|
|
6195
6204
|
className: xe(Ot, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
|
|
6196
|
-
onValueChange: (Z) =>
|
|
6205
|
+
onValueChange: (Z) => B(Z),
|
|
6197
6206
|
children: [
|
|
6198
6207
|
/* @__PURE__ */ e(vt, { value: "details", children: "Details" }),
|
|
6199
6208
|
/* @__PURE__ */ e(vt, { value: "properties", children: "Properties" }),
|
|
@@ -6202,7 +6211,7 @@ function rr({
|
|
|
6202
6211
|
}
|
|
6203
6212
|
),
|
|
6204
6213
|
/* @__PURE__ */ n(
|
|
6205
|
-
|
|
6214
|
+
Qa,
|
|
6206
6215
|
{
|
|
6207
6216
|
noValidate: !0,
|
|
6208
6217
|
className: xe(
|
|
@@ -6213,11 +6222,11 @@ function rr({
|
|
|
6213
6222
|
S === "loading" && /* @__PURE__ */ e(Ft, {}),
|
|
6214
6223
|
S === "extra_view" && Ve && u?.View && /* @__PURE__ */ e(u.View, { path: Ve }),
|
|
6215
6224
|
S === "welcome" && /* @__PURE__ */ e(
|
|
6216
|
-
|
|
6225
|
+
Xi,
|
|
6217
6226
|
{
|
|
6218
6227
|
path: Ve,
|
|
6219
6228
|
onContinue: (Z) => {
|
|
6220
|
-
Z ? (de(Z),
|
|
6229
|
+
Z ? (de(Z), B("import_data_mapping")) : B("details");
|
|
6221
6230
|
},
|
|
6222
6231
|
collections: _,
|
|
6223
6232
|
parentCollection: y,
|
|
@@ -6225,7 +6234,7 @@ function rr({
|
|
|
6225
6234
|
}
|
|
6226
6235
|
),
|
|
6227
6236
|
S === "import_data_mapping" && A && /* @__PURE__ */ e(
|
|
6228
|
-
|
|
6237
|
+
ar,
|
|
6229
6238
|
{
|
|
6230
6239
|
importConfig: A,
|
|
6231
6240
|
collectionEditable: it,
|
|
@@ -6233,7 +6242,7 @@ function rr({
|
|
|
6233
6242
|
}
|
|
6234
6243
|
),
|
|
6235
6244
|
S === "import_data_preview" && A && /* @__PURE__ */ e(
|
|
6236
|
-
|
|
6245
|
+
rr,
|
|
6237
6246
|
{
|
|
6238
6247
|
importConfig: A,
|
|
6239
6248
|
properties: q.properties,
|
|
@@ -6241,7 +6250,7 @@ function rr({
|
|
|
6241
6250
|
}
|
|
6242
6251
|
),
|
|
6243
6252
|
S === "import_data_saving" && A && /* @__PURE__ */ e(
|
|
6244
|
-
|
|
6253
|
+
ui,
|
|
6245
6254
|
{
|
|
6246
6255
|
importConfig: A,
|
|
6247
6256
|
collection: q,
|
|
@@ -6254,7 +6263,7 @@ function rr({
|
|
|
6254
6263
|
}
|
|
6255
6264
|
),
|
|
6256
6265
|
S === "details" && /* @__PURE__ */ e(
|
|
6257
|
-
|
|
6266
|
+
yi,
|
|
6258
6267
|
{
|
|
6259
6268
|
existingPaths: V,
|
|
6260
6269
|
existingAliases: I,
|
|
@@ -6264,7 +6273,7 @@ function rr({
|
|
|
6264
6273
|
}
|
|
6265
6274
|
),
|
|
6266
6275
|
S === "subcollections" && te && /* @__PURE__ */ e(
|
|
6267
|
-
|
|
6276
|
+
Zi,
|
|
6268
6277
|
{
|
|
6269
6278
|
parentCollection: y,
|
|
6270
6279
|
configController: i,
|
|
@@ -6275,13 +6284,13 @@ function rr({
|
|
|
6275
6284
|
}
|
|
6276
6285
|
),
|
|
6277
6286
|
S === "properties" && /* @__PURE__ */ e(
|
|
6278
|
-
|
|
6287
|
+
Ji,
|
|
6279
6288
|
{
|
|
6280
6289
|
showErrors: at > 0,
|
|
6281
6290
|
isNewCollection: t,
|
|
6282
6291
|
reservedGroups: p,
|
|
6283
6292
|
onPropertyError: (Z, bt, we) => {
|
|
6284
|
-
z.current =
|
|
6293
|
+
z.current = Ra({
|
|
6285
6294
|
...z.current,
|
|
6286
6295
|
[Z]: we
|
|
6287
6296
|
}, !0);
|
|
@@ -6292,10 +6301,10 @@ function rr({
|
|
|
6292
6301
|
propertyConfigs: k,
|
|
6293
6302
|
collectionEditable: it,
|
|
6294
6303
|
extraIcon: u?.icon && /* @__PURE__ */ e(
|
|
6295
|
-
|
|
6304
|
+
ne,
|
|
6296
6305
|
{
|
|
6297
6306
|
color: "primary",
|
|
6298
|
-
onClick: () =>
|
|
6307
|
+
onClick: () => B("extra_view"),
|
|
6299
6308
|
children: u.icon
|
|
6300
6309
|
}
|
|
6301
6310
|
)
|
|
@@ -6312,7 +6321,7 @@ function rr({
|
|
|
6312
6321
|
{
|
|
6313
6322
|
variant: "text",
|
|
6314
6323
|
type: "button",
|
|
6315
|
-
onClick: () => (A.setInUse(!1),
|
|
6324
|
+
onClick: () => (A.setInUse(!1), B("welcome")),
|
|
6316
6325
|
children: [
|
|
6317
6326
|
/* @__PURE__ */ e(ot, {}),
|
|
6318
6327
|
"Back"
|
|
@@ -6325,7 +6334,7 @@ function rr({
|
|
|
6325
6334
|
variant: "text",
|
|
6326
6335
|
type: "button",
|
|
6327
6336
|
onClick: () => {
|
|
6328
|
-
fe(q),
|
|
6337
|
+
fe(q), B("import_data_mapping");
|
|
6329
6338
|
},
|
|
6330
6339
|
children: [
|
|
6331
6340
|
/* @__PURE__ */ e(ot, {}),
|
|
@@ -6338,7 +6347,7 @@ function rr({
|
|
|
6338
6347
|
{
|
|
6339
6348
|
variant: "text",
|
|
6340
6349
|
type: "button",
|
|
6341
|
-
onClick: () =>
|
|
6350
|
+
onClick: () => B("welcome"),
|
|
6342
6351
|
children: [
|
|
6343
6352
|
/* @__PURE__ */ e(ot, {}),
|
|
6344
6353
|
"Back"
|
|
@@ -6350,7 +6359,7 @@ function rr({
|
|
|
6350
6359
|
{
|
|
6351
6360
|
variant: "text",
|
|
6352
6361
|
type: "button",
|
|
6353
|
-
onClick: () =>
|
|
6362
|
+
onClick: () => B("details"),
|
|
6354
6363
|
children: [
|
|
6355
6364
|
/* @__PURE__ */ e(ot, {}),
|
|
6356
6365
|
"Back"
|
|
@@ -6394,8 +6403,8 @@ function rr({
|
|
|
6394
6403
|
color: "primary",
|
|
6395
6404
|
type: "submit",
|
|
6396
6405
|
loading: L,
|
|
6397
|
-
disabled: L || S === "details" && !
|
|
6398
|
-
startIcon: S === "properties" ? /* @__PURE__ */ e(
|
|
6406
|
+
disabled: L || S === "details" && !se,
|
|
6407
|
+
startIcon: S === "properties" ? /* @__PURE__ */ e(Ua, {}) : void 0,
|
|
6399
6408
|
children: [
|
|
6400
6409
|
S === "details" && "Next",
|
|
6401
6410
|
S === "properties" && "Create collection"
|
|
@@ -6423,7 +6432,7 @@ function rr({
|
|
|
6423
6432
|
}
|
|
6424
6433
|
) });
|
|
6425
6434
|
}
|
|
6426
|
-
function
|
|
6435
|
+
function nr(t, a) {
|
|
6427
6436
|
const { properties: i, ...r } = t, s = {};
|
|
6428
6437
|
return Object.keys(i).forEach((o) => {
|
|
6429
6438
|
s[o] = da(i[o], a);
|
|
@@ -6433,9 +6442,9 @@ function da(t, a) {
|
|
|
6433
6442
|
let i = t;
|
|
6434
6443
|
if (a && typeof i == "object" && i.propertyConfig) {
|
|
6435
6444
|
const r = a[i.propertyConfig];
|
|
6436
|
-
if (r &&
|
|
6445
|
+
if (r && oe(r.property))
|
|
6437
6446
|
i = r.property;
|
|
6438
|
-
else if (r && (i = Y(r.property, i)), !
|
|
6447
|
+
else if (r && (i = Y(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
|
|
6439
6448
|
const s = {};
|
|
6440
6449
|
Object.keys(i.properties).forEach((o) => {
|
|
6441
6450
|
s[o] = da(i.properties[o], a);
|
|
@@ -6444,7 +6453,7 @@ function da(t, a) {
|
|
|
6444
6453
|
}
|
|
6445
6454
|
return i;
|
|
6446
6455
|
}
|
|
6447
|
-
const pa = U.createContext({}), ma = U.createContext({}),
|
|
6456
|
+
const pa = U.createContext({}), ma = U.createContext({}), sr = U.memo(
|
|
6448
6457
|
function({
|
|
6449
6458
|
children: a,
|
|
6450
6459
|
collectionConfigController: i,
|
|
@@ -6456,7 +6465,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
|
|
|
6456
6465
|
getUser: p,
|
|
6457
6466
|
getData: u
|
|
6458
6467
|
}) {
|
|
6459
|
-
const c = $e(), m =
|
|
6468
|
+
const c = $e(), m = hi(), b = Re(), { propertyConfigs: g } = Ue(), {
|
|
6460
6469
|
collections: y
|
|
6461
6470
|
} = c, O = y.map((f) => f.path.trim().toLowerCase()), [k, x] = U.useState();
|
|
6462
6471
|
pe(() => {
|
|
@@ -6487,7 +6496,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
|
|
|
6487
6496
|
property: z,
|
|
6488
6497
|
editedCollectionPath: Q,
|
|
6489
6498
|
currentPropertiesOrder: S,
|
|
6490
|
-
parentPathSegments:
|
|
6499
|
+
parentPathSegments: B,
|
|
6491
6500
|
collection: ge
|
|
6492
6501
|
}) => {
|
|
6493
6502
|
const Ce = f && f.includes(".") ? f.substring(0, f.lastIndexOf(".")) : void 0, te = f && f.includes(".") ? f.substring(f.lastIndexOf(".") + 1) : f;
|
|
@@ -6497,7 +6506,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
|
|
|
6497
6506
|
namespace: Ce,
|
|
6498
6507
|
currentPropertiesOrder: S,
|
|
6499
6508
|
editedCollectionPath: Q,
|
|
6500
|
-
parentPathSegments:
|
|
6509
|
+
parentPathSegments: B,
|
|
6501
6510
|
collectionEditable: ge?.editable ?? !1
|
|
6502
6511
|
});
|
|
6503
6512
|
}, []), N = U.useCallback(({
|
|
@@ -6622,7 +6631,7 @@ const pa = U.createContext({}), ma = U.createContext({}), nr = U.memo(
|
|
|
6622
6631
|
},
|
|
6623
6632
|
ut
|
|
6624
6633
|
), Ee = () => Lt(ma), ua = () => Lt(pa);
|
|
6625
|
-
function
|
|
6634
|
+
function lr({
|
|
6626
6635
|
path: t,
|
|
6627
6636
|
parentPathSegments: a,
|
|
6628
6637
|
collection: i,
|
|
@@ -6634,7 +6643,7 @@ function sr({
|
|
|
6634
6643
|
}).editCollections : !0;
|
|
6635
6644
|
let m = null;
|
|
6636
6645
|
return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (m = /* @__PURE__ */ e(
|
|
6637
|
-
|
|
6646
|
+
re,
|
|
6638
6647
|
{
|
|
6639
6648
|
title: r.sortBy || r.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
|
|
6640
6649
|
children: /* @__PURE__ */ e(
|
|
@@ -6659,18 +6668,18 @@ function sr({
|
|
|
6659
6668
|
message: "Default config saved"
|
|
6660
6669
|
});
|
|
6661
6670
|
}),
|
|
6662
|
-
children: /* @__PURE__ */ e(
|
|
6671
|
+
children: /* @__PURE__ */ e($a, {})
|
|
6663
6672
|
}
|
|
6664
6673
|
)
|
|
6665
6674
|
}
|
|
6666
6675
|
)), /* @__PURE__ */ n(D, { children: [
|
|
6667
6676
|
c && m,
|
|
6668
6677
|
/* @__PURE__ */ e(
|
|
6669
|
-
|
|
6678
|
+
re,
|
|
6670
6679
|
{
|
|
6671
6680
|
title: c ? "Edit collection" : "You don't have permissions to edit this collection",
|
|
6672
6681
|
children: /* @__PURE__ */ e(
|
|
6673
|
-
|
|
6682
|
+
ne,
|
|
6674
6683
|
{
|
|
6675
6684
|
color: "primary",
|
|
6676
6685
|
disabled: !c,
|
|
@@ -6685,7 +6694,7 @@ function sr({
|
|
|
6685
6694
|
function st(t) {
|
|
6686
6695
|
return t && Object.keys(t).length === 0 ? t : t ?? null;
|
|
6687
6696
|
}
|
|
6688
|
-
function
|
|
6697
|
+
function cr({
|
|
6689
6698
|
path: t,
|
|
6690
6699
|
collection: a
|
|
6691
6700
|
}) {
|
|
@@ -6700,10 +6709,10 @@ function lr({
|
|
|
6700
6709
|
return /* @__PURE__ */ n(D, { children: [
|
|
6701
6710
|
/* @__PURE__ */ n("div", { children: [
|
|
6702
6711
|
o.deleteCollections && /* @__PURE__ */ e(
|
|
6703
|
-
|
|
6712
|
+
La,
|
|
6704
6713
|
{
|
|
6705
|
-
trigger: /* @__PURE__ */ e(
|
|
6706
|
-
children: /* @__PURE__ */ n(
|
|
6714
|
+
trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ka, { size: "small" }) }),
|
|
6715
|
+
children: /* @__PURE__ */ n(Ya, { onClick: (c) => {
|
|
6707
6716
|
c.preventDefault(), c.stopPropagation(), p(!0);
|
|
6708
6717
|
}, children: [
|
|
6709
6718
|
/* @__PURE__ */ e(pt, {}),
|
|
@@ -6712,7 +6721,7 @@ function lr({
|
|
|
6712
6721
|
}
|
|
6713
6722
|
),
|
|
6714
6723
|
o.editCollections && /* @__PURE__ */ e(
|
|
6715
|
-
|
|
6724
|
+
ne,
|
|
6716
6725
|
{
|
|
6717
6726
|
onClick: (c) => {
|
|
6718
6727
|
l();
|
|
@@ -6737,7 +6746,7 @@ function lr({
|
|
|
6737
6746
|
)
|
|
6738
6747
|
] });
|
|
6739
6748
|
}
|
|
6740
|
-
function
|
|
6749
|
+
function dr({
|
|
6741
6750
|
group: t,
|
|
6742
6751
|
context: a
|
|
6743
6752
|
}) {
|
|
@@ -6777,12 +6786,12 @@ function cr({
|
|
|
6777
6786
|
}
|
|
6778
6787
|
);
|
|
6779
6788
|
}
|
|
6780
|
-
function
|
|
6789
|
+
function pr() {
|
|
6781
6790
|
const t = Le(), a = $e(), i = Ee(), r = i.configPermissions ? i.configPermissions({
|
|
6782
6791
|
user: t.user
|
|
6783
6792
|
}).createCollections : !0, s = i.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
|
|
6784
6793
|
return /* @__PURE__ */ e(
|
|
6785
|
-
|
|
6794
|
+
Ga,
|
|
6786
6795
|
{
|
|
6787
6796
|
in: o,
|
|
6788
6797
|
children: /* @__PURE__ */ n(
|
|
@@ -6817,7 +6826,7 @@ function dr() {
|
|
|
6817
6826
|
}
|
|
6818
6827
|
);
|
|
6819
6828
|
}
|
|
6820
|
-
function
|
|
6829
|
+
function mr({
|
|
6821
6830
|
propertyKey: t,
|
|
6822
6831
|
onHover: a,
|
|
6823
6832
|
property: i,
|
|
@@ -6826,8 +6835,8 @@ function pr({
|
|
|
6826
6835
|
collection: o
|
|
6827
6836
|
}) {
|
|
6828
6837
|
const l = Ee();
|
|
6829
|
-
return /* @__PURE__ */ e(
|
|
6830
|
-
|
|
6838
|
+
return /* @__PURE__ */ e(re, { title: "Edit", children: /* @__PURE__ */ e(
|
|
6839
|
+
ne,
|
|
6831
6840
|
{
|
|
6832
6841
|
className: a ? "bg-white dark:bg-gray-950" : "hidden",
|
|
6833
6842
|
onClick: () => {
|
|
@@ -6844,7 +6853,7 @@ function pr({
|
|
|
6844
6853
|
}
|
|
6845
6854
|
) });
|
|
6846
6855
|
}
|
|
6847
|
-
function
|
|
6856
|
+
function ur({
|
|
6848
6857
|
fullPath: t,
|
|
6849
6858
|
parentPathSegments: a,
|
|
6850
6859
|
collection: i
|
|
@@ -6853,7 +6862,7 @@ function mr({
|
|
|
6853
6862
|
user: r.user,
|
|
6854
6863
|
collection: i
|
|
6855
6864
|
}).editCollections : !0;
|
|
6856
|
-
return /* @__PURE__ */ e(
|
|
6865
|
+
return /* @__PURE__ */ e(re, { title: o ? "Add new property" : "You don't have permission to add new properties", children: /* @__PURE__ */ e(
|
|
6857
6866
|
"div",
|
|
6858
6867
|
{
|
|
6859
6868
|
className: "p-0.5 w-20 h-full flex items-center justify-center cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-950",
|
|
@@ -6861,7 +6870,7 @@ function mr({
|
|
|
6861
6870
|
s.editProperty({
|
|
6862
6871
|
editedCollectionPath: t,
|
|
6863
6872
|
parentPathSegments: a,
|
|
6864
|
-
currentPropertiesOrder:
|
|
6873
|
+
currentPropertiesOrder: Ha(i),
|
|
6865
6874
|
collection: i
|
|
6866
6875
|
});
|
|
6867
6876
|
},
|
|
@@ -6869,7 +6878,7 @@ function mr({
|
|
|
6869
6878
|
}
|
|
6870
6879
|
) });
|
|
6871
6880
|
}
|
|
6872
|
-
function
|
|
6881
|
+
function Nr({
|
|
6873
6882
|
collectionConfigController: t,
|
|
6874
6883
|
configPermissions: a,
|
|
6875
6884
|
reservedGroups: i,
|
|
@@ -6884,7 +6893,7 @@ function Pr({
|
|
|
6884
6893
|
const c = (b) => {
|
|
6885
6894
|
Xe(b.properties), b.subcollections?.forEach(c);
|
|
6886
6895
|
}, m = t.collections ?? [];
|
|
6887
|
-
return m.forEach(c),
|
|
6896
|
+
return m.forEach(c), Ja(m, u);
|
|
6888
6897
|
},
|
|
6889
6898
|
[t.collections]
|
|
6890
6899
|
);
|
|
@@ -6893,10 +6902,10 @@ function Pr({
|
|
|
6893
6902
|
loading: t.loading,
|
|
6894
6903
|
collections: {
|
|
6895
6904
|
injectCollections: p,
|
|
6896
|
-
CollectionActions:
|
|
6905
|
+
CollectionActions: lr
|
|
6897
6906
|
},
|
|
6898
6907
|
provider: {
|
|
6899
|
-
Component:
|
|
6908
|
+
Component: sr,
|
|
6900
6909
|
props: {
|
|
6901
6910
|
collectionConfigController: t,
|
|
6902
6911
|
configPermissions: a,
|
|
@@ -6909,18 +6918,18 @@ function Pr({
|
|
|
6909
6918
|
}
|
|
6910
6919
|
},
|
|
6911
6920
|
homePage: {
|
|
6912
|
-
additionalChildrenEnd: /* @__PURE__ */ e(
|
|
6913
|
-
CollectionActions:
|
|
6914
|
-
AdditionalCards:
|
|
6921
|
+
additionalChildrenEnd: /* @__PURE__ */ e(pr, {}),
|
|
6922
|
+
CollectionActions: cr,
|
|
6923
|
+
AdditionalCards: dr
|
|
6915
6924
|
},
|
|
6916
6925
|
collectionView: {
|
|
6917
|
-
HeaderAction:
|
|
6918
|
-
AddColumnComponent:
|
|
6926
|
+
HeaderAction: mr,
|
|
6927
|
+
AddColumnComponent: ur
|
|
6919
6928
|
}
|
|
6920
6929
|
};
|
|
6921
6930
|
}
|
|
6922
|
-
function
|
|
6923
|
-
const a =
|
|
6931
|
+
function Sr({ path: t }) {
|
|
6932
|
+
const a = gr(t), i = hr(t), r = Ee();
|
|
6924
6933
|
return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
|
|
6925
6934
|
/* @__PURE__ */ e(ea, { error: "No collection for path: " + a }),
|
|
6926
6935
|
/* @__PURE__ */ e(
|
|
@@ -6941,24 +6950,24 @@ function Nr({ path: t }) {
|
|
|
6941
6950
|
)
|
|
6942
6951
|
] });
|
|
6943
6952
|
}
|
|
6944
|
-
function
|
|
6953
|
+
function hr(t) {
|
|
6945
6954
|
const a = t.split("/");
|
|
6946
6955
|
return a.filter((i, r) => r % 2 === 0 && r !== a.length - 1);
|
|
6947
6956
|
}
|
|
6948
|
-
function
|
|
6957
|
+
function gr(t) {
|
|
6949
6958
|
const a = t.split("/");
|
|
6950
6959
|
return a[a.length - 1];
|
|
6951
6960
|
}
|
|
6952
6961
|
export {
|
|
6953
|
-
|
|
6962
|
+
Sr as MissingReferenceWidget,
|
|
6954
6963
|
He as editableProperty,
|
|
6955
|
-
|
|
6964
|
+
le as getFullId,
|
|
6956
6965
|
ke as idToPropertiesPath,
|
|
6957
6966
|
Ne as namespaceToPropertiesOrderPath,
|
|
6958
|
-
|
|
6959
|
-
|
|
6967
|
+
vi as namespaceToPropertiesPath,
|
|
6968
|
+
Pi as removeNonEditableProperties,
|
|
6960
6969
|
Ee as useCollectionEditorController,
|
|
6961
|
-
|
|
6970
|
+
Nr as useCollectionEditorPlugin,
|
|
6962
6971
|
ua as useCollectionsConfigController
|
|
6963
6972
|
};
|
|
6964
6973
|
//# sourceMappingURL=index.es.js.map
|