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