@declarion/react 0.41.0 → 0.43.0
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-x_3rA4Rm.js → DraggableChildrenTable-G4Sw1XAD.js} +43 -43
- package/dist-lib/{Grid-CKvYZx69.js → Grid-CXn-IK3H.js} +2 -2
- package/dist-lib/{LayoutRenderer-Bxvllfdl.js → LayoutRenderer-DX8pFS5A.js} +906 -861
- package/dist-lib/MarkdownRenderer-CreI9x2m.js +85 -0
- package/dist-lib/{RefreshControl-Cxzbbj3F.js → RefreshControl-DFh0-gCb.js} +58 -60
- package/dist-lib/{SmartDetailPage.impl-RDaFEH3Y.js → SmartDetailPage.impl-K6Jj1-9z.js} +545 -545
- package/dist-lib/{SmartRecordListPage.impl-BDdULatb.js → SmartRecordListPage.impl-DQW_uVfL.js} +250 -250
- package/dist-lib/hooks/usePageStateTtl.d.ts +1 -1
- package/dist-lib/index.js +1216 -1216
- package/dist-lib/lib/brand-tokens.d.ts +1 -1
- package/dist-lib/lib/evidence-verdict.d.ts +0 -1
- package/dist-lib/lib/safe-url.d.ts +14 -0
- package/dist-lib/{registry-DsZmw4hy.js → registry-r4hiflwC.js} +501 -501
- package/dist-lib/testing.js +42 -42
- package/dist-lib/types/api.d.ts +1 -1
- package/dist-lib/{useCurrentScreen-D6LPBFOi.js → useCurrentScreen-CpQjVmrT.js} +1320 -1286
- package/dist-lib/{useProperties-DiwFyA4b.js → useProperties-CULxrNT4.js} +43 -43
- package/dist-lib/{value-BudY9GCn.js → value-fUHxMV4r.js} +20 -20
- package/package.json +12 -12
- package/dist-lib/MarkdownRenderer-BvWJ8pzN.js +0 -98
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
|
|
2
|
-
import {
|
|
3
|
-
import { E as
|
|
4
|
-
import { E as
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useLocation as
|
|
9
|
-
import { useQuery as
|
|
10
|
-
import { Fragment as
|
|
2
|
+
import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, En as l, F as u, Fn as d, In as f, L as p, N as m, On as h, Pn as g, Q as _, Sn as v, Xn as y, _ as b, bn as x, bt as S, cr as ee, dt as te, gt as C, i as w, it as ne, j as T, jt as re, lr as E, nr as ie, pt as ae, sr as oe, un as se, wn as D, wt as O, xn as ce, yn as le } from "./useCurrentScreen-CpQjVmrT.js";
|
|
3
|
+
import { E as ue, L as k, R as A, V as j, _ as M, b as de, c as fe, d as pe, f as me, m as he, n as ge, o as _e, r as ve, t as ye, w as be } from "./RefreshControl-DFh0-gCb.js";
|
|
4
|
+
import { E as xe, F as Se, G as Ce, I as we, J as Te, K as Ee, M as De, O as Oe, U as ke, W as Ae, Y as je, _ as Me, a as Ne, i as Pe, it as Fe, j as Ie, k as Le, mt as Re, q as ze, s as Be, ut as Ve, w as He } from "./registry-r4hiflwC.js";
|
|
5
|
+
import { n as Ue, r as We, t as Ge } from "./dataTableStyles-vwD1mVOP.js";
|
|
6
|
+
import { n as Ke, t as qe } from "./LayoutRenderer-DX8pFS5A.js";
|
|
7
|
+
import { Fragment as N, useCallback as P, useEffect as F, useMemo as I, useRef as Je, useState as L } from "react";
|
|
8
|
+
import { useLocation as Ye, useParams as Xe, useSearchParams as Ze } from "react-router";
|
|
9
|
+
import { useQuery as R, useQueryClient as z } from "@tanstack/react-query";
|
|
10
|
+
import { Fragment as Qe, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/shared/AssociationTabs.tsx
|
|
12
|
-
function
|
|
13
|
-
let a =
|
|
12
|
+
function $e({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
13
|
+
let a = I(() => Object.entries(r), [r]), [o, s] = L(0);
|
|
14
14
|
if (a.length === 0) return null;
|
|
15
15
|
let [c, l] = a[o];
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
title: /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ B(Re, {
|
|
17
|
+
title: /* @__PURE__ */ B("div", {
|
|
18
18
|
style: {
|
|
19
19
|
display: "flex",
|
|
20
20
|
alignItems: "center",
|
|
@@ -25,7 +25,7 @@ function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
25
25
|
},
|
|
26
26
|
children: a.map(([e, n], r) => {
|
|
27
27
|
let i = r === o;
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ V("button", {
|
|
29
29
|
onClick: (e) => {
|
|
30
30
|
e.stopPropagation(), s(r);
|
|
31
31
|
},
|
|
@@ -43,16 +43,16 @@ function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
43
43
|
cursor: "pointer",
|
|
44
44
|
fontWeight: i ? 600 : 500
|
|
45
45
|
},
|
|
46
|
-
children: [n.display?.icon && /* @__PURE__ */
|
|
46
|
+
children: [n.display?.icon && /* @__PURE__ */ B(t, {
|
|
47
47
|
name: n.display.icon,
|
|
48
48
|
size: 13
|
|
49
|
-
}),
|
|
49
|
+
}), D(n.display?.name) || e]
|
|
50
50
|
}, e);
|
|
51
51
|
})
|
|
52
52
|
}),
|
|
53
53
|
collapsible: !1,
|
|
54
54
|
padding: "0",
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ B(et, {
|
|
56
56
|
entityCode: e,
|
|
57
57
|
recordId: n,
|
|
58
58
|
assocKey: c,
|
|
@@ -61,111 +61,111 @@ function Qe({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
61
61
|
})
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
let
|
|
64
|
+
function et({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c }) {
|
|
65
|
+
let l = Fe(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } = R({
|
|
66
66
|
queryKey: [
|
|
67
67
|
"association",
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
d,
|
|
69
|
+
n
|
|
70
70
|
],
|
|
71
|
-
queryFn: () =>
|
|
72
|
-
}),
|
|
71
|
+
queryFn: () => O(d, [n])
|
|
72
|
+
}), m = f?.target_entity ?? o.target, h = c.entities[m], g = I(() => f?.ids ?? [], [f?.ids]), _ = I(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), v = I(() => g.slice(0, 50), [g]), { data: y, isLoading: b } = R({
|
|
73
73
|
queryKey: [
|
|
74
74
|
"association-records",
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
m,
|
|
76
|
+
v
|
|
77
77
|
],
|
|
78
|
-
queryFn: () =>
|
|
78
|
+
queryFn: () => s(m, {
|
|
79
79
|
per_page: 50,
|
|
80
80
|
filters: [{
|
|
81
|
-
field:
|
|
81
|
+
field: _,
|
|
82
82
|
op: "in",
|
|
83
|
-
value:
|
|
83
|
+
value: v
|
|
84
84
|
}]
|
|
85
85
|
}),
|
|
86
|
-
enabled:
|
|
87
|
-
}),
|
|
88
|
-
let t =
|
|
86
|
+
enabled: v.length > 0 && !!h
|
|
87
|
+
}), x = y?.data ?? [], S = y?.$refs, ee = I(() => h ? h.fields.names().filter((e) => {
|
|
88
|
+
let t = h.fields.get(e);
|
|
89
89
|
return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
|
|
90
|
-
}).slice(0, 6) : [], [
|
|
91
|
-
let e =
|
|
90
|
+
}).slice(0, 6) : [], [h]), te = () => {
|
|
91
|
+
let e = a(c, m);
|
|
92
92
|
if (!e) return;
|
|
93
|
-
let t =
|
|
93
|
+
let t = D(o.display?.name) || i, n = new URLSearchParams();
|
|
94
94
|
n.set("filters", JSON.stringify([{
|
|
95
|
-
field:
|
|
95
|
+
field: _,
|
|
96
96
|
op: "in",
|
|
97
|
-
value:
|
|
98
|
-
}])),
|
|
97
|
+
value: g
|
|
98
|
+
}])), l(e.route, {
|
|
99
99
|
title: t,
|
|
100
100
|
icon: o.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 (p || b) return /* @__PURE__ */ B("div", {
|
|
109
|
+
style: C,
|
|
110
110
|
children: "Loading…"
|
|
111
111
|
});
|
|
112
|
-
if (!
|
|
113
|
-
style:
|
|
112
|
+
if (!h) return /* @__PURE__ */ B("div", {
|
|
113
|
+
style: C,
|
|
114
114
|
children: "Entity not found."
|
|
115
115
|
});
|
|
116
|
-
if (
|
|
117
|
-
style:
|
|
116
|
+
if (g.length === 0) return /* @__PURE__ */ B("div", {
|
|
117
|
+
style: C,
|
|
118
118
|
children: "No related records."
|
|
119
119
|
});
|
|
120
|
-
let
|
|
121
|
-
return /* @__PURE__ */
|
|
120
|
+
let w = a(c, m);
|
|
121
|
+
return /* @__PURE__ */ V("div", {
|
|
122
122
|
style: { padding: "8px 0" },
|
|
123
123
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
style:
|
|
126
|
-
children: [/* @__PURE__ */
|
|
127
|
-
style:
|
|
128
|
-
children:
|
|
129
|
-
}, e)) }) }), /* @__PURE__ */
|
|
130
|
-
let n =
|
|
131
|
-
return n ? /* @__PURE__ */
|
|
132
|
-
style:
|
|
133
|
-
children:
|
|
124
|
+
/* @__PURE__ */ V("table", {
|
|
125
|
+
style: We,
|
|
126
|
+
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: ee.map((e) => /* @__PURE__ */ B("th", {
|
|
127
|
+
style: Ue,
|
|
128
|
+
children: ce(h.fields.get(e), e, c.entities)
|
|
129
|
+
}, e)) }) }), /* @__PURE__ */ B("tbody", { children: x.map((e, t) => /* @__PURE__ */ B("tr", { children: ee.map((t) => {
|
|
130
|
+
let n = h.fields.get(t);
|
|
131
|
+
return n ? /* @__PURE__ */ B("td", {
|
|
132
|
+
style: Ge,
|
|
133
|
+
children: T({
|
|
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: S,
|
|
140
|
+
locale: u
|
|
141
141
|
})
|
|
142
|
-
}, t) : /* @__PURE__ */
|
|
142
|
+
}, t) : /* @__PURE__ */ B("td", {}, t);
|
|
143
143
|
}) }, t)) })]
|
|
144
144
|
}),
|
|
145
|
-
|
|
145
|
+
w && f && f.count > x.length && /* @__PURE__ */ B("div", {
|
|
146
146
|
style: {
|
|
147
147
|
padding: "10px 16px",
|
|
148
148
|
textAlign: "center"
|
|
149
149
|
},
|
|
150
|
-
children: /* @__PURE__ */
|
|
151
|
-
icon: /* @__PURE__ */
|
|
152
|
-
onClick:
|
|
150
|
+
children: /* @__PURE__ */ V(E, {
|
|
151
|
+
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
152
|
+
onClick: te,
|
|
153
153
|
children: [
|
|
154
154
|
"View all ",
|
|
155
|
-
|
|
155
|
+
f.count,
|
|
156
156
|
" records"
|
|
157
157
|
]
|
|
158
158
|
})
|
|
159
159
|
}),
|
|
160
|
-
|
|
160
|
+
w && x.length > 0 && f && f.count <= x.length && /* @__PURE__ */ B("div", {
|
|
161
161
|
style: {
|
|
162
162
|
padding: "10px 16px",
|
|
163
163
|
textAlign: "center"
|
|
164
164
|
},
|
|
165
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ B(E, {
|
|
166
166
|
kind: "ghost",
|
|
167
|
-
icon: /* @__PURE__ */
|
|
168
|
-
onClick:
|
|
167
|
+
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
168
|
+
onClick: te,
|
|
169
169
|
children: "Open in list view"
|
|
170
170
|
})
|
|
171
171
|
})
|
|
@@ -174,47 +174,47 @@ function $e({ entityCode: t, recordId: i, assocKey: a, association: o, schema: s
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/pages/RecordDocumentsPanel.tsx
|
|
177
|
-
var
|
|
178
|
-
function
|
|
179
|
-
return e?.some((e) => e.status === "pending") ?
|
|
177
|
+
var H = 4e3;
|
|
178
|
+
function U(e) {
|
|
179
|
+
return e?.some((e) => e.status === "pending") ? H : !1;
|
|
180
180
|
}
|
|
181
181
|
function tt({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
|
|
182
|
-
let { data: a, isLoading: o, error: s } =
|
|
182
|
+
let { data: a, isLoading: o, error: s } = R({
|
|
183
183
|
queryKey: [
|
|
184
|
-
|
|
184
|
+
M,
|
|
185
185
|
t,
|
|
186
186
|
n
|
|
187
187
|
],
|
|
188
|
-
queryFn: async () => (await
|
|
188
|
+
queryFn: async () => (await S("document.object_links", {
|
|
189
189
|
entity: t,
|
|
190
190
|
object_id: n
|
|
191
191
|
})).result?.documents ?? [],
|
|
192
192
|
enabled: !!(t && n) && (!!r || !!i),
|
|
193
|
-
refetchInterval: (e) =>
|
|
193
|
+
refetchInterval: (e) => U(e.state.data)
|
|
194
194
|
}), c = (a?.length ?? 0) > 0;
|
|
195
|
-
return !r && !c ? null : /* @__PURE__ */
|
|
196
|
-
title: /* @__PURE__ */
|
|
195
|
+
return !r && !c ? null : /* @__PURE__ */ V(Re, {
|
|
196
|
+
title: /* @__PURE__ */ B(W, {}),
|
|
197
197
|
collapsible: !1,
|
|
198
198
|
padding: "0",
|
|
199
199
|
children: [
|
|
200
|
-
o && /* @__PURE__ */
|
|
201
|
-
icon: /* @__PURE__ */
|
|
200
|
+
o && /* @__PURE__ */ B(G, {
|
|
201
|
+
icon: /* @__PURE__ */ B(e.loader, { size: 14 }),
|
|
202
202
|
text: "Loading documents..."
|
|
203
203
|
}),
|
|
204
|
-
s && /* @__PURE__ */
|
|
205
|
-
icon: /* @__PURE__ */
|
|
204
|
+
s && /* @__PURE__ */ B(G, {
|
|
205
|
+
icon: /* @__PURE__ */ B(e.warning, { size: 14 }),
|
|
206
206
|
text: s instanceof Error ? s.message : String(s)
|
|
207
207
|
}),
|
|
208
|
-
!o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */
|
|
209
|
-
icon: /* @__PURE__ */
|
|
208
|
+
!o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ B(G, {
|
|
209
|
+
icon: /* @__PURE__ */ B(e.file, { size: 14 }),
|
|
210
210
|
text: "No generated documents"
|
|
211
211
|
}),
|
|
212
|
-
!o && !s && a && a.length > 0 && /* @__PURE__ */
|
|
212
|
+
!o && !s && a && a.length > 0 && /* @__PURE__ */ B("div", {
|
|
213
213
|
style: {
|
|
214
214
|
display: "flex",
|
|
215
215
|
flexDirection: "column"
|
|
216
216
|
},
|
|
217
|
-
children: a.map((e) => /* @__PURE__ */
|
|
217
|
+
children: a.map((e) => /* @__PURE__ */ B(nt, {
|
|
218
218
|
entityCode: t,
|
|
219
219
|
objectId: n,
|
|
220
220
|
doc: e
|
|
@@ -224,7 +224,7 @@ function tt({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
function W() {
|
|
227
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ V("div", {
|
|
228
228
|
style: {
|
|
229
229
|
display: "flex",
|
|
230
230
|
alignItems: "center",
|
|
@@ -235,57 +235,57 @@ function W() {
|
|
|
235
235
|
fontWeight: 600,
|
|
236
236
|
color: "var(--text)"
|
|
237
237
|
},
|
|
238
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ B(e.file, { size: 13 }), "Documents"]
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
function nt({ entityCode: t, objectId:
|
|
242
|
-
let
|
|
243
|
-
async function
|
|
244
|
-
|
|
241
|
+
function nt({ entityCode: t, objectId: r, doc: i }) {
|
|
242
|
+
let a = z(), [o, s] = L(!1), [c, l] = L(!1), [u, d] = L(!1), [f, p] = L(!1), [m, h] = L(null), g = D(i.title) || i.filename || i.template_code, v = i.status === "ready" && i.download_url && !f;
|
|
243
|
+
async function y() {
|
|
244
|
+
s(!0), h(null);
|
|
245
245
|
try {
|
|
246
|
-
let e = (await
|
|
247
|
-
generated_document_id:
|
|
246
|
+
let e = (await S("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 _(e.download_url, e.filename);
|
|
251
251
|
} catch (e) {
|
|
252
|
-
|
|
252
|
+
n(e) ? (p(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
|
|
253
253
|
} finally {
|
|
254
|
-
|
|
254
|
+
s(!1);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
async function
|
|
258
|
-
if (
|
|
259
|
-
|
|
257
|
+
async function b() {
|
|
258
|
+
if (i.download_url) {
|
|
259
|
+
l(!0), h(null);
|
|
260
260
|
try {
|
|
261
|
-
await
|
|
261
|
+
await _(i.download_url, i.filename);
|
|
262
262
|
} catch (e) {
|
|
263
|
-
|
|
263
|
+
n(e) ? (p(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
|
|
264
264
|
} finally {
|
|
265
|
-
|
|
265
|
+
l(!1);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
270
|
-
|
|
269
|
+
async function x() {
|
|
270
|
+
d(!0), h(null);
|
|
271
271
|
try {
|
|
272
|
-
await
|
|
273
|
-
...
|
|
274
|
-
template_code:
|
|
275
|
-
template_source:
|
|
276
|
-
output_format:
|
|
277
|
-
}), await
|
|
278
|
-
|
|
272
|
+
await S("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
|
+
M,
|
|
279
279
|
t,
|
|
280
|
-
|
|
280
|
+
r
|
|
281
281
|
] });
|
|
282
282
|
} catch (e) {
|
|
283
283
|
h(e instanceof Error ? e.message : String(e));
|
|
284
284
|
} finally {
|
|
285
|
-
|
|
285
|
+
d(!1);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
return /* @__PURE__ */
|
|
288
|
+
return /* @__PURE__ */ V("div", {
|
|
289
289
|
style: {
|
|
290
290
|
display: "grid",
|
|
291
291
|
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
@@ -294,10 +294,10 @@ function nt({ entityCode: t, objectId: n, doc: r }) {
|
|
|
294
294
|
padding: "11px 14px",
|
|
295
295
|
borderTop: "1px solid var(--divider)"
|
|
296
296
|
},
|
|
297
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ V("div", {
|
|
298
298
|
style: { minWidth: 0 },
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ B("div", {
|
|
301
301
|
style: {
|
|
302
302
|
fontSize: 13,
|
|
303
303
|
fontWeight: 600,
|
|
@@ -308,7 +308,7 @@ function nt({ entityCode: t, objectId: n, doc: r }) {
|
|
|
308
308
|
},
|
|
309
309
|
children: g
|
|
310
310
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ V("div", {
|
|
312
312
|
style: {
|
|
313
313
|
marginTop: 3,
|
|
314
314
|
display: "flex",
|
|
@@ -318,65 +318,65 @@ function nt({ entityCode: t, objectId: n, doc: r }) {
|
|
|
318
318
|
fontSize: 11.5
|
|
319
319
|
},
|
|
320
320
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ B("span", { children: i.output_format.toUpperCase() }),
|
|
322
|
+
/* @__PURE__ */ B("span", { children: f ? "artifact unavailable" : i.status }),
|
|
323
|
+
/* @__PURE__ */ B("span", { children: i.ready_at || i.created_at })
|
|
324
324
|
]
|
|
325
325
|
}),
|
|
326
|
-
|
|
326
|
+
i.status === "failed" && i.error_text && /* @__PURE__ */ B("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
|
+
m && /* @__PURE__ */ B("div", {
|
|
335
335
|
style: {
|
|
336
336
|
marginTop: 5,
|
|
337
337
|
color: "var(--danger)",
|
|
338
338
|
fontSize: 12
|
|
339
339
|
},
|
|
340
|
-
children:
|
|
340
|
+
children: m
|
|
341
341
|
})
|
|
342
342
|
]
|
|
343
|
-
}),
|
|
343
|
+
}), v ? /* @__PURE__ */ V("div", {
|
|
344
344
|
style: {
|
|
345
345
|
display: "flex",
|
|
346
346
|
gap: 6
|
|
347
347
|
},
|
|
348
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ B(E, {
|
|
349
349
|
kind: "ghost",
|
|
350
350
|
size: "sm",
|
|
351
|
-
icon:
|
|
352
|
-
onClick:
|
|
353
|
-
disabled:
|
|
351
|
+
icon: B(o ? e.loader : e.file, { size: 12 }),
|
|
352
|
+
onClick: y,
|
|
353
|
+
disabled: o,
|
|
354
354
|
children: "PDF"
|
|
355
|
-
}), /* @__PURE__ */
|
|
355
|
+
}), /* @__PURE__ */ B(E, {
|
|
356
356
|
kind: "default",
|
|
357
357
|
size: "sm",
|
|
358
|
-
icon:
|
|
359
|
-
onClick:
|
|
360
|
-
disabled:
|
|
358
|
+
icon: B(c ? e.loader : e.download, { size: 12 }),
|
|
359
|
+
onClick: b,
|
|
360
|
+
disabled: c,
|
|
361
361
|
children: "Download"
|
|
362
362
|
})]
|
|
363
|
-
}) :
|
|
363
|
+
}) : f ? /* @__PURE__ */ B(E, {
|
|
364
364
|
kind: "ghost",
|
|
365
365
|
size: "sm",
|
|
366
|
-
icon:
|
|
367
|
-
onClick:
|
|
368
|
-
disabled:
|
|
366
|
+
icon: B(u ? e.loader : e.file, { size: 12 }),
|
|
367
|
+
onClick: x,
|
|
368
|
+
disabled: u,
|
|
369
369
|
children: "Regenerate"
|
|
370
|
-
}) : /* @__PURE__ */
|
|
370
|
+
}) : /* @__PURE__ */ B(E, {
|
|
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
|
}
|
|
378
378
|
function G({ icon: e, text: t }) {
|
|
379
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ V("div", {
|
|
380
380
|
style: {
|
|
381
381
|
display: "flex",
|
|
382
382
|
alignItems: "center",
|
|
@@ -393,7 +393,7 @@ function G({ icon: e, text: t }) {
|
|
|
393
393
|
function rt({ errors: t, onJump: n }) {
|
|
394
394
|
if (t.length === 0) return null;
|
|
395
395
|
let r = t.length !== 1;
|
|
396
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ V("div", {
|
|
397
397
|
role: "alert",
|
|
398
398
|
style: {
|
|
399
399
|
display: "flex",
|
|
@@ -405,19 +405,19 @@ function rt({ errors: t, onJump: n }) {
|
|
|
405
405
|
border: "1px solid var(--danger-border)",
|
|
406
406
|
color: "var(--text)"
|
|
407
407
|
},
|
|
408
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ B("span", {
|
|
409
409
|
style: {
|
|
410
410
|
color: "var(--danger)",
|
|
411
411
|
marginTop: 1,
|
|
412
412
|
display: "flex"
|
|
413
413
|
},
|
|
414
|
-
children: /* @__PURE__ */
|
|
415
|
-
}), /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ B(e.warning, { size: 14 })
|
|
415
|
+
}), /* @__PURE__ */ V("div", {
|
|
416
416
|
style: {
|
|
417
417
|
flex: 1,
|
|
418
418
|
minWidth: 0
|
|
419
419
|
},
|
|
420
|
-
children: [/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ V("div", {
|
|
421
421
|
style: {
|
|
422
422
|
fontSize: 12.5,
|
|
423
423
|
fontWeight: 600,
|
|
@@ -429,7 +429,7 @@ function rt({ errors: t, onJump: n }) {
|
|
|
429
429
|
r ? "fields need" : "field needs",
|
|
430
430
|
" attention"
|
|
431
431
|
]
|
|
432
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ B("ul", {
|
|
433
433
|
style: {
|
|
434
434
|
margin: 0,
|
|
435
435
|
padding: 0,
|
|
@@ -438,7 +438,7 @@ function rt({ errors: t, onJump: n }) {
|
|
|
438
438
|
flexDirection: "column",
|
|
439
439
|
gap: 2
|
|
440
440
|
},
|
|
441
|
-
children: t.map((e) => /* @__PURE__ */
|
|
441
|
+
children: t.map((e) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ V("button", {
|
|
442
442
|
type: "button",
|
|
443
443
|
onClick: n ? () => n(e.name) : void 0,
|
|
444
444
|
style: {
|
|
@@ -451,21 +451,21 @@ function rt({ errors: t, onJump: n }) {
|
|
|
451
451
|
fontFamily: "inherit"
|
|
452
452
|
},
|
|
453
453
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ B("span", {
|
|
455
455
|
style: {
|
|
456
456
|
color: "var(--danger)",
|
|
457
457
|
marginRight: 6
|
|
458
458
|
},
|
|
459
459
|
children: "•"
|
|
460
460
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ B("span", {
|
|
462
462
|
style: {
|
|
463
463
|
fontWeight: 500,
|
|
464
464
|
color: "var(--text-2)"
|
|
465
465
|
},
|
|
466
466
|
children: e.label
|
|
467
467
|
}),
|
|
468
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ V("span", {
|
|
469
469
|
style: { color: "var(--text-3)" },
|
|
470
470
|
children: [" - ", e.message]
|
|
471
471
|
})
|
|
@@ -478,7 +478,7 @@ function rt({ errors: t, onJump: n }) {
|
|
|
478
478
|
//#endregion
|
|
479
479
|
//#region src/components/shared/HighlightsStrip.tsx
|
|
480
480
|
function K({ items: e }) {
|
|
481
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
481
|
+
return e.length === 0 ? null : /* @__PURE__ */ B("div", {
|
|
482
482
|
style: {
|
|
483
483
|
display: "flex",
|
|
484
484
|
alignItems: "center",
|
|
@@ -486,25 +486,25 @@ function K({ items: e }) {
|
|
|
486
486
|
gap: "6px 0",
|
|
487
487
|
fontSize: 12
|
|
488
488
|
},
|
|
489
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
489
|
+
children: e.map((e, t) => /* @__PURE__ */ V(N, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
|
|
490
490
|
width: 1,
|
|
491
491
|
height: 12,
|
|
492
492
|
background: "var(--divider)",
|
|
493
493
|
marginInline: 12
|
|
494
|
-
} }), /* @__PURE__ */
|
|
494
|
+
} }), /* @__PURE__ */ V("span", {
|
|
495
495
|
style: {
|
|
496
496
|
display: "inline-flex",
|
|
497
497
|
alignItems: "center",
|
|
498
498
|
gap: 6,
|
|
499
499
|
lineHeight: 1.3
|
|
500
500
|
},
|
|
501
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ B("span", {
|
|
502
502
|
style: {
|
|
503
503
|
color: "var(--text-3)",
|
|
504
504
|
fontSize: 11.5
|
|
505
505
|
},
|
|
506
506
|
children: e.label
|
|
507
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ B("span", {
|
|
508
508
|
style: { color: "var(--text)" },
|
|
509
509
|
children: e.value
|
|
510
510
|
})]
|
|
@@ -522,12 +522,12 @@ function it({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
522
522
|
if (c) {
|
|
523
523
|
let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
|
|
524
524
|
l.push({
|
|
525
|
-
label:
|
|
526
|
-
value: n ? /* @__PURE__ */
|
|
525
|
+
label: D(c.name),
|
|
526
|
+
value: n ? /* @__PURE__ */ B(oe, {
|
|
527
527
|
tone: n.color ?? "slate",
|
|
528
528
|
size: "xs",
|
|
529
|
-
children:
|
|
530
|
-
}) : /* @__PURE__ */
|
|
529
|
+
children: D(n.name)
|
|
530
|
+
}) : /* @__PURE__ */ B("span", {
|
|
531
531
|
style: { color: "var(--text-4)" },
|
|
532
532
|
children: "—"
|
|
533
533
|
})
|
|
@@ -535,7 +535,7 @@ function it({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
535
535
|
continue;
|
|
536
536
|
}
|
|
537
537
|
if (t.fields.get(e) || t.files?.get(e)) {
|
|
538
|
-
let a =
|
|
538
|
+
let a = ze({
|
|
539
539
|
entity: t,
|
|
540
540
|
entityCode: n,
|
|
541
541
|
fieldName: e,
|
|
@@ -548,13 +548,13 @@ function it({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
548
548
|
locale: s
|
|
549
549
|
});
|
|
550
550
|
l.push({
|
|
551
|
-
label:
|
|
551
|
+
label: Te(t, e, o.entities),
|
|
552
552
|
value: a
|
|
553
553
|
});
|
|
554
554
|
continue;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
return l.length === 0 ? null : /* @__PURE__ */
|
|
557
|
+
return l.length === 0 ? null : /* @__PURE__ */ B(K, { items: l });
|
|
558
558
|
}
|
|
559
559
|
//#endregion
|
|
560
560
|
//#region src/components/shared/AuditMetaStrip.tsx
|
|
@@ -563,7 +563,7 @@ function at(e) {
|
|
|
563
563
|
}
|
|
564
564
|
function ot({ lines: e }) {
|
|
565
565
|
let t = e.filter(at);
|
|
566
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
566
|
+
return t.length === 0 ? null : /* @__PURE__ */ B("div", {
|
|
567
567
|
style: {
|
|
568
568
|
display: "flex",
|
|
569
569
|
flexWrap: "wrap",
|
|
@@ -575,18 +575,18 @@ function ot({ lines: e }) {
|
|
|
575
575
|
fontSize: 11.5,
|
|
576
576
|
color: "var(--text-3)"
|
|
577
577
|
},
|
|
578
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
578
|
+
children: t.map((e, t) => /* @__PURE__ */ B(st, { line: e }, t))
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
function st({ line: e }) {
|
|
582
|
-
return /* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ V("div", {
|
|
583
583
|
style: {
|
|
584
584
|
display: "flex",
|
|
585
585
|
alignItems: "center",
|
|
586
586
|
gap: 8,
|
|
587
587
|
minWidth: 0
|
|
588
588
|
},
|
|
589
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ B("span", {
|
|
590
590
|
style: {
|
|
591
591
|
fontSize: 11,
|
|
592
592
|
fontWeight: 600,
|
|
@@ -594,7 +594,7 @@ function st({ line: e }) {
|
|
|
594
594
|
flexShrink: 0
|
|
595
595
|
},
|
|
596
596
|
children: e.label
|
|
597
|
-
}), /* @__PURE__ */
|
|
597
|
+
}), /* @__PURE__ */ V("span", {
|
|
598
598
|
style: {
|
|
599
599
|
display: "inline-flex",
|
|
600
600
|
alignItems: "center",
|
|
@@ -602,15 +602,15 @@ function st({ line: e }) {
|
|
|
602
602
|
minWidth: 0
|
|
603
603
|
},
|
|
604
604
|
children: [
|
|
605
|
-
e.by != null && /* @__PURE__ */
|
|
605
|
+
e.by != null && /* @__PURE__ */ B("span", {
|
|
606
606
|
style: { color: "var(--text-2)" },
|
|
607
607
|
children: e.by
|
|
608
608
|
}),
|
|
609
|
-
e.by != null && e.at != null && /* @__PURE__ */
|
|
609
|
+
e.by != null && e.at != null && /* @__PURE__ */ B("span", {
|
|
610
610
|
style: { color: "var(--text-4)" },
|
|
611
611
|
children: "·"
|
|
612
612
|
}),
|
|
613
|
-
e.at != null && /* @__PURE__ */
|
|
613
|
+
e.at != null && /* @__PURE__ */ B("span", {
|
|
614
614
|
className: "num",
|
|
615
615
|
children: e.at
|
|
616
616
|
})
|
|
@@ -626,7 +626,7 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
626
626
|
let c = (e) => {
|
|
627
627
|
if (!e || !t.fields.get(e)) return;
|
|
628
628
|
let s = r[e];
|
|
629
|
-
if (!(s == null || s === "")) return
|
|
629
|
+
if (!(s == null || s === "")) return ze({
|
|
630
630
|
entity: t,
|
|
631
631
|
entityCode: n,
|
|
632
632
|
fieldName: e,
|
|
@@ -639,8 +639,8 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
639
639
|
locale: o
|
|
640
640
|
});
|
|
641
641
|
};
|
|
642
|
-
return /* @__PURE__ */
|
|
643
|
-
label:
|
|
642
|
+
return /* @__PURE__ */ B(ot, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
|
|
643
|
+
label: D(e.label),
|
|
644
644
|
at: c(e.at),
|
|
645
645
|
by: c(e.by)
|
|
646
646
|
})) : [{
|
|
@@ -662,13 +662,13 @@ function q(e) {
|
|
|
662
662
|
}
|
|
663
663
|
function lt({ evidence: e }) {
|
|
664
664
|
let t = e?.verdict ?? "unverified", n = q(e?.verified_at), r = [];
|
|
665
|
-
return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */
|
|
665
|
+
return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ V("div", {
|
|
666
666
|
style: {
|
|
667
667
|
display: "flex",
|
|
668
668
|
flexDirection: "column",
|
|
669
669
|
gap: 6
|
|
670
670
|
},
|
|
671
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ V("div", {
|
|
672
672
|
style: {
|
|
673
673
|
display: "flex",
|
|
674
674
|
alignItems: "center",
|
|
@@ -676,7 +676,7 @@ function lt({ evidence: e }) {
|
|
|
676
676
|
flexWrap: "wrap"
|
|
677
677
|
},
|
|
678
678
|
children: [
|
|
679
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ B("span", {
|
|
680
680
|
style: {
|
|
681
681
|
fontSize: 12,
|
|
682
682
|
fontWeight: 600,
|
|
@@ -684,13 +684,13 @@ function lt({ evidence: e }) {
|
|
|
684
684
|
},
|
|
685
685
|
children: "Evidence"
|
|
686
686
|
}),
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
tone:
|
|
687
|
+
/* @__PURE__ */ B(oe, {
|
|
688
|
+
tone: ve(t),
|
|
689
689
|
size: "sm",
|
|
690
690
|
dot: !0,
|
|
691
|
-
children:
|
|
691
|
+
children: ge(t)
|
|
692
692
|
}),
|
|
693
|
-
r.length > 0 && /* @__PURE__ */
|
|
693
|
+
r.length > 0 && /* @__PURE__ */ B("span", {
|
|
694
694
|
style: {
|
|
695
695
|
fontSize: 12,
|
|
696
696
|
color: "var(--muted-foreground)"
|
|
@@ -698,7 +698,7 @@ function lt({ evidence: e }) {
|
|
|
698
698
|
children: r.join(" · ")
|
|
699
699
|
})
|
|
700
700
|
]
|
|
701
|
-
}), e?.reason && /* @__PURE__ */
|
|
701
|
+
}), e?.reason && /* @__PURE__ */ B("span", {
|
|
702
702
|
style: {
|
|
703
703
|
fontSize: 12,
|
|
704
704
|
color: "var(--destructive)"
|
|
@@ -710,8 +710,8 @@ function lt({ evidence: e }) {
|
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region src/components/shared/RecordHeader.tsx
|
|
712
712
|
function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: l = !1, onBack: u, right: d, identityControls: f, showTitle: p = !0 }) {
|
|
713
|
-
let m =
|
|
714
|
-
return /* @__PURE__ */
|
|
713
|
+
let m = ie(), h = m.category === "phone" || m.width <= 520;
|
|
714
|
+
return /* @__PURE__ */ V("div", {
|
|
715
715
|
style: {
|
|
716
716
|
display: "flex",
|
|
717
717
|
alignItems: "flex-start",
|
|
@@ -720,27 +720,27 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
|
|
|
720
720
|
minWidth: 0
|
|
721
721
|
},
|
|
722
722
|
children: [
|
|
723
|
-
p && l && /* @__PURE__ */
|
|
723
|
+
p && l && /* @__PURE__ */ B("div", {
|
|
724
724
|
style: {
|
|
725
725
|
paddingTop: 4,
|
|
726
726
|
flexShrink: 0
|
|
727
727
|
},
|
|
728
|
-
children: /* @__PURE__ */
|
|
728
|
+
children: /* @__PURE__ */ B(ee, {
|
|
729
729
|
size: 26,
|
|
730
|
-
icon: /* @__PURE__ */
|
|
730
|
+
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
731
731
|
title: "Back",
|
|
732
732
|
onClick: u
|
|
733
733
|
})
|
|
734
734
|
}),
|
|
735
|
-
p && (n || t) && /* @__PURE__ */
|
|
735
|
+
p && (n || t) && /* @__PURE__ */ B("div", {
|
|
736
736
|
style: {
|
|
737
737
|
flexShrink: 0,
|
|
738
738
|
paddingTop: 2
|
|
739
739
|
},
|
|
740
|
-
children: n ? /* @__PURE__ */
|
|
740
|
+
children: n ? /* @__PURE__ */ B(j, {
|
|
741
741
|
name: n,
|
|
742
742
|
size: 32
|
|
743
|
-
}) : /* @__PURE__ */
|
|
743
|
+
}) : /* @__PURE__ */ B("span", {
|
|
744
744
|
style: {
|
|
745
745
|
width: 32,
|
|
746
746
|
height: 32,
|
|
@@ -754,12 +754,12 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
|
|
|
754
754
|
children: t
|
|
755
755
|
})
|
|
756
756
|
}),
|
|
757
|
-
p && /* @__PURE__ */
|
|
757
|
+
p && /* @__PURE__ */ V("div", {
|
|
758
758
|
style: {
|
|
759
759
|
flex: "1 1 0",
|
|
760
760
|
minWidth: 0
|
|
761
761
|
},
|
|
762
|
-
children: [/* @__PURE__ */
|
|
762
|
+
children: [/* @__PURE__ */ V("div", {
|
|
763
763
|
style: {
|
|
764
764
|
display: "flex",
|
|
765
765
|
alignItems: "center",
|
|
@@ -767,7 +767,7 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
|
|
|
767
767
|
flexWrap: "wrap"
|
|
768
768
|
},
|
|
769
769
|
children: [
|
|
770
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ B("h1", {
|
|
771
771
|
style: {
|
|
772
772
|
margin: 0,
|
|
773
773
|
fontSize: "var(--page-title-size, var(--page-title-size-detail))",
|
|
@@ -784,13 +784,13 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
|
|
|
784
784
|
},
|
|
785
785
|
children: r
|
|
786
786
|
}),
|
|
787
|
-
i && /* @__PURE__ */
|
|
788
|
-
a && /* @__PURE__ */
|
|
787
|
+
i && /* @__PURE__ */ B(k, { value: i }),
|
|
788
|
+
a && /* @__PURE__ */ B(A, {
|
|
789
789
|
label: a,
|
|
790
790
|
"data-testid": "detail-description-info"
|
|
791
791
|
}),
|
|
792
792
|
f,
|
|
793
|
-
s === "edit" && c && /* @__PURE__ */
|
|
793
|
+
s === "edit" && c && /* @__PURE__ */ V("span", {
|
|
794
794
|
style: {
|
|
795
795
|
display: "inline-flex",
|
|
796
796
|
alignItems: "center",
|
|
@@ -798,26 +798,26 @@ function ut({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
|
|
|
798
798
|
fontSize: 11,
|
|
799
799
|
color: "var(--warn)"
|
|
800
800
|
},
|
|
801
|
-
children: [/* @__PURE__ */
|
|
801
|
+
children: [/* @__PURE__ */ B("span", { style: {
|
|
802
802
|
width: 6,
|
|
803
803
|
height: 6,
|
|
804
804
|
borderRadius: 999,
|
|
805
805
|
background: "var(--warn)"
|
|
806
806
|
} }), "Unsaved"]
|
|
807
807
|
}),
|
|
808
|
-
s === "create" && /* @__PURE__ */
|
|
808
|
+
s === "create" && /* @__PURE__ */ B(oe, {
|
|
809
809
|
tone: "violet",
|
|
810
810
|
size: "xs",
|
|
811
811
|
dot: !0,
|
|
812
812
|
children: "New record"
|
|
813
813
|
})
|
|
814
814
|
]
|
|
815
|
-
}), o && s === "display" && /* @__PURE__ */
|
|
815
|
+
}), o && s === "display" && /* @__PURE__ */ B("div", {
|
|
816
816
|
style: { marginTop: 8 },
|
|
817
817
|
children: o
|
|
818
818
|
})]
|
|
819
819
|
}),
|
|
820
|
-
d && /* @__PURE__ */
|
|
820
|
+
d && /* @__PURE__ */ B("div", {
|
|
821
821
|
role: "toolbar",
|
|
822
822
|
"aria-label": "Page actions",
|
|
823
823
|
style: {
|
|
@@ -893,46 +893,46 @@ function _t(e, t) {
|
|
|
893
893
|
}
|
|
894
894
|
function vt(e, t) {
|
|
895
895
|
if (e) {
|
|
896
|
-
let n =
|
|
896
|
+
let n = h(x(e, t));
|
|
897
897
|
if (n.replace(/^\|+|\|+$/g, "")) return n;
|
|
898
898
|
}
|
|
899
|
-
return t.id == null ? crypto.randomUUID() :
|
|
899
|
+
return t.id == null ? crypto.randomUUID() : f(t.id);
|
|
900
900
|
}
|
|
901
901
|
function J({ screenCode: e }) {
|
|
902
|
-
return /* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ B(m, { children: /* @__PURE__ */ B(yt, { screenCode: e }) });
|
|
903
903
|
}
|
|
904
904
|
function yt({ screenCode: t }) {
|
|
905
|
-
let { id:
|
|
906
|
-
if (!
|
|
907
|
-
let e =
|
|
905
|
+
let { id: n } = Xe(), a = ne(), [s, c] = Ze(), { data: f } = i(), m = re((e) => e.user), _ = u(), y = ie(), b = f?.screens[t], S = b?.entity ? f?.entities[b.entity] : void 0, C = b?.entity, w = le(S, "create"), T = le(S, "update"), E = le(S, "restore"), oe = (() => {
|
|
906
|
+
if (!S || !S.singleton || !S.prefilter) return;
|
|
907
|
+
let e = o(S);
|
|
908
908
|
if (e.length !== 1) return;
|
|
909
|
-
let t =
|
|
910
|
-
if (t === "$caller.user_id") return
|
|
911
|
-
if (t === "$caller.tenant_id") return
|
|
912
|
-
})(),
|
|
913
|
-
if (!
|
|
914
|
-
if (!
|
|
915
|
-
let e =
|
|
916
|
-
if (e.length === 1) return { [e[0]]:
|
|
917
|
-
let t =
|
|
909
|
+
let t = S.prefilter[e[0]];
|
|
910
|
+
if (t === "$caller.user_id") return m?.id;
|
|
911
|
+
if (t === "$caller.tenant_id") return m?.tenant?.id;
|
|
912
|
+
})(), O = oe !== void 0, k = O ? oe : n, A = !O && k === "new", j = I(() => {
|
|
913
|
+
if (!k || A) return;
|
|
914
|
+
if (!S) return k;
|
|
915
|
+
let e = o(S);
|
|
916
|
+
if (e.length === 1) return { [e[0]]: k };
|
|
917
|
+
let t = l(k, e.length);
|
|
918
918
|
if (!t) return;
|
|
919
919
|
let n = {};
|
|
920
920
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
921
921
|
return n;
|
|
922
922
|
}, [
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
]),
|
|
927
|
-
if (
|
|
928
|
-
}, [
|
|
929
|
-
|
|
930
|
-
let
|
|
931
|
-
|
|
932
|
-
let [xt, St] =
|
|
933
|
-
let e = parseInt(
|
|
923
|
+
k,
|
|
924
|
+
A,
|
|
925
|
+
S
|
|
926
|
+
]), M = I(() => {
|
|
927
|
+
if (j) return typeof j == "string" ? j : h(j);
|
|
928
|
+
}, [j]), me = Ne(C, j), { data: he, isLoading: ge, error: ve } = me, ye = we((e) => e.degradedEntities), Te = C ? Se(S?.realtime, ye, C) : !1;
|
|
929
|
+
de(Pe(C, j), !A);
|
|
930
|
+
let De = xe(C ?? ""), Fe = Le(C ?? ""), Ie = Oe(C ?? ""), Re = Object.keys(S?.status_groups ?? {}).length > 0, ze = he?.data, Ue = ze?.$statuses, We = ze?.$properties, Ge = s.get("edit") === "true", [N, R] = L(A || Ge), [z, et] = L({}), [H, U] = L({}), [W, nt] = L({}), [G, K] = L(void 0), [at, ot] = L(!1), [st, q] = L(void 0), [ut, ft] = L(!1), mt = A ? w : T, J = N && mt, yt = ae();
|
|
931
|
+
te(J && !A, yt.enabled);
|
|
932
|
+
let [xt, St] = L(() => {
|
|
933
|
+
let e = parseInt(b?.sidebar_width || "380", 10);
|
|
934
934
|
return isNaN(e) ? 380 : e;
|
|
935
|
-
}), wt =
|
|
935
|
+
}), wt = Je(null), Y = Je(null), Tt = P((e) => {
|
|
936
936
|
e.preventDefault();
|
|
937
937
|
let t = wt.current;
|
|
938
938
|
if (!t) return;
|
|
@@ -949,75 +949,75 @@ function yt({ screenCode: t }) {
|
|
|
949
949
|
Y.current && t && St(parseInt(t.style.width, 10) || Y.current.startW), Y.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
950
950
|
};
|
|
951
951
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
952
|
-
}, []), X =
|
|
953
|
-
|
|
952
|
+
}, []), X = he?.data, Z = typeof X?.$row_version == "string" ? X.$row_version : void 0, Et = X?.$refs, Dt = Je(Z);
|
|
953
|
+
F(() => {
|
|
954
954
|
if (!Z) return;
|
|
955
955
|
let e = Dt.current;
|
|
956
|
-
Dt.current = Z, e && e !== Z &&
|
|
957
|
-
}, [
|
|
958
|
-
let Ot = !!
|
|
959
|
-
|
|
960
|
-
let jt = !
|
|
961
|
-
|
|
956
|
+
Dt.current = Z, e && e !== Z && N && ot(!0);
|
|
957
|
+
}, [N, Z]);
|
|
958
|
+
let Ot = !!S?.soft_delete && X != null && X[S.soft_delete] != null, kt = Ye(), At = Je(null);
|
|
959
|
+
fe({ scrollElementRef: At });
|
|
960
|
+
let jt = !A && ve instanceof se && ve.status === 404, Mt = Je(null);
|
|
961
|
+
F(() => {
|
|
962
962
|
if (!jt) return;
|
|
963
|
-
let e =
|
|
964
|
-
Mt.current !== e && (Mt.current = e,
|
|
963
|
+
let e = be(kt);
|
|
964
|
+
Mt.current !== e && (Mt.current = e, ue.getState().kill(e));
|
|
965
965
|
}, [jt, kt]);
|
|
966
|
-
let { openTab: Nt, updateTabTitle: Pt, findTabByPathname: Ft } =
|
|
967
|
-
|
|
968
|
-
if (!
|
|
969
|
-
let e = kt.pathname, t =
|
|
966
|
+
let { openTab: Nt, updateTabTitle: Pt, findTabByPathname: Ft } = Ve();
|
|
967
|
+
F(() => {
|
|
968
|
+
if (!S || O || yt.enabled) return;
|
|
969
|
+
let e = kt.pathname, t = D(b?.display?.name) || D(S.display.name), n = b?.display?.icon || S.display.icon;
|
|
970
970
|
Ft(e) || Nt({
|
|
971
971
|
pathname: e,
|
|
972
972
|
search: "",
|
|
973
|
-
title:
|
|
973
|
+
title: A ? `New ${t}` : t,
|
|
974
974
|
icon: n,
|
|
975
975
|
closable: !0
|
|
976
976
|
});
|
|
977
977
|
}, [
|
|
978
978
|
kt.pathname,
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
979
|
+
b?.display?.name?.en,
|
|
980
|
+
S?.display.name?.en,
|
|
981
|
+
b?.display?.icon,
|
|
982
|
+
S?.display.icon,
|
|
983
|
+
A,
|
|
984
|
+
O,
|
|
985
985
|
yt.enabled
|
|
986
|
-
]),
|
|
987
|
-
if (!X || !
|
|
986
|
+
]), F(() => {
|
|
987
|
+
if (!X || !S || O || yt.enabled) return;
|
|
988
988
|
let e = Ft(kt.pathname);
|
|
989
989
|
if (e) {
|
|
990
|
-
let t =
|
|
990
|
+
let t = D(b?.display?.name) || D(S.display.name), n = v(X, S), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
991
991
|
Pt(e.id, r);
|
|
992
992
|
}
|
|
993
993
|
}, [
|
|
994
994
|
X,
|
|
995
|
-
|
|
996
|
-
|
|
995
|
+
S?.display.name?.en,
|
|
996
|
+
S?.display.display_field,
|
|
997
997
|
kt.pathname,
|
|
998
|
-
|
|
998
|
+
O,
|
|
999
999
|
yt.enabled
|
|
1000
1000
|
]);
|
|
1001
|
-
let It =
|
|
1002
|
-
if (!
|
|
1001
|
+
let It = I(() => {
|
|
1002
|
+
if (!S || !mt) return /* @__PURE__ */ new Set();
|
|
1003
1003
|
let e = /* @__PURE__ */ new Set();
|
|
1004
|
-
for (let [t, n] of
|
|
1005
|
-
for (let [t] of
|
|
1004
|
+
for (let [t, n] of S.fields) !n.auto && !n.primary && e.add(t);
|
|
1005
|
+
for (let [t] of S.files ?? []) e.add(t);
|
|
1006
1006
|
return e;
|
|
1007
|
-
}, [
|
|
1008
|
-
|
|
1009
|
-
if (!(!
|
|
1010
|
-
if (
|
|
1011
|
-
let e =
|
|
1012
|
-
e &&
|
|
1013
|
-
entity:
|
|
1007
|
+
}, [S, mt]);
|
|
1008
|
+
F(() => {
|
|
1009
|
+
if (!(!Ge || !X || !S || !T)) {
|
|
1010
|
+
if (N || R(!0), Object.keys(z).length === 0) {
|
|
1011
|
+
let e = k ? _e(k) : null;
|
|
1012
|
+
e && Ae(ke({
|
|
1013
|
+
entity: S,
|
|
1014
1014
|
formData: e,
|
|
1015
1015
|
record: void 0,
|
|
1016
1016
|
isNew: !0
|
|
1017
1017
|
})).forEach((e) => {
|
|
1018
|
-
|
|
1018
|
+
_.registerDraft({
|
|
1019
1019
|
fileId: e,
|
|
1020
|
-
discard: () =>
|
|
1020
|
+
discard: () => p(e)
|
|
1021
1021
|
});
|
|
1022
1022
|
});
|
|
1023
1023
|
let t = {};
|
|
@@ -1027,16 +1027,16 @@ function yt({ screenCode: t }) {
|
|
|
1027
1027
|
t[n] = r;
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
|
-
let i =
|
|
1031
|
-
t[n] =
|
|
1032
|
-
}),
|
|
1030
|
+
let i = Ee(S, X, n);
|
|
1031
|
+
t[n] = Ce(S, n) ? i ?? null : i ?? "";
|
|
1032
|
+
}), et(t);
|
|
1033
1033
|
}
|
|
1034
|
-
if (
|
|
1034
|
+
if (S.children !== void 0 && S.children.length > 0 && G === void 0) {
|
|
1035
1035
|
let e = X.$children;
|
|
1036
1036
|
if (e && Object.keys(e).length > 0) {
|
|
1037
1037
|
let t = {};
|
|
1038
1038
|
for (let [n, r] of Object.entries(e)) {
|
|
1039
|
-
let e =
|
|
1039
|
+
let e = f?.entities[n];
|
|
1040
1040
|
t[n] = r.map((t) => ({
|
|
1041
1041
|
...t,
|
|
1042
1042
|
_key: vt(e, t)
|
|
@@ -1045,46 +1045,46 @@ function yt({ screenCode: t }) {
|
|
|
1045
1045
|
K(t), q(e);
|
|
1046
1046
|
} else K({}), q({});
|
|
1047
1047
|
}
|
|
1048
|
-
|
|
1048
|
+
c((e) => {
|
|
1049
1049
|
let t = new URLSearchParams(e);
|
|
1050
1050
|
return t.delete("edit"), t;
|
|
1051
1051
|
}, { replace: !0 });
|
|
1052
1052
|
}
|
|
1053
1053
|
}, [
|
|
1054
|
-
|
|
1054
|
+
Ge,
|
|
1055
1055
|
X,
|
|
1056
1056
|
It,
|
|
1057
|
-
|
|
1058
|
-
|
|
1057
|
+
T,
|
|
1058
|
+
S,
|
|
1059
1059
|
G,
|
|
1060
|
-
|
|
1061
|
-
]),
|
|
1062
|
-
!
|
|
1060
|
+
f
|
|
1061
|
+
]), F(() => {
|
|
1062
|
+
!A || !w || !S?.children || S.children.length === 0 || G === void 0 && (K({}), q({}));
|
|
1063
1063
|
}, [
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1064
|
+
A,
|
|
1065
|
+
w,
|
|
1066
|
+
S?.children
|
|
1067
1067
|
]);
|
|
1068
|
-
let Lt =
|
|
1069
|
-
if (await
|
|
1070
|
-
let e =
|
|
1068
|
+
let Lt = P(async () => {
|
|
1069
|
+
if (await _.flushAllDrafts(), A) {
|
|
1070
|
+
let e = b?.route?.replace("/:id", "") ?? "/";
|
|
1071
1071
|
a(e);
|
|
1072
|
-
} else
|
|
1072
|
+
} else R(!1), et({}), U({}), nt({}), K(void 0), q(void 0), ft(!1);
|
|
1073
1073
|
}, [
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1074
|
+
_,
|
|
1075
|
+
A,
|
|
1076
|
+
b,
|
|
1077
1077
|
a
|
|
1078
|
-
]), Rt =
|
|
1079
|
-
|
|
1078
|
+
]), Rt = P((e, t) => {
|
|
1079
|
+
et((n) => ({
|
|
1080
1080
|
...n,
|
|
1081
1081
|
[e]: t
|
|
1082
1082
|
}));
|
|
1083
|
-
}, []), Q =
|
|
1084
|
-
if (!
|
|
1085
|
-
let e =
|
|
1083
|
+
}, []), Q = I(() => {
|
|
1084
|
+
if (!b?.route) return "/";
|
|
1085
|
+
let e = b.route.split("/");
|
|
1086
1086
|
return e.pop(), e.join("/") || "/";
|
|
1087
|
-
}, [
|
|
1087
|
+
}, [b]), zt = I(() => !f?.screens || !Q || Q === "/" ? !1 : Object.values(f.screens).some((e) => e.route === Q), [f, Q]), Bt = Me({ fallback: P(() => {
|
|
1088
1088
|
if (!zt) {
|
|
1089
1089
|
a("/");
|
|
1090
1090
|
return;
|
|
@@ -1096,39 +1096,39 @@ function yt({ screenCode: t }) {
|
|
|
1096
1096
|
Q,
|
|
1097
1097
|
Ft,
|
|
1098
1098
|
a
|
|
1099
|
-
]) }), Vt = !
|
|
1100
|
-
if (!
|
|
1099
|
+
]) }), Vt = !O && (Bt.hasOriginBack || Bt.allowFallbackBack && !!zt), Ht = r(), Ut = I(() => {
|
|
1100
|
+
if (!S) return {};
|
|
1101
1101
|
let e = {};
|
|
1102
|
-
for (let t of dt(
|
|
1103
|
-
for (let t of pt(
|
|
1102
|
+
for (let t of dt(S, z, A)) It.has(t) && (e[t] = "Required");
|
|
1103
|
+
for (let t of pt(S, z)) It.has(t) && (e[t] = "Invalid email address");
|
|
1104
1104
|
return e;
|
|
1105
1105
|
}, [
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1106
|
+
S,
|
|
1107
|
+
z,
|
|
1108
|
+
A,
|
|
1109
1109
|
It
|
|
1110
|
-
]), Wt = Object.keys(Ut).length > 0, Gt =
|
|
1111
|
-
if (!
|
|
1112
|
-
let e = {}, t =
|
|
1113
|
-
entity:
|
|
1114
|
-
formData:
|
|
1110
|
+
]), Wt = Object.keys(Ut).length > 0, Gt = P(() => {
|
|
1111
|
+
if (!C || !S || A && !w || !A && !T || (ft(!0), Wt)) return;
|
|
1112
|
+
let e = {}, t = ke({
|
|
1113
|
+
entity: S,
|
|
1114
|
+
formData: z,
|
|
1115
1115
|
record: X,
|
|
1116
|
-
isNew:
|
|
1117
|
-
}), n =
|
|
1118
|
-
if (
|
|
1119
|
-
if (
|
|
1120
|
-
let r =
|
|
1116
|
+
isNew: A
|
|
1117
|
+
}), n = Ae(t);
|
|
1118
|
+
if (A) for (let [t, n] of Object.entries(z)) {
|
|
1119
|
+
if (S.files?.has(t)) continue;
|
|
1120
|
+
let r = je(S, t, n);
|
|
1121
1121
|
r !== "" && r != null && (e[t] = r);
|
|
1122
1122
|
}
|
|
1123
1123
|
else {
|
|
1124
|
-
for (let [t, n] of Object.entries(
|
|
1125
|
-
if (
|
|
1126
|
-
let r = X ?
|
|
1124
|
+
for (let [t, n] of Object.entries(z)) {
|
|
1125
|
+
if (S.files?.has(t)) continue;
|
|
1126
|
+
let r = X ? Ee(S, X, t) : void 0, i = je(S, t, n), a = je(S, t, r);
|
|
1127
1127
|
(i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
|
|
1128
1128
|
}
|
|
1129
1129
|
Z && (e.$row_version = Z);
|
|
1130
1130
|
}
|
|
1131
|
-
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(
|
|
1131
|
+
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(H).length > 0 && (e.$statuses = Object.entries(H).map(([e, t]) => ({
|
|
1132
1132
|
status_group_code: e,
|
|
1133
1133
|
status_code: t
|
|
1134
1134
|
}))), Object.keys(W).length > 0 && (e.$properties = Object.entries(W).map(([e, t]) => ({
|
|
@@ -1141,81 +1141,81 @@ function yt({ screenCode: t }) {
|
|
|
1141
1141
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
1142
1142
|
return i;
|
|
1143
1143
|
}), i = st?.[e] ?? [];
|
|
1144
|
-
(
|
|
1144
|
+
(A || !_t(r, i)) && (t[e] = r);
|
|
1145
1145
|
}
|
|
1146
1146
|
Object.keys(t).length > 0 && (e.$children = t);
|
|
1147
1147
|
}
|
|
1148
|
-
if (!
|
|
1149
|
-
|
|
1148
|
+
if (!A && Object.keys(e).length === 0) {
|
|
1149
|
+
R(!1), U({}), nt({}), K(void 0), q(void 0), ft(!1);
|
|
1150
1150
|
return;
|
|
1151
1151
|
}
|
|
1152
1152
|
let r = () => {
|
|
1153
|
-
|
|
1153
|
+
R(!1), ot(!1), ft(!1), U({}), nt({}), K(void 0), q(void 0);
|
|
1154
1154
|
};
|
|
1155
|
-
|
|
1156
|
-
n.forEach((e) =>
|
|
1157
|
-
let t = e.data, i =
|
|
1155
|
+
A ? De.mutate(e, { onSuccess: (e) => {
|
|
1156
|
+
n.forEach((e) => _.markCommitted(e));
|
|
1157
|
+
let t = e.data, i = h(S ? x(S, t) : {});
|
|
1158
1158
|
a(i ? `${Q}/${encodeURIComponent(i)}` : Q, { replace: !0 }), r();
|
|
1159
|
-
} }) :
|
|
1160
|
-
pkValues:
|
|
1159
|
+
} }) : j && Fe.mutate({
|
|
1160
|
+
pkValues: j,
|
|
1161
1161
|
data: e
|
|
1162
1162
|
}, {
|
|
1163
1163
|
onSuccess: () => {
|
|
1164
|
-
n.forEach((e) =>
|
|
1164
|
+
n.forEach((e) => _.markCommitted(e)), r();
|
|
1165
1165
|
},
|
|
1166
1166
|
onError: (e) => {
|
|
1167
|
-
e instanceof
|
|
1167
|
+
e instanceof se && e.code === "STALE_OBJECT" && ot(!0);
|
|
1168
1168
|
}
|
|
1169
1169
|
});
|
|
1170
1170
|
}, [
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1171
|
+
_,
|
|
1172
|
+
A,
|
|
1173
|
+
w,
|
|
1174
|
+
T,
|
|
1175
|
+
C,
|
|
1176
|
+
z,
|
|
1177
1177
|
Wt,
|
|
1178
|
-
|
|
1178
|
+
H,
|
|
1179
1179
|
W,
|
|
1180
1180
|
G,
|
|
1181
1181
|
st,
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1182
|
+
De,
|
|
1183
|
+
Fe,
|
|
1184
|
+
S,
|
|
1185
1185
|
a,
|
|
1186
1186
|
Q,
|
|
1187
1187
|
X,
|
|
1188
1188
|
Z,
|
|
1189
|
-
|
|
1190
|
-
]), Kt =
|
|
1189
|
+
j
|
|
1190
|
+
]), Kt = P((e, t) => {
|
|
1191
1191
|
K((n) => ({
|
|
1192
1192
|
...n ?? {},
|
|
1193
1193
|
[e]: t
|
|
1194
1194
|
}));
|
|
1195
|
-
}, []), qt =
|
|
1196
|
-
!
|
|
1195
|
+
}, []), qt = P(() => {
|
|
1196
|
+
!j || A || !E || Ie.mutate(j);
|
|
1197
1197
|
}, [
|
|
1198
|
-
|
|
1199
|
-
N,
|
|
1198
|
+
j,
|
|
1200
1199
|
A,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
if (!
|
|
1205
|
-
if (!
|
|
1200
|
+
E,
|
|
1201
|
+
Ie
|
|
1202
|
+
]), Jt = I(() => ht(G, f), [G, f]), Yt = Object.keys(Jt).length > 0;
|
|
1203
|
+
if (!b || !S) return null;
|
|
1204
|
+
if (!A && ge) return /* @__PURE__ */ B(He, {});
|
|
1205
|
+
if (!A && !X || jt) return /* @__PURE__ */ V("div", {
|
|
1206
1206
|
style: { padding: 24 },
|
|
1207
|
-
children: [/* @__PURE__ */
|
|
1207
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1208
1208
|
style: {
|
|
1209
1209
|
display: "flex",
|
|
1210
1210
|
alignItems: "center",
|
|
1211
1211
|
gap: 8,
|
|
1212
1212
|
marginBottom: 8
|
|
1213
1213
|
},
|
|
1214
|
-
children: [Vt && /* @__PURE__ */
|
|
1215
|
-
icon: /* @__PURE__ */
|
|
1214
|
+
children: [Vt && /* @__PURE__ */ B(ee, {
|
|
1215
|
+
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1216
1216
|
onClick: Bt.goBack,
|
|
1217
1217
|
title: "Back"
|
|
1218
|
-
}), /* @__PURE__ */
|
|
1218
|
+
}), /* @__PURE__ */ B("h1", {
|
|
1219
1219
|
style: {
|
|
1220
1220
|
margin: 0,
|
|
1221
1221
|
fontSize: 18,
|
|
@@ -1224,29 +1224,29 @@ function yt({ screenCode: t }) {
|
|
|
1224
1224
|
},
|
|
1225
1225
|
children: "Not Found"
|
|
1226
1226
|
})]
|
|
1227
|
-
}), /* @__PURE__ */
|
|
1227
|
+
}), /* @__PURE__ */ B("p", {
|
|
1228
1228
|
style: { color: "var(--text-3)" },
|
|
1229
1229
|
children: "Record not found."
|
|
1230
1230
|
})]
|
|
1231
1231
|
});
|
|
1232
|
-
let Xt =
|
|
1233
|
-
entity:
|
|
1234
|
-
screen:
|
|
1232
|
+
let Xt = S.display, Zt = D(b.display?.name) || D(Xt.name), Qt = v(X, S), $t = A ? `New ${Zt}` : Qt ? String(Qt) : Zt, en = De.isPending || Fe.isPending, tn = b.responsive?.[y.category]?.layout, nn = tn?.tabs ?? (y.isPhone ? "sections" : void 0), rn = tn?.header_card === !0 ? Be({
|
|
1233
|
+
entity: S,
|
|
1234
|
+
screen: b
|
|
1235
1235
|
}) : void 0, $ = {
|
|
1236
|
-
schema:
|
|
1237
|
-
entity:
|
|
1238
|
-
entityCode:
|
|
1239
|
-
recordId:
|
|
1236
|
+
schema: f,
|
|
1237
|
+
entity: S,
|
|
1238
|
+
entityCode: C,
|
|
1239
|
+
recordId: M ?? k ?? "",
|
|
1240
1240
|
record: J ? {
|
|
1241
1241
|
...X ?? {},
|
|
1242
|
-
...
|
|
1242
|
+
...z
|
|
1243
1243
|
} : X ?? {},
|
|
1244
|
-
isNew:
|
|
1244
|
+
isNew: A,
|
|
1245
1245
|
mode: J ? "edit" : "display",
|
|
1246
1246
|
onFieldChange: J ? Rt : void 0,
|
|
1247
1247
|
refs: Et,
|
|
1248
1248
|
objectProperties: (() => {
|
|
1249
|
-
let e =
|
|
1249
|
+
let e = We ?? [];
|
|
1250
1250
|
if (!J || Object.keys(W).length === 0) return e.length > 0 ? e : void 0;
|
|
1251
1251
|
let t = e.map((e) => W[e.property_code] === void 0 ? e : {
|
|
1252
1252
|
...e,
|
|
@@ -1260,27 +1260,27 @@ function yt({ screenCode: t }) {
|
|
|
1260
1260
|
});
|
|
1261
1261
|
return t;
|
|
1262
1262
|
})(),
|
|
1263
|
-
onSetProperty:
|
|
1263
|
+
onSetProperty: A || !T ? void 0 : J ? (e, t) => nt((n) => ({
|
|
1264
1264
|
...n,
|
|
1265
1265
|
[e]: t
|
|
1266
1266
|
})) : void 0,
|
|
1267
1267
|
isPropertyPending: !1,
|
|
1268
1268
|
objectStatuses: (() => {
|
|
1269
|
-
let e =
|
|
1270
|
-
if (!J || Object.keys(
|
|
1271
|
-
let t = e.map((e) =>
|
|
1269
|
+
let e = Ue ?? [];
|
|
1270
|
+
if (!J || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
|
|
1271
|
+
let t = e.map((e) => H[e.group_code] === void 0 ? e : {
|
|
1272
1272
|
...e,
|
|
1273
|
-
status_code:
|
|
1273
|
+
status_code: H[e.group_code]
|
|
1274
1274
|
});
|
|
1275
|
-
for (let [n, r] of Object.entries(
|
|
1275
|
+
for (let [n, r] of Object.entries(H)) e.some((e) => e.group_code === n) || t.push({
|
|
1276
1276
|
group_code: n,
|
|
1277
1277
|
status_code: r,
|
|
1278
1278
|
status_name: {},
|
|
1279
|
-
set_at:
|
|
1279
|
+
set_at: d()
|
|
1280
1280
|
});
|
|
1281
1281
|
return t;
|
|
1282
1282
|
})(),
|
|
1283
|
-
onSetStatus:
|
|
1283
|
+
onSetStatus: A || !T ? void 0 : J ? (e, t) => U((n) => ({
|
|
1284
1284
|
...n,
|
|
1285
1285
|
[e]: t
|
|
1286
1286
|
})) : void 0,
|
|
@@ -1291,32 +1291,32 @@ function yt({ screenCode: t }) {
|
|
|
1291
1291
|
fieldErrors: J && ut ? Ut : void 0,
|
|
1292
1292
|
detailTabsPresentation: nn,
|
|
1293
1293
|
relatedRecordsPresentation: tn?.related_records
|
|
1294
|
-
}, an = !!
|
|
1295
|
-
screen:
|
|
1296
|
-
entity:
|
|
1297
|
-
entityCode:
|
|
1294
|
+
}, an = !!b.sidebar && b.sidebar.length > 0, on = tn?.sidebar === "hidden", sn = an && !on && !y.isDesktop, cn = an && !on && y.isDesktop, ln = !A && X ? /* @__PURE__ */ B(it, {
|
|
1295
|
+
screen: b,
|
|
1296
|
+
entity: S,
|
|
1297
|
+
entityCode: C,
|
|
1298
1298
|
record: X,
|
|
1299
1299
|
refs: Et,
|
|
1300
|
-
objectStatuses:
|
|
1301
|
-
schema:
|
|
1300
|
+
objectStatuses: Ue,
|
|
1301
|
+
schema: f,
|
|
1302
1302
|
locale: Ht
|
|
1303
|
-
}) : void 0, un = /* @__PURE__ */
|
|
1303
|
+
}) : void 0, un = /* @__PURE__ */ B(Ct, {
|
|
1304
1304
|
title: $t,
|
|
1305
|
-
recordId:
|
|
1305
|
+
recordId: k,
|
|
1306
1306
|
editing: J,
|
|
1307
|
-
isNew:
|
|
1307
|
+
isNew: A,
|
|
1308
1308
|
isRecordDeleted: Ot,
|
|
1309
|
-
dirty:
|
|
1309
|
+
dirty: N,
|
|
1310
1310
|
isSaving: en,
|
|
1311
1311
|
hasChildErrors: Yt,
|
|
1312
1312
|
hasFieldErrors: ut && Wt,
|
|
1313
|
-
canRestore:
|
|
1314
|
-
entity:
|
|
1315
|
-
screen:
|
|
1316
|
-
globalActions:
|
|
1317
|
-
entityCode:
|
|
1313
|
+
canRestore: E,
|
|
1314
|
+
entity: S,
|
|
1315
|
+
screen: b,
|
|
1316
|
+
globalActions: f?.actions,
|
|
1317
|
+
entityCode: C,
|
|
1318
1318
|
record: X,
|
|
1319
|
-
id:
|
|
1319
|
+
id: k,
|
|
1320
1320
|
listRoute: Q,
|
|
1321
1321
|
listRouteExists: !!zt,
|
|
1322
1322
|
highlights: ln,
|
|
@@ -1325,16 +1325,16 @@ function yt({ screenCode: t }) {
|
|
|
1325
1325
|
onCancelEdit: Lt,
|
|
1326
1326
|
onSave: Gt,
|
|
1327
1327
|
onRestore: qt,
|
|
1328
|
-
isRestoring:
|
|
1328
|
+
isRestoring: Ie.isPending,
|
|
1329
1329
|
refreshControl: {
|
|
1330
|
-
refetch:
|
|
1331
|
-
isFetching:
|
|
1332
|
-
isLoading:
|
|
1333
|
-
isLive:
|
|
1330
|
+
refetch: me.refetch,
|
|
1331
|
+
isFetching: me.isFetching,
|
|
1332
|
+
isLoading: me.isLoading,
|
|
1333
|
+
isLive: Te
|
|
1334
1334
|
},
|
|
1335
|
-
isRealtimeEntity:
|
|
1336
|
-
canManageTemplates:
|
|
1337
|
-
}), dn = Ot && /* @__PURE__ */
|
|
1335
|
+
isRealtimeEntity: S?.realtime === !0,
|
|
1336
|
+
canManageTemplates: pe(f)
|
|
1337
|
+
}), dn = Ot && /* @__PURE__ */ V("div", {
|
|
1338
1338
|
style: {
|
|
1339
1339
|
display: "flex",
|
|
1340
1340
|
alignItems: "center",
|
|
@@ -1347,8 +1347,8 @@ function yt({ screenCode: t }) {
|
|
|
1347
1347
|
color: "var(--danger)",
|
|
1348
1348
|
fontSize: 12.5
|
|
1349
1349
|
},
|
|
1350
|
-
children: [/* @__PURE__ */
|
|
1351
|
-
}), fn = at && /* @__PURE__ */
|
|
1350
|
+
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ", g(String(X[S.soft_delete]))] })]
|
|
1351
|
+
}), fn = at && /* @__PURE__ */ V("div", {
|
|
1352
1352
|
style: {
|
|
1353
1353
|
display: "flex",
|
|
1354
1354
|
alignItems: "center",
|
|
@@ -1361,73 +1361,73 @@ function yt({ screenCode: t }) {
|
|
|
1361
1361
|
color: "var(--warn)",
|
|
1362
1362
|
fontSize: 12.5
|
|
1363
1363
|
},
|
|
1364
|
-
children: [/* @__PURE__ */
|
|
1365
|
-
}), pn = J && ut && Wt && /* @__PURE__ */
|
|
1364
|
+
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: "This record changed on the server while you were viewing or editing it." })]
|
|
1365
|
+
}), pn = J && ut && Wt && /* @__PURE__ */ B(rt, {
|
|
1366
1366
|
errors: Object.entries(Ut).map(([e, t]) => {
|
|
1367
|
-
let n =
|
|
1367
|
+
let n = S.fields.get(e);
|
|
1368
1368
|
return {
|
|
1369
1369
|
name: e,
|
|
1370
|
-
label: n ?
|
|
1370
|
+
label: n ? ce(n, e, f?.entities) : e,
|
|
1371
1371
|
message: t
|
|
1372
1372
|
};
|
|
1373
1373
|
}),
|
|
1374
1374
|
onJump: (e) => {
|
|
1375
|
-
let t = document.getElementById(`${
|
|
1375
|
+
let t = document.getElementById(`${C}-${e}`);
|
|
1376
1376
|
t && (t.scrollIntoView({
|
|
1377
1377
|
block: "center",
|
|
1378
1378
|
behavior: "smooth"
|
|
1379
1379
|
}), t.focus?.());
|
|
1380
1380
|
}
|
|
1381
|
-
}), mn =
|
|
1381
|
+
}), mn = Re && !A && !(b.items && b.items.length > 0) && /* @__PURE__ */ B("div", {
|
|
1382
1382
|
className: "mb-4",
|
|
1383
|
-
children: /* @__PURE__ */
|
|
1384
|
-
statusGroups:
|
|
1383
|
+
children: /* @__PURE__ */ B(Ke, {
|
|
1384
|
+
statusGroups: S.status_groups ?? {},
|
|
1385
1385
|
objectStatuses: $.objectStatuses,
|
|
1386
|
-
onSetStatus:
|
|
1386
|
+
onSetStatus: T && J ? (e, t) => U((n) => ({
|
|
1387
1387
|
...n,
|
|
1388
1388
|
[e]: t
|
|
1389
1389
|
})) : gt,
|
|
1390
1390
|
isPending: !1,
|
|
1391
1391
|
mode: J ? "edit" : "display"
|
|
1392
1392
|
})
|
|
1393
|
-
}), hn =
|
|
1393
|
+
}), hn = S.evidence_covered && !A && X && /* @__PURE__ */ B("div", {
|
|
1394
1394
|
className: "mb-4",
|
|
1395
|
-
children: /* @__PURE__ */
|
|
1396
|
-
}), gn = /* @__PURE__ */
|
|
1397
|
-
rn && (X ||
|
|
1395
|
+
children: /* @__PURE__ */ B(lt, { evidence: X.$evidence })
|
|
1396
|
+
}), gn = /* @__PURE__ */ V(Qe, { children: [
|
|
1397
|
+
rn && (X || A) && /* @__PURE__ */ B(bt, {
|
|
1398
1398
|
card: rn,
|
|
1399
|
-
entity:
|
|
1399
|
+
entity: S,
|
|
1400
1400
|
record: $.record,
|
|
1401
1401
|
objectStatuses: $.objectStatuses,
|
|
1402
1402
|
objectProperties: $.objectProperties
|
|
1403
1403
|
}),
|
|
1404
|
-
|
|
1405
|
-
nodes:
|
|
1404
|
+
b.items && b.items.length > 0 && (X || A) && f && /* @__PURE__ */ B(qe, {
|
|
1405
|
+
nodes: b.items,
|
|
1406
1406
|
ctx: $
|
|
1407
1407
|
}),
|
|
1408
|
-
!
|
|
1409
|
-
entityCode:
|
|
1410
|
-
recordId:
|
|
1411
|
-
associations:
|
|
1412
|
-
schema:
|
|
1408
|
+
!A && k && C && S.associations && Object.keys(S.associations).length > 0 && f && /* @__PURE__ */ B($e, {
|
|
1409
|
+
entityCode: C,
|
|
1410
|
+
recordId: M ?? k ?? "",
|
|
1411
|
+
associations: S.associations,
|
|
1412
|
+
schema: f
|
|
1413
1413
|
}),
|
|
1414
|
-
!
|
|
1415
|
-
entityCode:
|
|
1416
|
-
objectId:
|
|
1417
|
-
canGenerateOne: !!
|
|
1418
|
-
canManageTemplates:
|
|
1414
|
+
!A && k && C && /* @__PURE__ */ B(tt, {
|
|
1415
|
+
entityCode: C,
|
|
1416
|
+
objectId: M ?? k,
|
|
1417
|
+
canGenerateOne: !!S?.documents?.generate_one,
|
|
1418
|
+
canManageTemplates: pe(f)
|
|
1419
1419
|
}),
|
|
1420
|
-
!
|
|
1421
|
-
screen:
|
|
1422
|
-
entity:
|
|
1423
|
-
entityCode:
|
|
1420
|
+
!A && X && f && /* @__PURE__ */ B(ct, {
|
|
1421
|
+
screen: b,
|
|
1422
|
+
entity: S,
|
|
1423
|
+
entityCode: C,
|
|
1424
1424
|
record: X,
|
|
1425
1425
|
refs: Et,
|
|
1426
|
-
schema:
|
|
1426
|
+
schema: f,
|
|
1427
1427
|
locale: Ht
|
|
1428
1428
|
})
|
|
1429
1429
|
] });
|
|
1430
|
-
if (cn) return /* @__PURE__ */
|
|
1430
|
+
if (cn) return /* @__PURE__ */ V("div", {
|
|
1431
1431
|
style: {
|
|
1432
1432
|
height: "100%",
|
|
1433
1433
|
display: "flex",
|
|
@@ -1435,7 +1435,7 @@ function yt({ screenCode: t }) {
|
|
|
1435
1435
|
background: "var(--background)"
|
|
1436
1436
|
},
|
|
1437
1437
|
children: [
|
|
1438
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ V("div", {
|
|
1439
1439
|
style: {
|
|
1440
1440
|
flex: 1,
|
|
1441
1441
|
minWidth: 0,
|
|
@@ -1443,7 +1443,7 @@ function yt({ screenCode: t }) {
|
|
|
1443
1443
|
flexDirection: "column",
|
|
1444
1444
|
height: "100%"
|
|
1445
1445
|
},
|
|
1446
|
-
children: [/* @__PURE__ */
|
|
1446
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1447
1447
|
style: {
|
|
1448
1448
|
flexShrink: 0,
|
|
1449
1449
|
padding: "14px 20px 8px"
|
|
@@ -1456,7 +1456,7 @@ function yt({ screenCode: t }) {
|
|
|
1456
1456
|
mn,
|
|
1457
1457
|
hn
|
|
1458
1458
|
]
|
|
1459
|
-
}), /* @__PURE__ */
|
|
1459
|
+
}), /* @__PURE__ */ B("div", {
|
|
1460
1460
|
ref: At,
|
|
1461
1461
|
style: {
|
|
1462
1462
|
flex: 1,
|
|
@@ -1470,11 +1470,11 @@ function yt({ screenCode: t }) {
|
|
|
1470
1470
|
children: gn
|
|
1471
1471
|
})]
|
|
1472
1472
|
}),
|
|
1473
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ B("div", {
|
|
1474
1474
|
className: "detail-resize-handle",
|
|
1475
1475
|
onMouseDown: Tt,
|
|
1476
1476
|
title: "Drag to resize",
|
|
1477
|
-
children: /* @__PURE__ */
|
|
1477
|
+
children: /* @__PURE__ */ B("div", { style: {
|
|
1478
1478
|
position: "absolute",
|
|
1479
1479
|
top: 0,
|
|
1480
1480
|
bottom: 0,
|
|
@@ -1484,22 +1484,22 @@ function yt({ screenCode: t }) {
|
|
|
1484
1484
|
background: "var(--border)"
|
|
1485
1485
|
} })
|
|
1486
1486
|
}),
|
|
1487
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ B("div", {
|
|
1488
1488
|
ref: wt,
|
|
1489
1489
|
style: {
|
|
1490
1490
|
flexShrink: 0,
|
|
1491
1491
|
height: "100%",
|
|
1492
1492
|
width: `${xt}px`
|
|
1493
1493
|
},
|
|
1494
|
-
children: (X ||
|
|
1495
|
-
nodes:
|
|
1494
|
+
children: (X || A) && f && /* @__PURE__ */ B(qe, {
|
|
1495
|
+
nodes: b.sidebar,
|
|
1496
1496
|
ctx: $
|
|
1497
1497
|
})
|
|
1498
1498
|
})
|
|
1499
1499
|
]
|
|
1500
1500
|
});
|
|
1501
1501
|
let _n = y.isPhone ? 12 : 24;
|
|
1502
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ V("div", {
|
|
1503
1503
|
style: {
|
|
1504
1504
|
height: "100%",
|
|
1505
1505
|
display: "flex",
|
|
@@ -1507,7 +1507,7 @@ function yt({ screenCode: t }) {
|
|
|
1507
1507
|
overflow: "hidden",
|
|
1508
1508
|
background: "var(--background)"
|
|
1509
1509
|
},
|
|
1510
|
-
children: [/* @__PURE__ */
|
|
1510
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1511
1511
|
style: {
|
|
1512
1512
|
flexShrink: 0,
|
|
1513
1513
|
padding: y.isPhone ? "14px 12px 8px" : "24px 24px 8px"
|
|
@@ -1520,7 +1520,7 @@ function yt({ screenCode: t }) {
|
|
|
1520
1520
|
mn,
|
|
1521
1521
|
hn
|
|
1522
1522
|
]
|
|
1523
|
-
}), /* @__PURE__ */
|
|
1523
|
+
}), /* @__PURE__ */ V("div", {
|
|
1524
1524
|
ref: At,
|
|
1525
1525
|
style: {
|
|
1526
1526
|
flex: 1,
|
|
@@ -1533,7 +1533,7 @@ function yt({ screenCode: t }) {
|
|
|
1533
1533
|
minWidth: 0,
|
|
1534
1534
|
WebkitOverflowScrolling: "touch"
|
|
1535
1535
|
},
|
|
1536
|
-
children: [gn, sn && (X ||
|
|
1536
|
+
children: [gn, sn && (X || A) && f && /* @__PURE__ */ B("div", {
|
|
1537
1537
|
"data-testid": "detail-sidebar-inline",
|
|
1538
1538
|
style: {
|
|
1539
1539
|
display: "flex",
|
|
@@ -1541,23 +1541,23 @@ function yt({ screenCode: t }) {
|
|
|
1541
1541
|
gap: 16,
|
|
1542
1542
|
minWidth: 0
|
|
1543
1543
|
},
|
|
1544
|
-
children: /* @__PURE__ */
|
|
1545
|
-
nodes:
|
|
1544
|
+
children: /* @__PURE__ */ B(qe, {
|
|
1545
|
+
nodes: b.sidebar,
|
|
1546
1546
|
ctx: $
|
|
1547
1547
|
})
|
|
1548
1548
|
})]
|
|
1549
1549
|
})]
|
|
1550
1550
|
});
|
|
1551
1551
|
}
|
|
1552
|
-
function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties:
|
|
1553
|
-
let
|
|
1554
|
-
let
|
|
1555
|
-
return
|
|
1556
|
-
},
|
|
1552
|
+
function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
1553
|
+
let a = (e) => {
|
|
1554
|
+
let a = xt(t, e, n, r, i);
|
|
1555
|
+
return a != null && f(a) !== "";
|
|
1556
|
+
}, o = (e) => f(xt(t, e, n, r, i)) || /* @__PURE__ */ B("span", {
|
|
1557
1557
|
style: { color: "var(--text-3)" },
|
|
1558
1558
|
children: "-"
|
|
1559
|
-
}),
|
|
1560
|
-
return /* @__PURE__ */
|
|
1559
|
+
}), s = f(e.titleUsesDisplay ? v(n, t) : e.titleField ? xt(t, e.titleField, n, r, i) : void 0) || D(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));
|
|
1560
|
+
return /* @__PURE__ */ V("section", {
|
|
1561
1561
|
"data-testid": "detail-header-card",
|
|
1562
1562
|
style: {
|
|
1563
1563
|
width: "100%",
|
|
@@ -1570,9 +1570,9 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1570
1570
|
boxSizing: "border-box"
|
|
1571
1571
|
},
|
|
1572
1572
|
children: [
|
|
1573
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ V("div", {
|
|
1574
1574
|
style: { minWidth: 0 },
|
|
1575
|
-
children: [/* @__PURE__ */
|
|
1575
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1576
1576
|
style: {
|
|
1577
1577
|
fontSize: 15,
|
|
1578
1578
|
lineHeight: 1.25,
|
|
@@ -1580,8 +1580,8 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1580
1580
|
color: "var(--text)",
|
|
1581
1581
|
overflowWrap: "anywhere"
|
|
1582
1582
|
},
|
|
1583
|
-
children:
|
|
1584
|
-
}), e.subtitleField && /* @__PURE__ */
|
|
1583
|
+
children: s
|
|
1584
|
+
}), e.subtitleField && /* @__PURE__ */ B("div", {
|
|
1585
1585
|
style: {
|
|
1586
1586
|
marginTop: 4,
|
|
1587
1587
|
fontSize: 12.5,
|
|
@@ -1589,17 +1589,17 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1589
1589
|
color: "var(--text-3)",
|
|
1590
1590
|
overflowWrap: "anywhere"
|
|
1591
1591
|
},
|
|
1592
|
-
children:
|
|
1592
|
+
children: o(e.subtitleField)
|
|
1593
1593
|
})]
|
|
1594
1594
|
}),
|
|
1595
|
-
|
|
1595
|
+
c.length > 0 && /* @__PURE__ */ B("div", {
|
|
1596
1596
|
style: {
|
|
1597
1597
|
display: "flex",
|
|
1598
1598
|
flexWrap: "wrap",
|
|
1599
1599
|
gap: 6,
|
|
1600
1600
|
marginTop: 10
|
|
1601
1601
|
},
|
|
1602
|
-
children:
|
|
1602
|
+
children: c.map((e) => /* @__PURE__ */ B("span", {
|
|
1603
1603
|
style: {
|
|
1604
1604
|
minWidth: 0,
|
|
1605
1605
|
maxWidth: "100%",
|
|
@@ -1611,10 +1611,10 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1611
1611
|
lineHeight: 1.4,
|
|
1612
1612
|
overflowWrap: "anywhere"
|
|
1613
1613
|
},
|
|
1614
|
-
children:
|
|
1614
|
+
children: o(e)
|
|
1615
1615
|
}, e))
|
|
1616
1616
|
}),
|
|
1617
|
-
|
|
1617
|
+
l.length > 0 && /* @__PURE__ */ B("dl", {
|
|
1618
1618
|
style: {
|
|
1619
1619
|
display: "grid",
|
|
1620
1620
|
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
@@ -1623,23 +1623,23 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1623
1623
|
fontSize: 12.5,
|
|
1624
1624
|
lineHeight: 1.35
|
|
1625
1625
|
},
|
|
1626
|
-
children:
|
|
1626
|
+
children: l.map((e) => /* @__PURE__ */ V("div", {
|
|
1627
1627
|
style: { display: "contents" },
|
|
1628
|
-
children: [/* @__PURE__ */
|
|
1628
|
+
children: [/* @__PURE__ */ B("dt", {
|
|
1629
1629
|
style: { color: "var(--text-3)" },
|
|
1630
1630
|
children: St(t, e)
|
|
1631
|
-
}), /* @__PURE__ */
|
|
1631
|
+
}), /* @__PURE__ */ B("dd", {
|
|
1632
1632
|
style: {
|
|
1633
1633
|
margin: 0,
|
|
1634
1634
|
color: "var(--text-2)",
|
|
1635
1635
|
minWidth: 0,
|
|
1636
1636
|
overflowWrap: "anywhere"
|
|
1637
1637
|
},
|
|
1638
|
-
children:
|
|
1638
|
+
children: o(e)
|
|
1639
1639
|
})]
|
|
1640
1640
|
}, e))
|
|
1641
1641
|
}),
|
|
1642
|
-
|
|
1642
|
+
u.length > 0 && /* @__PURE__ */ B("div", {
|
|
1643
1643
|
style: {
|
|
1644
1644
|
display: "flex",
|
|
1645
1645
|
flexWrap: "wrap",
|
|
@@ -1648,7 +1648,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1648
1648
|
color: "var(--text-3)",
|
|
1649
1649
|
fontSize: 11.5
|
|
1650
1650
|
},
|
|
1651
|
-
children:
|
|
1651
|
+
children: u.map((e) => /* @__PURE__ */ V("span", {
|
|
1652
1652
|
style: {
|
|
1653
1653
|
minWidth: 0,
|
|
1654
1654
|
overflowWrap: "anywhere"
|
|
@@ -1656,7 +1656,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1656
1656
|
children: [
|
|
1657
1657
|
St(t, e),
|
|
1658
1658
|
": ",
|
|
1659
|
-
|
|
1659
|
+
o(e)
|
|
1660
1660
|
]
|
|
1661
1661
|
}, e))
|
|
1662
1662
|
})
|
|
@@ -1666,74 +1666,74 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1666
1666
|
function xt(e, t, n, r, i) {
|
|
1667
1667
|
if (t.startsWith("$status.")) {
|
|
1668
1668
|
let e = t.slice(8), n = r?.find((t) => t.group_code === e);
|
|
1669
|
-
return
|
|
1669
|
+
return D(n?.status_name) || n?.status_code;
|
|
1670
1670
|
}
|
|
1671
1671
|
if (t.startsWith("$property.")) {
|
|
1672
1672
|
let e = t.slice(10);
|
|
1673
1673
|
return i?.find((t) => t.property_code === e)?.value;
|
|
1674
1674
|
}
|
|
1675
|
-
return
|
|
1675
|
+
return Ee(e, n, t);
|
|
1676
1676
|
}
|
|
1677
1677
|
function St(e, t) {
|
|
1678
1678
|
if (t.startsWith("$status.")) return t.slice(8);
|
|
1679
1679
|
if (t.startsWith("$property.")) return t.slice(10);
|
|
1680
1680
|
let n = e.fields.get(t);
|
|
1681
|
-
return n ?
|
|
1681
|
+
return n ? ce(n, t) : t;
|
|
1682
1682
|
}
|
|
1683
|
-
function Ct({ title:
|
|
1684
|
-
let { run:
|
|
1685
|
-
if (!
|
|
1686
|
-
let e =
|
|
1683
|
+
function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: m, screen: h, globalActions: g, entityCode: _, record: v, id: x, listRoute: ee, listRouteExists: te, highlights: T, showBack: re, onBack: ie, onCancelEdit: ae, onSave: oe, onRestore: se, isRestoring: O, refreshControl: ce, isRealtimeEntity: le, canManageTemplates: k }) {
|
|
1684
|
+
let { run: A } = w(), j = he("detail"), M = Fe(), de = ne(), fe = r(), pe = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), ge = b(c(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), m?.actions, g, v ?? {}, []), _e = b(pe, m?.actions, g, v ?? {}, []), ve = I(() => {
|
|
1685
|
+
if (!m) return;
|
|
1686
|
+
let e = x ? [x] : [];
|
|
1687
1687
|
return {
|
|
1688
|
-
entity:
|
|
1689
|
-
entityCode:
|
|
1690
|
-
screen:
|
|
1691
|
-
screenRoute:
|
|
1692
|
-
selectedRows:
|
|
1688
|
+
entity: m,
|
|
1689
|
+
entityCode: _ ?? "",
|
|
1690
|
+
screen: h,
|
|
1691
|
+
screenRoute: h?.route ?? "",
|
|
1692
|
+
selectedRows: v ? [v] : [],
|
|
1693
1693
|
selectedIds: e,
|
|
1694
|
-
locale:
|
|
1695
|
-
tabNavigate: (e, t) =>
|
|
1694
|
+
locale: fe,
|
|
1695
|
+
tabNavigate: (e, t) => M(e, {
|
|
1696
1696
|
title: t?.title,
|
|
1697
1697
|
icon: t?.icon,
|
|
1698
1698
|
search: t?.search
|
|
1699
1699
|
}),
|
|
1700
|
-
runActionApi: (e, t) =>
|
|
1700
|
+
runActionApi: (e, t) => S(e, t)
|
|
1701
1701
|
};
|
|
1702
1702
|
}, [
|
|
1703
|
-
|
|
1704
|
-
C,
|
|
1703
|
+
m,
|
|
1705
1704
|
_,
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1705
|
+
h,
|
|
1706
|
+
x,
|
|
1707
|
+
v,
|
|
1708
|
+
fe,
|
|
1709
|
+
M
|
|
1710
|
+
]), xe = (e, t) => {
|
|
1711
|
+
let n = Ie(e, t, { row: v ?? void 0 });
|
|
1712
1712
|
if (n === null) return;
|
|
1713
|
-
let r =
|
|
1714
|
-
return
|
|
1713
|
+
let r = x ? [x] : [], i = e === "__delete" && te ? ee : null;
|
|
1714
|
+
return A({
|
|
1715
1715
|
action: t,
|
|
1716
|
-
title:
|
|
1717
|
-
row:
|
|
1718
|
-
execute: (e) =>
|
|
1716
|
+
title: D(t.display?.name) || e,
|
|
1717
|
+
row: v ?? void 0,
|
|
1718
|
+
execute: (e) => S(n, C(e, r)),
|
|
1719
1719
|
onSuccess: i ? () => {
|
|
1720
|
-
|
|
1720
|
+
ue.getState().kill(be(location)), de(i, { replace: !0 });
|
|
1721
1721
|
} : void 0
|
|
1722
1722
|
});
|
|
1723
|
-
},
|
|
1724
|
-
layout:
|
|
1725
|
-
row:
|
|
1726
|
-
onRun:
|
|
1723
|
+
}, Se = j.isVisible("show_actions") && !o && x && ge.length > 0 ? /* @__PURE__ */ B(De, {
|
|
1724
|
+
layout: ge,
|
|
1725
|
+
row: v,
|
|
1726
|
+
onRun: xe,
|
|
1727
1727
|
kind: "detail",
|
|
1728
|
-
entityActions:
|
|
1729
|
-
globalActions:
|
|
1728
|
+
entityActions: m?.actions,
|
|
1729
|
+
globalActions: g,
|
|
1730
1730
|
reservedRightWidth: 0,
|
|
1731
|
-
widgetContext:
|
|
1731
|
+
widgetContext: ve,
|
|
1732
1732
|
constrain: !1
|
|
1733
|
-
}) : null,
|
|
1734
|
-
liveObject:
|
|
1735
|
-
realtime:
|
|
1736
|
-
}) : null,
|
|
1733
|
+
}) : null, Ce = !o && x ? /* @__PURE__ */ B(ye, {
|
|
1734
|
+
liveObject: ce,
|
|
1735
|
+
realtime: le
|
|
1736
|
+
}) : null, we = j.isVisible("show_actions") && !o && x && _e.length > 0 ? /* @__PURE__ */ V("div", {
|
|
1737
1737
|
style: {
|
|
1738
1738
|
display: "flex",
|
|
1739
1739
|
justifyContent: "flex-end",
|
|
@@ -1741,62 +1741,62 @@ function Ct({ title: r, recordId: i, editing: o, isNew: s, isRecordDeleted: c, d
|
|
|
1741
1741
|
gap: 8,
|
|
1742
1742
|
marginTop: 10
|
|
1743
1743
|
},
|
|
1744
|
-
children: [
|
|
1745
|
-
layout:
|
|
1746
|
-
row:
|
|
1747
|
-
onRun:
|
|
1744
|
+
children: [Se ? null : Ce, /* @__PURE__ */ B(De, {
|
|
1745
|
+
layout: _e,
|
|
1746
|
+
row: v,
|
|
1747
|
+
onRun: xe,
|
|
1748
1748
|
kind: "detail",
|
|
1749
|
-
entityActions:
|
|
1750
|
-
globalActions:
|
|
1749
|
+
entityActions: m?.actions,
|
|
1750
|
+
globalActions: g,
|
|
1751
1751
|
reservedRightWidth: 0,
|
|
1752
|
-
widgetContext:
|
|
1753
|
-
ariaLabel:
|
|
1752
|
+
widgetContext: ve,
|
|
1753
|
+
ariaLabel: Se ? "Detail toolbar actions" : "Page actions"
|
|
1754
1754
|
})]
|
|
1755
|
-
}) : null,
|
|
1756
|
-
entityCode:
|
|
1755
|
+
}) : null, Te = j.isVisible("show_actions") && !o && x && _ ? /* @__PURE__ */ B(me, {
|
|
1756
|
+
entityCode: _,
|
|
1757
1757
|
scope: "detail",
|
|
1758
|
-
objectIds: [
|
|
1759
|
-
capability:
|
|
1760
|
-
canManageTemplates:
|
|
1761
|
-
}) : null,
|
|
1758
|
+
objectIds: [x],
|
|
1759
|
+
capability: m?.documents,
|
|
1760
|
+
canManageTemplates: k
|
|
1761
|
+
}) : null, Ee = s ? p ? /* @__PURE__ */ B(E, {
|
|
1762
1762
|
kind: "primary",
|
|
1763
|
-
icon:
|
|
1764
|
-
onClick:
|
|
1765
|
-
disabled:
|
|
1766
|
-
children:
|
|
1767
|
-
}) : null :
|
|
1768
|
-
icon: /* @__PURE__ */
|
|
1769
|
-
onClick:
|
|
1763
|
+
icon: B(O ? y : e.refresh, { size: 13 }),
|
|
1764
|
+
onClick: se,
|
|
1765
|
+
disabled: O,
|
|
1766
|
+
children: O ? "Restoring…" : "Restore"
|
|
1767
|
+
}) : null : a ? /* @__PURE__ */ V(Qe, { children: [/* @__PURE__ */ B(E, {
|
|
1768
|
+
icon: /* @__PURE__ */ B(e.x, { size: 13 }),
|
|
1769
|
+
onClick: ae,
|
|
1770
1770
|
disabled: u,
|
|
1771
1771
|
children: "Cancel"
|
|
1772
|
-
}), /* @__PURE__ */
|
|
1772
|
+
}), /* @__PURE__ */ B(E, {
|
|
1773
1773
|
kind: "primary",
|
|
1774
|
-
icon:
|
|
1775
|
-
onClick:
|
|
1774
|
+
icon: B(u ? y : e.save, { size: 13 }),
|
|
1775
|
+
onClick: oe,
|
|
1776
1776
|
disabled: u || d || f,
|
|
1777
1777
|
title: d ? "Fix errors in child rows" : f ? "Fix the highlighted fields" : void 0,
|
|
1778
1778
|
children: u ? "Saving…" : "Save"
|
|
1779
|
-
})] }) : !
|
|
1779
|
+
})] }) : !o && x ? Se ? /* @__PURE__ */ V("span", {
|
|
1780
1780
|
style: { display: "contents" },
|
|
1781
|
-
children: [
|
|
1782
|
-
}) :
|
|
1783
|
-
return /* @__PURE__ */
|
|
1784
|
-
icon:
|
|
1785
|
-
name:
|
|
1781
|
+
children: [Te, Se]
|
|
1782
|
+
}) : Te : null;
|
|
1783
|
+
return /* @__PURE__ */ V(Qe, { children: [/* @__PURE__ */ B(ut, {
|
|
1784
|
+
icon: m?.display.icon ? /* @__PURE__ */ B(t, {
|
|
1785
|
+
name: m.display.icon,
|
|
1786
1786
|
size: 16
|
|
1787
1787
|
}) : void 0,
|
|
1788
|
-
title:
|
|
1789
|
-
description:
|
|
1788
|
+
title: n,
|
|
1789
|
+
description: D(h?.display?.description) || D(m?.display?.description),
|
|
1790
1790
|
recordId: i,
|
|
1791
|
-
highlights:
|
|
1792
|
-
identityControls: !
|
|
1793
|
-
mode:
|
|
1791
|
+
highlights: T,
|
|
1792
|
+
identityControls: !s && !a && !o ? Ce : null,
|
|
1793
|
+
mode: o ? "create" : a ? "edit" : "display",
|
|
1794
1794
|
dirty: l,
|
|
1795
|
-
showBack:
|
|
1796
|
-
onBack:
|
|
1797
|
-
right:
|
|
1798
|
-
showTitle:
|
|
1799
|
-
}),
|
|
1795
|
+
showBack: re,
|
|
1796
|
+
onBack: ie,
|
|
1797
|
+
right: Ee,
|
|
1798
|
+
showTitle: j.isVisible("show_title")
|
|
1799
|
+
}), we] });
|
|
1800
1800
|
}
|
|
1801
1801
|
//#endregion
|
|
1802
1802
|
export { J as SmartDetailPage };
|