@plumile/backoffice-react 0.1.160 → 0.1.162
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/README.md +3 -0
- package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js +0 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +52 -42
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -0
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +1 -0
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js +4 -6
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js.map +1 -1
- package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +0 -1
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js +27 -8
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js.map +1 -1
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +2 -2
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js.map +1 -1
- package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js +26 -0
- package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js.map +1 -0
- package/lib/esm/index.js +9 -6
- package/lib/esm/modules/uploads.js +31 -0
- package/lib/esm/modules/uploads.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +313 -262
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +8 -8
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/relay/shortAccessTokenEnvironment.js +15 -0
- package/lib/esm/relay/shortAccessTokenEnvironment.js.map +1 -0
- package/lib/esm/relay/useMutationAction.js +33 -0
- package/lib/esm/relay/useMutationAction.js.map +1 -0
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/backofficeFilterAction.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/BackofficeInlineFilterRow.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts +2 -0
- package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts +12 -0
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/modules/uploads.d.ts +27 -0
- package/lib/types/modules/uploads.d.ts.map +1 -0
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts +4 -0
- package/lib/types/relay/shortAccessTokenEnvironment.d.ts.map +1 -0
- package/lib/types/relay/useMutationAction.d.ts +15 -0
- package/lib/types/relay/useMutationAction.d.ts.map +1 -0
- package/package.json +19 -19
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TechnicalIdentifierValue as e, normalizeTechnicalIdentifier as t } from "../components/backoffice/technical/TechnicalIdentifierValue.js";
|
|
2
|
+
import { isEmptyText as n, resolveBadgeTone as r, resolveLabel as i, resolveRelationValue as a, resolveValueLabel as o } from "./BackofficeEntityDetailPage.helpers.js";
|
|
3
|
+
import { Fragment as s, createElement as c } from "react";
|
|
3
4
|
//#region src/pages/BackofficeEntityDetailPage.view-helpers.ts
|
|
4
|
-
var
|
|
5
|
+
var l = (e, t, n) => {
|
|
5
6
|
switch (e) {
|
|
6
7
|
case "yesNo": return t ? {
|
|
7
8
|
tone: "success",
|
|
@@ -89,250 +90,267 @@ var s = (e, t, n) => {
|
|
|
89
90
|
};
|
|
90
91
|
default: throw Error(`Unsupported flag variant: ${String(e)}`);
|
|
91
92
|
}
|
|
92
|
-
},
|
|
93
|
-
let { tApp: r, t:
|
|
94
|
-
if (
|
|
95
|
-
let
|
|
96
|
-
return
|
|
93
|
+
}, u = (e, t) => {
|
|
94
|
+
let { tApp: r, t: i, resolveEntityHref: a, renderLink: s } = t, c = i("common.notAvailable");
|
|
95
|
+
if (e.type === "text") {
|
|
96
|
+
let t = o(e.value, r);
|
|
97
|
+
return n(t) ? c : t;
|
|
97
98
|
}
|
|
98
|
-
if (
|
|
99
|
-
let { id:
|
|
100
|
-
if (
|
|
101
|
-
let n =
|
|
102
|
-
if (
|
|
103
|
-
let l =
|
|
104
|
-
return l == null ?
|
|
99
|
+
if (e.type === "entityRef") {
|
|
100
|
+
let { id: t } = e;
|
|
101
|
+
if (t == null || t.trim() === "") return c;
|
|
102
|
+
let n = o(e.label, r), i = n != null && String(n).trim() !== "" ? n : null;
|
|
103
|
+
if (i == null) return c;
|
|
104
|
+
let l = a?.(e.entity, t) ?? null;
|
|
105
|
+
return l == null ? i : s(l, i);
|
|
105
106
|
}
|
|
106
|
-
let { href: l } =
|
|
107
|
+
let { href: l } = e;
|
|
107
108
|
if (l == null || l.trim() === "") return c;
|
|
108
|
-
let u =
|
|
109
|
-
return
|
|
110
|
-
},
|
|
111
|
-
let { tApp:
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
114
|
-
let
|
|
115
|
-
if (
|
|
116
|
-
let r =
|
|
117
|
-
if (
|
|
118
|
-
let c = s?.(
|
|
119
|
-
return c == null ?
|
|
109
|
+
let u = o(e.label, r);
|
|
110
|
+
return n(u) ? c : s(l, u);
|
|
111
|
+
}, d = (e, t, r) => {
|
|
112
|
+
let { tApp: i, t: a, resolveEntityHref: s, renderDate: c, renderLink: l } = r, u = a("common.notAvailable");
|
|
113
|
+
if (e.type === "dateTime") return c(e.value(t), u);
|
|
114
|
+
if (e.type === "entityRef") {
|
|
115
|
+
let n = e.id(t);
|
|
116
|
+
if (n == null || n.trim() === "") return u;
|
|
117
|
+
let r = o(e.value?.(t), i), a = r != null && String(r).trim() !== "" ? r : null;
|
|
118
|
+
if (a == null) return u;
|
|
119
|
+
let c = s?.(e.entity, n) ?? null;
|
|
120
|
+
return c == null ? a : l(c, a);
|
|
120
121
|
}
|
|
121
|
-
if (
|
|
122
|
-
let r =
|
|
123
|
-
return r == null || r.trim() === "" ||
|
|
122
|
+
if (e.type === "link") {
|
|
123
|
+
let r = e.href(t), a = o(e.value(t), i);
|
|
124
|
+
return r == null || r.trim() === "" || n(a) ? u : l(r, a);
|
|
124
125
|
}
|
|
125
|
-
let d =
|
|
126
|
-
return
|
|
127
|
-
},
|
|
126
|
+
let d = o(e.value(t), i);
|
|
127
|
+
return n(d) ? u : d;
|
|
128
|
+
}, f = (e, t, n, i) => {
|
|
128
129
|
if (e.type === "badgeRow") {
|
|
129
|
-
let
|
|
130
|
-
let t =
|
|
130
|
+
let r = e.items(t).map((e) => {
|
|
131
|
+
let t = o(e.label, n), r = t == null ? "" : String(t);
|
|
131
132
|
return {
|
|
132
133
|
...e,
|
|
133
|
-
label:
|
|
134
|
+
label: r
|
|
134
135
|
};
|
|
135
136
|
});
|
|
136
|
-
return
|
|
137
|
+
return r.length === 0 ? void 0 : i.renderBadgeRow(r);
|
|
137
138
|
}
|
|
138
|
-
let
|
|
139
|
+
let a = o(e.value(t), n), s = a == null ? "" : String(a);
|
|
139
140
|
if (s.trim() === "") return;
|
|
140
|
-
let c =
|
|
141
|
-
return
|
|
142
|
-
},
|
|
143
|
-
let { tApp:
|
|
144
|
-
return
|
|
145
|
-
let
|
|
146
|
-
switch (
|
|
141
|
+
let c = r(e.tone, t);
|
|
142
|
+
return i.renderTag(c, s);
|
|
143
|
+
}, p = (t, s, d) => {
|
|
144
|
+
let { tApp: f, t: p, resolveEntityHref: m, formatNumber: h, formatCurrency: g, formatCurrencyTitle: _, formatPercent: v, relationEntityListRoutes: y, resolveRelationItem: b, setWhereValue: x, renderTag: S, renderBadgeRow: C, renderDate: w, renderFlagTag: T, renderLink: E, renderTaggedValue: D, wrapCustomNode: O } = d, k = [], A = [], j = [], M = p("common.notAvailable");
|
|
145
|
+
return t.forEach((t, d) => {
|
|
146
|
+
let N = `${t.type}-${d}`;
|
|
147
|
+
switch (t.type) {
|
|
147
148
|
case "text": {
|
|
148
|
-
let e =
|
|
149
|
-
|
|
150
|
-
id:
|
|
151
|
-
label:
|
|
152
|
-
size:
|
|
149
|
+
let e = o(t.value(s), f);
|
|
150
|
+
k.push({
|
|
151
|
+
id: N,
|
|
152
|
+
label: i(t.label, f),
|
|
153
|
+
size: t.size,
|
|
153
154
|
value: e,
|
|
154
|
-
copyValue:
|
|
155
|
-
fullWidth:
|
|
155
|
+
copyValue: t.copyValue?.(s) ?? void 0,
|
|
156
|
+
fullWidth: t.fullWidth
|
|
156
157
|
});
|
|
157
158
|
break;
|
|
158
159
|
}
|
|
159
160
|
case "badge": {
|
|
160
|
-
let e =
|
|
161
|
-
|
|
162
|
-
id:
|
|
163
|
-
label:
|
|
164
|
-
size:
|
|
165
|
-
value:
|
|
161
|
+
let e = o(t.value(s), f), n = e == null ? "" : String(e), a = r(t.tone, s);
|
|
162
|
+
k.push({
|
|
163
|
+
id: N,
|
|
164
|
+
label: i(t.label, f),
|
|
165
|
+
size: t.size,
|
|
166
|
+
value: n.trim() === "" ? null : S(a, n)
|
|
166
167
|
});
|
|
167
168
|
break;
|
|
168
169
|
}
|
|
169
170
|
case "badgeRow": {
|
|
170
|
-
let e =
|
|
171
|
-
let t =
|
|
171
|
+
let e = t.items(s).map((e) => {
|
|
172
|
+
let t = o(e.label, f), n = t == null ? "" : String(t);
|
|
172
173
|
return {
|
|
173
174
|
...e,
|
|
174
175
|
label: n
|
|
175
176
|
};
|
|
176
177
|
});
|
|
177
|
-
|
|
178
|
-
id:
|
|
179
|
-
label:
|
|
180
|
-
size:
|
|
181
|
-
value: e.length > 0 ?
|
|
182
|
-
fullWidth:
|
|
178
|
+
k.push({
|
|
179
|
+
id: N,
|
|
180
|
+
label: i(t.label, f),
|
|
181
|
+
size: t.size,
|
|
182
|
+
value: e.length > 0 ? C(e) : null,
|
|
183
|
+
fullWidth: t.fullWidth
|
|
183
184
|
});
|
|
184
185
|
break;
|
|
185
186
|
}
|
|
186
187
|
case "dateTime":
|
|
187
|
-
|
|
188
|
-
id:
|
|
189
|
-
label:
|
|
190
|
-
size:
|
|
191
|
-
value:
|
|
188
|
+
k.push({
|
|
189
|
+
id: N,
|
|
190
|
+
label: i(t.label, f),
|
|
191
|
+
size: t.size,
|
|
192
|
+
value: w(t.value(s), M)
|
|
192
193
|
});
|
|
193
194
|
break;
|
|
194
195
|
case "number": {
|
|
195
|
-
let e =
|
|
196
|
-
if (e != null) if (
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
} else
|
|
200
|
-
|
|
201
|
-
id:
|
|
202
|
-
label:
|
|
203
|
-
size:
|
|
204
|
-
value:
|
|
196
|
+
let e = t.value(s), n = null;
|
|
197
|
+
if (e != null) if (t.format === "currency") {
|
|
198
|
+
let t = g(e);
|
|
199
|
+
n = c("span", { title: _?.(e) ?? void 0 }, t);
|
|
200
|
+
} else n = t.format === "percent" ? v(e) : h(e);
|
|
201
|
+
k.push({
|
|
202
|
+
id: N,
|
|
203
|
+
label: i(t.label, f),
|
|
204
|
+
size: t.size,
|
|
205
|
+
value: n
|
|
205
206
|
});
|
|
206
207
|
break;
|
|
207
208
|
}
|
|
208
209
|
case "flag": {
|
|
209
|
-
let e =
|
|
210
|
-
|
|
211
|
-
id:
|
|
212
|
-
label:
|
|
213
|
-
size:
|
|
214
|
-
value: e == null ? null :
|
|
210
|
+
let e = t.value(s);
|
|
211
|
+
k.push({
|
|
212
|
+
id: N,
|
|
213
|
+
label: i(t.label, f),
|
|
214
|
+
size: t.size,
|
|
215
|
+
value: e == null ? null : T(l(t.variant, e, p))
|
|
215
216
|
});
|
|
216
217
|
break;
|
|
217
218
|
}
|
|
218
219
|
case "entityRef": {
|
|
219
|
-
let e =
|
|
220
|
+
let e = t.id(s), n = null;
|
|
220
221
|
if (e != null && e.trim() !== "") {
|
|
221
|
-
let
|
|
222
|
-
|
|
222
|
+
let r = t.value?.(s), i = r != null && r.trim() !== "" ? r : null, a = m?.(t.entity, e) ?? null;
|
|
223
|
+
i != null && (n = a == null ? i : E(a, i));
|
|
223
224
|
}
|
|
224
|
-
|
|
225
|
-
id:
|
|
226
|
-
label:
|
|
227
|
-
size:
|
|
228
|
-
value:
|
|
225
|
+
k.push({
|
|
226
|
+
id: N,
|
|
227
|
+
label: i(t.label, f),
|
|
228
|
+
size: t.size,
|
|
229
|
+
value: n ?? M
|
|
230
|
+
});
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
case "technicalIdentifier": {
|
|
234
|
+
let n = t.value(s);
|
|
235
|
+
k.push({
|
|
236
|
+
id: N,
|
|
237
|
+
label: i(t.label, f),
|
|
238
|
+
size: t.size,
|
|
239
|
+
value: n == null ? null : c(e, {
|
|
240
|
+
value: n,
|
|
241
|
+
copyValue: t.copyValue?.(s) ?? void 0,
|
|
242
|
+
variant: t.variant,
|
|
243
|
+
copyLabel: p("common.actions.copy")
|
|
244
|
+
}),
|
|
245
|
+
copyValue: t.copyValue?.(s) ?? void 0,
|
|
246
|
+
fullWidth: t.fullWidth
|
|
229
247
|
});
|
|
230
248
|
break;
|
|
231
249
|
}
|
|
232
250
|
case "link": {
|
|
233
|
-
let
|
|
234
|
-
|
|
235
|
-
id:
|
|
236
|
-
label:
|
|
237
|
-
size:
|
|
238
|
-
value:
|
|
251
|
+
let e = t.href(s), r = t.value(s);
|
|
252
|
+
k.push({
|
|
253
|
+
id: N,
|
|
254
|
+
label: i(t.label, f),
|
|
255
|
+
size: t.size,
|
|
256
|
+
value: e != null && e.trim() !== "" && !n(r) ? E(e, r) : null
|
|
239
257
|
});
|
|
240
258
|
break;
|
|
241
259
|
}
|
|
242
260
|
case "taggedValue": {
|
|
243
|
-
let e =
|
|
244
|
-
tApp:
|
|
245
|
-
t:
|
|
246
|
-
resolveEntityHref:
|
|
247
|
-
renderLink:
|
|
261
|
+
let e = t.tag(s), n = u(t.value(s), {
|
|
262
|
+
tApp: f,
|
|
263
|
+
t: p,
|
|
264
|
+
resolveEntityHref: m,
|
|
265
|
+
renderLink: E
|
|
248
266
|
}), r = e == null ? null : {
|
|
249
267
|
...e,
|
|
250
268
|
label: (() => {
|
|
251
|
-
let t =
|
|
269
|
+
let t = o(e.label, f);
|
|
252
270
|
return t == null ? "" : String(t);
|
|
253
271
|
})()
|
|
254
272
|
};
|
|
255
|
-
|
|
256
|
-
id:
|
|
257
|
-
label:
|
|
258
|
-
size:
|
|
259
|
-
value: r != null ||
|
|
260
|
-
fullWidth:
|
|
273
|
+
k.push({
|
|
274
|
+
id: N,
|
|
275
|
+
label: i(t.label, f),
|
|
276
|
+
size: t.size,
|
|
277
|
+
value: r != null || n != null ? D(r, n) : null,
|
|
278
|
+
fullWidth: t.fullWidth
|
|
261
279
|
});
|
|
262
280
|
break;
|
|
263
281
|
}
|
|
264
282
|
case "relation": {
|
|
265
|
-
let e =
|
|
283
|
+
let e = a(t.value(s));
|
|
266
284
|
if (e == null) break;
|
|
267
|
-
let
|
|
268
|
-
if (
|
|
269
|
-
let
|
|
270
|
-
if (
|
|
271
|
-
|
|
272
|
-
id:
|
|
273
|
-
label:
|
|
274
|
-
relation:
|
|
275
|
-
listRoute:
|
|
285
|
+
let n = y[t.relation.target];
|
|
286
|
+
if (n == null) break;
|
|
287
|
+
let r = x(null, t.relation.whereKey, e, t.relation.path);
|
|
288
|
+
if (r == null) break;
|
|
289
|
+
A.push(b({
|
|
290
|
+
id: N,
|
|
291
|
+
label: i(t.label, f),
|
|
292
|
+
relation: t.relation,
|
|
293
|
+
listRoute: n,
|
|
276
294
|
value: e,
|
|
277
|
-
where:
|
|
295
|
+
where: r
|
|
278
296
|
}));
|
|
279
297
|
break;
|
|
280
298
|
}
|
|
281
299
|
case "custom": {
|
|
282
|
-
let e =
|
|
300
|
+
let e = t.render(s);
|
|
283
301
|
if (e == null) break;
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
id:
|
|
287
|
-
label:
|
|
288
|
-
size:
|
|
302
|
+
if (t.label != null) {
|
|
303
|
+
k.push({
|
|
304
|
+
id: N,
|
|
305
|
+
label: i(t.label, f),
|
|
306
|
+
size: t.size,
|
|
289
307
|
value: e,
|
|
290
|
-
fullWidth:
|
|
308
|
+
fullWidth: t.fullWidth
|
|
291
309
|
});
|
|
292
310
|
break;
|
|
293
311
|
}
|
|
294
|
-
|
|
312
|
+
j.push(O(N, e));
|
|
295
313
|
break;
|
|
296
314
|
}
|
|
297
315
|
default: break;
|
|
298
316
|
}
|
|
299
317
|
}), {
|
|
300
|
-
items:
|
|
301
|
-
relationItems:
|
|
302
|
-
customNodes:
|
|
318
|
+
items: k,
|
|
319
|
+
relationItems: A,
|
|
320
|
+
customNodes: j
|
|
303
321
|
};
|
|
304
|
-
},
|
|
305
|
-
let { tApp:
|
|
322
|
+
}, m = (e, t, n) => {
|
|
323
|
+
let { tApp: a, t: l, resolveEntityHref: p, renderLink: m, renderDate: h, renderTag: g, renderBadgeRow: _ } = n, v = e.titleValue?.(t, a) ?? i(e.title, a), y = typeof t == "object" && t && "id" in t && typeof t.id == "string" ? t.id.trim() : null, b = v.trim() === "" || y != null && v.trim() === y ? i(e.title, a) : v, x;
|
|
306
324
|
if (e.subtitleItems != null && e.subtitleItems.length > 0) {
|
|
307
|
-
let { subtitleItems:
|
|
308
|
-
|
|
309
|
-
i.push(
|
|
310
|
-
tApp:
|
|
311
|
-
t:
|
|
325
|
+
let { subtitleItems: n } = e, r = e.subtitleSeparator ?? " / ", i = [];
|
|
326
|
+
n.forEach((e, o) => {
|
|
327
|
+
i.push(c("span", { key: e.id }, u(e.value(t), {
|
|
328
|
+
tApp: a,
|
|
329
|
+
t: l,
|
|
312
330
|
resolveEntityHref: p,
|
|
313
331
|
renderLink: m
|
|
314
|
-
}))),
|
|
315
|
-
}),
|
|
332
|
+
}))), o < n.length - 1 && i.push(c("span", { key: `${e.id}-sep` }, r));
|
|
333
|
+
}), x = c("span", null, ...i);
|
|
316
334
|
} else {
|
|
317
|
-
let
|
|
318
|
-
|
|
335
|
+
let n = e.subtitleValue?.(t, a) ?? (e.subtitle == null ? null : i(e.subtitle, a));
|
|
336
|
+
x = n != null && n.trim() !== "" ? n : void 0;
|
|
319
337
|
}
|
|
320
|
-
let
|
|
321
|
-
e.badges?.forEach((e,
|
|
322
|
-
let
|
|
323
|
-
|
|
338
|
+
let S = [];
|
|
339
|
+
e.badges?.forEach((e, n) => {
|
|
340
|
+
let l = i(e.label, a), u = o(e.value(t), a), d = u == null ? "" : String(u);
|
|
341
|
+
d.trim() !== "" && (S.push(g(r(e.tone, t), `${l}: ${d}`)), typeof S[S.length - 1] == "object" && (S[S.length - 1] = c(s, { key: `${l}-${n}` }, S[S.length - 1])));
|
|
324
342
|
});
|
|
325
|
-
let
|
|
343
|
+
let C = e.status == null ? void 0 : f(e.status, t, a, {
|
|
326
344
|
renderBadgeRow: _,
|
|
327
345
|
renderTag: g
|
|
328
|
-
}),
|
|
329
|
-
let
|
|
346
|
+
}), w = e.meta?.map((e, n) => {
|
|
347
|
+
let r = i(e.label, a);
|
|
330
348
|
return {
|
|
331
|
-
id: `${
|
|
332
|
-
label:
|
|
333
|
-
value:
|
|
334
|
-
tApp:
|
|
335
|
-
t:
|
|
349
|
+
id: `${r}-${n}`,
|
|
350
|
+
label: r,
|
|
351
|
+
value: d(e, t, {
|
|
352
|
+
tApp: a,
|
|
353
|
+
t: l,
|
|
336
354
|
resolveEntityHref: p,
|
|
337
355
|
renderDate: h,
|
|
338
356
|
renderLink: m
|
|
@@ -340,196 +358,229 @@ var s = (e, t, n) => {
|
|
|
340
358
|
};
|
|
341
359
|
});
|
|
342
360
|
return {
|
|
343
|
-
title:
|
|
344
|
-
subtitle:
|
|
345
|
-
badges:
|
|
346
|
-
status:
|
|
347
|
-
items:
|
|
361
|
+
title: b,
|
|
362
|
+
subtitle: x,
|
|
363
|
+
badges: S.length > 0 ? c(s, null, ...S) : void 0,
|
|
364
|
+
status: C,
|
|
365
|
+
items: w
|
|
348
366
|
};
|
|
349
|
-
},
|
|
367
|
+
}, h = (e) => {
|
|
350
368
|
if (e != null) {
|
|
351
369
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return String(e);
|
|
352
370
|
try {
|
|
353
|
-
return
|
|
371
|
+
return c("pre", null, JSON.stringify(e, null, 2));
|
|
354
372
|
} catch {
|
|
355
|
-
return
|
|
373
|
+
return c("pre", null, e instanceof Error ? e.message : "[unserializable payload]");
|
|
356
374
|
}
|
|
357
375
|
}
|
|
358
|
-
},
|
|
359
|
-
let { tApp:
|
|
360
|
-
|
|
361
|
-
let
|
|
376
|
+
}, g = (e) => e === "id" || e === "hash" || e === "external" ? e : null, _ = (r) => {
|
|
377
|
+
let { value: i, href: a, refKind: s, copyValue: l, tApp: u, t: d, renderLink: f } = r, p = o(i, u), m = g(s);
|
|
378
|
+
if (m != null) {
|
|
379
|
+
let n = t(p);
|
|
380
|
+
return n == null ? d("common.notAvailable") : c(e, {
|
|
381
|
+
value: n,
|
|
382
|
+
copyValue: l ?? n,
|
|
383
|
+
variant: m,
|
|
384
|
+
copyLabel: d("common.actions.copy")
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
return a != null && a.trim() !== "" && !n(p) ? f(a, p) : p ?? d("common.notAvailable");
|
|
388
|
+
}, v = (t, r, a) => {
|
|
389
|
+
let { tApp: s, t: l, keyPrefix: u } = a;
|
|
390
|
+
return t == null || t.length === 0 ? [] : t.map((t, d) => {
|
|
391
|
+
let f = u == null ? `${t.kind}-${d}` : `${u}-${t.kind}-${d}`;
|
|
362
392
|
if (t.kind === "custom") {
|
|
363
393
|
let e = t.render(r);
|
|
364
|
-
return e == null ? null : t.label == null ? a.wrapCustomNode(
|
|
394
|
+
return e == null ? null : t.label == null ? a.wrapCustomNode(f, e) : a.renderCustomSection(f, i(t.label, s), e);
|
|
365
395
|
}
|
|
366
|
-
let
|
|
396
|
+
let p = "title" in t ? i(t.title, s) : i(t.label, s), m = t.description == null ? void 0 : i(t.description, s);
|
|
367
397
|
if (t.kind === "summary") return a.renderKeyValueListSection({
|
|
368
|
-
key:
|
|
369
|
-
title:
|
|
370
|
-
description:
|
|
371
|
-
items: t.items.map((
|
|
372
|
-
let
|
|
373
|
-
return
|
|
374
|
-
id:
|
|
375
|
-
label:
|
|
398
|
+
key: f,
|
|
399
|
+
title: p,
|
|
400
|
+
description: m,
|
|
401
|
+
items: t.items.map((e) => {
|
|
402
|
+
let t = o(e.value(r), s), c = e.href?.(r), u = e.tone?.(r), d = t ?? l("common.notAvailable");
|
|
403
|
+
return c != null && c.trim() !== "" && !n(t) ? d = a.renderLink(c, t) : u != null && !n(t) && (d = a.renderTag(u, String(t))), {
|
|
404
|
+
id: e.id,
|
|
405
|
+
label: i(e.label, s),
|
|
376
406
|
value: d
|
|
377
407
|
};
|
|
378
408
|
})
|
|
379
409
|
});
|
|
380
410
|
if (t.kind === "metrics") return a.renderMetricGroup({
|
|
381
|
-
key:
|
|
382
|
-
title:
|
|
383
|
-
description:
|
|
411
|
+
key: f,
|
|
412
|
+
title: p,
|
|
413
|
+
description: m,
|
|
384
414
|
density: t.density,
|
|
385
415
|
items: t.items.map((e) => {
|
|
386
|
-
let t = e.formattedValue?.(r),
|
|
416
|
+
let t = e.formattedValue?.(r), n = o(e.value(r), s);
|
|
387
417
|
return {
|
|
388
418
|
id: e.id,
|
|
389
|
-
label:
|
|
390
|
-
value: t ??
|
|
391
|
-
hint:
|
|
419
|
+
label: i(e.label, s),
|
|
420
|
+
value: t ?? n ?? l("common.notAvailable"),
|
|
421
|
+
hint: o(e.hint?.(r), s),
|
|
392
422
|
tone: e.tone?.(r),
|
|
393
423
|
copyValue: e.copyValue?.(r) ?? void 0
|
|
394
424
|
};
|
|
395
425
|
})
|
|
396
426
|
});
|
|
397
427
|
if (t.kind === "states") return a.renderKeyValueListSection({
|
|
398
|
-
key:
|
|
399
|
-
title:
|
|
400
|
-
description:
|
|
428
|
+
key: f,
|
|
429
|
+
title: p,
|
|
430
|
+
description: m,
|
|
401
431
|
items: t.states.map((e) => {
|
|
402
432
|
let t = e.getDisplay(e.value(r), r);
|
|
403
433
|
return {
|
|
404
434
|
id: e.id,
|
|
405
|
-
label:
|
|
406
|
-
value: a.renderTag(t.tone, String(
|
|
435
|
+
label: i(e.label, s),
|
|
436
|
+
value: a.renderTag(t.tone, String(o(t.label, s) ?? l("common.notAvailable")))
|
|
407
437
|
};
|
|
408
438
|
})
|
|
409
439
|
});
|
|
410
440
|
if (t.kind === "context") return a.renderContextStack({
|
|
411
|
-
key:
|
|
412
|
-
title:
|
|
413
|
-
items: t.items.map((
|
|
414
|
-
let
|
|
441
|
+
key: f,
|
|
442
|
+
title: p,
|
|
443
|
+
items: t.items.map((e) => {
|
|
444
|
+
let t = o(e.value(r), s), c = e.href?.(r);
|
|
415
445
|
return {
|
|
416
|
-
id:
|
|
417
|
-
label:
|
|
418
|
-
value: c != null && c.trim() !== "" && !
|
|
446
|
+
id: e.id,
|
|
447
|
+
label: i(e.label, s),
|
|
448
|
+
value: c != null && c.trim() !== "" && !n(t) ? a.renderLink(c, t) : t
|
|
419
449
|
};
|
|
420
450
|
})
|
|
421
451
|
});
|
|
422
452
|
if (t.kind === "relations") return a.renderRelations({
|
|
423
|
-
key:
|
|
424
|
-
title:
|
|
425
|
-
description:
|
|
453
|
+
key: f,
|
|
454
|
+
title: p,
|
|
455
|
+
description: m,
|
|
426
456
|
items: t.items.map((e) => ({
|
|
427
457
|
id: e.id,
|
|
428
|
-
label:
|
|
458
|
+
label: i(e.label, s),
|
|
429
459
|
count: e.count?.(r) ?? null,
|
|
430
460
|
href: e.href?.(r) ?? void 0,
|
|
431
|
-
description:
|
|
461
|
+
description: o(e.description?.(r), s),
|
|
432
462
|
tone: e.tone?.(r)
|
|
433
463
|
}))
|
|
434
464
|
});
|
|
435
465
|
if (t.kind === "timeline") return a.renderTimeline({
|
|
436
|
-
key:
|
|
437
|
-
title:
|
|
438
|
-
description:
|
|
466
|
+
key: f,
|
|
467
|
+
title: p,
|
|
468
|
+
description: m,
|
|
439
469
|
events: t.events.map((e) => {
|
|
440
|
-
let t = e.state?.(r),
|
|
470
|
+
let t = e.state?.(r), n = t == null ? null : o(t.label, s), c = n == null ? null : String(n);
|
|
441
471
|
return {
|
|
442
472
|
id: e.id,
|
|
443
|
-
label:
|
|
444
|
-
timestamp: e.timestamp == null ? void 0 : a.renderDate(e.timestamp(r),
|
|
445
|
-
description:
|
|
446
|
-
actor:
|
|
473
|
+
label: c == null || c.trim() === "" ? i(e.label, s) : `${i(e.label, s)}: ${c}`,
|
|
474
|
+
timestamp: e.timestamp == null ? void 0 : a.renderDate(e.timestamp(r), l("common.notAvailable")),
|
|
475
|
+
description: o(e.description?.(r), s),
|
|
476
|
+
actor: o(e.actor?.(r), s),
|
|
447
477
|
tone: t?.tone,
|
|
448
|
-
payload:
|
|
478
|
+
payload: h(e.payload?.(r))
|
|
449
479
|
};
|
|
450
480
|
})
|
|
451
481
|
});
|
|
452
482
|
if (t.kind === "audit") return a.renderAuditTimeline({
|
|
453
|
-
key:
|
|
454
|
-
title:
|
|
455
|
-
description:
|
|
456
|
-
events: t.items.map((
|
|
457
|
-
let
|
|
483
|
+
key: f,
|
|
484
|
+
title: p,
|
|
485
|
+
description: m,
|
|
486
|
+
events: t.items.map((e) => {
|
|
487
|
+
let t = o(e.actor?.(r), s), c = o(e.source?.(r), s);
|
|
458
488
|
return {
|
|
459
|
-
id:
|
|
460
|
-
title:
|
|
461
|
-
time: a.renderDate(
|
|
462
|
-
actor:
|
|
463
|
-
source:
|
|
489
|
+
id: e.id,
|
|
490
|
+
title: i(e.label, s),
|
|
491
|
+
time: a.renderDate(e.timestamp?.(r), l("common.notAvailable")),
|
|
492
|
+
actor: n(t) ? void 0 : t,
|
|
493
|
+
source: n(c) ? void 0 : c
|
|
464
494
|
};
|
|
465
495
|
})
|
|
466
496
|
});
|
|
467
497
|
if (t.kind === "references") return a.renderKeyValueListSection({
|
|
468
|
-
key:
|
|
469
|
-
title:
|
|
470
|
-
description:
|
|
471
|
-
items: t.references.map((
|
|
472
|
-
let
|
|
498
|
+
key: f,
|
|
499
|
+
title: p,
|
|
500
|
+
description: m,
|
|
501
|
+
items: t.references.map((e) => {
|
|
502
|
+
let t = e.href?.(r);
|
|
473
503
|
return {
|
|
474
|
-
id:
|
|
475
|
-
label:
|
|
476
|
-
value:
|
|
504
|
+
id: e.id,
|
|
505
|
+
label: i(e.label, s),
|
|
506
|
+
value: _({
|
|
507
|
+
value: e.value(r),
|
|
508
|
+
href: t,
|
|
509
|
+
refKind: e.refKind ?? "text",
|
|
510
|
+
copyValue: e.copyValue?.(r) ?? void 0,
|
|
511
|
+
tApp: s,
|
|
512
|
+
t: l,
|
|
513
|
+
renderLink: a.renderLink
|
|
514
|
+
})
|
|
477
515
|
};
|
|
478
516
|
})
|
|
479
517
|
});
|
|
480
518
|
if (t.kind === "actionResult") {
|
|
481
|
-
let
|
|
482
|
-
|
|
519
|
+
let e = [], c = t.status?.(r);
|
|
520
|
+
c != null && e.push({
|
|
483
521
|
id: `${t.id}-status`,
|
|
484
|
-
label:
|
|
485
|
-
value: a.renderTag(
|
|
522
|
+
label: l("detail.actionResult.status"),
|
|
523
|
+
value: a.renderTag(c.tone, String(o(c.label, s) ?? l("common.notAvailable")))
|
|
486
524
|
});
|
|
487
|
-
let
|
|
488
|
-
return
|
|
525
|
+
let u = o(t.message?.(r), s);
|
|
526
|
+
return n(u) || e.push({
|
|
489
527
|
id: `${t.id}-message`,
|
|
490
|
-
label:
|
|
491
|
-
value:
|
|
492
|
-
}), t.references?.forEach((
|
|
493
|
-
|
|
494
|
-
id:
|
|
495
|
-
label:
|
|
496
|
-
value:
|
|
528
|
+
label: l("detail.actionResult.message"),
|
|
529
|
+
value: u
|
|
530
|
+
}), t.references?.forEach((t) => {
|
|
531
|
+
e.push({
|
|
532
|
+
id: t.id,
|
|
533
|
+
label: i(t.label, s),
|
|
534
|
+
value: _({
|
|
535
|
+
value: t.value(r),
|
|
536
|
+
href: t.href?.(r),
|
|
537
|
+
refKind: t.refKind ?? "text",
|
|
538
|
+
copyValue: t.copyValue?.(r) ?? void 0,
|
|
539
|
+
tApp: s,
|
|
540
|
+
t: l,
|
|
541
|
+
renderLink: a.renderLink
|
|
542
|
+
})
|
|
497
543
|
});
|
|
498
544
|
}), a.renderKeyValueListSection({
|
|
499
|
-
key:
|
|
500
|
-
title:
|
|
501
|
-
description:
|
|
502
|
-
items:
|
|
545
|
+
key: f,
|
|
546
|
+
title: p,
|
|
547
|
+
description: m,
|
|
548
|
+
items: e
|
|
503
549
|
});
|
|
504
550
|
}
|
|
505
551
|
return t.kind === "technicalFacts" ? a.renderKeyValueListSection({
|
|
506
|
-
key:
|
|
507
|
-
title:
|
|
508
|
-
description:
|
|
552
|
+
key: f,
|
|
553
|
+
title: p,
|
|
554
|
+
description: m,
|
|
509
555
|
items: t.facts.map((t) => {
|
|
510
|
-
let
|
|
556
|
+
let u = o(t.value(r), s), d = t.href?.(r), f = t.copyValue?.(r) ?? void 0;
|
|
511
557
|
return {
|
|
512
558
|
id: t.id,
|
|
513
|
-
label:
|
|
514
|
-
value:
|
|
559
|
+
label: i(t.label, s),
|
|
560
|
+
value: f != null && f.trim() !== "" ? c(e, {
|
|
561
|
+
value: u ?? f,
|
|
562
|
+
copyValue: f,
|
|
563
|
+
variant: "external",
|
|
564
|
+
copyLabel: l("common.actions.copy")
|
|
565
|
+
}) : d != null && d.trim() !== "" && !n(u) ? a.renderLink(d, u) : u ?? l("common.notAvailable")
|
|
515
566
|
};
|
|
516
567
|
})
|
|
517
568
|
}) : t.kind === "table" ? a.renderTable({
|
|
518
|
-
key:
|
|
519
|
-
title:
|
|
520
|
-
description:
|
|
569
|
+
key: f,
|
|
570
|
+
title: p,
|
|
571
|
+
description: m,
|
|
521
572
|
columns: a.resolveTableColumns(t.columns),
|
|
522
573
|
rows: t.rows(r)
|
|
523
574
|
}) : a.renderPayload({
|
|
524
|
-
key:
|
|
525
|
-
title:
|
|
526
|
-
description:
|
|
575
|
+
key: f,
|
|
576
|
+
title: p,
|
|
577
|
+
description: m,
|
|
527
578
|
content: t.value(r),
|
|
528
579
|
format: t.format
|
|
529
580
|
});
|
|
530
581
|
});
|
|
531
582
|
};
|
|
532
583
|
//#endregion
|
|
533
|
-
export {
|
|
584
|
+
export { p as buildFieldItems, v as renderBlocks, l as resolveFlagTag, m as resolveHeaderItems, d as resolveHeaderMeta, f as resolveHeaderStatus, u as resolveInlineValue };
|
|
534
585
|
|
|
535
586
|
//# sourceMappingURL=BackofficeEntityDetailPage.view-helpers.js.map
|