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