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