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