@declarion/react 0.163.0 → 0.168.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/components/actions/ActionDialog.js +93 -88
- package/dist-lib/components/actions/ActionRunner.js +3 -1
- package/dist-lib/components/fields/JsonEditor.js +10 -6
- package/dist-lib/components/pages/SmartDetailPage.impl.js +484 -474
- package/dist-lib/hooks/usePageStateRuntime.js +1 -1
- package/dist-lib/hooks/useRegisterScreenTab.js +15 -13
- package/package.json +1 -1
|
@@ -26,62 +26,62 @@ import { useTabStore as fe } from "../../stores/tabs.js";
|
|
|
26
26
|
import { applyRowState as pe, resolveActionLayoutForSlot as _ } from "../../lib/actions.js";
|
|
27
27
|
import { effectiveScreenForRecord as me, variantActionCodesForRecord as he } from "../../lib/variants.js";
|
|
28
28
|
import { dispatchAction as v } from "../../lib/action-dispatch.js";
|
|
29
|
-
import { ResponsiveActionBar as
|
|
30
|
-
import { RefreshControl as
|
|
31
|
-
import { DocumentsMenu as
|
|
32
|
-
import { RecordPanels as
|
|
33
|
-
import { canManageDocumentTemplates as
|
|
34
|
-
import { useTabNavigate as
|
|
35
|
-
import { useScreenBack as
|
|
36
|
-
import { useEmbed as
|
|
37
|
-
import { useEmbedNavigate as
|
|
38
|
-
import { useReportEmbedDirty as
|
|
39
|
-
import { useScreenIsLive as
|
|
40
|
-
import { entityAllowsCreateRoute as
|
|
41
|
-
import { LayoutRenderer as
|
|
42
|
-
import { ErrorSummary as
|
|
43
|
-
import { DetailHighlights as
|
|
44
|
-
import { DetailAuditStrip as
|
|
45
|
-
import { StatusGroupsDisplay as
|
|
46
|
-
import { EvidenceBlock as
|
|
47
|
-
import { RecordHeader as
|
|
48
|
-
import { PageShell as
|
|
49
|
-
import { DynamicIcon as
|
|
50
|
-
import { findInvalidEmailFields as
|
|
51
|
-
import { takePeekDraft as
|
|
52
|
-
import { coerceDisplayString as
|
|
53
|
-
import { FileDraftScope as
|
|
54
|
-
import { discardFile as
|
|
55
|
-
import { buildFilesPayload as
|
|
56
|
-
import { getEntityFileField as
|
|
57
|
-
import { resolveCard as
|
|
58
|
-
import { useText as
|
|
59
|
-
import { useRowTenant as
|
|
60
|
-
import { useUnsavedInput as
|
|
61
|
-
import { showsOnNewRecord as
|
|
62
|
-
import { useCallback as
|
|
63
|
-
import { Fragment as
|
|
64
|
-
import { useLocation as
|
|
29
|
+
import { ResponsiveActionBar as ge } from "../actions/ResponsiveActionBar.js";
|
|
30
|
+
import { RefreshControl as _e } from "../shared/RefreshControl.js";
|
|
31
|
+
import { DocumentsMenu as y } from "./DocumentsMenu.js";
|
|
32
|
+
import { RecordPanels as ve } from "./RecordPanels.js";
|
|
33
|
+
import { canManageDocumentTemplates as ye } from "../../lib/document-templates.js";
|
|
34
|
+
import { useTabNavigate as b } from "../../hooks/useTabNavigate.js";
|
|
35
|
+
import { useScreenBack as be } from "../../hooks/useScreenBack.js";
|
|
36
|
+
import { useEmbed as xe } from "../../embed/EmbedContext.js";
|
|
37
|
+
import { useEmbedNavigate as Se } from "../../embed/useEmbedNavigate.js";
|
|
38
|
+
import { useReportEmbedDirty as Ce } from "../../embed/embed-dirty.js";
|
|
39
|
+
import { useScreenIsLive as x } from "../../stores/realtime.js";
|
|
40
|
+
import { entityAllowsCreateRoute as we, entityAllowsMutation as Te, extractPkValues as Ee, fieldDisplayName as S, getDisplayValue as De, getPrimaryKeyFields as Oe, isUserEditableField as ke, pkValuesFromId as Ae, pkValuesToId as je, resolveRefRecordLabel as C, rowAllowsMutation as Me, rowSetInTenant as Ne } from "../../types/schema.js";
|
|
41
|
+
import { LayoutRenderer as w } from "../detail-layout/LayoutRenderer.js";
|
|
42
|
+
import { ErrorSummary as Pe } from "../detail-layout/ErrorSummary.js";
|
|
43
|
+
import { DetailHighlights as Fe, highlightedFieldCodes as Ie } from "../detail-layout/DetailHighlights.js";
|
|
44
|
+
import { DetailAuditStrip as Le } from "../detail-layout/DetailAuditStrip.js";
|
|
45
|
+
import { StatusGroupsDisplay as Re } from "../shared/StatusGroupsDisplay.js";
|
|
46
|
+
import { EvidenceBlock as ze } from "../detail-layout/EvidenceBlock.js";
|
|
47
|
+
import { RecordHeader as Be } from "../chrome/RecordHeader.js";
|
|
48
|
+
import { PageShell as Ve } from "../chrome/PageShell.js";
|
|
49
|
+
import { DynamicIcon as He } from "../shared/DynamicIcon.js";
|
|
50
|
+
import { findInvalidEmailFields as Ue, findMissingRequiredFields as We, validatePendingChildren as Ge } from "../../lib/children-validation.js";
|
|
51
|
+
import { takePeekDraft as Ke } from "../list/peekDraftStore.js";
|
|
52
|
+
import { coerceDisplayString as T } from "../../lib/display-value.js";
|
|
53
|
+
import { FileDraftScope as E, useFileDraftScope as qe } from "../file-widgets/draft-scope.js";
|
|
54
|
+
import { discardFile as Je } from "../file-widgets/upload.js";
|
|
55
|
+
import { buildFilesPayload as Ye, collectCommittedFileIds as Xe } from "../file-widgets/payload.js";
|
|
56
|
+
import { getEntityFileField as Ze, getSchemaFieldValue as Qe, serializeSchemaFieldValue as D } from "../file-widgets/host.js";
|
|
57
|
+
import { resolveCard as $e } from "./list/cardProjection.js";
|
|
58
|
+
import { useText as et } from "../../hooks/useText.js";
|
|
59
|
+
import { useRowTenant as tt } from "../../hooks/useRowTenant.js";
|
|
60
|
+
import { useUnsavedInput as nt } from "../../hooks/useUnsavedInput.js";
|
|
61
|
+
import { showsOnNewRecord as rt } from "../../lib/child-config.js";
|
|
62
|
+
import { useCallback as O, useEffect as k, useMemo as A, useRef as it, useState as j } from "react";
|
|
63
|
+
import { Fragment as at, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
64
|
+
import { useLocation as ot, useParams as st, useSearchParams as ct } from "react-router";
|
|
65
65
|
// src/components/pages/SmartDetailPage.impl.tsx
|
|
66
|
-
var
|
|
67
|
-
function
|
|
66
|
+
var lt = () => {}, ut = { expand: ["evidence"] };
|
|
67
|
+
function P(e, t) {
|
|
68
68
|
return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
let c = {}, l =
|
|
70
|
+
function dt({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
|
|
71
|
+
let c = {}, l = Ye({
|
|
72
72
|
entity: e,
|
|
73
73
|
formData: t,
|
|
74
74
|
record: n,
|
|
75
75
|
isNew: r
|
|
76
|
-
}), u =
|
|
76
|
+
}), u = Xe(l);
|
|
77
77
|
if (r) for (let [n, r] of Object.entries(t)) {
|
|
78
78
|
if (e.files?.has(n)) continue;
|
|
79
|
-
let t =
|
|
79
|
+
let t = D(e, n, r);
|
|
80
80
|
t !== "" && t != null && (c[n] = t);
|
|
81
81
|
}
|
|
82
82
|
else for (let [r, i] of Object.entries(t)) {
|
|
83
83
|
if (e.files?.has(r)) continue;
|
|
84
|
-
let t = n ?
|
|
84
|
+
let t = n ? Qe(e, n, r) : void 0, a = D(e, r, i), o = D(e, r, t);
|
|
85
85
|
(a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (c[r] = a);
|
|
86
86
|
}
|
|
87
87
|
if (Object.keys(l).length > 0 && (c.$files = l), Object.keys(i).length > 0 && (c.$statuses = Object.entries(i).map(([e, t]) => ({
|
|
@@ -97,7 +97,7 @@ function ct({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, p
|
|
|
97
97
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
98
98
|
return i;
|
|
99
99
|
}), a = s?.[t] ?? [];
|
|
100
|
-
(r || !
|
|
100
|
+
(r || !P(i, a)) && (e[t] = i);
|
|
101
101
|
}
|
|
102
102
|
Object.keys(e).length > 0 && (c.$children = e);
|
|
103
103
|
}
|
|
@@ -106,169 +106,174 @@ function ct({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, p
|
|
|
106
106
|
committedFileIds: u
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function ft(e, t) {
|
|
110
110
|
if (e) {
|
|
111
|
-
let n =
|
|
111
|
+
let n = Ee(e, t), r = je(n);
|
|
112
112
|
if (r.replace(/^\|+|\|+$/g, "")) return r;
|
|
113
113
|
}
|
|
114
|
-
return t.id == null ? crypto.randomUUID() :
|
|
114
|
+
return t.id == null ? crypto.randomUUID() : T(t.id);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
return /* @__PURE__ */
|
|
116
|
+
function pt({ screenCode: e }) {
|
|
117
|
+
return /* @__PURE__ */ M(E, { children: /* @__PURE__ */ M(mt, { screenCode: e }) });
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let o =
|
|
121
|
-
if (!
|
|
122
|
-
let e =
|
|
119
|
+
function mt({ screenCode: r }) {
|
|
120
|
+
let o = et(), oe = et("errors"), { id: le } = st(), g = Se(), [ue, pe] = ct(), { data: _ } = u(), he = ee((e) => e.user), v = qe(), ge = ae(), _e = _?.screens[r], y = _e?.entity ? _?.entities[_e.entity] : void 0, b = _e?.entity, C = Te(y, "create"), Be = tt(y), He = (() => {
|
|
121
|
+
if (!y || !y.singleton || !y.prefilter) return;
|
|
122
|
+
let e = Oe(y);
|
|
123
123
|
if (e.length !== 1) return;
|
|
124
|
-
let t =
|
|
124
|
+
let t = y.prefilter[e[0]];
|
|
125
125
|
if (t === "$caller.user_id") return he?.id;
|
|
126
126
|
if (t === "$caller.tenant_id") return he?.tenant?.id;
|
|
127
|
-
})(),
|
|
128
|
-
if (!
|
|
129
|
-
if (!
|
|
130
|
-
let e =
|
|
131
|
-
if (e.length === 1) return { [e[0]]:
|
|
132
|
-
let t =
|
|
127
|
+
})(), T = He !== void 0, E = T ? He : le, D = !T && E === "new", P = A(() => {
|
|
128
|
+
if (!E || D) return;
|
|
129
|
+
if (!y) return E;
|
|
130
|
+
let e = Oe(y);
|
|
131
|
+
if (e.length === 1) return { [e[0]]: E };
|
|
132
|
+
let t = Ae(E, e.length);
|
|
133
133
|
if (!t) return;
|
|
134
134
|
let n = {};
|
|
135
135
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
136
136
|
return n;
|
|
137
137
|
}, [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
]),
|
|
142
|
-
if (
|
|
143
|
-
}, [
|
|
144
|
-
e(!
|
|
145
|
-
let
|
|
146
|
-
p(d(
|
|
147
|
-
let
|
|
148
|
-
|
|
149
|
-
let [
|
|
150
|
-
let e = parseInt(
|
|
138
|
+
E,
|
|
139
|
+
D,
|
|
140
|
+
y
|
|
141
|
+
]), pt = A(() => {
|
|
142
|
+
if (P) return typeof P == "string" ? P : je(P);
|
|
143
|
+
}, [P]), mt = f(b, P, ut), { data: F, isLoading: gt, error: vt } = mt, I = c(mt), xt = !D && I.error !== null && !(I.error instanceof se && I.error.status === 404);
|
|
144
|
+
e(!gt);
|
|
145
|
+
let St = x(y?.realtime, b ?? ""), Ct = b ? St : !1;
|
|
146
|
+
p(d(b, P, ut), !D);
|
|
147
|
+
let wt = m(b ?? ""), Tt = ie(b ?? ""), Et = h(b ?? ""), Dt = Object.keys(y?.status_groups ?? {}).length > 0, L = F?.data, R = Me(y, "update", L, Be.tenantId), Ot = !!L && Te(y, "update") && !Ne(y, L, Be.tenantId), kt = Me(y, "restore", L, Be.tenantId), At = L?.$statuses, jt = L?.$properties, Mt = ue.get("edit") === "true", [Nt, Pt] = j(D || Mt), [z, Ft] = j({}), [B, It] = j({}), [V, Lt] = j({}), [H, U] = j(void 0), [Rt, zt] = j(!1), [Bt, W] = j(void 0), [Vt, Ht] = j(!1), Ut = D ? C : R, G = Nt && Ut, Wt = xe();
|
|
148
|
+
Ce(G && !D, Wt.enabled);
|
|
149
|
+
let [Gt, Kt] = j(() => {
|
|
150
|
+
let e = parseInt(_e?.sidebar_width || "380", 10);
|
|
151
151
|
return isNaN(e) ? 380 : e;
|
|
152
|
-
}),
|
|
152
|
+
}), qt = it(null), K = it(null), Jt = O((e) => {
|
|
153
153
|
e.preventDefault();
|
|
154
|
-
let t =
|
|
154
|
+
let t = qt.current;
|
|
155
155
|
if (!t) return;
|
|
156
156
|
let n = t.offsetWidth;
|
|
157
|
-
|
|
157
|
+
K.current = {
|
|
158
158
|
startX: e.clientX,
|
|
159
159
|
startW: n
|
|
160
160
|
};
|
|
161
161
|
let r = (e) => {
|
|
162
|
-
if (!
|
|
163
|
-
let n =
|
|
162
|
+
if (!K.current) return;
|
|
163
|
+
let n = K.current.startX - e.clientX, r = Math.max(280, Math.min(800, K.current.startW + n));
|
|
164
164
|
t.style.width = `${r}px`;
|
|
165
165
|
}, i = () => {
|
|
166
|
-
|
|
166
|
+
K.current && t && Kt(parseInt(t.style.width, 10) || K.current.startW), K.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
167
167
|
};
|
|
168
168
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
169
|
-
}, []),
|
|
170
|
-
|
|
171
|
-
let e = parseInt(
|
|
172
|
-
|
|
173
|
-
}, [
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
if (!
|
|
177
|
-
let e =
|
|
178
|
-
|
|
179
|
-
}, [
|
|
180
|
-
let
|
|
181
|
-
te({ scrollElementRef:
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
if (
|
|
185
|
-
let e = ne(
|
|
186
|
-
|
|
187
|
-
}, [
|
|
188
|
-
let { openTab:
|
|
189
|
-
|
|
190
|
-
if (!
|
|
191
|
-
let e =
|
|
192
|
-
|
|
169
|
+
}, []), q = F?.data, J = me(y, _e, q ?? {});
|
|
170
|
+
k(() => {
|
|
171
|
+
let e = parseInt(J?.sidebar_width || "380", 10);
|
|
172
|
+
Kt(Number.isNaN(e) ? 380 : e);
|
|
173
|
+
}, [J?.sidebar_width]);
|
|
174
|
+
let Y = typeof q?.$row_version == "string" ? q.$row_version : void 0, Yt = q?.$refs, Xt = it(Y);
|
|
175
|
+
k(() => {
|
|
176
|
+
if (!Y) return;
|
|
177
|
+
let e = Xt.current;
|
|
178
|
+
Xt.current = Y, e && e !== Y && Nt && zt(!0);
|
|
179
|
+
}, [Nt, Y]);
|
|
180
|
+
let Zt = !!y?.soft_delete && q != null && q[y.soft_delete] != null, X = ot(), Qt = it(null);
|
|
181
|
+
te({ scrollElementRef: Qt });
|
|
182
|
+
let $t = !D && vt instanceof se && vt.status === 404, en = D && !we(y), tn = it(null);
|
|
183
|
+
k(() => {
|
|
184
|
+
if (!$t) return;
|
|
185
|
+
let e = ne(X);
|
|
186
|
+
tn.current !== e && (tn.current = e, re.getState().kill(e));
|
|
187
|
+
}, [$t, X]);
|
|
188
|
+
let { openTab: nn, updateTabTitle: rn, findTabByPathname: an } = fe(), on = y !== void 0, sn = o(J?.display?.name) || o(y?.display.name), cn = J?.display?.icon || y?.display.icon;
|
|
189
|
+
k(() => {
|
|
190
|
+
if (!on || T || Wt.enabled) return;
|
|
191
|
+
let e = X.pathname;
|
|
192
|
+
nn({
|
|
193
193
|
pathname: e,
|
|
194
194
|
search: "",
|
|
195
|
-
title:
|
|
196
|
-
derivedTitle: !
|
|
197
|
-
icon:
|
|
195
|
+
title: D ? o("record.new_title", "New {name}", { name: sn }) : sn,
|
|
196
|
+
derivedTitle: !D,
|
|
197
|
+
icon: cn,
|
|
198
198
|
closable: !0
|
|
199
199
|
});
|
|
200
200
|
}, [
|
|
201
|
-
|
|
201
|
+
X.pathname,
|
|
202
202
|
o,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
sn,
|
|
204
|
+
cn,
|
|
205
|
+
on,
|
|
206
|
+
nn,
|
|
206
207
|
D,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
T,
|
|
209
|
+
Wt.enabled
|
|
210
|
+
]), k(() => {
|
|
211
|
+
if (!q || !y || T || Wt.enabled) return;
|
|
212
|
+
let e = an(X.pathname);
|
|
211
213
|
if (e) {
|
|
212
|
-
let t =
|
|
213
|
-
|
|
214
|
+
let t = sn, n = De(o, q, y), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
215
|
+
rn(e.id, r, r === t);
|
|
214
216
|
}
|
|
215
217
|
}, [
|
|
216
|
-
|
|
218
|
+
q,
|
|
217
219
|
o,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
y,
|
|
221
|
+
sn,
|
|
222
|
+
an,
|
|
223
|
+
rn,
|
|
224
|
+
X.pathname,
|
|
225
|
+
T,
|
|
226
|
+
Wt.enabled
|
|
222
227
|
]);
|
|
223
|
-
let
|
|
224
|
-
if (!
|
|
228
|
+
let ln = A(() => {
|
|
229
|
+
if (!y || !Ut) return /* @__PURE__ */ new Set();
|
|
225
230
|
let e = /* @__PURE__ */ new Set();
|
|
226
|
-
for (let [t, n] of
|
|
227
|
-
for (let [t] of
|
|
231
|
+
for (let [t, n] of y.fields) ke(n) && e.add(t);
|
|
232
|
+
for (let [t] of y.files ?? []) e.add(t);
|
|
228
233
|
return e;
|
|
229
|
-
}, [
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
if (
|
|
233
|
-
let e =
|
|
234
|
+
}, [y, Ut]), un = it(null);
|
|
235
|
+
k(() => {
|
|
236
|
+
if (Mt && q && y && R && un.current !== X.key) {
|
|
237
|
+
if (un.current = X.key, Nt || Pt(!0), Object.keys(z).length === 0) {
|
|
238
|
+
let e = E ? Ke(E) : null;
|
|
234
239
|
if (e) {
|
|
235
|
-
let t =
|
|
236
|
-
entity:
|
|
240
|
+
let t = Ye({
|
|
241
|
+
entity: y,
|
|
237
242
|
formData: e,
|
|
238
243
|
record: void 0,
|
|
239
244
|
isNew: !0
|
|
240
245
|
});
|
|
241
|
-
|
|
246
|
+
Xe(t).forEach((e) => {
|
|
242
247
|
v.registerDraft({
|
|
243
248
|
fileId: e,
|
|
244
|
-
discard: () =>
|
|
249
|
+
discard: () => Je(e)
|
|
245
250
|
});
|
|
246
251
|
});
|
|
247
252
|
}
|
|
248
253
|
let t = {};
|
|
249
|
-
|
|
254
|
+
ln.forEach((n) => {
|
|
250
255
|
let r = e ? e[n] : void 0;
|
|
251
256
|
if (r !== void 0) {
|
|
252
257
|
t[n] = r;
|
|
253
258
|
return;
|
|
254
259
|
}
|
|
255
|
-
let i =
|
|
256
|
-
t[n] =
|
|
257
|
-
}),
|
|
260
|
+
let i = Qe(y, q, n);
|
|
261
|
+
t[n] = Ze(y, n) ? i ?? null : i ?? "";
|
|
262
|
+
}), Ft(t);
|
|
258
263
|
}
|
|
259
|
-
if (
|
|
260
|
-
let e =
|
|
264
|
+
if (y.children !== void 0 && y.children.length > 0 && H === void 0) {
|
|
265
|
+
let e = q.$children;
|
|
261
266
|
if (e && Object.keys(e).length > 0) {
|
|
262
267
|
let t = {};
|
|
263
268
|
for (let [n, r] of Object.entries(e)) {
|
|
264
269
|
let e = _?.entities[n];
|
|
265
270
|
t[n] = r.map((t) => ({
|
|
266
271
|
...t,
|
|
267
|
-
_key:
|
|
272
|
+
_key: ft(e, t)
|
|
268
273
|
}));
|
|
269
274
|
}
|
|
270
|
-
|
|
271
|
-
} else
|
|
275
|
+
U(t), W(e);
|
|
276
|
+
} else U({}), W({});
|
|
272
277
|
}
|
|
273
278
|
pe((e) => {
|
|
274
279
|
let t = new URLSearchParams(e);
|
|
@@ -276,152 +281,157 @@ function dt({ screenCode: r }) {
|
|
|
276
281
|
}, { replace: !0 });
|
|
277
282
|
}
|
|
278
283
|
}, [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
Mt,
|
|
285
|
+
q,
|
|
286
|
+
ln,
|
|
287
|
+
R,
|
|
288
|
+
y,
|
|
289
|
+
H,
|
|
285
290
|
_,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
X.key,
|
|
292
|
+
v,
|
|
293
|
+
Nt,
|
|
294
|
+
z,
|
|
295
|
+
E,
|
|
296
|
+
pe
|
|
297
|
+
]), k(() => {
|
|
298
|
+
D && C && y?.children && y.children.length !== 0 && (U((e) => e ?? {}), W((e) => e ?? {}));
|
|
289
299
|
}, [
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
300
|
+
D,
|
|
301
|
+
C,
|
|
302
|
+
y?.children
|
|
293
303
|
]);
|
|
294
|
-
let
|
|
295
|
-
if (await v.flushAllDrafts(),
|
|
296
|
-
let e =
|
|
304
|
+
let dn = O(async () => {
|
|
305
|
+
if (await v.flushAllDrafts(), D) {
|
|
306
|
+
let e = J?.route?.replace("/:id", "") ?? "/";
|
|
297
307
|
g(e);
|
|
298
|
-
} else
|
|
308
|
+
} else Pt(!1), Ft({}), It({}), Lt({}), U(void 0), W(void 0), Ht(!1);
|
|
299
309
|
}, [
|
|
300
310
|
v,
|
|
301
|
-
|
|
302
|
-
|
|
311
|
+
D,
|
|
312
|
+
J,
|
|
303
313
|
g
|
|
304
|
-
]),
|
|
305
|
-
|
|
314
|
+
]), fn = O((e, t) => {
|
|
315
|
+
Ft((n) => ({
|
|
306
316
|
...n,
|
|
307
317
|
[e]: t
|
|
308
318
|
}));
|
|
309
|
-
}, []),
|
|
310
|
-
if (!
|
|
311
|
-
let e =
|
|
319
|
+
}, []), Z = A(() => {
|
|
320
|
+
if (!J?.route) return "/";
|
|
321
|
+
let e = J.route.split("/");
|
|
312
322
|
return e.pop(), e.join("/") || "/";
|
|
313
|
-
}, [
|
|
314
|
-
if (!
|
|
323
|
+
}, [J]), pn = A(() => !_?.screens || !Z || Z === "/" ? !1 : Object.values(_.screens).some((e) => e.route === Z), [_, Z]), mn = O(() => {
|
|
324
|
+
if (!pn) {
|
|
315
325
|
g("/");
|
|
316
326
|
return;
|
|
317
327
|
}
|
|
318
|
-
let e =
|
|
319
|
-
g(e ? `${
|
|
328
|
+
let e = an(Z)?.search ?? "";
|
|
329
|
+
g(e ? `${Z}?${e}` : Z);
|
|
320
330
|
}, [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
331
|
+
pn,
|
|
332
|
+
Z,
|
|
333
|
+
an,
|
|
324
334
|
g
|
|
325
|
-
]),
|
|
326
|
-
if (!
|
|
335
|
+
]), Q = be({ fallback: mn }), hn = !T && (Q.hasOriginBack || Q.allowFallbackBack && !!pn), gn = A(() => {
|
|
336
|
+
if (!y) return {};
|
|
327
337
|
let e = {};
|
|
328
|
-
for (let t of
|
|
329
|
-
for (let t of
|
|
338
|
+
for (let t of We(y, z, D)) ln.has(t) && (e[t] = o("record.field.required", "Required"));
|
|
339
|
+
for (let t of Ue(y, z)) ln.has(t) && (e[t] = oe("record.email_invalid", "This is not a valid email address."));
|
|
330
340
|
return e;
|
|
331
341
|
}, [
|
|
332
342
|
o,
|
|
333
343
|
oe,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
]),
|
|
339
|
-
entity:
|
|
340
|
-
formData:
|
|
341
|
-
record:
|
|
342
|
-
isNew:
|
|
343
|
-
pendingStatuses:
|
|
344
|
-
pendingProperties:
|
|
345
|
-
pendingChildren:
|
|
346
|
-
childrenSnapshot:
|
|
344
|
+
y,
|
|
345
|
+
z,
|
|
346
|
+
D,
|
|
347
|
+
ln
|
|
348
|
+
]), _n = Object.keys(gn).length > 0, vn = A(() => y ? dt({
|
|
349
|
+
entity: y,
|
|
350
|
+
formData: z,
|
|
351
|
+
record: q,
|
|
352
|
+
isNew: D,
|
|
353
|
+
pendingStatuses: B,
|
|
354
|
+
pendingProperties: V,
|
|
355
|
+
pendingChildren: H,
|
|
356
|
+
childrenSnapshot: Bt
|
|
347
357
|
}) : {
|
|
348
358
|
payload: {},
|
|
349
359
|
committedFileIds: []
|
|
350
360
|
}, [
|
|
351
|
-
|
|
361
|
+
y,
|
|
362
|
+
z,
|
|
363
|
+
q,
|
|
364
|
+
D,
|
|
365
|
+
B,
|
|
366
|
+
V,
|
|
352
367
|
H,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
let vn = A(() => {
|
|
362
|
-
if (!S || !x || k && !T || !k && !V || (Vt(!0), mn)) return;
|
|
363
|
-
let e = { ...hn.payload }, { committedFileIds: t } = hn;
|
|
364
|
-
if (!k && !gn) {
|
|
365
|
-
jt(!1), Nt({}), Ft({}), G(void 0), zt(void 0), Vt(!1);
|
|
368
|
+
Bt
|
|
369
|
+
]), yn = Object.keys(vn.payload).length > 0, bn = G && (D || yn);
|
|
370
|
+
nt(bn);
|
|
371
|
+
let xn = O(() => {
|
|
372
|
+
if (!b || !y || D && !C || !D && !R || (Ht(!0), _n)) return;
|
|
373
|
+
let e = { ...vn.payload }, { committedFileIds: t } = vn;
|
|
374
|
+
if (!D && !yn) {
|
|
375
|
+
Pt(!1), It({}), Lt({}), U(void 0), W(void 0), Ht(!1);
|
|
366
376
|
return;
|
|
367
377
|
}
|
|
368
|
-
!
|
|
378
|
+
!D && Y && (e.$row_version = Y);
|
|
369
379
|
let n = () => {
|
|
370
|
-
|
|
380
|
+
Pt(!1), zt(!1), Ht(!1), It({}), Lt({}), U(void 0), W(void 0);
|
|
371
381
|
};
|
|
372
|
-
|
|
382
|
+
D ? wt.mutate(e, { onSuccess: (e) => {
|
|
373
383
|
t.forEach((e) => v.markCommitted(e));
|
|
374
|
-
let r = e.data, i =
|
|
375
|
-
g(a ? `${
|
|
376
|
-
} }) :
|
|
377
|
-
pkValues:
|
|
384
|
+
let r = e.data, i = y ? Ee(y, r) : {}, a = je(i);
|
|
385
|
+
g(a ? `${Z}/${encodeURIComponent(a)}` : Z, { replace: !0 }), n();
|
|
386
|
+
} }) : P && Tt.mutate({
|
|
387
|
+
pkValues: P,
|
|
378
388
|
data: e
|
|
379
389
|
}, {
|
|
380
390
|
onSuccess: () => {
|
|
381
391
|
t.forEach((e) => v.markCommitted(e)), n();
|
|
382
392
|
},
|
|
383
393
|
onError: (e) => {
|
|
384
|
-
e instanceof se && e.code === "entity.stale_object" &&
|
|
394
|
+
e instanceof se && e.code === "entity.stale_object" && zt(!0);
|
|
385
395
|
}
|
|
386
396
|
});
|
|
387
397
|
}, [
|
|
388
398
|
v,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
+
D,
|
|
400
|
+
C,
|
|
401
|
+
R,
|
|
402
|
+
b,
|
|
403
|
+
_n,
|
|
404
|
+
vn,
|
|
405
|
+
yn,
|
|
406
|
+
wt,
|
|
407
|
+
Tt,
|
|
408
|
+
y,
|
|
399
409
|
g,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
]),
|
|
404
|
-
|
|
410
|
+
Z,
|
|
411
|
+
Y,
|
|
412
|
+
P
|
|
413
|
+
]), Sn = O((e, t) => {
|
|
414
|
+
U((n) => ({
|
|
405
415
|
...n ?? {},
|
|
406
416
|
[e]: t
|
|
407
417
|
}));
|
|
408
|
-
}, []),
|
|
409
|
-
|
|
418
|
+
}, []), Cn = O(() => {
|
|
419
|
+
P && !D && kt && Et.mutate(P);
|
|
410
420
|
}, [
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
]),
|
|
416
|
-
if (!
|
|
417
|
-
if (!
|
|
418
|
-
if (
|
|
421
|
+
P,
|
|
422
|
+
D,
|
|
423
|
+
kt,
|
|
424
|
+
Et
|
|
425
|
+
]), wn = A(() => Ge(H, _), [H, _]), Tn = Object.keys(wn).length > 0;
|
|
426
|
+
if (!J || !y) return null;
|
|
427
|
+
if (!D && I.loading) return /* @__PURE__ */ M(ce, {});
|
|
428
|
+
if (xt && !F) return /* @__PURE__ */ N("div", {
|
|
419
429
|
style: { padding: 24 },
|
|
420
|
-
children: [
|
|
421
|
-
icon: /* @__PURE__ */
|
|
422
|
-
onClick:
|
|
430
|
+
children: [hn && /* @__PURE__ */ M(a, {
|
|
431
|
+
icon: /* @__PURE__ */ M(i.back, { size: 14 }),
|
|
432
|
+
onClick: Q.goBack,
|
|
423
433
|
title: o("record.back", "Back")
|
|
424
|
-
}), /* @__PURE__ */
|
|
434
|
+
}), /* @__PURE__ */ N("p", {
|
|
425
435
|
role: "alert",
|
|
426
436
|
style: {
|
|
427
437
|
color: "var(--danger)",
|
|
@@ -430,26 +440,26 @@ function dt({ screenCode: r }) {
|
|
|
430
440
|
gap: 8
|
|
431
441
|
},
|
|
432
442
|
children: [
|
|
433
|
-
l(oe,
|
|
443
|
+
l(oe, I.error),
|
|
434
444
|
" ",
|
|
435
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ M(s, { onRetry: I.retry })
|
|
436
446
|
]
|
|
437
447
|
})]
|
|
438
448
|
});
|
|
439
|
-
if (
|
|
449
|
+
if (en) return /* @__PURE__ */ N("div", {
|
|
440
450
|
style: { padding: 24 },
|
|
441
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ N("div", {
|
|
442
452
|
style: {
|
|
443
453
|
display: "flex",
|
|
444
454
|
alignItems: "center",
|
|
445
455
|
gap: 8,
|
|
446
456
|
marginBottom: 8
|
|
447
457
|
},
|
|
448
|
-
children: [
|
|
449
|
-
icon: /* @__PURE__ */
|
|
450
|
-
onClick:
|
|
458
|
+
children: [hn && /* @__PURE__ */ M(a, {
|
|
459
|
+
icon: /* @__PURE__ */ M(i.back, { size: 14 }),
|
|
460
|
+
onClick: Q.goBack,
|
|
451
461
|
title: o("record.back", "Back")
|
|
452
|
-
}), /* @__PURE__ */
|
|
462
|
+
}), /* @__PURE__ */ M("h1", {
|
|
453
463
|
style: {
|
|
454
464
|
margin: 0,
|
|
455
465
|
fontSize: 18,
|
|
@@ -458,25 +468,25 @@ function dt({ screenCode: r }) {
|
|
|
458
468
|
},
|
|
459
469
|
children: o("record.create_closed.title", "Not Available")
|
|
460
470
|
})]
|
|
461
|
-
}), /* @__PURE__ */
|
|
471
|
+
}), /* @__PURE__ */ M("p", {
|
|
462
472
|
style: { color: "var(--text-3)" },
|
|
463
473
|
children: o("record.create_closed.body", "This record type is not created from a form.")
|
|
464
474
|
})]
|
|
465
475
|
});
|
|
466
|
-
if (!
|
|
476
|
+
if (!D && !q || $t) return /* @__PURE__ */ N("div", {
|
|
467
477
|
style: { padding: 24 },
|
|
468
|
-
children: [/* @__PURE__ */
|
|
478
|
+
children: [/* @__PURE__ */ N("div", {
|
|
469
479
|
style: {
|
|
470
480
|
display: "flex",
|
|
471
481
|
alignItems: "center",
|
|
472
482
|
gap: 8,
|
|
473
483
|
marginBottom: 8
|
|
474
484
|
},
|
|
475
|
-
children: [
|
|
476
|
-
icon: /* @__PURE__ */
|
|
477
|
-
onClick:
|
|
485
|
+
children: [hn && /* @__PURE__ */ M(a, {
|
|
486
|
+
icon: /* @__PURE__ */ M(i.back, { size: 14 }),
|
|
487
|
+
onClick: Q.goBack,
|
|
478
488
|
title: o("record.back", "Back")
|
|
479
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ M("h1", {
|
|
480
490
|
style: {
|
|
481
491
|
margin: 0,
|
|
482
492
|
fontSize: 18,
|
|
@@ -485,36 +495,36 @@ function dt({ screenCode: r }) {
|
|
|
485
495
|
},
|
|
486
496
|
children: o("record.missing.title", "Not Found")
|
|
487
497
|
})]
|
|
488
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ M("p", {
|
|
489
499
|
style: { color: "var(--text-3)" },
|
|
490
500
|
children: oe("entity.not_found", "This record does not exist.")
|
|
491
501
|
})]
|
|
492
502
|
});
|
|
493
|
-
let
|
|
494
|
-
entity:
|
|
495
|
-
screen:
|
|
503
|
+
let En = y.display, Dn = o(J.display?.name) || o(En.name), On = De(o, q, y), kn = D ? o("record.new_title", "New {name}", { name: Dn }) : On ? String(On) : Dn, An = wt.isPending || Tt.isPending, jn = J.responsive?.[ge.category]?.layout, Mn = jn?.tabs ?? (ge.isPhone ? "sections" : void 0), Nn = jn?.header_card === !0 ? $e({
|
|
504
|
+
entity: y,
|
|
505
|
+
screen: J
|
|
496
506
|
}) : void 0, $ = {
|
|
497
507
|
schema: _,
|
|
498
|
-
entity:
|
|
499
|
-
entityCode:
|
|
500
|
-
recordId:
|
|
501
|
-
record:
|
|
502
|
-
...
|
|
503
|
-
...
|
|
504
|
-
} :
|
|
505
|
-
isNew:
|
|
506
|
-
mode:
|
|
507
|
-
onFieldChange:
|
|
508
|
-
refs:
|
|
509
|
-
headerFields: !
|
|
508
|
+
entity: y,
|
|
509
|
+
entityCode: b,
|
|
510
|
+
recordId: pt ?? E ?? "",
|
|
511
|
+
record: G ? {
|
|
512
|
+
...q ?? {},
|
|
513
|
+
...z
|
|
514
|
+
} : q ?? {},
|
|
515
|
+
isNew: D,
|
|
516
|
+
mode: G ? "edit" : "display",
|
|
517
|
+
onFieldChange: G ? fn : void 0,
|
|
518
|
+
refs: Yt,
|
|
519
|
+
headerFields: !D && q ? Ie(J, y) : void 0,
|
|
510
520
|
objectProperties: (() => {
|
|
511
|
-
let e =
|
|
512
|
-
if (!
|
|
513
|
-
let t = e.map((e) =>
|
|
521
|
+
let e = jt ?? [];
|
|
522
|
+
if (!G || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
|
|
523
|
+
let t = e.map((e) => V[e.property_code] === void 0 ? e : {
|
|
514
524
|
...e,
|
|
515
|
-
value:
|
|
525
|
+
value: V[e.property_code]
|
|
516
526
|
});
|
|
517
|
-
for (let [n, r] of Object.entries(
|
|
527
|
+
for (let [n, r] of Object.entries(V)) e.some((e) => e.property_code === n) || t.push({
|
|
518
528
|
property_code: n,
|
|
519
529
|
name: {},
|
|
520
530
|
type: "string",
|
|
@@ -522,19 +532,19 @@ function dt({ screenCode: r }) {
|
|
|
522
532
|
});
|
|
523
533
|
return t;
|
|
524
534
|
})(),
|
|
525
|
-
onSetProperty:
|
|
535
|
+
onSetProperty: D || !R ? void 0 : G ? (e, t) => Lt((n) => ({
|
|
526
536
|
...n,
|
|
527
537
|
[e]: t
|
|
528
538
|
})) : void 0,
|
|
529
539
|
isPropertyPending: !1,
|
|
530
540
|
objectStatuses: (() => {
|
|
531
|
-
let e =
|
|
532
|
-
if (!
|
|
533
|
-
let t = e.map((e) =>
|
|
541
|
+
let e = At ?? [];
|
|
542
|
+
if (!G || Object.keys(B).length === 0) return e.length > 0 ? e : void 0;
|
|
543
|
+
let t = e.map((e) => B[e.group_code] === void 0 ? e : {
|
|
534
544
|
...e,
|
|
535
|
-
status_code:
|
|
545
|
+
status_code: B[e.group_code]
|
|
536
546
|
});
|
|
537
|
-
for (let [r, i] of Object.entries(
|
|
547
|
+
for (let [r, i] of Object.entries(B)) e.some((e) => e.group_code === r) || t.push({
|
|
538
548
|
group_code: r,
|
|
539
549
|
status_code: i,
|
|
540
550
|
status_name: {},
|
|
@@ -542,144 +552,144 @@ function dt({ screenCode: r }) {
|
|
|
542
552
|
});
|
|
543
553
|
return t;
|
|
544
554
|
})(),
|
|
545
|
-
onSetStatus:
|
|
555
|
+
onSetStatus: D || !R ? void 0 : G ? (e, t) => It((n) => ({
|
|
546
556
|
...n,
|
|
547
557
|
[e]: t
|
|
548
558
|
})) : void 0,
|
|
549
559
|
isStatusPending: !1,
|
|
550
|
-
pendingChildren:
|
|
551
|
-
onChildrenChange:
|
|
552
|
-
childValidationErrors:
|
|
553
|
-
fieldErrors:
|
|
554
|
-
detailTabsPresentation:
|
|
555
|
-
relatedRecordsPresentation:
|
|
556
|
-
},
|
|
557
|
-
screen:
|
|
558
|
-
entity:
|
|
559
|
-
entityCode:
|
|
560
|
-
record:
|
|
561
|
-
refs:
|
|
562
|
-
objectStatuses:
|
|
560
|
+
pendingChildren: G ? H : void 0,
|
|
561
|
+
onChildrenChange: G ? Sn : void 0,
|
|
562
|
+
childValidationErrors: G ? wn : void 0,
|
|
563
|
+
fieldErrors: G && Vt ? gn : void 0,
|
|
564
|
+
detailTabsPresentation: Mn,
|
|
565
|
+
relatedRecordsPresentation: jn?.related_records
|
|
566
|
+
}, Pn = !!J.sidebar && (D ? J.sidebar.some((e) => rt(e, y, _?.entities ?? {})) : J.sidebar.length > 0), Fn = jn?.sidebar === "hidden", In = Pn && !Fn && !ge.isDesktop, Ln = Pn && !Fn && ge.isDesktop, Rn = !D && q ? /* @__PURE__ */ M(Fe, {
|
|
567
|
+
screen: J,
|
|
568
|
+
entity: y,
|
|
569
|
+
entityCode: b,
|
|
570
|
+
record: q,
|
|
571
|
+
refs: Yt,
|
|
572
|
+
objectStatuses: At,
|
|
563
573
|
schema: _
|
|
564
|
-
}) : void 0,
|
|
565
|
-
title:
|
|
566
|
-
editing:
|
|
567
|
-
isNew:
|
|
568
|
-
isRecordDeleted:
|
|
569
|
-
dirty:
|
|
570
|
-
isSaving:
|
|
571
|
-
hasChildErrors:
|
|
572
|
-
hasFieldErrors:
|
|
573
|
-
canRestore:
|
|
574
|
-
entity:
|
|
575
|
-
screen:
|
|
574
|
+
}) : void 0, zn = /* @__PURE__ */ M(_t, {
|
|
575
|
+
title: kn,
|
|
576
|
+
editing: G,
|
|
577
|
+
isNew: D,
|
|
578
|
+
isRecordDeleted: Zt,
|
|
579
|
+
dirty: bn,
|
|
580
|
+
isSaving: An,
|
|
581
|
+
hasChildErrors: Tn,
|
|
582
|
+
hasFieldErrors: Vt && _n,
|
|
583
|
+
canRestore: kt,
|
|
584
|
+
entity: y,
|
|
585
|
+
screen: J,
|
|
576
586
|
globalActions: _?.actions,
|
|
577
|
-
entityCode:
|
|
578
|
-
record:
|
|
579
|
-
id:
|
|
580
|
-
listRoute:
|
|
581
|
-
listRouteExists: !!
|
|
582
|
-
highlights:
|
|
583
|
-
showBack:
|
|
584
|
-
onBack:
|
|
585
|
-
onCancelEdit:
|
|
586
|
-
onSave:
|
|
587
|
-
onRestore:
|
|
588
|
-
isRestoring:
|
|
587
|
+
entityCode: b,
|
|
588
|
+
record: q,
|
|
589
|
+
id: E,
|
|
590
|
+
listRoute: Z,
|
|
591
|
+
listRouteExists: !!pn,
|
|
592
|
+
highlights: Rn,
|
|
593
|
+
showBack: hn,
|
|
594
|
+
onBack: Q.goBack,
|
|
595
|
+
onCancelEdit: dn,
|
|
596
|
+
onSave: xn,
|
|
597
|
+
onRestore: Cn,
|
|
598
|
+
isRestoring: Et.isPending,
|
|
589
599
|
refreshControl: {
|
|
590
|
-
refetch:
|
|
591
|
-
isLoading:
|
|
592
|
-
isLive:
|
|
600
|
+
refetch: mt.refetch,
|
|
601
|
+
isLoading: mt.isLoading,
|
|
602
|
+
isLive: Ct
|
|
593
603
|
},
|
|
594
|
-
isRealtimeEntity:
|
|
595
|
-
canManageTemplates:
|
|
596
|
-
}),
|
|
604
|
+
isRealtimeEntity: y?.realtime === !0,
|
|
605
|
+
canManageTemplates: ye(_)
|
|
606
|
+
}), Bn = Zt && /* @__PURE__ */ M(yt, {
|
|
597
607
|
tone: "danger",
|
|
598
|
-
children: o("record.deleted_banner", "This record was deleted on {date}", { date: t(String(
|
|
608
|
+
children: o("record.deleted_banner", "This record was deleted on {date}", { date: t(String(q[y.soft_delete]), {
|
|
599
609
|
zone: o.timeZone,
|
|
600
|
-
declared: !!(
|
|
610
|
+
declared: !!(y.fields.get(y.soft_delete)?.timezone || y.default_timezone)
|
|
601
611
|
}) })
|
|
602
|
-
}),
|
|
612
|
+
}), Vn = Rt && /* @__PURE__ */ M(yt, {
|
|
603
613
|
tone: "warn",
|
|
604
614
|
children: o("record.changed_on_server", "This record changed on the server while you were viewing or editing it.")
|
|
605
|
-
}),
|
|
615
|
+
}), Hn = Ot && q ? bt(o, y, q, Yt) : void 0, Un = Ot && /* @__PURE__ */ M(yt, {
|
|
606
616
|
tone: "info",
|
|
607
617
|
testId: "record-other-tenant-banner",
|
|
608
|
-
children:
|
|
609
|
-
}),
|
|
610
|
-
errors: Object.entries(
|
|
611
|
-
let n =
|
|
618
|
+
children: Hn ? o("record.other_tenant_banner_named", "This record is set in the tenant {tenant}. Change it from that tenant.", { tenant: Hn }) : o("record.other_tenant_banner", "This record is set in another tenant. Change it from that tenant.")
|
|
619
|
+
}), Wn = G && Vt && _n && /* @__PURE__ */ M(Pe, {
|
|
620
|
+
errors: Object.entries(gn).map(([e, t]) => {
|
|
621
|
+
let n = y.fields.get(e);
|
|
612
622
|
return {
|
|
613
623
|
name: e,
|
|
614
|
-
label: n ?
|
|
624
|
+
label: n ? S(o, n, e, _?.entities) : e,
|
|
615
625
|
message: t
|
|
616
626
|
};
|
|
617
627
|
}),
|
|
618
628
|
onJump: (e) => {
|
|
619
|
-
let t = document.getElementById(`${
|
|
629
|
+
let t = document.getElementById(`${b}-${e}`);
|
|
620
630
|
t && (t.scrollIntoView({
|
|
621
631
|
block: "center",
|
|
622
632
|
behavior: "smooth"
|
|
623
633
|
}), t.focus?.());
|
|
624
634
|
}
|
|
625
|
-
}),
|
|
635
|
+
}), Gn = Dt && !D && !(J.items && J.items.length > 0) && /* @__PURE__ */ M("div", {
|
|
626
636
|
className: "mb-4",
|
|
627
|
-
children: /* @__PURE__ */
|
|
628
|
-
statusGroups:
|
|
637
|
+
children: /* @__PURE__ */ M(Re, {
|
|
638
|
+
statusGroups: y.status_groups ?? {},
|
|
629
639
|
objectStatuses: $.objectStatuses,
|
|
630
|
-
onSetStatus:
|
|
640
|
+
onSetStatus: R && G ? (e, t) => It((n) => ({
|
|
631
641
|
...n,
|
|
632
642
|
[e]: t
|
|
633
|
-
})) :
|
|
643
|
+
})) : lt,
|
|
634
644
|
isPending: !1,
|
|
635
|
-
mode:
|
|
645
|
+
mode: G ? "edit" : "display"
|
|
636
646
|
})
|
|
637
|
-
}),
|
|
647
|
+
}), Kn = y.evidence_covered && !D && q && /* @__PURE__ */ M("div", {
|
|
638
648
|
className: "mb-4",
|
|
639
|
-
children: /* @__PURE__ */
|
|
640
|
-
}),
|
|
641
|
-
|
|
642
|
-
card:
|
|
643
|
-
entity:
|
|
649
|
+
children: /* @__PURE__ */ M(ze, { evidence: q.$evidence })
|
|
650
|
+
}), qn = /* @__PURE__ */ N(at, { children: [
|
|
651
|
+
Nn && (q || D) && /* @__PURE__ */ M(ht, {
|
|
652
|
+
card: Nn,
|
|
653
|
+
entity: y,
|
|
644
654
|
record: $.record,
|
|
645
655
|
objectStatuses: $.objectStatuses,
|
|
646
656
|
objectProperties: $.objectProperties
|
|
647
657
|
}),
|
|
648
|
-
|
|
649
|
-
nodes:
|
|
658
|
+
J.items && J.items.length > 0 && (q || D) && _ && /* @__PURE__ */ M(w, {
|
|
659
|
+
nodes: J.items,
|
|
650
660
|
ctx: $
|
|
651
661
|
}),
|
|
652
|
-
!
|
|
653
|
-
entityCode:
|
|
654
|
-
recordId:
|
|
655
|
-
associations:
|
|
662
|
+
!D && E && b && y.associations && Object.keys(y.associations).length > 0 && _ && /* @__PURE__ */ M(de, {
|
|
663
|
+
entityCode: b,
|
|
664
|
+
recordId: pt ?? E ?? "",
|
|
665
|
+
associations: y.associations,
|
|
656
666
|
schema: _
|
|
657
667
|
}),
|
|
658
|
-
!
|
|
659
|
-
entity:
|
|
660
|
-
entityCode:
|
|
661
|
-
objectId:
|
|
668
|
+
!D && E && b && /* @__PURE__ */ M(ve, {
|
|
669
|
+
entity: y,
|
|
670
|
+
entityCode: b,
|
|
671
|
+
objectId: pt ?? E,
|
|
662
672
|
schema: _
|
|
663
673
|
}),
|
|
664
|
-
!
|
|
665
|
-
screen:
|
|
666
|
-
entity:
|
|
667
|
-
entityCode:
|
|
668
|
-
record:
|
|
669
|
-
recordId:
|
|
670
|
-
refs:
|
|
674
|
+
!D && q && _ && /* @__PURE__ */ M(Le, {
|
|
675
|
+
screen: J,
|
|
676
|
+
entity: y,
|
|
677
|
+
entityCode: b,
|
|
678
|
+
record: q,
|
|
679
|
+
recordId: pt ?? E,
|
|
680
|
+
refs: Yt,
|
|
671
681
|
schema: _
|
|
672
682
|
})
|
|
673
|
-
] }),
|
|
674
|
-
|
|
675
|
-
Rn,
|
|
676
|
-
Ln,
|
|
677
|
-
Bn,
|
|
683
|
+
] }), Jn = /* @__PURE__ */ N(at, { children: [
|
|
684
|
+
zn,
|
|
678
685
|
Vn,
|
|
679
|
-
|
|
680
|
-
Un
|
|
686
|
+
Bn,
|
|
687
|
+
Un,
|
|
688
|
+
Wn,
|
|
689
|
+
Gn,
|
|
690
|
+
Kn
|
|
681
691
|
] });
|
|
682
|
-
return
|
|
692
|
+
return Ln ? /* @__PURE__ */ N("div", {
|
|
683
693
|
style: {
|
|
684
694
|
height: "100%",
|
|
685
695
|
display: "flex",
|
|
@@ -687,23 +697,23 @@ function dt({ screenCode: r }) {
|
|
|
687
697
|
background: "var(--background)"
|
|
688
698
|
},
|
|
689
699
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ M("div", {
|
|
691
701
|
style: {
|
|
692
702
|
flex: 1,
|
|
693
703
|
minWidth: 0,
|
|
694
704
|
height: "100%"
|
|
695
705
|
},
|
|
696
|
-
children: /* @__PURE__ */
|
|
697
|
-
scrollRef:
|
|
698
|
-
header:
|
|
699
|
-
children:
|
|
706
|
+
children: /* @__PURE__ */ M(Ve, {
|
|
707
|
+
scrollRef: Qt,
|
|
708
|
+
header: Jn,
|
|
709
|
+
children: qn
|
|
700
710
|
})
|
|
701
711
|
}),
|
|
702
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ M("div", {
|
|
703
713
|
className: "detail-resize-handle",
|
|
704
|
-
onMouseDown:
|
|
714
|
+
onMouseDown: Jt,
|
|
705
715
|
title: o("record.layout.drag_to_resize", "Drag to resize"),
|
|
706
|
-
children: /* @__PURE__ */
|
|
716
|
+
children: /* @__PURE__ */ M("div", { style: {
|
|
707
717
|
position: "absolute",
|
|
708
718
|
top: 0,
|
|
709
719
|
bottom: 0,
|
|
@@ -713,23 +723,23 @@ function dt({ screenCode: r }) {
|
|
|
713
723
|
background: "var(--border)"
|
|
714
724
|
} })
|
|
715
725
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
-
ref:
|
|
726
|
+
/* @__PURE__ */ M("div", {
|
|
727
|
+
ref: qt,
|
|
718
728
|
style: {
|
|
719
729
|
flexShrink: 0,
|
|
720
730
|
height: "100%",
|
|
721
|
-
width: `${
|
|
731
|
+
width: `${Gt}px`
|
|
722
732
|
},
|
|
723
|
-
children: (
|
|
724
|
-
nodes:
|
|
733
|
+
children: (q || D) && _ && /* @__PURE__ */ M(w, {
|
|
734
|
+
nodes: J.sidebar,
|
|
725
735
|
ctx: $
|
|
726
736
|
})
|
|
727
737
|
})
|
|
728
738
|
]
|
|
729
|
-
}) : /* @__PURE__ */
|
|
730
|
-
scrollRef:
|
|
731
|
-
header:
|
|
732
|
-
children: [
|
|
739
|
+
}) : /* @__PURE__ */ N(Ve, {
|
|
740
|
+
scrollRef: Qt,
|
|
741
|
+
header: Jn,
|
|
742
|
+
children: [qn, In && (q || D) && _ && /* @__PURE__ */ M("div", {
|
|
733
743
|
"data-testid": "detail-sidebar-inline",
|
|
734
744
|
style: {
|
|
735
745
|
display: "flex",
|
|
@@ -737,25 +747,25 @@ function dt({ screenCode: r }) {
|
|
|
737
747
|
gap: 16,
|
|
738
748
|
minWidth: 0
|
|
739
749
|
},
|
|
740
|
-
children: /* @__PURE__ */
|
|
741
|
-
nodes:
|
|
750
|
+
children: /* @__PURE__ */ M(w, {
|
|
751
|
+
nodes: J.sidebar,
|
|
742
752
|
ctx: $
|
|
743
753
|
})
|
|
744
754
|
})]
|
|
745
755
|
});
|
|
746
756
|
}
|
|
747
|
-
function
|
|
748
|
-
let a =
|
|
749
|
-
let o =
|
|
750
|
-
return o != null &&
|
|
757
|
+
function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
758
|
+
let a = et(), o = (e) => {
|
|
759
|
+
let o = F(a, t, e, n, r, i);
|
|
760
|
+
return o != null && T(o) !== "";
|
|
751
761
|
}, s = (e) => {
|
|
752
|
-
let o =
|
|
753
|
-
return
|
|
762
|
+
let o = F(a, t, e, n, r, i);
|
|
763
|
+
return T(o) || /* @__PURE__ */ M("span", {
|
|
754
764
|
style: { color: "var(--text-3)" },
|
|
755
765
|
children: "-"
|
|
756
766
|
});
|
|
757
|
-
}, c = e.titleUsesDisplay ?
|
|
758
|
-
return /* @__PURE__ */
|
|
767
|
+
}, c = e.titleUsesDisplay ? De(a, n, t) : e.titleField ? F(a, t, e.titleField, n, r, i) : void 0, l = T(c) || a(t.display?.name) || a("record.fallback_title", "Record"), u = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), ee = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), d = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
|
|
768
|
+
return /* @__PURE__ */ N("section", {
|
|
759
769
|
"data-testid": "detail-header-card",
|
|
760
770
|
style: {
|
|
761
771
|
width: "100%",
|
|
@@ -768,9 +778,9 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
768
778
|
boxSizing: "border-box"
|
|
769
779
|
},
|
|
770
780
|
children: [
|
|
771
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ N("div", {
|
|
772
782
|
style: { minWidth: 0 },
|
|
773
|
-
children: [/* @__PURE__ */
|
|
783
|
+
children: [/* @__PURE__ */ M("div", {
|
|
774
784
|
style: {
|
|
775
785
|
fontSize: 15,
|
|
776
786
|
lineHeight: 1.25,
|
|
@@ -779,7 +789,7 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
779
789
|
overflowWrap: "anywhere"
|
|
780
790
|
},
|
|
781
791
|
children: l
|
|
782
|
-
}), e.subtitleField && /* @__PURE__ */
|
|
792
|
+
}), e.subtitleField && /* @__PURE__ */ M("div", {
|
|
783
793
|
style: {
|
|
784
794
|
marginTop: 4,
|
|
785
795
|
fontSize: 12.5,
|
|
@@ -790,14 +800,14 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
790
800
|
children: s(e.subtitleField)
|
|
791
801
|
})]
|
|
792
802
|
}),
|
|
793
|
-
u.length > 0 && /* @__PURE__ */
|
|
803
|
+
u.length > 0 && /* @__PURE__ */ M("div", {
|
|
794
804
|
style: {
|
|
795
805
|
display: "flex",
|
|
796
806
|
flexWrap: "wrap",
|
|
797
807
|
gap: 6,
|
|
798
808
|
marginTop: 10
|
|
799
809
|
},
|
|
800
|
-
children: u.map((e) => /* @__PURE__ */
|
|
810
|
+
children: u.map((e) => /* @__PURE__ */ M("span", {
|
|
801
811
|
style: {
|
|
802
812
|
minWidth: 0,
|
|
803
813
|
maxWidth: "100%",
|
|
@@ -812,7 +822,7 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
812
822
|
children: s(e)
|
|
813
823
|
}, e))
|
|
814
824
|
}),
|
|
815
|
-
ee.length > 0 && /* @__PURE__ */
|
|
825
|
+
ee.length > 0 && /* @__PURE__ */ M("dl", {
|
|
816
826
|
style: {
|
|
817
827
|
display: "grid",
|
|
818
828
|
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
@@ -821,12 +831,12 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
821
831
|
fontSize: 12.5,
|
|
822
832
|
lineHeight: 1.35
|
|
823
833
|
},
|
|
824
|
-
children: ee.map((e) => /* @__PURE__ */
|
|
834
|
+
children: ee.map((e) => /* @__PURE__ */ N("div", {
|
|
825
835
|
style: { display: "contents" },
|
|
826
|
-
children: [/* @__PURE__ */
|
|
836
|
+
children: [/* @__PURE__ */ M("dt", {
|
|
827
837
|
style: { color: "var(--text-3)" },
|
|
828
|
-
children:
|
|
829
|
-
}), /* @__PURE__ */
|
|
838
|
+
children: gt(a, t, e)
|
|
839
|
+
}), /* @__PURE__ */ M("dd", {
|
|
830
840
|
style: {
|
|
831
841
|
margin: 0,
|
|
832
842
|
color: "var(--text-2)",
|
|
@@ -837,7 +847,7 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
837
847
|
})]
|
|
838
848
|
}, e))
|
|
839
849
|
}),
|
|
840
|
-
d.length > 0 && /* @__PURE__ */
|
|
850
|
+
d.length > 0 && /* @__PURE__ */ M("div", {
|
|
841
851
|
style: {
|
|
842
852
|
display: "flex",
|
|
843
853
|
flexWrap: "wrap",
|
|
@@ -846,13 +856,13 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
846
856
|
color: "var(--text-3)",
|
|
847
857
|
fontSize: 11.5
|
|
848
858
|
},
|
|
849
|
-
children: d.map((e) => /* @__PURE__ */
|
|
859
|
+
children: d.map((e) => /* @__PURE__ */ N("span", {
|
|
850
860
|
style: {
|
|
851
861
|
minWidth: 0,
|
|
852
862
|
overflowWrap: "anywhere"
|
|
853
863
|
},
|
|
854
864
|
children: [
|
|
855
|
-
|
|
865
|
+
gt(a, t, e),
|
|
856
866
|
": ",
|
|
857
867
|
s(e)
|
|
858
868
|
]
|
|
@@ -861,7 +871,7 @@ function ft({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
861
871
|
]
|
|
862
872
|
});
|
|
863
873
|
}
|
|
864
|
-
function
|
|
874
|
+
function F(e, t, n, r, i, a) {
|
|
865
875
|
if (n.startsWith("$status.")) {
|
|
866
876
|
let t = n.slice(8), r = i?.find((e) => e.group_code === t);
|
|
867
877
|
return e(r?.status_name) || r?.status_code;
|
|
@@ -870,16 +880,16 @@ function R(e, t, n, r, i, a) {
|
|
|
870
880
|
let e = n.slice(10);
|
|
871
881
|
return a?.find((t) => t.property_code === e)?.value;
|
|
872
882
|
}
|
|
873
|
-
return
|
|
883
|
+
return Qe(t, r, n);
|
|
874
884
|
}
|
|
875
|
-
function
|
|
885
|
+
function gt(e, t, n) {
|
|
876
886
|
if (n.startsWith("$status.")) return n.slice(8);
|
|
877
887
|
if (n.startsWith("$property.")) return n.slice(10);
|
|
878
888
|
let r = t.fields.get(n);
|
|
879
|
-
return r ?
|
|
889
|
+
return r ? S(e, r, n) : n;
|
|
880
890
|
}
|
|
881
|
-
function
|
|
882
|
-
let
|
|
891
|
+
function _t({ title: e, editing: t, isNew: n, isRecordDeleted: a, dirty: s, isSaving: c, hasChildErrors: l, hasFieldErrors: u, canRestore: ee, entity: d, screen: f, globalActions: p, entityCode: te, record: m, id: h, listRoute: ie, listRouteExists: ae, highlights: se, showBack: ce, onBack: de, onCancelEdit: fe, onSave: me, onRestore: ve, isRestoring: ye, refreshControl: be, isRealtimeEntity: xe, canManageTemplates: Ce }) {
|
|
892
|
+
let x = et(), we = et("errors"), Te = tt(d), { run: Ee } = le(), S = oe("detail"), De = b(), Oe = Se(), ke = _(f?.action_layout, d?.action_layout, d?.actions, p, "detail_toolbar"), Ae = _(f?.action_layout, d?.action_layout, d?.actions, p, "detail"), je = pe(x, Ae, d?.actions, p, m ?? {}, [], Te, he(d, m ?? {})), C = pe(x, ke, d?.actions, p, m ?? {}, [], Te, he(d, m ?? {})), Me = A(() => {
|
|
883
893
|
if (!d) return;
|
|
884
894
|
let e = h ? [h] : [];
|
|
885
895
|
return {
|
|
@@ -889,8 +899,8 @@ function mt({ title: e, editing: t, isNew: n, isRecordDeleted: a, dirty: s, isSa
|
|
|
889
899
|
screenRoute: f?.route ?? "",
|
|
890
900
|
selectedRows: m ? [m] : [],
|
|
891
901
|
selectedIds: e,
|
|
892
|
-
t:
|
|
893
|
-
tabNavigate: (e, t) =>
|
|
902
|
+
t: x,
|
|
903
|
+
tabNavigate: (e, t) => De(e, {
|
|
894
904
|
title: t?.title,
|
|
895
905
|
icon: t?.icon,
|
|
896
906
|
search: t?.search
|
|
@@ -904,34 +914,34 @@ function mt({ title: e, editing: t, isNew: n, isRecordDeleted: a, dirty: s, isSa
|
|
|
904
914
|
f,
|
|
905
915
|
h,
|
|
906
916
|
m,
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
]),
|
|
910
|
-
let n = v(
|
|
917
|
+
x,
|
|
918
|
+
De
|
|
919
|
+
]), Ne = (e, t) => {
|
|
920
|
+
let n = v(we, e, t, { row: m ?? void 0 });
|
|
911
921
|
if (n === null) return;
|
|
912
922
|
let r = h ? [h] : [], i = e === "__delete" && ae ? ie : null;
|
|
913
|
-
return
|
|
923
|
+
return Ee({
|
|
914
924
|
action: t,
|
|
915
|
-
title:
|
|
925
|
+
title: x(t.display?.name) || e,
|
|
916
926
|
row: m ?? void 0,
|
|
917
927
|
execute: (e) => ue(n, g(e, r)),
|
|
918
928
|
onSuccess: i ? () => {
|
|
919
|
-
re.getState().kill(ne(location)),
|
|
929
|
+
re.getState().kill(ne(location)), Oe(i, { replace: !0 });
|
|
920
930
|
} : void 0
|
|
921
931
|
});
|
|
922
|
-
},
|
|
923
|
-
layout:
|
|
932
|
+
}, w = S.isVisible("show_actions") && !n && h && je.length > 0 ? /* @__PURE__ */ M(ge, {
|
|
933
|
+
layout: je,
|
|
924
934
|
row: m,
|
|
925
|
-
onRun:
|
|
935
|
+
onRun: Ne,
|
|
926
936
|
kind: "detail",
|
|
927
937
|
entityActions: d?.actions,
|
|
928
938
|
globalActions: p,
|
|
929
939
|
reservedRightWidth: 0,
|
|
930
|
-
widgetContext:
|
|
931
|
-
}) : null,
|
|
932
|
-
liveObject:
|
|
933
|
-
realtime:
|
|
934
|
-
}) : null,
|
|
940
|
+
widgetContext: Me
|
|
941
|
+
}) : null, Pe = !n && h ? /* @__PURE__ */ M(_e, {
|
|
942
|
+
liveObject: be,
|
|
943
|
+
realtime: xe
|
|
944
|
+
}) : null, Fe = S.isVisible("show_actions") && !n && h && C.length > 0 ? /* @__PURE__ */ N("div", {
|
|
935
945
|
style: {
|
|
936
946
|
display: "flex",
|
|
937
947
|
justifyContent: "flex-end",
|
|
@@ -939,63 +949,63 @@ function mt({ title: e, editing: t, isNew: n, isRecordDeleted: a, dirty: s, isSa
|
|
|
939
949
|
gap: 8,
|
|
940
950
|
marginTop: 10
|
|
941
951
|
},
|
|
942
|
-
children: [
|
|
943
|
-
layout:
|
|
952
|
+
children: [w ? null : Pe, /* @__PURE__ */ M(ge, {
|
|
953
|
+
layout: C,
|
|
944
954
|
row: m,
|
|
945
|
-
onRun:
|
|
955
|
+
onRun: Ne,
|
|
946
956
|
kind: "detail",
|
|
947
957
|
entityActions: d?.actions,
|
|
948
958
|
globalActions: p,
|
|
949
959
|
reservedRightWidth: 0,
|
|
950
|
-
widgetContext:
|
|
951
|
-
ariaLabel:
|
|
960
|
+
widgetContext: Me,
|
|
961
|
+
ariaLabel: w ? x("record.toolbar_actions", "Detail toolbar actions") : x("record.page_actions", "Page actions")
|
|
952
962
|
})]
|
|
953
|
-
}) : null,
|
|
963
|
+
}) : null, Ie = S.isVisible("show_actions") && !n && h && te ? /* @__PURE__ */ M(y, {
|
|
954
964
|
entityCode: te,
|
|
955
965
|
scope: "detail",
|
|
956
966
|
objectIds: [h],
|
|
957
967
|
capability: d?.documents,
|
|
958
|
-
canManageTemplates:
|
|
959
|
-
}) : null,
|
|
968
|
+
canManageTemplates: Ce
|
|
969
|
+
}) : null, Le = a ? ee ? /* @__PURE__ */ M(r, {
|
|
960
970
|
kind: "primary",
|
|
961
|
-
icon:
|
|
962
|
-
onClick:
|
|
963
|
-
disabled:
|
|
964
|
-
children:
|
|
965
|
-
}) : null : t ? /* @__PURE__ */
|
|
966
|
-
icon: /* @__PURE__ */
|
|
971
|
+
icon: M(ye ? o : i.refresh, { size: 13 }),
|
|
972
|
+
onClick: ve,
|
|
973
|
+
disabled: ye,
|
|
974
|
+
children: ye ? x("record.restoring", "Restoring…") : x("record.restore", "Restore")
|
|
975
|
+
}) : null : t ? /* @__PURE__ */ N(at, { children: [/* @__PURE__ */ M(r, {
|
|
976
|
+
icon: /* @__PURE__ */ M(i.x, { size: 13 }),
|
|
967
977
|
onClick: fe,
|
|
968
978
|
disabled: c,
|
|
969
|
-
children:
|
|
970
|
-
}), /* @__PURE__ */
|
|
979
|
+
children: x("dialog.cancel", "Cancel")
|
|
980
|
+
}), /* @__PURE__ */ M(r, {
|
|
971
981
|
kind: "primary",
|
|
972
|
-
icon:
|
|
982
|
+
icon: M(c ? o : i.save, { size: 13 }),
|
|
973
983
|
onClick: me,
|
|
974
984
|
disabled: c || l || u,
|
|
975
|
-
title: l ?
|
|
976
|
-
children: c ?
|
|
977
|
-
})] }) : !n && h ?
|
|
985
|
+
title: l ? x("record.save.fix_child_rows", "Fix errors in child rows") : u ? x("record.save.fix_fields", "Fix the highlighted fields") : void 0,
|
|
986
|
+
children: c ? x("dialog.saving", "Saving…") : x("dialog.save", "Save")
|
|
987
|
+
})] }) : !n && h ? w ? /* @__PURE__ */ N("span", {
|
|
978
988
|
style: { display: "contents" },
|
|
979
|
-
children: [
|
|
980
|
-
}) :
|
|
981
|
-
return /* @__PURE__ */
|
|
982
|
-
icon: d?.display.icon ? /* @__PURE__ */
|
|
989
|
+
children: [Ie, w]
|
|
990
|
+
}) : Ie : null;
|
|
991
|
+
return /* @__PURE__ */ N(at, { children: [/* @__PURE__ */ M(Be, {
|
|
992
|
+
icon: d?.display.icon ? /* @__PURE__ */ M(He, {
|
|
983
993
|
name: d.display.icon,
|
|
984
994
|
size: 16
|
|
985
995
|
}) : void 0,
|
|
986
996
|
title: e,
|
|
987
|
-
description:
|
|
997
|
+
description: x(f?.display?.description) || x(d?.display?.description),
|
|
988
998
|
highlights: se,
|
|
989
|
-
identityControls: !a && !t && !n ?
|
|
999
|
+
identityControls: !a && !t && !n ? Pe : null,
|
|
990
1000
|
mode: n ? "create" : t ? "edit" : "display",
|
|
991
1001
|
dirty: s,
|
|
992
1002
|
showBack: ce,
|
|
993
1003
|
onBack: de,
|
|
994
|
-
right:
|
|
995
|
-
showTitle:
|
|
996
|
-
}),
|
|
1004
|
+
right: Le,
|
|
1005
|
+
showTitle: S.isVisible("show_title")
|
|
1006
|
+
}), Fe] });
|
|
997
1007
|
}
|
|
998
|
-
var
|
|
1008
|
+
var vt = {
|
|
999
1009
|
danger: {
|
|
1000
1010
|
border: "var(--danger)",
|
|
1001
1011
|
background: "var(--danger-soft)",
|
|
@@ -1012,9 +1022,9 @@ var ht = {
|
|
|
1012
1022
|
color: "var(--accent)"
|
|
1013
1023
|
}
|
|
1014
1024
|
};
|
|
1015
|
-
function
|
|
1016
|
-
let r =
|
|
1017
|
-
return /* @__PURE__ */
|
|
1025
|
+
function yt({ tone: e, testId: t, children: n }) {
|
|
1026
|
+
let r = vt[e];
|
|
1027
|
+
return /* @__PURE__ */ N("div", {
|
|
1018
1028
|
"data-testid": t,
|
|
1019
1029
|
style: {
|
|
1020
1030
|
display: "flex",
|
|
@@ -1028,13 +1038,13 @@ function gt({ tone: e, testId: t, children: n }) {
|
|
|
1028
1038
|
color: r.color,
|
|
1029
1039
|
fontSize: 12.5
|
|
1030
1040
|
},
|
|
1031
|
-
children: [
|
|
1041
|
+
children: [M(e === "info" ? i.info : i.warning, { size: 14 }), /* @__PURE__ */ M("span", { children: n })]
|
|
1032
1042
|
});
|
|
1033
1043
|
}
|
|
1034
|
-
function
|
|
1044
|
+
function bt(e, t, n, r) {
|
|
1035
1045
|
let i = t.tenant_key, a = i ? t.fields.get(i) : void 0;
|
|
1036
1046
|
if (!i || !a?.ref?.entity) return;
|
|
1037
1047
|
let o = r?.[a.ref.entity]?.[String(n[i])];
|
|
1038
|
-
if (o) return
|
|
1048
|
+
if (o) return C(e, o, a.display?.ref_display_field || "$display", "") || void 0;
|
|
1039
1049
|
}
|
|
1040
|
-
export {
|
|
1050
|
+
export { pt as SmartDetailPage };
|