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