@nivaro/react 0.3.52 → 0.3.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +47 -3
  4. package/dist/shared/components/ItemEditForm.js +3851 -3821
  5. package/dist/shared/components/NotificationBell.js +163 -150
  6. package/dist/shared/components/PageRenderer.js +600 -549
  7. package/dist/shared/components/ProfileView.js +36 -34
  8. package/dist/shared/components/QueryStatStrip.js +96 -89
  9. package/dist/shared/components/QueryTable.js +214 -215
  10. package/dist/shared/components/ReportView.js +548 -529
  11. package/dist/shared/components/alerts/AlertManagerView.js +346 -320
  12. package/dist/shared/components/item-edit/CatalogPickerField.js +1300 -1219
  13. package/dist/shared/components/item-edit/FieldAffordances.js +145 -136
  14. package/dist/shared/components/item-edit/FieldRenderer.js +366 -326
  15. package/dist/shared/components/item-edit/InlineTableField.js +3047 -2932
  16. package/dist/shared/components/item-edit/NestedRelationEditor.js +149 -143
  17. package/dist/shared/components/item-edit/PlanGrid.js +718 -705
  18. package/dist/shared/components/item-edit/SummaryPanel.js +351 -337
  19. package/dist/shared/components/item-edit/line-qty.js +115 -53
  20. package/dist/shared/components/item-edit/save-refusal.js +18 -18
  21. package/dist/shared/components/item-edit/usePersonalDefaults.js +210 -207
  22. package/dist/shared/components/panels/CommentPanel.js +204 -197
  23. package/dist/shared/components/panels/ItemLockBanner.js +318 -291
  24. package/dist/shared/components/panels/PipelinePanel.js +1388 -1218
  25. package/dist/shared/components/panels/RecordIntegrityBanner.js +201 -172
  26. package/dist/shared/components/panels/RevisionsPanel.js +101 -106
  27. package/dist/shared/components/panels/TransitionRequirementsDialog.js +564 -534
  28. package/dist/shared/components/panels/requirement-side-effects.js +46 -29
  29. package/dist/shared/components/queue/QueueItemSheet.js +219 -146
  30. package/dist/shared/components/queue/QueueWorklist.js +738 -730
  31. package/dist/shared/components/widgets/ReviewListWidget.js +236 -201
  32. package/dist/shared/lib/activity-sentence.js +236 -227
  33. package/dist/shared/lib/record-ref.js +43 -34
  34. package/package.json +1 -1
@@ -1,116 +1,151 @@
1
- import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
- import { ExternalLink as qe } from "lucide-react";
3
- import { memo as Te, useContext as Je, useRef as J, useEffect as oe, useState as He } from "react";
4
- import { useDrilldown as Ve, useParentDraft as $e, RelationPathDataContext as Ge, useApiFetchConfig as Ke, fieldDrilldownConfig as V } from "../../context.js";
5
- import { getFieldInterface as We } from "../../lib/field-interfaces.js";
6
- import { precisionOf as Ye } from "../../lib/format-value.js";
7
- import { resolveOptionFilterTokens as ne } from "../../lib/option-filter-tokens.js";
8
- import { counterOf as ze } from "../../lib/placement-behaviour.js";
9
- import { choiceLabel as Ue } from "../../lib/utils.js";
10
- import { Badge as Qe } from "../ui/badge.js";
11
- import { Input as T } from "../ui/input.js";
12
- import { Label as Ce } from "../ui/label.js";
13
- import { NumberDraftInput as Xe } from "../ui/number-draft-input.js";
14
- import { SimpleSelect as Ze } from "../ui/SimpleSelect.js";
15
- import { Switch as Oe } from "../ui/switch.js";
16
- import { Textarea as $ } from "../ui/textarea.js";
17
- import { CatalogPickerField as et } from "./CatalogPickerField.js";
18
- import { columnMaxLength as me } from "./column-length.js";
19
- import { useFieldAffordances as tt } from "./FieldAffordances.js";
20
- import { ProgressField as ie, RatingScaleField as ae, DurationReadOnly as rt, ChecklistReadOnly as ot, ColorPackField as le, PhoneField as se, EmailField as nt, AddressAutocompleteField as it } from "./FieldPack.js";
21
- import { FilePickerField as at, FileM2MField as lt } from "./FilePickerField.js";
1
+ import { jsx as i, jsxs as h } from "react/jsx-runtime";
2
+ import { ExternalLink as Je } from "lucide-react";
3
+ import { memo as Ke, useContext as Ve, useRef as j, useEffect as re, useState as He, useLayoutEffect as $e } from "react";
4
+ import { useDrilldown as Ge, useParentDraft as We, RelationPathDataContext as Ye, useApiFetchConfig as ze, fieldDrilldownConfig as V } from "../../context.js";
5
+ import { getFieldInterface as Ue } from "../../lib/field-interfaces.js";
6
+ import { precisionOf as Qe } from "../../lib/format-value.js";
7
+ import { resolveOptionFilterTokens as oe } from "../../lib/option-filter-tokens.js";
8
+ import { counterOf as Xe } from "../../lib/placement-behaviour.js";
9
+ import { choiceLabel as Ze } from "../../lib/utils.js";
10
+ import { Badge as Ce } from "../ui/badge.js";
11
+ import { Input as L } from "../ui/input.js";
12
+ import { Label as Oe } from "../ui/label.js";
13
+ import { NumberDraftInput as et } from "../ui/number-draft-input.js";
14
+ import { SimpleSelect as tt } from "../ui/SimpleSelect.js";
15
+ import { Switch as rt } from "../ui/switch.js";
16
+ import { Textarea as me } from "../ui/textarea.js";
17
+ import { CatalogPickerField as ot } from "./CatalogPickerField.js";
18
+ import { columnMaxLength as pe } from "./column-length.js";
19
+ import { useFieldAffordances as nt } from "./FieldAffordances.js";
20
+ import { ProgressField as ne, RatingScaleField as ie, DurationReadOnly as it, ChecklistReadOnly as at, ColorPackField as ae, PhoneField as le, EmailField as lt, AddressAutocompleteField as st } from "./FieldPack.js";
21
+ import { FilePickerField as ct, FileM2MField as dt } from "./FilePickerField.js";
22
22
  import { formatDisplayValue as B } from "./GroupSection.js";
23
- import { parseJson as y, toLocalDatetime as st } from "./helpers.js";
24
- import { InlineGridField as ct } from "./InlineGridField.js";
25
- import { InlineTableField as dt } from "./InlineTableField.js";
26
- import { checkNumberEntry as ut } from "./line-qty.js";
27
- import { M2MSingleSelectCombobox as mt, M2MCombobox as pt } from "./M2MCombobox.js";
28
- import { MembershipSetField as yt } from "./MembershipSetField.js";
29
- import { PlanGridField as _t } from "./PlanGrid.js";
30
- import { smartParseDate as ft, CountdownChip as bt, DurationField as xt, FiscalPeriodField as ht, ChecklistField as gt, RepeaterField as vt, RangeSliderField as wt, DateRangeField as Nt, AddressField as kt, maskFor as Ft, applyInputMask as ce } from "./PolishFields.js";
31
- import { QuickCreateButton as At } from "./QuickCreateButton.js";
32
- import { RelationCombobox as Rt } from "./RelationCombobox.js";
33
- import { RelationGroupedCombobox as St } from "./RelationGroupedCombobox.js";
34
- import { RichTextEditor as jt } from "./RichTextEditor.js";
35
- function Dt({
36
- plugin: h,
23
+ import { parseJson as f, toLocalDatetime as ut } from "./helpers.js";
24
+ import { InlineGridField as mt } from "./InlineGridField.js";
25
+ import { InlineTableField as pt } from "./InlineTableField.js";
26
+ import { checkNumberEntry as yt } from "./line-qty.js";
27
+ import { M2MSingleSelectCombobox as ft, M2MCombobox as _t } from "./M2MCombobox.js";
28
+ import { MembershipSetField as bt } from "./MembershipSetField.js";
29
+ import { PlanGridField as xt } from "./PlanGrid.js";
30
+ import { smartParseDate as ht, CountdownChip as gt, DurationField as vt, FiscalPeriodField as wt, ChecklistField as Nt, RepeaterField as kt, RangeSliderField as Ft, DateRangeField as At, AddressField as Rt, maskFor as St, applyInputMask as se } from "./PolishFields.js";
31
+ import { QuickCreateButton as jt } from "./QuickCreateButton.js";
32
+ import { RelationCombobox as It } from "./RelationCombobox.js";
33
+ import { RelationGroupedCombobox as Dt } from "./RelationGroupedCombobox.js";
34
+ import { RichTextEditor as Mt } from "./RichTextEditor.js";
35
+ function Pt({
36
+ plugin: m,
37
37
  props: e
38
38
  }) {
39
- const i = J(null), a = J(void 0), p = J(e);
40
- return p.current = e, oe(() => {
41
- if (i.current)
42
- return i.current.innerHTML = "", a.current = h.mount(i.current, p.current), () => {
43
- var c, d;
44
- (d = (c = a.current) == null ? void 0 : c.destroy) == null || d.call(c), a.current = void 0;
39
+ const n = j(null), a = j(void 0), p = j(e);
40
+ return p.current = e, re(() => {
41
+ if (n.current)
42
+ return n.current.innerHTML = "", a.current = m.mount(n.current, p.current), () => {
43
+ var d, c;
44
+ (c = (d = a.current) == null ? void 0 : d.destroy) == null || c.call(d), a.current = void 0;
45
45
  };
46
- }, [h]), oe(() => {
47
- var c, d;
48
- (d = (c = a.current) == null ? void 0 : c.update) == null || d.call(c, e);
49
- }, [e]), /* @__PURE__ */ n("div", { ref: i, "data-custom-interface": h.interface });
46
+ }, [m]), re(() => {
47
+ var d, c;
48
+ (c = (d = a.current) == null ? void 0 : d.update) == null || c.call(d, e);
49
+ }, [e]), /* @__PURE__ */ i("div", { ref: n, "data-custom-interface": m.interface });
50
50
  }
51
- function de(h) {
52
- const e = h.validation_rules, i = Array.isArray(e) ? e : y(typeof e == "string" ? e : null);
53
- if (!Array.isArray(i)) return {};
54
- const a = (c) => {
55
- const d = /* @__PURE__ */ new Date();
56
- d.setDate(d.getDate() + c);
57
- const b = (v) => String(v).padStart(2, "0");
58
- return `${d.getFullYear()}-${b(d.getMonth() + 1)}-${b(d.getDate())}`;
51
+ function ce(m) {
52
+ const e = m.validation_rules, n = Array.isArray(e) ? e : f(typeof e == "string" ? e : null);
53
+ if (!Array.isArray(n)) return {};
54
+ const a = (d) => {
55
+ const c = /* @__PURE__ */ new Date();
56
+ c.setDate(c.getDate() + d);
57
+ const _ = (v) => String(v).padStart(2, "0");
58
+ return `${c.getFullYear()}-${_(c.getMonth() + 1)}-${_(c.getDate())}`;
59
59
  }, p = {};
60
- for (const c of i) {
61
- const d = Number(c == null ? void 0 : c.value);
62
- Number.isFinite(d) && ((c == null ? void 0 : c.type) === "min_days_from_today" && (p.min = a(d)), (c == null ? void 0 : c.type) === "max_days_from_today" && (p.max = a(d)));
60
+ for (const d of n) {
61
+ const c = Number(d == null ? void 0 : d.value);
62
+ Number.isFinite(c) && ((d == null ? void 0 : d.type) === "min_days_from_today" && (p.min = a(c)), (d == null ? void 0 : d.type) === "max_days_from_today" && (p.max = a(c)));
63
63
  }
64
64
  return p;
65
65
  }
66
- function ue(h) {
67
- const e = me(h), i = y(h.options), a = Number(i == null ? void 0 : i.max_length);
66
+ function de(m) {
67
+ const e = pe(m), n = f(m.options), a = Number(n == null ? void 0 : n.max_length);
68
68
  return Number.isFinite(a) && a > 0 ? e != null ? Math.min(e, a) : a : e ?? void 0;
69
69
  }
70
- const pr = Te(function({
70
+ function ye(m, e) {
71
+ const n = j(null), a = j(m), p = j(m);
72
+ p.current = m, $e(() => {
73
+ const c = n.current;
74
+ !c || m === a.current || (a.current = m, c.value !== m && (c.value = m));
75
+ }, [m]);
76
+ const d = (c) => {
77
+ c !== a.current && (e(c), a.current = c, queueMicrotask(() => {
78
+ const _ = n.current;
79
+ !_ || a.current !== c || p.current === c || (a.current = p.current, _.value = p.current);
80
+ }));
81
+ };
82
+ return {
83
+ ref: n,
84
+ defaultValue: m,
85
+ onChange: (c) => d(c.target.value),
86
+ onBlur: (c) => d(c.target.value)
87
+ };
88
+ }
89
+ function Bt({
90
+ value: m,
91
+ commit: e,
92
+ ...n
93
+ }) {
94
+ const a = ye(m, e);
95
+ return /* @__PURE__ */ i(L, { ...n, ...a });
96
+ }
97
+ function ue({
98
+ value: m,
99
+ commit: e,
100
+ ...n
101
+ }) {
102
+ const a = ye(m, e);
103
+ return /* @__PURE__ */ i(me, { ...n, ...a });
104
+ }
105
+ const br = Ke(function({
71
106
  field: e,
72
- value: i,
107
+ value: n,
73
108
  onChange: a,
74
109
  relations: p,
75
- collection: c,
76
- itemId: d,
77
- cascadeFilter: b,
110
+ collection: d,
111
+ itemId: c,
112
+ cascadeFilter: _,
78
113
  requiredParentLabel: v,
79
114
  narrowedBy: u,
80
115
  onCountChange: N,
81
- displayOnly: G,
82
- prefillParentId: pe,
83
- pinnedOption: K
116
+ displayOnly: H,
117
+ prefillParentId: fe,
118
+ pinnedOption: $
84
119
  }) {
85
- var U, Q, C, X, Z, O, ee, te, re;
86
- const j = Ve(), M = tt(), A = $e(), H = Je(Ge), D = A, _ = (() => {
120
+ var z, U, Q, X, Z, C, O, ee, te;
121
+ const I = Ge(), M = nt(), A = We(), K = Ve(Ye), D = A, b = (() => {
87
122
  try {
88
- return Ke();
123
+ return ze();
89
124
  } catch {
90
125
  return null;
91
126
  }
92
- })(), s = e.interface ?? "", W = J(We(s)).current;
93
- if (W)
94
- return /* @__PURE__ */ n(
95
- Dt,
127
+ })(), s = e.interface ?? "", G = j(Ue(s)).current;
128
+ if (G)
129
+ return /* @__PURE__ */ i(
130
+ Pt,
96
131
  {
97
- plugin: W,
132
+ plugin: G,
98
133
  props: {
99
- value: i,
134
+ value: n,
100
135
  onChange: a,
101
136
  field: { field: e.field, label: e.label, options: e.options },
102
- readOnly: !!e.readonly || !!G,
103
- collection: c,
104
- itemId: d || null
137
+ readOnly: !!e.readonly || !!H,
138
+ collection: d,
139
+ itemId: c || null
105
140
  }
106
141
  }
107
142
  );
108
143
  if (s === "file-image" || s === "file") {
109
- const r = y(e.options);
110
- return /* @__PURE__ */ n(
111
- at,
144
+ const r = f(e.options);
145
+ return /* @__PURE__ */ i(
146
+ ct,
112
147
  {
113
- value: i,
148
+ value: n,
114
149
  onChange: a,
115
150
  disabled: e.readonly,
116
151
  allowUpload: (r == null ? void 0 : r.allow_upload) !== !1,
@@ -118,39 +153,39 @@ const pr = Te(function({
118
153
  }
119
154
  );
120
155
  }
121
- const Y = !s || s.startsWith("relation-") || s === "select-multiple-m2m" || s.endsWith("-m2o") || s.endsWith("-m2m"), k = Y ? p.find(
122
- (r) => r.many_collection === c && r.many_field === e.field && !r.junction_field
156
+ const W = !s || s.startsWith("relation-") || s === "select-multiple-m2m" || s.endsWith("-m2o") || s.endsWith("-m2m"), k = W ? p.find(
157
+ (r) => r.many_collection === d && r.many_field === e.field && !r.junction_field
123
158
  ) : null;
124
159
  if (k != null && k.one_collection) {
125
160
  if (s === "relation-grouped") {
126
- const m = y(e.options);
127
- if (m != null && m.group_field && (m != null && m.option_field))
128
- return /* @__PURE__ */ n(
129
- St,
161
+ const y = f(e.options);
162
+ if (y != null && y.group_field && (y != null && y.option_field))
163
+ return /* @__PURE__ */ i(
164
+ Dt,
130
165
  {
131
166
  collection: k.one_collection,
132
- value: i,
167
+ value: n,
133
168
  onChange: a,
134
- groupField: m.group_field,
135
- optionField: m.option_field,
169
+ groupField: y.group_field,
170
+ optionField: y.option_field,
136
171
  disabled: e.readonly,
137
172
  placeholder: e.placeholder ?? void 0,
138
- extraFilter: b,
139
- pinned: K
173
+ extraFilter: _,
174
+ pinned: $
140
175
  }
141
176
  );
142
177
  }
143
- const r = j && i != null && i !== "" ? V(e) : null, o = y(e.options), l = ne(
178
+ const r = I && n != null && n !== "" ? V(e) : null, o = f(e.options), l = oe(
144
179
  o != null && o.option_filter && typeof o.option_filter == "object" ? o.option_filter : void 0,
145
180
  A == null ? void 0 : A.draft,
146
- d
147
- ), t = l ? b ? { _and: [l, b] } : l : b, f = /* @__PURE__ */ n(
148
- Rt,
181
+ c
182
+ ), t = l ? _ ? { _and: [l, _] } : l : _, x = /* @__PURE__ */ i(
183
+ It,
149
184
  {
150
185
  fieldKey: e.field,
151
- missPlacement: (M == null ? void 0 : M.layoutId) != null && M.pickerMisses !== !1 ? { layoutId: Number(M.layoutId), collection: c, field: e.field } : null,
186
+ missPlacement: (M == null ? void 0 : M.layoutId) != null && M.pickerMisses !== !1 ? { layoutId: Number(M.layoutId), collection: d, field: e.field } : null,
152
187
  collection: k.one_collection,
153
- value: i,
188
+ value: n,
154
189
  onChange: a,
155
190
  disabled: e.readonly,
156
191
  placeholder: e.placeholder ?? void 0,
@@ -159,47 +194,47 @@ const pr = Te(function({
159
194
  optionSort: typeof (o == null ? void 0 : o.option_sort) == "string" && o.option_sort ? o.option_sort : void 0,
160
195
  requiredParent: v ?? void 0,
161
196
  narrowedBy: u,
162
- pinned: K,
163
- facets: Array.isArray(o == null ? void 0 : o.picker_facets) ? o.picker_facets.map((m) => ({
164
- ...m,
197
+ pinned: $,
198
+ facets: Array.isArray(o == null ? void 0 : o.picker_facets) ? o.picker_facets.map((y) => ({
199
+ ...y,
165
200
  // Facet filters support the same '$parent.<field>' tokens (and
166
201
  // _and clause pruning) as option_filter, resolved from the same
167
202
  // parent draft — keeps facet option lists in sync with the main
168
203
  // option query's eligibility clauses.
169
- filter: m.filter && typeof m.filter == "object" ? ne(m.filter, A == null ? void 0 : A.draft, d) : void 0
204
+ filter: y.filter && typeof y.filter == "object" ? oe(y.filter, A == null ? void 0 : A.draft, c) : void 0
170
205
  })) : void 0
171
206
  }
172
207
  ), w = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
173
- return !r && !w ? f : /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
174
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: f }),
175
- w && /* @__PURE__ */ n(
176
- At,
208
+ return !r && !w ? x : /* @__PURE__ */ h("div", { className: "flex items-center gap-1.5", children: [
209
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: x }),
210
+ w && /* @__PURE__ */ i(
211
+ jt,
177
212
  {
178
213
  targetCollection: k.one_collection,
179
214
  config: w,
180
- onCreated: (m) => a(m)
215
+ onCreated: (y) => a(y)
181
216
  }
182
217
  ),
183
- r && /* @__PURE__ */ n(
218
+ r && /* @__PURE__ */ i(
184
219
  "button",
185
220
  {
186
221
  type: "button",
187
222
  title: "Open detail panel",
188
- onClick: () => j == null ? void 0 : j.open({
223
+ onClick: () => I == null ? void 0 : I.open({
189
224
  collection: k.one_collection,
190
- itemId: String(i),
225
+ itemId: String(n),
191
226
  layoutId: r.layout_id,
192
227
  width: r.width
193
228
  }),
194
229
  className: "shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-slate-800",
195
- children: /* @__PURE__ */ n(qe, { className: "h-3.5 w-3.5" })
230
+ children: /* @__PURE__ */ i(Je, { className: "h-3.5 w-3.5" })
196
231
  }
197
232
  )
198
233
  ] });
199
234
  }
200
- const L = Y && !k ? (() => {
235
+ const E = W && !k ? (() => {
201
236
  const r = p.find(
202
- (l) => l.one_collection === c && (l.one_field === e.field || l.junction_field != null && l.many_collection === e.field)
237
+ (l) => l.one_collection === d && (l.one_field === e.field || l.junction_field != null && l.many_collection === e.field)
203
238
  );
204
239
  if (!r) return null;
205
240
  if (r.junction_field) return r;
@@ -208,14 +243,14 @@ const pr = Te(function({
208
243
  );
209
244
  return o ? { ...r, junction_field: o.many_field } : null;
210
245
  })() : null;
211
- if (L) {
246
+ if (E) {
212
247
  if (s === "files-m2m") {
213
- const l = y(e.options);
214
- return /* @__PURE__ */ n(
215
- lt,
248
+ const l = f(e.options);
249
+ return /* @__PURE__ */ i(
250
+ dt,
216
251
  {
217
- relation: L,
218
- parentId: d,
252
+ relation: E,
253
+ parentId: c,
219
254
  allRelations: p,
220
255
  disabled: e.readonly,
221
256
  allowUpload: (l == null ? void 0 : l.allow_upload) !== !1,
@@ -224,26 +259,26 @@ const pr = Te(function({
224
259
  }
225
260
  );
226
261
  }
227
- const r = y(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
228
- return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ n(
229
- mt,
262
+ const r = f(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
263
+ return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ i(
264
+ ft,
230
265
  {
231
- relation: L,
232
- parentId: d,
266
+ relation: E,
267
+ parentId: c,
233
268
  allRelations: p,
234
- extraFilter: b,
269
+ extraFilter: _,
235
270
  optionSort: o,
236
271
  requiredParent: v ?? void 0,
237
272
  onCountChange: N,
238
- readOnly: G
273
+ readOnly: H
239
274
  }
240
- ) : /* @__PURE__ */ n(
241
- pt,
275
+ ) : /* @__PURE__ */ i(
276
+ _t,
242
277
  {
243
- relation: L,
244
- parentId: d,
278
+ relation: E,
279
+ parentId: c,
245
280
  allRelations: p,
246
- extraFilter: b,
281
+ extraFilter: _,
247
282
  optionSort: o,
248
283
  requiredParent: v ?? void 0,
249
284
  onCountChange: N,
@@ -252,69 +287,69 @@ const pr = Te(function({
252
287
  );
253
288
  }
254
289
  if (e.readonly && s !== "inline-table") {
255
- if (s === "relation-path" && i != null && i !== "" && j) {
256
- const l = V(e), t = H == null ? void 0 : H[e.field];
290
+ if (s === "relation-path" && n != null && n !== "" && I) {
291
+ const l = V(e), t = K == null ? void 0 : K[e.field];
257
292
  if (l && (t != null && t.target_collection) && t.ids.length > 0)
258
- return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: /* @__PURE__ */ n(
293
+ return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: /* @__PURE__ */ i(
259
294
  "button",
260
295
  {
261
296
  type: "button",
262
- onClick: () => j.open({
297
+ onClick: () => I.open({
263
298
  collection: t.target_collection,
264
299
  itemId: t.ids[0],
265
300
  layoutId: l.layout_id,
266
301
  width: l.width,
267
- title: String(i)
302
+ title: String(n)
268
303
  }),
269
304
  className: "text-left text-sm text-slate-700 underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-[#172940] hover:decoration-nvr-cyan dark:text-slate-200 dark:hover:text-nvr-cyan",
270
- children: B(i, e)
305
+ children: B(n, e)
271
306
  }
272
307
  ) });
273
308
  }
274
- const r = (U = e.options) == null ? void 0 : U.__live_delta;
309
+ const r = (z = e.options) == null ? void 0 : z.__live_delta;
275
310
  if (r && Number.isFinite(Number(r.live))) {
276
- const l = Number(r.original), t = Number(r.live) - (Number.isFinite(l) ? l : 0), f = Math.round(t * 100) / 100;
277
- return /* @__PURE__ */ x("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
278
- /* @__PURE__ */ n("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: B(r.original, e) }),
279
- /* @__PURE__ */ n("span", { className: "text-slate-300", "aria-hidden": !0, children: "→" }),
280
- /* @__PURE__ */ n("span", { className: "text-sm font-medium tabular-nums", children: B(r.live, e) }),
281
- f !== 0 && /* @__PURE__ */ x(
311
+ const l = Number(r.original), t = Number(r.live) - (Number.isFinite(l) ? l : 0), x = Math.round(t * 100) / 100;
312
+ return /* @__PURE__ */ h("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
313
+ /* @__PURE__ */ i("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: B(r.original, e) }),
314
+ /* @__PURE__ */ i("span", { className: "text-slate-300", "aria-hidden": !0, children: "→" }),
315
+ /* @__PURE__ */ i("span", { className: "text-sm font-medium tabular-nums", children: B(r.live, e) }),
316
+ x !== 0 && /* @__PURE__ */ h(
282
317
  "span",
283
318
  {
284
- className: `rounded px-1.5 py-px text-[11px] font-medium tabular-nums ${f > 0 ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400" : "bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400"}`,
319
+ className: `rounded px-1.5 py-px text-[11px] font-medium tabular-nums ${x > 0 ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400" : "bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400"}`,
285
320
  children: [
286
- f > 0 ? "+" : "−",
287
- B(Math.abs(f), e)
321
+ x > 0 ? "+" : "−",
322
+ B(Math.abs(x), e)
288
323
  ]
289
324
  }
290
325
  )
291
326
  ] });
292
327
  }
293
- if (s === "progress") return /* @__PURE__ */ n(ie, { value: i, onChange: a, readOnly: !0 });
328
+ if (s === "progress") return /* @__PURE__ */ i(ne, { value: n, onChange: a, readOnly: !0 });
294
329
  if (s === "rating") {
295
- const l = (Q = y(e.options)) == null ? void 0 : Q.rating_max;
296
- return /* @__PURE__ */ n(ae, { value: i, onChange: a, max: l ?? 5, readOnly: !0 });
330
+ const l = (U = f(e.options)) == null ? void 0 : U.rating_max;
331
+ return /* @__PURE__ */ i(ie, { value: n, onChange: a, max: l ?? 5, readOnly: !0 });
297
332
  }
298
- if (s === "duration") return /* @__PURE__ */ n(rt, { value: i });
299
- if (s === "checklist") return /* @__PURE__ */ n(ot, { value: i });
333
+ if (s === "duration") return /* @__PURE__ */ i(it, { value: n });
334
+ if (s === "checklist") return /* @__PURE__ */ i(at, { value: n });
300
335
  if (s === "color")
301
- return /* @__PURE__ */ n(le, { field: e, value: i, onChange: a, readOnly: !0 });
302
- if (s === "phone") return /* @__PURE__ */ n(se, { value: i, onChange: a, readOnly: !0 });
303
- const o = i == null ? /* @__PURE__ */ n("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof i == "boolean" ? /* @__PURE__ */ n(Qe, { variant: i ? "default" : "secondary", children: i ? "Yes" : "No" }) : /* @__PURE__ */ n("span", { className: "text-sm tabular-nums", children: B(i, e) });
304
- return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: o });
336
+ return /* @__PURE__ */ i(ae, { field: e, value: n, onChange: a, readOnly: !0 });
337
+ if (s === "phone") return /* @__PURE__ */ i(le, { value: n, onChange: a, readOnly: !0 });
338
+ const o = n == null ? /* @__PURE__ */ i("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof n == "boolean" ? /* @__PURE__ */ i(Ce, { variant: n ? "default" : "secondary", children: n ? "Yes" : "No" }) : /* @__PURE__ */ i("span", { className: "text-sm tabular-nums", children: B(n, e) });
339
+ return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: o });
305
340
  }
306
- const g = i == null ? "" : String(i);
341
+ const g = n == null ? "" : String(n);
307
342
  if (e.type === "boolean")
308
- return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
309
- /* @__PURE__ */ n(Oe, { checked: !!i, onCheckedChange: a }),
310
- /* @__PURE__ */ n(Ce, { className: "font-normal text-sm", children: i ? "Yes" : "No" })
343
+ return /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
344
+ /* @__PURE__ */ i(rt, { checked: !!n, onCheckedChange: a }),
345
+ /* @__PURE__ */ i(Oe, { className: "font-normal text-sm", children: n ? "Yes" : "No" })
311
346
  ] });
312
347
  if (e.type === "datetime" || s === "datetime") {
313
- const r = y(e.options);
348
+ const r = f(e.options);
314
349
  if ((r == null ? void 0 : r.date_mode) === "date") {
315
- const o = de(e);
316
- return /* @__PURE__ */ n(
317
- T,
350
+ const o = ce(e);
351
+ return /* @__PURE__ */ i(
352
+ L,
318
353
  {
319
354
  type: "date",
320
355
  value: g.slice(0, 10),
@@ -325,21 +360,21 @@ const pr = Te(function({
325
360
  }
326
361
  );
327
362
  }
328
- return /* @__PURE__ */ n(
329
- T,
363
+ return /* @__PURE__ */ i(
364
+ L,
330
365
  {
331
366
  type: "datetime-local",
332
- value: st(i),
367
+ value: ut(n),
333
368
  onChange: (o) => a(o.target.value ? new Date(o.target.value).toISOString() : null),
334
369
  placeholder: e.placeholder ?? void 0
335
370
  }
336
371
  );
337
372
  }
338
373
  if (e.type === "date" || s === "date") {
339
- const r = ((C = y(e.options)) == null ? void 0 : C.countdown) === !0, o = de(e);
340
- return /* @__PURE__ */ x("div", { className: "flex items-center", children: [
341
- /* @__PURE__ */ n(
342
- T,
374
+ const r = ((Q = f(e.options)) == null ? void 0 : Q.countdown) === !0, o = ce(e);
375
+ return /* @__PURE__ */ h("div", { className: "flex items-center", children: [
376
+ /* @__PURE__ */ i(
377
+ L,
343
378
  {
344
379
  type: "date",
345
380
  value: g.slice(0, 10),
@@ -347,14 +382,14 @@ const pr = Te(function({
347
382
  max: o.max,
348
383
  onChange: (l) => a(l.target.value || null),
349
384
  onPaste: (l) => {
350
- const t = ft(l.clipboardData.getData("text"));
385
+ const t = ht(l.clipboardData.getData("text"));
351
386
  t && (l.preventDefault(), a(t));
352
387
  },
353
388
  placeholder: e.placeholder ?? void 0,
354
389
  className: "flex-1"
355
390
  }
356
391
  ),
357
- r && /* @__PURE__ */ n(bt, { value: g.slice(0, 10) })
392
+ r && /* @__PURE__ */ i(gt, { value: g.slice(0, 10) })
358
393
  ] });
359
394
  }
360
395
  if ([
@@ -375,36 +410,36 @@ const pr = Te(function({
375
410
  ].includes(e.type)) {
376
411
  const r = ["integer", "bigInteger", "int", "bigint", "smallint", "tinyint"].includes(
377
412
  e.type
378
- ), o = r ? 0 : Ye(e.options, -1), l = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = ut(i, { type: e.type, label: e.label || "Value" }), f = t.ok ? null : t.message;
379
- return /* @__PURE__ */ x("div", { children: [
380
- /* @__PURE__ */ n(
381
- Xe,
413
+ ), o = r ? 0 : Qe(e.options, -1), l = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = yt(n, { type: e.type, label: e.label || "Value" }), x = t.ok ? null : t.message;
414
+ return /* @__PURE__ */ h("div", { children: [
415
+ /* @__PURE__ */ i(
416
+ et,
382
417
  {
383
418
  type: "number",
384
- "aria-invalid": f ? !0 : void 0,
419
+ "aria-invalid": x ? !0 : void 0,
385
420
  step: l,
386
- value: i,
421
+ value: n,
387
422
  onValue: a,
388
423
  onBlur: (w) => {
389
424
  if (o < 0 || w.target.value === "") return;
390
- const m = Number(w.target.value);
391
- if (!Number.isFinite(m)) return;
392
- const E = Number(m.toFixed(o));
393
- E !== m && a(E);
425
+ const y = Number(w.target.value);
426
+ if (!Number.isFinite(y)) return;
427
+ const q = Number(y.toFixed(o));
428
+ q !== y && a(q);
394
429
  },
395
430
  placeholder: e.placeholder ?? void 0
396
431
  }
397
432
  ),
398
- f && /* @__PURE__ */ n("p", { className: "mt-1 text-[11.5px] text-red-600 dark:text-red-400", "data-number-entry-error": !0, children: f })
433
+ x && /* @__PURE__ */ i("p", { className: "mt-1 text-[11.5px] text-red-600 dark:text-red-400", "data-number-entry-error": !0, children: x })
399
434
  ] });
400
435
  }
401
436
  if (e.type === "json" || s === "code")
402
- return /* @__PURE__ */ n(
403
- $,
437
+ return /* @__PURE__ */ i(
438
+ me,
404
439
  {
405
440
  className: "font-mono text-xs",
406
441
  rows: 4,
407
- value: typeof i == "object" ? JSON.stringify(i, null, 2) : g,
442
+ value: typeof n == "object" ? JSON.stringify(n, null, 2) : g,
408
443
  onChange: (r) => {
409
444
  try {
410
445
  a(JSON.parse(r.target.value));
@@ -416,157 +451,157 @@ const pr = Te(function({
416
451
  }
417
452
  );
418
453
  if (s === "textarea")
419
- return /* @__PURE__ */ n(
420
- $,
454
+ return /* @__PURE__ */ i(
455
+ ue,
421
456
  {
422
457
  rows: 4,
423
- maxLength: ue(e),
458
+ maxLength: de(e),
424
459
  value: g,
425
- onChange: (r) => a(r.target.value),
460
+ commit: a,
426
461
  placeholder: e.placeholder ?? void 0
427
462
  }
428
463
  );
429
464
  if (s === "wysiwyg" || s === "markdown")
430
- return /* @__PURE__ */ n(
431
- $,
465
+ return /* @__PURE__ */ i(
466
+ ue,
432
467
  {
433
468
  rows: 6,
434
469
  value: g,
435
- onChange: (r) => a(r.target.value),
470
+ commit: a,
436
471
  placeholder: e.placeholder ?? void 0,
437
472
  className: "font-mono text-sm"
438
473
  }
439
474
  );
440
475
  if (s === "input-rich-text-html" || s === "rich_text" || e.type === "rich_text" || s === "extension-editorjs")
441
- return /* @__PURE__ */ n(
442
- jt,
476
+ return /* @__PURE__ */ i(
477
+ Mt,
443
478
  {
444
479
  value: g,
445
480
  onChange: a,
446
481
  placeholder: e.placeholder ?? void 0,
447
482
  disabled: e.readonly,
448
- pastePlain: ((X = y(e.options)) == null ? void 0 : X.paste_plain) === !0
483
+ pastePlain: ((X = f(e.options)) == null ? void 0 : X.paste_plain) === !0
449
484
  }
450
485
  );
451
486
  if (s === "inline-grid" || s === "relation-list" || s === "list-o2m") {
452
487
  const r = p.find(
453
- (o) => o.one_collection === c && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
488
+ (o) => o.one_collection === d && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
454
489
  );
455
490
  if (r) {
456
491
  const o = r.many_collection ?? null, l = r.many_field ?? null;
457
- if (o && l && d) {
458
- const f = (typeof e.options == "string" ? (() => {
492
+ if (o && l && c) {
493
+ const x = (typeof e.options == "string" ? (() => {
459
494
  try {
460
495
  return JSON.parse(e.options);
461
496
  } catch {
462
497
  return {};
463
498
  }
464
499
  })() : e.options ?? {}).layout_slug ?? null;
465
- return /* @__PURE__ */ n(
466
- ct,
500
+ return /* @__PURE__ */ i(
501
+ mt,
467
502
  {
468
503
  relatedCollection: o,
469
504
  manyField: l,
470
- parentId: d,
471
- layoutSlug: f,
505
+ parentId: c,
506
+ layoutSlug: x,
472
507
  parentFieldKey: e.field,
473
508
  emptyLabel: e.label || void 0
474
509
  }
475
510
  );
476
511
  }
477
- return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline grid editing not available in embedded form" });
512
+ return /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline grid editing not available in embedded form" });
478
513
  }
479
514
  }
480
515
  if (s === "inline-table") {
481
516
  const r = p.find(
482
- (o) => o.one_collection === c && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
517
+ (o) => o.one_collection === d && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
483
518
  );
484
519
  if (r) {
485
520
  const o = r.many_collection ?? null, l = r.many_field ?? null;
486
- if (o && l && d) {
521
+ if (o && l && c) {
487
522
  const t = typeof e.options == "string" ? (() => {
488
523
  try {
489
524
  return JSON.parse(e.options);
490
525
  } catch {
491
526
  return {};
492
527
  }
493
- })() : e.options ?? {}, f = t.layout_id ?? null, w = !!t.show_row_revisions, m = !!t.row_comments, E = t.allow_revision_restore !== !1, _e = t.save_mode ?? "immediate", fe = !!t.show_line_numbers, be = t.enable_reorder !== !1, xe = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, he = Array.isArray(t.row_rules) ? t.row_rules : void 0, ge = Array.isArray(t.column_presets) ? t.column_presets : void 0, ve = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, we = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, Ne = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, ke = Array.isArray(t.unique_by) ? t.unique_by : void 0, Fe = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, Ae = t.sort_dir === "desc" ? "desc" : "asc", Re = t.freeze_first_column === !0, Se = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, je = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, De = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, Ie = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Me = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Pe = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Be = t.row_match_panel ?? void 0, Le = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Ee = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, R = t.membership_set;
528
+ })() : e.options ?? {}, x = t.layout_id ?? null, w = !!t.show_row_revisions, y = !!t.row_comments, q = t.allow_revision_restore !== !1, be = t.save_mode ?? "immediate", xe = !!t.show_line_numbers, he = t.enable_reorder !== !1, ge = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, ve = Array.isArray(t.row_rules) ? t.row_rules : void 0, we = Array.isArray(t.column_presets) ? t.column_presets : void 0, Ne = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, ke = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, Fe = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, Ae = Array.isArray(t.unique_by) ? t.unique_by : void 0, Re = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, Se = t.sort_dir === "desc" ? "desc" : "asc", je = t.freeze_first_column === !0, Ie = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, De = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, Me = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, Pe = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Be = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Le = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Ee = t.row_match_panel ?? void 0, Te = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, qe = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, R = t.membership_set;
494
529
  if (R != null && R.key_field && (R != null && R.value_field))
495
- return /* @__PURE__ */ n(
496
- yt,
530
+ return /* @__PURE__ */ i(
531
+ bt,
497
532
  {
498
533
  relatedCollection: o,
499
534
  manyField: l,
500
- parentId: d,
535
+ parentId: c,
501
536
  config: R,
502
537
  readOnly: e.readonly
503
538
  }
504
539
  );
505
540
  const S = t.catalog_mode;
506
541
  if (S != null && S.item_field && (S != null && S.section_by))
507
- return /* @__PURE__ */ n(
508
- et,
542
+ return /* @__PURE__ */ i(
543
+ ot,
509
544
  {
510
545
  relatedCollection: o,
511
546
  manyField: l,
512
- parentId: d,
513
- parentCollection: c,
547
+ parentId: c,
548
+ parentCollection: d,
514
549
  config: S,
515
550
  readOnly: e.readonly
516
551
  }
517
552
  );
518
553
  const F = t.row_split;
519
554
  if (F != null && F.key_field && (F != null && F.category_field) && Array.isArray(F.value_fields)) {
520
- const q = t.spread_remaining;
521
- return /* @__PURE__ */ n(
522
- _t,
555
+ const J = t.spread_remaining;
556
+ return /* @__PURE__ */ i(
557
+ xt,
523
558
  {
524
559
  relatedCollection: o,
525
560
  manyField: l,
526
- parentId: d,
561
+ parentId: c,
527
562
  config: F,
528
563
  compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
529
564
  stats: Array.isArray(t.stats) ? t.stats : null,
530
565
  sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
531
- remaining: typeof (q == null ? void 0 : q.remaining) == "string" ? q.remaining : null,
566
+ remaining: typeof (J == null ? void 0 : J.remaining) == "string" ? J.remaining : null,
532
567
  readOnly: e.readonly,
533
568
  showHistory: w,
534
569
  emptyLabel: e.label || void 0
535
570
  }
536
571
  );
537
572
  }
538
- return /* @__PURE__ */ n(
539
- dt,
573
+ return /* @__PURE__ */ i(
574
+ pt,
540
575
  {
541
576
  relatedCollection: o,
542
577
  manyField: l,
543
- parentId: d,
544
- parentCollection: c,
545
- layoutId: f,
578
+ parentId: c,
579
+ parentCollection: d,
580
+ layoutId: x,
546
581
  showRowRevisions: w,
547
- rowComments: m,
548
- allowRevisionRestore: E,
549
- saveMode: _e,
550
- showLineNumbers: fe,
551
- enableReorder: be,
552
- parentCascades: xe,
553
- rowRules: he,
554
- columnPresets: ge,
555
- defaultPreset: ve,
556
- drawerRelations: we,
557
- parentContextFields: Ne,
558
- uniqueBy: ke,
559
- sortField: Fe,
560
- sortDir: Ae,
561
- sectionGroupBy: Se,
562
- freezeFirstColumn: Re,
563
- rowFilter: je,
564
- rowDefaults: Le,
565
- allocateDrawer: De,
566
- autoAllocate: Ie,
567
- rowBulkActions: Me,
568
- uploadTemplate: Pe,
569
- rowMatchPanel: Be,
582
+ rowComments: y,
583
+ allowRevisionRestore: q,
584
+ saveMode: be,
585
+ showLineNumbers: xe,
586
+ enableReorder: he,
587
+ parentCascades: ge,
588
+ rowRules: ve,
589
+ columnPresets: we,
590
+ defaultPreset: Ne,
591
+ drawerRelations: ke,
592
+ parentContextFields: Fe,
593
+ uniqueBy: Ae,
594
+ sortField: Re,
595
+ sortDir: Se,
596
+ sectionGroupBy: Ie,
597
+ freezeFirstColumn: je,
598
+ rowFilter: De,
599
+ rowDefaults: Te,
600
+ allocateDrawer: Me,
601
+ autoAllocate: Pe,
602
+ rowBulkActions: Be,
603
+ uploadTemplate: Le,
604
+ rowMatchPanel: Ee,
570
605
  lineSla: t.line_sla ?? null,
571
606
  editorMode: t.editor_mode === "split" ? "split" : "drawer",
572
607
  rowLints: Array.isArray(t.row_lints) ? t.row_lints : null,
@@ -574,8 +609,8 @@ const pr = Te(function({
574
609
  sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
575
610
  spreadRemaining: t.spread_remaining && typeof t.spread_remaining == "object" ? t.spread_remaining : null,
576
611
  compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
577
- submissionErrors: Ee,
578
- prefillParentId: pe,
612
+ submissionErrors: qe,
613
+ prefillParentId: fe,
579
614
  parentFieldKey: e.field,
580
615
  readOnly: e.readonly,
581
616
  emptyLabel: e.label || void 0
@@ -583,118 +618,122 @@ const pr = Te(function({
583
618
  );
584
619
  }
585
620
  }
586
- return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
621
+ return /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
587
622
  }
588
- if (s === "color") return /* @__PURE__ */ n(le, { field: e, value: i, onChange: a });
623
+ if (s === "color") return /* @__PURE__ */ i(ae, { field: e, value: n, onChange: a });
589
624
  if (s === "rating") {
590
- const r = (Z = y(e.options)) == null ? void 0 : Z.rating_max;
591
- return /* @__PURE__ */ n(ae, { value: i, onChange: a, max: r ?? 5 });
625
+ const r = (Z = f(e.options)) == null ? void 0 : Z.rating_max;
626
+ return /* @__PURE__ */ i(ie, { value: n, onChange: a, max: r ?? 5 });
592
627
  }
593
- if (s === "progress") return /* @__PURE__ */ n(ie, { value: i, onChange: a });
628
+ if (s === "progress") return /* @__PURE__ */ i(ne, { value: n, onChange: a });
594
629
  if (s === "phone")
595
- return /* @__PURE__ */ n(se, { value: i, onChange: a, placeholder: e.placeholder ?? void 0 });
630
+ return /* @__PURE__ */ i(le, { value: n, onChange: a, placeholder: e.placeholder ?? void 0 });
596
631
  if (s === "email")
597
- return /* @__PURE__ */ n(nt, { value: i, onChange: a, placeholder: e.placeholder ?? void 0 });
632
+ return /* @__PURE__ */ i(lt, { value: n, onChange: a, placeholder: e.placeholder ?? void 0 });
598
633
  if (s === "address-autocomplete")
599
- return /* @__PURE__ */ n(
600
- it,
634
+ return /* @__PURE__ */ i(
635
+ st,
601
636
  {
602
637
  field: e,
603
- value: i,
638
+ value: n,
604
639
  onChange: a,
605
- apiBase: _ == null ? void 0 : _.apiBase,
606
- authHeaders: _ == null ? void 0 : _.authHeaders,
607
- credentials: _ == null ? void 0 : _.credentials,
640
+ apiBase: b == null ? void 0 : b.apiBase,
641
+ authHeaders: b == null ? void 0 : b.authHeaders,
642
+ credentials: b == null ? void 0 : b.credentials,
608
643
  placeholder: e.placeholder ?? void 0
609
644
  }
610
645
  );
611
- if (s === "duration") return /* @__PURE__ */ n(xt, { value: i, onChange: a });
612
- if (s === "fiscal_period") return /* @__PURE__ */ n(ht, { value: i, onChange: a });
613
- if (s === "checklist") return /* @__PURE__ */ n(gt, { value: i, onChange: a });
646
+ if (s === "duration") return /* @__PURE__ */ i(vt, { value: n, onChange: a });
647
+ if (s === "fiscal_period") return /* @__PURE__ */ i(wt, { value: n, onChange: a });
648
+ if (s === "checklist") return /* @__PURE__ */ i(Nt, { value: n, onChange: a });
614
649
  if (s === "repeater" || e.repeater_schema && e.type === "json")
615
- return /* @__PURE__ */ n(vt, { field: e, value: i, onChange: a });
650
+ return /* @__PURE__ */ i(kt, { field: e, value: n, onChange: a });
616
651
  if (s === "range_slider") {
617
- const r = (O = y(e.options)) == null ? void 0 : O.range_end_field;
618
- return /* @__PURE__ */ n(
619
- wt,
652
+ const r = (C = f(e.options)) == null ? void 0 : C.range_end_field;
653
+ return /* @__PURE__ */ i(
654
+ Ft,
620
655
  {
621
656
  field: e,
622
- value: i,
657
+ value: n,
623
658
  onChange: a,
624
- pairedValue: r ? (ee = D == null ? void 0 : D.draft) == null ? void 0 : ee[r] : void 0
659
+ pairedValue: r ? (O = D == null ? void 0 : D.draft) == null ? void 0 : O[r] : void 0
625
660
  }
626
661
  );
627
662
  }
628
663
  if (s === "date_range") {
629
- const r = (te = y(e.options)) == null ? void 0 : te.range_end_field;
630
- return /* @__PURE__ */ n(
631
- Nt,
664
+ const r = (ee = f(e.options)) == null ? void 0 : ee.range_end_field;
665
+ return /* @__PURE__ */ i(
666
+ At,
632
667
  {
633
668
  field: e,
634
- value: i,
669
+ value: n,
635
670
  onChange: a,
636
- pairedValue: r ? (re = D == null ? void 0 : D.draft) == null ? void 0 : re[r] : void 0
671
+ pairedValue: r ? (te = D == null ? void 0 : D.draft) == null ? void 0 : te[r] : void 0
637
672
  }
638
673
  );
639
674
  }
640
675
  if (s === "address")
641
- return /* @__PURE__ */ n(
642
- kt,
676
+ return /* @__PURE__ */ i(
677
+ Rt,
643
678
  {
644
679
  field: e,
645
- value: i,
680
+ value: n,
646
681
  onChange: a,
647
- apiBase: _ == null ? void 0 : _.apiBase,
648
- authHeaders: _ == null ? void 0 : _.authHeaders
682
+ apiBase: b == null ? void 0 : b.apiBase,
683
+ authHeaders: b == null ? void 0 : b.authHeaders
649
684
  }
650
685
  );
651
686
  if (s === "tags")
652
- return /* @__PURE__ */ n(It, { field: e, value: i, onChange: a });
687
+ return /* @__PURE__ */ i(Lt, { field: e, value: n, onChange: a });
653
688
  if (s === "select-dropdown" || s === "radio-buttons") {
654
689
  const r = (() => {
655
- const o = y(e.options);
690
+ const o = f(e.options);
656
691
  return (o == null ? void 0 : o.choices) ?? [];
657
692
  })();
658
693
  if (r.length > 0)
659
- return /* @__PURE__ */ n(
660
- Ze,
694
+ return /* @__PURE__ */ i(
695
+ tt,
661
696
  {
662
697
  value: g,
663
698
  onChange: (o) => a(o || null),
664
699
  options: [
665
700
  { value: "", label: "— Select —" },
666
- ...r.map((o) => ({ value: o.value, label: Ue(o.text) }))
701
+ ...r.map((o) => ({ value: o.value, label: Ze(o.text) }))
667
702
  ],
668
703
  ariaLabel: e.label ?? e.field,
669
704
  className: "h-9 rounded-md text-sm"
670
705
  }
671
706
  );
672
707
  }
673
- const I = Ft(e), ye = me(e), P = (() => {
674
- const r = y(e.options);
708
+ const T = St(e), _e = pe(e), P = (() => {
709
+ const r = f(e.options);
675
710
  if (Number.isFinite(Number(r == null ? void 0 : r.max_length))) return Number(r == null ? void 0 : r.max_length);
676
- const o = y(e.validation_rules), l = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
677
- return l && Number.isFinite(Number(l.value)) ? Number(l.value) : ye;
678
- })(), z = /* @__PURE__ */ n(
679
- T,
711
+ const o = f(e.validation_rules), l = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
712
+ return l && Number.isFinite(Number(l.value)) ? Number(l.value) : _e;
713
+ })(), Y = T ? /* @__PURE__ */ i(
714
+ L,
680
715
  {
681
- maxLength: I ? void 0 : ue(e),
682
- value: I ? ce(I, g).display : g,
716
+ value: se(T, g).display,
683
717
  onChange: (r) => {
684
- if (I) {
685
- const { clean: o } = ce(I, r.target.value);
686
- a(o || null);
687
- } else
688
- a(r.target.value || null);
718
+ const { clean: o } = se(T, r.target.value);
719
+ a(o || null);
689
720
  },
690
- placeholder: e.placeholder ?? I ?? void 0
721
+ placeholder: e.placeholder ?? T ?? void 0
722
+ }
723
+ ) : /* @__PURE__ */ i(
724
+ Bt,
725
+ {
726
+ maxLength: de(e),
727
+ value: g,
728
+ commit: (r) => a(r || null),
729
+ placeholder: e.placeholder ?? void 0
691
730
  }
692
731
  );
693
- if (P != null && P > 0 && !ze(e._overrides)) {
732
+ if (P != null && P > 0 && !Xe(e._overrides)) {
694
733
  const r = g.length;
695
- return /* @__PURE__ */ x("div", { children: [
696
- z,
697
- r >= P * 0.6 && /* @__PURE__ */ x(
734
+ return /* @__PURE__ */ h("div", { children: [
735
+ Y,
736
+ r >= P * 0.6 && /* @__PURE__ */ h(
698
737
  "p",
699
738
  {
700
739
  className: r > P ? "mt-0.5 text-right text-[10.5px] tabular-nums text-red-500" : "mt-0.5 text-right text-[10.5px] tabular-nums text-slate-400",
@@ -707,14 +746,14 @@ const pr = Te(function({
707
746
  )
708
747
  ] });
709
748
  }
710
- return z;
749
+ return Y;
711
750
  });
712
- function It({
713
- field: h,
751
+ function Lt({
752
+ field: m,
714
753
  value: e,
715
- onChange: i
754
+ onChange: n
716
755
  }) {
717
- const [a, p] = He(""), c = (() => {
756
+ const [a, p] = He(""), d = (() => {
718
757
  if (Array.isArray(e)) return e.map(String);
719
758
  if (typeof e == "string" && e.trim().startsWith("["))
720
759
  try {
@@ -724,27 +763,27 @@ function It({
724
763
  return [];
725
764
  }
726
765
  return typeof e == "string" && e.trim() !== "" ? [e] : [];
727
- })(), d = (() => {
728
- const u = y(h.options);
766
+ })(), c = (() => {
767
+ const u = f(m.options);
729
768
  return Array.isArray(u == null ? void 0 : u.tag_options) ? u.tag_options.map(String) : [];
730
- })(), b = (u) => i(u.length > 0 ? JSON.stringify(u) : null), v = (u) => {
769
+ })(), _ = (u) => n(u.length > 0 ? JSON.stringify(u) : null), v = (u) => {
731
770
  const N = u.trim();
732
- !N || c.includes(N) || (b([...c, N]), p(""));
771
+ !N || d.includes(N) || (_([...d, N]), p(""));
733
772
  };
734
- return /* @__PURE__ */ x("div", { className: "rounded-md border border-input bg-background px-2 py-1.5", children: [
735
- /* @__PURE__ */ x("div", { className: "flex flex-wrap items-center gap-1", children: [
736
- c.map((u) => /* @__PURE__ */ x(
773
+ return /* @__PURE__ */ h("div", { className: "rounded-md border border-input bg-background px-2 py-1.5", children: [
774
+ /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
775
+ d.map((u) => /* @__PURE__ */ h(
737
776
  "span",
738
777
  {
739
778
  className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11.5px] font-medium text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
740
779
  children: [
741
780
  u,
742
- /* @__PURE__ */ n(
781
+ /* @__PURE__ */ i(
743
782
  "button",
744
783
  {
745
784
  type: "button",
746
785
  "aria-label": `Remove ${u}`,
747
- onClick: () => b(c.filter((N) => N !== u)),
786
+ onClick: () => _(d.filter((N) => N !== u)),
748
787
  className: "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
749
788
  children: "×"
750
789
  }
@@ -753,21 +792,21 @@ function It({
753
792
  },
754
793
  u
755
794
  )),
756
- /* @__PURE__ */ n(
795
+ /* @__PURE__ */ i(
757
796
  "input",
758
797
  {
759
798
  value: a,
760
799
  onChange: (u) => p(u.target.value),
761
800
  onKeyDown: (u) => {
762
- (u.key === "Enter" || u.key === ",") && (u.preventDefault(), v(a)), u.key === "Backspace" && a === "" && c.length > 0 && b(c.slice(0, -1));
801
+ (u.key === "Enter" || u.key === ",") && (u.preventDefault(), v(a)), u.key === "Backspace" && a === "" && d.length > 0 && _(d.slice(0, -1));
763
802
  },
764
803
  onBlur: () => v(a),
765
- placeholder: c.length === 0 ? "Type and press Enter…" : "",
804
+ placeholder: d.length === 0 ? "Type and press Enter…" : "",
766
805
  className: "h-6 min-w-[120px] flex-1 bg-transparent text-[13px] outline-none"
767
806
  }
768
807
  )
769
808
  ] }),
770
- d.length > 0 && /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap gap-1 border-t border-slate-100 pt-1 dark:border-border/60", children: d.filter((u) => !c.includes(u)).map((u) => /* @__PURE__ */ x(
809
+ c.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 flex flex-wrap gap-1 border-t border-slate-100 pt-1 dark:border-border/60", children: c.filter((u) => !d.includes(u)).map((u) => /* @__PURE__ */ h(
771
810
  "button",
772
811
  {
773
812
  type: "button",
@@ -783,6 +822,7 @@ function It({
783
822
  ] });
784
823
  }
785
824
  export {
786
- pr as FieldRenderer,
787
- ne as resolveOptionFilterTokens
825
+ br as FieldRenderer,
826
+ oe as resolveOptionFilterTokens,
827
+ ye as useKeptText
788
828
  };