@plumile/backoffice-react 0.1.151 → 0.1.153

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.
Files changed (32) hide show
  1. package/lib/esm/auth/authRefreshNotice.css.js +0 -1
  2. package/lib/esm/auth/login/loginPage.css.js +0 -1
  3. package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +2 -0
  4. package/lib/esm/pages/BackofficeDashboardPage.js +73 -244
  5. package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
  6. package/lib/esm/pages/BackofficeDashboardWidgetContent.js +193 -0
  7. package/lib/esm/pages/BackofficeDashboardWidgetContent.js.map +1 -0
  8. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +8 -10
  9. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
  10. package/lib/esm/pages/BackofficeEntityDetailPage.js +261 -246
  11. package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
  12. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +1 -1
  13. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
  14. package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js +10 -9
  15. package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js.map +1 -1
  16. package/lib/esm/pages/BackofficeRedirect.js +13 -0
  17. package/lib/esm/pages/BackofficeRedirect.js.map +1 -0
  18. package/lib/esm/router/createBackofficeRoutes.js +100 -97
  19. package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
  20. package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
  21. package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts +9 -0
  22. package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts.map +1 -0
  23. package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
  24. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  25. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +2 -2
  26. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
  27. package/lib/types/pages/BackofficeEntityDetailUnknownPageRedirect.d.ts.map +1 -1
  28. package/lib/types/pages/BackofficeRedirect.d.ts +7 -0
  29. package/lib/types/pages/BackofficeRedirect.d.ts.map +1 -0
  30. package/lib/types/router/createBackofficeRoutes.d.ts +3 -1
  31. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  32. package/package.json +11 -11
@@ -1,245 +1,262 @@
1
1
  import { useBackofficeReactTranslation as e } from "../i18n/useBackofficeReactTranslation.js";
2
2
  import { resolveMutationOutcome as t } from "../relay/mutationResult.js";
3
3
  import { useBackofficeConfig as n } from "../provider/BackofficeConfigContext.js";
4
- import { resolveToastSpec as r, resolveToastViewActions as i } from "../components/backoffice/actions/toastViewAction.js";
5
- import { LazyBackofficeEntityActionFormDialog as a } from "../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js";
6
- import { buildDataTableColumns as o } from "../components/backoffice/columns/buildDataTableColumns.js";
7
- import { BackofficeDetailBadgeRow as s } from "../components/backoffice/detail/BackofficeDetailBadgeRow.js";
8
- import { BackofficeDetailFlagTag as c } from "../components/backoffice/detail/BackofficeDetailFlagTag.js";
9
- import { BackofficeDetailTaggedValue as l } from "../components/backoffice/detail/BackofficeDetailTaggedValue.js";
10
- import { BackofficeLifecycleTimelineSection as u } from "../components/backoffice/detail/BackofficeLifecycleTimelineSection.js";
11
- import { BackofficeRelationsSummaryGrid as d } from "../components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
4
+ import { BackofficeErrorBoundary as r } from "../components/backoffice/errors/BackofficeErrorBoundary.js";
5
+ import { resolveToastSpec as i, resolveToastViewActions as a } from "../components/backoffice/actions/toastViewAction.js";
6
+ import { LazyBackofficeEntityActionFormDialog as o } from "../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js";
7
+ import { buildDataTableColumns as s } from "../components/backoffice/columns/buildDataTableColumns.js";
8
+ import { BackofficeDetailBadgeRow as c } from "../components/backoffice/detail/BackofficeDetailBadgeRow.js";
9
+ import { BackofficeDetailFlagTag as l } from "../components/backoffice/detail/BackofficeDetailFlagTag.js";
10
+ import { BackofficeDetailTaggedValue as u } from "../components/backoffice/detail/BackofficeDetailTaggedValue.js";
11
+ import { BackofficeLifecycleTimelineSection as d } from "../components/backoffice/detail/BackofficeLifecycleTimelineSection.js";
12
+ import { BackofficeRelationsSummaryGrid as f } from "../components/backoffice/detail/BackofficeRelationsSummaryGrid.js";
12
13
  import { BackofficeRightPageLayout as ee } from "../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js";
13
14
  import { buildEntityDetailBreadcrumb as te } from "../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js";
14
- import { BackofficeEntityDetailScaffold as f } from "../components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js";
15
- import { useBackofficeFormats as p } from "../i18n/useBackofficeFormats.js";
16
- import { useRelayEnvironment as m } from "../relay/useRelayEnvironment.js";
15
+ import { BackofficeEntityDetailScaffold as p } from "../components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js";
16
+ import { useBackofficeFormats as m } from "../i18n/useBackofficeFormats.js";
17
+ import { useRelayEnvironment as ne } from "../relay/useRelayEnvironment.js";
17
18
  import { resolveVisibleDetailPages as h } from "./detail/pageResolution.js";
18
19
  import { useBackofficeEntityDetailLayoutContext as g } from "./detail/BackofficeEntityDetailLayoutContext.js";
19
- import { extractMutationPayload as ne, isFormMutationAction as _, isMutationAction as re, isRouteAction as ie, resolveLabel as v } from "./BackofficeEntityDetailPage.helpers.js";
20
- import { headerActions as ae, headerBlock as oe, headerMeta as se, headerMetaList as ce } from "./backofficeEntityDetailPage.css.js";
21
- import { buildTabsItems as le } from "./detail/buildTabsItems.js";
22
- import { buildFieldItems as ue, renderBlocks as de, resolveHeaderItems as fe } from "./BackofficeEntityDetailPage.view-helpers.js";
23
- import { useContext as y, useMemo as b, useState as x } from "react";
24
- import { Fragment as pe, jsx as S, jsxs as C } from "react/jsx-runtime";
25
- import { useTranslation as me } from "react-i18next";
26
- import { Button as he } from "@plumile/ui/atomic/atoms/button/Button.js";
27
- import { commitMutation as ge, useFragment as w, usePreloadedQuery as T } from "react-relay";
28
- import { useToast as E } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
29
- import D from "@plumile/router/routing/RoutingContext.js";
30
- import { FormattedDate as O } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
31
- import { BACKOFFICE_DATE_TIME_OPTIONS as k } from "@plumile/backoffice-core/constants.js";
32
- import A from "@plumile/router/routing/Link.js";
33
- import { Tag as j } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
34
- import { buildBackofficeFallbackListHref as _e, buildBackofficeListHref as ve, buildBackofficeListLink as ye } from "@plumile/backoffice-core/state/buildListHref.js";
35
- import { BackofficeDetailSection as M } from "@plumile/ui/backoffice/molecules/backoffice_detail_section/BackofficeDetailSection.js";
36
- import { BackofficePayloadViewer as be } from "@plumile/ui/backoffice/molecules/backoffice_payload_viewer/BackofficePayloadViewer.js";
37
- import { setWhereValue as xe } from "@plumile/backoffice-core/filters/where.js";
38
- import { BackofficePageHeader as Se } from "@plumile/ui/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js";
39
- import { AuditTimeline as Ce } from "@plumile/ui/backoffice/organisms/audit_timeline/AuditTimeline.js";
40
- import { MetricCard as we } from "@plumile/ui/components/dashboard/metric_card/MetricCard.js";
41
- import { MetricTileGroup as Te } from "@plumile/ui/components/dashboard/metric_tile_group/MetricTileGroup.js";
42
- import { Tabs as Ee } from "@plumile/ui/atomic/molecules/tabs/Tabs.js";
43
- import { DetailPageTemplate as De } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
44
- import N from "@plumile/router/errors/HttpRedirect.js";
45
- import { DataTable as Oe } from "@plumile/ui/components/data-table/DataTable.js";
46
- import { LinkButton as ke } from "@plumile/ui/atomic/atoms/button/LinkButton.js";
47
- import { BackofficeKeyValueList as P } from "@plumile/ui/backoffice/molecules/backoffice_key_value_list/BackofficeKeyValueList.js";
48
- import { BackofficeRelationsMenu as Ae } from "@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js";
49
- import { BackofficeScopeStack as je } from "@plumile/ui/backoffice/molecules/backoffice_scope_stack/BackofficeScopeStack.js";
50
- import { ChatCheckSvg as F } from "@plumile/ui/icons/ChatCheckSvg.js";
51
- import { KeyOffSvg as I } from "@plumile/ui/icons/KeyOffSvg.js";
52
- import { KeySvg as L } from "@plumile/ui/icons/KeySvg.js";
53
- import { LockOpenSvg as R } from "@plumile/ui/icons/LockOpenSvg.js";
54
- import { LockSvg as z } from "@plumile/ui/icons/LockSvg.js";
55
- import { RobotCheckSvg as B } from "@plumile/ui/icons/RobotCheckSvg.js";
56
- import { RobotXSvg as V } from "@plumile/ui/icons/RobotXSvg.js";
57
- import { RocketOffSvg as H } from "@plumile/ui/icons/RocketOffSvg.js";
58
- import { RocketSvg as U } from "@plumile/ui/icons/RocketSvg.js";
59
- import { SettingsCheckSvg as W } from "@plumile/ui/icons/SettingsCheckSvg.js";
20
+ import { BackofficeRedirect as _ } from "./BackofficeRedirect.js";
21
+ import { extractMutationPayload as re, isFormMutationAction as v, isMutationAction as ie, isRouteAction as ae, resolveLabel as y } from "./BackofficeEntityDetailPage.helpers.js";
22
+ import { headerActions as oe, headerBlock as se, headerMeta as ce, headerMetaList as le } from "./backofficeEntityDetailPage.css.js";
23
+ import { buildTabsItems as ue } from "./detail/buildTabsItems.js";
24
+ import { buildFieldItems as de, renderBlocks as fe, resolveHeaderItems as pe } from "./BackofficeEntityDetailPage.view-helpers.js";
25
+ import { Suspense as b, useContext as x, useMemo as S, useState as C } from "react";
26
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
27
+ import { useTranslation as D } from "react-i18next";
28
+ import { Button as O } from "@plumile/ui/atomic/atoms/button/Button.js";
29
+ import { commitMutation as me, useFragment as k, useLazyLoadQuery as A, usePreloadedQuery as j } from "react-relay";
30
+ import { useToast as M } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
31
+ import N from "@plumile/router/routing/RoutingContext.js";
32
+ import { FormattedDate as P } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
33
+ import { BACKOFFICE_DATE_TIME_OPTIONS as F } from "@plumile/backoffice-core/constants.js";
34
+ import I from "@plumile/router/routing/Link.js";
35
+ import { Tag as L } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
36
+ import { buildBackofficeFallbackListHref as he, buildBackofficeListHref as ge, buildBackofficeListLink as _e } from "@plumile/backoffice-core/state/buildListHref.js";
37
+ import { BackofficeDetailSection as R } from "@plumile/ui/backoffice/molecules/backoffice_detail_section/BackofficeDetailSection.js";
38
+ import { BackofficePayloadViewer as ve } from "@plumile/ui/backoffice/molecules/backoffice_payload_viewer/BackofficePayloadViewer.js";
39
+ import { setWhereValue as ye } from "@plumile/backoffice-core/filters/where.js";
40
+ import { BackofficePageHeader as be } from "@plumile/ui/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js";
41
+ import { AuditTimeline as xe } from "@plumile/ui/backoffice/organisms/audit_timeline/AuditTimeline.js";
42
+ import { MetricCard as Se } from "@plumile/ui/components/dashboard/metric_card/MetricCard.js";
43
+ import { MetricTileGroup as Ce } from "@plumile/ui/components/dashboard/metric_tile_group/MetricTileGroup.js";
44
+ import { Tabs as we } from "@plumile/ui/atomic/molecules/tabs/Tabs.js";
45
+ import { DetailPageTemplate as Te } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
46
+ import { DataTable as Ee } from "@plumile/ui/components/data-table/DataTable.js";
47
+ import { LinkButton as De } from "@plumile/ui/atomic/atoms/button/LinkButton.js";
48
+ import { BackofficeKeyValueList as z } from "@plumile/ui/backoffice/molecules/backoffice_key_value_list/BackofficeKeyValueList.js";
49
+ import { BackofficeRelationsMenu as Oe } from "@plumile/ui/backoffice/molecules/backoffice_relations_menu/BackofficeRelationsMenu.js";
50
+ import { BackofficeScopeStack as ke } from "@plumile/ui/backoffice/molecules/backoffice_scope_stack/BackofficeScopeStack.js";
51
+ import { ChatCheckSvg as B } from "@plumile/ui/icons/ChatCheckSvg.js";
52
+ import { KeyOffSvg as Ae } from "@plumile/ui/icons/KeyOffSvg.js";
53
+ import { KeySvg as je } from "@plumile/ui/icons/KeySvg.js";
54
+ import { LockOpenSvg as Me } from "@plumile/ui/icons/LockOpenSvg.js";
55
+ import { LockSvg as Ne } from "@plumile/ui/icons/LockSvg.js";
56
+ import { RobotCheckSvg as V } from "@plumile/ui/icons/RobotCheckSvg.js";
57
+ import { RobotXSvg as H } from "@plumile/ui/icons/RobotXSvg.js";
58
+ import { RocketOffSvg as U } from "@plumile/ui/icons/RocketOffSvg.js";
59
+ import { RocketSvg as W } from "@plumile/ui/icons/RocketSvg.js";
60
+ import { SettingsCheckSvg as Pe } from "@plumile/ui/icons/SettingsCheckSvg.js";
60
61
  import { SettingsXSvg as G } from "@plumile/ui/icons/SettingsXSvg.js";
61
- import { ShieldLockSvg as K } from "@plumile/ui/icons/ShieldLockSvg.js";
62
- import { ShieldOffSvg as Me } from "@plumile/ui/icons/ShieldOffSvg.js";
63
- import { XBadgeSvg as q } from "@plumile/ui/icons/XBadgeSvg.js";
62
+ import { ShieldLockSvg as Fe } from "@plumile/ui/icons/ShieldLockSvg.js";
63
+ import { ShieldOffSvg as K } from "@plumile/ui/icons/ShieldOffSvg.js";
64
+ import { XBadgeSvg as Ie } from "@plumile/ui/icons/XBadgeSvg.js";
64
65
  //#region src/pages/BackofficeEntityDetailPage.tsx
65
- var Ne = (e) => {
66
+ var q = "store-or-network", J = ({ count: e, node: t, relationValue: n }) => {
67
+ let r = A(e.query, e.getVariables(t, n), { fetchPolicy: q }), i = e.getCount(r);
68
+ return i == null ? null : /* @__PURE__ */ T(w, { children: i });
69
+ }, Le = ({ count: e, node: t, relationValue: n }) => e == null ? null : /* @__PURE__ */ T(r, {
70
+ fallback: () => null,
71
+ children: /* @__PURE__ */ T(b, {
72
+ fallback: null,
73
+ children: /* @__PURE__ */ T(J, {
74
+ count: e,
75
+ node: t,
76
+ relationValue: n
77
+ })
78
+ })
79
+ }), Re = (e) => {
66
80
  switch (e) {
67
- case "shield-lock": return /* @__PURE__ */ S(K, {
81
+ case "shield-lock": return /* @__PURE__ */ T(Fe, {
68
82
  width: 14,
69
83
  height: 14,
70
84
  "aria-hidden": "true"
71
85
  });
72
- case "shield-off": return /* @__PURE__ */ S(Me, {
86
+ case "shield-off": return /* @__PURE__ */ T(K, {
73
87
  width: 14,
74
88
  height: 14,
75
89
  "aria-hidden": "true"
76
90
  });
77
- case "settings-check": return /* @__PURE__ */ S(W, {
91
+ case "settings-check": return /* @__PURE__ */ T(Pe, {
78
92
  width: 14,
79
93
  height: 14,
80
94
  "aria-hidden": "true"
81
95
  });
82
- case "settings-x": return /* @__PURE__ */ S(G, {
96
+ case "settings-x": return /* @__PURE__ */ T(G, {
83
97
  width: 14,
84
98
  height: 14,
85
99
  "aria-hidden": "true"
86
100
  });
87
- case "x-badge": return /* @__PURE__ */ S(q, {
101
+ case "x-badge": return /* @__PURE__ */ T(Ie, {
88
102
  width: 14,
89
103
  height: 14,
90
104
  "aria-hidden": "true"
91
105
  });
92
- case "chat-check": return /* @__PURE__ */ S(F, {
106
+ case "chat-check": return /* @__PURE__ */ T(B, {
93
107
  width: 14,
94
108
  height: 14,
95
109
  "aria-hidden": "true"
96
110
  });
97
- case "key": return /* @__PURE__ */ S(L, {
111
+ case "key": return /* @__PURE__ */ T(je, {
98
112
  width: 14,
99
113
  height: 14,
100
114
  "aria-hidden": "true"
101
115
  });
102
- case "key-off": return /* @__PURE__ */ S(I, {
116
+ case "key-off": return /* @__PURE__ */ T(Ae, {
103
117
  width: 14,
104
118
  height: 14,
105
119
  "aria-hidden": "true"
106
120
  });
107
- case "lock": return /* @__PURE__ */ S(z, {
121
+ case "lock": return /* @__PURE__ */ T(Ne, {
108
122
  width: 14,
109
123
  height: 14,
110
124
  "aria-hidden": "true"
111
125
  });
112
- case "lock-open": return /* @__PURE__ */ S(R, {
126
+ case "lock-open": return /* @__PURE__ */ T(Me, {
113
127
  width: 14,
114
128
  height: 14,
115
129
  "aria-hidden": "true"
116
130
  });
117
- case "robot-check": return /* @__PURE__ */ S(B, {
131
+ case "robot-check": return /* @__PURE__ */ T(V, {
118
132
  width: 14,
119
133
  height: 14,
120
134
  "aria-hidden": "true"
121
135
  });
122
- case "robot-x": return /* @__PURE__ */ S(V, {
136
+ case "robot-x": return /* @__PURE__ */ T(H, {
123
137
  width: 14,
124
138
  height: 14,
125
139
  "aria-hidden": "true"
126
140
  });
127
- case "rocket": return /* @__PURE__ */ S(U, {
141
+ case "rocket": return /* @__PURE__ */ T(W, {
128
142
  width: 14,
129
143
  height: 14,
130
144
  "aria-hidden": "true"
131
145
  });
132
- case "rocket-off": return /* @__PURE__ */ S(H, {
146
+ case "rocket-off": return /* @__PURE__ */ T(U, {
133
147
  width: 14,
134
148
  height: 14,
135
149
  "aria-hidden": "true"
136
150
  });
137
151
  default: throw Error(`Unsupported flag icon: ${String(e)}`);
138
152
  }
139
- }, Pe = (e) => {
153
+ }, ze = (e) => {
140
154
  if (e.presentation?.desktop === "secondary" || e.presentation?.group === "scope" || e.presentation?.group === "status") return "secondary";
141
155
  let t = e.fields?.map((e) => e.presentation?.group) ?? [];
142
156
  return t.length > 0 && t.every((e) => e === "scope" || e === "status") || e.placement === "side" || e.placement === "secondary" ? "secondary" : "primary";
143
- }, Fe = ({ config: F, prepared: I }) => {
144
- let { t: L } = me(), { t: R } = e(), { formatNumber: z, formatCurrency: B, formatCurrencyTitle: V, formatPercent: H } = p(), { entities: U, entityRegistry: W } = n(), { layoutView: G } = g(), K = y(D), Me = m(), q = E(), [Fe, J] = x({}), [Ie, Le] = x(null), Y = h({
145
- mainPage: F.pages.mainPage,
146
- subPages: F.pages.subPages,
147
- activePagePath: I.pagePath,
148
- node: G
149
- }), X = Y.activePage ?? F.pages.mainPage, Re = Y.pages.length > 0 ? Y.pages : [F.pages.mainPage], Z = (e, t) => {
150
- J((n) => n[e] === t ? n : {
157
+ }, Y = ({ config: r, prepared: b }) => {
158
+ let { t: A } = D(), { t: B } = e(), { formatNumber: Ae, formatCurrency: je, formatCurrencyTitle: Me, formatPercent: Ne } = m(), { entities: V, entityRegistry: H } = n(), { layoutView: U } = g(), W = x(N), Pe = ne(), G = M(), [Fe, K] = C({}), [Ie, q] = C(null), J = h({
159
+ mainPage: r.pages.mainPage,
160
+ subPages: r.pages.subPages,
161
+ activePagePath: b.pagePath,
162
+ node: U
163
+ }), Y = J.activePage ?? r.pages.mainPage, X = J.pages.length > 0 ? J.pages : [r.pages.mainPage], Z = (e, t) => {
164
+ K((n) => n[e] === t ? n : {
151
165
  ...n,
152
166
  [e]: t
153
167
  });
154
- }, { page: Q } = F, ze = T(Q.query, I.pageQuery), $ = Q.resolveNode(ze, {
155
- id: I.id,
156
- detailId: I.detailId
157
- }), Be = $ != null, Ve = w(Q.fragment, $), He = b(() => Object.fromEntries(Q.content.flatMap((e) => e.kind === "fieldSet" ? e.fields.flatMap((e) => e.type === "relation" ? [e.relation.target] : []) : []).flatMap((e) => {
158
- let t = U[e];
168
+ }, { page: Q } = r, Be = j(Q.query, b.pageQuery), $ = Q.resolveNode(Be, {
169
+ id: b.id,
170
+ detailId: b.detailId
171
+ }), Ve = $ != null, He = k(Q.fragment, $), Ue = S(() => Object.fromEntries(Q.content.flatMap((e) => e.kind === "fieldSet" ? e.fields.flatMap((e) => e.type === "relation" ? [e.relation.target] : []) : []).flatMap((e) => {
172
+ let t = V[e];
159
173
  return t?.hasList === !0 ? [[e, t.routes.list]] : [];
160
- })), [U, Q.content]);
161
- if (!Be) throw new N(F.routes.list);
162
- return /* @__PURE__ */ S(f, {
163
- node: Ve,
174
+ })), [V, Q.content]);
175
+ return Ve ? /* @__PURE__ */ T(p, {
176
+ node: He,
164
177
  render: (e) => {
165
- let n = Q.toView(e), f = le({
166
- pages: Re,
167
- id: I.id,
168
- tApp: L,
169
- detailPageHref: F.routes.detailPage
170
- }), p = (e, t) => {
171
- let n = U[e];
178
+ let n = Q.toView(e), p = ue({
179
+ pages: X,
180
+ id: b.id,
181
+ tApp: A,
182
+ detailPageHref: r.routes.detailPage
183
+ }), m = (e, t) => {
184
+ let n = V[e];
172
185
  return n == null ? null : n.routes.detail(t);
173
- }, m = ({ id: e, label: t, count: n, relation: r, listRoute: i, value: a, where: o }) => {
174
- let { target: s, filterId: c, whereKey: l, path: u } = r, d = W.getLoadedListEntity(s);
186
+ }, ne = ({ id: e, label: t, count: r, relation: i, listRoute: a, value: o, where: s }) => {
187
+ let { target: c, filterId: l, whereKey: u, path: d } = i, f = H.getLoadedListEntity(c);
175
188
  return {
176
189
  id: e,
177
190
  label: t,
178
- count: n,
179
- href: d == null ? _e(i, o, [{
180
- id: c ?? (u == null ? l : `${l}.${u.join(".")}`),
181
- value: a
182
- }]) : ve(d.config, { where: o }),
191
+ count: Le({
192
+ count: r,
193
+ node: n,
194
+ relationValue: o
195
+ }),
196
+ href: f == null ? he(a, s, [{
197
+ id: l ?? (d == null ? u : `${u}.${d.join(".")}`),
198
+ value: o
199
+ }]) : ge(f.config, { where: s }),
183
200
  onClick: async (e) => {
184
- if (K == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
201
+ if (W == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
185
202
  e.preventDefault();
186
- let t = ye((await W.loadListEntity(s)).config, { where: o });
187
- K.history.push({
203
+ let t = _e((await H.loadListEntity(c)).config, { where: s });
204
+ W.history.push({
188
205
  pathname: t.pathname,
189
206
  search: t.search === "" ? "" : `?${t.search}`,
190
207
  hash: ""
191
208
  });
192
209
  }
193
210
  };
194
- }, h = fe(F.header, G, {
195
- tApp: L,
196
- t: R,
197
- resolveEntityHref: p,
198
- renderLink: (e, t) => /* @__PURE__ */ S(A, {
211
+ }, h = pe(r.header, U, {
212
+ tApp: A,
213
+ t: B,
214
+ resolveEntityHref: m,
215
+ renderLink: (e, t) => /* @__PURE__ */ T(I, {
199
216
  to: e,
200
217
  children: t
201
218
  }),
202
- renderDate: (e, t) => /* @__PURE__ */ S(O, {
219
+ renderDate: (e, t) => /* @__PURE__ */ T(P, {
203
220
  value: e,
204
- options: k,
221
+ options: F,
205
222
  fallback: t
206
223
  }),
207
- renderTag: (e, t) => /* @__PURE__ */ S(j, {
224
+ renderTag: (e, t) => /* @__PURE__ */ T(L, {
208
225
  tone: e,
209
226
  children: t
210
227
  }),
211
- renderBadgeRow: (e) => /* @__PURE__ */ S(s, { items: e })
228
+ renderBadgeRow: (e) => /* @__PURE__ */ T(c, { items: e })
212
229
  }), g = te({
213
- config: F,
214
- tApp: L,
215
- entityId: I.id,
216
- layoutView: G,
217
- pageLabel: X.label(L),
218
- pageId: X.id
219
- }), y = Q.actions ?? [], b = [];
220
- if (y.length > 0) {
221
- let e = y.filter((e) => e.isVisible == null ? !0 : e.isVisible(n));
222
- e.length > 0 && (b = e.map((e) => {
223
- let a = v(e.label, L), o = e.ariaLabel == null ? a : v(e.ariaLabel, L), s = e.variant ?? "secondary", c = e.size ?? "small", l = Fe[e.id] ?? !1, u = l || e.isDisabled?.(n) === !0;
224
- return ie(e) ? /* @__PURE__ */ S(ke, {
230
+ config: r,
231
+ tApp: A,
232
+ entityId: b.id,
233
+ layoutView: U,
234
+ pageLabel: Y.label(A),
235
+ pageId: Y.id
236
+ }), _ = Q.actions ?? [], x = [];
237
+ if (_.length > 0) {
238
+ let e = _.filter((e) => e.isVisible == null ? !0 : e.isVisible(n));
239
+ e.length > 0 && (x = e.map((e) => {
240
+ let r = y(e.label, A), o = e.ariaLabel == null ? r : y(e.ariaLabel, A), s = e.variant ?? "secondary", c = e.size ?? "small", l = Fe[e.id] ?? !1, u = l || e.isDisabled?.(n) === !0;
241
+ return ae(e) ? /* @__PURE__ */ T(De, {
225
242
  to: e.to(n),
226
243
  variant: s,
227
244
  size: c,
228
245
  isDisabled: u,
229
246
  "aria-label": o,
230
- children: a
231
- }, e.id) : _(e) ? /* @__PURE__ */ S(he, {
247
+ children: r
248
+ }, e.id) : v(e) ? /* @__PURE__ */ T(O, {
232
249
  type: "button",
233
250
  variant: s,
234
251
  size: c,
235
252
  isLoading: !1,
236
253
  disabled: u,
237
254
  onClick: () => {
238
- Le(e.id);
255
+ q(e.id);
239
256
  },
240
257
  "aria-label": o,
241
- children: a
242
- }, e.id) : re(e) ? /* @__PURE__ */ S(he, {
258
+ children: r
259
+ }, e.id) : ie(e) ? /* @__PURE__ */ T(O, {
243
260
  type: "button",
244
261
  variant: s,
245
262
  size: c,
@@ -247,48 +264,48 @@ var Ne = (e) => {
247
264
  disabled: u,
248
265
  onClick: () => {
249
266
  if (l) return;
250
- let a = e.getVariables(n);
251
- Z(e.id, !0), ge(Me, {
267
+ let r = e.getVariables(n);
268
+ Z(e.id, !0), me(Pe, {
252
269
  mutation: e.mutation,
253
- variables: a,
270
+ variables: r,
254
271
  updater: (t) => {
255
272
  e.updater?.(t, n);
256
273
  },
257
- onCompleted: (a) => {
274
+ onCompleted: (r) => {
258
275
  Z(e.id, !1);
259
- let o = ne(a);
276
+ let o = re(r);
260
277
  if (o != null) {
261
- let i = R("actions.form.errors.invalidPayload");
262
- e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (i = v(e.toasts.error.title, L)) : i = v(e.toasts.error.message, L);
278
+ let r = B("actions.form.errors.invalidPayload");
279
+ e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (r = y(e.toasts.error.title, A)) : r = y(e.toasts.error.message, A);
263
280
  let a = t(o, {
264
- defaultErrorMessage: i,
281
+ defaultErrorMessage: r,
265
282
  mapReason: (t) => {
266
283
  let r = e.mapErrorReason?.(t, n);
267
- return r == null ? null : typeof r == "function" ? v(r, L) : String(r);
284
+ return r == null ? null : typeof r == "function" ? y(r, A) : String(r);
268
285
  }
269
286
  });
270
287
  if (!a.ok) {
271
288
  let t = Error(a.message);
272
289
  if (e.onError?.(t, n), e.toasts?.error != null) {
273
- let t = r(e.toasts.error, L);
274
- q.error(t.title, t.message);
290
+ let t = i(e.toasts.error, A);
291
+ G.error(t.title, t.message);
275
292
  }
276
293
  return;
277
294
  }
278
295
  }
279
- if (e.onCompleted?.(a, n), e.toasts?.success != null) {
280
- let t = r(e.toasts.success, L), o = i({
296
+ if (e.onCompleted?.(r, n), e.toasts?.success != null) {
297
+ let t = i(e.toasts.success, A), o = a({
281
298
  toast: e.toasts.success,
282
- response: a,
299
+ response: r,
283
300
  node: n,
284
- tApp: L,
285
- entities: U,
286
- defaultLabel: R("actions.view"),
301
+ tApp: A,
302
+ entities: V,
303
+ defaultLabel: B("actions.view"),
287
304
  navigateTo: (e) => {
288
- K?.history.push({ pathname: e });
305
+ W?.history.push({ pathname: e });
289
306
  }
290
307
  });
291
- q.push({
308
+ G.push({
292
309
  kind: "info",
293
310
  title: t.title,
294
311
  message: t.message,
@@ -298,61 +315,61 @@ var Ne = (e) => {
298
315
  },
299
316
  onError: (t) => {
300
317
  if (Z(e.id, !1), e.onError?.(t, n), e.toasts?.error != null) {
301
- let t = r(e.toasts.error, L);
302
- q.error(t.title, t.message);
318
+ let t = i(e.toasts.error, A);
319
+ G.error(t.title, t.message);
303
320
  }
304
321
  }
305
322
  });
306
323
  },
307
324
  "aria-label": o,
308
- children: a
325
+ children: r
309
326
  }, e.id) : null;
310
327
  }));
311
328
  }
312
- let x = y.find((e) => e.id === Ie), { content: me } = Q, w = [], T = [], E = [];
313
- me.forEach((e, t) => {
314
- let r = Pe(e) === "secondary" ? T : w;
329
+ let S = _.find((e) => e.id === Ie), { content: C } = Q, D = [], k = [], j = [];
330
+ C.forEach((e, t) => {
331
+ let r = ze(e) === "secondary" ? k : D;
315
332
  if (e.kind === "fieldSet") {
316
- let i = v(e.title, L), a = e.description == null ? void 0 : v(e.description, L), { items: o, relationItems: u, customNodes: d } = ue(e.fields, n, {
317
- tApp: L,
318
- t: R,
319
- resolveEntityHref: p,
320
- formatNumber: z,
321
- formatCurrency: B,
322
- formatCurrencyTitle: V,
323
- formatPercent: H,
324
- relationEntityListRoutes: He,
325
- resolveRelationItem: m,
326
- setWhereValue: xe,
327
- renderTag: (e, t) => /* @__PURE__ */ S(j, {
333
+ let i = y(e.title, A), a = e.description == null ? void 0 : y(e.description, A), { items: o, relationItems: s, customNodes: d } = de(e.fields, n, {
334
+ tApp: A,
335
+ t: B,
336
+ resolveEntityHref: m,
337
+ formatNumber: Ae,
338
+ formatCurrency: je,
339
+ formatCurrencyTitle: Me,
340
+ formatPercent: Ne,
341
+ relationEntityListRoutes: Ue,
342
+ resolveRelationItem: ne,
343
+ setWhereValue: ye,
344
+ renderTag: (e, t) => /* @__PURE__ */ T(L, {
328
345
  tone: e,
329
346
  children: t
330
347
  }),
331
- renderBadgeRow: (e) => /* @__PURE__ */ S(s, { items: e }),
332
- renderDate: (e, t) => /* @__PURE__ */ S(O, {
348
+ renderBadgeRow: (e) => /* @__PURE__ */ T(c, { items: e }),
349
+ renderDate: (e, t) => /* @__PURE__ */ T(P, {
333
350
  value: e,
334
- options: k,
351
+ options: F,
335
352
  fallback: t
336
353
  }),
337
- renderFlagTag: (e) => /* @__PURE__ */ S(c, {
354
+ renderFlagTag: (e) => /* @__PURE__ */ T(l, {
338
355
  tone: e.tone,
339
- icon: e.iconName == null ? void 0 : Ne(e.iconName),
356
+ icon: e.iconName == null ? void 0 : Re(e.iconName),
340
357
  label: e.label
341
358
  }),
342
- renderLink: (e, t) => /* @__PURE__ */ S(A, {
359
+ renderLink: (e, t) => /* @__PURE__ */ T(I, {
343
360
  to: e,
344
361
  children: t
345
362
  }),
346
- renderTaggedValue: (e, t) => /* @__PURE__ */ S(l, {
363
+ renderTaggedValue: (e, t) => /* @__PURE__ */ T(u, {
347
364
  tag: e,
348
365
  value: t
349
366
  }),
350
- wrapCustomNode: (e, t) => /* @__PURE__ */ S("div", { children: t }, e)
367
+ wrapCustomNode: (e, t) => /* @__PURE__ */ T("div", { children: t }, e)
351
368
  });
352
- if (u.forEach((e) => {
353
- E.some((t) => t.id === e.id) || E.push(e);
369
+ if (s.forEach((e) => {
370
+ j.some((t) => t.id === e.id) || j.push(e);
354
371
  }), !(o.length > 0 || d.length > 0)) return;
355
- r.push(/* @__PURE__ */ S(M, {
372
+ r.push(/* @__PURE__ */ T(R, {
356
373
  title: i,
357
374
  description: a,
358
375
  items: o.length > 0 ? o : void 0,
@@ -360,73 +377,73 @@ var Ne = (e) => {
360
377
  }, `${i}-${t}`));
361
378
  return;
362
379
  }
363
- let i = de([e], n, {
364
- tApp: L,
365
- t: R,
366
- resolveEntityHref: p,
380
+ let i = fe([e], n, {
381
+ tApp: A,
382
+ t: B,
383
+ resolveEntityHref: m,
367
384
  keyPrefix: String(t),
368
- renderLink: (e, t) => /* @__PURE__ */ S(A, {
385
+ renderLink: (e, t) => /* @__PURE__ */ T(I, {
369
386
  to: e,
370
387
  children: t
371
388
  }),
372
- renderDate: (e, t) => /* @__PURE__ */ S(O, {
389
+ renderDate: (e, t) => /* @__PURE__ */ T(P, {
373
390
  value: e,
374
- options: k,
391
+ options: F,
375
392
  fallback: t
376
393
  }),
377
- renderTag: (e, t) => /* @__PURE__ */ S(j, {
394
+ renderTag: (e, t) => /* @__PURE__ */ T(L, {
378
395
  tone: e,
379
396
  children: t
380
397
  }),
381
- renderMetricGroup: ({ key: e, title: t, description: n, density: r, items: i }) => /* @__PURE__ */ S(M, {
398
+ renderMetricGroup: ({ key: e, title: t, description: n, density: r, items: i }) => /* @__PURE__ */ T(R, {
382
399
  title: t,
383
400
  description: n,
384
- children: i.length > 0 && /* @__PURE__ */ S(Te, {
401
+ children: i.length > 0 && /* @__PURE__ */ T(Ce, {
385
402
  density: r ?? "comfortable",
386
403
  minColumn: "180",
387
- children: i.map((e) => /* @__PURE__ */ S(we, {
404
+ children: i.map((e) => /* @__PURE__ */ T(Se, {
388
405
  label: e.label,
389
406
  value: e.value,
390
407
  hint: e.hint,
391
408
  tone: e.tone ?? "neutral",
392
409
  density: r ?? "comfortable",
393
410
  copyValue: e.copyValue,
394
- copyLabel: R("common.actions.copy"),
395
- copiedLabel: R("common.actions.copied")
411
+ copyLabel: B("common.actions.copy"),
412
+ copiedLabel: B("common.actions.copied")
396
413
  }, e.id))
397
414
  })
398
415
  }, e),
399
- renderTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ S(u, {
416
+ renderTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ T(d, {
400
417
  title: t,
401
418
  description: n,
402
419
  events: r
403
420
  }, e),
404
- renderAuditTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ S(M, {
421
+ renderAuditTimeline: ({ key: e, title: t, description: n, events: r }) => /* @__PURE__ */ T(R, {
405
422
  title: t,
406
423
  description: n,
407
- children: /* @__PURE__ */ S(Ce, { events: r })
424
+ children: /* @__PURE__ */ T(xe, { events: r })
408
425
  }, e),
409
- renderRelations: ({ key: e, title: t, items: n }) => /* @__PURE__ */ S(d, {
426
+ renderRelations: ({ key: e, title: t, items: n }) => /* @__PURE__ */ T(f, {
410
427
  title: t,
411
428
  items: n
412
429
  }, e),
413
- renderContextStack: ({ key: e, title: t, items: n }) => /* @__PURE__ */ S(je, {
430
+ renderContextStack: ({ key: e, title: t, items: n }) => /* @__PURE__ */ T(ke, {
414
431
  title: t,
415
432
  items: n
416
433
  }, e),
417
- renderCustomSection: (e, t, n) => /* @__PURE__ */ S(M, {
434
+ renderCustomSection: (e, t, n) => /* @__PURE__ */ T(R, {
418
435
  title: t,
419
436
  children: n
420
437
  }, e),
421
- wrapCustomNode: (e, t) => /* @__PURE__ */ S("div", { children: t }, e),
422
- resolveTableColumns: (e) => o(e, {
423
- tApp: L,
424
- t: R
438
+ wrapCustomNode: (e, t) => /* @__PURE__ */ T("div", { children: t }, e),
439
+ resolveTableColumns: (e) => s(e, {
440
+ tApp: A,
441
+ t: B
425
442
  }),
426
- renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */ S(M, {
443
+ renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */ T(R, {
427
444
  title: t,
428
445
  description: n,
429
- children: /* @__PURE__ */ S(Oe, {
446
+ children: /* @__PURE__ */ T(Ee, {
430
447
  columns: r,
431
448
  rows: i,
432
449
  getRowId: (e, t) => {
@@ -438,89 +455,87 @@ var Ne = (e) => {
438
455
  }
439
456
  })
440
457
  }, e),
441
- renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */ S(M, {
458
+ renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */ T(R, {
442
459
  title: t,
443
460
  description: n,
444
- children: /* @__PURE__ */ S(be, {
461
+ children: /* @__PURE__ */ T(ve, {
445
462
  content: r,
446
463
  format: i,
447
- emptyState: R("common.notAvailable")
464
+ emptyState: B("common.notAvailable")
448
465
  })
449
466
  }, e),
450
- renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ S(M, {
467
+ renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ T(R, {
451
468
  title: t,
452
469
  description: n,
453
- children: /* @__PURE__ */ S(P, { items: r })
470
+ children: /* @__PURE__ */ T(z, { items: r })
454
471
  }, e)
455
472
  })[0];
456
473
  i != null && r.push(i);
457
474
  });
458
- let D = E.length > 0 ? /* @__PURE__ */ S(Ae, {
459
- label: R("relations.menu.label"),
460
- items: E
461
- }) : null, N = b.length > 0 || D != null ? /* @__PURE__ */ C("div", {
462
- className: ae,
463
- children: [b.length > 0 && /* @__PURE__ */ S("div", {
475
+ let M = j.length > 0 ? /* @__PURE__ */ T(Oe, {
476
+ label: B("relations.menu.label"),
477
+ items: j
478
+ }) : null, N = x.length > 0 || M != null ? /* @__PURE__ */ E("div", {
479
+ className: oe,
480
+ children: [x.length > 0 && /* @__PURE__ */ T("div", {
464
481
  className: "txvbqbfpn txvbqbey txvbqblsh txvbqbhdl txvbqbh7g",
465
- children: b
466
- }), D != null && /* @__PURE__ */ S("div", {
482
+ children: x
483
+ }), M != null && /* @__PURE__ */ T("div", {
467
484
  className: "txvbqbfpn txvbqbey txvbqb10mr txvbqbb49 txvbqbbkc txvbqb2sj txvbqb7tt",
468
- children: D
485
+ children: M
469
486
  })]
470
- }) : void 0, J = h.status != null || h.badges != null ? /* @__PURE__ */ C("div", {
471
- className: se,
472
- children: [h.status, h.badges]
473
- }) : void 0, Y = h.items != null && h.items.length > 0 ? /* @__PURE__ */ S("div", {
487
+ }) : void 0, K = h.status != null || h.badges != null ? /* @__PURE__ */ E("div", {
474
488
  className: ce,
475
- children: /* @__PURE__ */ S(P, { items: h.items })
476
- }) : null, ze = T.length > 0, $ = null;
477
- return Re.length > 1 && ($ = /* @__PURE__ */ S(Ee, {
478
- items: f,
479
- activeId: X.id,
489
+ children: [h.status, h.badges]
490
+ }) : void 0, J = h.items != null && h.items.length > 0 ? /* @__PURE__ */ T("div", {
491
+ className: le,
492
+ children: /* @__PURE__ */ T(z, { items: h.items })
493
+ }) : null, Be = k.length > 0, $ = null;
494
+ return X.length > 1 && ($ = /* @__PURE__ */ T(we, {
495
+ items: p,
496
+ activeId: Y.id,
480
497
  variant: "underline"
481
- })), /* @__PURE__ */ C(ee, {
498
+ })), /* @__PURE__ */ E(ee, {
482
499
  breadcrumb: g,
483
- children: [/* @__PURE__ */ S(De, {
484
- headerNode: /* @__PURE__ */ C("div", {
485
- className: oe,
486
- children: [/* @__PURE__ */ S(Se, {
500
+ children: [/* @__PURE__ */ T(Te, {
501
+ headerNode: /* @__PURE__ */ E("div", {
502
+ className: se,
503
+ children: [/* @__PURE__ */ T(be, {
487
504
  title: h.title,
488
505
  subtitle: h.subtitle,
489
506
  actions: N,
490
- meta: J
491
- }), Y]
507
+ meta: K
508
+ }), J]
492
509
  }),
493
510
  tabsNode: $,
494
- sidePanel: ze ? /* @__PURE__ */ S(pe, { children: T }) : void 0,
511
+ sidePanel: Be ? /* @__PURE__ */ T(w, { children: k }) : void 0,
495
512
  sidePanelVariant: "plain",
496
513
  headerDensity: "compact",
497
- children: /* @__PURE__ */ S(pe, { children: w })
498
- }), x != null && _(x) && /* @__PURE__ */ S(a, {
514
+ children: /* @__PURE__ */ T(w, { children: D })
515
+ }), S != null && v(S) && /* @__PURE__ */ T(o, {
499
516
  isOpen: !0,
500
- action: x,
517
+ action: S,
501
518
  node: n,
502
519
  onClose: () => {
503
- Le(null);
520
+ q(null);
504
521
  }
505
522
  })]
506
523
  });
507
524
  }
508
- });
509
- }, J = ({ config: e, prepared: t }) => {
525
+ }) : /* @__PURE__ */ T(_, { to: r.routes.list });
526
+ }, X = ({ config: e, prepared: t }) => {
510
527
  let { layoutView: n } = g(), r = h({
511
528
  mainPage: e.pages.mainPage,
512
529
  subPages: e.pages.subPages,
513
530
  activePagePath: t.pagePath,
514
531
  node: n
515
532
  });
516
- if (!r.hasVisiblePages || r.activePage == null) throw new N(e.routes.list);
517
- if (r.activePage.id !== t.pageId) throw new N(e.routes.detailPage(t.id, r.activePage.id));
518
- return /* @__PURE__ */ S(Fe, {
533
+ return !r.hasVisiblePages || r.activePage == null ? /* @__PURE__ */ T(_, { to: e.routes.list }) : r.activePage.id === t.pageId ? /* @__PURE__ */ T(Y, {
519
534
  config: t.pageConfig,
520
535
  prepared: t
521
- });
536
+ }) : /* @__PURE__ */ T(_, { to: e.routes.detailPage(t.id, r.activePage.id) });
522
537
  };
523
538
  //#endregion
524
- export { J as BackofficeEntityDetailPage, J as default };
539
+ export { X as BackofficeEntityDetailPage, X as default };
525
540
 
526
541
  //# sourceMappingURL=BackofficeEntityDetailPage.js.map