@declarion/react 0.104.0 → 0.109.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 (34) hide show
  1. package/dist-lib/api/agents.js +8 -7
  2. package/dist-lib/api/client.js +48 -49
  3. package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
  4. package/dist-lib/components/agents/ChatAttachments.js +144 -0
  5. package/dist-lib/components/agents/transcript-runs.js +1 -1
  6. package/dist-lib/components/chrome/AssociationTabs.js +89 -75
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
  8. package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
  9. package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
  10. package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
  11. package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
  12. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
  13. package/dist-lib/components/fields/RefCombobox.js +53 -48
  14. package/dist-lib/components/fields/index.js +1 -0
  15. package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
  16. package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
  17. package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
  18. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
  19. package/dist-lib/components/params/ParamsBlock.js +18 -15
  20. package/dist-lib/components/params/param-editors.js +60 -54
  21. package/dist-lib/components/primitives/RetryButton.js +14 -0
  22. package/dist-lib/components/primitives/StatTile.js +42 -34
  23. package/dist-lib/hooks/useAgentConversation.js +18 -13
  24. package/dist-lib/hooks/useParams.js +54 -52
  25. package/dist-lib/hooks/useSchema.js +5 -2
  26. package/dist-lib/hooks/useTimelineData.js +26 -24
  27. package/dist-lib/index.d.ts +89 -5
  28. package/dist-lib/index.js +95 -93
  29. package/dist-lib/lib/read-display-state.js +19 -0
  30. package/dist-lib/stores/auth.js +1 -0
  31. package/dist-lib/testing.d.ts +1 -1
  32. package/dist-lib/types/fieldType.js +1 -1
  33. package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
  34. package/package.json +1 -1
@@ -8,27 +8,29 @@ import { Btn as _ } from "../primitives/Btn.js";
8
8
  import { IconBtn as v } from "../primitives/IconBtn.js";
9
9
  import { useText as y } from "../../hooks/useText.js";
10
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";
11
+ import { RetryButton as x } from "../primitives/RetryButton.js";
12
+ import { useResponsiveMode as S } from "../../hooks/useResponsiveMode.js";
13
+ import { Spinner as C } from "../primitives/Spinner.js";
14
+ import { readDisplayState as w } from "../../lib/read-display-state.js";
15
+ import { DynamicIcon as T } from "../shared/DynamicIcon.js";
16
+ import { useTabNavigate as E } from "../../hooks/useTabNavigate.js";
17
+ import { applyRowState as D, defaultFlatForSlot as O } from "../../lib/actions.js";
18
+ import { ENTITY_CHILDREN_KEY as k, useChildrenData as A } from "../../hooks/useChildrenData.js";
19
+ import { useActionRunner as j } from "../actions/ActionRunner.js";
20
+ import { renderField as M } from "../fields/index.js";
21
+ import { dispatchAction as N } from "../../lib/action-dispatch.js";
22
+ import { ResponsiveActionBar as P } from "../actions/ResponsiveActionBar.js";
21
23
  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
- import { useAssociatedData as F } from "../../hooks/useAssociatedData.js";
25
- import { RowActionsKebab as I } from "../actions/RowActionsKebab.js";
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";
24
+ import { dataTableCellStyle as F, dataTableHeadCellStyle as te, dataTableStyle as ne } from "../primitives/dataTableStyles.js";
25
+ import { ActionButton as re } from "../actions/ActionButton.js";
26
+ import { useAssociatedData as I } from "../../hooks/useAssociatedData.js";
27
+ import { RowActionsKebab as L } from "../actions/RowActionsKebab.js";
28
+ import { AssociatedToolbar as R } from "./AssociatedToolbar.js";
29
+ import { useCallback as z, useEffect as B, useId as ie, useMemo as V, useRef as ae, useState as H } from "react";
28
30
  import { useQueryClient as U } from "@tanstack/react-query";
29
- import { Fragment as ie, jsx as W, jsxs as G } from "react/jsx-runtime";
31
+ import { Fragment as oe, jsx as W, jsxs as G } from "react/jsx-runtime";
30
32
  //#region src/components/detail-layout/AssociatedBlock.tsx
31
- function ae(e) {
33
+ function se(e) {
32
34
  if (!e) return [];
33
35
  let t = [];
34
36
  for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || r.href || n.startsWith("__") || t.push({
@@ -63,7 +65,7 @@ function K(t, n, r) {
63
65
  }
64
66
  return i;
65
67
  }
66
- function oe(e, t, n) {
68
+ function ce(e, t, n) {
67
69
  let r = e[n];
68
70
  if (!r) return null;
69
71
  let i = e[t], a = i?.children?.find((e) => e.entity === n);
@@ -91,7 +93,7 @@ function q(e, t, n, r, i) {
91
93
  let s = r[o];
92
94
  return typeof s == "string" || typeof s == "number" ? String(s) : "";
93
95
  }
94
- function se(e, t, n) {
96
+ function le(e, t, n) {
95
97
  let r = new Set(a(e));
96
98
  return new Set(t.filter((t) => {
97
99
  if (t === n || r.has(t)) return !1;
@@ -99,14 +101,14 @@ function se(e, t, n) {
99
101
  return i ? o(i) : !1;
100
102
  }));
101
103
  }
102
- function ce(e, t, n) {
104
+ function ue(e, t, n) {
103
105
  return new Set(t.filter((t) => {
104
106
  if (t === n) return !1;
105
107
  let r = e.fields.get(t);
106
108
  return !(!r || r.auto);
107
109
  }));
108
110
  }
109
- function le(e, t, n, r) {
111
+ function de(e, t, n, r) {
110
112
  let i = [];
111
113
  for (let a of t) {
112
114
  let t = n.fields.get(a);
@@ -121,7 +123,7 @@ function J({ node: e, ctx: t }) {
121
123
  if (!r || t.isNew) return null;
122
124
  let i = t.schema.entities[r];
123
125
  if (!i) return null;
124
- let a = e.foreign_key ?? oe(t.schema.entities, t.entityCode, r);
126
+ let a = e.foreign_key ?? ce(t.schema.entities, t.entityCode, r);
125
127
  return a ? /* @__PURE__ */ W(Y, {
126
128
  node: e,
127
129
  ctx: t,
@@ -148,30 +150,30 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
148
150
  if (e === a) return !1;
149
151
  let t = i.fields.get(e);
150
152
  return !(!t || t.primary || t.display?.is_listable === !1);
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), [
153
+ }), 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 = V(() => K(i.actions, a, x), [
152
154
  i.actions,
153
155
  a,
154
156
  x
155
- ]), D = B(() => {
157
+ ]), C = V(() => {
156
158
  let e = {};
157
159
  for (let { code: t, action: n } of S) e[t] = n;
158
160
  return e;
159
- }, [S]), O = B(() => {
161
+ }, [S]), w = V(() => {
160
162
  let e = i.action_layout ?? null;
161
- return T(o, e ?? E(D, "list_toolbar"), D, void 0, {}, [], d);
163
+ return D(o, e ?? O(C, "list_toolbar"), C, void 0, {}, [], d);
162
164
  }, [
163
165
  o,
164
166
  i.action_layout,
165
- D,
167
+ C,
166
168
  d
167
- ]), { run: A } = k(), N = w(), te = B(() => ({
169
+ ]), { run: k } = j(), A = E(), M = V(() => ({
168
170
  entity: i,
169
171
  entityCode: r,
170
172
  screenRoute: typeof window < "u" ? window.location.pathname : "",
171
173
  selectedRows: [],
172
174
  selectedIds: [],
173
175
  t: o,
174
- tabNavigate: (e, t) => N(e, {
176
+ tabNavigate: (e, t) => A(e, {
175
177
  title: t?.title,
176
178
  icon: t?.icon,
177
179
  search: t?.search
@@ -181,29 +183,29 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
181
183
  i,
182
184
  r,
183
185
  o,
184
- N
185
- ]), P = U(), F = R(() => {
186
- P.invalidateQueries({ predicate: (e) => {
186
+ A
187
+ ]), F = U(), te = z(() => {
188
+ F.invalidateQueries({ predicate: (e) => {
187
189
  let t = e.queryKey;
188
190
  return t[0] === "entity-children" && t[3] === r;
189
191
  } });
190
- }, [P, r]), I = R((e, t) => {
191
- let n = j(s, e, t, {}, r);
192
- if (n !== null) return A({
192
+ }, [F, r]), ne = z((e, t) => {
193
+ let n = N(s, e, t, {}, r);
194
+ if (n !== null) return k({
193
195
  action: t,
194
196
  title: o(t.display?.name) || e,
195
197
  execute: async (e) => {
196
198
  let t = await p(n, l(e, void 0));
197
- return F(), t;
199
+ return te(), t;
198
200
  }
199
201
  });
200
202
  }, [
201
203
  o,
202
204
  s,
203
- A,
205
+ k,
204
206
  r,
205
- F
206
- ]), [L, re] = H(0), z = /* @__PURE__ */ G("div", {
207
+ te
208
+ ]), [I, L] = H(0), R = /* @__PURE__ */ G("div", {
207
209
  style: {
208
210
  display: "flex",
209
211
  alignItems: "center",
@@ -212,28 +214,28 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
212
214
  minWidth: 0,
213
215
  justifyContent: "flex-end"
214
216
  },
215
- children: [i.action_layout ? O.length > 0 && /* @__PURE__ */ W(M, {
217
+ children: [i.action_layout ? w.length > 0 && /* @__PURE__ */ W(P, {
216
218
  kind: "toolbar",
217
- layout: O,
218
- entityActions: D,
219
- onRun: I,
220
- widgetContext: te,
219
+ layout: w,
220
+ entityActions: C,
221
+ onRun: ne,
222
+ widgetContext: M,
221
223
  ariaLabel: o("record.associated.toolbar_actions", "{name} toolbar actions", { name: h })
222
- }) : S.map(({ code: e, action: t }) => /* @__PURE__ */ W(ne, {
224
+ }) : S.map(({ code: e, action: t }) => /* @__PURE__ */ W(re, {
223
225
  actionCode: e,
224
226
  action: t,
225
227
  entityCode: r,
226
228
  variant: "ghost",
227
229
  size: "sm",
228
- onSuccess: F
230
+ onSuccess: te
229
231
  }, e)), m && /* @__PURE__ */ W(_, {
230
232
  kind: "ghost",
231
233
  size: "xs",
232
234
  icon: /* @__PURE__ */ W(g.plus, { size: 12 }),
233
- onClick: () => re((e) => e + 1),
235
+ onClick: () => L((e) => e + 1),
234
236
  children: o("record.row.add", "Add row")
235
237
  })]
236
- }), V = v ? /* @__PURE__ */ W(X, {
238
+ }), B = v ? /* @__PURE__ */ W(X, {
237
239
  entityCode: r,
238
240
  entity: i,
239
241
  parentEntity: t.entityCode,
@@ -246,8 +248,8 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
246
248
  searchable: e.searchable,
247
249
  filterFields: e.filters,
248
250
  sort: e.sort,
249
- startDraftSignal: L
250
- }) : /* @__PURE__ */ W(ue, {
251
+ startDraftSignal: I
252
+ }) : /* @__PURE__ */ W(fe, {
251
253
  entityCode: r,
252
254
  entity: i,
253
255
  parentEntity: t.entityCode,
@@ -258,7 +260,7 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
258
260
  interaction: f,
259
261
  ctx: t,
260
262
  sort: e.sort,
261
- startDraftSignal: L
263
+ startDraftSignal: I
262
264
  });
263
265
  return t.withinCard ? /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("div", {
264
266
  style: {
@@ -266,21 +268,21 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
266
268
  justifyContent: "flex-end",
267
269
  marginBottom: 8
268
270
  },
269
- children: z
270
- }), V] }) : /* @__PURE__ */ W(b, {
271
+ children: R
272
+ }), B] }) : /* @__PURE__ */ W(b, {
271
273
  title: h,
272
- icon: i.display?.icon ? /* @__PURE__ */ W(C, {
274
+ icon: i.display?.icon ? /* @__PURE__ */ W(T, {
273
275
  name: i.display.icon,
274
276
  size: 14
275
277
  }) : void 0,
276
- right: z,
277
- children: V
278
+ right: R,
279
+ children: B
278
280
  });
279
281
  }
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(() => {
282
+ function fe({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
283
+ let d = U(), f = A(n, r, e, i, l), p = f.data, m = w(f), h = p?.data ?? [], g = p?.$refs, _ = z(() => {
282
284
  d.invalidateQueries({ queryKey: [
283
- D,
285
+ k,
284
286
  n,
285
287
  r,
286
288
  e
@@ -302,21 +304,22 @@ function ue({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
302
304
  ctx: c,
303
305
  rows: h,
304
306
  refs: g,
305
- isLoading: p,
306
- isError: m,
307
+ isLoading: m.loading,
308
+ isError: m.error !== null,
309
+ onRetry: m.retry,
307
310
  invalidateQuery: _,
308
311
  startDraftSignal: u
309
312
  });
310
313
  }
311
314
  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);
313
- re(() => (w.current && clearTimeout(w.current), w.current = setTimeout(() => {
315
+ let p = y(), m = U(), [h, g] = H(""), [v, b] = H(""), [x, S] = H({}), T = ae(void 0);
316
+ B(() => (T.current && clearTimeout(T.current), T.current = setTimeout(() => {
314
317
  b(h);
315
318
  }, 300), () => {
316
- w.current && clearTimeout(w.current);
319
+ T.current && clearTimeout(T.current);
317
320
  }), [h]);
318
- let T = R((e, t) => {
319
- C((n) => {
321
+ let E = z((e, t) => {
322
+ S((n) => {
320
323
  if (t === "__all__") {
321
324
  let { [e]: t, ...r } = n;
322
325
  return r;
@@ -326,13 +329,13 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
326
329
  [e]: t
327
330
  };
328
331
  });
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(() => {
330
- if (!D?.pages) return {
332
+ }, []), D = V(() => Object.keys(x).length > 0 ? x : void 0, [x]), O = I(n, r, e, i, d, void 0, v || void 0, D), { data: k, hasNextPage: A, fetchNextPage: j, isFetchingNextPage: M } = O, N = w(O), { rows: P, refs: ee } = V(() => {
333
+ if (!k?.pages) return {
331
334
  rows: [],
332
335
  refs: void 0
333
336
  };
334
337
  let e = [], t;
335
- for (let n of D.pages) if (e.push(...n.data), n.$refs) {
338
+ for (let n of k.pages) if (e.push(...n.data), n.$refs) {
336
339
  if (!t) t = { ...n.$refs };
337
340
  else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
338
341
  ...t[e],
@@ -343,21 +346,21 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
343
346
  rows: e,
344
347
  refs: t
345
348
  };
346
- }, [D]), te = R(() => {
349
+ }, [k]), F = z(() => {
347
350
  m.invalidateQueries({ predicate: (t) => {
348
351
  let n = t.queryKey;
349
352
  return n[0] === "entity-children" && n[3] === e;
350
353
  } });
351
354
  }, [m, e]);
352
355
  return /* @__PURE__ */ G("div", { children: [
353
- /* @__PURE__ */ W(L, {
356
+ /* @__PURE__ */ W(R, {
354
357
  entity: t,
355
358
  searchable: l,
356
359
  filterFields: u,
357
360
  searchValue: h,
358
361
  onSearchChange: g,
359
362
  filters: x,
360
- onFilterChange: T,
363
+ onFilterChange: E,
361
364
  allEntities: c.schema.entities
362
365
  }),
363
366
  /* @__PURE__ */ W(Z, {
@@ -369,11 +372,12 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
369
372
  editable: o,
370
373
  interaction: s,
371
374
  ctx: c,
372
- rows: ee,
373
- refs: N,
374
- isLoading: O,
375
- isError: k,
376
- invalidateQuery: te,
375
+ rows: P,
376
+ refs: ee,
377
+ isLoading: N.loading,
378
+ isError: N.error !== null,
379
+ onRetry: N.retry,
380
+ invalidateQuery: F,
377
381
  startDraftSignal: f
378
382
  }),
379
383
  A && /* @__PURE__ */ W("div", {
@@ -381,7 +385,7 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
381
385
  children: /* @__PURE__ */ W(_, {
382
386
  kind: "ghost",
383
387
  size: "xs",
384
- icon: M ? /* @__PURE__ */ W(S, { size: 12 }) : void 0,
388
+ icon: M ? /* @__PURE__ */ W(C, { size: 12 }) : void 0,
385
389
  onClick: () => j(),
386
390
  disabled: M,
387
391
  children: p("record.associated.load_more", "Load more")
@@ -389,44 +393,44 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
389
393
  })
390
394
  ] });
391
395
  }
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, [
396
+ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, editable: l, interaction: p, ctx: g, rows: _, refs: v, isLoading: b, isError: C, onRetry: w, invalidateQuery: T, startDraftSignal: E }) {
397
+ let D = y(), O = y("errors"), k = S(), A = ee(t), M = k.isPhone && g.relatedRecordsPresentation === "table", N = o.find((e) => e !== a), P = V(() => p === "navigate" ? s(void 0, t, g.schema.screens) : null, [
394
398
  p,
395
399
  t,
396
400
  g.schema.screens
397
- ]), N = B(() => l ? se(t, o, a) : /* @__PURE__ */ new Set(), [
401
+ ]), F = V(() => l ? le(t, o, a) : /* @__PURE__ */ new Set(), [
398
402
  o,
399
403
  a,
400
404
  t,
401
405
  l
402
- ]), ne = B(() => ce(t, o, a), [
406
+ ]), re = V(() => ue(t, o, a), [
403
407
  o,
404
408
  a,
405
409
  t
406
- ]), F = B(() => {
410
+ ]), I = V(() => {
407
411
  let e = /* @__PURE__ */ new Map();
408
412
  for (let n of _) {
409
413
  let i = r(t, n);
410
414
  e.set(f(i), i);
411
415
  }
412
416
  return e;
413
- }, [_, t]), I = B(() => {
417
+ }, [_, t]), L = V(() => {
414
418
  let e = /* @__PURE__ */ new Map();
415
419
  for (let n of _) {
416
420
  let i = n.$row_version;
417
421
  typeof i == "string" && i !== "" && e.set(f(r(t, n)), i);
418
422
  }
419
423
  return e;
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({});
423
- re(() => {
424
+ }, [_, t]), R = V(() => se(t.actions), [t.actions]), [ie, U] = H(null), [oe, K] = H(null), [ce, q] = H([]), [J, Y] = H({}), fe = ae(J);
425
+ fe.current = J;
426
+ let X = ae({});
427
+ B(() => {
424
428
  let e = X.current;
425
429
  return () => {
426
430
  for (let t of Object.values(e)) clearTimeout(t);
427
431
  };
428
432
  }, []);
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) => {
433
+ let [Z, Q] = H(null), [he, $] = H([]), [ve, ye] = H(!1), { run: be } = j(), [xe, Se] = H(/* @__PURE__ */ new Set()), Ce = z(async (t, n, r) => {
430
434
  Y((e) => ({
431
435
  ...e,
432
436
  [t]: {
@@ -436,11 +440,11 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
436
440
  }
437
441
  }));
438
442
  try {
439
- let i = I.get(t), a = i ? {
443
+ let i = L.get(t), a = i ? {
440
444
  ...n,
441
445
  $row_version: i
442
446
  } : n;
443
- return await m(e, F.get(t) ?? t, a), Y((e) => {
447
+ return await m(e, I.get(t) ?? t, a), Y((e) => {
444
448
  let n = e[t];
445
449
  if (!n) return e;
446
450
  if (n.ver > r) return {
@@ -452,9 +456,9 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
452
456
  };
453
457
  let { [t]: i, ...a } = e;
454
458
  return a;
455
- }), C(), !0;
459
+ }), T(), !0;
456
460
  } catch (e) {
457
- let n = h(E, e);
461
+ let n = h(O, e);
458
462
  return Y((e) => ({
459
463
  ...e,
460
464
  [t]: {
@@ -466,11 +470,11 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
466
470
  }
467
471
  }, [
468
472
  e,
469
- E,
470
- C,
471
- F,
472
- I
473
- ]), Se = R((e, t, n) => {
473
+ O,
474
+ T,
475
+ I,
476
+ L
477
+ ]), we = z((e, t, n) => {
474
478
  Y((r) => {
475
479
  let i = r[e] ?? {
476
480
  buffer: {},
@@ -489,10 +493,10 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
489
493
  }
490
494
  };
491
495
  }), p === "inline_edit" && (X.current[e] && clearTimeout(X.current[e]), X.current[e] = setTimeout(() => {
492
- let t = ue.current[e];
493
- t && Object.keys(t.buffer).length > 0 && xe(e, { ...t.buffer }, t.ver);
496
+ let t = fe.current[e];
497
+ t && Object.keys(t.buffer).length > 0 && Ce(e, { ...t.buffer }, t.ver);
494
498
  }, 500));
495
- }, [xe, p]), Ce = R(() => {
499
+ }, [Ce, p]), Te = z(() => {
496
500
  let e = {};
497
501
  e[a] = n;
498
502
  for (let n of o) {
@@ -505,27 +509,27 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
505
509
  n,
506
510
  o,
507
511
  t.fields
508
- ]), we = V(w);
509
- re(() => {
510
- w !== void 0 && w !== we.current && (we.current = w, !Z && Ce());
512
+ ]), Ee = ae(E);
513
+ B(() => {
514
+ E !== void 0 && E !== Ee.current && (Ee.current = E, !Z && Te());
511
515
  }, [
512
- w,
516
+ E,
513
517
  Z,
514
- Ce
518
+ Te
515
519
  ]);
516
- let Te = R(async () => {
520
+ let De = z(async () => {
517
521
  if (!Z) return;
518
- let n = le(Z, o, t, a);
522
+ let n = de(Z, o, t, a);
519
523
  if (n.length > 0) $(n);
520
524
  else {
521
- _e(!0);
525
+ ye(!0);
522
526
  try {
523
- await u(e, Z), Q(null), $([]), C();
527
+ await u(e, Z), Q(null), $([]), T();
524
528
  } catch (e) {
525
- let t = h(E, e);
529
+ let t = h(O, e);
526
530
  $([`_error:${t}`]);
527
531
  } finally {
528
- _e(!1);
532
+ ye(!1);
529
533
  }
530
534
  }
531
535
  }, [
@@ -534,69 +538,73 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
534
538
  t,
535
539
  a,
536
540
  e,
537
- E,
538
- C
539
- ]), Ee = R((e) => {
541
+ O,
542
+ T
543
+ ]), Oe = z((e) => {
540
544
  Y({}), q([]), K(e);
541
- }, []), De = R(async (e) => {
542
- let n = ue.current[e], i = n?.buffer ?? {};
545
+ }, []), ke = z(async (e) => {
546
+ let n = fe.current[e], i = n?.buffer ?? {};
543
547
  if (Object.keys(i).length === 0) {
544
548
  K(null), q([]);
545
549
  return;
546
550
  }
547
- let s = le({
551
+ let s = de({
548
552
  ..._.find((n) => f(r(t, n)) === e) ?? {},
549
553
  ...i
550
554
  }, o, t, a);
551
- s.length > 0 ? q(s) : await xe(e, { ...i }, n?.ver ?? 0) && (K(null), q([]));
555
+ s.length > 0 ? q(s) : await Ce(e, { ...i }, n?.ver ?? 0) && (K(null), q([]));
552
556
  }, [
553
557
  _,
554
558
  t,
555
559
  o,
556
560
  a,
557
- xe
558
- ]), Oe = R((e) => {
561
+ Ce
562
+ ]), Ae = z((e) => {
559
563
  Y((t) => {
560
564
  if (!t[e]) return t;
561
565
  let { [e]: n, ...r } = t;
562
566
  return r;
563
567
  }), q([]), K(null);
564
- }, []), ke = R((n, r) => {
565
- let i = F.get(n) ?? n;
566
- return ve({
568
+ }, []), je = z((n, r) => {
569
+ let i = I.get(n) ?? n;
570
+ return be({
567
571
  action: t.actions?.__delete,
568
572
  destructive: !0,
569
- title: T(t.display?.name) || T("record.action.delete", "Delete"),
573
+ title: D(t.display?.name) || D("record.action.delete", "Delete"),
570
574
  row: r,
571
575
  entity: e,
572
576
  execute: async () => {
573
- be((e) => new Set(e).add(n));
577
+ Se((e) => new Set(e).add(n));
574
578
  try {
575
579
  return await d(e, i);
576
580
  } finally {
577
- be((e) => {
581
+ Se((e) => {
578
582
  let t = new Set(e);
579
583
  return t.delete(n), t;
580
584
  });
581
585
  }
582
586
  },
583
- onSuccess: () => C()
587
+ onSuccess: () => T()
584
588
  });
585
589
  }, [
586
- T,
587
- ve,
590
+ D,
591
+ be,
588
592
  t,
589
593
  e,
590
- C,
591
- F
594
+ T,
595
+ I
592
596
  ]);
593
- if (S) return /* @__PURE__ */ W("div", {
597
+ if (C) return /* @__PURE__ */ G("div", {
594
598
  style: {
595
599
  fontSize: 12.5,
596
600
  color: "var(--danger)",
597
601
  padding: "8px 0"
598
602
  },
599
- children: E("record.related_rows_unreadable", "The related records could not be loaded.")
603
+ children: [
604
+ O("record.related_rows_unreadable", "The related records could not be loaded."),
605
+ " ",
606
+ /* @__PURE__ */ W(x, { onRetry: w })
607
+ ]
600
608
  });
601
609
  if (b) return /* @__PURE__ */ G("div", {
602
610
  style: {
@@ -615,138 +623,138 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
615
623
  borderRadius: "var(--radius-md)"
616
624
  } })]
617
625
  });
618
- let Ae = _.length === 0 && !Z;
619
- return D.isPhone && !A ? /* @__PURE__ */ G("div", { children: [Ae && /* @__PURE__ */ W("div", {
626
+ let Me = _.length === 0 && !Z;
627
+ return k.isPhone && !M ? /* @__PURE__ */ G("div", { children: [Me && /* @__PURE__ */ W("div", {
620
628
  style: {
621
629
  fontSize: 12.5,
622
630
  color: "var(--text-3)",
623
631
  padding: "12px 0"
624
632
  },
625
- children: T("record.related.empty", "No records yet.")
626
- }), !Ae && /* @__PURE__ */ G("div", {
633
+ children: D("record.related.empty", "No records yet.")
634
+ }), !Me && /* @__PURE__ */ G("div", {
627
635
  style: {
628
636
  display: "flex",
629
637
  flexDirection: "column",
630
638
  gap: 10
631
639
  },
632
640
  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, {
641
+ let i = f(r(t, n)), a = xe.has(i), s = J[i], u = P && i ? P.replace(/:\w+/, i) : void 0;
642
+ return /* @__PURE__ */ W(pe, {
635
643
  rowId: i,
636
644
  row: n,
637
645
  entity: t,
638
646
  entities: g.schema.entities,
639
647
  screens: g.schema.screens,
640
648
  columns: o,
641
- editableColumns: N,
642
- editable: l && c(t, n, O.tenantId),
649
+ editableColumns: F,
650
+ editable: l && c(t, n, A.tenantId),
643
651
  interaction: p,
644
- isEditing: ie === i,
645
- editErrors: oe,
652
+ isEditing: oe === i,
653
+ editErrors: ce,
646
654
  isDeleting: a,
647
- activeCell: z,
655
+ activeCell: ie,
648
656
  setActiveCell: U,
649
657
  rowState: s,
650
- onCellChange: Se,
651
- onDeleteClick: (e) => void ke(e, n),
652
- onStartEdit: Ee,
653
- onConfirmEdit: De,
654
- onCancelEdit: Oe,
658
+ onCellChange: we,
659
+ onDeleteClick: (e) => void je(e, n),
660
+ onStartEdit: Oe,
661
+ onConfirmEdit: ke,
662
+ onCancelEdit: Ae,
655
663
  refs: v,
656
- identityCol: j,
664
+ identityCol: N,
657
665
  href: u,
658
- rowActions: L,
666
+ rowActions: R,
659
667
  entityCode: e,
660
- onRowActionSuccess: C
668
+ onRowActionSuccess: T
661
669
  }, i);
662
- }), Z && /* @__PURE__ */ W(he, {
670
+ }), Z && /* @__PURE__ */ W(_e, {
663
671
  draftRow: Z,
664
672
  entity: t,
665
673
  columns: o,
666
- editableColumns: ne,
674
+ editableColumns: re,
667
675
  foreignKey: a,
668
- draftErrors: pe,
669
- draftSaving: ge,
676
+ draftErrors: he,
677
+ draftSaving: ve,
670
678
  onChange: (e, t) => Q((n) => n && {
671
679
  ...n,
672
680
  [e]: t
673
681
  }),
674
- onConfirm: Te,
682
+ onConfirm: De,
675
683
  onCancel: () => {
676
684
  Q(null), $([]);
677
685
  },
678
686
  refs: v
679
687
  })]
680
- })] }) : /* @__PURE__ */ G("div", { children: [Ae && /* @__PURE__ */ W("div", {
688
+ })] }) : /* @__PURE__ */ G("div", { children: [Me && /* @__PURE__ */ W("div", {
681
689
  style: {
682
690
  fontSize: 12.5,
683
691
  color: "var(--text-3)",
684
692
  padding: "12px 0"
685
693
  },
686
- children: T("record.related.empty", "No records yet.")
687
- }), !Ae && /* @__PURE__ */ W("div", {
694
+ children: D("record.related.empty", "No records yet.")
695
+ }), !Me && /* @__PURE__ */ W("div", {
688
696
  style: { overflowX: "auto" },
689
697
  children: /* @__PURE__ */ G("table", {
690
- style: P,
698
+ style: ne,
691
699
  children: [/* @__PURE__ */ W("thead", { children: /* @__PURE__ */ G("tr", { children: [
692
700
  o.map((e) => {
693
701
  let n = t.fields.get(e);
694
702
  return /* @__PURE__ */ W("th", {
695
703
  style: te,
696
- children: n ? i(T, n, e, g.schema.entities) : e
704
+ children: n ? i(D, n, e, g.schema.entities) : e
697
705
  }, e);
698
706
  }),
699
707
  l && /* @__PURE__ */ W("th", { style: {
700
708
  height: 30,
701
709
  width: 72
702
710
  } }),
703
- !l && L.length > 0 && /* @__PURE__ */ W("th", { style: {
711
+ !l && R.length > 0 && /* @__PURE__ */ W("th", { style: {
704
712
  height: 30,
705
713
  width: 40
706
714
  } })
707
715
  ] }) }), /* @__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, {
716
+ let i = f(r(t, n)), a = xe.has(i), s = J[i], u = P && i ? P.replace(/:\w+/, i) : void 0;
717
+ return /* @__PURE__ */ W(me, {
710
718
  rowId: i,
711
719
  row: n,
712
720
  entity: t,
713
721
  entities: g.schema.entities,
714
722
  screens: g.schema.screens,
715
723
  columns: o,
716
- editableColumns: N,
717
- editable: l && c(t, n, O.tenantId),
724
+ editableColumns: F,
725
+ editable: l && c(t, n, A.tenantId),
718
726
  interaction: p,
719
- isEditing: ie === i,
720
- editErrors: oe,
727
+ isEditing: oe === i,
728
+ editErrors: ce,
721
729
  isDeleting: a,
722
- activeCell: z,
730
+ activeCell: ie,
723
731
  setActiveCell: U,
724
732
  rowState: s,
725
- onCellChange: Se,
726
- onDeleteClick: (e) => void ke(e, n),
727
- onStartEdit: Ee,
728
- onConfirmEdit: De,
729
- onCancelEdit: Oe,
733
+ onCellChange: we,
734
+ onDeleteClick: (e) => void je(e, n),
735
+ onStartEdit: Oe,
736
+ onConfirmEdit: ke,
737
+ onCancelEdit: Ae,
730
738
  refs: v,
731
- identityCol: j,
739
+ identityCol: N,
732
740
  href: u,
733
- rowActions: L,
741
+ rowActions: R,
734
742
  entityCode: e,
735
- onRowActionSuccess: C
743
+ onRowActionSuccess: T
736
744
  }, i);
737
- }), Z && /* @__PURE__ */ W(me, {
745
+ }), Z && /* @__PURE__ */ W(ge, {
738
746
  draftRow: Z,
739
747
  entity: t,
740
748
  columns: o,
741
- editableColumns: ne,
749
+ editableColumns: re,
742
750
  foreignKey: a,
743
- draftErrors: pe,
744
- draftSaving: ge,
751
+ draftErrors: he,
752
+ draftSaving: ve,
745
753
  onChange: (e, t) => Q((n) => n && {
746
754
  ...n,
747
755
  [e]: t
748
756
  }),
749
- onConfirm: Te,
757
+ onConfirm: De,
750
758
  onCancel: () => {
751
759
  Q(null), $([]);
752
760
  },
@@ -755,15 +763,15 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
755
763
  })
756
764
  })] });
757
765
  }
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 : {
766
+ function pe({ 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: S, refs: w, identityCol: T, href: E, rowActions: D, onRowActionSuccess: O }) {
767
+ let k = y(), A = ie(), j = V(() => !m || Object.keys(m.buffer).length === 0 ? n : {
760
768
  ...n,
761
769
  ...m.buffer
762
770
  }, [n, m]);
763
771
  if (u === "row_edit" && d) {
764
772
  let t = m?.error ? [...f, `_error:${m.error}`] : f;
765
- return /* @__PURE__ */ W(pe, {
766
- values: M,
773
+ return /* @__PURE__ */ W(he, {
774
+ values: j,
767
775
  entity: r,
768
776
  columns: s,
769
777
  editableColumns: c,
@@ -771,7 +779,7 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
771
779
  saving: m?.saving ?? !1,
772
780
  onChange: (t, n) => h(e, t, n),
773
781
  onConfirm: () => x(e),
774
- onCancel: () => C(e),
782
+ onCancel: () => S(e),
775
783
  refs: w
776
784
  });
777
785
  }
@@ -791,17 +799,17 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
791
799
  gap: 12
792
800
  },
793
801
  children: s.map((n) => {
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`, _ = {
802
+ 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 = `${A}-${e}-${n}`, g = `${m}-label`, _ = {
795
803
  fontSize: 11.5,
796
804
  fontWeight: 600,
797
805
  color: "var(--text-3)"
798
- }, v = s ? A({
806
+ }, v = s ? M({
799
807
  field: s,
800
808
  fieldName: n,
801
- value: M[n],
809
+ value: j[n],
802
810
  mode: d ? "edit" : "display",
803
811
  onChange: d ? (t) => h(e, n, t) : void 0,
804
- record: M,
812
+ record: j,
805
813
  refs: w,
806
814
  compact: d,
807
815
  entity: r,
@@ -810,7 +818,7 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
810
818
  fieldId: m,
811
819
  labelId: g,
812
820
  t: k
813
- }) : t(M[n]);
821
+ }) : t(j[n]);
814
822
  return /* @__PURE__ */ G("div", {
815
823
  style: {
816
824
  display: "flex",
@@ -851,8 +859,8 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
851
859
  justifyContent: "flex-end",
852
860
  gap: 6
853
861
  },
854
- children: [l && /* @__PURE__ */ G(ie, { children: [
855
- m?.saving && /* @__PURE__ */ W(S, { size: 12 }),
862
+ children: [l && /* @__PURE__ */ G(oe, { children: [
863
+ m?.saving && /* @__PURE__ */ W(C, { size: 12 }),
856
864
  m?.error && /* @__PURE__ */ W("span", {
857
865
  style: {
858
866
  fontSize: 11,
@@ -873,75 +881,75 @@ function de({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
873
881
  onClick: () => _(e),
874
882
  title: k("record.row.delete", "Delete row")
875
883
  })
876
- ] }), !l && D && D.length > 0 && /* @__PURE__ */ W(I, {
884
+ ] }), !l && D && D.length > 0 && /* @__PURE__ */ W(L, {
877
885
  entity: r,
878
886
  actions: D,
879
887
  objectIds: [e],
880
- row: M,
888
+ row: j,
881
889
  onSuccess: O
882
890
  })]
883
891
  })]
884
892
  });
885
893
  }
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 : {
894
+ function me({ 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: S, onCancelEdit: w, refs: T, identityCol: E, href: D, rowActions: O, onRowActionSuccess: k }) {
895
+ let A = y(), j = V(() => !h || Object.keys(h.buffer).length === 0 ? n : {
888
896
  ...n,
889
897
  ...h.buffer
890
898
  }, [n, h]);
891
899
  if (l === "row_edit" && u) {
892
900
  let t = h?.error ? [...d, `_error:${h.error}`] : d;
893
901
  return /* @__PURE__ */ W(Q, {
894
- values: M,
902
+ values: j,
895
903
  entity: r,
896
904
  columns: o,
897
905
  editableColumns: s,
898
906
  errors: t,
899
907
  saving: h?.saving ?? !1,
900
908
  onChange: (t, n) => _(e, t, n),
901
- onConfirm: () => C(e),
909
+ onConfirm: () => S(e),
902
910
  onCancel: () => w(e),
903
911
  refs: T
904
912
  });
905
913
  }
906
- let ee = N, te = {
914
+ let N = F, P = {
907
915
  padding: "4px 4px",
908
916
  borderBottom: "1px solid var(--divider)",
909
917
  verticalAlign: "middle"
910
- }, P = l === "inline_edit";
918
+ }, ee = l === "inline_edit";
911
919
  return /* @__PURE__ */ G("tr", {
912
920
  style: { opacity: f ? .5 : 1 },
913
921
  children: [
914
922
  o.map((n) => {
915
923
  let o = r.fields.get(n), c = s.has(n);
916
- if (P && p?.rowId === e && p?.col === n && c) return /* @__PURE__ */ W("td", {
917
- style: te,
918
- children: o ? A({
924
+ if (ee && p?.rowId === e && p?.col === n && c) return /* @__PURE__ */ W("td", {
925
+ style: P,
926
+ children: o ? M({
919
927
  field: o,
920
928
  fieldName: n,
921
- value: M[n],
929
+ value: j[n],
922
930
  mode: "edit",
923
931
  onChange: (t) => _(e, n, t),
924
- record: M,
932
+ record: j,
925
933
  refs: T,
926
934
  compact: !0,
927
- t: j
928
- }) : t(M[n])
935
+ t: A
936
+ }) : t(j[n])
929
937
  }, n);
930
- let l = D && n === E, u = o ? A({
938
+ let l = D && n === E, u = o ? M({
931
939
  field: o,
932
940
  fieldName: n,
933
- value: M[n],
941
+ value: j[n],
934
942
  mode: "display",
935
- record: M,
943
+ record: j,
936
944
  refs: T,
937
945
  entity: r,
938
946
  entities: i,
939
947
  screens: l ? void 0 : a,
940
- t: j
941
- }) : t(M[n]), d = P && c && !f;
948
+ t: A
949
+ }) : t(j[n]), d = ee && c && !f;
942
950
  return /* @__PURE__ */ W("td", {
943
951
  style: {
944
- ...ee,
952
+ ...N,
945
953
  cursor: d ? "pointer" : "default"
946
954
  },
947
955
  onClick: d ? () => m({
@@ -974,7 +982,7 @@ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
974
982
  gap: 4
975
983
  },
976
984
  children: [
977
- h?.saving && /* @__PURE__ */ W(S, { size: 12 }),
985
+ h?.saving && /* @__PURE__ */ W(C, { size: 12 }),
978
986
  h?.error && /* @__PURE__ */ W("span", {
979
987
  style: {
980
988
  fontSize: 11,
@@ -987,13 +995,13 @@ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
987
995
  size: 24,
988
996
  icon: /* @__PURE__ */ W(g.edit, { size: 12 }),
989
997
  onClick: () => x(e),
990
- title: j("record.row.edit", "Edit row")
998
+ title: A("record.row.edit", "Edit row")
991
999
  }),
992
1000
  /* @__PURE__ */ W(v, {
993
1001
  size: 24,
994
1002
  icon: /* @__PURE__ */ W(g.trash, { size: 12 }),
995
1003
  onClick: () => b(e),
996
- title: j("record.row.delete", "Delete row")
1004
+ title: A("record.row.delete", "Delete row")
997
1005
  })
998
1006
  ]
999
1007
  })
@@ -1004,11 +1012,11 @@ function fe({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
1004
1012
  borderBottom: "1px solid var(--divider)",
1005
1013
  verticalAlign: "middle"
1006
1014
  },
1007
- children: /* @__PURE__ */ W(I, {
1015
+ children: /* @__PURE__ */ W(L, {
1008
1016
  entity: r,
1009
1017
  actions: O,
1010
1018
  objectIds: [e],
1011
- row: M,
1019
+ row: j,
1012
1020
  onSuccess: k
1013
1021
  })
1014
1022
  })
@@ -1044,7 +1052,7 @@ function Q({ values: e, entity: n, columns: r, editableColumns: i, errors: a, sa
1044
1052
  title: c ? f("record.row.field_required", "{field} is required", { field: r }) : void 0,
1045
1053
  children: /* @__PURE__ */ W("div", {
1046
1054
  style: _,
1047
- children: a ? A({
1055
+ children: a ? M({
1048
1056
  field: a,
1049
1057
  fieldName: r,
1050
1058
  value: e[r],
@@ -1083,7 +1091,7 @@ function Q({ values: e, entity: n, columns: r, editableColumns: i, errors: a, sa
1083
1091
  }),
1084
1092
  /* @__PURE__ */ W(v, {
1085
1093
  size: 24,
1086
- icon: W(o ? S : g.check, { size: 12 }),
1094
+ icon: W(o ? C : g.check, { size: 12 }),
1087
1095
  onClick: c,
1088
1096
  title: f("record.row.confirm", "Confirm (Enter)")
1089
1097
  }),
@@ -1098,8 +1106,8 @@ function Q({ values: e, entity: n, columns: r, editableColumns: i, errors: a, sa
1098
1106
  })]
1099
1107
  });
1100
1108
  }
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:")));
1109
+ function he({ values: e, entity: n, columns: r, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
1110
+ let p = y(), m = ie(), h = o.find((e) => e.startsWith("_error:")), _ = new Set(o.filter((e) => !e.startsWith("_error:")));
1103
1111
  return /* @__PURE__ */ G("div", {
1104
1112
  style: {
1105
1113
  border: "1px solid var(--border)",
@@ -1148,7 +1156,7 @@ function pe({ values: e, entity: n, columns: r, editableColumns: a, errors: o, s
1148
1156
  borderRadius: l ? "var(--radius-sm)" : 0
1149
1157
  },
1150
1158
  title: l ? p("record.row.field_required", "{field} is required", { field: r }) : void 0,
1151
- children: s ? o ? A({
1159
+ children: s ? o ? M({
1152
1160
  field: o,
1153
1161
  fieldName: r,
1154
1162
  value: e[r],
@@ -1185,7 +1193,7 @@ function pe({ values: e, entity: n, columns: r, editableColumns: a, errors: o, s
1185
1193
  }),
1186
1194
  /* @__PURE__ */ W(v, {
1187
1195
  size: 32,
1188
- icon: W(s ? S : g.check, { size: 14 }),
1196
+ icon: W(s ? C : g.check, { size: 14 }),
1189
1197
  onClick: l,
1190
1198
  title: p("record.row.confirm", "Confirm (Enter)")
1191
1199
  }),
@@ -1199,8 +1207,8 @@ function pe({ values: e, entity: n, columns: r, editableColumns: a, errors: o, s
1199
1207
  })]
1200
1208
  });
1201
1209
  }
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(() => {
1210
+ function ge({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1211
+ let d = V(() => {
1204
1212
  let e = new Set(r);
1205
1213
  return e.delete(i), e;
1206
1214
  }, [r, i]);
@@ -1218,12 +1226,12 @@ function me({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
1218
1226
  accent: !0
1219
1227
  });
1220
1228
  }
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(() => {
1229
+ function _e({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1230
+ let d = V(() => {
1223
1231
  let e = new Set(r);
1224
1232
  return e.delete(i), e;
1225
1233
  }, [r, i]);
1226
- return /* @__PURE__ */ W(pe, {
1234
+ return /* @__PURE__ */ W(he, {
1227
1235
  values: e,
1228
1236
  entity: t,
1229
1237
  columns: n,
@@ -1238,4 +1246,4 @@ function he({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
1238
1246
  });
1239
1247
  }
1240
1248
  //#endregion
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 };
1249
+ export { J as AssociatedBlock, ue as associatedDraftEditableColumns, le as associatedEditableColumns, q as associatedParentValue, de as findMissingRequiredAssociatedFields, ce as resolveAssociatedForeignKey, se as resolveAssociatedRowActions, K as resolveAssociatedToolbarActions };