@declarion/react 0.36.3 → 0.36.5
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/dist-lib/{DraggableChildrenTable-ChUh120M.js → DraggableChildrenTable-BfErdVdt.js} +35 -35
- package/dist-lib/{Grid-DT9wV-D7.js → Grid-D0ckegd1.js} +41 -41
- package/dist-lib/{LayoutRenderer-0UKE3pp6.js → LayoutRenderer-BGeN0rwC.js} +465 -465
- package/dist-lib/{MarkdownRenderer-CvURrJCu.js → MarkdownRenderer-14LG1clY.js} +1 -1
- package/dist-lib/{RefreshControl-CX_D6PcA.js → RefreshControl-Bpd9kw0G.js} +45 -45
- package/dist-lib/{SmartDetailPage.impl-Ccz4TqfJ.js → SmartDetailPage.impl-BaXAi7OH.js} +234 -234
- package/dist-lib/{SmartRecordListPage.impl-Y0w4oIe3.js → SmartRecordListPage.impl-CgiZWbF3.js} +189 -189
- package/dist-lib/index.d.ts +1 -1
- package/dist-lib/index.js +1510 -1526
- package/dist-lib/{registry-D_zbJrLC.js → registry-KMbQkTF6.js} +1036 -1034
- package/dist-lib/testing.d.ts +8 -0
- package/dist-lib/testing.js +63 -60
- package/dist-lib/{ActionRunner-BrXXs8ga.js → useCurrentScreen-Bgp6_vne.js} +18 -2
- package/dist-lib/{useProperties-C_1KM72K.js → useProperties-DMT162ot.js} +68 -68
- package/dist-lib/{value-BBnVc95O.js → value-CUVtVjKI.js} +22 -22
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-BWO6QtNF.js";
|
|
2
|
-
import {
|
|
3
|
-
import { I as oe, N as se, P as ce, S as le, f as A, h as j, i as ue, l as de, o as fe, t as M, u as N, v as pe, w as me } from "./RefreshControl-
|
|
4
|
-
import { $ as he, D as ge, G as _e, H as ve, K as ye, L as P, M as be, O as xe, Q as Se, St as Ce, U as we, W as Te, X as Ee, Z as De, _ as Oe, a as ke, dt as Ae, et as je, ft as Me, i as Ne, nt as Pe, q as Fe, s as Ie, tt as Le, vt as Re, w as ze, z as Be } from "./registry-
|
|
2
|
+
import { $ as n, B as r, Gn as i, I as a, Kn as o, L as s, Nn as c, S as l, W as u, Wn as d, Xt as f, Z as p, _t as m, an as h, b as g, bn as _, cn as v, fn as y, g as b, gt as ee, h as te, i as x, ln as ne, lt as S, mn as C, nt as w, on as re, ot as T, sn as ie, un as E, ut as D, v as O, z as k, zn as ae } from "./useCurrentScreen-Bgp6_vne.js";
|
|
3
|
+
import { I as oe, N as se, P as ce, S as le, f as A, h as j, i as ue, l as de, o as fe, t as M, u as N, v as pe, w as me } from "./RefreshControl-Bpd9kw0G.js";
|
|
4
|
+
import { $ as he, D as ge, G as _e, H as ve, K as ye, L as P, M as be, O as xe, Q as Se, St as Ce, U as we, W as Te, X as Ee, Z as De, _ as Oe, a as ke, dt as Ae, et as je, ft as Me, i as Ne, nt as Pe, q as Fe, s as Ie, tt as Le, vt as Re, w as ze, z as Be } from "./registry-KMbQkTF6.js";
|
|
5
5
|
import { n as Ve, r as He, t as Ue } from "./dataTableStyles-vwD1mVOP.js";
|
|
6
|
-
import { n as We, t as Ge } from "./LayoutRenderer-
|
|
6
|
+
import { n as We, t as Ge } from "./LayoutRenderer-BGeN0rwC.js";
|
|
7
7
|
import { Fragment as Ke, useCallback as F, useEffect as I, useMemo as L, useRef as qe, useState as R } from "react";
|
|
8
8
|
import { useLocation as Je, useParams as Ye, useSearchParams as Xe } from "react-router-dom";
|
|
9
9
|
import { useQuery as Ze, useQueryClient as Qe } from "@tanstack/react-query";
|
|
@@ -46,7 +46,7 @@ function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
46
46
|
children: [n.display?.icon && /* @__PURE__ */ z(t, {
|
|
47
47
|
name: n.display.icon,
|
|
48
48
|
size: 13
|
|
49
|
-
}),
|
|
49
|
+
}), E(n.display?.name) || e]
|
|
50
50
|
}, e);
|
|
51
51
|
})
|
|
52
52
|
}),
|
|
@@ -62,110 +62,110 @@ function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a }) {
|
|
65
|
-
let
|
|
65
|
+
let s = Ae(), c = te(), l = `${t}.${r}`, { data: u, isLoading: d } = Ze({
|
|
66
66
|
queryKey: [
|
|
67
67
|
"association",
|
|
68
|
-
|
|
68
|
+
l,
|
|
69
69
|
n
|
|
70
70
|
],
|
|
71
|
-
queryFn: () =>
|
|
72
|
-
}), f =
|
|
71
|
+
queryFn: () => D(l, [n])
|
|
72
|
+
}), f = u?.target_entity ?? i.target, p = a.entities[f], m = L(() => u?.ids ?? [], [u?.ids]), h = L(() => p?.fields.names().find((e) => p.fields.get(e)?.primary) ?? "id", [p]), g = L(() => m.slice(0, 50), [m]), { data: _, isLoading: v } = Ze({
|
|
73
73
|
queryKey: [
|
|
74
74
|
"association-records",
|
|
75
75
|
f,
|
|
76
|
-
|
|
76
|
+
g
|
|
77
77
|
],
|
|
78
|
-
queryFn: () =>
|
|
78
|
+
queryFn: () => S(f, {
|
|
79
79
|
per_page: 50,
|
|
80
80
|
filters: [{
|
|
81
|
-
field:
|
|
81
|
+
field: h,
|
|
82
82
|
op: "in",
|
|
83
|
-
value:
|
|
83
|
+
value: g
|
|
84
84
|
}]
|
|
85
85
|
}),
|
|
86
|
-
enabled:
|
|
87
|
-
}),
|
|
86
|
+
enabled: g.length > 0 && !!p
|
|
87
|
+
}), y = _?.data ?? [], ee = _?.$refs, x = L(() => p ? p.fields.names().filter((e) => {
|
|
88
88
|
let t = p.fields.get(e);
|
|
89
89
|
return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
|
|
90
|
-
}).slice(0, 6) : [], [p]),
|
|
90
|
+
}).slice(0, 6) : [], [p]), ne = () => {
|
|
91
91
|
let e = P(a, f);
|
|
92
92
|
if (!e) return;
|
|
93
|
-
let t =
|
|
93
|
+
let t = E(i.display?.name) || r, n = new URLSearchParams();
|
|
94
94
|
n.set("filters", JSON.stringify([{
|
|
95
|
-
field:
|
|
95
|
+
field: h,
|
|
96
96
|
op: "in",
|
|
97
|
-
value:
|
|
98
|
-
}])),
|
|
97
|
+
value: m
|
|
98
|
+
}])), s(e.route, {
|
|
99
99
|
title: t,
|
|
100
100
|
icon: i.display?.icon || e.icon,
|
|
101
101
|
search: n.toString()
|
|
102
102
|
});
|
|
103
|
-
},
|
|
103
|
+
}, C = {
|
|
104
104
|
fontSize: 12.5,
|
|
105
105
|
color: "var(--text-3)",
|
|
106
106
|
padding: "14px 16px"
|
|
107
107
|
};
|
|
108
|
-
if (
|
|
109
|
-
style:
|
|
108
|
+
if (d || v) return /* @__PURE__ */ z("div", {
|
|
109
|
+
style: C,
|
|
110
110
|
children: "Loading…"
|
|
111
111
|
});
|
|
112
112
|
if (!p) return /* @__PURE__ */ z("div", {
|
|
113
|
-
style:
|
|
113
|
+
style: C,
|
|
114
114
|
children: "Entity not found."
|
|
115
115
|
});
|
|
116
|
-
if (
|
|
117
|
-
style:
|
|
116
|
+
if (m.length === 0) return /* @__PURE__ */ z("div", {
|
|
117
|
+
style: C,
|
|
118
118
|
children: "No related records."
|
|
119
119
|
});
|
|
120
|
-
let
|
|
120
|
+
let w = P(a, f);
|
|
121
121
|
return /* @__PURE__ */ B("div", {
|
|
122
122
|
style: { padding: "8px 0" },
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ B("table", {
|
|
125
125
|
style: He,
|
|
126
|
-
children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", { children:
|
|
126
|
+
children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", { children: x.map((e) => /* @__PURE__ */ z("th", {
|
|
127
127
|
style: Ve,
|
|
128
|
-
children:
|
|
129
|
-
}, e)) }) }), /* @__PURE__ */ z("tbody", { children:
|
|
128
|
+
children: ie(p.fields.get(e), e, a.entities)
|
|
129
|
+
}, e)) }) }), /* @__PURE__ */ z("tbody", { children: y.map((e, t) => /* @__PURE__ */ z("tr", { children: x.map((t) => {
|
|
130
130
|
let n = p.fields.get(t);
|
|
131
131
|
return n ? /* @__PURE__ */ z("td", {
|
|
132
132
|
style: Ue,
|
|
133
|
-
children:
|
|
133
|
+
children: b({
|
|
134
134
|
field: n,
|
|
135
135
|
fieldName: t,
|
|
136
136
|
value: e[t],
|
|
137
137
|
mode: "display",
|
|
138
138
|
record: e,
|
|
139
|
-
refs:
|
|
140
|
-
locale:
|
|
139
|
+
refs: ee,
|
|
140
|
+
locale: c
|
|
141
141
|
})
|
|
142
142
|
}, t) : /* @__PURE__ */ z("td", {}, t);
|
|
143
143
|
}) }, t)) })]
|
|
144
144
|
}),
|
|
145
|
-
|
|
145
|
+
w && u && u.count > y.length && /* @__PURE__ */ z("div", {
|
|
146
146
|
style: {
|
|
147
147
|
padding: "10px 16px",
|
|
148
148
|
textAlign: "center"
|
|
149
149
|
},
|
|
150
|
-
children: /* @__PURE__ */ B(
|
|
150
|
+
children: /* @__PURE__ */ B(o, {
|
|
151
151
|
icon: /* @__PURE__ */ z(e.external, { size: 12 }),
|
|
152
|
-
onClick:
|
|
152
|
+
onClick: ne,
|
|
153
153
|
children: [
|
|
154
154
|
"View all ",
|
|
155
|
-
|
|
155
|
+
u.count,
|
|
156
156
|
" records"
|
|
157
157
|
]
|
|
158
158
|
})
|
|
159
159
|
}),
|
|
160
|
-
|
|
160
|
+
w && y.length > 0 && u && u.count <= y.length && /* @__PURE__ */ z("div", {
|
|
161
161
|
style: {
|
|
162
162
|
padding: "10px 16px",
|
|
163
163
|
textAlign: "center"
|
|
164
164
|
},
|
|
165
|
-
children: /* @__PURE__ */ z(
|
|
165
|
+
children: /* @__PURE__ */ z(o, {
|
|
166
166
|
kind: "ghost",
|
|
167
167
|
icon: /* @__PURE__ */ z(e.external, { size: 12 }),
|
|
168
|
-
onClick:
|
|
168
|
+
onClick: ne,
|
|
169
169
|
children: "Open in list view"
|
|
170
170
|
})
|
|
171
171
|
})
|
|
@@ -185,7 +185,7 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
185
185
|
t,
|
|
186
186
|
n
|
|
187
187
|
],
|
|
188
|
-
queryFn: async () => (await
|
|
188
|
+
queryFn: async () => (await T("document.object_links", {
|
|
189
189
|
entity: t,
|
|
190
190
|
object_id: n
|
|
191
191
|
})).result?.documents ?? [],
|
|
@@ -238,51 +238,51 @@ function V() {
|
|
|
238
238
|
children: [/* @__PURE__ */ z(e.file, { size: 13 }), "Documents"]
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
function at({ entityCode: t, objectId: n, doc:
|
|
242
|
-
let
|
|
243
|
-
async function
|
|
244
|
-
|
|
241
|
+
function at({ entityCode: t, objectId: n, doc: i }) {
|
|
242
|
+
let a = Qe(), [s, c] = R(!1), [l, u] = R(!1), [d, f] = R(!1), [p, m] = R(!1), [h, g] = R(null), _ = E(i.title) || i.filename || i.template_code, v = i.status === "ready" && i.download_url && !p;
|
|
243
|
+
async function y() {
|
|
244
|
+
c(!0), g(null);
|
|
245
245
|
try {
|
|
246
|
-
let e = (await
|
|
247
|
-
generated_document_id:
|
|
246
|
+
let e = (await T("document.download_format", {
|
|
247
|
+
generated_document_id: i.generated_document_id,
|
|
248
248
|
format: "pdf"
|
|
249
249
|
})).result;
|
|
250
|
-
e?.download_url && await
|
|
250
|
+
e?.download_url && await k(e.download_url, e.filename);
|
|
251
251
|
} catch (e) {
|
|
252
|
-
|
|
252
|
+
r(e) ? (m(!0), g("Artifact unavailable")) : g(e instanceof Error ? e.message : String(e));
|
|
253
253
|
} finally {
|
|
254
|
-
|
|
254
|
+
c(!1);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
async function
|
|
258
|
-
if (
|
|
259
|
-
u(!0),
|
|
257
|
+
async function b() {
|
|
258
|
+
if (i.download_url) {
|
|
259
|
+
u(!0), g(null);
|
|
260
260
|
try {
|
|
261
|
-
await
|
|
261
|
+
await k(i.download_url, i.filename);
|
|
262
262
|
} catch (e) {
|
|
263
|
-
|
|
263
|
+
r(e) ? (m(!0), g("Artifact unavailable")) : g(e instanceof Error ? e.message : String(e));
|
|
264
264
|
} finally {
|
|
265
265
|
u(!1);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
270
|
-
|
|
269
|
+
async function ee() {
|
|
270
|
+
f(!0), g(null);
|
|
271
271
|
try {
|
|
272
|
-
await
|
|
273
|
-
...
|
|
274
|
-
template_code:
|
|
275
|
-
template_source:
|
|
276
|
-
output_format:
|
|
277
|
-
}), await
|
|
272
|
+
await T("document.generate", {
|
|
273
|
+
...i.input ?? {},
|
|
274
|
+
template_code: i.template_code,
|
|
275
|
+
template_source: i.template_source,
|
|
276
|
+
output_format: i.output_format
|
|
277
|
+
}), await a.invalidateQueries({ queryKey: [
|
|
278
278
|
j,
|
|
279
279
|
t,
|
|
280
280
|
n
|
|
281
281
|
] });
|
|
282
282
|
} catch (e) {
|
|
283
|
-
|
|
283
|
+
g(e instanceof Error ? e.message : String(e));
|
|
284
284
|
} finally {
|
|
285
|
-
|
|
285
|
+
f(!1);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
return /* @__PURE__ */ B("div", {
|
|
@@ -306,7 +306,7 @@ function at({ entityCode: t, objectId: n, doc: r }) {
|
|
|
306
306
|
textOverflow: "ellipsis",
|
|
307
307
|
whiteSpace: "nowrap"
|
|
308
308
|
},
|
|
309
|
-
children:
|
|
309
|
+
children: _
|
|
310
310
|
}),
|
|
311
311
|
/* @__PURE__ */ B("div", {
|
|
312
312
|
style: {
|
|
@@ -318,60 +318,60 @@ function at({ entityCode: t, objectId: n, doc: r }) {
|
|
|
318
318
|
fontSize: 11.5
|
|
319
319
|
},
|
|
320
320
|
children: [
|
|
321
|
-
/* @__PURE__ */ z("span", { children:
|
|
322
|
-
/* @__PURE__ */ z("span", { children:
|
|
323
|
-
/* @__PURE__ */ z("span", { children:
|
|
321
|
+
/* @__PURE__ */ z("span", { children: i.output_format.toUpperCase() }),
|
|
322
|
+
/* @__PURE__ */ z("span", { children: p ? "artifact unavailable" : i.status }),
|
|
323
|
+
/* @__PURE__ */ z("span", { children: i.ready_at || i.created_at })
|
|
324
324
|
]
|
|
325
325
|
}),
|
|
326
|
-
|
|
326
|
+
i.status === "failed" && i.error_text && /* @__PURE__ */ z("div", {
|
|
327
327
|
style: {
|
|
328
328
|
marginTop: 5,
|
|
329
329
|
color: "var(--danger)",
|
|
330
330
|
fontSize: 12
|
|
331
331
|
},
|
|
332
|
-
children:
|
|
332
|
+
children: i.error_text
|
|
333
333
|
}),
|
|
334
|
-
|
|
334
|
+
h && /* @__PURE__ */ z("div", {
|
|
335
335
|
style: {
|
|
336
336
|
marginTop: 5,
|
|
337
337
|
color: "var(--danger)",
|
|
338
338
|
fontSize: 12
|
|
339
339
|
},
|
|
340
|
-
children:
|
|
340
|
+
children: h
|
|
341
341
|
})
|
|
342
342
|
]
|
|
343
|
-
}),
|
|
343
|
+
}), v ? /* @__PURE__ */ B("div", {
|
|
344
344
|
style: {
|
|
345
345
|
display: "flex",
|
|
346
346
|
gap: 6
|
|
347
347
|
},
|
|
348
|
-
children: [/* @__PURE__ */ z(
|
|
348
|
+
children: [/* @__PURE__ */ z(o, {
|
|
349
349
|
kind: "ghost",
|
|
350
350
|
size: "sm",
|
|
351
|
-
icon: z(
|
|
352
|
-
onClick:
|
|
353
|
-
disabled:
|
|
351
|
+
icon: z(s ? e.loader : e.file, { size: 12 }),
|
|
352
|
+
onClick: y,
|
|
353
|
+
disabled: s,
|
|
354
354
|
children: "PDF"
|
|
355
|
-
}), /* @__PURE__ */ z(
|
|
355
|
+
}), /* @__PURE__ */ z(o, {
|
|
356
356
|
kind: "default",
|
|
357
357
|
size: "sm",
|
|
358
|
-
icon: z(
|
|
359
|
-
onClick:
|
|
360
|
-
disabled:
|
|
358
|
+
icon: z(l ? e.loader : e.download, { size: 12 }),
|
|
359
|
+
onClick: b,
|
|
360
|
+
disabled: l,
|
|
361
361
|
children: "Download"
|
|
362
362
|
})]
|
|
363
|
-
}) :
|
|
363
|
+
}) : p ? /* @__PURE__ */ z(o, {
|
|
364
364
|
kind: "ghost",
|
|
365
365
|
size: "sm",
|
|
366
|
-
icon: z(
|
|
367
|
-
onClick:
|
|
368
|
-
disabled:
|
|
366
|
+
icon: z(d ? e.loader : e.file, { size: 12 }),
|
|
367
|
+
onClick: ee,
|
|
368
|
+
disabled: d,
|
|
369
369
|
children: "Regenerate"
|
|
370
|
-
}) : /* @__PURE__ */ z(
|
|
370
|
+
}) : /* @__PURE__ */ z(o, {
|
|
371
371
|
kind: "ghost",
|
|
372
372
|
size: "sm",
|
|
373
373
|
disabled: !0,
|
|
374
|
-
children:
|
|
374
|
+
children: i.status === "pending" ? "Pending" : "Unavailable"
|
|
375
375
|
})]
|
|
376
376
|
});
|
|
377
377
|
}
|
|
@@ -513,20 +513,20 @@ function st({ items: e }) {
|
|
|
513
513
|
}
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region src/components/detail-layout/DetailHighlights.tsx
|
|
516
|
-
function ct({ screen: e, entity: t, entityCode: n, record: r, refs:
|
|
517
|
-
let
|
|
518
|
-
if (!
|
|
519
|
-
let
|
|
520
|
-
for (let e of
|
|
521
|
-
let
|
|
522
|
-
if (
|
|
523
|
-
let t =
|
|
524
|
-
|
|
525
|
-
label:
|
|
526
|
-
value: n ? /* @__PURE__ */ z(
|
|
516
|
+
function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
|
|
517
|
+
let c = e.highlights;
|
|
518
|
+
if (!c || c.length === 0) return null;
|
|
519
|
+
let l = [];
|
|
520
|
+
for (let e of c) {
|
|
521
|
+
let c = t.status_groups?.[e];
|
|
522
|
+
if (c) {
|
|
523
|
+
let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
|
|
524
|
+
l.push({
|
|
525
|
+
label: E(c.name),
|
|
526
|
+
value: n ? /* @__PURE__ */ z(d, {
|
|
527
527
|
tone: n.color ?? "slate",
|
|
528
528
|
size: "xs",
|
|
529
|
-
children:
|
|
529
|
+
children: E(n.name)
|
|
530
530
|
}) : /* @__PURE__ */ z("span", {
|
|
531
531
|
style: { color: "var(--text-4)" },
|
|
532
532
|
children: "—"
|
|
@@ -535,26 +535,26 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: a, objectSta
|
|
|
535
535
|
continue;
|
|
536
536
|
}
|
|
537
537
|
if (t.fields.get(e) || t.files?.get(e)) {
|
|
538
|
-
let
|
|
538
|
+
let a = je({
|
|
539
539
|
entity: t,
|
|
540
540
|
entityCode: n,
|
|
541
541
|
fieldName: e,
|
|
542
542
|
record: r,
|
|
543
543
|
mode: "display",
|
|
544
|
-
refs:
|
|
545
|
-
entities:
|
|
546
|
-
screens:
|
|
544
|
+
refs: i,
|
|
545
|
+
entities: o.entities,
|
|
546
|
+
screens: o.screens,
|
|
547
547
|
surface: "list",
|
|
548
|
-
locale:
|
|
548
|
+
locale: s
|
|
549
549
|
});
|
|
550
|
-
|
|
551
|
-
label: Le(t, e,
|
|
552
|
-
value:
|
|
550
|
+
l.push({
|
|
551
|
+
label: Le(t, e, o.entities),
|
|
552
|
+
value: a
|
|
553
553
|
});
|
|
554
554
|
continue;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
return
|
|
557
|
+
return l.length === 0 ? null : /* @__PURE__ */ z(st, { items: l });
|
|
558
558
|
}
|
|
559
559
|
//#endregion
|
|
560
560
|
//#region src/components/shared/AuditMetaStrip.tsx
|
|
@@ -640,7 +640,7 @@ function ut({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
640
640
|
});
|
|
641
641
|
};
|
|
642
642
|
return /* @__PURE__ */ z(lt, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
|
|
643
|
-
label:
|
|
643
|
+
label: E(e.label),
|
|
644
644
|
at: c(e.at),
|
|
645
645
|
by: c(e.by)
|
|
646
646
|
})) : [{
|
|
@@ -655,30 +655,30 @@ function ut({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
655
655
|
}
|
|
656
656
|
//#endregion
|
|
657
657
|
//#region src/components/shared/RecordHeader.tsx
|
|
658
|
-
function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, highlights:
|
|
659
|
-
let
|
|
658
|
+
function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, highlights: s, mode: c, dirty: l = !1, showBack: u = !1, onBack: f, right: p, showTitle: m = !0 }) {
|
|
659
|
+
let h = ae(), g = h.category === "phone" || h.width <= 520;
|
|
660
660
|
return /* @__PURE__ */ B("div", {
|
|
661
661
|
style: {
|
|
662
662
|
display: "flex",
|
|
663
663
|
alignItems: "flex-start",
|
|
664
664
|
gap: 10,
|
|
665
|
-
flexWrap:
|
|
665
|
+
flexWrap: g ? "wrap" : "nowrap",
|
|
666
666
|
minWidth: 0
|
|
667
667
|
},
|
|
668
668
|
children: [
|
|
669
|
-
|
|
669
|
+
m && u && /* @__PURE__ */ z("div", {
|
|
670
670
|
style: {
|
|
671
671
|
paddingTop: 4,
|
|
672
672
|
flexShrink: 0
|
|
673
673
|
},
|
|
674
|
-
children: /* @__PURE__ */ z(
|
|
674
|
+
children: /* @__PURE__ */ z(i, {
|
|
675
675
|
size: 26,
|
|
676
676
|
icon: /* @__PURE__ */ z(e.back, { size: 14 }),
|
|
677
677
|
title: "Back",
|
|
678
|
-
onClick:
|
|
678
|
+
onClick: f
|
|
679
679
|
})
|
|
680
680
|
}),
|
|
681
|
-
|
|
681
|
+
m && (n || t) && /* @__PURE__ */ z("div", {
|
|
682
682
|
style: {
|
|
683
683
|
flexShrink: 0,
|
|
684
684
|
paddingTop: 2
|
|
@@ -700,7 +700,7 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
|
|
|
700
700
|
children: t
|
|
701
701
|
})
|
|
702
702
|
}),
|
|
703
|
-
|
|
703
|
+
m && /* @__PURE__ */ B("div", {
|
|
704
704
|
style: {
|
|
705
705
|
flex: "1 1 0",
|
|
706
706
|
minWidth: 0
|
|
@@ -724,7 +724,7 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
|
|
|
724
724
|
minWidth: 0,
|
|
725
725
|
overflow: "hidden",
|
|
726
726
|
textOverflow: "ellipsis",
|
|
727
|
-
whiteSpace:
|
|
727
|
+
whiteSpace: g ? "normal" : "nowrap",
|
|
728
728
|
overflowWrap: "anywhere",
|
|
729
729
|
maxWidth: "100%"
|
|
730
730
|
},
|
|
@@ -735,7 +735,7 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
|
|
|
735
735
|
label: o,
|
|
736
736
|
"data-testid": "detail-description-info"
|
|
737
737
|
}),
|
|
738
|
-
|
|
738
|
+
c === "edit" && l && /* @__PURE__ */ B("span", {
|
|
739
739
|
style: {
|
|
740
740
|
display: "inline-flex",
|
|
741
741
|
alignItems: "center",
|
|
@@ -750,31 +750,31 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
|
|
|
750
750
|
background: "var(--warn)"
|
|
751
751
|
} }), "Unsaved"]
|
|
752
752
|
}),
|
|
753
|
-
|
|
753
|
+
c === "create" && /* @__PURE__ */ z(d, {
|
|
754
754
|
tone: "violet",
|
|
755
755
|
size: "xs",
|
|
756
756
|
dot: !0,
|
|
757
757
|
children: "New record"
|
|
758
758
|
})
|
|
759
759
|
]
|
|
760
|
-
}),
|
|
760
|
+
}), s && c === "display" && /* @__PURE__ */ z("div", {
|
|
761
761
|
style: { marginTop: 8 },
|
|
762
|
-
children:
|
|
762
|
+
children: s
|
|
763
763
|
})]
|
|
764
764
|
}),
|
|
765
|
-
|
|
765
|
+
p && /* @__PURE__ */ z("div", {
|
|
766
766
|
role: "toolbar",
|
|
767
767
|
"aria-label": "Page actions",
|
|
768
768
|
style: {
|
|
769
769
|
display: "flex",
|
|
770
770
|
alignItems: "center",
|
|
771
771
|
gap: 6,
|
|
772
|
-
flex:
|
|
772
|
+
flex: g ? "1 1 100%" : "1 1 auto",
|
|
773
773
|
flexWrap: "wrap",
|
|
774
|
-
justifyContent:
|
|
774
|
+
justifyContent: g ? "flex-start" : "flex-end",
|
|
775
775
|
minWidth: 0
|
|
776
776
|
},
|
|
777
|
-
children:
|
|
777
|
+
children: p
|
|
778
778
|
})
|
|
779
779
|
]
|
|
780
780
|
});
|
|
@@ -838,28 +838,28 @@ function _t(e, t) {
|
|
|
838
838
|
}
|
|
839
839
|
function vt(e, t) {
|
|
840
840
|
if (e) {
|
|
841
|
-
let n =
|
|
841
|
+
let n = C(re(e, t));
|
|
842
842
|
if (n.replace(/^\|+|\|+$/g, "")) return n;
|
|
843
843
|
}
|
|
844
|
-
return t.id == null ? crypto.randomUUID() :
|
|
844
|
+
return t.id == null ? crypto.randomUUID() : _(t.id);
|
|
845
845
|
}
|
|
846
846
|
function yt({ screenCode: e }) {
|
|
847
|
-
return /* @__PURE__ */ z(
|
|
847
|
+
return /* @__PURE__ */ z(O, { children: /* @__PURE__ */ z(K, { screenCode: e }) });
|
|
848
848
|
}
|
|
849
849
|
function K({ screenCode: t }) {
|
|
850
|
-
let { id:
|
|
850
|
+
let { id: r } = Ye(), o = u(), [c, d] = Xe(), { data: _ } = ee(), b = m((e) => e.user), x = g(), S = ae(), w = _?.screens[t], T = w?.entity ? _?.entities[w.entity] : void 0, D = w?.entity, O = h(T, "create"), k = h(T, "update"), oe = h(T, "delete"), se = h(T, "restore"), ce = (() => {
|
|
851
851
|
if (!T || !T.singleton || !T.prefilter) return;
|
|
852
|
-
let e =
|
|
852
|
+
let e = ne(T);
|
|
853
853
|
if (e.length !== 1) return;
|
|
854
854
|
let t = T.prefilter[e[0]];
|
|
855
|
-
if (t === "$caller.user_id") return
|
|
856
|
-
if (t === "$caller.tenant_id") return
|
|
857
|
-
})(), A = ce !== void 0, j = A ? ce :
|
|
855
|
+
if (t === "$caller.user_id") return b?.id;
|
|
856
|
+
if (t === "$caller.tenant_id") return b?.tenant?.id;
|
|
857
|
+
})(), A = ce !== void 0, j = A ? ce : r, M = !A && j === "new", N = L(() => {
|
|
858
858
|
if (!j || M) return;
|
|
859
859
|
if (!T) return j;
|
|
860
|
-
let e =
|
|
860
|
+
let e = ne(T);
|
|
861
861
|
if (e.length === 1) return { [e[0]]: j };
|
|
862
|
-
let t =
|
|
862
|
+
let t = y(j, e.length);
|
|
863
863
|
if (!t) return;
|
|
864
864
|
let n = {};
|
|
865
865
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
@@ -869,11 +869,11 @@ function K({ screenCode: t }) {
|
|
|
869
869
|
M,
|
|
870
870
|
T
|
|
871
871
|
]), ge = L(() => {
|
|
872
|
-
if (N) return typeof N == "string" ? N :
|
|
873
|
-
}, [N]), P = ke(
|
|
874
|
-
pe(Ne(
|
|
875
|
-
let Le = ve(
|
|
876
|
-
|
|
872
|
+
if (N) return typeof N == "string" ? N : C(N);
|
|
873
|
+
}, [N]), P = ke(D, N), { data: be, isLoading: xe, error: Ce } = P, Ae = Fe((e) => e.degradedEntities), je = D ? ye(T?.realtime, Ae, D) : !1;
|
|
874
|
+
pe(Ne(D, N), !M);
|
|
875
|
+
let Le = ve(D ?? ""), Be = _e(D ?? ""), Ve = we(D ?? ""), He = Te(D ?? ""), Ue = Object.keys(T?.status_groups ?? {}).length > 0, Ke = be?.data, Ze = Ke?.$statuses, Qe = Ke?.$properties, tt = c.get("edit") === "true", [nt, rt] = R(M || tt), [V, at] = R({}), [H, st] = R({}), [U, lt] = R({}), [W, G] = R(void 0), [ft, mt] = R(!1), [yt, K] = R(void 0), [xt, St] = R({ show: !1 }), [wt, Tt] = R(!1), Et = M ? O : k, q = nt && Et, Dt = n();
|
|
876
|
+
p(q && !M, Dt.enabled);
|
|
877
877
|
let [Ot, kt] = R(() => {
|
|
878
878
|
let e = parseInt(w?.sidebar_width || "380", 10);
|
|
879
879
|
return isNaN(e) ? 380 : e;
|
|
@@ -902,7 +902,7 @@ function K({ screenCode: t }) {
|
|
|
902
902
|
}, [nt, X]);
|
|
903
903
|
let Pt = !!T?.soft_delete, Ft = Pt && Y != null && Y[T.soft_delete] != null, Z = Je(), It = qe(null);
|
|
904
904
|
fe({ scrollElementRef: It });
|
|
905
|
-
let Lt = !M && Ce instanceof
|
|
905
|
+
let Lt = !M && Ce instanceof f && Ce.status === 404, Rt = qe(null);
|
|
906
906
|
I(() => {
|
|
907
907
|
if (!Lt) return;
|
|
908
908
|
let e = le(Z);
|
|
@@ -911,7 +911,7 @@ function K({ screenCode: t }) {
|
|
|
911
911
|
let { openTab: zt, updateTabTitle: Bt, findTabByPathname: Vt } = Re();
|
|
912
912
|
I(() => {
|
|
913
913
|
if (!T || A || Dt.enabled) return;
|
|
914
|
-
let e = Z.pathname, t =
|
|
914
|
+
let e = Z.pathname, t = E(w?.display?.name) || E(T.display.name), n = w?.display?.icon || T.display.icon;
|
|
915
915
|
Vt(e) || zt({
|
|
916
916
|
pathname: e,
|
|
917
917
|
search: "",
|
|
@@ -932,7 +932,7 @@ function K({ screenCode: t }) {
|
|
|
932
932
|
if (!Y || !T || A || Dt.enabled) return;
|
|
933
933
|
let e = Vt(Z.pathname);
|
|
934
934
|
if (e) {
|
|
935
|
-
let t =
|
|
935
|
+
let t = E(w?.display?.name) || E(T.display.name), n = v(Y, T), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
936
936
|
Bt(e.id, r);
|
|
937
937
|
}
|
|
938
938
|
}, [
|
|
@@ -960,9 +960,9 @@ function K({ screenCode: t }) {
|
|
|
960
960
|
record: void 0,
|
|
961
961
|
isNew: !0
|
|
962
962
|
})).forEach((e) => {
|
|
963
|
-
|
|
963
|
+
x.registerDraft({
|
|
964
964
|
fileId: e,
|
|
965
|
-
discard: () =>
|
|
965
|
+
discard: () => l(e)
|
|
966
966
|
});
|
|
967
967
|
});
|
|
968
968
|
let t = {};
|
|
@@ -1011,12 +1011,12 @@ function K({ screenCode: t }) {
|
|
|
1011
1011
|
T?.children
|
|
1012
1012
|
]);
|
|
1013
1013
|
let Ut = F(async () => {
|
|
1014
|
-
if (await
|
|
1014
|
+
if (await x.flushAllDrafts(), M) {
|
|
1015
1015
|
let e = w?.route?.replace("/:id", "") ?? "/";
|
|
1016
1016
|
o(e);
|
|
1017
1017
|
} else rt(!1), at({}), st({}), lt({}), G(void 0), K(void 0), Tt(!1);
|
|
1018
1018
|
}, [
|
|
1019
|
-
|
|
1019
|
+
x,
|
|
1020
1020
|
M,
|
|
1021
1021
|
w,
|
|
1022
1022
|
o
|
|
@@ -1053,7 +1053,7 @@ function K({ screenCode: t }) {
|
|
|
1053
1053
|
M,
|
|
1054
1054
|
Ht
|
|
1055
1055
|
]), Xt = Object.keys(Yt).length > 0, Zt = F(() => {
|
|
1056
|
-
if (!
|
|
1056
|
+
if (!D || !T || M && !O || !M && !k || (Tt(!0), Xt)) return;
|
|
1057
1057
|
let e = {}, t = Ee({
|
|
1058
1058
|
entity: T,
|
|
1059
1059
|
formData: V,
|
|
@@ -1098,26 +1098,26 @@ function K({ screenCode: t }) {
|
|
|
1098
1098
|
rt(!1), mt(!1), Tt(!1), st({}), lt({}), G(void 0), K(void 0);
|
|
1099
1099
|
};
|
|
1100
1100
|
M ? Le.mutate(e, { onSuccess: (e) => {
|
|
1101
|
-
n.forEach((e) =>
|
|
1102
|
-
let t = e.data, i =
|
|
1101
|
+
n.forEach((e) => x.markCommitted(e));
|
|
1102
|
+
let t = e.data, i = C(T ? re(T, t) : {});
|
|
1103
1103
|
o(i ? `${Q}/${encodeURIComponent(i)}` : Q, { replace: !0 }), r();
|
|
1104
1104
|
} }) : N && Be.mutate({
|
|
1105
1105
|
pkValues: N,
|
|
1106
1106
|
data: e
|
|
1107
1107
|
}, {
|
|
1108
1108
|
onSuccess: () => {
|
|
1109
|
-
n.forEach((e) =>
|
|
1109
|
+
n.forEach((e) => x.markCommitted(e)), r();
|
|
1110
1110
|
},
|
|
1111
1111
|
onError: (e) => {
|
|
1112
|
-
e instanceof
|
|
1112
|
+
e instanceof f && e.code === "STALE_OBJECT" && mt(!0);
|
|
1113
1113
|
}
|
|
1114
1114
|
});
|
|
1115
1115
|
}, [
|
|
1116
|
-
|
|
1116
|
+
x,
|
|
1117
1117
|
M,
|
|
1118
1118
|
O,
|
|
1119
1119
|
k,
|
|
1120
|
-
|
|
1120
|
+
D,
|
|
1121
1121
|
V,
|
|
1122
1122
|
Xt,
|
|
1123
1123
|
H,
|
|
@@ -1168,7 +1168,7 @@ function K({ screenCode: t }) {
|
|
|
1168
1168
|
gap: 8,
|
|
1169
1169
|
marginBottom: 8
|
|
1170
1170
|
},
|
|
1171
|
-
children: [qt && /* @__PURE__ */ z(
|
|
1171
|
+
children: [qt && /* @__PURE__ */ z(i, {
|
|
1172
1172
|
icon: /* @__PURE__ */ z(e.back, { size: 14 }),
|
|
1173
1173
|
onClick: Kt.goBack,
|
|
1174
1174
|
title: "Back"
|
|
@@ -1186,13 +1186,13 @@ function K({ screenCode: t }) {
|
|
|
1186
1186
|
children: "Record not found."
|
|
1187
1187
|
})]
|
|
1188
1188
|
});
|
|
1189
|
-
let rn = T.display, an =
|
|
1189
|
+
let rn = T.display, an = E(w.display?.name) || E(rn.name), on = v(Y, T), sn = M ? `New ${an}` : on ? String(on) : an, cn = Le.isPending || Be.isPending, ln = w.responsive?.[S.category]?.layout, un = ln?.tabs ?? (S.isPhone ? "sections" : void 0), dn = ln?.header_card === !0 ? Ie({
|
|
1190
1190
|
entity: T,
|
|
1191
1191
|
screen: w
|
|
1192
1192
|
}) : void 0, $ = {
|
|
1193
1193
|
schema: _,
|
|
1194
1194
|
entity: T,
|
|
1195
|
-
entityCode:
|
|
1195
|
+
entityCode: D,
|
|
1196
1196
|
recordId: ge ?? j ?? "",
|
|
1197
1197
|
record: q ? {
|
|
1198
1198
|
...Y ?? {},
|
|
@@ -1229,11 +1229,11 @@ function K({ screenCode: t }) {
|
|
|
1229
1229
|
...e,
|
|
1230
1230
|
status_code: H[e.group_code]
|
|
1231
1231
|
});
|
|
1232
|
-
for (let [
|
|
1233
|
-
group_code:
|
|
1234
|
-
status_code:
|
|
1232
|
+
for (let [n, r] of Object.entries(H)) e.some((e) => e.group_code === n) || t.push({
|
|
1233
|
+
group_code: n,
|
|
1234
|
+
status_code: r,
|
|
1235
1235
|
status_name: {},
|
|
1236
|
-
set_at:
|
|
1236
|
+
set_at: s()
|
|
1237
1237
|
});
|
|
1238
1238
|
return t;
|
|
1239
1239
|
})(),
|
|
@@ -1248,10 +1248,10 @@ function K({ screenCode: t }) {
|
|
|
1248
1248
|
fieldErrors: q && wt ? Yt : void 0,
|
|
1249
1249
|
detailTabsPresentation: un,
|
|
1250
1250
|
relatedRecordsPresentation: ln?.related_records
|
|
1251
|
-
}, fn = !!w.sidebar && w.sidebar.length > 0, pn = ln?.sidebar === "hidden", mn = fn && !pn && !
|
|
1251
|
+
}, fn = !!w.sidebar && w.sidebar.length > 0, pn = ln?.sidebar === "hidden", mn = fn && !pn && !S.isDesktop, hn = fn && !pn && S.isDesktop, gn = !M && Y ? /* @__PURE__ */ z(ct, {
|
|
1252
1252
|
screen: w,
|
|
1253
1253
|
entity: T,
|
|
1254
|
-
entityCode:
|
|
1254
|
+
entityCode: D,
|
|
1255
1255
|
record: Y,
|
|
1256
1256
|
refs: Mt,
|
|
1257
1257
|
objectStatuses: Ze,
|
|
@@ -1271,7 +1271,7 @@ function K({ screenCode: t }) {
|
|
|
1271
1271
|
entity: T,
|
|
1272
1272
|
screen: w,
|
|
1273
1273
|
globalActions: _?.actions,
|
|
1274
|
-
entityCode:
|
|
1274
|
+
entityCode: D,
|
|
1275
1275
|
record: Y,
|
|
1276
1276
|
id: j,
|
|
1277
1277
|
listRoute: Q,
|
|
@@ -1304,7 +1304,7 @@ function K({ screenCode: t }) {
|
|
|
1304
1304
|
color: "var(--danger)",
|
|
1305
1305
|
fontSize: 12.5
|
|
1306
1306
|
},
|
|
1307
|
-
children: [/* @__PURE__ */ z(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: ["This record was deleted on ",
|
|
1307
|
+
children: [/* @__PURE__ */ z(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: ["This record was deleted on ", a(String(Y[T.soft_delete]))] })]
|
|
1308
1308
|
}), yn = ft && /* @__PURE__ */ B("div", {
|
|
1309
1309
|
style: {
|
|
1310
1310
|
display: "flex",
|
|
@@ -1324,12 +1324,12 @@ function K({ screenCode: t }) {
|
|
|
1324
1324
|
let n = T.fields.get(e);
|
|
1325
1325
|
return {
|
|
1326
1326
|
name: e,
|
|
1327
|
-
label: n ?
|
|
1327
|
+
label: n ? ie(n, e, _?.entities) : e,
|
|
1328
1328
|
message: t
|
|
1329
1329
|
};
|
|
1330
1330
|
}),
|
|
1331
1331
|
onJump: (e) => {
|
|
1332
|
-
let t = document.getElementById(`${
|
|
1332
|
+
let t = document.getElementById(`${D}-${e}`);
|
|
1333
1333
|
t && (t.scrollIntoView({
|
|
1334
1334
|
block: "center",
|
|
1335
1335
|
behavior: "smooth"
|
|
@@ -1359,14 +1359,14 @@ function K({ screenCode: t }) {
|
|
|
1359
1359
|
nodes: w.items,
|
|
1360
1360
|
ctx: $
|
|
1361
1361
|
}),
|
|
1362
|
-
!M && j &&
|
|
1363
|
-
entityCode:
|
|
1362
|
+
!M && j && D && T.associations && Object.keys(T.associations).length > 0 && _ && /* @__PURE__ */ z(et, {
|
|
1363
|
+
entityCode: D,
|
|
1364
1364
|
recordId: ge ?? j ?? "",
|
|
1365
1365
|
associations: T.associations,
|
|
1366
1366
|
schema: _
|
|
1367
1367
|
}),
|
|
1368
|
-
!M && j &&
|
|
1369
|
-
entityCode:
|
|
1368
|
+
!M && j && D && /* @__PURE__ */ z(it, {
|
|
1369
|
+
entityCode: D,
|
|
1370
1370
|
objectId: ge ?? j,
|
|
1371
1371
|
canGenerateOne: !!T?.documents?.generate_one,
|
|
1372
1372
|
canManageTemplates: de(_)
|
|
@@ -1374,7 +1374,7 @@ function K({ screenCode: t }) {
|
|
|
1374
1374
|
!M && Y && _ && /* @__PURE__ */ z(ut, {
|
|
1375
1375
|
screen: w,
|
|
1376
1376
|
entity: T,
|
|
1377
|
-
entityCode:
|
|
1377
|
+
entityCode: D,
|
|
1378
1378
|
record: Y,
|
|
1379
1379
|
refs: Mt,
|
|
1380
1380
|
schema: _,
|
|
@@ -1460,7 +1460,7 @@ function K({ screenCode: t }) {
|
|
|
1460
1460
|
Cn
|
|
1461
1461
|
]
|
|
1462
1462
|
});
|
|
1463
|
-
let wn =
|
|
1463
|
+
let wn = S.isPhone ? 12 : 24;
|
|
1464
1464
|
return /* @__PURE__ */ B("div", {
|
|
1465
1465
|
style: {
|
|
1466
1466
|
height: "100%",
|
|
@@ -1473,7 +1473,7 @@ function K({ screenCode: t }) {
|
|
|
1473
1473
|
/* @__PURE__ */ B("div", {
|
|
1474
1474
|
style: {
|
|
1475
1475
|
flexShrink: 0,
|
|
1476
|
-
padding:
|
|
1476
|
+
padding: S.isPhone ? "14px 12px 8px" : "24px 24px 8px"
|
|
1477
1477
|
},
|
|
1478
1478
|
children: [
|
|
1479
1479
|
_n,
|
|
@@ -1517,11 +1517,11 @@ function K({ screenCode: t }) {
|
|
|
1517
1517
|
function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
1518
1518
|
let a = (e) => {
|
|
1519
1519
|
let a = xt(t, e, n, r, i);
|
|
1520
|
-
return a != null &&
|
|
1521
|
-
}, o = (e) =>
|
|
1520
|
+
return a != null && _(a) !== "";
|
|
1521
|
+
}, o = (e) => _(xt(t, e, n, r, i)) || /* @__PURE__ */ z("span", {
|
|
1522
1522
|
style: { color: "var(--text-3)" },
|
|
1523
1523
|
children: "-"
|
|
1524
|
-
}), s =
|
|
1524
|
+
}), s = _(e.titleUsesDisplay ? v(n, t) : e.titleField ? xt(t, e.titleField, n, r, i) : void 0) || E(t.display?.name) || "Record", c = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), l = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
|
|
1525
1525
|
return /* @__PURE__ */ B("section", {
|
|
1526
1526
|
"data-testid": "detail-header-card",
|
|
1527
1527
|
style: {
|
|
@@ -1631,7 +1631,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1631
1631
|
function xt(e, t, n, r, i) {
|
|
1632
1632
|
if (t.startsWith("$status.")) {
|
|
1633
1633
|
let e = t.slice(8), n = r?.find((t) => t.group_code === e);
|
|
1634
|
-
return
|
|
1634
|
+
return E(n?.status_name) || n?.status_code;
|
|
1635
1635
|
}
|
|
1636
1636
|
if (t.startsWith("$property.")) {
|
|
1637
1637
|
let e = t.slice(10);
|
|
@@ -1643,18 +1643,18 @@ function St(e, t) {
|
|
|
1643
1643
|
if (t.startsWith("$status.")) return t.slice(8);
|
|
1644
1644
|
if (t.startsWith("$property.")) return t.slice(10);
|
|
1645
1645
|
let n = e.fields.get(t);
|
|
1646
|
-
return n ?
|
|
1646
|
+
return n ? ie(n, t) : t;
|
|
1647
1647
|
}
|
|
1648
|
-
function Ct({ title: n, recordId:
|
|
1649
|
-
let { run: ce } =
|
|
1650
|
-
if (!
|
|
1651
|
-
let e =
|
|
1648
|
+
function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, dirty: l, isSaving: d, hasChildErrors: f, hasFieldErrors: p, canRestore: m, entity: h, screen: g, globalActions: _, entityCode: v, record: y, id: b, listRoute: ee, listRouteExists: ne, highlights: S, showBack: C, onBack: re, onCancelEdit: ie, onSave: D, onRestore: O, isRestoring: k, refreshControl: ae, isRealtimeEntity: oe, canManageTemplates: se }) {
|
|
1649
|
+
let { run: ce } = x(), j = A("detail"), ue = Ae(), de = u(), fe = te(), pe = Be(g?.action_layout, h?.action_layout, h?.actions, _, "detail_toolbar"), he = be(Be(g?.action_layout, h?.action_layout, h?.actions, _, "detail"), h?.actions, _, y ?? {}, []), _e = be(pe, h?.actions, _, y ?? {}, []), ve = L(() => {
|
|
1650
|
+
if (!h) return;
|
|
1651
|
+
let e = b ? [b] : [];
|
|
1652
1652
|
return {
|
|
1653
|
-
entity:
|
|
1654
|
-
entityCode:
|
|
1655
|
-
screen:
|
|
1656
|
-
screenRoute:
|
|
1657
|
-
selectedRows:
|
|
1653
|
+
entity: h,
|
|
1654
|
+
entityCode: v ?? "",
|
|
1655
|
+
screen: g,
|
|
1656
|
+
screenRoute: g?.route ?? "",
|
|
1657
|
+
selectedRows: y ? [y] : [],
|
|
1658
1658
|
selectedIds: e,
|
|
1659
1659
|
locale: fe,
|
|
1660
1660
|
tabNavigate: (e, t) => ue(e, {
|
|
@@ -1662,41 +1662,41 @@ function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1662
1662
|
icon: t?.icon,
|
|
1663
1663
|
search: t?.search
|
|
1664
1664
|
}),
|
|
1665
|
-
runActionApi: (e, t) =>
|
|
1665
|
+
runActionApi: (e, t) => T(e, t)
|
|
1666
1666
|
};
|
|
1667
1667
|
}, [
|
|
1668
|
-
m,
|
|
1669
|
-
y,
|
|
1670
1668
|
h,
|
|
1671
|
-
|
|
1669
|
+
v,
|
|
1670
|
+
g,
|
|
1672
1671
|
b,
|
|
1672
|
+
y,
|
|
1673
1673
|
fe,
|
|
1674
1674
|
ue
|
|
1675
1675
|
]), ye = (e, t) => {
|
|
1676
|
-
let n = ge(e, t, { row:
|
|
1676
|
+
let n = ge(e, t, { row: y ?? void 0 });
|
|
1677
1677
|
if (n === null) return;
|
|
1678
|
-
let r =
|
|
1678
|
+
let r = b ? [b] : [], i = e === "__delete" && ne ? ee : null;
|
|
1679
1679
|
return ce({
|
|
1680
1680
|
action: t,
|
|
1681
|
-
title:
|
|
1682
|
-
execute: (e) =>
|
|
1681
|
+
title: E(t.display?.name) || e,
|
|
1682
|
+
execute: (e) => T(n, w(e, r)),
|
|
1683
1683
|
onSuccess: i ? () => {
|
|
1684
1684
|
me.getState().kill(le(location)), de(i, { replace: !0 });
|
|
1685
1685
|
} : void 0
|
|
1686
1686
|
});
|
|
1687
|
-
}, P = j.isVisible("show_actions") && !
|
|
1687
|
+
}, P = j.isVisible("show_actions") && !a && b && he.length > 0 ? /* @__PURE__ */ z(xe, {
|
|
1688
1688
|
layout: he,
|
|
1689
|
-
row:
|
|
1689
|
+
row: y,
|
|
1690
1690
|
onRun: ye,
|
|
1691
1691
|
kind: "detail",
|
|
1692
|
-
entityActions:
|
|
1692
|
+
entityActions: h?.actions,
|
|
1693
1693
|
globalActions: _,
|
|
1694
1694
|
reservedRightWidth: 0,
|
|
1695
1695
|
widgetContext: ve
|
|
1696
|
-
}) : null, Se = !
|
|
1697
|
-
liveObject:
|
|
1696
|
+
}) : null, Se = !a && b ? /* @__PURE__ */ z(M, {
|
|
1697
|
+
liveObject: ae,
|
|
1698
1698
|
realtime: oe
|
|
1699
|
-
}) : null, Ce = j.isVisible("show_actions") && !
|
|
1699
|
+
}) : null, Ce = j.isVisible("show_actions") && !a && b && _e.length > 0 ? /* @__PURE__ */ B("div", {
|
|
1700
1700
|
style: {
|
|
1701
1701
|
display: "flex",
|
|
1702
1702
|
justifyContent: "flex-end",
|
|
@@ -1706,40 +1706,40 @@ function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1706
1706
|
},
|
|
1707
1707
|
children: [P ? null : Se, /* @__PURE__ */ z(xe, {
|
|
1708
1708
|
layout: _e,
|
|
1709
|
-
row:
|
|
1709
|
+
row: y,
|
|
1710
1710
|
onRun: ye,
|
|
1711
1711
|
kind: "detail",
|
|
1712
|
-
entityActions:
|
|
1712
|
+
entityActions: h?.actions,
|
|
1713
1713
|
globalActions: _,
|
|
1714
1714
|
reservedRightWidth: 0,
|
|
1715
1715
|
widgetContext: ve,
|
|
1716
1716
|
ariaLabel: P ? "Detail toolbar actions" : "Page actions"
|
|
1717
1717
|
})]
|
|
1718
|
-
}) : null, we = j.isVisible("show_actions") && !
|
|
1719
|
-
entityCode:
|
|
1718
|
+
}) : null, we = j.isVisible("show_actions") && !a && b && v ? /* @__PURE__ */ z(N, {
|
|
1719
|
+
entityCode: v,
|
|
1720
1720
|
scope: "detail",
|
|
1721
|
-
objectIds: [
|
|
1722
|
-
capability:
|
|
1721
|
+
objectIds: [b],
|
|
1722
|
+
capability: h?.documents,
|
|
1723
1723
|
canManageTemplates: se
|
|
1724
|
-
}) : null, Te = s ?
|
|
1724
|
+
}) : null, Te = s ? m ? /* @__PURE__ */ z(o, {
|
|
1725
1725
|
kind: "primary",
|
|
1726
|
-
icon: z(
|
|
1727
|
-
onClick:
|
|
1728
|
-
disabled:
|
|
1729
|
-
children:
|
|
1730
|
-
}) : null :
|
|
1726
|
+
icon: z(k ? c : e.refresh, { size: 13 }),
|
|
1727
|
+
onClick: O,
|
|
1728
|
+
disabled: k,
|
|
1729
|
+
children: k ? "Restoring…" : "Restore"
|
|
1730
|
+
}) : null : i ? /* @__PURE__ */ B($e, { children: [/* @__PURE__ */ z(o, {
|
|
1731
1731
|
icon: /* @__PURE__ */ z(e.x, { size: 13 }),
|
|
1732
|
-
onClick:
|
|
1733
|
-
disabled:
|
|
1732
|
+
onClick: ie,
|
|
1733
|
+
disabled: d,
|
|
1734
1734
|
children: "Cancel"
|
|
1735
|
-
}), /* @__PURE__ */ z(
|
|
1735
|
+
}), /* @__PURE__ */ z(o, {
|
|
1736
1736
|
kind: "primary",
|
|
1737
|
-
icon: z(
|
|
1738
|
-
onClick:
|
|
1739
|
-
disabled:
|
|
1740
|
-
title:
|
|
1741
|
-
children:
|
|
1742
|
-
})] }) : !
|
|
1737
|
+
icon: z(d ? c : e.save, { size: 13 }),
|
|
1738
|
+
onClick: D,
|
|
1739
|
+
disabled: d || f || p,
|
|
1740
|
+
title: f ? "Fix errors in child rows" : p ? "Fix the highlighted fields" : void 0,
|
|
1741
|
+
children: d ? "Saving…" : "Save"
|
|
1742
|
+
})] }) : !a && b ? P ? /* @__PURE__ */ B("span", {
|
|
1743
1743
|
style: { display: "contents" },
|
|
1744
1744
|
children: [
|
|
1745
1745
|
we,
|
|
@@ -1748,18 +1748,18 @@ function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1748
1748
|
]
|
|
1749
1749
|
}) : we : null;
|
|
1750
1750
|
return /* @__PURE__ */ B($e, { children: [/* @__PURE__ */ z(G, {
|
|
1751
|
-
icon:
|
|
1752
|
-
name:
|
|
1751
|
+
icon: h?.display.icon ? /* @__PURE__ */ z(t, {
|
|
1752
|
+
name: h.display.icon,
|
|
1753
1753
|
size: 16
|
|
1754
1754
|
}) : void 0,
|
|
1755
1755
|
title: n,
|
|
1756
|
-
description: g
|
|
1757
|
-
recordId:
|
|
1758
|
-
highlights:
|
|
1759
|
-
mode:
|
|
1760
|
-
dirty:
|
|
1761
|
-
showBack:
|
|
1762
|
-
onBack:
|
|
1756
|
+
description: E(g?.display?.description) || E(h?.display?.description),
|
|
1757
|
+
recordId: r,
|
|
1758
|
+
highlights: S,
|
|
1759
|
+
mode: a ? "create" : i ? "edit" : "display",
|
|
1760
|
+
dirty: l,
|
|
1761
|
+
showBack: C,
|
|
1762
|
+
onBack: re,
|
|
1763
1763
|
right: Te,
|
|
1764
1764
|
showTitle: j.isVisible("show_title")
|
|
1765
1765
|
}), Ce] });
|