@declarion/react 0.48.2 → 0.49.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 (84) hide show
  1. package/dist-lib/Check-DAfMbQIw.js +38 -0
  2. package/dist-lib/{DraggableChildrenTable-p2ZSdwzj.js → DraggableChildrenTable-B98Md-Yq.js} +30 -30
  3. package/dist-lib/{Grid-CjLFAKMZ.js → Grid-BdtEd4R9.js} +2 -2
  4. package/dist-lib/{LayoutRenderer-DCscqXsv.js → LayoutRenderer-oVU3nEb5.js} +600 -597
  5. package/dist-lib/ListCardsBody-DYMt1H8l.js +287 -0
  6. package/dist-lib/{MarkdownRenderer-Sb7zcvj0.js → MarkdownRenderer-E9hbyoUn.js} +1 -1
  7. package/dist-lib/RefreshControl-B_2eW53M.js +430 -0
  8. package/dist-lib/{SmartDetailPage.impl-BAW-Tx_H.js → SmartDetailPage.impl-Dg22HOxb.js} +520 -515
  9. package/dist-lib/SmartListPage.impl-CPhhXT5S.js +2849 -0
  10. package/dist-lib/{SmartRecordListPage.impl-DtSSlGrI.js → SmartRecordListPage.impl-CF0UKgUj.js} +243 -240
  11. package/dist-lib/SortHeaderMenu-DodGvb7A.js +106 -0
  12. package/dist-lib/action-dispatch-CYOw7nkP.js +1984 -0
  13. package/dist-lib/api/batch.d.ts +5 -2
  14. package/dist-lib/api/data.d.ts +35 -4
  15. package/dist-lib/api/entities.d.ts +3 -3
  16. package/dist-lib/cardProjection-D-AufCh-.js +757 -0
  17. package/dist-lib/components/{shared → actions}/ObjectActionBar.d.ts +1 -1
  18. package/dist-lib/components/{shared → actions}/ResponsiveActionBar.d.ts +1 -1
  19. package/dist-lib/components/fields/cells/factories/date.d.ts +2 -0
  20. package/dist-lib/components/file-widgets/upload.d.ts +6 -1
  21. package/dist-lib/components/layout/Layout.d.ts +1 -1
  22. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  23. package/dist-lib/components/pages/SmartListPage.d.ts +2 -12
  24. package/dist-lib/components/pages/SmartListPage.impl.d.ts +4 -0
  25. package/dist-lib/components/pages/list/ListCardRow.d.ts +40 -0
  26. package/dist-lib/components/pages/list/ListCardsBody.d.ts +34 -0
  27. package/dist-lib/components/pages/list/ListFloatbar.d.ts +1 -1
  28. package/dist-lib/components/pages/list/ListFooter.d.ts +26 -0
  29. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -1
  30. package/dist-lib/components/pages/list/ListNoRows.d.ts +32 -0
  31. package/dist-lib/components/pages/list/ListTable.d.ts +34 -0
  32. package/dist-lib/components/pages/list/ListTableRow.d.ts +18 -0
  33. package/dist-lib/components/pages/list/ListToolbar.d.ts +43 -0
  34. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +14 -0
  35. package/dist-lib/components/pages/list/page-size.d.ts +3 -0
  36. package/dist-lib/components/pages/list/sortable-header.d.ts +2 -0
  37. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +37 -0
  38. package/dist-lib/components/pages/list/useListQuery.d.ts +66 -0
  39. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +61 -0
  40. package/dist-lib/components/pages/list/useListSelection.d.ts +31 -0
  41. package/dist-lib/components/pages/list/useListSort.d.ts +45 -0
  42. package/dist-lib/components/pages/list/useListViews.d.ts +46 -0
  43. package/dist-lib/components/pages/list/useRowMenu.d.ts +1 -1
  44. package/dist-lib/components/shared/RefreshControl.d.ts +17 -4
  45. package/dist-lib/field-classification-DTgUnbzd.js +1134 -0
  46. package/dist-lib/format-count-DAHCcHZO.js +1551 -0
  47. package/dist-lib/hooks/useBrandingChrome.d.ts +17 -1
  48. package/dist-lib/hooks/useText.d.ts +3 -0
  49. package/dist-lib/hooks/useViews.d.ts +1 -1
  50. package/dist-lib/index.d.ts +17 -15
  51. package/dist-lib/index.js +1783 -6287
  52. package/dist-lib/lib/messages.d.ts +7 -1
  53. package/dist-lib/lib/rowClickGesture.d.ts +12 -0
  54. package/dist-lib/lib/timestamp.d.ts +8 -3
  55. package/dist-lib/peekDraftStore-CnxqkoWN.js +194 -0
  56. package/dist-lib/record-documents-key-DEFlLxnF.js +27 -0
  57. package/dist-lib/registry-WypUQQ7t.js +1768 -0
  58. package/dist-lib/testing.d.ts +17 -2
  59. package/dist-lib/testing.js +72 -58
  60. package/dist-lib/types/api.d.ts +54 -12
  61. package/dist-lib/types/schema.d.ts +22 -6
  62. package/dist-lib/{useCurrentScreen-BshVTPVq.js → useCurrentScreen-C5Oio-1G.js} +1125 -1068
  63. package/dist-lib/useListQuery-Dc2vbxqs.js +87 -0
  64. package/dist-lib/useProperties-C36ENFdY.js +81 -0
  65. package/dist-lib/{useProperties-DrHFr0A1.js → useTabSearchMirror-sIuYEFaq.js} +116 -194
  66. package/dist-lib/{value-B1O6QikE.js → value-igT4LsqW.js} +69 -69
  67. package/package.json +1 -1
  68. package/dist-lib/RefreshControl-Cnl9nE0x.js +0 -945
  69. package/dist-lib/registry-CCxnZW2b.js +0 -5281
  70. /package/dist-lib/components/{shared → actions}/ActionButton.d.ts +0 -0
  71. /package/dist-lib/components/{shared → actions}/ActionDialog.d.ts +0 -0
  72. /package/dist-lib/components/{shared → actions}/ActionResultDialog.d.ts +0 -0
  73. /package/dist-lib/components/{shared → actions}/ActionRunner.d.ts +0 -0
  74. /package/dist-lib/components/{mass-edit → actions}/PropertyGridEditor.d.ts +0 -0
  75. /package/dist-lib/components/{shared → actions}/RowActionsKebab.d.ts +0 -0
  76. /package/dist-lib/components/{shared → chrome}/AssociationTabs.d.ts +0 -0
  77. /package/dist-lib/components/{shared → chrome}/AuditMetaStrip.d.ts +0 -0
  78. /package/dist-lib/components/{shared → chrome}/Breadcrumbs.d.ts +0 -0
  79. /package/dist-lib/components/{shared → chrome}/HighlightsStrip.d.ts +0 -0
  80. /package/dist-lib/components/{shared → chrome}/PageHeader.d.ts +0 -0
  81. /package/dist-lib/components/{shared → chrome}/RecordHeader.d.ts +0 -0
  82. /package/dist-lib/components/{shell → layout}/CommandPalette.d.ts +0 -0
  83. /package/dist-lib/components/{columns → list}/ColumnPicker.d.ts +0 -0
  84. /package/dist-lib/components/{views → list}/ViewSwitcher.d.ts +0 -0
@@ -1,114 +1,117 @@
1
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-CCxnZW2b.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-DrHFr0A1.js";
5
- import { t as F } from "./LayoutRenderer-DCscqXsv.js";
6
- import { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as se } from "react";
2
+ import { $n as t, A as n, At as r, Dn as i, F as a, In as o, Jn as s, N as c, Sn as l, Tn as u, Zn as d, dr as f, fr as p, q as m, rr as ee, rt as h, wn as g, zn as te } from "./useCurrentScreen-C5Oio-1G.js";
3
+ import { a as _ } from "./registry-WypUQQ7t.js";
4
+ import { O as ne, c as re, f as v } from "./field-classification-DTgUnbzd.js";
5
+ import { f as y, h as b, p as x, u as S } from "./action-dispatch-CYOw7nkP.js";
6
+ import { d as C, m as w, n as T, p as E, t as D, u as O } from "./cardProjection-D-AufCh-.js";
7
+ import { c as k, f as A, h as j, m as M, n as ie, t as ae } from "./useTabSearchMirror-sIuYEFaq.js";
8
+ import { n as oe, r as N } from "./useProperties-C36ENFdY.js";
9
+ import { t as P } from "./LayoutRenderer-oVU3nEb5.js";
10
+ import { t as se } from "./useListQuery-Dc2vbxqs.js";
11
+ import { useCallback as F, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
7
12
  import { useSearchParams as ce } from "react-router";
8
13
  import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
9
14
  //#region src/components/pages/SmartRecordListPage.impl.tsx
15
+ var le = 200;
10
16
  function U({ screenCode: t }) {
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(() => {
14
- let e = p?.responsive?.[c.category]?.presentation;
17
+ let [n, a] = ce(), { data: o } = r(), c = ee(), l = o?.screens[t], u = l?.entity ? o?.entities[l.entity] : void 0, p = l?.entity;
18
+ ie(l, u, n.toString()), ae(l?.route);
19
+ let h = re(), _ = n.get("selected") ?? null, v = n.get("search") ?? "", y = m(v, 300), b = n.get("sort") ?? l?.sort_default ?? "", x = L(() => A(n), [n]), S = x.filters.length > 0 ? x.filters : void 0, C = L(() => l?.columns ?? u?.fields.names().filter((e) => !u.fields.get(e)?.primary && !u.fields.get(e)?.auto && u.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [l?.columns, u]), w = L(() => {
20
+ let e = l?.responsive?.[c.category]?.presentation;
15
21
  return c.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
16
- }, [p?.responsive, c.category]), T = R(() => {
17
- let e = p?.responsive?.[c.category];
22
+ }, [l?.responsive, c.category]), E = L(() => {
23
+ let e = l?.responsive?.[c.category];
18
24
  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";
19
- }, [p?.responsive, c.category]), oe = p?.responsive?.[c.category]?.layout?.related_records, N = R(() => E({
20
- entity: m,
21
- screen: p
22
- }), [m, p]), F = R(() => re({
23
- entity: m,
24
- screen: p,
25
- presentation: T,
25
+ }, [l?.responsive, c.category]), oe = l?.responsive?.[c.category]?.layout?.related_records, N = L(() => D({
26
+ entity: u,
27
+ screen: l
28
+ }), [u, l]), P = L(() => T({
29
+ entity: u,
30
+ screen: l,
31
+ presentation: E,
26
32
  visibleColumns: C,
27
33
  card: N,
28
34
  sort: b
29
35
  }), [
30
- m,
31
- p,
32
- T,
36
+ u,
37
+ l,
38
+ E,
33
39
  C,
34
40
  N,
35
41
  b
36
- ]), U = m?.list_pagination === "cursor", { data: W, isLoading: G } = d(g, {
42
+ ]), U = se({
43
+ entity: u,
44
+ entityCode: p,
45
+ screen: l,
46
+ screenCode: t,
37
47
  page: 1,
38
- per_page: 200,
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,
44
- preview: !0,
45
- screen: p?.fixed_filters ? t : void 0
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,
52
- preview: !0,
53
- screen: p?.fixed_filters ? t : void 0,
54
- limit: 200
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) => {
56
- i((t) => {
48
+ perPage: le,
49
+ sortForRequest: O(b),
50
+ debouncedSearch: y,
51
+ filters: x.filters,
52
+ filterError: !!x.error,
53
+ includeDeleted: !1,
54
+ expand: P.expandFields,
55
+ select: P.selectFields,
56
+ runCountQuery: !1,
57
+ urlKey: `${p ?? ""}|${n.toString()}`
58
+ }), W = U.rows, G = U.refs, K = U.isLoading, q = L(() => u?.fields.names().find((e) => u.fields.get(e)?.primary) ?? "id", [u]), J = F((e, t) => {
59
+ a((t) => {
57
60
  let n = new URLSearchParams(t);
58
61
  return e ? n.set("selected", e) : n.delete("selected"), n;
59
62
  }, { replace: t?.replace ?? !0 });
60
- }, [i]), pe = I((e) => {
61
- i((t) => {
63
+ }, [a]), fe = F((e) => {
64
+ a((t) => {
62
65
  let n = new URLSearchParams(t);
63
66
  return e ? n.set("search", e) : n.delete("search"), n;
64
67
  }, { replace: !0 });
65
- }, [i]), me = I((e, t) => {
66
- i((n) => {
68
+ }, [a]), pe = F((e, t) => {
69
+ a((n) => {
67
70
  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;
71
+ return a = t && t !== "__all__" ? [...M(i, e), k(e, t)] : M(i, e), j(a, r), r;
69
72
  }, { replace: !0 });
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);
73
+ }, [a]), Y = (l?.list_resizable ?? !1) && w === "split" && c.category !== "phone" && !c.touch, me = R(null), [X, Z] = z(null), he = R(!1), Q = l?.list_width;
74
+ I(() => {
75
+ !Y || !Q?.endsWith("%") || Z(null);
73
76
  }, [
74
- X,
75
- $,
77
+ Y,
78
+ Q,
76
79
  c.width,
77
80
  c.height
78
- ]), L(() => {
79
- if (!X || Z !== null) return;
80
- let e = he.current;
81
+ ]), I(() => {
82
+ if (!Y || X !== null) return;
83
+ let e = me.current;
81
84
  if (e) {
82
- if ($ && $.endsWith("%")) {
83
- let t = parseFloat($) / 100;
84
- Q(Math.round(e.getBoundingClientRect().width * t));
85
- } else Q($ && parseInt($, 10) || 320);
85
+ if (Q && Q.endsWith("%")) {
86
+ let t = parseFloat(Q) / 100;
87
+ Z(Math.round(e.getBoundingClientRect().width * t));
88
+ } else Z(Q && parseInt(Q, 10) || 320);
86
89
  }
87
90
  }, [
91
+ Y,
92
+ Q,
88
93
  X,
89
- $,
90
- Z,
91
- m
94
+ u
92
95
  ]);
93
- let _e = z(null);
94
- L(() => () => {
95
- _e.current?.();
96
+ let $ = R(null);
97
+ I(() => () => {
98
+ $.current?.();
96
99
  }, []);
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);
100
+ let ge = F((e) => {
101
+ e.preventDefault(), he.current = !0;
102
+ let t = e.clientX, n = X ?? 320, r = (e) => {
103
+ if (!he.current) return;
104
+ let r = (me.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
105
+ Z(i);
103
106
  }, i = () => {
104
- ge.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", _e.current = null;
107
+ he.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", $.current = null;
105
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]);
108
- if (!s || !p || !m) return null;
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%";
109
+ document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), $.current = i;
110
+ }, [X]);
111
+ if (!o || !l || !u) return null;
112
+ let _e = S?.length ?? 0, ve = w === "split" || w === "stacked" || !_, ye = w === "split" || w === "stacked" || !!_, be = w !== "split" && _ ? () => J(null, { replace: !0 }) : void 0, xe = w === "split" ? Y && X !== null ? X : l.list_width ?? "320px" : "100%";
110
113
  return /* @__PURE__ */ H("div", {
111
- ref: he,
114
+ ref: me,
112
115
  "data-record-list-presentation": w,
113
116
  style: {
114
117
  display: "flex",
@@ -118,16 +121,16 @@ function U({ screenCode: t }) {
118
121
  overflow: "hidden"
119
122
  },
120
123
  children: [
121
- be && /* @__PURE__ */ H("div", {
124
+ ve && /* @__PURE__ */ H("div", {
122
125
  "data-testid": "record-list-panel",
123
126
  style: {
124
127
  flex: w === "split" ? "none" : "1 1 auto",
125
128
  display: "flex",
126
129
  flexDirection: "column",
127
130
  overflow: "hidden",
128
- borderRight: w === "split" && !X ? "1px solid var(--divider)" : "none",
131
+ borderRight: w === "split" && !Y ? "1px solid var(--divider)" : "none",
129
132
  borderBottom: w === "stacked" ? "1px solid var(--divider)" : "none",
130
- width: Ce,
133
+ width: xe,
131
134
  minWidth: 0,
132
135
  height: w === "stacked" ? "50%" : "100%"
133
136
  },
@@ -135,36 +138,36 @@ function U({ screenCode: t }) {
135
138
  style: {
136
139
  paddingTop: 12,
137
140
  paddingBottom: 12,
138
- ...ie(12),
141
+ ...ne(12),
139
142
  display: "flex",
140
143
  flexDirection: "column",
141
144
  gap: 8,
142
145
  borderBottom: "1px solid var(--divider)"
143
146
  },
144
147
  children: [
145
- _.hasOriginBack && /* @__PURE__ */ H("div", {
148
+ h.hasOriginBack && /* @__PURE__ */ H("div", {
146
149
  style: {
147
150
  display: "flex",
148
151
  alignItems: "center",
149
152
  gap: 8
150
153
  },
151
- children: [/* @__PURE__ */ V(ee, {
154
+ children: [/* @__PURE__ */ V(f, {
152
155
  icon: /* @__PURE__ */ V(e.back, { size: 14 }),
153
156
  title: "Back",
154
- onClick: _.goBack
157
+ onClick: h.goBack
155
158
  }), /* @__PURE__ */ V("span", {
156
159
  style: {
157
160
  fontSize: 12.5,
158
161
  fontWeight: 600,
159
162
  color: "var(--text)"
160
163
  },
161
- children: u(p.display?.name) || u(m.display.name_plural)
164
+ children: i(l.display?.name) || i(u.display.name_plural)
162
165
  })]
163
166
  }),
164
- /* @__PURE__ */ V(f, {
165
- value: ne,
166
- onChange: pe,
167
- placeholder: `Search ${u(m.display.name_plural)}…`,
167
+ /* @__PURE__ */ V(d, {
168
+ value: v,
169
+ onChange: fe,
170
+ placeholder: `Search ${i(u.display.name_plural)}…`,
168
171
  prefix: /* @__PURE__ */ V(e.search, { size: 13 })
169
172
  }),
170
173
  x.error && /* @__PURE__ */ H("div", {
@@ -179,28 +182,28 @@ function U({ screenCode: t }) {
179
182
  },
180
183
  children: [x.error, " Showing this list without URL filters."]
181
184
  }),
182
- p.filters && p.filters.length > 0 && /* @__PURE__ */ V("div", {
185
+ l.filters && l.filters.length > 0 && /* @__PURE__ */ V("div", {
183
186
  style: {
184
187
  display: "flex",
185
188
  flexWrap: "wrap",
186
189
  gap: 6
187
190
  },
188
- children: p.filters.map((e) => {
189
- let t = m.fields.get(e);
191
+ children: l.filters.map((e) => {
192
+ let t = u.fields.get(e);
190
193
  if (!t?.values) return null;
191
- let n = S?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", r = l(t, e, s.entities), i = [{
194
+ let n = S?.find((t) => t.field === e && t.op === "eq")?.value ?? "__all__", r = g(t, e, o.entities), a = [{
192
195
  value: "__all__",
193
196
  label: `All ${r}`
194
197
  }, ...t.values.map((e) => ({
195
198
  value: e.code,
196
- label: u(e.name) || e.code
199
+ label: i(e.name) || e.code
197
200
  }))];
198
201
  return /* @__PURE__ */ V("div", {
199
202
  style: { minWidth: 120 },
200
- children: /* @__PURE__ */ V(a, {
203
+ children: /* @__PURE__ */ V(s, {
201
204
  value: n,
202
- options: i,
203
- onChange: (t) => me(e, t),
205
+ options: a,
206
+ onChange: (t) => pe(e, t),
204
207
  placeholder: r
205
208
  })
206
209
  }, e);
@@ -214,8 +217,8 @@ function U({ screenCode: t }) {
214
217
  fontSize: 11,
215
218
  color: "var(--text-3)"
216
219
  },
217
- children: [/* @__PURE__ */ V("span", { children: Y ? "Loading…" : `${J.length} ${u(m.display.name_plural)}` }), ye > 0 && /* @__PURE__ */ V("button", {
218
- onClick: () => i((e) => {
220
+ children: [/* @__PURE__ */ V("span", { children: K ? "Loading…" : `${W.length} ${i(u.display.name_plural)}` }), _e > 0 && /* @__PURE__ */ V("button", {
221
+ onClick: () => a((e) => {
219
222
  let t = new URLSearchParams(e);
220
223
  return t.delete("filters"), t;
221
224
  }, { replace: !0 }),
@@ -236,12 +239,12 @@ function U({ screenCode: t }) {
236
239
  style: {
237
240
  flex: 1,
238
241
  overflowY: "auto",
239
- padding: T === "cards" ? 10 : 0,
240
- display: T === "cards" ? "flex" : "block",
242
+ padding: E === "cards" ? 10 : 0,
243
+ display: E === "cards" ? "flex" : "block",
241
244
  flexDirection: "column",
242
- gap: T === "cards" ? 10 : void 0
245
+ gap: E === "cards" ? 10 : void 0
243
246
  },
244
- children: Y ? /* @__PURE__ */ V("div", {
247
+ children: K ? /* @__PURE__ */ V("div", {
245
248
  style: {
246
249
  padding: 12,
247
250
  display: "flex",
@@ -253,7 +256,7 @@ function U({ screenCode: t }) {
253
256
  borderRadius: 6,
254
257
  background: "var(--surface-3)"
255
258
  } }, t))
256
- }) : J.length === 0 ? /* @__PURE__ */ V("div", {
259
+ }) : W.length === 0 ? /* @__PURE__ */ V("div", {
257
260
  style: {
258
261
  padding: 28,
259
262
  textAlign: "center",
@@ -261,23 +264,23 @@ function U({ screenCode: t }) {
261
264
  color: "var(--text-3)"
262
265
  },
263
266
  children: "No records found"
264
- }) : /* @__PURE__ */ H(B, { children: [J.map((e) => {
265
- let t = o(e[de]);
266
- return /* @__PURE__ */ V(le, {
267
+ }) : /* @__PURE__ */ H(B, { children: [W.map((e) => {
268
+ let t = te(e[q]);
269
+ return /* @__PURE__ */ V(ue, {
267
270
  record: e,
268
- entity: m,
271
+ entity: u,
269
272
  columns: C,
270
273
  card: N,
271
- presentation: T,
272
- refs: ue,
273
- isSelected: t === v,
274
- onClick: () => fe(t, { replace: w === "split" })
274
+ presentation: E,
275
+ refs: G,
276
+ isSelected: t === _,
277
+ onClick: () => J(t, { replace: w === "split" })
275
278
  }, t);
276
- }), U && K.hasMore && /* @__PURE__ */ V("button", {
279
+ }), U.isCursor && U.hasMorePages && /* @__PURE__ */ V("button", {
277
280
  type: "button",
278
281
  "data-testid": "record-list-load-more",
279
- onClick: () => void K.fetchNextPage(),
280
- disabled: K.isFetchingNextPage,
282
+ onClick: U.fetchNextPage,
283
+ disabled: U.isFetchingNextPage,
281
284
  style: {
282
285
  width: "100%",
283
286
  padding: "8px 12px",
@@ -286,15 +289,15 @@ function U({ screenCode: t }) {
286
289
  border: "none",
287
290
  borderTop: "1px solid var(--divider)",
288
291
  color: "var(--text-2)",
289
- cursor: K.isFetchingNextPage ? "default" : "pointer"
292
+ cursor: U.isFetchingNextPage ? "default" : "pointer"
290
293
  },
291
- children: K.isFetchingNextPage ? "Loading…" : "Load more"
294
+ children: U.isFetchingNextPage ? "Loading…" : "Load more"
292
295
  })] })
293
296
  })]
294
297
  }),
295
- X && /* @__PURE__ */ V("div", {
298
+ Y && /* @__PURE__ */ V("div", {
296
299
  "data-testid": "record-list-resize-handle",
297
- onMouseDown: ve,
300
+ onMouseDown: ge,
298
301
  style: {
299
302
  flex: "none",
300
303
  width: 1,
@@ -305,7 +308,7 @@ function U({ screenCode: t }) {
305
308
  onMouseEnter: (e) => e.currentTarget.style.background = "var(--border-strong)",
306
309
  onMouseLeave: (e) => e.currentTarget.style.background = "var(--divider)"
307
310
  }),
308
- xe && /* @__PURE__ */ V("div", {
311
+ ye && /* @__PURE__ */ V("div", {
309
312
  "data-testid": "record-detail-panel",
310
313
  style: {
311
314
  flex: 1,
@@ -313,15 +316,15 @@ function U({ screenCode: t }) {
313
316
  overflow: "hidden",
314
317
  height: w === "stacked" ? "50%" : "100%"
315
318
  },
316
- children: v ? /* @__PURE__ */ V(q, {
317
- entityCode: g,
318
- recordId: v,
319
- items: p.items,
320
- schema: s,
321
- entity: m,
322
- onBackToList: Se,
319
+ children: _ ? /* @__PURE__ */ V(de, {
320
+ entityCode: p,
321
+ recordId: _,
322
+ items: l.items,
323
+ schema: o,
324
+ entity: u,
325
+ onBackToList: be,
323
326
  relatedRecordsPresentation: oe
324
- }, v) : /* @__PURE__ */ V("div", {
327
+ }, _) : /* @__PURE__ */ V("div", {
325
328
  style: {
326
329
  display: "flex",
327
330
  alignItems: "center",
@@ -333,7 +336,7 @@ function U({ screenCode: t }) {
333
336
  style: { fontSize: 12.5 },
334
337
  children: [
335
338
  "Select a ",
336
- u(m.display.name),
339
+ i(u.display.name),
337
340
  " to view details"
338
341
  ]
339
342
  })
@@ -342,10 +345,10 @@ function U({ screenCode: t }) {
342
345
  ]
343
346
  });
344
347
  }
345
- function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs: o, isSelected: s, onClick: c }) {
346
- let l = t();
348
+ function ue({ record: e, entity: t, columns: r, card: i, presentation: a, refs: o, isSelected: s, onClick: c }) {
349
+ let l = n();
347
350
  if (a === "cards") {
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));
351
+ let n = i.badgeFields.filter((n) => W(t, e, n)), r = i.bodyFields.filter((n) => W(t, e, n)), a = i.metaFields.filter((n) => W(t, e, n));
349
352
  return /* @__PURE__ */ H("button", {
350
353
  type: "button",
351
354
  "data-testid": "record-list-card",
@@ -367,7 +370,7 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
367
370
  },
368
371
  children: [
369
372
  /* @__PURE__ */ V(G, {
370
- entity: n,
373
+ entity: t,
371
374
  record: e,
372
375
  field: i.titleField,
373
376
  refs: o
@@ -378,8 +381,8 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
378
381
  color: "var(--text-3)",
379
382
  overflowWrap: "anywhere"
380
383
  },
381
- children: w({
382
- entity: n,
384
+ children: x({
385
+ entity: t,
383
386
  fieldName: i.subtitleField,
384
387
  record: e,
385
388
  mode: "display",
@@ -387,13 +390,13 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
387
390
  locale: l
388
391
  })
389
392
  }),
390
- t.length > 0 && /* @__PURE__ */ V("div", {
393
+ n.length > 0 && /* @__PURE__ */ V("div", {
391
394
  style: {
392
395
  display: "flex",
393
396
  flexWrap: "wrap",
394
397
  gap: 6
395
398
  },
396
- children: t.map((t) => /* @__PURE__ */ V("span", {
399
+ children: n.map((n) => /* @__PURE__ */ V("span", {
397
400
  style: {
398
401
  border: "1px solid var(--border)",
399
402
  borderRadius: 999,
@@ -403,15 +406,15 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
403
406
  maxWidth: "100%",
404
407
  overflowWrap: "anywhere"
405
408
  },
406
- children: w({
407
- entity: n,
408
- fieldName: t,
409
+ children: x({
410
+ entity: t,
411
+ fieldName: n,
409
412
  record: e,
410
413
  mode: "display",
411
414
  refs: o,
412
415
  locale: l
413
416
  })
414
- }, t))
417
+ }, n))
415
418
  }),
416
419
  r.length > 0 && /* @__PURE__ */ V("dl", {
417
420
  style: {
@@ -420,13 +423,13 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
420
423
  gap: "5px 10px",
421
424
  margin: 0
422
425
  },
423
- children: r.map((t) => /* @__PURE__ */ V(K, {
424
- entity: n,
426
+ children: r.map((n) => /* @__PURE__ */ V(K, {
427
+ entity: t,
425
428
  record: e,
426
- fieldName: t,
429
+ fieldName: n,
427
430
  refs: o,
428
431
  locale: l
429
- }, t))
432
+ }, n))
430
433
  }),
431
434
  a.length > 0 && /* @__PURE__ */ V("div", {
432
435
  style: {
@@ -436,20 +439,20 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
436
439
  fontSize: 11,
437
440
  color: "var(--text-3)"
438
441
  },
439
- children: a.map((t) => /* @__PURE__ */ V("span", {
442
+ children: a.map((n) => /* @__PURE__ */ V("span", {
440
443
  style: {
441
444
  minWidth: 0,
442
445
  overflowWrap: "anywhere"
443
446
  },
444
- children: w({
445
- entity: n,
446
- fieldName: t,
447
+ children: x({
448
+ entity: t,
449
+ fieldName: n,
447
450
  record: e,
448
451
  mode: "display",
449
452
  refs: o,
450
453
  locale: l
451
454
  })
452
- }, t))
455
+ }, n))
453
456
  })
454
457
  ]
455
458
  });
@@ -487,8 +490,8 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
487
490
  whiteSpace: "nowrap",
488
491
  color: "var(--text)"
489
492
  },
490
- children: w({
491
- entity: n,
493
+ children: x({
494
+ entity: t,
492
495
  fieldName: u,
493
496
  record: e,
494
497
  mode: "display",
@@ -510,8 +513,8 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
510
513
  textOverflow: "ellipsis",
511
514
  whiteSpace: "nowrap"
512
515
  },
513
- children: w({
514
- entity: n,
516
+ children: x({
517
+ entity: t,
515
518
  fieldName: d,
516
519
  record: e,
517
520
  mode: "display",
@@ -525,30 +528,30 @@ function le({ record: e, entity: n, columns: r, card: i, presentation: a, refs:
525
528
  gap: 4,
526
529
  flexShrink: 0
527
530
  },
528
- children: f.map((t) => v(n, e, t) == null ? null : /* @__PURE__ */ V("div", {
531
+ children: f.map((n) => y(t, e, n) == null ? null : /* @__PURE__ */ V("div", {
529
532
  style: { fontSize: 11 },
530
- children: w({
531
- entity: n,
532
- fieldName: t,
533
+ children: x({
534
+ entity: t,
535
+ fieldName: n,
533
536
  record: e,
534
537
  mode: "display",
535
538
  refs: o,
536
539
  locale: l
537
540
  })
538
- }, t))
541
+ }, n))
539
542
  })]
540
543
  })]
541
544
  });
542
545
  }
543
546
  function W(e, t, n) {
544
- let r = v(e, t, n);
547
+ let r = y(e, t, n);
545
548
  return !(r == null || r === "" || Array.isArray(r) && r.length === 0);
546
549
  }
547
- function G({ entity: e, record: n, field: i, refs: a }) {
548
- let o = t(), s = r(n, e), c = i ? w({
550
+ function G({ entity: e, record: t, field: r, refs: a }) {
551
+ let o = n(), s = u(t, e), c = r ? x({
549
552
  entity: e,
550
- fieldName: i,
551
- record: n,
553
+ fieldName: r,
554
+ record: t,
552
555
  mode: "display",
553
556
  refs: a,
554
557
  locale: o
@@ -560,11 +563,11 @@ function G({ entity: e, record: n, field: i, refs: a }) {
560
563
  color: "var(--text)",
561
564
  overflowWrap: "anywhere"
562
565
  },
563
- children: c || u(e.display.name)
566
+ children: c || i(e.display.name)
564
567
  });
565
568
  }
566
569
  function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
567
- let a = v(e, t, n);
570
+ let a = y(e, t, n);
568
571
  if (a == null || a === "") return null;
569
572
  let o = e.fields.get(n);
570
573
  return o ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("dt", {
@@ -574,7 +577,7 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
574
577
  minWidth: 0,
575
578
  overflowWrap: "anywhere"
576
579
  },
577
- children: l(o, n)
580
+ children: g(o, n)
578
581
  }), /* @__PURE__ */ V("dd", {
579
582
  style: {
580
583
  margin: 0,
@@ -583,7 +586,7 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
583
586
  minWidth: 0,
584
587
  overflowWrap: "anywhere"
585
588
  },
586
- children: w({
589
+ children: x({
587
590
  entity: e,
588
591
  fieldName: n,
589
592
  record: t,
@@ -593,8 +596,8 @@ function K({ entity: e, record: t, fieldName: n, refs: r, locale: i }) {
593
596
  })
594
597
  })] }) : null;
595
598
  }
596
- function q({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, relatedRecordsPresentation: o }) {
597
- return /* @__PURE__ */ V(s, { children: /* @__PURE__ */ V(J, {
599
+ function de({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, relatedRecordsPresentation: o }) {
600
+ return /* @__PURE__ */ V(c, { children: /* @__PURE__ */ V(q, {
598
601
  entityCode: e,
599
602
  recordId: t,
600
603
  items: n,
@@ -604,89 +607,89 @@ function q({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackT
604
607
  relatedRecordsPresentation: o
605
608
  }) });
606
609
  }
607
- function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackToList: d, relatedRecordsPresentation: f }) {
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(() => {
610
+ function q({ entityCode: n, recordId: r, items: s, schema: c, entity: d, onBackToList: m, relatedRecordsPresentation: ee }) {
611
+ let g = l(d, "update"), ne = L(() => r ? o(d, r) : void 0, [r, d]), { data: re, isLoading: x } = _(n, ne), T = v(n), D = a(), [O, k] = z(!1), [A, j] = z({}), M = re?.data, ie = M?.$statuses, ae = M?.$properties, se = N(n, r), I = oe(n, r), R = L(() => {
609
612
  let e = /* @__PURE__ */ new Set();
610
- for (let [t, n] of l.fields) !n.auto && !n.primary && e.add(t);
611
- for (let [t] of l.files ?? []) e.add(t);
613
+ for (let [t, n] of d.fields) !n.auto && !n.primary && e.add(t);
614
+ for (let [t] of d.files ?? []) e.add(t);
612
615
  return e;
613
- }, [l]), ce = I(() => {
614
- if (j) {
616
+ }, [d]), ce = F(() => {
617
+ if (M) {
615
618
  let e = {};
616
- z.forEach((t) => {
617
- let n = v(l, j, t);
618
- e[t] = y(l, t) ? n ?? null : n ?? "";
619
- }), A(e);
619
+ R.forEach((t) => {
620
+ let n = y(d, M, t);
621
+ e[t] = S(d, t) ? n ?? null : n ?? "";
622
+ }), j(e);
620
623
  }
621
- O(!0);
624
+ k(!0);
622
625
  }, [
623
- j,
624
- z,
625
- l
626
- ]), U = I(async () => {
627
- await E.flushAllDrafts(), O(!1), A({});
628
- }, [E]), le = I(() => {
629
- let e = {}, t = x({
630
- entity: l,
631
- formData: k,
632
- record: j,
626
+ M,
627
+ R,
628
+ d
629
+ ]), le = F(async () => {
630
+ await D.flushAllDrafts(), k(!1), j({});
631
+ }, [D]), U = F(() => {
632
+ let e = {}, t = E({
633
+ entity: d,
634
+ formData: A,
635
+ record: M,
633
636
  isNew: !1
634
- }), r = S(t);
635
- for (let [t, n] of Object.entries(k)) l.files?.has(t) || (e[t] = T(l, t, n));
637
+ }), n = w(t);
638
+ for (let [t, n] of Object.entries(A)) d.files?.has(t) || (e[t] = b(d, t, n));
636
639
  if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0) {
637
- O(!1), A({});
640
+ k(!1), j({});
638
641
  return;
639
642
  }
640
- w.mutate({
641
- pkValues: n,
643
+ T.mutate({
644
+ pkValues: r,
642
645
  data: e
643
646
  }, {
644
647
  onSuccess: () => {
645
- r.forEach((e) => E.markCommitted(e)), O(!1), A({}), g.success("Saved");
648
+ n.forEach((e) => D.markCommitted(e)), k(!1), j({}), h.success("Saved");
646
649
  },
647
- onError: () => g.error("Failed to save")
650
+ onError: () => h.error("Failed to save")
648
651
  });
649
652
  }, [
650
- E,
651
- w,
652
- n,
653
- l,
654
- k,
655
- j
656
- ]), W = I((e, t) => {
657
- A((n) => ({
653
+ D,
654
+ T,
655
+ r,
656
+ d,
657
+ A,
658
+ M
659
+ ]), ue = F((e, t) => {
660
+ j((n) => ({
658
661
  ...n,
659
662
  [e]: t
660
663
  }));
661
664
  }, []);
662
- if (ie) return /* @__PURE__ */ V(b, {});
663
- if (!j) return null;
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 = {
665
- schema: s,
666
- entity: l,
667
- entityCode: t,
668
- recordId: n,
669
- record: D ? {
670
- ...j,
671
- ...k
672
- } : j,
665
+ if (x) return /* @__PURE__ */ V(C, {});
666
+ if (!M) return null;
667
+ let W = u(M, d), G = d.display?.display_field, K = W ? void 0 : G ? M[G] : M[d.fields.names()[0]], de = W || (K != null && typeof K != "object" ? te(K) : i(d.display.name)), q = M?.$refs, J = {
668
+ schema: c,
669
+ entity: d,
670
+ entityCode: n,
671
+ recordId: r,
672
+ record: O ? {
673
+ ...M,
674
+ ...A
675
+ } : M,
673
676
  isNew: !1,
674
- mode: D ? "edit" : "display",
675
- onFieldChange: D ? W : void 0,
676
- refs: ue,
677
- objectProperties: M ?? void 0,
678
- onSetProperty: h ? (e, t) => L.mutate({
677
+ mode: O ? "edit" : "display",
678
+ onFieldChange: O ? ue : void 0,
679
+ refs: q,
680
+ objectProperties: ae ?? void 0,
681
+ onSetProperty: g ? (e, t) => I.mutate({
679
682
  propertyCode: e,
680
683
  value: t
681
684
  }) : void 0,
682
- isPropertyPending: L.isPending,
683
- objectStatuses: ae ?? void 0,
684
- onSetStatus: h ? (e, t) => P.mutate({
685
+ isPropertyPending: I.isPending,
686
+ objectStatuses: ie ?? void 0,
687
+ onSetStatus: g ? (e, t) => se.mutate({
685
688
  groupCode: e,
686
689
  statusCode: t
687
690
  }) : void 0,
688
- isStatusPending: P.isPending,
689
- relatedRecordsPresentation: f
691
+ isStatusPending: se.isPending,
692
+ relatedRecordsPresentation: ee
690
693
  };
691
694
  return /* @__PURE__ */ H("div", {
692
695
  style: {
@@ -716,30 +719,30 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
716
719
  whiteSpace: "nowrap",
717
720
  color: "var(--text)"
718
721
  },
719
- children: J
722
+ children: de
720
723
  }), /* @__PURE__ */ H("div", {
721
724
  style: {
722
725
  display: "flex",
723
726
  alignItems: "center",
724
727
  gap: 6
725
728
  },
726
- children: [d && /* @__PURE__ */ V(ee, {
729
+ children: [m && /* @__PURE__ */ V(f, {
727
730
  icon: /* @__PURE__ */ V(e.back, { size: 14 }),
728
731
  title: "Back to list",
729
- onClick: d
730
- }), h && (D ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(_, {
732
+ onClick: m
733
+ }), g && (O ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(p, {
731
734
  size: "xs",
732
735
  icon: /* @__PURE__ */ V(e.x, { size: 12 }),
733
- onClick: U,
736
+ onClick: le,
734
737
  children: "Cancel"
735
- }), /* @__PURE__ */ V(_, {
738
+ }), /* @__PURE__ */ V(p, {
736
739
  kind: "primary",
737
740
  size: "xs",
738
- icon: w.isPending ? /* @__PURE__ */ V(p, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
739
- onClick: le,
740
- disabled: w.isPending,
741
- children: w.isPending ? "Saving…" : "Save"
742
- })] }) : /* @__PURE__ */ V(_, {
741
+ icon: T.isPending ? /* @__PURE__ */ V(t, { size: 12 }) : /* @__PURE__ */ V(e.save, { size: 12 }),
742
+ onClick: U,
743
+ disabled: T.isPending,
744
+ children: T.isPending ? "Saving…" : "Save"
745
+ })] }) : /* @__PURE__ */ V(p, {
743
746
  size: "xs",
744
747
  icon: /* @__PURE__ */ V(e.edit, { size: 12 }),
745
748
  onClick: ce,
@@ -755,9 +758,9 @@ function J({ entityCode: t, recordId: n, items: a, schema: s, entity: l, onBackT
755
758
  flexDirection: "column",
756
759
  gap: 12
757
760
  },
758
- children: a && a.length > 0 ? /* @__PURE__ */ V(F, {
759
- nodes: a,
760
- ctx: Y
761
+ children: s && s.length > 0 ? /* @__PURE__ */ V(P, {
762
+ nodes: s,
763
+ ctx: J
761
764
  }) : /* @__PURE__ */ H("p", {
762
765
  style: {
763
766
  fontSize: 12.5,