@plumile/backoffice-react 0.1.60 → 0.1.62
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/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +67 -68
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailBadgeRow.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailBadgeRow.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailField.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailField.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +21 -21
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailTaggedValue.js.map +1 -1
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js +12 -12
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js.map +1 -1
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -1
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +19 -19
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js +1 -1
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeContentFallback.js +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeContentFallback.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +30 -31
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js +2 -2
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsQueryBoundary.js.map +1 -1
- package/lib/esm/hooks/useBackofficeAuth.js +13 -13
- package/lib/esm/hooks/useBackofficeAuth.js.map +1 -1
- package/lib/esm/hooks/useBackofficeSessionAuth.js +8 -8
- package/lib/esm/hooks/useBackofficeSessionAuth.js.map +1 -1
- package/lib/esm/index.js +18 -2
- package/lib/esm/pages/BackofficeDashboardPage.js +24 -24
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +8 -8
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +86 -87
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js +3 -3
- package/lib/esm/pages/BackofficeLayoutPage.js +4 -4
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeLoginPage.js +4 -4
- package/lib/esm/pages/BackofficeLoginPage.js.map +1 -1
- package/lib/esm/pages/BackofficePasswordResetCompletePage.js +6 -6
- package/lib/esm/pages/BackofficePasswordResetCompletePage.js.map +1 -1
- package/lib/esm/pages/BackofficePasswordResetRequestPage.js +4 -4
- package/lib/esm/pages/BackofficePasswordResetRequestPage.js.map +1 -1
- package/lib/esm/pages/BackofficeToolsOperationPage.js +53 -53
- package/lib/esm/pages/BackofficeToolsOperationPage.js.map +1 -1
- package/lib/esm/pages/BackofficeVerifyEmailPage.js +6 -6
- package/lib/esm/pages/BackofficeVerifyEmailPage.js.map +1 -1
- package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
- package/lib/esm/provider/BackofficeProvider.js +0 -2
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/relay/RelayProvider.js +4 -4
- package/lib/esm/relay/RelayProvider.js.map +1 -1
- package/lib/esm/relay/createInlineReader.js +3 -3
- package/lib/esm/relay/createInlineReader.js.map +1 -1
- package/lib/esm/relay/useRelayEnvironment.js +7 -2
- package/lib/esm/relay/useRelayEnvironment.js.map +1 -0
- package/lib/esm/router/createBackofficeRoutes.js +81 -81
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailFlagTag.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/EntityFilterValue.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +1 -1
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts +1 -1
- package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts.map +1 -1
- package/lib/types/hooks/useBackofficeAuth.d.ts.map +1 -1
- package/lib/types/hooks/useBackofficeSessionAuth.d.ts.map +1 -1
- package/lib/types/index.d.ts +18 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeLoginPage.d.ts +1 -1
- package/lib/types/pages/BackofficeLoginPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficePasswordResetCompletePage.d.ts.map +1 -1
- package/lib/types/pages/BackofficePasswordResetRequestPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeToolsOperationPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeVerifyEmailPage.d.ts.map +1 -1
- package/lib/types/pages/detail/buildTabsItems.d.ts +1 -1
- package/lib/types/pages/detail/buildTabsItems.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts +0 -2
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/relay/RelayProvider.d.ts.map +1 -1
- package/lib/types/relay/createInlineReader.d.ts.map +1 -1
- package/lib/types/relay/useRelayEnvironment.d.ts +2 -1
- package/lib/types/relay/useRelayEnvironment.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -16,26 +16,25 @@ import { buildEntityDetailBreadcrumb as h } from "../components/backoffice/layou
|
|
|
16
16
|
import { BackofficeEntityDetailScaffold as g } from "../components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js";
|
|
17
17
|
import { useRelayEnvironment as _ } from "../relay/useRelayEnvironment.js";
|
|
18
18
|
import { useBackofficeFormats as v } from "../i18n/useBackofficeFormats.js";
|
|
19
|
-
import {
|
|
19
|
+
import { resolveVisibleDetailPages as y } from "./detail/pageResolution.js";
|
|
20
|
+
import { useBackofficeEntityDetailLayoutContext as b } from "./detail/BackofficeEntityDetailLayoutContext.js";
|
|
20
21
|
import { headerActions as ee, headerBlock as te, headerMeta as ne, headerMetaList as re } from "./backofficeEntityDetailPage.css.js";
|
|
21
22
|
import { buildTabsItems as ie } from "./detail/buildTabsItems.js";
|
|
22
|
-
import { resolveVisibleDetailPages as b } from "./detail/pageResolution.js";
|
|
23
23
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
24
24
|
import { useTranslation as w } from "react-i18next";
|
|
25
|
-
import {
|
|
26
|
-
import { useContext as
|
|
27
|
-
import { commitMutation as
|
|
28
|
-
import { HighlightCode as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import { ChatCheckSvg as V } from "@plumile/ui/icons/ChatCheckSvg.js";
|
|
25
|
+
import { BackofficeKeyValueList as T, BackofficePageHeader as ae, BackofficeRelationsMenu as oe, Button as E, DataTable as D, FormattedDate as O, LinkButton as se, useToast as k } from "@plumile/ui";
|
|
26
|
+
import { useContext as A, useMemo as ce, useState as j } from "react";
|
|
27
|
+
import { commitMutation as le, useFragment as M, usePreloadedQuery as N } from "react-relay";
|
|
28
|
+
import { HighlightCode as P } from "@plumile/ui/atomic/molecules/highlight/HighlightCode.js";
|
|
29
|
+
import { HttpRedirect as F, Link as I, RoutingContext as L } from "@plumile/router";
|
|
30
|
+
import { BACKOFFICE_DATE_TIME_OPTIONS as R } from "@plumile/backoffice-core/constants.js";
|
|
31
|
+
import { Tag as z } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
|
|
32
|
+
import { buildBackofficeFallbackListHref as ue, buildBackofficeListHref as de, buildBackofficeListLink as fe } from "@plumile/backoffice-core/state/buildListHref.js";
|
|
33
|
+
import { setWhereValue as B } from "@plumile/backoffice-core/filters/where.js";
|
|
34
|
+
import { DetailPageTemplate as pe } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
|
|
35
|
+
import { BackofficeTabs as me } from "@plumile/ui/backoffice/molecules/backoffice_tabs/BackofficeTabs.js";
|
|
36
|
+
import { LazyBackofficeJsonViewer as V } from "@plumile/ui/backoffice/molecules/backoffice_json_viewer/LazyBackofficeJsonViewer.js";
|
|
37
|
+
import { ChatCheckSvg as he } from "@plumile/ui/icons/ChatCheckSvg.js";
|
|
39
38
|
import { KeyOffSvg as H } from "@plumile/ui/icons/KeyOffSvg.js";
|
|
40
39
|
import { KeySvg as U } from "@plumile/ui/icons/KeySvg.js";
|
|
41
40
|
import { LockOpenSvg as W } from "@plumile/ui/icons/LockOpenSvg.js";
|
|
@@ -106,7 +105,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
106
105
|
} : {
|
|
107
106
|
tone: "success",
|
|
108
107
|
label: n("flags.failure.ok"),
|
|
109
|
-
icon: /* @__PURE__ */ S(
|
|
108
|
+
icon: /* @__PURE__ */ S(he, {
|
|
110
109
|
width: 14,
|
|
111
110
|
height: 14,
|
|
112
111
|
"aria-hidden": "true"
|
|
@@ -216,7 +215,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
216
215
|
let r = Z(e.label, n), o = r != null && String(r).trim() !== "" ? r : null;
|
|
217
216
|
if (o == null) return a;
|
|
218
217
|
let s = i?.(e.entity, t) ?? null;
|
|
219
|
-
return s == null ? o : /* @__PURE__ */ S(
|
|
218
|
+
return s == null ? o : /* @__PURE__ */ S(I, {
|
|
220
219
|
to: s,
|
|
221
220
|
children: o
|
|
222
221
|
});
|
|
@@ -224,7 +223,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
224
223
|
let { href: o } = e;
|
|
225
224
|
if (o == null || o.trim() === "") return a;
|
|
226
225
|
let s = Z(e.label, n);
|
|
227
|
-
return Q(s) ? a : /* @__PURE__ */ S(
|
|
226
|
+
return Q(s) ? a : /* @__PURE__ */ S(I, {
|
|
228
227
|
to: o,
|
|
229
228
|
children: s
|
|
230
229
|
});
|
|
@@ -246,7 +245,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
246
245
|
break;
|
|
247
246
|
}
|
|
248
247
|
case "badge": {
|
|
249
|
-
let n = Z(e.value(t), r), i = n == null ? "" : String(n), a = $(e.tone, t), o = i.trim() === "" ? null : /* @__PURE__ */ S(
|
|
248
|
+
let n = Z(e.value(t), r), i = n == null ? "" : String(n), a = $(e.tone, t), o = i.trim() === "" ? null : /* @__PURE__ */ S(z, {
|
|
250
249
|
tone: a,
|
|
251
250
|
children: i
|
|
252
251
|
});
|
|
@@ -281,9 +280,9 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
281
280
|
id: v,
|
|
282
281
|
label: X(e.label, r),
|
|
283
282
|
size: e.size,
|
|
284
|
-
value: /* @__PURE__ */ S(
|
|
283
|
+
value: /* @__PURE__ */ S(O, {
|
|
285
284
|
value: n,
|
|
286
|
-
options:
|
|
285
|
+
options: R,
|
|
287
286
|
fallback: i("common.notAvailable")
|
|
288
287
|
})
|
|
289
288
|
});
|
|
@@ -321,7 +320,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
321
320
|
let n = e.id(t), i = null;
|
|
322
321
|
if (n != null && n.trim() !== "") {
|
|
323
322
|
let r = e.value?.(t), o = r != null && r.trim() !== "" ? r : null, s = a?.(e.entity, n) ?? null;
|
|
324
|
-
o != null && (i = s == null ? o : /* @__PURE__ */ S(
|
|
323
|
+
o != null && (i = s == null ? o : /* @__PURE__ */ S(I, {
|
|
325
324
|
to: s,
|
|
326
325
|
children: o
|
|
327
326
|
}));
|
|
@@ -335,7 +334,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
335
334
|
break;
|
|
336
335
|
}
|
|
337
336
|
case "link": {
|
|
338
|
-
let n = e.href(t), i = e.value(t), a = n != null && n.trim() !== "" && !Q(i) ? /* @__PURE__ */ S(
|
|
337
|
+
let n = e.href(t), i = e.value(t), a = n != null && n.trim() !== "" && !Q(i) ? /* @__PURE__ */ S(I, {
|
|
339
338
|
to: n,
|
|
340
339
|
children: i
|
|
341
340
|
}) : null;
|
|
@@ -376,7 +375,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
376
375
|
if (n == null) break;
|
|
377
376
|
let i = d[e.entity];
|
|
378
377
|
if (i == null) break;
|
|
379
|
-
let a = X(e.label, r), o = e.count?.(t) ?? null, s =
|
|
378
|
+
let a = X(e.label, r), o = e.count?.(t) ?? null, s = B(null, e.whereKey, n, e.path);
|
|
380
379
|
if (s == null) break;
|
|
381
380
|
h.push(f({
|
|
382
381
|
id: v,
|
|
@@ -417,9 +416,9 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
417
416
|
};
|
|
418
417
|
}, je = (e, t, n) => {
|
|
419
418
|
let { tApp: r, t: i, resolveEntityHref: a } = n, o = i("common.notAvailable");
|
|
420
|
-
if (e.type === "dateTime") return /* @__PURE__ */ S(
|
|
419
|
+
if (e.type === "dateTime") return /* @__PURE__ */ S(O, {
|
|
421
420
|
value: e.value(t),
|
|
422
|
-
options:
|
|
421
|
+
options: R,
|
|
423
422
|
fallback: o
|
|
424
423
|
});
|
|
425
424
|
if (e.type === "entityRef") {
|
|
@@ -428,14 +427,14 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
428
427
|
let i = Z(e.value?.(t), r), s = i != null && String(i).trim() !== "" ? i : null;
|
|
429
428
|
if (s == null) return o;
|
|
430
429
|
let c = a?.(e.entity, n) ?? null;
|
|
431
|
-
return c == null ? s : /* @__PURE__ */ S(
|
|
430
|
+
return c == null ? s : /* @__PURE__ */ S(I, {
|
|
432
431
|
to: c,
|
|
433
432
|
children: s
|
|
434
433
|
});
|
|
435
434
|
}
|
|
436
435
|
if (e.type === "link") {
|
|
437
436
|
let n = e.href(t), i = Z(e.value(t), r);
|
|
438
|
-
return n == null || n.trim() === "" || Q(i) ? o : /* @__PURE__ */ S(
|
|
437
|
+
return n == null || n.trim() === "" || Q(i) ? o : /* @__PURE__ */ S(I, {
|
|
439
438
|
to: n,
|
|
440
439
|
children: i
|
|
441
440
|
});
|
|
@@ -454,7 +453,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
454
453
|
return r.length === 0 ? void 0 : /* @__PURE__ */ S(s, { items: r });
|
|
455
454
|
}
|
|
456
455
|
let r = Z(e.value(t), n), i = r == null ? "" : String(r);
|
|
457
|
-
if (i.trim() !== "") return /* @__PURE__ */ S(
|
|
456
|
+
if (i.trim() !== "") return /* @__PURE__ */ S(z, {
|
|
458
457
|
tone: $(e.tone, t),
|
|
459
458
|
children: i
|
|
460
459
|
});
|
|
@@ -479,7 +478,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
479
478
|
let i = X(e.label, r), a = Z(e.value(t), r), o = a == null ? "" : String(a);
|
|
480
479
|
if (o.trim() === "") return;
|
|
481
480
|
let s = $(e.tone, t);
|
|
482
|
-
l.push(/* @__PURE__ */ S(
|
|
481
|
+
l.push(/* @__PURE__ */ S(z, {
|
|
483
482
|
tone: s,
|
|
484
483
|
children: `${i}: ${o}`
|
|
485
484
|
}, `${i}-${n}`));
|
|
@@ -532,7 +531,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
532
531
|
return /* @__PURE__ */ S(c, {
|
|
533
532
|
title: p,
|
|
534
533
|
description: m,
|
|
535
|
-
children: /* @__PURE__ */ S(
|
|
534
|
+
children: /* @__PURE__ */ S(D, {
|
|
536
535
|
columns: o(e.columns, {
|
|
537
536
|
tApp: r,
|
|
538
537
|
t: i,
|
|
@@ -552,7 +551,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
552
551
|
if (e.kind === "json") return /* @__PURE__ */ S(c, {
|
|
553
552
|
title: p,
|
|
554
553
|
description: m,
|
|
555
|
-
children: /* @__PURE__ */ S(
|
|
554
|
+
children: /* @__PURE__ */ S(V, {
|
|
556
555
|
value: e.value(t),
|
|
557
556
|
title: p
|
|
558
557
|
})
|
|
@@ -562,7 +561,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
562
561
|
return /* @__PURE__ */ S(c, {
|
|
563
562
|
title: p,
|
|
564
563
|
description: m,
|
|
565
|
-
children: /* @__PURE__ */ S(
|
|
564
|
+
children: /* @__PURE__ */ S(P, {
|
|
566
565
|
badgeLabel: i("tools.output"),
|
|
567
566
|
copyCode: n,
|
|
568
567
|
fallbackCodeText: n
|
|
@@ -581,7 +580,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
581
580
|
}, u) : /* @__PURE__ */ S(c, {
|
|
582
581
|
title: p,
|
|
583
582
|
description: m,
|
|
584
|
-
children: /* @__PURE__ */ S(
|
|
583
|
+
children: /* @__PURE__ */ S(T, { items: e.items.map((e, n) => {
|
|
585
584
|
let a = X(e.label, r), o = Z(e.value(t), r);
|
|
586
585
|
return {
|
|
587
586
|
id: `${a}-${n}`,
|
|
@@ -592,25 +591,25 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
592
591
|
}, u);
|
|
593
592
|
});
|
|
594
593
|
}, Fe = ({ config: o, prepared: s }) => {
|
|
595
|
-
let { t: l } = w(), { t: u } = t(), { formatNumber: d, formatCurrency: f, formatPercent: p } = v(), { entities:
|
|
594
|
+
let { t: l } = w(), { t: u } = t(), { formatNumber: d, formatCurrency: f, formatPercent: p } = v(), { entities: D, entityRegistry: O } = n(), { layoutView: P } = b(), I = A(L), R = _(), z = k(), [B, V] = j({}), [he, H] = j(null), U = y({
|
|
596
595
|
mainPage: o.pages.mainPage,
|
|
597
596
|
subPages: o.pages.subPages,
|
|
598
597
|
activePagePath: s.pagePath,
|
|
599
|
-
node:
|
|
598
|
+
node: P
|
|
600
599
|
}), W = U.activePage ?? o.pages.mainPage, G = U.pages.length > 0 ? U.pages : [o.pages.mainPage], K = (e, t) => {
|
|
601
|
-
|
|
600
|
+
V((n) => n[e] === t ? n : {
|
|
602
601
|
...n,
|
|
603
602
|
[e]: t
|
|
604
603
|
});
|
|
605
|
-
}, { page: q } = o, J =
|
|
604
|
+
}, { page: q } = o, J = N(q.query, s.pageQuery), Y = q.resolveNode(J, {
|
|
606
605
|
id: s.id,
|
|
607
606
|
detailId: s.detailId
|
|
608
607
|
});
|
|
609
|
-
if (Y == null) throw new
|
|
610
|
-
let ge =
|
|
611
|
-
let t =
|
|
608
|
+
if (Y == null) throw new F(o.routes.list);
|
|
609
|
+
let ge = M(q.fragment, Y), _e = ce(() => Object.fromEntries(q.content.flatMap((e) => e.kind === "section" ? e.fields.flatMap((e) => e.type === "relation" ? [e.entity] : []) : []).flatMap((e) => {
|
|
610
|
+
let t = D[e];
|
|
612
611
|
return t?.hasList === !0 ? [[e, t.routes.list]] : [];
|
|
613
|
-
})), [
|
|
612
|
+
})), [D, q.content]);
|
|
614
613
|
return /* @__PURE__ */ S(g, {
|
|
615
614
|
node: ge,
|
|
616
615
|
render: (t) => {
|
|
@@ -620,30 +619,30 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
620
619
|
tApp: l,
|
|
621
620
|
detailPageHref: o.routes.detailPage
|
|
622
621
|
}), _ = (e, t) => {
|
|
623
|
-
let n =
|
|
622
|
+
let n = D[e];
|
|
624
623
|
return n == null ? null : n.routes.detail(t);
|
|
625
624
|
}, v = ({ id: e, label: t, count: n, entityId: r, filterId: i, listRoute: a, path: o, value: s, where: c, whereKey: l }) => {
|
|
626
|
-
let u =
|
|
625
|
+
let u = O.getLoadedListEntity(r);
|
|
627
626
|
return {
|
|
628
627
|
id: e,
|
|
629
628
|
label: t,
|
|
630
629
|
count: n,
|
|
631
|
-
href: u == null ?
|
|
630
|
+
href: u == null ? ue(a, c, [{
|
|
632
631
|
id: i ?? (o == null ? l : `${l}.${o.join(".")}`),
|
|
633
632
|
value: s
|
|
634
|
-
}]) :
|
|
633
|
+
}]) : de(u.config, { where: c }),
|
|
635
634
|
onClick: async (e) => {
|
|
636
|
-
if (
|
|
635
|
+
if (I == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
637
636
|
e.preventDefault();
|
|
638
|
-
let t =
|
|
639
|
-
|
|
637
|
+
let t = fe((await O.loadListEntity(r)).config, { where: c });
|
|
638
|
+
I.history.push({
|
|
640
639
|
pathname: t.pathname,
|
|
641
640
|
search: t.search === "" ? "" : `?${t.search}`,
|
|
642
641
|
hash: ""
|
|
643
642
|
});
|
|
644
643
|
}
|
|
645
644
|
};
|
|
646
|
-
}, y = Ne(o.header,
|
|
645
|
+
}, y = Ne(o.header, P, {
|
|
647
646
|
tApp: l,
|
|
648
647
|
t: u,
|
|
649
648
|
resolveEntityHref: _
|
|
@@ -651,21 +650,21 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
651
650
|
config: o,
|
|
652
651
|
tApp: l,
|
|
653
652
|
entityId: s.id,
|
|
654
|
-
layoutView:
|
|
653
|
+
layoutView: P,
|
|
655
654
|
pageLabel: W.label(l)
|
|
656
|
-
}), w = q.actions ?? [],
|
|
655
|
+
}), w = q.actions ?? [], k = [];
|
|
657
656
|
if (w.length > 0) {
|
|
658
657
|
let t = w.filter((e) => e.isVisible == null ? !0 : e.isVisible(n));
|
|
659
|
-
t.length > 0 && (
|
|
660
|
-
let a = X(t.label, l), o = t.ariaLabel == null ? a : X(t.ariaLabel, l), s = t.variant ?? "secondary", c = t.size ?? "small", d =
|
|
661
|
-
return Te(t) ? /* @__PURE__ */ S(
|
|
658
|
+
t.length > 0 && (k = t.map((t) => {
|
|
659
|
+
let a = X(t.label, l), o = t.ariaLabel == null ? a : X(t.ariaLabel, l), s = t.variant ?? "secondary", c = t.size ?? "small", d = B[t.id] ?? !1, f = d || t.isDisabled?.(n) === !0;
|
|
660
|
+
return Te(t) ? /* @__PURE__ */ S(se, {
|
|
662
661
|
to: t.to(n),
|
|
663
662
|
variant: s,
|
|
664
663
|
size: c,
|
|
665
664
|
isDisabled: f,
|
|
666
665
|
"aria-label": o,
|
|
667
666
|
children: a
|
|
668
|
-
}, t.id) : De(t) ? /* @__PURE__ */ S(
|
|
667
|
+
}, t.id) : De(t) ? /* @__PURE__ */ S(E, {
|
|
669
668
|
type: "button",
|
|
670
669
|
variant: s,
|
|
671
670
|
size: c,
|
|
@@ -676,7 +675,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
676
675
|
},
|
|
677
676
|
"aria-label": o,
|
|
678
677
|
children: a
|
|
679
|
-
}, t.id) : Ee(t) ? /* @__PURE__ */ S(
|
|
678
|
+
}, t.id) : Ee(t) ? /* @__PURE__ */ S(E, {
|
|
680
679
|
type: "button",
|
|
681
680
|
variant: s,
|
|
682
681
|
size: c,
|
|
@@ -685,7 +684,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
685
684
|
onClick: () => {
|
|
686
685
|
if (d) return;
|
|
687
686
|
let a = t.getVariables(n);
|
|
688
|
-
K(t.id, !0),
|
|
687
|
+
K(t.id, !0), le(R, {
|
|
689
688
|
mutation: t.mutation,
|
|
690
689
|
variables: a,
|
|
691
690
|
updater: (e) => {
|
|
@@ -708,7 +707,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
708
707
|
let e = Error(a.message);
|
|
709
708
|
if (t.onError?.(e, n), t.toasts?.error != null) {
|
|
710
709
|
let e = r(t.toasts.error, l);
|
|
711
|
-
|
|
710
|
+
z.error(e.title, e.message);
|
|
712
711
|
}
|
|
713
712
|
return;
|
|
714
713
|
}
|
|
@@ -719,13 +718,13 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
719
718
|
response: a,
|
|
720
719
|
node: n,
|
|
721
720
|
tApp: l,
|
|
722
|
-
entities:
|
|
721
|
+
entities: D,
|
|
723
722
|
defaultLabel: u("actions.view"),
|
|
724
723
|
navigateTo: (e) => {
|
|
725
|
-
|
|
724
|
+
I?.history.push({ pathname: e });
|
|
726
725
|
}
|
|
727
726
|
});
|
|
728
|
-
|
|
727
|
+
z.push({
|
|
729
728
|
kind: "info",
|
|
730
729
|
title: e.title,
|
|
731
730
|
message: e.message,
|
|
@@ -736,7 +735,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
736
735
|
onError: (e) => {
|
|
737
736
|
if (K(t.id, !1), t.onError?.(e, n), t.toasts?.error != null) {
|
|
738
737
|
let e = r(t.toasts.error, l);
|
|
739
|
-
|
|
738
|
+
z.error(e.title, e.message);
|
|
740
739
|
}
|
|
741
740
|
}
|
|
742
741
|
});
|
|
@@ -746,9 +745,9 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
746
745
|
}, t.id) : null;
|
|
747
746
|
}));
|
|
748
747
|
}
|
|
749
|
-
let
|
|
750
|
-
|
|
751
|
-
let r = (e.placement ?? "primary") === "secondary" ?
|
|
748
|
+
let A = w.find((e) => e.id === he), { content: ce } = q, j = [], M = [], N = [];
|
|
749
|
+
ce.forEach((e, t) => {
|
|
750
|
+
let r = (e.placement ?? "primary") === "secondary" ? M : j;
|
|
752
751
|
if (e.kind === "section") {
|
|
753
752
|
let i = X(e.title, l), a = e.description == null ? void 0 : X(e.description, l), { items: o, relationItems: s, customNodes: m } = Ae(e.fields, n, {
|
|
754
753
|
tApp: l,
|
|
@@ -761,7 +760,7 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
761
760
|
resolveRelationItem: v
|
|
762
761
|
});
|
|
763
762
|
if (s.forEach((e) => {
|
|
764
|
-
|
|
763
|
+
N.some((t) => t.id === e.id) || N.push(e);
|
|
765
764
|
}), !(o.length > 0 || m.length > 0)) return;
|
|
766
765
|
r.push(/* @__PURE__ */ S(c, {
|
|
767
766
|
title: i,
|
|
@@ -779,42 +778,42 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
779
778
|
})[0];
|
|
780
779
|
i != null && r.push(i);
|
|
781
780
|
});
|
|
782
|
-
let
|
|
781
|
+
let F = N.length > 0 ? /* @__PURE__ */ S(oe, {
|
|
783
782
|
label: u("relations.menu.label"),
|
|
784
|
-
items:
|
|
785
|
-
}) : null,
|
|
783
|
+
items: N
|
|
784
|
+
}) : null, L = k.length > 0 || F != null ? /* @__PURE__ */ C("div", {
|
|
786
785
|
className: ee,
|
|
787
|
-
children: [
|
|
788
|
-
}) : void 0,
|
|
786
|
+
children: [k, F]
|
|
787
|
+
}) : void 0, V = y.status != null || y.badges != null ? /* @__PURE__ */ C("div", {
|
|
789
788
|
className: ne,
|
|
790
789
|
children: [y.status, y.badges]
|
|
791
790
|
}) : void 0, U = y.items != null && y.items.length > 0 ? /* @__PURE__ */ S("div", {
|
|
792
791
|
className: re,
|
|
793
|
-
children: /* @__PURE__ */ S(
|
|
794
|
-
}) : null, J =
|
|
795
|
-
return G.length > 1 && (Y = /* @__PURE__ */ S(
|
|
792
|
+
children: /* @__PURE__ */ S(T, { items: y.items })
|
|
793
|
+
}) : null, J = M.length > 0, Y = null;
|
|
794
|
+
return G.length > 1 && (Y = /* @__PURE__ */ S(me, {
|
|
796
795
|
items: g,
|
|
797
796
|
activeId: W.id,
|
|
798
797
|
onChange: () => {}
|
|
799
798
|
})), /* @__PURE__ */ C(m, {
|
|
800
799
|
breadcrumb: b,
|
|
801
|
-
children: [/* @__PURE__ */ S(
|
|
800
|
+
children: [/* @__PURE__ */ S(pe, {
|
|
802
801
|
headerNode: /* @__PURE__ */ C("div", {
|
|
803
802
|
className: te,
|
|
804
|
-
children: [/* @__PURE__ */ S(
|
|
803
|
+
children: [/* @__PURE__ */ S(ae, {
|
|
805
804
|
title: y.title,
|
|
806
805
|
subtitle: y.subtitle,
|
|
807
|
-
actions:
|
|
808
|
-
meta:
|
|
806
|
+
actions: L,
|
|
807
|
+
meta: V
|
|
809
808
|
}), U]
|
|
810
809
|
}),
|
|
811
810
|
tabsNode: Y,
|
|
812
|
-
sidePanel: J ? /* @__PURE__ */ S(x, { children:
|
|
811
|
+
sidePanel: J ? /* @__PURE__ */ S(x, { children: M }) : void 0,
|
|
813
812
|
sidePanelVariant: "plain",
|
|
814
|
-
children: /* @__PURE__ */ S(x, { children:
|
|
815
|
-
}),
|
|
813
|
+
children: /* @__PURE__ */ S(x, { children: j })
|
|
814
|
+
}), A != null && De(A) && /* @__PURE__ */ S(a, {
|
|
816
815
|
isOpen: !0,
|
|
817
|
-
action:
|
|
816
|
+
action: A,
|
|
818
817
|
node: n,
|
|
819
818
|
onClose: () => {
|
|
820
819
|
H(null);
|
|
@@ -824,14 +823,14 @@ var X = (e, t) => e(t), xe = (e) => typeof e == "object" && !!e && !Array.isArra
|
|
|
824
823
|
}
|
|
825
824
|
});
|
|
826
825
|
}, Ie = ({ config: e, prepared: t }) => {
|
|
827
|
-
let { layoutView: n } =
|
|
826
|
+
let { layoutView: n } = b(), r = y({
|
|
828
827
|
mainPage: e.pages.mainPage,
|
|
829
828
|
subPages: e.pages.subPages,
|
|
830
829
|
activePagePath: t.pagePath,
|
|
831
830
|
node: n
|
|
832
831
|
});
|
|
833
|
-
if (!r.hasVisiblePages || r.activePage == null) throw new
|
|
834
|
-
if (r.activePage.id !== t.pageId) throw new
|
|
832
|
+
if (!r.hasVisiblePages || r.activePage == null) throw new F(e.routes.list);
|
|
833
|
+
if (r.activePage.id !== t.pageId) throw new F(e.routes.detailPage(t.id, r.activePage.id));
|
|
835
834
|
return /* @__PURE__ */ S(Fe, {
|
|
836
835
|
config: t.pageConfig,
|
|
837
836
|
prepared: t
|