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