@declarion/react 0.45.0 → 0.48.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-p2ZSdwzj.js} +2 -2
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CcCveEE7.js → Grid-CjLFAKMZ.js} +2 -2
- package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-X3p4yfo_.js} +598 -585
- package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-Sb7zcvj0.js} +10 -10
- package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-Cnl9nE0x.js} +268 -238
- package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-bb0UNOII.js} +545 -532
- package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-BFh8auUZ.js} +171 -158
- package/dist-lib/api/agents.d.ts +47 -18
- package/dist-lib/components/agents/AgentChatPanel.d.ts +7 -1
- package/dist-lib/components/agents/AgentPicker.d.ts +9 -0
- 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/primitives/Tooltip.d.ts +4 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +10 -5
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +10 -24
- package/dist-lib/hooks/useBrandingChrome.d.ts +11 -0
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/hooks/useLongPress.d.ts +29 -0
- package/dist-lib/hooks/useResponsiveMode.d.ts +2 -21
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +10 -3
- package/dist-lib/index.js +3305 -2741
- package/dist-lib/lib/actions.d.ts +13 -5
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/longPressGesture.d.ts +55 -0
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/page-inset.d.ts +3 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/lib/viewport-category.d.ts +44 -0
- package/dist-lib/{registry-DJKp0yaV.js → registry-CWDnxiLJ.js} +1291 -1008
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +15 -2
- package/dist-lib/types/schema.d.ts +26 -0
- package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-BshVTPVq.js} +1124 -1088
- package/dist-lib/{useProperties-TlltWwLv.js → useProperties-B5p9mIH8.js} +92 -61
- package/dist-lib/{value-CHY7LgZ-.js → value-B1O6QikE.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
- package/dist-lib/components/agents/AgentVisualHints.d.ts +0 -6
package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-BFh8auUZ.js}
RENAMED
|
@@ -1,140 +1,141 @@
|
|
|
1
|
-
import { s as e } from "./DynamicIcon-
|
|
2
|
-
import { A as t, At as n, Cn as r, F as i, Kn as a, Ln as o, N as s, Pn as c, Sn as l, Tn as u, X as d, Yn as f, Zn as p, bn as m, lr as ee, q as h,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { useCallback as
|
|
7
|
-
import { useSearchParams as
|
|
8
|
-
import { Fragment as
|
|
1
|
+
import { s as e } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
+
import { A as t, At as n, Cn as r, F as i, Kn as a, Ln as o, N as s, Pn as c, Sn as l, Tn as u, X as d, Yn as f, Zn as p, bn as m, lr as ee, q as h, rt as g, tr as te, ur as _ } from "./useCurrentScreen-BshVTPVq.js";
|
|
3
|
+
import { $ as v, A as ne, Q as y, T as b, X as x, Z as S, a as C, c as re, dt as ie, et as w, nt as T, s as E, v as D } from "./registry-CWDnxiLJ.js";
|
|
4
|
+
import { S as O, c as k, f as A, g as j, h as ae, m as M, n as oe, r as N, v as P } from "./useProperties-B5p9mIH8.js";
|
|
5
|
+
import { t as F } from "./LayoutRenderer-X3p4yfo_.js";
|
|
6
|
+
import { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as se } from "react";
|
|
7
|
+
import { useSearchParams as ce } from "react-router";
|
|
8
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/pages/SmartRecordListPage.impl.tsx
|
|
10
10
|
function U({ screenCode: t }) {
|
|
11
|
-
let [r, i] =
|
|
12
|
-
j(p, m, r.toString()),
|
|
13
|
-
let _ =
|
|
14
|
-
let e = A(r);
|
|
15
|
-
return e.length > 0 ? e : void 0;
|
|
16
|
-
}, [r]), C = z(() => p?.columns ?? m?.fields.names().filter((e) => !m.fields.get(e)?.primary && !m.fields.get(e)?.auto && m.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [p?.columns, m]), T = z(() => {
|
|
11
|
+
let [r, i] = ce(), { data: s } = n(), c = te(), p = s?.screens[t], m = p?.entity ? s?.entities[p.entity] : void 0, g = p?.entity;
|
|
12
|
+
j(p, m, r.toString()), P(p?.route);
|
|
13
|
+
let _ = D(), v = r.get("selected") ?? null, ne = r.get("search") ?? "", y = h(ne, 300), b = r.get("sort") ?? p?.sort_default ?? "", x = R(() => A(r), [r]), S = x.filters.length > 0 ? x.filters : void 0, C = R(() => p?.columns ?? m?.fields.names().filter((e) => !m.fields.get(e)?.primary && !m.fields.get(e)?.auto && m.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [p?.columns, m]), w = R(() => {
|
|
17
14
|
let e = p?.responsive?.[c.category]?.presentation;
|
|
18
15
|
return c.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
|
|
19
|
-
}, [p?.responsive, c.category]),
|
|
16
|
+
}, [p?.responsive, c.category]), T = R(() => {
|
|
20
17
|
let e = p?.responsive?.[c.category];
|
|
21
18
|
return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation : c.category === "phone" ? "cards" : "table";
|
|
22
|
-
}, [p?.responsive, c.category]),
|
|
19
|
+
}, [p?.responsive, c.category]), oe = p?.responsive?.[c.category]?.layout?.related_records, N = R(() => E({
|
|
23
20
|
entity: m,
|
|
24
21
|
screen: p
|
|
25
|
-
}), [m, p]),
|
|
22
|
+
}), [m, p]), F = R(() => re({
|
|
26
23
|
entity: m,
|
|
27
24
|
screen: p,
|
|
28
|
-
presentation:
|
|
25
|
+
presentation: T,
|
|
29
26
|
visibleColumns: C,
|
|
30
|
-
card:
|
|
31
|
-
sort:
|
|
27
|
+
card: N,
|
|
28
|
+
sort: b
|
|
32
29
|
}), [
|
|
33
30
|
m,
|
|
34
31
|
p,
|
|
35
|
-
|
|
32
|
+
T,
|
|
36
33
|
C,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
34
|
+
N,
|
|
35
|
+
b
|
|
36
|
+
]), U = m?.list_pagination === "cursor", { data: W, isLoading: G } = d(g, {
|
|
40
37
|
page: 1,
|
|
41
38
|
per_page: 200,
|
|
42
|
-
sort:
|
|
43
|
-
search:
|
|
44
|
-
filters: S,
|
|
45
|
-
select:
|
|
46
|
-
expand:
|
|
39
|
+
sort: b || void 0,
|
|
40
|
+
search: y || void 0,
|
|
41
|
+
filters: x.error ? void 0 : S,
|
|
42
|
+
select: F.selectFields,
|
|
43
|
+
expand: F.expandFields,
|
|
47
44
|
preview: !0,
|
|
48
45
|
screen: p?.fixed_filters ? t : void 0
|
|
49
|
-
}, !
|
|
50
|
-
sort:
|
|
51
|
-
search:
|
|
52
|
-
filters: S,
|
|
53
|
-
select:
|
|
54
|
-
expand:
|
|
46
|
+
}, !U), K = O(g, {
|
|
47
|
+
sort: b || void 0,
|
|
48
|
+
search: y || void 0,
|
|
49
|
+
filters: x.error ? void 0 : S,
|
|
50
|
+
select: F.selectFields,
|
|
51
|
+
expand: F.expandFields,
|
|
55
52
|
preview: !0,
|
|
56
53
|
screen: p?.fixed_filters ? t : void 0,
|
|
57
54
|
limit: 200
|
|
58
|
-
},
|
|
55
|
+
}, U), J = U ? K.rows : W?.data ?? [], ue = U ? K.refs : W?.$refs, Y = U ? K.isLoading : G, de = R(() => m?.fields.names().find((e) => m.fields.get(e)?.primary) ?? "id", [m]), fe = I((e, t) => {
|
|
59
56
|
i((t) => {
|
|
60
57
|
let n = new URLSearchParams(t);
|
|
61
58
|
return e ? n.set("selected", e) : n.delete("selected"), n;
|
|
62
59
|
}, { replace: t?.replace ?? !0 });
|
|
63
|
-
}, [i]),
|
|
60
|
+
}, [i]), pe = I((e) => {
|
|
64
61
|
i((t) => {
|
|
65
62
|
let n = new URLSearchParams(t);
|
|
66
63
|
return e ? n.set("search", e) : n.delete("search"), n;
|
|
67
64
|
}, { replace: !0 });
|
|
68
|
-
}, [i]),
|
|
65
|
+
}, [i]), me = I((e, t) => {
|
|
69
66
|
i((n) => {
|
|
70
|
-
let r = new URLSearchParams(n), i = A(n), a;
|
|
71
|
-
return a = t && t !== "__all__" ? [...
|
|
67
|
+
let r = new URLSearchParams(n), i = A(n).filters, a;
|
|
68
|
+
return a = t && t !== "__all__" ? [...M(i, e), k(e, t)] : M(i, e), ae(a, r), r;
|
|
72
69
|
}, { replace: !0 });
|
|
73
|
-
}, [i]),
|
|
74
|
-
|
|
75
|
-
!
|
|
70
|
+
}, [i]), X = (p?.list_resizable ?? !1) && w === "split" && c.category !== "phone" && !c.touch, he = z(null), [Z, Q] = se(null), ge = z(!1), $ = p?.list_width;
|
|
71
|
+
L(() => {
|
|
72
|
+
!X || !$?.endsWith("%") || Q(null);
|
|
76
73
|
}, [
|
|
77
|
-
|
|
74
|
+
X,
|
|
78
75
|
$,
|
|
79
76
|
c.width,
|
|
80
77
|
c.height
|
|
81
|
-
]),
|
|
82
|
-
if (!
|
|
83
|
-
let e =
|
|
84
|
-
if (e)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
]), L(() => {
|
|
79
|
+
if (!X || Z !== null) return;
|
|
80
|
+
let e = he.current;
|
|
81
|
+
if (e) {
|
|
82
|
+
if ($ && $.endsWith("%")) {
|
|
83
|
+
let t = parseFloat($) / 100;
|
|
84
|
+
Q(Math.round(e.getBoundingClientRect().width * t));
|
|
85
|
+
} else Q($ && parseInt($, 10) || 320);
|
|
86
|
+
}
|
|
88
87
|
}, [
|
|
89
|
-
Y,
|
|
90
|
-
$,
|
|
91
88
|
X,
|
|
89
|
+
$,
|
|
90
|
+
Z,
|
|
92
91
|
m
|
|
93
92
|
]);
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
let _e = z(null);
|
|
94
|
+
L(() => () => {
|
|
95
|
+
_e.current?.();
|
|
97
96
|
}, []);
|
|
98
|
-
let
|
|
99
|
-
e.preventDefault(),
|
|
100
|
-
let t = e.clientX, n =
|
|
101
|
-
if (!
|
|
102
|
-
let r = (
|
|
103
|
-
|
|
97
|
+
let ve = I((e) => {
|
|
98
|
+
e.preventDefault(), ge.current = !0;
|
|
99
|
+
let t = e.clientX, n = Z ?? 320, r = (e) => {
|
|
100
|
+
if (!ge.current) return;
|
|
101
|
+
let r = (he.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
|
|
102
|
+
Q(i);
|
|
104
103
|
}, i = () => {
|
|
105
|
-
|
|
104
|
+
ge.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", _e.current = null;
|
|
106
105
|
};
|
|
107
|
-
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i),
|
|
108
|
-
}, [
|
|
106
|
+
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), _e.current = i;
|
|
107
|
+
}, [Z]);
|
|
109
108
|
if (!s || !p || !m) return null;
|
|
110
|
-
let
|
|
109
|
+
let ye = S?.length ?? 0, be = w === "split" || w === "stacked" || !v, xe = w === "split" || w === "stacked" || !!v, Se = w !== "split" && v ? () => fe(null, { replace: !0 }) : void 0, Ce = w === "split" ? X && Z !== null ? Z : p.list_width ?? "320px" : "100%";
|
|
111
110
|
return /* @__PURE__ */ H("div", {
|
|
112
|
-
ref:
|
|
113
|
-
"data-record-list-presentation":
|
|
111
|
+
ref: he,
|
|
112
|
+
"data-record-list-presentation": w,
|
|
114
113
|
style: {
|
|
115
114
|
display: "flex",
|
|
116
|
-
flexDirection:
|
|
115
|
+
flexDirection: w === "stacked" ? "column" : "row",
|
|
117
116
|
height: "100%",
|
|
118
117
|
minWidth: 0,
|
|
119
118
|
overflow: "hidden"
|
|
120
119
|
},
|
|
121
120
|
children: [
|
|
122
|
-
|
|
121
|
+
be && /* @__PURE__ */ H("div", {
|
|
123
122
|
"data-testid": "record-list-panel",
|
|
124
123
|
style: {
|
|
125
|
-
flex:
|
|
124
|
+
flex: w === "split" ? "none" : "1 1 auto",
|
|
126
125
|
display: "flex",
|
|
127
126
|
flexDirection: "column",
|
|
128
127
|
overflow: "hidden",
|
|
129
|
-
borderRight:
|
|
130
|
-
borderBottom:
|
|
131
|
-
width:
|
|
128
|
+
borderRight: w === "split" && !X ? "1px solid var(--divider)" : "none",
|
|
129
|
+
borderBottom: w === "stacked" ? "1px solid var(--divider)" : "none",
|
|
130
|
+
width: Ce,
|
|
132
131
|
minWidth: 0,
|
|
133
|
-
height:
|
|
132
|
+
height: w === "stacked" ? "50%" : "100%"
|
|
134
133
|
},
|
|
135
134
|
children: [/* @__PURE__ */ H("div", {
|
|
136
135
|
style: {
|
|
137
|
-
|
|
136
|
+
paddingTop: 12,
|
|
137
|
+
paddingBottom: 12,
|
|
138
|
+
...ie(12),
|
|
138
139
|
display: "flex",
|
|
139
140
|
flexDirection: "column",
|
|
140
141
|
gap: 8,
|
|
@@ -161,11 +162,23 @@ function U({ screenCode: t }) {
|
|
|
161
162
|
})]
|
|
162
163
|
}),
|
|
163
164
|
/* @__PURE__ */ V(f, {
|
|
164
|
-
value:
|
|
165
|
-
onChange:
|
|
165
|
+
value: ne,
|
|
166
|
+
onChange: pe,
|
|
166
167
|
placeholder: `Search ${u(m.display.name_plural)}…`,
|
|
167
168
|
prefix: /* @__PURE__ */ V(e.search, { size: 13 })
|
|
168
169
|
}),
|
|
170
|
+
x.error && /* @__PURE__ */ H("div", {
|
|
171
|
+
role: "alert",
|
|
172
|
+
"data-testid": "record-list-filter-url-error",
|
|
173
|
+
style: {
|
|
174
|
+
padding: "7px 9px",
|
|
175
|
+
border: "1px solid var(--danger)",
|
|
176
|
+
borderRadius: 6,
|
|
177
|
+
color: "var(--danger)",
|
|
178
|
+
fontSize: 11.5
|
|
179
|
+
},
|
|
180
|
+
children: [x.error, " Showing this list without URL filters."]
|
|
181
|
+
}),
|
|
169
182
|
p.filters && p.filters.length > 0 && /* @__PURE__ */ V("div", {
|
|
170
183
|
style: {
|
|
171
184
|
display: "flex",
|
|
@@ -175,19 +188,19 @@ function U({ screenCode: t }) {
|
|
|
175
188
|
children: p.filters.map((e) => {
|
|
176
189
|
let t = m.fields.get(e);
|
|
177
190
|
if (!t?.values) return null;
|
|
178
|
-
let n = S?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", r = l(t, e, s.entities)
|
|
191
|
+
let n = S?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", r = l(t, e, s.entities), i = [{
|
|
192
|
+
value: "__all__",
|
|
193
|
+
label: `All ${r}`
|
|
194
|
+
}, ...t.values.map((e) => ({
|
|
195
|
+
value: e.code,
|
|
196
|
+
label: u(e.name) || e.code
|
|
197
|
+
}))];
|
|
179
198
|
return /* @__PURE__ */ V("div", {
|
|
180
199
|
style: { minWidth: 120 },
|
|
181
200
|
children: /* @__PURE__ */ V(a, {
|
|
182
201
|
value: n,
|
|
183
|
-
options:
|
|
184
|
-
|
|
185
|
-
label: `All ${r}`
|
|
186
|
-
}, ...t.values.map((e) => ({
|
|
187
|
-
value: e.code,
|
|
188
|
-
label: u(e.name) || e.code
|
|
189
|
-
}))],
|
|
190
|
-
onChange: (t) => pe(e, t),
|
|
202
|
+
options: i,
|
|
203
|
+
onChange: (t) => me(e, t),
|
|
191
204
|
placeholder: r
|
|
192
205
|
})
|
|
193
206
|
}, e);
|
|
@@ -201,7 +214,7 @@ function U({ screenCode: t }) {
|
|
|
201
214
|
fontSize: 11,
|
|
202
215
|
color: "var(--text-3)"
|
|
203
216
|
},
|
|
204
|
-
children: [/* @__PURE__ */ V("span", { children:
|
|
217
|
+
children: [/* @__PURE__ */ V("span", { children: Y ? "Loading…" : `${J.length} ${u(m.display.name_plural)}` }), ye > 0 && /* @__PURE__ */ V("button", {
|
|
205
218
|
onClick: () => i((e) => {
|
|
206
219
|
let t = new URLSearchParams(e);
|
|
207
220
|
return t.delete("filters"), t;
|
|
@@ -223,12 +236,12 @@ function U({ screenCode: t }) {
|
|
|
223
236
|
style: {
|
|
224
237
|
flex: 1,
|
|
225
238
|
overflowY: "auto",
|
|
226
|
-
padding:
|
|
227
|
-
display:
|
|
239
|
+
padding: T === "cards" ? 10 : 0,
|
|
240
|
+
display: T === "cards" ? "flex" : "block",
|
|
228
241
|
flexDirection: "column",
|
|
229
|
-
gap:
|
|
242
|
+
gap: T === "cards" ? 10 : void 0
|
|
230
243
|
},
|
|
231
|
-
children:
|
|
244
|
+
children: Y ? /* @__PURE__ */ V("div", {
|
|
232
245
|
style: {
|
|
233
246
|
padding: 12,
|
|
234
247
|
display: "flex",
|
|
@@ -240,7 +253,7 @@ function U({ screenCode: t }) {
|
|
|
240
253
|
borderRadius: 6,
|
|
241
254
|
background: "var(--surface-3)"
|
|
242
255
|
} }, t))
|
|
243
|
-
}) :
|
|
256
|
+
}) : J.length === 0 ? /* @__PURE__ */ V("div", {
|
|
244
257
|
style: {
|
|
245
258
|
padding: 28,
|
|
246
259
|
textAlign: "center",
|
|
@@ -248,23 +261,23 @@ function U({ screenCode: t }) {
|
|
|
248
261
|
color: "var(--text-3)"
|
|
249
262
|
},
|
|
250
263
|
children: "No records found"
|
|
251
|
-
}) : /* @__PURE__ */ H(
|
|
252
|
-
let t = o(e[
|
|
253
|
-
return /* @__PURE__ */ V(
|
|
264
|
+
}) : /* @__PURE__ */ H(B, { children: [J.map((e) => {
|
|
265
|
+
let t = o(e[de]);
|
|
266
|
+
return /* @__PURE__ */ V(le, {
|
|
254
267
|
record: e,
|
|
255
268
|
entity: m,
|
|
256
269
|
columns: C,
|
|
257
|
-
card:
|
|
258
|
-
presentation:
|
|
259
|
-
refs:
|
|
270
|
+
card: N,
|
|
271
|
+
presentation: T,
|
|
272
|
+
refs: ue,
|
|
260
273
|
isSelected: t === v,
|
|
261
|
-
onClick: () =>
|
|
274
|
+
onClick: () => fe(t, { replace: w === "split" })
|
|
262
275
|
}, t);
|
|
263
|
-
}),
|
|
276
|
+
}), U && K.hasMore && /* @__PURE__ */ V("button", {
|
|
264
277
|
type: "button",
|
|
265
278
|
"data-testid": "record-list-load-more",
|
|
266
|
-
onClick: () => void
|
|
267
|
-
disabled:
|
|
279
|
+
onClick: () => void K.fetchNextPage(),
|
|
280
|
+
disabled: K.isFetchingNextPage,
|
|
268
281
|
style: {
|
|
269
282
|
width: "100%",
|
|
270
283
|
padding: "8px 12px",
|
|
@@ -273,15 +286,15 @@ function U({ screenCode: t }) {
|
|
|
273
286
|
border: "none",
|
|
274
287
|
borderTop: "1px solid var(--divider)",
|
|
275
288
|
color: "var(--text-2)",
|
|
276
|
-
cursor:
|
|
289
|
+
cursor: K.isFetchingNextPage ? "default" : "pointer"
|
|
277
290
|
},
|
|
278
|
-
children:
|
|
291
|
+
children: K.isFetchingNextPage ? "Loading…" : "Load more"
|
|
279
292
|
})] })
|
|
280
293
|
})]
|
|
281
294
|
}),
|
|
282
|
-
|
|
295
|
+
X && /* @__PURE__ */ V("div", {
|
|
283
296
|
"data-testid": "record-list-resize-handle",
|
|
284
|
-
onMouseDown:
|
|
297
|
+
onMouseDown: ve,
|
|
285
298
|
style: {
|
|
286
299
|
flex: "none",
|
|
287
300
|
width: 1,
|
|
@@ -292,13 +305,13 @@ function U({ screenCode: t }) {
|
|
|
292
305
|
onMouseEnter: (e) => e.currentTarget.style.background = "var(--border-strong)",
|
|
293
306
|
onMouseLeave: (e) => e.currentTarget.style.background = "var(--divider)"
|
|
294
307
|
}),
|
|
295
|
-
|
|
308
|
+
xe && /* @__PURE__ */ V("div", {
|
|
296
309
|
"data-testid": "record-detail-panel",
|
|
297
310
|
style: {
|
|
298
311
|
flex: 1,
|
|
299
312
|
minWidth: 0,
|
|
300
313
|
overflow: "hidden",
|
|
301
|
-
height:
|
|
314
|
+
height: w === "stacked" ? "50%" : "100%"
|
|
302
315
|
},
|
|
303
316
|
children: v ? /* @__PURE__ */ V(q, {
|
|
304
317
|
entityCode: g,
|
|
@@ -306,8 +319,8 @@ function U({ screenCode: t }) {
|
|
|
306
319
|
items: p.items,
|
|
307
320
|
schema: s,
|
|
308
321
|
entity: m,
|
|
309
|
-
onBackToList:
|
|
310
|
-
relatedRecordsPresentation:
|
|
322
|
+
onBackToList: Se,
|
|
323
|
+
relatedRecordsPresentation: oe
|
|
311
324
|
}, v) : /* @__PURE__ */ V("div", {
|
|
312
325
|
style: {
|
|
313
326
|
display: "flex",
|
|
@@ -329,7 +342,7 @@ function U({ screenCode: t }) {
|
|
|
329
342
|
]
|
|
330
343
|
});
|
|
331
344
|
}
|
|
332
|
-
function
|
|
345
|
+
function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs: o, isSelected: s, onClick: c }) {
|
|
333
346
|
let l = t();
|
|
334
347
|
if (a === "cards") {
|
|
335
348
|
let t = i.badgeFields.filter((t) => W(n, e, t)), r = i.bodyFields.filter((t) => W(n, e, t)), a = i.metaFields.filter((t) => W(n, e, t));
|
|
@@ -365,7 +378,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
365
378
|
color: "var(--text-3)",
|
|
366
379
|
overflowWrap: "anywhere"
|
|
367
380
|
},
|
|
368
|
-
children:
|
|
381
|
+
children: w({
|
|
369
382
|
entity: n,
|
|
370
383
|
fieldName: i.subtitleField,
|
|
371
384
|
record: e,
|
|
@@ -390,7 +403,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
390
403
|
maxWidth: "100%",
|
|
391
404
|
overflowWrap: "anywhere"
|
|
392
405
|
},
|
|
393
|
-
children:
|
|
406
|
+
children: w({
|
|
394
407
|
entity: n,
|
|
395
408
|
fieldName: t,
|
|
396
409
|
record: e,
|
|
@@ -428,7 +441,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
428
441
|
minWidth: 0,
|
|
429
442
|
overflowWrap: "anywhere"
|
|
430
443
|
},
|
|
431
|
-
children:
|
|
444
|
+
children: w({
|
|
432
445
|
entity: n,
|
|
433
446
|
fieldName: t,
|
|
434
447
|
record: e,
|
|
@@ -474,7 +487,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
474
487
|
whiteSpace: "nowrap",
|
|
475
488
|
color: "var(--text)"
|
|
476
489
|
},
|
|
477
|
-
children:
|
|
490
|
+
children: w({
|
|
478
491
|
entity: n,
|
|
479
492
|
fieldName: u,
|
|
480
493
|
record: e,
|
|
@@ -497,7 +510,7 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
497
510
|
textOverflow: "ellipsis",
|
|
498
511
|
whiteSpace: "nowrap"
|
|
499
512
|
},
|
|
500
|
-
children:
|
|
513
|
+
children: w({
|
|
501
514
|
entity: n,
|
|
502
515
|
fieldName: d,
|
|
503
516
|
record: e,
|
|
@@ -512,9 +525,9 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
512
525
|
gap: 4,
|
|
513
526
|
flexShrink: 0
|
|
514
527
|
},
|
|
515
|
-
children: f.map((t) =>
|
|
528
|
+
children: f.map((t) => v(n, e, t) == null ? null : /* @__PURE__ */ V("div", {
|
|
516
529
|
style: { fontSize: 11 },
|
|
517
|
-
children:
|
|
530
|
+
children: w({
|
|
518
531
|
entity: n,
|
|
519
532
|
fieldName: t,
|
|
520
533
|
record: e,
|
|
@@ -528,11 +541,18 @@ function ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
|
|
|
528
541
|
});
|
|
529
542
|
}
|
|
530
543
|
function W(e, t, n) {
|
|
531
|
-
let r =
|
|
544
|
+
let r = v(e, t, n);
|
|
532
545
|
return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
|
|
533
546
|
}
|
|
534
547
|
function G({ entity: e, record: n, field: i, refs: a }) {
|
|
535
|
-
let o = t(), s = r(n, e)
|
|
548
|
+
let o = t(), s = r(n, e), c = i ? w({
|
|
549
|
+
entity: e,
|
|
550
|
+
fieldName: i,
|
|
551
|
+
record: n,
|
|
552
|
+
mode: "display",
|
|
553
|
+
refs: a,
|
|
554
|
+
locale: o
|
|
555
|
+
}) : s;
|
|
536
556
|
return /* @__PURE__ */ V("div", {
|
|
537
557
|
style: {
|
|
538
558
|
fontSize: 13.5,
|
|
@@ -540,21 +560,14 @@ function G({ entity: e, record: n, field: i, refs: a }) {
|
|
|
540
560
|
color: "var(--text)",
|
|
541
561
|
overflowWrap: "anywhere"
|
|
542
562
|
},
|
|
543
|
-
children:
|
|
544
|
-
entity: e,
|
|
545
|
-
fieldName: i,
|
|
546
|
-
record: n,
|
|
547
|
-
mode: "display",
|
|
548
|
-
refs: a,
|
|
549
|
-
locale: o
|
|
550
|
-
}) : s) || u(e.display.name)
|
|
563
|
+
children: c || u(e.display.name)
|
|
551
564
|
});
|
|
552
565
|
}
|
|
553
566
|
function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
554
|
-
let a =
|
|
567
|
+
let a = v(e, t, n);
|
|
555
568
|
if (a == null || a === "") return null;
|
|
556
569
|
let o = e.fields.get(n);
|
|
557
|
-
return o ? /* @__PURE__ */ H(
|
|
570
|
+
return o ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("dt", {
|
|
558
571
|
style: {
|
|
559
572
|
color: "var(--text-3)",
|
|
560
573
|
fontSize: 11.5,
|
|
@@ -570,7 +583,7 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
|
|
|
570
583
|
minWidth: 0,
|
|
571
584
|
overflowWrap: "anywhere"
|
|
572
585
|
},
|
|
573
|
-
children:
|
|
586
|
+
children: w({
|
|
574
587
|
entity: e,
|
|
575
588
|
fieldName: n,
|
|
576
589
|
record: t,
|
|
@@ -592,34 +605,34 @@ function q({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackT
|
|
|
592
605
|
}) });
|
|
593
606
|
}
|
|
594
607
|
function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackToList: d, relatedRecordsPresentation: f }) {
|
|
595
|
-
let h = m(l, "update"),
|
|
608
|
+
let h = m(l, "update"), te = R(() => n ? c(l, n) : void 0, [n, l]), { data: re, isLoading: ie } = C(t, te), w = ne(t), E = i(), [D, O] = se(!1), [k, A] = se({}), j = re?.data, ae = j?.$statuses, M = j?.$properties, P = N(t, n), L = oe(t, n), z = R(() => {
|
|
596
609
|
let e = /* @__PURE__ */ new Set();
|
|
597
610
|
for (let [t, n] of l.fields) !n.auto && !n.primary && e.add(t);
|
|
598
611
|
for (let [t] of l.files ?? []) e.add(t);
|
|
599
612
|
return e;
|
|
600
|
-
}, [l]),
|
|
613
|
+
}, [l]), ce = I(() => {
|
|
601
614
|
if (j) {
|
|
602
615
|
let e = {};
|
|
603
|
-
|
|
604
|
-
let n =
|
|
605
|
-
e[t] =
|
|
616
|
+
z.forEach((t) => {
|
|
617
|
+
let n = v(l, j, t);
|
|
618
|
+
e[t] = y(l, t) ? n ?? null : n ?? "";
|
|
606
619
|
}), A(e);
|
|
607
620
|
}
|
|
608
621
|
O(!0);
|
|
609
622
|
}, [
|
|
610
623
|
j,
|
|
611
|
-
|
|
624
|
+
z,
|
|
612
625
|
l
|
|
613
|
-
]), U =
|
|
626
|
+
]), U = I(async () => {
|
|
614
627
|
await E.flushAllDrafts(), O(!1), A({});
|
|
615
|
-
}, [E]),
|
|
616
|
-
let e = {}, t =
|
|
628
|
+
}, [E]), le = I(() => {
|
|
629
|
+
let e = {}, t = x({
|
|
617
630
|
entity: l,
|
|
618
631
|
formData: k,
|
|
619
632
|
record: j,
|
|
620
633
|
isNew: !1
|
|
621
|
-
}), r =
|
|
622
|
-
for (let [t, n] of Object.entries(k)) l.files?.has(t) || (e[t] =
|
|
634
|
+
}), r = S(t);
|
|
635
|
+
for (let [t, n] of Object.entries(k)) l.files?.has(t) || (e[t] = T(l, t, n));
|
|
623
636
|
if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0) {
|
|
624
637
|
O(!1), A({});
|
|
625
638
|
return;
|
|
@@ -640,15 +653,15 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
640
653
|
l,
|
|
641
654
|
k,
|
|
642
655
|
j
|
|
643
|
-
]), W =
|
|
656
|
+
]), W = I((e, t) => {
|
|
644
657
|
A((n) => ({
|
|
645
658
|
...n,
|
|
646
659
|
[e]: t
|
|
647
660
|
}));
|
|
648
661
|
}, []);
|
|
649
|
-
if (
|
|
662
|
+
if (ie) return /* @__PURE__ */ V(b, {});
|
|
650
663
|
if (!j) return null;
|
|
651
|
-
let G = r(j, l), K = l.display?.display_field, q = G ? void 0 : K ? j[K] : j[l.fields.names()[0]], J = G || (q != null && typeof q != "object" ? o(q) : u(l.display.name)),
|
|
664
|
+
let G = r(j, l), K = l.display?.display_field, q = G ? void 0 : K ? j[K] : j[l.fields.names()[0]], J = G || (q != null && typeof q != "object" ? o(q) : u(l.display.name)), ue = j?.$refs, Y = {
|
|
652
665
|
schema: s,
|
|
653
666
|
entity: l,
|
|
654
667
|
entityCode: t,
|
|
@@ -660,19 +673,19 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
660
673
|
isNew: !1,
|
|
661
674
|
mode: D ? "edit" : "display",
|
|
662
675
|
onFieldChange: D ? W : void 0,
|
|
663
|
-
refs:
|
|
664
|
-
objectProperties:
|
|
665
|
-
onSetProperty: h ? (e, t) =>
|
|
676
|
+
refs: ue,
|
|
677
|
+
objectProperties: M ?? void 0,
|
|
678
|
+
onSetProperty: h ? (e, t) => L.mutate({
|
|
666
679
|
propertyCode: e,
|
|
667
680
|
value: t
|
|
668
681
|
}) : void 0,
|
|
669
|
-
isPropertyPending:
|
|
670
|
-
objectStatuses:
|
|
671
|
-
onSetStatus: h ? (e, t) =>
|
|
682
|
+
isPropertyPending: L.isPending,
|
|
683
|
+
objectStatuses: ae ?? void 0,
|
|
684
|
+
onSetStatus: h ? (e, t) => P.mutate({
|
|
672
685
|
groupCode: e,
|
|
673
686
|
statusCode: t
|
|
674
687
|
}) : void 0,
|
|
675
|
-
isStatusPending:
|
|
688
|
+
isStatusPending: P.isPending,
|
|
676
689
|
relatedRecordsPresentation: f
|
|
677
690
|
};
|
|
678
691
|
return /* @__PURE__ */ H("div", {
|
|
@@ -714,7 +727,7 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
714
727
|
icon: /* @__PURE__ */ V(e.back, { size: 14 }),
|
|
715
728
|
title: "Back to list",
|
|
716
729
|
onClick: d
|
|
717
|
-
}), h && (D ? /* @__PURE__ */ H(
|
|
730
|
+
}), h && (D ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(_, {
|
|
718
731
|
size: "xs",
|
|
719
732
|
icon: /* @__PURE__ */ V(e.x, { size: 12 }),
|
|
720
733
|
onClick: U,
|
|
@@ -723,13 +736,13 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
723
736
|
kind: "primary",
|
|
724
737
|
size: "xs",
|
|
725
738
|
icon: w.isPending ? /* @__PURE__ */ V(p, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
|
|
726
|
-
onClick:
|
|
739
|
+
onClick: le,
|
|
727
740
|
disabled: w.isPending,
|
|
728
741
|
children: w.isPending ? "Saving…" : "Save"
|
|
729
742
|
})] }) : /* @__PURE__ */ V(_, {
|
|
730
743
|
size: "xs",
|
|
731
744
|
icon: /* @__PURE__ */ V(e.edit, { size: 12 }),
|
|
732
|
-
onClick:
|
|
745
|
+
onClick: ce,
|
|
733
746
|
children: "Edit"
|
|
734
747
|
}))]
|
|
735
748
|
})]
|
|
@@ -742,9 +755,9 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
|
|
|
742
755
|
flexDirection: "column",
|
|
743
756
|
gap: 12
|
|
744
757
|
},
|
|
745
|
-
children: a && a.length > 0 ? /* @__PURE__ */ V(
|
|
758
|
+
children: a && a.length > 0 ? /* @__PURE__ */ V(F, {
|
|
746
759
|
nodes: a,
|
|
747
|
-
ctx:
|
|
760
|
+
ctx: Y
|
|
748
761
|
}) : /* @__PURE__ */ H("p", {
|
|
749
762
|
style: {
|
|
750
763
|
fontSize: 12.5,
|