@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.
Files changed (47) hide show
  1. package/dist-lib/{DraggableChildrenTable-BDnJK0AU.js → DraggableChildrenTable-p2ZSdwzj.js} +2 -2
  2. package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
  3. package/dist-lib/{Grid-CcCveEE7.js → Grid-CjLFAKMZ.js} +2 -2
  4. package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-X3p4yfo_.js} +598 -585
  5. package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-Sb7zcvj0.js} +10 -10
  6. package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-Cnl9nE0x.js} +268 -238
  7. package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-bb0UNOII.js} +545 -532
  8. package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-BFh8auUZ.js} +171 -158
  9. package/dist-lib/api/agents.d.ts +47 -18
  10. package/dist-lib/components/agents/AgentChatPanel.d.ts +7 -1
  11. package/dist-lib/components/agents/AgentPicker.d.ts +9 -0
  12. package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
  13. package/dist-lib/components/file-widgets/host.d.ts +1 -0
  14. package/dist-lib/components/list/QuickPeek.d.ts +1 -1
  15. package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
  16. package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
  17. package/dist-lib/components/primitives/Tooltip.d.ts +4 -0
  18. package/dist-lib/components/shared/ResponsiveActionBar.d.ts +10 -5
  19. package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
  20. package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
  21. package/dist-lib/declarion-react.css +1 -1
  22. package/dist-lib/hooks/useAgentConversation.d.ts +10 -24
  23. package/dist-lib/hooks/useBrandingChrome.d.ts +11 -0
  24. package/dist-lib/hooks/useFilters.d.ts +1 -0
  25. package/dist-lib/hooks/useLongPress.d.ts +29 -0
  26. package/dist-lib/hooks/useResponsiveMode.d.ts +2 -21
  27. package/dist-lib/icons.js +1 -1
  28. package/dist-lib/index.d.ts +10 -3
  29. package/dist-lib/index.js +3305 -2741
  30. package/dist-lib/lib/actions.d.ts +13 -5
  31. package/dist-lib/lib/filter-evaluator.d.ts +16 -0
  32. package/dist-lib/lib/filters.d.ts +10 -4
  33. package/dist-lib/lib/longPressGesture.d.ts +55 -0
  34. package/dist-lib/lib/messages.d.ts +1 -0
  35. package/dist-lib/lib/page-inset.d.ts +3 -0
  36. package/dist-lib/lib/variants.d.ts +7 -0
  37. package/dist-lib/lib/viewport-category.d.ts +44 -0
  38. package/dist-lib/{registry-DJKp0yaV.js → registry-CWDnxiLJ.js} +1291 -1008
  39. package/dist-lib/testing.js +10 -10
  40. package/dist-lib/types/api.d.ts +15 -2
  41. package/dist-lib/types/schema.d.ts +26 -0
  42. package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-BshVTPVq.js} +1124 -1088
  43. package/dist-lib/{useProperties-TlltWwLv.js → useProperties-B5p9mIH8.js} +92 -61
  44. package/dist-lib/{value-CHY7LgZ-.js → value-B1O6QikE.js} +1 -1
  45. package/dist-lib/vite/index.js +23 -22
  46. package/package.json +12 -12
  47. package/dist-lib/components/agents/AgentVisualHints.d.ts +0 -6
@@ -1,140 +1,141 @@
1
- import { s as e } from "./DynamicIcon-DeRpAaXm.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, rr as te, rt as g, ur as _ } from "./useCurrentScreen-A3xZDs7U.js";
3
- import { G as v, K as y, U as b, W as x, Y as S, _ as ne, a as C, c as w, k as T, q as E, s as D, w as re } from "./registry-DJKp0yaV.js";
4
- import { _ as O, c as k, f as A, h as j, m as ie, n as M, p as N, r as P, x as F } from "./useProperties-TlltWwLv.js";
5
- import { t as I } from "./LayoutRenderer-BReuhVdX.js";
6
- import { useCallback as L, useEffect as R, useMemo as z, useRef as B, useState as ae } from "react";
7
- import { useSearchParams as oe } from "react-router";
8
- import { Fragment as se, jsx as V, jsxs as H } from "react/jsx-runtime";
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] = oe(), { 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()), O(p?.route);
13
- let _ = ne(), v = r.get("selected") ?? null, y = r.get("search") ?? "", b = h(y, 300), x = r.get("sort") ?? p?.sort_default ?? "", S = z(() => {
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]), E = z(() => {
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]), re = p?.responsive?.[c.category]?.layout?.related_records, M = z(() => D({
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]), P = z(() => w({
22
+ }), [m, p]), F = R(() => re({
26
23
  entity: m,
27
24
  screen: p,
28
- presentation: E,
25
+ presentation: T,
29
26
  visibleColumns: C,
30
- card: M,
31
- sort: x
27
+ card: N,
28
+ sort: b
32
29
  }), [
33
30
  m,
34
31
  p,
35
- E,
32
+ T,
36
33
  C,
37
- M,
38
- x
39
- ]), I = m?.list_pagination === "cursor", { data: U, isLoading: W } = d(g, {
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: x || void 0,
43
- search: b || void 0,
44
- filters: S,
45
- select: P.selectFields,
46
- expand: P.expandFields,
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
- }, !I), G = F(g, {
50
- sort: x || void 0,
51
- search: b || void 0,
52
- filters: S,
53
- select: P.selectFields,
54
- expand: P.expandFields,
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
- }, I), K = I ? G.rows : U?.data ?? [], J = I ? G.refs : U?.$refs, le = I ? G.isLoading : W, ue = z(() => m?.fields.names().find((e) => m.fields.get(e)?.primary) ?? "id", [m]), de = L((e, t) => {
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]), fe = L((e) => {
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]), pe = L((e, t) => {
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__" ? [...N(i, e), k(e, t)] : N(i, e), ie(a, r), r;
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]), Y = (p?.list_resizable ?? !1) && T === "split" && c.category !== "phone" && !c.touch, me = B(null), [X, Z] = ae(null), Q = B(!1), $ = p?.list_width;
74
- R(() => {
75
- !Y || !$?.endsWith("%") || Z(null);
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
- Y,
74
+ X,
78
75
  $,
79
76
  c.width,
80
77
  c.height
81
- ]), R(() => {
82
- if (!Y || X !== null) return;
83
- let e = me.current;
84
- if (e) if ($ && $.endsWith("%")) {
85
- let t = parseFloat($) / 100;
86
- Z(Math.round(e.getBoundingClientRect().width * t));
87
- } else Z($ && parseInt($, 10) || 320);
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 he = B(null);
95
- R(() => () => {
96
- he.current?.();
93
+ let _e = z(null);
94
+ L(() => () => {
95
+ _e.current?.();
97
96
  }, []);
98
- let ge = L((e) => {
99
- e.preventDefault(), Q.current = !0;
100
- let t = e.clientX, n = X ?? 320, r = (e) => {
101
- if (!Q.current) return;
102
- let r = (me.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
103
- Z(i);
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
- Q.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", he.current = null;
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), he.current = i;
108
- }, [X]);
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 _e = S?.length ?? 0, ve = T === "split" || T === "stacked" || !v, ye = T === "split" || T === "stacked" || !!v, be = T !== "split" && v ? () => de(null, { replace: !0 }) : void 0, xe = T === "split" ? Y && X !== null ? X : p.list_width ?? "320px" : "100%";
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: me,
113
- "data-record-list-presentation": T,
111
+ ref: he,
112
+ "data-record-list-presentation": w,
114
113
  style: {
115
114
  display: "flex",
116
- flexDirection: T === "stacked" ? "column" : "row",
115
+ flexDirection: w === "stacked" ? "column" : "row",
117
116
  height: "100%",
118
117
  minWidth: 0,
119
118
  overflow: "hidden"
120
119
  },
121
120
  children: [
122
- ve && /* @__PURE__ */ H("div", {
121
+ be && /* @__PURE__ */ H("div", {
123
122
  "data-testid": "record-list-panel",
124
123
  style: {
125
- flex: T === "split" ? "none" : "1 1 auto",
124
+ flex: w === "split" ? "none" : "1 1 auto",
126
125
  display: "flex",
127
126
  flexDirection: "column",
128
127
  overflow: "hidden",
129
- borderRight: T === "split" && !Y ? "1px solid var(--divider)" : "none",
130
- borderBottom: T === "stacked" ? "1px solid var(--divider)" : "none",
131
- width: xe,
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: T === "stacked" ? "50%" : "100%"
132
+ height: w === "stacked" ? "50%" : "100%"
134
133
  },
135
134
  children: [/* @__PURE__ */ H("div", {
136
135
  style: {
137
- padding: 12,
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: y,
165
- onChange: fe,
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
- value: "__all__",
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: le ? "Loading…" : `${K.length} ${u(m.display.name_plural)}` }), _e > 0 && /* @__PURE__ */ V("button", {
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: E === "cards" ? 10 : 0,
227
- display: E === "cards" ? "flex" : "block",
239
+ padding: T === "cards" ? 10 : 0,
240
+ display: T === "cards" ? "flex" : "block",
228
241
  flexDirection: "column",
229
- gap: E === "cards" ? 10 : void 0
242
+ gap: T === "cards" ? 10 : void 0
230
243
  },
231
- children: le ? /* @__PURE__ */ V("div", {
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
- }) : K.length === 0 ? /* @__PURE__ */ V("div", {
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(se, { children: [K.map((e) => {
252
- let t = o(e[ue]);
253
- return /* @__PURE__ */ V(ce, {
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: M,
258
- presentation: E,
259
- refs: J,
270
+ card: N,
271
+ presentation: T,
272
+ refs: ue,
260
273
  isSelected: t === v,
261
- onClick: () => de(t, { replace: T === "split" })
274
+ onClick: () => fe(t, { replace: w === "split" })
262
275
  }, t);
263
- }), I && G.hasMore && /* @__PURE__ */ V("button", {
276
+ }), U && K.hasMore && /* @__PURE__ */ V("button", {
264
277
  type: "button",
265
278
  "data-testid": "record-list-load-more",
266
- onClick: () => void G.fetchNextPage(),
267
- disabled: G.isFetchingNextPage,
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: G.isFetchingNextPage ? "default" : "pointer"
289
+ cursor: K.isFetchingNextPage ? "default" : "pointer"
277
290
  },
278
- children: G.isFetchingNextPage ? "Loading…" : "Load more"
291
+ children: K.isFetchingNextPage ? "Loading…" : "Load more"
279
292
  })] })
280
293
  })]
281
294
  }),
282
- Y && /* @__PURE__ */ V("div", {
295
+ X && /* @__PURE__ */ V("div", {
283
296
  "data-testid": "record-list-resize-handle",
284
- onMouseDown: ge,
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
- ye && /* @__PURE__ */ V("div", {
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: T === "stacked" ? "50%" : "100%"
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: be,
310
- relatedRecordsPresentation: re
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 ce({ record: e, entity: n, columns: r, card: i, presentation: a, refs: o, isSelected: s, onClick: c }) {
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: E({
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: E({
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: E({
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: E({
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: E({
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) => y(n, e, t) == null ? null : /* @__PURE__ */ V("div", {
528
+ children: f.map((t) => v(n, e, t) == null ? null : /* @__PURE__ */ V("div", {
516
529
  style: { fontSize: 11 },
517
- children: E({
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 = y(e, t, n);
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: (i ? E({
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 = y(e, t, n);
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(se, { children: [/* @__PURE__ */ V("dt", {
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: E({
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"), { data: te, isLoading: ne } = C(t, z(() => n ? c(l, n) : void 0, [n, l])), w = T(t), E = i(), [D, O] = ae(!1), [k, A] = ae({}), j = te?.data, ie = j?.$statuses, N = j?.$properties, F = P(t, n), R = M(t, n), B = z(() => {
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]), oe = L(() => {
613
+ }, [l]), ce = I(() => {
601
614
  if (j) {
602
615
  let e = {};
603
- B.forEach((t) => {
604
- let n = y(l, j, t);
605
- e[t] = v(l, t) ? n ?? null : n ?? "";
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
- B,
624
+ z,
612
625
  l
613
- ]), U = L(async () => {
626
+ ]), U = I(async () => {
614
627
  await E.flushAllDrafts(), O(!1), A({});
615
- }, [E]), ce = L(() => {
616
- let e = {}, t = b({
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 = x(t);
622
- for (let [t, n] of Object.entries(k)) l.files?.has(t) || (e[t] = S(l, t, n));
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 = L((e, t) => {
656
+ ]), W = I((e, t) => {
644
657
  A((n) => ({
645
658
  ...n,
646
659
  [e]: t
647
660
  }));
648
661
  }, []);
649
- if (ne) return /* @__PURE__ */ V(re, {});
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)), le = j?.$refs, ue = {
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: le,
664
- objectProperties: N ?? void 0,
665
- onSetProperty: h ? (e, t) => R.mutate({
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: R.isPending,
670
- objectStatuses: ie ?? void 0,
671
- onSetStatus: h ? (e, t) => F.mutate({
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: F.isPending,
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(se, { children: [/* @__PURE__ */ V(_, {
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: ce,
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: oe,
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(I, {
758
+ children: a && a.length > 0 ? /* @__PURE__ */ V(F, {
746
759
  nodes: a,
747
- ctx: ue
760
+ ctx: Y
748
761
  }) : /* @__PURE__ */ H("p", {
749
762
  style: {
750
763
  fontSize: 12.5,