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