@declarion/react 0.250.0 → 0.252.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.
@@ -1,212 +1,213 @@
1
1
  import { useFirstScreenSettled as e } from "../../lib/capabilityPrefetch.js";
2
- import { Btn as t } from "../primitives/Btn.js";
3
- import { Icon as n } from "../primitives/Icons.js";
4
- import { IconBtn as r } from "../primitives/IconBtn.js";
5
- import { Spinner as i } from "../primitives/Spinner.js";
6
- import { TextInput as a } from "../primitives/Fields.js";
7
- import { RetryButton as o } from "../primitives/RetryButton.js";
8
- import { readDisplayState as s } from "../../lib/read-display-state.js";
9
- import { failureTitle as c } from "../../lib/failure.js";
10
- import { useScreenBack as l } from "../../hooks/useScreenBack.js";
11
- import { useTabSearchMirror as u } from "../../hooks/useTabSearchMirror.js";
12
- import { useRegisterScreenTab as d } from "../../hooks/useRegisterScreenTab.js";
13
- import { useSchema as ee } from "../../hooks/useSchema.js";
2
+ import { useSearchDraft as t } from "../../hooks/useSearchDraft.js";
3
+ import { Btn as n } from "../primitives/Btn.js";
4
+ import { Icon as r } from "../primitives/Icons.js";
5
+ import { IconBtn as i } from "../primitives/IconBtn.js";
6
+ import { Spinner as a } from "../primitives/Spinner.js";
7
+ import { TextInput as o } from "../primitives/Fields.js";
8
+ import { RetryButton as s } from "../primitives/RetryButton.js";
9
+ import { readDisplayState as c } from "../../lib/read-display-state.js";
10
+ import { failureTitle as l } from "../../lib/failure.js";
11
+ import { useScreenBack as u } from "../../hooks/useScreenBack.js";
12
+ import { useTabSearchMirror as d } from "../../hooks/useTabSearchMirror.js";
13
+ import { useRegisterScreenTab as ee } from "../../hooks/useRegisterScreenTab.js";
14
+ import { useSchema as te } from "../../hooks/useSchema.js";
14
15
  import { useObject as f } from "../../hooks/useObject.js";
15
16
  import { useUpdateObject as p } from "../../hooks/useMutations.js";
16
- import { useSetStatus as te } from "../../hooks/useObjectStatus.js";
17
+ import { useSetStatus as ne } from "../../hooks/useObjectStatus.js";
17
18
  import { useSetProperty as m } from "../../hooks/useProperties.js";
18
- import { useDebounce as ne } from "../../hooks/useDebounce.js";
19
- import { useResponsiveMode as re } from "../../hooks/useResponsiveMode.js";
20
- import { FileDraftScope as h, useFileDraftScope as g } from "../file-widgets/draft-scope.js";
19
+ import { useDebounce as re } from "../../hooks/useDebounce.js";
20
+ import { useResponsiveMode as h } from "../../hooks/useResponsiveMode.js";
21
+ import { FileDraftScope as ie, useFileDraftScope as g } from "../file-widgets/draft-scope.js";
21
22
  import { buildFilesPayload as _, collectCommittedFileIds as v } from "../file-widgets/payload.js";
22
- import { getEntityFileField as ie, getSchemaFieldValue as y, renderSchemaField as b, schemaFieldHasValue as x, serializeSchemaFieldValue as ae } from "../file-widgets/host.js";
23
- import { countActiveFilters as oe, parseFilterURLState as se, removeFilterAtPath as ce, setFiltersInURL as S } from "../../lib/filters.js";
24
- import { DetailSkeleton as C } from "../shared/LoadingSkeleton.js";
25
- import { LayoutRenderer as w } from "../detail-layout/LayoutRenderer.js";
26
- import { coerceDisplayString as le } from "../../lib/display-value.js";
27
- import { fieldDisplayName as T, getDisplayValue as ue, isUserEditableField as de, rowAllowsMutation as fe, singlePkValues as E } from "../../types/schema.js";
28
- import { pageInsetX as pe } from "../../lib/page-inset.js";
29
- import { resolveCard as D, resolveListProjection as O } from "./list/cardProjection.js";
30
- import { useListQuery as k } from "./list/useListQuery.js";
31
- import { stripUnsupportedSortSegments as A } from "../../lib/sort.js";
32
- import { readableSort as j } from "../../lib/field-classification.js";
33
- import { useText as M } from "../../hooks/useText.js";
34
- import { useRowTenant as N } from "../../hooks/useRowTenant.js";
35
- import { textWithNodes as P } from "../../lib/language.js";
23
+ import { getEntityFileField as y, getSchemaFieldValue as b, renderSchemaField as x, schemaFieldHasValue as S, serializeSchemaFieldValue as ae } from "../file-widgets/host.js";
24
+ import { countActiveFilters as oe, parseFilterURLState as se, removeFilterAtPath as C, setFiltersInURL as w } from "../../lib/filters.js";
25
+ import { DetailSkeleton as T } from "../shared/LoadingSkeleton.js";
26
+ import { LayoutRenderer as E } from "../detail-layout/LayoutRenderer.js";
27
+ import { coerceDisplayString as ce } from "../../lib/display-value.js";
28
+ import { fieldDisplayName as D, getDisplayValue as le, isUserEditableField as ue, rowAllowsMutation as de, singlePkValues as O } from "../../types/schema.js";
29
+ import { pageInsetX as fe } from "../../lib/page-inset.js";
30
+ import { resolveCard as k, resolveListProjection as A } from "./list/cardProjection.js";
31
+ import { useListQuery as j } from "./list/useListQuery.js";
32
+ import { stripUnsupportedSortSegments as M } from "../../lib/sort.js";
33
+ import { readableSort as N } from "../../lib/field-classification.js";
34
+ import { useText as P } from "../../hooks/useText.js";
35
+ import { useRowTenant as pe } from "../../hooks/useRowTenant.js";
36
+ import { textWithNodes as me } from "../../lib/language.js";
36
37
  import { FilterChips as F } from "../filters/FilterChips.js";
37
- import { FilterDrawer as I } from "../filters/FilterDrawer.js";
38
- import { useFilterValueLabels as me } from "./list/use-filter-value-labels.js";
39
- import { useListFilterPresentation as he } from "./list/useListFilterPresentation.js";
40
- import { FilterOmittedNotice as L } from "../filters/FilterOmittedNotice.js";
41
- import { listLoadErrorDescription as ge } from "./list/ListNoRows.js";
42
- import { useCallback as R, useEffect as z, useMemo as B, useRef as V, useState as H } from "react";
43
- import { Fragment as _e, jsx as U, jsxs as W } from "react/jsx-runtime";
44
- import { useSearchParams as ve } from "react-router";
38
+ import { FilterDrawer as he } from "../filters/FilterDrawer.js";
39
+ import { useFilterValueLabels as ge } from "./list/use-filter-value-labels.js";
40
+ import { useListFilterPresentation as _e } from "./list/useListFilterPresentation.js";
41
+ import { FilterOmittedNotice as I } from "../filters/FilterOmittedNotice.js";
42
+ import { listLoadErrorDescription as ve } from "./list/ListNoRows.js";
43
+ import { useCallback as L, useEffect as R, useMemo as z, useRef as B, useState as V } from "react";
44
+ import { Fragment as ye, jsx as H, jsxs as U } from "react/jsx-runtime";
45
+ import { useSearchParams as be } from "react-router";
45
46
  // src/components/pages/SmartRecordListPage.impl.tsx
46
- var ye = 200, G = "items:";
47
- function K({ screenCode: i }) {
48
- let o = M(), s = M("errors"), [c, f] = ve(), { data: p, refetch: te } = ee(), m = re(), [h, g] = H(!1), _ = p?.screens[i], v = _?.entity ? p?.entities[_.entity] : void 0, ie = _?.entity;
49
- d(_, v, c.toString()), u(_?.route);
50
- let y = l(), b = c.get("selected") ?? null, x = c.get("search") ?? "", ae = ne(x, 300), C = c.get("sort") ?? j(v, _?.sort_default) ?? "", w = B(() => se(c), [c]), { visibleFilterState: T, filterFieldMeta: ue, allFilterFieldMeta: de, filterFieldName: fe } = he(_, v, p?.entities, w.filters), E = T.filters, N = R((e) => {
47
+ var xe = 200, W = "items:";
48
+ function G({ screenCode: a }) {
49
+ let s = P(), c = P("errors"), [l, f] = be(), { data: p, refetch: ne } = te(), m = h(), [ie, g] = V(!1), _ = p?.screens[a], v = _?.entity ? p?.entities[_.entity] : void 0, y = _?.entity;
50
+ ee(_, v, l.toString()), d(_?.route);
51
+ let b = u(), x = l.get("selected") ?? null, S = l.get("search") ?? "", ae = re(S, 300), T = l.get("sort") ?? N(v, _?.sort_default) ?? "", E = z(() => se(l), [l]), { visibleFilterState: D, filterFieldMeta: le, allFilterFieldMeta: ue, filterFieldName: de } = _e(_, v, p?.entities, E.filters), O = D.filters, pe = L((e) => {
51
52
  f((t) => {
52
53
  let n = new URLSearchParams(t);
53
- return S(e, n), n;
54
+ return w(e, n), n;
54
55
  }, { replace: !0 });
55
- }, [f]), P = B(() => _?.columns ?? v?.fields.names().filter((e) => !v.fields.get(e)?.primary && !v.fields.get(e)?.auto && v.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [_?.columns, v]), G = B(() => {
56
+ }, [f]), me = z(() => _?.columns ?? v?.fields.names().filter((e) => !v.fields.get(e)?.primary && !v.fields.get(e)?.auto && v.fields.get(e)?.display?.is_listable !== !1).slice(0, 4) ?? [], [_?.columns, v]), W = z(() => {
56
57
  let e = _?.responsive?.[m.category]?.presentation;
57
58
  return m.category === "phone" ? "drilldown" : e === "split" || e === "drilldown" || e === "stacked" ? e : "split";
58
- }, [_?.responsive, m.category]), K = B(() => {
59
+ }, [_?.responsive, m.category]), G = z(() => {
59
60
  let e = _?.responsive?.[m.category];
60
61
  return e?.list?.presentation === "table" || e?.list?.presentation === "cards" ? e.list.presentation : e?.presentation === "table" || e?.presentation === "cards" ? e.presentation : m.category === "phone" ? "cards" : "table";
61
- }, [_?.responsive, m.category]), xe = _?.responsive?.[m.category]?.layout?.related_records, q = B(() => D({
62
+ }, [_?.responsive, m.category]), K = _?.responsive?.[m.category]?.layout?.related_records, q = z(() => k({
62
63
  entity: v,
63
64
  screen: _
64
- }), [v, _]), Ce = B(() => O({
65
+ }), [v, _]), J = z(() => A({
65
66
  entity: v,
66
67
  screen: _,
67
- presentation: K,
68
- visibleColumns: P,
68
+ presentation: G,
69
+ visibleColumns: me,
69
70
  card: q,
70
- sort: C
71
+ sort: T
71
72
  }), [
72
73
  v,
73
74
  _,
74
- K,
75
- P,
75
+ G,
76
+ me,
76
77
  q,
77
- C
78
- ]), J = k({
78
+ T
79
+ ]), Y = j({
79
80
  entity: v,
80
- entityCode: ie,
81
+ entityCode: y,
81
82
  screen: _,
82
- screenCode: i,
83
+ screenCode: a,
83
84
  page: 1,
84
- perPage: ye,
85
- sortForRequest: A(C),
85
+ perPage: xe,
86
+ sortForRequest: M(T),
86
87
  debouncedSearch: ae,
87
- filters: E,
88
+ filters: O,
88
89
  includeDeleted: !1,
89
- expand: Ce.expandFields,
90
- select: Ce.selectFields,
90
+ expand: J.expandFields,
91
+ select: J.selectFields,
91
92
  isHeld: !v,
92
93
  retryHeld: () => {
93
- te();
94
+ ne();
94
95
  },
95
96
  runCountQuery: !1,
96
- urlKey: `${ie ?? ""}|${c.toString()}`
97
- }), we = J.rows, Te = J.refs, Y = J.isLoading;
98
- e(!Y);
99
- let { labelFor: Ee, refs: De } = me(de, E, Te, p?.entities), Oe = B(() => v?.fields.names().find((e) => v.fields.get(e)?.primary) ?? "id", [v]), ke = R((e, t) => {
97
+ urlKey: `${y ?? ""}|${l.toString()}`
98
+ }), we = Y.rows, Te = Y.refs, X = Y.isLoading;
99
+ e(!X);
100
+ let { labelFor: Ee, refs: De } = ge(ue, O, Te, p?.entities), Oe = z(() => v?.fields.names().find((e) => v.fields.get(e)?.primary) ?? "id", [v]), ke = L((e, t) => {
100
101
  f((t) => {
101
102
  let n = new URLSearchParams(t);
102
103
  return e ? n.set("selected", e) : n.delete("selected"), n;
103
104
  }, { replace: t?.replace ?? !0 });
104
- }, [f]), Ae = R((e) => {
105
+ }, [f]), Ae = L((e) => {
105
106
  f((t) => {
106
107
  let n = new URLSearchParams(t);
107
108
  return e ? n.set("search", e) : n.delete("search"), n;
108
109
  }, { replace: !0 });
109
- }, [f]), X = (_?.list_resizable ?? !1) && G === "split" && m.category !== "phone" && !m.touch, je = V(null), [Z, Q] = H(null), Me = V(!1), $ = _?.list_width;
110
- z(() => {
111
- X && $?.endsWith("%") && Q(null);
110
+ }, [f]), [je, Me] = t(S, Ae), Z = (_?.list_resizable ?? !1) && W === "split" && m.category !== "phone" && !m.touch, Ne = B(null), [Q, Pe] = V(null), Fe = B(!1), $ = _?.list_width;
111
+ R(() => {
112
+ Z && $?.endsWith("%") && Pe(null);
112
113
  }, [
113
- X,
114
+ Z,
114
115
  $,
115
116
  m.width,
116
117
  m.height
117
- ]), z(() => {
118
- if (!X || Z !== null) return;
119
- let e = je.current;
118
+ ]), R(() => {
119
+ if (!Z || Q !== null) return;
120
+ let e = Ne.current;
120
121
  if (e) {
121
122
  if ($ && $.endsWith("%")) {
122
123
  let t = parseFloat($) / 100;
123
- Q(Math.round(e.getBoundingClientRect().width * t));
124
- } else Q($ && parseInt($, 10) || 320);
124
+ Pe(Math.round(e.getBoundingClientRect().width * t));
125
+ } else Pe($ && parseInt($, 10) || 320);
125
126
  }
126
127
  }, [
127
- X,
128
- $,
129
128
  Z,
129
+ $,
130
+ Q,
130
131
  v
131
132
  ]);
132
- let Ne = V(null);
133
- z(() => () => {
134
- Ne.current?.();
133
+ let Ie = B(null);
134
+ R(() => () => {
135
+ Ie.current?.();
135
136
  }, []);
136
- let Pe = R((e) => {
137
- e.preventDefault(), Me.current = !0;
138
- let t = e.clientX, n = Z ?? 320, r = (e) => {
139
- if (!Me.current) return;
140
- let r = (je.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
141
- Q(i);
137
+ let Le = L((e) => {
138
+ e.preventDefault(), Fe.current = !0;
139
+ let t = e.clientX, n = Q ?? 320, r = (e) => {
140
+ if (!Fe.current) return;
141
+ let r = (Ne.current?.getBoundingClientRect().width ?? window.innerWidth) - 300, i = Math.max(200, Math.min(r, n + e.clientX - t));
142
+ Pe(i);
142
143
  }, i = () => {
143
- Me.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", Ne.current = null;
144
+ Fe.current = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "", Ie.current = null;
144
145
  };
145
- document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), Ne.current = i;
146
- }, [Z]);
146
+ document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), Ie.current = i;
147
+ }, [Q]);
147
148
  if (!p || !_ || !v) return null;
148
- let Fe = oe(E), Ie = G === "split" || G === "stacked" || !b, Le = G === "split" || G === "stacked" || !!b, Re = G !== "split" && b ? () => ke(null, { replace: !0 }) : void 0, ze = G === "split" ? X && Z !== null ? Z : _.list_width ?? "320px" : "100%";
149
- return /* @__PURE__ */ W("div", {
150
- ref: je,
151
- "data-record-list-presentation": G,
149
+ let Re = oe(O), ze = W === "split" || W === "stacked" || !x, Be = W === "split" || W === "stacked" || !!x, Ve = W !== "split" && x ? () => ke(null, { replace: !0 }) : void 0, He = W === "split" ? Z && Q !== null ? Q : _.list_width ?? "320px" : "100%";
150
+ return /* @__PURE__ */ U("div", {
151
+ ref: Ne,
152
+ "data-record-list-presentation": W,
152
153
  style: {
153
154
  display: "flex",
154
- flexDirection: G === "stacked" ? "column" : "row",
155
+ flexDirection: W === "stacked" ? "column" : "row",
155
156
  height: "100%",
156
157
  minWidth: 0,
157
158
  overflow: "hidden"
158
159
  },
159
160
  children: [
160
- Ie && /* @__PURE__ */ W("div", {
161
+ ze && /* @__PURE__ */ U("div", {
161
162
  "data-testid": "record-list-panel",
162
163
  style: {
163
- flex: G === "split" ? "none" : "1 1 auto",
164
+ flex: W === "split" ? "none" : "1 1 auto",
164
165
  display: "flex",
165
166
  flexDirection: "column",
166
167
  overflow: "hidden",
167
- borderRight: G === "split" && !X ? "1px solid var(--divider)" : "none",
168
- borderBottom: G === "stacked" ? "1px solid var(--divider)" : "none",
169
- width: ze,
168
+ borderRight: W === "split" && !Z ? "1px solid var(--divider)" : "none",
169
+ borderBottom: W === "stacked" ? "1px solid var(--divider)" : "none",
170
+ width: He,
170
171
  minWidth: 0,
171
- height: G === "stacked" ? "50%" : "100%"
172
+ height: W === "stacked" ? "50%" : "100%"
172
173
  },
173
- children: [/* @__PURE__ */ W("div", {
174
+ children: [/* @__PURE__ */ U("div", {
174
175
  style: {
175
176
  paddingTop: 12,
176
177
  paddingBottom: 12,
177
- ...pe(12),
178
+ ...fe(12),
178
179
  display: "flex",
179
180
  flexDirection: "column",
180
181
  gap: 8,
181
182
  borderBottom: "1px solid var(--divider)"
182
183
  },
183
184
  children: [
184
- y.hasOriginBack && /* @__PURE__ */ W("div", {
185
+ b.hasOriginBack && /* @__PURE__ */ U("div", {
185
186
  style: {
186
187
  display: "flex",
187
188
  alignItems: "center",
188
189
  gap: 8
189
190
  },
190
- children: [/* @__PURE__ */ U(r, {
191
- icon: /* @__PURE__ */ U(n.back, { size: 14 }),
192
- title: o("list.header.back", "Back"),
193
- onClick: y.goBack
194
- }), /* @__PURE__ */ U("span", {
191
+ children: [/* @__PURE__ */ H(i, {
192
+ icon: /* @__PURE__ */ H(r.back, { size: 14 }),
193
+ title: s("list.header.back", "Back"),
194
+ onClick: b.goBack
195
+ }), /* @__PURE__ */ H("span", {
195
196
  style: {
196
197
  fontSize: 12.5,
197
198
  fontWeight: 600,
198
199
  color: "var(--text)"
199
200
  },
200
- children: o(_.display?.name) || o(v.display.name_plural)
201
+ children: s(_.display?.name) || s(v.display.name_plural)
201
202
  })]
202
203
  }),
203
- /* @__PURE__ */ U(a, {
204
- value: x,
205
- onChange: Ae,
206
- placeholder: o("list.toolbar.search_placeholder", "Search {name}…", { name: o(v.display.name_plural) }),
207
- prefix: /* @__PURE__ */ U(n.search, { size: 13 })
204
+ /* @__PURE__ */ H(o, {
205
+ value: je,
206
+ onChange: Me,
207
+ placeholder: s("list.toolbar.search_placeholder", "Search {name}…", { name: s(v.display.name_plural) }),
208
+ prefix: /* @__PURE__ */ H(r.search, { size: 13 })
208
209
  }),
209
- w.error && /* @__PURE__ */ W("div", {
210
+ E.error && /* @__PURE__ */ U("div", {
210
211
  role: "alert",
211
212
  "data-testid": "record-list-filter-url-error",
212
213
  style: {
@@ -217,27 +218,27 @@ function K({ screenCode: i }) {
217
218
  fontSize: 11.5
218
219
  },
219
220
  children: [
220
- s(w.errorCode ?? "", w.error),
221
+ c(E.errorCode ?? "", E.error),
221
222
  " ",
222
- o("list.filters.invalid_suffix", "Showing this list without URL filters.")
223
+ s("list.filters.invalid_suffix", "Showing this list without URL filters.")
223
224
  ]
224
225
  }),
225
- /* @__PURE__ */ W(t, {
226
+ /* @__PURE__ */ U(n, {
226
227
  size: "xs",
227
- icon: /* @__PURE__ */ U(n.filter, { size: 12 }),
228
+ icon: /* @__PURE__ */ H(r.filter, { size: 12 }),
228
229
  onClick: () => g(!0),
229
- children: [o("filter.drawer.title", "Filters"), Fe > 0 ? ` (${Fe})` : ""]
230
+ children: [s("filter.drawer.title", "Filters"), Re > 0 ? ` (${Re})` : ""]
230
231
  }),
231
- T.omitted && /* @__PURE__ */ U(L, {}),
232
- /* @__PURE__ */ U(F, {
233
- filters: E,
232
+ D.omitted && /* @__PURE__ */ H(I, {}),
233
+ /* @__PURE__ */ H(F, {
234
+ filters: O,
234
235
  resolveValue: Ee,
235
- fieldLabel: fe,
236
- onRemoveAtPath: (e) => N(ce(E, e)),
237
- onClearAll: () => N([]),
236
+ fieldLabel: de,
237
+ onRemoveAtPath: (e) => pe(C(O, e)),
238
+ onClearAll: () => pe([]),
238
239
  onChipClick: () => g(!0)
239
240
  }),
240
- /* @__PURE__ */ U("div", {
241
+ /* @__PURE__ */ H("div", {
241
242
  style: {
242
243
  display: "flex",
243
244
  alignItems: "center",
@@ -245,88 +246,88 @@ function K({ screenCode: i }) {
245
246
  fontSize: 11,
246
247
  color: "var(--text-3)"
247
248
  },
248
- children: /* @__PURE__ */ U("span", { children: Y ? o("list.records.loading", "Loading…") : J.isError ? s("list.rows_unreadable", "The records could not be loaded.") : o("list.records.count", "{count} {name}", {
249
+ children: /* @__PURE__ */ H("span", { children: X ? s("list.records.loading", "Loading…") : Y.isError ? c("list.rows_unreadable", "The records could not be loaded.") : s("list.records.count", "{count} {name}", {
249
250
  count: we.length,
250
- name: o(v.display.name_plural)
251
+ name: s(v.display.name_plural)
251
252
  }) })
252
253
  })
253
254
  ]
254
- }), /* @__PURE__ */ U("div", {
255
+ }), /* @__PURE__ */ H("div", {
255
256
  style: {
256
257
  flex: 1,
257
258
  overflowY: "auto",
258
- padding: K === "cards" ? 10 : 0,
259
- display: K === "cards" ? "flex" : "block",
259
+ padding: G === "cards" ? 10 : 0,
260
+ display: G === "cards" ? "flex" : "block",
260
261
  flexDirection: "column",
261
- gap: K === "cards" ? 10 : void 0
262
+ gap: G === "cards" ? 10 : void 0
262
263
  },
263
- children: Y && J.isLoadingStale ? /* @__PURE__ */ W("div", {
264
+ children: X && Y.isLoadingStale ? /* @__PURE__ */ U("div", {
264
265
  role: "alert",
265
266
  style: {
266
267
  padding: 16,
267
268
  color: "var(--text-2)"
268
269
  },
269
270
  children: [
270
- o("list.rows.loading_slow_title", "Still loading data"),
271
+ s("list.rows.loading_slow_title", "Still loading data"),
271
272
  " ",
272
- /* @__PURE__ */ U(t, {
273
+ /* @__PURE__ */ H(n, {
273
274
  size: "xs",
274
275
  onClick: () => {
275
- J.retry();
276
+ Y.retry();
276
277
  },
277
- children: o("list.rows.retry", "Retry")
278
+ children: s("list.rows.retry", "Retry")
278
279
  })
279
280
  ]
280
- }) : Y ? /* @__PURE__ */ U("div", {
281
+ }) : X ? /* @__PURE__ */ H("div", {
281
282
  style: {
282
283
  padding: 12,
283
284
  display: "flex",
284
285
  flexDirection: "column",
285
286
  gap: 6
286
287
  },
287
- children: Array.from({ length: 8 }).map((e, t) => /* @__PURE__ */ U("div", { style: {
288
+ children: Array.from({ length: 8 }).map((e, t) => /* @__PURE__ */ H("div", { style: {
288
289
  height: 48,
289
290
  borderRadius: "var(--radius-md)",
290
291
  background: "var(--surface-3)"
291
292
  } }, t))
292
- }) : J.isError ? /* @__PURE__ */ W("div", {
293
+ }) : Y.isError ? /* @__PURE__ */ U("div", {
293
294
  role: "alert",
294
295
  style: {
295
296
  padding: 16,
296
297
  color: "var(--text-2)"
297
298
  },
298
- children: [ge(o, s, v, J.error), /* @__PURE__ */ U(t, {
299
+ children: [ve(s, c, v, Y.error), /* @__PURE__ */ H(n, {
299
300
  size: "xs",
300
301
  onClick: () => {
301
- J.retry();
302
+ Y.retry();
302
303
  },
303
- children: o("list.rows.retry", "Retry")
304
+ children: s("list.rows.retry", "Retry")
304
305
  })]
305
- }) : we.length === 0 ? /* @__PURE__ */ U("div", {
306
+ }) : we.length === 0 ? /* @__PURE__ */ H("div", {
306
307
  style: {
307
308
  padding: 28,
308
309
  textAlign: "center",
309
310
  fontSize: 12.5,
310
311
  color: "var(--text-3)"
311
312
  },
312
- children: o("list.records.none", "No records found")
313
- }) : /* @__PURE__ */ W(_e, { children: [we.map((e) => {
314
- let t = le(e[Oe]);
315
- return /* @__PURE__ */ U(be, {
313
+ children: s("list.records.none", "No records found")
314
+ }) : /* @__PURE__ */ U(ye, { children: [we.map((e) => {
315
+ let t = ce(e[Oe]);
316
+ return /* @__PURE__ */ H(Se, {
316
317
  record: e,
317
318
  entity: v,
318
- columns: P,
319
+ columns: me,
319
320
  card: q,
320
- presentation: K,
321
+ presentation: G,
321
322
  refs: Te,
322
- isSelected: t === b,
323
- onClick: () => ke(t, { replace: G === "split" })
323
+ isSelected: t === x,
324
+ onClick: () => ke(t, { replace: W === "split" })
324
325
  }, t);
325
- }), J.isCursor && J.hasMorePages && /* @__PURE__ */ U("button", {
326
+ }), Y.isCursor && Y.hasMorePages && /* @__PURE__ */ H("button", {
326
327
  type: "button",
327
328
  "data-testid": "record-list-load-more",
328
- onClick: J.fetchNextPage,
329
- disabled: J.isFetchingNextPage,
329
+ onClick: Y.fetchNextPage,
330
+ disabled: Y.isFetchingNextPage,
330
331
  style: {
331
332
  width: "100%",
332
333
  padding: "8px 12px",
@@ -335,15 +336,15 @@ function K({ screenCode: i }) {
335
336
  border: "none",
336
337
  borderTop: "1px solid var(--divider)",
337
338
  color: "var(--text-2)",
338
- cursor: J.isFetchingNextPage ? "default" : "pointer"
339
+ cursor: Y.isFetchingNextPage ? "default" : "pointer"
339
340
  },
340
- children: J.isFetchingNextPage ? o("list.records.loading", "Loading…") : o("list.footer.load_more", "Load more")
341
+ children: Y.isFetchingNextPage ? s("list.records.loading", "Loading…") : s("list.footer.load_more", "Load more")
341
342
  })] })
342
343
  })]
343
344
  }),
344
- X && /* @__PURE__ */ U("div", {
345
+ Z && /* @__PURE__ */ H("div", {
345
346
  "data-testid": "record-list-resize-handle",
346
- onMouseDown: Pe,
347
+ onMouseDown: Le,
347
348
  style: {
348
349
  flex: "none",
349
350
  width: 1,
@@ -354,7 +355,7 @@ function K({ screenCode: i }) {
354
355
  onMouseEnter: (e) => e.currentTarget.style.background = "var(--border-strong)",
355
356
  onMouseLeave: (e) => e.currentTarget.style.background = "var(--divider)"
356
357
  }),
357
- Le && /* @__PURE__ */ W("div", {
358
+ Be && /* @__PURE__ */ U("div", {
358
359
  "data-testid": "record-detail-panel",
359
360
  style: {
360
361
  flex: 1,
@@ -362,23 +363,23 @@ function K({ screenCode: i }) {
362
363
  flexDirection: "column",
363
364
  minWidth: 0,
364
365
  overflow: "hidden",
365
- height: G === "stacked" ? "50%" : "100%"
366
+ height: W === "stacked" ? "50%" : "100%"
366
367
  },
367
- children: [!Ie && T.omitted && /* @__PURE__ */ U(L, { className: "p-4" }), /* @__PURE__ */ U("div", {
368
+ children: [!ze && D.omitted && /* @__PURE__ */ H(I, { className: "p-4" }), /* @__PURE__ */ H("div", {
368
369
  style: {
369
370
  flex: 1,
370
371
  minHeight: 0
371
372
  },
372
- children: b ? /* @__PURE__ */ U(Se, {
373
- entityCode: ie,
374
- recordId: b,
373
+ children: x ? /* @__PURE__ */ H(Ce, {
374
+ entityCode: y,
375
+ recordId: x,
375
376
  items: _.items,
376
377
  schema: p,
377
378
  entity: v,
378
- onBackToList: Re,
379
- onOpenFilters: Ie ? void 0 : () => g(!0),
380
- relatedRecordsPresentation: xe
381
- }, b) : /* @__PURE__ */ U("div", {
379
+ onBackToList: Ve,
380
+ onOpenFilters: ze ? void 0 : () => g(!0),
381
+ relatedRecordsPresentation: K
382
+ }, x) : /* @__PURE__ */ H("div", {
382
383
  style: {
383
384
  display: "flex",
384
385
  alignItems: "center",
@@ -386,21 +387,21 @@ function K({ screenCode: i }) {
386
387
  height: "100%",
387
388
  color: "var(--text-3)"
388
389
  },
389
- children: /* @__PURE__ */ U("p", {
390
+ children: /* @__PURE__ */ H("p", {
390
391
  style: { fontSize: 12.5 },
391
- children: o("list.detail.select_prompt", "Select a {name} to view details", { name: o(v.display.name) })
392
+ children: s("list.detail.select_prompt", "Select a {name} to view details", { name: s(v.display.name) })
392
393
  })
393
394
  })
394
395
  })]
395
396
  }),
396
- /* @__PURE__ */ U(I, {
397
- open: h,
397
+ /* @__PURE__ */ H(he, {
398
+ open: ie,
398
399
  onClose: () => g(!1),
399
- filters: E,
400
- onApply: N,
401
- availableFields: ue,
402
- allFields: de,
403
- fieldLabel: fe,
400
+ filters: O,
401
+ onApply: pe,
402
+ availableFields: le,
403
+ allFields: ue,
404
+ fieldLabel: de,
404
405
  resolveValue: Ee,
405
406
  defaultFilters: _.default_filters,
406
407
  refs: De
@@ -408,11 +409,11 @@ function K({ screenCode: i }) {
408
409
  ]
409
410
  });
410
411
  }
411
- function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a, isSelected: o, onClick: s }) {
412
- let c = M();
412
+ function Se({ record: e, entity: t, columns: n, card: r, presentation: i, refs: a, isSelected: o, onClick: s }) {
413
+ let c = P();
413
414
  if (i === "cards") {
414
- let n = r.badgeFields.filter((n) => x(t, e, n)), i = r.bodyFields.filter((n) => x(t, e, n)), l = r.metaFields.filter((n) => x(t, e, n));
415
- return /* @__PURE__ */ W("button", {
415
+ let n = r.badgeFields.filter((n) => S(t, e, n)), i = r.bodyFields.filter((n) => S(t, e, n)), l = r.metaFields.filter((n) => S(t, e, n));
416
+ return /* @__PURE__ */ U("button", {
416
417
  type: "button",
417
418
  "data-testid": "record-list-card",
418
419
  "aria-current": o ? "true" : void 0,
@@ -432,19 +433,19 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
432
433
  boxShadow: o ? "inset 3px 0 0 var(--accent)" : "none"
433
434
  },
434
435
  children: [
435
- /* @__PURE__ */ U(xe, {
436
+ /* @__PURE__ */ H(K, {
436
437
  entity: t,
437
438
  record: e,
438
439
  field: r.titleField,
439
440
  refs: a
440
441
  }),
441
- r.subtitleField && /* @__PURE__ */ U("div", {
442
+ r.subtitleField && /* @__PURE__ */ H("div", {
442
443
  style: {
443
444
  fontSize: 12,
444
445
  color: "var(--text-3)",
445
446
  overflowWrap: "anywhere"
446
447
  },
447
- children: b({
448
+ children: x({
448
449
  entity: t,
449
450
  fieldName: r.subtitleField,
450
451
  record: e,
@@ -453,13 +454,13 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
453
454
  t: c
454
455
  })
455
456
  }),
456
- n.length > 0 && /* @__PURE__ */ U("div", {
457
+ n.length > 0 && /* @__PURE__ */ H("div", {
457
458
  style: {
458
459
  display: "flex",
459
460
  flexWrap: "wrap",
460
461
  gap: 6
461
462
  },
462
- children: n.map((n) => /* @__PURE__ */ U("span", {
463
+ children: n.map((n) => /* @__PURE__ */ H("span", {
463
464
  style: {
464
465
  border: "1px solid var(--border)",
465
466
  borderRadius: 999,
@@ -469,7 +470,7 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
469
470
  maxWidth: "100%",
470
471
  overflowWrap: "anywhere"
471
472
  },
472
- children: b({
473
+ children: x({
473
474
  entity: t,
474
475
  fieldName: n,
475
476
  record: e,
@@ -479,21 +480,21 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
479
480
  })
480
481
  }, n))
481
482
  }),
482
- i.length > 0 && /* @__PURE__ */ U("dl", {
483
+ i.length > 0 && /* @__PURE__ */ H("dl", {
483
484
  style: {
484
485
  display: "grid",
485
486
  gridTemplateColumns: "minmax(72px, max-content) minmax(0, 1fr)",
486
487
  gap: "5px 10px",
487
488
  margin: 0
488
489
  },
489
- children: i.map((n) => /* @__PURE__ */ U(q, {
490
+ children: i.map((n) => /* @__PURE__ */ H(q, {
490
491
  entity: t,
491
492
  record: e,
492
493
  fieldName: n,
493
494
  refs: a
494
495
  }, n))
495
496
  }),
496
- l.length > 0 && /* @__PURE__ */ U("div", {
497
+ l.length > 0 && /* @__PURE__ */ H("div", {
497
498
  style: {
498
499
  display: "flex",
499
500
  flexWrap: "wrap",
@@ -501,12 +502,12 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
501
502
  fontSize: 11,
502
503
  color: "var(--text-3)"
503
504
  },
504
- children: l.map((n) => /* @__PURE__ */ U("span", {
505
+ children: l.map((n) => /* @__PURE__ */ H("span", {
505
506
  style: {
506
507
  minWidth: 0,
507
508
  overflowWrap: "anywhere"
508
509
  },
509
- children: b({
510
+ children: x({
510
511
  entity: t,
511
512
  fieldName: n,
512
513
  record: e,
@@ -520,7 +521,7 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
520
521
  });
521
522
  }
522
523
  let l = n[0], u = n[1], d = n.slice(2, 4);
523
- return /* @__PURE__ */ W("button", {
524
+ return /* @__PURE__ */ U("button", {
524
525
  onClick: s,
525
526
  style: {
526
527
  width: "100%",
@@ -543,7 +544,7 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
543
544
  onMouseLeave: (e) => {
544
545
  o || (e.currentTarget.style.background = "transparent");
545
546
  },
546
- children: [l && /* @__PURE__ */ U("div", {
547
+ children: [l && /* @__PURE__ */ H("div", {
547
548
  style: {
548
549
  fontSize: 12.5,
549
550
  fontWeight: 500,
@@ -552,7 +553,7 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
552
553
  whiteSpace: "nowrap",
553
554
  color: "var(--text)"
554
555
  },
555
- children: b({
556
+ children: x({
556
557
  entity: t,
557
558
  fieldName: l,
558
559
  record: e,
@@ -560,13 +561,13 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
560
561
  refs: a,
561
562
  t: c
562
563
  })
563
- }), /* @__PURE__ */ W("div", {
564
+ }), /* @__PURE__ */ U("div", {
564
565
  style: {
565
566
  display: "flex",
566
567
  alignItems: "center",
567
568
  gap: 6
568
569
  },
569
- children: [u && /* @__PURE__ */ U("div", {
570
+ children: [u && /* @__PURE__ */ H("div", {
570
571
  style: {
571
572
  fontSize: 11,
572
573
  color: "var(--text-3)",
@@ -575,7 +576,7 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
575
576
  textOverflow: "ellipsis",
576
577
  whiteSpace: "nowrap"
577
578
  },
578
- children: b({
579
+ children: x({
579
580
  entity: t,
580
581
  fieldName: u,
581
582
  record: e,
@@ -583,16 +584,16 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
583
584
  refs: a,
584
585
  t: c
585
586
  })
586
- }), /* @__PURE__ */ U("div", {
587
+ }), /* @__PURE__ */ H("div", {
587
588
  style: {
588
589
  display: "flex",
589
590
  alignItems: "center",
590
591
  gap: 4,
591
592
  flexShrink: 0
592
593
  },
593
- children: d.map((n) => y(t, e, n) == null ? null : /* @__PURE__ */ U("div", {
594
+ children: d.map((n) => b(t, e, n) == null ? null : /* @__PURE__ */ H("div", {
594
595
  style: { fontSize: 11 },
595
- children: b({
596
+ children: x({
596
597
  entity: t,
597
598
  fieldName: n,
598
599
  record: e,
@@ -605,8 +606,8 @@ function be({ record: e, entity: t, columns: n, card: r, presentation: i, refs:
605
606
  })]
606
607
  });
607
608
  }
608
- function xe({ entity: e, record: t, field: n, refs: r }) {
609
- let i = M(), a = ue(i, t, e), o = n ? b({
609
+ function K({ entity: e, record: t, field: n, refs: r }) {
610
+ let i = P(), a = le(i, t, e), o = n ? x({
610
611
  entity: e,
611
612
  fieldName: n,
612
613
  record: t,
@@ -614,7 +615,7 @@ function xe({ entity: e, record: t, field: n, refs: r }) {
614
615
  refs: r,
615
616
  t: i
616
617
  }) : a;
617
- return /* @__PURE__ */ U("div", {
618
+ return /* @__PURE__ */ H("div", {
618
619
  style: {
619
620
  fontSize: 13.5,
620
621
  fontWeight: 600,
@@ -625,18 +626,18 @@ function xe({ entity: e, record: t, field: n, refs: r }) {
625
626
  });
626
627
  }
627
628
  function q({ entity: e, record: t, fieldName: n, refs: r }) {
628
- let i = M(), a = y(e, t, n);
629
+ let i = P(), a = b(e, t, n);
629
630
  if (a == null || a === "") return null;
630
631
  let o = e.fields.get(n);
631
- return o ? /* @__PURE__ */ W(_e, { children: [/* @__PURE__ */ U("dt", {
632
+ return o ? /* @__PURE__ */ U(ye, { children: [/* @__PURE__ */ H("dt", {
632
633
  style: {
633
634
  color: "var(--text-3)",
634
635
  fontSize: 11.5,
635
636
  minWidth: 0,
636
637
  overflowWrap: "anywhere"
637
638
  },
638
- children: T(i, o, n)
639
- }), /* @__PURE__ */ U("dd", {
639
+ children: D(i, o, n)
640
+ }), /* @__PURE__ */ H("dd", {
640
641
  style: {
641
642
  margin: 0,
642
643
  color: "var(--text)",
@@ -644,7 +645,7 @@ function q({ entity: e, record: t, fieldName: n, refs: r }) {
644
645
  minWidth: 0,
645
646
  overflowWrap: "anywhere"
646
647
  },
647
- children: b({
648
+ children: x({
648
649
  entity: e,
649
650
  fieldName: n,
650
651
  record: t,
@@ -654,8 +655,8 @@ function q({ entity: e, record: t, fieldName: n, refs: r }) {
654
655
  })
655
656
  })] }) : null;
656
657
  }
657
- function Se({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, onOpenFilters: o, relatedRecordsPresentation: s }) {
658
- return /* @__PURE__ */ U(h, { children: /* @__PURE__ */ U(Ce, {
658
+ function Ce({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBackToList: a, onOpenFilters: o, relatedRecordsPresentation: s }) {
659
+ return /* @__PURE__ */ H(ie, { children: /* @__PURE__ */ H(J, {
659
660
  entityCode: e,
660
661
  recordId: t,
661
662
  items: n,
@@ -666,56 +667,56 @@ function Se({ entityCode: e, recordId: t, items: n, schema: r, entity: i, onBack
666
667
  relatedRecordsPresentation: s
667
668
  }) });
668
669
  }
669
- function Ce({ entityCode: e, recordId: a, items: l, schema: u, entity: d, onBackToList: ee, onOpenFilters: ne, relatedRecordsPresentation: re }) {
670
- let h = M(), b = M("errors"), x = N(d), oe = B(() => a ? E(d, a) : void 0, [a, d]), se = f(e, oe), ce = se.data, S = s(se), T = p(e), D = g(), [O, k] = H(!1), [A, j] = H({}), F = ce?.data, I = fe(d, "update", F, x.tenantId), me = F?.$statuses, he = F?.$properties, L = te(e, a), ge = m(e, a), z = B(() => {
670
+ function J({ entityCode: e, recordId: t, items: o, schema: u, entity: d, onBackToList: ee, onOpenFilters: te, relatedRecordsPresentation: re }) {
671
+ let h = P(), ie = P("errors"), x = pe(d), S = z(() => t ? O(d, t) : void 0, [t, d]), oe = f(e, S), se = oe.data, C = c(oe), w = p(e), D = g(), [k, A] = V(!1), [j, M] = V({}), N = se?.data, F = de(d, "update", N, x.tenantId), he = N?.$statuses, ge = N?.$properties, _e = ne(e, t), I = m(e, t), ve = z(() => {
671
672
  let e = /* @__PURE__ */ new Set();
672
- for (let [t, n] of d.fields) de(n) && e.add(t);
673
+ for (let [t, n] of d.fields) ue(n) && e.add(t);
673
674
  for (let [t] of d.files ?? []) e.add(t);
674
675
  return e;
675
- }, [d]), V = R(() => {
676
- if (F) {
676
+ }, [d]), R = L(() => {
677
+ if (N) {
677
678
  let e = {};
678
- z.forEach((t) => {
679
- let n = y(d, F, t);
680
- e[t] = ie(d, t) ? n ?? null : n ?? "";
681
- }), j(e);
679
+ ve.forEach((t) => {
680
+ let n = b(d, N, t);
681
+ e[t] = y(d, t) ? n ?? null : n ?? "";
682
+ }), M(e);
682
683
  }
683
- k(!0);
684
+ A(!0);
684
685
  }, [
685
- F,
686
- z,
686
+ N,
687
+ ve,
687
688
  d
688
- ]), ve = R(async () => {
689
- await D.flushAllDrafts(), k(!1), j({});
690
- }, [D]), ye = R(() => {
691
- let e = {}, t = _({
689
+ ]), B = L(async () => {
690
+ await D.flushAllDrafts(), A(!1), M({});
691
+ }, [D]), be = L(() => {
692
+ let e = {}, n = _({
692
693
  entity: d,
693
- formData: A,
694
- record: F,
694
+ formData: j,
695
+ record: N,
695
696
  isNew: !1
696
- }), n = v(t);
697
- for (let [t, n] of Object.entries(A)) d.files?.has(t) || (e[t] = ae(d, t, n));
698
- Object.keys(t).length > 0 && (e.$files = t), Object.keys(e).length === 0 ? (k(!1), j({})) : T.mutate({
699
- pkValues: a,
697
+ }), r = v(n);
698
+ for (let [t, n] of Object.entries(j)) d.files?.has(t) || (e[t] = ae(d, t, n));
699
+ Object.keys(n).length > 0 && (e.$files = n), Object.keys(e).length === 0 ? (A(!1), M({})) : w.mutate({
700
+ pkValues: t,
700
701
  data: e
701
702
  }, { onSuccess: () => {
702
- n.forEach((e) => D.markCommitted(e)), k(!1), j({});
703
+ r.forEach((e) => D.markCommitted(e)), A(!1), M({});
703
704
  } });
704
705
  }, [
705
706
  D,
706
- T,
707
- a,
707
+ w,
708
+ t,
708
709
  d,
709
- A,
710
- F
711
- ]), K = R((e, t) => {
712
- j((n) => ({
710
+ j,
711
+ N
712
+ ]), xe = L((e, t) => {
713
+ M((n) => ({
713
714
  ...n,
714
715
  [e]: t
715
716
  }));
716
717
  }, []);
717
- if (S.loading) return /* @__PURE__ */ U(C, {});
718
- if (!F && S.error !== null) return /* @__PURE__ */ W("p", {
718
+ if (C.loading) return /* @__PURE__ */ H(T, {});
719
+ if (!N && C.error !== null) return /* @__PURE__ */ U("p", {
719
720
  role: "alert",
720
721
  style: {
721
722
  padding: 16,
@@ -725,60 +726,60 @@ function Ce({ entityCode: e, recordId: a, items: l, schema: u, entity: d, onBack
725
726
  gap: 8
726
727
  },
727
728
  children: [
728
- c(b, S.error),
729
+ l(ie, C.error),
729
730
  " ",
730
- /* @__PURE__ */ U(o, { onRetry: S.retry })
731
+ /* @__PURE__ */ H(s, { onRetry: C.retry })
731
732
  ]
732
733
  });
733
- if (!F) return null;
734
- let be = ue(h, F, d), xe = d.display?.display_field, q = be ? void 0 : xe ? F[xe] : F[d.fields.names()[0]], Se = be || (q != null && typeof q != "object" ? le(q) : h(d.display.name)), Ce = F?.$refs, J = {
734
+ if (!N) return null;
735
+ let G = le(h, N, d), Se = d.display?.display_field, K = G ? void 0 : Se ? N[Se] : N[d.fields.names()[0]], q = G || (K != null && typeof K != "object" ? ce(K) : h(d.display.name)), Ce = N?.$refs, J = {
735
736
  schema: u,
736
737
  entity: d,
737
738
  entityCode: e,
738
- recordId: a,
739
- record: O ? {
740
- ...F,
741
- ...A
742
- } : F,
739
+ recordId: t,
740
+ record: k ? {
741
+ ...N,
742
+ ...j
743
+ } : N,
743
744
  isNew: !1,
744
- mode: O ? "edit" : "display",
745
- onFieldChange: O ? K : void 0,
745
+ mode: k ? "edit" : "display",
746
+ onFieldChange: k ? xe : void 0,
746
747
  refs: Ce,
747
- objectProperties: he ?? void 0,
748
- onSetProperty: I ? (e, t) => ge.mutate({
748
+ objectProperties: ge ?? void 0,
749
+ onSetProperty: F ? (e, t) => I.mutate({
749
750
  propertyCode: e,
750
751
  value: t
751
752
  }) : void 0,
752
- isPropertyPending: ge.isPending,
753
- objectStatuses: me ?? void 0,
754
- onSetStatus: I ? (e, t) => L.mutate({
753
+ isPropertyPending: I.isPending,
754
+ objectStatuses: he ?? void 0,
755
+ onSetStatus: F ? (e, t) => _e.mutate({
755
756
  groupCode: e,
756
757
  statusCode: t
757
758
  }) : void 0,
758
- isStatusPending: L.isPending,
759
+ isStatusPending: _e.isPending,
759
760
  relatedRecordsPresentation: re
760
761
  };
761
- return /* @__PURE__ */ W("div", {
762
+ return /* @__PURE__ */ U("div", {
762
763
  style: {
763
764
  display: "flex",
764
765
  flexDirection: "column",
765
766
  height: "100%"
766
767
  },
767
- children: [/* @__PURE__ */ W("div", {
768
+ children: [/* @__PURE__ */ U("div", {
768
769
  style: {
769
770
  display: "flex",
770
771
  alignItems: "center",
771
772
  justifyContent: "space-between",
772
773
  paddingTop: 10,
773
774
  paddingBottom: 10,
774
- ...pe(16),
775
+ ...fe(16),
775
776
  borderBottom: "1px solid var(--divider)",
776
777
  position: "sticky",
777
778
  top: 0,
778
779
  background: "var(--surface)",
779
780
  zIndex: 10
780
781
  },
781
- children: [/* @__PURE__ */ U("h2", {
782
+ children: [/* @__PURE__ */ H("h2", {
782
783
  style: {
783
784
  margin: 0,
784
785
  fontSize: 13,
@@ -788,66 +789,66 @@ function Ce({ entityCode: e, recordId: a, items: l, schema: u, entity: d, onBack
788
789
  whiteSpace: "nowrap",
789
790
  color: "var(--text)"
790
791
  },
791
- children: Se
792
- }), /* @__PURE__ */ W("div", {
792
+ children: q
793
+ }), /* @__PURE__ */ U("div", {
793
794
  style: {
794
795
  display: "flex",
795
796
  alignItems: "center",
796
797
  gap: 6
797
798
  },
798
799
  children: [
799
- ee && /* @__PURE__ */ U(r, {
800
- icon: /* @__PURE__ */ U(n.back, { size: 14 }),
800
+ ee && /* @__PURE__ */ H(i, {
801
+ icon: /* @__PURE__ */ H(r.back, { size: 14 }),
801
802
  title: h("list.detail.back_to_list", "Back to list"),
802
803
  onClick: ee
803
804
  }),
804
- ne && /* @__PURE__ */ U(r, {
805
- icon: /* @__PURE__ */ U(n.filter, { size: 14 }),
805
+ te && /* @__PURE__ */ H(i, {
806
+ icon: /* @__PURE__ */ H(r.filter, { size: 14 }),
806
807
  title: h("filter.drawer.title", "Filters"),
807
- onClick: ne
808
+ onClick: te
808
809
  }),
809
- I && (O ? /* @__PURE__ */ W(_e, { children: [/* @__PURE__ */ U(t, {
810
+ F && (k ? /* @__PURE__ */ U(ye, { children: [/* @__PURE__ */ H(n, {
810
811
  size: "xs",
811
- icon: /* @__PURE__ */ U(n.x, { size: 12 }),
812
- onClick: ve,
812
+ icon: /* @__PURE__ */ H(r.x, { size: 12 }),
813
+ onClick: B,
813
814
  children: h("dialog.cancel", "Cancel")
814
- }), /* @__PURE__ */ U(t, {
815
+ }), /* @__PURE__ */ H(n, {
815
816
  kind: "primary",
816
817
  size: "xs",
817
- icon: T.isPending ? /* @__PURE__ */ U(i, { size: 12 }) : /* @__PURE__ */ U(n.save, { size: 12 }),
818
- onClick: ye,
819
- disabled: T.isPending,
820
- children: T.isPending ? h("dialog.saving", "Saving…") : h("dialog.save", "Save")
821
- })] }) : /* @__PURE__ */ U(t, {
818
+ icon: w.isPending ? /* @__PURE__ */ H(a, { size: 12 }) : /* @__PURE__ */ H(r.save, { size: 12 }),
819
+ onClick: be,
820
+ disabled: w.isPending,
821
+ children: w.isPending ? h("dialog.saving", "Saving…") : h("dialog.save", "Save")
822
+ })] }) : /* @__PURE__ */ H(n, {
822
823
  size: "xs",
823
- icon: /* @__PURE__ */ U(n.edit, { size: 12 }),
824
- onClick: V,
824
+ icon: /* @__PURE__ */ H(r.edit, { size: 12 }),
825
+ onClick: R,
825
826
  children: h("list.record.edit", "Edit")
826
827
  }))
827
828
  ]
828
829
  })]
829
- }), /* @__PURE__ */ U("div", {
830
+ }), /* @__PURE__ */ H("div", {
830
831
  style: {
831
832
  flex: 1,
832
833
  overflowY: "auto",
833
834
  paddingTop: 16,
834
835
  paddingBottom: 16,
835
- ...pe(16),
836
+ ...fe(16),
836
837
  display: "flex",
837
838
  flexDirection: "column",
838
839
  gap: 12
839
840
  },
840
- children: l && l.length > 0 ? /* @__PURE__ */ U(w, {
841
- nodes: l,
841
+ children: o && o.length > 0 ? /* @__PURE__ */ H(E, {
842
+ nodes: o,
842
843
  ctx: J
843
- }) : /* @__PURE__ */ U("p", {
844
+ }) : /* @__PURE__ */ H("p", {
844
845
  style: {
845
846
  fontSize: 12.5,
846
847
  color: "var(--text-3)"
847
848
  },
848
- children: P(h("list.detail.no_layout", "No layout configured. Add {key} to the screen definition."), { key: /* @__PURE__ */ U("code", { children: G }) })
849
+ children: me(h("list.detail.no_layout", "No layout configured. Add {key} to the screen definition."), { key: /* @__PURE__ */ H("code", { children: W }) })
849
850
  })
850
851
  })]
851
852
  });
852
853
  }
853
- export { K as SmartRecordListPage };
854
+ export { G as SmartRecordListPage };