@nivaro/react 0.3.48 → 0.3.50

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 (52) 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 +25 -1
  5. package/dist/shared/components/CellCopyLayer.js +81 -44
  6. package/dist/shared/components/CollectionBrowserView.js +306 -297
  7. package/dist/shared/components/DataTable.js +3 -3
  8. package/dist/shared/components/FulfilmentPill.js +98 -78
  9. package/dist/shared/components/ItemEditForm.js +4682 -4570
  10. package/dist/shared/components/NotificationSourcesCard.js +151 -147
  11. package/dist/shared/components/ProfileView.js +72 -70
  12. package/dist/shared/components/QueryTable.js +462 -333
  13. package/dist/shared/components/imports/ImportConsole.js +4 -4
  14. package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +1144 -1127
  16. package/dist/shared/components/item-edit/CloneDialog.js +192 -142
  17. package/dist/shared/components/item-edit/FieldRenderer.js +127 -126
  18. package/dist/shared/components/item-edit/FieldRow.js +236 -226
  19. package/dist/shared/components/item-edit/HeaderTools.js +118 -113
  20. package/dist/shared/components/item-edit/InlineGridField.js +92 -90
  21. package/dist/shared/components/item-edit/InlineTableField.js +3091 -2942
  22. package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
  23. package/dist/shared/components/item-edit/PlanGrid.js +162 -162
  24. package/dist/shared/components/item-edit/PolishFields.js +169 -162
  25. package/dist/shared/components/item-edit/RelationCombobox.js +186 -181
  26. package/dist/shared/components/item-edit/SummaryPanel.js +148 -135
  27. package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
  28. package/dist/shared/components/item-edit/helpers.js +181 -155
  29. package/dist/shared/components/item-edit/line-midair.js +201 -0
  30. package/dist/shared/components/item-edit/soft-rules.js +27 -0
  31. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  32. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
  33. package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
  34. package/dist/shared/components/notifications/DeliveryChips.js +9 -9
  35. package/dist/shared/components/panels/ItemLockBanner.js +414 -358
  36. package/dist/shared/components/panels/PipelinePanel.js +1171 -975
  37. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  38. package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
  39. package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
  40. package/dist/shared/components/profile/PersonProfile.js +23 -21
  41. package/dist/shared/components/profile/SignedInDevices.js +126 -0
  42. package/dist/shared/components/queue/QueueItemSheet.js +38 -37
  43. package/dist/shared/components/queue/QueueWorklist.js +870 -827
  44. package/dist/shared/components/queue/column-chooser.js +21 -0
  45. package/dist/shared/components/queue/live-state-aspect.js +6 -0
  46. package/dist/shared/components/support/SupportView.js +1 -1
  47. package/dist/shared/components/ui/number-draft-input.js +93 -0
  48. package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
  49. package/dist/shared/lib/edit-lock-fields.js +7 -0
  50. package/dist/shared/lib/error-hints.js +1 -0
  51. package/dist/shared/lib/reimport-visibility.js +10 -0
  52. package/package.json +1 -1
@@ -1,78 +1,79 @@
1
- import { jsx as c, jsxs as b } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as x } from "react/jsx-runtime";
2
2
  import { Check as F, MapPin as S } from "lucide-react";
3
- import { useState as y, useEffect as C } from "react";
4
- import { fiscalPeriodOf as $, getFiscalStartMonth as _ } from "../../lib/fiscal.js";
3
+ import { useState as N, useEffect as C } from "react";
4
+ import { fiscalPeriodOf as $, getFiscalStartMonth as D } from "../../lib/fiscal.js";
5
5
  import { Input as g } from "../ui/input.js";
6
+ import { NumberDraftInput as _ } from "../ui/number-draft-input.js";
6
7
  import { parseJson as w } from "./helpers.js";
7
- function N(l, a) {
8
- window.dispatchEvent(new CustomEvent("nvr:set-field", { detail: { field: l, value: a } }));
8
+ function k(s, n) {
9
+ window.dispatchEvent(new CustomEvent("nvr:set-field", { detail: { field: s, value: n } }));
9
10
  }
10
- function v(l) {
11
- return w(l.options) ?? {};
11
+ function v(s) {
12
+ return w(s.options) ?? {};
12
13
  }
13
- function Y(l, a) {
14
- const e = a.replace(/[^a-zA-Z0-9]/g, "").split("");
15
- let s = "", o = "";
16
- for (const d of l) {
14
+ function E(s, n) {
15
+ const e = n.replace(/[^a-zA-Z0-9]/g, "").split("");
16
+ let l = "", o = "";
17
+ for (const d of s) {
17
18
  if (e.length === 0) break;
18
19
  if (d === "#") {
19
20
  for (; e.length > 0 && !/\d/.test(e[0]); ) e.shift();
20
21
  if (e.length === 0) break;
21
22
  const r = e.shift();
22
- s += r, o += r;
23
+ l += r, o += r;
23
24
  } else if (d === "A") {
24
25
  for (; e.length > 0 && !/[a-zA-Z]/.test(e[0]); ) e.shift();
25
26
  if (e.length === 0) break;
26
27
  const r = e.shift();
27
- s += r, o += r;
28
+ l += r, o += r;
28
29
  } else if (d === "*") {
29
30
  const r = e.shift();
30
- s += r, o += r;
31
+ l += r, o += r;
31
32
  } else
32
- s += d;
33
+ l += d;
33
34
  }
34
- return { display: s, clean: o };
35
+ return { display: l, clean: o };
35
36
  }
36
- function E(l) {
37
- const a = v(l).input_mask;
38
- return typeof a == "string" && a.trim() ? a.trim() : null;
37
+ function J(s) {
38
+ const n = v(s).input_mask;
39
+ return typeof n == "string" && n.trim() ? n.trim() : null;
39
40
  }
40
- function I(l) {
41
- const a = l.trim().toLowerCase();
42
- if (!a) return null;
43
- const e = (t) => `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, s = /* @__PURE__ */ new Date();
44
- if (a === "today") return e(s);
45
- if (a === "tomorrow") return e(new Date(s.getTime() + 864e5));
46
- const o = a.match(/^\+(\d{1,4})$/);
47
- if (o) return e(new Date(s.getTime() + Number(o[1]) * 864e5));
48
- if (a === "eom") return e(new Date(s.getFullYear(), s.getMonth() + 1, 0));
49
- if (a === "eoy") return e(new Date(s.getFullYear(), 11, 31));
50
- const d = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"], r = a.match(/^(?:next\s+)?(sun|mon|tue|wed|thu|fri|sat)[a-z]*$/);
41
+ function R(s) {
42
+ const n = s.trim().toLowerCase();
43
+ if (!n) return null;
44
+ const e = (t) => `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, l = /* @__PURE__ */ new Date();
45
+ if (n === "today") return e(l);
46
+ if (n === "tomorrow") return e(new Date(l.getTime() + 864e5));
47
+ const o = n.match(/^\+(\d{1,4})$/);
48
+ if (o) return e(new Date(l.getTime() + Number(o[1]) * 864e5));
49
+ if (n === "eom") return e(new Date(l.getFullYear(), l.getMonth() + 1, 0));
50
+ if (n === "eoy") return e(new Date(l.getFullYear(), 11, 31));
51
+ const d = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"], r = n.match(/^(?:next\s+)?(sun|mon|tue|wed|thu|fri|sat)[a-z]*$/);
51
52
  if (r) {
52
- const t = d.findIndex((n) => n.startsWith(r[1]));
53
+ const t = d.findIndex((a) => a.startsWith(r[1]));
53
54
  if (t >= 0) {
54
- let n = (t - s.getDay() + 7) % 7;
55
- return (n === 0 || a.startsWith("next")) && (n += n === 0 ? 7 : 0), n === 0 && (n = 7), e(new Date(s.getTime() + n * 864e5));
55
+ let a = (t - l.getDay() + 7) % 7;
56
+ return (a === 0 || n.startsWith("next")) && (a += a === 0 ? 7 : 0), a === 0 && (a = 7), e(new Date(l.getTime() + a * 864e5));
56
57
  }
57
58
  }
58
59
  return null;
59
60
  }
60
- function J({
61
- value: l,
62
- onChange: a
61
+ function z({
62
+ value: s,
63
+ onChange: n
63
64
  }) {
64
- const e = Number(l), s = Number.isFinite(e) && l != null && l !== "" ? `${Math.floor(e / 60)}:${String(Math.round(e % 60)).padStart(2, "0")}` : "", [o, d] = y(s);
65
- C(() => d(s), [s]);
65
+ const e = Number(s), l = Number.isFinite(e) && s != null && s !== "" ? `${Math.floor(e / 60)}:${String(Math.round(e % 60)).padStart(2, "0")}` : "", [o, d] = N(l);
66
+ C(() => d(l), [l]);
66
67
  const r = () => {
67
68
  const t = o.trim();
68
69
  if (!t) {
69
- a(null);
70
+ n(null);
70
71
  return;
71
72
  }
72
- const n = t.match(/^(\d{1,4})(?::([0-5]?\d))?$/);
73
- n ? a(Number(n[1]) * 60 + Number(n[2] ?? 0)) : d(s);
73
+ const a = t.match(/^(\d{1,4})(?::([0-5]?\d))?$/);
74
+ a ? n(Number(a[1]) * 60 + Number(a[2] ?? 0)) : d(l);
74
75
  };
75
- return /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
76
+ return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
76
77
  /* @__PURE__ */ c(
77
78
  g,
78
79
  {
@@ -84,28 +85,28 @@ function J({
84
85
  className: "w-28 tabular-nums"
85
86
  }
86
87
  ),
87
- /* @__PURE__ */ c("span", { className: "text-[11.5px] text-slate-400", children: Number.isFinite(e) && l != null && l !== "" ? `${e} min` : "stored as minutes" })
88
+ /* @__PURE__ */ c("span", { className: "text-[11.5px] text-slate-400", children: Number.isFinite(e) && s != null && s !== "" ? `${e} min` : "stored as minutes" })
88
89
  ] });
89
90
  }
90
- function R({
91
- field: l,
92
- value: a,
91
+ function P({
92
+ field: s,
93
+ value: n,
93
94
  onChange: e,
94
- pairedValue: s
95
+ pairedValue: l
95
96
  }) {
96
- const o = v(l), d = Number.isFinite(Number(o.range_min)) ? Number(o.range_min) : 0, r = Number.isFinite(Number(o.range_max)) ? Number(o.range_max) : 100, t = o.range_end_field, n = Number(a ?? d), i = Number(s ?? r);
97
- return /* @__PURE__ */ b("div", { className: "py-1.5", children: [
98
- /* @__PURE__ */ b("div", { className: "flex items-center gap-3", children: [
97
+ const o = v(s), d = Number.isFinite(Number(o.range_min)) ? Number(o.range_min) : 0, r = Number.isFinite(Number(o.range_max)) ? Number(o.range_max) : 100, t = o.range_end_field, a = Number(n ?? d), i = Number(l ?? r);
98
+ return /* @__PURE__ */ x("div", { className: "py-1.5", children: [
99
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-3", children: [
99
100
  /* @__PURE__ */ c(
100
101
  "input",
101
102
  {
102
103
  type: "range",
103
104
  min: d,
104
105
  max: r,
105
- value: Number.isFinite(n) ? n : d,
106
+ value: Number.isFinite(a) ? a : d,
106
107
  onChange: (m) => e(Number(m.target.value)),
107
108
  className: "flex-1 accent-nvr-cyan",
108
- "aria-label": `${l.label ?? l.field} minimum`
109
+ "aria-label": `${s.label ?? s.field} minimum`
109
110
  }
110
111
  ),
111
112
  t && /* @__PURE__ */ c(
@@ -115,17 +116,17 @@ function R({
115
116
  min: d,
116
117
  max: r,
117
118
  value: Number.isFinite(i) ? i : r,
118
- onChange: (m) => N(t, Number(m.target.value)),
119
+ onChange: (m) => k(t, Number(m.target.value)),
119
120
  className: "flex-1 accent-[#172940]",
120
- "aria-label": `${l.label ?? l.field} maximum`
121
+ "aria-label": `${s.label ?? s.field} maximum`
121
122
  }
122
123
  )
123
124
  ] }),
124
- /* @__PURE__ */ b("p", { className: "mt-1 text-[12px] tabular-nums text-slate-500", children: [
125
- Number.isFinite(n) ? n : "—",
125
+ /* @__PURE__ */ x("p", { className: "mt-1 text-[12px] tabular-nums text-slate-500", children: [
126
+ Number.isFinite(a) ? a : "—",
126
127
  t ? ` – ${Number.isFinite(i) ? i : "—"}` : "",
127
128
  " ",
128
- /* @__PURE__ */ b("span", { className: "text-slate-400", children: [
129
+ /* @__PURE__ */ x("span", { className: "text-slate-400", children: [
129
130
  "(range ",
130
131
  d,
131
132
  "–",
@@ -135,44 +136,44 @@ function R({
135
136
  ] })
136
137
  ] });
137
138
  }
138
- function z({
139
- field: l,
140
- value: a,
139
+ function L({
140
+ field: s,
141
+ value: n,
141
142
  onChange: e,
142
- apiBase: s,
143
+ apiBase: l,
143
144
  authHeaders: o
144
145
  }) {
145
- const d = v(l), r = (() => {
146
- if (a && typeof a == "object") return a;
147
- if (typeof a == "string")
146
+ const d = v(s), r = (() => {
147
+ if (n && typeof n == "object") return n;
148
+ if (typeof n == "string")
148
149
  try {
149
- return JSON.parse(a);
150
+ return JSON.parse(n);
150
151
  } catch {
151
- return { street: a };
152
+ return { street: n };
152
153
  }
153
154
  return {};
154
- })(), [t, n] = y(!1), i = (u, f) => {
155
- const p = { ...r, [u]: f }, h = Object.values(p).every((x) => !x);
155
+ })(), [t, a] = N(!1), i = (u, f) => {
156
+ const p = { ...r, [u]: f }, h = Object.values(p).every((b) => !b);
156
157
  e(h ? null : JSON.stringify(p));
157
158
  }, m = async () => {
158
159
  var u, f;
159
- if (s) {
160
- n(!0);
160
+ if (l) {
161
+ a(!0);
161
162
  try {
162
- const p = [r.street, r.city, r.state, r.zip].filter(Boolean).join(", "), x = await (await fetch(`${s}/geocode`, {
163
+ const p = [r.street, r.city, r.state, r.zip].filter(Boolean).join(", "), b = await (await fetch(`${l}/geocode`, {
163
164
  method: "POST",
164
165
  headers: { ...o ?? {}, "content-type": "application/json" },
165
166
  credentials: "include",
166
167
  body: JSON.stringify({ q: p })
167
168
  })).json();
168
- ((u = x == null ? void 0 : x.data) == null ? void 0 : u.lat) != null && d.lat_field && N(d.lat_field, x.data.lat), ((f = x == null ? void 0 : x.data) == null ? void 0 : f.lng) != null && d.lng_field && N(d.lng_field, x.data.lng);
169
+ ((u = b == null ? void 0 : b.data) == null ? void 0 : u.lat) != null && d.lat_field && k(d.lat_field, b.data.lat), ((f = b == null ? void 0 : b.data) == null ? void 0 : f.lng) != null && d.lng_field && k(d.lng_field, b.data.lng);
169
170
  } catch {
170
171
  } finally {
171
- n(!1);
172
+ a(!1);
172
173
  }
173
174
  }
174
175
  };
175
- return /* @__PURE__ */ b("div", { className: "space-y-1.5", children: [
176
+ return /* @__PURE__ */ x("div", { className: "space-y-1.5", children: [
176
177
  /* @__PURE__ */ c(
177
178
  g,
178
179
  {
@@ -181,7 +182,7 @@ function z({
181
182
  placeholder: "Street address"
182
183
  }
183
184
  ),
184
- /* @__PURE__ */ b("div", { className: "flex gap-1.5", children: [
185
+ /* @__PURE__ */ x("div", { className: "flex gap-1.5", children: [
185
186
  /* @__PURE__ */ c(
186
187
  g,
187
188
  {
@@ -210,7 +211,7 @@ function z({
210
211
  }
211
212
  )
212
213
  ] }),
213
- (d.lat_field || d.lng_field) && /* @__PURE__ */ b(
214
+ (d.lat_field || d.lng_field) && /* @__PURE__ */ x(
214
215
  "button",
215
216
  {
216
217
  type: "button",
@@ -225,53 +226,53 @@ function z({
225
226
  )
226
227
  ] });
227
228
  }
228
- function P({
229
- value: l,
230
- onChange: a
229
+ function Q({
230
+ value: s,
231
+ onChange: n
231
232
  }) {
232
- const e = typeof l == "string" ? l.match(/^FY(\d{4})-Q([1-4])$/) : null, s = e ? Number(e[1]) : (/* @__PURE__ */ new Date()).getFullYear(), o = e ? Number(e[2]) : 1, d = (n, i) => a(`FY${n}-Q${i}`), r = Array.from({ length: 8 }, (n, i) => (/* @__PURE__ */ new Date()).getFullYear() - 3 + i), t = $(/* @__PURE__ */ new Date());
233
- return /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5", children: [
233
+ const e = typeof s == "string" ? s.match(/^FY(\d{4})-Q([1-4])$/) : null, l = e ? Number(e[1]) : (/* @__PURE__ */ new Date()).getFullYear(), o = e ? Number(e[2]) : 1, d = (a, i) => n(`FY${a}-Q${i}`), r = Array.from({ length: 8 }, (a, i) => (/* @__PURE__ */ new Date()).getFullYear() - 3 + i), t = $(/* @__PURE__ */ new Date());
234
+ return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
234
235
  /* @__PURE__ */ c(
235
236
  "button",
236
237
  {
237
238
  type: "button",
238
- onClick: () => a(t),
239
- "data-tip": `Set to the current period (fiscal year starts month ${_()})`,
240
- className: l === t ? "rounded-md bg-nvr-cyan/10 px-2 py-1.5 text-[11.5px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "rounded-md border border-slate-200 px-2 py-1.5 text-[11.5px] text-slate-500 hover:bg-muted dark:border-border",
239
+ onClick: () => n(t),
240
+ "data-tip": `Set to the current period (fiscal year starts month ${D()})`,
241
+ className: s === t ? "rounded-md bg-nvr-cyan/10 px-2 py-1.5 text-[11.5px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "rounded-md border border-slate-200 px-2 py-1.5 text-[11.5px] text-slate-500 hover:bg-muted dark:border-border",
241
242
  children: "Now"
242
243
  }
243
244
  ),
244
- /* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: r.slice(2, 6).map((n) => /* @__PURE__ */ b(
245
+ /* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: r.slice(2, 6).map((a) => /* @__PURE__ */ x(
245
246
  "button",
246
247
  {
247
248
  type: "button",
248
- onClick: () => d(n, o),
249
- className: e && s === n ? "bg-nvr-cyan/10 px-2 py-1.5 text-[12px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "px-2 py-1.5 text-[12px] text-slate-500 hover:bg-muted",
249
+ onClick: () => d(a, o),
250
+ className: e && l === a ? "bg-nvr-cyan/10 px-2 py-1.5 text-[12px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "px-2 py-1.5 text-[12px] text-slate-500 hover:bg-muted",
250
251
  children: [
251
252
  "FY",
252
- String(n).slice(2)
253
+ String(a).slice(2)
253
254
  ]
254
255
  },
255
- n
256
+ a
256
257
  )) }),
257
- /* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: [1, 2, 3, 4].map((n) => /* @__PURE__ */ b(
258
+ /* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: [1, 2, 3, 4].map((a) => /* @__PURE__ */ x(
258
259
  "button",
259
260
  {
260
261
  type: "button",
261
- onClick: () => d(s, n),
262
- className: e && o === n ? "bg-nvr-cyan/10 px-2 py-1.5 text-[12px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "px-2 py-1.5 text-[12px] text-slate-500 hover:bg-muted",
262
+ onClick: () => d(l, a),
263
+ className: e && o === a ? "bg-nvr-cyan/10 px-2 py-1.5 text-[12px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "px-2 py-1.5 text-[12px] text-slate-500 hover:bg-muted",
263
264
  children: [
264
265
  "Q",
265
- n
266
+ a
266
267
  ]
267
268
  },
268
- n
269
+ a
269
270
  )) }),
270
271
  e && /* @__PURE__ */ c(
271
272
  "button",
272
273
  {
273
274
  type: "button",
274
- onClick: () => a(null),
275
+ onClick: () => n(null),
275
276
  className: "px-1 text-[12px] text-slate-400 hover:text-red-500",
276
277
  "aria-label": "Clear fiscal period",
277
278
  children: "✕"
@@ -279,22 +280,22 @@ function P({
279
280
  )
280
281
  ] });
281
282
  }
282
- function L({
283
- value: l,
284
- onChange: a
283
+ function Z({
284
+ value: s,
285
+ onChange: n
285
286
  }) {
286
287
  const e = (() => {
287
- const t = typeof l == "string" ? (() => {
288
+ const t = typeof s == "string" ? (() => {
288
289
  try {
289
- return JSON.parse(l);
290
+ return JSON.parse(s);
290
291
  } catch {
291
292
  return [];
292
293
  }
293
- })() : l;
294
- return Array.isArray(t) ? t.filter((n) => n && typeof n.text == "string").map((n) => ({ text: n.text, done: !!n.done })) : [];
295
- })(), [s, o] = y(""), d = (t) => a(t.length > 0 ? JSON.stringify(t) : null), r = e.filter((t) => t.done).length;
296
- return /* @__PURE__ */ b("div", { className: "rounded-md border border-input bg-background p-2", children: [
297
- e.length > 0 && /* @__PURE__ */ c("p", { className: "mb-1.5 text-[11px] tabular-nums text-slate-400", children: /* @__PURE__ */ b(
294
+ })() : s;
295
+ return Array.isArray(t) ? t.filter((a) => a && typeof a.text == "string").map((a) => ({ text: a.text, done: !!a.done })) : [];
296
+ })(), [l, o] = N(""), d = (t) => n(t.length > 0 ? JSON.stringify(t) : null), r = e.filter((t) => t.done).length;
297
+ return /* @__PURE__ */ x("div", { className: "rounded-md border border-input bg-background p-2", children: [
298
+ e.length > 0 && /* @__PURE__ */ c("p", { className: "mb-1.5 text-[11px] tabular-nums text-slate-400", children: /* @__PURE__ */ x(
298
299
  "span",
299
300
  {
300
301
  className: r === e.length ? "rounded-full bg-emerald-100 px-1.5 py-px font-medium text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300" : "rounded-full bg-slate-100 px-1.5 py-px font-medium text-slate-500 dark:bg-muted",
@@ -306,14 +307,14 @@ function L({
306
307
  ]
307
308
  }
308
309
  ) }),
309
- /* @__PURE__ */ c("ul", { className: "space-y-1", children: e.map((t, n) => (
310
+ /* @__PURE__ */ c("ul", { className: "space-y-1", children: e.map((t, a) => (
310
311
  // biome-ignore lint/suspicious/noArrayIndexKey: positional list editor
311
- /* @__PURE__ */ b("li", { className: "group flex items-center gap-2", children: [
312
+ /* @__PURE__ */ x("li", { className: "group flex items-center gap-2", children: [
312
313
  /* @__PURE__ */ c(
313
314
  "button",
314
315
  {
315
316
  type: "button",
316
- onClick: () => d(e.map((i, m) => m === n ? { ...i, done: !i.done } : i)),
317
+ onClick: () => d(e.map((i, m) => m === a ? { ...i, done: !i.done } : i)),
317
318
  className: t.done ? "flex h-4 w-4 items-center justify-center rounded border border-emerald-500 bg-emerald-500" : "h-4 w-4 rounded border border-slate-300 hover:border-nvr-cyan dark:border-slate-600",
318
319
  "aria-label": t.done ? "Mark not done" : "Mark done",
319
320
  children: t.done && /* @__PURE__ */ c(F, { className: "h-3 w-3 text-white" })
@@ -330,21 +331,21 @@ function L({
330
331
  "button",
331
332
  {
332
333
  type: "button",
333
- onClick: () => d(e.filter((i, m) => m !== n)),
334
+ onClick: () => d(e.filter((i, m) => m !== a)),
334
335
  className: "hidden text-slate-300 hover:text-red-500 group-hover:inline",
335
336
  "aria-label": `Remove ${t.text}`,
336
337
  children: "×"
337
338
  }
338
339
  )
339
- ] }, n)
340
+ ] }, a)
340
341
  )) }),
341
342
  /* @__PURE__ */ c(
342
343
  "input",
343
344
  {
344
- value: s,
345
+ value: l,
345
346
  onChange: (t) => o(t.target.value),
346
347
  onKeyDown: (t) => {
347
- t.key === "Enter" && s.trim() && (t.preventDefault(), d([...e, { text: s.trim(), done: !1 }]), o(""));
348
+ t.key === "Enter" && l.trim() && (t.preventDefault(), d([...e, { text: l.trim(), done: !1 }]), o(""));
348
349
  },
349
350
  placeholder: "+ Add item and press Enter",
350
351
  className: "mt-1.5 h-7 w-full rounded border border-dashed border-slate-200 bg-transparent px-2 text-[12.5px] outline-none focus:border-nvr-cyan dark:border-border"
@@ -352,19 +353,19 @@ function L({
352
353
  )
353
354
  ] });
354
355
  }
355
- function Q({
356
- field: l,
357
- value: a,
356
+ function B({
357
+ field: s,
358
+ value: n,
358
359
  onChange: e,
359
- pairedValue: s
360
+ pairedValue: l
360
361
  }) {
361
- const o = v(l).range_end_field, d = (r) => typeof r == "string" && r ? r.slice(0, 10) : "";
362
- return /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
362
+ const o = v(s).range_end_field, d = (r) => typeof r == "string" && r ? r.slice(0, 10) : "";
363
+ return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
363
364
  /* @__PURE__ */ c(
364
365
  g,
365
366
  {
366
367
  type: "date",
367
- value: d(a),
368
+ value: d(n),
368
369
  onChange: (r) => e(r.target.value || null),
369
370
  className: "w-40"
370
371
  }
@@ -374,55 +375,55 @@ function Q({
374
375
  g,
375
376
  {
376
377
  type: "date",
377
- value: d(s),
378
- onChange: (r) => N(o, r.target.value || null),
378
+ value: d(l),
379
+ onChange: (r) => k(o, r.target.value || null),
379
380
  className: "w-40"
380
381
  }
381
382
  ) : /* @__PURE__ */ c("span", { className: "text-[11.5px] text-amber-600", children: "set options.range_end_field" })
382
383
  ] });
383
384
  }
384
- function Z({ value: l }) {
385
- const [, a] = y(0);
385
+ function K({ value: s }) {
386
+ const [, n] = N(0);
386
387
  if (C(() => {
387
- const i = setInterval(() => a((m) => m + 1), 6e4);
388
+ const i = setInterval(() => n((m) => m + 1), 6e4);
388
389
  return () => clearInterval(i);
389
- }, []), typeof l != "string" || !l) return null;
390
- const e = new Date(l.length === 10 ? `${l}T00:00:00` : l);
390
+ }, []), typeof s != "string" || !s) return null;
391
+ const e = new Date(s.length === 10 ? `${s}T00:00:00` : s);
391
392
  if (Number.isNaN(e.getTime())) return null;
392
- const s = e.getTime() - Date.now(), o = s < 0, d = Math.abs(s), r = Math.floor(d / 864e5), t = Math.floor(d % 864e5 / 36e5), n = r > 0 ? `${r}d ${t}h` : `${t}h ${Math.floor(d % 36e5 / 6e4)}m`;
393
+ const l = e.getTime() - Date.now(), o = l < 0, d = Math.abs(l), r = Math.floor(d / 864e5), t = Math.floor(d % 864e5 / 36e5), a = r > 0 ? `${r}d ${t}h` : `${t}h ${Math.floor(d % 36e5 / 6e4)}m`;
393
394
  return /* @__PURE__ */ c(
394
395
  "span",
395
396
  {
396
397
  className: o ? "ml-2 rounded-full bg-red-100 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-red-700 dark:bg-red-500/15 dark:text-red-300" : r < 3 ? "ml-2 rounded-full bg-amber-100 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-amber-700 dark:bg-amber-500/15 dark:text-amber-300" : "ml-2 rounded-full bg-slate-100 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-muted-foreground",
397
398
  "data-tip": e.toLocaleString(),
398
- children: o ? `T+${n}` : `T−${n}`
399
+ children: o ? `T+${a}` : `T−${a}`
399
400
  }
400
401
  );
401
402
  }
402
- function B({
403
- field: l,
404
- value: a,
403
+ function W({
404
+ field: s,
405
+ value: n,
405
406
  onChange: e
406
407
  }) {
407
- const s = (() => {
408
- const i = w(l.repeater_schema);
408
+ const l = (() => {
409
+ const i = w(s.repeater_schema);
409
410
  return Array.isArray(i) ? i : [];
410
411
  })(), o = (() => {
411
- const i = typeof a == "string" ? w(a) : a;
412
+ const i = typeof n == "string" ? w(n) : n;
412
413
  return Array.isArray(i) ? i : [];
413
- })(), [d, r] = y(/* @__PURE__ */ new Set()), t = (i) => e(i.length > 0 ? JSON.stringify(i) : null), n = (i, m) => {
414
+ })(), [d, r] = N(/* @__PURE__ */ new Set()), t = (i) => e(i.length > 0 ? JSON.stringify(i) : null), a = (i, m) => {
414
415
  const u = i + m;
415
416
  if (u < 0 || u >= o.length) return;
416
417
  const f = [...o];
417
418
  [f[i], f[u]] = [f[u], f[i]], t(f);
418
419
  };
419
- return s.length === 0 ? /* @__PURE__ */ c("p", { className: "text-[12px] text-amber-600", children: "No repeater schema configured." }) : /* @__PURE__ */ b("div", { className: "space-y-1.5", children: [
420
+ return l.length === 0 ? /* @__PURE__ */ c("p", { className: "text-[12px] text-amber-600", children: "No repeater schema configured." }) : /* @__PURE__ */ x("div", { className: "space-y-1.5", children: [
420
421
  o.map((i, m) => {
421
- const u = d.has(m), f = s.slice(0, 2).map((p) => String(i[p.key] ?? "")).filter(Boolean).join(" · ");
422
+ const u = d.has(m), f = l.slice(0, 2).map((p) => String(i[p.key] ?? "")).filter(Boolean).join(" · ");
422
423
  return (
423
424
  // biome-ignore lint/suspicious/noArrayIndexKey: positional rows
424
- /* @__PURE__ */ b("div", { className: "rounded-md border border-slate-200 dark:border-border", children: [
425
- /* @__PURE__ */ b("div", { className: "flex items-center gap-1 border-b border-slate-100 bg-slate-50 px-2 py-1 dark:border-border/60 dark:bg-muted/40", children: [
425
+ /* @__PURE__ */ x("div", { className: "rounded-md border border-slate-200 dark:border-border", children: [
426
+ /* @__PURE__ */ x("div", { className: "flex items-center gap-1 border-b border-slate-100 bg-slate-50 px-2 py-1 dark:border-border/60 dark:bg-muted/40", children: [
426
427
  /* @__PURE__ */ c(
427
428
  "button",
428
429
  {
@@ -441,7 +442,7 @@ function B({
441
442
  "button",
442
443
  {
443
444
  type: "button",
444
- onClick: () => n(m, -1),
445
+ onClick: () => a(m, -1),
445
446
  disabled: m === 0,
446
447
  className: "px-1 text-[12px] text-slate-400 hover:text-slate-700 disabled:opacity-30",
447
448
  "aria-label": "Move up",
@@ -452,7 +453,7 @@ function B({
452
453
  "button",
453
454
  {
454
455
  type: "button",
455
- onClick: () => n(m, 1),
456
+ onClick: () => a(m, 1),
456
457
  disabled: m === o.length - 1,
457
458
  className: "px-1 text-[12px] text-slate-400 hover:text-slate-700 disabled:opacity-30",
458
459
  "aria-label": "Move down",
@@ -470,7 +471,7 @@ function B({
470
471
  }
471
472
  )
472
473
  ] }),
473
- !u && /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-1.5 p-2", children: s.map((p) => /* @__PURE__ */ b("label", { className: "block", children: [
474
+ !u && /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-1.5 p-2", children: l.map((p) => /* @__PURE__ */ x("label", { className: "block", children: [
474
475
  /* @__PURE__ */ c("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: p.label ?? p.key }),
475
476
  p.type === "boolean" ? /* @__PURE__ */ c(
476
477
  "input",
@@ -479,23 +480,29 @@ function B({
479
480
  checked: i[p.key] === !0,
480
481
  onChange: (h) => t(
481
482
  o.map(
482
- (x, k) => k === m ? { ...x, [p.key]: h.target.checked } : x
483
+ (b, y) => y === m ? { ...b, [p.key]: h.target.checked } : b
483
484
  )
484
485
  ),
485
486
  className: "mt-1 block h-4 w-4 accent-nvr-cyan"
486
487
  }
488
+ ) : p.type === "number" ? (
489
+ // Keeps "2.0" as typed until the next key (army 4 a01-15).
490
+ /* @__PURE__ */ c(
491
+ _,
492
+ {
493
+ type: "number",
494
+ value: i[p.key],
495
+ onValue: (h) => t(o.map((b, y) => y === m ? { ...b, [p.key]: h } : b)),
496
+ className: "mt-0.5 h-7 text-[12.5px]"
497
+ }
498
+ )
487
499
  ) : /* @__PURE__ */ c(
488
500
  g,
489
501
  {
490
- type: p.type === "number" ? "number" : p.type === "date" ? "date" : "text",
502
+ type: p.type === "date" ? "date" : "text",
491
503
  value: String(i[p.key] ?? ""),
492
504
  onChange: (h) => t(
493
- o.map(
494
- (x, k) => k === m ? {
495
- ...x,
496
- [p.key]: p.type === "number" ? h.target.value === "" ? null : Number(h.target.value) : h.target.value
497
- } : x
498
- )
505
+ o.map((b, y) => y === m ? { ...b, [p.key]: h.target.value } : b)
499
506
  ),
500
507
  className: "mt-0.5 h-7 text-[12.5px]"
501
508
  }
@@ -516,16 +523,16 @@ function B({
516
523
  ] });
517
524
  }
518
525
  export {
519
- z as AddressField,
520
- L as ChecklistField,
521
- Z as CountdownChip,
522
- Q as DateRangeField,
523
- J as DurationField,
524
- P as FiscalPeriodField,
525
- R as RangeSliderField,
526
- B as RepeaterField,
527
- Y as applyInputMask,
528
- E as maskFor,
529
- N as setSiblingField,
530
- I as smartParseDate
526
+ L as AddressField,
527
+ Z as ChecklistField,
528
+ K as CountdownChip,
529
+ B as DateRangeField,
530
+ z as DurationField,
531
+ Q as FiscalPeriodField,
532
+ P as RangeSliderField,
533
+ W as RepeaterField,
534
+ E as applyInputMask,
535
+ J as maskFor,
536
+ k as setSiblingField,
537
+ R as smartParseDate
531
538
  };