@declarion/react 0.87.0 → 0.89.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,32 +1,32 @@
1
1
  import { OrderedMap as e } from "../../types/ordmap.js";
2
2
  import { coerceDisplayString as t } from "../../lib/display-value.js";
3
- import { entityAllowsMutation as n, extractPkValues as r, fieldDisplayName as i, getPrimaryKeyFields as a, resolveDetailRoute as o, rowSetInTenant as s } from "../../types/schema.js";
4
- import { Icon as c } from "../primitives/Icons.js";
5
- import { Btn as l } from "../primitives/Btn.js";
6
- import { IconBtn as u } from "../primitives/IconBtn.js";
7
- import { useText as d } from "../../hooks/useText.js";
8
- import { SectionCard as f } from "../primitives/SectionCard.js";
9
- import { useResponsiveMode as p } from "../../hooks/useResponsiveMode.js";
10
- import { Spinner as m } from "../primitives/Spinner.js";
11
- import { DynamicIcon as h } from "../shared/DynamicIcon.js";
12
- import { buildActionBody as g, createEntity as _, deleteObject as v, encodeObjectId as y, executeAction as b, updateEntity as x } from "../../api/data.js";
13
- import { failureTitle as S } from "../../lib/failure.js";
14
- import { useTabNavigate as C } from "../../hooks/useTabNavigate.js";
15
- import { applyRowState as w, defaultFlatForSlot as T } from "../../lib/actions.js";
16
- import { ENTITY_CHILDREN_KEY as E, useChildrenData as D } from "../../hooks/useChildrenData.js";
17
- import { useActionRunner as O } from "../actions/ActionRunner.js";
18
- import { renderField as k } from "../fields/index.js";
19
- import { dispatchAction as A } from "../../lib/action-dispatch.js";
20
- import { ResponsiveActionBar as j } from "../actions/ResponsiveActionBar.js";
21
- import { useRowTenant as M } from "../../hooks/useRowTenant.js";
22
- import { dataTableCellStyle as N, dataTableHeadCellStyle as ee, dataTableStyle as te } from "../primitives/dataTableStyles.js";
23
- import { ActionButton as P } from "../actions/ActionButton.js";
3
+ import { entityAllowsMutation as n, extractPkValues as r, fieldDisplayName as i, getPrimaryKeyFields as a, isUserEditableField as o, resolveDetailRoute as s, rowSetInTenant as c } from "../../types/schema.js";
4
+ import { buildActionBody as l, createEntity as u, deleteObject as d, encodeObjectId as f, executeAction as p, updateEntity as m } from "../../api/data.js";
5
+ import { failureTitle as h } from "../../lib/failure.js";
6
+ import { Icon as g } from "../primitives/Icons.js";
7
+ import { Btn as _ } from "../primitives/Btn.js";
8
+ import { IconBtn as v } from "../primitives/IconBtn.js";
9
+ import { useText as y } from "../../hooks/useText.js";
10
+ import { SectionCard as b } from "../primitives/SectionCard.js";
11
+ import { useResponsiveMode as x } from "../../hooks/useResponsiveMode.js";
12
+ import { Spinner as S } from "../primitives/Spinner.js";
13
+ import { DynamicIcon as C } from "../shared/DynamicIcon.js";
14
+ import { useTabNavigate as w } from "../../hooks/useTabNavigate.js";
15
+ import { applyRowState as T, defaultFlatForSlot as E } from "../../lib/actions.js";
16
+ import { ENTITY_CHILDREN_KEY as D, useChildrenData as O } from "../../hooks/useChildrenData.js";
17
+ import { useActionRunner as k } from "../actions/ActionRunner.js";
18
+ import { renderField as A } from "../fields/index.js";
19
+ import { dispatchAction as j } from "../../lib/action-dispatch.js";
20
+ import { ResponsiveActionBar as M } from "../actions/ResponsiveActionBar.js";
21
+ import { useRowTenant as ee } from "../../hooks/useRowTenant.js";
22
+ import { dataTableCellStyle as N, dataTableHeadCellStyle as te, dataTableStyle as P } from "../primitives/dataTableStyles.js";
23
+ import { ActionButton as ne } from "../actions/ActionButton.js";
24
24
  import { useAssociatedData as F } from "../../hooks/useAssociatedData.js";
25
25
  import { RowActionsKebab as I } from "../actions/RowActionsKebab.js";
26
- import { AssociatedToolbar as ne } from "./AssociatedToolbar.js";
27
- import { useCallback as L, useEffect as re, useId as R, useMemo as z, useRef as B, useState as V } from "react";
28
- import { useQueryClient as H } from "@tanstack/react-query";
29
- import { Fragment as ie, jsx as U, jsxs as W } from "react/jsx-runtime";
26
+ import { AssociatedToolbar as L } from "./AssociatedToolbar.js";
27
+ import { useCallback as R, useEffect as re, useId as z, useMemo as B, useRef as V, useState as H } from "react";
28
+ import { useQueryClient as U } from "@tanstack/react-query";
29
+ import { Fragment as ie, jsx as W, jsxs as G } from "react/jsx-runtime";
30
30
  //#region src/components/detail-layout/AssociatedBlock.tsx
31
31
  function ae(e) {
32
32
  if (!e) return [];
@@ -37,7 +37,7 @@ function ae(e) {
37
37
  }));
38
38
  return t;
39
39
  }
40
- function oe(t, n, r) {
40
+ function K(t, n, r) {
41
41
  if (!t) return [];
42
42
  let i = [];
43
43
  for (let [a, o] of Object.entries(t)) {
@@ -63,7 +63,7 @@ function oe(t, n, r) {
63
63
  }
64
64
  return i;
65
65
  }
66
- function G(e, t, n) {
66
+ function oe(e, t, n) {
67
67
  let r = e[n];
68
68
  if (!r) return null;
69
69
  let i = e[t], a = i?.children?.find((e) => e.entity === n);
@@ -85,12 +85,18 @@ function G(e, t, n) {
85
85
  }
86
86
  return null;
87
87
  }
88
+ function q(e, t, n, r, i) {
89
+ let o = e.fields.get(t)?.ref?.field;
90
+ if (!o || a(n).includes(o)) return i;
91
+ let s = r[o];
92
+ return typeof s == "string" || typeof s == "number" ? String(s) : "";
93
+ }
88
94
  function se(e, t, n) {
89
95
  let r = new Set(a(e));
90
96
  return new Set(t.filter((t) => {
91
97
  if (t === n || r.has(t)) return !1;
92
98
  let i = e.fields.get(t);
93
- return !(!i || i.auto || i.primary || i.source);
99
+ return i ? o(i) : !1;
94
100
  }));
95
101
  }
96
102
  function ce(e, t, n) {
@@ -110,19 +116,19 @@ function le(e, t, n, r) {
110
116
  }
111
117
  return i;
112
118
  }
113
- function ue({ node: e, ctx: t }) {
114
- let n = d("errors"), r = e.associated;
119
+ function J({ node: e, ctx: t }) {
120
+ let n = y("errors"), r = e.associated;
115
121
  if (!r || t.isNew) return null;
116
122
  let i = t.schema.entities[r];
117
123
  if (!i) return null;
118
- let a = e.foreign_key ?? G(t.schema.entities, t.entityCode, r);
119
- return a ? /* @__PURE__ */ U(K, {
124
+ let a = e.foreign_key ?? oe(t.schema.entities, t.entityCode, r);
125
+ return a ? /* @__PURE__ */ W(Y, {
120
126
  node: e,
121
127
  ctx: t,
122
128
  assocCode: r,
123
129
  assocEntity: i,
124
130
  fkField: a
125
- }) : /* @__PURE__ */ W("div", {
131
+ }) : /* @__PURE__ */ G("div", {
126
132
  style: {
127
133
  fontSize: 12.5,
128
134
  color: "var(--text-3)",
@@ -137,28 +143,28 @@ function ue({ node: e, ctx: t }) {
137
143
  ]
138
144
  });
139
145
  }
140
- function K({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
141
- let o = d(), s = d("errors"), u = e.columns && e.columns.length > 0 ? e.columns.filter((e) => e !== a && !!i.fields.get(e)) : i.fields.names().filter((e) => {
146
+ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
147
+ let o = y(), s = y("errors"), c = e.columns && e.columns.length > 0 ? e.columns.filter((e) => e !== a && !!i.fields.get(e)) : i.fields.names().filter((e) => {
142
148
  if (e === a) return !1;
143
149
  let t = i.fields.get(e);
144
150
  return !(!t || t.primary || t.display?.is_listable === !1);
145
- }), p = n(i, "update"), m = M(i), _ = e.interaction ?? "navigate", v = (_ === "inline_edit" || _ === "row_edit") && p && e.editable !== !1, y = o(i.display?.name_plural) || o(i.display?.name) || r, x = e.searchable === !0 || e.filters && e.filters.length > 0, S = z(() => oe(i.actions, a, t.recordId), [
151
+ }), u = n(i, "update"), d = ee(i), f = e.interaction ?? "navigate", m = (f === "inline_edit" || f === "row_edit") && u && e.editable !== !1, h = o(i.display?.name_plural) || o(i.display?.name) || r, v = e.searchable === !0 || e.filters && e.filters.length > 0, x = q(i, a, t.entity, t.record, t.recordId), S = B(() => K(i.actions, a, x), [
146
152
  i.actions,
147
153
  a,
148
- t.recordId
149
- ]), E = z(() => {
154
+ x
155
+ ]), D = B(() => {
150
156
  let e = {};
151
157
  for (let { code: t, action: n } of S) e[t] = n;
152
158
  return e;
153
- }, [S]), D = z(() => {
159
+ }, [S]), O = B(() => {
154
160
  let e = i.action_layout ?? null;
155
- return w(o, e ?? T(E, "list_toolbar"), E, void 0, {}, [], m);
161
+ return T(o, e ?? E(D, "list_toolbar"), D, void 0, {}, [], d);
156
162
  }, [
157
163
  o,
158
164
  i.action_layout,
159
- E,
160
- m
161
- ]), { run: k } = O(), N = C(), ee = z(() => ({
165
+ D,
166
+ d
167
+ ]), { run: A } = k(), N = w(), te = B(() => ({
162
168
  entity: i,
163
169
  entityCode: r,
164
170
  screenRoute: typeof window < "u" ? window.location.pathname : "",
@@ -170,34 +176,34 @@ function K({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
170
176
  icon: t?.icon,
171
177
  search: t?.search
172
178
  }),
173
- runActionApi: (e, t) => b(e, t)
179
+ runActionApi: (e, t) => p(e, t)
174
180
  }), [
175
181
  i,
176
182
  r,
177
183
  o,
178
184
  N
179
- ]), te = H(), F = L(() => {
180
- te.invalidateQueries({ predicate: (e) => {
185
+ ]), P = U(), F = R(() => {
186
+ P.invalidateQueries({ predicate: (e) => {
181
187
  let t = e.queryKey;
182
188
  return t[0] === "entity-children" && t[3] === r;
183
189
  } });
184
- }, [te, r]), I = L((e, t) => {
185
- let n = A(s, e, t, {}, r);
186
- if (n !== null) return k({
190
+ }, [P, r]), I = R((e, t) => {
191
+ let n = j(s, e, t, {}, r);
192
+ if (n !== null) return A({
187
193
  action: t,
188
194
  title: o(t.display?.name) || e,
189
195
  execute: async (e) => {
190
- let t = await b(n, g(e, void 0));
196
+ let t = await p(n, l(e, void 0));
191
197
  return F(), t;
192
198
  }
193
199
  });
194
200
  }, [
195
201
  o,
196
202
  s,
197
- k,
203
+ A,
198
204
  r,
199
205
  F
200
- ]), [ne, re] = V(0), R = /* @__PURE__ */ W("div", {
206
+ ]), [L, re] = H(0), z = /* @__PURE__ */ G("div", {
201
207
  style: {
202
208
  display: "flex",
203
209
  alignItems: "center",
@@ -206,75 +212,75 @@ function K({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
206
212
  minWidth: 0,
207
213
  justifyContent: "flex-end"
208
214
  },
209
- children: [i.action_layout ? D.length > 0 && /* @__PURE__ */ U(j, {
215
+ children: [i.action_layout ? O.length > 0 && /* @__PURE__ */ W(M, {
210
216
  kind: "toolbar",
211
- layout: D,
212
- entityActions: E,
217
+ layout: O,
218
+ entityActions: D,
213
219
  onRun: I,
214
- widgetContext: ee,
215
- ariaLabel: o("record.associated.toolbar_actions", "{name} toolbar actions", { name: y })
216
- }) : S.map(({ code: e, action: t }) => /* @__PURE__ */ U(P, {
220
+ widgetContext: te,
221
+ ariaLabel: o("record.associated.toolbar_actions", "{name} toolbar actions", { name: h })
222
+ }) : S.map(({ code: e, action: t }) => /* @__PURE__ */ W(ne, {
217
223
  actionCode: e,
218
224
  action: t,
219
225
  entityCode: r,
220
226
  variant: "ghost",
221
227
  size: "sm",
222
228
  onSuccess: F
223
- }, e)), v && /* @__PURE__ */ U(l, {
229
+ }, e)), m && /* @__PURE__ */ W(_, {
224
230
  kind: "ghost",
225
231
  size: "xs",
226
- icon: /* @__PURE__ */ U(c.plus, { size: 12 }),
232
+ icon: /* @__PURE__ */ W(g.plus, { size: 12 }),
227
233
  onClick: () => re((e) => e + 1),
228
234
  children: o("record.row.add", "Add row")
229
235
  })]
230
- }), B = x ? /* @__PURE__ */ U(J, {
236
+ }), V = v ? /* @__PURE__ */ W(X, {
231
237
  entityCode: r,
232
238
  entity: i,
233
239
  parentEntity: t.entityCode,
234
- parentId: t.recordId,
240
+ parentId: x,
235
241
  foreignKey: a,
236
- columns: u,
237
- editable: v,
238
- interaction: _,
242
+ columns: c,
243
+ editable: m,
244
+ interaction: f,
239
245
  ctx: t,
240
246
  searchable: e.searchable,
241
247
  filterFields: e.filters,
242
248
  sort: e.sort,
243
- startDraftSignal: ne
244
- }) : /* @__PURE__ */ U(q, {
249
+ startDraftSignal: L
250
+ }) : /* @__PURE__ */ W(ue, {
245
251
  entityCode: r,
246
252
  entity: i,
247
253
  parentEntity: t.entityCode,
248
- parentId: t.recordId,
254
+ parentId: x,
249
255
  foreignKey: a,
250
- columns: u,
251
- editable: v,
252
- interaction: _,
256
+ columns: c,
257
+ editable: m,
258
+ interaction: f,
253
259
  ctx: t,
254
260
  sort: e.sort,
255
- startDraftSignal: ne
261
+ startDraftSignal: L
256
262
  });
257
- return t.withinCard ? /* @__PURE__ */ W("div", { children: [/* @__PURE__ */ U("div", {
263
+ return t.withinCard ? /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("div", {
258
264
  style: {
259
265
  display: "flex",
260
266
  justifyContent: "flex-end",
261
267
  marginBottom: 8
262
268
  },
263
- children: R
264
- }), B] }) : /* @__PURE__ */ U(f, {
265
- title: y,
266
- icon: i.display?.icon ? /* @__PURE__ */ U(h, {
269
+ children: z
270
+ }), V] }) : /* @__PURE__ */ W(b, {
271
+ title: h,
272
+ icon: i.display?.icon ? /* @__PURE__ */ W(C, {
267
273
  name: i.display.icon,
268
274
  size: 14
269
275
  }) : void 0,
270
- right: R,
271
- children: B
276
+ right: z,
277
+ children: V
272
278
  });
273
279
  }
274
- function q({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
275
- let d = H(), { data: f, isLoading: p, isError: m } = D(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs, _ = L(() => {
280
+ function ue({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
281
+ let d = U(), { data: f, isLoading: p, isError: m } = O(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs, _ = R(() => {
276
282
  d.invalidateQueries({ queryKey: [
277
- E,
283
+ D,
278
284
  n,
279
285
  r,
280
286
  e
@@ -285,7 +291,7 @@ function q({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
285
291
  r,
286
292
  e
287
293
  ]);
288
- return /* @__PURE__ */ U(Y, {
294
+ return /* @__PURE__ */ W(Z, {
289
295
  entityCode: e,
290
296
  entity: t,
291
297
  parentId: r,
@@ -302,14 +308,14 @@ function q({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
302
308
  startDraftSignal: u
303
309
  });
304
310
  }
305
- function J({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: u, filterFields: f, sort: p, startDraftSignal: h }) {
306
- let g = d(), _ = H(), [v, y] = V(""), [b, x] = V(""), [S, C] = V({}), w = B(void 0);
311
+ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: l, filterFields: u, sort: d, startDraftSignal: f }) {
312
+ let p = y(), m = U(), [h, g] = H(""), [v, b] = H(""), [x, C] = H({}), w = V(void 0);
307
313
  re(() => (w.current && clearTimeout(w.current), w.current = setTimeout(() => {
308
- x(v);
314
+ b(h);
309
315
  }, 300), () => {
310
316
  w.current && clearTimeout(w.current);
311
- }), [v]);
312
- let T = L((e, t) => {
317
+ }), [h]);
318
+ let T = R((e, t) => {
313
319
  C((n) => {
314
320
  if (t === "__all__") {
315
321
  let { [e]: t, ...r } = n;
@@ -320,7 +326,7 @@ function J({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
320
326
  [e]: t
321
327
  };
322
328
  });
323
- }, []), E = z(() => Object.keys(S).length > 0 ? S : void 0, [S]), { data: D, isLoading: O, isError: k, hasNextPage: A, fetchNextPage: j, isFetchingNextPage: M } = F(n, r, e, i, p, void 0, b || void 0, E), { rows: N, refs: ee } = z(() => {
329
+ }, []), E = B(() => Object.keys(x).length > 0 ? x : void 0, [x]), { data: D, isLoading: O, isError: k, hasNextPage: A, fetchNextPage: j, isFetchingNextPage: M } = F(n, r, e, i, d, void 0, v || void 0, E), { rows: ee, refs: N } = B(() => {
324
330
  if (!D?.pages) return {
325
331
  rows: [],
326
332
  refs: void 0
@@ -337,24 +343,24 @@ function J({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
337
343
  rows: e,
338
344
  refs: t
339
345
  };
340
- }, [D]), te = L(() => {
341
- _.invalidateQueries({ predicate: (t) => {
346
+ }, [D]), te = R(() => {
347
+ m.invalidateQueries({ predicate: (t) => {
342
348
  let n = t.queryKey;
343
349
  return n[0] === "entity-children" && n[3] === e;
344
350
  } });
345
- }, [_, e]);
346
- return /* @__PURE__ */ W("div", { children: [
347
- /* @__PURE__ */ U(ne, {
351
+ }, [m, e]);
352
+ return /* @__PURE__ */ G("div", { children: [
353
+ /* @__PURE__ */ W(L, {
348
354
  entity: t,
349
- searchable: u,
350
- filterFields: f,
351
- searchValue: v,
352
- onSearchChange: y,
353
- filters: S,
355
+ searchable: l,
356
+ filterFields: u,
357
+ searchValue: h,
358
+ onSearchChange: g,
359
+ filters: x,
354
360
  onFilterChange: T,
355
361
  allEntities: c.schema.entities
356
362
  }),
357
- /* @__PURE__ */ U(Y, {
363
+ /* @__PURE__ */ W(Z, {
358
364
  entityCode: e,
359
365
  entity: t,
360
366
  parentId: r,
@@ -363,65 +369,65 @@ function J({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
363
369
  editable: o,
364
370
  interaction: s,
365
371
  ctx: c,
366
- rows: N,
367
- refs: ee,
372
+ rows: ee,
373
+ refs: N,
368
374
  isLoading: O,
369
375
  isError: k,
370
376
  invalidateQuery: te,
371
- startDraftSignal: h
377
+ startDraftSignal: f
372
378
  }),
373
- A && /* @__PURE__ */ U("div", {
379
+ A && /* @__PURE__ */ W("div", {
374
380
  style: { marginTop: 4 },
375
- children: /* @__PURE__ */ U(l, {
381
+ children: /* @__PURE__ */ W(_, {
376
382
  kind: "ghost",
377
383
  size: "xs",
378
- icon: M ? /* @__PURE__ */ U(m, { size: 12 }) : void 0,
384
+ icon: M ? /* @__PURE__ */ W(S, { size: 12 }) : void 0,
379
385
  onClick: () => j(),
380
386
  disabled: M,
381
- children: g("record.associated.load_more", "Load more")
387
+ children: p("record.associated.load_more", "Load more")
382
388
  })
383
389
  })
384
390
  ] });
385
391
  }
386
- function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, editable: l, interaction: u, ctx: f, rows: m, refs: h, isLoading: g, isError: b, invalidateQuery: C, startDraftSignal: w }) {
387
- let T = d(), E = d("errors"), D = p(), k = M(t), A = D.isPhone && f.relatedRecordsPresentation === "table", j = c.find((e) => e !== a), N = z(() => u === "navigate" ? o(void 0, t, f.schema.screens) : null, [
388
- u,
392
+ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, editable: l, interaction: p, ctx: g, rows: _, refs: v, isLoading: b, isError: S, invalidateQuery: C, startDraftSignal: w }) {
393
+ let T = y(), E = y("errors"), D = x(), O = ee(t), A = D.isPhone && g.relatedRecordsPresentation === "table", j = o.find((e) => e !== a), M = B(() => p === "navigate" ? s(void 0, t, g.schema.screens) : null, [
394
+ p,
389
395
  t,
390
- f.schema.screens
391
- ]), P = z(() => l ? se(t, c, a) : /* @__PURE__ */ new Set(), [
392
- c,
396
+ g.schema.screens
397
+ ]), N = B(() => l ? se(t, o, a) : /* @__PURE__ */ new Set(), [
398
+ o,
393
399
  a,
394
400
  t,
395
401
  l
396
- ]), F = z(() => ce(t, c, a), [
397
- c,
402
+ ]), ne = B(() => ce(t, o, a), [
403
+ o,
398
404
  a,
399
405
  t
400
- ]), I = z(() => {
406
+ ]), F = B(() => {
401
407
  let e = /* @__PURE__ */ new Map();
402
- for (let n of m) {
408
+ for (let n of _) {
403
409
  let i = r(t, n);
404
- e.set(y(i), i);
410
+ e.set(f(i), i);
405
411
  }
406
412
  return e;
407
- }, [m, t]), ne = z(() => {
413
+ }, [_, t]), I = B(() => {
408
414
  let e = /* @__PURE__ */ new Map();
409
- for (let n of m) {
415
+ for (let n of _) {
410
416
  let i = n.$row_version;
411
- typeof i == "string" && i !== "" && e.set(y(r(t, n)), i);
417
+ typeof i == "string" && i !== "" && e.set(f(r(t, n)), i);
412
418
  }
413
419
  return e;
414
- }, [m, t]), R = z(() => ae(t.actions), [t.actions]), [H, ie] = V(null), [oe, G] = V(null), [ue, K] = V([]), [q, J] = V({}), Y = B(q);
415
- Y.current = q;
416
- let X = B({});
420
+ }, [_, t]), L = B(() => ae(t.actions), [t.actions]), [z, U] = H(null), [ie, K] = H(null), [oe, q] = H([]), [J, Y] = H({}), ue = V(J);
421
+ ue.current = J;
422
+ let X = V({});
417
423
  re(() => {
418
424
  let e = X.current;
419
425
  return () => {
420
426
  for (let t of Object.values(e)) clearTimeout(t);
421
427
  };
422
428
  }, []);
423
- let [Z, Q] = V(null), [he, $] = V([]), [ge, _e] = V(!1), { run: ve } = O(), [ye, be] = V(/* @__PURE__ */ new Set()), xe = L(async (t, n, r) => {
424
- J((e) => ({
429
+ let [Z, Q] = H(null), [pe, $] = H([]), [ge, _e] = H(!1), { run: ve } = k(), [ye, be] = H(/* @__PURE__ */ new Set()), xe = R(async (t, n, r) => {
430
+ Y((e) => ({
425
431
  ...e,
426
432
  [t]: {
427
433
  ...e[t],
@@ -430,11 +436,11 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
430
436
  }
431
437
  }));
432
438
  try {
433
- let i = ne.get(t), a = i ? {
439
+ let i = I.get(t), a = i ? {
434
440
  ...n,
435
441
  $row_version: i
436
442
  } : n;
437
- return await x(e, I.get(t) ?? t, a), J((e) => {
443
+ return await m(e, F.get(t) ?? t, a), Y((e) => {
438
444
  let n = e[t];
439
445
  if (!n) return e;
440
446
  if (n.ver > r) return {
@@ -448,8 +454,8 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
448
454
  return a;
449
455
  }), C(), !0;
450
456
  } catch (e) {
451
- let n = S(E, e);
452
- return J((e) => ({
457
+ let n = h(E, e);
458
+ return Y((e) => ({
453
459
  ...e,
454
460
  [t]: {
455
461
  ...e[t],
@@ -462,10 +468,10 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
462
468
  e,
463
469
  E,
464
470
  C,
465
- I,
466
- ne
467
- ]), Se = L((e, t, n) => {
468
- J((r) => {
471
+ F,
472
+ I
473
+ ]), Se = R((e, t, n) => {
474
+ Y((r) => {
469
475
  let i = r[e] ?? {
470
476
  buffer: {},
471
477
  ver: 0,
@@ -482,14 +488,14 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
482
488
  ver: a
483
489
  }
484
490
  };
485
- }), u === "inline_edit" && (X.current[e] && clearTimeout(X.current[e]), X.current[e] = setTimeout(() => {
486
- let t = Y.current[e];
491
+ }), p === "inline_edit" && (X.current[e] && clearTimeout(X.current[e]), X.current[e] = setTimeout(() => {
492
+ let t = ue.current[e];
487
493
  t && Object.keys(t.buffer).length > 0 && xe(e, { ...t.buffer }, t.ver);
488
494
  }, 500));
489
- }, [xe, u]), Ce = L(() => {
495
+ }, [xe, p]), Ce = R(() => {
490
496
  let e = {};
491
497
  e[a] = n;
492
- for (let n of c) {
498
+ for (let n of o) {
493
499
  let r = t.fields.get(n);
494
500
  r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
495
501
  }
@@ -497,9 +503,9 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
497
503
  }, [
498
504
  a,
499
505
  n,
500
- c,
506
+ o,
501
507
  t.fields
502
- ]), we = B(w);
508
+ ]), we = V(w);
503
509
  re(() => {
504
510
  w !== void 0 && w !== we.current && (we.current = w, !Z && Ce());
505
511
  }, [
@@ -507,16 +513,16 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
507
513
  Z,
508
514
  Ce
509
515
  ]);
510
- let Te = L(async () => {
516
+ let Te = R(async () => {
511
517
  if (!Z) return;
512
- let n = le(Z, c, t, a);
518
+ let n = le(Z, o, t, a);
513
519
  if (n.length > 0) $(n);
514
520
  else {
515
521
  _e(!0);
516
522
  try {
517
- await _(e, Z), Q(null), $([]), C();
523
+ await u(e, Z), Q(null), $([]), C();
518
524
  } catch (e) {
519
- let t = S(E, e);
525
+ let t = h(E, e);
520
526
  $([`_error:${t}`]);
521
527
  } finally {
522
528
  _e(!1);
@@ -524,39 +530,39 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
524
530
  }
525
531
  }, [
526
532
  Z,
527
- c,
533
+ o,
528
534
  t,
529
535
  a,
530
536
  e,
531
537
  E,
532
538
  C
533
- ]), Ee = L((e) => {
534
- J({}), K([]), G(e);
535
- }, []), De = L(async (e) => {
536
- let n = Y.current[e], i = n?.buffer ?? {};
539
+ ]), Ee = R((e) => {
540
+ Y({}), q([]), K(e);
541
+ }, []), De = R(async (e) => {
542
+ let n = ue.current[e], i = n?.buffer ?? {};
537
543
  if (Object.keys(i).length === 0) {
538
- G(null), K([]);
544
+ K(null), q([]);
539
545
  return;
540
546
  }
541
- let o = le({
542
- ...m.find((n) => y(r(t, n)) === e) ?? {},
547
+ let s = le({
548
+ ..._.find((n) => f(r(t, n)) === e) ?? {},
543
549
  ...i
544
- }, c, t, a);
545
- o.length > 0 ? K(o) : await xe(e, { ...i }, n?.ver ?? 0) && (G(null), K([]));
550
+ }, o, t, a);
551
+ s.length > 0 ? q(s) : await xe(e, { ...i }, n?.ver ?? 0) && (K(null), q([]));
546
552
  }, [
547
- m,
553
+ _,
548
554
  t,
549
- c,
555
+ o,
550
556
  a,
551
557
  xe
552
- ]), Oe = L((e) => {
553
- J((t) => {
558
+ ]), Oe = R((e) => {
559
+ Y((t) => {
554
560
  if (!t[e]) return t;
555
561
  let { [e]: n, ...r } = t;
556
562
  return r;
557
- }), K([]), G(null);
558
- }, []), ke = L((n, r) => {
559
- let i = I.get(n) ?? n;
563
+ }), q([]), K(null);
564
+ }, []), ke = R((n, r) => {
565
+ let i = F.get(n) ?? n;
560
566
  return ve({
561
567
  action: t.actions?.__delete,
562
568
  destructive: !0,
@@ -566,7 +572,7 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
566
572
  execute: async () => {
567
573
  be((e) => new Set(e).add(n));
568
574
  try {
569
- return await v(e, i);
575
+ return await d(e, i);
570
576
  } finally {
571
577
  be((e) => {
572
578
  let t = new Set(e);
@@ -582,9 +588,9 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
582
588
  t,
583
589
  e,
584
590
  C,
585
- I
591
+ F
586
592
  ]);
587
- if (b) return /* @__PURE__ */ U("div", {
593
+ if (S) return /* @__PURE__ */ W("div", {
588
594
  style: {
589
595
  fontSize: 12.5,
590
596
  color: "var(--danger)",
@@ -592,74 +598,74 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
592
598
  },
593
599
  children: E("record.related_rows_unreadable", "The related records could not be loaded.")
594
600
  });
595
- if (g) return /* @__PURE__ */ W("div", {
601
+ if (b) return /* @__PURE__ */ G("div", {
596
602
  style: {
597
603
  display: "flex",
598
604
  flexDirection: "column",
599
605
  gap: 8,
600
606
  padding: "8px 0"
601
607
  },
602
- children: [/* @__PURE__ */ U("div", { style: {
608
+ children: [/* @__PURE__ */ W("div", { style: {
603
609
  height: 32,
604
610
  background: "var(--surface-3)",
605
611
  borderRadius: "var(--radius-md)"
606
- } }), /* @__PURE__ */ U("div", { style: {
612
+ } }), /* @__PURE__ */ W("div", { style: {
607
613
  height: 32,
608
614
  background: "var(--surface-3)",
609
615
  borderRadius: "var(--radius-md)"
610
616
  } })]
611
617
  });
612
- let Ae = m.length === 0 && !Z;
613
- return D.isPhone && !A ? /* @__PURE__ */ W("div", { children: [Ae && /* @__PURE__ */ U("div", {
618
+ let Ae = _.length === 0 && !Z;
619
+ return D.isPhone && !A ? /* @__PURE__ */ G("div", { children: [Ae && /* @__PURE__ */ W("div", {
614
620
  style: {
615
621
  fontSize: 12.5,
616
622
  color: "var(--text-3)",
617
623
  padding: "12px 0"
618
624
  },
619
625
  children: T("record.related.empty", "No records yet.")
620
- }), !Ae && /* @__PURE__ */ W("div", {
626
+ }), !Ae && /* @__PURE__ */ G("div", {
621
627
  style: {
622
628
  display: "flex",
623
629
  flexDirection: "column",
624
630
  gap: 10
625
631
  },
626
- children: [m.map((n) => {
627
- let i = y(r(t, n)), a = ye.has(i), o = q[i], d = N && i ? N.replace(/:\w+/, i) : void 0;
628
- return /* @__PURE__ */ U(de, {
632
+ children: [_.map((n) => {
633
+ let i = f(r(t, n)), a = ye.has(i), s = J[i], u = M && i ? M.replace(/:\w+/, i) : void 0;
634
+ return /* @__PURE__ */ W(de, {
629
635
  rowId: i,
630
636
  row: n,
631
637
  entity: t,
632
- entities: f.schema.entities,
633
- screens: f.schema.screens,
634
- columns: c,
635
- editableColumns: P,
636
- editable: l && s(t, n, k.tenantId),
637
- interaction: u,
638
- isEditing: oe === i,
639
- editErrors: ue,
638
+ entities: g.schema.entities,
639
+ screens: g.schema.screens,
640
+ columns: o,
641
+ editableColumns: N,
642
+ editable: l && c(t, n, O.tenantId),
643
+ interaction: p,
644
+ isEditing: ie === i,
645
+ editErrors: oe,
640
646
  isDeleting: a,
641
- activeCell: H,
642
- setActiveCell: ie,
643
- rowState: o,
647
+ activeCell: z,
648
+ setActiveCell: U,
649
+ rowState: s,
644
650
  onCellChange: Se,
645
651
  onDeleteClick: (e) => void ke(e, n),
646
652
  onStartEdit: Ee,
647
653
  onConfirmEdit: De,
648
654
  onCancelEdit: Oe,
649
- refs: h,
655
+ refs: v,
650
656
  identityCol: j,
651
- href: d,
652
- rowActions: R,
657
+ href: u,
658
+ rowActions: L,
653
659
  entityCode: e,
654
660
  onRowActionSuccess: C
655
661
  }, i);
656
- }), Z && /* @__PURE__ */ U(me, {
662
+ }), Z && /* @__PURE__ */ W(he, {
657
663
  draftRow: Z,
658
664
  entity: t,
659
- columns: c,
660
- editableColumns: F,
665
+ columns: o,
666
+ editableColumns: ne,
661
667
  foreignKey: a,
662
- draftErrors: he,
668
+ draftErrors: pe,
663
669
  draftSaving: ge,
664
670
  onChange: (e, t) => Q((n) => n && {
665
671
  ...n,
@@ -669,72 +675,72 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
669
675
  onCancel: () => {
670
676
  Q(null), $([]);
671
677
  },
672
- refs: h
678
+ refs: v
673
679
  })]
674
- })] }) : /* @__PURE__ */ W("div", { children: [Ae && /* @__PURE__ */ U("div", {
680
+ })] }) : /* @__PURE__ */ G("div", { children: [Ae && /* @__PURE__ */ W("div", {
675
681
  style: {
676
682
  fontSize: 12.5,
677
683
  color: "var(--text-3)",
678
684
  padding: "12px 0"
679
685
  },
680
686
  children: T("record.related.empty", "No records yet.")
681
- }), !Ae && /* @__PURE__ */ U("div", {
687
+ }), !Ae && /* @__PURE__ */ W("div", {
682
688
  style: { overflowX: "auto" },
683
- children: /* @__PURE__ */ W("table", {
684
- style: te,
685
- children: [/* @__PURE__ */ U("thead", { children: /* @__PURE__ */ W("tr", { children: [
686
- c.map((e) => {
689
+ children: /* @__PURE__ */ G("table", {
690
+ style: P,
691
+ children: [/* @__PURE__ */ W("thead", { children: /* @__PURE__ */ G("tr", { children: [
692
+ o.map((e) => {
687
693
  let n = t.fields.get(e);
688
- return /* @__PURE__ */ U("th", {
689
- style: ee,
690
- children: n ? i(T, n, e, f.schema.entities) : e
694
+ return /* @__PURE__ */ W("th", {
695
+ style: te,
696
+ children: n ? i(T, n, e, g.schema.entities) : e
691
697
  }, e);
692
698
  }),
693
- l && /* @__PURE__ */ U("th", { style: {
699
+ l && /* @__PURE__ */ W("th", { style: {
694
700
  height: 30,
695
701
  width: 72
696
702
  } }),
697
- !l && R.length > 0 && /* @__PURE__ */ U("th", { style: {
703
+ !l && L.length > 0 && /* @__PURE__ */ W("th", { style: {
698
704
  height: 30,
699
705
  width: 40
700
706
  } })
701
- ] }) }), /* @__PURE__ */ W("tbody", { children: [m.map((n) => {
702
- let i = y(r(t, n)), a = ye.has(i), o = q[i], d = N && i ? N.replace(/:\w+/, i) : void 0;
703
- return /* @__PURE__ */ U(fe, {
707
+ ] }) }), /* @__PURE__ */ G("tbody", { children: [_.map((n) => {
708
+ let i = f(r(t, n)), a = ye.has(i), s = J[i], u = M && i ? M.replace(/:\w+/, i) : void 0;
709
+ return /* @__PURE__ */ W(fe, {
704
710
  rowId: i,
705
711
  row: n,
706
712
  entity: t,
707
- entities: f.schema.entities,
708
- screens: f.schema.screens,
709
- columns: c,
710
- editableColumns: P,
711
- editable: l && s(t, n, k.tenantId),
712
- interaction: u,
713
- isEditing: oe === i,
714
- editErrors: ue,
713
+ entities: g.schema.entities,
714
+ screens: g.schema.screens,
715
+ columns: o,
716
+ editableColumns: N,
717
+ editable: l && c(t, n, O.tenantId),
718
+ interaction: p,
719
+ isEditing: ie === i,
720
+ editErrors: oe,
715
721
  isDeleting: a,
716
- activeCell: H,
717
- setActiveCell: ie,
718
- rowState: o,
722
+ activeCell: z,
723
+ setActiveCell: U,
724
+ rowState: s,
719
725
  onCellChange: Se,
720
726
  onDeleteClick: (e) => void ke(e, n),
721
727
  onStartEdit: Ee,
722
728
  onConfirmEdit: De,
723
729
  onCancelEdit: Oe,
724
- refs: h,
730
+ refs: v,
725
731
  identityCol: j,
726
- href: d,
727
- rowActions: R,
732
+ href: u,
733
+ rowActions: L,
728
734
  entityCode: e,
729
735
  onRowActionSuccess: C
730
736
  }, i);
731
- }), Z && /* @__PURE__ */ U(pe, {
737
+ }), Z && /* @__PURE__ */ W(me, {
732
738
  draftRow: Z,
733
739
  entity: t,
734
- columns: c,
735
- editableColumns: F,
740
+ columns: o,
741
+ editableColumns: ne,
736
742
  foreignKey: a,
737
- draftErrors: he,
743
+ draftErrors: pe,
738
744
  draftSaving: ge,
739
745
  onChange: (e, t) => Q((n) => n && {
740
746
  ...n,
@@ -744,40 +750,40 @@ function Y({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: c, e
744
750
  onCancel: () => {
745
751
  Q(null), $([]);
746
752
  },
747
- refs: h
753
+ refs: v
748
754
  })] })]
749
755
  })
750
756
  })] });
751
757
  }
752
- function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s, editableColumns: l, editable: f, interaction: p, isEditing: h, editErrors: g, isDeleting: _, rowState: v, onCellChange: y, onDeleteClick: b, onStartEdit: x, onConfirmEdit: S, onCancelEdit: C, refs: w, identityCol: T, href: E, rowActions: D, onRowActionSuccess: O }) {
753
- let A = d(), j = R(), M = z(() => !v || Object.keys(v.buffer).length === 0 ? n : {
758
+ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: p, rowState: m, onCellChange: h, onDeleteClick: _, onStartEdit: b, onConfirmEdit: x, onCancelEdit: C, refs: w, identityCol: T, href: E, rowActions: D, onRowActionSuccess: O }) {
759
+ let k = y(), j = z(), M = B(() => !m || Object.keys(m.buffer).length === 0 ? n : {
754
760
  ...n,
755
- ...v.buffer
756
- }, [n, v]);
757
- if (p === "row_edit" && h) {
758
- let t = v?.error ? [...g, `_error:${v.error}`] : g;
759
- return /* @__PURE__ */ U(Z, {
761
+ ...m.buffer
762
+ }, [n, m]);
763
+ if (u === "row_edit" && d) {
764
+ let t = m?.error ? [...f, `_error:${m.error}`] : f;
765
+ return /* @__PURE__ */ W(pe, {
760
766
  values: M,
761
767
  entity: r,
762
768
  columns: s,
763
- editableColumns: l,
769
+ editableColumns: c,
764
770
  errors: t,
765
- saving: v?.saving ?? !1,
766
- onChange: (t, n) => y(e, t, n),
767
- onConfirm: () => S(e),
771
+ saving: m?.saving ?? !1,
772
+ onChange: (t, n) => h(e, t, n),
773
+ onConfirm: () => x(e),
768
774
  onCancel: () => C(e),
769
775
  refs: w
770
776
  });
771
777
  }
772
- return /* @__PURE__ */ W("div", {
778
+ return /* @__PURE__ */ G("div", {
773
779
  style: {
774
780
  border: "1px solid var(--border)",
775
781
  borderRadius: "var(--radius-md)",
776
782
  background: "var(--surface)",
777
- opacity: _ ? .58 : 1,
783
+ opacity: p ? .58 : 1,
778
784
  overflow: "hidden"
779
785
  },
780
- children: [/* @__PURE__ */ U("div", {
786
+ children: [/* @__PURE__ */ W("div", {
781
787
  style: {
782
788
  padding: 10,
783
789
  display: "flex",
@@ -785,57 +791,57 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
785
791
  gap: 12
786
792
  },
787
793
  children: s.map((n) => {
788
- let s = r.fields.get(n), c = f && p === "inline_edit" && l.has(n), u = E && n === T, d = s ? i(A, s, n, a) : n, m = `${j}-${e}-${n}`, h = `${m}-label`, g = {
794
+ let s = r.fields.get(n), d = l && u === "inline_edit" && c.has(n), f = E && n === T, p = s ? i(k, s, n, a) : n, m = `${j}-${e}-${n}`, g = `${m}-label`, _ = {
789
795
  fontSize: 11.5,
790
796
  fontWeight: 600,
791
797
  color: "var(--text-3)"
792
- }, _ = s ? k({
798
+ }, v = s ? A({
793
799
  field: s,
794
800
  fieldName: n,
795
801
  value: M[n],
796
- mode: c ? "edit" : "display",
797
- onChange: c ? (t) => y(e, n, t) : void 0,
802
+ mode: d ? "edit" : "display",
803
+ onChange: d ? (t) => h(e, n, t) : void 0,
798
804
  record: M,
799
805
  refs: w,
800
- compact: c,
806
+ compact: d,
801
807
  entity: r,
802
808
  entities: a,
803
- screens: u ? void 0 : o,
809
+ screens: f ? void 0 : o,
804
810
  fieldId: m,
805
- labelId: h,
806
- t: A
811
+ labelId: g,
812
+ t: k
807
813
  }) : t(M[n]);
808
- return /* @__PURE__ */ W("div", {
814
+ return /* @__PURE__ */ G("div", {
809
815
  style: {
810
816
  display: "flex",
811
817
  flexDirection: "column",
812
818
  gap: 5,
813
819
  minWidth: 0
814
820
  },
815
- children: [c && s ? /* @__PURE__ */ U("label", {
816
- id: h,
821
+ children: [d && s ? /* @__PURE__ */ W("label", {
822
+ id: g,
817
823
  htmlFor: m,
818
- style: g,
819
- children: d
820
- }) : /* @__PURE__ */ U("div", {
821
- id: h,
822
- style: g,
823
- children: d
824
- }), /* @__PURE__ */ U("div", {
824
+ style: _,
825
+ children: p
826
+ }) : /* @__PURE__ */ W("div", {
827
+ id: g,
828
+ style: _,
829
+ children: p
830
+ }), /* @__PURE__ */ W("div", {
825
831
  style: { minWidth: 0 },
826
- children: u && !c ? /* @__PURE__ */ U("a", {
832
+ children: f && !d ? /* @__PURE__ */ W("a", {
827
833
  href: E,
828
834
  style: {
829
835
  color: "var(--accent-text)",
830
836
  textDecoration: "none",
831
837
  fontWeight: 500
832
838
  },
833
- children: _
834
- }) : _
839
+ children: v
840
+ }) : v
835
841
  })]
836
842
  }, n);
837
843
  })
838
- }), (f || D && D.length > 0) && /* @__PURE__ */ W("div", {
844
+ }), (l || D && D.length > 0) && /* @__PURE__ */ G("div", {
839
845
  style: {
840
846
  minHeight: 42,
841
847
  padding: "6px 8px",
@@ -845,29 +851,29 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
845
851
  justifyContent: "flex-end",
846
852
  gap: 6
847
853
  },
848
- children: [f && /* @__PURE__ */ W(ie, { children: [
849
- v?.saving && /* @__PURE__ */ U(m, { size: 12 }),
850
- v?.error && /* @__PURE__ */ U("span", {
854
+ children: [l && /* @__PURE__ */ G(ie, { children: [
855
+ m?.saving && /* @__PURE__ */ W(S, { size: 12 }),
856
+ m?.error && /* @__PURE__ */ W("span", {
851
857
  style: {
852
858
  fontSize: 11,
853
859
  color: "var(--danger)"
854
860
  },
855
- title: v.error,
861
+ title: m.error,
856
862
  children: "!"
857
863
  }),
858
- p === "row_edit" && /* @__PURE__ */ U(u, {
864
+ u === "row_edit" && /* @__PURE__ */ W(v, {
859
865
  size: 32,
860
- icon: /* @__PURE__ */ U(c.edit, { size: 14 }),
861
- onClick: () => x(e),
862
- title: A("record.row.edit", "Edit row")
866
+ icon: /* @__PURE__ */ W(g.edit, { size: 14 }),
867
+ onClick: () => b(e),
868
+ title: k("record.row.edit", "Edit row")
863
869
  }),
864
- /* @__PURE__ */ U(u, {
870
+ /* @__PURE__ */ W(v, {
865
871
  size: 32,
866
- icon: /* @__PURE__ */ U(c.trash, { size: 14 }),
867
- onClick: () => b(e),
868
- title: A("record.row.delete", "Delete row")
872
+ icon: /* @__PURE__ */ W(g.trash, { size: 14 }),
873
+ onClick: () => _(e),
874
+ title: k("record.row.delete", "Delete row")
869
875
  })
870
- ] }), !f && D && D.length > 0 && /* @__PURE__ */ U(I, {
876
+ ] }), !l && D && D.length > 0 && /* @__PURE__ */ W(I, {
871
877
  entity: r,
872
878
  actions: D,
873
879
  objectIds: [e],
@@ -877,21 +883,21 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
877
883
  })]
878
884
  });
879
885
  }
880
- function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o, editableColumns: s, editable: l, interaction: f, isEditing: p, editErrors: h, isDeleting: g, activeCell: _, setActiveCell: v, rowState: y, onCellChange: b, onDeleteClick: x, onStartEdit: S, onConfirmEdit: C, onCancelEdit: w, refs: T, identityCol: E, href: D, rowActions: O, onRowActionSuccess: A }) {
881
- let j = d(), M = z(() => !y || Object.keys(y.buffer).length === 0 ? n : {
886
+ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o, editableColumns: s, editable: c, interaction: l, isEditing: u, editErrors: d, isDeleting: f, activeCell: p, setActiveCell: m, rowState: h, onCellChange: _, onDeleteClick: b, onStartEdit: x, onConfirmEdit: C, onCancelEdit: w, refs: T, identityCol: E, href: D, rowActions: O, onRowActionSuccess: k }) {
887
+ let j = y(), M = B(() => !h || Object.keys(h.buffer).length === 0 ? n : {
882
888
  ...n,
883
- ...y.buffer
884
- }, [n, y]);
885
- if (f === "row_edit" && p) {
886
- let t = y?.error ? [...h, `_error:${y.error}`] : h;
887
- return /* @__PURE__ */ U(X, {
889
+ ...h.buffer
890
+ }, [n, h]);
891
+ if (l === "row_edit" && u) {
892
+ let t = h?.error ? [...d, `_error:${h.error}`] : d;
893
+ return /* @__PURE__ */ W(Q, {
888
894
  values: M,
889
895
  entity: r,
890
896
  columns: o,
891
897
  editableColumns: s,
892
898
  errors: t,
893
- saving: y?.saving ?? !1,
894
- onChange: (t, n) => b(e, t, n),
899
+ saving: h?.saving ?? !1,
900
+ onChange: (t, n) => _(e, t, n),
895
901
  onConfirm: () => C(e),
896
902
  onCancel: () => w(e),
897
903
  refs: T
@@ -901,27 +907,27 @@ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
901
907
  padding: "4px 4px",
902
908
  borderBottom: "1px solid var(--divider)",
903
909
  verticalAlign: "middle"
904
- }, P = f === "inline_edit";
905
- return /* @__PURE__ */ W("tr", {
906
- style: { opacity: g ? .5 : 1 },
910
+ }, P = l === "inline_edit";
911
+ return /* @__PURE__ */ G("tr", {
912
+ style: { opacity: f ? .5 : 1 },
907
913
  children: [
908
914
  o.map((n) => {
909
915
  let o = r.fields.get(n), c = s.has(n);
910
- if (P && _?.rowId === e && _?.col === n && c) return /* @__PURE__ */ U("td", {
916
+ if (P && p?.rowId === e && p?.col === n && c) return /* @__PURE__ */ W("td", {
911
917
  style: te,
912
- children: o ? k({
918
+ children: o ? A({
913
919
  field: o,
914
920
  fieldName: n,
915
921
  value: M[n],
916
922
  mode: "edit",
917
- onChange: (t) => b(e, n, t),
923
+ onChange: (t) => _(e, n, t),
918
924
  record: M,
919
925
  refs: T,
920
926
  compact: !0,
921
927
  t: j
922
928
  }) : t(M[n])
923
929
  }, n);
924
- let l = D && n === E, u = o ? k({
930
+ let l = D && n === E, u = o ? A({
925
931
  field: o,
926
932
  fieldName: n,
927
933
  value: M[n],
@@ -932,17 +938,17 @@ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
932
938
  entities: i,
933
939
  screens: l ? void 0 : a,
934
940
  t: j
935
- }) : t(M[n]), d = P && c && !g;
936
- return /* @__PURE__ */ U("td", {
941
+ }) : t(M[n]), d = P && c && !f;
942
+ return /* @__PURE__ */ W("td", {
937
943
  style: {
938
944
  ...ee,
939
945
  cursor: d ? "pointer" : "default"
940
946
  },
941
- onClick: d ? () => v({
947
+ onClick: d ? () => m({
942
948
  rowId: e,
943
949
  col: n
944
950
  }) : void 0,
945
- children: l ? /* @__PURE__ */ U("a", {
951
+ children: l ? /* @__PURE__ */ W("a", {
946
952
  href: D,
947
953
  style: {
948
954
  color: "var(--accent-text)",
@@ -955,111 +961,111 @@ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
955
961
  }) : u
956
962
  }, n);
957
963
  }),
958
- l && /* @__PURE__ */ U("td", {
964
+ c && /* @__PURE__ */ W("td", {
959
965
  style: {
960
966
  padding: "4px 8px",
961
967
  borderBottom: "1px solid var(--divider)",
962
968
  verticalAlign: "middle"
963
969
  },
964
- children: /* @__PURE__ */ W("div", {
970
+ children: /* @__PURE__ */ G("div", {
965
971
  style: {
966
972
  display: "flex",
967
973
  alignItems: "center",
968
974
  gap: 4
969
975
  },
970
976
  children: [
971
- y?.saving && /* @__PURE__ */ U(m, { size: 12 }),
972
- y?.error && /* @__PURE__ */ U("span", {
977
+ h?.saving && /* @__PURE__ */ W(S, { size: 12 }),
978
+ h?.error && /* @__PURE__ */ W("span", {
973
979
  style: {
974
980
  fontSize: 11,
975
981
  color: "var(--danger)"
976
982
  },
977
- title: y.error,
983
+ title: h.error,
978
984
  children: "!"
979
985
  }),
980
- f === "row_edit" && /* @__PURE__ */ U(u, {
986
+ l === "row_edit" && /* @__PURE__ */ W(v, {
981
987
  size: 24,
982
- icon: /* @__PURE__ */ U(c.edit, { size: 12 }),
983
- onClick: () => S(e),
988
+ icon: /* @__PURE__ */ W(g.edit, { size: 12 }),
989
+ onClick: () => x(e),
984
990
  title: j("record.row.edit", "Edit row")
985
991
  }),
986
- /* @__PURE__ */ U(u, {
992
+ /* @__PURE__ */ W(v, {
987
993
  size: 24,
988
- icon: /* @__PURE__ */ U(c.trash, { size: 12 }),
989
- onClick: () => x(e),
994
+ icon: /* @__PURE__ */ W(g.trash, { size: 12 }),
995
+ onClick: () => b(e),
990
996
  title: j("record.row.delete", "Delete row")
991
997
  })
992
998
  ]
993
999
  })
994
1000
  }),
995
- !l && O && O.length > 0 && /* @__PURE__ */ U("td", {
1001
+ !c && O && O.length > 0 && /* @__PURE__ */ W("td", {
996
1002
  style: {
997
1003
  padding: "4px 8px",
998
1004
  borderBottom: "1px solid var(--divider)",
999
1005
  verticalAlign: "middle"
1000
1006
  },
1001
- children: /* @__PURE__ */ U(I, {
1007
+ children: /* @__PURE__ */ W(I, {
1002
1008
  entity: r,
1003
1009
  actions: O,
1004
1010
  objectIds: [e],
1005
1011
  row: M,
1006
- onSuccess: A
1012
+ onSuccess: k
1007
1013
  })
1008
1014
  })
1009
1015
  ]
1010
1016
  });
1011
1017
  }
1012
- function X({ values: e, entity: n, columns: r, editableColumns: i, errors: a, saving: o, onChange: s, onConfirm: l, onCancel: f, refs: p, accent: h }) {
1013
- let g = d(), _ = a.find((e) => e.startsWith("_error:")), v = new Set(a.filter((e) => !e.startsWith("_error:"))), y = {
1018
+ function Q({ values: e, entity: n, columns: r, editableColumns: i, errors: a, saving: o, onChange: s, onConfirm: c, onCancel: l, refs: u, accent: d }) {
1019
+ let f = y(), p = a.find((e) => e.startsWith("_error:")), m = new Set(a.filter((e) => !e.startsWith("_error:"))), h = {
1014
1020
  padding: "6px 12px",
1015
1021
  borderBottom: "1px solid var(--divider)",
1016
1022
  verticalAlign: "middle",
1017
1023
  height: 40,
1018
1024
  minWidth: 0
1019
- }, b = {
1025
+ }, _ = {
1020
1026
  display: "block",
1021
1027
  width: "100%",
1022
1028
  maxWidth: "100%",
1023
1029
  minWidth: 0
1024
1030
  };
1025
- return /* @__PURE__ */ W("tr", {
1026
- style: h ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
1031
+ return /* @__PURE__ */ G("tr", {
1032
+ style: d ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
1027
1033
  onKeyDown: (e) => {
1028
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), f());
1034
+ e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), c()) : e.key === "Escape" && (e.preventDefault(), l());
1029
1035
  },
1030
1036
  children: [r.map((r) => {
1031
- let a = n.fields.get(r), o = i.has(r), c = v.has(r);
1032
- return o ? /* @__PURE__ */ U("td", {
1037
+ let a = n.fields.get(r), o = i.has(r), c = m.has(r);
1038
+ return o ? /* @__PURE__ */ W("td", {
1033
1039
  style: {
1034
- ...y,
1040
+ ...h,
1035
1041
  outline: c ? "1px solid var(--danger)" : "none",
1036
1042
  outlineOffset: -1
1037
1043
  },
1038
- title: c ? g("record.row.field_required", "{field} is required", { field: r }) : void 0,
1039
- children: /* @__PURE__ */ U("div", {
1040
- style: b,
1041
- children: a ? k({
1044
+ title: c ? f("record.row.field_required", "{field} is required", { field: r }) : void 0,
1045
+ children: /* @__PURE__ */ W("div", {
1046
+ style: _,
1047
+ children: a ? A({
1042
1048
  field: a,
1043
1049
  fieldName: r,
1044
1050
  value: e[r],
1045
1051
  mode: "edit",
1046
1052
  onChange: (e) => s(r, e),
1047
1053
  record: e,
1048
- refs: p,
1054
+ refs: u,
1049
1055
  compact: !0,
1050
- t: g
1056
+ t: f
1051
1057
  }) : t(e[r])
1052
1058
  })
1053
- }, r) : /* @__PURE__ */ U("td", {
1059
+ }, r) : /* @__PURE__ */ W("td", {
1054
1060
  style: {
1055
- ...y,
1061
+ ...h,
1056
1062
  color: "var(--text-3)"
1057
1063
  },
1058
1064
  children: a?.auto ? "—" : t(e[r])
1059
1065
  }, r);
1060
- }), /* @__PURE__ */ U("td", {
1061
- style: y,
1062
- children: /* @__PURE__ */ W("div", {
1066
+ }), /* @__PURE__ */ W("td", {
1067
+ style: h,
1068
+ children: /* @__PURE__ */ G("div", {
1063
1069
  style: {
1064
1070
  display: "flex",
1065
1071
  alignItems: "center",
@@ -1067,45 +1073,45 @@ function X({ values: e, entity: n, columns: r, editableColumns: i, errors: a, sa
1067
1073
  justifyContent: "flex-end"
1068
1074
  },
1069
1075
  children: [
1070
- _ && /* @__PURE__ */ U("span", {
1076
+ p && /* @__PURE__ */ W("span", {
1071
1077
  style: {
1072
1078
  fontSize: 11,
1073
1079
  color: "var(--danger)"
1074
1080
  },
1075
- title: _.slice(7),
1081
+ title: p.slice(7),
1076
1082
  children: "!"
1077
1083
  }),
1078
- /* @__PURE__ */ U(u, {
1084
+ /* @__PURE__ */ W(v, {
1079
1085
  size: 24,
1080
- icon: U(o ? m : c.check, { size: 12 }),
1081
- onClick: l,
1082
- title: g("record.row.confirm", "Confirm (Enter)")
1086
+ icon: W(o ? S : g.check, { size: 12 }),
1087
+ onClick: c,
1088
+ title: f("record.row.confirm", "Confirm (Enter)")
1083
1089
  }),
1084
- /* @__PURE__ */ U(u, {
1090
+ /* @__PURE__ */ W(v, {
1085
1091
  size: 24,
1086
- icon: /* @__PURE__ */ U(c.x, { size: 12 }),
1087
- onClick: f,
1088
- title: g("record.row.cancel", "Cancel (Esc)")
1092
+ icon: /* @__PURE__ */ W(g.x, { size: 12 }),
1093
+ onClick: l,
1094
+ title: f("record.row.cancel", "Cancel (Esc)")
1089
1095
  })
1090
1096
  ]
1091
1097
  })
1092
1098
  })]
1093
1099
  });
1094
1100
  }
1095
- function Z({ values: e, entity: n, columns: r, editableColumns: a, errors: o, saving: s, onChange: l, onConfirm: f, onCancel: p, refs: h, accent: g }) {
1096
- let _ = d(), v = R(), y = o.find((e) => e.startsWith("_error:")), b = new Set(o.filter((e) => !e.startsWith("_error:")));
1097
- return /* @__PURE__ */ W("div", {
1101
+ function pe({ values: e, entity: n, columns: r, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
1102
+ let p = y(), m = z(), h = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:")));
1103
+ return /* @__PURE__ */ G("div", {
1098
1104
  style: {
1099
1105
  border: "1px solid var(--border)",
1100
1106
  borderRadius: "var(--radius-md)",
1101
1107
  background: "var(--surface)",
1102
1108
  overflow: "hidden",
1103
- boxShadow: g ? "inset 3px 0 0 var(--accent)" : void 0
1109
+ boxShadow: f ? "inset 3px 0 0 var(--accent)" : void 0
1104
1110
  },
1105
1111
  onKeyDown: (e) => {
1106
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), f()) : e.key === "Escape" && (e.preventDefault(), p());
1112
+ e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), u());
1107
1113
  },
1108
- children: [/* @__PURE__ */ U("div", {
1114
+ children: [/* @__PURE__ */ W("div", {
1109
1115
  style: {
1110
1116
  padding: 10,
1111
1117
  display: "flex",
@@ -1113,52 +1119,52 @@ function Z({ values: e, entity: n, columns: r, editableColumns: a, errors: o, sa
1113
1119
  gap: 12
1114
1120
  },
1115
1121
  children: r.map((r) => {
1116
- let o = n.fields.get(r), s = a.has(r), c = b.has(r), u = o ? i(_, o, r) : r, d = `${v}-${r}`, f = `${d}-label`, p = {
1122
+ let o = n.fields.get(r), s = a.has(r), l = _.has(r), u = o ? i(p, o, r) : r, f = `${m}-${r}`, h = `${f}-label`, g = {
1117
1123
  fontSize: 11.5,
1118
1124
  fontWeight: 600,
1119
1125
  color: "var(--text-3)"
1120
1126
  };
1121
- return /* @__PURE__ */ W("div", {
1127
+ return /* @__PURE__ */ G("div", {
1122
1128
  style: {
1123
1129
  display: "flex",
1124
1130
  flexDirection: "column",
1125
1131
  gap: 5,
1126
1132
  minWidth: 0
1127
1133
  },
1128
- children: [s && o ? /* @__PURE__ */ U("label", {
1129
- id: f,
1130
- htmlFor: d,
1131
- style: p,
1134
+ children: [s && o ? /* @__PURE__ */ W("label", {
1135
+ id: h,
1136
+ htmlFor: f,
1137
+ style: g,
1132
1138
  children: u
1133
- }) : /* @__PURE__ */ U("div", {
1134
- id: f,
1135
- style: p,
1139
+ }) : /* @__PURE__ */ W("div", {
1140
+ id: h,
1141
+ style: g,
1136
1142
  children: u
1137
- }), /* @__PURE__ */ U("div", {
1143
+ }), /* @__PURE__ */ W("div", {
1138
1144
  style: {
1139
1145
  minWidth: 0,
1140
- outline: c ? "1px solid var(--danger)" : "none",
1146
+ outline: l ? "1px solid var(--danger)" : "none",
1141
1147
  outlineOffset: 3,
1142
- borderRadius: c ? "var(--radius-sm)" : 0
1148
+ borderRadius: l ? "var(--radius-sm)" : 0
1143
1149
  },
1144
- title: c ? _("record.row.field_required", "{field} is required", { field: r }) : void 0,
1145
- children: s ? o ? k({
1150
+ title: l ? p("record.row.field_required", "{field} is required", { field: r }) : void 0,
1151
+ children: s ? o ? A({
1146
1152
  field: o,
1147
1153
  fieldName: r,
1148
1154
  value: e[r],
1149
1155
  mode: "edit",
1150
- onChange: (e) => l(r, e),
1156
+ onChange: (e) => c(r, e),
1151
1157
  record: e,
1152
- refs: h,
1158
+ refs: d,
1153
1159
  compact: !0,
1154
- fieldId: d,
1155
- labelId: f,
1156
- t: _
1160
+ fieldId: f,
1161
+ labelId: h,
1162
+ t: p
1157
1163
  }) : t(e[r]) : o?.auto ? "—" : t(e[r])
1158
1164
  })]
1159
1165
  }, r);
1160
1166
  })
1161
- }), /* @__PURE__ */ W("div", {
1167
+ }), /* @__PURE__ */ G("div", {
1162
1168
  style: {
1163
1169
  minHeight: 42,
1164
1170
  padding: "6px 8px",
@@ -1169,36 +1175,36 @@ function Z({ values: e, entity: n, columns: r, editableColumns: a, errors: o, sa
1169
1175
  gap: 6
1170
1176
  },
1171
1177
  children: [
1172
- y && /* @__PURE__ */ U("span", {
1178
+ h && /* @__PURE__ */ W("span", {
1173
1179
  style: {
1174
1180
  fontSize: 11,
1175
1181
  color: "var(--danger)"
1176
1182
  },
1177
- title: y.slice(7),
1183
+ title: h.slice(7),
1178
1184
  children: "!"
1179
1185
  }),
1180
- /* @__PURE__ */ U(u, {
1186
+ /* @__PURE__ */ W(v, {
1181
1187
  size: 32,
1182
- icon: U(s ? m : c.check, { size: 14 }),
1183
- onClick: f,
1184
- title: _("record.row.confirm", "Confirm (Enter)")
1188
+ icon: W(s ? S : g.check, { size: 14 }),
1189
+ onClick: l,
1190
+ title: p("record.row.confirm", "Confirm (Enter)")
1185
1191
  }),
1186
- /* @__PURE__ */ U(u, {
1192
+ /* @__PURE__ */ W(v, {
1187
1193
  size: 32,
1188
- icon: /* @__PURE__ */ U(c.x, { size: 14 }),
1189
- onClick: p,
1190
- title: _("record.row.cancel", "Cancel (Esc)")
1194
+ icon: /* @__PURE__ */ W(g.x, { size: 14 }),
1195
+ onClick: u,
1196
+ title: p("record.row.cancel", "Cancel (Esc)")
1191
1197
  })
1192
1198
  ]
1193
1199
  })]
1194
1200
  });
1195
1201
  }
1196
- function pe({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1197
- let d = z(() => {
1202
+ function me({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1203
+ let d = B(() => {
1198
1204
  let e = new Set(r);
1199
1205
  return e.delete(i), e;
1200
1206
  }, [r, i]);
1201
- return /* @__PURE__ */ U(X, {
1207
+ return /* @__PURE__ */ W(Q, {
1202
1208
  values: e,
1203
1209
  entity: t,
1204
1210
  columns: n,
@@ -1212,12 +1218,12 @@ function pe({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
1212
1218
  accent: !0
1213
1219
  });
1214
1220
  }
1215
- function me({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1216
- let d = z(() => {
1221
+ function he({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1222
+ let d = B(() => {
1217
1223
  let e = new Set(r);
1218
1224
  return e.delete(i), e;
1219
1225
  }, [r, i]);
1220
- return /* @__PURE__ */ U(Z, {
1226
+ return /* @__PURE__ */ W(pe, {
1221
1227
  values: e,
1222
1228
  entity: t,
1223
1229
  columns: n,
@@ -1232,4 +1238,4 @@ function me({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
1232
1238
  });
1233
1239
  }
1234
1240
  //#endregion
1235
- export { ue as AssociatedBlock, ce as associatedDraftEditableColumns, se as associatedEditableColumns, le as findMissingRequiredAssociatedFields, G as resolveAssociatedForeignKey, ae as resolveAssociatedRowActions, oe as resolveAssociatedToolbarActions };
1241
+ export { J as AssociatedBlock, ce as associatedDraftEditableColumns, se as associatedEditableColumns, q as associatedParentValue, le as findMissingRequiredAssociatedFields, oe as resolveAssociatedForeignKey, ae as resolveAssociatedRowActions, K as resolveAssociatedToolbarActions };