@firecms/core 3.0.0-beta.2 → 3.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -6
- package/dist/index.es.js +810 -805
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +33 -36
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +36 -38
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +9 -9
- package/src/hooks/useBuildNavigationController.tsx +26 -6
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as n, jsxs as _, Fragment as V } from "react/jsx-runtime";
|
|
2
2
|
import * as Fr from "react";
|
|
3
|
-
import
|
|
3
|
+
import I, { useContext as je, useCallback as k, useMemo as pe, useState as Q, useRef as he, useEffect as M, createElement as Lo, createRef as $o, createContext as Wo, forwardRef as Jo, useLayoutEffect as Qr, useDeferredValue as Ho } from "react";
|
|
4
4
|
import { SnackbarProvider as Zo, useSnackbar as Xo } from "notistack";
|
|
5
5
|
import Bi from "object-hash";
|
|
6
6
|
import { getIn as Kt, Field as cn, useFormex as Lr, useCreateFormex as dn, Formex as un, setIn as Dr } from "@firecms/formex";
|
|
7
|
-
import { getColorSchemeForSeed as mn, CHIP_COLORS as Ko, CircleIcon as pn, FunctionsIcon as ea, iconKeys as $r, coolIconKeys as Rr, Icon as Wr, Tooltip as _e, ErrorIcon as fn, Typography as J, IconButton as
|
|
7
|
+
import { getColorSchemeForSeed as mn, CHIP_COLORS as Ko, CircleIcon as pn, FunctionsIcon as ea, iconKeys as $r, coolIconKeys as Rr, Icon as Wr, Tooltip as _e, ErrorIcon as fn, Typography as J, IconButton as le, ContentCopyIcon as Jr, OpenInNewIcon as ar, DescriptionIcon as ta, Skeleton as Ue, Chip as Hr, cn as ne, defaultBorderMixin as Be, KeyboardTabIcon as Zr, Checkbox as hn, Markdown as sr, TextareaAutosize as ra, MultiSelect as gn, MultiSelectItem as An, Select as tt, SelectItem as rt, BooleanSwitch as ia, DateTimeField as zt, paperMixin as lr, ErrorOutlineIcon as na, EditIcon as oa, Button as ge, RemoveCircleIcon as aa, Menu as Vt, MoreVertIcon as sa, MenuItem as De, FilterListOffIcon as la, CircularProgress as Gt, SearchBar as Xr, Badge as Ci, ArrowUpwardIcon as yr, Popover as Kr, FilterListIcon as ca, AssignmentIcon as da, TextField as yt, ClearIcon as Qt, BooleanSwitchWithLabel as cr, useOutsideAlerter as bn, AddIcon as ct, DeleteIcon as Pr, InfoIcon as ua, CloseIcon as yn, ExpandablePanel as ut, RemoveIcon as ei, fieldBackgroundMixin as wn, fieldBackgroundDisabledMixin as vn, fieldBackgroundHoverMixin as ti, focusedMixin as Si, Collapse as _n, ArrowDropDownIcon as kn, useInjectStyles as ma, Dialog as ri, DialogContent as ii, DialogActions as kt, FileCopyIcon as pa, ContentPasteIcon as fa, Alert as ha, SearchIcon as ga, Card as Aa, StarIcon as xn, StarBorderIcon as En, ArrowForwardIcon as ba, Container as ya, LoadingButton as wa, Avatar as Ii, DarkModeIcon as va, LightModeIcon as _a, LogoutIcon as ka, HandleIcon as xa, debounce as Ea, Tab as wr, Tabs as Ba, Sheet as Bn, CenteredView as Ni, MenuIcon as Fi, ChevronLeftIcon as Ca, ShortTextIcon as Sa, SubjectIcon as Ia, FormatQuoteIcon as Na, HttpIcon as Fa, EmailIcon as Qa, FlagIcon as Da, ListIcon as Ra, ListAltIcon as Pa, NumbersIcon as Ta, FormatListNumberedIcon as Qi, UploadFileIcon as Oa, DriveFolderUploadIcon as Ma, LinkIcon as za, AddLinkIcon as Va, ScheduleIcon as Ga, BallotIcon as Di, RepeatIcon as Ri, ViewStreamIcon as ja } from "@firecms/ui";
|
|
8
8
|
import { useNavigate as dr, useLocation as jt, Link as ni, UNSAFE_NavigationContext as Ya, NavLink as qa, Route as Jt, Routes as Ua } from "react-router-dom";
|
|
9
9
|
import * as Cn from "js-search";
|
|
10
|
-
import
|
|
10
|
+
import ee from "react-fast-compare";
|
|
11
11
|
import { format as La } from "date-fns";
|
|
12
12
|
import * as Sn from "date-fns/locale";
|
|
13
13
|
import { FixedSizeList as $a } from "react-window";
|
|
@@ -33,7 +33,7 @@ const Wd = ({ children: e }) => /* @__PURE__ */ n(
|
|
|
33
33
|
},
|
|
34
34
|
toggleMode: () => {
|
|
35
35
|
}
|
|
36
|
-
}, oi =
|
|
36
|
+
}, oi = I.createContext(Ka), Jd = oi.Provider, Rn = I.createContext({});
|
|
37
37
|
function ve(e) {
|
|
38
38
|
return es(ts(e));
|
|
39
39
|
}
|
|
@@ -671,10 +671,10 @@ function su(e) {
|
|
|
671
671
|
return e.match(/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/) ? !0 : !!e.match(/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)/);
|
|
672
672
|
}
|
|
673
673
|
function mi(e, t, r, i = 300) {
|
|
674
|
-
const o =
|
|
674
|
+
const o = I.useRef(!1), a = () => {
|
|
675
675
|
t(), o.current = !1;
|
|
676
|
-
}, s =
|
|
677
|
-
|
|
676
|
+
}, s = I.useRef(void 0);
|
|
677
|
+
I.useEffect(
|
|
678
678
|
() => (o.current = !0, clearTimeout(s.current), s.current = setTimeout(a, i), () => {
|
|
679
679
|
r && a();
|
|
680
680
|
}),
|
|
@@ -2745,7 +2745,7 @@ function gs(e, t) {
|
|
|
2745
2745
|
if (e && (e = Or(e), e in rr))
|
|
2746
2746
|
return e in rr ? /* @__PURE__ */ n(Wr, { iconKey: e, size: "medium", className: t }) : void 0;
|
|
2747
2747
|
}
|
|
2748
|
-
const zr =
|
|
2748
|
+
const zr = I.memo(
|
|
2749
2749
|
function({ collectionOrView: t, className: r }) {
|
|
2750
2750
|
const i = gs(t.icon, r);
|
|
2751
2751
|
if (t?.icon && i)
|
|
@@ -2755,7 +2755,7 @@ const zr = S.memo(
|
|
|
2755
2755
|
const s = Rr.length;
|
|
2756
2756
|
return a || (a = Rr[hs(t.path) % s]), /* @__PURE__ */ n(Wr, { iconKey: a, size: "medium", className: r });
|
|
2757
2757
|
},
|
|
2758
|
-
(e, t) =>
|
|
2758
|
+
(e, t) => ee(e.collectionOrView.icon, t.collectionOrView.icon)
|
|
2759
2759
|
), rr = $r.reduce((e, t) => (e[t] = t, e), {});
|
|
2760
2760
|
function mu(e, t) {
|
|
2761
2761
|
if (t !== void 0 && t === 1)
|
|
@@ -3062,7 +3062,7 @@ function vu(e) {
|
|
|
3062
3062
|
function _u(e) {
|
|
3063
3063
|
return e;
|
|
3064
3064
|
}
|
|
3065
|
-
const ks = "100vw", xs = "55vw", Gi = "768px", Wn =
|
|
3065
|
+
const ks = "100vw", xs = "55vw", Gi = "768px", Wn = I.createContext({}), Ke = () => je(Wn), Jn = I.createContext({}), ke = () => je(Jn), ft = () => je(Rn), Hn = I.createContext({}), fr = () => je(Hn), Zn = I.createContext({}), ht = () => je(Zn), Xn = I.createContext({}), qt = () => je(Xn), gt = () => {
|
|
3066
3066
|
const {
|
|
3067
3067
|
enqueueSnackbar: e,
|
|
3068
3068
|
closeSnackbar: t
|
|
@@ -3080,11 +3080,11 @@ const ks = "100vw", xs = "55vw", Gi = "768px", Wn = S.createContext({}), Ke = ()
|
|
|
3080
3080
|
}, []), i = k(() => {
|
|
3081
3081
|
t();
|
|
3082
3082
|
}, []);
|
|
3083
|
-
return
|
|
3083
|
+
return pe(() => ({
|
|
3084
3084
|
open: r,
|
|
3085
3085
|
close: i
|
|
3086
3086
|
}), [r, i]);
|
|
3087
|
-
}, Kn =
|
|
3087
|
+
}, Kn = I.createContext(void 0), xt = () => je(Kn), eo = I.createContext({}), Es = ({ children: e }) => {
|
|
3088
3088
|
const [t, r] = Q([]), i = he(t), o = (l) => {
|
|
3089
3089
|
i.current = l, r(l);
|
|
3090
3090
|
}, a = k(() => {
|
|
@@ -3115,8 +3115,8 @@ const ks = "100vw", xs = "55vw", Gi = "768px", Wn = S.createContext({}), Ke = ()
|
|
|
3115
3115
|
`dialog_${c}`
|
|
3116
3116
|
))
|
|
3117
3117
|
] });
|
|
3118
|
-
}, Bs = () => je(eo), to =
|
|
3119
|
-
const e = ft(), t = fr(), r = ht(), i = ke(), o = Ke(), a = qt(), s = gt(), l = xt(), c = Bs(), d =
|
|
3118
|
+
}, Bs = () => je(eo), to = I.createContext({}), ue = () => je(to), ro = I.createContext({}), Et = () => je(ro), Ce = () => {
|
|
3119
|
+
const e = ft(), t = fr(), r = ht(), i = ke(), o = Ke(), a = qt(), s = gt(), l = xt(), c = Bs(), d = ue(), u = Et(), f = I.useRef({
|
|
3120
3120
|
authController: e,
|
|
3121
3121
|
sideDialogsController: t,
|
|
3122
3122
|
sideEntityController: r,
|
|
@@ -3580,7 +3580,7 @@ function Ps({
|
|
|
3580
3580
|
size: e,
|
|
3581
3581
|
url: t
|
|
3582
3582
|
}) {
|
|
3583
|
-
const [r, i] = Q(!1), o =
|
|
3583
|
+
const [r, i] = Q(!1), o = pe(() => wt(e), [e]);
|
|
3584
3584
|
return e === "tiny" ? /* @__PURE__ */ n(
|
|
3585
3585
|
"img",
|
|
3586
3586
|
{
|
|
@@ -3624,7 +3624,7 @@ function Ps({
|
|
|
3624
3624
|
{
|
|
3625
3625
|
className: "rounded-full absolute bottom-[-4px] right-8",
|
|
3626
3626
|
children: /* @__PURE__ */ n(
|
|
3627
|
-
|
|
3627
|
+
le,
|
|
3628
3628
|
{
|
|
3629
3629
|
variant: "filled",
|
|
3630
3630
|
size: "small",
|
|
@@ -3641,7 +3641,7 @@ function Ps({
|
|
|
3641
3641
|
}
|
|
3642
3642
|
) }),
|
|
3643
3643
|
/* @__PURE__ */ n(_e, { title: "Open image in new tab", children: /* @__PURE__ */ n(
|
|
3644
|
-
|
|
3644
|
+
le,
|
|
3645
3645
|
{
|
|
3646
3646
|
variant: "filled",
|
|
3647
3647
|
component: "a",
|
|
@@ -3898,7 +3898,7 @@ function Eu(e) {
|
|
|
3898
3898
|
function co() {
|
|
3899
3899
|
return /* @__PURE__ */ n(Ue, { width: 24, height: 24 });
|
|
3900
3900
|
}
|
|
3901
|
-
const Ys =
|
|
3901
|
+
const Ys = I.memo(Us, qs);
|
|
3902
3902
|
function qs(e, t) {
|
|
3903
3903
|
return e.size === t.size && e.storagePathOrDownloadUrl === t.storagePathOrDownloadUrl && e.storeUrl === t.storeUrl;
|
|
3904
3904
|
}
|
|
@@ -3908,7 +3908,7 @@ function Us({
|
|
|
3908
3908
|
storagePathOrDownloadUrl: t,
|
|
3909
3909
|
size: r
|
|
3910
3910
|
}) {
|
|
3911
|
-
const [i, o] =
|
|
3911
|
+
const [i, o] = I.useState(void 0), a = qt(), [s, l] = I.useState(ji[t]);
|
|
3912
3912
|
if (M(() => {
|
|
3913
3913
|
if (!t)
|
|
3914
3914
|
return;
|
|
@@ -3977,7 +3977,7 @@ function uo({
|
|
|
3977
3977
|
);
|
|
3978
3978
|
} else if (r.previewAsTag) {
|
|
3979
3979
|
const o = mn(e ?? "");
|
|
3980
|
-
return /* @__PURE__ */ n(
|
|
3980
|
+
return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
3981
3981
|
Hr,
|
|
3982
3982
|
{
|
|
3983
3983
|
colorScheme: o,
|
|
@@ -4001,7 +4001,7 @@ function uo({
|
|
|
4001
4001
|
const o = t.split(`
|
|
4002
4002
|
`);
|
|
4003
4003
|
return t && t.includes(`
|
|
4004
|
-
`) ? /* @__PURE__ */ n("div", { className: "overflow-x-scroll", children: o.map((a, s) => /* @__PURE__ */ _(
|
|
4004
|
+
`) ? /* @__PURE__ */ n("div", { className: "overflow-x-scroll", children: o.map((a, s) => /* @__PURE__ */ _(I.Fragment, { children: [
|
|
4005
4005
|
/* @__PURE__ */ n("span", { children: a }),
|
|
4006
4006
|
s !== o.length - 1 && /* @__PURE__ */ n("br", {})
|
|
4007
4007
|
] }, `string_preview_${s}`)) }) : /* @__PURE__ */ n(V, { children: t });
|
|
@@ -4015,7 +4015,7 @@ function Yi({
|
|
|
4015
4015
|
// entity,
|
|
4016
4016
|
size: i
|
|
4017
4017
|
}) {
|
|
4018
|
-
const o =
|
|
4018
|
+
const o = ue(), a = pt({
|
|
4019
4019
|
propertyKey: e,
|
|
4020
4020
|
property: r,
|
|
4021
4021
|
propertyValue: t,
|
|
@@ -4033,9 +4033,9 @@ function Yi({
|
|
|
4033
4033
|
(c, d) => {
|
|
4034
4034
|
const u = a.resolvedProperties[d] ?? a.resolvedProperties[d] ?? (Array.isArray(a.of) ? a.of[d] : a.of);
|
|
4035
4035
|
return u ? /* @__PURE__ */ n(
|
|
4036
|
-
|
|
4036
|
+
I.Fragment,
|
|
4037
4037
|
{
|
|
4038
|
-
children: /* @__PURE__ */ n("div", { className:
|
|
4038
|
+
children: /* @__PURE__ */ n("div", { className: ne(Be, "m-1 border-b last:border-b-0"), children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
4039
4039
|
Re,
|
|
4040
4040
|
{
|
|
4041
4041
|
propertyKey: e,
|
|
@@ -4079,7 +4079,7 @@ function Ws({
|
|
|
4079
4079
|
onClick: a,
|
|
4080
4080
|
allowEntityNavigation: s = !0
|
|
4081
4081
|
}) {
|
|
4082
|
-
const l =
|
|
4082
|
+
const l = ue(), d = ke().getCollection(t.path);
|
|
4083
4083
|
if (!d) {
|
|
4084
4084
|
if (l.components?.missingReference)
|
|
4085
4085
|
return /* @__PURE__ */ n(l.components.missingReference, { path: t.path });
|
|
@@ -4100,7 +4100,7 @@ function Ws({
|
|
|
4100
4100
|
);
|
|
4101
4101
|
}
|
|
4102
4102
|
function Js({ reference: e, collection: t, previewProperties: r, size: i, disabled: o, allowEntityNavigation: a, onClick: s, onHover: l }) {
|
|
4103
|
-
const c =
|
|
4103
|
+
const c = ue(), d = Et(), u = ht(), {
|
|
4104
4104
|
entity: f,
|
|
4105
4105
|
dataLoading: m,
|
|
4106
4106
|
dataLoadingError: g
|
|
@@ -4111,12 +4111,12 @@ function Js({ reference: e, collection: t, previewProperties: r, size: i, disabl
|
|
|
4111
4111
|
useCache: !0
|
|
4112
4112
|
});
|
|
4113
4113
|
f && qi.set(e.pathWithId, f);
|
|
4114
|
-
const p = f ?? qi.get(e.pathWithId), h =
|
|
4114
|
+
const p = f ?? qi.get(e.pathWithId), h = pe(() => qe({
|
|
4115
4115
|
collection: t,
|
|
4116
4116
|
path: e.path,
|
|
4117
4117
|
values: p?.values,
|
|
4118
4118
|
fields: c.propertyConfigs
|
|
4119
|
-
}), [t]), A =
|
|
4119
|
+
}), [t]), A = pe(
|
|
4120
4120
|
() => As(h, c.propertyConfigs, r, i === "small" || i === "medium" ? 3 : 1),
|
|
4121
4121
|
[r, h, i]
|
|
4122
4122
|
);
|
|
@@ -4170,7 +4170,7 @@ function Js({ reference: e, collection: t, previewProperties: r, size: i, disabl
|
|
|
4170
4170
|
}
|
|
4171
4171
|
),
|
|
4172
4172
|
/* @__PURE__ */ n("div", { className: `my-${i === "tiny" ? 2 : 4}`, children: !o && p && a && /* @__PURE__ */ n(_e, { title: `See details for ${p.id}`, children: /* @__PURE__ */ n(
|
|
4173
|
-
|
|
4173
|
+
le,
|
|
4174
4174
|
{
|
|
4175
4175
|
color: "inherit",
|
|
4176
4176
|
size: "small",
|
|
@@ -4213,7 +4213,7 @@ function hi({
|
|
|
4213
4213
|
J,
|
|
4214
4214
|
{
|
|
4215
4215
|
variant: "label",
|
|
4216
|
-
className:
|
|
4216
|
+
className: ne(
|
|
4217
4217
|
"bg-opacity-70 bg-gray-100 dark:bg-gray-800 dark:bg-opacity-60",
|
|
4218
4218
|
"w-full",
|
|
4219
4219
|
"flex",
|
|
@@ -4244,7 +4244,7 @@ function Hs({
|
|
|
4244
4244
|
property: r,
|
|
4245
4245
|
size: i
|
|
4246
4246
|
}) {
|
|
4247
|
-
const o =
|
|
4247
|
+
const o = ue(), a = pt({
|
|
4248
4248
|
propertyKey: e,
|
|
4249
4249
|
property: r,
|
|
4250
4250
|
propertyValue: t,
|
|
@@ -4284,7 +4284,7 @@ function Zs({
|
|
|
4284
4284
|
property: r,
|
|
4285
4285
|
size: i
|
|
4286
4286
|
}) {
|
|
4287
|
-
const o =
|
|
4287
|
+
const o = ue(), a = pt({
|
|
4288
4288
|
propertyKey: e,
|
|
4289
4289
|
property: r,
|
|
4290
4290
|
propertyValue: t,
|
|
@@ -4296,7 +4296,7 @@ function Zs({
|
|
|
4296
4296
|
throw Error("Picked wrong preview component ArrayOfStorageComponentsPreview");
|
|
4297
4297
|
const s = i === "medium" ? "small" : "tiny";
|
|
4298
4298
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: t && t.map(
|
|
4299
|
-
(l, c) => /* @__PURE__ */ n(
|
|
4299
|
+
(l, c) => /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
4300
4300
|
Re,
|
|
4301
4301
|
{
|
|
4302
4302
|
propertyKey: e,
|
|
@@ -4315,7 +4315,7 @@ function mo({
|
|
|
4315
4315
|
}) {
|
|
4316
4316
|
return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1.5", children: t && t.map(
|
|
4317
4317
|
(o, a) => /* @__PURE__ */ n(
|
|
4318
|
-
|
|
4318
|
+
de,
|
|
4319
4319
|
{
|
|
4320
4320
|
children: /* @__PURE__ */ n(
|
|
4321
4321
|
Ve,
|
|
@@ -4358,7 +4358,7 @@ function Xs({
|
|
|
4358
4358
|
// entity,
|
|
4359
4359
|
size: i
|
|
4360
4360
|
}) {
|
|
4361
|
-
const o =
|
|
4361
|
+
const o = ue(), a = pt({
|
|
4362
4362
|
propertyKey: e,
|
|
4363
4363
|
property: r,
|
|
4364
4364
|
propertyValue: t,
|
|
@@ -4372,7 +4372,7 @@ function Xs({
|
|
|
4372
4372
|
return /* @__PURE__ */ n("div", { children: `Unexpected value: ${t}` });
|
|
4373
4373
|
const s = a.of;
|
|
4374
4374
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: t && t.map(
|
|
4375
|
-
(l, c) => /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
4375
|
+
(l, c) => /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
4376
4376
|
uo,
|
|
4377
4377
|
{
|
|
4378
4378
|
propertyKey: e,
|
|
@@ -4390,7 +4390,7 @@ function Ks({
|
|
|
4390
4390
|
size: i
|
|
4391
4391
|
// entity
|
|
4392
4392
|
}) {
|
|
4393
|
-
const o =
|
|
4393
|
+
const o = ue(), a = pt({
|
|
4394
4394
|
propertyKey: e,
|
|
4395
4395
|
property: r,
|
|
4396
4396
|
propertyValue: t,
|
|
@@ -4406,9 +4406,9 @@ function Ks({
|
|
|
4406
4406
|
const l = i === "medium" ? "small" : "tiny", c = a.oneOf.typeField ?? Dt, d = a.oneOf.valueField ?? er, u = a.oneOf.properties;
|
|
4407
4407
|
return /* @__PURE__ */ n("div", { className: "flex flex-col", children: s && s.map(
|
|
4408
4408
|
(f, m) => /* @__PURE__ */ n(
|
|
4409
|
-
|
|
4409
|
+
I.Fragment,
|
|
4410
4410
|
{
|
|
4411
|
-
children: /* @__PURE__ */ n("div", { className:
|
|
4411
|
+
children: /* @__PURE__ */ n("div", { className: ne(Be, "m-1 border-b last:border-b-0"), children: /* @__PURE__ */ n(de, { children: f && /* @__PURE__ */ n(
|
|
4412
4412
|
Re,
|
|
4413
4413
|
{
|
|
4414
4414
|
propertyKey: e,
|
|
@@ -4438,7 +4438,7 @@ function el({
|
|
|
4438
4438
|
return null;
|
|
4439
4439
|
const a = Object.keys(o.properties);
|
|
4440
4440
|
return i === "tiny" ? /* @__PURE__ */ n("div", { className: "w-full flex flex-col space-y-1 md:space-y-2", children: a.map((s, l) => /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
4441
|
-
|
|
4441
|
+
de,
|
|
4442
4442
|
{
|
|
4443
4443
|
children: /* @__PURE__ */ n(
|
|
4444
4444
|
Re,
|
|
@@ -4460,7 +4460,7 @@ function el({
|
|
|
4460
4460
|
return /* @__PURE__ */ _(
|
|
4461
4461
|
"div",
|
|
4462
4462
|
{
|
|
4463
|
-
className:
|
|
4463
|
+
className: ne(Be, "last:border-b-0 border-b"),
|
|
4464
4464
|
children: [
|
|
4465
4465
|
/* @__PURE__ */ _(
|
|
4466
4466
|
"div",
|
|
@@ -4486,7 +4486,7 @@ function el({
|
|
|
4486
4486
|
"div",
|
|
4487
4487
|
{
|
|
4488
4488
|
className: "flex-grow max-w-[75%]",
|
|
4489
|
-
children: /* @__PURE__ */ n(
|
|
4489
|
+
children: /* @__PURE__ */ n(de, { children: !(c.dataType === "map" || c === "array") && /* @__PURE__ */ n(
|
|
4490
4490
|
Re,
|
|
4491
4491
|
{
|
|
4492
4492
|
propertyKey: s,
|
|
@@ -4500,7 +4500,7 @@ function el({
|
|
|
4500
4500
|
]
|
|
4501
4501
|
}
|
|
4502
4502
|
),
|
|
4503
|
-
(c.dataType === "map" || c === "array") && /* @__PURE__ */ n("div", { className:
|
|
4503
|
+
(c.dataType === "map" || c === "array") && /* @__PURE__ */ n("div", { className: ne(Be, "border-l pl-4 ml-2 my-2"), children: /* @__PURE__ */ n(
|
|
4504
4504
|
Re,
|
|
4505
4505
|
{
|
|
4506
4506
|
propertyKey: s,
|
|
@@ -4525,7 +4525,7 @@ function po({ value: e }) {
|
|
|
4525
4525
|
children: Object.entries(e).map(([t, r]) => /* @__PURE__ */ _(
|
|
4526
4526
|
"div",
|
|
4527
4527
|
{
|
|
4528
|
-
className:
|
|
4528
|
+
className: ne(Be, "last:border-b-0 border-b"),
|
|
4529
4529
|
children: [
|
|
4530
4530
|
/* @__PURE__ */ _(
|
|
4531
4531
|
"div",
|
|
@@ -4552,13 +4552,13 @@ function po({ value: e }) {
|
|
|
4552
4552
|
"div",
|
|
4553
4553
|
{
|
|
4554
4554
|
className: "flex-grow max-w-[75%]",
|
|
4555
|
-
children: typeof r != "object" && /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(
|
|
4555
|
+
children: typeof r != "object" && /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(de, { children: r && r.toString() }) })
|
|
4556
4556
|
}
|
|
4557
4557
|
)
|
|
4558
4558
|
]
|
|
4559
4559
|
}
|
|
4560
4560
|
),
|
|
4561
|
-
typeof r == "object" && /* @__PURE__ */ n("div", { className:
|
|
4561
|
+
typeof r == "object" && /* @__PURE__ */ n("div", { className: ne(Be, "border-l pl-4"), children: /* @__PURE__ */ n(po, { value: r }) })
|
|
4562
4562
|
]
|
|
4563
4563
|
},
|
|
4564
4564
|
`map_preview_table_${t}}`
|
|
@@ -4569,7 +4569,7 @@ function po({ value: e }) {
|
|
|
4569
4569
|
function tl({
|
|
4570
4570
|
date: e
|
|
4571
4571
|
}) {
|
|
4572
|
-
const t =
|
|
4572
|
+
const t = ue(), r = t?.locale ? Sn[t?.locale] : void 0, i = t?.dateTimeFormat ?? cs, o = e ? La(e, i, { locale: r }) : "";
|
|
4573
4573
|
return /* @__PURE__ */ n(V, { children: o });
|
|
4574
4574
|
}
|
|
4575
4575
|
function rl({ value: e }) {
|
|
@@ -4593,8 +4593,8 @@ function il({
|
|
|
4593
4593
|
} else
|
|
4594
4594
|
return /* @__PURE__ */ n(V, { children: e });
|
|
4595
4595
|
}
|
|
4596
|
-
const Re =
|
|
4597
|
-
const r =
|
|
4596
|
+
const Re = I.memo(function(t) {
|
|
4597
|
+
const r = ue();
|
|
4598
4598
|
let i;
|
|
4599
4599
|
const {
|
|
4600
4600
|
property: o,
|
|
@@ -4746,7 +4746,7 @@ const Re = S.memo(function(t) {
|
|
|
4746
4746
|
}
|
|
4747
4747
|
) : i = lt(a, u.dataType, s) : i = JSON.stringify(s);
|
|
4748
4748
|
return i == null || Array.isArray(i) && i.length === 0 ? /* @__PURE__ */ n(At, {}) : i;
|
|
4749
|
-
},
|
|
4749
|
+
}, ee);
|
|
4750
4750
|
function lt(e, t, r) {
|
|
4751
4751
|
return console.warn(`Unexpected value for property ${e}, of type ${t}`, r), /* @__PURE__ */ n(
|
|
4752
4752
|
Ee,
|
|
@@ -4763,7 +4763,7 @@ function Bu({
|
|
|
4763
4763
|
size: i
|
|
4764
4764
|
// entity
|
|
4765
4765
|
}) {
|
|
4766
|
-
const o =
|
|
4766
|
+
const o = ue(), a = pt({
|
|
4767
4767
|
propertyKey: e,
|
|
4768
4768
|
property: r,
|
|
4769
4769
|
propertyValue: t,
|
|
@@ -4789,7 +4789,7 @@ function Bu({
|
|
|
4789
4789
|
"div",
|
|
4790
4790
|
{
|
|
4791
4791
|
className: "table-cell",
|
|
4792
|
-
children: /* @__PURE__ */ n(
|
|
4792
|
+
children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
4793
4793
|
Re,
|
|
4794
4794
|
{
|
|
4795
4795
|
propertyKey: g,
|
|
@@ -4829,7 +4829,7 @@ function fo({
|
|
|
4829
4829
|
path: r,
|
|
4830
4830
|
className: i
|
|
4831
4831
|
}) {
|
|
4832
|
-
const o =
|
|
4832
|
+
const o = ue(), s = pe(() => qe({
|
|
4833
4833
|
collection: t,
|
|
4834
4834
|
path: r,
|
|
4835
4835
|
entityId: e.id,
|
|
@@ -4837,7 +4837,7 @@ function fo({
|
|
|
4837
4837
|
fields: o.propertyConfigs
|
|
4838
4838
|
}), [t, r, e]).properties;
|
|
4839
4839
|
return /* @__PURE__ */ n("div", { className: "w-full " + i, children: /* @__PURE__ */ _("div", { className: "w-full mb-4", children: [
|
|
4840
|
-
/* @__PURE__ */ _("div", { className:
|
|
4840
|
+
/* @__PURE__ */ _("div", { className: ne(Be, "flex justify-between py-2 border-b last:border-b-0"), children: [
|
|
4841
4841
|
/* @__PURE__ */ n("div", { className: "flex items-center w-1/4", children: /* @__PURE__ */ n("span", { className: "pl-2 text-sm text-gray-600", children: "Id" }) }),
|
|
4842
4842
|
/* @__PURE__ */ _(
|
|
4843
4843
|
"div",
|
|
@@ -4851,7 +4851,7 @@ function fo({
|
|
|
4851
4851
|
href: o.entityLinkBuilder({ entity: e }),
|
|
4852
4852
|
rel: "noopener noreferrer",
|
|
4853
4853
|
target: "_blank",
|
|
4854
|
-
children: /* @__PURE__ */ n(
|
|
4854
|
+
children: /* @__PURE__ */ n(le, { children: /* @__PURE__ */ n(
|
|
4855
4855
|
ar,
|
|
4856
4856
|
{
|
|
4857
4857
|
size: "small"
|
|
@@ -4868,7 +4868,7 @@ function fo({
|
|
|
4868
4868
|
return /* @__PURE__ */ _(
|
|
4869
4869
|
"div",
|
|
4870
4870
|
{
|
|
4871
|
-
className:
|
|
4871
|
+
className: ne(Be, "flex justify-between py-2 border-b last:border-b-0"),
|
|
4872
4872
|
children: [
|
|
4873
4873
|
/* @__PURE__ */ n("div", { className: "flex items-center w-1/4", children: /* @__PURE__ */ n("span", { className: "pl-2 text-sm text-gray-600", children: c.name }) }),
|
|
4874
4874
|
/* @__PURE__ */ n(
|
|
@@ -4894,7 +4894,7 @@ function fo({
|
|
|
4894
4894
|
] }) });
|
|
4895
4895
|
}
|
|
4896
4896
|
function nl(e) {
|
|
4897
|
-
const t =
|
|
4897
|
+
const t = I.useRef(null), {
|
|
4898
4898
|
disabled: r,
|
|
4899
4899
|
value: i,
|
|
4900
4900
|
multiline: o,
|
|
@@ -4904,7 +4904,7 @@ function nl(e) {
|
|
|
4904
4904
|
M(() => {
|
|
4905
4905
|
l.current !== i && i !== c && d(i), l.current = i;
|
|
4906
4906
|
}, [i]);
|
|
4907
|
-
const f =
|
|
4907
|
+
const f = I.useCallback(() => {
|
|
4908
4908
|
!i && !c || c !== i && (l.current = c, a(c));
|
|
4909
4909
|
}, [c, a, i]);
|
|
4910
4910
|
return mi(c, f, !s, 2e3), M(() => {
|
|
@@ -4954,7 +4954,7 @@ function Er(e) {
|
|
|
4954
4954
|
updateValue: c,
|
|
4955
4955
|
multiple: d,
|
|
4956
4956
|
valueType: u
|
|
4957
|
-
} = e, f = Array.isArray(o) && d || !Array.isArray(o) && !d, m =
|
|
4957
|
+
} = e, f = Array.isArray(o) && d || !Array.isArray(o) && !d, m = I.useRef(null);
|
|
4958
4958
|
M(() => {
|
|
4959
4959
|
m.current && l && m.current?.focus({ preventScroll: !0 });
|
|
4960
4960
|
}, [l, m]);
|
|
@@ -5058,7 +5058,7 @@ function ol(e) {
|
|
|
5058
5058
|
M(() => {
|
|
5059
5059
|
c.current !== r && String(r) !== s && l(r ? r.toString() : null), c.current = r;
|
|
5060
5060
|
}, [r]);
|
|
5061
|
-
const d =
|
|
5061
|
+
const d = I.useCallback(() => {
|
|
5062
5062
|
if (s !== a)
|
|
5063
5063
|
if (s != null) {
|
|
5064
5064
|
const m = parseFloat(s);
|
|
@@ -5074,7 +5074,7 @@ function ol(e) {
|
|
|
5074
5074
|
},
|
|
5075
5075
|
[r, o]
|
|
5076
5076
|
);
|
|
5077
|
-
const u =
|
|
5077
|
+
const u = I.useRef(null);
|
|
5078
5078
|
M(() => {
|
|
5079
5079
|
u.current && o && u.current.focus({ preventScroll: !0 });
|
|
5080
5080
|
}, [o, u]);
|
|
@@ -5100,7 +5100,7 @@ function al(e) {
|
|
|
5100
5100
|
internalValue: t,
|
|
5101
5101
|
updateValue: r,
|
|
5102
5102
|
focused: i
|
|
5103
|
-
} = e, o =
|
|
5103
|
+
} = e, o = I.useRef(null);
|
|
5104
5104
|
return M(() => {
|
|
5105
5105
|
o.current && i && o.current.focus({ preventScroll: !0 });
|
|
5106
5106
|
}, [i, o]), /* @__PURE__ */ n(
|
|
@@ -5114,7 +5114,7 @@ function al(e) {
|
|
|
5114
5114
|
);
|
|
5115
5115
|
}
|
|
5116
5116
|
function sl(e) {
|
|
5117
|
-
const { locale: t } =
|
|
5117
|
+
const { locale: t } = ue(), {
|
|
5118
5118
|
disabled: r,
|
|
5119
5119
|
error: i,
|
|
5120
5120
|
mode: o,
|
|
@@ -5135,7 +5135,7 @@ function sl(e) {
|
|
|
5135
5135
|
}
|
|
5136
5136
|
);
|
|
5137
5137
|
}
|
|
5138
|
-
class
|
|
5138
|
+
class de extends I.Component {
|
|
5139
5139
|
constructor(t) {
|
|
5140
5140
|
super(t), this.state = { error: null };
|
|
5141
5141
|
}
|
|
@@ -5211,7 +5211,7 @@ function go({
|
|
|
5211
5211
|
size: m
|
|
5212
5212
|
})), [h, A] = Q(i), [y, b] = Q(p);
|
|
5213
5213
|
M(() => {
|
|
5214
|
-
|
|
5214
|
+
ee(h, i) || (A(i), b(p));
|
|
5215
5215
|
}, [p, i, h]);
|
|
5216
5216
|
const w = k(async (v) => {
|
|
5217
5217
|
if (d.fileName) {
|
|
@@ -5230,7 +5230,7 @@ function go({
|
|
|
5230
5230
|
}
|
|
5231
5231
|
let F;
|
|
5232
5232
|
C.storagePathOrDownloadUrl = R, C.metadata = N, F = [...y], F = Li(F), b(F);
|
|
5233
|
-
const D = F.filter((
|
|
5233
|
+
const D = F.filter((Y) => !!Y.storagePathOrDownloadUrl).map((Y) => Y.storagePathOrDownloadUrl);
|
|
5234
5234
|
c(u ? D : D ? D[0] : null);
|
|
5235
5235
|
}, [y, u, c, d, s]), B = k(async (v) => {
|
|
5236
5236
|
if (!v.length || l)
|
|
@@ -5305,7 +5305,7 @@ function Ao({
|
|
|
5305
5305
|
imageSize: o,
|
|
5306
5306
|
simple: a
|
|
5307
5307
|
}) {
|
|
5308
|
-
const s = qt(), l = gt(), [c, d] =
|
|
5308
|
+
const s = qt(), l = gt(), [c, d] = I.useState(), [u, f] = I.useState(!1), m = I.useRef(!1), g = I.useRef(!1), p = k((h, A) => {
|
|
5309
5309
|
g.current || (g.current = !0, d(void 0), f(!0), s.uploadFile({
|
|
5310
5310
|
file: h,
|
|
5311
5311
|
fileName: A,
|
|
@@ -5322,9 +5322,9 @@ function Ao({
|
|
|
5322
5322
|
g.current = !1;
|
|
5323
5323
|
}));
|
|
5324
5324
|
}, [t, r, i, s, e]);
|
|
5325
|
-
return
|
|
5325
|
+
return I.useEffect(() => (m.current = !0, t.file && p(t.file, t.fileName), () => {
|
|
5326
5326
|
m.current = !1;
|
|
5327
|
-
}), [t.file, t.fileName, p]), a ? /* @__PURE__ */ n("div", { className: `m-4 w-${o} h-${o}`, children: u && /* @__PURE__ */ n(Ue, { className: `w-${o} h-${o}` }) }) : /* @__PURE__ */ _("div", { className:
|
|
5327
|
+
}), [t.file, t.fileName, p]), a ? /* @__PURE__ */ n("div", { className: `m-4 w-${o} h-${o}`, children: u && /* @__PURE__ */ n(Ue, { className: `w-${o} h-${o}` }) }) : /* @__PURE__ */ _("div", { className: ne(
|
|
5328
5328
|
lr,
|
|
5329
5329
|
"relative m-4 border-box flex items-center justify-center",
|
|
5330
5330
|
`min-w-[${o}px] min-h-[${o}px]`
|
|
@@ -5351,7 +5351,7 @@ function bo({ showError: e, disabled: t, showExpandIcon: r, selected: i, openPop
|
|
|
5351
5351
|
}, [i]), /* @__PURE__ */ n(V, { children: (e || !t && r) && /* @__PURE__ */ _("div", { ref: s, className: "absolute top-0.5 right-0.5 flex items-center", children: [
|
|
5352
5352
|
i && a,
|
|
5353
5353
|
i && !t && r && /* @__PURE__ */ n(
|
|
5354
|
-
|
|
5354
|
+
le,
|
|
5355
5355
|
{
|
|
5356
5356
|
ref: c,
|
|
5357
5357
|
color: "inherit",
|
|
@@ -5497,30 +5497,30 @@ function gl({
|
|
|
5497
5497
|
isDragReject: D
|
|
5498
5498
|
} = Dn(
|
|
5499
5499
|
{
|
|
5500
|
-
accept: g.acceptedFiles ? g.acceptedFiles.map((P) => ({ [P]: [] })).reduce((P,
|
|
5500
|
+
accept: g.acceptedFiles ? g.acceptedFiles.map((P) => ({ [P]: [] })).reduce((P, re) => ({ ...P, ...re }), {}) : void 0,
|
|
5501
5501
|
disabled: f,
|
|
5502
5502
|
maxSize: g.maxSize,
|
|
5503
5503
|
noClick: !0,
|
|
5504
5504
|
noKeyboard: !0,
|
|
5505
5505
|
onDrop: p,
|
|
5506
|
-
onDropRejected: (P,
|
|
5507
|
-
for (const
|
|
5508
|
-
for (const G of
|
|
5506
|
+
onDropRejected: (P, re) => {
|
|
5507
|
+
for (const Z of P)
|
|
5508
|
+
for (const G of Z.errors)
|
|
5509
5509
|
B.open({
|
|
5510
5510
|
type: "error",
|
|
5511
5511
|
message: `Error uploading file: File is larger than ${g.maxSize} bytes`
|
|
5512
5512
|
});
|
|
5513
5513
|
}
|
|
5514
5514
|
}
|
|
5515
|
-
), { ...
|
|
5515
|
+
), { ...Y } = C(), oe = d ? "Drag 'n' drop some files here, or click here to edit" : "Drag 'n' drop a file here, or click here edit", z = d ? e.of : e, q = pe(() => wt(w), [w]), te = !f && l;
|
|
5516
5516
|
return /* @__PURE__ */ _(
|
|
5517
5517
|
"div",
|
|
5518
5518
|
{
|
|
5519
|
-
...
|
|
5519
|
+
...Y,
|
|
5520
5520
|
onMouseEnter: () => b(!0),
|
|
5521
5521
|
onMouseMove: () => b(!0),
|
|
5522
5522
|
onMouseLeave: () => b(!1),
|
|
5523
|
-
className:
|
|
5523
|
+
className: ne(
|
|
5524
5524
|
ul,
|
|
5525
5525
|
"relative w-full h-full flex",
|
|
5526
5526
|
`justify-${E ? "start" : "center"}`,
|
|
@@ -5530,9 +5530,9 @@ function gl({
|
|
|
5530
5530
|
),
|
|
5531
5531
|
children: [
|
|
5532
5532
|
/* @__PURE__ */ n("input", { autoFocus: m, ...N() }),
|
|
5533
|
-
r.map((P,
|
|
5534
|
-
let
|
|
5535
|
-
return P.storagePathOrDownloadUrl ?
|
|
5533
|
+
r.map((P, re) => {
|
|
5534
|
+
let Z;
|
|
5535
|
+
return P.storagePathOrDownloadUrl ? Z = /* @__PURE__ */ n(
|
|
5536
5536
|
Al,
|
|
5537
5537
|
{
|
|
5538
5538
|
property: z,
|
|
@@ -5540,19 +5540,19 @@ function gl({
|
|
|
5540
5540
|
entity: a,
|
|
5541
5541
|
size: w
|
|
5542
5542
|
},
|
|
5543
|
-
`storage_preview_${
|
|
5544
|
-
) : P.file && (
|
|
5543
|
+
`storage_preview_${re}`
|
|
5544
|
+
) : P.file && (Z = /* @__PURE__ */ n(
|
|
5545
5545
|
Ao,
|
|
5546
5546
|
{
|
|
5547
5547
|
entry: P,
|
|
5548
5548
|
metadata: x,
|
|
5549
5549
|
storagePath: A(P.file),
|
|
5550
5550
|
onFileUploadComplete: h,
|
|
5551
|
-
imageSize:
|
|
5551
|
+
imageSize: q,
|
|
5552
5552
|
simple: !0
|
|
5553
5553
|
},
|
|
5554
|
-
`storage_progress_${
|
|
5555
|
-
)),
|
|
5554
|
+
`storage_progress_${re}`
|
|
5555
|
+
)), Z;
|
|
5556
5556
|
}),
|
|
5557
5557
|
!r && /* @__PURE__ */ n(
|
|
5558
5558
|
"div",
|
|
@@ -5573,13 +5573,13 @@ function gl({
|
|
|
5573
5573
|
/* @__PURE__ */ n(
|
|
5574
5574
|
bo,
|
|
5575
5575
|
{
|
|
5576
|
-
showError:
|
|
5576
|
+
showError: te,
|
|
5577
5577
|
disabled: f,
|
|
5578
5578
|
showExpandIcon: !0,
|
|
5579
5579
|
selected: s,
|
|
5580
5580
|
openPopup: f ? void 0 : o,
|
|
5581
5581
|
children: /* @__PURE__ */ n(
|
|
5582
|
-
|
|
5582
|
+
le,
|
|
5583
5583
|
{
|
|
5584
5584
|
color: "inherit",
|
|
5585
5585
|
size: "small",
|
|
@@ -5603,7 +5603,7 @@ function Al({
|
|
|
5603
5603
|
"div",
|
|
5604
5604
|
{
|
|
5605
5605
|
className: "relative m-2",
|
|
5606
|
-
children: t && /* @__PURE__ */ n(
|
|
5606
|
+
children: t && /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
5607
5607
|
Re,
|
|
5608
5608
|
{
|
|
5609
5609
|
propertyKey: "ignore",
|
|
@@ -5616,7 +5616,7 @@ function Al({
|
|
|
5616
5616
|
);
|
|
5617
5617
|
}
|
|
5618
5618
|
function Ji(e) {
|
|
5619
|
-
const t =
|
|
5619
|
+
const t = ue(), r = ke(), { path: i } = e, o = r.getCollection(i);
|
|
5620
5620
|
if (!o) {
|
|
5621
5621
|
if (t.components?.missingReference)
|
|
5622
5622
|
return /* @__PURE__ */ n(t.components.missingReference, { path: i });
|
|
@@ -5624,7 +5624,7 @@ function Ji(e) {
|
|
|
5624
5624
|
}
|
|
5625
5625
|
return /* @__PURE__ */ n(bl, { ...e, collection: o });
|
|
5626
5626
|
}
|
|
5627
|
-
const bl =
|
|
5627
|
+
const bl = I.memo(
|
|
5628
5628
|
function(t) {
|
|
5629
5629
|
const {
|
|
5630
5630
|
name: r,
|
|
@@ -5718,7 +5718,7 @@ const bl = S.memo(
|
|
|
5718
5718
|
}
|
|
5719
5719
|
) : /* @__PURE__ */ n(Ee, { error: "The specified collection does not exist" });
|
|
5720
5720
|
},
|
|
5721
|
-
|
|
5721
|
+
ee
|
|
5722
5722
|
);
|
|
5723
5723
|
ze.addMethod(ze.array, "uniqueInArray", function(e = (r) => r, t) {
|
|
5724
5724
|
return this.test("uniqueInArray", t, (r) => !r || r.length === new Set(r.map(e)).size);
|
|
@@ -5986,7 +5986,7 @@ const Sl = ({
|
|
|
5986
5986
|
}) => /* @__PURE__ */ n(
|
|
5987
5987
|
"div",
|
|
5988
5988
|
{
|
|
5989
|
-
className:
|
|
5989
|
+
className: ne(
|
|
5990
5990
|
"flex flex-col max-h-full w-full",
|
|
5991
5991
|
{
|
|
5992
5992
|
"items-start": r || t
|
|
@@ -6001,7 +6001,7 @@ const Sl = ({
|
|
|
6001
6001
|
},
|
|
6002
6002
|
children: o
|
|
6003
6003
|
}
|
|
6004
|
-
), nr =
|
|
6004
|
+
), nr = I.memo(
|
|
6005
6005
|
function({
|
|
6006
6006
|
children: t,
|
|
6007
6007
|
actions: r,
|
|
@@ -6020,14 +6020,14 @@ const Sl = ({
|
|
|
6020
6020
|
hideOverflow: h = !0,
|
|
6021
6021
|
showExpandIcon: A = !0
|
|
6022
6022
|
}) {
|
|
6023
|
-
const [y, b] = In(), w = he(null), x =
|
|
6023
|
+
const [y, b] = In(), w = he(null), x = pe(() => vt(i), [i]), [E, B] = Q(!1), [v, C] = Q(l), N = !a && c;
|
|
6024
6024
|
M(() => {
|
|
6025
6025
|
l && C(!0);
|
|
6026
|
-
const
|
|
6026
|
+
const Z = setTimeout(() => {
|
|
6027
6027
|
C(!1);
|
|
6028
6028
|
}, 800);
|
|
6029
6029
|
return () => {
|
|
6030
|
-
clearTimeout(
|
|
6030
|
+
clearTimeout(Z);
|
|
6031
6031
|
};
|
|
6032
6032
|
}, [l]);
|
|
6033
6033
|
let R = 0;
|
|
@@ -6060,16 +6060,16 @@ const Sl = ({
|
|
|
6060
6060
|
const D = k(() => {
|
|
6061
6061
|
if (!g)
|
|
6062
6062
|
return;
|
|
6063
|
-
const
|
|
6064
|
-
a ? g(void 0) : !o &&
|
|
6065
|
-
}, [w, g, o, a]),
|
|
6066
|
-
D(),
|
|
6067
|
-
}, [D]), oe =
|
|
6063
|
+
const Z = w && w?.current?.getBoundingClientRect();
|
|
6064
|
+
a ? g(void 0) : !o && Z && g(Z);
|
|
6065
|
+
}, [w, g, o, a]), Y = k((Z) => {
|
|
6066
|
+
D(), Z.stopPropagation();
|
|
6067
|
+
}, [D]), oe = pe(() => b ? b.height > x : !1, [b, x]), z = !N && o, q = !a && u && oe, te = !a && !u && oe, P = k(() => B(!0), []), re = k(() => B(!1), []);
|
|
6068
6068
|
return /* @__PURE__ */ _(
|
|
6069
6069
|
"div",
|
|
6070
6070
|
{
|
|
6071
6071
|
ref: w,
|
|
6072
|
-
className:
|
|
6072
|
+
className: ne(
|
|
6073
6073
|
"transition-colors duration-100 ease-in-out",
|
|
6074
6074
|
`flex relative h-full rounded-md p-${R} border border-4 border-opacity-75`,
|
|
6075
6075
|
E && !a ? "bg-gray-50 dark:bg-gray-900" : "",
|
|
@@ -6088,20 +6088,20 @@ const Sl = ({
|
|
|
6088
6088
|
textAlign: d
|
|
6089
6089
|
},
|
|
6090
6090
|
tabIndex: o || a ? void 0 : 0,
|
|
6091
|
-
onFocus:
|
|
6091
|
+
onFocus: Y,
|
|
6092
6092
|
onMouseEnter: P,
|
|
6093
6093
|
onMouseMove: P,
|
|
6094
|
-
onMouseLeave:
|
|
6094
|
+
onMouseLeave: re,
|
|
6095
6095
|
children: [
|
|
6096
|
-
/* @__PURE__ */ _(
|
|
6097
|
-
m && !
|
|
6098
|
-
(!m ||
|
|
6096
|
+
/* @__PURE__ */ _(de, { children: [
|
|
6097
|
+
m && !te && t,
|
|
6098
|
+
(!m || te) && /* @__PURE__ */ n(
|
|
6099
6099
|
Sl,
|
|
6100
6100
|
{
|
|
6101
6101
|
fullHeight: m ?? !1,
|
|
6102
6102
|
justifyContent: F,
|
|
6103
|
-
scrollable:
|
|
6104
|
-
faded:
|
|
6103
|
+
scrollable: q ?? !1,
|
|
6104
|
+
faded: te,
|
|
6105
6105
|
children: !m && /* @__PURE__ */ n(
|
|
6106
6106
|
"div",
|
|
6107
6107
|
{
|
|
@@ -6125,11 +6125,11 @@ const Sl = ({
|
|
|
6125
6125
|
);
|
|
6126
6126
|
},
|
|
6127
6127
|
(e, t) => e.error === t.error && e.value === t.value && e.disabled === t.disabled && e.saved === t.saved && e.allowScroll === t.allowScroll && e.align === t.align && e.size === t.size && e.disabledTooltip === t.disabledTooltip && e.width === t.width && e.showExpandIcon === t.showExpandIcon && e.removePadding === t.removePadding && e.fullHeight === t.fullHeight && e.selected === t.selected
|
|
6128
|
-
), wo =
|
|
6128
|
+
), wo = I.createContext({}), Il = () => je(wo);
|
|
6129
6129
|
function Nl(e) {
|
|
6130
6130
|
return e.dataType === "string" && e.storage ? !0 : e.dataType === "array" ? Array.isArray(e.of) ? !1 : e.of?.dataType === "string" && e.of?.storage : !1;
|
|
6131
6131
|
}
|
|
6132
|
-
const Fl =
|
|
6132
|
+
const Fl = I.memo(
|
|
6133
6133
|
function({
|
|
6134
6134
|
propertyKey: t,
|
|
6135
6135
|
customFieldValidator: r,
|
|
@@ -6153,7 +6153,7 @@ const Fl = S.memo(
|
|
|
6153
6153
|
N(!0), setTimeout(() => {
|
|
6154
6154
|
N(!1);
|
|
6155
6155
|
}, 100);
|
|
6156
|
-
}, []), F = !!o.Field, D = !!o.Preview,
|
|
6156
|
+
}, []), F = !!o.Field, D = !!o.Preview, Y = Yt(o), oe = typeof o.disabled == "object" ? o.disabled.disabledMessage : void 0, z = u || f || !!o.disabled, q = pe(() => Mt({
|
|
6157
6157
|
property: o,
|
|
6158
6158
|
entityId: d.id,
|
|
6159
6159
|
customFieldValidator: r,
|
|
@@ -6161,12 +6161,12 @@ const Fl = S.memo(
|
|
|
6161
6161
|
}), [d.id, o, t]);
|
|
6162
6162
|
M(
|
|
6163
6163
|
() => {
|
|
6164
|
-
|
|
6164
|
+
ee(i, E.current) || (v(void 0), x(i), E.current = i, R());
|
|
6165
6165
|
},
|
|
6166
6166
|
[R, i]
|
|
6167
6167
|
);
|
|
6168
|
-
const
|
|
6169
|
-
|
|
6168
|
+
const te = (O) => {
|
|
6169
|
+
ee(O, E.current) || (N(!1), q.validate(O).then(() => {
|
|
6170
6170
|
v(void 0), E.current = O, g && g({
|
|
6171
6171
|
value: O,
|
|
6172
6172
|
propertyKey: t,
|
|
@@ -6176,25 +6176,25 @@ const Fl = S.memo(
|
|
|
6176
6176
|
fullPath: c,
|
|
6177
6177
|
context: m
|
|
6178
6178
|
});
|
|
6179
|
-
}).catch((
|
|
6180
|
-
v(
|
|
6179
|
+
}).catch((S) => {
|
|
6180
|
+
v(S);
|
|
6181
6181
|
}));
|
|
6182
6182
|
};
|
|
6183
6183
|
M(() => {
|
|
6184
|
-
|
|
6184
|
+
q.validate(w).then(() => v(void 0)).catch((O) => {
|
|
6185
6185
|
v(O);
|
|
6186
6186
|
});
|
|
6187
|
-
}, [w,
|
|
6187
|
+
}, [w, q, t, o, d]);
|
|
6188
6188
|
const P = (O) => {
|
|
6189
|
-
let
|
|
6190
|
-
O === void 0 ?
|
|
6189
|
+
let S;
|
|
6190
|
+
O === void 0 ? S = null : S = O, x(S), te(S);
|
|
6191
6191
|
};
|
|
6192
6192
|
Le({
|
|
6193
6193
|
property: o,
|
|
6194
6194
|
value: w,
|
|
6195
6195
|
setValue: P
|
|
6196
6196
|
});
|
|
6197
|
-
const
|
|
6197
|
+
const re = k((O) => {
|
|
6198
6198
|
A(O ? {
|
|
6199
6199
|
width: s,
|
|
6200
6200
|
height: l,
|
|
@@ -6202,7 +6202,7 @@ const Fl = S.memo(
|
|
|
6202
6202
|
cellRect: O,
|
|
6203
6203
|
propertyKey: t
|
|
6204
6204
|
} : void 0);
|
|
6205
|
-
}, [d, l, t, A, s]),
|
|
6205
|
+
}, [d, l, t, A, s]), Z = (O) => {
|
|
6206
6206
|
y && y(O ? {
|
|
6207
6207
|
width: s,
|
|
6208
6208
|
height: l,
|
|
@@ -6211,9 +6211,9 @@ const Fl = S.memo(
|
|
|
6211
6211
|
propertyKey: t
|
|
6212
6212
|
} : void 0);
|
|
6213
6213
|
};
|
|
6214
|
-
let G,
|
|
6214
|
+
let G, me = !1, ie = !1, se = !0, T = !1, K = !1, X = !0;
|
|
6215
6215
|
const ae = !z && B;
|
|
6216
|
-
if (u ||
|
|
6216
|
+
if (u || Y)
|
|
6217
6217
|
return /* @__PURE__ */ n(
|
|
6218
6218
|
nr,
|
|
6219
6219
|
{
|
|
@@ -6223,7 +6223,7 @@ const Fl = S.memo(
|
|
|
6223
6223
|
value: w,
|
|
6224
6224
|
align: a ?? "left",
|
|
6225
6225
|
fullHeight: !1,
|
|
6226
|
-
disabledTooltip: oe ?? (
|
|
6226
|
+
disabledTooltip: oe ?? (Y ? "Read only" : void 0),
|
|
6227
6227
|
disabled: !0,
|
|
6228
6228
|
children: /* @__PURE__ */ n(
|
|
6229
6229
|
Re,
|
|
@@ -6248,7 +6248,7 @@ const Fl = S.memo(
|
|
|
6248
6248
|
disabled: z,
|
|
6249
6249
|
focused: b,
|
|
6250
6250
|
selected: b,
|
|
6251
|
-
openPopup: y ?
|
|
6251
|
+
openPopup: y ? Z : void 0,
|
|
6252
6252
|
property: o,
|
|
6253
6253
|
entity: d,
|
|
6254
6254
|
path: c,
|
|
@@ -6257,10 +6257,10 @@ const Fl = S.memo(
|
|
|
6257
6257
|
updateValue: P,
|
|
6258
6258
|
propertyKey: t
|
|
6259
6259
|
}
|
|
6260
|
-
),
|
|
6260
|
+
), X = !1, ie = !0, K = !0, T = !0;
|
|
6261
6261
|
else if (b && o.dataType === "number") {
|
|
6262
|
-
const
|
|
6263
|
-
|
|
6262
|
+
const S = o;
|
|
6263
|
+
S.enumValues ? (G = /* @__PURE__ */ n(
|
|
6264
6264
|
Er,
|
|
6265
6265
|
{
|
|
6266
6266
|
name: t,
|
|
@@ -6269,12 +6269,12 @@ const Fl = S.memo(
|
|
|
6269
6269
|
focused: b,
|
|
6270
6270
|
valueType: "number",
|
|
6271
6271
|
small: it(p) !== "medium",
|
|
6272
|
-
enumValues:
|
|
6272
|
+
enumValues: S.enumValues,
|
|
6273
6273
|
error: B,
|
|
6274
6274
|
internalValue: w,
|
|
6275
6275
|
updateValue: P
|
|
6276
6276
|
}
|
|
6277
|
-
),
|
|
6277
|
+
), K = !0) : (G = /* @__PURE__ */ n(
|
|
6278
6278
|
ol,
|
|
6279
6279
|
{
|
|
6280
6280
|
align: a,
|
|
@@ -6284,10 +6284,10 @@ const Fl = S.memo(
|
|
|
6284
6284
|
value: w,
|
|
6285
6285
|
updateValue: P
|
|
6286
6286
|
}
|
|
6287
|
-
),
|
|
6287
|
+
), me = !0);
|
|
6288
6288
|
} else if (b && o.dataType === "string") {
|
|
6289
|
-
const
|
|
6290
|
-
if (
|
|
6289
|
+
const S = o;
|
|
6290
|
+
if (S.enumValues)
|
|
6291
6291
|
G = /* @__PURE__ */ n(
|
|
6292
6292
|
Er,
|
|
6293
6293
|
{
|
|
@@ -6297,25 +6297,25 @@ const Fl = S.memo(
|
|
|
6297
6297
|
disabled: z,
|
|
6298
6298
|
valueType: "string",
|
|
6299
6299
|
small: it(p) !== "medium",
|
|
6300
|
-
enumValues:
|
|
6300
|
+
enumValues: S.enumValues,
|
|
6301
6301
|
error: B,
|
|
6302
6302
|
internalValue: w,
|
|
6303
6303
|
updateValue: P
|
|
6304
6304
|
}
|
|
6305
|
-
),
|
|
6306
|
-
else if (!
|
|
6307
|
-
const
|
|
6305
|
+
), K = !0;
|
|
6306
|
+
else if (!S.storage) {
|
|
6307
|
+
const U = !!S.multiline || !!S.markdown;
|
|
6308
6308
|
G = /* @__PURE__ */ n(
|
|
6309
6309
|
nl,
|
|
6310
6310
|
{
|
|
6311
6311
|
error: B,
|
|
6312
6312
|
disabled: z,
|
|
6313
|
-
multiline:
|
|
6313
|
+
multiline: U,
|
|
6314
6314
|
focused: b,
|
|
6315
6315
|
value: w,
|
|
6316
6316
|
updateValue: P
|
|
6317
6317
|
}
|
|
6318
|
-
),
|
|
6318
|
+
), me = !0;
|
|
6319
6319
|
}
|
|
6320
6320
|
} else if (o.dataType === "boolean")
|
|
6321
6321
|
G = /* @__PURE__ */ n(
|
|
@@ -6340,7 +6340,7 @@ const Fl = S.memo(
|
|
|
6340
6340
|
internalValue: w,
|
|
6341
6341
|
updateValue: P
|
|
6342
6342
|
}
|
|
6343
|
-
),
|
|
6343
|
+
), K = !0, se = !1, me = !1;
|
|
6344
6344
|
else if (o.dataType === "reference")
|
|
6345
6345
|
typeof o.path == "string" && (G = /* @__PURE__ */ n(
|
|
6346
6346
|
Ji,
|
|
@@ -6356,12 +6356,12 @@ const Fl = S.memo(
|
|
|
6356
6356
|
title: o.name,
|
|
6357
6357
|
forceFilter: o.forceFilter
|
|
6358
6358
|
}
|
|
6359
|
-
)),
|
|
6359
|
+
)), me = !1;
|
|
6360
6360
|
else if (o.dataType === "array") {
|
|
6361
|
-
const
|
|
6362
|
-
if (!
|
|
6361
|
+
const S = o;
|
|
6362
|
+
if (!S.of && !S.oneOf)
|
|
6363
6363
|
throw Error(`You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property ${t}`);
|
|
6364
|
-
|
|
6364
|
+
S.of && !Array.isArray(S.of) && (S.of.dataType === "string" || S.of.dataType === "number" ? b && S.of.enumValues && (G = /* @__PURE__ */ n(
|
|
6365
6365
|
Er,
|
|
6366
6366
|
{
|
|
6367
6367
|
name: t,
|
|
@@ -6369,13 +6369,13 @@ const Fl = S.memo(
|
|
|
6369
6369
|
disabled: z,
|
|
6370
6370
|
focused: b,
|
|
6371
6371
|
small: it(p) !== "medium",
|
|
6372
|
-
valueType:
|
|
6373
|
-
enumValues:
|
|
6372
|
+
valueType: S.of.dataType,
|
|
6373
|
+
enumValues: S.of.enumValues,
|
|
6374
6374
|
error: B,
|
|
6375
6375
|
internalValue: w,
|
|
6376
6376
|
updateValue: P
|
|
6377
6377
|
}
|
|
6378
|
-
),
|
|
6378
|
+
), me = !0, K = !0, se = !1) : S.of.dataType === "reference" && (typeof S.of.path == "string" && (G = /* @__PURE__ */ n(
|
|
6379
6379
|
Ji,
|
|
6380
6380
|
{
|
|
6381
6381
|
name: t,
|
|
@@ -6384,15 +6384,15 @@ const Fl = S.memo(
|
|
|
6384
6384
|
updateValue: P,
|
|
6385
6385
|
size: p,
|
|
6386
6386
|
multiselect: !0,
|
|
6387
|
-
path:
|
|
6388
|
-
previewProperties:
|
|
6389
|
-
title:
|
|
6390
|
-
forceFilter:
|
|
6387
|
+
path: S.of.path,
|
|
6388
|
+
previewProperties: S.of.previewProperties,
|
|
6389
|
+
title: S.name,
|
|
6390
|
+
forceFilter: S.of.forceFilter
|
|
6391
6391
|
}
|
|
6392
|
-
)),
|
|
6392
|
+
)), me = !1));
|
|
6393
6393
|
}
|
|
6394
6394
|
}
|
|
6395
|
-
return G || (
|
|
6395
|
+
return G || (me = !1, ie = b && !G && !z && !Y, G = /* @__PURE__ */ n(
|
|
6396
6396
|
Re,
|
|
6397
6397
|
{
|
|
6398
6398
|
width: s,
|
|
@@ -6407,27 +6407,27 @@ const Fl = S.memo(
|
|
|
6407
6407
|
{
|
|
6408
6408
|
size: p,
|
|
6409
6409
|
width: s,
|
|
6410
|
-
onSelect:
|
|
6410
|
+
onSelect: re,
|
|
6411
6411
|
selected: b,
|
|
6412
|
-
disabled: z ||
|
|
6412
|
+
disabled: z || Y,
|
|
6413
6413
|
disabledTooltip: oe ?? "Disabled",
|
|
6414
6414
|
removePadding: T,
|
|
6415
|
-
fullHeight:
|
|
6415
|
+
fullHeight: K,
|
|
6416
6416
|
saved: C,
|
|
6417
6417
|
error: B,
|
|
6418
6418
|
align: a,
|
|
6419
|
-
allowScroll:
|
|
6420
|
-
showExpandIcon:
|
|
6419
|
+
allowScroll: me,
|
|
6420
|
+
showExpandIcon: ie,
|
|
6421
6421
|
value: w,
|
|
6422
|
-
hideOverflow:
|
|
6423
|
-
actions:
|
|
6422
|
+
hideOverflow: se,
|
|
6423
|
+
actions: X && /* @__PURE__ */ n(
|
|
6424
6424
|
bo,
|
|
6425
6425
|
{
|
|
6426
6426
|
showError: ae,
|
|
6427
6427
|
disabled: z,
|
|
6428
|
-
showExpandIcon:
|
|
6428
|
+
showExpandIcon: ie,
|
|
6429
6429
|
selected: b,
|
|
6430
|
-
openPopup: z ? void 0 :
|
|
6430
|
+
openPopup: z ? void 0 : Z
|
|
6431
6431
|
}
|
|
6432
6432
|
),
|
|
6433
6433
|
children: G
|
|
@@ -6438,9 +6438,9 @@ const Fl = S.memo(
|
|
|
6438
6438
|
Ql
|
|
6439
6439
|
);
|
|
6440
6440
|
function Ql(e, t) {
|
|
6441
|
-
return e.height === t.height && e.propertyKey === t.propertyKey && e.align === t.align && e.width === t.width &&
|
|
6441
|
+
return e.height === t.height && e.propertyKey === t.propertyKey && e.align === t.align && e.width === t.width && ee(e.property, t.property) && ee(e.value, t.value) && ee(e.entity.id, t.entity.id) && ee(e.entity.values, t.entity.values);
|
|
6442
6442
|
}
|
|
6443
|
-
const gi =
|
|
6443
|
+
const gi = function({
|
|
6444
6444
|
entity: t,
|
|
6445
6445
|
collection: r,
|
|
6446
6446
|
fullPath: i,
|
|
@@ -6465,7 +6465,7 @@ const gi = S.memo(function({
|
|
|
6465
6465
|
"div",
|
|
6466
6466
|
{
|
|
6467
6467
|
onClick: b,
|
|
6468
|
-
className:
|
|
6468
|
+
className: ne(
|
|
6469
6469
|
"h-full flex items-center justify-center flex-col bg-gray-50 dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90 z-10",
|
|
6470
6470
|
a ? "sticky left-0" : ""
|
|
6471
6471
|
),
|
|
@@ -6478,7 +6478,7 @@ const gi = S.memo(function({
|
|
|
6478
6478
|
children: [
|
|
6479
6479
|
(w || l) && /* @__PURE__ */ _("div", { className: "w-34 flex justify-center", children: [
|
|
6480
6480
|
B.map((v, C) => /* @__PURE__ */ n(_e, { title: v.name, children: /* @__PURE__ */ n(
|
|
6481
|
-
|
|
6481
|
+
le,
|
|
6482
6482
|
{
|
|
6483
6483
|
onClick: (N) => {
|
|
6484
6484
|
N.stopPropagation(), v.onClick({
|
|
@@ -6500,7 +6500,7 @@ const gi = S.memo(function({
|
|
|
6500
6500
|
Vt,
|
|
6501
6501
|
{
|
|
6502
6502
|
trigger: /* @__PURE__ */ n(
|
|
6503
|
-
|
|
6503
|
+
le,
|
|
6504
6504
|
{
|
|
6505
6505
|
size: h ? "medium" : "small",
|
|
6506
6506
|
children: /* @__PURE__ */ n(sa, {})
|
|
@@ -6558,9 +6558,9 @@ const gi = S.memo(function({
|
|
|
6558
6558
|
]
|
|
6559
6559
|
}
|
|
6560
6560
|
);
|
|
6561
|
-
}
|
|
6561
|
+
};
|
|
6562
6562
|
function Dl(e) {
|
|
6563
|
-
const t =
|
|
6563
|
+
const t = I.useRef(null), r = He(), i = I.useRef(!1);
|
|
6564
6564
|
M(() => {
|
|
6565
6565
|
t.current && i.current && !e.textSearchLoading && t.current.focus(), i.current = e.textSearchLoading ?? !1;
|
|
6566
6566
|
}, [e.textSearchLoading]);
|
|
@@ -6591,7 +6591,7 @@ function Dl(e) {
|
|
|
6591
6591
|
return /* @__PURE__ */ _(
|
|
6592
6592
|
"div",
|
|
6593
6593
|
{
|
|
6594
|
-
className:
|
|
6594
|
+
className: ne(Be, "no-scrollbar min-h-[56px] overflow-x-auto px-2 md:px-4 bg-gray-50 dark:bg-gray-900 border-b flex flex-row justify-between items-center w-full"),
|
|
6595
6595
|
children: [
|
|
6596
6596
|
/* @__PURE__ */ _("div", { className: "flex items-center gap-2 md:mr-4 mr-2", children: [
|
|
6597
6597
|
e.title && /* @__PURE__ */ n("div", { className: "hidden lg:block", children: e.title }),
|
|
@@ -6638,7 +6638,7 @@ function Ai(e) {
|
|
|
6638
6638
|
}
|
|
6639
6639
|
const _o = "collectionGroupParent";
|
|
6640
6640
|
function ko(e, t) {
|
|
6641
|
-
return
|
|
6641
|
+
return pe(() => e.propertiesOrder ? xo(e, e.propertiesOrder) : Pl(e, t), [e, t]);
|
|
6642
6642
|
}
|
|
6643
6643
|
function xo(e, t) {
|
|
6644
6644
|
return t.flatMap((r) => {
|
|
@@ -6741,7 +6741,7 @@ function jr({ text: e, ...t }) {
|
|
|
6741
6741
|
}
|
|
6742
6742
|
);
|
|
6743
6743
|
}
|
|
6744
|
-
const Ol =
|
|
6744
|
+
const Ol = I.memo(
|
|
6745
6745
|
function({
|
|
6746
6746
|
resizeHandleRef: t,
|
|
6747
6747
|
columnIndex: r,
|
|
@@ -6755,15 +6755,15 @@ const Ol = S.memo(
|
|
|
6755
6755
|
createFilterField: u,
|
|
6756
6756
|
AdditionalHeaderWidget: f
|
|
6757
6757
|
}) {
|
|
6758
|
-
const [m, g] = Q(!1), [p, h] =
|
|
6758
|
+
const [m, g] = Q(!1), [p, h] = I.useState(!1), [A, y] = I.useState(!1), b = k((v) => {
|
|
6759
6759
|
h(!0);
|
|
6760
6760
|
}, []), w = k((v, C) => {
|
|
6761
6761
|
s(c, v), C !== void 0 && h(C);
|
|
6762
6762
|
}, [c, s]), x = i === r, B = !(i !== r && i > 0) && (m || x);
|
|
6763
|
-
return /* @__PURE__ */ n(
|
|
6763
|
+
return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ _(
|
|
6764
6764
|
"div",
|
|
6765
6765
|
{
|
|
6766
|
-
className:
|
|
6766
|
+
className: ne(
|
|
6767
6767
|
"flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-gray-50 dark:bg-gray-900",
|
|
6768
6768
|
"text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 ",
|
|
6769
6769
|
"hover:bg-gray-100 dark:hover:bg-gray-800 hover:bg-opacity-50 dark:hover:bg-opacity-50",
|
|
@@ -6809,7 +6809,7 @@ const Ol = S.memo(
|
|
|
6809
6809
|
color: "secondary",
|
|
6810
6810
|
invisible: !o,
|
|
6811
6811
|
children: /* @__PURE__ */ _(
|
|
6812
|
-
|
|
6812
|
+
le,
|
|
6813
6813
|
{
|
|
6814
6814
|
size: "small",
|
|
6815
6815
|
className: m || p ? "bg-white dark:bg-gray-950" : void 0,
|
|
@@ -6839,7 +6839,7 @@ const Ol = S.memo(
|
|
|
6839
6839
|
className: A ? "hidden" : void 0,
|
|
6840
6840
|
modal: !0,
|
|
6841
6841
|
trigger: /* @__PURE__ */ n(
|
|
6842
|
-
|
|
6842
|
+
le,
|
|
6843
6843
|
{
|
|
6844
6844
|
className: m || p ? "bg-white dark:bg-gray-950" : void 0,
|
|
6845
6845
|
size: "small",
|
|
@@ -6867,7 +6867,7 @@ const Ol = S.memo(
|
|
|
6867
6867
|
"div",
|
|
6868
6868
|
{
|
|
6869
6869
|
ref: t,
|
|
6870
|
-
className:
|
|
6870
|
+
className: ne(
|
|
6871
6871
|
"absolute h-full w-[6px] top-0 right-0 cursor-col-resize",
|
|
6872
6872
|
B && "bg-gray-300 dark:bg-gray-700"
|
|
6873
6873
|
),
|
|
@@ -6878,7 +6878,7 @@ const Ol = S.memo(
|
|
|
6878
6878
|
}
|
|
6879
6879
|
) });
|
|
6880
6880
|
},
|
|
6881
|
-
|
|
6881
|
+
ee
|
|
6882
6882
|
);
|
|
6883
6883
|
function Ml({
|
|
6884
6884
|
column: e,
|
|
@@ -6918,7 +6918,7 @@ function Ml({
|
|
|
6918
6918
|
/* @__PURE__ */ n(
|
|
6919
6919
|
"div",
|
|
6920
6920
|
{
|
|
6921
|
-
className:
|
|
6921
|
+
className: ne(Be, "py-4 px-6 text-xs font-semibold uppercase border-b"),
|
|
6922
6922
|
children: e.title ?? l
|
|
6923
6923
|
}
|
|
6924
6924
|
),
|
|
@@ -7002,11 +7002,11 @@ const zl = ({
|
|
|
7002
7002
|
return /* @__PURE__ */ _(
|
|
7003
7003
|
"div",
|
|
7004
7004
|
{
|
|
7005
|
-
className:
|
|
7005
|
+
className: ne(Be, "z-20 sticky min-w-full flex w-fit flex-row top-0 left-0 h-12 border-b bg-gray-50 dark:bg-gray-900"),
|
|
7006
7006
|
children: [
|
|
7007
7007
|
e.map((E, B) => {
|
|
7008
7008
|
const v = e[B], C = v && a && a[v.key] ? a[v.key] : void 0;
|
|
7009
|
-
return /* @__PURE__ */ n(
|
|
7009
|
+
return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
7010
7010
|
Ol,
|
|
7011
7011
|
{
|
|
7012
7012
|
resizeHandleRef: u[B],
|
|
@@ -7027,7 +7027,7 @@ const zl = ({
|
|
|
7027
7027
|
]
|
|
7028
7028
|
}
|
|
7029
7029
|
);
|
|
7030
|
-
}, Vl =
|
|
7030
|
+
}, Vl = I.memo(
|
|
7031
7031
|
function({
|
|
7032
7032
|
rowData: t,
|
|
7033
7033
|
rowIndex: r,
|
|
@@ -7048,7 +7048,7 @@ const zl = ({
|
|
|
7048
7048
|
return /* @__PURE__ */ n(
|
|
7049
7049
|
"div",
|
|
7050
7050
|
{
|
|
7051
|
-
className:
|
|
7051
|
+
className: ne(
|
|
7052
7052
|
"flex min-w-full text-sm border-b border-gray-200 dark:border-gray-800 border-opacity-40 dark:border-opacity-40",
|
|
7053
7053
|
c ? c(t) : "",
|
|
7054
7054
|
{
|
|
@@ -7066,8 +7066,8 @@ const zl = ({
|
|
|
7066
7066
|
}
|
|
7067
7067
|
);
|
|
7068
7068
|
},
|
|
7069
|
-
|
|
7070
|
-
), Gl =
|
|
7069
|
+
ee
|
|
7070
|
+
), Gl = I.memo(
|
|
7071
7071
|
function(t) {
|
|
7072
7072
|
return t.rowData && t.cellRenderer(
|
|
7073
7073
|
{
|
|
@@ -7082,7 +7082,7 @@ const zl = ({
|
|
|
7082
7082
|
}
|
|
7083
7083
|
);
|
|
7084
7084
|
},
|
|
7085
|
-
(e, t) =>
|
|
7085
|
+
(e, t) => ee(e.rowData, t.rowData) && ee(e.column, t.column) && ee(e.cellData, t.cellData) && ee(e.rowIndex, t.rowIndex) && ee(e.cellRenderer, t.cellRenderer) && ee(e.columnIndex, t.columnIndex)
|
|
7086
7086
|
), hr = Wo({});
|
|
7087
7087
|
hr.displayName = "VirtualListContext";
|
|
7088
7088
|
const jl = Jo(({
|
|
@@ -7126,7 +7126,7 @@ const jl = Jo(({
|
|
|
7126
7126
|
left: 0
|
|
7127
7127
|
}, children: o })
|
|
7128
7128
|
] });
|
|
7129
|
-
} })), Yl =
|
|
7129
|
+
} })), Yl = I.memo(
|
|
7130
7130
|
function({
|
|
7131
7131
|
data: t,
|
|
7132
7132
|
onResetPagination: r,
|
|
@@ -7155,34 +7155,34 @@ const jl = Jo(({
|
|
|
7155
7155
|
M(() => {
|
|
7156
7156
|
R(a);
|
|
7157
7157
|
}, [a]);
|
|
7158
|
-
const [
|
|
7159
|
-
R(N.map((
|
|
7160
|
-
}, [N]),
|
|
7161
|
-
R(N.map((
|
|
7162
|
-
}, [N, l]),
|
|
7158
|
+
const [Y, oe] = In(), z = k((S) => {
|
|
7159
|
+
R(N.map((U) => U.key === S.column.key ? S.column : U));
|
|
7160
|
+
}, [N]), q = k((S) => {
|
|
7161
|
+
R(N.map((U) => U.key === S.column.key ? S.column : U)), l && l(S);
|
|
7162
|
+
}, [N, l]), te = he();
|
|
7163
7163
|
M(() => {
|
|
7164
|
-
|
|
7164
|
+
te.current = c;
|
|
7165
7165
|
}, [c]);
|
|
7166
7166
|
const P = k(() => {
|
|
7167
7167
|
D.current = 0, F.current && F.current.scrollTo(F.current?.scrollLeft, 0);
|
|
7168
|
-
}, []),
|
|
7169
|
-
const
|
|
7170
|
-
|
|
7171
|
-
}, [d, C, u, r, p, P, v]),
|
|
7168
|
+
}, []), re = k((S) => {
|
|
7169
|
+
const U = v === S && C === "desc", H = v === S && C === "asc" ? "desc" : U ? void 0 : "asc", ye = U ? void 0 : S, L = te.current, ce = H && ye ? [ye, H] : void 0;
|
|
7170
|
+
L && d && !d(L, ce) && u && u(void 0), r && r(), p && p(ce), P();
|
|
7171
|
+
}, [d, C, u, r, p, P, v]), Z = k(() => {
|
|
7172
7172
|
D.current = 0, p && p(void 0);
|
|
7173
|
-
}, [p]), G = Math.max((t?.length ?? 0) * vt(o) - oe.height, 0),
|
|
7174
|
-
i && (t?.length ?? 0) > 0 &&
|
|
7175
|
-
}, [t?.length, i]),
|
|
7176
|
-
scrollOffset:
|
|
7177
|
-
scrollUpdateWasRequested:
|
|
7173
|
+
}, [p]), G = Math.max((t?.length ?? 0) * vt(o) - oe.height, 0), me = k((S) => {
|
|
7174
|
+
i && (t?.length ?? 0) > 0 && S > D.current + 600 && (D.current = S, i());
|
|
7175
|
+
}, [t?.length, i]), ie = k(({
|
|
7176
|
+
scrollOffset: S,
|
|
7177
|
+
scrollUpdateWasRequested: U
|
|
7178
7178
|
}) => {
|
|
7179
|
-
!
|
|
7180
|
-
}, [G,
|
|
7179
|
+
!U && S >= G - 600 && me(S);
|
|
7180
|
+
}, [G, me]), se = k((S, U) => {
|
|
7181
7181
|
D.current = 0;
|
|
7182
|
-
const W =
|
|
7182
|
+
const W = te.current;
|
|
7183
7183
|
let H = W ? { ...W } : {};
|
|
7184
|
-
|
|
7185
|
-
}, [d, C, u,
|
|
7184
|
+
U ? H[S.key] = U : delete H[S.key], !d || d(H, v && C ? [v, C] : void 0) || (H = U ? { [S.key]: U } : {}), u && u(H), S.key !== v && Z();
|
|
7185
|
+
}, [d, C, u, Z, v]), T = k(() => /* @__PURE__ */ _(
|
|
7186
7186
|
"div",
|
|
7187
7187
|
{
|
|
7188
7188
|
className: "h-full flex flex-col items-center justify-center sticky left-0",
|
|
@@ -7191,7 +7191,7 @@ const jl = Jo(({
|
|
|
7191
7191
|
m?.message && /* @__PURE__ */ n(sr, { className: "px-4 break-all", source: m.message })
|
|
7192
7192
|
]
|
|
7193
7193
|
}
|
|
7194
|
-
), [m?.message]),
|
|
7194
|
+
), [m?.message]), K = k(() => h ? /* @__PURE__ */ n(jr, {}) : /* @__PURE__ */ _(
|
|
7195
7195
|
"div",
|
|
7196
7196
|
{
|
|
7197
7197
|
className: "flex flex-col overflow-auto items-center justify-center p-2 gap-2 h-full",
|
|
@@ -7200,7 +7200,7 @@ const jl = Jo(({
|
|
|
7200
7200
|
g
|
|
7201
7201
|
]
|
|
7202
7202
|
}
|
|
7203
|
-
), [g, h]),
|
|
7203
|
+
), [g, h]), X = !h && (t?.length ?? 0) === 0, ae = m ? T() : X ? K() : void 0, O = {
|
|
7204
7204
|
data: t,
|
|
7205
7205
|
size: o,
|
|
7206
7206
|
cellRenderer: A,
|
|
@@ -7209,10 +7209,10 @@ const jl = Jo(({
|
|
|
7209
7209
|
onRowClick: s,
|
|
7210
7210
|
customView: ae,
|
|
7211
7211
|
onColumnResize: z,
|
|
7212
|
-
onColumnResizeEnd:
|
|
7213
|
-
filter:
|
|
7214
|
-
onColumnSort:
|
|
7215
|
-
onFilterUpdate:
|
|
7212
|
+
onColumnResizeEnd: q,
|
|
7213
|
+
filter: te.current,
|
|
7214
|
+
onColumnSort: re,
|
|
7215
|
+
onFilterUpdate: se,
|
|
7216
7216
|
sortByProperty: v,
|
|
7217
7217
|
hoverRow: y ?? !1,
|
|
7218
7218
|
createFilterField: b,
|
|
@@ -7223,8 +7223,8 @@ const jl = Jo(({
|
|
|
7223
7223
|
return /* @__PURE__ */ n(
|
|
7224
7224
|
"div",
|
|
7225
7225
|
{
|
|
7226
|
-
ref:
|
|
7227
|
-
className:
|
|
7226
|
+
ref: Y,
|
|
7227
|
+
className: ne("h-full w-full", x),
|
|
7228
7228
|
children: /* @__PURE__ */ n(
|
|
7229
7229
|
hr.Provider,
|
|
7230
7230
|
{
|
|
@@ -7236,7 +7236,7 @@ const jl = Jo(({
|
|
|
7236
7236
|
width: oe.width,
|
|
7237
7237
|
height: oe.height,
|
|
7238
7238
|
itemCount: (t?.length ?? 0) + (E ? 1 : 0),
|
|
7239
|
-
onScroll:
|
|
7239
|
+
onScroll: ie,
|
|
7240
7240
|
includeAddColumn: !!B,
|
|
7241
7241
|
itemSize: vt(o)
|
|
7242
7242
|
},
|
|
@@ -7247,7 +7247,7 @@ const jl = Jo(({
|
|
|
7247
7247
|
}
|
|
7248
7248
|
);
|
|
7249
7249
|
},
|
|
7250
|
-
|
|
7250
|
+
ee
|
|
7251
7251
|
);
|
|
7252
7252
|
function ql({
|
|
7253
7253
|
outerRef: e,
|
|
@@ -7355,19 +7355,19 @@ function Ul({
|
|
|
7355
7355
|
previewProperties: s,
|
|
7356
7356
|
setHidden: l
|
|
7357
7357
|
}) {
|
|
7358
|
-
const c = i ? ["array-contains"] : ["==", "!=", ">", "<", ">=", "<="], [d, u] =
|
|
7358
|
+
const c = i ? ["array-contains"] : ["==", "!=", ">", "<", ">=", "<="], [d, u] = I.useState(!1);
|
|
7359
7359
|
i ? c.push("array-contains-any") : c.push("in", "not-in");
|
|
7360
7360
|
const [f, m] = t || [c[0], void 0], [g, p] = Q(f), [h, A] = Q(m), y = h ? Array.isArray(h) ? h.map((F) => F instanceof We ? F.id : null).filter(Boolean) : [h.id] : [];
|
|
7361
7361
|
function b(F, D) {
|
|
7362
|
-
const
|
|
7362
|
+
const Y = Cr.includes(g), oe = Cr.includes(F);
|
|
7363
7363
|
let z = D;
|
|
7364
|
-
|
|
7365
|
-
const
|
|
7364
|
+
Y !== oe && (z = oe ? z instanceof We ? [z] : [] : void 0), p(F), A(z);
|
|
7365
|
+
const q = z !== null && Array.isArray(z) ? z.length > 0 : z !== void 0;
|
|
7366
7366
|
r(
|
|
7367
|
-
F &&
|
|
7367
|
+
F && q ? [F, z] : void 0
|
|
7368
7368
|
);
|
|
7369
7369
|
}
|
|
7370
|
-
const w = ke(), x =
|
|
7370
|
+
const w = ke(), x = pe(() => o ? w.getCollection(o) : void 0, [o]), E = (F) => {
|
|
7371
7371
|
b(g, ot(F));
|
|
7372
7372
|
}, B = (F) => {
|
|
7373
7373
|
b(g, F.map((D) => ot(D)));
|
|
@@ -7491,7 +7491,7 @@ function Ll({
|
|
|
7491
7491
|
p(u, y);
|
|
7492
7492
|
},
|
|
7493
7493
|
endAdornment: m && /* @__PURE__ */ n(
|
|
7494
|
-
|
|
7494
|
+
le,
|
|
7495
7495
|
{
|
|
7496
7496
|
onClick: (A) => p(u, void 0),
|
|
7497
7497
|
children: /* @__PURE__ */ n(Qt, {})
|
|
@@ -7509,7 +7509,7 @@ function Ll({
|
|
|
7509
7509
|
},
|
|
7510
7510
|
multiple: h,
|
|
7511
7511
|
endAdornment: m && /* @__PURE__ */ n(
|
|
7512
|
-
|
|
7512
|
+
le,
|
|
7513
7513
|
{
|
|
7514
7514
|
className: "absolute right-3 top-2",
|
|
7515
7515
|
onClick: (A) => p(u, void 0),
|
|
@@ -7587,7 +7587,7 @@ function Wl({
|
|
|
7587
7587
|
setValue: o,
|
|
7588
7588
|
title: a
|
|
7589
7589
|
}) {
|
|
7590
|
-
const { locale: s } =
|
|
7590
|
+
const { locale: s } = ue(), l = t ? ["array-contains"] : ["==", "!=", ">", "<", ">=", "<="], [c, d] = i || [l[0], void 0], [u, f] = Q(c), [m, g] = Q(d);
|
|
7591
7591
|
function p(h, A) {
|
|
7592
7592
|
let y = A;
|
|
7593
7593
|
const b = Ki.includes(u), w = Ki.includes(h);
|
|
@@ -7624,7 +7624,7 @@ function Wl({
|
|
|
7624
7624
|
) })
|
|
7625
7625
|
] });
|
|
7626
7626
|
}
|
|
7627
|
-
const Jl =
|
|
7627
|
+
const Jl = I.memo(
|
|
7628
7628
|
function({
|
|
7629
7629
|
onValueChange: t,
|
|
7630
7630
|
cellRenderer: r,
|
|
@@ -7656,37 +7656,37 @@ const Jl = S.memo(
|
|
|
7656
7656
|
columns: R,
|
|
7657
7657
|
forceFilter: F,
|
|
7658
7658
|
highlightedRow: D,
|
|
7659
|
-
endAdornment:
|
|
7659
|
+
endAdornment: Y,
|
|
7660
7660
|
AddColumnComponent: oe
|
|
7661
7661
|
}) {
|
|
7662
|
-
const z = he(null), [
|
|
7662
|
+
const z = he(null), [q, te] = I.useState(void 0), P = () => {
|
|
7663
7663
|
!E || d || u || b !== void 0 && w?.(b + x);
|
|
7664
|
-
},
|
|
7664
|
+
}, re = k(() => {
|
|
7665
7665
|
w?.(x);
|
|
7666
|
-
}, [x]),
|
|
7666
|
+
}, [x]), Z = k(({ rowData: se }) => {
|
|
7667
7667
|
if (!l)
|
|
7668
|
-
return i && i(
|
|
7668
|
+
return i && i(se);
|
|
7669
7669
|
}, [i, l]);
|
|
7670
7670
|
bn(
|
|
7671
7671
|
z,
|
|
7672
7672
|
() => {
|
|
7673
|
-
|
|
7673
|
+
q && me();
|
|
7674
7674
|
},
|
|
7675
|
-
!!
|
|
7675
|
+
!!q
|
|
7676
7676
|
), M(() => {
|
|
7677
|
-
const
|
|
7678
|
-
T.keyCode === 27 &&
|
|
7677
|
+
const se = (T) => {
|
|
7678
|
+
T.keyCode === 27 && me();
|
|
7679
7679
|
};
|
|
7680
|
-
return document.addEventListener("keydown",
|
|
7681
|
-
document.removeEventListener("keydown",
|
|
7680
|
+
return document.addEventListener("keydown", se, !1), () => {
|
|
7681
|
+
document.removeEventListener("keydown", se, !1);
|
|
7682
7682
|
};
|
|
7683
7683
|
});
|
|
7684
|
-
const G = k((
|
|
7685
|
-
|
|
7686
|
-
}, []),
|
|
7687
|
-
|
|
7688
|
-
}, []),
|
|
7689
|
-
g?.({ ...
|
|
7684
|
+
const G = k((se) => {
|
|
7685
|
+
te(se);
|
|
7686
|
+
}, []), me = k(() => {
|
|
7687
|
+
te(void 0);
|
|
7688
|
+
}, []), ie = k((se) => {
|
|
7689
|
+
g?.({ ...se, ...F });
|
|
7690
7690
|
}, [F]);
|
|
7691
7691
|
return /* @__PURE__ */ n(
|
|
7692
7692
|
wo.Provider,
|
|
@@ -7696,7 +7696,7 @@ const Jl = S.memo(
|
|
|
7696
7696
|
select: G,
|
|
7697
7697
|
onValueChange: t,
|
|
7698
7698
|
size: s ?? "m",
|
|
7699
|
-
selectedCell:
|
|
7699
|
+
selectedCell: q
|
|
7700
7700
|
},
|
|
7701
7701
|
children: /* @__PURE__ */ n(
|
|
7702
7702
|
"div",
|
|
@@ -7709,25 +7709,25 @@ const Jl = S.memo(
|
|
|
7709
7709
|
data: c,
|
|
7710
7710
|
columns: R,
|
|
7711
7711
|
cellRenderer: r,
|
|
7712
|
-
onRowClick: l ? void 0 : i ?
|
|
7712
|
+
onRowClick: l ? void 0 : i ? Z : void 0,
|
|
7713
7713
|
onEndReached: P,
|
|
7714
|
-
onResetPagination:
|
|
7714
|
+
onResetPagination: re,
|
|
7715
7715
|
error: f,
|
|
7716
7716
|
paginationEnabled: E,
|
|
7717
7717
|
onColumnResize: o,
|
|
7718
7718
|
size: s,
|
|
7719
7719
|
loading: d,
|
|
7720
7720
|
filter: m,
|
|
7721
|
-
onFilterUpdate: g ?
|
|
7721
|
+
onFilterUpdate: g ? ie : void 0,
|
|
7722
7722
|
sortBy: p,
|
|
7723
7723
|
onSortByUpdate: h,
|
|
7724
7724
|
hoverRow: a,
|
|
7725
7725
|
checkFilterCombination: B,
|
|
7726
7726
|
createFilterField: C ? Hl : void 0,
|
|
7727
|
-
rowClassName: k((
|
|
7727
|
+
rowClassName: k((se) => D?.(se) ? "bg-gray-100 bg-opacity-75 dark:bg-gray-800 dark:bg-opacity-75" : "", [D]),
|
|
7728
7728
|
className: "flex-grow",
|
|
7729
7729
|
emptyComponent: N,
|
|
7730
|
-
endAdornment:
|
|
7730
|
+
endAdornment: Y,
|
|
7731
7731
|
AddColumnComponent: oe
|
|
7732
7732
|
}
|
|
7733
7733
|
)
|
|
@@ -7736,7 +7736,7 @@ const Jl = S.memo(
|
|
|
7736
7736
|
}
|
|
7737
7737
|
);
|
|
7738
7738
|
},
|
|
7739
|
-
|
|
7739
|
+
ee
|
|
7740
7740
|
);
|
|
7741
7741
|
function Hl({
|
|
7742
7742
|
id: e,
|
|
@@ -7807,7 +7807,7 @@ function Hl({
|
|
|
7807
7807
|
}
|
|
7808
7808
|
return /* @__PURE__ */ n("div", { children: `Currently the filter field ${s.dataType} is not supported` });
|
|
7809
7809
|
}
|
|
7810
|
-
const Bo =
|
|
7810
|
+
const Bo = I.memo(
|
|
7811
7811
|
function({
|
|
7812
7812
|
forceFilter: t,
|
|
7813
7813
|
actionsStart: r,
|
|
@@ -7837,36 +7837,36 @@ const Bo = S.memo(
|
|
|
7837
7837
|
AdditionalHeaderWidget: R,
|
|
7838
7838
|
additionalIDHeaderWidget: F,
|
|
7839
7839
|
emptyComponent: D,
|
|
7840
|
-
getIdColumnWidth:
|
|
7840
|
+
getIdColumnWidth: Y,
|
|
7841
7841
|
onTextSearchClick: oe,
|
|
7842
7842
|
textSearchLoading: z
|
|
7843
7843
|
}) {
|
|
7844
|
-
const
|
|
7845
|
-
g && g(
|
|
7846
|
-
}, []),
|
|
7847
|
-
column:
|
|
7848
|
-
columnIndex:
|
|
7844
|
+
const q = he(null), te = He(), P = !!t, re = (d?.selectedEntities?.length > 0 ? d?.selectedEntities : u)?.filter(Boolean), Z = Ce(), [G, me] = I.useState(w ?? "m"), ie = re?.map((L) => L.id), se = !!E.filterValues && Object.keys(E.filterValues).length > 0, T = k((L) => {
|
|
7845
|
+
g && g(L), me(L);
|
|
7846
|
+
}, []), K = k((L) => E.setSearchString?.(L), []), X = pe(() => y ? y.map((L) => ({ [L.key]: L })).reduce((L, ce) => ({ ...L, ...ce }), {}) : {}, [y]), ae = s, O = ({
|
|
7847
|
+
column: L,
|
|
7848
|
+
columnIndex: ce,
|
|
7849
7849
|
rowData: Me,
|
|
7850
7850
|
rowIndex: Se
|
|
7851
7851
|
}) => {
|
|
7852
|
-
const we = Me, Ye =
|
|
7853
|
-
let Ze =
|
|
7852
|
+
const we = Me, Ye = L.key;
|
|
7853
|
+
let Ze = L.custom?.disabled;
|
|
7854
7854
|
const at = we.values ? dt(we.values, Ye) : void 0, Qe = l?.({
|
|
7855
7855
|
propertyKey: Ye,
|
|
7856
7856
|
propertyValue: at,
|
|
7857
7857
|
entity: we
|
|
7858
|
-
}) ??
|
|
7859
|
-
return Qe?.disabled || (Ze = !1), Qe ? /* @__PURE__ */ n(
|
|
7858
|
+
}) ?? L.custom.resolvedProperty;
|
|
7859
|
+
return Qe?.disabled || (Ze = !1), Qe ? /* @__PURE__ */ n(de, { children: we ? /* @__PURE__ */ n(
|
|
7860
7860
|
Fl,
|
|
7861
7861
|
{
|
|
7862
7862
|
readonly: !A,
|
|
7863
|
-
align:
|
|
7863
|
+
align: L.align ?? "left",
|
|
7864
7864
|
propertyKey: Ye,
|
|
7865
7865
|
property: Qe,
|
|
7866
7866
|
value: we?.values ? dt(we.values, Ye) : void 0,
|
|
7867
7867
|
customFieldValidator: ae,
|
|
7868
|
-
columnIndex:
|
|
7869
|
-
width:
|
|
7868
|
+
columnIndex: ce,
|
|
7869
|
+
width: L.width,
|
|
7870
7870
|
height: vt(G),
|
|
7871
7871
|
entity: we,
|
|
7872
7872
|
disabled: Ze,
|
|
@@ -7874,15 +7874,15 @@ const Bo = S.memo(
|
|
|
7874
7874
|
},
|
|
7875
7875
|
`property_table_cell_${we.id}_${Ye}`
|
|
7876
7876
|
) : nt() }) : null;
|
|
7877
|
-
},
|
|
7878
|
-
column:
|
|
7879
|
-
rowData:
|
|
7877
|
+
}, S = k(({
|
|
7878
|
+
column: L,
|
|
7879
|
+
rowData: ce,
|
|
7880
7880
|
width: Me
|
|
7881
7881
|
}) => {
|
|
7882
|
-
const Se =
|
|
7882
|
+
const Se = ce, we = X[L.key], Ye = we.dependencies ? Object.entries(Se.values).filter(([Qe, st]) => we.dependencies.includes(Qe)).reduce((Qe, st) => ({ ...Qe, ...st }), {}) : Se, Ze = we.Builder;
|
|
7883
7883
|
if (!Ze && !we.value)
|
|
7884
7884
|
throw new Error("When using additional fields you need to provide a Builder or a value");
|
|
7885
|
-
const at = Ze ? /* @__PURE__ */ n(Ze, { entity: Se, context:
|
|
7885
|
+
const at = Ze ? /* @__PURE__ */ n(Ze, { entity: Se, context: Z }) : /* @__PURE__ */ n(V, { children: we.value?.({ entity: Se, context: Z }) });
|
|
7886
7886
|
return /* @__PURE__ */ n(
|
|
7887
7887
|
nr,
|
|
7888
7888
|
{
|
|
@@ -7895,70 +7895,67 @@ const Bo = S.memo(
|
|
|
7895
7895
|
allowScroll: !1,
|
|
7896
7896
|
showExpandIcon: !1,
|
|
7897
7897
|
disabledTooltip: "This column can't be edited directly",
|
|
7898
|
-
children: /* @__PURE__ */ n(
|
|
7898
|
+
children: /* @__PURE__ */ n(de, { children: at })
|
|
7899
7899
|
},
|
|
7900
|
-
`additional_table_cell_${Se.id}_${
|
|
7900
|
+
`additional_table_cell_${Se.id}_${L.key}`
|
|
7901
7901
|
);
|
|
7902
|
-
}, [G,
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7902
|
+
}, [G, ie]), U = (() => {
|
|
7903
|
+
const L = Tl({
|
|
7904
|
+
properties: x,
|
|
7905
|
+
sortable: v,
|
|
7906
|
+
forceFilter: t,
|
|
7907
|
+
disabledFilter: P,
|
|
7908
|
+
AdditionalHeaderWidget: R
|
|
7909
|
+
}), ce = y ? y.map((Me) => ({
|
|
7910
|
+
key: Me.key,
|
|
7911
|
+
align: "left",
|
|
7912
|
+
sortable: !1,
|
|
7913
|
+
title: Me.name,
|
|
7914
|
+
width: Me.width ?? 200
|
|
7915
|
+
})) : [];
|
|
7916
|
+
return [...L, ...ce];
|
|
7917
|
+
})(), H = [
|
|
7918
|
+
{
|
|
7919
|
+
key: "id_ewcfedcswdf3",
|
|
7920
|
+
width: Y?.() ?? (te ? 160 : 130),
|
|
7921
|
+
title: "ID",
|
|
7922
|
+
resizable: !1,
|
|
7923
|
+
frozen: te,
|
|
7924
|
+
headerAlign: "center",
|
|
7925
|
+
align: "center",
|
|
7926
|
+
AdditionalHeaderWidget: () => F
|
|
7918
7927
|
},
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
width: j?.() ?? (Z ? 160 : 130),
|
|
7923
|
-
title: "ID",
|
|
7924
|
-
resizable: !1,
|
|
7925
|
-
frozen: Z,
|
|
7926
|
-
headerAlign: "center",
|
|
7927
|
-
align: "center",
|
|
7928
|
-
AdditionalHeaderWidget: () => F
|
|
7929
|
-
}), [j, Z]), H = se(() => [
|
|
7930
|
-
W,
|
|
7931
|
-
...b.map((U) => L.find((ue) => ue.key === U.key)).filter(Boolean)
|
|
7932
|
-
], [L, b, W]), be = k((U) => {
|
|
7933
|
-
const ue = U.column, Me = U.columns, Se = ue.key;
|
|
7928
|
+
...b.map((L) => U.find((ce) => ce.key === L.key)).filter(Boolean)
|
|
7929
|
+
], ye = (L) => {
|
|
7930
|
+
const ce = L.column, Me = L.columns, Se = ce.key;
|
|
7934
7931
|
try {
|
|
7935
|
-
if (
|
|
7932
|
+
if (L.columnIndex === 0)
|
|
7936
7933
|
return a ? a({
|
|
7937
|
-
entity:
|
|
7934
|
+
entity: L.rowData,
|
|
7938
7935
|
size: G,
|
|
7939
|
-
width:
|
|
7940
|
-
frozen:
|
|
7936
|
+
width: ce.width,
|
|
7937
|
+
frozen: ce.frozen
|
|
7941
7938
|
}) : /* @__PURE__ */ n(
|
|
7942
7939
|
gi,
|
|
7943
7940
|
{
|
|
7944
|
-
entity:
|
|
7945
|
-
width:
|
|
7946
|
-
frozen:
|
|
7941
|
+
entity: L.rowData,
|
|
7942
|
+
width: ce.width,
|
|
7943
|
+
frozen: ce.frozen,
|
|
7947
7944
|
isSelected: !1,
|
|
7948
7945
|
size: G
|
|
7949
7946
|
}
|
|
7950
7947
|
);
|
|
7951
|
-
if (
|
|
7952
|
-
return
|
|
7953
|
-
if (
|
|
7954
|
-
return O(
|
|
7948
|
+
if (X[Se])
|
|
7949
|
+
return S(L);
|
|
7950
|
+
if (L.columnIndex < Me.length + 1)
|
|
7951
|
+
return O(L);
|
|
7955
7952
|
throw Error("Internal: columns not mapped properly");
|
|
7956
7953
|
} catch (we) {
|
|
7957
7954
|
return console.error("Error rendering cell", we), /* @__PURE__ */ n(
|
|
7958
7955
|
nr,
|
|
7959
7956
|
{
|
|
7960
7957
|
size: G,
|
|
7961
|
-
width:
|
|
7958
|
+
width: ce.width,
|
|
7962
7959
|
saved: !1,
|
|
7963
7960
|
value: null,
|
|
7964
7961
|
align: "left",
|
|
@@ -7968,19 +7965,19 @@ const Bo = S.memo(
|
|
|
7968
7965
|
}
|
|
7969
7966
|
);
|
|
7970
7967
|
}
|
|
7971
|
-
}
|
|
7968
|
+
};
|
|
7972
7969
|
return /* @__PURE__ */ _(
|
|
7973
7970
|
"div",
|
|
7974
7971
|
{
|
|
7975
|
-
ref:
|
|
7972
|
+
ref: q,
|
|
7976
7973
|
className: "h-full w-full flex flex-col bg-white dark:bg-gray-950",
|
|
7977
7974
|
children: [
|
|
7978
7975
|
/* @__PURE__ */ n(
|
|
7979
7976
|
Dl,
|
|
7980
7977
|
{
|
|
7981
7978
|
forceFilter: P,
|
|
7982
|
-
filterIsSet:
|
|
7983
|
-
onTextSearch: p ?
|
|
7979
|
+
filterIsSet: se,
|
|
7980
|
+
onTextSearch: p ? K : void 0,
|
|
7984
7981
|
textSearchLoading: z,
|
|
7985
7982
|
onTextSearchClick: p ? oe : void 0,
|
|
7986
7983
|
clearFilter: E.clearFilter,
|
|
@@ -7998,9 +7995,9 @@ const Bo = S.memo(
|
|
|
7998
7995
|
columns: H,
|
|
7999
7996
|
size: G,
|
|
8000
7997
|
inlineEditing: A,
|
|
8001
|
-
cellRenderer:
|
|
7998
|
+
cellRenderer: ye,
|
|
8002
7999
|
onEntityClick: f,
|
|
8003
|
-
highlightedRow: k((
|
|
8000
|
+
highlightedRow: k((L) => ie?.includes(L.id) ?? !1, [ie]),
|
|
8004
8001
|
tableController: E,
|
|
8005
8002
|
onValueChange: c,
|
|
8006
8003
|
onColumnResize: m,
|
|
@@ -8015,7 +8012,7 @@ const Bo = S.memo(
|
|
|
8015
8012
|
}
|
|
8016
8013
|
);
|
|
8017
8014
|
},
|
|
8018
|
-
|
|
8015
|
+
ee
|
|
8019
8016
|
);
|
|
8020
8017
|
function Zl({
|
|
8021
8018
|
data: e,
|
|
@@ -8027,10 +8024,10 @@ function Zl({
|
|
|
8027
8024
|
return [...t, ...e.filter((i) => !r.has(i.id))];
|
|
8028
8025
|
}
|
|
8029
8026
|
function Xl(e, t, r = 5e3) {
|
|
8030
|
-
const [i, o] =
|
|
8031
|
-
return
|
|
8027
|
+
const [i, o] = I.useState(e), a = I.useRef(i.length ?? 0), s = I.useRef(!1), l = I.useRef(t), c = !ee(l.current, t), d = e.length >= a.current || c;
|
|
8028
|
+
return I.useEffect(() => {
|
|
8032
8029
|
const u = () => {
|
|
8033
|
-
|
|
8030
|
+
ee(i, e) || (l.current = t, a.current = e.length, o(e)), s.current = !1;
|
|
8034
8031
|
};
|
|
8035
8032
|
s.current = !0;
|
|
8036
8033
|
let f;
|
|
@@ -8051,18 +8048,18 @@ function Co({
|
|
|
8051
8048
|
initialFilter: a,
|
|
8052
8049
|
initialSort: s,
|
|
8053
8050
|
forceFilter: l
|
|
8054
|
-
} = t, [c, d] =
|
|
8055
|
-
if (s && g && !
|
|
8051
|
+
} = t, [c, d] = I.useState(void 0), u = ke(), f = Ke(), m = pe(() => u.resolveAliasesFrom(e), [e, u.resolveAliasesFrom]), g = o ?? l, p = t.pagination === void 0 || !!t.pagination, h = typeof t.pagination == "number" ? t.pagination : Kl, [A, y] = I.useState(), [b, w] = I.useState(p ? h : void 0), x = pe(() => {
|
|
8052
|
+
if (s && g && !Z(g, s)) {
|
|
8056
8053
|
console.warn("Initial sort is not compatible with the force filter. Ignoring initial sort");
|
|
8057
8054
|
return;
|
|
8058
8055
|
}
|
|
8059
8056
|
return s;
|
|
8060
|
-
}, [s, g]), [E, B] =
|
|
8057
|
+
}, [s, g]), [E, B] = I.useState(g ?? a ?? void 0), [v, C] = I.useState(x), N = v ? v[0] : void 0, R = v ? v[1] : void 0, F = Ce(), [D, Y] = Q([]), [oe, z] = Q(!1), [q, te] = Q(), [P, re] = Q(!1), Z = k((T, K) => f.isFilterCombinationValid ? f.isFilterCombinationValid({
|
|
8061
8058
|
path: m,
|
|
8062
8059
|
collection: t,
|
|
8063
8060
|
filterValues: T,
|
|
8064
|
-
sortBy:
|
|
8065
|
-
}) : !0, []), G = k(() => B(g ?? void 0), [g]),
|
|
8061
|
+
sortBy: K
|
|
8062
|
+
}) : !0, []), G = k(() => B(g ?? void 0), [g]), me = k((T) => {
|
|
8066
8063
|
if (g) {
|
|
8067
8064
|
console.warn("Filter is not compatible with the force filter. Ignoring filter");
|
|
8068
8065
|
return;
|
|
@@ -8071,11 +8068,11 @@ function Co({
|
|
|
8071
8068
|
}, [g]);
|
|
8072
8069
|
M(() => {
|
|
8073
8070
|
z(!0);
|
|
8074
|
-
const T = async (
|
|
8071
|
+
const T = async (X) => {
|
|
8075
8072
|
if (t.callbacks?.onFetch)
|
|
8076
8073
|
try {
|
|
8077
|
-
|
|
8078
|
-
|
|
8074
|
+
X = await Promise.all(
|
|
8075
|
+
X.map((ae) => t.callbacks.onFetch({
|
|
8079
8076
|
collection: t,
|
|
8080
8077
|
path: m,
|
|
8081
8078
|
entity: ae,
|
|
@@ -8085,18 +8082,18 @@ function Co({
|
|
|
8085
8082
|
} catch (ae) {
|
|
8086
8083
|
console.error(ae);
|
|
8087
8084
|
}
|
|
8088
|
-
z(!1),
|
|
8085
|
+
z(!1), te(void 0), Y(X.map((ae) => ({
|
|
8089
8086
|
...ae
|
|
8090
8087
|
// values: sanitizeData(e.values, resolvedCollection.properties)
|
|
8091
|
-
}))),
|
|
8092
|
-
},
|
|
8093
|
-
console.error("ERROR",
|
|
8088
|
+
}))), re(!b || X.length < b);
|
|
8089
|
+
}, K = (X) => {
|
|
8090
|
+
console.error("ERROR", X), z(!1), Y([]), te(X);
|
|
8094
8091
|
};
|
|
8095
8092
|
return f.listenCollection ? f.listenCollection({
|
|
8096
8093
|
path: m,
|
|
8097
8094
|
collection: t,
|
|
8098
8095
|
onUpdate: T,
|
|
8099
|
-
onError:
|
|
8096
|
+
onError: K,
|
|
8100
8097
|
searchString: A,
|
|
8101
8098
|
filter: E,
|
|
8102
8099
|
limit: b,
|
|
@@ -8112,15 +8109,15 @@ function Co({
|
|
|
8112
8109
|
startAfter: void 0,
|
|
8113
8110
|
orderBy: N,
|
|
8114
8111
|
order: R
|
|
8115
|
-
}).then(T).catch(
|
|
8112
|
+
}).then(T).catch(K), () => {
|
|
8116
8113
|
});
|
|
8117
8114
|
}, [m, b, R, N, E, A]);
|
|
8118
|
-
const
|
|
8115
|
+
const ie = Zl({
|
|
8119
8116
|
data: D,
|
|
8120
8117
|
entitiesDisplayedFirst: r
|
|
8121
8118
|
});
|
|
8122
8119
|
return {
|
|
8123
|
-
data: Xl(
|
|
8120
|
+
data: Xl(ie, {
|
|
8124
8121
|
filterValues: E,
|
|
8125
8122
|
sortBy: v,
|
|
8126
8123
|
searchString: A,
|
|
@@ -8128,9 +8125,9 @@ function Co({
|
|
|
8128
8125
|
}),
|
|
8129
8126
|
dataLoading: oe,
|
|
8130
8127
|
noMoreToLoad: P,
|
|
8131
|
-
dataLoadingError:
|
|
8128
|
+
dataLoadingError: q,
|
|
8132
8129
|
filterValues: E,
|
|
8133
|
-
setFilterValues:
|
|
8130
|
+
setFilterValues: me,
|
|
8134
8131
|
sortBy: v,
|
|
8135
8132
|
setSortBy: C,
|
|
8136
8133
|
searchString: A,
|
|
@@ -8140,7 +8137,7 @@ function Co({
|
|
|
8140
8137
|
setItemCount: w,
|
|
8141
8138
|
paginationEnabled: p,
|
|
8142
8139
|
pageSize: h,
|
|
8143
|
-
checkFilterCombination:
|
|
8140
|
+
checkFilterCombination: Z,
|
|
8144
8141
|
popupCell: c,
|
|
8145
8142
|
setPopupCell: d
|
|
8146
8143
|
};
|
|
@@ -8160,7 +8157,7 @@ function ec({
|
|
|
8160
8157
|
tableController: c,
|
|
8161
8158
|
collectionEntitiesCount: d
|
|
8162
8159
|
}) {
|
|
8163
|
-
const u = Ce(), m =
|
|
8160
|
+
const u = Ce(), m = ue().plugins ?? [], g = ft(), p = He(), h = l.selectedEntities, A = Pt(e, g, $e(s), null) && i && (p ? /* @__PURE__ */ _(
|
|
8164
8161
|
ge,
|
|
8165
8162
|
{
|
|
8166
8163
|
id: `add_entity_${s}`,
|
|
@@ -8202,7 +8199,7 @@ function ec({
|
|
|
8202
8199
|
]
|
|
8203
8200
|
}
|
|
8204
8201
|
) : /* @__PURE__ */ n(
|
|
8205
|
-
|
|
8202
|
+
le,
|
|
8206
8203
|
{
|
|
8207
8204
|
color: "primary",
|
|
8208
8205
|
disabled: !h?.length || !y,
|
|
@@ -8227,9 +8224,9 @@ function ec({
|
|
|
8227
8224
|
context: u,
|
|
8228
8225
|
tableController: c,
|
|
8229
8226
|
collectionEntitiesCount: d
|
|
8230
|
-
}, x = or(e.Actions).map((E, B) => /* @__PURE__ */ n(
|
|
8227
|
+
}, x = or(e.Actions).map((E, B) => /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(E, { ...w }) }, `actions_${B}`));
|
|
8231
8228
|
return m && m.forEach((E, B) => {
|
|
8232
|
-
E.collections?.CollectionActions && x.push(...or(E.collections?.CollectionActions).map((v, C) => /* @__PURE__ */ n(
|
|
8229
|
+
E.collections?.CollectionActions && x.push(...or(E.collections?.CollectionActions).map((v, C) => /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(v, { ...w, ...E.collections?.collectionActionsProps }) }, `plugin_actions_${B}_${C}`)));
|
|
8233
8230
|
}), /* @__PURE__ */ _(V, { children: [
|
|
8234
8231
|
x,
|
|
8235
8232
|
b,
|
|
@@ -8237,7 +8234,7 @@ function ec({
|
|
|
8237
8234
|
] });
|
|
8238
8235
|
}
|
|
8239
8236
|
function So({ collection: e, fullPath: t, parentCollectionIds: r }) {
|
|
8240
|
-
const i = Ce(), o =
|
|
8237
|
+
const i = Ce(), o = ue(), [a, s] = Q(!1), [l, c] = Q(!1);
|
|
8241
8238
|
let d, u = !!e.textSearchEnabled;
|
|
8242
8239
|
return o?.plugins && (d = o.plugins?.find((m) => !!m.collectionView?.onTextSearchClick) ? () => {
|
|
8243
8240
|
s(!0), Promise.all(o.plugins?.map((m) => m.collectionView?.onTextSearchClick ? m.collectionView.onTextSearchClick({ context: i, path: t, collection: e, parentCollectionIds: r }) : Promise.resolve(!0))).then((m) => {
|
|
@@ -8255,7 +8252,7 @@ function tc({
|
|
|
8255
8252
|
onMove: o
|
|
8256
8253
|
}) {
|
|
8257
8254
|
let a = 0, s = 0;
|
|
8258
|
-
const l =
|
|
8255
|
+
const l = I.useRef(!1), c = (p) => {
|
|
8259
8256
|
if (p.button !== 0 || !e.current || p.defaultPrevented || p.innerClicked)
|
|
8260
8257
|
return;
|
|
8261
8258
|
const {
|
|
@@ -8398,7 +8395,7 @@ function Te({
|
|
|
8398
8395
|
title: r.longDescription,
|
|
8399
8396
|
side: "bottom",
|
|
8400
8397
|
children: /* @__PURE__ */ n(
|
|
8401
|
-
|
|
8398
|
+
le,
|
|
8402
8399
|
{
|
|
8403
8400
|
size: "small",
|
|
8404
8401
|
className: "self-start",
|
|
@@ -8443,7 +8440,7 @@ function en({
|
|
|
8443
8440
|
value: t ? t.toString() : "",
|
|
8444
8441
|
disabled: a,
|
|
8445
8442
|
position: "item-aligned",
|
|
8446
|
-
inputClassName:
|
|
8443
|
+
inputClassName: ne("w-full"),
|
|
8447
8444
|
label: /* @__PURE__ */ n(
|
|
8448
8445
|
Oe,
|
|
8449
8446
|
{
|
|
@@ -8454,7 +8451,7 @@ function en({
|
|
|
8454
8451
|
}
|
|
8455
8452
|
),
|
|
8456
8453
|
endAdornment: c.clearable && /* @__PURE__ */ n(
|
|
8457
|
-
|
|
8454
|
+
le,
|
|
8458
8455
|
{
|
|
8459
8456
|
onClick: f,
|
|
8460
8457
|
children: /* @__PURE__ */ n(Qt, {})
|
|
@@ -8606,13 +8603,13 @@ function nc({
|
|
|
8606
8603
|
const f = l.of;
|
|
8607
8604
|
if (f.dataType !== "reference")
|
|
8608
8605
|
throw Error("ArrayOfReferencesField expected a property containing references");
|
|
8609
|
-
const m = l.expanded === void 0 ? !0 : l.expanded, [g, p] =
|
|
8606
|
+
const m = l.expanded === void 0 ? !0 : l.expanded, [g, p] = I.useState(!1), h = t && Array.isArray(t) ? t.map((C) => C.id) : [];
|
|
8610
8607
|
Le({
|
|
8611
8608
|
property: l,
|
|
8612
8609
|
value: t,
|
|
8613
8610
|
setValue: d
|
|
8614
8611
|
});
|
|
8615
|
-
const A = ke(), y =
|
|
8612
|
+
const A = ke(), y = pe(() => f.path ? A.getCollection(f.path) : void 0, [f.path]);
|
|
8616
8613
|
if (!y)
|
|
8617
8614
|
throw Error(`Couldn't find the corresponding collection for the path: ${f.path}`);
|
|
8618
8615
|
const b = k((C) => {
|
|
@@ -8725,7 +8722,7 @@ function Io({
|
|
|
8725
8722
|
disabled: a,
|
|
8726
8723
|
size: s
|
|
8727
8724
|
}) {
|
|
8728
|
-
return /* @__PURE__ */ _("div", { className:
|
|
8725
|
+
return /* @__PURE__ */ _("div", { className: ne(
|
|
8729
8726
|
lr,
|
|
8730
8727
|
"relative m-4 border-box flex items-center justify-center",
|
|
8731
8728
|
s === "medium" ? "min-w-[220px] min-h-[220px] max-w-[220px]" : "min-w-[118px] min-h-[118px] max-w-[118px]"
|
|
@@ -8739,7 +8736,7 @@ function Io({
|
|
|
8739
8736
|
{
|
|
8740
8737
|
title: "Remove",
|
|
8741
8738
|
children: /* @__PURE__ */ n(
|
|
8742
|
-
|
|
8739
|
+
le,
|
|
8743
8740
|
{
|
|
8744
8741
|
size: "small",
|
|
8745
8742
|
onClick: (l) => {
|
|
@@ -8752,7 +8749,7 @@ function Io({
|
|
|
8752
8749
|
)
|
|
8753
8750
|
}
|
|
8754
8751
|
),
|
|
8755
|
-
r && /* @__PURE__ */ n(
|
|
8752
|
+
r && /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
8756
8753
|
Re,
|
|
8757
8754
|
{
|
|
8758
8755
|
propertyKey: e,
|
|
@@ -8894,7 +8891,7 @@ function uc({
|
|
|
8894
8891
|
"div",
|
|
8895
8892
|
{
|
|
8896
8893
|
...b(),
|
|
8897
|
-
className:
|
|
8894
|
+
className: ne(
|
|
8898
8895
|
wn,
|
|
8899
8896
|
t ? vn : ti,
|
|
8900
8897
|
oc,
|
|
@@ -8914,7 +8911,7 @@ function uc({
|
|
|
8914
8911
|
{
|
|
8915
8912
|
...a.droppableProps,
|
|
8916
8913
|
ref: a.innerRef,
|
|
8917
|
-
className:
|
|
8914
|
+
className: ne(
|
|
8918
8915
|
"flex items-center p-1 no-scrollbar",
|
|
8919
8916
|
o && l.length ? "overflow-auto" : "",
|
|
8920
8917
|
o && l.length ? "min-h-[180px]" : "min-h-[250px]"
|
|
@@ -8962,7 +8959,7 @@ function uc({
|
|
|
8962
8959
|
ref: R.innerRef,
|
|
8963
8960
|
...R.draggableProps,
|
|
8964
8961
|
...R.dragHandleProps,
|
|
8965
|
-
className:
|
|
8962
|
+
className: ne(Si, "rounded-md"),
|
|
8966
8963
|
style: {
|
|
8967
8964
|
...R.draggableProps.style
|
|
8968
8965
|
},
|
|
@@ -9134,7 +9131,7 @@ function Ft({
|
|
|
9134
9131
|
multiline: g,
|
|
9135
9132
|
disabled: a,
|
|
9136
9133
|
endAdornment: l.clearable && /* @__PURE__ */ n(
|
|
9137
|
-
|
|
9134
|
+
le,
|
|
9138
9135
|
{
|
|
9139
9136
|
onClick: f,
|
|
9140
9137
|
children: /* @__PURE__ */ n(Qt, {})
|
|
@@ -9171,7 +9168,7 @@ function Ft({
|
|
|
9171
9168
|
)
|
|
9172
9169
|
] });
|
|
9173
9170
|
}
|
|
9174
|
-
const pc =
|
|
9171
|
+
const pc = I.forwardRef(function({
|
|
9175
9172
|
propertyKey: t,
|
|
9176
9173
|
value: r,
|
|
9177
9174
|
setValue: i,
|
|
@@ -9231,7 +9228,7 @@ function fc({
|
|
|
9231
9228
|
property: c,
|
|
9232
9229
|
includeDescription: d
|
|
9233
9230
|
}) {
|
|
9234
|
-
const { locale: u } =
|
|
9231
|
+
const { locale: u } = ue(), f = t || null;
|
|
9235
9232
|
return Le({
|
|
9236
9233
|
property: c,
|
|
9237
9234
|
value: t,
|
|
@@ -9295,8 +9292,8 @@ function No({
|
|
|
9295
9292
|
/* @__PURE__ */ n(
|
|
9296
9293
|
"div",
|
|
9297
9294
|
{
|
|
9298
|
-
className:
|
|
9299
|
-
children: /* @__PURE__ */ n(
|
|
9295
|
+
className: ne(lr, "min-h-14 p-4 md:p-6 overflow-x-scroll no-scrollbar"),
|
|
9296
|
+
children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
9300
9297
|
Re,
|
|
9301
9298
|
{
|
|
9302
9299
|
propertyKey: e,
|
|
@@ -9341,7 +9338,7 @@ function gc({
|
|
|
9341
9338
|
value: e,
|
|
9342
9339
|
setValue: t
|
|
9343
9340
|
});
|
|
9344
|
-
const f = e && e instanceof We, m = ke(), g =
|
|
9341
|
+
const f = e && e instanceof We, m = ke(), g = pe(() => c.path ? m.getCollection(c.path) : void 0, [c.path]);
|
|
9345
9342
|
if (!g)
|
|
9346
9343
|
throw Error(`Couldn't find the corresponding collection for the path: ${c.path}`);
|
|
9347
9344
|
const p = k((y) => {
|
|
@@ -9411,11 +9408,11 @@ function gc({
|
|
|
9411
9408
|
)
|
|
9412
9409
|
] });
|
|
9413
9410
|
}
|
|
9414
|
-
const Bt =
|
|
9411
|
+
const Bt = I.memo(Ac, (e, t) => {
|
|
9415
9412
|
if (e.propertyKey !== t.propertyKey)
|
|
9416
9413
|
return !1;
|
|
9417
9414
|
const r = Pe(e.property) || e.property.fromBuilder, i = Pe(t.property) || t.property.fromBuilder;
|
|
9418
|
-
return !((r === i ||
|
|
9415
|
+
return !((r === i || ee(e.property, t.property)) && e.disabled === t.disabled) || Yr(t.property), !1;
|
|
9419
9416
|
});
|
|
9420
9417
|
function Ac({
|
|
9421
9418
|
propertyKey: e,
|
|
@@ -9429,7 +9426,7 @@ function Ac({
|
|
|
9429
9426
|
partOfBlock: c,
|
|
9430
9427
|
autoFocus: d
|
|
9431
9428
|
}) {
|
|
9432
|
-
const u =
|
|
9429
|
+
const u = ue();
|
|
9433
9430
|
return /* @__PURE__ */ n(
|
|
9434
9431
|
cn,
|
|
9435
9432
|
{
|
|
@@ -9503,12 +9500,12 @@ function bc({
|
|
|
9503
9500
|
},
|
|
9504
9501
|
fieldProps: f
|
|
9505
9502
|
}) {
|
|
9506
|
-
const { plugins: m } =
|
|
9503
|
+
const { plugins: m } = ue(), g = r.customProps, p = f.field.value, h = Kt(f.form.errors, t), A = Kt(f.form.touched, t), y = h && (f.form.submitCount > 0 || r.validation?.unique) && (!Array.isArray(h) || !!h.filter((C) => !!C).length), w = yc(d.path, d.collection, t, r, e, m) ?? e, x = f.form.isSubmitting, E = k((C, N) => {
|
|
9507
9504
|
f.form.setFieldTouched(t, !0, !1), f.form.setFieldValue(t, C, N);
|
|
9508
9505
|
}, []), B = k((C, N, R) => {
|
|
9509
9506
|
f.form.setFieldTouched(t, !0, !1), f.form.setFieldValue(C, N, R);
|
|
9510
9507
|
}, []);
|
|
9511
|
-
return /* @__PURE__ */ _(
|
|
9508
|
+
return /* @__PURE__ */ _(de, { children: [
|
|
9512
9509
|
/* @__PURE__ */ n(w, { ...{
|
|
9513
9510
|
propertyKey: t,
|
|
9514
9511
|
value: p,
|
|
@@ -9597,7 +9594,7 @@ function wc({
|
|
|
9597
9594
|
partOfBlock: !1,
|
|
9598
9595
|
autoFocus: f && x === 0
|
|
9599
9596
|
};
|
|
9600
|
-
return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
9597
|
+
return /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
9601
9598
|
Bt,
|
|
9602
9599
|
{
|
|
9603
9600
|
...E
|
|
@@ -9613,7 +9610,7 @@ function wc({
|
|
|
9613
9610
|
className: "text-text-secondary dark:text-text-secondary-dark"
|
|
9614
9611
|
}
|
|
9615
9612
|
);
|
|
9616
|
-
return /* @__PURE__ */ _(
|
|
9613
|
+
return /* @__PURE__ */ _(de, { children: [
|
|
9617
9614
|
!c && !l && /* @__PURE__ */ n(
|
|
9618
9615
|
ut,
|
|
9619
9616
|
{
|
|
@@ -9699,7 +9696,7 @@ function wi({
|
|
|
9699
9696
|
fieldName: r,
|
|
9700
9697
|
disabled: i
|
|
9701
9698
|
}) {
|
|
9702
|
-
const [o, a] =
|
|
9699
|
+
const [o, a] = I.useState(
|
|
9703
9700
|
Object.keys(e ?? {}).map((c) => [Ir(), {
|
|
9704
9701
|
key: c,
|
|
9705
9702
|
dataType: qr(e?.[c]) ?? "string"
|
|
@@ -9717,7 +9714,7 @@ function wi({
|
|
|
9717
9714
|
m.splice(p, 1);
|
|
9718
9715
|
}), a(m);
|
|
9719
9716
|
}, [e]);
|
|
9720
|
-
const s =
|
|
9717
|
+
const s = I.useRef(e ?? {}), l = (c, d) => {
|
|
9721
9718
|
if (!c) {
|
|
9722
9719
|
console.warn("No key selected for data type update");
|
|
9723
9720
|
return;
|
|
@@ -9806,7 +9803,7 @@ function _c({
|
|
|
9806
9803
|
updateDataType: c,
|
|
9807
9804
|
disabled: d
|
|
9808
9805
|
}) {
|
|
9809
|
-
const { locale: u } =
|
|
9806
|
+
const { locale: u } = ue();
|
|
9810
9807
|
function f(g, p, h) {
|
|
9811
9808
|
return h === "string" || h === "number" ? /* @__PURE__ */ n(
|
|
9812
9809
|
yt,
|
|
@@ -9868,7 +9865,7 @@ function _c({
|
|
|
9868
9865
|
) : h === "array" ? /* @__PURE__ */ n(
|
|
9869
9866
|
"div",
|
|
9870
9867
|
{
|
|
9871
|
-
className:
|
|
9868
|
+
className: ne(Be, "ml-2 pl-2 border-l border-solid"),
|
|
9872
9869
|
children: /* @__PURE__ */ n(
|
|
9873
9870
|
Mo,
|
|
9874
9871
|
{
|
|
@@ -9907,7 +9904,7 @@ function _c({
|
|
|
9907
9904
|
) : h === "map" ? /* @__PURE__ */ n(
|
|
9908
9905
|
"div",
|
|
9909
9906
|
{
|
|
9910
|
-
className:
|
|
9907
|
+
className: ne(Be, "ml-2 pl-2 border-l border-solid"),
|
|
9911
9908
|
children: /* @__PURE__ */ n(
|
|
9912
9909
|
wi,
|
|
9913
9910
|
{
|
|
@@ -9957,7 +9954,7 @@ function _c({
|
|
|
9957
9954
|
Vt,
|
|
9958
9955
|
{
|
|
9959
9956
|
trigger: /* @__PURE__ */ n(
|
|
9960
|
-
|
|
9957
|
+
le,
|
|
9961
9958
|
{
|
|
9962
9959
|
size: "small",
|
|
9963
9960
|
className: "h-7 w-7",
|
|
@@ -10017,7 +10014,7 @@ function _c({
|
|
|
10017
10014
|
}
|
|
10018
10015
|
),
|
|
10019
10016
|
/* @__PURE__ */ n(
|
|
10020
|
-
|
|
10017
|
+
le,
|
|
10021
10018
|
{
|
|
10022
10019
|
"aria-label": "delete",
|
|
10023
10020
|
size: "small",
|
|
@@ -10039,7 +10036,7 @@ function kc({
|
|
|
10039
10036
|
value: r,
|
|
10040
10037
|
setValue: i
|
|
10041
10038
|
}) {
|
|
10042
|
-
const { locale: o } =
|
|
10039
|
+
const { locale: o } = ue(), [a, s] = Q(qr(r) ?? "string");
|
|
10043
10040
|
function l(d) {
|
|
10044
10041
|
s(d);
|
|
10045
10042
|
}
|
|
@@ -10078,7 +10075,7 @@ function kc({
|
|
|
10078
10075
|
i(f);
|
|
10079
10076
|
}
|
|
10080
10077
|
}
|
|
10081
|
-
) : u === "array" ? /* @__PURE__ */ n(J, { variant: "caption", children: "Arrays of arrays are not supported." }) : u === "map" ? /* @__PURE__ */ n("div", { className:
|
|
10078
|
+
) : u === "array" ? /* @__PURE__ */ n(J, { variant: "caption", children: "Arrays of arrays are not supported." }) : u === "map" ? /* @__PURE__ */ n("div", { className: ne(Be, "ml-2 pl-2 border-l border-solid"), children: /* @__PURE__ */ n(
|
|
10082
10079
|
wi,
|
|
10083
10080
|
{
|
|
10084
10081
|
value: d,
|
|
@@ -10106,7 +10103,7 @@ function kc({
|
|
|
10106
10103
|
Vt,
|
|
10107
10104
|
{
|
|
10108
10105
|
trigger: /* @__PURE__ */ n(
|
|
10109
|
-
|
|
10106
|
+
le,
|
|
10110
10107
|
{
|
|
10111
10108
|
size: "small",
|
|
10112
10109
|
className: "h-7 w-7",
|
|
@@ -10223,7 +10220,7 @@ function xc({
|
|
|
10223
10220
|
partOfBlock: !1,
|
|
10224
10221
|
autoFocus: E === h
|
|
10225
10222
|
};
|
|
10226
|
-
return /* @__PURE__ */ n(
|
|
10223
|
+
return /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(Bt, { ...v }) });
|
|
10227
10224
|
}, b = /* @__PURE__ */ n(
|
|
10228
10225
|
yi,
|
|
10229
10226
|
{
|
|
@@ -10384,7 +10381,7 @@ function Bc({
|
|
|
10384
10381
|
const w = b ? a[b] : void 0;
|
|
10385
10382
|
u(b), f.setFieldTouched(p, !0), f.setFieldValue(p, b), f.setFieldValue(h, w ? ci(w) : null);
|
|
10386
10383
|
};
|
|
10387
|
-
return /* @__PURE__ */ _("div", { className:
|
|
10384
|
+
return /* @__PURE__ */ _("div", { className: ne(lr, "bg-transparent p-4 my-4 py-8"), children: [
|
|
10388
10385
|
/* @__PURE__ */ n(
|
|
10389
10386
|
cn,
|
|
10390
10387
|
{
|
|
@@ -10464,7 +10461,7 @@ function Sc({
|
|
|
10464
10461
|
includeDescription: u,
|
|
10465
10462
|
context: f
|
|
10466
10463
|
}) {
|
|
10467
|
-
const [m, g] =
|
|
10464
|
+
const [m, g] = I.useState(t), p = he(t);
|
|
10468
10465
|
ma("MarkdownFieldBinding", Ic);
|
|
10469
10466
|
const h = Ho({
|
|
10470
10467
|
internalValue: m,
|
|
@@ -10495,7 +10492,7 @@ function Sc({
|
|
|
10495
10492
|
Ht,
|
|
10496
10493
|
{
|
|
10497
10494
|
value: m ?? "",
|
|
10498
|
-
className:
|
|
10495
|
+
className: ne(
|
|
10499
10496
|
wn,
|
|
10500
10497
|
a ? vn : ti,
|
|
10501
10498
|
"text-base"
|
|
@@ -11214,7 +11211,7 @@ function Dc({
|
|
|
11214
11211
|
entity: a,
|
|
11215
11212
|
loading: s
|
|
11216
11213
|
}) {
|
|
11217
|
-
const { errors: l } = Lr(), c = r === "existing" || !e, d = r !== "existing" && !e, u =
|
|
11214
|
+
const { errors: l } = Lr(), c = r === "existing" || !e, d = r !== "existing" && !e, u = pe(() => {
|
|
11218
11215
|
if (!(!e || typeof e == "boolean" || e === "optional"))
|
|
11219
11216
|
return mt(e);
|
|
11220
11217
|
}, [e]), f = gt(), { copy: m } = Is({
|
|
@@ -11222,14 +11219,14 @@ function Dc({
|
|
|
11222
11219
|
type: "success",
|
|
11223
11220
|
message: `Copied ${h}`
|
|
11224
11221
|
})
|
|
11225
|
-
}), g =
|
|
11222
|
+
}), g = ue(), p = {
|
|
11226
11223
|
label: d ? "ID is set automatically" : "ID",
|
|
11227
11224
|
disabled: c || s,
|
|
11228
11225
|
name: "id",
|
|
11229
11226
|
value: (a && r === "existing" ? a.id : t) ?? "",
|
|
11230
11227
|
endAdornment: s ? /* @__PURE__ */ n(Gt, { size: "small" }) : a ? /* @__PURE__ */ _(V, { children: [
|
|
11231
11228
|
/* @__PURE__ */ n(_e, { title: "Copy", children: /* @__PURE__ */ n(
|
|
11232
|
-
|
|
11229
|
+
le,
|
|
11233
11230
|
{
|
|
11234
11231
|
onClick: (h) => m(a.id),
|
|
11235
11232
|
"aria-label": "copy-id",
|
|
@@ -11237,7 +11234,7 @@ function Dc({
|
|
|
11237
11234
|
}
|
|
11238
11235
|
) }),
|
|
11239
11236
|
g?.entityLinkBuilder && /* @__PURE__ */ n(_e, { title: "Open in the console", children: /* @__PURE__ */ n(
|
|
11240
|
-
|
|
11237
|
+
le,
|
|
11241
11238
|
{
|
|
11242
11239
|
component: "a",
|
|
11243
11240
|
href: g.entityLinkBuilder({ entity: a }),
|
|
@@ -11312,14 +11309,14 @@ function Qo({
|
|
|
11312
11309
|
onMultipleEntitiesDelete: s,
|
|
11313
11310
|
path: l
|
|
11314
11311
|
}) {
|
|
11315
|
-
const c = Ke(), d =
|
|
11316
|
-
|
|
11312
|
+
const c = Ke(), d = ue(), u = gt(), [f, m] = Q(!1), [g, p] = I.useState(), [h, A] = I.useState(), y = Ce();
|
|
11313
|
+
I.useEffect(() => {
|
|
11317
11314
|
if (e) {
|
|
11318
11315
|
const D = Array.isArray(e) && e.length === 1 ? e[0] : e;
|
|
11319
11316
|
p(D), A(Array.isArray(D));
|
|
11320
11317
|
}
|
|
11321
11318
|
}, [e]);
|
|
11322
|
-
const b =
|
|
11319
|
+
const b = pe(() => qe({
|
|
11323
11320
|
collection: t,
|
|
11324
11321
|
path: l,
|
|
11325
11322
|
fields: d.propertyConfigs
|
|
@@ -11327,21 +11324,21 @@ function Qo({
|
|
|
11327
11324
|
r();
|
|
11328
11325
|
}, [r]), x = k((D) => {
|
|
11329
11326
|
console.debug("Deleted", D);
|
|
11330
|
-
}, []), E = k((D,
|
|
11327
|
+
}, []), E = k((D, Y) => {
|
|
11331
11328
|
u.open({
|
|
11332
11329
|
type: "error",
|
|
11333
|
-
message: "Error deleting: " +
|
|
11334
|
-
}), console.error("Error deleting entity"), console.error(
|
|
11335
|
-
}, [b.name]), B = k((D,
|
|
11330
|
+
message: "Error deleting: " + Y?.message
|
|
11331
|
+
}), console.error("Error deleting entity"), console.error(Y);
|
|
11332
|
+
}, [b.name]), B = k((D, Y) => {
|
|
11336
11333
|
u.open({
|
|
11337
11334
|
type: "error",
|
|
11338
|
-
message: "Error before deleting: " +
|
|
11339
|
-
}), console.error(
|
|
11340
|
-
}, [b.name]), v = k((D,
|
|
11335
|
+
message: "Error before deleting: " + Y?.message
|
|
11336
|
+
}), console.error(Y);
|
|
11337
|
+
}, [b.name]), v = k((D, Y) => {
|
|
11341
11338
|
u.open({
|
|
11342
11339
|
type: "error",
|
|
11343
|
-
message: "Error after deleting: " +
|
|
11344
|
-
}), console.error(
|
|
11340
|
+
message: "Error after deleting: " + Y?.message
|
|
11341
|
+
}), console.error(Y);
|
|
11345
11342
|
}, [b.name]), C = k((D) => Cs({
|
|
11346
11343
|
dataSource: c,
|
|
11347
11344
|
entity: D,
|
|
@@ -11526,7 +11523,7 @@ function Pc({ propertyId: e }) {
|
|
|
11526
11523
|
),
|
|
11527
11524
|
/* @__PURE__ */ n(J, { variant: "caption", className: "text-white", children: /* @__PURE__ */ n("code", { children: e }) })
|
|
11528
11525
|
] }),
|
|
11529
|
-
/* @__PURE__ */ n(
|
|
11526
|
+
/* @__PURE__ */ n(le, { size: "small", children: /* @__PURE__ */ n(
|
|
11530
11527
|
fa,
|
|
11531
11528
|
{
|
|
11532
11529
|
size: "smallest",
|
|
@@ -11538,9 +11535,9 @@ function Pc({ propertyId: e }) {
|
|
|
11538
11535
|
) })
|
|
11539
11536
|
] });
|
|
11540
11537
|
}
|
|
11541
|
-
const Tc =
|
|
11538
|
+
const Tc = I.memo(
|
|
11542
11539
|
Oc,
|
|
11543
|
-
(e, t) => e.status === t.status && e.path === t.path &&
|
|
11540
|
+
(e, t) => e.status === t.status && e.path === t.path && ee(e.entity?.values, t.entity?.values)
|
|
11544
11541
|
);
|
|
11545
11542
|
function nn(e, t, r) {
|
|
11546
11543
|
const i = e.properties;
|
|
@@ -11568,12 +11565,12 @@ function Oc({
|
|
|
11568
11565
|
autoSave: f,
|
|
11569
11566
|
onIdUpdateError: m
|
|
11570
11567
|
}) {
|
|
11571
|
-
const g = Et(), p =
|
|
11568
|
+
const g = Et(), p = ue(), h = Ce(), A = Ke(), y = p.plugins, b = pe(() => qe({
|
|
11572
11569
|
collection: r,
|
|
11573
11570
|
path: t,
|
|
11574
11571
|
values: i?.values,
|
|
11575
11572
|
fields: p.propertyConfigs
|
|
11576
|
-
}), [i?.values, t]), w = (e === "new" || e === "copy") && !!b.customId && b.customId !== "optional", x =
|
|
11573
|
+
}), [i?.values, t]), w = (e === "new" || e === "copy") && !!b.customId && b.customId !== "optional", x = pe(() => e === "new" || e === "copy" ? w ? void 0 : A.generateEntityId(t) : i?.id, []), E = he(!1), B = he(nn(b, e, i)), [v, C] = I.useState(x), [N, R] = I.useState(!1), [F, D] = I.useState(), [Y, oe] = I.useState(!1), [z, q] = Q(i?.values ?? B.current), te = (W) => o({
|
|
11577
11574
|
collection: G,
|
|
11578
11575
|
path: t,
|
|
11579
11576
|
entityId: v,
|
|
@@ -11582,8 +11579,8 @@ function Oc({
|
|
|
11582
11579
|
closeAfterSave: E.current,
|
|
11583
11580
|
autoSave: f ?? !1
|
|
11584
11581
|
}).then((H) => {
|
|
11585
|
-
const
|
|
11586
|
-
g.onAnalyticsEvent?.(
|
|
11582
|
+
const ye = e === "new" ? "new_entity_saved" : e === "copy" ? "entity_copied" : e === "existing" ? "entity_edited" : "unmapped_event";
|
|
11583
|
+
g.onAnalyticsEvent?.(ye, { path: t });
|
|
11587
11584
|
}).catch((H) => {
|
|
11588
11585
|
console.error(H), D(H);
|
|
11589
11586
|
}).finally(() => {
|
|
@@ -11601,7 +11598,7 @@ function Oc({
|
|
|
11601
11598
|
throw Error("Form misconfiguration when saving, entityId should be set");
|
|
11602
11599
|
} else
|
|
11603
11600
|
throw Error("New FormType added, check EntityForm");
|
|
11604
|
-
return
|
|
11601
|
+
return te(W)?.then((ye) => {
|
|
11605
11602
|
H.resetForm({
|
|
11606
11603
|
values: W,
|
|
11607
11604
|
submitCount: 0,
|
|
@@ -11610,31 +11607,31 @@ function Oc({
|
|
|
11610
11607
|
}).finally(() => {
|
|
11611
11608
|
H.setSubmitting(!1);
|
|
11612
11609
|
});
|
|
11613
|
-
},
|
|
11610
|
+
}, re = dn({
|
|
11614
11611
|
initialValues: B.current,
|
|
11615
11612
|
onSubmit: P,
|
|
11616
|
-
validation: (W) =>
|
|
11617
|
-
const
|
|
11618
|
-
return H.inner.forEach((
|
|
11619
|
-
|
|
11613
|
+
validation: (W) => X?.validate(W, { abortEarly: !1 }).then(() => ({})).catch((H) => {
|
|
11614
|
+
const ye = {};
|
|
11615
|
+
return H.inner.forEach((L) => {
|
|
11616
|
+
ye[L.path] = L.message;
|
|
11620
11617
|
}), zc(H);
|
|
11621
11618
|
})
|
|
11622
11619
|
});
|
|
11623
11620
|
M(() => {
|
|
11624
11621
|
B.current = nn(b, e, i);
|
|
11625
|
-
const W =
|
|
11626
|
-
!
|
|
11627
|
-
Object.entries(G.properties).map(([H,
|
|
11628
|
-
if (ur(
|
|
11622
|
+
const W = re.initialValues;
|
|
11623
|
+
!re.isSubmitting && W && e === "existing" ? T(
|
|
11624
|
+
Object.entries(G.properties).map(([H, ye]) => {
|
|
11625
|
+
if (ur(ye))
|
|
11629
11626
|
return {};
|
|
11630
|
-
const
|
|
11631
|
-
return
|
|
11632
|
-
}).reduce((H,
|
|
11627
|
+
const L = W[H], ce = B.current[H];
|
|
11628
|
+
return ee(L, ce) ? {} : { [H]: ce };
|
|
11629
|
+
}).reduce((H, ye) => ({ ...H, ...ye }), {})
|
|
11633
11630
|
) : T({});
|
|
11634
11631
|
}, [i, b, e]);
|
|
11635
|
-
const
|
|
11636
|
-
const H =
|
|
11637
|
-
|
|
11632
|
+
const Z = (W) => {
|
|
11633
|
+
const H = re.initialValues;
|
|
11634
|
+
q(W), l && l(W), f && W && !ee(W, H) && te(W);
|
|
11638
11635
|
};
|
|
11639
11636
|
M(() => {
|
|
11640
11637
|
v && c && c(v);
|
|
@@ -11644,13 +11641,13 @@ function Oc({
|
|
|
11644
11641
|
path: t,
|
|
11645
11642
|
entityId: v,
|
|
11646
11643
|
values: z,
|
|
11647
|
-
previousValues:
|
|
11644
|
+
previousValues: re.initialValues,
|
|
11648
11645
|
fields: p.propertyConfigs
|
|
11649
|
-
}),
|
|
11650
|
-
if (
|
|
11646
|
+
}), me = r.callbacks?.onIdUpdate, ie = k(async () => {
|
|
11647
|
+
if (me && z && (e === "new" || e === "copy")) {
|
|
11651
11648
|
oe(!0);
|
|
11652
11649
|
try {
|
|
11653
|
-
const W = await
|
|
11650
|
+
const W = await me({
|
|
11654
11651
|
collection: G,
|
|
11655
11652
|
path: t,
|
|
11656
11653
|
entityId: v,
|
|
@@ -11665,36 +11662,36 @@ function Oc({
|
|
|
11665
11662
|
}
|
|
11666
11663
|
}, [v, z, e]);
|
|
11667
11664
|
M(() => {
|
|
11668
|
-
|
|
11669
|
-
}, [
|
|
11670
|
-
const [
|
|
11665
|
+
ie();
|
|
11666
|
+
}, [ie]);
|
|
11667
|
+
const [se, T] = Q({}), K = k(
|
|
11671
11668
|
({
|
|
11672
11669
|
name: W,
|
|
11673
11670
|
value: H,
|
|
11674
|
-
property:
|
|
11671
|
+
property: ye
|
|
11675
11672
|
}) => A.checkUniqueField(t, W, H, v),
|
|
11676
11673
|
[A, t, v]
|
|
11677
|
-
),
|
|
11674
|
+
), X = pe(
|
|
11678
11675
|
() => v ? yo(
|
|
11679
11676
|
v,
|
|
11680
11677
|
G.properties,
|
|
11681
|
-
|
|
11678
|
+
K
|
|
11682
11679
|
) : void 0,
|
|
11683
|
-
[v, G.properties,
|
|
11680
|
+
[v, G.properties, K]
|
|
11684
11681
|
), ae = ft(), O = k(({ entity: W, customEntityActions: H }) => {
|
|
11685
|
-
const
|
|
11686
|
-
return
|
|
11687
|
-
}, [ae, r, t]),
|
|
11688
|
-
setFieldValue:
|
|
11689
|
-
values:
|
|
11682
|
+
const ye = Pt(r, ae, $e(t), null), L = W ? pi(r, ae, $e(t), W) : !0, ce = [];
|
|
11683
|
+
return ye && ce.push(Do), L && ce.push(Ro), H && ce.push(...H), ce;
|
|
11684
|
+
}, [ae, r, t]), S = [], U = {
|
|
11685
|
+
setFieldValue: re.setFieldValue,
|
|
11686
|
+
values: re.values,
|
|
11690
11687
|
collection: G,
|
|
11691
11688
|
entityId: v,
|
|
11692
11689
|
path: t,
|
|
11693
|
-
save:
|
|
11690
|
+
save: te
|
|
11694
11691
|
};
|
|
11695
11692
|
if (M(() => {
|
|
11696
|
-
d && d(
|
|
11697
|
-
}, [d,
|
|
11693
|
+
d && d(U);
|
|
11694
|
+
}, [d, U]), y && r) {
|
|
11698
11695
|
const W = {
|
|
11699
11696
|
entityId: v,
|
|
11700
11697
|
path: t,
|
|
@@ -11702,9 +11699,9 @@ function Oc({
|
|
|
11702
11699
|
collection: r,
|
|
11703
11700
|
context: h,
|
|
11704
11701
|
currentEntityId: v,
|
|
11705
|
-
formContext:
|
|
11702
|
+
formContext: U
|
|
11706
11703
|
};
|
|
11707
|
-
|
|
11704
|
+
S.push(...y.map((H, ye) => H.form?.Actions ? /* @__PURE__ */ n(
|
|
11708
11705
|
H.form.Actions,
|
|
11709
11706
|
{
|
|
11710
11707
|
...W
|
|
@@ -11712,19 +11709,19 @@ function Oc({
|
|
|
11712
11709
|
`actions_${H.name}`
|
|
11713
11710
|
) : null).filter(Boolean));
|
|
11714
11711
|
}
|
|
11715
|
-
return /* @__PURE__ */ n(un, { value:
|
|
11716
|
-
|
|
11712
|
+
return /* @__PURE__ */ n(un, { value: re, children: /* @__PURE__ */ _("div", { className: "h-full overflow-auto", children: [
|
|
11713
|
+
S.length > 0 && /* @__PURE__ */ n(
|
|
11717
11714
|
"div",
|
|
11718
11715
|
{
|
|
11719
|
-
className:
|
|
11720
|
-
children:
|
|
11716
|
+
className: ne("w-full flex justify-end items-center sticky top-0 right-0 left-0 z-10 bg-opacity-60 bg-slate-200 dark:bg-opacity-60 dark:bg-slate-800 backdrop-blur-md"),
|
|
11717
|
+
children: S
|
|
11721
11718
|
}
|
|
11722
11719
|
),
|
|
11723
11720
|
/* @__PURE__ */ _("div", { className: "pt-12 pb-16 pl-8 pr-8 md:pl-10 md:pr-10", children: [
|
|
11724
11721
|
/* @__PURE__ */ _(
|
|
11725
11722
|
"div",
|
|
11726
11723
|
{
|
|
11727
|
-
className: `w-full py-2 flex flex-col items-start mt-${4 + (
|
|
11724
|
+
className: `w-full py-2 flex flex-col items-start mt-${4 + (S ? 8 : 0)} lg:mt-${8 + (S ? 8 : 0)} mb-8`,
|
|
11728
11725
|
children: [
|
|
11729
11726
|
/* @__PURE__ */ n(
|
|
11730
11727
|
J,
|
|
@@ -11750,22 +11747,22 @@ function Oc({
|
|
|
11750
11747
|
status: e,
|
|
11751
11748
|
onChange: C,
|
|
11752
11749
|
error: N,
|
|
11753
|
-
loading:
|
|
11750
|
+
loading: Y,
|
|
11754
11751
|
entity: i
|
|
11755
11752
|
}
|
|
11756
11753
|
),
|
|
11757
11754
|
v && /* @__PURE__ */ n(
|
|
11758
11755
|
Mc,
|
|
11759
11756
|
{
|
|
11760
|
-
...
|
|
11761
|
-
initialValues:
|
|
11757
|
+
...re,
|
|
11758
|
+
initialValues: re.initialValues,
|
|
11762
11759
|
onModified: s,
|
|
11763
11760
|
onDiscard: a,
|
|
11764
|
-
onValuesChanged:
|
|
11765
|
-
underlyingChanges:
|
|
11761
|
+
onValuesChanged: Z,
|
|
11762
|
+
underlyingChanges: se,
|
|
11766
11763
|
entity: i,
|
|
11767
11764
|
resolvedCollection: G,
|
|
11768
|
-
formContext:
|
|
11765
|
+
formContext: U,
|
|
11769
11766
|
status: e,
|
|
11770
11767
|
savingError: F,
|
|
11771
11768
|
closeAfterSaveRef: E,
|
|
@@ -11805,23 +11802,23 @@ function Mc(e) {
|
|
|
11805
11802
|
i && i(v), o && o(t);
|
|
11806
11803
|
}, [v, t]), M(() => {
|
|
11807
11804
|
!b && !f && a && l && Object.entries(a).forEach(([F, D]) => {
|
|
11808
|
-
const
|
|
11809
|
-
!
|
|
11805
|
+
const Y = t[F];
|
|
11806
|
+
!ee(D, Y) && !c[F] && (console.debug("Updated value from the datasource:", F, D), d(F, D !== void 0 ? D : null));
|
|
11810
11807
|
});
|
|
11811
11808
|
}, [f, b, a, l, t, c, d]);
|
|
11812
11809
|
const C = /* @__PURE__ */ n("div", { className: "flex flex-col gap-8", children: (u.propertiesOrder ?? Object.keys(u.properties)).map((F) => {
|
|
11813
11810
|
const D = u.properties[F];
|
|
11814
11811
|
if (!D)
|
|
11815
11812
|
return console.warn(`Property ${F} not found in collection ${u.name}`), null;
|
|
11816
|
-
const
|
|
11813
|
+
const Y = !!a && Object.keys(a).includes(F) && !!c[F], oe = !b && f || Yt(D) || !!D.disabled;
|
|
11817
11814
|
if (ur(D))
|
|
11818
11815
|
return null;
|
|
11819
|
-
const
|
|
11816
|
+
const q = {
|
|
11820
11817
|
propertyKey: F,
|
|
11821
11818
|
disabled: oe,
|
|
11822
11819
|
property: D,
|
|
11823
11820
|
includeDescription: D.description || D.longDescription,
|
|
11824
|
-
underlyingValueHasChanged:
|
|
11821
|
+
underlyingValueHasChanged: Y && !b,
|
|
11825
11822
|
context: s,
|
|
11826
11823
|
tableMode: !1,
|
|
11827
11824
|
partOfArray: !1,
|
|
@@ -11832,20 +11829,20 @@ function Mc(e) {
|
|
|
11832
11829
|
"div",
|
|
11833
11830
|
{
|
|
11834
11831
|
id: `form_field_${F}`,
|
|
11835
|
-
children: /* @__PURE__ */ n(
|
|
11832
|
+
children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
11836
11833
|
_e,
|
|
11837
11834
|
{
|
|
11838
11835
|
title: /* @__PURE__ */ n(Pc, { propertyId: F }),
|
|
11839
11836
|
delayDuration: 800,
|
|
11840
11837
|
side: "left",
|
|
11841
11838
|
sideOffset: 16,
|
|
11842
|
-
children: /* @__PURE__ */ n(Bt, { ...
|
|
11839
|
+
children: /* @__PURE__ */ n(Bt, { ...q })
|
|
11843
11840
|
}
|
|
11844
11841
|
) })
|
|
11845
11842
|
},
|
|
11846
11843
|
`field_${u.name}_${F}`
|
|
11847
11844
|
);
|
|
11848
|
-
}).filter(Boolean) }), N = f || !v && m === "existing", R =
|
|
11845
|
+
}).filter(Boolean) }), N = f || !v && m === "existing", R = I.useRef(null);
|
|
11849
11846
|
return /* @__PURE__ */ _(
|
|
11850
11847
|
"form",
|
|
11851
11848
|
{
|
|
@@ -11868,7 +11865,7 @@ function Mc(e) {
|
|
|
11868
11865
|
!b && /* @__PURE__ */ _(kt, { position: "absolute", children: [
|
|
11869
11866
|
h && /* @__PURE__ */ n("div", { className: "text-right", children: /* @__PURE__ */ n(J, { color: "error", children: h.message }) }),
|
|
11870
11867
|
l && E.length > 0 && /* @__PURE__ */ n("div", { className: "flex-grow flex overflow-auto no-scrollbar", children: E.map((F) => /* @__PURE__ */ n(
|
|
11871
|
-
|
|
11868
|
+
le,
|
|
11872
11869
|
{
|
|
11873
11870
|
color: "primary",
|
|
11874
11871
|
onClick: (D) => {
|
|
@@ -11958,13 +11955,13 @@ function Gc({
|
|
|
11958
11955
|
onCellValueChange: d,
|
|
11959
11956
|
container: u
|
|
11960
11957
|
}) {
|
|
11961
|
-
const f = Ce(), m =
|
|
11958
|
+
const f = Ce(), m = ue(), [g, p] = I.useState(), [h, A] = Q(), y = t?.id, [b, w] = Q(t), [x, E] = Q(b?.values), B = o ? qe({
|
|
11962
11959
|
collection: o,
|
|
11963
11960
|
path: a,
|
|
11964
11961
|
values: x,
|
|
11965
11962
|
entityId: y,
|
|
11966
11963
|
fields: m.propertyConfigs
|
|
11967
|
-
}) : void 0, v = rc(), C =
|
|
11964
|
+
}) : void 0, v = rc(), C = I.useRef(null), N = I.useRef(null), R = I.useRef(!1), F = k(() => {
|
|
11968
11965
|
if (!s)
|
|
11969
11966
|
throw Error("getInitialLocation error");
|
|
11970
11967
|
return {
|
|
@@ -11972,21 +11969,21 @@ function Gc({
|
|
|
11972
11969
|
y: s.top < v.height - s.bottom ? s.y + s.height / 2 : s.y - s.height / 2
|
|
11973
11970
|
};
|
|
11974
11971
|
}, [s, v.height, v.width]), D = k(({
|
|
11975
|
-
x:
|
|
11976
|
-
y:
|
|
11972
|
+
x: S,
|
|
11973
|
+
y: U
|
|
11977
11974
|
}) => {
|
|
11978
11975
|
const W = C.current?.getBoundingClientRect();
|
|
11979
11976
|
if (!W)
|
|
11980
11977
|
throw Error("normalizePosition called before draggableBoundingRect is set");
|
|
11981
11978
|
return {
|
|
11982
|
-
x: Math.max(0, Math.min(
|
|
11983
|
-
y: Math.max(0, Math.min(
|
|
11979
|
+
x: Math.max(0, Math.min(S, v.width - W.width)),
|
|
11980
|
+
y: Math.max(0, Math.min(U, v.height - W.height))
|
|
11984
11981
|
};
|
|
11985
|
-
}, [v]),
|
|
11986
|
-
const
|
|
11987
|
-
if (!s || !
|
|
11982
|
+
}, [v]), Y = k((S) => {
|
|
11983
|
+
const U = C.current?.getBoundingClientRect();
|
|
11984
|
+
if (!s || !U)
|
|
11988
11985
|
return;
|
|
11989
|
-
const W =
|
|
11986
|
+
const W = S ?? D(F());
|
|
11990
11987
|
(!h || W.x !== h.x || W.y !== h.y) && A(W);
|
|
11991
11988
|
}, [s, F, D, h]);
|
|
11992
11989
|
tc({
|
|
@@ -11994,7 +11991,7 @@ function Gc({
|
|
|
11994
11991
|
innerRef: N,
|
|
11995
11992
|
x: h?.x,
|
|
11996
11993
|
y: h?.y,
|
|
11997
|
-
onMove:
|
|
11994
|
+
onMove: Y
|
|
11998
11995
|
}), M(
|
|
11999
11996
|
() => {
|
|
12000
11997
|
R.current = !1;
|
|
@@ -12002,25 +11999,25 @@ function Gc({
|
|
|
12002
11999
|
[i, b]
|
|
12003
12000
|
), Qr(
|
|
12004
12001
|
() => {
|
|
12005
|
-
const
|
|
12006
|
-
!s || !
|
|
12002
|
+
const S = C.current?.getBoundingClientRect();
|
|
12003
|
+
!s || !S || R.current || (Y(), R.current = !0);
|
|
12007
12004
|
},
|
|
12008
|
-
[s,
|
|
12005
|
+
[s, Y, R.current]
|
|
12009
12006
|
), Qr(
|
|
12010
12007
|
() => {
|
|
12011
|
-
|
|
12008
|
+
Y(h);
|
|
12012
12009
|
},
|
|
12013
12010
|
[v, s]
|
|
12014
12011
|
);
|
|
12015
|
-
const oe =
|
|
12012
|
+
const oe = pe(() => {
|
|
12016
12013
|
if (!(!B || !y))
|
|
12017
12014
|
return yo(
|
|
12018
12015
|
y,
|
|
12019
12016
|
i && B.properties[i] ? { [i]: B.properties[i] } : {},
|
|
12020
12017
|
r
|
|
12021
12018
|
);
|
|
12022
|
-
}, [B, y, i, r]), z = k(() =>
|
|
12023
|
-
value:
|
|
12019
|
+
}, [B, y, i, r]), z = k(() => Y(h), [h, Y]), q = async (S) => (p(null), o && b && d && i ? d({
|
|
12020
|
+
value: S[i],
|
|
12024
12021
|
propertyKey: i,
|
|
12025
12022
|
entity: b,
|
|
12026
12023
|
setError: p,
|
|
@@ -12031,21 +12028,21 @@ function Gc({
|
|
|
12031
12028
|
}) : Promise.resolve());
|
|
12032
12029
|
if (!b)
|
|
12033
12030
|
return /* @__PURE__ */ n(V, {});
|
|
12034
|
-
const
|
|
12031
|
+
const te = dn({
|
|
12035
12032
|
initialValues: b?.values ?? {},
|
|
12036
|
-
validation: (
|
|
12033
|
+
validation: (S) => oe?.validate(S, { abortEarly: !1 }).then(() => ({})).catch((U) => {
|
|
12037
12034
|
const W = {};
|
|
12038
|
-
return
|
|
12035
|
+
return U.inner.forEach((H) => {
|
|
12039
12036
|
W[H.path] = H.message;
|
|
12040
12037
|
}), W;
|
|
12041
12038
|
}),
|
|
12042
12039
|
validateOnInitialRender: !0,
|
|
12043
|
-
onSubmit: (
|
|
12044
|
-
|
|
12040
|
+
onSubmit: (S, U) => {
|
|
12041
|
+
q(S).then(() => c()).finally(() => U.setSubmitting(!1));
|
|
12045
12042
|
}
|
|
12046
|
-
}), { values: P, isSubmitting:
|
|
12043
|
+
}), { values: P, isSubmitting: re, setFieldValue: Z, handleSubmit: G } = te;
|
|
12047
12044
|
if (M(() => {
|
|
12048
|
-
|
|
12045
|
+
ee(P, x) || E(P);
|
|
12049
12046
|
}, [P]), !b)
|
|
12050
12047
|
return /* @__PURE__ */ n(
|
|
12051
12048
|
Ee,
|
|
@@ -12055,26 +12052,26 @@ function Gc({
|
|
|
12055
12052
|
);
|
|
12056
12053
|
if (!B)
|
|
12057
12054
|
return /* @__PURE__ */ n(V, {});
|
|
12058
|
-
const
|
|
12055
|
+
const me = re, ie = {
|
|
12059
12056
|
collection: B,
|
|
12060
12057
|
entityId: y,
|
|
12061
12058
|
values: P,
|
|
12062
12059
|
path: a,
|
|
12063
|
-
setFieldValue:
|
|
12064
|
-
save:
|
|
12065
|
-
},
|
|
12060
|
+
setFieldValue: Z,
|
|
12061
|
+
save: q
|
|
12062
|
+
}, se = i && bt(B.properties, i), T = i && se ? {
|
|
12066
12063
|
propertyKey: i,
|
|
12067
|
-
disabled:
|
|
12068
|
-
property:
|
|
12064
|
+
disabled: re || Yt(se) || !!se.disabled,
|
|
12065
|
+
property: se,
|
|
12069
12066
|
includeDescription: !1,
|
|
12070
12067
|
underlyingValueHasChanged: !1,
|
|
12071
|
-
context:
|
|
12068
|
+
context: ie,
|
|
12072
12069
|
tableMode: !0,
|
|
12073
12070
|
partOfArray: !1,
|
|
12074
12071
|
partOfBlock: !1,
|
|
12075
12072
|
autoFocus: l
|
|
12076
12073
|
} : void 0;
|
|
12077
|
-
let
|
|
12074
|
+
let K = /* @__PURE__ */ n(V, { children: /* @__PURE__ */ n(
|
|
12078
12075
|
"div",
|
|
12079
12076
|
{
|
|
12080
12077
|
className: "w-[560px] max-w-full max-h-[85vh]",
|
|
@@ -12105,7 +12102,7 @@ function Gc({
|
|
|
12105
12102
|
variant: "filled",
|
|
12106
12103
|
color: "primary",
|
|
12107
12104
|
type: "submit",
|
|
12108
|
-
disabled:
|
|
12105
|
+
disabled: me,
|
|
12109
12106
|
children: "Save"
|
|
12110
12107
|
}
|
|
12111
12108
|
) })
|
|
@@ -12115,10 +12112,10 @@ function Gc({
|
|
|
12115
12112
|
},
|
|
12116
12113
|
`popup_form_${e}_${y}_${i}`
|
|
12117
12114
|
) });
|
|
12118
|
-
const
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
|
|
12115
|
+
const X = m.plugins;
|
|
12116
|
+
X && X.forEach((S) => {
|
|
12117
|
+
S.form?.provider && (K = /* @__PURE__ */ n(
|
|
12118
|
+
S.form.provider.Component,
|
|
12122
12119
|
{
|
|
12123
12120
|
status: "existing",
|
|
12124
12121
|
path: a,
|
|
@@ -12126,9 +12123,9 @@ function Gc({
|
|
|
12126
12123
|
entity: b,
|
|
12127
12124
|
context: f,
|
|
12128
12125
|
currentEntityId: y,
|
|
12129
|
-
formContext:
|
|
12130
|
-
...
|
|
12131
|
-
children:
|
|
12126
|
+
formContext: ie,
|
|
12127
|
+
...S.form.provider.props,
|
|
12128
|
+
children: K
|
|
12132
12129
|
}
|
|
12133
12130
|
));
|
|
12134
12131
|
});
|
|
@@ -12137,7 +12134,7 @@ function Gc({
|
|
|
12137
12134
|
{
|
|
12138
12135
|
className: `text-gray-900 dark:text-white overflow-auto rounded rounded-md bg-white dark:bg-gray-950 ${l ? "" : "hidden"} cursor-grab max-w-[100vw]`,
|
|
12139
12136
|
children: [
|
|
12140
|
-
|
|
12137
|
+
K,
|
|
12141
12138
|
g && /* @__PURE__ */ n(J, { color: "error", children: g.message })
|
|
12142
12139
|
]
|
|
12143
12140
|
}
|
|
@@ -12166,11 +12163,11 @@ function Gc({
|
|
|
12166
12163
|
height: "32px"
|
|
12167
12164
|
},
|
|
12168
12165
|
children: /* @__PURE__ */ n(
|
|
12169
|
-
|
|
12166
|
+
le,
|
|
12170
12167
|
{
|
|
12171
12168
|
size: "small",
|
|
12172
|
-
onClick: (
|
|
12173
|
-
|
|
12169
|
+
onClick: (S) => {
|
|
12170
|
+
S.stopPropagation(), c();
|
|
12174
12171
|
},
|
|
12175
12172
|
children: /* @__PURE__ */ n(
|
|
12176
12173
|
Qt,
|
|
@@ -12195,11 +12192,11 @@ function Gc({
|
|
|
12195
12192
|
{
|
|
12196
12193
|
asChild: !0,
|
|
12197
12194
|
container: u,
|
|
12198
|
-
children: /* @__PURE__ */ n(un, { value:
|
|
12195
|
+
children: /* @__PURE__ */ n(un, { value: te, children: O })
|
|
12199
12196
|
}
|
|
12200
12197
|
);
|
|
12201
12198
|
}
|
|
12202
|
-
const jc = "collectionGroupParent", Po =
|
|
12199
|
+
const jc = "collectionGroupParent", Po = I.memo(
|
|
12203
12200
|
function({
|
|
12204
12201
|
fullPath: t,
|
|
12205
12202
|
parentCollectionIds: r,
|
|
@@ -12207,14 +12204,14 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12207
12204
|
className: o,
|
|
12208
12205
|
...a
|
|
12209
12206
|
}) {
|
|
12210
|
-
const s = Ke(), l = ke(), c = ht(), d = ft(), u = xt(), f = Et(), m =
|
|
12207
|
+
const s = Ke(), l = ke(), c = ht(), d = ft(), u = xt(), f = Et(), m = ue(), g = I.useRef(null), p = pe(() => {
|
|
12211
12208
|
const $ = u?.getCollectionConfig(t);
|
|
12212
12209
|
return $ ? Je(a, $) : a;
|
|
12213
|
-
}, [a, t, u?.getCollectionConfig]), h =
|
|
12210
|
+
}, [a, t, u?.getCollectionConfig]), h = I.useRef(p);
|
|
12214
12211
|
M(() => {
|
|
12215
12212
|
h.current = p;
|
|
12216
12213
|
}, [p]);
|
|
12217
|
-
const A = Pt(p, d, $e(t), null), [y, b] = Q(void 0), [w, x] =
|
|
12214
|
+
const A = Pt(p, d, $e(t), null), [y, b] = Q(void 0), [w, x] = I.useState(void 0), [E, B] = I.useState(0), [v, C] = Q(0), N = k(() => {
|
|
12218
12215
|
const $ = y;
|
|
12219
12216
|
setTimeout(() => {
|
|
12220
12217
|
$ === y && b(void 0);
|
|
@@ -12222,21 +12219,21 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12222
12219
|
}, [y]), R = k(($) => {
|
|
12223
12220
|
const fe = h.current;
|
|
12224
12221
|
return Un(fe, d, $e(t), $ ?? null) ? fe.inlineEditing === void 0 || fe.inlineEditing : !1;
|
|
12225
|
-
}, [d, t]), F = p.selectionEnabled === void 0 || p.selectionEnabled, D = !R(), [
|
|
12226
|
-
selectedEntities:
|
|
12222
|
+
}, [d, t]), F = p.selectionEnabled === void 0 || p.selectionEnabled, D = !R(), [Y, oe] = Q(!1), z = To(), q = p.selectionController ?? z, {
|
|
12223
|
+
selectedEntities: te,
|
|
12227
12224
|
toggleEntitySelection: P,
|
|
12228
|
-
isEntitySelected:
|
|
12229
|
-
setSelectedEntities:
|
|
12230
|
-
} =
|
|
12225
|
+
isEntitySelected: re,
|
|
12226
|
+
setSelectedEntities: Z
|
|
12227
|
+
} = q;
|
|
12231
12228
|
M(() => {
|
|
12232
12229
|
x(void 0);
|
|
12233
|
-
}, [
|
|
12230
|
+
}, [te]);
|
|
12234
12231
|
const G = Co({
|
|
12235
12232
|
fullPath: t,
|
|
12236
12233
|
collection: h.current,
|
|
12237
12234
|
entitiesDisplayedFirst: [],
|
|
12238
12235
|
lastDeleteTimestamp: E
|
|
12239
|
-
}),
|
|
12236
|
+
}), me = I.useRef(Math.random().toString(36)), ie = G.popupCell, se = k(() => {
|
|
12240
12237
|
G.setPopupCell?.(void 0);
|
|
12241
12238
|
}, [G.setPopupCell]), T = k(($) => {
|
|
12242
12239
|
const fe = h.current;
|
|
@@ -12250,7 +12247,7 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12250
12247
|
updateUrl: !0,
|
|
12251
12248
|
onClose: N
|
|
12252
12249
|
});
|
|
12253
|
-
}, [N]),
|
|
12250
|
+
}, [N]), K = k(() => {
|
|
12254
12251
|
const $ = h.current;
|
|
12255
12252
|
f.onAnalyticsEvent?.("new_entity_click", {
|
|
12256
12253
|
path: t
|
|
@@ -12260,55 +12257,55 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12260
12257
|
updateUrl: !0,
|
|
12261
12258
|
onClose: N
|
|
12262
12259
|
});
|
|
12263
|
-
}, [t]),
|
|
12260
|
+
}, [t]), X = () => {
|
|
12264
12261
|
f.onAnalyticsEvent?.("multiple_delete_dialog_open", {
|
|
12265
12262
|
path: t
|
|
12266
|
-
}), x(
|
|
12263
|
+
}), x(te);
|
|
12267
12264
|
}, ae = ($, fe) => {
|
|
12268
12265
|
f.onAnalyticsEvent?.("single_entity_deleted", {
|
|
12269
12266
|
path: t
|
|
12270
|
-
}),
|
|
12267
|
+
}), Z((be) => be.filter((Ae) => Ae.id !== fe.id)), B(Date.now());
|
|
12271
12268
|
}, O = ($, fe) => {
|
|
12272
12269
|
f.onAnalyticsEvent?.("multiple_entities_deleted", {
|
|
12273
12270
|
path: t
|
|
12274
|
-
}),
|
|
12271
|
+
}), Z([]), x(void 0), B(Date.now());
|
|
12275
12272
|
};
|
|
12276
|
-
let
|
|
12277
|
-
m?.plugins && (
|
|
12278
|
-
const
|
|
12273
|
+
let S;
|
|
12274
|
+
m?.plugins && (S = m.plugins.find(($) => $.collectionView?.AddColumnComponent)?.collectionView?.AddColumnComponent);
|
|
12275
|
+
const U = k(($, fe) => {
|
|
12279
12276
|
if (u) {
|
|
12280
|
-
const
|
|
12277
|
+
const be = u.getCollectionConfig($), Ae = Je(be, fe);
|
|
12281
12278
|
u.onCollectionModified($, Ae);
|
|
12282
12279
|
}
|
|
12283
12280
|
}, [u]), W = k(({
|
|
12284
12281
|
width: $,
|
|
12285
12282
|
key: fe
|
|
12286
12283
|
}) => {
|
|
12287
|
-
const
|
|
12288
|
-
if (!bt(
|
|
12284
|
+
const be = h.current;
|
|
12285
|
+
if (!bt(be.properties, fe))
|
|
12289
12286
|
return;
|
|
12290
12287
|
const Ae = Oo(fe, $);
|
|
12291
|
-
|
|
12292
|
-
}, [
|
|
12293
|
-
u &&
|
|
12294
|
-
}, [
|
|
12288
|
+
U(t, Ae);
|
|
12289
|
+
}, [U, t]), H = k(($) => {
|
|
12290
|
+
u && U(t, { defaultSize: $ });
|
|
12291
|
+
}, [U, t, u]), ye = Pt(p, d, $e(t), null), L = k(
|
|
12295
12292
|
({
|
|
12296
12293
|
name: $,
|
|
12297
12294
|
value: fe,
|
|
12298
|
-
property:
|
|
12295
|
+
property: be,
|
|
12299
12296
|
entityId: Ae
|
|
12300
12297
|
}) => s.checkUniqueField(t, $, fe, Ae),
|
|
12301
12298
|
[t]
|
|
12302
|
-
),
|
|
12299
|
+
), ce = ({
|
|
12303
12300
|
fullPath: $,
|
|
12304
12301
|
context: fe,
|
|
12305
|
-
value:
|
|
12302
|
+
value: be,
|
|
12306
12303
|
propertyKey: Ae,
|
|
12307
12304
|
onValueUpdated: xe,
|
|
12308
12305
|
setError: It,
|
|
12309
12306
|
entity: Nt
|
|
12310
12307
|
}) => {
|
|
12311
|
-
const qo = Dr({ ...Nt.values }, Ae,
|
|
12308
|
+
const qo = Dr({ ...Nt.values }, Ae, be), Uo = {
|
|
12312
12309
|
path: $,
|
|
12313
12310
|
entityId: Nt.id,
|
|
12314
12311
|
values: qo,
|
|
@@ -12327,14 +12324,14 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12327
12324
|
console.error("Save failure"), console.error(Ei), It(Ei);
|
|
12328
12325
|
}
|
|
12329
12326
|
});
|
|
12330
|
-
}, Me = l.resolveAliasesFrom(t), Se =
|
|
12327
|
+
}, Me = l.resolveAliasesFrom(t), Se = pe(() => qe({
|
|
12331
12328
|
collection: p,
|
|
12332
12329
|
path: t,
|
|
12333
12330
|
fields: m.propertyConfigs
|
|
12334
12331
|
}), [p, t]), we = k(({
|
|
12335
12332
|
propertyKey: $,
|
|
12336
12333
|
propertyValue: fe,
|
|
12337
|
-
entity:
|
|
12334
|
+
entity: be
|
|
12338
12335
|
}) => {
|
|
12339
12336
|
let Ae = bt(p.properties, $);
|
|
12340
12337
|
return Ae || (Ae = bt(Se.properties, $)), Ge({
|
|
@@ -12342,14 +12339,14 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12342
12339
|
propertyOrBuilder: Ae,
|
|
12343
12340
|
path: t,
|
|
12344
12341
|
propertyValue: fe,
|
|
12345
|
-
values:
|
|
12346
|
-
entityId:
|
|
12342
|
+
values: be.values,
|
|
12343
|
+
entityId: be.id,
|
|
12347
12344
|
fields: m.propertyConfigs
|
|
12348
12345
|
});
|
|
12349
|
-
}, [p.properties, m.propertyConfigs, t, Se.properties]), Ye = ko(Se, !0), Ze =
|
|
12350
|
-
const $ = p.subcollections?.map((
|
|
12351
|
-
key: Ai(
|
|
12352
|
-
name:
|
|
12346
|
+
}, [p.properties, m.propertyConfigs, t, Se.properties]), Ye = ko(Se, !0), Ze = pe(() => {
|
|
12347
|
+
const $ = p.subcollections?.map((be) => ({
|
|
12348
|
+
key: Ai(be),
|
|
12349
|
+
name: be.name,
|
|
12353
12350
|
width: 200,
|
|
12354
12351
|
dependencies: [],
|
|
12355
12352
|
Builder: ({ entity: Ae }) => /* @__PURE__ */ n(
|
|
@@ -12362,12 +12359,12 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12362
12359
|
xe.stopPropagation(), c.open({
|
|
12363
12360
|
path: t,
|
|
12364
12361
|
entityId: Ae.id,
|
|
12365
|
-
selectedSubPath:
|
|
12362
|
+
selectedSubPath: be.id ?? be.path,
|
|
12366
12363
|
collection: p,
|
|
12367
12364
|
updateUrl: !0
|
|
12368
12365
|
});
|
|
12369
12366
|
},
|
|
12370
|
-
children:
|
|
12367
|
+
children: be.name
|
|
12371
12368
|
}
|
|
12372
12369
|
)
|
|
12373
12370
|
})) ?? [], fe = p.collectionGroup ? [{
|
|
@@ -12375,8 +12372,8 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12375
12372
|
name: "Parent entities",
|
|
12376
12373
|
width: 260,
|
|
12377
12374
|
dependencies: [],
|
|
12378
|
-
Builder: ({ entity:
|
|
12379
|
-
const Ae = l.getParentReferencesFromPath(
|
|
12375
|
+
Builder: ({ entity: be }) => {
|
|
12376
|
+
const Ae = l.getParentReferencesFromPath(be.path);
|
|
12380
12377
|
return /* @__PURE__ */ n(V, { children: Ae.map((xe) => /* @__PURE__ */ n(
|
|
12381
12378
|
Xe,
|
|
12382
12379
|
{
|
|
@@ -12394,24 +12391,24 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12394
12391
|
];
|
|
12395
12392
|
}, [p, t]), at = k(() => {
|
|
12396
12393
|
B(Date.now());
|
|
12397
|
-
}, []), Qe = He(), st =
|
|
12398
|
-
const
|
|
12399
|
-
return
|
|
12400
|
-
},
|
|
12394
|
+
}, []), Qe = He(), st = ({ entity: $, customEntityActions: fe }) => {
|
|
12395
|
+
const be = $ ? pi(p, d, $e(t), $) : !0, Ae = [Rc];
|
|
12396
|
+
return ye && Ae.push(Do), be && Ae.push(Ro), fe && Ae.push(...fe), Ae;
|
|
12397
|
+
}, gr = k(() => {
|
|
12401
12398
|
const $ = st({}), fe = $.filter((xe) => xe.collapsed !== !1), Ae = $.filter((xe) => xe.collapsed === !1).length * (Qe ? 40 : 30);
|
|
12402
12399
|
return (Qe ? 80 + Ae : 70 + Ae) + (fe.length > 0 ? Qe ? 40 : 30 : 0);
|
|
12403
|
-
}, [Qe]), Ar =
|
|
12400
|
+
}, [Qe]), Ar = ({
|
|
12404
12401
|
entity: $,
|
|
12405
12402
|
size: fe,
|
|
12406
|
-
width:
|
|
12403
|
+
width: be,
|
|
12407
12404
|
frozen: Ae
|
|
12408
12405
|
}) => {
|
|
12409
|
-
const xe =
|
|
12406
|
+
const xe = re($), It = st({ entity: $, customEntityActions: p.entityActions });
|
|
12410
12407
|
return /* @__PURE__ */ n(
|
|
12411
12408
|
gi,
|
|
12412
12409
|
{
|
|
12413
12410
|
entity: $,
|
|
12414
|
-
width:
|
|
12411
|
+
width: be,
|
|
12415
12412
|
frozen: Ae,
|
|
12416
12413
|
isSelected: xe,
|
|
12417
12414
|
selectionEnabled: F,
|
|
@@ -12423,13 +12420,13 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12423
12420
|
actions: It,
|
|
12424
12421
|
hideId: p?.hideIdFromCollection,
|
|
12425
12422
|
onCollectionChange: at,
|
|
12426
|
-
selectionController:
|
|
12423
|
+
selectionController: q
|
|
12427
12424
|
}
|
|
12428
12425
|
);
|
|
12429
|
-
},
|
|
12426
|
+
}, br = /* @__PURE__ */ n(
|
|
12430
12427
|
Kr,
|
|
12431
12428
|
{
|
|
12432
|
-
open:
|
|
12429
|
+
open: Y,
|
|
12433
12430
|
onOpenChange: oe,
|
|
12434
12431
|
enabled: !!p.description,
|
|
12435
12432
|
trigger: /* @__PURE__ */ _("div", { className: "flex flex-col items-start", children: [
|
|
@@ -12457,10 +12454,10 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12457
12454
|
] }),
|
|
12458
12455
|
children: p.description && /* @__PURE__ */ n("div", { className: "m-4 text-gray-900 dark:text-white", children: /* @__PURE__ */ n(sr, { source: p.description }) })
|
|
12459
12456
|
}
|
|
12460
|
-
),
|
|
12457
|
+
), j = k(({
|
|
12461
12458
|
property: $,
|
|
12462
12459
|
propertyKey: fe,
|
|
12463
|
-
onHover:
|
|
12460
|
+
onHover: be
|
|
12464
12461
|
}) => {
|
|
12465
12462
|
const Ae = h.current;
|
|
12466
12463
|
return m.plugins ? /* @__PURE__ */ n(V, { children: m.plugins.filter((xe) => xe.collectionView?.HeaderAction).map((xe, It) => {
|
|
@@ -12468,7 +12465,7 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12468
12465
|
return /* @__PURE__ */ n(
|
|
12469
12466
|
Nt,
|
|
12470
12467
|
{
|
|
12471
|
-
onHover:
|
|
12468
|
+
onHover: be,
|
|
12472
12469
|
propertyKey: fe,
|
|
12473
12470
|
property: $,
|
|
12474
12471
|
fullPath: t,
|
|
@@ -12478,9 +12475,9 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12478
12475
|
`plugin_header_action_${It}`
|
|
12479
12476
|
);
|
|
12480
12477
|
}) }) : null;
|
|
12481
|
-
}, [m.plugins, t, r]), Ie =
|
|
12482
|
-
return typeof
|
|
12483
|
-
|
|
12478
|
+
}, [m.plugins, t, r]), Ie = S ? function() {
|
|
12479
|
+
return typeof S == "function" ? /* @__PURE__ */ n(
|
|
12480
|
+
S,
|
|
12484
12481
|
{
|
|
12485
12482
|
fullPath: t,
|
|
12486
12483
|
parentCollectionIds: r ?? [],
|
|
@@ -12500,7 +12497,7 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12500
12497
|
return /* @__PURE__ */ _(
|
|
12501
12498
|
"div",
|
|
12502
12499
|
{
|
|
12503
|
-
className:
|
|
12500
|
+
className: ne("overflow-hidden h-full w-full", o),
|
|
12504
12501
|
ref: g,
|
|
12505
12502
|
children: [
|
|
12506
12503
|
/* @__PURE__ */ n(
|
|
@@ -12512,11 +12509,11 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12512
12509
|
onSizeChanged: H,
|
|
12513
12510
|
onEntityClick: T,
|
|
12514
12511
|
onColumnResize: W,
|
|
12515
|
-
onValueChange:
|
|
12512
|
+
onValueChange: ce,
|
|
12516
12513
|
tableRowActionsBuilder: Ar,
|
|
12517
|
-
uniqueFieldValidator:
|
|
12514
|
+
uniqueFieldValidator: L,
|
|
12518
12515
|
title: br,
|
|
12519
|
-
selectionController:
|
|
12516
|
+
selectionController: q,
|
|
12520
12517
|
highlightedEntities: y ? [y] : [],
|
|
12521
12518
|
defaultSize: p.defaultSize,
|
|
12522
12519
|
properties: Se.properties,
|
|
@@ -12530,11 +12527,11 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12530
12527
|
parentCollectionIds: r ?? [],
|
|
12531
12528
|
collection: p,
|
|
12532
12529
|
tableController: G,
|
|
12533
|
-
onMultipleDeleteClick:
|
|
12534
|
-
onNewClick:
|
|
12530
|
+
onMultipleDeleteClick: X,
|
|
12531
|
+
onNewClick: K,
|
|
12535
12532
|
path: t,
|
|
12536
12533
|
relativePath: p.path,
|
|
12537
|
-
selectionController:
|
|
12534
|
+
selectionController: q,
|
|
12538
12535
|
selectionEnabled: F,
|
|
12539
12536
|
collectionEntitiesCount: v
|
|
12540
12537
|
}
|
|
@@ -12546,7 +12543,7 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12546
12543
|
{
|
|
12547
12544
|
color: "primary",
|
|
12548
12545
|
variant: "outlined",
|
|
12549
|
-
onClick:
|
|
12546
|
+
onClick: K,
|
|
12550
12547
|
className: "mt-4",
|
|
12551
12548
|
children: [
|
|
12552
12549
|
/* @__PURE__ */ n(ct, {}),
|
|
@@ -12557,7 +12554,7 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12557
12554
|
] }) : /* @__PURE__ */ n(J, { variant: "label", children: "No results with the applied filter/sort" }),
|
|
12558
12555
|
hoverRow: D,
|
|
12559
12556
|
inlineEditing: R(),
|
|
12560
|
-
AdditionalHeaderWidget:
|
|
12557
|
+
AdditionalHeaderWidget: j,
|
|
12561
12558
|
AddColumnComponent: Ie,
|
|
12562
12559
|
getIdColumnWidth: gr,
|
|
12563
12560
|
additionalIDHeaderWidget: /* @__PURE__ */ n(
|
|
@@ -12573,19 +12570,19 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12573
12570
|
/* @__PURE__ */ n(
|
|
12574
12571
|
Vc,
|
|
12575
12572
|
{
|
|
12576
|
-
open: !!
|
|
12577
|
-
onClose:
|
|
12578
|
-
cellRect:
|
|
12579
|
-
propertyKey:
|
|
12573
|
+
open: !!ie,
|
|
12574
|
+
onClose: se,
|
|
12575
|
+
cellRect: ie?.cellRect,
|
|
12576
|
+
propertyKey: ie?.propertyKey,
|
|
12580
12577
|
collection: p,
|
|
12581
|
-
entity:
|
|
12582
|
-
tableKey:
|
|
12583
|
-
customFieldValidator:
|
|
12578
|
+
entity: ie?.entity,
|
|
12579
|
+
tableKey: me.current,
|
|
12580
|
+
customFieldValidator: L,
|
|
12584
12581
|
path: Me,
|
|
12585
|
-
onCellValueChange:
|
|
12582
|
+
onCellValueChange: ce,
|
|
12586
12583
|
container: g.current
|
|
12587
12584
|
},
|
|
12588
|
-
`popup_form_${
|
|
12585
|
+
`popup_form_${ie?.propertyKey}_${ie?.entity?.id}`
|
|
12589
12586
|
),
|
|
12590
12587
|
w && /* @__PURE__ */ n(
|
|
12591
12588
|
Qo,
|
|
@@ -12604,7 +12601,7 @@ const jc = "collectionGroupParent", Po = S.memo(
|
|
|
12604
12601
|
}
|
|
12605
12602
|
);
|
|
12606
12603
|
},
|
|
12607
|
-
(e, t) =>
|
|
12604
|
+
(e, t) => ee(e.fullPath, t.fullPath) && ee(e.parentCollectionIds, t.parentCollectionIds) && ee(e.isSubCollection, t.isSubCollection) && ee(e.className, t.className) && ee(e.properties, t.properties) && ee(e.propertiesOrder, t.propertiesOrder) && ee(e.hideIdFromCollection, t.hideIdFromCollection) && ee(e.inlineEditing, t.inlineEditing) && ee(e.selectionEnabled, t.selectionEnabled) && ee(e.selectionController, t.selectionController) && ee(e.Actions, t.Actions) && ee(e.defaultSize, t.defaultSize) && ee(e.textSearchEnabled, t.textSearchEnabled) && ee(e.additionalFields, t.additionalFields) && ee(e.forceFilter, t.forceFilter)
|
|
12608
12605
|
);
|
|
12609
12606
|
function To(e) {
|
|
12610
12607
|
const [t, r] = Q([]), i = k((a) => {
|
|
@@ -12625,7 +12622,7 @@ function Yc({
|
|
|
12625
12622
|
sortBy: i,
|
|
12626
12623
|
onCountChange: o
|
|
12627
12624
|
}) {
|
|
12628
|
-
const a = Ke(), s = ke(), [l, c] = Q(void 0), [d, u] = Q(void 0), f = i ? i[0] : void 0, m = i ? i[1] : void 0, g =
|
|
12625
|
+
const a = Ke(), s = ke(), [l, c] = Q(void 0), [d, u] = Q(void 0), f = i ? i[0] : void 0, m = i ? i[1] : void 0, g = pe(() => s.resolveAliasesFrom(e), [e, s.resolveAliasesFrom]);
|
|
12629
12626
|
return M(() => {
|
|
12630
12627
|
a.countEntities && a.countEntities({
|
|
12631
12628
|
path: g,
|
|
@@ -12657,13 +12654,13 @@ function qc({
|
|
|
12657
12654
|
collection: e,
|
|
12658
12655
|
path: t
|
|
12659
12656
|
}) {
|
|
12660
|
-
const [r, i] =
|
|
12657
|
+
const [r, i] = I.useState(!1), [o, a] = I.useState(""), s = ht();
|
|
12661
12658
|
return /* @__PURE__ */ n(_e, { title: r ? void 0 : "Find by ID", children: /* @__PURE__ */ n(
|
|
12662
12659
|
Kr,
|
|
12663
12660
|
{
|
|
12664
12661
|
open: r,
|
|
12665
12662
|
onOpenChange: i,
|
|
12666
|
-
trigger: /* @__PURE__ */ n(
|
|
12663
|
+
trigger: /* @__PURE__ */ n(le, { size: "small", children: /* @__PURE__ */ n(ga, { size: "small" }) }),
|
|
12667
12664
|
children: /* @__PURE__ */ n(
|
|
12668
12665
|
"form",
|
|
12669
12666
|
{
|
|
@@ -12715,50 +12712,50 @@ function Uc({
|
|
|
12715
12712
|
forceFilter: l,
|
|
12716
12713
|
maxSelection: c
|
|
12717
12714
|
}) {
|
|
12718
|
-
const d = vi(), u = ht(), f = ke(), m = Et(), g =
|
|
12719
|
-
let
|
|
12715
|
+
const d = vi(), u = ht(), f = ke(), m = Et(), g = ue(), p = f.resolveAliasesFrom(o), h = Ke(), [A, y] = Q([]), b = (q) => {
|
|
12716
|
+
let te;
|
|
12720
12717
|
const P = w.selectedEntities;
|
|
12721
12718
|
if (m.onAnalyticsEvent?.("reference_selection_toggle", {
|
|
12722
12719
|
path: p,
|
|
12723
|
-
entityId:
|
|
12720
|
+
entityId: q.id
|
|
12724
12721
|
}), P) {
|
|
12725
|
-
if (P.map((
|
|
12726
|
-
|
|
12722
|
+
if (P.map((re) => re.id).indexOf(q.id) > -1)
|
|
12723
|
+
te = P.filter((re) => re.id !== q.id);
|
|
12727
12724
|
else {
|
|
12728
12725
|
if (c && P.length >= c)
|
|
12729
12726
|
return;
|
|
12730
|
-
|
|
12727
|
+
te = [...P, q];
|
|
12731
12728
|
}
|
|
12732
|
-
w.setSelectedEntities(
|
|
12729
|
+
w.setSelectedEntities(te), t && t(te);
|
|
12733
12730
|
}
|
|
12734
12731
|
}, w = To(b);
|
|
12735
12732
|
M(() => {
|
|
12736
|
-
let
|
|
12737
|
-
const
|
|
12738
|
-
return
|
|
12739
|
-
|
|
12733
|
+
let q = !1;
|
|
12734
|
+
const te = a?.map((P) => P?.toString()).filter(Boolean);
|
|
12735
|
+
return te && i ? Promise.all(
|
|
12736
|
+
te.map((P) => h.fetchEntity({
|
|
12740
12737
|
path: p,
|
|
12741
12738
|
entityId: P,
|
|
12742
12739
|
collection: i
|
|
12743
12740
|
}))
|
|
12744
12741
|
).then((P) => {
|
|
12745
|
-
if (!
|
|
12746
|
-
const
|
|
12747
|
-
w.setSelectedEntities(
|
|
12742
|
+
if (!q) {
|
|
12743
|
+
const re = P.filter((Z) => Z !== void 0);
|
|
12744
|
+
w.setSelectedEntities(re), y(re);
|
|
12748
12745
|
}
|
|
12749
12746
|
}) : (w.setSelectedEntities([]), y([])), () => {
|
|
12750
|
-
|
|
12747
|
+
q = !0;
|
|
12751
12748
|
};
|
|
12752
12749
|
}, [h, p, a, i, w.setSelectedEntities]);
|
|
12753
12750
|
const x = () => {
|
|
12754
12751
|
m.onAnalyticsEvent?.("reference_selection_clear", {
|
|
12755
12752
|
path: p
|
|
12756
12753
|
}), w.setSelectedEntities([]), !r && e ? e(null) : t && t([]);
|
|
12757
|
-
}, E = (
|
|
12754
|
+
}, E = (q) => {
|
|
12758
12755
|
!r && e ? (m.onAnalyticsEvent?.("reference_selected_single", {
|
|
12759
12756
|
path: p,
|
|
12760
|
-
entityId:
|
|
12761
|
-
}), e(
|
|
12757
|
+
entityId: q.id
|
|
12758
|
+
}), e(q), d.close(!1)) : b(q);
|
|
12762
12759
|
}, B = () => {
|
|
12763
12760
|
m.onAnalyticsEvent?.("reference_selection_new_entity", {
|
|
12764
12761
|
path: p
|
|
@@ -12766,25 +12763,25 @@ function Uc({
|
|
|
12766
12763
|
path: p,
|
|
12767
12764
|
collection: i,
|
|
12768
12765
|
updateUrl: !0,
|
|
12769
|
-
onUpdate: ({ entity:
|
|
12770
|
-
y([
|
|
12766
|
+
onUpdate: ({ entity: q }) => {
|
|
12767
|
+
y([q, ...A]), E(q);
|
|
12771
12768
|
},
|
|
12772
12769
|
closeOnSave: !0
|
|
12773
12770
|
});
|
|
12774
12771
|
}, v = ({
|
|
12775
|
-
entity:
|
|
12776
|
-
size:
|
|
12772
|
+
entity: q,
|
|
12773
|
+
size: te,
|
|
12777
12774
|
width: P,
|
|
12778
|
-
frozen:
|
|
12775
|
+
frozen: re
|
|
12779
12776
|
}) => {
|
|
12780
|
-
const
|
|
12777
|
+
const Z = w.selectedEntities, G = Z && Z.map((me) => me.id).indexOf(q.id) > -1;
|
|
12781
12778
|
return /* @__PURE__ */ n(
|
|
12782
12779
|
gi,
|
|
12783
12780
|
{
|
|
12784
12781
|
width: P,
|
|
12785
|
-
frozen:
|
|
12786
|
-
entity:
|
|
12787
|
-
size:
|
|
12782
|
+
frozen: re,
|
|
12783
|
+
entity: q,
|
|
12784
|
+
size: te,
|
|
12788
12785
|
isSelected: G,
|
|
12789
12786
|
selectionEnabled: r,
|
|
12790
12787
|
hideId: i?.hideIdFromCollection,
|
|
@@ -12792,8 +12789,8 @@ function Uc({
|
|
|
12792
12789
|
selectionController: w
|
|
12793
12790
|
}
|
|
12794
12791
|
);
|
|
12795
|
-
}, C = k((
|
|
12796
|
-
|
|
12792
|
+
}, C = k((q) => {
|
|
12793
|
+
q.stopPropagation(), d.close(!1);
|
|
12797
12794
|
}, [d]);
|
|
12798
12795
|
if (!i)
|
|
12799
12796
|
return /* @__PURE__ */ n(
|
|
@@ -12802,7 +12799,7 @@ function Uc({
|
|
|
12802
12799
|
error: "Could not find collection with id " + i
|
|
12803
12800
|
}
|
|
12804
12801
|
);
|
|
12805
|
-
const N =
|
|
12802
|
+
const N = pe(() => qe({
|
|
12806
12803
|
collection: i,
|
|
12807
12804
|
path: p,
|
|
12808
12805
|
values: {},
|
|
@@ -12814,7 +12811,7 @@ function Uc({
|
|
|
12814
12811
|
forceFilter: l
|
|
12815
12812
|
}), {
|
|
12816
12813
|
textSearchLoading: D,
|
|
12817
|
-
textSearchInitialised:
|
|
12814
|
+
textSearchInitialised: Y,
|
|
12818
12815
|
onTextSearchClick: oe,
|
|
12819
12816
|
textSearchEnabled: z
|
|
12820
12817
|
} = (
|
|
@@ -12829,7 +12826,7 @@ function Uc({
|
|
|
12829
12826
|
Bo,
|
|
12830
12827
|
{
|
|
12831
12828
|
textSearchLoading: D,
|
|
12832
|
-
onTextSearchClick:
|
|
12829
|
+
onTextSearchClick: Y ? void 0 : oe,
|
|
12833
12830
|
textSearchEnabled: z,
|
|
12834
12831
|
displayedColumnIds: R,
|
|
12835
12832
|
onEntityClick: E,
|
|
@@ -12958,7 +12955,7 @@ function $c({
|
|
|
12958
12955
|
description: a,
|
|
12959
12956
|
onClick: s
|
|
12960
12957
|
}) {
|
|
12961
|
-
const l = xt(), c = /* @__PURE__ */ n(zr, { collectionOrView: r ?? e }), d = dr(), u = Ce(), f =
|
|
12958
|
+
const l = xt(), c = /* @__PURE__ */ n(zr, { collectionOrView: r ?? e }), d = dr(), u = Ce(), f = ue(), m = (l?.favouritePaths ?? []).includes(t);
|
|
12962
12959
|
let g;
|
|
12963
12960
|
if (f.plugins && r) {
|
|
12964
12961
|
const p = {
|
|
@@ -12978,7 +12975,7 @@ function $c({
|
|
|
12978
12975
|
return /* @__PURE__ */ n(
|
|
12979
12976
|
Aa,
|
|
12980
12977
|
{
|
|
12981
|
-
className:
|
|
12978
|
+
className: ne("h-full p-4 cursor-pointer min-h-[230px]"),
|
|
12982
12979
|
onClick: () => {
|
|
12983
12980
|
s?.(), d(i), l && l.setRecentlyVisitedPaths(
|
|
12984
12981
|
[t, ...(l.recentlyVisitedPaths ?? []).filter((p) => p !== t)]
|
|
@@ -13006,7 +13003,7 @@ function $c({
|
|
|
13006
13003
|
children: [
|
|
13007
13004
|
g,
|
|
13008
13005
|
l && /* @__PURE__ */ n(
|
|
13009
|
-
|
|
13006
|
+
le,
|
|
13010
13007
|
{
|
|
13011
13008
|
onClick: (p) => {
|
|
13012
13009
|
p.preventDefault(), p.stopPropagation(), m ? l.setFavouritePaths(
|
|
@@ -13112,7 +13109,7 @@ function Jc({ hidden: e }) {
|
|
|
13112
13109
|
}
|
|
13113
13110
|
const Nr = {};
|
|
13114
13111
|
function Hc() {
|
|
13115
|
-
const e = jt(), t =
|
|
13112
|
+
const e = jt(), t = I.useRef(null), [r, i] = I.useState(0), [o, a] = I.useState("down"), s = k(() => {
|
|
13116
13113
|
!t.current || !e.key || (Nr[e.key] = t.current.scrollTop, i(t.current.scrollTop), a(t.current.scrollTop > r ? "down" : "up"));
|
|
13117
13114
|
}, [t, e.key, r]);
|
|
13118
13115
|
return M(() => {
|
|
@@ -13144,7 +13141,7 @@ function Zc({
|
|
|
13144
13141
|
additionalChildrenStart: t,
|
|
13145
13142
|
additionalChildrenEnd: r
|
|
13146
13143
|
}) {
|
|
13147
|
-
const i = Ce(), o =
|
|
13144
|
+
const i = Ce(), o = ue(), a = ke();
|
|
13148
13145
|
if (!a.topLevelNavigation)
|
|
13149
13146
|
throw Error("Navigation not ready in FireCMSHomePage");
|
|
13150
13147
|
const {
|
|
@@ -13515,7 +13512,7 @@ const ed = function({
|
|
|
13515
13512
|
"div",
|
|
13516
13513
|
{
|
|
13517
13514
|
style: c,
|
|
13518
|
-
className:
|
|
13515
|
+
className: ne(
|
|
13519
13516
|
"pr-2",
|
|
13520
13517
|
{
|
|
13521
13518
|
"ml-[17rem]": o && p,
|
|
@@ -13552,9 +13549,9 @@ const ed = function({
|
|
|
13552
13549
|
}
|
|
13553
13550
|
) }),
|
|
13554
13551
|
/* @__PURE__ */ n("div", { className: "flex-grow" }),
|
|
13555
|
-
r && /* @__PURE__ */ n(
|
|
13552
|
+
r && /* @__PURE__ */ n(de, { children: r }),
|
|
13556
13553
|
/* @__PURE__ */ n(
|
|
13557
|
-
|
|
13554
|
+
le,
|
|
13558
13555
|
{
|
|
13559
13556
|
color: "inherit",
|
|
13560
13557
|
"aria-label": "Open drawer",
|
|
@@ -13706,7 +13703,7 @@ function an({
|
|
|
13706
13703
|
copy: l,
|
|
13707
13704
|
isDragging: c
|
|
13708
13705
|
}) {
|
|
13709
|
-
const [d, u] =
|
|
13706
|
+
const [d, u] = I.useState(!1), f = k(() => u(!0), []), m = k(() => u(!1), []);
|
|
13710
13707
|
return /* @__PURE__ */ n(
|
|
13711
13708
|
"div",
|
|
13712
13709
|
{
|
|
@@ -13748,7 +13745,7 @@ function rd({
|
|
|
13748
13745
|
provided: o,
|
|
13749
13746
|
copy: a
|
|
13750
13747
|
}) {
|
|
13751
|
-
const [s, l] = Q(!1), c =
|
|
13748
|
+
const [s, l] = Q(!1), c = I.useRef(null);
|
|
13752
13749
|
return bn(c, () => l(!1)), /* @__PURE__ */ n(
|
|
13753
13750
|
"div",
|
|
13754
13751
|
{
|
|
@@ -13764,7 +13761,7 @@ function rd({
|
|
|
13764
13761
|
title: "Drag to move. Click for more options",
|
|
13765
13762
|
children: [
|
|
13766
13763
|
/* @__PURE__ */ n(
|
|
13767
|
-
|
|
13764
|
+
le,
|
|
13768
13765
|
{
|
|
13769
13766
|
size: "small",
|
|
13770
13767
|
disabled: t,
|
|
@@ -13824,7 +13821,7 @@ function Fu({
|
|
|
13824
13821
|
size: d,
|
|
13825
13822
|
className: u
|
|
13826
13823
|
}) {
|
|
13827
|
-
const f = ke(), m =
|
|
13824
|
+
const f = ke(), m = pe(() => f.getCollection(r), [r, f]);
|
|
13828
13825
|
if (!m)
|
|
13829
13826
|
throw Error(`Couldn't find the corresponding collection for the path: ${r}`);
|
|
13830
13827
|
const g = k((b) => {
|
|
@@ -13876,7 +13873,7 @@ function Fu({
|
|
|
13876
13873
|
)), /* @__PURE__ */ _(
|
|
13877
13874
|
"div",
|
|
13878
13875
|
{
|
|
13879
|
-
className:
|
|
13876
|
+
className: ne(
|
|
13880
13877
|
"text-sm font-medium text-gray-500",
|
|
13881
13878
|
"min-w-80 flex flex-col gap-4",
|
|
13882
13879
|
"relative transition-colors duration-200 ease-in rounded font-medium",
|
|
@@ -13935,7 +13932,7 @@ function Qu({
|
|
|
13935
13932
|
selectedIcon: e = "",
|
|
13936
13933
|
onIconSelected: t
|
|
13937
13934
|
}) {
|
|
13938
|
-
const [r, i] =
|
|
13935
|
+
const [r, i] = I.useState(null), [o, a] = I.useState(""), s = I.useMemo(
|
|
13939
13936
|
() => Ea((c) => {
|
|
13940
13937
|
if (!c || c === "")
|
|
13941
13938
|
i(null);
|
|
@@ -13946,7 +13943,7 @@ function Qu({
|
|
|
13946
13943
|
}, nd),
|
|
13947
13944
|
[]
|
|
13948
13945
|
);
|
|
13949
|
-
return
|
|
13946
|
+
return I.useEffect(() => (s(o), () => {
|
|
13950
13947
|
s.clear();
|
|
13951
13948
|
}), [o, s]), /* @__PURE__ */ _(V, { children: [
|
|
13952
13949
|
/* @__PURE__ */ n(
|
|
@@ -13959,7 +13956,7 @@ function Qu({
|
|
|
13959
13956
|
}
|
|
13960
13957
|
),
|
|
13961
13958
|
/* @__PURE__ */ n("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? Rr : r).map((c) => /* @__PURE__ */ n(_e, { title: c, children: /* @__PURE__ */ n(
|
|
13962
|
-
|
|
13959
|
+
le,
|
|
13963
13960
|
{
|
|
13964
13961
|
shape: "square",
|
|
13965
13962
|
toggled: e === c,
|
|
@@ -14056,8 +14053,8 @@ function Ru({
|
|
|
14056
14053
|
), R = k(
|
|
14057
14054
|
(T) => `${ve(t)}/${Lt(T)}`,
|
|
14058
14055
|
[t]
|
|
14059
|
-
), F = k((T,
|
|
14060
|
-
const
|
|
14056
|
+
), F = k((T, K) => {
|
|
14057
|
+
const X = [
|
|
14061
14058
|
...(T ?? []).map((O) => O.hideFromNavigation ? void 0 : {
|
|
14062
14059
|
url: R(O.id ?? O.path),
|
|
14063
14060
|
type: "collection",
|
|
@@ -14067,7 +14064,7 @@ function Ru({
|
|
|
14067
14064
|
description: O.description?.trim(),
|
|
14068
14065
|
group: O.group?.trim()
|
|
14069
14066
|
}).filter(Boolean),
|
|
14070
|
-
...(
|
|
14067
|
+
...(K ?? []).map((O) => O.hideFromNavigation ? void 0 : {
|
|
14071
14068
|
url: N(Array.isArray(O.path) ? O.path[0] : O.path),
|
|
14072
14069
|
name: O.name.trim(),
|
|
14073
14070
|
type: "view",
|
|
@@ -14075,21 +14072,21 @@ function Ru({
|
|
|
14075
14072
|
description: O.description?.trim(),
|
|
14076
14073
|
group: O.group?.trim()
|
|
14077
14074
|
}).filter(Boolean)
|
|
14078
|
-
], ae = Object.values(
|
|
14075
|
+
], ae = Object.values(X).map((O) => O.group).filter(Boolean).filter((O, S, U) => U.indexOf(O) === S);
|
|
14079
14076
|
return {
|
|
14080
|
-
navigationEntries:
|
|
14077
|
+
navigationEntries: X,
|
|
14081
14078
|
groups: ae
|
|
14082
14079
|
};
|
|
14083
14080
|
}, [N, R]), D = k(async () => {
|
|
14084
14081
|
if (!r.initialLoading) {
|
|
14085
14082
|
try {
|
|
14086
|
-
const [T = [],
|
|
14083
|
+
const [T = [], K = []] = await Promise.all(
|
|
14087
14084
|
[
|
|
14088
14085
|
ld(i, r, s, l),
|
|
14089
14086
|
cd(o, r, s)
|
|
14090
14087
|
]
|
|
14091
14088
|
);
|
|
14092
|
-
u(T), m(
|
|
14089
|
+
u(T), m(K), A(F(T ?? [], K));
|
|
14093
14090
|
} catch (T) {
|
|
14094
14091
|
console.error(T), x(T);
|
|
14095
14092
|
}
|
|
@@ -14099,52 +14096,52 @@ function Ru({
|
|
|
14099
14096
|
M(() => {
|
|
14100
14097
|
D();
|
|
14101
14098
|
}, [D]);
|
|
14102
|
-
const
|
|
14099
|
+
const Y = k((T, K, X = !1) => {
|
|
14103
14100
|
if (!d)
|
|
14104
14101
|
return;
|
|
14105
|
-
const ae = ai(ve(T), d), O =
|
|
14106
|
-
let
|
|
14107
|
-
if (
|
|
14108
|
-
const W =
|
|
14109
|
-
|
|
14110
|
-
...
|
|
14111
|
-
subcollections:
|
|
14112
|
-
callbacks:
|
|
14113
|
-
permissions:
|
|
14102
|
+
const ae = ai(ve(T), d), O = X ? a?.getCollectionConfig(T) : void 0, S = ae ? Je(ae, O) : void 0;
|
|
14103
|
+
let U = S;
|
|
14104
|
+
if (S) {
|
|
14105
|
+
const W = S.subcollections, H = S.callbacks, ye = S.permissions;
|
|
14106
|
+
U = {
|
|
14107
|
+
...U,
|
|
14108
|
+
subcollections: U?.subcollections ?? W,
|
|
14109
|
+
callbacks: U?.callbacks ?? H,
|
|
14110
|
+
permissions: U?.permissions ?? ye
|
|
14114
14111
|
};
|
|
14115
14112
|
}
|
|
14116
|
-
if (
|
|
14117
|
-
return { ...
|
|
14113
|
+
if (U)
|
|
14114
|
+
return { ...S, ...U };
|
|
14118
14115
|
}, [
|
|
14119
14116
|
e,
|
|
14120
14117
|
t,
|
|
14121
14118
|
d
|
|
14122
14119
|
]), oe = k((T) => {
|
|
14123
|
-
let
|
|
14124
|
-
if (!
|
|
14120
|
+
let K = d;
|
|
14121
|
+
if (!K)
|
|
14125
14122
|
throw Error("Collections have not been initialised yet");
|
|
14126
|
-
for (let
|
|
14127
|
-
const ae = T[
|
|
14123
|
+
for (let X = 0; X < T.length; X++) {
|
|
14124
|
+
const ae = T[X], O = K.find((S) => S.id === ae || S.path === ae);
|
|
14128
14125
|
if (!O)
|
|
14129
14126
|
return;
|
|
14130
|
-
if (
|
|
14127
|
+
if (K = O.subcollections, X === T.length - 1)
|
|
14131
14128
|
return O;
|
|
14132
14129
|
}
|
|
14133
14130
|
}, [d]), z = k((T) => {
|
|
14134
|
-
let
|
|
14135
|
-
if (!
|
|
14131
|
+
let K = d;
|
|
14132
|
+
if (!K)
|
|
14136
14133
|
throw Error("Collections have not been initialised yet");
|
|
14137
|
-
for (let
|
|
14138
|
-
const ae = T[
|
|
14134
|
+
for (let X = 0; X < T.length; X++) {
|
|
14135
|
+
const ae = T[X], O = K.find((S) => S.id === ae);
|
|
14139
14136
|
if (!O)
|
|
14140
14137
|
return;
|
|
14141
|
-
if (
|
|
14138
|
+
if (K = O.subcollections, X === T.length - 1)
|
|
14142
14139
|
return O;
|
|
14143
14140
|
}
|
|
14144
|
-
}, [d]),
|
|
14141
|
+
}, [d]), q = k(
|
|
14145
14142
|
(T) => ve(T + "/").startsWith(ve(C) + "/"),
|
|
14146
14143
|
[C]
|
|
14147
|
-
),
|
|
14144
|
+
), te = k((T) => {
|
|
14148
14145
|
if (T.startsWith(C))
|
|
14149
14146
|
return T.replace(C, "");
|
|
14150
14147
|
throw Error("Expected path starting with " + C);
|
|
@@ -14153,28 +14150,36 @@ function Ru({
|
|
|
14153
14150
|
path: T
|
|
14154
14151
|
}) => `s/edit/${Lt(T)}`,
|
|
14155
14152
|
[]
|
|
14156
|
-
),
|
|
14153
|
+
), re = k((T) => {
|
|
14157
14154
|
if (!d)
|
|
14158
14155
|
throw Error("Collections have not been initialised yet");
|
|
14159
14156
|
return Pn(T, d);
|
|
14160
|
-
}, [d]),
|
|
14157
|
+
}, [d]), Z = c.state, G = Z && Z.base_location ? Z.base_location : c, me = k((T) => zo({
|
|
14161
14158
|
path: T,
|
|
14162
14159
|
collections: d
|
|
14163
|
-
}), [d]),
|
|
14160
|
+
}), [d]), ie = k((T) => {
|
|
14161
|
+
const X = T.split("/").filter((S, U) => U % 2 === 0);
|
|
14162
|
+
X.pop();
|
|
14163
|
+
const ae = [];
|
|
14164
|
+
for (let S = 1; S <= X.length; S++)
|
|
14165
|
+
ae.push(X.slice(0, S));
|
|
14166
|
+
const O = ae.map((S) => oe(S)?.id).filter(Boolean);
|
|
14167
|
+
return oe(X), console.log("getParentCollectionIds", T, O), O;
|
|
14168
|
+
}, [me]), se = k(
|
|
14164
14169
|
(T) => {
|
|
14165
|
-
let
|
|
14166
|
-
const
|
|
14170
|
+
let K = d;
|
|
14171
|
+
const X = [];
|
|
14167
14172
|
for (let ae = 0; ae < T.length; ae++) {
|
|
14168
|
-
const O = T[ae],
|
|
14169
|
-
if (!
|
|
14173
|
+
const O = T[ae], S = K.find((U) => U.id === O);
|
|
14174
|
+
if (!S)
|
|
14170
14175
|
throw Error(`Collection with id ${O} not found`);
|
|
14171
|
-
|
|
14176
|
+
X.push(S.path), K = S.subcollections;
|
|
14172
14177
|
}
|
|
14173
|
-
return
|
|
14178
|
+
return X;
|
|
14174
14179
|
},
|
|
14175
14180
|
[z]
|
|
14176
14181
|
);
|
|
14177
|
-
return
|
|
14182
|
+
return {
|
|
14178
14183
|
collections: d,
|
|
14179
14184
|
views: f,
|
|
14180
14185
|
loading: !g || y,
|
|
@@ -14183,22 +14188,22 @@ function Ru({
|
|
|
14183
14188
|
basePath: e,
|
|
14184
14189
|
baseCollectionPath: t,
|
|
14185
14190
|
initialised: g,
|
|
14186
|
-
getCollection:
|
|
14191
|
+
getCollection: Y,
|
|
14187
14192
|
getCollectionFromPaths: oe,
|
|
14188
14193
|
getCollectionFromIds: z,
|
|
14189
|
-
isUrlCollectionPath:
|
|
14190
|
-
urlPathToDataPath:
|
|
14194
|
+
isUrlCollectionPath: q,
|
|
14195
|
+
urlPathToDataPath: te,
|
|
14191
14196
|
buildUrlCollectionPath: R,
|
|
14192
14197
|
buildUrlEditCollectionPath: P,
|
|
14193
14198
|
buildCMSUrlPath: N,
|
|
14194
|
-
resolveAliasesFrom:
|
|
14199
|
+
resolveAliasesFrom: re,
|
|
14195
14200
|
topLevelNavigation: h,
|
|
14196
14201
|
baseLocation: G,
|
|
14197
14202
|
refreshNavigation: D,
|
|
14198
|
-
getParentReferencesFromPath:
|
|
14199
|
-
getParentCollectionIds:
|
|
14200
|
-
convertIdsToPaths:
|
|
14201
|
-
}
|
|
14203
|
+
getParentReferencesFromPath: me,
|
|
14204
|
+
getParentCollectionIds: ie,
|
|
14205
|
+
convertIdsToPaths: se
|
|
14206
|
+
};
|
|
14202
14207
|
}
|
|
14203
14208
|
function Pu(e, t) {
|
|
14204
14209
|
return t ? `${ve(e)}/${ve(t)}` : ve(e);
|
|
@@ -14244,69 +14249,69 @@ function dd({
|
|
|
14244
14249
|
o.customId && o.formAutoSave && console.warn(`The collection ${o.path} has customId and formAutoSave enabled. This is not supported and formAutoSave will be ignored`);
|
|
14245
14250
|
const [u, f] = Q(!1), [m, g] = Q(void 0);
|
|
14246
14251
|
mi(m, () => {
|
|
14247
|
-
m &&
|
|
14248
|
-
entityId:
|
|
14252
|
+
m && U({
|
|
14253
|
+
entityId: ie?.id,
|
|
14249
14254
|
collection: o,
|
|
14250
14255
|
path: e,
|
|
14251
14256
|
values: m,
|
|
14252
14257
|
closeAfterSave: !1
|
|
14253
14258
|
});
|
|
14254
14259
|
}, !1, 2e3);
|
|
14255
|
-
const p = Ke(), h = vi(), A = ht(), y = gt(), b =
|
|
14260
|
+
const p = Ke(), h = vi(), A = ht(), y = gt(), b = ue(), w = Ce(), x = ft(), [E, B] = Q(void 0), [v, C] = Q(i ? "copy" : t ? "existing" : "new"), N = he(void 0), R = N.current, F = (o.subcollections ?? []).filter((j) => !j.hideFromNavigation), D = F?.length ?? 0, Y = o.entityViews, oe = Y?.length ?? 0, z = o.formAutoSave && !o.customId, q = oe > 0 || D > 0, te = r ?? Yn(
|
|
14256
14261
|
o ? o.defaultSelectedView : void 0,
|
|
14257
14262
|
{
|
|
14258
14263
|
status: v,
|
|
14259
14264
|
entityId: t
|
|
14260
14265
|
}
|
|
14261
|
-
), P = he(
|
|
14262
|
-
entity:
|
|
14266
|
+
), P = he(te ?? $t), re = P.current === $t, {
|
|
14267
|
+
entity: Z,
|
|
14263
14268
|
dataLoading: G,
|
|
14264
14269
|
// eslint-disable-next-line no-unused-vars
|
|
14265
|
-
dataLoadingError:
|
|
14270
|
+
dataLoadingError: me
|
|
14266
14271
|
} = io({
|
|
14267
14272
|
path: e,
|
|
14268
14273
|
entityId: t,
|
|
14269
14274
|
collection: o,
|
|
14270
14275
|
useCache: !1
|
|
14271
|
-
}), [
|
|
14276
|
+
}), [ie, se] = Q(Z), [T, K] = Q(void 0);
|
|
14272
14277
|
M(() => {
|
|
14273
|
-
|
|
14274
|
-
}, [
|
|
14278
|
+
Z && se(Z);
|
|
14279
|
+
}, [Z]), M(() => {
|
|
14275
14280
|
if (v === "new")
|
|
14276
|
-
|
|
14281
|
+
K(!1);
|
|
14277
14282
|
else {
|
|
14278
|
-
const
|
|
14279
|
-
|
|
14283
|
+
const j = ie ? Un(o, x, $e(e), ie ?? null) : !1;
|
|
14284
|
+
ie && K(!j);
|
|
14280
14285
|
}
|
|
14281
|
-
}, [x,
|
|
14282
|
-
const
|
|
14286
|
+
}, [x, ie, v]);
|
|
14287
|
+
const X = k((j) => {
|
|
14283
14288
|
f(!1), y.open({
|
|
14284
14289
|
type: "error",
|
|
14285
|
-
message: "Error before saving: " +
|
|
14286
|
-
}), console.error(
|
|
14287
|
-
}, [y]), ae = k((
|
|
14290
|
+
message: "Error before saving: " + j?.message
|
|
14291
|
+
}), console.error(j);
|
|
14292
|
+
}, [y]), ae = k((j) => {
|
|
14288
14293
|
f(!1), y.open({
|
|
14289
14294
|
type: "error",
|
|
14290
|
-
message: "Error after saving (entity is saved): " +
|
|
14291
|
-
}), console.error(
|
|
14292
|
-
}, [y]), O = (
|
|
14295
|
+
message: "Error after saving (entity is saved): " + j?.message
|
|
14296
|
+
}), console.error(j);
|
|
14297
|
+
}, [y]), O = (j, Ie) => {
|
|
14293
14298
|
f(!1), z || y.open({
|
|
14294
14299
|
type: "success",
|
|
14295
14300
|
message: `${o.singularName ?? o.name}: Saved correctly`
|
|
14296
|
-
}),
|
|
14301
|
+
}), se(j), C("existing"), s(!1), c && c({ entity: j }), Ie ? (h.setBlocked(!1), h.close(!0), d?.()) : v !== "existing" && A.replace({
|
|
14297
14302
|
path: e,
|
|
14298
|
-
entityId:
|
|
14303
|
+
entityId: j.id,
|
|
14299
14304
|
selectedSubPath: P.current,
|
|
14300
14305
|
updateUrl: !0,
|
|
14301
14306
|
collection: o
|
|
14302
14307
|
});
|
|
14303
|
-
},
|
|
14308
|
+
}, S = k((j) => {
|
|
14304
14309
|
f(!1), y.open({
|
|
14305
14310
|
type: "error",
|
|
14306
|
-
message: "Error saving: " +
|
|
14307
|
-
}), console.error("Error saving entity", e, t), console.error(
|
|
14308
|
-
}, [t, e, y]),
|
|
14309
|
-
values:
|
|
14311
|
+
message: "Error saving: " + j?.message
|
|
14312
|
+
}), console.error("Error saving entity", e, t), console.error(j);
|
|
14313
|
+
}, [t, e, y]), U = ({
|
|
14314
|
+
values: j,
|
|
14310
14315
|
previousValues: Ie,
|
|
14311
14316
|
closeAfterSave: Ne,
|
|
14312
14317
|
entityId: et,
|
|
@@ -14316,19 +14321,19 @@ function dd({
|
|
|
14316
14321
|
f(!0), no({
|
|
14317
14322
|
path: St,
|
|
14318
14323
|
entityId: et,
|
|
14319
|
-
values:
|
|
14324
|
+
values: j,
|
|
14320
14325
|
previousValues: Ie,
|
|
14321
14326
|
collection: Ct,
|
|
14322
14327
|
status: v,
|
|
14323
14328
|
dataSource: p,
|
|
14324
14329
|
context: w,
|
|
14325
14330
|
onSaveSuccess: ($) => O($, Ne),
|
|
14326
|
-
onSaveFailure:
|
|
14327
|
-
onPreSaveHookError:
|
|
14331
|
+
onSaveFailure: S,
|
|
14332
|
+
onPreSaveHookError: X,
|
|
14328
14333
|
onSaveSuccessHookError: ae
|
|
14329
14334
|
}).then();
|
|
14330
14335
|
}, W = async ({
|
|
14331
|
-
collection:
|
|
14336
|
+
collection: j,
|
|
14332
14337
|
path: Ie,
|
|
14333
14338
|
entityId: Ne,
|
|
14334
14339
|
values: et,
|
|
@@ -14336,57 +14341,57 @@ function dd({
|
|
|
14336
14341
|
closeAfterSave: St,
|
|
14337
14342
|
autoSave: $
|
|
14338
14343
|
}) => {
|
|
14339
|
-
v && ($ ? g(et) :
|
|
14340
|
-
collection:
|
|
14344
|
+
v && ($ ? g(et) : U({
|
|
14345
|
+
collection: j,
|
|
14341
14346
|
path: Ie,
|
|
14342
14347
|
entityId: Ne,
|
|
14343
14348
|
values: et,
|
|
14344
14349
|
previousValues: Ct,
|
|
14345
14350
|
closeAfterSave: St
|
|
14346
14351
|
}));
|
|
14347
|
-
}, H =
|
|
14348
|
-
(
|
|
14349
|
-
if (!
|
|
14352
|
+
}, H = Y ? Y.map((j) => Gn(j, b.entityViews)).filter(Boolean) : [], ye = Y && H.map(
|
|
14353
|
+
(j, Ie) => {
|
|
14354
|
+
if (!j || P.current !== j.key)
|
|
14350
14355
|
return null;
|
|
14351
|
-
const Ne =
|
|
14356
|
+
const Ne = j.Builder;
|
|
14352
14357
|
return Ne ? /* @__PURE__ */ n(
|
|
14353
14358
|
"div",
|
|
14354
14359
|
{
|
|
14355
|
-
className:
|
|
14360
|
+
className: ne(
|
|
14356
14361
|
Be,
|
|
14357
14362
|
"relative flex-grow w-full h-full overflow-auto "
|
|
14358
14363
|
),
|
|
14359
14364
|
role: "tabpanel",
|
|
14360
|
-
children: /* @__PURE__ */ n(
|
|
14365
|
+
children: /* @__PURE__ */ n(de, { children: E && /* @__PURE__ */ n(
|
|
14361
14366
|
Ne,
|
|
14362
14367
|
{
|
|
14363
14368
|
collection: o,
|
|
14364
|
-
entity:
|
|
14365
|
-
modifiedValues: R ??
|
|
14369
|
+
entity: ie,
|
|
14370
|
+
modifiedValues: R ?? ie?.values,
|
|
14366
14371
|
formContext: E
|
|
14367
14372
|
}
|
|
14368
14373
|
) })
|
|
14369
14374
|
},
|
|
14370
|
-
`custom_view_${
|
|
14375
|
+
`custom_view_${j.key}`
|
|
14371
14376
|
) : (console.error("customView.Builder is not defined"), null);
|
|
14372
14377
|
}
|
|
14373
|
-
).filter(Boolean),
|
|
14374
|
-
(
|
|
14375
|
-
const Ne =
|
|
14378
|
+
).filter(Boolean), L = G && !ie || (!ie || T === void 0) && (v === "existing" || v === "copy"), ce = L || u, Me = F && F.map(
|
|
14379
|
+
(j, Ie) => {
|
|
14380
|
+
const Ne = j.id ?? j.path, et = ie ? `${e}/${ie?.id}/${ve(Ne)}` : void 0;
|
|
14376
14381
|
return P.current !== Ne ? null : /* @__PURE__ */ _(
|
|
14377
14382
|
"div",
|
|
14378
14383
|
{
|
|
14379
14384
|
className: "relative flex-grow h-full overflow-auto w-full",
|
|
14380
14385
|
role: "tabpanel",
|
|
14381
14386
|
children: [
|
|
14382
|
-
|
|
14383
|
-
!
|
|
14387
|
+
ce && /* @__PURE__ */ n(jr, {}),
|
|
14388
|
+
!L && (ie && et ? /* @__PURE__ */ n(
|
|
14384
14389
|
Po,
|
|
14385
14390
|
{
|
|
14386
14391
|
fullPath: et,
|
|
14387
14392
|
parentCollectionIds: [...a, o.id],
|
|
14388
14393
|
isSubCollection: !0,
|
|
14389
|
-
...
|
|
14394
|
+
...j
|
|
14390
14395
|
}
|
|
14391
14396
|
) : /* @__PURE__ */ n(
|
|
14392
14397
|
"div",
|
|
@@ -14402,31 +14407,31 @@ function dd({
|
|
|
14402
14407
|
}
|
|
14403
14408
|
).filter(Boolean), Se = k(() => {
|
|
14404
14409
|
s(!1);
|
|
14405
|
-
}, []), we = (
|
|
14406
|
-
P.current =
|
|
14410
|
+
}, []), we = (j) => {
|
|
14411
|
+
P.current = j, A.replace({
|
|
14407
14412
|
path: e,
|
|
14408
14413
|
entityId: t,
|
|
14409
|
-
selectedSubPath:
|
|
14414
|
+
selectedSubPath: j === $t ? void 0 : j,
|
|
14410
14415
|
updateUrl: !0,
|
|
14411
14416
|
collection: o
|
|
14412
14417
|
});
|
|
14413
|
-
}, Ye = k((
|
|
14414
|
-
N.current =
|
|
14415
|
-
}, []), Ze = k((
|
|
14418
|
+
}, Ye = k((j) => {
|
|
14419
|
+
N.current = j;
|
|
14420
|
+
}, []), Ze = k((j) => {
|
|
14416
14421
|
y.open({
|
|
14417
14422
|
type: "error",
|
|
14418
14423
|
message: "Error updating id, check the console"
|
|
14419
14424
|
});
|
|
14420
|
-
}, []), at = k((
|
|
14421
|
-
|
|
14425
|
+
}, []), at = k((j) => {
|
|
14426
|
+
se((Ie) => Ie ? {
|
|
14422
14427
|
...Ie,
|
|
14423
|
-
id:
|
|
14428
|
+
id: j
|
|
14424
14429
|
} : void 0);
|
|
14425
|
-
}, []), Qe = (
|
|
14426
|
-
z || s(
|
|
14430
|
+
}, []), Qe = (j) => {
|
|
14431
|
+
z || s(j);
|
|
14427
14432
|
};
|
|
14428
14433
|
function st() {
|
|
14429
|
-
const
|
|
14434
|
+
const j = b.plugins;
|
|
14430
14435
|
let Ie = /* @__PURE__ */ n(
|
|
14431
14436
|
Tc,
|
|
14432
14437
|
{
|
|
@@ -14437,7 +14442,7 @@ function dd({
|
|
|
14437
14442
|
onDiscard: Se,
|
|
14438
14443
|
onValuesChanged: Ye,
|
|
14439
14444
|
onModified: Qe,
|
|
14440
|
-
entity:
|
|
14445
|
+
entity: ie,
|
|
14441
14446
|
onIdChange: at,
|
|
14442
14447
|
onFormContextChange: B,
|
|
14443
14448
|
hideId: o.hideIdFromForm,
|
|
@@ -14445,7 +14450,7 @@ function dd({
|
|
|
14445
14450
|
onIdUpdateError: Ze
|
|
14446
14451
|
}
|
|
14447
14452
|
);
|
|
14448
|
-
return
|
|
14453
|
+
return j && j.forEach((Ne) => {
|
|
14449
14454
|
Ne.form?.provider && (Ie = /* @__PURE__ */ n(
|
|
14450
14455
|
Ne.form.provider.Component,
|
|
14451
14456
|
{
|
|
@@ -14455,14 +14460,14 @@ function dd({
|
|
|
14455
14460
|
onDiscard: Se,
|
|
14456
14461
|
onValuesChanged: Ye,
|
|
14457
14462
|
onModified: Qe,
|
|
14458
|
-
entity:
|
|
14463
|
+
entity: ie,
|
|
14459
14464
|
context: w,
|
|
14460
14465
|
formContext: E,
|
|
14461
14466
|
...Ne.form.provider.props,
|
|
14462
14467
|
children: Ie
|
|
14463
14468
|
}
|
|
14464
14469
|
));
|
|
14465
|
-
}), /* @__PURE__ */ n(
|
|
14470
|
+
}), /* @__PURE__ */ n(de, { children: Ie });
|
|
14466
14471
|
}
|
|
14467
14472
|
const gr = T === void 0 ? /* @__PURE__ */ n(V, {}) : T ? /* @__PURE__ */ _(V, { children: [
|
|
14468
14473
|
/* @__PURE__ */ n(
|
|
@@ -14477,30 +14482,30 @@ function dd({
|
|
|
14477
14482
|
fo,
|
|
14478
14483
|
{
|
|
14479
14484
|
className: "px-12",
|
|
14480
|
-
entity:
|
|
14485
|
+
entity: ie,
|
|
14481
14486
|
path: e,
|
|
14482
14487
|
collection: o
|
|
14483
14488
|
}
|
|
14484
14489
|
)
|
|
14485
14490
|
] }) : st(), Ar = F && F.map(
|
|
14486
|
-
(
|
|
14491
|
+
(j) => /* @__PURE__ */ n(
|
|
14487
14492
|
wr,
|
|
14488
14493
|
{
|
|
14489
14494
|
className: "text-sm min-w-[140px]",
|
|
14490
|
-
value:
|
|
14491
|
-
children:
|
|
14495
|
+
value: j.id,
|
|
14496
|
+
children: j.name
|
|
14492
14497
|
},
|
|
14493
|
-
`entity_detail_collection_tab_${
|
|
14498
|
+
`entity_detail_collection_tab_${j.name}`
|
|
14494
14499
|
)
|
|
14495
14500
|
), br = H.map(
|
|
14496
|
-
(
|
|
14501
|
+
(j) => /* @__PURE__ */ n(
|
|
14497
14502
|
wr,
|
|
14498
14503
|
{
|
|
14499
14504
|
className: "text-sm min-w-[140px]",
|
|
14500
|
-
value:
|
|
14501
|
-
children:
|
|
14505
|
+
value: j.key,
|
|
14506
|
+
children: j.name
|
|
14502
14507
|
},
|
|
14503
|
-
`entity_detail_collection_tab_${
|
|
14508
|
+
`entity_detail_collection_tab_${j.name}`
|
|
14504
14509
|
)
|
|
14505
14510
|
);
|
|
14506
14511
|
return /* @__PURE__ */ n(
|
|
@@ -14511,14 +14516,14 @@ function dd({
|
|
|
14511
14516
|
/* @__PURE__ */ _(
|
|
14512
14517
|
"div",
|
|
14513
14518
|
{
|
|
14514
|
-
className:
|
|
14519
|
+
className: ne(Be, "no-scrollbar border-b pl-2 pr-2 pt-1 flex items-end overflow-scroll bg-gray-50 dark:bg-gray-950"),
|
|
14515
14520
|
children: [
|
|
14516
14521
|
/* @__PURE__ */ n(
|
|
14517
14522
|
"div",
|
|
14518
14523
|
{
|
|
14519
14524
|
className: "pb-1 self-center",
|
|
14520
14525
|
children: /* @__PURE__ */ n(
|
|
14521
|
-
|
|
14526
|
+
le,
|
|
14522
14527
|
{
|
|
14523
14528
|
onClick: () => (d?.(), h.close(!1)),
|
|
14524
14529
|
size: "large",
|
|
@@ -14528,7 +14533,7 @@ function dd({
|
|
|
14528
14533
|
}
|
|
14529
14534
|
),
|
|
14530
14535
|
/* @__PURE__ */ n("div", { className: "flex-grow" }),
|
|
14531
|
-
|
|
14536
|
+
L && /* @__PURE__ */ n(
|
|
14532
14537
|
"div",
|
|
14533
14538
|
{
|
|
14534
14539
|
className: "self-center",
|
|
@@ -14539,17 +14544,17 @@ function dd({
|
|
|
14539
14544
|
Ba,
|
|
14540
14545
|
{
|
|
14541
14546
|
value: P.current,
|
|
14542
|
-
onValueChange: (
|
|
14543
|
-
we(
|
|
14547
|
+
onValueChange: (j) => {
|
|
14548
|
+
we(j);
|
|
14544
14549
|
},
|
|
14545
14550
|
className: "pl-4 pr-4 pt-0",
|
|
14546
14551
|
children: [
|
|
14547
14552
|
/* @__PURE__ */ n(
|
|
14548
14553
|
wr,
|
|
14549
14554
|
{
|
|
14550
|
-
disabled: !
|
|
14555
|
+
disabled: !q,
|
|
14551
14556
|
value: $t,
|
|
14552
|
-
className: `${
|
|
14557
|
+
className: `${q ? "" : "hidden"} text-sm min-w-[140px]`,
|
|
14553
14558
|
children: o.singularName ?? o.name
|
|
14554
14559
|
}
|
|
14555
14560
|
),
|
|
@@ -14577,13 +14582,13 @@ function dd({
|
|
|
14577
14582
|
"div",
|
|
14578
14583
|
{
|
|
14579
14584
|
role: "tabpanel",
|
|
14580
|
-
hidden: !
|
|
14585
|
+
hidden: !re,
|
|
14581
14586
|
id: `form_${e}`,
|
|
14582
14587
|
className: " w-full",
|
|
14583
|
-
children:
|
|
14588
|
+
children: L ? /* @__PURE__ */ n(jr, {}) : gr
|
|
14584
14589
|
}
|
|
14585
14590
|
),
|
|
14586
|
-
|
|
14591
|
+
ye,
|
|
14587
14592
|
Me
|
|
14588
14593
|
]
|
|
14589
14594
|
}
|
|
@@ -14593,7 +14598,7 @@ function dd({
|
|
|
14593
14598
|
);
|
|
14594
14599
|
}
|
|
14595
14600
|
function ud(e, t) {
|
|
14596
|
-
const [r, i] =
|
|
14601
|
+
const [r, i] = I.useState(), { navigator: o } = I.useContext(Ya), a = dr(), s = () => {
|
|
14597
14602
|
i(void 0);
|
|
14598
14603
|
}, l = () => {
|
|
14599
14604
|
t(), i(void 0), a(-1);
|
|
@@ -14611,7 +14616,7 @@ function ud(e, t) {
|
|
|
14611
14616
|
i(u);
|
|
14612
14617
|
}
|
|
14613
14618
|
}, []);
|
|
14614
|
-
return
|
|
14619
|
+
return I.useEffect(() => {
|
|
14615
14620
|
if (!e || r || !("block" in o))
|
|
14616
14621
|
return;
|
|
14617
14622
|
const d = o.block((u) => {
|
|
@@ -14656,7 +14661,7 @@ function md({
|
|
|
14656
14661
|
}
|
|
14657
14662
|
);
|
|
14658
14663
|
}
|
|
14659
|
-
const Go =
|
|
14664
|
+
const Go = I.createContext({
|
|
14660
14665
|
width: "",
|
|
14661
14666
|
blocked: !1,
|
|
14662
14667
|
setBlocked: (e) => {
|
|
@@ -14681,7 +14686,7 @@ function pd({
|
|
|
14681
14686
|
offsetPosition: e,
|
|
14682
14687
|
panel: t
|
|
14683
14688
|
}) {
|
|
14684
|
-
const [r, i] = Q(!1), [o, a] = Q(!1), [s, l] = Q(), c =
|
|
14689
|
+
const [r, i] = Q(!1), [o, a] = Q(!1), [s, l] = Q(), c = I.useRef(t?.width), d = c.current, u = fr(), {
|
|
14685
14690
|
navigationWasBlocked: f,
|
|
14686
14691
|
handleOk: m,
|
|
14687
14692
|
handleCancel: g
|
|
@@ -14724,7 +14729,7 @@ function pd({
|
|
|
14724
14729
|
width: t.width,
|
|
14725
14730
|
transform: `translateX(-${e * 200}px)`
|
|
14726
14731
|
},
|
|
14727
|
-
children: /* @__PURE__ */ n(
|
|
14732
|
+
children: /* @__PURE__ */ n(de, { children: t.component })
|
|
14728
14733
|
}
|
|
14729
14734
|
),
|
|
14730
14735
|
!t && /* @__PURE__ */ n("div", { style: { width: d } })
|
|
@@ -14749,7 +14754,7 @@ function fd(e) {
|
|
|
14749
14754
|
blocked: t,
|
|
14750
14755
|
setBlocked: r,
|
|
14751
14756
|
setBlockedNavigationMessage: i
|
|
14752
|
-
} = vi(), o = ke(), a =
|
|
14757
|
+
} = vi(), o = ke(), a = pe(() => o.getParentCollectionIds(e.path), [o, e.path]), s = pe(() => {
|
|
14753
14758
|
if (!e)
|
|
14754
14759
|
return;
|
|
14755
14760
|
let c = e.collection;
|
|
@@ -14773,7 +14778,7 @@ function fd(e) {
|
|
|
14773
14778
|
"."
|
|
14774
14779
|
] }) : void 0);
|
|
14775
14780
|
}, [s?.name, r, i]);
|
|
14776
|
-
return !e || !s ? /* @__PURE__ */ n("div", { className: "w-full" }) : /* @__PURE__ */ n(V, { children: /* @__PURE__ */ n(
|
|
14781
|
+
return !e || !s ? /* @__PURE__ */ n("div", { className: "w-full" }) : /* @__PURE__ */ n(V, { children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
14777
14782
|
dd,
|
|
14778
14783
|
{
|
|
14779
14784
|
...e,
|
|
@@ -14888,7 +14893,7 @@ function bd() {
|
|
|
14888
14893
|
};
|
|
14889
14894
|
M(() => {
|
|
14890
14895
|
const g = (e.state?.panels ?? []).map((p) => a.current[p]).filter((p) => !!p);
|
|
14891
|
-
|
|
14896
|
+
ee(o.current.map((p) => p.key), g.map((p) => p.key)) || l(g);
|
|
14892
14897
|
}, [e]);
|
|
14893
14898
|
const c = k(() => {
|
|
14894
14899
|
if (r.length === 0)
|
|
@@ -15235,7 +15240,7 @@ function Ou(e) {
|
|
|
15235
15240
|
entityViews: g ?? [],
|
|
15236
15241
|
propertyConfigs: m ?? {},
|
|
15237
15242
|
components: p
|
|
15238
|
-
}, B =
|
|
15243
|
+
}, B = pe(() => ({
|
|
15239
15244
|
onAnalyticsEvent: f
|
|
15240
15245
|
}), []);
|
|
15241
15246
|
return kd(l), h.navigationLoadingError ? /* @__PURE__ */ n(Ni, { maxWidth: "md", children: /* @__PURE__ */ n(
|
|
@@ -15304,7 +15309,7 @@ function xd({
|
|
|
15304
15309
|
loading: e,
|
|
15305
15310
|
children: t
|
|
15306
15311
|
}) {
|
|
15307
|
-
const r = Ce(), i =
|
|
15312
|
+
const r = Ce(), i = ue();
|
|
15308
15313
|
let o = t({
|
|
15309
15314
|
context: r,
|
|
15310
15315
|
loading: e
|
|
@@ -15352,7 +15357,7 @@ function Ed({
|
|
|
15352
15357
|
};
|
|
15353
15358
|
return /* @__PURE__ */ _("div", { className: "flex-grow overflow-scroll no-scrollbar", children: [
|
|
15354
15359
|
c.map((m) => /* @__PURE__ */ _(
|
|
15355
|
-
|
|
15360
|
+
I.Fragment,
|
|
15356
15361
|
{
|
|
15357
15362
|
children: [
|
|
15358
15363
|
u(m),
|
|
@@ -15403,7 +15408,7 @@ function sn({
|
|
|
15403
15408
|
width: r ? "280px" : "72px",
|
|
15404
15409
|
transition: r ? "width 150ms ease-in" : void 0
|
|
15405
15410
|
},
|
|
15406
|
-
className: ({ isActive: c }) =>
|
|
15411
|
+
className: ({ isActive: c }) => ne(
|
|
15407
15412
|
"rounded-r-xl truncate",
|
|
15408
15413
|
"hover:bg-slate-300 hover:bg-opacity-75 dark:hover:bg-gray-700 dark:hover:bg-opacity-75 text-gray-800 dark:text-gray-200 hover:text-gray-900 hover:dark:text-gray-100",
|
|
15409
15414
|
"flex flex-row items-center mr-8",
|
|
@@ -15425,7 +15430,7 @@ function sn({
|
|
|
15425
15430
|
/* @__PURE__ */ n(
|
|
15426
15431
|
"div",
|
|
15427
15432
|
{
|
|
15428
|
-
className:
|
|
15433
|
+
className: ne(
|
|
15429
15434
|
r ? "opacity-100" : "opacity-0 hidden",
|
|
15430
15435
|
"ml-4 font-inherit text-inherit"
|
|
15431
15436
|
),
|
|
@@ -15445,7 +15450,7 @@ function sn({
|
|
|
15445
15450
|
}
|
|
15446
15451
|
);
|
|
15447
15452
|
}
|
|
15448
|
-
const Bd = 280, Mu =
|
|
15453
|
+
const Bd = 280, Mu = I.memo(
|
|
15449
15454
|
function(t) {
|
|
15450
15455
|
const {
|
|
15451
15456
|
children: r,
|
|
@@ -15457,7 +15462,7 @@ const Bd = 280, Mu = S.memo(
|
|
|
15457
15462
|
drawerProps: c,
|
|
15458
15463
|
FireCMSAppBar: d = ed,
|
|
15459
15464
|
fireCMSAppBarProps: u
|
|
15460
|
-
} = t, f = He(), [m, g] =
|
|
15465
|
+
} = t, f = He(), [m, g] = I.useState(!1), [p, h] = I.useState(!1), A = k(() => h(!0), []), y = k(() => h(!1), []), b = k(() => {
|
|
15461
15466
|
g(!1);
|
|
15462
15467
|
}, []), w = m || !!(f && s && p);
|
|
15463
15468
|
return /* @__PURE__ */ _(
|
|
@@ -15515,8 +15520,8 @@ const Bd = 280, Mu = S.memo(
|
|
|
15515
15520
|
/* @__PURE__ */ n(
|
|
15516
15521
|
"div",
|
|
15517
15522
|
{
|
|
15518
|
-
className:
|
|
15519
|
-
children: /* @__PURE__ */ n(
|
|
15523
|
+
className: ne(Be, "flex-grow overflow-auto lg:m-0 lg:mx-4 lg:mb-4 lg:rounded-lg lg:border lg:border-solid m-0 mt-1"),
|
|
15524
|
+
children: /* @__PURE__ */ n(de, { children: r })
|
|
15520
15525
|
}
|
|
15521
15526
|
)
|
|
15522
15527
|
]
|
|
@@ -15526,7 +15531,7 @@ const Bd = 280, Mu = S.memo(
|
|
|
15526
15531
|
}
|
|
15527
15532
|
);
|
|
15528
15533
|
},
|
|
15529
|
-
|
|
15534
|
+
ee
|
|
15530
15535
|
), Cd = () => /* @__PURE__ */ n("div", { className: "flex flex-col min-h-[68px]" });
|
|
15531
15536
|
function Sd(e) {
|
|
15532
15537
|
const t = ke(), r = e.displayed ? e.open ? Bd : 72 : 0, i = /* @__PURE__ */ _(
|
|
@@ -15546,7 +15551,7 @@ function Sd(e) {
|
|
|
15546
15551
|
sideOffset: 12,
|
|
15547
15552
|
className: "fixed top-2 left-3 !bg-gray-50 dark:!bg-gray-900 rounded-full w-fit",
|
|
15548
15553
|
children: /* @__PURE__ */ n(
|
|
15549
|
-
|
|
15554
|
+
le,
|
|
15550
15555
|
{
|
|
15551
15556
|
color: "inherit",
|
|
15552
15557
|
"aria-label": "Open menu",
|
|
@@ -15566,7 +15571,7 @@ function Sd(e) {
|
|
|
15566
15571
|
transition: "padding 100ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",
|
|
15567
15572
|
padding: e.open ? "32px 144px 0px 24px" : "72px 16px 0px"
|
|
15568
15573
|
},
|
|
15569
|
-
className:
|
|
15574
|
+
className: ne("cursor-pointer"),
|
|
15570
15575
|
children: /* @__PURE__ */ n(
|
|
15571
15576
|
_e,
|
|
15572
15577
|
{
|
|
@@ -15582,7 +15587,7 @@ function Sd(e) {
|
|
|
15582
15587
|
{
|
|
15583
15588
|
src: e.logo,
|
|
15584
15589
|
alt: "Logo",
|
|
15585
|
-
className:
|
|
15590
|
+
className: ne(
|
|
15586
15591
|
"max-w-full max-h-full",
|
|
15587
15592
|
e.open ?? "w-[112px] h-[112px]"
|
|
15588
15593
|
)
|
|
@@ -15617,7 +15622,7 @@ function Sd(e) {
|
|
|
15617
15622
|
{
|
|
15618
15623
|
className: `absolute right-0 top-4 ${e.open ? "opacity-100" : "opacity-0 invisible"} transition-opacity duration-1000 ease-in-out`,
|
|
15619
15624
|
children: /* @__PURE__ */ n(
|
|
15620
|
-
|
|
15625
|
+
le,
|
|
15621
15626
|
{
|
|
15622
15627
|
"aria-label": "Close drawer",
|
|
15623
15628
|
onClick: () => e.setDrawerOpen(!1),
|
|
@@ -15630,7 +15635,7 @@ function Sd(e) {
|
|
|
15630
15635
|
}
|
|
15631
15636
|
) : e.displayed ? /* @__PURE__ */ _(V, { children: [
|
|
15632
15637
|
/* @__PURE__ */ n(
|
|
15633
|
-
|
|
15638
|
+
le,
|
|
15634
15639
|
{
|
|
15635
15640
|
color: "inherit",
|
|
15636
15641
|
"aria-label": "Open drawer",
|
|
@@ -15966,7 +15971,7 @@ function xi(e) {
|
|
|
15966
15971
|
function Yo(e) {
|
|
15967
15972
|
return e.propertyConfig ? e.propertyConfig : xi(e);
|
|
15968
15973
|
}
|
|
15969
|
-
const zu =
|
|
15974
|
+
const zu = I.memo(
|
|
15970
15975
|
function({
|
|
15971
15976
|
HomePage: t = Zc,
|
|
15972
15977
|
customRoutes: r
|
|
@@ -15985,7 +15990,7 @@ const zu = S.memo(
|
|
|
15985
15990
|
Jt,
|
|
15986
15991
|
{
|
|
15987
15992
|
path: g + "/*",
|
|
15988
|
-
element: /* @__PURE__ */ n(
|
|
15993
|
+
element: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ n(
|
|
15989
15994
|
Po,
|
|
15990
15995
|
{
|
|
15991
15996
|
isSubCollection: !1,
|
|
@@ -16120,7 +16125,7 @@ export {
|
|
|
16120
16125
|
fo as EntityPreview,
|
|
16121
16126
|
We as EntityReference,
|
|
16122
16127
|
Ve as EnumValuesChip,
|
|
16123
|
-
|
|
16128
|
+
de as ErrorBoundary,
|
|
16124
16129
|
Ee as ErrorView,
|
|
16125
16130
|
Te as FieldHelperText,
|
|
16126
16131
|
Ou as FireCMS,
|
|
@@ -16287,7 +16292,7 @@ export {
|
|
|
16287
16292
|
Is as useClipboard,
|
|
16288
16293
|
ku as useCollectionFetch,
|
|
16289
16294
|
ko as useColumnIds,
|
|
16290
|
-
|
|
16295
|
+
ue as useCustomizationController,
|
|
16291
16296
|
Ke as useDataSource,
|
|
16292
16297
|
Co as useDataSourceEntityCollectionTableController,
|
|
16293
16298
|
mi as useDebouncedCallback,
|