@declarion/react 0.53.0 → 0.54.1
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-BQZTvZaU.js → DraggableChildrenTable-Djc7QDzR.js} +32 -32
- package/dist-lib/{Grid-B9Tiytbd.js → Grid-Bd2r0_4J.js} +45 -45
- package/dist-lib/{LayoutRenderer-D_v9OD_A.js → LayoutRenderer-V6nf9aa_.js} +716 -714
- package/dist-lib/{ListCardsBody-dRnXsQ7A.js → ListCardsBody-Cdsvu0Vs.js} +29 -29
- package/dist-lib/{MarkdownRenderer-BCyrsLrd.js → MarkdownRenderer-CZo5ZgM7.js} +1 -1
- package/dist-lib/{RefreshControl-CV8nGACW.js → RefreshControl-CJm3vz9p.js} +40 -40
- package/dist-lib/{SmartDetailPage.impl-DWprVNMb.js → SmartDetailPage.impl-DoIjCzjQ.js} +492 -492
- package/dist-lib/{SmartListPage.impl-BwWURGwa.js → SmartListPage.impl-DnM8e14t.js} +743 -742
- package/dist-lib/{SmartRecordListPage.impl-BKKBShAg.js → SmartRecordListPage.impl-BmHGYbD9.js} +128 -128
- package/dist-lib/{SortHeaderMenu-pgi4sxMs.js → SortHeaderMenu-CA53NerB.js} +1 -1
- package/dist-lib/{action-dispatch-DlHTYag7.js → action-dispatch-JcUrLFaW.js} +177 -177
- package/dist-lib/api/agents.d.ts +0 -1
- package/dist-lib/api/events.d.ts +13 -4
- package/dist-lib/{cardProjection-C7Orz841.js → cardProjection-Q2kwqv8V.js} +19 -19
- package/dist-lib/components/actions/ObjectActionBar.d.ts +1 -1
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -1
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -1
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -1
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +1 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +1 -1
- package/dist-lib/components/layout/TopBar.d.ts +1 -1
- package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
- package/dist-lib/components/list/PeekFieldCell.d.ts +1 -1
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -1
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
- package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
- package/dist-lib/components/pages/list/ListToolbar.d.ts +5 -3
- package/dist-lib/components/pages/list/columns.d.ts +1 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +1 -1
- package/dist-lib/components/pages/list/useListQuery.d.ts +1 -5
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +1 -1
- package/dist-lib/components/pages/list/useListViews.d.ts +1 -1
- package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
- package/dist-lib/{field-classification-EY8CFF3P.js → field-classification-ssZvtr8J.js} +268 -397
- package/dist-lib/{format-count-BHkaDr9V.js → format-count-DHuivNT7.js} +236 -236
- package/dist-lib/hooks/useEntityData.d.ts +7 -0
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
- package/dist-lib/hooks/useSSE.d.ts +0 -1
- package/dist-lib/index.js +1039 -1020
- package/dist-lib/lib/action-dispatch.d.ts +1 -1
- package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
- package/dist-lib/lib/realtime-reconcile.d.ts +0 -9
- package/dist-lib/lib/realtime-resync.d.ts +23 -0
- package/dist-lib/{peekDraftStore-1pIajluX.js → peekDraftStore-lm9ViVLA.js} +17 -17
- package/dist-lib/{registry-C5ug25M8.js → registry-DsQFhEAD.js} +511 -511
- package/dist-lib/stores/realtime.d.ts +86 -19
- package/dist-lib/testing.js +40 -40
- package/dist-lib/types/api.d.ts +8 -4
- package/dist-lib/types/schema.d.ts +6 -0
- package/dist-lib/{useCurrentScreen-BdnZq8vZ.js → useCurrentScreen-aHx9HH1m.js} +2473 -1960
- package/dist-lib/useListQuery-DZn2BAxY.js +96 -0
- package/dist-lib/{useProperties-Bhi9Wn5O.js → useProperties-CAqKmUKg.js} +25 -25
- package/dist-lib/{useTabSearchMirror-Dl5x0xKu.js → useTabSearchMirror-DYW9WoK7.js} +10 -10
- package/dist-lib/{value-Rp-5W3o8.js → value-CzKQPJOp.js} +4 -4
- package/package.json +10 -10
- package/dist-lib/useListQuery-BxgrPZIB.js +0 -90
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import { $ as n,
|
|
3
|
-
import { _ as
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as
|
|
6
|
-
import { D as
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { n as
|
|
10
|
-
import { a as
|
|
11
|
-
import { n as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { useLocation as
|
|
14
|
-
import { useQuery as z, useQueryClient as
|
|
15
|
-
import { Fragment as
|
|
2
|
+
import { $n as n, Bn as r, Br as i, Ct as a, Mr as o, Mt as s, Or as c, Qn as l, V as u, Vr as d, Vt as f, Xn as p, Xt as m, Z as h, Zn as g, at as ee, b as _, dn as v, en as y, er as b, et as te, fr as x, i as S, in as C, ir as w, mr as T, nr as E, or as ne, pr as re, q as D, rn as O, rt as k, st as ie, tr as ae, tt as A, un as oe, wt as se, y as j, zr as M, zt as ce } from "./useCurrentScreen-aHx9HH1m.js";
|
|
3
|
+
import { _ as N, m as P, r as le, s as ue, t as de } from "./RefreshControl-CJm3vz9p.js";
|
|
4
|
+
import { a as fe, f as pe, i as me } from "./registry-DsQFhEAD.js";
|
|
5
|
+
import { t as he } from "./RecordIdBadge-CGxPR-8q.js";
|
|
6
|
+
import { D as ge, M as _e, O as ve, T as ye, b as be, f as xe, g as Se, l as Ce, p as we, u as Te } from "./field-classification-ssZvtr8J.js";
|
|
7
|
+
import { c as Ee, f as De, h as Oe, m as ke, o as Ae, p as je, r as Me, t as Ne, u as Pe } from "./action-dispatch-JcUrLFaW.js";
|
|
8
|
+
import { a as Fe, c as Ie, s as Le, t as Re } from "./cardProjection-Q2kwqv8V.js";
|
|
9
|
+
import { n as ze, r as Be, t as Ve } from "./dataTableStyles-vwD1mVOP.js";
|
|
10
|
+
import { a as He, i as Ue, o as We, r as Ge, s as Ke } from "./peekDraftStore-lm9ViVLA.js";
|
|
11
|
+
import { n as qe, t as Je } from "./LayoutRenderer-V6nf9aa_.js";
|
|
12
|
+
import { Fragment as Ye, useCallback as F, useEffect as I, useMemo as L, useRef as Xe, useState as R } from "react";
|
|
13
|
+
import { useLocation as Ze, useParams as Qe, useSearchParams as $e } from "react-router";
|
|
14
|
+
import { useQuery as z, useQueryClient as et } from "@tanstack/react-query";
|
|
15
|
+
import { Fragment as tt, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/chrome/AssociationTabs.tsx
|
|
17
|
-
function
|
|
17
|
+
function nt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
18
18
|
let a = L(() => Object.entries(r), [r]), [o, s] = R(0);
|
|
19
19
|
if (a.length === 0) return null;
|
|
20
20
|
let [c, l] = a[o];
|
|
21
|
-
return /* @__PURE__ */ B(
|
|
21
|
+
return /* @__PURE__ */ B(pe, {
|
|
22
22
|
title: /* @__PURE__ */ B("div", {
|
|
23
23
|
style: {
|
|
24
24
|
display: "flex",
|
|
@@ -51,7 +51,7 @@ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
51
51
|
children: [n.display?.icon && /* @__PURE__ */ B(t, {
|
|
52
52
|
name: n.display.icon,
|
|
53
53
|
size: 13
|
|
54
|
-
}),
|
|
54
|
+
}), E(n.display?.name) || e]
|
|
55
55
|
}, e);
|
|
56
56
|
})
|
|
57
57
|
}),
|
|
@@ -66,95 +66,95 @@ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
|
|
|
66
66
|
})
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function H({ entityCode: t, recordId:
|
|
70
|
-
let s =
|
|
69
|
+
function H({ entityCode: t, recordId: r, assocKey: i, association: a, schema: o }) {
|
|
70
|
+
let s = ve(), c = te(), l = `${t}.${i}`, { data: u, isLoading: f } = z({
|
|
71
71
|
queryKey: [
|
|
72
72
|
"association",
|
|
73
73
|
l,
|
|
74
|
-
|
|
74
|
+
r
|
|
75
75
|
],
|
|
76
|
-
queryFn: () =>
|
|
77
|
-
}),
|
|
76
|
+
queryFn: () => C(l, [r])
|
|
77
|
+
}), p = u?.target_entity ?? a.target, m = o.entities[p], h = L(() => u?.ids ?? [], [u?.ids]), g = L(() => m?.fields.names().find((e) => m.fields.get(e)?.primary) ?? "id", [m]), ee = L(() => h.slice(0, 50), [h]), { data: _, isLoading: v } = z({
|
|
78
78
|
queryKey: [
|
|
79
79
|
"association-records",
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
p,
|
|
81
|
+
ee
|
|
82
82
|
],
|
|
83
|
-
queryFn: () =>
|
|
83
|
+
queryFn: () => O(p, {
|
|
84
84
|
per_page: 50,
|
|
85
85
|
filters: [{
|
|
86
|
-
field:
|
|
86
|
+
field: g,
|
|
87
87
|
op: "in",
|
|
88
|
-
value:
|
|
88
|
+
value: ee
|
|
89
89
|
}]
|
|
90
90
|
}),
|
|
91
|
-
enabled:
|
|
92
|
-
}),
|
|
93
|
-
let t =
|
|
91
|
+
enabled: ee.length > 0 && !!m
|
|
92
|
+
}), y = _?.data ?? [], b = _?.$refs, x = L(() => m ? m.fields.names().filter((e) => {
|
|
93
|
+
let t = m.fields.get(e);
|
|
94
94
|
return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
|
|
95
|
-
}).slice(0, 6) : [], [
|
|
96
|
-
let e =
|
|
95
|
+
}).slice(0, 6) : [], [m]), S = () => {
|
|
96
|
+
let e = D(o, p);
|
|
97
97
|
if (!e) return;
|
|
98
|
-
let t =
|
|
98
|
+
let t = E(a.display?.name) || i, n = new URLSearchParams();
|
|
99
99
|
n.set("filters", JSON.stringify([{
|
|
100
|
-
field:
|
|
100
|
+
field: g,
|
|
101
101
|
op: "in",
|
|
102
|
-
value:
|
|
102
|
+
value: h
|
|
103
103
|
}])), s(e.route, {
|
|
104
104
|
title: t,
|
|
105
105
|
icon: a.display?.icon || e.icon,
|
|
106
106
|
search: n.toString()
|
|
107
107
|
});
|
|
108
|
-
},
|
|
108
|
+
}, w = {
|
|
109
109
|
fontSize: 12.5,
|
|
110
110
|
color: "var(--text-3)",
|
|
111
111
|
padding: "14px 16px"
|
|
112
112
|
};
|
|
113
|
-
if (
|
|
114
|
-
style:
|
|
113
|
+
if (f || v) return /* @__PURE__ */ B("div", {
|
|
114
|
+
style: w,
|
|
115
115
|
children: "Loading…"
|
|
116
116
|
});
|
|
117
|
-
if (!
|
|
118
|
-
style:
|
|
117
|
+
if (!m) return /* @__PURE__ */ B("div", {
|
|
118
|
+
style: w,
|
|
119
119
|
children: "Entity not found."
|
|
120
120
|
});
|
|
121
|
-
if (
|
|
122
|
-
style:
|
|
121
|
+
if (h.length === 0) return /* @__PURE__ */ B("div", {
|
|
122
|
+
style: w,
|
|
123
123
|
children: "No related records."
|
|
124
124
|
});
|
|
125
|
-
let
|
|
125
|
+
let T = D(o, p);
|
|
126
126
|
return /* @__PURE__ */ V("div", {
|
|
127
127
|
style: { padding: "8px 0" },
|
|
128
128
|
children: [
|
|
129
129
|
/* @__PURE__ */ V("table", {
|
|
130
|
-
style:
|
|
131
|
-
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children:
|
|
132
|
-
style:
|
|
133
|
-
children: m
|
|
134
|
-
}, e)) }) }), /* @__PURE__ */ B("tbody", { children:
|
|
135
|
-
let n =
|
|
130
|
+
style: Be,
|
|
131
|
+
children: [/* @__PURE__ */ B("thead", { children: /* @__PURE__ */ B("tr", { children: x.map((e) => /* @__PURE__ */ B("th", {
|
|
132
|
+
style: ze,
|
|
133
|
+
children: n(m.fields.get(e), e, o.entities)
|
|
134
|
+
}, e)) }) }), /* @__PURE__ */ B("tbody", { children: y.map((e, t) => /* @__PURE__ */ B("tr", { children: x.map((t) => {
|
|
135
|
+
let n = m.fields.get(t);
|
|
136
136
|
return n ? /* @__PURE__ */ B("td", {
|
|
137
|
-
style:
|
|
138
|
-
children:
|
|
137
|
+
style: Ve,
|
|
138
|
+
children: A({
|
|
139
139
|
field: n,
|
|
140
140
|
fieldName: t,
|
|
141
141
|
value: e[t],
|
|
142
142
|
mode: "display",
|
|
143
143
|
record: e,
|
|
144
|
-
refs:
|
|
144
|
+
refs: b,
|
|
145
145
|
locale: c
|
|
146
146
|
})
|
|
147
147
|
}, t) : /* @__PURE__ */ B("td", {}, t);
|
|
148
148
|
}) }, t)) })]
|
|
149
149
|
}),
|
|
150
|
-
|
|
150
|
+
T && u && u.count > y.length && /* @__PURE__ */ B("div", {
|
|
151
151
|
style: {
|
|
152
152
|
padding: "10px 16px",
|
|
153
153
|
textAlign: "center"
|
|
154
154
|
},
|
|
155
|
-
children: /* @__PURE__ */ V(
|
|
155
|
+
children: /* @__PURE__ */ V(d, {
|
|
156
156
|
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
157
|
-
onClick:
|
|
157
|
+
onClick: S,
|
|
158
158
|
children: [
|
|
159
159
|
"View all ",
|
|
160
160
|
u.count,
|
|
@@ -162,15 +162,15 @@ function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: o
|
|
|
162
162
|
]
|
|
163
163
|
})
|
|
164
164
|
}),
|
|
165
|
-
|
|
165
|
+
T && y.length > 0 && u && u.count <= y.length && /* @__PURE__ */ B("div", {
|
|
166
166
|
style: {
|
|
167
167
|
padding: "10px 16px",
|
|
168
168
|
textAlign: "center"
|
|
169
169
|
},
|
|
170
|
-
children: /* @__PURE__ */ B(
|
|
170
|
+
children: /* @__PURE__ */ B(d, {
|
|
171
171
|
kind: "ghost",
|
|
172
172
|
icon: /* @__PURE__ */ B(e.external, { size: 12 }),
|
|
173
|
-
onClick:
|
|
173
|
+
onClick: S,
|
|
174
174
|
children: "Open in list view"
|
|
175
175
|
})
|
|
176
176
|
})
|
|
@@ -179,26 +179,26 @@ function H({ entityCode: t, recordId: n, assocKey: r, association: a, schema: o
|
|
|
179
179
|
}
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/components/pages/RecordDocumentsPanel.tsx
|
|
182
|
-
var
|
|
182
|
+
var rt = 4e3;
|
|
183
183
|
function U(e) {
|
|
184
|
-
return e?.some((e) => e.status === "pending") ?
|
|
184
|
+
return e?.some((e) => e.status === "pending") ? rt : !1;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
|
|
187
187
|
let { data: a, isLoading: o, error: s } = z({
|
|
188
188
|
queryKey: [
|
|
189
|
-
|
|
189
|
+
j,
|
|
190
190
|
t,
|
|
191
191
|
n
|
|
192
192
|
],
|
|
193
|
-
queryFn: async () => (await
|
|
193
|
+
queryFn: async () => (await y("document.object_links", {
|
|
194
194
|
entity: t,
|
|
195
195
|
object_id: n
|
|
196
196
|
})).result?.documents ?? [],
|
|
197
197
|
enabled: !!(t && n) && (!!r || !!i),
|
|
198
198
|
refetchInterval: (e) => U(e.state.data)
|
|
199
199
|
}), c = (a?.length ?? 0) > 0;
|
|
200
|
-
return !r && !c ? null : /* @__PURE__ */ V(
|
|
201
|
-
title: /* @__PURE__ */ B(
|
|
200
|
+
return !r && !c ? null : /* @__PURE__ */ V(pe, {
|
|
201
|
+
title: /* @__PURE__ */ B(at, {}),
|
|
202
202
|
collapsible: !1,
|
|
203
203
|
padding: "0",
|
|
204
204
|
children: [
|
|
@@ -228,7 +228,7 @@ function at({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
|
|
|
228
228
|
]
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function at() {
|
|
232
232
|
return /* @__PURE__ */ V("div", {
|
|
233
233
|
style: {
|
|
234
234
|
display: "flex",
|
|
@@ -244,50 +244,50 @@ function ot() {
|
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
function W({ entityCode: t, objectId: n, doc: r }) {
|
|
247
|
-
let i =
|
|
247
|
+
let i = et(), [o, s] = R(!1), [c, l] = R(!1), [u, f] = R(!1), [p, m] = R(!1), [h, g] = R(null), ee = E(r.title) || r.filename || r.template_code, _ = r.status === "ready" && r.download_url && !p;
|
|
248
248
|
async function v() {
|
|
249
|
-
|
|
249
|
+
s(!0), g(null);
|
|
250
250
|
try {
|
|
251
|
-
let e = (await
|
|
251
|
+
let e = (await y("document.download_format", {
|
|
252
252
|
generated_document_id: r.generated_document_id,
|
|
253
253
|
format: "pdf"
|
|
254
254
|
})).result;
|
|
255
|
-
e?.download_url && await
|
|
255
|
+
e?.download_url && await a(e.download_url, e.filename);
|
|
256
256
|
} catch (e) {
|
|
257
|
-
|
|
257
|
+
se(e) ? (m(!0), g("Artifact unavailable")) : g(e instanceof Error ? e.message : String(e));
|
|
258
258
|
} finally {
|
|
259
|
-
|
|
259
|
+
s(!1);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
async function b() {
|
|
263
263
|
if (r.download_url) {
|
|
264
|
-
|
|
264
|
+
l(!0), g(null);
|
|
265
265
|
try {
|
|
266
|
-
await
|
|
266
|
+
await a(r.download_url, r.filename);
|
|
267
267
|
} catch (e) {
|
|
268
|
-
|
|
268
|
+
se(e) ? (m(!0), g("Artifact unavailable")) : g(e instanceof Error ? e.message : String(e));
|
|
269
269
|
} finally {
|
|
270
|
-
|
|
270
|
+
l(!1);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
async function
|
|
275
|
-
|
|
274
|
+
async function te() {
|
|
275
|
+
f(!0), g(null);
|
|
276
276
|
try {
|
|
277
|
-
await
|
|
277
|
+
await y("document.generate", {
|
|
278
278
|
...r.input ?? {},
|
|
279
279
|
template_code: r.template_code,
|
|
280
280
|
template_source: r.template_source,
|
|
281
281
|
output_format: r.output_format
|
|
282
282
|
}), await i.invalidateQueries({ queryKey: [
|
|
283
|
-
|
|
283
|
+
j,
|
|
284
284
|
t,
|
|
285
285
|
n
|
|
286
286
|
] });
|
|
287
287
|
} catch (e) {
|
|
288
|
-
|
|
288
|
+
g(e instanceof Error ? e.message : String(e));
|
|
289
289
|
} finally {
|
|
290
|
-
|
|
290
|
+
f(!1);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
return /* @__PURE__ */ V("div", {
|
|
@@ -311,7 +311,7 @@ function W({ entityCode: t, objectId: n, doc: r }) {
|
|
|
311
311
|
textOverflow: "ellipsis",
|
|
312
312
|
whiteSpace: "nowrap"
|
|
313
313
|
},
|
|
314
|
-
children:
|
|
314
|
+
children: ee
|
|
315
315
|
}),
|
|
316
316
|
/* @__PURE__ */ V("div", {
|
|
317
317
|
style: {
|
|
@@ -324,7 +324,7 @@ function W({ entityCode: t, objectId: n, doc: r }) {
|
|
|
324
324
|
},
|
|
325
325
|
children: [
|
|
326
326
|
/* @__PURE__ */ B("span", { children: r.output_format.toUpperCase() }),
|
|
327
|
-
/* @__PURE__ */ B("span", { children:
|
|
327
|
+
/* @__PURE__ */ B("span", { children: p ? "artifact unavailable" : r.status }),
|
|
328
328
|
/* @__PURE__ */ B("span", { children: r.ready_at || r.created_at })
|
|
329
329
|
]
|
|
330
330
|
}),
|
|
@@ -336,13 +336,13 @@ function W({ entityCode: t, objectId: n, doc: r }) {
|
|
|
336
336
|
},
|
|
337
337
|
children: r.error_text
|
|
338
338
|
}),
|
|
339
|
-
|
|
339
|
+
h && /* @__PURE__ */ B("div", {
|
|
340
340
|
style: {
|
|
341
341
|
marginTop: 5,
|
|
342
342
|
color: "var(--danger)",
|
|
343
343
|
fontSize: 12
|
|
344
344
|
},
|
|
345
|
-
children:
|
|
345
|
+
children: h
|
|
346
346
|
})
|
|
347
347
|
]
|
|
348
348
|
}), _ ? /* @__PURE__ */ V("div", {
|
|
@@ -350,29 +350,29 @@ function W({ entityCode: t, objectId: n, doc: r }) {
|
|
|
350
350
|
display: "flex",
|
|
351
351
|
gap: 6
|
|
352
352
|
},
|
|
353
|
-
children: [/* @__PURE__ */ B(
|
|
353
|
+
children: [/* @__PURE__ */ B(d, {
|
|
354
354
|
kind: "ghost",
|
|
355
355
|
size: "sm",
|
|
356
|
-
icon: B(
|
|
356
|
+
icon: B(o ? e.loader : e.file, { size: 12 }),
|
|
357
357
|
onClick: v,
|
|
358
|
-
disabled:
|
|
358
|
+
disabled: o,
|
|
359
359
|
children: "PDF"
|
|
360
|
-
}), /* @__PURE__ */ B(
|
|
360
|
+
}), /* @__PURE__ */ B(d, {
|
|
361
361
|
kind: "default",
|
|
362
362
|
size: "sm",
|
|
363
|
-
icon: B(
|
|
363
|
+
icon: B(c ? e.loader : e.download, { size: 12 }),
|
|
364
364
|
onClick: b,
|
|
365
|
-
disabled:
|
|
365
|
+
disabled: c,
|
|
366
366
|
children: "Download"
|
|
367
367
|
})]
|
|
368
|
-
}) :
|
|
368
|
+
}) : p ? /* @__PURE__ */ B(d, {
|
|
369
369
|
kind: "ghost",
|
|
370
370
|
size: "sm",
|
|
371
|
-
icon: B(
|
|
372
|
-
onClick:
|
|
373
|
-
disabled:
|
|
371
|
+
icon: B(u ? e.loader : e.file, { size: 12 }),
|
|
372
|
+
onClick: te,
|
|
373
|
+
disabled: u,
|
|
374
374
|
children: "Regenerate"
|
|
375
|
-
}) : /* @__PURE__ */ B(
|
|
375
|
+
}) : /* @__PURE__ */ B(d, {
|
|
376
376
|
kind: "ghost",
|
|
377
377
|
size: "sm",
|
|
378
378
|
disabled: !0,
|
|
@@ -395,7 +395,7 @@ function G({ icon: e, text: t }) {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/components/detail-layout/ErrorSummary.tsx
|
|
398
|
-
function
|
|
398
|
+
function ot({ errors: t, onJump: n }) {
|
|
399
399
|
if (t.length === 0) return null;
|
|
400
400
|
let r = t.length !== 1;
|
|
401
401
|
return /* @__PURE__ */ V("div", {
|
|
@@ -482,7 +482,7 @@ function st({ errors: t, onJump: n }) {
|
|
|
482
482
|
}
|
|
483
483
|
//#endregion
|
|
484
484
|
//#region src/components/chrome/HighlightsStrip.tsx
|
|
485
|
-
function
|
|
485
|
+
function st({ items: e }) {
|
|
486
486
|
return e.length === 0 ? null : /* @__PURE__ */ B("div", {
|
|
487
487
|
style: {
|
|
488
488
|
display: "flex",
|
|
@@ -491,7 +491,7 @@ function ct({ items: e }) {
|
|
|
491
491
|
gap: "6px 0",
|
|
492
492
|
fontSize: 12
|
|
493
493
|
},
|
|
494
|
-
children: e.map((e, t) => /* @__PURE__ */ V(
|
|
494
|
+
children: e.map((e, t) => /* @__PURE__ */ V(Ye, { children: [t > 0 && /* @__PURE__ */ B("span", { style: {
|
|
495
495
|
width: 1,
|
|
496
496
|
height: 12,
|
|
497
497
|
background: "var(--divider)",
|
|
@@ -518,7 +518,7 @@ function ct({ items: e }) {
|
|
|
518
518
|
}
|
|
519
519
|
//#endregion
|
|
520
520
|
//#region src/components/detail-layout/DetailHighlights.tsx
|
|
521
|
-
function
|
|
521
|
+
function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
|
|
522
522
|
let c = e.highlights;
|
|
523
523
|
if (!c || c.length === 0) return null;
|
|
524
524
|
let l = [];
|
|
@@ -527,11 +527,11 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
527
527
|
if (c) {
|
|
528
528
|
let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
|
|
529
529
|
l.push({
|
|
530
|
-
label:
|
|
531
|
-
value: n ? /* @__PURE__ */ B(
|
|
530
|
+
label: E(c.name),
|
|
531
|
+
value: n ? /* @__PURE__ */ B(M, {
|
|
532
532
|
tone: n.color ?? "slate",
|
|
533
533
|
size: "xs",
|
|
534
|
-
children:
|
|
534
|
+
children: E(n.name)
|
|
535
535
|
}) : /* @__PURE__ */ B("span", {
|
|
536
536
|
style: { color: "var(--text-4)" },
|
|
537
537
|
children: "—"
|
|
@@ -540,7 +540,7 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
540
540
|
continue;
|
|
541
541
|
}
|
|
542
542
|
if (t.fields.get(e) || t.files?.get(e)) {
|
|
543
|
-
let a =
|
|
543
|
+
let a = je({
|
|
544
544
|
entity: t,
|
|
545
545
|
entityCode: n,
|
|
546
546
|
fieldName: e,
|
|
@@ -553,21 +553,21 @@ function lt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
|
|
|
553
553
|
locale: s
|
|
554
554
|
});
|
|
555
555
|
l.push({
|
|
556
|
-
label:
|
|
556
|
+
label: ke(t, e, o.entities),
|
|
557
557
|
value: a
|
|
558
558
|
});
|
|
559
559
|
continue;
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
return l.length === 0 ? null : /* @__PURE__ */ B(
|
|
562
|
+
return l.length === 0 ? null : /* @__PURE__ */ B(st, { items: l });
|
|
563
563
|
}
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region src/components/chrome/AuditMetaStrip.tsx
|
|
566
|
-
function
|
|
566
|
+
function lt(e) {
|
|
567
567
|
return e.by != null || e.at != null;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
let t = e.filter(
|
|
569
|
+
function ut({ lines: e }) {
|
|
570
|
+
let t = e.filter(lt);
|
|
571
571
|
return t.length === 0 ? null : /* @__PURE__ */ B("div", {
|
|
572
572
|
style: {
|
|
573
573
|
display: "flex",
|
|
@@ -625,13 +625,13 @@ function K({ line: e }) {
|
|
|
625
625
|
}
|
|
626
626
|
//#endregion
|
|
627
627
|
//#region src/components/detail-layout/DetailAuditStrip.tsx
|
|
628
|
-
function
|
|
628
|
+
function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
|
|
629
629
|
let s = e.audit;
|
|
630
630
|
if (s?.enabled === !1) return null;
|
|
631
631
|
let c = (e) => {
|
|
632
632
|
if (!e || !t.fields.get(e)) return;
|
|
633
633
|
let s = r[e];
|
|
634
|
-
if (s != null && s !== "") return
|
|
634
|
+
if (s != null && s !== "") return je({
|
|
635
635
|
entity: t,
|
|
636
636
|
entityCode: n,
|
|
637
637
|
fieldName: e,
|
|
@@ -644,7 +644,7 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
644
644
|
locale: o
|
|
645
645
|
});
|
|
646
646
|
}, l = s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
|
|
647
|
-
label:
|
|
647
|
+
label: E(e.label),
|
|
648
648
|
at: c(e.at),
|
|
649
649
|
by: c(e.by)
|
|
650
650
|
})) : [{
|
|
@@ -656,17 +656,17 @@ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
|
|
|
656
656
|
at: c("updated_at"),
|
|
657
657
|
by: c("updated_by")
|
|
658
658
|
}];
|
|
659
|
-
return /* @__PURE__ */ B(
|
|
659
|
+
return /* @__PURE__ */ B(ut, { lines: l });
|
|
660
660
|
}
|
|
661
661
|
//#endregion
|
|
662
662
|
//#region src/components/detail-layout/EvidenceBlock.tsx
|
|
663
|
-
function
|
|
663
|
+
function ft(e) {
|
|
664
664
|
if (!e) return;
|
|
665
665
|
let t = new Date(e);
|
|
666
666
|
if (!Number.isNaN(t.getTime())) return t.toLocaleString();
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
let t = e?.verdict ?? "unverified", n =
|
|
668
|
+
function pt({ evidence: e }) {
|
|
669
|
+
let t = e?.verdict ?? "unverified", n = ft(e?.verified_at), r = [];
|
|
670
670
|
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__ */ V("div", {
|
|
671
671
|
style: {
|
|
672
672
|
display: "flex",
|
|
@@ -689,11 +689,11 @@ function mt({ evidence: e }) {
|
|
|
689
689
|
},
|
|
690
690
|
children: "Evidence"
|
|
691
691
|
}),
|
|
692
|
-
/* @__PURE__ */ B(
|
|
693
|
-
tone:
|
|
692
|
+
/* @__PURE__ */ B(M, {
|
|
693
|
+
tone: He(t),
|
|
694
694
|
size: "sm",
|
|
695
695
|
dot: !0,
|
|
696
|
-
children:
|
|
696
|
+
children: Ue(t)
|
|
697
697
|
}),
|
|
698
698
|
r.length > 0 && /* @__PURE__ */ B("span", {
|
|
699
699
|
style: {
|
|
@@ -714,8 +714,8 @@ function mt({ evidence: e }) {
|
|
|
714
714
|
}
|
|
715
715
|
//#endregion
|
|
716
716
|
//#region src/components/chrome/RecordHeader.tsx
|
|
717
|
-
var
|
|
718
|
-
function q({ icon: t, avatarName: n, title: r, recordId:
|
|
717
|
+
var mt = 180, ht = 160;
|
|
718
|
+
function q({ icon: t, avatarName: n, title: r, recordId: a, description: o, highlights: s, mode: c, dirty: l = !1, showBack: u = !1, onBack: d, right: f, identityControls: p, showTitle: m = !0 }) {
|
|
719
719
|
return /* @__PURE__ */ V("div", {
|
|
720
720
|
style: {
|
|
721
721
|
display: "flex",
|
|
@@ -730,7 +730,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
730
730
|
paddingTop: 4,
|
|
731
731
|
flexShrink: 0
|
|
732
732
|
},
|
|
733
|
-
children: /* @__PURE__ */ B(
|
|
733
|
+
children: /* @__PURE__ */ B(i, {
|
|
734
734
|
size: 26,
|
|
735
735
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
736
736
|
title: "Back",
|
|
@@ -742,7 +742,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
742
742
|
flexShrink: 0,
|
|
743
743
|
paddingTop: 2
|
|
744
744
|
},
|
|
745
|
-
children: n ? /* @__PURE__ */ B(
|
|
745
|
+
children: n ? /* @__PURE__ */ B(N, {
|
|
746
746
|
name: n,
|
|
747
747
|
size: 32
|
|
748
748
|
}) : /* @__PURE__ */ B("span", {
|
|
@@ -759,7 +759,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
759
759
|
children: t
|
|
760
760
|
})
|
|
761
761
|
}),
|
|
762
|
-
m && /* @__PURE__ */ V(
|
|
762
|
+
m && /* @__PURE__ */ V(tt, { children: [
|
|
763
763
|
/* @__PURE__ */ B("h1", {
|
|
764
764
|
style: {
|
|
765
765
|
margin: 0,
|
|
@@ -768,7 +768,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
768
768
|
letterSpacing: 0,
|
|
769
769
|
lineHeight: "var(--page-title-line-height, var(--page-title-line-height-detail))",
|
|
770
770
|
color: "var(--text)",
|
|
771
|
-
minWidth:
|
|
771
|
+
minWidth: ht,
|
|
772
772
|
overflow: "hidden",
|
|
773
773
|
textOverflow: "ellipsis",
|
|
774
774
|
whiteSpace: "nowrap",
|
|
@@ -780,13 +780,13 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
780
780
|
},
|
|
781
781
|
children: r
|
|
782
782
|
}),
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
label:
|
|
783
|
+
a && /* @__PURE__ */ B(he, { value: a }),
|
|
784
|
+
o && /* @__PURE__ */ B(P, {
|
|
785
|
+
label: o,
|
|
786
786
|
"data-testid": "detail-description-info"
|
|
787
787
|
}),
|
|
788
788
|
p,
|
|
789
|
-
|
|
789
|
+
c === "edit" && l && /* @__PURE__ */ V("span", {
|
|
790
790
|
style: {
|
|
791
791
|
display: "inline-flex",
|
|
792
792
|
alignItems: "center",
|
|
@@ -801,7 +801,7 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
801
801
|
background: "var(--warn)"
|
|
802
802
|
} }), "Unsaved"]
|
|
803
803
|
}),
|
|
804
|
-
|
|
804
|
+
c === "create" && /* @__PURE__ */ B(M, {
|
|
805
805
|
tone: "violet",
|
|
806
806
|
size: "xs",
|
|
807
807
|
dot: !0,
|
|
@@ -819,25 +819,25 @@ function q({ icon: t, avatarName: n, title: r, recordId: i, description: a, high
|
|
|
819
819
|
flexShrink: 1,
|
|
820
820
|
flexBasis: "auto",
|
|
821
821
|
marginLeft: "auto",
|
|
822
|
-
minWidth:
|
|
822
|
+
minWidth: mt,
|
|
823
823
|
flexWrap: "wrap",
|
|
824
824
|
justifyContent: "flex-end"
|
|
825
825
|
},
|
|
826
826
|
children: f
|
|
827
827
|
}),
|
|
828
|
-
|
|
828
|
+
s && c === "display" && /* @__PURE__ */ B("div", {
|
|
829
829
|
style: {
|
|
830
830
|
flexBasis: "100%",
|
|
831
831
|
minWidth: 0
|
|
832
832
|
},
|
|
833
|
-
children:
|
|
833
|
+
children: s
|
|
834
834
|
})
|
|
835
835
|
]
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
//#endregion
|
|
839
839
|
//#region src/lib/children-validation.ts
|
|
840
|
-
function
|
|
840
|
+
function gt(e, t, n) {
|
|
841
841
|
let r = [];
|
|
842
842
|
for (let [i, a] of e.fields) {
|
|
843
843
|
if (!a.required || a.auto || n && a.primary || e.tenant_key && i === e.tenant_key || a.default !== void 0 && a.default !== null) continue;
|
|
@@ -846,17 +846,17 @@ function _t(e, t, n) {
|
|
|
846
846
|
}
|
|
847
847
|
return r;
|
|
848
848
|
}
|
|
849
|
-
var
|
|
850
|
-
function
|
|
849
|
+
var _t = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
850
|
+
function vt(e, t) {
|
|
851
851
|
let n = [];
|
|
852
852
|
for (let [r, i] of e.fields) {
|
|
853
853
|
if (i.type !== "email") continue;
|
|
854
854
|
let e = t[r];
|
|
855
|
-
typeof e == "string" && e !== "" && !
|
|
855
|
+
typeof e == "string" && e !== "" && !_t.test(e) && n.push(r);
|
|
856
856
|
}
|
|
857
857
|
return n;
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function yt(e, t) {
|
|
860
860
|
let n = /* @__PURE__ */ new Set();
|
|
861
861
|
for (let r of Object.values(t.entities)) if (r.children) {
|
|
862
862
|
for (let t of r.children) if (t.entity === e && t.foreign_key) {
|
|
@@ -866,13 +866,13 @@ function bt(e, t) {
|
|
|
866
866
|
}
|
|
867
867
|
return n;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function bt(e, t) {
|
|
870
870
|
if (!e || !t) return {};
|
|
871
871
|
let n = {};
|
|
872
872
|
for (let [r, i] of Object.entries(e)) {
|
|
873
873
|
let e = t.entities[r];
|
|
874
874
|
if (!e) continue;
|
|
875
|
-
let a =
|
|
875
|
+
let a = yt(r, t), o = [];
|
|
876
876
|
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);
|
|
877
877
|
if (o.length !== 0) for (let e of i) {
|
|
878
878
|
if (e._deleted) continue;
|
|
@@ -888,54 +888,54 @@ function xt(e, t) {
|
|
|
888
888
|
}
|
|
889
889
|
//#endregion
|
|
890
890
|
//#region src/components/pages/SmartDetailPage.impl.tsx
|
|
891
|
-
var
|
|
892
|
-
function
|
|
891
|
+
var xt = () => {};
|
|
892
|
+
function St(e, t) {
|
|
893
893
|
return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Ct(e, t) {
|
|
896
896
|
if (e) {
|
|
897
|
-
let n =
|
|
897
|
+
let n = l(e, t), r = ne(n);
|
|
898
898
|
if (r.replace(/^\|+|\|+$/g, "")) return r;
|
|
899
899
|
}
|
|
900
|
-
return t.id == null ? crypto.randomUUID() :
|
|
900
|
+
return t.id == null ? crypto.randomUUID() : T(t.id);
|
|
901
901
|
}
|
|
902
|
-
function
|
|
903
|
-
return /* @__PURE__ */ B(
|
|
902
|
+
function wt({ screenCode: e }) {
|
|
903
|
+
return /* @__PURE__ */ B(k, { children: /* @__PURE__ */ B(Tt, { screenCode: e }) });
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
let { id:
|
|
907
|
-
if (!
|
|
908
|
-
let e =
|
|
905
|
+
function Tt({ screenCode: t }) {
|
|
906
|
+
let { id: a } = Qe(), c = s(), [u, d] = $e(), { data: m } = oe(), h = v((e) => e.user), y = ee(), S = o(), C = m?.screens[t], T = C?.entity ? m?.entities[C.entity] : void 0, D = C?.entity, O = g(T, "create"), k = g(T, "update"), A = g(T, "restore"), se = (() => {
|
|
907
|
+
if (!T || !T.singleton || !T.prefilter) return;
|
|
908
|
+
let e = ae(T);
|
|
909
909
|
if (e.length !== 1) return;
|
|
910
|
-
let t =
|
|
911
|
-
if (t === "$caller.user_id") return
|
|
912
|
-
if (t === "$caller.tenant_id") return
|
|
913
|
-
})(),
|
|
914
|
-
if (!
|
|
915
|
-
if (!
|
|
916
|
-
let e =
|
|
917
|
-
if (e.length === 1) return { [e[0]]:
|
|
918
|
-
let t =
|
|
910
|
+
let t = T.prefilter[e[0]];
|
|
911
|
+
if (t === "$caller.user_id") return h?.id;
|
|
912
|
+
if (t === "$caller.tenant_id") return h?.tenant?.id;
|
|
913
|
+
})(), j = se !== void 0, M = j ? se : a, N = !j && M === "new", P = L(() => {
|
|
914
|
+
if (!M || N) return;
|
|
915
|
+
if (!T) return M;
|
|
916
|
+
let e = ae(T);
|
|
917
|
+
if (e.length === 1) return { [e[0]]: M };
|
|
918
|
+
let t = w(M, e.length);
|
|
919
919
|
if (!t) return;
|
|
920
920
|
let n = {};
|
|
921
921
|
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
922
922
|
return n;
|
|
923
923
|
}, [
|
|
924
|
-
j,
|
|
925
924
|
M,
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
925
|
+
N,
|
|
926
|
+
T
|
|
927
|
+
]), ue = L(() => {
|
|
928
|
+
if (P) return typeof P == "string" ? P : ne(P);
|
|
929
|
+
}, [P]), de = fe(D, P), { data: pe, isLoading: he, error: ve } = de, Ee = _(T?.realtime, D ?? ""), ke = D ? Ee : !1;
|
|
930
|
+
Se(me(D, P), !N);
|
|
931
|
+
let Ae = Te(D ?? ""), je = we(D ?? ""), Ne = xe(D ?? ""), ze = Object.keys(T?.status_groups ?? {}).length > 0, Be = pe?.data, Ve = Be?.$statuses, He = Be?.$properties, Ue = u.get("edit") === "true", [Ke, Ye] = R(N || Ue), [z, et] = R({}), [H, rt] = R({}), [U, at] = R({}), [W, G] = R(void 0), [st, lt] = R(!1), [ut, K] = R(void 0), [ft, mt] = R(!1), ht = N ? O : k, q = Ke && ht, _t = f();
|
|
932
|
+
ce(q && !N, _t.enabled);
|
|
933
|
+
let [yt, wt] = R(() => {
|
|
934
|
+
let e = parseInt(C?.sidebar_width || "380", 10);
|
|
935
935
|
return isNaN(e) ? 380 : e;
|
|
936
|
-
}),
|
|
936
|
+
}), Tt = Xe(null), J = Xe(null), Dt = F((e) => {
|
|
937
937
|
e.preventDefault();
|
|
938
|
-
let t =
|
|
938
|
+
let t = Tt.current;
|
|
939
939
|
if (!t) return;
|
|
940
940
|
let n = t.offsetWidth;
|
|
941
941
|
J.current = {
|
|
@@ -947,108 +947,108 @@ function Et({ screenCode: t }) {
|
|
|
947
947
|
let n = J.current.startX - e.clientX, r = Math.max(280, Math.min(800, J.current.startW + n));
|
|
948
948
|
t.style.width = `${r}px`;
|
|
949
949
|
}, i = () => {
|
|
950
|
-
J.current && t &&
|
|
950
|
+
J.current && t && wt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
951
951
|
};
|
|
952
952
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
953
|
-
}, []), Y =
|
|
953
|
+
}, []), Y = pe?.data, X = Me(T, C, Y ?? {});
|
|
954
954
|
I(() => {
|
|
955
955
|
let e = parseInt(X?.sidebar_width || "380", 10);
|
|
956
|
-
|
|
956
|
+
wt(Number.isNaN(e) ? 380 : e);
|
|
957
957
|
}, [X?.sidebar_width]);
|
|
958
|
-
let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0,
|
|
958
|
+
let Z = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, kt = Y?.$refs, At = Xe(Z);
|
|
959
959
|
I(() => {
|
|
960
960
|
if (!Z) return;
|
|
961
|
-
let e =
|
|
962
|
-
|
|
963
|
-
}, [
|
|
964
|
-
let
|
|
965
|
-
|
|
966
|
-
let
|
|
961
|
+
let e = At.current;
|
|
962
|
+
At.current = Z, e && e !== Z && Ke && lt(!0);
|
|
963
|
+
}, [Ke, Z]);
|
|
964
|
+
let jt = !!T?.soft_delete && Y != null && Y[T.soft_delete] != null, Mt = Ze(), Nt = Xe(null);
|
|
965
|
+
le({ scrollElementRef: Nt });
|
|
966
|
+
let Pt = !N && ve instanceof r && ve.status === 404, Ft = N && !p(T), It = Xe(null);
|
|
967
967
|
I(() => {
|
|
968
|
-
if (!
|
|
969
|
-
let e =
|
|
970
|
-
|
|
971
|
-
}, [
|
|
972
|
-
let { openTab:
|
|
968
|
+
if (!Pt) return;
|
|
969
|
+
let e = be(Mt);
|
|
970
|
+
It.current !== e && (It.current = e, ge.getState().kill(e));
|
|
971
|
+
}, [Pt, Mt]);
|
|
972
|
+
let { openTab: Lt, updateTabTitle: Rt, findTabByPathname: zt } = _e();
|
|
973
973
|
I(() => {
|
|
974
|
-
if (!
|
|
975
|
-
let e =
|
|
976
|
-
|
|
974
|
+
if (!T || j || _t.enabled) return;
|
|
975
|
+
let e = Mt.pathname, t = E(X?.display?.name) || E(T.display.name), n = X?.display?.icon || T.display.icon;
|
|
976
|
+
zt(e) || Lt({
|
|
977
977
|
pathname: e,
|
|
978
978
|
search: "",
|
|
979
|
-
title:
|
|
979
|
+
title: N ? `New ${t}` : t,
|
|
980
980
|
icon: n,
|
|
981
981
|
closable: !0
|
|
982
982
|
});
|
|
983
983
|
}, [
|
|
984
|
-
|
|
984
|
+
Mt.pathname,
|
|
985
985
|
X?.display?.name?.en,
|
|
986
|
-
|
|
986
|
+
T?.display.name?.en,
|
|
987
987
|
X?.display?.icon,
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
988
|
+
T?.display.icon,
|
|
989
|
+
N,
|
|
990
|
+
j,
|
|
991
|
+
_t.enabled
|
|
992
992
|
]), I(() => {
|
|
993
|
-
if (!Y || !
|
|
994
|
-
let e =
|
|
993
|
+
if (!Y || !T || j || _t.enabled) return;
|
|
994
|
+
let e = zt(Mt.pathname);
|
|
995
995
|
if (e) {
|
|
996
|
-
let t =
|
|
997
|
-
|
|
996
|
+
let t = E(X?.display?.name) || E(T.display.name), n = b(Y, T), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
997
|
+
Rt(e.id, r);
|
|
998
998
|
}
|
|
999
999
|
}, [
|
|
1000
1000
|
Y,
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1001
|
+
T?.display.name?.en,
|
|
1002
|
+
T?.display.display_field,
|
|
1003
|
+
Mt.pathname,
|
|
1004
|
+
j,
|
|
1005
|
+
_t.enabled
|
|
1006
1006
|
]);
|
|
1007
|
-
let
|
|
1008
|
-
if (!
|
|
1007
|
+
let Bt = L(() => {
|
|
1008
|
+
if (!T || !ht) return /* @__PURE__ */ new Set();
|
|
1009
1009
|
let e = /* @__PURE__ */ new Set();
|
|
1010
|
-
for (let [t, n] of
|
|
1011
|
-
for (let [t] of
|
|
1010
|
+
for (let [t, n] of T.fields) !n.auto && !n.primary && e.add(t);
|
|
1011
|
+
for (let [t] of T.files ?? []) e.add(t);
|
|
1012
1012
|
return e;
|
|
1013
|
-
}, [
|
|
1013
|
+
}, [T, ht]);
|
|
1014
1014
|
I(() => {
|
|
1015
|
-
if (!(!
|
|
1016
|
-
if (
|
|
1017
|
-
let e =
|
|
1015
|
+
if (!(!Ue || !Y || !T || !k)) {
|
|
1016
|
+
if (Ke || Ye(!0), Object.keys(z).length === 0) {
|
|
1017
|
+
let e = M ? Ge(M) : null;
|
|
1018
1018
|
if (e) {
|
|
1019
|
-
let t =
|
|
1020
|
-
entity:
|
|
1019
|
+
let t = Le({
|
|
1020
|
+
entity: T,
|
|
1021
1021
|
formData: e,
|
|
1022
1022
|
record: void 0,
|
|
1023
1023
|
isNew: !0
|
|
1024
1024
|
});
|
|
1025
|
-
|
|
1026
|
-
|
|
1025
|
+
Ie(t).forEach((e) => {
|
|
1026
|
+
y.registerDraft({
|
|
1027
1027
|
fileId: e,
|
|
1028
1028
|
discard: () => ie(e)
|
|
1029
1029
|
});
|
|
1030
1030
|
});
|
|
1031
1031
|
}
|
|
1032
1032
|
let t = {};
|
|
1033
|
-
|
|
1033
|
+
Bt.forEach((n) => {
|
|
1034
1034
|
let r = e ? e[n] : void 0;
|
|
1035
1035
|
if (r !== void 0) {
|
|
1036
1036
|
t[n] = r;
|
|
1037
1037
|
return;
|
|
1038
1038
|
}
|
|
1039
|
-
let i =
|
|
1040
|
-
t[n] =
|
|
1041
|
-
}),
|
|
1039
|
+
let i = De(T, Y, n);
|
|
1040
|
+
t[n] = Pe(T, n) ? i ?? null : i ?? "";
|
|
1041
|
+
}), et(t);
|
|
1042
1042
|
}
|
|
1043
|
-
if (
|
|
1043
|
+
if (T.children !== void 0 && T.children.length > 0 && W === void 0) {
|
|
1044
1044
|
let e = Y.$children;
|
|
1045
1045
|
if (e && Object.keys(e).length > 0) {
|
|
1046
1046
|
let t = {};
|
|
1047
1047
|
for (let [n, r] of Object.entries(e)) {
|
|
1048
|
-
let e =
|
|
1048
|
+
let e = m?.entities[n];
|
|
1049
1049
|
t[n] = r.map((t) => ({
|
|
1050
1050
|
...t,
|
|
1051
|
-
_key:
|
|
1051
|
+
_key: Ct(e, t)
|
|
1052
1052
|
}));
|
|
1053
1053
|
}
|
|
1054
1054
|
G(t), K(e);
|
|
@@ -1060,32 +1060,32 @@ function Et({ screenCode: t }) {
|
|
|
1060
1060
|
}, { replace: !0 });
|
|
1061
1061
|
}
|
|
1062
1062
|
}, [
|
|
1063
|
-
|
|
1063
|
+
Ue,
|
|
1064
1064
|
Y,
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1065
|
+
Bt,
|
|
1066
|
+
k,
|
|
1067
|
+
T,
|
|
1068
1068
|
W,
|
|
1069
|
-
|
|
1069
|
+
m
|
|
1070
1070
|
]), I(() => {
|
|
1071
|
-
!
|
|
1071
|
+
!N || !O || !T?.children || T.children.length === 0 || W === void 0 && (G({}), K({}));
|
|
1072
1072
|
}, [
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1073
|
+
N,
|
|
1074
|
+
O,
|
|
1075
|
+
T?.children
|
|
1076
1076
|
]);
|
|
1077
|
-
let
|
|
1078
|
-
if (await
|
|
1077
|
+
let Vt = F(async () => {
|
|
1078
|
+
if (await y.flushAllDrafts(), N) {
|
|
1079
1079
|
let e = X?.route?.replace("/:id", "") ?? "/";
|
|
1080
|
-
|
|
1081
|
-
} else
|
|
1080
|
+
c(e);
|
|
1081
|
+
} else Ye(!1), et({}), rt({}), at({}), G(void 0), K(void 0), mt(!1);
|
|
1082
1082
|
}, [
|
|
1083
|
-
|
|
1084
|
-
|
|
1083
|
+
y,
|
|
1084
|
+
N,
|
|
1085
1085
|
X,
|
|
1086
|
-
|
|
1087
|
-
]),
|
|
1088
|
-
|
|
1086
|
+
c
|
|
1087
|
+
]), Ht = F((e, t) => {
|
|
1088
|
+
et((n) => ({
|
|
1089
1089
|
...n,
|
|
1090
1090
|
[e]: t
|
|
1091
1091
|
}));
|
|
@@ -1093,46 +1093,46 @@ function Et({ screenCode: t }) {
|
|
|
1093
1093
|
if (!X?.route) return "/";
|
|
1094
1094
|
let e = X.route.split("/");
|
|
1095
1095
|
return e.pop(), e.join("/") || "/";
|
|
1096
|
-
}, [X]),
|
|
1097
|
-
if (!
|
|
1098
|
-
|
|
1096
|
+
}, [X]), Ut = L(() => !m?.screens || !Q || Q === "/" ? !1 : Object.values(m.screens).some((e) => e.route === Q), [m, Q]), Wt = F(() => {
|
|
1097
|
+
if (!Ut) {
|
|
1098
|
+
c("/");
|
|
1099
1099
|
return;
|
|
1100
1100
|
}
|
|
1101
|
-
let e =
|
|
1102
|
-
|
|
1101
|
+
let e = zt(Q)?.search ?? "";
|
|
1102
|
+
c(e ? `${Q}?${e}` : Q);
|
|
1103
1103
|
}, [
|
|
1104
|
-
|
|
1104
|
+
Ut,
|
|
1105
1105
|
Q,
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
]),
|
|
1109
|
-
if (!
|
|
1106
|
+
zt,
|
|
1107
|
+
c
|
|
1108
|
+
]), Gt = Ce({ fallback: Wt }), Kt = !j && (Gt.hasOriginBack || Gt.allowFallbackBack && !!Ut), qt = te(), Jt = L(() => {
|
|
1109
|
+
if (!T) return {};
|
|
1110
1110
|
let e = {};
|
|
1111
|
-
for (let t of
|
|
1112
|
-
for (let t of
|
|
1111
|
+
for (let t of gt(T, z, N)) Bt.has(t) && (e[t] = "Required");
|
|
1112
|
+
for (let t of vt(T, z)) Bt.has(t) && (e[t] = "Invalid email address");
|
|
1113
1113
|
return e;
|
|
1114
1114
|
}, [
|
|
1115
|
-
|
|
1115
|
+
T,
|
|
1116
1116
|
z,
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
]),
|
|
1120
|
-
if (!
|
|
1121
|
-
let e = {}, t =
|
|
1122
|
-
entity:
|
|
1117
|
+
N,
|
|
1118
|
+
Bt
|
|
1119
|
+
]), Yt = Object.keys(Jt).length > 0, Xt = F(() => {
|
|
1120
|
+
if (!D || !T || N && !O || !N && !k || (mt(!0), Yt)) return;
|
|
1121
|
+
let e = {}, t = Le({
|
|
1122
|
+
entity: T,
|
|
1123
1123
|
formData: z,
|
|
1124
1124
|
record: Y,
|
|
1125
|
-
isNew:
|
|
1126
|
-
}), n =
|
|
1127
|
-
if (
|
|
1128
|
-
if (
|
|
1129
|
-
let r =
|
|
1125
|
+
isNew: N
|
|
1126
|
+
}), n = Ie(t);
|
|
1127
|
+
if (N) for (let [t, n] of Object.entries(z)) {
|
|
1128
|
+
if (T.files?.has(t)) continue;
|
|
1129
|
+
let r = Oe(T, t, n);
|
|
1130
1130
|
r !== "" && r != null && (e[t] = r);
|
|
1131
1131
|
}
|
|
1132
1132
|
else {
|
|
1133
1133
|
for (let [t, n] of Object.entries(z)) {
|
|
1134
|
-
if (
|
|
1135
|
-
let r = Y ?
|
|
1134
|
+
if (T.files?.has(t)) continue;
|
|
1135
|
+
let r = Y ? De(T, Y, t) : void 0, i = Oe(T, t, n), a = Oe(T, t, r);
|
|
1136
1136
|
(i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
|
|
1137
1137
|
}
|
|
1138
1138
|
Z && (e.$row_version = Z);
|
|
@@ -1149,69 +1149,69 @@ function Et({ screenCode: t }) {
|
|
|
1149
1149
|
let r = n.filter((e) => !e._deleted).map((e) => {
|
|
1150
1150
|
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
1151
1151
|
return i;
|
|
1152
|
-
}), i =
|
|
1153
|
-
(
|
|
1152
|
+
}), i = ut?.[e] ?? [];
|
|
1153
|
+
(N || !St(r, i)) && (t[e] = r);
|
|
1154
1154
|
}
|
|
1155
1155
|
Object.keys(t).length > 0 && (e.$children = t);
|
|
1156
1156
|
}
|
|
1157
|
-
if (!
|
|
1158
|
-
|
|
1157
|
+
if (!N && Object.keys(e).length === 0) {
|
|
1158
|
+
Ye(!1), rt({}), at({}), G(void 0), K(void 0), mt(!1);
|
|
1159
1159
|
return;
|
|
1160
1160
|
}
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1161
|
+
let i = () => {
|
|
1162
|
+
Ye(!1), lt(!1), mt(!1), rt({}), at({}), G(void 0), K(void 0);
|
|
1163
1163
|
};
|
|
1164
|
-
|
|
1165
|
-
n.forEach((e) =>
|
|
1166
|
-
let t = e.data,
|
|
1167
|
-
|
|
1168
|
-
} }) :
|
|
1169
|
-
pkValues:
|
|
1164
|
+
N ? Ae.mutate(e, { onSuccess: (e) => {
|
|
1165
|
+
n.forEach((e) => y.markCommitted(e));
|
|
1166
|
+
let t = e.data, r = T ? l(T, t) : {}, a = ne(r);
|
|
1167
|
+
c(a ? `${Q}/${encodeURIComponent(a)}` : Q, { replace: !0 }), i();
|
|
1168
|
+
} }) : P && je.mutate({
|
|
1169
|
+
pkValues: P,
|
|
1170
1170
|
data: e
|
|
1171
1171
|
}, {
|
|
1172
1172
|
onSuccess: () => {
|
|
1173
|
-
n.forEach((e) =>
|
|
1173
|
+
n.forEach((e) => y.markCommitted(e)), i();
|
|
1174
1174
|
},
|
|
1175
1175
|
onError: (e) => {
|
|
1176
|
-
e instanceof
|
|
1176
|
+
e instanceof r && e.code === "entity.stale_object" && lt(!0);
|
|
1177
1177
|
}
|
|
1178
1178
|
});
|
|
1179
1179
|
}, [
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1180
|
+
y,
|
|
1181
|
+
N,
|
|
1182
|
+
O,
|
|
1183
|
+
k,
|
|
1183
1184
|
D,
|
|
1184
|
-
w,
|
|
1185
1185
|
z,
|
|
1186
|
-
|
|
1186
|
+
Yt,
|
|
1187
1187
|
H,
|
|
1188
1188
|
U,
|
|
1189
1189
|
W,
|
|
1190
|
-
|
|
1190
|
+
ut,
|
|
1191
|
+
Ae,
|
|
1191
1192
|
je,
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
i,
|
|
1193
|
+
T,
|
|
1194
|
+
c,
|
|
1195
1195
|
Q,
|
|
1196
1196
|
Y,
|
|
1197
1197
|
Z,
|
|
1198
|
-
|
|
1199
|
-
]),
|
|
1198
|
+
P
|
|
1199
|
+
]), Zt = F((e, t) => {
|
|
1200
1200
|
G((n) => ({
|
|
1201
1201
|
...n ?? {},
|
|
1202
1202
|
[e]: t
|
|
1203
1203
|
}));
|
|
1204
|
-
}, []),
|
|
1205
|
-
!
|
|
1204
|
+
}, []), Qt = F(() => {
|
|
1205
|
+
!P || N || !A || Ne.mutate(P);
|
|
1206
1206
|
}, [
|
|
1207
|
+
P,
|
|
1207
1208
|
N,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
if (!
|
|
1213
|
-
if (
|
|
1214
|
-
if (It) return /* @__PURE__ */ V("div", {
|
|
1209
|
+
A,
|
|
1210
|
+
Ne
|
|
1211
|
+
]), $t = L(() => bt(W, m), [W, m]), en = Object.keys($t).length > 0;
|
|
1212
|
+
if (!X || !T) return null;
|
|
1213
|
+
if (!N && he) return /* @__PURE__ */ B(Fe, {});
|
|
1214
|
+
if (Ft) return /* @__PURE__ */ V("div", {
|
|
1215
1215
|
style: { padding: 24 },
|
|
1216
1216
|
children: [/* @__PURE__ */ V("div", {
|
|
1217
1217
|
style: {
|
|
@@ -1220,9 +1220,9 @@ function Et({ screenCode: t }) {
|
|
|
1220
1220
|
gap: 8,
|
|
1221
1221
|
marginBottom: 8
|
|
1222
1222
|
},
|
|
1223
|
-
children: [
|
|
1223
|
+
children: [Kt && /* @__PURE__ */ B(i, {
|
|
1224
1224
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1225
|
-
onClick:
|
|
1225
|
+
onClick: Gt.goBack,
|
|
1226
1226
|
title: "Back"
|
|
1227
1227
|
}), /* @__PURE__ */ B("h1", {
|
|
1228
1228
|
style: {
|
|
@@ -1238,7 +1238,7 @@ function Et({ screenCode: t }) {
|
|
|
1238
1238
|
children: "This record type is not created from a form."
|
|
1239
1239
|
})]
|
|
1240
1240
|
});
|
|
1241
|
-
if (!
|
|
1241
|
+
if (!N && !Y || Pt) return /* @__PURE__ */ V("div", {
|
|
1242
1242
|
style: { padding: 24 },
|
|
1243
1243
|
children: [/* @__PURE__ */ V("div", {
|
|
1244
1244
|
style: {
|
|
@@ -1247,9 +1247,9 @@ function Et({ screenCode: t }) {
|
|
|
1247
1247
|
gap: 8,
|
|
1248
1248
|
marginBottom: 8
|
|
1249
1249
|
},
|
|
1250
|
-
children: [
|
|
1250
|
+
children: [Kt && /* @__PURE__ */ B(i, {
|
|
1251
1251
|
icon: /* @__PURE__ */ B(e.back, { size: 14 }),
|
|
1252
|
-
onClick:
|
|
1252
|
+
onClick: Gt.goBack,
|
|
1253
1253
|
title: "Back"
|
|
1254
1254
|
}), /* @__PURE__ */ B("h1", {
|
|
1255
1255
|
style: {
|
|
@@ -1265,24 +1265,24 @@ function Et({ screenCode: t }) {
|
|
|
1265
1265
|
children: "Record not found."
|
|
1266
1266
|
})]
|
|
1267
1267
|
});
|
|
1268
|
-
let
|
|
1269
|
-
entity:
|
|
1268
|
+
let tn = T.display, nn = E(X.display?.name) || E(tn.name), rn = b(Y, T), an = N ? `New ${nn}` : rn ? String(rn) : nn, on = Ae.isPending || je.isPending, sn = X.responsive?.[S.category]?.layout, cn = sn?.tabs ?? (S.isPhone ? "sections" : void 0), ln = sn?.header_card === !0 ? Re({
|
|
1269
|
+
entity: T,
|
|
1270
1270
|
screen: X
|
|
1271
1271
|
}) : void 0, $ = {
|
|
1272
|
-
schema:
|
|
1273
|
-
entity:
|
|
1274
|
-
entityCode:
|
|
1275
|
-
recordId:
|
|
1272
|
+
schema: m,
|
|
1273
|
+
entity: T,
|
|
1274
|
+
entityCode: D,
|
|
1275
|
+
recordId: ue ?? M ?? "",
|
|
1276
1276
|
record: q ? {
|
|
1277
1277
|
...Y ?? {},
|
|
1278
1278
|
...z
|
|
1279
1279
|
} : Y ?? {},
|
|
1280
|
-
isNew:
|
|
1280
|
+
isNew: N,
|
|
1281
1281
|
mode: q ? "edit" : "display",
|
|
1282
|
-
onFieldChange: q ?
|
|
1283
|
-
refs:
|
|
1282
|
+
onFieldChange: q ? Ht : void 0,
|
|
1283
|
+
refs: kt,
|
|
1284
1284
|
objectProperties: (() => {
|
|
1285
|
-
let e =
|
|
1285
|
+
let e = He ?? [];
|
|
1286
1286
|
if (!q || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
|
|
1287
1287
|
let t = e.map((e) => U[e.property_code] === void 0 ? e : {
|
|
1288
1288
|
...e,
|
|
@@ -1296,13 +1296,13 @@ function Et({ screenCode: t }) {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
return t;
|
|
1298
1298
|
})(),
|
|
1299
|
-
onSetProperty:
|
|
1299
|
+
onSetProperty: N || !k ? void 0 : q ? (e, t) => at((n) => ({
|
|
1300
1300
|
...n,
|
|
1301
1301
|
[e]: t
|
|
1302
1302
|
})) : void 0,
|
|
1303
1303
|
isPropertyPending: !1,
|
|
1304
1304
|
objectStatuses: (() => {
|
|
1305
|
-
let e =
|
|
1305
|
+
let e = Ve ?? [];
|
|
1306
1306
|
if (!q || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
|
|
1307
1307
|
let t = e.map((e) => H[e.group_code] === void 0 ? e : {
|
|
1308
1308
|
...e,
|
|
@@ -1312,64 +1312,64 @@ function Et({ screenCode: t }) {
|
|
|
1312
1312
|
group_code: n,
|
|
1313
1313
|
status_code: r,
|
|
1314
1314
|
status_name: {},
|
|
1315
|
-
set_at:
|
|
1315
|
+
set_at: re()
|
|
1316
1316
|
});
|
|
1317
1317
|
return t;
|
|
1318
1318
|
})(),
|
|
1319
|
-
onSetStatus:
|
|
1319
|
+
onSetStatus: N || !k ? void 0 : q ? (e, t) => rt((n) => ({
|
|
1320
1320
|
...n,
|
|
1321
1321
|
[e]: t
|
|
1322
1322
|
})) : void 0,
|
|
1323
1323
|
isStatusPending: !1,
|
|
1324
1324
|
pendingChildren: q ? W : void 0,
|
|
1325
|
-
onChildrenChange: q ?
|
|
1326
|
-
childValidationErrors: q ?
|
|
1327
|
-
fieldErrors: q &&
|
|
1328
|
-
detailTabsPresentation:
|
|
1329
|
-
relatedRecordsPresentation:
|
|
1330
|
-
},
|
|
1325
|
+
onChildrenChange: q ? Zt : void 0,
|
|
1326
|
+
childValidationErrors: q ? $t : void 0,
|
|
1327
|
+
fieldErrors: q && ft ? Jt : void 0,
|
|
1328
|
+
detailTabsPresentation: cn,
|
|
1329
|
+
relatedRecordsPresentation: sn?.related_records
|
|
1330
|
+
}, un = !!X.sidebar && X.sidebar.length > 0, dn = sn?.sidebar === "hidden", fn = un && !dn && !S.isDesktop, pn = un && !dn && S.isDesktop, mn = !N && Y ? /* @__PURE__ */ B(ct, {
|
|
1331
1331
|
screen: X,
|
|
1332
|
-
entity:
|
|
1333
|
-
entityCode:
|
|
1332
|
+
entity: T,
|
|
1333
|
+
entityCode: D,
|
|
1334
1334
|
record: Y,
|
|
1335
|
-
refs:
|
|
1336
|
-
objectStatuses:
|
|
1337
|
-
schema:
|
|
1338
|
-
locale:
|
|
1339
|
-
}) : void 0,
|
|
1340
|
-
title:
|
|
1341
|
-
recordId:
|
|
1335
|
+
refs: kt,
|
|
1336
|
+
objectStatuses: Ve,
|
|
1337
|
+
schema: m,
|
|
1338
|
+
locale: qt
|
|
1339
|
+
}) : void 0, hn = /* @__PURE__ */ B(Ot, {
|
|
1340
|
+
title: an,
|
|
1341
|
+
recordId: M,
|
|
1342
1342
|
editing: q,
|
|
1343
|
-
isNew:
|
|
1344
|
-
isRecordDeleted:
|
|
1345
|
-
dirty:
|
|
1346
|
-
isSaving:
|
|
1347
|
-
hasChildErrors:
|
|
1348
|
-
hasFieldErrors:
|
|
1349
|
-
canRestore:
|
|
1350
|
-
entity:
|
|
1343
|
+
isNew: N,
|
|
1344
|
+
isRecordDeleted: jt,
|
|
1345
|
+
dirty: Ke,
|
|
1346
|
+
isSaving: on,
|
|
1347
|
+
hasChildErrors: en,
|
|
1348
|
+
hasFieldErrors: ft && Yt,
|
|
1349
|
+
canRestore: A,
|
|
1350
|
+
entity: T,
|
|
1351
1351
|
screen: X,
|
|
1352
|
-
globalActions:
|
|
1353
|
-
entityCode:
|
|
1352
|
+
globalActions: m?.actions,
|
|
1353
|
+
entityCode: D,
|
|
1354
1354
|
record: Y,
|
|
1355
|
-
id:
|
|
1355
|
+
id: M,
|
|
1356
1356
|
listRoute: Q,
|
|
1357
|
-
listRouteExists: !!
|
|
1358
|
-
highlights:
|
|
1359
|
-
showBack:
|
|
1360
|
-
onBack:
|
|
1361
|
-
onCancelEdit:
|
|
1362
|
-
onSave:
|
|
1363
|
-
onRestore:
|
|
1364
|
-
isRestoring:
|
|
1357
|
+
listRouteExists: !!Ut,
|
|
1358
|
+
highlights: mn,
|
|
1359
|
+
showBack: Kt,
|
|
1360
|
+
onBack: Gt.goBack,
|
|
1361
|
+
onCancelEdit: Vt,
|
|
1362
|
+
onSave: Xt,
|
|
1363
|
+
onRestore: Qt,
|
|
1364
|
+
isRestoring: Ne.isPending,
|
|
1365
1365
|
refreshControl: {
|
|
1366
|
-
refetch:
|
|
1367
|
-
isLoading:
|
|
1368
|
-
isLive:
|
|
1366
|
+
refetch: de.refetch,
|
|
1367
|
+
isLoading: de.isLoading,
|
|
1368
|
+
isLive: ke
|
|
1369
1369
|
},
|
|
1370
|
-
isRealtimeEntity:
|
|
1371
|
-
canManageTemplates:
|
|
1372
|
-
}),
|
|
1370
|
+
isRealtimeEntity: T?.realtime === !0,
|
|
1371
|
+
canManageTemplates: We(m)
|
|
1372
|
+
}), gn = jt && /* @__PURE__ */ V("div", {
|
|
1373
1373
|
style: {
|
|
1374
1374
|
display: "flex",
|
|
1375
1375
|
alignItems: "center",
|
|
@@ -1382,8 +1382,8 @@ function Et({ screenCode: t }) {
|
|
|
1382
1382
|
color: "var(--danger)",
|
|
1383
1383
|
fontSize: 12.5
|
|
1384
1384
|
},
|
|
1385
|
-
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ",
|
|
1386
|
-
}),
|
|
1385
|
+
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ V("span", { children: ["This record was deleted on ", x(String(Y[T.soft_delete]))] })]
|
|
1386
|
+
}), _n = st && /* @__PURE__ */ V("div", {
|
|
1387
1387
|
style: {
|
|
1388
1388
|
display: "flex",
|
|
1389
1389
|
alignItems: "center",
|
|
@@ -1397,72 +1397,72 @@ function Et({ screenCode: t }) {
|
|
|
1397
1397
|
fontSize: 12.5
|
|
1398
1398
|
},
|
|
1399
1399
|
children: [/* @__PURE__ */ B(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: "This record changed on the server while you were viewing or editing it." })]
|
|
1400
|
-
}),
|
|
1401
|
-
errors: Object.entries(
|
|
1402
|
-
let
|
|
1400
|
+
}), vn = q && ft && Yt && /* @__PURE__ */ B(ot, {
|
|
1401
|
+
errors: Object.entries(Jt).map(([e, t]) => {
|
|
1402
|
+
let r = T.fields.get(e);
|
|
1403
1403
|
return {
|
|
1404
1404
|
name: e,
|
|
1405
|
-
label:
|
|
1405
|
+
label: r ? n(r, e, m?.entities) : e,
|
|
1406
1406
|
message: t
|
|
1407
1407
|
};
|
|
1408
1408
|
}),
|
|
1409
1409
|
onJump: (e) => {
|
|
1410
|
-
let t = document.getElementById(`${
|
|
1410
|
+
let t = document.getElementById(`${D}-${e}`);
|
|
1411
1411
|
t && (t.scrollIntoView({
|
|
1412
1412
|
block: "center",
|
|
1413
1413
|
behavior: "smooth"
|
|
1414
1414
|
}), t.focus?.());
|
|
1415
1415
|
}
|
|
1416
|
-
}),
|
|
1416
|
+
}), yn = ze && !N && !(X.items && X.items.length > 0) && /* @__PURE__ */ B("div", {
|
|
1417
1417
|
className: "mb-4",
|
|
1418
|
-
children: /* @__PURE__ */ B(
|
|
1419
|
-
statusGroups:
|
|
1418
|
+
children: /* @__PURE__ */ B(qe, {
|
|
1419
|
+
statusGroups: T.status_groups ?? {},
|
|
1420
1420
|
objectStatuses: $.objectStatuses,
|
|
1421
|
-
onSetStatus:
|
|
1421
|
+
onSetStatus: k && q ? (e, t) => rt((n) => ({
|
|
1422
1422
|
...n,
|
|
1423
1423
|
[e]: t
|
|
1424
|
-
})) :
|
|
1424
|
+
})) : xt,
|
|
1425
1425
|
isPending: !1,
|
|
1426
1426
|
mode: q ? "edit" : "display"
|
|
1427
1427
|
})
|
|
1428
|
-
}),
|
|
1428
|
+
}), bn = T.evidence_covered && !N && Y && /* @__PURE__ */ B("div", {
|
|
1429
1429
|
className: "mb-4",
|
|
1430
|
-
children: /* @__PURE__ */ B(
|
|
1431
|
-
}),
|
|
1432
|
-
|
|
1433
|
-
card:
|
|
1434
|
-
entity:
|
|
1430
|
+
children: /* @__PURE__ */ B(pt, { evidence: Y.$evidence })
|
|
1431
|
+
}), xn = /* @__PURE__ */ V(tt, { children: [
|
|
1432
|
+
ln && (Y || N) && /* @__PURE__ */ B(Et, {
|
|
1433
|
+
card: ln,
|
|
1434
|
+
entity: T,
|
|
1435
1435
|
record: $.record,
|
|
1436
1436
|
objectStatuses: $.objectStatuses,
|
|
1437
1437
|
objectProperties: $.objectProperties
|
|
1438
1438
|
}),
|
|
1439
|
-
X.items && X.items.length > 0 && (Y ||
|
|
1439
|
+
X.items && X.items.length > 0 && (Y || N) && m && /* @__PURE__ */ B(Je, {
|
|
1440
1440
|
nodes: X.items,
|
|
1441
1441
|
ctx: $
|
|
1442
1442
|
}),
|
|
1443
|
-
!
|
|
1444
|
-
entityCode:
|
|
1445
|
-
recordId:
|
|
1446
|
-
associations:
|
|
1447
|
-
schema:
|
|
1443
|
+
!N && M && D && T.associations && Object.keys(T.associations).length > 0 && m && /* @__PURE__ */ B(nt, {
|
|
1444
|
+
entityCode: D,
|
|
1445
|
+
recordId: ue ?? M ?? "",
|
|
1446
|
+
associations: T.associations,
|
|
1447
|
+
schema: m
|
|
1448
1448
|
}),
|
|
1449
|
-
!
|
|
1450
|
-
entityCode:
|
|
1451
|
-
objectId:
|
|
1452
|
-
canGenerateOne: !!
|
|
1453
|
-
canManageTemplates:
|
|
1449
|
+
!N && M && D && /* @__PURE__ */ B(it, {
|
|
1450
|
+
entityCode: D,
|
|
1451
|
+
objectId: ue ?? M,
|
|
1452
|
+
canGenerateOne: !!T?.documents?.generate_one,
|
|
1453
|
+
canManageTemplates: We(m)
|
|
1454
1454
|
}),
|
|
1455
|
-
!
|
|
1455
|
+
!N && Y && m && /* @__PURE__ */ B(dt, {
|
|
1456
1456
|
screen: X,
|
|
1457
|
-
entity:
|
|
1458
|
-
entityCode:
|
|
1457
|
+
entity: T,
|
|
1458
|
+
entityCode: D,
|
|
1459
1459
|
record: Y,
|
|
1460
|
-
refs:
|
|
1461
|
-
schema:
|
|
1462
|
-
locale:
|
|
1460
|
+
refs: kt,
|
|
1461
|
+
schema: m,
|
|
1462
|
+
locale: qt
|
|
1463
1463
|
})
|
|
1464
1464
|
] });
|
|
1465
|
-
if (
|
|
1465
|
+
if (pn) return /* @__PURE__ */ V("div", {
|
|
1466
1466
|
style: {
|
|
1467
1467
|
height: "100%",
|
|
1468
1468
|
display: "flex",
|
|
@@ -1484,15 +1484,15 @@ function Et({ screenCode: t }) {
|
|
|
1484
1484
|
padding: "14px 20px 8px"
|
|
1485
1485
|
},
|
|
1486
1486
|
children: [
|
|
1487
|
+
hn,
|
|
1488
|
+
_n,
|
|
1487
1489
|
gn,
|
|
1488
1490
|
vn,
|
|
1489
|
-
_n,
|
|
1490
1491
|
yn,
|
|
1491
|
-
bn
|
|
1492
|
-
xn
|
|
1492
|
+
bn
|
|
1493
1493
|
]
|
|
1494
1494
|
}), /* @__PURE__ */ B("div", {
|
|
1495
|
-
ref:
|
|
1495
|
+
ref: Nt,
|
|
1496
1496
|
style: {
|
|
1497
1497
|
flex: 1,
|
|
1498
1498
|
minHeight: 0,
|
|
@@ -1502,12 +1502,12 @@ function Et({ screenCode: t }) {
|
|
|
1502
1502
|
flexDirection: "column",
|
|
1503
1503
|
gap: 16
|
|
1504
1504
|
},
|
|
1505
|
-
children:
|
|
1505
|
+
children: xn
|
|
1506
1506
|
})]
|
|
1507
1507
|
}),
|
|
1508
1508
|
/* @__PURE__ */ B("div", {
|
|
1509
1509
|
className: "detail-resize-handle",
|
|
1510
|
-
onMouseDown:
|
|
1510
|
+
onMouseDown: Dt,
|
|
1511
1511
|
title: "Drag to resize",
|
|
1512
1512
|
children: /* @__PURE__ */ B("div", { style: {
|
|
1513
1513
|
position: "absolute",
|
|
@@ -1520,20 +1520,20 @@ function Et({ screenCode: t }) {
|
|
|
1520
1520
|
} })
|
|
1521
1521
|
}),
|
|
1522
1522
|
/* @__PURE__ */ B("div", {
|
|
1523
|
-
ref:
|
|
1523
|
+
ref: Tt,
|
|
1524
1524
|
style: {
|
|
1525
1525
|
flexShrink: 0,
|
|
1526
1526
|
height: "100%",
|
|
1527
|
-
width: `${
|
|
1527
|
+
width: `${yt}px`
|
|
1528
1528
|
},
|
|
1529
|
-
children: (Y ||
|
|
1529
|
+
children: (Y || N) && m && /* @__PURE__ */ B(Je, {
|
|
1530
1530
|
nodes: X.sidebar,
|
|
1531
1531
|
ctx: $
|
|
1532
1532
|
})
|
|
1533
1533
|
})
|
|
1534
1534
|
]
|
|
1535
1535
|
});
|
|
1536
|
-
let
|
|
1536
|
+
let Sn = S.isPhone ? ye(12) : {
|
|
1537
1537
|
paddingLeft: "24px",
|
|
1538
1538
|
paddingRight: "24px"
|
|
1539
1539
|
};
|
|
@@ -1548,34 +1548,34 @@ function Et({ screenCode: t }) {
|
|
|
1548
1548
|
children: [/* @__PURE__ */ V("div", {
|
|
1549
1549
|
style: {
|
|
1550
1550
|
flexShrink: 0,
|
|
1551
|
-
paddingTop:
|
|
1551
|
+
paddingTop: S.isPhone ? 14 : 24,
|
|
1552
1552
|
paddingBottom: 8,
|
|
1553
|
-
...
|
|
1553
|
+
...Sn
|
|
1554
1554
|
},
|
|
1555
1555
|
children: [
|
|
1556
|
+
hn,
|
|
1557
|
+
_n,
|
|
1556
1558
|
gn,
|
|
1557
1559
|
vn,
|
|
1558
|
-
_n,
|
|
1559
1560
|
yn,
|
|
1560
|
-
bn
|
|
1561
|
-
xn
|
|
1561
|
+
bn
|
|
1562
1562
|
]
|
|
1563
1563
|
}), /* @__PURE__ */ V("div", {
|
|
1564
|
-
ref:
|
|
1564
|
+
ref: Nt,
|
|
1565
1565
|
style: {
|
|
1566
1566
|
flex: 1,
|
|
1567
1567
|
minHeight: 0,
|
|
1568
1568
|
overflowY: "auto",
|
|
1569
1569
|
paddingTop: 4,
|
|
1570
1570
|
paddingBottom: "calc(24px + var(--safe-area-bottom))",
|
|
1571
|
-
...
|
|
1571
|
+
...Sn,
|
|
1572
1572
|
display: "flex",
|
|
1573
1573
|
flexDirection: "column",
|
|
1574
1574
|
gap: 16,
|
|
1575
1575
|
minWidth: 0,
|
|
1576
1576
|
WebkitOverflowScrolling: "touch"
|
|
1577
1577
|
},
|
|
1578
|
-
children: [
|
|
1578
|
+
children: [xn, fn && (Y || N) && m && /* @__PURE__ */ B("div", {
|
|
1579
1579
|
"data-testid": "detail-sidebar-inline",
|
|
1580
1580
|
style: {
|
|
1581
1581
|
display: "flex",
|
|
@@ -1583,7 +1583,7 @@ function Et({ screenCode: t }) {
|
|
|
1583
1583
|
gap: 16,
|
|
1584
1584
|
minWidth: 0
|
|
1585
1585
|
},
|
|
1586
|
-
children: /* @__PURE__ */ B(
|
|
1586
|
+
children: /* @__PURE__ */ B(Je, {
|
|
1587
1587
|
nodes: X.sidebar,
|
|
1588
1588
|
ctx: $
|
|
1589
1589
|
})
|
|
@@ -1591,17 +1591,17 @@ function Et({ screenCode: t }) {
|
|
|
1591
1591
|
})]
|
|
1592
1592
|
});
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function Et({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
|
|
1595
1595
|
let a = (e) => {
|
|
1596
1596
|
let a = J(t, e, n, r, i);
|
|
1597
|
-
return a != null &&
|
|
1597
|
+
return a != null && T(a) !== "";
|
|
1598
1598
|
}, o = (e) => {
|
|
1599
1599
|
let a = J(t, e, n, r, i);
|
|
1600
|
-
return
|
|
1600
|
+
return T(a) || /* @__PURE__ */ B("span", {
|
|
1601
1601
|
style: { color: "var(--text-3)" },
|
|
1602
1602
|
children: "-"
|
|
1603
1603
|
});
|
|
1604
|
-
}, s = e.titleUsesDisplay ?
|
|
1604
|
+
}, s = e.titleUsesDisplay ? b(n, t) : e.titleField ? J(t, e.titleField, n, r, i) : void 0, c = T(s) || E(t.display?.name) || "Record", l = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), d = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
|
|
1605
1605
|
return /* @__PURE__ */ V("section", {
|
|
1606
1606
|
"data-testid": "detail-header-card",
|
|
1607
1607
|
style: {
|
|
@@ -1672,7 +1672,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1672
1672
|
style: { display: "contents" },
|
|
1673
1673
|
children: [/* @__PURE__ */ B("dt", {
|
|
1674
1674
|
style: { color: "var(--text-3)" },
|
|
1675
|
-
children:
|
|
1675
|
+
children: Dt(t, e)
|
|
1676
1676
|
}), /* @__PURE__ */ B("dd", {
|
|
1677
1677
|
style: {
|
|
1678
1678
|
margin: 0,
|
|
@@ -1699,7 +1699,7 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1699
1699
|
overflowWrap: "anywhere"
|
|
1700
1700
|
},
|
|
1701
1701
|
children: [
|
|
1702
|
-
|
|
1702
|
+
Dt(t, e),
|
|
1703
1703
|
": ",
|
|
1704
1704
|
o(e)
|
|
1705
1705
|
]
|
|
@@ -1711,73 +1711,73 @@ function Dt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
|
|
|
1711
1711
|
function J(e, t, n, r, i) {
|
|
1712
1712
|
if (t.startsWith("$status.")) {
|
|
1713
1713
|
let e = t.slice(8), n = r?.find((t) => t.group_code === e);
|
|
1714
|
-
return
|
|
1714
|
+
return E(n?.status_name) || n?.status_code;
|
|
1715
1715
|
}
|
|
1716
1716
|
if (t.startsWith("$property.")) {
|
|
1717
1717
|
let e = t.slice(10);
|
|
1718
1718
|
return i?.find((t) => t.property_code === e)?.value;
|
|
1719
1719
|
}
|
|
1720
|
-
return
|
|
1720
|
+
return De(e, n, t);
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function Dt(e, t) {
|
|
1723
1723
|
if (t.startsWith("$status.")) return t.slice(8);
|
|
1724
1724
|
if (t.startsWith("$property.")) return t.slice(10);
|
|
1725
|
-
let
|
|
1726
|
-
return
|
|
1725
|
+
let r = e.fields.get(t);
|
|
1726
|
+
return r ? n(r, t) : t;
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1729
|
-
let { run:
|
|
1728
|
+
function Ot({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: o, dirty: l, isSaving: f, hasChildErrors: p, hasFieldErrors: g, canRestore: ee, entity: _, screen: v, globalActions: b, entityCode: x, record: C, id: w, listRoute: T, listRouteExists: ne, highlights: re, showBack: D, onBack: O, onCancelEdit: k, onSave: ie, onRestore: ae, isRestoring: A, refreshControl: oe, isRealtimeEntity: se, canManageTemplates: j }) {
|
|
1729
|
+
let { run: M } = S(), ce = ue("detail"), N = ve(), P = s(), le = te(), fe = h(v?.action_layout, _?.action_layout, _?.actions, b, "detail_toolbar"), pe = h(v?.action_layout, _?.action_layout, _?.actions, b, "detail"), me = u(pe, _?.actions, b, C ?? {}, [], Ae(_, C ?? {})), he = u(fe, _?.actions, b, C ?? {}, [], Ae(_, C ?? {})), _e = L(() => {
|
|
1730
1730
|
if (!_) return;
|
|
1731
|
-
let e =
|
|
1731
|
+
let e = w ? [w] : [];
|
|
1732
1732
|
return {
|
|
1733
1733
|
entity: _,
|
|
1734
1734
|
entityCode: x ?? "",
|
|
1735
1735
|
screen: v,
|
|
1736
1736
|
screenRoute: v?.route ?? "",
|
|
1737
|
-
selectedRows:
|
|
1737
|
+
selectedRows: C ? [C] : [],
|
|
1738
1738
|
selectedIds: e,
|
|
1739
|
-
locale:
|
|
1740
|
-
tabNavigate: (e, t) =>
|
|
1739
|
+
locale: le,
|
|
1740
|
+
tabNavigate: (e, t) => N(e, {
|
|
1741
1741
|
title: t?.title,
|
|
1742
1742
|
icon: t?.icon,
|
|
1743
1743
|
search: t?.search
|
|
1744
1744
|
}),
|
|
1745
|
-
runActionApi: (e, t) =>
|
|
1745
|
+
runActionApi: (e, t) => y(e, t)
|
|
1746
1746
|
};
|
|
1747
1747
|
}, [
|
|
1748
1748
|
_,
|
|
1749
1749
|
x,
|
|
1750
1750
|
v,
|
|
1751
|
+
w,
|
|
1751
1752
|
C,
|
|
1752
|
-
|
|
1753
|
-
N
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
let n = Pe(e, t, { row: S ?? void 0 });
|
|
1753
|
+
le,
|
|
1754
|
+
N
|
|
1755
|
+
]), ye = (e, t) => {
|
|
1756
|
+
let n = Ne(e, t, { row: C ?? void 0 });
|
|
1757
1757
|
if (n === null) return;
|
|
1758
|
-
let r =
|
|
1759
|
-
return
|
|
1758
|
+
let r = w ? [w] : [], i = e === "__delete" && ne ? T : null;
|
|
1759
|
+
return M({
|
|
1760
1760
|
action: t,
|
|
1761
|
-
title:
|
|
1762
|
-
row:
|
|
1763
|
-
execute: (e) =>
|
|
1761
|
+
title: E(t.display?.name) || e,
|
|
1762
|
+
row: C ?? void 0,
|
|
1763
|
+
execute: (e) => y(n, m(e, r)),
|
|
1764
1764
|
onSuccess: i ? () => {
|
|
1765
|
-
|
|
1765
|
+
ge.getState().kill(be(location)), P(i, { replace: !0 });
|
|
1766
1766
|
} : void 0
|
|
1767
1767
|
});
|
|
1768
|
-
},
|
|
1769
|
-
layout:
|
|
1770
|
-
row:
|
|
1771
|
-
onRun:
|
|
1768
|
+
}, xe = ce.isVisible("show_actions") && !a && w && me.length > 0 ? /* @__PURE__ */ B(Ee, {
|
|
1769
|
+
layout: me,
|
|
1770
|
+
row: C,
|
|
1771
|
+
onRun: ye,
|
|
1772
1772
|
kind: "detail",
|
|
1773
1773
|
entityActions: _?.actions,
|
|
1774
|
-
globalActions:
|
|
1774
|
+
globalActions: b,
|
|
1775
1775
|
reservedRightWidth: 0,
|
|
1776
|
-
widgetContext:
|
|
1777
|
-
}) : null, Se = !
|
|
1778
|
-
liveObject:
|
|
1779
|
-
realtime:
|
|
1780
|
-
}) : null, Ce =
|
|
1776
|
+
widgetContext: _e
|
|
1777
|
+
}) : null, Se = !a && w ? /* @__PURE__ */ B(de, {
|
|
1778
|
+
liveObject: oe,
|
|
1779
|
+
realtime: se
|
|
1780
|
+
}) : null, Ce = ce.isVisible("show_actions") && !a && w && he.length > 0 ? /* @__PURE__ */ V("div", {
|
|
1781
1781
|
style: {
|
|
1782
1782
|
display: "flex",
|
|
1783
1783
|
justifyContent: "flex-end",
|
|
@@ -1785,62 +1785,62 @@ function kt({ title: r, recordId: i, editing: a, isNew: s, isRecordDeleted: c, d
|
|
|
1785
1785
|
gap: 8,
|
|
1786
1786
|
marginTop: 10
|
|
1787
1787
|
},
|
|
1788
|
-
children: [
|
|
1788
|
+
children: [xe ? null : Se, /* @__PURE__ */ B(Ee, {
|
|
1789
1789
|
layout: he,
|
|
1790
|
-
row:
|
|
1791
|
-
onRun:
|
|
1790
|
+
row: C,
|
|
1791
|
+
onRun: ye,
|
|
1792
1792
|
kind: "detail",
|
|
1793
1793
|
entityActions: _?.actions,
|
|
1794
|
-
globalActions:
|
|
1794
|
+
globalActions: b,
|
|
1795
1795
|
reservedRightWidth: 0,
|
|
1796
|
-
widgetContext:
|
|
1797
|
-
ariaLabel:
|
|
1796
|
+
widgetContext: _e,
|
|
1797
|
+
ariaLabel: xe ? "Detail toolbar actions" : "Page actions"
|
|
1798
1798
|
})]
|
|
1799
|
-
}) : null, we =
|
|
1799
|
+
}) : null, we = ce.isVisible("show_actions") && !a && w && x ? /* @__PURE__ */ B(Ke, {
|
|
1800
1800
|
entityCode: x,
|
|
1801
1801
|
scope: "detail",
|
|
1802
|
-
objectIds: [
|
|
1802
|
+
objectIds: [w],
|
|
1803
1803
|
capability: _?.documents,
|
|
1804
|
-
canManageTemplates:
|
|
1805
|
-
}) : null, Te =
|
|
1804
|
+
canManageTemplates: j
|
|
1805
|
+
}) : null, Te = o ? ee ? /* @__PURE__ */ B(d, {
|
|
1806
1806
|
kind: "primary",
|
|
1807
|
-
icon: B(
|
|
1808
|
-
onClick:
|
|
1809
|
-
disabled:
|
|
1810
|
-
children:
|
|
1811
|
-
}) : null :
|
|
1807
|
+
icon: B(A ? c : e.refresh, { size: 13 }),
|
|
1808
|
+
onClick: ae,
|
|
1809
|
+
disabled: A,
|
|
1810
|
+
children: A ? "Restoring…" : "Restore"
|
|
1811
|
+
}) : null : i ? /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(d, {
|
|
1812
1812
|
icon: /* @__PURE__ */ B(e.x, { size: 13 }),
|
|
1813
|
-
onClick:
|
|
1814
|
-
disabled:
|
|
1813
|
+
onClick: k,
|
|
1814
|
+
disabled: f,
|
|
1815
1815
|
children: "Cancel"
|
|
1816
|
-
}), /* @__PURE__ */ B(
|
|
1816
|
+
}), /* @__PURE__ */ B(d, {
|
|
1817
1817
|
kind: "primary",
|
|
1818
|
-
icon: B(
|
|
1818
|
+
icon: B(f ? c : e.save, { size: 13 }),
|
|
1819
1819
|
onClick: ie,
|
|
1820
|
-
disabled:
|
|
1821
|
-
title:
|
|
1822
|
-
children:
|
|
1823
|
-
})] }) : !
|
|
1820
|
+
disabled: f || p || g,
|
|
1821
|
+
title: p ? "Fix errors in child rows" : g ? "Fix the highlighted fields" : void 0,
|
|
1822
|
+
children: f ? "Saving…" : "Save"
|
|
1823
|
+
})] }) : !a && w ? xe ? /* @__PURE__ */ V("span", {
|
|
1824
1824
|
style: { display: "contents" },
|
|
1825
|
-
children: [we,
|
|
1825
|
+
children: [we, xe]
|
|
1826
1826
|
}) : we : null;
|
|
1827
|
-
return /* @__PURE__ */ V(
|
|
1827
|
+
return /* @__PURE__ */ V(tt, { children: [/* @__PURE__ */ B(q, {
|
|
1828
1828
|
icon: _?.display.icon ? /* @__PURE__ */ B(t, {
|
|
1829
1829
|
name: _.display.icon,
|
|
1830
1830
|
size: 16
|
|
1831
1831
|
}) : void 0,
|
|
1832
|
-
title:
|
|
1833
|
-
description:
|
|
1834
|
-
recordId:
|
|
1835
|
-
highlights:
|
|
1836
|
-
identityControls: !
|
|
1837
|
-
mode:
|
|
1832
|
+
title: n,
|
|
1833
|
+
description: E(v?.display?.description) || E(_?.display?.description),
|
|
1834
|
+
recordId: r,
|
|
1835
|
+
highlights: re,
|
|
1836
|
+
identityControls: !o && !i && !a ? Se : null,
|
|
1837
|
+
mode: a ? "create" : i ? "edit" : "display",
|
|
1838
1838
|
dirty: l,
|
|
1839
|
-
showBack:
|
|
1840
|
-
onBack:
|
|
1839
|
+
showBack: D,
|
|
1840
|
+
onBack: O,
|
|
1841
1841
|
right: Te,
|
|
1842
|
-
showTitle:
|
|
1842
|
+
showTitle: ce.isVisible("show_title")
|
|
1843
1843
|
}), Ce] });
|
|
1844
1844
|
}
|
|
1845
1845
|
//#endregion
|
|
1846
|
-
export {
|
|
1846
|
+
export { wt as SmartDetailPage };
|