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