@declarion/react 0.52.0 → 0.54.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-CJCjc_cd.js → DraggableChildrenTable-CPoUY99R.js} +35 -35
- package/dist-lib/{Grid-DUjbQg3r.js → Grid--QAEby8k.js} +28 -28
- package/dist-lib/{LayoutRenderer-DbdxC-Bq.js → LayoutRenderer-BxZ7Nd9b.js} +920 -922
- package/dist-lib/{ListCardsBody-C8ofksQb.js → ListCardsBody-BPV4GPrv.js} +14 -14
- package/dist-lib/{MarkdownRenderer-B9_5fwuE.js → MarkdownRenderer-CIKuh_0i.js} +10 -10
- package/dist-lib/{record-documents-key-8fdm7C10.js → RecordIdBadge-CGxPR-8q.js} +1 -4
- package/dist-lib/{RefreshControl-C-8UCyau.js → RefreshControl-DMLkZP3R.js} +120 -122
- package/dist-lib/{SmartDetailPage.impl-DWjNQ052.js → SmartDetailPage.impl-SnNu6Ug-.js} +376 -377
- package/dist-lib/{SmartListPage.impl-yKBK7a8b.js → SmartListPage.impl-C73pR7Iw.js} +1098 -1099
- package/dist-lib/{SmartRecordListPage.impl-DRpU_DOC.js → SmartRecordListPage.impl-rJjQZe1V.js} +183 -183
- package/dist-lib/{SortHeaderMenu-CbihbEGd.js → SortHeaderMenu-DQ_KrkWk.js} +1 -1
- package/dist-lib/{action-dispatch-C28UhXXA.js → action-dispatch-DsuUS7ae.js} +382 -382
- package/dist-lib/api/agents.d.ts +0 -1
- package/dist-lib/api/events.d.ts +27 -5
- package/dist-lib/{cardProjection-Bp_ZPLUE.js → cardProjection-BadzqyeQ.js} +146 -204
- package/dist-lib/components/actions/ObjectActionBar.d.ts +1 -1
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -1
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -1
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
- package/dist-lib/components/list/PeekFieldCell.d.ts +1 -1
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +2 -2
- package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
- package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
- package/dist-lib/components/pages/list/columns.d.ts +1 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +1 -1
- package/dist-lib/components/pages/list/useListQuery.d.ts +6 -1
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +1 -1
- package/dist-lib/components/pages/list/useListViews.d.ts +1 -1
- package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
- package/dist-lib/components/shared/RefreshControl.d.ts +7 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +9 -0
- package/dist-lib/{field-classification-CeYJlsNq.js → field-classification-sMkkAEg9.js} +301 -320
- package/dist-lib/{format-count-C3N-WxEy.js → format-count-B5SLlNOb.js} +245 -245
- package/dist-lib/hooks/useMutations.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +24 -4
- package/dist-lib/index.js +1586 -1858
- package/dist-lib/lib/action-dispatch.d.ts +1 -1
- package/dist-lib/lib/document-templates.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +43 -0
- package/dist-lib/{peekDraftStore-D3sowXga.js → peekDraftStore-CbHFwz_F.js} +36 -36
- package/dist-lib/{registry-p6CejATt.js → registry-D0RhCnEL.js} +507 -507
- package/dist-lib/stores/realtime.d.ts +20 -0
- package/dist-lib/testing.js +35 -35
- package/dist-lib/types/api.d.ts +8 -4
- package/dist-lib/types/schema.d.ts +6 -0
- package/dist-lib/{useCurrentScreen-74x5yJNb.js → useCurrentScreen-DVTXCj_K.js} +2508 -1557
- package/dist-lib/{useListQuery-D75bgLLz.js → useListQuery-C2nq58YV.js} +13 -10
- package/dist-lib/{useProperties-C5fZp12D.js → useProperties-BcIz-MyO.js} +25 -25
- package/dist-lib/useTabSearchMirror-UYCsopxP.js +177 -0
- package/dist-lib/{value-DKekzcjz.js → value-CQzGOI0F.js} +25 -25
- package/package.json +14 -14
- package/dist-lib/useTabSearchMirror-D_wzoYRz.js +0 -406
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import { $ as n, $n as r,
|
|
3
|
-
import { _ as
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { c as
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import { a as
|
|
11
|
-
import { n as Je, t as Ye } from "./LayoutRenderer-
|
|
2
|
+
import { $ as n, $n as r, $t as i, Bt as a, Cr as o, Dr as s, Fn as c, Fr as l, Gn as u, Gt as d, Ht as f, Ir as p, Jn as m, Kn as h, Nt as g, Pr as _, Qt as v, Tt as y, U as b, Xn as x, Y as S, Yn as C, Yt as w, Zn as T, an as ee, at as E, c as te, cr as ne, g as D, i as re, lr as O, lt as ie, nt as ae, on as oe, qn as se, rt as k, s as ce, sr as le, st as ue, tr as A, wt as j } from "./useCurrentScreen-DVTXCj_K.js";
|
|
3
|
+
import { _ as M, m as N, r as de, s as fe, t as pe } from "./RefreshControl-DMLkZP3R.js";
|
|
4
|
+
import { a as me, f as P, i as he } from "./registry-D0RhCnEL.js";
|
|
5
|
+
import { t as ge } from "./RecordIdBadge-CGxPR-8q.js";
|
|
6
|
+
import { D as _e, M as ve, O as ye, T as be, b as xe, f as Se, g as Ce, l as we, p as Te, u as Ee } from "./field-classification-sMkkAEg9.js";
|
|
7
|
+
import { c as De, f as Oe, h as ke, m as Ae, o as je, p as Me, r as Ne, t as Pe, u as Fe } from "./action-dispatch-DsuUS7ae.js";
|
|
8
|
+
import { a as Ie, c as Le, s as Re, t as ze } from "./cardProjection-BadzqyeQ.js";
|
|
9
|
+
import { n as Be, r as Ve, t as He } from "./dataTableStyles-vwD1mVOP.js";
|
|
10
|
+
import { a as Ue, i as We, o as Ge, r as Ke, s as qe } from "./peekDraftStore-CbHFwz_F.js";
|
|
11
|
+
import { n as Je, t as Ye } from "./LayoutRenderer-BxZ7Nd9b.js";
|
|
12
12
|
import { Fragment as Xe, useCallback as F, useEffect as I, useMemo as L, useRef as Ze, useState as R } from "react";
|
|
13
13
|
import { useLocation as Qe, useParams as $e, useSearchParams as et } from "react-router";
|
|
14
14
|
import { useQuery as z, useQueryClient as tt } from "@tanstack/react-query";
|
|
@@ -18,7 +18,7 @@ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
18
18
|
let a = L(() => Object.entries(r), [r]), [o, s] = R(0);
|
|
19
19
|
if (a.length === 0) return null;
|
|
20
20
|
let [c, l] = a[o];
|
|
21
|
-
return /* @__PURE__ */ B(
|
|
21
|
+
return /* @__PURE__ */ B(P, {
|
|
22
22
|
title: /* @__PURE__ */ B("div", {
|
|
23
23
|
style: {
|
|
24
24
|
display: "flex",
|
|
@@ -51,7 +51,7 @@ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
51
51
|
children: [n.display?.icon && /* @__PURE__ */ B(t, {
|
|
52
52
|
name: n.display.icon,
|
|
53
53
|
size: 13
|
|
54
|
-
}),
|
|
54
|
+
}), T(n.display?.name) || e]
|
|
55
55
|
}, e);
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
@@ -66,41 +66,41 @@ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
66
66
|
})
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema:
|
|
70
|
-
let
|
|
69
|
+
function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: o }) {
|
|
70
|
+
let s = ye(), c = ae(), l = `${t}.${r}`, { data: u, isLoading: d } = z({
|
|
71
71
|
queryKey: [
|
|
72
72
|
"association",
|
|
73
|
-
|
|
73
|
+
l,
|
|
74
74
|
n
|
|
75
75
|
],
|
|
76
|
-
queryFn: () =>
|
|
77
|
-
}),
|
|
76
|
+
queryFn: () => i(l, [n])
|
|
77
|
+
}), f = u?.target_entity ?? a.target, h = o.entities[f], g = L(() => u?.ids ?? [], [u?.ids]), _ = L(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), y = L(() => g.slice(0, 50), [g]), { data: b, isLoading: x } = z({
|
|
78
78
|
queryKey: [
|
|
79
79
|
"association-records",
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
f,
|
|
81
|
+
y
|
|
82
82
|
],
|
|
83
|
-
queryFn: () =>
|
|
83
|
+
queryFn: () => v(f, {
|
|
84
84
|
per_page: 50,
|
|
85
85
|
filters: [{
|
|
86
86
|
field: _,
|
|
87
87
|
op: "in",
|
|
88
|
-
value:
|
|
88
|
+
value: y
|
|
89
89
|
}]
|
|
90
90
|
}),
|
|
91
|
-
enabled:
|
|
92
|
-
}),
|
|
91
|
+
enabled: y.length > 0 && !!h
|
|
92
|
+
}), C = b?.data ?? [], w = b?.$refs, ee = L(() => h ? h.fields.names().filter((e) => {
|
|
93
93
|
let t = h.fields.get(e);
|
|
94
94
|
return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
|
|
95
|
-
}).slice(0, 6) : [], [h]),
|
|
96
|
-
let e = o
|
|
95
|
+
}).slice(0, 6) : [], [h]), E = () => {
|
|
96
|
+
let e = S(o, f);
|
|
97
97
|
if (!e) return;
|
|
98
|
-
let t =
|
|
98
|
+
let t = T(a.display?.name) || r, n = new URLSearchParams();
|
|
99
99
|
n.set("filters", JSON.stringify([{
|
|
100
100
|
field: _,
|
|
101
101
|
op: "in",
|
|
102
102
|
value: g
|
|
103
|
-
}])),
|
|
103
|
+
}])), s(e.route, {
|
|
104
104
|
title: t,
|
|
105
105
|
icon: a.display?.icon || e.icon,
|
|
106
106
|
search: n.toString()
|
|
@@ -110,7 +110,7 @@ function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: s
|
|
|
110
110
|
color: "var(--text-3)",
|
|
111
111
|
padding: "14px 16px"
|
|
112
112
|
};
|
|
113
|
-
if (
|
|
113
|
+
if (d || x) return /* @__PURE__ */ B("div", {
|
|
114
114
|
style: te,
|
|
115
115
|
children: "Loading…"
|
|
116
116
|
});
|
|
@@ -122,55 +122,55 @@ function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: s
|
|
|
122
122
|
style: te,
|
|
123
123
|
children: "No related records."
|
|
124
124
|
});
|
|
125
|
-
let
|
|
125
|
+
let ne = S(o, f);
|
|
126
126
|
return /* @__PURE__ */ V("div", {
|
|
127
127
|
style: { padding: "8px 0" },
|
|
128
128
|
children: [
|
|
129
129
|
/* @__PURE__ */ V("table", {
|
|
130
|
-
style:
|
|
131
|
-
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children:
|
|
132
|
-
style:
|
|
133
|
-
children:
|
|
134
|
-
}, e)) }) }), /* @__PURE__ */ B("tbody", { children:
|
|
130
|
+
style: Ve,
|
|
131
|
+
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: ee.map((e) => /* @__PURE__ */ B("th", {
|
|
132
|
+
style: Be,
|
|
133
|
+
children: m(h.fields.get(e), e, o.entities)
|
|
134
|
+
}, e)) }) }), /* @__PURE__ */ B("tbody", { children: C.map((e, t) => /* @__PURE__ */ B("tr", { children: ee.map((t) => {
|
|
135
135
|
let n = h.fields.get(t);
|
|
136
136
|
return n ? /* @__PURE__ */ B("td", {
|
|
137
|
-
style:
|
|
138
|
-
children:
|
|
137
|
+
style: He,
|
|
138
|
+
children: k({
|
|
139
139
|
field: n,
|
|
140
140
|
fieldName: t,
|
|
141
141
|
value: e[t],
|
|
142
142
|
mode: "display",
|
|
143
143
|
record: e,
|
|
144
|
-
refs:
|
|
145
|
-
locale:
|
|
144
|
+
refs: w,
|
|
145
|
+
locale: c
|
|
146
146
|
})
|
|
147
147
|
}, t) : /* @__PURE__ */ B("td", {}, t);
|
|
148
148
|
}) }, t)) })]
|
|
149
149
|
}),
|
|
150
|
-
|
|
150
|
+
ne && u && u.count > C.length && /* @__PURE__ */ B("div", {
|
|
151
151
|
style: {
|
|
152
152
|
padding: "10px 16px",
|
|
153
153
|
textAlign: "center"
|
|
154
154
|
},
|
|
155
|
-
children: /* @__PURE__ */ V(
|
|
155
|
+
children: /* @__PURE__ */ V(p, {
|
|
156
156
|
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
157
|
-
onClick:
|
|
157
|
+
onClick: E,
|
|
158
158
|
children: [
|
|
159
159
|
"View all ",
|
|
160
|
-
|
|
160
|
+
u.count,
|
|
161
161
|
" records"
|
|
162
162
|
]
|
|
163
163
|
})
|
|
164
164
|
}),
|
|
165
|
-
|
|
165
|
+
ne && C.length > 0 && u && u.count <= C.length && /* @__PURE__ */ B("div", {
|
|
166
166
|
style: {
|
|
167
167
|
padding: "10px 16px",
|
|
168
168
|
textAlign: "center"
|
|
169
169
|
},
|
|
170
|
-
children: /* @__PURE__ */ B(
|
|
170
|
+
children: /* @__PURE__ */ B(p, {
|
|
171
171
|
kind: "ghost",
|
|
172
172
|
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
173
|
-
onClick:
|
|
173
|
+
onClick: E,
|
|
174
174
|
children: "Open in list view"
|
|
175
175
|
})
|
|
176
176
|
})
|
|
@@ -186,18 +186,18 @@ function U(e) {
|
|
|
186
186
|
function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
|
|
187
187
|
let { data: a, isLoading: o, error: s } = z({
|
|
188
188
|
queryKey: [
|
|
189
|
-
|
|
189
|
+
D,
|
|
190
190
|
t,
|
|
191
191
|
n
|
|
192
192
|
],
|
|
193
|
-
queryFn: async () => (await
|
|
193
|
+
queryFn: async () => (await w("document.object_links", {
|
|
194
194
|
entity: t,
|
|
195
195
|
object_id: n
|
|
196
196
|
})).result?.documents ?? [],
|
|
197
197
|
enabled: !!(t && n) && (!!r || !!i),
|
|
198
198
|
refetchInterval: (e) => U(e.state.data)
|
|
199
199
|
}), c = (a?.length ?? 0) > 0;
|
|
200
|
-
return !r && !c ? null : /* @__PURE__ */ V(
|
|
200
|
+
return !r && !c ? null : /* @__PURE__ */ V(P, {
|
|
201
201
|
title: /* @__PURE__ */ B(ot, {}),
|
|
202
202
|
collapsible: !1,
|
|
203
203
|
padding: "0",
|
|
@@ -243,51 +243,51 @@ function ot() {
|
|
|
243
243
|
children: [/* @__PURE__ */ B(e.file, { size: 13 }), "Documents"]
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
function W({ entityCode: t, objectId:
|
|
247
|
-
let
|
|
248
|
-
async function
|
|
249
|
-
|
|
246
|
+
function W({ entityCode: t, objectId: n, doc: r }) {
|
|
247
|
+
let i = tt(), [a, o] = R(!1), [s, c] = R(!1), [l, u] = R(!1), [d, f] = R(!1), [m, h] = R(null), g = T(r.title) || r.filename || r.template_code, _ = r.status === "ready" && r.download_url && !d;
|
|
248
|
+
async function v() {
|
|
249
|
+
o(!0), h(null);
|
|
250
250
|
try {
|
|
251
|
-
let e = (await
|
|
252
|
-
generated_document_id:
|
|
251
|
+
let e = (await w("document.download_format", {
|
|
252
|
+
generated_document_id: r.generated_document_id,
|
|
253
253
|
format: "pdf"
|
|
254
254
|
})).result;
|
|
255
|
-
e?.download_url && await
|
|
255
|
+
e?.download_url && await j(e.download_url, e.filename);
|
|
256
256
|
} catch (e) {
|
|
257
|
-
|
|
257
|
+
y(e) ? (f(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
|
|
258
258
|
} finally {
|
|
259
|
-
|
|
259
|
+
o(!1);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
async function
|
|
263
|
-
if (
|
|
264
|
-
|
|
262
|
+
async function b() {
|
|
263
|
+
if (r.download_url) {
|
|
264
|
+
c(!0), h(null);
|
|
265
265
|
try {
|
|
266
|
-
await
|
|
266
|
+
await j(r.download_url, r.filename);
|
|
267
267
|
} catch (e) {
|
|
268
|
-
|
|
268
|
+
y(e) ? (f(!0), h("Artifact unavailable")) : h(e instanceof Error ? e.message : String(e));
|
|
269
269
|
} finally {
|
|
270
|
-
|
|
270
|
+
c(!1);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
async function
|
|
275
|
-
|
|
274
|
+
async function x() {
|
|
275
|
+
u(!0), h(null);
|
|
276
276
|
try {
|
|
277
|
-
await
|
|
278
|
-
...
|
|
279
|
-
template_code:
|
|
280
|
-
template_source:
|
|
281
|
-
output_format:
|
|
282
|
-
}), await
|
|
283
|
-
|
|
277
|
+
await w("document.generate", {
|
|
278
|
+
...r.input ?? {},
|
|
279
|
+
template_code: r.template_code,
|
|
280
|
+
template_source: r.template_source,
|
|
281
|
+
output_format: r.output_format
|
|
282
|
+
}), await i.invalidateQueries({ queryKey: [
|
|
283
|
+
D,
|
|
284
284
|
t,
|
|
285
|
-
|
|
285
|
+
n
|
|
286
286
|
] });
|
|
287
287
|
} catch (e) {
|
|
288
|
-
|
|
288
|
+
h(e instanceof Error ? e.message : String(e));
|
|
289
289
|
} finally {
|
|
290
|
-
|
|
290
|
+
u(!1);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
return /* @__PURE__ */ V("div", {
|
|
@@ -311,7 +311,7 @@ function W({ entityCode: t, objectId: r, doc: i }) {
|
|
|
311
311
|
textOverflow: "ellipsis",
|
|
312
312
|
whiteSpace: "nowrap"
|
|
313
313
|
},
|
|
314
|
-
children:
|
|
314
|
+
children: g
|
|
315
315
|
}),
|
|
316
316
|
/* @__PURE__ */ V("div", {
|
|
317
317
|
style: {
|
|
@@ -323,18 +323,18 @@ function W({ entityCode: t, objectId: r, doc: i }) {
|
|
|
323
323
|
fontSize: 11.5
|
|
324
324
|
},
|
|
325
325
|
children: [
|
|
326
|
-
/* @__PURE__ */ B("span", { children:
|
|
327
|
-
/* @__PURE__ */ B("span", { children:
|
|
328
|
-
/* @__PURE__ */ B("span", { children:
|
|
326
|
+
/* @__PURE__ */ B("span", { children: r.output_format.toUpperCase() }),
|
|
327
|
+
/* @__PURE__ */ B("span", { children: d ? "artifact unavailable" : r.status }),
|
|
328
|
+
/* @__PURE__ */ B("span", { children: r.ready_at || r.created_at })
|
|
329
329
|
]
|
|
330
330
|
}),
|
|
331
|
-
|
|
331
|
+
r.status === "failed" && r.error_text && /* @__PURE__ */ B("div", {
|
|
332
332
|
style: {
|
|
333
333
|
marginTop: 5,
|
|
334
334
|
color: "var(--danger)",
|
|
335
335
|
fontSize: 12
|
|
336
336
|
},
|
|
337
|
-
children:
|
|
337
|
+
children: r.error_text
|
|
338
338
|
}),
|
|
339
339
|
m && /* @__PURE__ */ B("div", {
|
|
340
340
|
style: {
|
|
@@ -345,38 +345,38 @@ function W({ entityCode: t, objectId: r, doc: i }) {
|
|
|
345
345
|
children: m
|
|
346
346
|
})
|
|
347
347
|
]
|
|
348
|
-
}),
|
|
348
|
+
}), _ ? /* @__PURE__ */ V("div", {
|
|
349
349
|
style: {
|
|
350
350
|
display: "flex",
|
|
351
351
|
gap: 6
|
|
352
352
|
},
|
|
353
|
-
children: [/* @__PURE__ */ B(
|
|
353
|
+
children: [/* @__PURE__ */ B(p, {
|
|
354
354
|
kind: "ghost",
|
|
355
355
|
size: "sm",
|
|
356
|
-
icon: B(
|
|
357
|
-
onClick:
|
|
358
|
-
disabled:
|
|
356
|
+
icon: B(a ? e.loader : e.file, { size: 12 }),
|
|
357
|
+
onClick: v,
|
|
358
|
+
disabled: a,
|
|
359
359
|
children: "PDF"
|
|
360
|
-
}), /* @__PURE__ */ B(
|
|
360
|
+
}), /* @__PURE__ */ B(p, {
|
|
361
361
|
kind: "default",
|
|
362
362
|
size: "sm",
|
|
363
|
-
icon: B(
|
|
364
|
-
onClick:
|
|
365
|
-
disabled:
|
|
363
|
+
icon: B(s ? e.loader : e.download, { size: 12 }),
|
|
364
|
+
onClick: b,
|
|
365
|
+
disabled: s,
|
|
366
366
|
children: "Download"
|
|
367
367
|
})]
|
|
368
|
-
}) :
|
|
368
|
+
}) : d ? /* @__PURE__ */ B(p, {
|
|
369
369
|
kind: "ghost",
|
|
370
370
|
size: "sm",
|
|
371
|
-
icon: B(
|
|
372
|
-
onClick:
|
|
373
|
-
disabled:
|
|
371
|
+
icon: B(l ? e.loader : e.file, { size: 12 }),
|
|
372
|
+
onClick: x,
|
|
373
|
+
disabled: l,
|
|
374
374
|
children: "Regenerate"
|
|
375
|
-
}) : /* @__PURE__ */ B(
|
|
375
|
+
}) : /* @__PURE__ */ B(p, {
|
|
376
376
|
kind: "ghost",
|
|
377
377
|
size: "sm",
|
|
378
378
|
disabled: !0,
|
|
379
|
-
children:
|
|
379
|
+
children: r.status === "pending" ? "Pending" : "Unavailable"
|
|
380
380
|
})]
|
|
381
381
|
});
|
|
382
382
|
}
|
|
@@ -527,11 +527,11 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
527
527
|
if (c) {
|
|
528
528
|
let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
|
|
529
529
|
l.push({
|
|
530
|
-
label:
|
|
531
|
-
value: n ? /* @__PURE__ */ B(
|
|
530
|
+
label: T(c.name),
|
|
531
|
+
value: n ? /* @__PURE__ */ B(_, {
|
|
532
532
|
tone: n.color ?? "slate",
|
|
533
533
|
size: "xs",
|
|
534
|
-
children:
|
|
534
|
+
children: T(n.name)
|
|
535
535
|
}) : /* @__PURE__ */ B("span", {
|
|
536
536
|
style: { color: "var(--text-4)" },
|
|
537
537
|
children: "—"
|
|
@@ -540,7 +540,7 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
540
540
|
continue;
|
|
541
541
|
}
|
|
542
542
|
if (t.fields.get(e) || t.files?.get(e)) {
|
|
543
|
-
let a =
|
|
543
|
+
let a = Me({
|
|
544
544
|
entity: t,
|
|
545
545
|
entityCode: n,
|
|
546
546
|
fieldName: e,
|
|
@@ -553,7 +553,7 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
553
553
|
locale: s
|
|
554
554
|
});
|
|
555
555
|
l.push({
|
|
556
|
-
label:
|
|
556
|
+
label: Ae(t, e, o.entities),
|
|
557
557
|
value: a
|
|
558
558
|
});
|
|
559
559
|
continue;
|
|
@@ -631,7 +631,7 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
631
631
|
let c = (e) => {
|
|
632
632
|
if (!e || !t.fields.get(e)) return;
|
|
633
633
|
let s = r[e];
|
|
634
|
-
if (s != null && s !== "") return
|
|
634
|
+
if (s != null && s !== "") return Me({
|
|
635
635
|
entity: t,
|
|
636
636
|
entityCode: n,
|
|
637
637
|
fieldName: e,
|
|
@@ -644,7 +644,7 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
644
644
|
locale: o
|
|
645
645
|
});
|
|
646
646
|
}, l = s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
|
|
647
|
-
label:
|
|
647
|
+
label: T(e.label),
|
|
648
648
|
at: c(e.at),
|
|
649
649
|
by: c(e.by)
|
|
650
650
|
})) : [{
|
|
@@ -689,11 +689,11 @@ function mt({ evidence: e }) {
|
|
|
689
689
|
},
|
|
690
690
|
children: "Evidence"
|
|
691
691
|
}),
|
|
692
|
-
/* @__PURE__ */ B(
|
|
693
|
-
tone:
|
|
692
|
+
/* @__PURE__ */ B(_, {
|
|
693
|
+
tone: Ue(t),
|
|
694
694
|
size: "sm",
|
|
695
695
|
dot: !0,
|
|
696
|
-
children:
|
|
696
|
+
children: We(t)
|
|
697
697
|
}),
|
|
698
698
|
r.length > 0 && /* @__PURE__ */ B("span", {
|
|
699
699
|
style: {
|
|
@@ -715,7 +715,7 @@ function mt({ evidence: e }) {
|
|
|
715
715
|
//#endregion
|
|
716
716
|
//#region src/components/chrome/RecordHeader.tsx
|
|
717
717
|
var ht = 180, gt = 160;
|
|
718
|
-
function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack:
|
|
718
|
+
function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: u = !1, onBack: d, right: f, identityControls: p, showTitle: m = !0 }) {
|
|
719
719
|
return /* @__PURE__ */ V("div", {
|
|
720
720
|
style: {
|
|
721
721
|
display: "flex",
|
|
@@ -725,24 +725,24 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
725
725
|
minWidth: 0
|
|
726
726
|
},
|
|
727
727
|
children: [
|
|
728
|
-
|
|
728
|
+
m && u && /* @__PURE__ */ B("div", {
|
|
729
729
|
style: {
|
|
730
730
|
paddingTop: 4,
|
|
731
731
|
flexShrink: 0
|
|
732
732
|
},
|
|
733
|
-
children: /* @__PURE__ */ B(
|
|
733
|
+
children: /* @__PURE__ */ B(l, {
|
|
734
734
|
size: 26,
|
|
735
735
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
736
736
|
title: "Back",
|
|
737
|
-
onClick:
|
|
737
|
+
onClick: d
|
|
738
738
|
})
|
|
739
739
|
}),
|
|
740
|
-
|
|
740
|
+
m && (n || t) && /* @__PURE__ */ B("div", {
|
|
741
741
|
style: {
|
|
742
742
|
flexShrink: 0,
|
|
743
743
|
paddingTop: 2
|
|
744
744
|
},
|
|
745
|
-
children: n ? /* @__PURE__ */ B(
|
|
745
|
+
children: n ? /* @__PURE__ */ B(M, {
|
|
746
746
|
name: n,
|
|
747
747
|
size: 32
|
|
748
748
|
}) : /* @__PURE__ */ B("span", {
|
|
@@ -759,7 +759,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
759
759
|
children: t
|
|
760
760
|
})
|
|
761
761
|
}),
|
|
762
|
-
|
|
762
|
+
m && /* @__PURE__ */ V(nt, { children: [
|
|
763
763
|
/* @__PURE__ */ B("h1", {
|
|
764
764
|
style: {
|
|
765
765
|
margin: 0,
|
|
@@ -780,12 +780,12 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
780
780
|
},
|
|
781
781
|
children: r
|
|
782
782
|
}),
|
|
783
|
-
i && /* @__PURE__ */ B(
|
|
784
|
-
a && /* @__PURE__ */ B(
|
|
783
|
+
i && /* @__PURE__ */ B(ge, { value: i }),
|
|
784
|
+
a && /* @__PURE__ */ B(N, {
|
|
785
785
|
label: a,
|
|
786
786
|
"data-testid": "detail-description-info"
|
|
787
787
|
}),
|
|
788
|
-
|
|
788
|
+
p,
|
|
789
789
|
s === "edit" && c && /* @__PURE__ */ V("span", {
|
|
790
790
|
style: {
|
|
791
791
|
display: "inline-flex",
|
|
@@ -801,14 +801,14 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
801
801
|
background: "var(--warn)"
|
|
802
802
|
} }), "Unsaved"]
|
|
803
803
|
}),
|
|
804
|
-
s === "create" && /* @__PURE__ */ B(
|
|
804
|
+
s === "create" && /* @__PURE__ */ B(_, {
|
|
805
805
|
tone: "violet",
|
|
806
806
|
size: "xs",
|
|
807
807
|
dot: !0,
|
|
808
808
|
children: "New record"
|
|
809
809
|
})
|
|
810
810
|
] }),
|
|
811
|
-
|
|
811
|
+
f && /* @__PURE__ */ B("div", {
|
|
812
812
|
role: "toolbar",
|
|
813
813
|
"aria-label": "Page actions",
|
|
814
814
|
style: {
|
|
@@ -823,7 +823,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
823
823
|
flexWrap: "wrap",
|
|
824
824
|
justifyContent: "flex-end"
|
|
825
825
|
},
|
|
826
|
-
children:
|
|
826
|
+
children: f
|
|
827
827
|
}),
|
|
828
828
|
o && s === "display" && /* @__PURE__ */ B("div", {
|
|
829
829
|
style: {
|
|
@@ -894,42 +894,42 @@ function Ct(e, t) {
|
|
|
894
894
|
}
|
|
895
895
|
function wt(e, t) {
|
|
896
896
|
if (e) {
|
|
897
|
-
let n =
|
|
897
|
+
let n = se(e, t), r = A(n);
|
|
898
898
|
if (r.replace(/^\|+|\|+$/g, "")) return r;
|
|
899
899
|
}
|
|
900
|
-
return t.id == null ? crypto.randomUUID() :
|
|
900
|
+
return t.id == null ? crypto.randomUUID() : O(t.id);
|
|
901
901
|
}
|
|
902
902
|
function Tt({ screenCode: e }) {
|
|
903
|
-
return /* @__PURE__ */ B(
|
|
903
|
+
return /* @__PURE__ */ B(E, { children: /* @__PURE__ */ B(Et, { screenCode: e }) });
|
|
904
904
|
}
|
|
905
905
|
function Et({ screenCode: t }) {
|
|
906
|
-
let { id: n } = $e(),
|
|
907
|
-
if (!
|
|
908
|
-
let e =
|
|
906
|
+
let { id: n } = $e(), i = g(), [o, d] = et(), { data: p } = ee(), _ = oe((e) => e.user), v = ue(), y = s(), b = p?.screens[t], S = b?.entity ? p?.entities[b.entity] : void 0, w = b?.entity, E = h(S, "create"), D = h(S, "update"), re = h(S, "restore"), O = (() => {
|
|
907
|
+
if (!S || !S.singleton || !S.prefilter) return;
|
|
908
|
+
let e = x(S);
|
|
909
909
|
if (e.length !== 1) return;
|
|
910
|
-
let t =
|
|
911
|
-
if (t === "$caller.user_id") return
|
|
912
|
-
if (t === "$caller.tenant_id") return
|
|
913
|
-
})(), k =
|
|
914
|
-
if (!
|
|
915
|
-
if (!
|
|
916
|
-
let e =
|
|
917
|
-
if (e.length === 1) return { [e[0]]:
|
|
918
|
-
let t =
|
|
910
|
+
let t = S.prefilter[e[0]];
|
|
911
|
+
if (t === "$caller.user_id") return _?.id;
|
|
912
|
+
if (t === "$caller.tenant_id") return _?.tenant?.id;
|
|
913
|
+
})(), k = O !== void 0, j = k ? O : n, M = !k && j === "new", N = L(() => {
|
|
914
|
+
if (!j || M) return;
|
|
915
|
+
if (!S) return j;
|
|
916
|
+
let e = x(S);
|
|
917
|
+
if (e.length === 1) return { [e[0]]: j };
|
|
918
|
+
let t = r(j, e.length);
|
|
919
919
|
if (!t) return;
|
|
920
920
|
let n = {};
|
|
921
921
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
922
922
|
return n;
|
|
923
923
|
}, [
|
|
924
|
-
A,
|
|
925
924
|
j,
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
S(q &&
|
|
925
|
+
M,
|
|
926
|
+
S
|
|
927
|
+
]), fe = L(() => {
|
|
928
|
+
if (N) return typeof N == "string" ? N : A(N);
|
|
929
|
+
}, [N]), pe = me(w, N), { data: P, isLoading: ge, error: ye } = pe, De = te((e) => e.degradedEntities), Ae = w ? ce(S?.realtime, De, w) : !1;
|
|
930
|
+
Ce(he(w, N), !M);
|
|
931
|
+
let je = Ee(w ?? ""), Me = Te(w ?? ""), Pe = Se(w ?? ""), Be = Object.keys(S?.status_groups ?? {}).length > 0, Ve = P?.data, He = Ve?.$statuses, Ue = Ve?.$properties, We = o.get("edit") === "true", [qe, Xe] = R(M || We), [z, tt] = R({}), [H, it] = R({}), [U, ot] = R({}), [W, G] = R(void 0), [ct, ut] = R(!1), [dt, K] = R(void 0), [pt, ht] = R(!1), gt = M ? E : D, q = qe && gt, vt = f();
|
|
932
|
+
a(q && !M, vt.enabled);
|
|
933
933
|
let [bt, Tt] = R(() => {
|
|
934
934
|
let e = parseInt(b?.sidebar_width || "380", 10);
|
|
935
935
|
return isNaN(e) ? 380 : e;
|
|
@@ -950,7 +950,7 @@ function Et({ screenCode: t }) {
|
|
|
950
950
|
J.current && t && Tt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
951
951
|
};
|
|
952
952
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
953
|
-
}, []), Y =
|
|
953
|
+
}, []), Y = P?.data, X = Ne(S, b, Y ?? {});
|
|
954
954
|
I(() => {
|
|
955
955
|
let e = parseInt(X?.sidebar_width || "380", 10);
|
|
956
956
|
Tt(Number.isNaN(e) ? 380 : e);
|
|
@@ -959,73 +959,73 @@ function Et({ screenCode: t }) {
|
|
|
959
959
|
I(() => {
|
|
960
960
|
if (!Z) return;
|
|
961
961
|
let e = jt.current;
|
|
962
|
-
jt.current = Z, e && e !== Z &&
|
|
963
|
-
}, [
|
|
964
|
-
let Mt = !!
|
|
965
|
-
|
|
966
|
-
let Ft = !
|
|
962
|
+
jt.current = Z, e && e !== Z && qe && ut(!0);
|
|
963
|
+
}, [qe, Z]);
|
|
964
|
+
let Mt = !!S?.soft_delete && Y != null && Y[S.soft_delete] != null, Nt = Qe(), Pt = Ze(null);
|
|
965
|
+
de({ scrollElementRef: Pt });
|
|
966
|
+
let Ft = !M && ye instanceof c && ye.status === 404, It = M && !u(S), Lt = Ze(null);
|
|
967
967
|
I(() => {
|
|
968
968
|
if (!Ft) return;
|
|
969
|
-
let e =
|
|
970
|
-
Lt.current !== e && (Lt.current = e,
|
|
969
|
+
let e = xe(Nt);
|
|
970
|
+
Lt.current !== e && (Lt.current = e, _e.getState().kill(e));
|
|
971
971
|
}, [Ft, Nt]);
|
|
972
972
|
let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = ve();
|
|
973
973
|
I(() => {
|
|
974
|
-
if (!
|
|
975
|
-
let e = Nt.pathname, t =
|
|
974
|
+
if (!S || k || vt.enabled) return;
|
|
975
|
+
let e = Nt.pathname, t = T(X?.display?.name) || T(S.display.name), n = X?.display?.icon || S.display.icon;
|
|
976
976
|
Bt(e) || Rt({
|
|
977
977
|
pathname: e,
|
|
978
978
|
search: "",
|
|
979
|
-
title:
|
|
979
|
+
title: M ? `New ${t}` : t,
|
|
980
980
|
icon: n,
|
|
981
981
|
closable: !0
|
|
982
982
|
});
|
|
983
983
|
}, [
|
|
984
984
|
Nt.pathname,
|
|
985
985
|
X?.display?.name?.en,
|
|
986
|
-
|
|
986
|
+
S?.display.name?.en,
|
|
987
987
|
X?.display?.icon,
|
|
988
|
-
|
|
989
|
-
|
|
988
|
+
S?.display.icon,
|
|
989
|
+
M,
|
|
990
990
|
k,
|
|
991
991
|
vt.enabled
|
|
992
992
|
]), I(() => {
|
|
993
|
-
if (!Y || !
|
|
993
|
+
if (!Y || !S || k || vt.enabled) return;
|
|
994
994
|
let e = Bt(Nt.pathname);
|
|
995
995
|
if (e) {
|
|
996
|
-
let t =
|
|
996
|
+
let t = T(X?.display?.name) || T(S.display.name), n = C(Y, S), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
997
997
|
zt(e.id, r);
|
|
998
998
|
}
|
|
999
999
|
}, [
|
|
1000
1000
|
Y,
|
|
1001
|
-
|
|
1002
|
-
|
|
1001
|
+
S?.display.name?.en,
|
|
1002
|
+
S?.display.display_field,
|
|
1003
1003
|
Nt.pathname,
|
|
1004
1004
|
k,
|
|
1005
1005
|
vt.enabled
|
|
1006
1006
|
]);
|
|
1007
1007
|
let Vt = L(() => {
|
|
1008
|
-
if (!
|
|
1008
|
+
if (!S || !gt) return /* @__PURE__ */ new Set();
|
|
1009
1009
|
let e = /* @__PURE__ */ new Set();
|
|
1010
|
-
for (let [t, n] of
|
|
1011
|
-
for (let [t] of
|
|
1010
|
+
for (let [t, n] of S.fields) !n.auto && !n.primary && e.add(t);
|
|
1011
|
+
for (let [t] of S.files ?? []) e.add(t);
|
|
1012
1012
|
return e;
|
|
1013
|
-
}, [
|
|
1013
|
+
}, [S, gt]);
|
|
1014
1014
|
I(() => {
|
|
1015
|
-
if (!(!
|
|
1016
|
-
if (
|
|
1017
|
-
let e =
|
|
1015
|
+
if (!(!We || !Y || !S || !D)) {
|
|
1016
|
+
if (qe || Xe(!0), Object.keys(z).length === 0) {
|
|
1017
|
+
let e = j ? Ke(j) : null;
|
|
1018
1018
|
if (e) {
|
|
1019
|
-
let t =
|
|
1020
|
-
entity:
|
|
1019
|
+
let t = Re({
|
|
1020
|
+
entity: S,
|
|
1021
1021
|
formData: e,
|
|
1022
1022
|
record: void 0,
|
|
1023
1023
|
isNew: !0
|
|
1024
1024
|
});
|
|
1025
|
-
|
|
1026
|
-
|
|
1025
|
+
Le(t).forEach((e) => {
|
|
1026
|
+
v.registerDraft({
|
|
1027
1027
|
fileId: e,
|
|
1028
|
-
discard: () =>
|
|
1028
|
+
discard: () => ie(e)
|
|
1029
1029
|
});
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
@@ -1036,16 +1036,16 @@ function Et({ screenCode: t }) {
|
|
|
1036
1036
|
t[n] = r;
|
|
1037
1037
|
return;
|
|
1038
1038
|
}
|
|
1039
|
-
let i =
|
|
1040
|
-
t[n] =
|
|
1039
|
+
let i = Oe(S, Y, n);
|
|
1040
|
+
t[n] = Fe(S, n) ? i ?? null : i ?? "";
|
|
1041
1041
|
}), tt(t);
|
|
1042
1042
|
}
|
|
1043
|
-
if (
|
|
1043
|
+
if (S.children !== void 0 && S.children.length > 0 && W === void 0) {
|
|
1044
1044
|
let e = Y.$children;
|
|
1045
1045
|
if (e && Object.keys(e).length > 0) {
|
|
1046
1046
|
let t = {};
|
|
1047
1047
|
for (let [n, r] of Object.entries(e)) {
|
|
1048
|
-
let e =
|
|
1048
|
+
let e = p?.entities[n];
|
|
1049
1049
|
t[n] = r.map((t) => ({
|
|
1050
1050
|
...t,
|
|
1051
1051
|
_key: wt(e, t)
|
|
@@ -1054,36 +1054,36 @@ function Et({ screenCode: t }) {
|
|
|
1054
1054
|
G(t), K(e);
|
|
1055
1055
|
} else G({}), K({});
|
|
1056
1056
|
}
|
|
1057
|
-
|
|
1057
|
+
d((e) => {
|
|
1058
1058
|
let t = new URLSearchParams(e);
|
|
1059
1059
|
return t.delete("edit"), t;
|
|
1060
1060
|
}, { replace: !0 });
|
|
1061
1061
|
}
|
|
1062
1062
|
}, [
|
|
1063
|
-
|
|
1063
|
+
We,
|
|
1064
1064
|
Y,
|
|
1065
1065
|
Vt,
|
|
1066
|
-
|
|
1067
|
-
|
|
1066
|
+
D,
|
|
1067
|
+
S,
|
|
1068
1068
|
W,
|
|
1069
|
-
|
|
1069
|
+
p
|
|
1070
1070
|
]), I(() => {
|
|
1071
|
-
!
|
|
1071
|
+
!M || !E || !S?.children || S.children.length === 0 || W === void 0 && (G({}), K({}));
|
|
1072
1072
|
}, [
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1073
|
+
M,
|
|
1074
|
+
E,
|
|
1075
|
+
S?.children
|
|
1076
1076
|
]);
|
|
1077
1077
|
let Ht = F(async () => {
|
|
1078
|
-
if (await
|
|
1078
|
+
if (await v.flushAllDrafts(), M) {
|
|
1079
1079
|
let e = X?.route?.replace("/:id", "") ?? "/";
|
|
1080
|
-
|
|
1080
|
+
i(e);
|
|
1081
1081
|
} else Xe(!1), tt({}), it({}), ot({}), G(void 0), K(void 0), ht(!1);
|
|
1082
1082
|
}, [
|
|
1083
|
-
|
|
1084
|
-
|
|
1083
|
+
v,
|
|
1084
|
+
M,
|
|
1085
1085
|
X,
|
|
1086
|
-
|
|
1086
|
+
i
|
|
1087
1087
|
]), Ut = F((e, t) => {
|
|
1088
1088
|
tt((n) => ({
|
|
1089
1089
|
...n,
|
|
@@ -1093,46 +1093,46 @@ function Et({ screenCode: t }) {
|
|
|
1093
1093
|
if (!X?.route) return "/";
|
|
1094
1094
|
let e = X.route.split("/");
|
|
1095
1095
|
return e.pop(), e.join("/") || "/";
|
|
1096
|
-
}, [X]), Wt = L(() => !
|
|
1096
|
+
}, [X]), Wt = L(() => !p?.screens || !Q || Q === "/" ? !1 : Object.values(p.screens).some((e) => e.route === Q), [p, Q]), Gt = F(() => {
|
|
1097
1097
|
if (!Wt) {
|
|
1098
|
-
|
|
1098
|
+
i("/");
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
1101
|
let e = Bt(Q)?.search ?? "";
|
|
1102
|
-
|
|
1102
|
+
i(e ? `${Q}?${e}` : Q);
|
|
1103
1103
|
}, [
|
|
1104
1104
|
Wt,
|
|
1105
1105
|
Q,
|
|
1106
1106
|
Bt,
|
|
1107
|
-
|
|
1108
|
-
]), Kt =
|
|
1109
|
-
if (!
|
|
1107
|
+
i
|
|
1108
|
+
]), Kt = we({ fallback: Gt }), qt = !k && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = ae(), Yt = L(() => {
|
|
1109
|
+
if (!S) return {};
|
|
1110
1110
|
let e = {};
|
|
1111
|
-
for (let t of _t(
|
|
1112
|
-
for (let t of yt(
|
|
1111
|
+
for (let t of _t(S, z, M)) Vt.has(t) && (e[t] = "Required");
|
|
1112
|
+
for (let t of yt(S, z)) Vt.has(t) && (e[t] = "Invalid email address");
|
|
1113
1113
|
return e;
|
|
1114
1114
|
}, [
|
|
1115
|
-
|
|
1115
|
+
S,
|
|
1116
1116
|
z,
|
|
1117
|
-
|
|
1117
|
+
M,
|
|
1118
1118
|
Vt
|
|
1119
1119
|
]), Xt = Object.keys(Yt).length > 0, Zt = F(() => {
|
|
1120
|
-
if (!w || !
|
|
1121
|
-
let e = {}, t =
|
|
1122
|
-
entity:
|
|
1120
|
+
if (!w || !S || M && !E || !M && !D || (ht(!0), Xt)) return;
|
|
1121
|
+
let e = {}, t = Re({
|
|
1122
|
+
entity: S,
|
|
1123
1123
|
formData: z,
|
|
1124
1124
|
record: Y,
|
|
1125
|
-
isNew:
|
|
1126
|
-
}), n =
|
|
1127
|
-
if (
|
|
1128
|
-
if (
|
|
1129
|
-
let r =
|
|
1125
|
+
isNew: M
|
|
1126
|
+
}), n = Le(t);
|
|
1127
|
+
if (M) for (let [t, n] of Object.entries(z)) {
|
|
1128
|
+
if (S.files?.has(t)) continue;
|
|
1129
|
+
let r = ke(S, t, n);
|
|
1130
1130
|
r !== "" && r != null && (e[t] = r);
|
|
1131
1131
|
}
|
|
1132
1132
|
else {
|
|
1133
1133
|
for (let [t, n] of Object.entries(z)) {
|
|
1134
|
-
if (
|
|
1135
|
-
let r = Y ?
|
|
1134
|
+
if (S.files?.has(t)) continue;
|
|
1135
|
+
let r = Y ? Oe(S, Y, t) : void 0, i = ke(S, t, n), a = ke(S, t, r);
|
|
1136
1136
|
(i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
|
|
1137
1137
|
}
|
|
1138
1138
|
Z && (e.$row_version = Z);
|
|
@@ -1150,37 +1150,37 @@ function Et({ screenCode: t }) {
|
|
|
1150
1150
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
1151
1151
|
return i;
|
|
1152
1152
|
}), i = dt?.[e] ?? [];
|
|
1153
|
-
(
|
|
1153
|
+
(M || !Ct(r, i)) && (t[e] = r);
|
|
1154
1154
|
}
|
|
1155
1155
|
Object.keys(t).length > 0 && (e.$children = t);
|
|
1156
1156
|
}
|
|
1157
|
-
if (!
|
|
1157
|
+
if (!M && Object.keys(e).length === 0) {
|
|
1158
1158
|
Xe(!1), it({}), ot({}), G(void 0), K(void 0), ht(!1);
|
|
1159
1159
|
return;
|
|
1160
1160
|
}
|
|
1161
|
-
let
|
|
1161
|
+
let r = () => {
|
|
1162
1162
|
Xe(!1), ut(!1), ht(!1), it({}), ot({}), G(void 0), K(void 0);
|
|
1163
1163
|
};
|
|
1164
|
-
|
|
1165
|
-
n.forEach((e) =>
|
|
1166
|
-
let t = e.data, a =
|
|
1167
|
-
|
|
1168
|
-
} }) :
|
|
1169
|
-
pkValues:
|
|
1164
|
+
M ? je.mutate(e, { onSuccess: (e) => {
|
|
1165
|
+
n.forEach((e) => v.markCommitted(e));
|
|
1166
|
+
let t = e.data, a = S ? se(S, t) : {}, o = A(a);
|
|
1167
|
+
i(o ? `${Q}/${encodeURIComponent(o)}` : Q, { replace: !0 }), r();
|
|
1168
|
+
} }) : N && Me.mutate({
|
|
1169
|
+
pkValues: N,
|
|
1170
1170
|
data: e
|
|
1171
1171
|
}, {
|
|
1172
1172
|
onSuccess: () => {
|
|
1173
|
-
n.forEach((e) =>
|
|
1173
|
+
n.forEach((e) => v.markCommitted(e)), r();
|
|
1174
1174
|
},
|
|
1175
1175
|
onError: (e) => {
|
|
1176
|
-
e instanceof
|
|
1176
|
+
e instanceof c && e.code === "entity.stale_object" && ut(!0);
|
|
1177
1177
|
}
|
|
1178
1178
|
});
|
|
1179
1179
|
}, [
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
T,
|
|
1180
|
+
v,
|
|
1181
|
+
M,
|
|
1183
1182
|
E,
|
|
1183
|
+
D,
|
|
1184
1184
|
w,
|
|
1185
1185
|
z,
|
|
1186
1186
|
Xt,
|
|
@@ -1188,29 +1188,29 @@ function Et({ screenCode: t }) {
|
|
|
1188
1188
|
U,
|
|
1189
1189
|
W,
|
|
1190
1190
|
dt,
|
|
1191
|
+
je,
|
|
1191
1192
|
Me,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
r,
|
|
1193
|
+
S,
|
|
1194
|
+
i,
|
|
1195
1195
|
Q,
|
|
1196
1196
|
Y,
|
|
1197
1197
|
Z,
|
|
1198
|
-
|
|
1198
|
+
N
|
|
1199
1199
|
]), Qt = F((e, t) => {
|
|
1200
1200
|
G((n) => ({
|
|
1201
1201
|
...n ?? {},
|
|
1202
1202
|
[e]: t
|
|
1203
1203
|
}));
|
|
1204
1204
|
}, []), $t = F(() => {
|
|
1205
|
-
!
|
|
1205
|
+
!N || M || !re || Pe.mutate(N);
|
|
1206
1206
|
}, [
|
|
1207
|
+
N,
|
|
1207
1208
|
M,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
if (!
|
|
1213
|
-
if (!j && he) return /* @__PURE__ */ B(Le, {});
|
|
1209
|
+
re,
|
|
1210
|
+
Pe
|
|
1211
|
+
]), en = L(() => xt(W, p), [W, p]), tn = Object.keys(en).length > 0;
|
|
1212
|
+
if (!X || !S) return null;
|
|
1213
|
+
if (!M && ge) return /* @__PURE__ */ B(Ie, {});
|
|
1214
1214
|
if (It) return /* @__PURE__ */ V("div", {
|
|
1215
1215
|
style: { padding: 24 },
|
|
1216
1216
|
children: [/* @__PURE__ */ V("div", {
|
|
@@ -1220,7 +1220,7 @@ function Et({ screenCode: t }) {
|
|
|
1220
1220
|
gap: 8,
|
|
1221
1221
|
marginBottom: 8
|
|
1222
1222
|
},
|
|
1223
|
-
children: [qt && /* @__PURE__ */ B(
|
|
1223
|
+
children: [qt && /* @__PURE__ */ B(l, {
|
|
1224
1224
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1225
1225
|
onClick: Kt.goBack,
|
|
1226
1226
|
title: "Back"
|
|
@@ -1238,7 +1238,7 @@ function Et({ screenCode: t }) {
|
|
|
1238
1238
|
children: "This record type is not created from a form."
|
|
1239
1239
|
})]
|
|
1240
1240
|
});
|
|
1241
|
-
if (!
|
|
1241
|
+
if (!M && !Y || Ft) return /* @__PURE__ */ V("div", {
|
|
1242
1242
|
style: { padding: 24 },
|
|
1243
1243
|
children: [/* @__PURE__ */ V("div", {
|
|
1244
1244
|
style: {
|
|
@@ -1247,7 +1247,7 @@ function Et({ screenCode: t }) {
|
|
|
1247
1247
|
gap: 8,
|
|
1248
1248
|
marginBottom: 8
|
|
1249
1249
|
},
|
|
1250
|
-
children: [qt && /* @__PURE__ */ B(
|
|
1250
|
+
children: [qt && /* @__PURE__ */ B(l, {
|
|
1251
1251
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1252
1252
|
onClick: Kt.goBack,
|
|
1253
1253
|
title: "Back"
|
|
@@ -1265,24 +1265,24 @@ function Et({ screenCode: t }) {
|
|
|
1265
1265
|
children: "Record not found."
|
|
1266
1266
|
})]
|
|
1267
1267
|
});
|
|
1268
|
-
let nn =
|
|
1269
|
-
entity:
|
|
1268
|
+
let nn = S.display, rn = T(X.display?.name) || T(nn.name), an = C(Y, S), on = M ? `New ${rn}` : an ? String(an) : rn, sn = je.isPending || Me.isPending, cn = X.responsive?.[y.category]?.layout, ln = cn?.tabs ?? (y.isPhone ? "sections" : void 0), un = cn?.header_card === !0 ? ze({
|
|
1269
|
+
entity: S,
|
|
1270
1270
|
screen: X
|
|
1271
1271
|
}) : void 0, $ = {
|
|
1272
|
-
schema:
|
|
1273
|
-
entity:
|
|
1272
|
+
schema: p,
|
|
1273
|
+
entity: S,
|
|
1274
1274
|
entityCode: w,
|
|
1275
|
-
recordId:
|
|
1275
|
+
recordId: fe ?? j ?? "",
|
|
1276
1276
|
record: q ? {
|
|
1277
1277
|
...Y ?? {},
|
|
1278
1278
|
...z
|
|
1279
1279
|
} : Y ?? {},
|
|
1280
|
-
isNew:
|
|
1280
|
+
isNew: M,
|
|
1281
1281
|
mode: q ? "edit" : "display",
|
|
1282
1282
|
onFieldChange: q ? Ut : void 0,
|
|
1283
1283
|
refs: At,
|
|
1284
1284
|
objectProperties: (() => {
|
|
1285
|
-
let e =
|
|
1285
|
+
let e = Ue ?? [];
|
|
1286
1286
|
if (!q || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
|
|
1287
1287
|
let t = e.map((e) => U[e.property_code] === void 0 ? e : {
|
|
1288
1288
|
...e,
|
|
@@ -1296,13 +1296,13 @@ function Et({ screenCode: t }) {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
return t;
|
|
1298
1298
|
})(),
|
|
1299
|
-
onSetProperty:
|
|
1299
|
+
onSetProperty: M || !D ? void 0 : q ? (e, t) => ot((n) => ({
|
|
1300
1300
|
...n,
|
|
1301
1301
|
[e]: t
|
|
1302
1302
|
})) : void 0,
|
|
1303
1303
|
isPropertyPending: !1,
|
|
1304
1304
|
objectStatuses: (() => {
|
|
1305
|
-
let e =
|
|
1305
|
+
let e = He ?? [];
|
|
1306
1306
|
if (!q || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
|
|
1307
1307
|
let t = e.map((e) => H[e.group_code] === void 0 ? e : {
|
|
1308
1308
|
...e,
|
|
@@ -1312,11 +1312,11 @@ function Et({ screenCode: t }) {
|
|
|
1312
1312
|
group_code: n,
|
|
1313
1313
|
status_code: r,
|
|
1314
1314
|
status_name: {},
|
|
1315
|
-
set_at:
|
|
1315
|
+
set_at: ne()
|
|
1316
1316
|
});
|
|
1317
1317
|
return t;
|
|
1318
1318
|
})(),
|
|
1319
|
-
onSetStatus:
|
|
1319
|
+
onSetStatus: M || !D ? void 0 : q ? (e, t) => it((n) => ({
|
|
1320
1320
|
...n,
|
|
1321
1321
|
[e]: t
|
|
1322
1322
|
})) : void 0,
|
|
@@ -1327,32 +1327,32 @@ function Et({ screenCode: t }) {
|
|
|
1327
1327
|
fieldErrors: q && pt ? Yt : void 0,
|
|
1328
1328
|
detailTabsPresentation: ln,
|
|
1329
1329
|
relatedRecordsPresentation: cn?.related_records
|
|
1330
|
-
}, dn = !!X.sidebar && X.sidebar.length > 0, fn = cn?.sidebar === "hidden", pn = dn && !fn && !y.isDesktop, mn = dn && !fn && y.isDesktop, hn = !
|
|
1330
|
+
}, dn = !!X.sidebar && X.sidebar.length > 0, fn = cn?.sidebar === "hidden", pn = dn && !fn && !y.isDesktop, mn = dn && !fn && y.isDesktop, hn = !M && Y ? /* @__PURE__ */ B(lt, {
|
|
1331
1331
|
screen: X,
|
|
1332
|
-
entity:
|
|
1332
|
+
entity: S,
|
|
1333
1333
|
entityCode: w,
|
|
1334
1334
|
record: Y,
|
|
1335
1335
|
refs: At,
|
|
1336
|
-
objectStatuses:
|
|
1337
|
-
schema:
|
|
1336
|
+
objectStatuses: He,
|
|
1337
|
+
schema: p,
|
|
1338
1338
|
locale: Jt
|
|
1339
1339
|
}) : void 0, gn = /* @__PURE__ */ B(kt, {
|
|
1340
1340
|
title: on,
|
|
1341
|
-
recordId:
|
|
1341
|
+
recordId: j,
|
|
1342
1342
|
editing: q,
|
|
1343
|
-
isNew:
|
|
1343
|
+
isNew: M,
|
|
1344
1344
|
isRecordDeleted: Mt,
|
|
1345
|
-
dirty:
|
|
1345
|
+
dirty: qe,
|
|
1346
1346
|
isSaving: sn,
|
|
1347
1347
|
hasChildErrors: tn,
|
|
1348
1348
|
hasFieldErrors: pt && Xt,
|
|
1349
|
-
canRestore:
|
|
1350
|
-
entity:
|
|
1349
|
+
canRestore: re,
|
|
1350
|
+
entity: S,
|
|
1351
1351
|
screen: X,
|
|
1352
|
-
globalActions:
|
|
1352
|
+
globalActions: p?.actions,
|
|
1353
1353
|
entityCode: w,
|
|
1354
1354
|
record: Y,
|
|
1355
|
-
id:
|
|
1355
|
+
id: j,
|
|
1356
1356
|
listRoute: Q,
|
|
1357
1357
|
listRouteExists: !!Wt,
|
|
1358
1358
|
highlights: hn,
|
|
@@ -1361,15 +1361,14 @@ function Et({ screenCode: t }) {
|
|
|
1361
1361
|
onCancelEdit: Ht,
|
|
1362
1362
|
onSave: Zt,
|
|
1363
1363
|
onRestore: $t,
|
|
1364
|
-
isRestoring:
|
|
1364
|
+
isRestoring: Pe.isPending,
|
|
1365
1365
|
refreshControl: {
|
|
1366
|
-
refetch:
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
isLive: je
|
|
1366
|
+
refetch: pe.refetch,
|
|
1367
|
+
isLoading: pe.isLoading,
|
|
1368
|
+
isLive: Ae
|
|
1370
1369
|
},
|
|
1371
|
-
isRealtimeEntity:
|
|
1372
|
-
canManageTemplates:
|
|
1370
|
+
isRealtimeEntity: S?.realtime === !0,
|
|
1371
|
+
canManageTemplates: Ge(p)
|
|
1373
1372
|
}), _n = Mt && /* @__PURE__ */ V("div", {
|
|
1374
1373
|
style: {
|
|
1375
1374
|
display: "flex",
|
|
@@ -1383,7 +1382,7 @@ function Et({ screenCode: t }) {
|
|
|
1383
1382
|
color: "var(--danger)",
|
|
1384
1383
|
fontSize: 12.5
|
|
1385
1384
|
},
|
|
1386
|
-
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ",
|
|
1385
|
+
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ", le(String(Y[S.soft_delete]))] })]
|
|
1387
1386
|
}), vn = ct && /* @__PURE__ */ V("div", {
|
|
1388
1387
|
style: {
|
|
1389
1388
|
display: "flex",
|
|
@@ -1400,10 +1399,10 @@ function Et({ screenCode: t }) {
|
|
|
1400
1399
|
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: "This record changed on the server while you were viewing or editing it." })]
|
|
1401
1400
|
}), yn = q && pt && Xt && /* @__PURE__ */ B(st, {
|
|
1402
1401
|
errors: Object.entries(Yt).map(([e, t]) => {
|
|
1403
|
-
let n =
|
|
1402
|
+
let n = S.fields.get(e);
|
|
1404
1403
|
return {
|
|
1405
1404
|
name: e,
|
|
1406
|
-
label: n ?
|
|
1405
|
+
label: n ? m(n, e, p?.entities) : e,
|
|
1407
1406
|
message: t
|
|
1408
1407
|
};
|
|
1409
1408
|
}),
|
|
@@ -1414,52 +1413,52 @@ function Et({ screenCode: t }) {
|
|
|
1414
1413
|
behavior: "smooth"
|
|
1415
1414
|
}), t.focus?.());
|
|
1416
1415
|
}
|
|
1417
|
-
}), bn =
|
|
1416
|
+
}), bn = Be && !M && !(X.items && X.items.length > 0) && /* @__PURE__ */ B("div", {
|
|
1418
1417
|
className: "mb-4",
|
|
1419
1418
|
children: /* @__PURE__ */ B(Je, {
|
|
1420
|
-
statusGroups:
|
|
1419
|
+
statusGroups: S.status_groups ?? {},
|
|
1421
1420
|
objectStatuses: $.objectStatuses,
|
|
1422
|
-
onSetStatus:
|
|
1421
|
+
onSetStatus: D && q ? (e, t) => it((n) => ({
|
|
1423
1422
|
...n,
|
|
1424
1423
|
[e]: t
|
|
1425
1424
|
})) : St,
|
|
1426
1425
|
isPending: !1,
|
|
1427
1426
|
mode: q ? "edit" : "display"
|
|
1428
1427
|
})
|
|
1429
|
-
}), xn =
|
|
1428
|
+
}), xn = S.evidence_covered && !M && Y && /* @__PURE__ */ B("div", {
|
|
1430
1429
|
className: "mb-4",
|
|
1431
1430
|
children: /* @__PURE__ */ B(mt, { evidence: Y.$evidence })
|
|
1432
1431
|
}), Sn = /* @__PURE__ */ V(nt, { children: [
|
|
1433
|
-
un && (Y ||
|
|
1432
|
+
un && (Y || M) && /* @__PURE__ */ B(Dt, {
|
|
1434
1433
|
card: un,
|
|
1435
|
-
entity:
|
|
1434
|
+
entity: S,
|
|
1436
1435
|
record: $.record,
|
|
1437
1436
|
objectStatuses: $.objectStatuses,
|
|
1438
1437
|
objectProperties: $.objectProperties
|
|
1439
1438
|
}),
|
|
1440
|
-
X.items && X.items.length > 0 && (Y ||
|
|
1439
|
+
X.items && X.items.length > 0 && (Y || M) && p && /* @__PURE__ */ B(Ye, {
|
|
1441
1440
|
nodes: X.items,
|
|
1442
1441
|
ctx: $
|
|
1443
1442
|
}),
|
|
1444
|
-
!
|
|
1443
|
+
!M && j && w && S.associations && Object.keys(S.associations).length > 0 && p && /* @__PURE__ */ B(rt, {
|
|
1445
1444
|
entityCode: w,
|
|
1446
|
-
recordId:
|
|
1447
|
-
associations:
|
|
1448
|
-
schema:
|
|
1445
|
+
recordId: fe ?? j ?? "",
|
|
1446
|
+
associations: S.associations,
|
|
1447
|
+
schema: p
|
|
1449
1448
|
}),
|
|
1450
|
-
!
|
|
1449
|
+
!M && j && w && /* @__PURE__ */ B(at, {
|
|
1451
1450
|
entityCode: w,
|
|
1452
|
-
objectId:
|
|
1453
|
-
canGenerateOne: !!
|
|
1454
|
-
canManageTemplates:
|
|
1451
|
+
objectId: fe ?? j,
|
|
1452
|
+
canGenerateOne: !!S?.documents?.generate_one,
|
|
1453
|
+
canManageTemplates: Ge(p)
|
|
1455
1454
|
}),
|
|
1456
|
-
!
|
|
1455
|
+
!M && Y && p && /* @__PURE__ */ B(ft, {
|
|
1457
1456
|
screen: X,
|
|
1458
|
-
entity:
|
|
1457
|
+
entity: S,
|
|
1459
1458
|
entityCode: w,
|
|
1460
1459
|
record: Y,
|
|
1461
1460
|
refs: At,
|
|
1462
|
-
schema:
|
|
1461
|
+
schema: p,
|
|
1463
1462
|
locale: Jt
|
|
1464
1463
|
})
|
|
1465
1464
|
] });
|
|
@@ -1527,14 +1526,14 @@ function Et({ screenCode: t }) {
|
|
|
1527
1526
|
height: "100%",
|
|
1528
1527
|
width: `${bt}px`
|
|
1529
1528
|
},
|
|
1530
|
-
children: (Y ||
|
|
1529
|
+
children: (Y || M) && p && /* @__PURE__ */ B(Ye, {
|
|
1531
1530
|
nodes: X.sidebar,
|
|
1532
1531
|
ctx: $
|
|
1533
1532
|
})
|
|
1534
1533
|
})
|
|
1535
1534
|
]
|
|
1536
1535
|
});
|
|
1537
|
-
let Cn = y.isPhone ?
|
|
1536
|
+
let Cn = y.isPhone ? be(12) : {
|
|
1538
1537
|
paddingLeft: "24px",
|
|
1539
1538
|
paddingRight: "24px"
|
|
1540
1539
|
};
|
|
@@ -1576,7 +1575,7 @@ function Et({ screenCode: t }) {
|
|
|
1576
1575
|
minWidth: 0,
|
|
1577
1576
|
WebkitOverflowScrolling: "touch"
|
|
1578
1577
|
},
|
|
1579
|
-
children: [Sn, pn && (Y ||
|
|
1578
|
+
children: [Sn, pn && (Y || M) && p && /* @__PURE__ */ B("div", {
|
|
1580
1579
|
"data-testid": "detail-sidebar-inline",
|
|
1581
1580
|
style: {
|
|
1582
1581
|
display: "flex",
|
|
@@ -1595,14 +1594,14 @@ function Et({ screenCode: t }) {
|
|
|
1595
1594
|
function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
1596
1595
|
let a = (e) => {
|
|
1597
1596
|
let a = J(t, e, n, r, i);
|
|
1598
|
-
return a != null &&
|
|
1597
|
+
return a != null && O(a) !== "";
|
|
1599
1598
|
}, o = (e) => {
|
|
1600
1599
|
let a = J(t, e, n, r, i);
|
|
1601
|
-
return
|
|
1600
|
+
return O(a) || /* @__PURE__ */ B("span", {
|
|
1602
1601
|
style: { color: "var(--text-3)" },
|
|
1603
1602
|
children: "-"
|
|
1604
1603
|
});
|
|
1605
|
-
}, s = e.titleUsesDisplay ?
|
|
1604
|
+
}, s = e.titleUsesDisplay ? C(n, t) : e.titleField ? J(t, e.titleField, n, r, i) : void 0, c = O(s) || T(t.display?.name) || "Record", l = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
|
|
1606
1605
|
return /* @__PURE__ */ V("section", {
|
|
1607
1606
|
"data-testid": "detail-header-card",
|
|
1608
1607
|
style: {
|
|
@@ -1660,7 +1659,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1660
1659
|
children: o(e)
|
|
1661
1660
|
}, e))
|
|
1662
1661
|
}),
|
|
1663
|
-
|
|
1662
|
+
u.length > 0 && /* @__PURE__ */ B("dl", {
|
|
1664
1663
|
style: {
|
|
1665
1664
|
display: "grid",
|
|
1666
1665
|
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
@@ -1669,7 +1668,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1669
1668
|
fontSize: 12.5,
|
|
1670
1669
|
lineHeight: 1.35
|
|
1671
1670
|
},
|
|
1672
|
-
children:
|
|
1671
|
+
children: u.map((e) => /* @__PURE__ */ V("div", {
|
|
1673
1672
|
style: { display: "contents" },
|
|
1674
1673
|
children: [/* @__PURE__ */ B("dt", {
|
|
1675
1674
|
style: { color: "var(--text-3)" },
|
|
@@ -1685,7 +1684,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1685
1684
|
})]
|
|
1686
1685
|
}, e))
|
|
1687
1686
|
}),
|
|
1688
|
-
|
|
1687
|
+
d.length > 0 && /* @__PURE__ */ B("div", {
|
|
1689
1688
|
style: {
|
|
1690
1689
|
display: "flex",
|
|
1691
1690
|
flexWrap: "wrap",
|
|
@@ -1694,7 +1693,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1694
1693
|
color: "var(--text-3)",
|
|
1695
1694
|
fontSize: 11.5
|
|
1696
1695
|
},
|
|
1697
|
-
children:
|
|
1696
|
+
children: d.map((e) => /* @__PURE__ */ V("span", {
|
|
1698
1697
|
style: {
|
|
1699
1698
|
minWidth: 0,
|
|
1700
1699
|
overflowWrap: "anywhere"
|
|
@@ -1712,73 +1711,73 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1712
1711
|
function J(e, t, n, r, i) {
|
|
1713
1712
|
if (t.startsWith("$status.")) {
|
|
1714
1713
|
let e = t.slice(8), n = r?.find((t) => t.group_code === e);
|
|
1715
|
-
return
|
|
1714
|
+
return T(n?.status_name) || n?.status_code;
|
|
1716
1715
|
}
|
|
1717
1716
|
if (t.startsWith("$property.")) {
|
|
1718
1717
|
let e = t.slice(10);
|
|
1719
1718
|
return i?.find((t) => t.property_code === e)?.value;
|
|
1720
1719
|
}
|
|
1721
|
-
return
|
|
1720
|
+
return Oe(e, n, t);
|
|
1722
1721
|
}
|
|
1723
1722
|
function Ot(e, t) {
|
|
1724
1723
|
if (t.startsWith("$status.")) return t.slice(8);
|
|
1725
1724
|
if (t.startsWith("$property.")) return t.slice(10);
|
|
1726
1725
|
let n = e.fields.get(t);
|
|
1727
|
-
return n ?
|
|
1726
|
+
return n ? m(n, t) : t;
|
|
1728
1727
|
}
|
|
1729
|
-
function kt({ title:
|
|
1730
|
-
let { run:
|
|
1731
|
-
if (!
|
|
1732
|
-
let e =
|
|
1728
|
+
function kt({ title: r, recordId: i, editing: a, isNew: s, isRecordDeleted: c, dirty: l, isSaving: u, hasChildErrors: f, hasFieldErrors: m, canRestore: h, entity: _, screen: v, globalActions: y, entityCode: x, record: S, id: C, listRoute: ee, listRouteExists: E, highlights: te, showBack: ne, onBack: D, onCancelEdit: O, onSave: ie, onRestore: oe, isRestoring: se, refreshControl: k, isRealtimeEntity: ce, canManageTemplates: le }) {
|
|
1729
|
+
let { run: ue } = re(), A = fe("detail"), j = ye(), M = g(), N = ae(), de = n(v?.action_layout, _?.action_layout, _?.actions, y, "detail_toolbar"), me = n(v?.action_layout, _?.action_layout, _?.actions, y, "detail"), P = b(me, _?.actions, y, S ?? {}, [], je(_, S ?? {})), he = b(de, _?.actions, y, S ?? {}, [], je(_, S ?? {})), ge = L(() => {
|
|
1730
|
+
if (!_) return;
|
|
1731
|
+
let e = C ? [C] : [];
|
|
1733
1732
|
return {
|
|
1734
|
-
entity:
|
|
1735
|
-
entityCode:
|
|
1736
|
-
screen:
|
|
1737
|
-
screenRoute:
|
|
1738
|
-
selectedRows:
|
|
1733
|
+
entity: _,
|
|
1734
|
+
entityCode: x ?? "",
|
|
1735
|
+
screen: v,
|
|
1736
|
+
screenRoute: v?.route ?? "",
|
|
1737
|
+
selectedRows: S ? [S] : [],
|
|
1739
1738
|
selectedIds: e,
|
|
1740
1739
|
locale: N,
|
|
1741
|
-
tabNavigate: (e, t) =>
|
|
1740
|
+
tabNavigate: (e, t) => j(e, {
|
|
1742
1741
|
title: t?.title,
|
|
1743
1742
|
icon: t?.icon,
|
|
1744
1743
|
search: t?.search
|
|
1745
1744
|
}),
|
|
1746
|
-
runActionApi: (e, t) =>
|
|
1745
|
+
runActionApi: (e, t) => w(e, t)
|
|
1747
1746
|
};
|
|
1748
1747
|
}, [
|
|
1749
|
-
|
|
1748
|
+
_,
|
|
1749
|
+
x,
|
|
1750
1750
|
v,
|
|
1751
|
-
|
|
1751
|
+
C,
|
|
1752
1752
|
S,
|
|
1753
|
-
x,
|
|
1754
1753
|
N,
|
|
1755
|
-
|
|
1756
|
-
]),
|
|
1757
|
-
let n =
|
|
1754
|
+
j
|
|
1755
|
+
]), ve = (e, t) => {
|
|
1756
|
+
let n = Pe(e, t, { row: S ?? void 0 });
|
|
1758
1757
|
if (n === null) return;
|
|
1759
|
-
let r =
|
|
1760
|
-
return
|
|
1758
|
+
let r = C ? [C] : [], i = e === "__delete" && E ? ee : null;
|
|
1759
|
+
return ue({
|
|
1761
1760
|
action: t,
|
|
1762
|
-
title:
|
|
1763
|
-
row:
|
|
1764
|
-
execute: (e) =>
|
|
1761
|
+
title: T(t.display?.name) || e,
|
|
1762
|
+
row: S ?? void 0,
|
|
1763
|
+
execute: (e) => w(n, d(e, r)),
|
|
1765
1764
|
onSuccess: i ? () => {
|
|
1766
|
-
|
|
1765
|
+
_e.getState().kill(xe(location)), M(i, { replace: !0 });
|
|
1767
1766
|
} : void 0
|
|
1768
1767
|
});
|
|
1769
|
-
},
|
|
1770
|
-
layout:
|
|
1771
|
-
row:
|
|
1772
|
-
onRun:
|
|
1768
|
+
}, be = A.isVisible("show_actions") && !s && C && P.length > 0 ? /* @__PURE__ */ B(De, {
|
|
1769
|
+
layout: P,
|
|
1770
|
+
row: S,
|
|
1771
|
+
onRun: ve,
|
|
1773
1772
|
kind: "detail",
|
|
1774
|
-
entityActions:
|
|
1775
|
-
globalActions:
|
|
1773
|
+
entityActions: _?.actions,
|
|
1774
|
+
globalActions: y,
|
|
1776
1775
|
reservedRightWidth: 0,
|
|
1777
|
-
widgetContext:
|
|
1778
|
-
}) : null, Se = !s &&
|
|
1779
|
-
liveObject:
|
|
1780
|
-
realtime:
|
|
1781
|
-
}) : null,
|
|
1776
|
+
widgetContext: ge
|
|
1777
|
+
}) : null, Se = !s && C ? /* @__PURE__ */ B(pe, {
|
|
1778
|
+
liveObject: k,
|
|
1779
|
+
realtime: ce
|
|
1780
|
+
}) : null, Ce = A.isVisible("show_actions") && !s && C && he.length > 0 ? /* @__PURE__ */ V("div", {
|
|
1782
1781
|
style: {
|
|
1783
1782
|
display: "flex",
|
|
1784
1783
|
justifyContent: "flex-end",
|
|
@@ -1786,62 +1785,62 @@ function kt({ title: n, recordId: a, editing: o, isNew: s, isRecordDeleted: c, d
|
|
|
1786
1785
|
gap: 8,
|
|
1787
1786
|
marginTop: 10
|
|
1788
1787
|
},
|
|
1789
|
-
children: [
|
|
1790
|
-
layout:
|
|
1791
|
-
row:
|
|
1792
|
-
onRun:
|
|
1788
|
+
children: [be ? null : Se, /* @__PURE__ */ B(De, {
|
|
1789
|
+
layout: he,
|
|
1790
|
+
row: S,
|
|
1791
|
+
onRun: ve,
|
|
1793
1792
|
kind: "detail",
|
|
1794
|
-
entityActions:
|
|
1795
|
-
globalActions:
|
|
1793
|
+
entityActions: _?.actions,
|
|
1794
|
+
globalActions: y,
|
|
1796
1795
|
reservedRightWidth: 0,
|
|
1797
|
-
widgetContext:
|
|
1798
|
-
ariaLabel:
|
|
1796
|
+
widgetContext: ge,
|
|
1797
|
+
ariaLabel: be ? "Detail toolbar actions" : "Page actions"
|
|
1799
1798
|
})]
|
|
1800
|
-
}) : null,
|
|
1801
|
-
entityCode:
|
|
1799
|
+
}) : null, we = A.isVisible("show_actions") && !s && C && x ? /* @__PURE__ */ B(qe, {
|
|
1800
|
+
entityCode: x,
|
|
1802
1801
|
scope: "detail",
|
|
1803
|
-
objectIds: [
|
|
1804
|
-
capability:
|
|
1805
|
-
canManageTemplates:
|
|
1806
|
-
}) : null,
|
|
1802
|
+
objectIds: [C],
|
|
1803
|
+
capability: _?.documents,
|
|
1804
|
+
canManageTemplates: le
|
|
1805
|
+
}) : null, Te = c ? h ? /* @__PURE__ */ B(p, {
|
|
1807
1806
|
kind: "primary",
|
|
1808
|
-
icon: B(se ?
|
|
1809
|
-
onClick:
|
|
1807
|
+
icon: B(se ? o : e.refresh, { size: 13 }),
|
|
1808
|
+
onClick: oe,
|
|
1810
1809
|
disabled: se,
|
|
1811
1810
|
children: se ? "Restoring…" : "Restore"
|
|
1812
|
-
}) : null :
|
|
1811
|
+
}) : null : a ? /* @__PURE__ */ V(nt, { children: [/* @__PURE__ */ B(p, {
|
|
1813
1812
|
icon: /* @__PURE__ */ B(e.x, { size: 13 }),
|
|
1814
|
-
onClick:
|
|
1815
|
-
disabled:
|
|
1813
|
+
onClick: O,
|
|
1814
|
+
disabled: u,
|
|
1816
1815
|
children: "Cancel"
|
|
1817
|
-
}), /* @__PURE__ */ B(
|
|
1816
|
+
}), /* @__PURE__ */ B(p, {
|
|
1818
1817
|
kind: "primary",
|
|
1819
|
-
icon: B(
|
|
1820
|
-
onClick:
|
|
1821
|
-
disabled:
|
|
1822
|
-
title:
|
|
1823
|
-
children:
|
|
1824
|
-
})] }) : !s &&
|
|
1818
|
+
icon: B(u ? o : e.save, { size: 13 }),
|
|
1819
|
+
onClick: ie,
|
|
1820
|
+
disabled: u || f || m,
|
|
1821
|
+
title: f ? "Fix errors in child rows" : m ? "Fix the highlighted fields" : void 0,
|
|
1822
|
+
children: u ? "Saving…" : "Save"
|
|
1823
|
+
})] }) : !s && C ? be ? /* @__PURE__ */ V("span", {
|
|
1825
1824
|
style: { display: "contents" },
|
|
1826
|
-
children: [
|
|
1827
|
-
}) :
|
|
1825
|
+
children: [we, be]
|
|
1826
|
+
}) : we : null;
|
|
1828
1827
|
return /* @__PURE__ */ V(nt, { children: [/* @__PURE__ */ B(q, {
|
|
1829
|
-
icon:
|
|
1830
|
-
name:
|
|
1828
|
+
icon: _?.display.icon ? /* @__PURE__ */ B(t, {
|
|
1829
|
+
name: _.display.icon,
|
|
1831
1830
|
size: 16
|
|
1832
1831
|
}) : void 0,
|
|
1833
|
-
title:
|
|
1834
|
-
description:
|
|
1835
|
-
recordId:
|
|
1836
|
-
highlights:
|
|
1837
|
-
identityControls: !c && !
|
|
1838
|
-
mode: s ? "create" :
|
|
1839
|
-
dirty:
|
|
1840
|
-
showBack:
|
|
1841
|
-
onBack:
|
|
1842
|
-
right:
|
|
1843
|
-
showTitle:
|
|
1844
|
-
}),
|
|
1832
|
+
title: r,
|
|
1833
|
+
description: T(v?.display?.description) || T(_?.display?.description),
|
|
1834
|
+
recordId: i,
|
|
1835
|
+
highlights: te,
|
|
1836
|
+
identityControls: !c && !a && !s ? Se : null,
|
|
1837
|
+
mode: s ? "create" : a ? "edit" : "display",
|
|
1838
|
+
dirty: l,
|
|
1839
|
+
showBack: ne,
|
|
1840
|
+
onBack: D,
|
|
1841
|
+
right: Te,
|
|
1842
|
+
showTitle: A.isVisible("show_title")
|
|
1843
|
+
}), Ce] });
|
|
1845
1844
|
}
|
|
1846
1845
|
//#endregion
|
|
1847
1846
|
export { Tt as SmartDetailPage };
|