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