@plumile/backoffice-react 0.1.161 → 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.
Files changed (48) hide show
  1. package/README.md +3 -0
  2. package/lib/esm/auth/authRefreshNotice.css.js +0 -1
  3. package/lib/esm/auth/login/loginPage.css.js +0 -1
  4. package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +52 -42
  5. package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
  6. package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -0
  7. package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
  8. package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js.map +1 -1
  9. package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -0
  10. package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js +4 -6
  11. package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
  12. package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js +1 -1
  13. package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js.map +1 -1
  14. package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js +27 -8
  15. package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js.map +1 -1
  16. package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +2 -2
  17. package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js.map +1 -1
  18. package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js +26 -0
  19. package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js.map +1 -0
  20. package/lib/esm/index.js +9 -6
  21. package/lib/esm/modules/uploads.js +31 -0
  22. package/lib/esm/modules/uploads.js.map +1 -0
  23. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +313 -262
  24. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
  25. package/lib/esm/pages/BackofficeEntityListPage.helpers.js +8 -8
  26. package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
  27. package/lib/esm/relay/shortAccessTokenEnvironment.js +15 -0
  28. package/lib/esm/relay/shortAccessTokenEnvironment.js.map +1 -0
  29. package/lib/esm/relay/useMutationAction.js +33 -0
  30. package/lib/esm/relay/useMutationAction.js.map +1 -0
  31. package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
  32. package/lib/types/components/backoffice/filters/backofficeFilterAction.css.d.ts.map +1 -1
  33. package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts.map +1 -1
  34. package/lib/types/components/backoffice/shared/BackofficeInlineFilterRow.d.ts.map +1 -1
  35. package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts +2 -0
  36. package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts.map +1 -1
  37. package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts +12 -0
  38. package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts.map +1 -0
  39. package/lib/types/index.d.ts +3 -0
  40. package/lib/types/index.d.ts.map +1 -1
  41. package/lib/types/modules/uploads.d.ts +27 -0
  42. package/lib/types/modules/uploads.d.ts.map +1 -0
  43. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
  44. package/lib/types/relay/shortAccessTokenEnvironment.d.ts +4 -0
  45. package/lib/types/relay/shortAccessTokenEnvironment.d.ts.map +1 -0
  46. package/lib/types/relay/useMutationAction.d.ts +15 -0
  47. package/lib/types/relay/useMutationAction.d.ts.map +1 -0
  48. package/package.json +19 -19
@@ -1,7 +1,8 @@
1
- import { isEmptyText as e, resolveBadgeTone as t, resolveLabel as n, resolveRelationValue as r, resolveValueLabel as i } from "./BackofficeEntityDetailPage.helpers.js";
2
- import { Fragment as a, createElement as o } from "react";
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 s = (e, t, n) => {
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
- }, c = (t, n) => {
93
- let { tApp: r, t: a, resolveEntityHref: o, renderLink: s } = n, c = a("common.notAvailable");
94
- if (t.type === "text") {
95
- let n = i(t.value, r);
96
- return e(n) ? c : n;
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 (t.type === "entityRef") {
99
- let { id: e } = t;
100
- if (e == null || e.trim() === "") return c;
101
- let n = i(t.label, r), a = n != null && String(n).trim() !== "" ? n : null;
102
- if (a == null) return c;
103
- let l = o?.(t.entity, e) ?? null;
104
- return l == null ? a : s(l, a);
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 } = t;
107
+ let { href: l } = e;
107
108
  if (l == null || l.trim() === "") return c;
108
- let u = i(t.label, r);
109
- return e(u) ? c : s(l, u);
110
- }, l = (t, n, r) => {
111
- let { tApp: a, t: o, resolveEntityHref: s, renderDate: c, renderLink: l } = r, u = o("common.notAvailable");
112
- if (t.type === "dateTime") return c(t.value(n), u);
113
- if (t.type === "entityRef") {
114
- let e = t.id(n);
115
- if (e == null || e.trim() === "") return u;
116
- let r = i(t.value?.(n), a), o = r != null && String(r).trim() !== "" ? r : null;
117
- if (o == null) return u;
118
- let c = s?.(t.entity, e) ?? null;
119
- return c == null ? o : l(c, o);
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 (t.type === "link") {
122
- let r = t.href(n), o = i(t.value(n), a);
123
- return r == null || r.trim() === "" || e(o) ? u : l(r, o);
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 = i(t.value(n), a);
126
- return e(d) ? u : d;
127
- }, u = (e, n, r, a) => {
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 t = e.items(n).map((e) => {
130
- let t = i(e.label, r), n = t == null ? "" : String(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: n
134
+ label: r
134
135
  };
135
136
  });
136
- return t.length === 0 ? void 0 : a.renderBadgeRow(t);
137
+ return r.length === 0 ? void 0 : i.renderBadgeRow(r);
137
138
  }
138
- let o = i(e.value(n), r), s = o == null ? "" : String(o);
139
+ let a = o(e.value(t), n), s = a == null ? "" : String(a);
139
140
  if (s.trim() === "") return;
140
- let c = t(e.tone, n);
141
- return a.renderTag(c, s);
142
- }, d = (a, l, u) => {
143
- let { tApp: d, t: f, resolveEntityHref: p, formatNumber: m, formatCurrency: h, formatCurrencyTitle: g, formatPercent: _, relationEntityListRoutes: v, resolveRelationItem: y, setWhereValue: b, renderTag: x, renderBadgeRow: S, renderDate: C, renderFlagTag: w, renderLink: T, renderTaggedValue: E, wrapCustomNode: D } = u, O = [], k = [], A = [], j = f("common.notAvailable");
144
- return a.forEach((a, u) => {
145
- let M = `${a.type}-${u}`;
146
- switch (a.type) {
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 = i(a.value(l), d);
149
- O.push({
150
- id: M,
151
- label: n(a.label, d),
152
- size: a.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: a.copyValue?.(l) ?? void 0,
155
- fullWidth: a.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 = i(a.value(l), d), r = e == null ? "" : String(e), o = t(a.tone, l);
161
- O.push({
162
- id: M,
163
- label: n(a.label, d),
164
- size: a.size,
165
- value: r.trim() === "" ? null : x(o, r)
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 = a.items(l).map((e) => {
171
- let t = i(e.label, d), n = t == null ? "" : String(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
- O.push({
178
- id: M,
179
- label: n(a.label, d),
180
- size: a.size,
181
- value: e.length > 0 ? S(e) : null,
182
- fullWidth: a.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
- O.push({
188
- id: M,
189
- label: n(a.label, d),
190
- size: a.size,
191
- value: C(a.value(l), j)
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 = a.value(l), t = null;
196
- if (e != null) if (a.format === "currency") {
197
- let n = h(e);
198
- t = o("span", { title: g?.(e) ?? void 0 }, n);
199
- } else t = a.format === "percent" ? _(e) : m(e);
200
- O.push({
201
- id: M,
202
- label: n(a.label, d),
203
- size: a.size,
204
- value: t
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 = a.value(l);
210
- O.push({
211
- id: M,
212
- label: n(a.label, d),
213
- size: a.size,
214
- value: e == null ? null : w(s(a.variant, e, f))
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 = a.id(l), t = null;
220
+ let e = t.id(s), n = null;
220
221
  if (e != null && e.trim() !== "") {
221
- let n = a.value?.(l), r = n != null && n.trim() !== "" ? n : null, i = p?.(a.entity, e) ?? null;
222
- r != null && (t = i == null ? r : T(i, r));
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
- O.push({
225
- id: M,
226
- label: n(a.label, d),
227
- size: a.size,
228
- value: t ?? j
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 t = a.href(l), r = a.value(l);
234
- O.push({
235
- id: M,
236
- label: n(a.label, d),
237
- size: a.size,
238
- value: t != null && t.trim() !== "" && !e(r) ? T(t, r) : null
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 = a.tag(l), t = c(a.value(l), {
244
- tApp: d,
245
- t: f,
246
- resolveEntityHref: p,
247
- renderLink: T
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 = i(e.label, d);
269
+ let t = o(e.label, f);
252
270
  return t == null ? "" : String(t);
253
271
  })()
254
272
  };
255
- O.push({
256
- id: M,
257
- label: n(a.label, d),
258
- size: a.size,
259
- value: r != null || t != null ? E(r, t) : null,
260
- fullWidth: a.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 = r(a.value(l));
283
+ let e = a(t.value(s));
266
284
  if (e == null) break;
267
- let t = v[a.relation.target];
268
- if (t == null) break;
269
- let i = b(null, a.relation.whereKey, e, a.relation.path);
270
- if (i == null) break;
271
- k.push(y({
272
- id: M,
273
- label: n(a.label, d),
274
- relation: a.relation,
275
- listRoute: t,
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: i
295
+ where: r
278
296
  }));
279
297
  break;
280
298
  }
281
299
  case "custom": {
282
- let e = a.render(l);
300
+ let e = t.render(s);
283
301
  if (e == null) break;
284
- if (a.label != null) {
285
- O.push({
286
- id: M,
287
- label: n(a.label, d),
288
- size: a.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: a.fullWidth
308
+ fullWidth: t.fullWidth
291
309
  });
292
310
  break;
293
311
  }
294
- A.push(D(M, e));
312
+ j.push(O(N, e));
295
313
  break;
296
314
  }
297
315
  default: break;
298
316
  }
299
317
  }), {
300
- items: O,
301
- relationItems: k,
302
- customNodes: A
318
+ items: k,
319
+ relationItems: A,
320
+ customNodes: j
303
321
  };
304
- }, f = (e, r, s) => {
305
- let { tApp: d, t: f, resolveEntityHref: p, renderLink: m, renderDate: h, renderTag: g, renderBadgeRow: _ } = s, v = e.titleValue?.(r, d) ?? n(e.title, d), y = v.trim() === "" ? n(e.title, d) : v, b;
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: t } = e, n = e.subtitleSeparator ?? " / ", i = [];
308
- t.forEach((e, a) => {
309
- i.push(o("span", { key: e.id }, c(e.value(r), {
310
- tApp: d,
311
- t: f,
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
- }))), a < t.length - 1 && i.push(o("span", { key: `${e.id}-sep` }, n));
315
- }), b = o("span", null, ...i);
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 t = e.subtitleValue?.(r, d) ?? (e.subtitle == null ? null : n(e.subtitle, d));
318
- b = t != null && t.trim() !== "" ? t : void 0;
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 x = [];
321
- e.badges?.forEach((e, s) => {
322
- let c = n(e.label, d), l = i(e.value(r), d), u = l == null ? "" : String(l);
323
- u.trim() !== "" && (x.push(g(t(e.tone, r), `${c}: ${u}`)), typeof x[x.length - 1] == "object" && (x[x.length - 1] = o(a, { key: `${c}-${s}` }, x[x.length - 1])));
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 S = e.status == null ? void 0 : u(e.status, r, d, {
343
+ let C = e.status == null ? void 0 : f(e.status, t, a, {
326
344
  renderBadgeRow: _,
327
345
  renderTag: g
328
- }), C = e.meta?.map((e, t) => {
329
- let i = n(e.label, d);
346
+ }), w = e.meta?.map((e, n) => {
347
+ let r = i(e.label, a);
330
348
  return {
331
- id: `${i}-${t}`,
332
- label: i,
333
- value: l(e, r, {
334
- tApp: d,
335
- t: f,
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: y,
344
- subtitle: b,
345
- badges: x.length > 0 ? o(a, null, ...x) : void 0,
346
- status: S,
347
- items: C
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
- }, p = (e) => {
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 o("pre", null, JSON.stringify(e, null, 2));
371
+ return c("pre", null, JSON.stringify(e, null, 2));
354
372
  } catch {
355
- return o("pre", null, e instanceof Error ? e.message : "[unserializable payload]");
373
+ return c("pre", null, e instanceof Error ? e.message : "[unserializable payload]");
356
374
  }
357
375
  }
358
- }, m = (t, r, a) => {
359
- let { tApp: o, t: s, keyPrefix: c } = a;
360
- return t == null || t.length === 0 ? [] : t.map((t, l) => {
361
- let u = c == null ? `${t.kind}-${l}` : `${c}-${t.kind}-${l}`;
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(u, e) : a.renderCustomSection(u, n(t.label, o), e);
394
+ return e == null ? null : t.label == null ? a.wrapCustomNode(f, e) : a.renderCustomSection(f, i(t.label, s), e);
365
395
  }
366
- let d = "title" in t ? n(t.title, o) : n(t.label, o), f = t.description == null ? void 0 : n(t.description, o);
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: u,
369
- title: d,
370
- description: f,
371
- items: t.items.map((t) => {
372
- let c = i(t.value(r), o), l = t.href?.(r), u = t.tone?.(r), d = c ?? s("common.notAvailable");
373
- return l != null && l.trim() !== "" && !e(c) ? d = a.renderLink(l, c) : u != null && !e(c) && (d = a.renderTag(u, String(c))), {
374
- id: t.id,
375
- label: n(t.label, o),
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: u,
382
- title: d,
383
- description: f,
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), a = i(e.value(r), o);
416
+ let t = e.formattedValue?.(r), n = o(e.value(r), s);
387
417
  return {
388
418
  id: e.id,
389
- label: n(e.label, o),
390
- value: t ?? a ?? s("common.notAvailable"),
391
- hint: i(e.hint?.(r), o),
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: u,
399
- title: d,
400
- description: f,
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: n(e.label, o),
406
- value: a.renderTag(t.tone, String(i(t.label, o) ?? s("common.notAvailable")))
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: u,
412
- title: d,
413
- items: t.items.map((t) => {
414
- let s = i(t.value(r), o), c = t.href?.(r);
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: t.id,
417
- label: n(t.label, o),
418
- value: c != null && c.trim() !== "" && !e(s) ? a.renderLink(c, s) : s
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: u,
424
- title: d,
425
- description: f,
453
+ key: f,
454
+ title: p,
455
+ description: m,
426
456
  items: t.items.map((e) => ({
427
457
  id: e.id,
428
- label: n(e.label, o),
458
+ label: i(e.label, s),
429
459
  count: e.count?.(r) ?? null,
430
460
  href: e.href?.(r) ?? void 0,
431
- description: i(e.description?.(r), o),
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: u,
437
- title: d,
438
- description: f,
466
+ key: f,
467
+ title: p,
468
+ description: m,
439
469
  events: t.events.map((e) => {
440
- let t = e.state?.(r), c = t == null ? null : i(t.label, o), l = c == null ? null : String(c);
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: l == null || l.trim() === "" ? n(e.label, o) : `${n(e.label, o)}: ${l}`,
444
- timestamp: e.timestamp == null ? void 0 : a.renderDate(e.timestamp(r), s("common.notAvailable")),
445
- description: i(e.description?.(r), o),
446
- actor: i(e.actor?.(r), o),
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: p(e.payload?.(r))
478
+ payload: h(e.payload?.(r))
449
479
  };
450
480
  })
451
481
  });
452
482
  if (t.kind === "audit") return a.renderAuditTimeline({
453
- key: u,
454
- title: d,
455
- description: f,
456
- events: t.items.map((t) => {
457
- let c = i(t.actor?.(r), o), l = i(t.source?.(r), o);
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: t.id,
460
- title: n(t.label, o),
461
- time: a.renderDate(t.timestamp?.(r), s("common.notAvailable")),
462
- actor: e(c) ? void 0 : c,
463
- source: e(l) ? void 0 : l
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: u,
469
- title: d,
470
- description: f,
471
- items: t.references.map((t) => {
472
- let c = i(t.value(r), o), l = t.href?.(r);
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: t.id,
475
- label: n(t.label, o),
476
- value: l != null && l.trim() !== "" && !e(c) ? a.renderLink(l, c) : c ?? s("common.notAvailable")
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 c = [], l = t.status?.(r);
482
- l != null && c.push({
519
+ let e = [], c = t.status?.(r);
520
+ c != null && e.push({
483
521
  id: `${t.id}-status`,
484
- label: s("detail.actionResult.status"),
485
- value: a.renderTag(l.tone, String(i(l.label, o) ?? s("common.notAvailable")))
522
+ label: l("detail.actionResult.status"),
523
+ value: a.renderTag(c.tone, String(o(c.label, s) ?? l("common.notAvailable")))
486
524
  });
487
- let p = i(t.message?.(r), o);
488
- return e(p) || c.push({
525
+ let u = o(t.message?.(r), s);
526
+ return n(u) || e.push({
489
527
  id: `${t.id}-message`,
490
- label: s("detail.actionResult.message"),
491
- value: p
492
- }), t.references?.forEach((e) => {
493
- c.push({
494
- id: e.id,
495
- label: n(e.label, o),
496
- value: i(e.value(r), o) ?? s("common.notAvailable")
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: u,
500
- title: d,
501
- description: f,
502
- items: c
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: u,
507
- title: d,
508
- description: f,
552
+ key: f,
553
+ title: p,
554
+ description: m,
509
555
  items: t.facts.map((t) => {
510
- let c = i(t.value(r), o), l = t.href?.(r);
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: n(t.label, o),
514
- value: l != null && l.trim() !== "" && !e(c) ? a.renderLink(l, c) : c ?? s("common.notAvailable")
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: u,
519
- title: d,
520
- description: f,
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: u,
525
- title: d,
526
- description: f,
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 { d as buildFieldItems, m as renderBlocks, s as resolveFlagTag, f as resolveHeaderItems, l as resolveHeaderMeta, u as resolveHeaderStatus, c as resolveInlineValue };
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