@declarion/react 0.45.0 → 0.47.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/{DraggableChildrenTable-BDnJK0AU.js → DraggableChildrenTable-B6KjWkwD.js} +2 -2
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CcCveEE7.js → Grid-OdquWJNX.js} +2 -2
- package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-CzAdhjNT.js} +525 -518
- package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
- package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-F9Ib9asP.js} +18 -18
- package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-DdSu3kmW.js} +305 -294
- package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-SkIp0_Rd.js} +165 -154
- package/dist-lib/api/agents.d.ts +39 -7
- package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +8 -1
- package/dist-lib/index.js +3031 -2674
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/{registry-DJKp0yaV.js → registry-C2VD-5MD.js} +571 -347
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/schema.d.ts +26 -0
- package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-ow4r-nWa.js} +721 -693
- package/dist-lib/{useProperties-TlltWwLv.js → useProperties-lEKfzm2X.js} +92 -61
- package/dist-lib/{value-CHY7LgZ-.js → value-CXohNH6a.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { s as e, t } from "./DynamicIcon-
|
|
2
|
-
import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, Dn as l, F as u, Fn as d, In as f, L as p, Ln as m, N as h, Q as g, Sn as _, Tn as v, Zn as y, _ as b, bn as x, bt as S, cr as C, dt as ee, gt as w, i as T, it as te, j as ne, jt as re, kn as ie, lr as ae, pt as oe, rr as se, un as ce, ur as E, wn as le, wt as D, xn as ue, yn as de } from "./useCurrentScreen-
|
|
3
|
-
import { E as fe, L as O, R as k, V as A, _ as j, b as pe, c as me, d as he, f as ge, m as _e, n as ve, o as ye, r as be, t as xe, w as Se } from "./RefreshControl-
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useLocation as
|
|
9
|
-
import { useQuery as
|
|
10
|
-
import { Fragment as
|
|
1
|
+
import { s as e, t } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
+
import { $ as n, A as r, At as i, C as a, Cn as o, Ct as s, D as c, Dn as l, F as u, Fn as d, In as f, L as p, Ln as m, N as h, Q as g, Sn as _, Tn as v, Zn as y, _ as b, bn as x, bt as S, cr as C, dt as ee, gt as w, i as T, it as te, j as ne, jt as re, kn as ie, lr as ae, pt as oe, rr as se, un as ce, ur as E, wn as le, wt as D, xn as ue, yn as de } from "./useCurrentScreen-ow4r-nWa.js";
|
|
3
|
+
import { E as fe, L as O, R as k, V as A, _ as j, b as pe, c as me, d as he, f as ge, m as _e, n as ve, o as ye, r as be, t as xe, w as Se } from "./RefreshControl-F9Ib9asP.js";
|
|
4
|
+
import { $ as Ce, A as we, D as Te, H as Ee, L as De, M as Oe, P as ke, Q as Ae, T as je, U as Me, X as Ne, Z as Pe, _t as Fe, a as Ie, dt as Le, et as Re, i as ze, k as Be, nt as Ve, s as He, tt as Ue, v as We, xt as Ge, z as Ke } from "./registry-C2VD-5MD.js";
|
|
5
|
+
import { n as qe, r as Je, t as M } from "./dataTableStyles-vwD1mVOP.js";
|
|
6
|
+
import { n as Ye, t as Xe } from "./LayoutRenderer-CzAdhjNT.js";
|
|
7
|
+
import { Fragment as Ze, useCallback as N, useEffect as P, useMemo as F, useRef as Qe, useState as I } from "react";
|
|
8
|
+
import { useLocation as $e, useParams as et, useSearchParams as tt } from "react-router";
|
|
9
|
+
import { useQuery as L, useQueryClient as nt } from "@tanstack/react-query";
|
|
10
|
+
import { Fragment as rt, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/shared/AssociationTabs.tsx
|
|
12
|
-
function
|
|
13
|
-
let a =
|
|
12
|
+
function it({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
13
|
+
let a = F(() => Object.entries(r), [r]), [o, s] = I(0);
|
|
14
14
|
if (a.length === 0) return null;
|
|
15
15
|
let [c, l] = a[o];
|
|
16
|
-
return /* @__PURE__ */ R(
|
|
16
|
+
return /* @__PURE__ */ R(Ge, {
|
|
17
17
|
title: /* @__PURE__ */ R("div", {
|
|
18
18
|
style: {
|
|
19
19
|
display: "flex",
|
|
@@ -52,7 +52,7 @@ function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
52
52
|
}),
|
|
53
53
|
collapsible: !1,
|
|
54
54
|
padding: "0",
|
|
55
|
-
children: /* @__PURE__ */ R(
|
|
55
|
+
children: /* @__PURE__ */ R(B, {
|
|
56
56
|
entityCode: e,
|
|
57
57
|
recordId: n,
|
|
58
58
|
assocKey: c,
|
|
@@ -61,15 +61,15 @@ function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
61
61
|
})
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
let l = Le(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } =
|
|
64
|
+
function B({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c }) {
|
|
65
|
+
let l = Le(), u = r(), d = `${t}.${i}`, { data: f, isLoading: p } = L({
|
|
66
66
|
queryKey: [
|
|
67
67
|
"association",
|
|
68
68
|
d,
|
|
69
69
|
n
|
|
70
70
|
],
|
|
71
71
|
queryFn: () => D(d, [n])
|
|
72
|
-
}), m = f?.target_entity ?? o.target, h = c.entities[m], g =
|
|
72
|
+
}), m = f?.target_entity ?? o.target, h = c.entities[m], g = F(() => f?.ids ?? [], [f?.ids]), y = F(() => h?.fields.names().find((e) => h.fields.get(e)?.primary) ?? "id", [h]), b = F(() => g.slice(0, 50), [g]), { data: x, isLoading: S } = L({
|
|
73
73
|
queryKey: [
|
|
74
74
|
"association-records",
|
|
75
75
|
m,
|
|
@@ -84,7 +84,7 @@ function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
|
|
|
84
84
|
}]
|
|
85
85
|
}),
|
|
86
86
|
enabled: b.length > 0 && !!h
|
|
87
|
-
}), C = x?.data ?? [], ee = x?.$refs, w =
|
|
87
|
+
}), C = x?.data ?? [], ee = x?.$refs, w = F(() => h ? h.fields.names().filter((e) => {
|
|
88
88
|
let t = h.fields.get(e);
|
|
89
89
|
return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
|
|
90
90
|
}).slice(0, 6) : [], [h]), T = () => {
|
|
@@ -122,14 +122,14 @@ function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
|
|
|
122
122
|
style: { padding: "8px 0" },
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ z("table", {
|
|
125
|
-
style:
|
|
125
|
+
style: Je,
|
|
126
126
|
children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ R("tr", { children: w.map((e) => /* @__PURE__ */ R("th", {
|
|
127
|
-
style:
|
|
127
|
+
style: qe,
|
|
128
128
|
children: _(h.fields.get(e), e, c.entities)
|
|
129
129
|
}, e)) }) }), /* @__PURE__ */ R("tbody", { children: C.map((e, t) => /* @__PURE__ */ R("tr", { children: w.map((t) => {
|
|
130
130
|
let n = h.fields.get(t);
|
|
131
131
|
return n ? /* @__PURE__ */ R("td", {
|
|
132
|
-
style:
|
|
132
|
+
style: M,
|
|
133
133
|
children: ne({
|
|
134
134
|
field: n,
|
|
135
135
|
fieldName: t,
|
|
@@ -174,12 +174,12 @@ function rt({ entityCode: t, recordId: n, assocKey: i, association: o, schema: c
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/pages/RecordDocumentsPanel.tsx
|
|
177
|
-
var
|
|
178
|
-
function
|
|
179
|
-
return e?.some((e) => e.status === "pending") ?
|
|
177
|
+
var V = 4e3;
|
|
178
|
+
function H(e) {
|
|
179
|
+
return e?.some((e) => e.status === "pending") ? V : !1;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
let { data: a, isLoading: o, error: s } =
|
|
181
|
+
function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
|
|
182
|
+
let { data: a, isLoading: o, error: s } = L({
|
|
183
183
|
queryKey: [
|
|
184
184
|
j,
|
|
185
185
|
t,
|
|
@@ -190,22 +190,22 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
190
190
|
object_id: n
|
|
191
191
|
})).result?.documents ?? [],
|
|
192
192
|
enabled: !!(t && n) && (!!r || !!i),
|
|
193
|
-
refetchInterval: (e) =>
|
|
193
|
+
refetchInterval: (e) => H(e.state.data)
|
|
194
194
|
}), c = (a?.length ?? 0) > 0;
|
|
195
|
-
return !r && !c ? null : /* @__PURE__ */ z(
|
|
196
|
-
title: /* @__PURE__ */ R(
|
|
195
|
+
return !r && !c ? null : /* @__PURE__ */ z(Ge, {
|
|
196
|
+
title: /* @__PURE__ */ R(ot, {}),
|
|
197
197
|
collapsible: !1,
|
|
198
198
|
padding: "0",
|
|
199
199
|
children: [
|
|
200
|
-
o && /* @__PURE__ */ R(
|
|
200
|
+
o && /* @__PURE__ */ R(W, {
|
|
201
201
|
icon: /* @__PURE__ */ R(e.loader, { size: 14 }),
|
|
202
202
|
text: "Loading documents..."
|
|
203
203
|
}),
|
|
204
|
-
s && /* @__PURE__ */ R(
|
|
204
|
+
s && /* @__PURE__ */ R(W, {
|
|
205
205
|
icon: /* @__PURE__ */ R(e.warning, { size: 14 }),
|
|
206
206
|
text: s instanceof Error ? s.message : String(s)
|
|
207
207
|
}),
|
|
208
|
-
!o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ R(
|
|
208
|
+
!o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ R(W, {
|
|
209
209
|
icon: /* @__PURE__ */ R(e.file, { size: 14 }),
|
|
210
210
|
text: "No generated documents"
|
|
211
211
|
}),
|
|
@@ -214,7 +214,7 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
214
214
|
display: "flex",
|
|
215
215
|
flexDirection: "column"
|
|
216
216
|
},
|
|
217
|
-
children: a.map((e) => /* @__PURE__ */ R(
|
|
217
|
+
children: a.map((e) => /* @__PURE__ */ R(U, {
|
|
218
218
|
entityCode: t,
|
|
219
219
|
objectId: n,
|
|
220
220
|
doc: e
|
|
@@ -223,7 +223,7 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
223
223
|
]
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function ot() {
|
|
227
227
|
return /* @__PURE__ */ z("div", {
|
|
228
228
|
style: {
|
|
229
229
|
display: "flex",
|
|
@@ -238,8 +238,8 @@ function H() {
|
|
|
238
238
|
children: [/* @__PURE__ */ R(e.file, { size: 13 }), "Documents"]
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
let a =
|
|
241
|
+
function U({ entityCode: t, objectId: r, doc: i }) {
|
|
242
|
+
let a = nt(), [o, s] = I(!1), [c, l] = I(!1), [u, d] = I(!1), [f, p] = I(!1), [m, h] = I(null), _ = v(i.title) || i.filename || i.template_code, y = i.status === "ready" && i.download_url && !f;
|
|
243
243
|
async function b() {
|
|
244
244
|
s(!0), h(null);
|
|
245
245
|
try {
|
|
@@ -375,7 +375,7 @@ function at({ entityCode: t, objectId: r, doc: i }) {
|
|
|
375
375
|
})]
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function W({ icon: e, text: t }) {
|
|
379
379
|
return /* @__PURE__ */ z("div", {
|
|
380
380
|
style: {
|
|
381
381
|
display: "flex",
|
|
@@ -390,7 +390,7 @@ function U({ icon: e, text: t }) {
|
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
392
|
//#region src/components/detail-layout/ErrorSummary.tsx
|
|
393
|
-
function
|
|
393
|
+
function st({ errors: t, onJump: n }) {
|
|
394
394
|
if (t.length === 0) return null;
|
|
395
395
|
let r = t.length !== 1;
|
|
396
396
|
return /* @__PURE__ */ z("div", {
|
|
@@ -477,7 +477,7 @@ function ot({ errors: t, onJump: n }) {
|
|
|
477
477
|
}
|
|
478
478
|
//#endregion
|
|
479
479
|
//#region src/components/shared/HighlightsStrip.tsx
|
|
480
|
-
function
|
|
480
|
+
function ct({ items: e }) {
|
|
481
481
|
return e.length === 0 ? null : /* @__PURE__ */ R("div", {
|
|
482
482
|
style: {
|
|
483
483
|
display: "flex",
|
|
@@ -486,7 +486,7 @@ function W({ items: e }) {
|
|
|
486
486
|
gap: "6px 0",
|
|
487
487
|
fontSize: 12
|
|
488
488
|
},
|
|
489
|
-
children: e.map((e, t) => /* @__PURE__ */ z(
|
|
489
|
+
children: e.map((e, t) => /* @__PURE__ */ z(Ze, { children: [t > 0 && /* @__PURE__ */ R("span", { style: {
|
|
490
490
|
width: 1,
|
|
491
491
|
height: 12,
|
|
492
492
|
background: "var(--divider)",
|
|
@@ -513,7 +513,7 @@ function W({ items: e }) {
|
|
|
513
513
|
}
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region src/components/detail-layout/DetailHighlights.tsx
|
|
516
|
-
function
|
|
516
|
+
function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
|
|
517
517
|
let c = e.highlights;
|
|
518
518
|
if (!c || c.length === 0) return null;
|
|
519
519
|
let l = [];
|
|
@@ -535,7 +535,7 @@ function st({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
535
535
|
continue;
|
|
536
536
|
}
|
|
537
537
|
if (t.fields.get(e) || t.files?.get(e)) {
|
|
538
|
-
let a =
|
|
538
|
+
let a = Re({
|
|
539
539
|
entity: t,
|
|
540
540
|
entityCode: n,
|
|
541
541
|
fieldName: e,
|
|
@@ -548,21 +548,21 @@ function st({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
548
548
|
locale: s
|
|
549
549
|
});
|
|
550
550
|
l.push({
|
|
551
|
-
label:
|
|
551
|
+
label: Ue(t, e, o.entities),
|
|
552
552
|
value: a
|
|
553
553
|
});
|
|
554
554
|
continue;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
return l.length === 0 ? null : /* @__PURE__ */ R(
|
|
557
|
+
return l.length === 0 ? null : /* @__PURE__ */ R(ct, { items: l });
|
|
558
558
|
}
|
|
559
559
|
//#endregion
|
|
560
560
|
//#region src/components/shared/AuditMetaStrip.tsx
|
|
561
|
-
function
|
|
561
|
+
function ut(e) {
|
|
562
562
|
return e.by != null || e.at != null;
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
let t = e.filter(
|
|
564
|
+
function dt({ lines: e }) {
|
|
565
|
+
let t = e.filter(ut);
|
|
566
566
|
return t.length === 0 ? null : /* @__PURE__ */ R("div", {
|
|
567
567
|
style: {
|
|
568
568
|
display: "flex",
|
|
@@ -575,10 +575,10 @@ function lt({ lines: e }) {
|
|
|
575
575
|
fontSize: 11.5,
|
|
576
576
|
color: "var(--text-3)"
|
|
577
577
|
},
|
|
578
|
-
children: t.map((e, t) => /* @__PURE__ */ R(
|
|
578
|
+
children: t.map((e, t) => /* @__PURE__ */ R(G, { line: e }, t))
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function G({ line: e }) {
|
|
582
582
|
return /* @__PURE__ */ z("div", {
|
|
583
583
|
style: {
|
|
584
584
|
display: "flex",
|
|
@@ -620,13 +620,13 @@ function ut({ line: e }) {
|
|
|
620
620
|
}
|
|
621
621
|
//#endregion
|
|
622
622
|
//#region src/components/detail-layout/DetailAuditStrip.tsx
|
|
623
|
-
function
|
|
623
|
+
function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
|
|
624
624
|
let s = e.audit;
|
|
625
625
|
if (s?.enabled === !1) return null;
|
|
626
626
|
let c = (e) => {
|
|
627
627
|
if (!e || !t.fields.get(e)) return;
|
|
628
628
|
let s = r[e];
|
|
629
|
-
if (
|
|
629
|
+
if (s != null && s !== "") return Re({
|
|
630
630
|
entity: t,
|
|
631
631
|
entityCode: n,
|
|
632
632
|
fieldName: e,
|
|
@@ -638,8 +638,7 @@ function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
638
638
|
surface: "list",
|
|
639
639
|
locale: o
|
|
640
640
|
});
|
|
641
|
-
}
|
|
642
|
-
return /* @__PURE__ */ R(lt, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
|
|
641
|
+
}, l = s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
|
|
643
642
|
label: v(e.label),
|
|
644
643
|
at: c(e.at),
|
|
645
644
|
by: c(e.by)
|
|
@@ -651,17 +650,18 @@ function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
651
650
|
label: "Updated",
|
|
652
651
|
at: c("updated_at"),
|
|
653
652
|
by: c("updated_by")
|
|
654
|
-
}]
|
|
653
|
+
}];
|
|
654
|
+
return /* @__PURE__ */ R(dt, { lines: l });
|
|
655
655
|
}
|
|
656
656
|
//#endregion
|
|
657
657
|
//#region src/components/detail-layout/EvidenceBlock.tsx
|
|
658
|
-
function
|
|
658
|
+
function pt(e) {
|
|
659
659
|
if (!e) return;
|
|
660
660
|
let t = new Date(e);
|
|
661
661
|
if (!Number.isNaN(t.getTime())) return t.toLocaleString();
|
|
662
662
|
}
|
|
663
|
-
function
|
|
664
|
-
let t = e?.verdict ?? "unverified", n =
|
|
663
|
+
function mt({ evidence: e }) {
|
|
664
|
+
let t = e?.verdict ?? "unverified", n = pt(e?.verified_at), r = [];
|
|
665
665
|
return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ z("div", {
|
|
666
666
|
style: {
|
|
667
667
|
display: "flex",
|
|
@@ -709,7 +709,7 @@ function ft({ evidence: e }) {
|
|
|
709
709
|
}
|
|
710
710
|
//#endregion
|
|
711
711
|
//#region src/components/shared/RecordHeader.tsx
|
|
712
|
-
function
|
|
712
|
+
function ht({ icon: t, avatarName: n, title: r, recordId: i, description: a, highlights: o, mode: s, dirty: c = !1, showBack: l = !1, onBack: u, right: d, identityControls: f, showTitle: p = !0 }) {
|
|
713
713
|
let m = se(), h = m.category === "phone" || m.width <= 520;
|
|
714
714
|
return /* @__PURE__ */ z("div", {
|
|
715
715
|
style: {
|
|
@@ -836,7 +836,7 @@ function pt({ icon: t, avatarName: n, title: r, recordId: i, description: a, hig
|
|
|
836
836
|
}
|
|
837
837
|
//#endregion
|
|
838
838
|
//#region src/lib/children-validation.ts
|
|
839
|
-
function
|
|
839
|
+
function gt(e, t, n) {
|
|
840
840
|
let r = [];
|
|
841
841
|
for (let [i, a] of e.fields) {
|
|
842
842
|
if (!a.required || a.auto || n && a.primary || e.tenant_key && i === e.tenant_key || a.default !== void 0 && a.default !== null) continue;
|
|
@@ -845,17 +845,17 @@ function mt(e, t, n) {
|
|
|
845
845
|
}
|
|
846
846
|
return r;
|
|
847
847
|
}
|
|
848
|
-
var
|
|
849
|
-
function
|
|
848
|
+
var _t = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
849
|
+
function vt(e, t) {
|
|
850
850
|
let n = [];
|
|
851
851
|
for (let [r, i] of e.fields) {
|
|
852
852
|
if (i.type !== "email") continue;
|
|
853
853
|
let e = t[r];
|
|
854
|
-
typeof e == "string" && e !== "" && !
|
|
854
|
+
typeof e == "string" && e !== "" && !_t.test(e) && n.push(r);
|
|
855
855
|
}
|
|
856
856
|
return n;
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function K(e, t) {
|
|
859
859
|
let n = /* @__PURE__ */ new Set();
|
|
860
860
|
for (let r of Object.values(t.entities)) if (r.children) {
|
|
861
861
|
for (let t of r.children) if (t.entity === e && t.foreign_key) {
|
|
@@ -865,13 +865,13 @@ function _t(e, t) {
|
|
|
865
865
|
}
|
|
866
866
|
return n;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function yt(e, t) {
|
|
869
869
|
if (!e || !t) return {};
|
|
870
870
|
let n = {};
|
|
871
871
|
for (let [r, i] of Object.entries(e)) {
|
|
872
872
|
let e = t.entities[r];
|
|
873
873
|
if (!e) continue;
|
|
874
|
-
let a =
|
|
874
|
+
let a = K(r, t), o = [];
|
|
875
875
|
for (let [t, n] of e.fields) e.tenant_key && t === e.tenant_key || n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
|
|
876
876
|
if (o.length !== 0) for (let e of i) {
|
|
877
877
|
if (e._deleted) continue;
|
|
@@ -887,29 +887,29 @@ function vt(e, t) {
|
|
|
887
887
|
}
|
|
888
888
|
//#endregion
|
|
889
889
|
//#region src/components/pages/SmartDetailPage.impl.tsx
|
|
890
|
-
var
|
|
891
|
-
function
|
|
890
|
+
var bt = () => {};
|
|
891
|
+
function xt(e, t) {
|
|
892
892
|
return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function St(e, t) {
|
|
895
895
|
if (e) {
|
|
896
|
-
let n =
|
|
897
|
-
if (
|
|
896
|
+
let n = ue(e, t), r = ie(n);
|
|
897
|
+
if (r.replace(/^\|+|\|+$/g, "")) return r;
|
|
898
898
|
}
|
|
899
899
|
return t.id == null ? crypto.randomUUID() : m(t.id);
|
|
900
900
|
}
|
|
901
|
-
function
|
|
902
|
-
return /* @__PURE__ */ R(h, { children: /* @__PURE__ */ R(
|
|
901
|
+
function q({ screenCode: e }) {
|
|
902
|
+
return /* @__PURE__ */ R(h, { children: /* @__PURE__ */ R(Ct, { screenCode: e }) });
|
|
903
903
|
}
|
|
904
|
-
function
|
|
905
|
-
let { id: n } =
|
|
904
|
+
function Ct({ screenCode: t }) {
|
|
905
|
+
let { id: n } = et(), a = te(), [s, c] = tt(), { data: m } = i(), h = re((e) => e.user), g = u(), y = se(), b = m?.screens[t], S = b?.entity ? m?.entities[b.entity] : void 0, C = b?.entity, w = x(S, "create"), T = x(S, "update"), ne = x(S, "restore"), E = (() => {
|
|
906
906
|
if (!S || !S.singleton || !S.prefilter) return;
|
|
907
907
|
let e = le(S);
|
|
908
908
|
if (e.length !== 1) return;
|
|
909
909
|
let t = S.prefilter[e[0]];
|
|
910
910
|
if (t === "$caller.user_id") return h?.id;
|
|
911
911
|
if (t === "$caller.tenant_id") return h?.tenant?.id;
|
|
912
|
-
})(), D = E !== void 0, O = D ? E : n, k = !D && O === "new", A =
|
|
912
|
+
})(), D = E !== void 0, O = D ? E : n, k = !D && O === "new", A = F(() => {
|
|
913
913
|
if (!O || k) return;
|
|
914
914
|
if (!S) return O;
|
|
915
915
|
let e = le(S);
|
|
@@ -923,16 +923,16 @@ function q({ screenCode: t }) {
|
|
|
923
923
|
O,
|
|
924
924
|
k,
|
|
925
925
|
S
|
|
926
|
-
]), j =
|
|
926
|
+
]), j = F(() => {
|
|
927
927
|
if (A) return typeof A == "string" ? A : ie(A);
|
|
928
|
-
}, [A]), ge =
|
|
929
|
-
pe(
|
|
930
|
-
let
|
|
928
|
+
}, [A]), ge = Ie(C, A), { data: _e, isLoading: ve, error: be } = ge, xe = Me((e) => e.degradedEntities), De = C ? Ee(S?.realtime, xe, C) : !1;
|
|
929
|
+
pe(ze(C, A), !k);
|
|
930
|
+
let Oe = Te(C ?? ""), Le = we(C ?? ""), Re = Be(C ?? ""), Ue = Object.keys(S?.status_groups ?? {}).length > 0, Ge = _e?.data, Ke = Ge?.$statuses, qe = Ge?.$properties, Je = s.get("edit") === "true", [M, Ze] = I(k || Je), [L, nt] = I({}), [B, V] = I({}), [H, ot] = I({}), [U, W] = I(void 0), [ct, ut] = I(!1), [dt, G] = I(void 0), [pt, ht] = I(!1), _t = k ? w : T, K = M && _t, q = oe();
|
|
931
931
|
ee(K && !k, q.enabled);
|
|
932
|
-
let [Ct,
|
|
932
|
+
let [Ct, Tt] = I(() => {
|
|
933
933
|
let e = parseInt(b?.sidebar_width || "380", 10);
|
|
934
934
|
return isNaN(e) ? 380 : e;
|
|
935
|
-
}), Et =
|
|
935
|
+
}), Et = Qe(null), J = Qe(null), Ot = N((e) => {
|
|
936
936
|
e.preventDefault();
|
|
937
937
|
let t = Et.current;
|
|
938
938
|
if (!t) return;
|
|
@@ -946,28 +946,33 @@ function q({ screenCode: t }) {
|
|
|
946
946
|
let n = J.current.startX - e.clientX, r = Math.max(280, Math.min(800, J.current.startW + n));
|
|
947
947
|
t.style.width = `${r}px`;
|
|
948
948
|
}, i = () => {
|
|
949
|
-
J.current && t &&
|
|
949
|
+
J.current && t && Tt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
950
950
|
};
|
|
951
951
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
952
|
-
}, []), Y = _e?.data, X =
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
952
|
+
}, []), Y = _e?.data, X = ke(S, b, Y ?? {});
|
|
953
|
+
P(() => {
|
|
954
|
+
let e = parseInt(X?.sidebar_width || "380", 10);
|
|
955
|
+
Tt(Number.isNaN(e) ? 380 : e);
|
|
956
|
+
}, [X?.sidebar_width]);
|
|
957
|
+
let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, kt = Y?.$refs, At = Qe(Z);
|
|
958
|
+
P(() => {
|
|
959
|
+
if (!Z) return;
|
|
960
|
+
let e = At.current;
|
|
961
|
+
At.current = Z, e && e !== Z && M && ut(!0);
|
|
962
|
+
}, [M, Z]);
|
|
963
|
+
let jt = !!S?.soft_delete && Y != null && Y[S.soft_delete] != null, Mt = $e(), Nt = Qe(null);
|
|
964
|
+
me({ scrollElementRef: Nt });
|
|
965
|
+
let Pt = !k && be instanceof ce && be.status === 404, Ft = k && !de(S), It = Qe(null);
|
|
966
|
+
P(() => {
|
|
967
|
+
if (!Pt) return;
|
|
968
|
+
let e = Se(Mt);
|
|
969
|
+
It.current !== e && (It.current = e, fe.getState().kill(e));
|
|
970
|
+
}, [Pt, Mt]);
|
|
971
|
+
let { openTab: Lt, updateTabTitle: Rt, findTabByPathname: zt } = Fe();
|
|
972
|
+
P(() => {
|
|
968
973
|
if (!S || D || q.enabled) return;
|
|
969
|
-
let e =
|
|
970
|
-
|
|
974
|
+
let e = Mt.pathname, t = v(X?.display?.name) || v(S.display.name), n = X?.display?.icon || S.display.icon;
|
|
975
|
+
zt(e) || Lt({
|
|
971
976
|
pathname: e,
|
|
972
977
|
search: "",
|
|
973
978
|
title: k ? `New ${t}` : t,
|
|
@@ -975,61 +980,64 @@ function q({ screenCode: t }) {
|
|
|
975
980
|
closable: !0
|
|
976
981
|
});
|
|
977
982
|
}, [
|
|
978
|
-
|
|
979
|
-
|
|
983
|
+
Mt.pathname,
|
|
984
|
+
X?.display?.name?.en,
|
|
980
985
|
S?.display.name?.en,
|
|
981
|
-
|
|
986
|
+
X?.display?.icon,
|
|
982
987
|
S?.display.icon,
|
|
983
988
|
k,
|
|
984
989
|
D,
|
|
985
990
|
q.enabled
|
|
986
|
-
]),
|
|
991
|
+
]), P(() => {
|
|
987
992
|
if (!Y || !S || D || q.enabled) return;
|
|
988
|
-
let e =
|
|
993
|
+
let e = zt(Mt.pathname);
|
|
989
994
|
if (e) {
|
|
990
|
-
let t = v(
|
|
991
|
-
|
|
995
|
+
let t = v(X?.display?.name) || v(S.display.name), n = o(Y, S), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
996
|
+
Rt(e.id, r);
|
|
992
997
|
}
|
|
993
998
|
}, [
|
|
994
999
|
Y,
|
|
995
1000
|
S?.display.name?.en,
|
|
996
1001
|
S?.display.display_field,
|
|
997
|
-
|
|
1002
|
+
Mt.pathname,
|
|
998
1003
|
D,
|
|
999
1004
|
q.enabled
|
|
1000
1005
|
]);
|
|
1001
|
-
let
|
|
1006
|
+
let Bt = F(() => {
|
|
1002
1007
|
if (!S || !_t) return /* @__PURE__ */ new Set();
|
|
1003
1008
|
let e = /* @__PURE__ */ new Set();
|
|
1004
1009
|
for (let [t, n] of S.fields) !n.auto && !n.primary && e.add(t);
|
|
1005
1010
|
for (let [t] of S.files ?? []) e.add(t);
|
|
1006
1011
|
return e;
|
|
1007
1012
|
}, [S, _t]);
|
|
1008
|
-
|
|
1009
|
-
if (!(!
|
|
1010
|
-
if (
|
|
1013
|
+
P(() => {
|
|
1014
|
+
if (!(!Je || !Y || !S || !T)) {
|
|
1015
|
+
if (M || Ze(!0), Object.keys(L).length === 0) {
|
|
1011
1016
|
let e = O ? ye(O) : null;
|
|
1012
|
-
e
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1017
|
+
if (e) {
|
|
1018
|
+
let t = Ne({
|
|
1019
|
+
entity: S,
|
|
1020
|
+
formData: e,
|
|
1021
|
+
record: void 0,
|
|
1022
|
+
isNew: !0
|
|
1023
|
+
});
|
|
1024
|
+
Pe(t).forEach((e) => {
|
|
1025
|
+
g.registerDraft({
|
|
1026
|
+
fileId: e,
|
|
1027
|
+
discard: () => p(e)
|
|
1028
|
+
});
|
|
1021
1029
|
});
|
|
1022
|
-
}
|
|
1030
|
+
}
|
|
1023
1031
|
let t = {};
|
|
1024
|
-
|
|
1032
|
+
Bt.forEach((n) => {
|
|
1025
1033
|
let r = e ? e[n] : void 0;
|
|
1026
1034
|
if (r !== void 0) {
|
|
1027
1035
|
t[n] = r;
|
|
1028
1036
|
return;
|
|
1029
1037
|
}
|
|
1030
|
-
let i =
|
|
1031
|
-
t[n] =
|
|
1032
|
-
}),
|
|
1038
|
+
let i = Ce(S, Y, n);
|
|
1039
|
+
t[n] = Ae(S, n) ? i ?? null : i ?? "";
|
|
1040
|
+
}), nt(t);
|
|
1033
1041
|
}
|
|
1034
1042
|
if (S.children !== void 0 && S.children.length > 0 && U === void 0) {
|
|
1035
1043
|
let e = Y.$children;
|
|
@@ -1039,7 +1047,7 @@ function q({ screenCode: t }) {
|
|
|
1039
1047
|
let e = m?.entities[n];
|
|
1040
1048
|
t[n] = r.map((t) => ({
|
|
1041
1049
|
...t,
|
|
1042
|
-
_key:
|
|
1050
|
+
_key: St(e, t)
|
|
1043
1051
|
}));
|
|
1044
1052
|
}
|
|
1045
1053
|
W(t), G(e);
|
|
@@ -1051,82 +1059,82 @@ function q({ screenCode: t }) {
|
|
|
1051
1059
|
}, { replace: !0 });
|
|
1052
1060
|
}
|
|
1053
1061
|
}, [
|
|
1054
|
-
|
|
1062
|
+
Je,
|
|
1055
1063
|
Y,
|
|
1056
|
-
|
|
1064
|
+
Bt,
|
|
1057
1065
|
T,
|
|
1058
1066
|
S,
|
|
1059
1067
|
U,
|
|
1060
1068
|
m
|
|
1061
|
-
]),
|
|
1069
|
+
]), P(() => {
|
|
1062
1070
|
!k || !w || !S?.children || S.children.length === 0 || U === void 0 && (W({}), G({}));
|
|
1063
1071
|
}, [
|
|
1064
1072
|
k,
|
|
1065
1073
|
w,
|
|
1066
1074
|
S?.children
|
|
1067
1075
|
]);
|
|
1068
|
-
let
|
|
1076
|
+
let Vt = N(async () => {
|
|
1069
1077
|
if (await g.flushAllDrafts(), k) {
|
|
1070
|
-
let e =
|
|
1078
|
+
let e = X?.route?.replace("/:id", "") ?? "/";
|
|
1071
1079
|
a(e);
|
|
1072
|
-
} else
|
|
1080
|
+
} else Ze(!1), nt({}), V({}), ot({}), W(void 0), G(void 0), ht(!1);
|
|
1073
1081
|
}, [
|
|
1074
1082
|
g,
|
|
1075
1083
|
k,
|
|
1076
|
-
|
|
1084
|
+
X,
|
|
1077
1085
|
a
|
|
1078
|
-
]),
|
|
1079
|
-
|
|
1086
|
+
]), Ht = N((e, t) => {
|
|
1087
|
+
nt((n) => ({
|
|
1080
1088
|
...n,
|
|
1081
1089
|
[e]: t
|
|
1082
1090
|
}));
|
|
1083
|
-
}, []), Q =
|
|
1084
|
-
if (!
|
|
1085
|
-
let e =
|
|
1091
|
+
}, []), Q = F(() => {
|
|
1092
|
+
if (!X?.route) return "/";
|
|
1093
|
+
let e = X.route.split("/");
|
|
1086
1094
|
return e.pop(), e.join("/") || "/";
|
|
1087
|
-
}, [
|
|
1088
|
-
if (!
|
|
1095
|
+
}, [X]), Ut = F(() => !m?.screens || !Q || Q === "/" ? !1 : Object.values(m.screens).some((e) => e.route === Q), [m, Q]), Wt = N(() => {
|
|
1096
|
+
if (!Ut) {
|
|
1089
1097
|
a("/");
|
|
1090
1098
|
return;
|
|
1091
1099
|
}
|
|
1092
|
-
let e =
|
|
1100
|
+
let e = zt(Q)?.search ?? "";
|
|
1093
1101
|
a(e ? `${Q}?${e}` : Q);
|
|
1094
1102
|
}, [
|
|
1095
|
-
|
|
1103
|
+
Ut,
|
|
1096
1104
|
Q,
|
|
1097
|
-
|
|
1105
|
+
zt,
|
|
1098
1106
|
a
|
|
1099
|
-
]) }),
|
|
1107
|
+
]), Gt = We({ fallback: Wt }), Kt = !D && (Gt.hasOriginBack || Gt.allowFallbackBack && !!Ut), qt = r(), Jt = F(() => {
|
|
1100
1108
|
if (!S) return {};
|
|
1101
1109
|
let e = {};
|
|
1102
|
-
for (let t of
|
|
1103
|
-
for (let t of
|
|
1110
|
+
for (let t of gt(S, L, k)) Bt.has(t) && (e[t] = "Required");
|
|
1111
|
+
for (let t of vt(S, L)) Bt.has(t) && (e[t] = "Invalid email address");
|
|
1104
1112
|
return e;
|
|
1105
1113
|
}, [
|
|
1106
1114
|
S,
|
|
1107
1115
|
L,
|
|
1108
1116
|
k,
|
|
1109
|
-
|
|
1110
|
-
]),
|
|
1111
|
-
if (!C || !S || k && !w || !k && !T || (ht(!0),
|
|
1112
|
-
let e = {}, t =
|
|
1117
|
+
Bt
|
|
1118
|
+
]), Yt = Object.keys(Jt).length > 0, Xt = N(() => {
|
|
1119
|
+
if (!C || !S || k && !w || !k && !T || (ht(!0), Yt)) return;
|
|
1120
|
+
let e = {}, t = Ne({
|
|
1113
1121
|
entity: S,
|
|
1114
1122
|
formData: L,
|
|
1115
1123
|
record: Y,
|
|
1116
1124
|
isNew: k
|
|
1117
|
-
}), n =
|
|
1125
|
+
}), n = Pe(t);
|
|
1118
1126
|
if (k) for (let [t, n] of Object.entries(L)) {
|
|
1119
1127
|
if (S.files?.has(t)) continue;
|
|
1120
|
-
let r =
|
|
1128
|
+
let r = Ve(S, t, n);
|
|
1121
1129
|
r !== "" && r != null && (e[t] = r);
|
|
1122
1130
|
}
|
|
1123
1131
|
else {
|
|
1124
1132
|
for (let [t, n] of Object.entries(L)) {
|
|
1125
1133
|
if (S.files?.has(t)) continue;
|
|
1126
|
-
let r = Y ?
|
|
1134
|
+
let r = Y ? Ce(S, Y, t) : void 0, i = Ve(S, t, n), a = Ve(S, t, r);
|
|
1127
1135
|
(i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
|
|
1128
1136
|
}
|
|
1129
|
-
|
|
1137
|
+
Z && (e.$row_version = Z);
|
|
1130
1138
|
}
|
|
1131
1139
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(B).length > 0 && (e.$statuses = Object.entries(B).map(([e, t]) => ({
|
|
1132
1140
|
status_group_code: e,
|
|
@@ -1140,22 +1148,22 @@ function q({ screenCode: t }) {
|
|
|
1140
1148
|
let r = n.filter((e) => !e._deleted).map((e) => {
|
|
1141
1149
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
1142
1150
|
return i;
|
|
1143
|
-
}), i =
|
|
1144
|
-
(k || !
|
|
1151
|
+
}), i = dt?.[e] ?? [];
|
|
1152
|
+
(k || !xt(r, i)) && (t[e] = r);
|
|
1145
1153
|
}
|
|
1146
1154
|
Object.keys(t).length > 0 && (e.$children = t);
|
|
1147
1155
|
}
|
|
1148
1156
|
if (!k && Object.keys(e).length === 0) {
|
|
1149
|
-
|
|
1157
|
+
Ze(!1), V({}), ot({}), W(void 0), G(void 0), ht(!1);
|
|
1150
1158
|
return;
|
|
1151
1159
|
}
|
|
1152
1160
|
let r = () => {
|
|
1153
|
-
|
|
1161
|
+
Ze(!1), ut(!1), ht(!1), V({}), ot({}), W(void 0), G(void 0);
|
|
1154
1162
|
};
|
|
1155
|
-
k ?
|
|
1163
|
+
k ? Oe.mutate(e, { onSuccess: (e) => {
|
|
1156
1164
|
n.forEach((e) => g.markCommitted(e));
|
|
1157
|
-
let t = e.data, i =
|
|
1158
|
-
a(
|
|
1165
|
+
let t = e.data, i = S ? ue(S, t) : {}, o = ie(i);
|
|
1166
|
+
a(o ? `${Q}/${encodeURIComponent(o)}` : Q, { replace: !0 }), r();
|
|
1159
1167
|
} }) : A && Le.mutate({
|
|
1160
1168
|
pkValues: A,
|
|
1161
1169
|
data: e
|
|
@@ -1164,7 +1172,7 @@ function q({ screenCode: t }) {
|
|
|
1164
1172
|
n.forEach((e) => g.markCommitted(e)), r();
|
|
1165
1173
|
},
|
|
1166
1174
|
onError: (e) => {
|
|
1167
|
-
e instanceof ce && e.code === "STALE_OBJECT" &&
|
|
1175
|
+
e instanceof ce && e.code === "STALE_OBJECT" && ut(!0);
|
|
1168
1176
|
}
|
|
1169
1177
|
});
|
|
1170
1178
|
}, [
|
|
@@ -1174,35 +1182,35 @@ function q({ screenCode: t }) {
|
|
|
1174
1182
|
T,
|
|
1175
1183
|
C,
|
|
1176
1184
|
L,
|
|
1177
|
-
|
|
1185
|
+
Yt,
|
|
1178
1186
|
B,
|
|
1179
1187
|
H,
|
|
1180
1188
|
U,
|
|
1181
|
-
|
|
1182
|
-
|
|
1189
|
+
dt,
|
|
1190
|
+
Oe,
|
|
1183
1191
|
Le,
|
|
1184
1192
|
S,
|
|
1185
1193
|
a,
|
|
1186
1194
|
Q,
|
|
1187
1195
|
Y,
|
|
1188
|
-
|
|
1196
|
+
Z,
|
|
1189
1197
|
A
|
|
1190
|
-
]),
|
|
1198
|
+
]), Zt = N((e, t) => {
|
|
1191
1199
|
W((n) => ({
|
|
1192
1200
|
...n ?? {},
|
|
1193
1201
|
[e]: t
|
|
1194
1202
|
}));
|
|
1195
|
-
}, []),
|
|
1203
|
+
}, []), Qt = N(() => {
|
|
1196
1204
|
!A || k || !ne || Re.mutate(A);
|
|
1197
1205
|
}, [
|
|
1198
1206
|
A,
|
|
1199
1207
|
k,
|
|
1200
1208
|
ne,
|
|
1201
1209
|
Re
|
|
1202
|
-
]),
|
|
1203
|
-
if (!
|
|
1204
|
-
if (!k && ve) return /* @__PURE__ */ R(
|
|
1205
|
-
if (
|
|
1210
|
+
]), $t = F(() => yt(U, m), [U, m]), en = Object.keys($t).length > 0;
|
|
1211
|
+
if (!X || !S) return null;
|
|
1212
|
+
if (!k && ve) return /* @__PURE__ */ R(je, {});
|
|
1213
|
+
if (Ft) return /* @__PURE__ */ z("div", {
|
|
1206
1214
|
style: { padding: 24 },
|
|
1207
1215
|
children: [/* @__PURE__ */ z("div", {
|
|
1208
1216
|
style: {
|
|
@@ -1211,9 +1219,9 @@ function q({ screenCode: t }) {
|
|
|
1211
1219
|
gap: 8,
|
|
1212
1220
|
marginBottom: 8
|
|
1213
1221
|
},
|
|
1214
|
-
children: [
|
|
1222
|
+
children: [Kt && /* @__PURE__ */ R(ae, {
|
|
1215
1223
|
icon: /* @__PURE__ */ R(e.back, { size: 14 }),
|
|
1216
|
-
onClick:
|
|
1224
|
+
onClick: Gt.goBack,
|
|
1217
1225
|
title: "Back"
|
|
1218
1226
|
}), /* @__PURE__ */ R("h1", {
|
|
1219
1227
|
style: {
|
|
@@ -1229,7 +1237,7 @@ function q({ screenCode: t }) {
|
|
|
1229
1237
|
children: "This record type is not created from a form."
|
|
1230
1238
|
})]
|
|
1231
1239
|
});
|
|
1232
|
-
if (!k && !Y ||
|
|
1240
|
+
if (!k && !Y || Pt) return /* @__PURE__ */ z("div", {
|
|
1233
1241
|
style: { padding: 24 },
|
|
1234
1242
|
children: [/* @__PURE__ */ z("div", {
|
|
1235
1243
|
style: {
|
|
@@ -1238,9 +1246,9 @@ function q({ screenCode: t }) {
|
|
|
1238
1246
|
gap: 8,
|
|
1239
1247
|
marginBottom: 8
|
|
1240
1248
|
},
|
|
1241
|
-
children: [
|
|
1249
|
+
children: [Kt && /* @__PURE__ */ R(ae, {
|
|
1242
1250
|
icon: /* @__PURE__ */ R(e.back, { size: 14 }),
|
|
1243
|
-
onClick:
|
|
1251
|
+
onClick: Gt.goBack,
|
|
1244
1252
|
title: "Back"
|
|
1245
1253
|
}), /* @__PURE__ */ R("h1", {
|
|
1246
1254
|
style: {
|
|
@@ -1256,9 +1264,9 @@ function q({ screenCode: t }) {
|
|
|
1256
1264
|
children: "Record not found."
|
|
1257
1265
|
})]
|
|
1258
1266
|
});
|
|
1259
|
-
let
|
|
1267
|
+
let tn = S.display, nn = v(X.display?.name) || v(tn.name), rn = o(Y, S), an = k ? `New ${nn}` : rn ? String(rn) : nn, on = Oe.isPending || Le.isPending, sn = X.responsive?.[y.category]?.layout, cn = sn?.tabs ?? (y.isPhone ? "sections" : void 0), ln = sn?.header_card === !0 ? He({
|
|
1260
1268
|
entity: S,
|
|
1261
|
-
screen:
|
|
1269
|
+
screen: X
|
|
1262
1270
|
}) : void 0, $ = {
|
|
1263
1271
|
schema: m,
|
|
1264
1272
|
entity: S,
|
|
@@ -1270,10 +1278,10 @@ function q({ screenCode: t }) {
|
|
|
1270
1278
|
} : Y ?? {},
|
|
1271
1279
|
isNew: k,
|
|
1272
1280
|
mode: K ? "edit" : "display",
|
|
1273
|
-
onFieldChange: K ?
|
|
1274
|
-
refs:
|
|
1281
|
+
onFieldChange: K ? Ht : void 0,
|
|
1282
|
+
refs: kt,
|
|
1275
1283
|
objectProperties: (() => {
|
|
1276
|
-
let e =
|
|
1284
|
+
let e = qe ?? [];
|
|
1277
1285
|
if (!K || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
|
|
1278
1286
|
let t = e.map((e) => H[e.property_code] === void 0 ? e : {
|
|
1279
1287
|
...e,
|
|
@@ -1287,13 +1295,13 @@ function q({ screenCode: t }) {
|
|
|
1287
1295
|
});
|
|
1288
1296
|
return t;
|
|
1289
1297
|
})(),
|
|
1290
|
-
onSetProperty: k || !T ? void 0 : K ? (e, t) =>
|
|
1298
|
+
onSetProperty: k || !T ? void 0 : K ? (e, t) => ot((n) => ({
|
|
1291
1299
|
...n,
|
|
1292
1300
|
[e]: t
|
|
1293
1301
|
})) : void 0,
|
|
1294
1302
|
isPropertyPending: !1,
|
|
1295
1303
|
objectStatuses: (() => {
|
|
1296
|
-
let e =
|
|
1304
|
+
let e = Ke ?? [];
|
|
1297
1305
|
if (!K || Object.keys(B).length === 0) return e.length > 0 ? e : void 0;
|
|
1298
1306
|
let t = e.map((e) => B[e.group_code] === void 0 ? e : {
|
|
1299
1307
|
...e,
|
|
@@ -1313,45 +1321,45 @@ function q({ screenCode: t }) {
|
|
|
1313
1321
|
})) : void 0,
|
|
1314
1322
|
isStatusPending: !1,
|
|
1315
1323
|
pendingChildren: K ? U : void 0,
|
|
1316
|
-
onChildrenChange: K ?
|
|
1317
|
-
childValidationErrors: K ?
|
|
1318
|
-
fieldErrors: K && pt ?
|
|
1319
|
-
detailTabsPresentation:
|
|
1320
|
-
relatedRecordsPresentation:
|
|
1321
|
-
},
|
|
1322
|
-
screen:
|
|
1324
|
+
onChildrenChange: K ? Zt : void 0,
|
|
1325
|
+
childValidationErrors: K ? $t : void 0,
|
|
1326
|
+
fieldErrors: K && pt ? Jt : void 0,
|
|
1327
|
+
detailTabsPresentation: cn,
|
|
1328
|
+
relatedRecordsPresentation: sn?.related_records
|
|
1329
|
+
}, un = !!X.sidebar && X.sidebar.length > 0, dn = sn?.sidebar === "hidden", fn = un && !dn && !y.isDesktop, pn = un && !dn && y.isDesktop, mn = !k && Y ? /* @__PURE__ */ R(lt, {
|
|
1330
|
+
screen: X,
|
|
1323
1331
|
entity: S,
|
|
1324
1332
|
entityCode: C,
|
|
1325
1333
|
record: Y,
|
|
1326
|
-
refs:
|
|
1327
|
-
objectStatuses:
|
|
1334
|
+
refs: kt,
|
|
1335
|
+
objectStatuses: Ke,
|
|
1328
1336
|
schema: m,
|
|
1329
|
-
locale:
|
|
1330
|
-
}) : void 0,
|
|
1331
|
-
title:
|
|
1337
|
+
locale: qt
|
|
1338
|
+
}) : void 0, hn = /* @__PURE__ */ R(Dt, {
|
|
1339
|
+
title: an,
|
|
1332
1340
|
recordId: O,
|
|
1333
1341
|
editing: K,
|
|
1334
1342
|
isNew: k,
|
|
1335
|
-
isRecordDeleted:
|
|
1336
|
-
dirty:
|
|
1337
|
-
isSaving:
|
|
1338
|
-
hasChildErrors:
|
|
1339
|
-
hasFieldErrors: pt &&
|
|
1343
|
+
isRecordDeleted: jt,
|
|
1344
|
+
dirty: M,
|
|
1345
|
+
isSaving: on,
|
|
1346
|
+
hasChildErrors: en,
|
|
1347
|
+
hasFieldErrors: pt && Yt,
|
|
1340
1348
|
canRestore: ne,
|
|
1341
1349
|
entity: S,
|
|
1342
|
-
screen:
|
|
1350
|
+
screen: X,
|
|
1343
1351
|
globalActions: m?.actions,
|
|
1344
1352
|
entityCode: C,
|
|
1345
1353
|
record: Y,
|
|
1346
1354
|
id: O,
|
|
1347
1355
|
listRoute: Q,
|
|
1348
|
-
listRouteExists: !!
|
|
1349
|
-
highlights:
|
|
1350
|
-
showBack:
|
|
1351
|
-
onBack:
|
|
1352
|
-
onCancelEdit:
|
|
1353
|
-
onSave:
|
|
1354
|
-
onRestore:
|
|
1356
|
+
listRouteExists: !!Ut,
|
|
1357
|
+
highlights: mn,
|
|
1358
|
+
showBack: Kt,
|
|
1359
|
+
onBack: Gt.goBack,
|
|
1360
|
+
onCancelEdit: Vt,
|
|
1361
|
+
onSave: Xt,
|
|
1362
|
+
onRestore: Qt,
|
|
1355
1363
|
isRestoring: Re.isPending,
|
|
1356
1364
|
refreshControl: {
|
|
1357
1365
|
refetch: ge.refetch,
|
|
@@ -1361,7 +1369,7 @@ function q({ screenCode: t }) {
|
|
|
1361
1369
|
},
|
|
1362
1370
|
isRealtimeEntity: S?.realtime === !0,
|
|
1363
1371
|
canManageTemplates: he(m)
|
|
1364
|
-
}),
|
|
1372
|
+
}), gn = jt && /* @__PURE__ */ z("div", {
|
|
1365
1373
|
style: {
|
|
1366
1374
|
display: "flex",
|
|
1367
1375
|
alignItems: "center",
|
|
@@ -1375,7 +1383,7 @@ function q({ screenCode: t }) {
|
|
|
1375
1383
|
fontSize: 12.5
|
|
1376
1384
|
},
|
|
1377
1385
|
children: [/* @__PURE__ */ R(e.warning, { size: 14 }), /* @__PURE__ */ z("span", { children: ["This record was deleted on ", d(String(Y[S.soft_delete]))] })]
|
|
1378
|
-
}),
|
|
1386
|
+
}), _n = ct && /* @__PURE__ */ z("div", {
|
|
1379
1387
|
style: {
|
|
1380
1388
|
display: "flex",
|
|
1381
1389
|
alignItems: "center",
|
|
@@ -1389,8 +1397,8 @@ function q({ screenCode: t }) {
|
|
|
1389
1397
|
fontSize: 12.5
|
|
1390
1398
|
},
|
|
1391
1399
|
children: [/* @__PURE__ */ R(e.warning, { size: 14 }), /* @__PURE__ */ R("span", { children: "This record changed on the server while you were viewing or editing it." })]
|
|
1392
|
-
}),
|
|
1393
|
-
errors: Object.entries(
|
|
1400
|
+
}), vn = K && pt && Yt && /* @__PURE__ */ R(st, {
|
|
1401
|
+
errors: Object.entries(Jt).map(([e, t]) => {
|
|
1394
1402
|
let n = S.fields.get(e);
|
|
1395
1403
|
return {
|
|
1396
1404
|
name: e,
|
|
@@ -1405,56 +1413,56 @@ function q({ screenCode: t }) {
|
|
|
1405
1413
|
behavior: "smooth"
|
|
1406
1414
|
}), t.focus?.());
|
|
1407
1415
|
}
|
|
1408
|
-
}),
|
|
1416
|
+
}), yn = Ue && !k && !(X.items && X.items.length > 0) && /* @__PURE__ */ R("div", {
|
|
1409
1417
|
className: "mb-4",
|
|
1410
|
-
children: /* @__PURE__ */ R(
|
|
1418
|
+
children: /* @__PURE__ */ R(Ye, {
|
|
1411
1419
|
statusGroups: S.status_groups ?? {},
|
|
1412
1420
|
objectStatuses: $.objectStatuses,
|
|
1413
1421
|
onSetStatus: T && K ? (e, t) => V((n) => ({
|
|
1414
1422
|
...n,
|
|
1415
1423
|
[e]: t
|
|
1416
|
-
})) :
|
|
1424
|
+
})) : bt,
|
|
1417
1425
|
isPending: !1,
|
|
1418
1426
|
mode: K ? "edit" : "display"
|
|
1419
1427
|
})
|
|
1420
|
-
}),
|
|
1428
|
+
}), bn = S.evidence_covered && !k && Y && /* @__PURE__ */ R("div", {
|
|
1421
1429
|
className: "mb-4",
|
|
1422
|
-
children: /* @__PURE__ */ R(
|
|
1423
|
-
}),
|
|
1424
|
-
|
|
1425
|
-
card:
|
|
1430
|
+
children: /* @__PURE__ */ R(mt, { evidence: Y.$evidence })
|
|
1431
|
+
}), xn = /* @__PURE__ */ z(rt, { children: [
|
|
1432
|
+
ln && (Y || k) && /* @__PURE__ */ R(wt, {
|
|
1433
|
+
card: ln,
|
|
1426
1434
|
entity: S,
|
|
1427
1435
|
record: $.record,
|
|
1428
1436
|
objectStatuses: $.objectStatuses,
|
|
1429
1437
|
objectProperties: $.objectProperties
|
|
1430
1438
|
}),
|
|
1431
|
-
|
|
1432
|
-
nodes:
|
|
1439
|
+
X.items && X.items.length > 0 && (Y || k) && m && /* @__PURE__ */ R(Xe, {
|
|
1440
|
+
nodes: X.items,
|
|
1433
1441
|
ctx: $
|
|
1434
1442
|
}),
|
|
1435
|
-
!k && O && C && S.associations && Object.keys(S.associations).length > 0 && m && /* @__PURE__ */ R(
|
|
1443
|
+
!k && O && C && S.associations && Object.keys(S.associations).length > 0 && m && /* @__PURE__ */ R(it, {
|
|
1436
1444
|
entityCode: C,
|
|
1437
1445
|
recordId: j ?? O ?? "",
|
|
1438
1446
|
associations: S.associations,
|
|
1439
1447
|
schema: m
|
|
1440
1448
|
}),
|
|
1441
|
-
!k && O && C && /* @__PURE__ */ R(
|
|
1449
|
+
!k && O && C && /* @__PURE__ */ R(at, {
|
|
1442
1450
|
entityCode: C,
|
|
1443
1451
|
objectId: j ?? O,
|
|
1444
1452
|
canGenerateOne: !!S?.documents?.generate_one,
|
|
1445
1453
|
canManageTemplates: he(m)
|
|
1446
1454
|
}),
|
|
1447
|
-
!k && Y && m && /* @__PURE__ */ R(
|
|
1448
|
-
screen:
|
|
1455
|
+
!k && Y && m && /* @__PURE__ */ R(ft, {
|
|
1456
|
+
screen: X,
|
|
1449
1457
|
entity: S,
|
|
1450
1458
|
entityCode: C,
|
|
1451
1459
|
record: Y,
|
|
1452
|
-
refs:
|
|
1460
|
+
refs: kt,
|
|
1453
1461
|
schema: m,
|
|
1454
|
-
locale:
|
|
1462
|
+
locale: qt
|
|
1455
1463
|
})
|
|
1456
1464
|
] });
|
|
1457
|
-
if (
|
|
1465
|
+
if (pn) return /* @__PURE__ */ z("div", {
|
|
1458
1466
|
style: {
|
|
1459
1467
|
height: "100%",
|
|
1460
1468
|
display: "flex",
|
|
@@ -1476,15 +1484,15 @@ function q({ screenCode: t }) {
|
|
|
1476
1484
|
padding: "14px 20px 8px"
|
|
1477
1485
|
},
|
|
1478
1486
|
children: [
|
|
1479
|
-
fn,
|
|
1480
|
-
mn,
|
|
1481
|
-
pn,
|
|
1482
1487
|
hn,
|
|
1488
|
+
_n,
|
|
1483
1489
|
gn,
|
|
1484
|
-
|
|
1490
|
+
vn,
|
|
1491
|
+
yn,
|
|
1492
|
+
bn
|
|
1485
1493
|
]
|
|
1486
1494
|
}), /* @__PURE__ */ R("div", {
|
|
1487
|
-
ref:
|
|
1495
|
+
ref: Nt,
|
|
1488
1496
|
style: {
|
|
1489
1497
|
flex: 1,
|
|
1490
1498
|
minHeight: 0,
|
|
@@ -1494,12 +1502,12 @@ function q({ screenCode: t }) {
|
|
|
1494
1502
|
flexDirection: "column",
|
|
1495
1503
|
gap: 16
|
|
1496
1504
|
},
|
|
1497
|
-
children:
|
|
1505
|
+
children: xn
|
|
1498
1506
|
})]
|
|
1499
1507
|
}),
|
|
1500
1508
|
/* @__PURE__ */ R("div", {
|
|
1501
1509
|
className: "detail-resize-handle",
|
|
1502
|
-
onMouseDown:
|
|
1510
|
+
onMouseDown: Ot,
|
|
1503
1511
|
title: "Drag to resize",
|
|
1504
1512
|
children: /* @__PURE__ */ R("div", { style: {
|
|
1505
1513
|
position: "absolute",
|
|
@@ -1518,14 +1526,14 @@ function q({ screenCode: t }) {
|
|
|
1518
1526
|
height: "100%",
|
|
1519
1527
|
width: `${Ct}px`
|
|
1520
1528
|
},
|
|
1521
|
-
children: (Y || k) && m && /* @__PURE__ */ R(
|
|
1522
|
-
nodes:
|
|
1529
|
+
children: (Y || k) && m && /* @__PURE__ */ R(Xe, {
|
|
1530
|
+
nodes: X.sidebar,
|
|
1523
1531
|
ctx: $
|
|
1524
1532
|
})
|
|
1525
1533
|
})
|
|
1526
1534
|
]
|
|
1527
1535
|
});
|
|
1528
|
-
let
|
|
1536
|
+
let Sn = y.isPhone ? 12 : 24;
|
|
1529
1537
|
return /* @__PURE__ */ z("div", {
|
|
1530
1538
|
style: {
|
|
1531
1539
|
height: "100%",
|
|
@@ -1540,27 +1548,27 @@ function q({ screenCode: t }) {
|
|
|
1540
1548
|
padding: y.isPhone ? "14px 12px 8px" : "24px 24px 8px"
|
|
1541
1549
|
},
|
|
1542
1550
|
children: [
|
|
1543
|
-
fn,
|
|
1544
|
-
mn,
|
|
1545
|
-
pn,
|
|
1546
1551
|
hn,
|
|
1552
|
+
_n,
|
|
1547
1553
|
gn,
|
|
1548
|
-
|
|
1554
|
+
vn,
|
|
1555
|
+
yn,
|
|
1556
|
+
bn
|
|
1549
1557
|
]
|
|
1550
1558
|
}), /* @__PURE__ */ z("div", {
|
|
1551
|
-
ref:
|
|
1559
|
+
ref: Nt,
|
|
1552
1560
|
style: {
|
|
1553
1561
|
flex: 1,
|
|
1554
1562
|
minHeight: 0,
|
|
1555
1563
|
overflowY: "auto",
|
|
1556
|
-
padding: `4px ${
|
|
1564
|
+
padding: `4px ${Sn}px calc(24px + var(--safe-area-bottom, 0px))`,
|
|
1557
1565
|
display: "flex",
|
|
1558
1566
|
flexDirection: "column",
|
|
1559
1567
|
gap: 16,
|
|
1560
1568
|
minWidth: 0,
|
|
1561
1569
|
WebkitOverflowScrolling: "touch"
|
|
1562
1570
|
},
|
|
1563
|
-
children: [
|
|
1571
|
+
children: [xn, fn && (Y || k) && m && /* @__PURE__ */ R("div", {
|
|
1564
1572
|
"data-testid": "detail-sidebar-inline",
|
|
1565
1573
|
style: {
|
|
1566
1574
|
display: "flex",
|
|
@@ -1568,22 +1576,25 @@ function q({ screenCode: t }) {
|
|
|
1568
1576
|
gap: 16,
|
|
1569
1577
|
minWidth: 0
|
|
1570
1578
|
},
|
|
1571
|
-
children: /* @__PURE__ */ R(
|
|
1572
|
-
nodes:
|
|
1579
|
+
children: /* @__PURE__ */ R(Xe, {
|
|
1580
|
+
nodes: X.sidebar,
|
|
1573
1581
|
ctx: $
|
|
1574
1582
|
})
|
|
1575
1583
|
})]
|
|
1576
1584
|
})]
|
|
1577
1585
|
});
|
|
1578
1586
|
}
|
|
1579
|
-
function
|
|
1587
|
+
function wt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
1580
1588
|
let a = (e) => {
|
|
1581
|
-
let a =
|
|
1589
|
+
let a = Tt(t, e, n, r, i);
|
|
1582
1590
|
return a != null && m(a) !== "";
|
|
1583
|
-
}, s = (e) =>
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1591
|
+
}, s = (e) => {
|
|
1592
|
+
let a = Tt(t, e, n, r, i);
|
|
1593
|
+
return m(a) || /* @__PURE__ */ R("span", {
|
|
1594
|
+
style: { color: "var(--text-3)" },
|
|
1595
|
+
children: "-"
|
|
1596
|
+
});
|
|
1597
|
+
}, c = e.titleUsesDisplay ? o(n, t) : e.titleField ? Tt(t, e.titleField, n, r, i) : void 0, l = m(c) || v(t.display?.name) || "Record", u = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
|
|
1587
1598
|
return /* @__PURE__ */ z("section", {
|
|
1588
1599
|
"data-testid": "detail-header-card",
|
|
1589
1600
|
style: {
|
|
@@ -1607,7 +1618,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1607
1618
|
color: "var(--text)",
|
|
1608
1619
|
overflowWrap: "anywhere"
|
|
1609
1620
|
},
|
|
1610
|
-
children:
|
|
1621
|
+
children: l
|
|
1611
1622
|
}), e.subtitleField && /* @__PURE__ */ R("div", {
|
|
1612
1623
|
style: {
|
|
1613
1624
|
marginTop: 4,
|
|
@@ -1619,14 +1630,14 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1619
1630
|
children: s(e.subtitleField)
|
|
1620
1631
|
})]
|
|
1621
1632
|
}),
|
|
1622
|
-
|
|
1633
|
+
u.length > 0 && /* @__PURE__ */ R("div", {
|
|
1623
1634
|
style: {
|
|
1624
1635
|
display: "flex",
|
|
1625
1636
|
flexWrap: "wrap",
|
|
1626
1637
|
gap: 6,
|
|
1627
1638
|
marginTop: 10
|
|
1628
1639
|
},
|
|
1629
|
-
children:
|
|
1640
|
+
children: u.map((e) => /* @__PURE__ */ R("span", {
|
|
1630
1641
|
style: {
|
|
1631
1642
|
minWidth: 0,
|
|
1632
1643
|
maxWidth: "100%",
|
|
@@ -1641,7 +1652,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1641
1652
|
children: s(e)
|
|
1642
1653
|
}, e))
|
|
1643
1654
|
}),
|
|
1644
|
-
|
|
1655
|
+
d.length > 0 && /* @__PURE__ */ R("dl", {
|
|
1645
1656
|
style: {
|
|
1646
1657
|
display: "grid",
|
|
1647
1658
|
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
@@ -1650,11 +1661,11 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1650
1661
|
fontSize: 12.5,
|
|
1651
1662
|
lineHeight: 1.35
|
|
1652
1663
|
},
|
|
1653
|
-
children:
|
|
1664
|
+
children: d.map((e) => /* @__PURE__ */ z("div", {
|
|
1654
1665
|
style: { display: "contents" },
|
|
1655
1666
|
children: [/* @__PURE__ */ R("dt", {
|
|
1656
1667
|
style: { color: "var(--text-3)" },
|
|
1657
|
-
children:
|
|
1668
|
+
children: Et(t, e)
|
|
1658
1669
|
}), /* @__PURE__ */ R("dd", {
|
|
1659
1670
|
style: {
|
|
1660
1671
|
margin: 0,
|
|
@@ -1666,7 +1677,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1666
1677
|
})]
|
|
1667
1678
|
}, e))
|
|
1668
1679
|
}),
|
|
1669
|
-
|
|
1680
|
+
f.length > 0 && /* @__PURE__ */ R("div", {
|
|
1670
1681
|
style: {
|
|
1671
1682
|
display: "flex",
|
|
1672
1683
|
flexWrap: "wrap",
|
|
@@ -1675,13 +1686,13 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1675
1686
|
color: "var(--text-3)",
|
|
1676
1687
|
fontSize: 11.5
|
|
1677
1688
|
},
|
|
1678
|
-
children:
|
|
1689
|
+
children: f.map((e) => /* @__PURE__ */ z("span", {
|
|
1679
1690
|
style: {
|
|
1680
1691
|
minWidth: 0,
|
|
1681
1692
|
overflowWrap: "anywhere"
|
|
1682
1693
|
},
|
|
1683
1694
|
children: [
|
|
1684
|
-
|
|
1695
|
+
Et(t, e),
|
|
1685
1696
|
": ",
|
|
1686
1697
|
s(e)
|
|
1687
1698
|
]
|
|
@@ -1690,7 +1701,7 @@ function St({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1690
1701
|
]
|
|
1691
1702
|
});
|
|
1692
1703
|
}
|
|
1693
|
-
function
|
|
1704
|
+
function Tt(e, t, n, r, i) {
|
|
1694
1705
|
if (t.startsWith("$status.")) {
|
|
1695
1706
|
let e = t.slice(8), n = r?.find((t) => t.group_code === e);
|
|
1696
1707
|
return v(n?.status_name) || n?.status_code;
|
|
@@ -1699,16 +1710,16 @@ function Ct(e, t, n, r, i) {
|
|
|
1699
1710
|
let e = t.slice(10);
|
|
1700
1711
|
return i?.find((t) => t.property_code === e)?.value;
|
|
1701
1712
|
}
|
|
1702
|
-
return
|
|
1713
|
+
return Ce(e, n, t);
|
|
1703
1714
|
}
|
|
1704
|
-
function
|
|
1715
|
+
function Et(e, t) {
|
|
1705
1716
|
if (t.startsWith("$status.")) return t.slice(8);
|
|
1706
1717
|
if (t.startsWith("$property.")) return t.slice(10);
|
|
1707
1718
|
let n = e.fields.get(t);
|
|
1708
1719
|
return n ? _(n, t) : t;
|
|
1709
1720
|
}
|
|
1710
|
-
function
|
|
1711
|
-
let { run: O } = T(), k = _e("detail"), A = Le(), j = te(), pe = r(), me = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), he =
|
|
1721
|
+
function Dt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, dirty: l, isSaving: u, hasChildErrors: d, hasFieldErrors: f, canRestore: p, entity: m, screen: h, globalActions: g, entityCode: _, record: x, id: C, listRoute: ee, listRouteExists: ne, highlights: re, showBack: ie, onBack: ae, onCancelEdit: oe, onSave: se, onRestore: ce, isRestoring: le, refreshControl: D, isRealtimeEntity: ue, canManageTemplates: de }) {
|
|
1722
|
+
let { run: O } = T(), k = _e("detail"), A = Le(), j = te(), pe = r(), me = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), he = c(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), ve = b(he, m?.actions, g, x ?? {}, [], De(m, x ?? {})), ye = b(me, m?.actions, g, x ?? {}, [], De(m, x ?? {})), be = F(() => {
|
|
1712
1723
|
if (!m) return;
|
|
1713
1724
|
let e = C ? [C] : [];
|
|
1714
1725
|
return {
|
|
@@ -1734,8 +1745,8 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1734
1745
|
x,
|
|
1735
1746
|
pe,
|
|
1736
1747
|
A
|
|
1737
|
-
]),
|
|
1738
|
-
let n =
|
|
1748
|
+
]), Ce = (e, t) => {
|
|
1749
|
+
let n = Oe(e, t, { row: x ?? void 0 });
|
|
1739
1750
|
if (n === null) return;
|
|
1740
1751
|
let r = C ? [C] : [], i = e === "__delete" && ne ? ee : null;
|
|
1741
1752
|
return O({
|
|
@@ -1747,20 +1758,20 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1747
1758
|
fe.getState().kill(Se(location)), j(i, { replace: !0 });
|
|
1748
1759
|
} : void 0
|
|
1749
1760
|
});
|
|
1750
|
-
},
|
|
1751
|
-
layout:
|
|
1761
|
+
}, we = k.isVisible("show_actions") && !o && C && ve.length > 0 ? /* @__PURE__ */ R(Ke, {
|
|
1762
|
+
layout: ve,
|
|
1752
1763
|
row: x,
|
|
1753
|
-
onRun:
|
|
1764
|
+
onRun: Ce,
|
|
1754
1765
|
kind: "detail",
|
|
1755
1766
|
entityActions: m?.actions,
|
|
1756
1767
|
globalActions: g,
|
|
1757
1768
|
reservedRightWidth: 0,
|
|
1758
|
-
widgetContext:
|
|
1769
|
+
widgetContext: be,
|
|
1759
1770
|
constrain: !1
|
|
1760
|
-
}) : null,
|
|
1771
|
+
}) : null, Te = !o && C ? /* @__PURE__ */ R(xe, {
|
|
1761
1772
|
liveObject: D,
|
|
1762
1773
|
realtime: ue
|
|
1763
|
-
}) : null,
|
|
1774
|
+
}) : null, Ee = k.isVisible("show_actions") && !o && C && ye.length > 0 ? /* @__PURE__ */ z("div", {
|
|
1764
1775
|
style: {
|
|
1765
1776
|
display: "flex",
|
|
1766
1777
|
justifyContent: "flex-end",
|
|
@@ -1768,30 +1779,30 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1768
1779
|
gap: 8,
|
|
1769
1780
|
marginTop: 10
|
|
1770
1781
|
},
|
|
1771
|
-
children: [
|
|
1772
|
-
layout:
|
|
1782
|
+
children: [we ? null : Te, /* @__PURE__ */ R(Ke, {
|
|
1783
|
+
layout: ye,
|
|
1773
1784
|
row: x,
|
|
1774
|
-
onRun:
|
|
1785
|
+
onRun: Ce,
|
|
1775
1786
|
kind: "detail",
|
|
1776
1787
|
entityActions: m?.actions,
|
|
1777
1788
|
globalActions: g,
|
|
1778
1789
|
reservedRightWidth: 0,
|
|
1779
|
-
widgetContext:
|
|
1780
|
-
ariaLabel:
|
|
1790
|
+
widgetContext: be,
|
|
1791
|
+
ariaLabel: we ? "Detail toolbar actions" : "Page actions"
|
|
1781
1792
|
})]
|
|
1782
|
-
}) : null,
|
|
1793
|
+
}) : null, ke = k.isVisible("show_actions") && !o && C && _ ? /* @__PURE__ */ R(ge, {
|
|
1783
1794
|
entityCode: _,
|
|
1784
1795
|
scope: "detail",
|
|
1785
1796
|
objectIds: [C],
|
|
1786
1797
|
capability: m?.documents,
|
|
1787
1798
|
canManageTemplates: de
|
|
1788
|
-
}) : null,
|
|
1799
|
+
}) : null, Ae = s ? p ? /* @__PURE__ */ R(E, {
|
|
1789
1800
|
kind: "primary",
|
|
1790
1801
|
icon: R(le ? y : e.refresh, { size: 13 }),
|
|
1791
1802
|
onClick: ce,
|
|
1792
1803
|
disabled: le,
|
|
1793
1804
|
children: le ? "Restoring…" : "Restore"
|
|
1794
|
-
}) : null : a ? /* @__PURE__ */ z(
|
|
1805
|
+
}) : null : a ? /* @__PURE__ */ z(rt, { children: [/* @__PURE__ */ R(E, {
|
|
1795
1806
|
icon: /* @__PURE__ */ R(e.x, { size: 13 }),
|
|
1796
1807
|
onClick: oe,
|
|
1797
1808
|
disabled: u,
|
|
@@ -1803,11 +1814,11 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1803
1814
|
disabled: u || d || f,
|
|
1804
1815
|
title: d ? "Fix errors in child rows" : f ? "Fix the highlighted fields" : void 0,
|
|
1805
1816
|
children: u ? "Saving…" : "Save"
|
|
1806
|
-
})] }) : !o && C ?
|
|
1817
|
+
})] }) : !o && C ? we ? /* @__PURE__ */ z("span", {
|
|
1807
1818
|
style: { display: "contents" },
|
|
1808
|
-
children: [
|
|
1809
|
-
}) :
|
|
1810
|
-
return /* @__PURE__ */ z(
|
|
1819
|
+
children: [ke, we]
|
|
1820
|
+
}) : ke : null;
|
|
1821
|
+
return /* @__PURE__ */ z(rt, { children: [/* @__PURE__ */ R(ht, {
|
|
1811
1822
|
icon: m?.display.icon ? /* @__PURE__ */ R(t, {
|
|
1812
1823
|
name: m.display.icon,
|
|
1813
1824
|
size: 16
|
|
@@ -1816,14 +1827,14 @@ function Tt({ title: n, recordId: i, editing: a, isNew: o, isRecordDeleted: s, d
|
|
|
1816
1827
|
description: v(h?.display?.description) || v(m?.display?.description),
|
|
1817
1828
|
recordId: i,
|
|
1818
1829
|
highlights: re,
|
|
1819
|
-
identityControls: !s && !a && !o ?
|
|
1830
|
+
identityControls: !s && !a && !o ? Te : null,
|
|
1820
1831
|
mode: o ? "create" : a ? "edit" : "display",
|
|
1821
1832
|
dirty: l,
|
|
1822
1833
|
showBack: ie,
|
|
1823
1834
|
onBack: ae,
|
|
1824
|
-
right:
|
|
1835
|
+
right: Ae,
|
|
1825
1836
|
showTitle: k.isVisible("show_title")
|
|
1826
|
-
}),
|
|
1837
|
+
}), Ee] });
|
|
1827
1838
|
}
|
|
1828
1839
|
//#endregion
|
|
1829
|
-
export {
|
|
1840
|
+
export { q as SmartDetailPage };
|