@nivaro/react 0.3.49 → 0.3.51

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 (46) hide show
  1. package/dist/components/InlineGridField.js +166 -105
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +38 -4
  5. package/dist/shared/components/ItemEditForm.js +5258 -5034
  6. package/dist/shared/components/QueryTable.js +489 -347
  7. package/dist/shared/components/ReportView.js +105 -99
  8. package/dist/shared/components/alerts/AlertManagerView.js +327 -301
  9. package/dist/shared/components/item-edit/CatalogPickerField.js +1230 -1175
  10. package/dist/shared/components/item-edit/CloneDialog.js +192 -142
  11. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
  12. package/dist/shared/components/item-edit/FieldRenderer.js +249 -244
  13. package/dist/shared/components/item-edit/FieldRow.js +402 -370
  14. package/dist/shared/components/item-edit/FilePickerField.js +315 -307
  15. package/dist/shared/components/item-edit/InlineGridField.js +92 -90
  16. package/dist/shared/components/item-edit/InlineTableField.js +3119 -2951
  17. package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
  18. package/dist/shared/components/item-edit/PlanGrid.js +162 -162
  19. package/dist/shared/components/item-edit/PolishFields.js +169 -162
  20. package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
  21. package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
  22. package/dist/shared/components/item-edit/RelationCombobox.js +198 -191
  23. package/dist/shared/components/item-edit/SummaryPanel.js +282 -259
  24. package/dist/shared/components/item-edit/UserChip.js +233 -200
  25. package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
  26. package/dist/shared/components/item-edit/header-midair.js +51 -0
  27. package/dist/shared/components/item-edit/helpers.js +181 -155
  28. package/dist/shared/components/item-edit/line-midair.js +207 -0
  29. package/dist/shared/components/item-edit/soft-rules.js +27 -0
  30. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  31. package/dist/shared/components/panels/CommentPanel.js +290 -284
  32. package/dist/shared/components/panels/ItemLockBanner.js +414 -358
  33. package/dist/shared/components/panels/PipelinePanel.js +1241 -992
  34. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  35. package/dist/shared/components/panels/TaskPanel.js +71 -61
  36. package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
  37. package/dist/shared/components/panels/requirement-side-effects.js +40 -0
  38. package/dist/shared/components/queue/QueueWorklist.js +925 -871
  39. package/dist/shared/components/queue/column-chooser.js +21 -0
  40. package/dist/shared/components/queue/live-state-aspect.js +6 -0
  41. package/dist/shared/components/ui/number-draft-input.js +93 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
  43. package/dist/shared/lib/draft-store.js +48 -34
  44. package/dist/shared/lib/error-hints.js +1 -0
  45. package/dist/shared/lib/query-stats.js +60 -60
  46. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
1
  import { jsx as t, jsxs as a, Fragment as L } from "react/jsx-runtime";
2
- import { useQueryClient as ae, useQuery as Y } from "@tanstack/react-query";
2
+ import { useQueryClient as ae, useQuery as V } from "@tanstack/react-query";
3
3
  import { Loader2 as ie, X as U, ChevronRight as le } from "lucide-react";
4
4
  import { memo as de, useState as k, useMemo as W } from "react";
5
5
  import { useNivaroClient as oe } from "../../context.js";
6
- import { get as G, patch as ce, del as pe, post as ue } from "../../lib/commands.js";
7
- import { titleCase as V, cn as me, toLocalDateString as xe } from "../../lib/utils.js";
8
- import { useAddendumO2M as he, useAddendumView as be } from "./AddendumFieldContext.js";
9
- import { useO2MStaging as fe } from "./O2MStagingContext.js";
10
- const ye = /* @__PURE__ */ new Set([
6
+ import { get as Y, patch as ce, del as pe, post as ue } from "../../lib/commands.js";
7
+ import { titleCase as G, cn as me, toLocalDateString as xe } from "../../lib/utils.js";
8
+ import { NumberDraftInput as he } from "../ui/number-draft-input.js";
9
+ import { useAddendumO2M as be, useAddendumView as fe } from "./AddendumFieldContext.js";
10
+ import { useO2MStaging as ye } from "./O2MStagingContext.js";
11
+ const ge = /* @__PURE__ */ new Set([
11
12
  "alias",
12
13
  "o2m",
13
14
  "m2m",
@@ -15,39 +16,39 @@ const ye = /* @__PURE__ */ new Set([
15
16
  "presentation",
16
17
  "group",
17
18
  "divider"
18
- ]), $e = de(function({
19
+ ]), Ie = de(function({
19
20
  relatedCollection: l,
20
21
  manyField: c,
21
22
  parentId: m,
22
23
  layoutSlug: b,
23
24
  parentFieldKey: Z,
24
- emptyLabel: S
25
+ emptyLabel: q
25
26
  }) {
26
27
  var H;
27
- const f = oe(), Q = ae(), x = fe(), d = m === "new", B = he()[Z ?? ""] ?? [], [q, C] = k(null), [_, D] = k({}), [E, v] = k(!1), [R, y] = k({}), [g, $] = k(!1), N = be(), { data: u } = Y({
28
+ const f = oe(), P = ae(), x = ye(), d = m === "new", B = be()[Z ?? ""] ?? [], [S, C] = k(null), [Q, _] = k({}), [E, w] = k(!1), [R, y] = k({}), [g, $] = k(!1), N = fe(), { data: u } = V({
28
29
  queryKey: ["active-layout", l, b ?? null],
29
30
  queryFn: () => f.request(
30
- G("/collection-layouts/active", {
31
+ Y("/collection-layouts/active", {
31
32
  collection: l,
32
33
  ...b ? { slug: b } : {}
33
34
  })
34
35
  ).then((e) => e.data).catch(() => null),
35
36
  staleTime: 6e4,
36
37
  enabled: !!b
37
- }), T = b ? ((H = u == null ? void 0 : u.layout) == null ? void 0 : H.id) ?? null : null, { data: ee = [] } = Y({
38
+ }), T = b ? ((H = u == null ? void 0 : u.layout) == null ? void 0 : H.id) ?? null : null, { data: ee = [] } = V({
38
39
  queryKey: ["field-config", l, T],
39
40
  queryFn: () => f.request(
40
- G(
41
+ Y(
41
42
  `/field-config/${l}`,
42
43
  T ? { layout_id: String(T) } : void 0
43
44
  )
44
45
  ).then((e) => e.data ?? []),
45
46
  staleTime: 6e4,
46
47
  enabled: !b || u !== void 0
47
- }), { data: w = [], isLoading: te } = Y({
48
+ }), { data: v = [], isLoading: te } = V({
48
49
  queryKey: ["o2m-rows", l, c, m],
49
50
  queryFn: () => f.request(
50
- G(`/items/${l}`, {
51
+ Y(`/items/${l}`, {
51
52
  filter: JSON.stringify({ [c]: { _eq: m } }),
52
53
  limit: 200
53
54
  })
@@ -55,23 +56,23 @@ const ye = /* @__PURE__ */ new Set([
55
56
  enabled: !d,
56
57
  staleTime: 3e4
57
58
  }), J = d && x ? x.getPendingRows(l, c) : [], o = ee.filter(
58
- (e) => !e.hidden && !ye.has(e.type) && e.field !== c && e.field !== "id"
59
+ (e) => !e.hidden && !ge.has(e.type) && e.field !== c && e.field !== "id"
59
60
  ), A = W(
60
- () => ((u == null ? void 0 : u.groups) ?? []).filter((e) => e.type === "section").sort((e, n) => e.sort - n.sort),
61
+ () => ((u == null ? void 0 : u.groups) ?? []).filter((e) => e.type === "section").sort((e, r) => e.sort - r.sort),
61
62
  [u]
62
63
  ), h = W(() => {
63
64
  if (!A.length) return null;
64
65
  const e = /* @__PURE__ */ new Map();
65
- for (const n of o) {
66
- const r = n.group_key ?? null;
67
- e.has(r) || e.set(r, []), e.get(r).push(n);
66
+ for (const r of o) {
67
+ const n = r.group_key ?? null;
68
+ e.has(n) || e.set(n, []), e.get(n).push(r);
68
69
  }
69
70
  return e;
70
71
  }, [o, A]);
71
72
  async function X(e) {
72
73
  $(!0);
73
74
  try {
74
- await f.request(ce(`/items/${l}/${e}`, _)), Q.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), C(null);
75
+ await f.request(ce(`/items/${l}/${e}`, Q)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), C(null);
75
76
  } catch {
76
77
  } finally {
77
78
  $(!1);
@@ -79,52 +80,53 @@ const ye = /* @__PURE__ */ new Set([
79
80
  }
80
81
  async function z() {
81
82
  if (d && x) {
82
- x.queueRow(l, c, { ...R }), v(!1), y({});
83
+ x.queueRow(l, c, { ...R }), w(!1), y({});
83
84
  return;
84
85
  }
85
86
  $(!0);
86
87
  try {
87
88
  await f.request(
88
89
  ue(`/items/${l}`, { ...R, [c]: m })
89
- ), Q.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), v(!1), y({});
90
+ ), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] }), w(!1), y({});
90
91
  } catch {
91
92
  } finally {
92
93
  $(!1);
93
94
  }
94
95
  }
95
- async function ne(e) {
96
+ async function re(e) {
96
97
  try {
97
- await f.request(pe(`/items/${l}/${e}`)), Q.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] });
98
+ await f.request(pe(`/items/${l}/${e}`)), P.invalidateQueries({ queryKey: ["o2m-rows", l, c, m] });
98
99
  } catch {
99
100
  }
100
101
  }
101
- function K(e, n) {
102
- if (n == null) return /* @__PURE__ */ t("span", { className: "text-slate-300", children: "—" });
102
+ function I(e, r) {
103
+ if (r == null) return /* @__PURE__ */ t("span", { className: "text-slate-300", children: "—" });
103
104
  if (e.type === "boolean")
104
- return /* @__PURE__ */ t("span", { className: n ? "text-emerald-600" : "text-slate-400", children: n ? "Yes" : "No" });
105
+ return /* @__PURE__ */ t("span", { className: r ? "text-emerald-600" : "text-slate-400", children: r ? "Yes" : "No" });
105
106
  if (e.type === "datetime" || e.type === "date")
106
107
  try {
107
- return /* @__PURE__ */ t("span", { children: xe(n) });
108
+ return /* @__PURE__ */ t("span", { children: xe(r) });
108
109
  } catch {
109
110
  }
110
- return /* @__PURE__ */ t("span", { className: "truncate", children: String(n) });
111
+ return /* @__PURE__ */ t("span", { className: "truncate", children: String(r) });
111
112
  }
112
- function O(e, n, r) {
113
- const s = n[e.field] ?? "";
113
+ function K(e, r, n) {
114
+ const s = r[e.field] ?? "";
114
115
  return e.type === "boolean" ? /* @__PURE__ */ t(
115
116
  "input",
116
117
  {
117
118
  type: "checkbox",
118
119
  checked: !!s,
119
- onChange: (i) => r(e.field, i.target.checked),
120
+ onChange: (i) => n(e.field, i.target.checked),
120
121
  className: "h-4 w-4"
121
122
  }
122
123
  ) : e.type === "integer" || e.type === "bigInteger" || e.type === "float" || e.type === "decimal" ? /* @__PURE__ */ t(
123
- "input",
124
+ he,
124
125
  {
126
+ bare: !0,
125
127
  type: "number",
126
- value: String(s),
127
- onChange: (i) => r(e.field, i.target.value === "" ? null : Number(i.target.value)),
128
+ value: s,
129
+ onValue: (i) => n(e.field, i),
128
130
  className: "w-full rounded border border-slate-200 px-2 py-1.5 text-[12px] focus:outline-none focus:border-nvr-cyan"
129
131
  }
130
132
  ) : e.type === "date" ? /* @__PURE__ */ t(
@@ -132,7 +134,7 @@ const ye = /* @__PURE__ */ new Set([
132
134
  {
133
135
  type: "date",
134
136
  value: String(s).slice(0, 10),
135
- onChange: (i) => r(e.field, i.target.value || null),
137
+ onChange: (i) => n(e.field, i.target.value || null),
136
138
  className: "w-full rounded border border-slate-200 px-2 py-1.5 text-[12px] focus:outline-none focus:border-nvr-cyan"
137
139
  }
138
140
  ) : e.type === "datetime" ? /* @__PURE__ */ t(
@@ -140,7 +142,7 @@ const ye = /* @__PURE__ */ new Set([
140
142
  {
141
143
  type: "datetime-local",
142
144
  value: String(s).slice(0, 16),
143
- onChange: (i) => r(e.field, i.target.value ? new Date(i.target.value).toISOString() : null),
145
+ onChange: (i) => n(e.field, i.target.value ? new Date(i.target.value).toISOString() : null),
144
146
  className: "w-full rounded border border-slate-200 px-2 py-1.5 text-[12px] focus:outline-none focus:border-nvr-cyan"
145
147
  }
146
148
  ) : /* @__PURE__ */ t(
@@ -148,13 +150,13 @@ const ye = /* @__PURE__ */ new Set([
148
150
  {
149
151
  type: "text",
150
152
  value: String(s),
151
- onChange: (i) => r(e.field, i.target.value),
153
+ onChange: (i) => n(e.field, i.target.value),
152
154
  className: "w-full rounded border border-slate-200 px-2 py-1.5 text-[12px] focus:outline-none focus:border-nvr-cyan"
153
155
  }
154
156
  );
155
157
  }
156
- function F(e, n, r, s, i) {
157
- const I = (h == null ? void 0 : h.get(null)) ?? [];
158
+ function F(e, r, n, s, i) {
159
+ const j = (h == null ? void 0 : h.get(null)) ?? [];
158
160
  return /* @__PURE__ */ a("div", { className: "border border-slate-200 rounded-lg bg-white overflow-hidden", children: [
159
161
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between border-b border-slate-100 px-3 py-2 bg-slate-50", children: [
160
162
  /* @__PURE__ */ t("span", { className: "text-[11px] font-semibold text-slate-600 uppercase tracking-wide", children: i }),
@@ -173,7 +175,7 @@ const ye = /* @__PURE__ */ new Set([
173
175
  {
174
176
  type: "button",
175
177
  disabled: g,
176
- onClick: r,
178
+ onClick: n,
177
179
  className: "text-[11px] font-medium bg-nvr-cyan text-white px-2.5 py-0.5 rounded hover:brightness-110 disabled:opacity-50",
178
180
  children: g ? "…" : "Save"
179
181
  }
@@ -181,29 +183,29 @@ const ye = /* @__PURE__ */ new Set([
181
183
  ] })
182
184
  ] }),
183
185
  /* @__PURE__ */ a("div", { className: "p-3 space-y-4", children: [
184
- I.length > 0 && /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: I.map((p) => /* @__PURE__ */ a("div", { children: [
185
- /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: p.label ?? V(p.field) }),
186
- O(p, e, n)
186
+ j.length > 0 && /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: j.map((p) => /* @__PURE__ */ a("div", { children: [
187
+ /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: p.label ?? G(p.field) }),
188
+ K(p, e, r)
187
189
  ] }, p.field)) }),
188
190
  A.map((p) => {
189
- const M = (h == null ? void 0 : h.get(p.key)) ?? [];
190
- return M.length ? /* @__PURE__ */ a("div", { children: [
191
+ const D = (h == null ? void 0 : h.get(p.key)) ?? [];
192
+ return D.length ? /* @__PURE__ */ a("div", { children: [
191
193
  /* @__PURE__ */ t("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-slate-400 mb-2 pb-1 border-b border-slate-100", children: p.label }),
192
- /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: M.map((P) => /* @__PURE__ */ a("div", { children: [
193
- /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: P.label ?? V(P.field) }),
194
- O(P, e, n)
195
- ] }, P.field)) })
194
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2", children: D.map((M) => /* @__PURE__ */ a("div", { children: [
195
+ /* @__PURE__ */ t("label", { className: "block text-[11px] font-medium text-slate-500 mb-1", children: M.label ?? G(M.field) }),
196
+ K(M, e, r)
197
+ ] }, M.field)) })
196
198
  ] }, p.key) : null;
197
199
  })
198
200
  ] })
199
201
  ] });
200
202
  }
201
- function re(e, n) {
202
- return o.map((r) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: O(r, e, n) }, r.field));
203
+ function ne(e, r) {
204
+ return o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: K(n, e, r) }, n.field));
203
205
  }
204
206
  if (!d && te)
205
207
  return /* @__PURE__ */ t("div", { className: "py-3 text-center text-[12px] text-slate-400", children: /* @__PURE__ */ t(ie, { className: "h-4 w-4 animate-spin inline" }) });
206
- const se = d ? J : w, j = !!h && A.length > 0;
208
+ const se = d ? J : v, O = !!h && A.length > 0;
207
209
  return (
208
210
  // The flat grid shows every displayable child column (a wide legacy table
209
211
  // has dozens) — it scrolls inside its card rather than running off a
@@ -216,48 +218,48 @@ const ye = /* @__PURE__ */ new Set([
216
218
  "th",
217
219
  {
218
220
  className: "px-3 py-2 text-left font-medium text-slate-500 text-[11px]",
219
- children: e.label ?? V(e.field)
221
+ children: e.label ?? G(e.field)
220
222
  },
221
223
  e.field
222
224
  )),
223
225
  /* @__PURE__ */ t("th", { className: "w-16" })
224
226
  ] }) }),
225
227
  /* @__PURE__ */ a("tbody", { children: [
226
- d && J.map((e, n) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-amber-50/40", children: [
228
+ d && J.map((e, r) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-amber-50/40", children: [
227
229
  /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: /* @__PURE__ */ t("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Pending" }) }),
228
- o.map((r) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600", children: K(r, e[r.field]) }, r.field)),
230
+ o.map((n) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600", children: I(n, e[n.field]) }, n.field)),
229
231
  /* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t(
230
232
  "button",
231
233
  {
232
234
  type: "button",
233
- onClick: () => x == null ? void 0 : x.removeRow(l, c, n),
235
+ onClick: () => x == null ? void 0 : x.removeRow(l, c, r),
234
236
  className: "rounded p-0.5 text-slate-400 hover:text-red-500",
235
237
  children: /* @__PURE__ */ t(U, { className: "h-3 w-3" })
236
238
  }
237
239
  ) })
238
- ] }, n)),
239
- !d && N === "original" && w.map((e, n) => {
240
- const r = String(e.id), s = q === r && !j;
240
+ ] }, r)),
241
+ !d && N === "original" && v.map((e, r) => {
242
+ const n = String(e.id), s = S === n && !O;
241
243
  return /* @__PURE__ */ a(
242
244
  "tr",
243
245
  {
244
246
  className: me(
245
247
  "border-b border-slate-100",
246
- n % 2 === 0 ? "bg-white" : "bg-slate-50/50"
248
+ r % 2 === 0 ? "bg-white" : "bg-slate-50/50"
247
249
  ),
248
250
  children: [
249
- o.map((i) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: s ? O(
251
+ o.map((i) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5", children: s ? K(
250
252
  i,
251
- _,
252
- (I, p) => D((M) => ({ ...M, [I]: p }))
253
- ) : K(i, e[i.field]) }, i.field)),
253
+ Q,
254
+ (j, p) => _((D) => ({ ...D, [j]: p }))
255
+ ) : I(i, e[i.field]) }, i.field)),
254
256
  /* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-1 justify-end", children: s ? /* @__PURE__ */ a(L, { children: [
255
257
  /* @__PURE__ */ t(
256
258
  "button",
257
259
  {
258
260
  type: "button",
259
261
  disabled: g,
260
- onClick: () => X(r),
262
+ onClick: () => X(n),
261
263
  className: "rounded px-1.5 py-0.5 bg-nvr-cyan text-white text-[11px] font-medium hover:brightness-110 disabled:opacity-50",
262
264
  children: g ? "…" : "Save"
263
265
  }
@@ -277,7 +279,7 @@ const ye = /* @__PURE__ */ new Set([
277
279
  {
278
280
  type: "button",
279
281
  onClick: () => {
280
- C(r), D({ ...e });
282
+ C(n), _({ ...e });
281
283
  },
282
284
  className: "rounded p-0.5 text-slate-400 hover:text-slate-700",
283
285
  children: /* @__PURE__ */ t(le, { className: "h-3.5 w-3.5" })
@@ -287,7 +289,7 @@ const ye = /* @__PURE__ */ new Set([
287
289
  "button",
288
290
  {
289
291
  type: "button",
290
- onClick: () => ne(e.id),
292
+ onClick: () => re(e.id),
291
293
  className: "rounded p-0.5 text-slate-400 hover:text-red-500",
292
294
  children: /* @__PURE__ */ t(U, { className: "h-3 w-3" })
293
295
  }
@@ -295,11 +297,11 @@ const ye = /* @__PURE__ */ new Set([
295
297
  ] }) }) })
296
298
  ]
297
299
  },
298
- r
300
+ n
299
301
  );
300
302
  }),
301
303
  !d && N !== "original" && (() => {
302
- const e = B.find((n) => n.addendumId === N);
304
+ const e = B.find((r) => r.addendumId === N);
303
305
  return e ? e.rows.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
304
306
  "td",
305
307
  {
@@ -307,24 +309,24 @@ const ye = /* @__PURE__ */ new Set([
307
309
  className: "px-3 py-4 text-center text-[11px] text-amber-500",
308
310
  children: "No proposed rows in this addendum"
309
311
  }
310
- ) }) : e.rows.map((n, r) => /* @__PURE__ */ a("tr", { className: "border-b border-amber-100 bg-amber-50/60", children: [
311
- o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-amber-900", children: K(s, n[s.field]) }, s.field)),
312
+ ) }) : e.rows.map((r, n) => /* @__PURE__ */ a("tr", { className: "border-b border-amber-100 bg-amber-50/60", children: [
313
+ o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-amber-900", children: I(s, r[s.field]) }, s.field)),
312
314
  /* @__PURE__ */ t("td", { className: "px-2 py-1.5 text-right", children: /* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-wide text-amber-400", children: "Proposed" }) })
313
- ] }, r)) : w.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
315
+ ] }, n)) : v.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
314
316
  "td",
315
317
  {
316
318
  colSpan: o.length + 1,
317
319
  className: "px-3 py-4 text-center text-[11px] text-slate-400",
318
- children: S ? `No ${S.toLowerCase()} yet` : "No rows"
320
+ children: q ? `No ${q.toLowerCase()} yet` : "No rows"
319
321
  }
320
- ) }) : w.map((n, r) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100", children: [
321
- o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-slate-700", children: K(s, n[s.field]) }, s.field)),
322
+ ) }) : v.map((r, n) => /* @__PURE__ */ a("tr", { className: "border-b border-slate-100", children: [
323
+ o.map((s) => /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-[11px] text-slate-700", children: I(s, r[s.field]) }, s.field)),
322
324
  /* @__PURE__ */ t("td", { className: "px-2 py-1.5" })
323
- ] }, r));
325
+ ] }, n));
324
326
  })(),
325
- N === "original" && E && !j && /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-nvr-cyan/5", children: [
327
+ N === "original" && E && !O && /* @__PURE__ */ a("tr", { className: "border-b border-slate-100 bg-nvr-cyan/5", children: [
326
328
  d && /* @__PURE__ */ t("td", { className: "px-3 py-1.5" }),
327
- re(R, (e, n) => y((r) => ({ ...r, [e]: n }))),
329
+ ne(R, (e, r) => y((n) => ({ ...n, [e]: r }))),
328
330
  /* @__PURE__ */ t("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-1 justify-end", children: [
329
331
  /* @__PURE__ */ t(
330
332
  "button",
@@ -341,7 +343,7 @@ const ye = /* @__PURE__ */ new Set([
341
343
  {
342
344
  type: "button",
343
345
  onClick: () => {
344
- v(!1), y({});
346
+ w(!1), y({});
345
347
  },
346
348
  className: "rounded px-1.5 py-0.5 text-slate-400 hover:text-slate-700 text-[11px]",
347
349
  children: "Cancel"
@@ -354,24 +356,24 @@ const ye = /* @__PURE__ */ new Set([
354
356
  {
355
357
  colSpan: o.length + (d ? 2 : 1),
356
358
  className: "px-3 py-4 text-center text-slate-400",
357
- children: S ? `No ${S.toLowerCase()} yet` : d ? "No pending rows" : "No rows"
359
+ children: q ? `No ${q.toLowerCase()} yet` : d ? "No pending rows" : "No rows"
358
360
  }
359
361
  ) })
360
362
  ] })
361
363
  ] }),
362
- q && j && (w.find((n) => String(n.id) === q) ? /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: F(
363
- _,
364
- (n, r) => D((s) => ({ ...s, [n]: r })),
365
- () => X(q),
364
+ S && O && (v.find((r) => String(r.id) === S) ? /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: F(
365
+ Q,
366
+ (r, n) => _((s) => ({ ...s, [r]: n })),
367
+ () => X(S),
366
368
  () => C(null),
367
369
  "Edit Row"
368
370
  ) }) : null),
369
- E && j && /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: F(
371
+ E && O && /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3", children: F(
370
372
  R,
371
- (e, n) => y((r) => ({ ...r, [e]: n })),
373
+ (e, r) => y((n) => ({ ...n, [e]: r })),
372
374
  z,
373
375
  () => {
374
- v(!1), y({});
376
+ w(!1), y({});
375
377
  },
376
378
  "New Row"
377
379
  ) }),
@@ -379,7 +381,7 @@ const ye = /* @__PURE__ */ new Set([
379
381
  "button",
380
382
  {
381
383
  type: "button",
382
- onClick: () => v(!0),
384
+ onClick: () => w(!0),
383
385
  className: "text-[11px] font-medium text-nvr-cyan hover:underline",
384
386
  children: "+ Add row"
385
387
  }
@@ -388,5 +390,5 @@ const ye = /* @__PURE__ */ new Set([
388
390
  );
389
391
  });
390
392
  export {
391
- $e as InlineGridField
393
+ Ie as InlineGridField
392
394
  };