@declarion/react 0.59.2 → 0.61.1
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/{AgentChatPanel.impl-DBH1Ff4G.js → AgentChatPanel.impl-rgkewyMl.js} +40 -40
- package/dist-lib/{DetailAuditStrip-9eJM2Fml.js → DetailAuditStrip-CSXZoy7v.js} +12 -12
- package/dist-lib/{DraggableChildrenTable-4RZC351U.js → DraggableChildrenTable-DruYOxKm.js} +35 -35
- package/dist-lib/{Grid-CQabaBLx.js → Grid-Dsf3I0xG.js} +3 -3
- package/dist-lib/{LayoutRenderer-DGKWZKpW.js → LayoutRenderer-QN7Wp2W6.js} +465 -465
- package/dist-lib/{ListCardsBody-DfGmyNIu.js → ListCardsBody-CNaZ0xwz.js} +27 -27
- package/dist-lib/{MarkdownRenderer-BDbzDv_y.js → MarkdownRenderer-BuO5hYJh.js} +2 -2
- package/dist-lib/{RefreshControl-Bhoib0ZA.js → RefreshControl-DO9rYcdq.js} +27 -27
- package/dist-lib/{SmartDetailPage.impl-DFjz29Ff.js → SmartDetailPage.impl-DFIIx80b.js} +471 -471
- package/dist-lib/SmartListPage.impl-D694R32H.js +3051 -0
- package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.js +780 -0
- package/dist-lib/{SortHeaderMenu-Cijxk4cX.js → SortHeaderMenu-BV-aQbPy.js} +2 -2
- package/dist-lib/{action-dispatch-DY0c8U81.js → action-dispatch-gWmOYjOP.js} +189 -189
- package/dist-lib/api/data.d.ts +5 -1
- package/dist-lib/{cardProjection-Bkl2SSYz.js → cardProjection-BnmWukxk.js} +1 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +9 -2
- package/dist-lib/components/pages/list/useListViews.d.ts +3 -2
- package/dist-lib/components/primitives/Fields.d.ts +3 -1
- package/dist-lib/{failure-v-uGSpbX.js → failure-BUxXuP4c.js} +6 -6
- package/dist-lib/{format-count-DA4wmmWR.js → format-count-bXVfHzbI.js} +247 -247
- package/dist-lib/hooks/useObject.d.ts +3 -2
- package/dist-lib/index.js +1055 -1047
- package/dist-lib/lib/field-classification.d.ts +10 -1
- package/dist-lib/{peekDraftStore-D-cTbiIr.js → peekDraftStore-Dk1Ha5u3.js} +7 -7
- package/dist-lib/{registry-Cb3W-czW.js → registry-nSeHd5si.js} +445 -439
- package/dist-lib/testing.js +3 -3
- package/dist-lib/types/api.d.ts +0 -1
- package/dist-lib/{useAgentConversation-D97IqE-J.js → useAgentConversation-nT5UypJX.js} +15 -15
- package/dist-lib/{useCurrentScreen-BL5NZFCw.js → useCurrentScreen-0WBj7wT6.js} +1176 -1090
- package/dist-lib/{useListQuery-BG1GyKtJ.js → useListQuery-C7dq_sEo.js} +5 -5
- package/dist-lib/{field-classification-C28XE-_P.js → useOwnRefresh-q80kCMMh.js} +134 -160
- package/dist-lib/{useProperties-4Lg3odrt.js → useProperties-CeGKtq7Q.js} +3 -3
- package/dist-lib/{useTabSearchMirror-ZVLlINBX.js → useTabSearchMirror-CzNAj82Q.js} +2 -2
- package/dist-lib/{useText-BFDCTUSo.js → useText-BsedsJ-J.js} +2 -2
- package/dist-lib/{value-By1-WJ8J.js → value-Dwfyghtj.js} +1 -1
- package/package.json +9 -9
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +0 -3046
- package/dist-lib/SmartRecordListPage.impl-C1FJLr80.js +0 -780
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import {
|
|
3
|
-
import { r as
|
|
4
|
-
import { $ as
|
|
5
|
-
import { c as
|
|
6
|
-
import { i as
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import { c as
|
|
10
|
-
import { n as
|
|
11
|
-
import { a as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { Fragment as
|
|
2
|
+
import { Bn as n, Bt as r, Dn as i, En as a, Jn as o, Kn as s, Nn as c, On as l, Tn as u, Vn as d, W as f, X as p, b as m, ct as h, et as g, fn as _, gn as v, i as y, jn as b, kn as x, ot as S, qn as C, qt as ee, rt as te, ut as ne, wn as re, y as w, zn as ie } from "./useCurrentScreen-0WBj7wT6.js";
|
|
3
|
+
import { r as ae, s as T, t as E } from "./RefreshControl-DO9rYcdq.js";
|
|
4
|
+
import { $ as oe, D as se, f as ce, p as le, t as D, u as ue } from "./useText-BsedsJ-J.js";
|
|
5
|
+
import { c as O, h as k, s as de } from "./registry-nSeHd5si.js";
|
|
6
|
+
import { i as fe, n as pe, t as me } from "./DetailAuditStrip-CSXZoy7v.js";
|
|
7
|
+
import { a as he, m as A, n as j, p as M, r as N, t as P, u as F } from "./failure-BUxXuP4c.js";
|
|
8
|
+
import { A as ge, E as _e, S as ve, T as ye, a as be, c as xe, f as Se, g as Ce, l as we, n as Te, s as Ee, x as De } from "./useOwnRefresh-q80kCMMh.js";
|
|
9
|
+
import { c as Oe, f as ke, h as Ae, m as je, o as Me, p as Ne, r as Pe, t as Fe, u as Ie } from "./action-dispatch-gWmOYjOP.js";
|
|
10
|
+
import { n as Le, r as Re, t as ze } from "./dataTableStyles-vwD1mVOP.js";
|
|
11
|
+
import { a as Be, i as Ve, o as He, r as Ue, s as We } from "./peekDraftStore-Dk1Ha5u3.js";
|
|
12
|
+
import { n as Ge, t as Ke } from "./LayoutRenderer-QN7Wp2W6.js";
|
|
13
|
+
import { t as qe } from "./cardProjection-BnmWukxk.js";
|
|
14
|
+
import { Fragment as Je, useCallback as Ye, useEffect as I, useMemo as L, useRef as Xe, useState as R } from "react";
|
|
15
15
|
import { useLocation as Ze, useParams as Qe, useSearchParams as $e } from "react-router";
|
|
16
16
|
import { useQuery as z, useQueryClient as et } from "@tanstack/react-query";
|
|
17
17
|
import { Fragment as tt, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
18
18
|
//#region src/components/chrome/AssociationTabs.tsx
|
|
19
19
|
function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
20
|
-
let a =
|
|
20
|
+
let a = D(), o = L(() => Object.entries(r), [r]), [s, c] = R(0);
|
|
21
21
|
if (o.length === 0) return null;
|
|
22
22
|
let [l, u] = o[s];
|
|
23
|
-
return /* @__PURE__ */ B(
|
|
23
|
+
return /* @__PURE__ */ B(k, {
|
|
24
24
|
title: /* @__PURE__ */ B("div", {
|
|
25
25
|
style: {
|
|
26
26
|
display: "flex",
|
|
@@ -68,108 +68,108 @@ function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
68
68
|
})
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
function H({ entityCode: t, recordId: n, assocKey: r, association:
|
|
72
|
-
let
|
|
71
|
+
function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: s }) {
|
|
72
|
+
let c = D(), l = D("errors"), u = _e(), d = `${t}.${r}`, { data: f, isLoading: m } = z({
|
|
73
73
|
queryKey: [
|
|
74
74
|
"association",
|
|
75
|
-
|
|
75
|
+
d,
|
|
76
76
|
n
|
|
77
77
|
],
|
|
78
|
-
queryFn: () =>
|
|
79
|
-
}),
|
|
78
|
+
queryFn: () => A(d, [n])
|
|
79
|
+
}), h = f?.target_entity ?? a.target, g = s.entities[h], _ = L(() => f?.ids ?? [], [f?.ids]), v = L(() => g?.fields.names().find((e) => g.fields.get(e)?.primary) ?? "id", [g]), y = L(() => _.slice(0, 50), [_]), { data: b, isLoading: x } = z({
|
|
80
80
|
queryKey: [
|
|
81
81
|
"association-records",
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
h,
|
|
83
|
+
y
|
|
84
84
|
],
|
|
85
|
-
queryFn: () =>
|
|
85
|
+
queryFn: () => M(h, {
|
|
86
86
|
per_page: 50,
|
|
87
87
|
filters: [{
|
|
88
|
-
field:
|
|
88
|
+
field: v,
|
|
89
89
|
op: "in",
|
|
90
|
-
value:
|
|
90
|
+
value: y
|
|
91
91
|
}]
|
|
92
92
|
}),
|
|
93
|
-
enabled:
|
|
94
|
-
}),
|
|
95
|
-
let t =
|
|
93
|
+
enabled: y.length > 0 && !!g
|
|
94
|
+
}), S = b?.data ?? [], C = b?.$refs, ee = L(() => g ? g.fields.names().filter((e) => {
|
|
95
|
+
let t = g.fields.get(e);
|
|
96
96
|
return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
|
|
97
|
-
}).slice(0, 6) : [], [
|
|
98
|
-
let e =
|
|
97
|
+
}).slice(0, 6) : [], [g]), ne = () => {
|
|
98
|
+
let e = p(s, h);
|
|
99
99
|
if (!e) return;
|
|
100
|
-
let t =
|
|
100
|
+
let t = c(a.display?.name) || r, n = new URLSearchParams();
|
|
101
101
|
n.set("filters", JSON.stringify([{
|
|
102
|
-
field:
|
|
102
|
+
field: v,
|
|
103
103
|
op: "in",
|
|
104
|
-
value:
|
|
105
|
-
}])),
|
|
104
|
+
value: _
|
|
105
|
+
}])), u(e.route, {
|
|
106
106
|
title: t,
|
|
107
|
-
icon:
|
|
107
|
+
icon: a.display?.icon || e.icon,
|
|
108
108
|
search: n.toString()
|
|
109
109
|
});
|
|
110
|
-
},
|
|
110
|
+
}, re = {
|
|
111
111
|
fontSize: 12.5,
|
|
112
112
|
color: "var(--text-3)",
|
|
113
113
|
padding: "14px 16px"
|
|
114
114
|
};
|
|
115
|
-
if (
|
|
116
|
-
style:
|
|
117
|
-
children:
|
|
115
|
+
if (m || x) return /* @__PURE__ */ B("div", {
|
|
116
|
+
style: re,
|
|
117
|
+
children: c("shell.loading", "Loading…")
|
|
118
118
|
});
|
|
119
|
-
if (!
|
|
120
|
-
style:
|
|
121
|
-
children:
|
|
119
|
+
if (!g) return /* @__PURE__ */ B("div", {
|
|
120
|
+
style: re,
|
|
121
|
+
children: l("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
122
122
|
});
|
|
123
|
-
if (
|
|
124
|
-
style:
|
|
125
|
-
children:
|
|
123
|
+
if (_.length === 0) return /* @__PURE__ */ B("div", {
|
|
124
|
+
style: re,
|
|
125
|
+
children: c("shell.association.empty", "No related records.")
|
|
126
126
|
});
|
|
127
|
-
let
|
|
127
|
+
let w = p(s, h);
|
|
128
128
|
return /* @__PURE__ */ V("div", {
|
|
129
129
|
style: { padding: "8px 0" },
|
|
130
130
|
children: [
|
|
131
131
|
/* @__PURE__ */ V("table", {
|
|
132
|
-
style:
|
|
133
|
-
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children:
|
|
134
|
-
style:
|
|
135
|
-
children:
|
|
136
|
-
}, e)) }) }), /* @__PURE__ */ B("tbody", { children:
|
|
137
|
-
let n =
|
|
132
|
+
style: Re,
|
|
133
|
+
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: ee.map((e) => /* @__PURE__ */ B("th", {
|
|
134
|
+
style: Le,
|
|
135
|
+
children: i(c, g.fields.get(e), e, s.entities)
|
|
136
|
+
}, e)) }) }), /* @__PURE__ */ B("tbody", { children: S.map((e, t) => /* @__PURE__ */ B("tr", { children: ee.map((t) => {
|
|
137
|
+
let n = g.fields.get(t);
|
|
138
138
|
return n ? /* @__PURE__ */ B("td", {
|
|
139
|
-
style:
|
|
140
|
-
children:
|
|
139
|
+
style: ze,
|
|
140
|
+
children: te({
|
|
141
141
|
field: n,
|
|
142
142
|
fieldName: t,
|
|
143
143
|
value: e[t],
|
|
144
144
|
mode: "display",
|
|
145
145
|
record: e,
|
|
146
|
-
refs:
|
|
147
|
-
t:
|
|
146
|
+
refs: C,
|
|
147
|
+
t: c
|
|
148
148
|
})
|
|
149
149
|
}, t) : /* @__PURE__ */ B("td", {}, t);
|
|
150
150
|
}) }, t)) })]
|
|
151
151
|
}),
|
|
152
|
-
|
|
152
|
+
w && f && f.count > S.length && /* @__PURE__ */ B("div", {
|
|
153
153
|
style: {
|
|
154
154
|
padding: "10px 16px",
|
|
155
155
|
textAlign: "center"
|
|
156
156
|
},
|
|
157
|
-
children: /* @__PURE__ */ B(
|
|
157
|
+
children: /* @__PURE__ */ B(o, {
|
|
158
158
|
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
159
|
-
onClick:
|
|
160
|
-
children:
|
|
159
|
+
onClick: ne,
|
|
160
|
+
children: c("shell.association.view_all", "View all {count} records", { count: f.count })
|
|
161
161
|
})
|
|
162
162
|
}),
|
|
163
|
-
|
|
163
|
+
w && S.length > 0 && f && f.count <= S.length && /* @__PURE__ */ B("div", {
|
|
164
164
|
style: {
|
|
165
165
|
padding: "10px 16px",
|
|
166
166
|
textAlign: "center"
|
|
167
167
|
},
|
|
168
|
-
children: /* @__PURE__ */ B(
|
|
168
|
+
children: /* @__PURE__ */ B(o, {
|
|
169
169
|
kind: "ghost",
|
|
170
170
|
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
171
|
-
onClick:
|
|
172
|
-
children:
|
|
171
|
+
onClick: ne,
|
|
172
|
+
children: c("shell.association.open_list", "Open in list view")
|
|
173
173
|
})
|
|
174
174
|
})
|
|
175
175
|
]
|
|
@@ -182,20 +182,20 @@ function it(e) {
|
|
|
182
182
|
return e?.some((e) => e.status === "pending") ? rt : !1;
|
|
183
183
|
}
|
|
184
184
|
function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
|
|
185
|
-
let a =
|
|
185
|
+
let a = D(), o = D("errors"), { data: s, isLoading: c, error: l } = z({
|
|
186
186
|
queryKey: [
|
|
187
|
-
|
|
187
|
+
w,
|
|
188
188
|
t,
|
|
189
189
|
n
|
|
190
190
|
],
|
|
191
|
-
queryFn: async () => (await
|
|
191
|
+
queryFn: async () => (await F("document.object_links", {
|
|
192
192
|
entity: t,
|
|
193
193
|
object_id: n
|
|
194
194
|
})).result?.documents ?? [],
|
|
195
195
|
enabled: !!(t && n) && (!!r || !!i),
|
|
196
196
|
refetchInterval: (e) => it(e.state.data)
|
|
197
197
|
}), u = (s?.length ?? 0) > 0;
|
|
198
|
-
return !r && !u ? null : /* @__PURE__ */ V(
|
|
198
|
+
return !r && !u ? null : /* @__PURE__ */ V(k, {
|
|
199
199
|
title: /* @__PURE__ */ B(W, {}),
|
|
200
200
|
collapsible: !1,
|
|
201
201
|
padding: "0",
|
|
@@ -206,7 +206,7 @@ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
206
206
|
}),
|
|
207
207
|
l && /* @__PURE__ */ B(G, {
|
|
208
208
|
icon: /* @__PURE__ */ B(e.warning, { size: 14 }),
|
|
209
|
-
text:
|
|
209
|
+
text: P(o, l)
|
|
210
210
|
}),
|
|
211
211
|
!c && !l && (s?.length ?? 0) === 0 && /* @__PURE__ */ B(G, {
|
|
212
212
|
icon: /* @__PURE__ */ B(e.file, { size: 14 }),
|
|
@@ -227,7 +227,7 @@ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
function W() {
|
|
230
|
-
let t =
|
|
230
|
+
let t = D();
|
|
231
231
|
return /* @__PURE__ */ V("div", {
|
|
232
232
|
style: {
|
|
233
233
|
display: "flex",
|
|
@@ -243,50 +243,50 @@ function W() {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
function ot({ entityCode: t, objectId: n, doc: r }) {
|
|
246
|
-
let i =
|
|
247
|
-
async function
|
|
248
|
-
d(!0),
|
|
246
|
+
let i = D(), { data: a } = ce(), s = i(a?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === r.status)?.name) || r.status, c = D("errors"), l = et(), [u, d] = R(!1), [f, p] = R(!1), [m, h] = R(!1), [g, _] = R(!1), [v, y] = R(null), b = i(r.title) || r.filename || r.template_code, x = r.status === "ready" && r.download_url && !g;
|
|
247
|
+
async function S() {
|
|
248
|
+
d(!0), y(null);
|
|
249
249
|
try {
|
|
250
|
-
let e = (await
|
|
250
|
+
let e = (await F("document.download_format", {
|
|
251
251
|
generated_document_id: r.generated_document_id,
|
|
252
252
|
format: U
|
|
253
253
|
})).result;
|
|
254
|
-
e?.download_url && await
|
|
254
|
+
e?.download_url && await j(c, e.download_url, e.filename);
|
|
255
255
|
} catch (e) {
|
|
256
|
-
|
|
256
|
+
N(e) ? (_(!0), y(c("document.artifact_unavailable", "This generated file is not available."))) : y(P(c, e));
|
|
257
257
|
} finally {
|
|
258
258
|
d(!1);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
async function
|
|
261
|
+
async function C() {
|
|
262
262
|
if (r.download_url) {
|
|
263
|
-
p(!0),
|
|
263
|
+
p(!0), y(null);
|
|
264
264
|
try {
|
|
265
|
-
await
|
|
265
|
+
await j(c, r.download_url, r.filename);
|
|
266
266
|
} catch (e) {
|
|
267
|
-
|
|
267
|
+
N(e) ? (_(!0), y(c("document.artifact_unavailable", "This generated file is not available."))) : y(P(c, e));
|
|
268
268
|
} finally {
|
|
269
269
|
p(!1);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
async function
|
|
274
|
-
|
|
273
|
+
async function ee() {
|
|
274
|
+
h(!0), y(null);
|
|
275
275
|
try {
|
|
276
|
-
await
|
|
276
|
+
await F("document.generate", {
|
|
277
277
|
...r.input ?? {},
|
|
278
278
|
template_code: r.template_code,
|
|
279
279
|
template_source: r.template_source,
|
|
280
280
|
output_format: r.output_format
|
|
281
281
|
}), await l.invalidateQueries({ queryKey: [
|
|
282
|
-
|
|
282
|
+
w,
|
|
283
283
|
t,
|
|
284
284
|
n
|
|
285
285
|
] });
|
|
286
286
|
} catch (e) {
|
|
287
|
-
|
|
287
|
+
y(P(c, e));
|
|
288
288
|
} finally {
|
|
289
|
-
|
|
289
|
+
h(!1);
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
return /* @__PURE__ */ V("div", {
|
|
@@ -310,7 +310,7 @@ function ot({ entityCode: t, objectId: n, doc: r }) {
|
|
|
310
310
|
textOverflow: "ellipsis",
|
|
311
311
|
whiteSpace: "nowrap"
|
|
312
312
|
},
|
|
313
|
-
children:
|
|
313
|
+
children: b
|
|
314
314
|
}),
|
|
315
315
|
/* @__PURE__ */ V("div", {
|
|
316
316
|
style: {
|
|
@@ -323,7 +323,7 @@ function ot({ entityCode: t, objectId: n, doc: r }) {
|
|
|
323
323
|
},
|
|
324
324
|
children: [
|
|
325
325
|
/* @__PURE__ */ B("span", { children: r.output_format.toUpperCase() }),
|
|
326
|
-
/* @__PURE__ */ B("span", { children:
|
|
326
|
+
/* @__PURE__ */ B("span", { children: g ? i("document.row.artifact_missing", "artifact unavailable") : s }),
|
|
327
327
|
/* @__PURE__ */ B("span", { children: r.ready_at || r.created_at })
|
|
328
328
|
]
|
|
329
329
|
}),
|
|
@@ -335,43 +335,43 @@ function ot({ entityCode: t, objectId: n, doc: r }) {
|
|
|
335
335
|
},
|
|
336
336
|
children: r.error_text
|
|
337
337
|
}),
|
|
338
|
-
|
|
338
|
+
v && /* @__PURE__ */ B("div", {
|
|
339
339
|
style: {
|
|
340
340
|
marginTop: 5,
|
|
341
341
|
color: "var(--danger)",
|
|
342
342
|
fontSize: 12
|
|
343
343
|
},
|
|
344
|
-
children:
|
|
344
|
+
children: v
|
|
345
345
|
})
|
|
346
346
|
]
|
|
347
|
-
}),
|
|
347
|
+
}), x ? /* @__PURE__ */ V("div", {
|
|
348
348
|
style: {
|
|
349
349
|
display: "flex",
|
|
350
350
|
gap: 6
|
|
351
351
|
},
|
|
352
|
-
children: [/* @__PURE__ */ B(
|
|
352
|
+
children: [/* @__PURE__ */ B(o, {
|
|
353
353
|
kind: "ghost",
|
|
354
354
|
size: "sm",
|
|
355
355
|
icon: B(u ? e.loader : e.file, { size: 12 }),
|
|
356
|
-
onClick:
|
|
356
|
+
onClick: S,
|
|
357
357
|
disabled: u,
|
|
358
358
|
children: U.toUpperCase()
|
|
359
|
-
}), /* @__PURE__ */ B(
|
|
359
|
+
}), /* @__PURE__ */ B(o, {
|
|
360
360
|
kind: "default",
|
|
361
361
|
size: "sm",
|
|
362
362
|
icon: B(f ? e.loader : e.download, { size: 12 }),
|
|
363
|
-
onClick:
|
|
363
|
+
onClick: C,
|
|
364
364
|
disabled: f,
|
|
365
365
|
children: i("document.result.download", "Download")
|
|
366
366
|
})]
|
|
367
|
-
}) :
|
|
367
|
+
}) : g ? /* @__PURE__ */ B(o, {
|
|
368
368
|
kind: "ghost",
|
|
369
369
|
size: "sm",
|
|
370
|
-
icon: B(
|
|
371
|
-
onClick:
|
|
372
|
-
disabled:
|
|
370
|
+
icon: B(m ? e.loader : e.file, { size: 12 }),
|
|
371
|
+
onClick: ee,
|
|
372
|
+
disabled: m,
|
|
373
373
|
children: i("document.row.regenerate", "Regenerate")
|
|
374
|
-
}) : /* @__PURE__ */ B(
|
|
374
|
+
}) : /* @__PURE__ */ B(o, {
|
|
375
375
|
kind: "ghost",
|
|
376
376
|
size: "sm",
|
|
377
377
|
disabled: !0,
|
|
@@ -395,7 +395,7 @@ function G({ icon: e, text: t }) {
|
|
|
395
395
|
//#endregion
|
|
396
396
|
//#region src/components/detail-layout/ErrorSummary.tsx
|
|
397
397
|
function st({ errors: t, onJump: n }) {
|
|
398
|
-
let r =
|
|
398
|
+
let r = D();
|
|
399
399
|
return t.length === 0 ? null : /* @__PURE__ */ V("div", {
|
|
400
400
|
role: "alert",
|
|
401
401
|
style: {
|
|
@@ -426,7 +426,7 @@ function st({ errors: t, onJump: n }) {
|
|
|
426
426
|
fontWeight: 600,
|
|
427
427
|
marginBottom: 4
|
|
428
428
|
},
|
|
429
|
-
children:
|
|
429
|
+
children: ue(r, "record.errors.summary", t.length, {
|
|
430
430
|
one: "{count} field needs attention",
|
|
431
431
|
other: "{count} fields need attention"
|
|
432
432
|
})
|
|
@@ -487,7 +487,7 @@ function K({ items: e }) {
|
|
|
487
487
|
gap: "6px 0",
|
|
488
488
|
fontSize: 12
|
|
489
489
|
},
|
|
490
|
-
children: e.map((e, t) => /* @__PURE__ */ V(
|
|
490
|
+
children: e.map((e, t) => /* @__PURE__ */ V(Je, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
|
|
491
491
|
width: 1,
|
|
492
492
|
height: 12,
|
|
493
493
|
background: "var(--divider)",
|
|
@@ -514,17 +514,17 @@ function K({ items: e }) {
|
|
|
514
514
|
}
|
|
515
515
|
//#endregion
|
|
516
516
|
//#region src/components/detail-layout/DetailHighlights.tsx
|
|
517
|
-
function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses:
|
|
518
|
-
let c =
|
|
517
|
+
function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o }) {
|
|
518
|
+
let c = D(), l = e.highlights;
|
|
519
519
|
if (!l || l.length === 0) return null;
|
|
520
520
|
let u = [];
|
|
521
521
|
for (let e of l) {
|
|
522
522
|
let l = t.status_groups?.[e];
|
|
523
523
|
if (l) {
|
|
524
|
-
let t =
|
|
524
|
+
let t = a?.find((t) => t.group_code === e), n = t ? l.statuses.find((e) => e.code === t.status_code) : void 0;
|
|
525
525
|
u.push({
|
|
526
526
|
label: c(l.name),
|
|
527
|
-
value: n ? /* @__PURE__ */ B(
|
|
527
|
+
value: n ? /* @__PURE__ */ B(s, {
|
|
528
528
|
tone: n.color ?? "slate",
|
|
529
529
|
size: "xs",
|
|
530
530
|
children: c(n.name)
|
|
@@ -536,20 +536,20 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
536
536
|
continue;
|
|
537
537
|
}
|
|
538
538
|
if (t.fields.get(e) || t.files?.get(e)) {
|
|
539
|
-
let a =
|
|
539
|
+
let a = Ne({
|
|
540
540
|
entity: t,
|
|
541
541
|
entityCode: n,
|
|
542
542
|
fieldName: e,
|
|
543
543
|
record: r,
|
|
544
544
|
mode: "display",
|
|
545
545
|
refs: i,
|
|
546
|
-
entities:
|
|
547
|
-
screens:
|
|
546
|
+
entities: o.entities,
|
|
547
|
+
screens: o.screens,
|
|
548
548
|
surface: "list",
|
|
549
549
|
t: c
|
|
550
550
|
});
|
|
551
551
|
u.push({
|
|
552
|
-
label:
|
|
552
|
+
label: je(c, t, e, o.entities),
|
|
553
553
|
value: a
|
|
554
554
|
});
|
|
555
555
|
continue;
|
|
@@ -565,8 +565,8 @@ function lt(e, t) {
|
|
|
565
565
|
if (!Number.isNaN(n.getTime())) return n.toLocaleString(t);
|
|
566
566
|
}
|
|
567
567
|
function ut({ evidence: e }) {
|
|
568
|
-
let t =
|
|
569
|
-
return r && i.push(t("record.evidence.verified", "Verified {when}", { when: r })), e?.seq && i.push(t("record.evidence.chain", "chain #{seq}", { seq: e.seq })), e?.
|
|
568
|
+
let t = D(), n = e?.verdict ?? "unverified", r = lt(e?.verified_at, t.language), i = [];
|
|
569
|
+
return r && i.push(t("record.evidence.verified", "Verified {when}", { when: r })), e?.seq && i.push(t("record.evidence.chain", "chain #{seq}", { seq: e.seq })), e?.generation && i.push(t("record.evidence.generation", "generation {number}", { number: e.generation })), /* @__PURE__ */ V("div", {
|
|
570
570
|
style: {
|
|
571
571
|
display: "flex",
|
|
572
572
|
flexDirection: "column",
|
|
@@ -588,11 +588,11 @@ function ut({ evidence: e }) {
|
|
|
588
588
|
},
|
|
589
589
|
children: t("record.evidence.title", "Evidence")
|
|
590
590
|
}),
|
|
591
|
-
/* @__PURE__ */ B(
|
|
592
|
-
tone:
|
|
591
|
+
/* @__PURE__ */ B(s, {
|
|
592
|
+
tone: Be(n),
|
|
593
593
|
size: "sm",
|
|
594
594
|
dot: !0,
|
|
595
|
-
children:
|
|
595
|
+
children: Ve(t, n)
|
|
596
596
|
}),
|
|
597
597
|
i.length > 0 && /* @__PURE__ */ B("span", {
|
|
598
598
|
style: {
|
|
@@ -664,52 +664,52 @@ function ht(e, t) {
|
|
|
664
664
|
}
|
|
665
665
|
//#endregion
|
|
666
666
|
//#region src/components/pages/SmartDetailPage.impl.tsx
|
|
667
|
-
var gt = () => {};
|
|
668
|
-
function
|
|
667
|
+
var gt = () => {}, _t = { expand: ["evidence"] };
|
|
668
|
+
function vt(e, t) {
|
|
669
669
|
return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function yt(e, t) {
|
|
672
672
|
if (e) {
|
|
673
|
-
let n =
|
|
673
|
+
let n = a(e, t), r = c(n);
|
|
674
674
|
if (r.replace(/^\|+|\|+$/g, "")) return r;
|
|
675
675
|
}
|
|
676
|
-
return t.id == null ? crypto.randomUUID() :
|
|
676
|
+
return t.id == null ? crypto.randomUUID() : d(t.id);
|
|
677
677
|
}
|
|
678
678
|
function q({ screenCode: e }) {
|
|
679
|
-
return /* @__PURE__ */ B(
|
|
679
|
+
return /* @__PURE__ */ B(S, { children: /* @__PURE__ */ B(bt, { screenCode: e }) });
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
let
|
|
683
|
-
if (!
|
|
684
|
-
let e =
|
|
681
|
+
function bt({ screenCode: t }) {
|
|
682
|
+
let o = D(), s = D("errors"), { id: d } = Qe(), f = r(), [p, g] = $e(), { data: _ } = ce(), y = le((e) => e.user), S = h(), te = v(), w = _?.screens[t], T = w?.entity ? _?.entities[w.entity] : void 0, E = w?.entity, ue = u(T, "create"), k = u(T, "update"), pe = u(T, "restore"), he = (() => {
|
|
683
|
+
if (!T || !T.singleton || !T.prefilter) return;
|
|
684
|
+
let e = x(T);
|
|
685
685
|
if (e.length !== 1) return;
|
|
686
|
-
let t =
|
|
687
|
-
if (t === "$caller.user_id") return
|
|
688
|
-
if (t === "$caller.tenant_id") return
|
|
689
|
-
})(),
|
|
690
|
-
if (!
|
|
691
|
-
if (!
|
|
692
|
-
let e =
|
|
693
|
-
if (e.length === 1) return { [e[0]]:
|
|
694
|
-
let t =
|
|
686
|
+
let t = T.prefilter[e[0]];
|
|
687
|
+
if (t === "$caller.user_id") return y?.id;
|
|
688
|
+
if (t === "$caller.tenant_id") return y?.tenant?.id;
|
|
689
|
+
})(), A = he !== void 0, j = A ? he : d, M = !A && j === "new", N = L(() => {
|
|
690
|
+
if (!j || M) return;
|
|
691
|
+
if (!T) return j;
|
|
692
|
+
let e = x(T);
|
|
693
|
+
if (e.length === 1) return { [e[0]]: j };
|
|
694
|
+
let t = b(j, e.length);
|
|
695
695
|
if (!t) return;
|
|
696
696
|
let n = {};
|
|
697
697
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
698
698
|
return n;
|
|
699
699
|
}, [
|
|
700
|
-
A,
|
|
701
700
|
j,
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
Oe(
|
|
707
|
-
|
|
708
|
-
|
|
701
|
+
M,
|
|
702
|
+
T
|
|
703
|
+
]), P = L(() => {
|
|
704
|
+
if (N) return typeof N == "string" ? N : c(N);
|
|
705
|
+
}, [N]), F = O(E, N, _t), { data: _e, isLoading: Oe, error: je } = F, Me = m(T?.realtime, E ?? ""), Ne = E ? Me : !1;
|
|
706
|
+
Se(de(E, N, _t), !M);
|
|
707
|
+
let Fe = be(E ?? ""), Le = xe(E ?? ""), Re = Ee(E ?? ""), ze = Object.keys(T?.status_groups ?? {}).length > 0, Be = _e?.data, Ve = Be?.$statuses, We = Be?.$properties, Je = p.get("edit") === "true", [z, et] = R(M || Je), [H, rt] = R({}), [U, it] = R({}), [W, ot] = R({}), [G, K] = R(void 0), [lt, ft] = R(!1), [mt, q] = R(void 0), [bt, J] = R(!1), St = M ? ue : k, Y = z && St, wt = se();
|
|
708
|
+
ee(Y && !M, wt.enabled);
|
|
709
709
|
let [Tt, Et] = R(() => {
|
|
710
|
-
let e = parseInt(
|
|
710
|
+
let e = parseInt(w?.sidebar_width || "380", 10);
|
|
711
711
|
return isNaN(e) ? 380 : e;
|
|
712
|
-
}), Dt = Xe(null), Ot = Xe(null), kt =
|
|
712
|
+
}), Dt = Xe(null), Ot = Xe(null), kt = Ye((e) => {
|
|
713
713
|
e.preventDefault();
|
|
714
714
|
let t = Dt.current;
|
|
715
715
|
if (!t) return;
|
|
@@ -726,80 +726,80 @@ function yt({ screenCode: t }) {
|
|
|
726
726
|
Ot.current && t && Et(parseInt(t.style.width, 10) || Ot.current.startW), Ot.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
727
727
|
};
|
|
728
728
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
729
|
-
}, []),
|
|
729
|
+
}, []), X = _e?.data, Z = Pe(T, w, X ?? {});
|
|
730
730
|
I(() => {
|
|
731
|
-
let e = parseInt(
|
|
731
|
+
let e = parseInt(Z?.sidebar_width || "380", 10);
|
|
732
732
|
Et(Number.isNaN(e) ? 380 : e);
|
|
733
|
-
}, [
|
|
734
|
-
let
|
|
733
|
+
}, [Z?.sidebar_width]);
|
|
734
|
+
let Q = typeof X?.$row_version == "string" ? X.$row_version : void 0, At = X?.$refs, jt = Xe(Q);
|
|
735
735
|
I(() => {
|
|
736
|
-
if (!
|
|
736
|
+
if (!Q) return;
|
|
737
737
|
let e = jt.current;
|
|
738
|
-
jt.current =
|
|
739
|
-
}, [z,
|
|
740
|
-
let Mt = !!
|
|
741
|
-
|
|
742
|
-
let Ft = !
|
|
738
|
+
jt.current = Q, e && e !== Q && z && ft(!0);
|
|
739
|
+
}, [z, Q]);
|
|
740
|
+
let Mt = !!T?.soft_delete && X != null && X[T.soft_delete] != null, Nt = Ze(), Pt = Xe(null);
|
|
741
|
+
ae({ scrollElementRef: Pt });
|
|
742
|
+
let Ft = !M && je instanceof oe && je.status === 404, It = M && !re(T), Lt = Xe(null);
|
|
743
743
|
I(() => {
|
|
744
744
|
if (!Ft) return;
|
|
745
|
-
let e =
|
|
745
|
+
let e = Ce(Nt);
|
|
746
746
|
Lt.current !== e && (Lt.current = e, ye.getState().kill(e));
|
|
747
747
|
}, [Ft, Nt]);
|
|
748
|
-
let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } =
|
|
748
|
+
let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = ge();
|
|
749
749
|
I(() => {
|
|
750
|
-
if (!
|
|
751
|
-
let e = Nt.pathname, t =
|
|
750
|
+
if (!T || A || wt.enabled) return;
|
|
751
|
+
let e = Nt.pathname, t = o(Z?.display?.name) || o(T.display.name), n = Z?.display?.icon || T.display.icon;
|
|
752
752
|
Bt(e) || Rt({
|
|
753
753
|
pathname: e,
|
|
754
754
|
search: "",
|
|
755
|
-
title:
|
|
756
|
-
derivedTitle: !
|
|
755
|
+
title: M ? o("record.new_title", "New {name}", { name: t }) : t,
|
|
756
|
+
derivedTitle: !M,
|
|
757
757
|
icon: n,
|
|
758
758
|
closable: !0
|
|
759
759
|
});
|
|
760
760
|
}, [
|
|
761
761
|
Nt.pathname,
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
762
|
+
o,
|
|
763
|
+
Z?.display?.icon,
|
|
764
|
+
T?.display.icon,
|
|
765
|
+
M,
|
|
766
|
+
A,
|
|
767
767
|
wt.enabled
|
|
768
768
|
]), I(() => {
|
|
769
|
-
if (!
|
|
769
|
+
if (!X || !T || A || wt.enabled) return;
|
|
770
770
|
let e = Bt(Nt.pathname);
|
|
771
771
|
if (e) {
|
|
772
|
-
let t =
|
|
772
|
+
let t = o(Z?.display?.name) || o(T.display.name), n = l(o, X, T), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
773
773
|
zt(e.id, r, r === t);
|
|
774
774
|
}
|
|
775
775
|
}, [
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
776
|
+
X,
|
|
777
|
+
o,
|
|
778
|
+
T?.display.display_field,
|
|
779
779
|
Nt.pathname,
|
|
780
|
-
|
|
780
|
+
A,
|
|
781
781
|
wt.enabled
|
|
782
782
|
]);
|
|
783
783
|
let Vt = L(() => {
|
|
784
|
-
if (!
|
|
784
|
+
if (!T || !St) return /* @__PURE__ */ new Set();
|
|
785
785
|
let e = /* @__PURE__ */ new Set();
|
|
786
|
-
for (let [t, n] of
|
|
787
|
-
for (let [t] of
|
|
786
|
+
for (let [t, n] of T.fields) !n.auto && !n.primary && e.add(t);
|
|
787
|
+
for (let [t] of T.files ?? []) e.add(t);
|
|
788
788
|
return e;
|
|
789
|
-
}, [
|
|
789
|
+
}, [T, St]);
|
|
790
790
|
I(() => {
|
|
791
|
-
if (
|
|
791
|
+
if (Je && X && T && k) {
|
|
792
792
|
if (z || et(!0), Object.keys(H).length === 0) {
|
|
793
|
-
let e =
|
|
793
|
+
let e = j ? Ue(j) : null;
|
|
794
794
|
if (e) {
|
|
795
|
-
let t =
|
|
796
|
-
entity:
|
|
795
|
+
let t = De({
|
|
796
|
+
entity: T,
|
|
797
797
|
formData: e,
|
|
798
798
|
record: void 0,
|
|
799
799
|
isNew: !0
|
|
800
800
|
});
|
|
801
|
-
|
|
802
|
-
|
|
801
|
+
ve(t).forEach((e) => {
|
|
802
|
+
S.registerDraft({
|
|
803
803
|
fileId: e,
|
|
804
804
|
discard: () => ne(e)
|
|
805
805
|
});
|
|
@@ -812,19 +812,19 @@ function yt({ screenCode: t }) {
|
|
|
812
812
|
t[n] = r;
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
|
-
let i =
|
|
816
|
-
t[n] =
|
|
815
|
+
let i = ke(T, X, n);
|
|
816
|
+
t[n] = Ie(T, n) ? i ?? null : i ?? "";
|
|
817
817
|
}), rt(t);
|
|
818
818
|
}
|
|
819
|
-
if (
|
|
820
|
-
let e =
|
|
819
|
+
if (T.children !== void 0 && T.children.length > 0 && G === void 0) {
|
|
820
|
+
let e = X.$children;
|
|
821
821
|
if (e && Object.keys(e).length > 0) {
|
|
822
822
|
let t = {};
|
|
823
823
|
for (let [n, r] of Object.entries(e)) {
|
|
824
824
|
let e = _?.entities[n];
|
|
825
825
|
t[n] = r.map((t) => ({
|
|
826
826
|
...t,
|
|
827
|
-
_key:
|
|
827
|
+
_key: yt(e, t)
|
|
828
828
|
}));
|
|
829
829
|
}
|
|
830
830
|
K(t), q(e);
|
|
@@ -836,84 +836,84 @@ function yt({ screenCode: t }) {
|
|
|
836
836
|
}, { replace: !0 });
|
|
837
837
|
}
|
|
838
838
|
}, [
|
|
839
|
-
|
|
840
|
-
|
|
839
|
+
Je,
|
|
840
|
+
X,
|
|
841
841
|
Vt,
|
|
842
|
-
|
|
843
|
-
|
|
842
|
+
k,
|
|
843
|
+
T,
|
|
844
844
|
G,
|
|
845
845
|
_
|
|
846
846
|
]), I(() => {
|
|
847
|
-
|
|
847
|
+
M && ue && T?.children && T.children.length !== 0 && G === void 0 && (K({}), q({}));
|
|
848
848
|
}, [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
849
|
+
M,
|
|
850
|
+
ue,
|
|
851
|
+
T?.children
|
|
852
852
|
]);
|
|
853
|
-
let Ht =
|
|
854
|
-
if (await
|
|
855
|
-
let e =
|
|
856
|
-
|
|
857
|
-
} else et(!1), rt({}), it({}), ot({}), K(void 0), q(void 0),
|
|
853
|
+
let Ht = Ye(async () => {
|
|
854
|
+
if (await S.flushAllDrafts(), M) {
|
|
855
|
+
let e = Z?.route?.replace("/:id", "") ?? "/";
|
|
856
|
+
f(e);
|
|
857
|
+
} else et(!1), rt({}), it({}), ot({}), K(void 0), q(void 0), J(!1);
|
|
858
858
|
}, [
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
]), Ut =
|
|
859
|
+
S,
|
|
860
|
+
M,
|
|
861
|
+
Z,
|
|
862
|
+
f
|
|
863
|
+
]), Ut = Ye((e, t) => {
|
|
864
864
|
rt((n) => ({
|
|
865
865
|
...n,
|
|
866
866
|
[e]: t
|
|
867
867
|
}));
|
|
868
|
-
}, []),
|
|
869
|
-
if (!
|
|
870
|
-
let e =
|
|
868
|
+
}, []), $ = L(() => {
|
|
869
|
+
if (!Z?.route) return "/";
|
|
870
|
+
let e = Z.route.split("/");
|
|
871
871
|
return e.pop(), e.join("/") || "/";
|
|
872
|
-
}, [
|
|
872
|
+
}, [Z]), Wt = L(() => !_?.screens || !$ || $ === "/" ? !1 : Object.values(_.screens).some((e) => e.route === $), [_, $]), Gt = Ye(() => {
|
|
873
873
|
if (!Wt) {
|
|
874
|
-
|
|
874
|
+
f("/");
|
|
875
875
|
return;
|
|
876
876
|
}
|
|
877
|
-
let e = Bt(
|
|
878
|
-
|
|
877
|
+
let e = Bt($)?.search ?? "";
|
|
878
|
+
f(e ? `${$}?${e}` : $);
|
|
879
879
|
}, [
|
|
880
880
|
Wt,
|
|
881
|
-
|
|
881
|
+
$,
|
|
882
882
|
Bt,
|
|
883
|
-
|
|
884
|
-
]), Kt =
|
|
885
|
-
if (!
|
|
883
|
+
f
|
|
884
|
+
]), Kt = we({ fallback: Gt }), qt = !A && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = L(() => {
|
|
885
|
+
if (!T) return {};
|
|
886
886
|
let e = {};
|
|
887
|
-
for (let t of dt(
|
|
888
|
-
for (let t of pt(
|
|
887
|
+
for (let t of dt(T, H, M)) Vt.has(t) && (e[t] = o("record.field.required", "Required"));
|
|
888
|
+
for (let t of pt(T, H)) Vt.has(t) && (e[t] = s("record.email_invalid", "This is not a valid email address."));
|
|
889
889
|
return e;
|
|
890
890
|
}, [
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
891
|
+
o,
|
|
892
|
+
s,
|
|
893
|
+
T,
|
|
894
894
|
H,
|
|
895
|
-
|
|
895
|
+
M,
|
|
896
896
|
Vt
|
|
897
|
-
]), Yt = Object.keys(Jt).length > 0, Xt =
|
|
898
|
-
if (!
|
|
899
|
-
let e = {}, t =
|
|
900
|
-
entity:
|
|
897
|
+
]), Yt = Object.keys(Jt).length > 0, Xt = Ye(() => {
|
|
898
|
+
if (!E || !T || M && !ue || !M && !k || (J(!0), Yt)) return;
|
|
899
|
+
let e = {}, t = De({
|
|
900
|
+
entity: T,
|
|
901
901
|
formData: H,
|
|
902
|
-
record:
|
|
903
|
-
isNew:
|
|
904
|
-
}), n =
|
|
905
|
-
if (
|
|
906
|
-
if (
|
|
907
|
-
let r =
|
|
902
|
+
record: X,
|
|
903
|
+
isNew: M
|
|
904
|
+
}), n = ve(t);
|
|
905
|
+
if (M) for (let [t, n] of Object.entries(H)) {
|
|
906
|
+
if (T.files?.has(t)) continue;
|
|
907
|
+
let r = Ae(T, t, n);
|
|
908
908
|
r !== "" && r != null && (e[t] = r);
|
|
909
909
|
}
|
|
910
910
|
else {
|
|
911
911
|
for (let [t, n] of Object.entries(H)) {
|
|
912
|
-
if (
|
|
913
|
-
let r =
|
|
912
|
+
if (T.files?.has(t)) continue;
|
|
913
|
+
let r = X ? ke(T, X, t) : void 0, i = Ae(T, t, n), a = Ae(T, t, r);
|
|
914
914
|
(i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
|
|
915
915
|
}
|
|
916
|
-
|
|
916
|
+
Q && (e.$row_version = Q);
|
|
917
917
|
}
|
|
918
918
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(U).length > 0 && (e.$statuses = Object.entries(U).map(([e, t]) => ({
|
|
919
919
|
status_group_code: e,
|
|
@@ -928,67 +928,67 @@ function yt({ screenCode: t }) {
|
|
|
928
928
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
929
929
|
return i;
|
|
930
930
|
}), i = mt?.[e] ?? [];
|
|
931
|
-
(
|
|
931
|
+
(M || !vt(r, i)) && (t[e] = r);
|
|
932
932
|
}
|
|
933
933
|
Object.keys(t).length > 0 && (e.$children = t);
|
|
934
934
|
}
|
|
935
|
-
if (!
|
|
936
|
-
et(!1), it({}), ot({}), K(void 0), q(void 0),
|
|
935
|
+
if (!M && Object.keys(e).length === 0) {
|
|
936
|
+
et(!1), it({}), ot({}), K(void 0), q(void 0), J(!1);
|
|
937
937
|
return;
|
|
938
938
|
}
|
|
939
939
|
let r = () => {
|
|
940
|
-
et(!1), ft(!1),
|
|
940
|
+
et(!1), ft(!1), J(!1), it({}), ot({}), K(void 0), q(void 0);
|
|
941
941
|
};
|
|
942
|
-
|
|
943
|
-
n.forEach((e) =>
|
|
944
|
-
let t = e.data,
|
|
945
|
-
|
|
946
|
-
} }) :
|
|
947
|
-
pkValues:
|
|
942
|
+
M ? Fe.mutate(e, { onSuccess: (e) => {
|
|
943
|
+
n.forEach((e) => S.markCommitted(e));
|
|
944
|
+
let t = e.data, i = T ? a(T, t) : {}, o = c(i);
|
|
945
|
+
f(o ? `${$}/${encodeURIComponent(o)}` : $, { replace: !0 }), r();
|
|
946
|
+
} }) : N && Le.mutate({
|
|
947
|
+
pkValues: N,
|
|
948
948
|
data: e
|
|
949
949
|
}, {
|
|
950
950
|
onSuccess: () => {
|
|
951
|
-
n.forEach((e) =>
|
|
951
|
+
n.forEach((e) => S.markCommitted(e)), r();
|
|
952
952
|
},
|
|
953
953
|
onError: (e) => {
|
|
954
|
-
e instanceof
|
|
954
|
+
e instanceof oe && e.code === "entity.stale_object" && ft(!0);
|
|
955
955
|
}
|
|
956
956
|
});
|
|
957
957
|
}, [
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
958
|
+
S,
|
|
959
|
+
M,
|
|
960
|
+
ue,
|
|
961
|
+
k,
|
|
962
|
+
E,
|
|
963
963
|
H,
|
|
964
964
|
Yt,
|
|
965
965
|
U,
|
|
966
966
|
W,
|
|
967
967
|
G,
|
|
968
968
|
mt,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
969
|
+
Fe,
|
|
970
|
+
Le,
|
|
971
|
+
T,
|
|
972
|
+
f,
|
|
973
|
+
$,
|
|
974
|
+
X,
|
|
973
975
|
Q,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
M
|
|
977
|
-
]), Zt = F((e, t) => {
|
|
976
|
+
N
|
|
977
|
+
]), Zt = Ye((e, t) => {
|
|
978
978
|
K((n) => ({
|
|
979
979
|
...n ?? {},
|
|
980
980
|
[e]: t
|
|
981
981
|
}));
|
|
982
|
-
}, []), Qt =
|
|
983
|
-
|
|
982
|
+
}, []), Qt = Ye(() => {
|
|
983
|
+
N && !M && pe && Re.mutate(N);
|
|
984
984
|
}, [
|
|
985
|
+
N,
|
|
985
986
|
M,
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
ze
|
|
987
|
+
pe,
|
|
988
|
+
Re
|
|
989
989
|
]), $t = L(() => ht(G, _), [G, _]), en = Object.keys($t).length > 0;
|
|
990
|
-
if (!
|
|
991
|
-
if (!
|
|
990
|
+
if (!Z || !T) return null;
|
|
991
|
+
if (!M && Oe) return /* @__PURE__ */ B(Te, {});
|
|
992
992
|
if (It) return /* @__PURE__ */ V("div", {
|
|
993
993
|
style: { padding: 24 },
|
|
994
994
|
children: [/* @__PURE__ */ V("div", {
|
|
@@ -998,10 +998,10 @@ function yt({ screenCode: t }) {
|
|
|
998
998
|
gap: 8,
|
|
999
999
|
marginBottom: 8
|
|
1000
1000
|
},
|
|
1001
|
-
children: [qt && /* @__PURE__ */ B(
|
|
1001
|
+
children: [qt && /* @__PURE__ */ B(C, {
|
|
1002
1002
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1003
1003
|
onClick: Kt.goBack,
|
|
1004
|
-
title:
|
|
1004
|
+
title: o("record.back", "Back")
|
|
1005
1005
|
}), /* @__PURE__ */ B("h1", {
|
|
1006
1006
|
style: {
|
|
1007
1007
|
margin: 0,
|
|
@@ -1009,14 +1009,14 @@ function yt({ screenCode: t }) {
|
|
|
1009
1009
|
fontWeight: 600,
|
|
1010
1010
|
color: "var(--text)"
|
|
1011
1011
|
},
|
|
1012
|
-
children:
|
|
1012
|
+
children: o("record.create_closed.title", "Not Available")
|
|
1013
1013
|
})]
|
|
1014
1014
|
}), /* @__PURE__ */ B("p", {
|
|
1015
1015
|
style: { color: "var(--text-3)" },
|
|
1016
|
-
children:
|
|
1016
|
+
children: o("record.create_closed.body", "This record type is not created from a form.")
|
|
1017
1017
|
})]
|
|
1018
1018
|
});
|
|
1019
|
-
if (!
|
|
1019
|
+
if (!M && !X || Ft) return /* @__PURE__ */ V("div", {
|
|
1020
1020
|
style: { padding: 24 },
|
|
1021
1021
|
children: [/* @__PURE__ */ V("div", {
|
|
1022
1022
|
style: {
|
|
@@ -1025,10 +1025,10 @@ function yt({ screenCode: t }) {
|
|
|
1025
1025
|
gap: 8,
|
|
1026
1026
|
marginBottom: 8
|
|
1027
1027
|
},
|
|
1028
|
-
children: [qt && /* @__PURE__ */ B(
|
|
1028
|
+
children: [qt && /* @__PURE__ */ B(C, {
|
|
1029
1029
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1030
1030
|
onClick: Kt.goBack,
|
|
1031
|
-
title:
|
|
1031
|
+
title: o("record.back", "Back")
|
|
1032
1032
|
}), /* @__PURE__ */ B("h1", {
|
|
1033
1033
|
style: {
|
|
1034
1034
|
margin: 0,
|
|
@@ -1036,32 +1036,32 @@ function yt({ screenCode: t }) {
|
|
|
1036
1036
|
fontWeight: 600,
|
|
1037
1037
|
color: "var(--text)"
|
|
1038
1038
|
},
|
|
1039
|
-
children:
|
|
1039
|
+
children: o("record.missing.title", "Not Found")
|
|
1040
1040
|
})]
|
|
1041
1041
|
}), /* @__PURE__ */ B("p", {
|
|
1042
1042
|
style: { color: "var(--text-3)" },
|
|
1043
|
-
children:
|
|
1043
|
+
children: s("entity.not_found", "This record does not exist.")
|
|
1044
1044
|
})]
|
|
1045
1045
|
});
|
|
1046
|
-
let tn =
|
|
1047
|
-
entity:
|
|
1048
|
-
screen:
|
|
1049
|
-
}) : void 0,
|
|
1046
|
+
let tn = T.display, nn = o(Z.display?.name) || o(tn.name), rn = l(o, X, T), an = M ? o("record.new_title", "New {name}", { name: nn }) : rn ? String(rn) : nn, on = Fe.isPending || Le.isPending, sn = Z.responsive?.[te.category]?.layout, cn = sn?.tabs ?? (te.isPhone ? "sections" : void 0), ln = sn?.header_card === !0 ? qe({
|
|
1047
|
+
entity: T,
|
|
1048
|
+
screen: Z
|
|
1049
|
+
}) : void 0, un = {
|
|
1050
1050
|
schema: _,
|
|
1051
|
-
entity:
|
|
1052
|
-
entityCode:
|
|
1053
|
-
recordId:
|
|
1054
|
-
record:
|
|
1055
|
-
...
|
|
1051
|
+
entity: T,
|
|
1052
|
+
entityCode: E,
|
|
1053
|
+
recordId: P ?? j ?? "",
|
|
1054
|
+
record: Y ? {
|
|
1055
|
+
...X ?? {},
|
|
1056
1056
|
...H
|
|
1057
|
-
} :
|
|
1058
|
-
isNew:
|
|
1059
|
-
mode:
|
|
1060
|
-
onFieldChange:
|
|
1057
|
+
} : X ?? {},
|
|
1058
|
+
isNew: M,
|
|
1059
|
+
mode: Y ? "edit" : "display",
|
|
1060
|
+
onFieldChange: Y ? Ut : void 0,
|
|
1061
1061
|
refs: At,
|
|
1062
1062
|
objectProperties: (() => {
|
|
1063
|
-
let e =
|
|
1064
|
-
if (!
|
|
1063
|
+
let e = We ?? [];
|
|
1064
|
+
if (!Y || Object.keys(W).length === 0) return e.length > 0 ? e : void 0;
|
|
1065
1065
|
let t = e.map((e) => W[e.property_code] === void 0 ? e : {
|
|
1066
1066
|
...e,
|
|
1067
1067
|
value: W[e.property_code]
|
|
@@ -1074,14 +1074,14 @@ function yt({ screenCode: t }) {
|
|
|
1074
1074
|
});
|
|
1075
1075
|
return t;
|
|
1076
1076
|
})(),
|
|
1077
|
-
onSetProperty:
|
|
1077
|
+
onSetProperty: M || !k ? void 0 : Y ? (e, t) => ot((n) => ({
|
|
1078
1078
|
...n,
|
|
1079
1079
|
[e]: t
|
|
1080
1080
|
})) : void 0,
|
|
1081
1081
|
isPropertyPending: !1,
|
|
1082
1082
|
objectStatuses: (() => {
|
|
1083
|
-
let e =
|
|
1084
|
-
if (!
|
|
1083
|
+
let e = Ve ?? [];
|
|
1084
|
+
if (!Y || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
|
|
1085
1085
|
let t = e.map((e) => U[e.group_code] === void 0 ? e : {
|
|
1086
1086
|
...e,
|
|
1087
1087
|
status_code: U[e.group_code]
|
|
@@ -1094,59 +1094,59 @@ function yt({ screenCode: t }) {
|
|
|
1094
1094
|
});
|
|
1095
1095
|
return t;
|
|
1096
1096
|
})(),
|
|
1097
|
-
onSetStatus:
|
|
1097
|
+
onSetStatus: M || !k ? void 0 : Y ? (e, t) => it((n) => ({
|
|
1098
1098
|
...n,
|
|
1099
1099
|
[e]: t
|
|
1100
1100
|
})) : void 0,
|
|
1101
1101
|
isStatusPending: !1,
|
|
1102
|
-
pendingChildren:
|
|
1103
|
-
onChildrenChange:
|
|
1104
|
-
childValidationErrors:
|
|
1105
|
-
fieldErrors:
|
|
1102
|
+
pendingChildren: Y ? G : void 0,
|
|
1103
|
+
onChildrenChange: Y ? Zt : void 0,
|
|
1104
|
+
childValidationErrors: Y ? $t : void 0,
|
|
1105
|
+
fieldErrors: Y && bt ? Jt : void 0,
|
|
1106
1106
|
detailTabsPresentation: cn,
|
|
1107
1107
|
relatedRecordsPresentation: sn?.related_records
|
|
1108
|
-
},
|
|
1109
|
-
screen:
|
|
1110
|
-
entity:
|
|
1111
|
-
entityCode:
|
|
1112
|
-
record:
|
|
1108
|
+
}, dn = !!Z.sidebar && Z.sidebar.length > 0, fn = sn?.sidebar === "hidden", pn = dn && !fn && !te.isDesktop, mn = dn && !fn && te.isDesktop, hn = !M && X ? /* @__PURE__ */ B(ct, {
|
|
1109
|
+
screen: Z,
|
|
1110
|
+
entity: T,
|
|
1111
|
+
entityCode: E,
|
|
1112
|
+
record: X,
|
|
1113
1113
|
refs: At,
|
|
1114
|
-
objectStatuses:
|
|
1114
|
+
objectStatuses: Ve,
|
|
1115
1115
|
schema: _
|
|
1116
|
-
}) : void 0,
|
|
1116
|
+
}) : void 0, gn = /* @__PURE__ */ B(Ct, {
|
|
1117
1117
|
title: an,
|
|
1118
|
-
recordId:
|
|
1119
|
-
editing:
|
|
1120
|
-
isNew:
|
|
1118
|
+
recordId: j,
|
|
1119
|
+
editing: Y,
|
|
1120
|
+
isNew: M,
|
|
1121
1121
|
isRecordDeleted: Mt,
|
|
1122
1122
|
dirty: z,
|
|
1123
1123
|
isSaving: on,
|
|
1124
1124
|
hasChildErrors: en,
|
|
1125
|
-
hasFieldErrors:
|
|
1126
|
-
canRestore:
|
|
1127
|
-
entity:
|
|
1128
|
-
screen:
|
|
1125
|
+
hasFieldErrors: bt && Yt,
|
|
1126
|
+
canRestore: pe,
|
|
1127
|
+
entity: T,
|
|
1128
|
+
screen: Z,
|
|
1129
1129
|
globalActions: _?.actions,
|
|
1130
|
-
entityCode:
|
|
1131
|
-
record:
|
|
1132
|
-
id:
|
|
1133
|
-
listRoute:
|
|
1130
|
+
entityCode: E,
|
|
1131
|
+
record: X,
|
|
1132
|
+
id: j,
|
|
1133
|
+
listRoute: $,
|
|
1134
1134
|
listRouteExists: !!Wt,
|
|
1135
|
-
highlights:
|
|
1135
|
+
highlights: hn,
|
|
1136
1136
|
showBack: qt,
|
|
1137
1137
|
onBack: Kt.goBack,
|
|
1138
1138
|
onCancelEdit: Ht,
|
|
1139
1139
|
onSave: Xt,
|
|
1140
1140
|
onRestore: Qt,
|
|
1141
|
-
isRestoring:
|
|
1141
|
+
isRestoring: Re.isPending,
|
|
1142
1142
|
refreshControl: {
|
|
1143
|
-
refetch:
|
|
1144
|
-
isLoading:
|
|
1145
|
-
isLive:
|
|
1143
|
+
refetch: F.refetch,
|
|
1144
|
+
isLoading: F.isLoading,
|
|
1145
|
+
isLive: Ne
|
|
1146
1146
|
},
|
|
1147
|
-
isRealtimeEntity:
|
|
1148
|
-
canManageTemplates:
|
|
1149
|
-
}),
|
|
1147
|
+
isRealtimeEntity: T?.realtime === !0,
|
|
1148
|
+
canManageTemplates: He(_)
|
|
1149
|
+
}), _n = Mt && /* @__PURE__ */ V("div", {
|
|
1150
1150
|
style: {
|
|
1151
1151
|
display: "flex",
|
|
1152
1152
|
alignItems: "center",
|
|
@@ -1159,8 +1159,8 @@ function yt({ screenCode: t }) {
|
|
|
1159
1159
|
color: "var(--danger)",
|
|
1160
1160
|
fontSize: 12.5
|
|
1161
1161
|
},
|
|
1162
|
-
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children:
|
|
1163
|
-
}),
|
|
1162
|
+
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: o("record.deleted_banner", "This record was deleted on {date}", { date: ie(String(X[T.soft_delete])) }) })]
|
|
1163
|
+
}), vn = lt && /* @__PURE__ */ V("div", {
|
|
1164
1164
|
style: {
|
|
1165
1165
|
display: "flex",
|
|
1166
1166
|
alignItems: "center",
|
|
@@ -1173,79 +1173,79 @@ function yt({ screenCode: t }) {
|
|
|
1173
1173
|
color: "var(--warn)",
|
|
1174
1174
|
fontSize: 12.5
|
|
1175
1175
|
},
|
|
1176
|
-
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children:
|
|
1177
|
-
}),
|
|
1176
|
+
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: o("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
|
|
1177
|
+
}), yn = Y && bt && Yt && /* @__PURE__ */ B(st, {
|
|
1178
1178
|
errors: Object.entries(Jt).map(([e, t]) => {
|
|
1179
|
-
let n =
|
|
1179
|
+
let n = T.fields.get(e);
|
|
1180
1180
|
return {
|
|
1181
1181
|
name: e,
|
|
1182
|
-
label: n ?
|
|
1182
|
+
label: n ? i(o, n, e, _?.entities) : e,
|
|
1183
1183
|
message: t
|
|
1184
1184
|
};
|
|
1185
1185
|
}),
|
|
1186
1186
|
onJump: (e) => {
|
|
1187
|
-
let t = document.getElementById(`${
|
|
1187
|
+
let t = document.getElementById(`${E}-${e}`);
|
|
1188
1188
|
t && (t.scrollIntoView({
|
|
1189
1189
|
block: "center",
|
|
1190
1190
|
behavior: "smooth"
|
|
1191
1191
|
}), t.focus?.());
|
|
1192
1192
|
}
|
|
1193
|
-
}),
|
|
1193
|
+
}), bn = ze && !M && !(Z.items && Z.items.length > 0) && /* @__PURE__ */ B("div", {
|
|
1194
1194
|
className: "mb-4",
|
|
1195
|
-
children: /* @__PURE__ */ B(
|
|
1196
|
-
statusGroups:
|
|
1197
|
-
objectStatuses:
|
|
1198
|
-
onSetStatus:
|
|
1195
|
+
children: /* @__PURE__ */ B(Ge, {
|
|
1196
|
+
statusGroups: T.status_groups ?? {},
|
|
1197
|
+
objectStatuses: un.objectStatuses,
|
|
1198
|
+
onSetStatus: k && Y ? (e, t) => it((n) => ({
|
|
1199
1199
|
...n,
|
|
1200
1200
|
[e]: t
|
|
1201
1201
|
})) : gt,
|
|
1202
1202
|
isPending: !1,
|
|
1203
|
-
mode:
|
|
1203
|
+
mode: Y ? "edit" : "display"
|
|
1204
1204
|
})
|
|
1205
|
-
}),
|
|
1205
|
+
}), xn = T.evidence_covered && !M && X && /* @__PURE__ */ B("div", {
|
|
1206
1206
|
className: "mb-4",
|
|
1207
|
-
children: /* @__PURE__ */ B(ut, { evidence:
|
|
1208
|
-
}),
|
|
1209
|
-
ln && (
|
|
1207
|
+
children: /* @__PURE__ */ B(ut, { evidence: X.$evidence })
|
|
1208
|
+
}), Sn = /* @__PURE__ */ V(tt, { children: [
|
|
1209
|
+
ln && (X || M) && /* @__PURE__ */ B(xt, {
|
|
1210
1210
|
card: ln,
|
|
1211
|
-
entity:
|
|
1212
|
-
record:
|
|
1213
|
-
objectStatuses:
|
|
1214
|
-
objectProperties:
|
|
1211
|
+
entity: T,
|
|
1212
|
+
record: un.record,
|
|
1213
|
+
objectStatuses: un.objectStatuses,
|
|
1214
|
+
objectProperties: un.objectProperties
|
|
1215
1215
|
}),
|
|
1216
|
-
|
|
1217
|
-
nodes:
|
|
1218
|
-
ctx:
|
|
1216
|
+
Z.items && Z.items.length > 0 && (X || M) && _ && /* @__PURE__ */ B(Ke, {
|
|
1217
|
+
nodes: Z.items,
|
|
1218
|
+
ctx: un
|
|
1219
1219
|
}),
|
|
1220
|
-
!
|
|
1221
|
-
entityCode:
|
|
1222
|
-
recordId:
|
|
1223
|
-
associations:
|
|
1220
|
+
!M && j && E && T.associations && Object.keys(T.associations).length > 0 && _ && /* @__PURE__ */ B(nt, {
|
|
1221
|
+
entityCode: E,
|
|
1222
|
+
recordId: P ?? j ?? "",
|
|
1223
|
+
associations: T.associations,
|
|
1224
1224
|
schema: _
|
|
1225
1225
|
}),
|
|
1226
|
-
!
|
|
1227
|
-
entityCode:
|
|
1228
|
-
objectId:
|
|
1229
|
-
canGenerateOne: !!
|
|
1230
|
-
canManageTemplates:
|
|
1226
|
+
!M && j && E && /* @__PURE__ */ B(at, {
|
|
1227
|
+
entityCode: E,
|
|
1228
|
+
objectId: P ?? j,
|
|
1229
|
+
canGenerateOne: !!T?.documents?.generate_one,
|
|
1230
|
+
canManageTemplates: He(_)
|
|
1231
1231
|
}),
|
|
1232
|
-
!
|
|
1233
|
-
screen:
|
|
1234
|
-
entity:
|
|
1235
|
-
entityCode:
|
|
1236
|
-
record:
|
|
1232
|
+
!M && X && _ && /* @__PURE__ */ B(me, {
|
|
1233
|
+
screen: Z,
|
|
1234
|
+
entity: T,
|
|
1235
|
+
entityCode: E,
|
|
1236
|
+
record: X,
|
|
1237
1237
|
refs: At,
|
|
1238
1238
|
schema: _
|
|
1239
1239
|
})
|
|
1240
|
-
] }),
|
|
1241
|
-
hn,
|
|
1242
|
-
_n,
|
|
1240
|
+
] }), Cn = /* @__PURE__ */ V(tt, { children: [
|
|
1243
1241
|
gn,
|
|
1244
1242
|
vn,
|
|
1243
|
+
_n,
|
|
1245
1244
|
yn,
|
|
1246
|
-
bn
|
|
1245
|
+
bn,
|
|
1246
|
+
xn
|
|
1247
1247
|
] });
|
|
1248
|
-
return
|
|
1248
|
+
return mn ? /* @__PURE__ */ V("div", {
|
|
1249
1249
|
style: {
|
|
1250
1250
|
height: "100%",
|
|
1251
1251
|
display: "flex",
|
|
@@ -1259,16 +1259,16 @@ function yt({ screenCode: t }) {
|
|
|
1259
1259
|
minWidth: 0,
|
|
1260
1260
|
height: "100%"
|
|
1261
1261
|
},
|
|
1262
|
-
children: /* @__PURE__ */ B(
|
|
1262
|
+
children: /* @__PURE__ */ B(fe, {
|
|
1263
1263
|
scrollRef: Pt,
|
|
1264
|
-
header:
|
|
1265
|
-
children:
|
|
1264
|
+
header: Cn,
|
|
1265
|
+
children: Sn
|
|
1266
1266
|
})
|
|
1267
1267
|
}),
|
|
1268
1268
|
/* @__PURE__ */ B("div", {
|
|
1269
1269
|
className: "detail-resize-handle",
|
|
1270
1270
|
onMouseDown: kt,
|
|
1271
|
-
title:
|
|
1271
|
+
title: o("record.layout.drag_to_resize", "Drag to resize"),
|
|
1272
1272
|
children: /* @__PURE__ */ B("div", { style: {
|
|
1273
1273
|
position: "absolute",
|
|
1274
1274
|
top: 0,
|
|
@@ -1286,16 +1286,16 @@ function yt({ screenCode: t }) {
|
|
|
1286
1286
|
height: "100%",
|
|
1287
1287
|
width: `${Tt}px`
|
|
1288
1288
|
},
|
|
1289
|
-
children: (
|
|
1290
|
-
nodes:
|
|
1291
|
-
ctx:
|
|
1289
|
+
children: (X || M) && _ && /* @__PURE__ */ B(Ke, {
|
|
1290
|
+
nodes: Z.sidebar,
|
|
1291
|
+
ctx: un
|
|
1292
1292
|
})
|
|
1293
1293
|
})
|
|
1294
1294
|
]
|
|
1295
|
-
}) : /* @__PURE__ */ V(
|
|
1295
|
+
}) : /* @__PURE__ */ V(fe, {
|
|
1296
1296
|
scrollRef: Pt,
|
|
1297
|
-
header:
|
|
1298
|
-
children: [
|
|
1297
|
+
header: Cn,
|
|
1298
|
+
children: [Sn, pn && (X || M) && _ && /* @__PURE__ */ B("div", {
|
|
1299
1299
|
"data-testid": "detail-sidebar-inline",
|
|
1300
1300
|
style: {
|
|
1301
1301
|
display: "flex",
|
|
@@ -1303,24 +1303,24 @@ function yt({ screenCode: t }) {
|
|
|
1303
1303
|
gap: 16,
|
|
1304
1304
|
minWidth: 0
|
|
1305
1305
|
},
|
|
1306
|
-
children: /* @__PURE__ */ B(
|
|
1307
|
-
nodes:
|
|
1308
|
-
ctx:
|
|
1306
|
+
children: /* @__PURE__ */ B(Ke, {
|
|
1307
|
+
nodes: Z.sidebar,
|
|
1308
|
+
ctx: un
|
|
1309
1309
|
})
|
|
1310
1310
|
})]
|
|
1311
1311
|
});
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1314
|
-
let a =
|
|
1315
|
-
let o =
|
|
1316
|
-
return o != null &&
|
|
1313
|
+
function xt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
1314
|
+
let a = D(), o = (e) => {
|
|
1315
|
+
let o = J(a, t, e, n, r, i);
|
|
1316
|
+
return o != null && d(o) !== "";
|
|
1317
1317
|
}, s = (e) => {
|
|
1318
|
-
let o =
|
|
1319
|
-
return
|
|
1318
|
+
let o = J(a, t, e, n, r, i);
|
|
1319
|
+
return d(o) || /* @__PURE__ */ B("span", {
|
|
1320
1320
|
style: { color: "var(--text-3)" },
|
|
1321
1321
|
children: "-"
|
|
1322
1322
|
});
|
|
1323
|
-
}, c = e.titleUsesDisplay ?
|
|
1323
|
+
}, c = e.titleUsesDisplay ? l(a, n, t) : e.titleField ? J(a, t, e.titleField, n, r, i) : void 0, u = d(c) || a(t.display?.name) || a("record.fallback_title", "Record"), f = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), p = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), m = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
|
|
1324
1324
|
return /* @__PURE__ */ V("section", {
|
|
1325
1325
|
"data-testid": "detail-header-card",
|
|
1326
1326
|
style: {
|
|
@@ -1344,7 +1344,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1344
1344
|
color: "var(--text)",
|
|
1345
1345
|
overflowWrap: "anywhere"
|
|
1346
1346
|
},
|
|
1347
|
-
children:
|
|
1347
|
+
children: u
|
|
1348
1348
|
}), e.subtitleField && /* @__PURE__ */ B("div", {
|
|
1349
1349
|
style: {
|
|
1350
1350
|
marginTop: 4,
|
|
@@ -1356,14 +1356,14 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1356
1356
|
children: s(e.subtitleField)
|
|
1357
1357
|
})]
|
|
1358
1358
|
}),
|
|
1359
|
-
|
|
1359
|
+
f.length > 0 && /* @__PURE__ */ B("div", {
|
|
1360
1360
|
style: {
|
|
1361
1361
|
display: "flex",
|
|
1362
1362
|
flexWrap: "wrap",
|
|
1363
1363
|
gap: 6,
|
|
1364
1364
|
marginTop: 10
|
|
1365
1365
|
},
|
|
1366
|
-
children:
|
|
1366
|
+
children: f.map((e) => /* @__PURE__ */ B("span", {
|
|
1367
1367
|
style: {
|
|
1368
1368
|
minWidth: 0,
|
|
1369
1369
|
maxWidth: "100%",
|
|
@@ -1378,7 +1378,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1378
1378
|
children: s(e)
|
|
1379
1379
|
}, e))
|
|
1380
1380
|
}),
|
|
1381
|
-
|
|
1381
|
+
p.length > 0 && /* @__PURE__ */ B("dl", {
|
|
1382
1382
|
style: {
|
|
1383
1383
|
display: "grid",
|
|
1384
1384
|
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
@@ -1387,7 +1387,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1387
1387
|
fontSize: 12.5,
|
|
1388
1388
|
lineHeight: 1.35
|
|
1389
1389
|
},
|
|
1390
|
-
children:
|
|
1390
|
+
children: p.map((e) => /* @__PURE__ */ V("div", {
|
|
1391
1391
|
style: { display: "contents" },
|
|
1392
1392
|
children: [/* @__PURE__ */ B("dt", {
|
|
1393
1393
|
style: { color: "var(--text-3)" },
|
|
@@ -1403,7 +1403,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1403
1403
|
})]
|
|
1404
1404
|
}, e))
|
|
1405
1405
|
}),
|
|
1406
|
-
|
|
1406
|
+
m.length > 0 && /* @__PURE__ */ B("div", {
|
|
1407
1407
|
style: {
|
|
1408
1408
|
display: "flex",
|
|
1409
1409
|
flexWrap: "wrap",
|
|
@@ -1412,7 +1412,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1412
1412
|
color: "var(--text-3)",
|
|
1413
1413
|
fontSize: 11.5
|
|
1414
1414
|
},
|
|
1415
|
-
children:
|
|
1415
|
+
children: m.map((e) => /* @__PURE__ */ V("span", {
|
|
1416
1416
|
style: {
|
|
1417
1417
|
minWidth: 0,
|
|
1418
1418
|
overflowWrap: "anywhere"
|
|
@@ -1427,7 +1427,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1427
1427
|
]
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function J(e, t, n, r, i, a) {
|
|
1431
1431
|
if (n.startsWith("$status.")) {
|
|
1432
1432
|
let t = n.slice(8), r = i?.find((e) => e.group_code === t);
|
|
1433
1433
|
return e(r?.status_name) || r?.status_code;
|
|
@@ -1436,67 +1436,67 @@ function xt(e, t, n, r, i, a) {
|
|
|
1436
1436
|
let e = n.slice(10);
|
|
1437
1437
|
return a?.find((t) => t.property_code === e)?.value;
|
|
1438
1438
|
}
|
|
1439
|
-
return
|
|
1439
|
+
return ke(t, r, n);
|
|
1440
1440
|
}
|
|
1441
1441
|
function St(e, t, n) {
|
|
1442
1442
|
if (n.startsWith("$status.")) return n.slice(8);
|
|
1443
1443
|
if (n.startsWith("$property.")) return n.slice(10);
|
|
1444
1444
|
let r = t.fields.get(n);
|
|
1445
|
-
return r ?
|
|
1445
|
+
return r ? i(e, r, n) : n;
|
|
1446
1446
|
}
|
|
1447
|
-
function Ct({ title: n, recordId: i, editing: a, isNew:
|
|
1448
|
-
let
|
|
1447
|
+
function Ct({ title: n, recordId: i, editing: a, isNew: s, isRecordDeleted: c, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: p, canRestore: m, entity: h, screen: v, globalActions: b, entityCode: x, record: S, id: C, listRoute: ee, listRouteExists: te, highlights: ne, showBack: re, onBack: w, onCancelEdit: ie, onSave: ae, onRestore: oe, isRestoring: se, refreshControl: ce, isRealtimeEntity: le, canManageTemplates: ue }) {
|
|
1448
|
+
let O = D(), k = D("errors"), { run: de } = y(), fe = T("detail"), me = _e(), A = r(), j = g(v?.action_layout, h?.action_layout, h?.actions, b, "detail_toolbar"), M = g(v?.action_layout, h?.action_layout, h?.actions, b, "detail"), N = f(O, M, h?.actions, b, S ?? {}, [], Me(h, S ?? {})), P = f(O, j, h?.actions, b, S ?? {}, [], Me(h, S ?? {})), ge = L(() => {
|
|
1449
1449
|
if (!h) return;
|
|
1450
|
-
let e =
|
|
1450
|
+
let e = C ? [C] : [];
|
|
1451
1451
|
return {
|
|
1452
1452
|
entity: h,
|
|
1453
|
-
entityCode:
|
|
1454
|
-
screen:
|
|
1455
|
-
screenRoute:
|
|
1456
|
-
selectedRows:
|
|
1453
|
+
entityCode: x ?? "",
|
|
1454
|
+
screen: v,
|
|
1455
|
+
screenRoute: v?.route ?? "",
|
|
1456
|
+
selectedRows: S ? [S] : [],
|
|
1457
1457
|
selectedIds: e,
|
|
1458
|
-
t:
|
|
1459
|
-
tabNavigate: (e, t) =>
|
|
1458
|
+
t: O,
|
|
1459
|
+
tabNavigate: (e, t) => me(e, {
|
|
1460
1460
|
title: t?.title,
|
|
1461
1461
|
icon: t?.icon,
|
|
1462
1462
|
search: t?.search
|
|
1463
1463
|
}),
|
|
1464
|
-
runActionApi: (e, t) =>
|
|
1464
|
+
runActionApi: (e, t) => F(e, t)
|
|
1465
1465
|
};
|
|
1466
1466
|
}, [
|
|
1467
1467
|
h,
|
|
1468
|
-
y,
|
|
1469
|
-
_,
|
|
1470
1468
|
x,
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1469
|
+
v,
|
|
1470
|
+
C,
|
|
1471
|
+
S,
|
|
1472
|
+
O,
|
|
1473
|
+
me
|
|
1474
|
+
]), ve = (e, t) => {
|
|
1475
|
+
let n = Fe(k, e, t, { row: S ?? void 0 });
|
|
1476
1476
|
if (n === null) return;
|
|
1477
|
-
let r =
|
|
1478
|
-
return
|
|
1477
|
+
let r = C ? [C] : [], i = e === "__delete" && te ? ee : null;
|
|
1478
|
+
return de({
|
|
1479
1479
|
action: t,
|
|
1480
|
-
title:
|
|
1481
|
-
row:
|
|
1482
|
-
execute: (e) =>
|
|
1480
|
+
title: O(t.display?.name) || e,
|
|
1481
|
+
row: S ?? void 0,
|
|
1482
|
+
execute: (e) => F(n, he(e, r)),
|
|
1483
1483
|
onSuccess: i ? () => {
|
|
1484
|
-
ye.getState().kill(
|
|
1484
|
+
ye.getState().kill(Ce(location)), A(i, { replace: !0 });
|
|
1485
1485
|
} : void 0
|
|
1486
1486
|
});
|
|
1487
|
-
},
|
|
1488
|
-
layout:
|
|
1489
|
-
row:
|
|
1490
|
-
onRun:
|
|
1487
|
+
}, be = fe.isVisible("show_actions") && !s && C && N.length > 0 ? /* @__PURE__ */ B(Oe, {
|
|
1488
|
+
layout: N,
|
|
1489
|
+
row: S,
|
|
1490
|
+
onRun: ve,
|
|
1491
1491
|
kind: "detail",
|
|
1492
1492
|
entityActions: h?.actions,
|
|
1493
|
-
globalActions:
|
|
1493
|
+
globalActions: b,
|
|
1494
1494
|
reservedRightWidth: 0,
|
|
1495
|
-
widgetContext:
|
|
1496
|
-
}) : null,
|
|
1497
|
-
liveObject:
|
|
1498
|
-
realtime:
|
|
1499
|
-
}) : null,
|
|
1495
|
+
widgetContext: ge
|
|
1496
|
+
}) : null, xe = !s && C ? /* @__PURE__ */ B(E, {
|
|
1497
|
+
liveObject: ce,
|
|
1498
|
+
realtime: le
|
|
1499
|
+
}) : null, Se = fe.isVisible("show_actions") && !s && C && P.length > 0 ? /* @__PURE__ */ V("div", {
|
|
1500
1500
|
style: {
|
|
1501
1501
|
display: "flex",
|
|
1502
1502
|
justifyContent: "flex-end",
|
|
@@ -1504,62 +1504,62 @@ function Ct({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1504
1504
|
gap: 8,
|
|
1505
1505
|
marginTop: 10
|
|
1506
1506
|
},
|
|
1507
|
-
children: [
|
|
1508
|
-
layout:
|
|
1509
|
-
row:
|
|
1510
|
-
onRun:
|
|
1507
|
+
children: [be ? null : xe, /* @__PURE__ */ B(Oe, {
|
|
1508
|
+
layout: P,
|
|
1509
|
+
row: S,
|
|
1510
|
+
onRun: ve,
|
|
1511
1511
|
kind: "detail",
|
|
1512
1512
|
entityActions: h?.actions,
|
|
1513
|
-
globalActions:
|
|
1513
|
+
globalActions: b,
|
|
1514
1514
|
reservedRightWidth: 0,
|
|
1515
|
-
widgetContext:
|
|
1516
|
-
ariaLabel:
|
|
1515
|
+
widgetContext: ge,
|
|
1516
|
+
ariaLabel: be ? O("record.toolbar_actions", "Detail toolbar actions") : O("record.page_actions", "Page actions")
|
|
1517
1517
|
})]
|
|
1518
|
-
}) : null,
|
|
1519
|
-
entityCode:
|
|
1518
|
+
}) : null, we = fe.isVisible("show_actions") && !s && C && x ? /* @__PURE__ */ B(We, {
|
|
1519
|
+
entityCode: x,
|
|
1520
1520
|
scope: "detail",
|
|
1521
|
-
objectIds: [
|
|
1521
|
+
objectIds: [C],
|
|
1522
1522
|
capability: h?.documents,
|
|
1523
|
-
canManageTemplates:
|
|
1524
|
-
}) : null,
|
|
1523
|
+
canManageTemplates: ue
|
|
1524
|
+
}) : null, Te = c ? m ? /* @__PURE__ */ B(o, {
|
|
1525
1525
|
kind: "primary",
|
|
1526
|
-
icon: B(
|
|
1527
|
-
onClick:
|
|
1528
|
-
disabled:
|
|
1529
|
-
children:
|
|
1530
|
-
}) : null : a ? /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(
|
|
1526
|
+
icon: B(se ? _ : e.refresh, { size: 13 }),
|
|
1527
|
+
onClick: oe,
|
|
1528
|
+
disabled: se,
|
|
1529
|
+
children: se ? O("record.restoring", "Restoring…") : O("record.restore", "Restore")
|
|
1530
|
+
}) : null : a ? /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(o, {
|
|
1531
1531
|
icon: /* @__PURE__ */ B(e.x, { size: 13 }),
|
|
1532
|
-
onClick:
|
|
1533
|
-
disabled:
|
|
1534
|
-
children:
|
|
1535
|
-
}), /* @__PURE__ */ B(
|
|
1532
|
+
onClick: ie,
|
|
1533
|
+
disabled: u,
|
|
1534
|
+
children: O("dialog.cancel", "Cancel")
|
|
1535
|
+
}), /* @__PURE__ */ B(o, {
|
|
1536
1536
|
kind: "primary",
|
|
1537
|
-
icon: B(
|
|
1538
|
-
onClick:
|
|
1539
|
-
disabled:
|
|
1540
|
-
title:
|
|
1541
|
-
children:
|
|
1542
|
-
})] }) : !
|
|
1537
|
+
icon: B(u ? _ : e.save, { size: 13 }),
|
|
1538
|
+
onClick: ae,
|
|
1539
|
+
disabled: u || d || p,
|
|
1540
|
+
title: d ? O("record.save.fix_child_rows", "Fix errors in child rows") : p ? O("record.save.fix_fields", "Fix the highlighted fields") : void 0,
|
|
1541
|
+
children: u ? O("dialog.saving", "Saving…") : O("dialog.save", "Save")
|
|
1542
|
+
})] }) : !s && C ? be ? /* @__PURE__ */ V("span", {
|
|
1543
1543
|
style: { display: "contents" },
|
|
1544
|
-
children: [
|
|
1545
|
-
}) :
|
|
1546
|
-
return /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(
|
|
1544
|
+
children: [we, be]
|
|
1545
|
+
}) : we : null;
|
|
1546
|
+
return /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(pe, {
|
|
1547
1547
|
icon: h?.display.icon ? /* @__PURE__ */ B(t, {
|
|
1548
1548
|
name: h.display.icon,
|
|
1549
1549
|
size: 16
|
|
1550
1550
|
}) : void 0,
|
|
1551
1551
|
title: n,
|
|
1552
|
-
description:
|
|
1552
|
+
description: O(v?.display?.description) || O(h?.display?.description),
|
|
1553
1553
|
recordId: i,
|
|
1554
|
-
highlights:
|
|
1555
|
-
identityControls: !
|
|
1556
|
-
mode:
|
|
1557
|
-
dirty:
|
|
1558
|
-
showBack:
|
|
1559
|
-
onBack:
|
|
1560
|
-
right:
|
|
1561
|
-
showTitle:
|
|
1562
|
-
}),
|
|
1554
|
+
highlights: ne,
|
|
1555
|
+
identityControls: !c && !a && !s ? xe : null,
|
|
1556
|
+
mode: s ? "create" : a ? "edit" : "display",
|
|
1557
|
+
dirty: l,
|
|
1558
|
+
showBack: re,
|
|
1559
|
+
onBack: w,
|
|
1560
|
+
right: Te,
|
|
1561
|
+
showTitle: fe.isVisible("show_title")
|
|
1562
|
+
}), Se] });
|
|
1563
1563
|
}
|
|
1564
1564
|
//#endregion
|
|
1565
1565
|
export { q as SmartDetailPage };
|