@declarion/react 0.59.2 → 0.61.1

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 (39) hide show
  1. package/dist-lib/{AgentChatPanel.impl-DBH1Ff4G.js → AgentChatPanel.impl-rgkewyMl.js} +40 -40
  2. package/dist-lib/{DetailAuditStrip-9eJM2Fml.js → DetailAuditStrip-CSXZoy7v.js} +12 -12
  3. package/dist-lib/{DraggableChildrenTable-4RZC351U.js → DraggableChildrenTable-DruYOxKm.js} +35 -35
  4. package/dist-lib/{Grid-CQabaBLx.js → Grid-Dsf3I0xG.js} +3 -3
  5. package/dist-lib/{LayoutRenderer-DGKWZKpW.js → LayoutRenderer-QN7Wp2W6.js} +465 -465
  6. package/dist-lib/{ListCardsBody-DfGmyNIu.js → ListCardsBody-CNaZ0xwz.js} +27 -27
  7. package/dist-lib/{MarkdownRenderer-BDbzDv_y.js → MarkdownRenderer-BuO5hYJh.js} +2 -2
  8. package/dist-lib/{RefreshControl-Bhoib0ZA.js → RefreshControl-DO9rYcdq.js} +27 -27
  9. package/dist-lib/{SmartDetailPage.impl-DFjz29Ff.js → SmartDetailPage.impl-DFIIx80b.js} +471 -471
  10. package/dist-lib/SmartListPage.impl-D694R32H.js +3051 -0
  11. package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.js +780 -0
  12. package/dist-lib/{SortHeaderMenu-Cijxk4cX.js → SortHeaderMenu-BV-aQbPy.js} +2 -2
  13. package/dist-lib/{action-dispatch-DY0c8U81.js → action-dispatch-gWmOYjOP.js} +189 -189
  14. package/dist-lib/api/data.d.ts +5 -1
  15. package/dist-lib/{cardProjection-Bkl2SSYz.js → cardProjection-BnmWukxk.js} +1 -1
  16. package/dist-lib/components/pages/list/filter-meta.d.ts +1 -1
  17. package/dist-lib/components/pages/list/useActiveView.d.ts +9 -2
  18. package/dist-lib/components/pages/list/useListViews.d.ts +3 -2
  19. package/dist-lib/components/primitives/Fields.d.ts +3 -1
  20. package/dist-lib/{failure-v-uGSpbX.js → failure-BUxXuP4c.js} +6 -6
  21. package/dist-lib/{format-count-DA4wmmWR.js → format-count-bXVfHzbI.js} +247 -247
  22. package/dist-lib/hooks/useObject.d.ts +3 -2
  23. package/dist-lib/index.js +1055 -1047
  24. package/dist-lib/lib/field-classification.d.ts +10 -1
  25. package/dist-lib/{peekDraftStore-D-cTbiIr.js → peekDraftStore-Dk1Ha5u3.js} +7 -7
  26. package/dist-lib/{registry-Cb3W-czW.js → registry-nSeHd5si.js} +445 -439
  27. package/dist-lib/testing.js +3 -3
  28. package/dist-lib/types/api.d.ts +0 -1
  29. package/dist-lib/{useAgentConversation-D97IqE-J.js → useAgentConversation-nT5UypJX.js} +15 -15
  30. package/dist-lib/{useCurrentScreen-BL5NZFCw.js → useCurrentScreen-0WBj7wT6.js} +1176 -1090
  31. package/dist-lib/{useListQuery-BG1GyKtJ.js → useListQuery-C7dq_sEo.js} +5 -5
  32. package/dist-lib/{field-classification-C28XE-_P.js → useOwnRefresh-q80kCMMh.js} +134 -160
  33. package/dist-lib/{useProperties-4Lg3odrt.js → useProperties-CeGKtq7Q.js} +3 -3
  34. package/dist-lib/{useTabSearchMirror-ZVLlINBX.js → useTabSearchMirror-CzNAj82Q.js} +2 -2
  35. package/dist-lib/{useText-BFDCTUSo.js → useText-BsedsJ-J.js} +2 -2
  36. package/dist-lib/{value-By1-WJ8J.js → value-Dwfyghtj.js} +1 -1
  37. package/package.json +9 -9
  38. package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +0 -3046
  39. package/dist-lib/SmartRecordListPage.impl-C1FJLr80.js +0 -780
@@ -1,9 +1,9 @@
1
1
  import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
2
- import { $ as n, D as r, Et as i, G as a, In as o, L as s, Ln as c, O as l, Ot as u, Pn as d, Q as f, R as p, Rn as m, Tn as h, W as g, X as _, Zt as v, _n as y, en as b, gn as x, hn as S, i as C, jn as w, kt as T, ln as E, nn as D, on as O, q as k, rn as A, rt as j, tt as M, xt as N, yn as P } from "./useCurrentScreen-BL5NZFCw.js";
3
- import { A as F, M as I, f as L, s as R, t as z } from "./useText-BFDCTUSo.js";
4
- import { a as B, c as V, f as H, m as U, o as ee, s as te, t as ne, u as W, y as re } from "./failure-v-uGSpbX.js";
5
- import { N as G } from "./field-classification-C28XE-_P.js";
6
- import { c as ie, l as ae, o as oe, t as se } from "./action-dispatch-DY0c8U81.js";
2
+ import { $ as n, D as r, Dn as i, En as a, Fn as o, G as s, It as c, Jn as l, Kn as u, L as d, O as f, Q as p, R as m, Rt as h, Tn as g, Vn as _, W as v, Wn as y, X as b, fn as x, gn as S, i as C, jt as w, kn as T, pn as E, q as D, qn as O, rt as k, sn as A, tt as j, un as M, yn as N, zt as P } from "./useCurrentScreen-0WBj7wT6.js";
3
+ import { A as F, M as I, f as L, s as R, t as z } from "./useText-BsedsJ-J.js";
4
+ import { a as B, c as V, f as H, m as U, o as ee, s as te, t as ne, u as W, y as re } from "./failure-BUxXuP4c.js";
5
+ import { E as G } from "./useOwnRefresh-q80kCMMh.js";
6
+ import { c as ie, l as ae, o as oe, t as se } from "./action-dispatch-gWmOYjOP.js";
7
7
  import { n as ce, r as le, t as ue } from "./dataTableStyles-vwD1mVOP.js";
8
8
  import { Component as K, createContext as de, useCallback as q, useContext as fe, useEffect as pe, useId as me, useMemo as J, useRef as Y, useState as X } from "react";
9
9
  import { QueryClientContext as he, useInfiniteQuery as ge, useQuery as _e, useQueryClient as Z } from "@tanstack/react-query";
@@ -21,16 +21,16 @@ var xe = {
21
21
  shadow: "none"
22
22
  }
23
23
  };
24
- function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: s, footer: l, collapsible: u = !0, defaultOpen: d = !0, icon: f, emphasis: p = "primary", headingLevel: m = 2, padding: h = "16px" }) {
25
- let g = z(), [_, v] = X(d), y = xe[p] ?? xe.primary;
24
+ function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: o, footer: s, collapsible: c = !0, defaultOpen: l = !0, icon: d, emphasis: f = "primary", headingLevel: p = 2, padding: m = "16px" }) {
25
+ let h = z(), [g, _] = X(l), v = xe[f] ?? xe.primary;
26
26
  return /* @__PURE__ */ $("div", {
27
- "data-emphasis": p,
27
+ "data-emphasis": f,
28
28
  style: {
29
- background: y.surface,
29
+ background: v.surface,
30
30
  border: "1px solid var(--border)",
31
31
  borderRadius: 10,
32
32
  overflow: "hidden",
33
- boxShadow: y.shadow,
33
+ boxShadow: v.shadow,
34
34
  flexShrink: 0
35
35
  },
36
36
  children: [
@@ -40,25 +40,25 @@ function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: s,
40
40
  alignItems: "center",
41
41
  gap: 10,
42
42
  padding: "10px 14px",
43
- borderBottom: _ ? "1px solid var(--divider)" : "none",
43
+ borderBottom: g ? "1px solid var(--divider)" : "none",
44
44
  minHeight: 40
45
45
  },
46
46
  children: [
47
47
  /* @__PURE__ */ Q("div", {
48
48
  role: "heading",
49
- "aria-level": m,
49
+ "aria-level": p,
50
50
  style: {
51
51
  display: "flex",
52
52
  flex: 1,
53
53
  minWidth: 0
54
54
  },
55
55
  children: /* @__PURE__ */ $("div", {
56
- role: u ? "button" : void 0,
57
- tabIndex: u ? 0 : void 0,
58
- "aria-expanded": u ? _ : void 0,
59
- onClick: u ? () => v((e) => !e) : void 0,
60
- onKeyDown: u ? (e) => {
61
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), v((e) => !e));
56
+ role: c ? "button" : void 0,
57
+ tabIndex: c ? 0 : void 0,
58
+ "aria-expanded": c ? g : void 0,
59
+ onClick: c ? () => _((e) => !e) : void 0,
60
+ onKeyDown: c ? (e) => {
61
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), _((e) => !e));
62
62
  } : void 0,
63
63
  style: {
64
64
  display: "flex",
@@ -66,17 +66,17 @@ function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: s,
66
66
  gap: 8,
67
67
  flex: 1,
68
68
  minWidth: 0,
69
- cursor: u ? "pointer" : "default",
69
+ cursor: c ? "pointer" : "default",
70
70
  userSelect: "none"
71
71
  },
72
72
  children: [
73
- f && /* @__PURE__ */ Q("span", {
73
+ d && /* @__PURE__ */ Q("span", {
74
74
  style: {
75
75
  color: "var(--text-3)",
76
76
  display: "flex",
77
77
  flexShrink: 0
78
78
  },
79
- children: f
79
+ children: d
80
80
  }),
81
81
  /* @__PURE__ */ Q("div", {
82
82
  style: {
@@ -120,26 +120,26 @@ function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: s,
120
120
  ]
121
121
  })
122
122
  }),
123
- i && /* @__PURE__ */ Q(o, {
123
+ i && /* @__PURE__ */ Q(u, {
124
124
  tone: i.tone ?? "violet",
125
125
  size: "xs",
126
126
  dot: i.dot,
127
127
  children: i.text
128
128
  }),
129
129
  r,
130
- u && /* @__PURE__ */ Q(c, {
130
+ c && /* @__PURE__ */ Q(O, {
131
131
  size: 24,
132
- icon: Q(_ ? e.up : e.down, { size: 14 }),
133
- onClick: () => v((e) => !e),
134
- title: _ ? g("control.collapse", "Collapse") : g("control.expand", "Expand")
132
+ icon: Q(g ? e.up : e.down, { size: 14 }),
133
+ onClick: () => _((e) => !e),
134
+ title: g ? h("control.collapse", "Collapse") : h("control.expand", "Expand")
135
135
  })
136
136
  ]
137
137
  }),
138
- _ && /* @__PURE__ */ Q("div", {
139
- style: { padding: h },
140
- children: s
138
+ g && /* @__PURE__ */ Q("div", {
139
+ style: { padding: m },
140
+ children: o
141
141
  }),
142
- l && _ && /* @__PURE__ */ Q("div", {
142
+ s && g && /* @__PURE__ */ Q("div", {
143
143
  style: {
144
144
  padding: "8px 14px",
145
145
  borderTop: "1px solid var(--divider)",
@@ -147,7 +147,7 @@ function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: s,
147
147
  fontSize: 11.5,
148
148
  color: "var(--text-3)"
149
149
  },
150
- children: l
150
+ children: s
151
151
  })
152
152
  ]
153
153
  });
@@ -212,12 +212,12 @@ function Ne({ columns: e = 2, children: t }) {
212
212
  })
213
213
  });
214
214
  }
215
- function Pe({ label: t, children: n, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: d, labelId: f, labelTitle: p, "data-testid": m }) {
216
- let h = z(), g = fe(Me), _ = r || g.stackPairs, v = !!a;
215
+ function Pe({ label: t, children: n, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: u, labelId: d, labelTitle: f, "data-testid": p }) {
216
+ let m = z(), g = fe(Me), _ = r || g.stackPairs, v = !!a;
217
217
  return /* @__PURE__ */ $("div", {
218
218
  className: "detail-row",
219
219
  "data-error": v || void 0,
220
- "data-testid": m,
220
+ "data-testid": p,
221
221
  style: {
222
222
  display: "flex",
223
223
  flexDirection: _ ? "column" : "row",
@@ -239,14 +239,14 @@ function Pe({ label: t, children: n, span: r = !1, required: i, error: a, hint:
239
239
  alignItems: "flex-start",
240
240
  gap: 2
241
241
  },
242
- children: [d ? /* @__PURE__ */ Q("label", {
243
- id: f,
244
- htmlFor: d,
245
- title: p || void 0,
242
+ children: [u ? /* @__PURE__ */ Q("label", {
243
+ id: d,
244
+ htmlFor: u,
245
+ title: f || void 0,
246
246
  children: t
247
247
  }) : /* @__PURE__ */ Q("span", {
248
- id: f,
249
- title: p || void 0,
248
+ id: d,
249
+ title: f || void 0,
250
250
  children: t
251
251
  }), i && l === "edit" && /* @__PURE__ */ Q("span", {
252
252
  "aria-hidden": "true",
@@ -296,10 +296,10 @@ function Pe({ label: t, children: n, span: r = !1, required: i, error: a, hint:
296
296
  flexShrink: 0,
297
297
  marginTop: -2
298
298
  },
299
- children: [c && /* @__PURE__ */ Q(u, {
299
+ children: [c && /* @__PURE__ */ Q(h, {
300
300
  value: c,
301
301
  size: "sm",
302
- title: h("record.field.copy_value", "Copy value")
302
+ title: m("record.field.copy_value", "Copy value")
303
303
  }), s]
304
304
  })]
305
305
  }), (v || o != null) && /* @__PURE__ */ $("div", {
@@ -318,19 +318,25 @@ function Pe({ label: t, children: n, span: r = !1, required: i, error: a, hint:
318
318
  }
319
319
  //#endregion
320
320
  //#region src/hooks/useObject.ts
321
- function Fe(e, t) {
322
- return [
321
+ function Fe(e, t, n = {}) {
322
+ let r = t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]]), i = n.expand?.join(",");
323
+ return i ? [
324
+ "entity-item",
325
+ e,
326
+ r,
327
+ i
328
+ ] : [
323
329
  "entity-item",
324
330
  e,
325
- t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]])
331
+ r
326
332
  ];
327
333
  }
328
- function Ie(e, t) {
329
- let n = Fe(e, t), r = n[2];
334
+ function Ie(e, t, n = {}) {
335
+ let r = Fe(e, t, n), i = r[2];
330
336
  return _e({
331
- queryKey: n,
332
- queryFn: () => H(e, t),
333
- enabled: !!e && !!t && t !== "new" && r !== void 0
337
+ queryKey: r,
338
+ queryFn: () => H(e, t, n),
339
+ enabled: !!e && !!t && t !== "new" && i !== void 0
334
340
  });
335
341
  }
336
342
  //#endregion
@@ -368,102 +374,102 @@ function Le(e, t, n, i, a, o, s, c) {
368
374
  }
369
375
  //#endregion
370
376
  //#region src/components/actions/ActionButton.tsx
371
- function Re({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: o, variant: l = "outline", size: u = "default", onSuccess: d }) {
372
- let h = z(), g = z("errors"), [v, y] = X(!1), [b, x] = X(!1), { data: S } = L(), w = G(), { run: E } = C(), D = f(r), O = !o || k(r.conditions, o), A = q(async () => {
377
+ function Re({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: o, variant: s = "outline", size: c = "default", onSuccess: u }) {
378
+ let f = z(), h = z("errors"), [g, _] = X(!1), [v, y] = X(!1), { data: x } = L(), S = G(), { run: w } = C(), T = p(r), E = !o || D(r.conditions, o), k = q(async () => {
373
379
  if (r.association && a.length !== 0) {
374
- y(!0);
380
+ _(!0);
375
381
  try {
376
- let e = i ? `${i}.${r.association}` : r.association, t = await U(e, a), n = _(S, t.target_entity);
382
+ let e = i ? `${i}.${r.association}` : r.association, t = await U(e, a), n = b(x, t.target_entity);
377
383
  if (!n) {
378
- T.error(g("action.list_screen_missing", "No list screen is declared for this entity."), t.target_entity);
384
+ P.error(h("action.list_screen_missing", "No list screen is declared for this entity."), t.target_entity);
379
385
  return;
380
386
  }
381
- let o = S?.entities[t.target_entity], s = h(r.display?.name) || t.target_entity;
387
+ let o = x?.entities[t.target_entity], s = f(r.display?.name) || t.target_entity;
382
388
  if (t.ids.length === 0) {
383
- T.info(h("action.association.none_related", "No related {name} found", { name: s }));
389
+ P.info(f("action.association.none_related", "No related {name} found", { name: s }));
384
390
  return;
385
391
  }
386
392
  let c = o?.fields.names().find((e) => o.fields.get(e)?.primary) ?? "id", l = new URLSearchParams();
387
- l.set(`filter_${c}`, t.ids.join(",")), w(n.route, {
393
+ l.set(`filter_${c}`, t.ids.join(",")), S(n.route, {
388
394
  title: s,
389
395
  icon: r.display?.icon || n.icon,
390
396
  search: l.toString()
391
- }), d?.();
397
+ }), u?.();
392
398
  } catch (e) {
393
- T.error(ne(g, e));
399
+ P.error(ne(h, e));
394
400
  } finally {
395
- y(!1);
401
+ _(!1);
396
402
  }
397
403
  }
398
404
  }, [
405
+ f,
399
406
  h,
400
- g,
401
407
  r,
402
408
  i,
403
409
  a,
410
+ x,
404
411
  S,
405
- w,
406
- d
407
- ]), j = r.entity ? `${r.entity}.${n}` : n, N = a.length > 0 ? a : void 0, P = q(() => {
408
- x(!0), E({
412
+ u
413
+ ]), A = r.entity ? `${r.entity}.${n}` : n, M = a.length > 0 ? a : void 0, N = q(() => {
414
+ y(!0), w({
409
415
  action: r,
410
- title: h(r.display?.name) || n,
416
+ title: f(r.display?.name) || n,
411
417
  row: o,
412
418
  entity: i,
413
- execute: (e) => W(j, B(e, N)),
414
- onSuccess: () => d?.()
415
- }).finally(() => x(!1));
419
+ execute: (e) => W(A, B(e, M)),
420
+ onSuccess: () => u?.()
421
+ }).finally(() => y(!1));
416
422
  }, [
417
- h,
418
- E,
423
+ f,
424
+ w,
419
425
  r,
420
426
  n,
421
427
  o,
422
428
  i,
423
- j,
424
- N,
425
- d
429
+ A,
430
+ M,
431
+ u
426
432
  ]), F = q(() => {
427
- if (p(r)) {
428
- s(g, r.ui_steps, { row: o }).then(() => d?.());
433
+ if (m(r)) {
434
+ d(h, r.ui_steps, { row: o }).then(() => u?.());
429
435
  return;
430
436
  }
431
- if (D) {
432
- A();
437
+ if (T) {
438
+ k();
433
439
  return;
434
440
  }
435
441
  if (r.href && !r.handler && !r.association) {
436
- let e = i ? S?.entities[i] : void 0, t = M(o, e), a = r.href;
437
- i && (a = a.replaceAll("${entity}", i)), t && (a = a.replaceAll("${id}", encodeURIComponent(t))), w(a, {
438
- title: h(r.display?.name) || n,
442
+ let e = i ? x?.entities[i] : void 0, t = j(o, e), a = r.href;
443
+ i && (a = a.replaceAll("${entity}", i)), t && (a = a.replaceAll("${id}", encodeURIComponent(t))), S(a, {
444
+ title: f(r.display?.name) || n,
439
445
  icon: r.display?.icon
440
- }), d?.();
446
+ }), u?.();
441
447
  return;
442
448
  }
443
- P();
449
+ N();
444
450
  }, [
451
+ f,
445
452
  h,
446
- g,
447
453
  r,
448
454
  o,
449
455
  i,
450
- S?.entities,
456
+ x?.entities,
451
457
  n,
452
- w,
453
- D,
454
- A,
455
- P,
456
- d
457
- ]), I = h(r.display?.name), R = r.display?.icon, V = R && e[R], H = V ? /* @__PURE__ */ Q(V, { size: 13 }) : R ? /* @__PURE__ */ Q(t, {
458
+ S,
459
+ T,
460
+ k,
461
+ N,
462
+ u
463
+ ]), I = f(r.display?.name), R = r.display?.icon, V = R && e[R], H = V ? /* @__PURE__ */ Q(V, { size: 13 }) : R ? /* @__PURE__ */ Q(t, {
458
464
  name: R,
459
465
  size: 13
460
- }) : null, ee = !O || b || v;
461
- return u === "icon" ? /* @__PURE__ */ Q(c, {
466
+ }) : null, ee = !E || v || g;
467
+ return c === "icon" ? /* @__PURE__ */ Q(O, {
462
468
  icon: H ?? /* @__PURE__ */ Q(e.bolt, { size: 13 }),
463
469
  onClick: F,
464
470
  title: I
465
- }) : /* @__PURE__ */ Q(m, {
466
- kind: l === "default" ? "primary" : l === "ghost" ? "ghost" : "default",
471
+ }) : /* @__PURE__ */ Q(l, {
472
+ kind: s === "default" ? "primary" : s === "ghost" ? "ghost" : "default",
467
473
  size: "sm",
468
474
  icon: H,
469
475
  danger: r.destructive,
@@ -476,31 +482,31 @@ function Re({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: o
476
482
  }
477
483
  //#endregion
478
484
  //#region src/components/actions/RowActionsKebab.tsx
479
- function ze({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: s, size: l = 22, align: u = "end" }) {
480
- let f = z(), p = Y(null), [m, h] = X(!1), [_, v] = X(null), { run: y } = C(), b = J(() => {
485
+ function ze({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: s, size: c = 22, align: l = "end" }) {
486
+ let u = z(), d = Y(null), [f, p] = X(!1), [m, h] = X(null), { run: g } = C(), _ = J(() => {
481
487
  let e = {};
482
488
  for (let { code: n, action: r } of t) e[n] = r;
483
489
  return e;
484
- }, [t]), x = J(() => {
490
+ }, [t]), b = J(() => {
485
491
  let e = t.map(({ code: e }) => ({
486
492
  kind: "action",
487
493
  code: e,
488
494
  enabled: !0,
489
495
  reason: null
490
496
  }));
491
- return r ? g(f, e, b, void 0, r, [], oe(i, r)) : e;
497
+ return r ? v(u, e, _, void 0, r, [], oe(i, r)) : e;
492
498
  }, [
493
- f,
499
+ u,
494
500
  t,
495
- b,
501
+ _,
496
502
  r,
497
503
  i
498
- ]), S = q((e, t) => {
499
- h(!1);
504
+ ]), x = q((e, t) => {
505
+ p(!1);
500
506
  let i = t.entity ? `${t.entity}.${e}` : e;
501
- return y({
507
+ return g({
502
508
  action: t,
503
- title: f(t.display?.name) || e,
509
+ title: u(t.display?.name) || e,
504
510
  row: r,
505
511
  execute: async (e) => {
506
512
  let t = await W(i, B(e, n));
@@ -508,41 +514,41 @@ function ze({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
508
514
  }
509
515
  });
510
516
  }, [
511
- f,
512
- y,
517
+ u,
518
+ g,
513
519
  r,
514
520
  n,
515
521
  a
516
522
  ]);
517
- return !o && x.length === 0 ? null : /* @__PURE__ */ $("div", {
523
+ return !o && b.length === 0 ? null : /* @__PURE__ */ $("div", {
518
524
  className: "sl-row-actions",
519
- "data-open": m ? "true" : void 0,
525
+ "data-open": f ? "true" : void 0,
520
526
  style: {
521
527
  display: "flex",
522
528
  alignItems: "center",
523
529
  justifyContent: "flex-end"
524
530
  },
525
- children: [/* @__PURE__ */ Q(c, {
526
- ref: p,
527
- size: l,
528
- icon: /* @__PURE__ */ Q(e.more, { size: Math.round(l * .55) }),
529
- onClick: () => h((e) => !e),
530
- title: f("action.menu.title", "Actions")
531
- }), /* @__PURE__ */ $(d, {
532
- open: m,
533
- anchor: p.current,
534
- onClose: () => h(!1),
531
+ children: [/* @__PURE__ */ Q(O, {
532
+ ref: d,
533
+ size: c,
534
+ icon: /* @__PURE__ */ Q(e.more, { size: Math.round(c * .55) }),
535
+ onClick: () => p((e) => !e),
536
+ title: u("action.menu.title", "Actions")
537
+ }), /* @__PURE__ */ $(y, {
538
+ open: f,
539
+ anchor: d.current,
540
+ onClose: () => p(!1),
535
541
  width: 200,
536
- align: u,
542
+ align: l,
537
543
  children: [
538
544
  o,
539
- o && s && x.length > 0 && /* @__PURE__ */ Q(A, { divider: !0 }),
545
+ o && s && b.length > 0 && /* @__PURE__ */ Q(E, { divider: !0 }),
540
546
  /* @__PURE__ */ Q(ae, {
541
- layout: x,
542
- entityActions: b,
543
- onRun: S,
544
- loading: _,
545
- onLoadingChange: v,
547
+ layout: b,
548
+ entityActions: _,
549
+ onRun: x,
550
+ loading: m,
551
+ onLoadingChange: h,
546
552
  row: r
547
553
  })
548
554
  ]
@@ -551,73 +557,73 @@ function ze({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu
551
557
  }
552
558
  //#endregion
553
559
  //#region src/components/detail-layout/AssociatedToolbar.tsx
554
- function Be({ entity: t, searchable: n, filterFields: r, searchValue: i, onSearchChange: a, filters: o, onFilterChange: s, allEntities: c }) {
555
- let l = z(), u = n === !0, d = r && r.length > 0;
556
- return !u && !d ? null : /* @__PURE__ */ $("div", {
560
+ function Be({ entity: t, searchable: n, filterFields: r, searchValue: a, onSearchChange: o, filters: s, onFilterChange: c, allEntities: l }) {
561
+ let u = z(), d = n === !0, f = r && r.length > 0;
562
+ return !d && !f ? null : /* @__PURE__ */ $("div", {
557
563
  style: {
558
564
  display: "flex",
559
565
  alignItems: "center",
560
566
  gap: 6,
561
567
  marginBottom: 8
562
568
  },
563
- children: [u && /* @__PURE__ */ Q("div", {
569
+ children: [d && /* @__PURE__ */ Q("div", {
564
570
  style: {
565
571
  flex: 1,
566
572
  maxWidth: 220
567
573
  },
568
- children: /* @__PURE__ */ Q(b, {
569
- value: i,
570
- onChange: a,
571
- placeholder: l("record.associated.search", "Search…"),
574
+ children: /* @__PURE__ */ Q(M, {
575
+ value: a,
576
+ onChange: o,
577
+ placeholder: u("record.associated.search", "Search…"),
572
578
  prefix: /* @__PURE__ */ Q(e.search, { size: 12 })
573
579
  })
574
- }), d && r.map((e) => {
580
+ }), f && r.map((e) => {
575
581
  let n = t.fields.get(e);
576
582
  if (!n) return null;
577
- let r = o[e] ?? "__all__", i = y(l, n, e, c);
583
+ let r = s[e] ?? "__all__", a = i(u, n, e, l);
578
584
  if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ Q(Ve, {
579
585
  field: n,
580
- label: i,
586
+ label: a,
581
587
  value: r,
582
- onChange: (t) => s(e, t)
588
+ onChange: (t) => c(e, t)
583
589
  }, e);
584
590
  if (!n.values) return null;
585
- let a = [{
591
+ let o = [{
586
592
  value: "__all__",
587
- label: l("record.associated.filter_all", "All {name}", { name: i })
593
+ label: u("record.associated.filter_all", "All {name}", { name: a })
588
594
  }, ...n.values.map((e) => ({
589
595
  value: e.code,
590
- label: l(e.name) || e.code
596
+ label: u(e.name) || e.code
591
597
  }))];
592
598
  return /* @__PURE__ */ Q("div", {
593
599
  style: { width: 160 },
594
- children: /* @__PURE__ */ Q(v, {
600
+ children: /* @__PURE__ */ Q(A, {
595
601
  value: r,
596
- options: a,
597
- onChange: (t) => s(e, t),
598
- placeholder: i
602
+ options: o,
603
+ onChange: (t) => c(e, t),
604
+ placeholder: a
599
605
  })
600
606
  }, e);
601
607
  })]
602
608
  });
603
609
  }
604
610
  function Ve({ field: e, label: t, value: n, onChange: r }) {
605
- let a = z(), o = N(e.ref?.entity), s = e.display?.ref_display_field ?? o?.display?.display_field, c = J(() => o ? [...o.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [o]), { data: l } = i(e.ref?.entity, {
611
+ let i = z(), a = w(e.ref?.entity), o = e.display?.ref_display_field ?? a?.display?.display_field, s = J(() => a ? [...a.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [a]), { data: l } = c(e.ref?.entity, {
606
612
  per_page: 200,
607
- sort: s ? `${s}:asc` : void 0
608
- }), u = l?.data ?? [], d = (e) => e == null ? "—" : typeof e == "object" && !Array.isArray(e) ? a(e) || "—" : w(e), f = [{
613
+ sort: o ? `${o}:asc` : void 0
614
+ }), u = l?.data ?? [], d = (e) => e == null ? "—" : typeof e == "object" && !Array.isArray(e) ? i(e) || "—" : _(e), f = [{
609
615
  value: "__all__",
610
- label: a("record.associated.filter_all", "All {name}", { name: t })
616
+ label: i("record.associated.filter_all", "All {name}", { name: t })
611
617
  }, ...u.map((e) => {
612
- let t = String(e[c]), n = e[E];
618
+ let t = String(e[s]), n = e[N];
613
619
  return {
614
620
  value: t,
615
- label: typeof n == "string" && n !== "" ? n : s ? d(e[s] ?? t) : t
621
+ label: typeof n == "string" && n !== "" ? n : o ? d(e[o] ?? t) : t
616
622
  };
617
623
  })];
618
624
  return /* @__PURE__ */ Q("div", {
619
625
  style: { width: 160 },
620
- children: /* @__PURE__ */ Q(v, {
626
+ children: /* @__PURE__ */ Q(A, {
621
627
  value: n,
622
628
  options: f,
623
629
  onChange: r,
@@ -685,7 +691,7 @@ function We(e, t, n) {
685
691
  return null;
686
692
  }
687
693
  function Ge(e, t, n) {
688
- let r = new Set(P(e));
694
+ let r = new Set(T(e));
689
695
  return new Set(t.filter((t) => {
690
696
  if (t === n || r.has(t)) return !1;
691
697
  let i = e.fields.get(t);
@@ -747,28 +753,28 @@ function Je({ node: e, ctx: t }) {
747
753
  ]
748
754
  });
749
755
  }
750
- function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
751
- let c = z(), l = z("errors"), u = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== s && !!o.fields.get(e)) : o.fields.names().filter((e) => {
752
- if (e === s) return !1;
753
- let t = o.fields.get(e);
756
+ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
757
+ let c = z(), u = z("errors"), d = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== o && !!a.fields.get(e)) : a.fields.names().filter((e) => {
758
+ if (e === o) return !1;
759
+ let t = a.fields.get(e);
754
760
  return !(!t || t.primary || t.display?.is_listable === !1);
755
- }), d = S(o, "update"), f = n.interaction ?? (d ? "navigate" : "readonly"), p = (f === "inline_edit" || f === "row_edit") && d && n.editable !== !1, h = c(o.display?.name_plural) || c(o.display?.name) || i, _ = n.searchable === !0 || n.filters && n.filters.length > 0, v = J(() => Ue(o.actions, s, r.recordId), [
756
- o.actions,
757
- s,
761
+ }), f = g(a, "update"), p = n.interaction ?? (f ? "navigate" : "readonly"), m = (p === "inline_edit" || p === "row_edit") && f && n.editable !== !1, h = c(a.display?.name_plural) || c(a.display?.name) || i, _ = n.searchable === !0 || n.filters && n.filters.length > 0, y = J(() => Ue(a.actions, o, r.recordId), [
762
+ a.actions,
763
+ o,
758
764
  r.recordId
759
- ]), y = J(() => {
765
+ ]), b = J(() => {
760
766
  let e = {};
761
- for (let { code: t, action: n } of v) e[t] = n;
767
+ for (let { code: t, action: n } of y) e[t] = n;
762
768
  return e;
763
- }, [v]), b = J(() => {
764
- let e = o.action_layout ?? null;
765
- return g(c, e ?? a(y, "list_toolbar"), y, void 0, {}, []);
769
+ }, [y]), x = J(() => {
770
+ let e = a.action_layout ?? null;
771
+ return v(c, e ?? s(b, "list_toolbar"), b, void 0, {}, []);
766
772
  }, [
767
773
  c,
768
- o.action_layout,
769
- y
770
- ]), { run: x } = C(), w = G(), T = J(() => ({
771
- entity: o,
774
+ a.action_layout,
775
+ b
776
+ ]), { run: S } = C(), w = G(), T = J(() => ({
777
+ entity: a,
772
778
  entityCode: i,
773
779
  screenRoute: typeof window < "u" ? window.location.pathname : "",
774
780
  selectedRows: [],
@@ -781,7 +787,7 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
781
787
  }),
782
788
  runActionApi: (e, t) => W(e, t)
783
789
  }), [
784
- o,
790
+ a,
785
791
  i,
786
792
  c,
787
793
  w
@@ -791,8 +797,8 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
791
797
  return t[0] === "entity-children" && t[3] === i;
792
798
  } });
793
799
  }, [E, i]), O = q((e, t) => {
794
- let n = se(l, e, t, {}, i);
795
- if (n !== null) return x({
800
+ let n = se(u, e, t, {}, i);
801
+ if (n !== null) return S({
796
802
  action: t,
797
803
  title: c(t.display?.name) || e,
798
804
  execute: async (e) => {
@@ -802,8 +808,8 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
802
808
  });
803
809
  }, [
804
810
  c,
805
- l,
806
- x,
811
+ u,
812
+ S,
807
813
  i,
808
814
  D
809
815
  ]), [k, A] = X(0), j = /* @__PURE__ */ $("div", {
@@ -815,21 +821,21 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
815
821
  minWidth: 0,
816
822
  justifyContent: "flex-end"
817
823
  },
818
- children: [o.action_layout ? b.length > 0 && /* @__PURE__ */ Q(ie, {
824
+ children: [a.action_layout ? x.length > 0 && /* @__PURE__ */ Q(ie, {
819
825
  kind: "toolbar",
820
- layout: b,
821
- entityActions: y,
826
+ layout: x,
827
+ entityActions: b,
822
828
  onRun: O,
823
829
  widgetContext: T,
824
830
  ariaLabel: c("record.associated.toolbar_actions", "{name} toolbar actions", { name: h })
825
- }) : v.map(({ code: e, action: t }) => /* @__PURE__ */ Q(Re, {
831
+ }) : y.map(({ code: e, action: t }) => /* @__PURE__ */ Q(Re, {
826
832
  actionCode: e,
827
833
  action: t,
828
834
  entityCode: i,
829
835
  variant: "ghost",
830
836
  size: "sm",
831
837
  onSuccess: D
832
- }, e)), p && /* @__PURE__ */ Q(m, {
838
+ }, e)), m && /* @__PURE__ */ Q(l, {
833
839
  kind: "ghost",
834
840
  size: "xs",
835
841
  icon: /* @__PURE__ */ Q(e.plus, { size: 12 }),
@@ -838,13 +844,13 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
838
844
  })]
839
845
  }), M = _ ? /* @__PURE__ */ Q(Ze, {
840
846
  entityCode: i,
841
- entity: o,
847
+ entity: a,
842
848
  parentEntity: r.entityCode,
843
849
  parentId: r.recordId,
844
- foreignKey: s,
845
- columns: u,
846
- editable: p,
847
- interaction: f,
850
+ foreignKey: o,
851
+ columns: d,
852
+ editable: m,
853
+ interaction: p,
848
854
  ctx: r,
849
855
  searchable: n.searchable,
850
856
  filterFields: n.filters,
@@ -852,13 +858,13 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
852
858
  startDraftSignal: k
853
859
  }) : /* @__PURE__ */ Q(Xe, {
854
860
  entityCode: i,
855
- entity: o,
861
+ entity: a,
856
862
  parentEntity: r.entityCode,
857
863
  parentId: r.recordId,
858
- foreignKey: s,
859
- columns: u,
860
- editable: p,
861
- interaction: f,
864
+ foreignKey: o,
865
+ columns: d,
866
+ editable: m,
867
+ interaction: p,
862
868
  ctx: r,
863
869
  sort: n.sort,
864
870
  startDraftSignal: k
@@ -872,16 +878,16 @@ function Ye({ node: n, ctx: r, assocCode: i, assocEntity: o, fkField: s }) {
872
878
  children: j
873
879
  }), M] }) : /* @__PURE__ */ Q(Se, {
874
880
  title: h,
875
- icon: o.display?.icon ? /* @__PURE__ */ Q(t, {
876
- name: o.display.icon,
881
+ icon: a.display?.icon ? /* @__PURE__ */ Q(t, {
882
+ name: a.display.icon,
877
883
  size: 14
878
884
  }) : void 0,
879
885
  right: j,
880
886
  children: M
881
887
  });
882
888
  }
883
- function Xe({ entityCode: e, entity: t, parentEntity: n, parentId: i, foreignKey: a, columns: o, editable: s, interaction: c, ctx: u, sort: d, startDraftSignal: f }) {
884
- let p = Z(), { data: m, isLoading: h, isError: g } = l(n, i, e, a, d), _ = m?.data ?? [], v = m?.$refs, y = q(() => {
889
+ function Xe({ entityCode: e, entity: t, parentEntity: n, parentId: i, foreignKey: a, columns: o, editable: s, interaction: c, ctx: l, sort: u, startDraftSignal: d }) {
890
+ let p = Z(), { data: m, isLoading: h, isError: g } = f(n, i, e, a, u), _ = m?.data ?? [], v = m?.$refs, y = q(() => {
885
891
  p.invalidateQueries({ queryKey: [
886
892
  r,
887
893
  n,
@@ -902,24 +908,24 @@ function Xe({ entityCode: e, entity: t, parentEntity: n, parentId: i, foreignKey
902
908
  columns: o,
903
909
  editable: s,
904
910
  interaction: c,
905
- ctx: u,
911
+ ctx: l,
906
912
  rows: _,
907
913
  refs: v,
908
914
  isLoading: h,
909
915
  isError: g,
910
916
  invalidateQuery: y,
911
- startDraftSignal: f
917
+ startDraftSignal: d
912
918
  });
913
919
  }
914
- function Ze({ 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 }) {
915
- let p = z(), h = Z(), [g, _] = X(""), [v, y] = X(""), [b, x] = X({}), S = Y(void 0);
916
- pe(() => (S.current && clearTimeout(S.current), S.current = setTimeout(() => {
920
+ function Ze({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: u, filterFields: d, sort: f, startDraftSignal: p }) {
921
+ let m = z(), h = Z(), [g, _] = X(""), [v, y] = X(""), [b, S] = X({}), C = Y(void 0);
922
+ pe(() => (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
917
923
  y(g);
918
924
  }, 300), () => {
919
- S.current && clearTimeout(S.current);
925
+ C.current && clearTimeout(C.current);
920
926
  }), [g]);
921
- let C = q((e, t) => {
922
- x((n) => {
927
+ let w = q((e, t) => {
928
+ S((n) => {
923
929
  if (t === "__all__") {
924
930
  let { [e]: t, ...r } = n;
925
931
  return r;
@@ -929,13 +935,13 @@ function Ze({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
929
935
  [e]: t
930
936
  };
931
937
  });
932
- }, []), w = J(() => Object.keys(b).length > 0 ? b : void 0, [b]), { data: T, isLoading: E, isError: O, hasNextPage: k, fetchNextPage: A, isFetchingNextPage: j } = Le(n, r, e, i, d, void 0, v || void 0, w), { rows: M, refs: N } = J(() => {
933
- if (!T?.pages) return {
938
+ }, []), T = J(() => Object.keys(b).length > 0 ? b : void 0, [b]), { data: E, isLoading: D, isError: O, hasNextPage: k, fetchNextPage: A, isFetchingNextPage: j } = Le(n, r, e, i, f, void 0, v || void 0, T), { rows: M, refs: N } = J(() => {
939
+ if (!E?.pages) return {
934
940
  rows: [],
935
941
  refs: void 0
936
942
  };
937
943
  let e = [], t;
938
- for (let n of T.pages) if (e.push(...n.data), n.$refs) {
944
+ for (let n of E.pages) if (e.push(...n.data), n.$refs) {
939
945
  if (!t) t = { ...n.$refs };
940
946
  else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
941
947
  ...t[e],
@@ -946,7 +952,7 @@ function Ze({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
946
952
  rows: e,
947
953
  refs: t
948
954
  };
949
- }, [T]), P = q(() => {
955
+ }, [E]), P = q(() => {
950
956
  h.invalidateQueries({ predicate: (t) => {
951
957
  let n = t.queryKey;
952
958
  return n[0] === "entity-children" && n[3] === e;
@@ -955,12 +961,12 @@ function Ze({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
955
961
  return /* @__PURE__ */ $("div", { children: [
956
962
  /* @__PURE__ */ Q(Be, {
957
963
  entity: t,
958
- searchable: l,
959
- filterFields: u,
964
+ searchable: u,
965
+ filterFields: d,
960
966
  searchValue: g,
961
967
  onSearchChange: _,
962
968
  filters: b,
963
- onFilterChange: C,
969
+ onFilterChange: w,
964
970
  allEntities: c.schema.entities
965
971
  }),
966
972
  /* @__PURE__ */ Q(Qe, {
@@ -974,53 +980,53 @@ function Ze({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
974
980
  ctx: c,
975
981
  rows: M,
976
982
  refs: N,
977
- isLoading: E,
983
+ isLoading: D,
978
984
  isError: O,
979
985
  invalidateQuery: P,
980
- startDraftSignal: f
986
+ startDraftSignal: p
981
987
  }),
982
988
  k && /* @__PURE__ */ Q("div", {
983
989
  style: { marginTop: 4 },
984
- children: /* @__PURE__ */ Q(m, {
990
+ children: /* @__PURE__ */ Q(l, {
985
991
  kind: "ghost",
986
992
  size: "xs",
987
- icon: j ? /* @__PURE__ */ Q(D, { size: 12 }) : void 0,
993
+ icon: j ? /* @__PURE__ */ Q(x, { size: 12 }) : void 0,
988
994
  onClick: () => A(),
989
995
  disabled: j,
990
- children: p("record.associated.load_more", "Load more")
996
+ children: m("record.associated.load_more", "Load more")
991
997
  })
992
998
  })
993
999
  ] });
994
1000
  }
995
- function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: s, rows: c, refs: l, isLoading: u, isError: d, invalidateQuery: f, startDraftSignal: p }) {
996
- let m = z(), g = z("errors"), _ = O(), v = _.isPhone && s.relatedRecordsPresentation === "table", b = i.find((e) => e !== r), S = J(() => o === "navigate" ? h(void 0, t, s.schema.screens) : null, [
997
- o,
1001
+ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: s, editable: c, interaction: l, ctx: u, rows: d, refs: f, isLoading: p, isError: m, invalidateQuery: h, startDraftSignal: g }) {
1002
+ let _ = z(), v = z("errors"), y = S(), b = y.isPhone && u.relatedRecordsPresentation === "table", x = s.find((e) => e !== r), w = J(() => l === "navigate" ? o(void 0, t, u.schema.screens) : null, [
1003
+ l,
998
1004
  t,
999
- s.schema.screens
1000
- ]), w = J(() => a ? Ge(t, i, r) : /* @__PURE__ */ new Set(), [
1001
- i,
1005
+ u.schema.screens
1006
+ ]), T = J(() => c ? Ge(t, s, r) : /* @__PURE__ */ new Set(), [
1007
+ s,
1002
1008
  r,
1003
1009
  t,
1004
- a
1005
- ]), T = J(() => Ke(t, i, r), [
1006
- i,
1010
+ c
1011
+ ]), E = J(() => Ke(t, s, r), [
1012
+ s,
1007
1013
  r,
1008
1014
  t
1009
- ]), E = J(() => {
1015
+ ]), D = J(() => {
1010
1016
  let e = /* @__PURE__ */ new Map();
1011
- for (let n of c) {
1012
- let r = x(t, n);
1017
+ for (let n of d) {
1018
+ let r = a(t, n);
1013
1019
  e.set(V(r), r);
1014
1020
  }
1015
1021
  return e;
1016
- }, [c, t]), D = J(() => {
1022
+ }, [d, t]), O = J(() => {
1017
1023
  let e = /* @__PURE__ */ new Map();
1018
- for (let n of c) {
1024
+ for (let n of d) {
1019
1025
  let r = n.$row_version;
1020
- typeof r == "string" && r !== "" && e.set(V(x(t, n)), r);
1026
+ typeof r == "string" && r !== "" && e.set(V(a(t, n)), r);
1021
1027
  }
1022
1028
  return e;
1023
- }, [c, t]), k = J(() => He(t.actions), [t.actions]), [A, j] = X(null), [M, N] = X(null), [P, F] = X([]), [I, L] = X({}), R = Y(I);
1029
+ }, [d, t]), k = J(() => He(t.actions), [t.actions]), [A, j] = X(null), [M, N] = X(null), [P, F] = X([]), [I, L] = X({}), R = Y(I);
1024
1030
  R.current = I;
1025
1031
  let B = Y({});
1026
1032
  pe(() => {
@@ -1039,11 +1045,11 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1039
1045
  }
1040
1046
  }));
1041
1047
  try {
1042
- let i = D.get(t), a = i ? {
1048
+ let i = O.get(t), a = i ? {
1043
1049
  ...n,
1044
1050
  $row_version: i
1045
1051
  } : n;
1046
- return await re(e, E.get(t) ?? t, a), L((e) => {
1052
+ return await re(e, D.get(t) ?? t, a), L((e) => {
1047
1053
  let n = e[t];
1048
1054
  if (!n) return e;
1049
1055
  if (n.ver > r) return {
@@ -1055,9 +1061,9 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1055
1061
  };
1056
1062
  let { [t]: i, ...a } = e;
1057
1063
  return a;
1058
- }), f(), !0;
1064
+ }), h(), !0;
1059
1065
  } catch (e) {
1060
- let n = ne(g, e);
1066
+ let n = ne(v, e);
1061
1067
  return L((e) => ({
1062
1068
  ...e,
1063
1069
  [t]: {
@@ -1069,10 +1075,10 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1069
1075
  }
1070
1076
  }, [
1071
1077
  e,
1072
- g,
1073
- f,
1074
- E,
1075
- D
1078
+ v,
1079
+ h,
1080
+ D,
1081
+ O
1076
1082
  ]), de = q((e, t, n) => {
1077
1083
  L((r) => {
1078
1084
  let i = r[e] ?? {
@@ -1091,14 +1097,14 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1091
1097
  ver: a
1092
1098
  }
1093
1099
  };
1094
- }), o === "inline_edit" && (B.current[e] && clearTimeout(B.current[e]), B.current[e] = setTimeout(() => {
1100
+ }), l === "inline_edit" && (B.current[e] && clearTimeout(B.current[e]), B.current[e] = setTimeout(() => {
1095
1101
  let t = R.current[e];
1096
1102
  t && Object.keys(t.buffer).length > 0 && K(e, { ...t.buffer }, t.ver);
1097
1103
  }, 500));
1098
- }, [K, o]), fe = q(() => {
1104
+ }, [K, l]), fe = q(() => {
1099
1105
  let e = {};
1100
1106
  e[r] = n;
1101
- for (let n of i) {
1107
+ for (let n of s) {
1102
1108
  let r = t.fields.get(n);
1103
1109
  r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
1104
1110
  }
@@ -1106,61 +1112,61 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1106
1112
  }, [
1107
1113
  r,
1108
1114
  n,
1109
- i,
1115
+ s,
1110
1116
  t.fields
1111
- ]), me = Y(p);
1117
+ ]), me = Y(g);
1112
1118
  pe(() => {
1113
- p !== void 0 && p !== me.current && (me.current = p, !H && fe());
1119
+ g !== void 0 && g !== me.current && (me.current = g, !H && fe());
1114
1120
  }, [
1115
- p,
1121
+ g,
1116
1122
  H,
1117
1123
  fe
1118
1124
  ]);
1119
1125
  let he = q(async () => {
1120
1126
  if (!H) return;
1121
- let n = qe(H, i, t, r);
1127
+ let n = qe(H, s, t, r);
1122
1128
  if (n.length > 0) {
1123
1129
  G(n);
1124
1130
  return;
1125
1131
  }
1126
1132
  ae(!0);
1127
1133
  try {
1128
- await ee(e, H), U(null), G([]), f();
1134
+ await ee(e, H), U(null), G([]), h();
1129
1135
  } catch (e) {
1130
- let t = ne(g, e);
1136
+ let t = ne(v, e);
1131
1137
  G([`_error:${t}`]);
1132
1138
  } finally {
1133
1139
  ae(!1);
1134
1140
  }
1135
1141
  }, [
1136
1142
  H,
1137
- i,
1143
+ s,
1138
1144
  t,
1139
1145
  r,
1140
1146
  e,
1141
- g,
1142
- f
1147
+ v,
1148
+ h
1143
1149
  ]), ge = q((e) => {
1144
1150
  L({}), F([]), N(e);
1145
1151
  }, []), _e = q(async (e) => {
1146
- let n = R.current[e], a = n?.buffer ?? {};
1147
- if (Object.keys(a).length === 0) {
1152
+ let n = R.current[e], i = n?.buffer ?? {};
1153
+ if (Object.keys(i).length === 0) {
1148
1154
  N(null), F([]);
1149
1155
  return;
1150
1156
  }
1151
1157
  let o = qe({
1152
- ...c.find((n) => V(x(t, n)) === e) ?? {},
1153
- ...a
1154
- }, i, t, r);
1158
+ ...d.find((n) => V(a(t, n)) === e) ?? {},
1159
+ ...i
1160
+ }, s, t, r);
1155
1161
  if (o.length > 0) {
1156
1162
  F(o);
1157
1163
  return;
1158
1164
  }
1159
- await K(e, { ...a }, n?.ver ?? 0) && (N(null), F([]));
1165
+ await K(e, { ...i }, n?.ver ?? 0) && (N(null), F([]));
1160
1166
  }, [
1161
- c,
1167
+ d,
1162
1168
  t,
1163
- i,
1169
+ s,
1164
1170
  r,
1165
1171
  K
1166
1172
  ]), Z = q((e) => {
@@ -1170,11 +1176,11 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1170
1176
  return r;
1171
1177
  }), F([]), N(null);
1172
1178
  }, []), ve = q((n, r) => {
1173
- let i = E.get(n) ?? n;
1179
+ let i = D.get(n) ?? n;
1174
1180
  return oe({
1175
1181
  action: t.actions?.__delete,
1176
1182
  destructive: !0,
1177
- title: m(t.display?.name) || m("record.action.delete", "Delete"),
1183
+ title: _(t.display?.name) || _("record.action.delete", "Delete"),
1178
1184
  row: r,
1179
1185
  entity: e,
1180
1186
  execute: async () => {
@@ -1188,25 +1194,25 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1188
1194
  });
1189
1195
  }
1190
1196
  },
1191
- onSuccess: () => f()
1197
+ onSuccess: () => h()
1192
1198
  });
1193
1199
  }, [
1194
- m,
1200
+ _,
1195
1201
  oe,
1196
1202
  t,
1197
1203
  e,
1198
- f,
1199
- E
1204
+ h,
1205
+ D
1200
1206
  ]);
1201
- if (d) return /* @__PURE__ */ Q("div", {
1207
+ if (m) return /* @__PURE__ */ Q("div", {
1202
1208
  style: {
1203
1209
  fontSize: 12.5,
1204
1210
  color: "var(--danger)",
1205
1211
  padding: "8px 0"
1206
1212
  },
1207
- children: g("record.related_rows_unreadable", "The related records could not be loaded.")
1213
+ children: v("record.related_rows_unreadable", "The related records could not be loaded.")
1208
1214
  });
1209
- if (u) return /* @__PURE__ */ $("div", {
1215
+ if (p) return /* @__PURE__ */ $("div", {
1210
1216
  style: {
1211
1217
  display: "flex",
1212
1218
  flexDirection: "column",
@@ -1223,55 +1229,55 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1223
1229
  borderRadius: 6
1224
1230
  } })]
1225
1231
  });
1226
- let ye = c.length === 0 && !H;
1227
- return _.isPhone && !v ? /* @__PURE__ */ $("div", { children: [ye && !a && /* @__PURE__ */ Q("div", {
1232
+ let ye = d.length === 0 && !H;
1233
+ return y.isPhone && !b ? /* @__PURE__ */ $("div", { children: [ye && !c && /* @__PURE__ */ Q("div", {
1228
1234
  style: {
1229
1235
  fontSize: 12.5,
1230
1236
  color: "var(--text-3)",
1231
1237
  padding: "12px 0"
1232
1238
  },
1233
- children: m("record.related.empty", "No records yet.")
1234
- }), (!ye || a) && /* @__PURE__ */ $("div", {
1239
+ children: _("record.related.empty", "No records yet.")
1240
+ }), (!ye || c) && /* @__PURE__ */ $("div", {
1235
1241
  style: {
1236
1242
  display: "flex",
1237
1243
  flexDirection: "column",
1238
1244
  gap: 10
1239
1245
  },
1240
- children: [c.map((n) => {
1241
- let r = V(x(t, n)), c = se.has(r), u = I[r], d = S && r ? S.replace(/:\w+/, r) : void 0;
1246
+ children: [d.map((n) => {
1247
+ let r = V(a(t, n)), i = se.has(r), o = I[r], d = w && r ? w.replace(/:\w+/, r) : void 0;
1242
1248
  return /* @__PURE__ */ Q($e, {
1243
1249
  rowId: r,
1244
1250
  row: n,
1245
1251
  entity: t,
1246
- entities: s.schema.entities,
1247
- screens: s.schema.screens,
1248
- columns: i,
1249
- editableColumns: w,
1250
- editable: a,
1251
- interaction: o,
1252
+ entities: u.schema.entities,
1253
+ screens: u.schema.screens,
1254
+ columns: s,
1255
+ editableColumns: T,
1256
+ editable: c,
1257
+ interaction: l,
1252
1258
  isEditing: M === r,
1253
1259
  editErrors: P,
1254
- isDeleting: c,
1260
+ isDeleting: i,
1255
1261
  activeCell: A,
1256
1262
  setActiveCell: j,
1257
- rowState: u,
1263
+ rowState: o,
1258
1264
  onCellChange: de,
1259
1265
  onDeleteClick: (e) => void ve(e, n),
1260
1266
  onStartEdit: ge,
1261
1267
  onConfirmEdit: _e,
1262
1268
  onCancelEdit: Z,
1263
- refs: l,
1264
- identityCol: b,
1269
+ refs: f,
1270
+ identityCol: x,
1265
1271
  href: d,
1266
1272
  rowActions: k,
1267
1273
  entityCode: e,
1268
- onRowActionSuccess: f
1274
+ onRowActionSuccess: h
1269
1275
  }, r);
1270
1276
  }), H && /* @__PURE__ */ Q(it, {
1271
1277
  draftRow: H,
1272
1278
  entity: t,
1273
- columns: i,
1274
- editableColumns: T,
1279
+ columns: s,
1280
+ editableColumns: E,
1275
1281
  foreignKey: r,
1276
1282
  draftErrors: W,
1277
1283
  draftSaving: ie,
@@ -1283,70 +1289,70 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1283
1289
  onCancel: () => {
1284
1290
  U(null), G([]);
1285
1291
  },
1286
- refs: l
1292
+ refs: f
1287
1293
  })]
1288
- })] }) : /* @__PURE__ */ $("div", { children: [ye && !a && /* @__PURE__ */ Q("div", {
1294
+ })] }) : /* @__PURE__ */ $("div", { children: [ye && !c && /* @__PURE__ */ Q("div", {
1289
1295
  style: {
1290
1296
  fontSize: 12.5,
1291
1297
  color: "var(--text-3)",
1292
1298
  padding: "12px 0"
1293
1299
  },
1294
- children: m("record.related.empty", "No records yet.")
1295
- }), (!ye || a) && /* @__PURE__ */ Q("div", {
1300
+ children: _("record.related.empty", "No records yet.")
1301
+ }), (!ye || c) && /* @__PURE__ */ Q("div", {
1296
1302
  style: { overflowX: "auto" },
1297
1303
  children: /* @__PURE__ */ $("table", {
1298
1304
  style: le,
1299
1305
  children: [/* @__PURE__ */ Q("thead", { children: /* @__PURE__ */ $("tr", { children: [
1300
- i.map((e) => {
1306
+ s.map((e) => {
1301
1307
  let n = t.fields.get(e);
1302
1308
  return /* @__PURE__ */ Q("th", {
1303
1309
  style: ce,
1304
- children: n ? y(m, n, e, s.schema.entities) : e
1310
+ children: n ? i(_, n, e, u.schema.entities) : e
1305
1311
  }, e);
1306
1312
  }),
1307
- a && /* @__PURE__ */ Q("th", { style: {
1313
+ c && /* @__PURE__ */ Q("th", { style: {
1308
1314
  height: 30,
1309
1315
  width: 72
1310
1316
  } }),
1311
- !a && k.length > 0 && /* @__PURE__ */ Q("th", { style: {
1317
+ !c && k.length > 0 && /* @__PURE__ */ Q("th", { style: {
1312
1318
  height: 30,
1313
1319
  width: 40
1314
1320
  } })
1315
- ] }) }), /* @__PURE__ */ $("tbody", { children: [c.map((n) => {
1316
- let r = V(x(t, n)), c = se.has(r), u = I[r], d = S && r ? S.replace(/:\w+/, r) : void 0;
1321
+ ] }) }), /* @__PURE__ */ $("tbody", { children: [d.map((n) => {
1322
+ let r = V(a(t, n)), i = se.has(r), o = I[r], d = w && r ? w.replace(/:\w+/, r) : void 0;
1317
1323
  return /* @__PURE__ */ Q(et, {
1318
1324
  rowId: r,
1319
1325
  row: n,
1320
1326
  entity: t,
1321
- entities: s.schema.entities,
1322
- screens: s.schema.screens,
1323
- columns: i,
1324
- editableColumns: w,
1325
- editable: a,
1326
- interaction: o,
1327
+ entities: u.schema.entities,
1328
+ screens: u.schema.screens,
1329
+ columns: s,
1330
+ editableColumns: T,
1331
+ editable: c,
1332
+ interaction: l,
1327
1333
  isEditing: M === r,
1328
1334
  editErrors: P,
1329
- isDeleting: c,
1335
+ isDeleting: i,
1330
1336
  activeCell: A,
1331
1337
  setActiveCell: j,
1332
- rowState: u,
1338
+ rowState: o,
1333
1339
  onCellChange: de,
1334
1340
  onDeleteClick: (e) => void ve(e, n),
1335
1341
  onStartEdit: ge,
1336
1342
  onConfirmEdit: _e,
1337
1343
  onCancelEdit: Z,
1338
- refs: l,
1339
- identityCol: b,
1344
+ refs: f,
1345
+ identityCol: x,
1340
1346
  href: d,
1341
1347
  rowActions: k,
1342
1348
  entityCode: e,
1343
- onRowActionSuccess: f
1349
+ onRowActionSuccess: h
1344
1350
  }, r);
1345
1351
  }), H && /* @__PURE__ */ Q(rt, {
1346
1352
  draftRow: H,
1347
1353
  entity: t,
1348
- columns: i,
1349
- editableColumns: T,
1354
+ columns: s,
1355
+ editableColumns: E,
1350
1356
  foreignKey: r,
1351
1357
  draftErrors: W,
1352
1358
  draftSaving: ie,
@@ -1358,29 +1364,29 @@ function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i,
1358
1364
  onCancel: () => {
1359
1365
  U(null), G([]);
1360
1366
  },
1361
- refs: l
1367
+ refs: f
1362
1368
  })] })]
1363
1369
  })
1364
1370
  })] });
1365
1371
  }
1366
- function $e({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o, editableColumns: s, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: p, rowState: m, onCellChange: h, onDeleteClick: g, onStartEdit: _, onConfirmEdit: v, onCancelEdit: b, refs: x, identityCol: S, href: C, rowActions: T, onRowActionSuccess: E }) {
1367
- let O = z(), k = me(), A = J(() => !m || Object.keys(m.buffer).length === 0 ? n : {
1372
+ function $e({ rowId: t, 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: g, onStartEdit: v, onConfirmEdit: y, onCancelEdit: b, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
1373
+ let D = z(), A = me(), j = J(() => !m || Object.keys(m.buffer).length === 0 ? n : {
1368
1374
  ...n,
1369
1375
  ...m.buffer
1370
1376
  }, [n, m]);
1371
1377
  if (u === "row_edit" && d) {
1372
1378
  let e = m?.error ? [...f, `_error:${m.error}`] : f;
1373
1379
  return /* @__PURE__ */ Q(nt, {
1374
- values: A,
1380
+ values: j,
1375
1381
  entity: r,
1376
- columns: o,
1377
- editableColumns: s,
1382
+ columns: s,
1383
+ editableColumns: c,
1378
1384
  errors: e,
1379
1385
  saving: m?.saving ?? !1,
1380
1386
  onChange: (e, n) => h(t, e, n),
1381
- onConfirm: () => v(t),
1387
+ onConfirm: () => y(t),
1382
1388
  onCancel: () => b(t),
1383
- refs: x
1389
+ refs: S
1384
1390
  });
1385
1391
  }
1386
1392
  return /* @__PURE__ */ $("div", {
@@ -1398,27 +1404,27 @@ function $e({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1398
1404
  flexDirection: "column",
1399
1405
  gap: 12
1400
1406
  },
1401
- children: o.map((e) => {
1402
- let n = r.fields.get(e), o = l && u === "inline_edit" && s.has(e), c = C && e === S, d = n ? y(O, n, e, i) : e, f = `${k}-${t}-${e}`, p = `${f}-label`, m = {
1407
+ children: s.map((e) => {
1408
+ let n = r.fields.get(e), s = l && u === "inline_edit" && c.has(e), d = w && e === C, f = n ? i(D, n, e, a) : e, p = `${A}-${t}-${e}`, m = `${p}-label`, g = {
1403
1409
  fontSize: 11.5,
1404
1410
  fontWeight: 600,
1405
1411
  color: "var(--text-3)"
1406
- }, g = n ? j({
1412
+ }, v = n ? k({
1407
1413
  field: n,
1408
1414
  fieldName: e,
1409
- value: A[e],
1410
- mode: o ? "edit" : "display",
1411
- onChange: o ? (n) => h(t, e, n) : void 0,
1412
- record: A,
1413
- refs: x,
1414
- compact: o,
1415
+ value: j[e],
1416
+ mode: s ? "edit" : "display",
1417
+ onChange: s ? (n) => h(t, e, n) : void 0,
1418
+ record: j,
1419
+ refs: S,
1420
+ compact: s,
1415
1421
  entity: r,
1416
- entities: i,
1417
- screens: c ? void 0 : a,
1418
- fieldId: f,
1419
- labelId: p,
1420
- t: O
1421
- }) : w(A[e]);
1422
+ entities: a,
1423
+ screens: d ? void 0 : o,
1424
+ fieldId: p,
1425
+ labelId: m,
1426
+ t: D
1427
+ }) : _(j[e]);
1422
1428
  return /* @__PURE__ */ $("div", {
1423
1429
  style: {
1424
1430
  display: "flex",
@@ -1426,26 +1432,26 @@ function $e({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1426
1432
  gap: 5,
1427
1433
  minWidth: 0
1428
1434
  },
1429
- children: [o && n ? /* @__PURE__ */ Q("label", {
1430
- id: p,
1431
- htmlFor: f,
1432
- style: m,
1433
- children: d
1435
+ children: [s && n ? /* @__PURE__ */ Q("label", {
1436
+ id: m,
1437
+ htmlFor: p,
1438
+ style: g,
1439
+ children: f
1434
1440
  }) : /* @__PURE__ */ Q("div", {
1435
- id: p,
1436
- style: m,
1437
- children: d
1441
+ id: m,
1442
+ style: g,
1443
+ children: f
1438
1444
  }), /* @__PURE__ */ Q("div", {
1439
1445
  style: { minWidth: 0 },
1440
- children: c && !o ? /* @__PURE__ */ Q("a", {
1441
- href: C,
1446
+ children: d && !s ? /* @__PURE__ */ Q("a", {
1447
+ href: w,
1442
1448
  style: {
1443
1449
  color: "var(--accent)",
1444
1450
  textDecoration: "none",
1445
1451
  fontWeight: 500
1446
1452
  },
1447
- children: g
1448
- }) : g
1453
+ children: v
1454
+ }) : v
1449
1455
  })]
1450
1456
  }, e);
1451
1457
  })
@@ -1460,7 +1466,7 @@ function $e({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1460
1466
  gap: 6
1461
1467
  },
1462
1468
  children: [l && /* @__PURE__ */ $(ve, { children: [
1463
- m?.saving && /* @__PURE__ */ Q(D, { size: 12 }),
1469
+ m?.saving && /* @__PURE__ */ Q(x, { size: 12 }),
1464
1470
  m?.error && /* @__PURE__ */ Q("span", {
1465
1471
  style: {
1466
1472
  fontSize: 11,
@@ -1469,90 +1475,90 @@ function $e({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1469
1475
  title: m.error,
1470
1476
  children: "!"
1471
1477
  }),
1472
- u === "row_edit" && /* @__PURE__ */ Q(c, {
1478
+ u === "row_edit" && /* @__PURE__ */ Q(O, {
1473
1479
  size: 32,
1474
1480
  icon: /* @__PURE__ */ Q(e.edit, { size: 14 }),
1475
- onClick: () => _(t),
1476
- title: O("record.row.edit", "Edit row")
1481
+ onClick: () => v(t),
1482
+ title: D("record.row.edit", "Edit row")
1477
1483
  }),
1478
- /* @__PURE__ */ Q(c, {
1484
+ /* @__PURE__ */ Q(O, {
1479
1485
  size: 32,
1480
1486
  icon: /* @__PURE__ */ Q(e.trash, { size: 14 }),
1481
1487
  onClick: () => g(t),
1482
- title: O("record.row.delete", "Delete row")
1488
+ title: D("record.row.delete", "Delete row")
1483
1489
  })
1484
1490
  ] }), !l && T && T.length > 0 && /* @__PURE__ */ Q(ze, {
1485
1491
  entity: r,
1486
1492
  actions: T,
1487
1493
  objectIds: [t],
1488
- row: A,
1494
+ row: j,
1489
1495
  onSuccess: E
1490
1496
  })]
1491
1497
  })]
1492
1498
  });
1493
1499
  }
1494
- function et({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o, editableColumns: s, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: p, activeCell: m, setActiveCell: h, rowState: g, onCellChange: _, onDeleteClick: v, onStartEdit: y, onConfirmEdit: b, onCancelEdit: x, refs: S, identityCol: C, href: T, rowActions: E, onRowActionSuccess: O }) {
1495
- let k = z(), A = J(() => !g || Object.keys(g.buffer).length === 0 ? n : {
1500
+ function et({ rowId: t, 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: g, onDeleteClick: v, onStartEdit: y, onConfirmEdit: b, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
1501
+ let A = z(), j = J(() => !h || Object.keys(h.buffer).length === 0 ? n : {
1496
1502
  ...n,
1497
- ...g.buffer
1498
- }, [n, g]);
1499
- if (u === "row_edit" && d) {
1500
- let e = g?.error ? [...f, `_error:${g.error}`] : f;
1503
+ ...h.buffer
1504
+ }, [n, h]);
1505
+ if (l === "row_edit" && u) {
1506
+ let e = h?.error ? [...d, `_error:${h.error}`] : d;
1501
1507
  return /* @__PURE__ */ Q(tt, {
1502
- values: A,
1508
+ values: j,
1503
1509
  entity: r,
1504
1510
  columns: o,
1505
1511
  editableColumns: s,
1506
1512
  errors: e,
1507
- saving: g?.saving ?? !1,
1508
- onChange: (e, n) => _(t, e, n),
1513
+ saving: h?.saving ?? !1,
1514
+ onChange: (e, n) => g(t, e, n),
1509
1515
  onConfirm: () => b(t),
1510
- onCancel: () => x(t),
1511
- refs: S
1516
+ onCancel: () => S(t),
1517
+ refs: C
1512
1518
  });
1513
1519
  }
1514
1520
  let M = ue, N = {
1515
1521
  padding: "4px 4px",
1516
1522
  borderBottom: "1px solid var(--divider)",
1517
1523
  verticalAlign: "middle"
1518
- }, P = u === "inline_edit";
1524
+ }, P = l === "inline_edit";
1519
1525
  return /* @__PURE__ */ $("tr", {
1520
- style: { opacity: p ? .5 : 1 },
1526
+ style: { opacity: f ? .5 : 1 },
1521
1527
  children: [
1522
1528
  o.map((e) => {
1523
1529
  let n = r.fields.get(e), o = s.has(e);
1524
- if (P && m?.rowId === t && m?.col === e && o) return /* @__PURE__ */ Q("td", {
1530
+ if (P && p?.rowId === t && p?.col === e && o) return /* @__PURE__ */ Q("td", {
1525
1531
  style: N,
1526
- children: n ? j({
1532
+ children: n ? k({
1527
1533
  field: n,
1528
1534
  fieldName: e,
1529
- value: A[e],
1535
+ value: j[e],
1530
1536
  mode: "edit",
1531
- onChange: (n) => _(t, e, n),
1532
- record: A,
1533
- refs: S,
1537
+ onChange: (n) => g(t, e, n),
1538
+ record: j,
1539
+ refs: C,
1534
1540
  compact: !0,
1535
- t: k
1536
- }) : w(A[e])
1541
+ t: A
1542
+ }) : _(j[e])
1537
1543
  }, e);
1538
- let c = T && e === C, l = n ? j({
1544
+ let c = T && e === w, l = n ? k({
1539
1545
  field: n,
1540
1546
  fieldName: e,
1541
- value: A[e],
1547
+ value: j[e],
1542
1548
  mode: "display",
1543
- record: A,
1544
- refs: S,
1549
+ record: j,
1550
+ refs: C,
1545
1551
  entity: r,
1546
1552
  entities: i,
1547
1553
  screens: c ? void 0 : a,
1548
- t: k
1549
- }) : w(A[e]), u = P && o && !p;
1554
+ t: A
1555
+ }) : _(j[e]), u = P && o && !f;
1550
1556
  return /* @__PURE__ */ Q("td", {
1551
1557
  style: {
1552
1558
  ...M,
1553
1559
  cursor: u ? "pointer" : "default"
1554
1560
  },
1555
- onClick: u ? () => h({
1561
+ onClick: u ? () => m({
1556
1562
  rowId: t,
1557
1563
  col: e
1558
1564
  }) : void 0,
@@ -1569,7 +1575,7 @@ function et({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1569
1575
  }) : l
1570
1576
  }, e);
1571
1577
  }),
1572
- l && /* @__PURE__ */ Q("td", {
1578
+ c && /* @__PURE__ */ Q("td", {
1573
1579
  style: {
1574
1580
  padding: "4px 8px",
1575
1581
  borderBottom: "1px solid var(--divider)",
@@ -1582,31 +1588,31 @@ function et({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1582
1588
  gap: 4
1583
1589
  },
1584
1590
  children: [
1585
- g?.saving && /* @__PURE__ */ Q(D, { size: 12 }),
1586
- g?.error && /* @__PURE__ */ Q("span", {
1591
+ h?.saving && /* @__PURE__ */ Q(x, { size: 12 }),
1592
+ h?.error && /* @__PURE__ */ Q("span", {
1587
1593
  style: {
1588
1594
  fontSize: 11,
1589
1595
  color: "var(--danger)"
1590
1596
  },
1591
- title: g.error,
1597
+ title: h.error,
1592
1598
  children: "!"
1593
1599
  }),
1594
- u === "row_edit" && /* @__PURE__ */ Q(c, {
1600
+ l === "row_edit" && /* @__PURE__ */ Q(O, {
1595
1601
  size: 24,
1596
1602
  icon: /* @__PURE__ */ Q(e.edit, { size: 12 }),
1597
1603
  onClick: () => y(t),
1598
- title: k("record.row.edit", "Edit row")
1604
+ title: A("record.row.edit", "Edit row")
1599
1605
  }),
1600
- /* @__PURE__ */ Q(c, {
1606
+ /* @__PURE__ */ Q(O, {
1601
1607
  size: 24,
1602
1608
  icon: /* @__PURE__ */ Q(e.trash, { size: 12 }),
1603
1609
  onClick: () => v(t),
1604
- title: k("record.row.delete", "Delete row")
1610
+ title: A("record.row.delete", "Delete row")
1605
1611
  })
1606
1612
  ]
1607
1613
  })
1608
1614
  }),
1609
- !l && E && E.length > 0 && /* @__PURE__ */ Q("td", {
1615
+ !c && E && E.length > 0 && /* @__PURE__ */ Q("td", {
1610
1616
  style: {
1611
1617
  padding: "4px 8px",
1612
1618
  borderBottom: "1px solid var(--divider)",
@@ -1616,63 +1622,63 @@ function et({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o,
1616
1622
  entity: r,
1617
1623
  actions: E,
1618
1624
  objectIds: [t],
1619
- row: A,
1620
- onSuccess: O
1625
+ row: j,
1626
+ onSuccess: D
1621
1627
  })
1622
1628
  })
1623
1629
  ]
1624
1630
  });
1625
1631
  }
1626
- function tt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, saving: o, onChange: s, onConfirm: l, onCancel: u, refs: d, accent: f }) {
1627
- let p = z(), m = a.find((e) => e.startsWith("_error:")), h = new Set(a.filter((e) => !e.startsWith("_error:"))), g = {
1632
+ function tt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, saving: o, onChange: s, onConfirm: c, onCancel: l, refs: u, accent: d }) {
1633
+ let f = z(), p = a.find((e) => e.startsWith("_error:")), m = new Set(a.filter((e) => !e.startsWith("_error:"))), h = {
1628
1634
  padding: "6px 12px",
1629
1635
  borderBottom: "1px solid var(--divider)",
1630
1636
  verticalAlign: "middle",
1631
1637
  height: 40,
1632
1638
  minWidth: 0
1633
- }, _ = {
1639
+ }, g = {
1634
1640
  display: "block",
1635
1641
  width: "100%",
1636
1642
  maxWidth: "100%",
1637
1643
  minWidth: 0
1638
1644
  };
1639
1645
  return /* @__PURE__ */ $("tr", {
1640
- style: f ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
1646
+ style: d ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
1641
1647
  onKeyDown: (e) => {
1642
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), u());
1648
+ e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), c()) : e.key === "Escape" && (e.preventDefault(), l());
1643
1649
  },
1644
1650
  children: [r.map((e) => {
1645
- let r = n.fields.get(e), a = i.has(e), o = h.has(e);
1651
+ let r = n.fields.get(e), a = i.has(e), o = m.has(e);
1646
1652
  return a ? /* @__PURE__ */ Q("td", {
1647
1653
  style: {
1648
- ...g,
1654
+ ...h,
1649
1655
  outline: o ? "1px solid var(--danger)" : "none",
1650
1656
  outlineOffset: -1
1651
1657
  },
1652
- title: o ? p("record.row.field_required", "{field} is required", { field: e }) : void 0,
1658
+ title: o ? f("record.row.field_required", "{field} is required", { field: e }) : void 0,
1653
1659
  children: /* @__PURE__ */ Q("div", {
1654
- style: _,
1655
- children: r ? j({
1660
+ style: g,
1661
+ children: r ? k({
1656
1662
  field: r,
1657
1663
  fieldName: e,
1658
1664
  value: t[e],
1659
1665
  mode: "edit",
1660
1666
  onChange: (t) => s(e, t),
1661
1667
  record: t,
1662
- refs: d,
1668
+ refs: u,
1663
1669
  compact: !0,
1664
- t: p
1665
- }) : w(t[e])
1670
+ t: f
1671
+ }) : _(t[e])
1666
1672
  })
1667
1673
  }, e) : /* @__PURE__ */ Q("td", {
1668
1674
  style: {
1669
- ...g,
1675
+ ...h,
1670
1676
  color: "var(--text-3)"
1671
1677
  },
1672
- children: r?.auto ? "—" : w(t[e])
1678
+ children: r?.auto ? "—" : _(t[e])
1673
1679
  }, e);
1674
1680
  }), /* @__PURE__ */ Q("td", {
1675
- style: g,
1681
+ style: h,
1676
1682
  children: /* @__PURE__ */ $("div", {
1677
1683
  style: {
1678
1684
  display: "flex",
@@ -1681,33 +1687,33 @@ function tt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
1681
1687
  justifyContent: "flex-end"
1682
1688
  },
1683
1689
  children: [
1684
- m && /* @__PURE__ */ Q("span", {
1690
+ p && /* @__PURE__ */ Q("span", {
1685
1691
  style: {
1686
1692
  fontSize: 11,
1687
1693
  color: "var(--danger)"
1688
1694
  },
1689
- title: m.slice(7),
1695
+ title: p.slice(7),
1690
1696
  children: "!"
1691
1697
  }),
1692
- /* @__PURE__ */ Q(c, {
1698
+ /* @__PURE__ */ Q(O, {
1693
1699
  size: 24,
1694
- icon: Q(o ? D : e.check, { size: 12 }),
1695
- onClick: l,
1696
- title: p("record.row.confirm", "Confirm (Enter)")
1700
+ icon: Q(o ? x : e.check, { size: 12 }),
1701
+ onClick: c,
1702
+ title: f("record.row.confirm", "Confirm (Enter)")
1697
1703
  }),
1698
- /* @__PURE__ */ Q(c, {
1704
+ /* @__PURE__ */ Q(O, {
1699
1705
  size: 24,
1700
1706
  icon: /* @__PURE__ */ Q(e.x, { size: 12 }),
1701
- onClick: u,
1702
- title: p("record.row.cancel", "Cancel (Esc)")
1707
+ onClick: l,
1708
+ title: f("record.row.cancel", "Cancel (Esc)")
1703
1709
  })
1704
1710
  ]
1705
1711
  })
1706
1712
  })]
1707
1713
  });
1708
1714
  }
1709
- function nt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, saving: o, onChange: s, onConfirm: l, onCancel: u, refs: d, accent: f }) {
1710
- let p = z(), m = me(), h = a.find((e) => e.startsWith("_error:")), g = new Set(a.filter((e) => !e.startsWith("_error:")));
1715
+ function nt({ values: t, entity: n, columns: r, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
1716
+ let p = z(), m = me(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:")));
1711
1717
  return /* @__PURE__ */ $("div", {
1712
1718
  style: {
1713
1719
  border: "1px solid var(--border)",
@@ -1727,7 +1733,7 @@ function nt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
1727
1733
  gap: 12
1728
1734
  },
1729
1735
  children: r.map((e) => {
1730
- let r = n.fields.get(e), a = i.has(e), o = g.has(e), c = r ? y(p, r, e) : e, l = `${m}-${e}`, u = `${l}-label`, f = {
1736
+ let r = n.fields.get(e), o = a.has(e), s = g.has(e), l = r ? i(p, r, e) : e, u = `${m}-${e}`, f = `${u}-label`, h = {
1731
1737
  fontSize: 11.5,
1732
1738
  fontWeight: 600,
1733
1739
  color: "var(--text-3)"
@@ -1739,36 +1745,36 @@ function nt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
1739
1745
  gap: 5,
1740
1746
  minWidth: 0
1741
1747
  },
1742
- children: [a && r ? /* @__PURE__ */ Q("label", {
1743
- id: u,
1744
- htmlFor: l,
1745
- style: f,
1746
- children: c
1748
+ children: [o && r ? /* @__PURE__ */ Q("label", {
1749
+ id: f,
1750
+ htmlFor: u,
1751
+ style: h,
1752
+ children: l
1747
1753
  }) : /* @__PURE__ */ Q("div", {
1748
- id: u,
1749
- style: f,
1750
- children: c
1754
+ id: f,
1755
+ style: h,
1756
+ children: l
1751
1757
  }), /* @__PURE__ */ Q("div", {
1752
1758
  style: {
1753
1759
  minWidth: 0,
1754
- outline: o ? "1px solid var(--danger)" : "none",
1760
+ outline: s ? "1px solid var(--danger)" : "none",
1755
1761
  outlineOffset: 3,
1756
- borderRadius: o ? 5 : 0
1762
+ borderRadius: s ? 5 : 0
1757
1763
  },
1758
- title: o ? p("record.row.field_required", "{field} is required", { field: e }) : void 0,
1759
- children: a ? r ? j({
1764
+ title: s ? p("record.row.field_required", "{field} is required", { field: e }) : void 0,
1765
+ children: o ? r ? k({
1760
1766
  field: r,
1761
1767
  fieldName: e,
1762
1768
  value: t[e],
1763
1769
  mode: "edit",
1764
- onChange: (t) => s(e, t),
1770
+ onChange: (t) => c(e, t),
1765
1771
  record: t,
1766
1772
  refs: d,
1767
1773
  compact: !0,
1768
- fieldId: l,
1769
- labelId: u,
1774
+ fieldId: u,
1775
+ labelId: f,
1770
1776
  t: p
1771
- }) : w(t[e]) : r?.auto ? "—" : w(t[e])
1777
+ }) : _(t[e]) : r?.auto ? "—" : _(t[e])
1772
1778
  })]
1773
1779
  }, e);
1774
1780
  })
@@ -1791,13 +1797,13 @@ function nt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, s
1791
1797
  title: h.slice(7),
1792
1798
  children: "!"
1793
1799
  }),
1794
- /* @__PURE__ */ Q(c, {
1800
+ /* @__PURE__ */ Q(O, {
1795
1801
  size: 32,
1796
- icon: Q(o ? D : e.check, { size: 14 }),
1802
+ icon: Q(s ? x : e.check, { size: 14 }),
1797
1803
  onClick: l,
1798
1804
  title: p("record.row.confirm", "Confirm (Enter)")
1799
1805
  }),
1800
- /* @__PURE__ */ Q(c, {
1806
+ /* @__PURE__ */ Q(O, {
1801
1807
  size: 32,
1802
1808
  icon: /* @__PURE__ */ Q(e.x, { size: 14 }),
1803
1809
  onClick: u,
@@ -1926,7 +1932,7 @@ function lt({ message: e, onRetry: t, t: n, errorTitle: r }) {
1926
1932
  },
1927
1933
  children: e || r("ui.render_failed_undescribed", "An unexpected error occurred.")
1928
1934
  }),
1929
- /* @__PURE__ */ Q("div", { children: /* @__PURE__ */ Q(m, {
1935
+ /* @__PURE__ */ Q("div", { children: /* @__PURE__ */ Q(l, {
1930
1936
  onClick: t,
1931
1937
  children: n("control.try_again", "Try again")
1932
1938
  }) })