@nivaro/react 0.3.15 → 0.3.16

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 +127 -6
  4. package/dist/index.js +736 -734
  5. package/dist/shared/components/CollectionBrowserView.js +2344 -2309
  6. package/dist/shared/components/ItemEditForm.js +3773 -3604
  7. package/dist/shared/components/RecordGridEditor.js +319 -282
  8. package/dist/shared/components/RecordReadView.js +202 -200
  9. package/dist/shared/components/cbv/unknown-fields.js +18 -8
  10. package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
  11. package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
  12. package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
  13. package/dist/shared/components/item-edit/FieldRow.js +198 -184
  14. package/dist/shared/components/item-edit/HeaderTools.js +107 -99
  15. package/dist/shared/components/item-edit/InlineTableField.js +138 -136
  16. package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
  17. package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
  18. package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
  19. package/dist/shared/components/item-edit/column-length.js +12 -0
  20. package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
  21. package/dist/shared/components/panels/ItemLockBanner.js +307 -285
  22. package/dist/shared/components/panels/PipelinePanel.js +486 -465
  23. package/dist/shared/components/panels/RevisionsPanel.js +210 -204
  24. package/dist/shared/components/profile/DelegationCard.js +178 -121
  25. package/dist/shared/components/profile/PersonActivity.js +152 -139
  26. package/dist/shared/components/queue/QueueWorklist.js +668 -659
  27. package/dist/shared/components/queue/transition-note.js +90 -0
  28. package/dist/shared/components/support/SupportRequestDialog.js +100 -89
  29. package/dist/shared/components/support/TicketDetailSheet.js +104 -91
  30. package/dist/shared/lib/autofill-runs.js +33 -26
  31. package/dist/shared/lib/draft-store.js +40 -24
  32. package/dist/shared/lib/live-queries.js +10 -9
  33. package/dist/shared/lib/restore-skipped.js +10 -0
  34. package/package.json +1 -1
@@ -1,52 +1,53 @@
1
1
  import { jsx as i, jsxs as g } from "react/jsx-runtime";
2
- import { ExternalLink as Me } from "lucide-react";
3
- import { useContext as Be, useRef as J, useEffect as re, useState as Le } from "react";
4
- import { useDrilldown as Ee, useParentDraft as qe, RelationPathDataContext as Te, useApiFetchConfig as Je, fieldDrilldownConfig as V } from "../../context.js";
5
- import { getFieldInterface as He } from "../../lib/field-interfaces.js";
6
- import { precisionOf as Ve } from "../../lib/format-value.js";
7
- import { resolveOptionFilterTokens as oe } from "../../lib/option-filter-tokens.js";
8
- import { counterOf as $e } from "../../lib/placement-behaviour.js";
9
- import { choiceLabel as Ge } from "../../lib/utils.js";
10
- import { Badge as Ke } from "../ui/badge.js";
2
+ import { ExternalLink as Le } from "lucide-react";
3
+ import { useContext as Ee, useRef as J, useEffect as oe, useState as qe } from "react";
4
+ import { useDrilldown as Te, useParentDraft as Je, RelationPathDataContext as He, useApiFetchConfig as Ve, fieldDrilldownConfig as V } from "../../context.js";
5
+ import { getFieldInterface as $e } from "../../lib/field-interfaces.js";
6
+ import { precisionOf as Ge } from "../../lib/format-value.js";
7
+ import { resolveOptionFilterTokens as ne } from "../../lib/option-filter-tokens.js";
8
+ import { counterOf as Ke } from "../../lib/placement-behaviour.js";
9
+ import { choiceLabel as We } from "../../lib/utils.js";
10
+ import { Badge as Ye } from "../ui/badge.js";
11
11
  import { Input as B } from "../ui/input.js";
12
- import { Label as We } from "../ui/label.js";
13
- import { SimpleSelect as Ye } from "../ui/SimpleSelect.js";
14
- import { Switch as ze } from "../ui/switch.js";
12
+ import { Label as ze } from "../ui/label.js";
13
+ import { SimpleSelect as Ue } from "../ui/SimpleSelect.js";
14
+ import { Switch as Ce } from "../ui/switch.js";
15
15
  import { Textarea as $ } from "../ui/textarea.js";
16
- import { CatalogPickerField as Ue } from "./CatalogPickerField.js";
17
- import { useFieldAffordances as Ce } from "./FieldAffordances.js";
18
- import { ProgressField as ne, RatingScaleField as ie, DurationReadOnly as Qe, ChecklistReadOnly as Xe, ColorPackField as ae, PhoneField as le, EmailField as Ze, AddressAutocompleteField as Oe } from "./FieldPack.js";
19
- import { FilePickerField as et, FileM2MField as tt } from "./FilePickerField.js";
16
+ import { CatalogPickerField as Qe } from "./CatalogPickerField.js";
17
+ import { columnMaxLength as ie } from "./column-length.js";
18
+ import { useFieldAffordances as Xe } from "./FieldAffordances.js";
19
+ import { ProgressField as ae, RatingScaleField as le, DurationReadOnly as Ze, ChecklistReadOnly as Oe, ColorPackField as se, PhoneField as ce, EmailField as et, AddressAutocompleteField as tt } from "./FieldPack.js";
20
+ import { FilePickerField as rt, FileM2MField as ot } from "./FilePickerField.js";
20
21
  import { formatDisplayValue as L } from "./GroupSection.js";
21
- import { parseJson as _, toLocalDatetime as rt } from "./helpers.js";
22
- import { InlineGridField as ot } from "./InlineGridField.js";
23
- import { InlineTableField as nt } from "./InlineTableField.js";
24
- import { checkNumberEntry as it } from "./line-qty.js";
25
- import { M2MSingleSelectCombobox as at, M2MCombobox as lt } from "./M2MCombobox.js";
26
- import { MembershipSetField as st } from "./MembershipSetField.js";
27
- import { PlanGridField as ct } from "./PlanGrid.js";
28
- import { smartParseDate as dt, CountdownChip as ut, DurationField as mt, FiscalPeriodField as pt, ChecklistField as yt, RepeaterField as _t, RangeSliderField as ft, DateRangeField as bt, AddressField as xt, maskFor as ht, applyInputMask as se } from "./PolishFields.js";
29
- import { QuickCreateButton as gt } from "./QuickCreateButton.js";
30
- import { RelationCombobox as vt } from "./RelationCombobox.js";
31
- import { RelationGroupedCombobox as wt } from "./RelationGroupedCombobox.js";
32
- import { RichTextEditor as Nt } from "./RichTextEditor.js";
33
- function kt({
22
+ import { parseJson as _, toLocalDatetime as nt } from "./helpers.js";
23
+ import { InlineGridField as it } from "./InlineGridField.js";
24
+ import { InlineTableField as at } from "./InlineTableField.js";
25
+ import { checkNumberEntry as lt } from "./line-qty.js";
26
+ import { M2MSingleSelectCombobox as st, M2MCombobox as ct } from "./M2MCombobox.js";
27
+ import { MembershipSetField as dt } from "./MembershipSetField.js";
28
+ import { PlanGridField as ut } from "./PlanGrid.js";
29
+ import { smartParseDate as mt, CountdownChip as pt, DurationField as yt, FiscalPeriodField as _t, ChecklistField as ft, RepeaterField as bt, RangeSliderField as xt, DateRangeField as ht, AddressField as gt, maskFor as vt, applyInputMask as de } from "./PolishFields.js";
30
+ import { QuickCreateButton as wt } from "./QuickCreateButton.js";
31
+ import { RelationCombobox as Nt } from "./RelationCombobox.js";
32
+ import { RelationGroupedCombobox as kt } from "./RelationGroupedCombobox.js";
33
+ import { RichTextEditor as Ft } from "./RichTextEditor.js";
34
+ function At({
34
35
  plugin: e,
35
36
  props: n
36
37
  }) {
37
38
  const l = J(null), m = J(void 0), y = J(n);
38
- return y.current = n, re(() => {
39
+ return y.current = n, oe(() => {
39
40
  if (l.current)
40
41
  return l.current.innerHTML = "", m.current = e.mount(l.current, y.current), () => {
41
42
  var c, u;
42
43
  (u = (c = m.current) == null ? void 0 : c.destroy) == null || u.call(c), m.current = void 0;
43
44
  };
44
- }, [e]), re(() => {
45
+ }, [e]), oe(() => {
45
46
  var c, u;
46
47
  (u = (c = m.current) == null ? void 0 : c.update) == null || u.call(c, n);
47
48
  }, [n]), /* @__PURE__ */ i("div", { ref: l, "data-custom-interface": e.interface });
48
49
  }
49
- function ce(e) {
50
+ function ue(e) {
50
51
  const n = e.validation_rules, l = Array.isArray(n) ? n : _(typeof n == "string" ? n : null);
51
52
  if (!Array.isArray(l)) return {};
52
53
  const m = (c) => {
@@ -61,7 +62,7 @@ function ce(e) {
61
62
  }
62
63
  return y;
63
64
  }
64
- function ir({
65
+ function sr({
65
66
  field: e,
66
67
  value: n,
67
68
  onChange: l,
@@ -73,20 +74,20 @@ function ir({
73
74
  narrowedBy: F,
74
75
  onCountChange: d,
75
76
  displayOnly: w,
76
- prefillParentId: de,
77
+ prefillParentId: me,
77
78
  pinnedOption: G
78
79
  }) {
79
- var z, U, C, Q, X, Z, O, ee, te;
80
- const j = Ee(), I = Ce(), A = qe(), H = Be(Te), D = A, f = (() => {
80
+ var U, C, Q, X, Z, O, ee, te, re;
81
+ const j = Te(), P = Xe(), A = Je(), H = Ee(He), D = A, f = (() => {
81
82
  try {
82
- return Je();
83
+ return Ve();
83
84
  } catch {
84
85
  return null;
85
86
  }
86
- })(), s = e.interface ?? "", K = J(He(s)).current;
87
+ })(), s = e.interface ?? "", K = J($e(s)).current;
87
88
  if (K)
88
89
  return /* @__PURE__ */ i(
89
- kt,
90
+ At,
90
91
  {
91
92
  plugin: K,
92
93
  props: {
@@ -102,7 +103,7 @@ function ir({
102
103
  if (s === "file-image" || s === "file") {
103
104
  const r = _(e.options);
104
105
  return /* @__PURE__ */ i(
105
- et,
106
+ rt,
106
107
  {
107
108
  value: n,
108
109
  onChange: l,
@@ -120,7 +121,7 @@ function ir({
120
121
  const p = _(e.options);
121
122
  if (p != null && p.group_field && (p != null && p.option_field))
122
123
  return /* @__PURE__ */ i(
123
- wt,
124
+ kt,
124
125
  {
125
126
  collection: N.one_collection,
126
127
  value: n,
@@ -134,15 +135,15 @@ function ir({
134
135
  }
135
136
  );
136
137
  }
137
- const r = j && n != null && n !== "" ? V(e) : null, o = _(e.options), a = oe(
138
+ const r = j && n != null && n !== "" ? V(e) : null, o = _(e.options), a = ne(
138
139
  o != null && o.option_filter && typeof o.option_filter == "object" ? o.option_filter : void 0,
139
140
  A == null ? void 0 : A.draft,
140
141
  c
141
142
  ), t = a ? u ? { _and: [a, u] } : a : u, b = /* @__PURE__ */ i(
142
- vt,
143
+ Nt,
143
144
  {
144
145
  fieldKey: e.field,
145
- missPlacement: (I == null ? void 0 : I.layoutId) != null && I.pickerMisses !== !1 ? { layoutId: Number(I.layoutId), collection: y, field: e.field } : null,
146
+ missPlacement: (P == null ? void 0 : P.layoutId) != null && P.pickerMisses !== !1 ? { layoutId: Number(P.layoutId), collection: y, field: e.field } : null,
146
147
  collection: N.one_collection,
147
148
  value: n,
148
149
  onChange: l,
@@ -160,14 +161,14 @@ function ir({
160
161
  // _and clause pruning) as option_filter, resolved from the same
161
162
  // parent draft — keeps facet option lists in sync with the main
162
163
  // option query's eligibility clauses.
163
- filter: p.filter && typeof p.filter == "object" ? oe(p.filter, A == null ? void 0 : A.draft, c) : void 0
164
+ filter: p.filter && typeof p.filter == "object" ? ne(p.filter, A == null ? void 0 : A.draft, c) : void 0
164
165
  })) : void 0
165
166
  }
166
167
  ), h = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
167
168
  return !r && !h ? b : /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
168
169
  /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: b }),
169
170
  h && /* @__PURE__ */ i(
170
- gt,
171
+ wt,
171
172
  {
172
173
  targetCollection: N.one_collection,
173
174
  config: h,
@@ -186,7 +187,7 @@ function ir({
186
187
  width: r.width
187
188
  }),
188
189
  className: "shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-slate-800",
189
- children: /* @__PURE__ */ i(Me, { className: "h-3.5 w-3.5" })
190
+ children: /* @__PURE__ */ i(Le, { className: "h-3.5 w-3.5" })
190
191
  }
191
192
  )
192
193
  ] });
@@ -206,7 +207,7 @@ function ir({
206
207
  if (s === "files-m2m") {
207
208
  const a = _(e.options);
208
209
  return /* @__PURE__ */ i(
209
- tt,
210
+ ot,
210
211
  {
211
212
  relation: E,
212
213
  parentId: c,
@@ -220,7 +221,7 @@ function ir({
220
221
  }
221
222
  const r = _(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
222
223
  return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ i(
223
- at,
224
+ st,
224
225
  {
225
226
  relation: E,
226
227
  parentId: c,
@@ -232,7 +233,7 @@ function ir({
232
233
  readOnly: w
233
234
  }
234
235
  ) : /* @__PURE__ */ i(
235
- lt,
236
+ ct,
236
237
  {
237
238
  relation: E,
238
239
  parentId: c,
@@ -265,7 +266,7 @@ function ir({
265
266
  }
266
267
  ) });
267
268
  }
268
- const r = (z = e.options) == null ? void 0 : z.__live_delta;
269
+ const r = (U = e.options) == null ? void 0 : U.__live_delta;
269
270
  if (r && Number.isFinite(Number(r.live))) {
270
271
  const a = Number(r.original), t = Number(r.live) - (Number.isFinite(a) ? a : 0), b = Math.round(t * 100) / 100;
271
272
  return /* @__PURE__ */ g("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
@@ -284,29 +285,29 @@ function ir({
284
285
  )
285
286
  ] });
286
287
  }
287
- if (s === "progress") return /* @__PURE__ */ i(ne, { value: n, onChange: l, readOnly: !0 });
288
+ if (s === "progress") return /* @__PURE__ */ i(ae, { value: n, onChange: l, readOnly: !0 });
288
289
  if (s === "rating") {
289
- const a = (U = _(e.options)) == null ? void 0 : U.rating_max;
290
- return /* @__PURE__ */ i(ie, { value: n, onChange: l, max: a ?? 5, readOnly: !0 });
290
+ const a = (C = _(e.options)) == null ? void 0 : C.rating_max;
291
+ return /* @__PURE__ */ i(le, { value: n, onChange: l, max: a ?? 5, readOnly: !0 });
291
292
  }
292
- if (s === "duration") return /* @__PURE__ */ i(Qe, { value: n });
293
- if (s === "checklist") return /* @__PURE__ */ i(Xe, { value: n });
293
+ if (s === "duration") return /* @__PURE__ */ i(Ze, { value: n });
294
+ if (s === "checklist") return /* @__PURE__ */ i(Oe, { value: n });
294
295
  if (s === "color")
295
- return /* @__PURE__ */ i(ae, { field: e, value: n, onChange: l, readOnly: !0 });
296
- if (s === "phone") return /* @__PURE__ */ i(le, { value: n, onChange: l, readOnly: !0 });
297
- const o = n == null ? /* @__PURE__ */ i("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof n == "boolean" ? /* @__PURE__ */ i(Ke, { variant: n ? "default" : "secondary", children: n ? "Yes" : "No" }) : /* @__PURE__ */ i("span", { className: "text-sm tabular-nums", children: L(n, e) });
296
+ return /* @__PURE__ */ i(se, { field: e, value: n, onChange: l, readOnly: !0 });
297
+ if (s === "phone") return /* @__PURE__ */ i(ce, { value: n, onChange: l, readOnly: !0 });
298
+ const o = n == null ? /* @__PURE__ */ i("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof n == "boolean" ? /* @__PURE__ */ i(Ye, { variant: n ? "default" : "secondary", children: n ? "Yes" : "No" }) : /* @__PURE__ */ i("span", { className: "text-sm tabular-nums", children: L(n, e) });
298
299
  return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: o });
299
300
  }
300
301
  const x = n == null ? "" : String(n);
301
302
  if (e.type === "boolean")
302
303
  return /* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
303
- /* @__PURE__ */ i(ze, { checked: !!n, onCheckedChange: l }),
304
- /* @__PURE__ */ i(We, { className: "font-normal text-sm", children: n ? "Yes" : "No" })
304
+ /* @__PURE__ */ i(Ce, { checked: !!n, onCheckedChange: l }),
305
+ /* @__PURE__ */ i(ze, { className: "font-normal text-sm", children: n ? "Yes" : "No" })
305
306
  ] });
306
307
  if (e.type === "datetime" || s === "datetime") {
307
308
  const r = _(e.options);
308
309
  if ((r == null ? void 0 : r.date_mode) === "date") {
309
- const o = ce(e);
310
+ const o = ue(e);
310
311
  return /* @__PURE__ */ i(
311
312
  B,
312
313
  {
@@ -323,14 +324,14 @@ function ir({
323
324
  B,
324
325
  {
325
326
  type: "datetime-local",
326
- value: rt(n),
327
+ value: nt(n),
327
328
  onChange: (o) => l(o.target.value ? new Date(o.target.value).toISOString() : null),
328
329
  placeholder: e.placeholder ?? void 0
329
330
  }
330
331
  );
331
332
  }
332
333
  if (e.type === "date" || s === "date") {
333
- const r = ((C = _(e.options)) == null ? void 0 : C.countdown) === !0, o = ce(e);
334
+ const r = ((Q = _(e.options)) == null ? void 0 : Q.countdown) === !0, o = ue(e);
334
335
  return /* @__PURE__ */ g("div", { className: "flex items-center", children: [
335
336
  /* @__PURE__ */ i(
336
337
  B,
@@ -341,14 +342,14 @@ function ir({
341
342
  max: o.max,
342
343
  onChange: (a) => l(a.target.value || null),
343
344
  onPaste: (a) => {
344
- const t = dt(a.clipboardData.getData("text"));
345
+ const t = mt(a.clipboardData.getData("text"));
345
346
  t && (a.preventDefault(), l(t));
346
347
  },
347
348
  placeholder: e.placeholder ?? void 0,
348
349
  className: "flex-1"
349
350
  }
350
351
  ),
351
- r && /* @__PURE__ */ i(ut, { value: x.slice(0, 10) })
352
+ r && /* @__PURE__ */ i(pt, { value: x.slice(0, 10) })
352
353
  ] });
353
354
  }
354
355
  if ([
@@ -369,7 +370,7 @@ function ir({
369
370
  ].includes(e.type)) {
370
371
  const r = ["integer", "bigInteger", "int", "bigint", "smallint", "tinyint"].includes(
371
372
  e.type
372
- ), o = r ? 0 : Ve(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = it(n, { type: e.type, label: e.label || "Value" }), b = t.ok ? null : t.message;
373
+ ), o = r ? 0 : Ge(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = lt(n, { type: e.type, label: e.label || "Value" }), b = t.ok ? null : t.message;
373
374
  return /* @__PURE__ */ g("div", { children: [
374
375
  /* @__PURE__ */ i(
375
376
  B,
@@ -414,6 +415,7 @@ function ir({
414
415
  $,
415
416
  {
416
417
  rows: 4,
418
+ maxLength: ie(e) ?? void 0,
417
419
  value: x,
418
420
  onChange: (r) => l(r.target.value),
419
421
  placeholder: e.placeholder ?? void 0
@@ -432,13 +434,13 @@ function ir({
432
434
  );
433
435
  if (s === "input-rich-text-html" || s === "rich_text" || e.type === "rich_text" || s === "extension-editorjs")
434
436
  return /* @__PURE__ */ i(
435
- Nt,
437
+ Ft,
436
438
  {
437
439
  value: x,
438
440
  onChange: l,
439
441
  placeholder: e.placeholder ?? void 0,
440
442
  disabled: e.readonly,
441
- pastePlain: ((Q = _(e.options)) == null ? void 0 : Q.paste_plain) === !0
443
+ pastePlain: ((X = _(e.options)) == null ? void 0 : X.paste_plain) === !0
442
444
  }
443
445
  );
444
446
  if (s === "inline-grid" || s === "relation-list" || s === "list-o2m") {
@@ -456,7 +458,7 @@ function ir({
456
458
  }
457
459
  })() : e.options ?? {}).layout_slug ?? null;
458
460
  return /* @__PURE__ */ i(
459
- ot,
461
+ it,
460
462
  {
461
463
  relatedCollection: o,
462
464
  manyField: a,
@@ -483,10 +485,10 @@ function ir({
483
485
  } catch {
484
486
  return {};
485
487
  }
486
- })() : e.options ?? {}, b = t.layout_id ?? null, h = !!t.show_row_revisions, p = !!t.row_comments, q = t.allow_revision_restore !== !1, ue = t.save_mode ?? "immediate", me = !!t.show_line_numbers, pe = t.enable_reorder !== !1, ye = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, _e = Array.isArray(t.row_rules) ? t.row_rules : void 0, fe = Array.isArray(t.column_presets) ? t.column_presets : void 0, be = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, xe = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, he = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, ge = Array.isArray(t.unique_by) ? t.unique_by : void 0, ve = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, we = t.sort_dir === "desc" ? "desc" : "asc", Ne = t.freeze_first_column === !0, ke = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, Fe = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, Ae = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, Se = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Re = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, je = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, De = t.row_match_panel ?? void 0, Ie = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Pe = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, S = t.membership_set;
488
+ })() : e.options ?? {}, b = t.layout_id ?? null, h = !!t.show_row_revisions, p = !!t.row_comments, q = t.allow_revision_restore !== !1, pe = t.save_mode ?? "immediate", ye = !!t.show_line_numbers, _e = t.enable_reorder !== !1, fe = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, be = Array.isArray(t.row_rules) ? t.row_rules : void 0, xe = Array.isArray(t.column_presets) ? t.column_presets : void 0, he = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, ge = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, ve = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, we = Array.isArray(t.unique_by) ? t.unique_by : void 0, Ne = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, ke = t.sort_dir === "desc" ? "desc" : "asc", Fe = t.freeze_first_column === !0, Ae = 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, Re = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, je = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, De = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Ie = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Pe = t.row_match_panel ?? void 0, Me = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Be = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, S = t.membership_set;
487
489
  if (S != null && S.key_field && (S != null && S.value_field))
488
490
  return /* @__PURE__ */ i(
489
- st,
491
+ dt,
490
492
  {
491
493
  relatedCollection: o,
492
494
  manyField: a,
@@ -498,7 +500,7 @@ function ir({
498
500
  const R = t.catalog_mode;
499
501
  if (R != null && R.item_field && (R != null && R.section_by))
500
502
  return /* @__PURE__ */ i(
501
- Ue,
503
+ Qe,
502
504
  {
503
505
  relatedCollection: o,
504
506
  manyField: a,
@@ -512,7 +514,7 @@ function ir({
512
514
  if (k != null && k.key_field && (k != null && k.category_field) && Array.isArray(k.value_fields)) {
513
515
  const T = t.spread_remaining;
514
516
  return /* @__PURE__ */ i(
515
- ct,
517
+ ut,
516
518
  {
517
519
  relatedCollection: o,
518
520
  manyField: a,
@@ -529,7 +531,7 @@ function ir({
529
531
  );
530
532
  }
531
533
  return /* @__PURE__ */ i(
532
- nt,
534
+ at,
533
535
  {
534
536
  relatedCollection: o,
535
537
  manyField: a,
@@ -539,27 +541,27 @@ function ir({
539
541
  showRowRevisions: h,
540
542
  rowComments: p,
541
543
  allowRevisionRestore: q,
542
- saveMode: ue,
543
- showLineNumbers: me,
544
- enableReorder: pe,
545
- parentCascades: ye,
546
- rowRules: _e,
547
- columnPresets: fe,
548
- defaultPreset: be,
549
- drawerRelations: xe,
550
- parentContextFields: he,
551
- uniqueBy: ge,
552
- sortField: ve,
553
- sortDir: we,
554
- sectionGroupBy: ke,
555
- freezeFirstColumn: Ne,
556
- rowFilter: Fe,
557
- rowDefaults: Ie,
558
- allocateDrawer: Ae,
559
- autoAllocate: Se,
560
- rowBulkActions: Re,
561
- uploadTemplate: je,
562
- rowMatchPanel: De,
544
+ saveMode: pe,
545
+ showLineNumbers: ye,
546
+ enableReorder: _e,
547
+ parentCascades: fe,
548
+ rowRules: be,
549
+ columnPresets: xe,
550
+ defaultPreset: he,
551
+ drawerRelations: ge,
552
+ parentContextFields: ve,
553
+ uniqueBy: we,
554
+ sortField: Ne,
555
+ sortDir: ke,
556
+ sectionGroupBy: Ae,
557
+ freezeFirstColumn: Fe,
558
+ rowFilter: Se,
559
+ rowDefaults: Me,
560
+ allocateDrawer: Re,
561
+ autoAllocate: je,
562
+ rowBulkActions: De,
563
+ uploadTemplate: Ie,
564
+ rowMatchPanel: Pe,
563
565
  lineSla: t.line_sla ?? null,
564
566
  editorMode: t.editor_mode === "split" ? "split" : "drawer",
565
567
  rowLints: Array.isArray(t.row_lints) ? t.row_lints : null,
@@ -567,8 +569,8 @@ function ir({
567
569
  sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
568
570
  spreadRemaining: t.spread_remaining && typeof t.spread_remaining == "object" ? t.spread_remaining : null,
569
571
  compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
570
- submissionErrors: Pe,
571
- prefillParentId: de,
572
+ submissionErrors: Be,
573
+ prefillParentId: me,
572
574
  parentFieldKey: e.field,
573
575
  readOnly: e.readonly,
574
576
  emptyLabel: e.label || void 0
@@ -578,19 +580,19 @@ function ir({
578
580
  }
579
581
  return /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
580
582
  }
581
- if (s === "color") return /* @__PURE__ */ i(ae, { field: e, value: n, onChange: l });
583
+ if (s === "color") return /* @__PURE__ */ i(se, { field: e, value: n, onChange: l });
582
584
  if (s === "rating") {
583
- const r = (X = _(e.options)) == null ? void 0 : X.rating_max;
584
- return /* @__PURE__ */ i(ie, { value: n, onChange: l, max: r ?? 5 });
585
+ const r = (Z = _(e.options)) == null ? void 0 : Z.rating_max;
586
+ return /* @__PURE__ */ i(le, { value: n, onChange: l, max: r ?? 5 });
585
587
  }
586
- if (s === "progress") return /* @__PURE__ */ i(ne, { value: n, onChange: l });
588
+ if (s === "progress") return /* @__PURE__ */ i(ae, { value: n, onChange: l });
587
589
  if (s === "phone")
588
- return /* @__PURE__ */ i(le, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
590
+ return /* @__PURE__ */ i(ce, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
589
591
  if (s === "email")
590
- return /* @__PURE__ */ i(Ze, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
592
+ return /* @__PURE__ */ i(et, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
591
593
  if (s === "address-autocomplete")
592
594
  return /* @__PURE__ */ i(
593
- Oe,
595
+ tt,
594
596
  {
595
597
  field: e,
596
598
  value: n,
@@ -601,38 +603,38 @@ function ir({
601
603
  placeholder: e.placeholder ?? void 0
602
604
  }
603
605
  );
604
- if (s === "duration") return /* @__PURE__ */ i(mt, { value: n, onChange: l });
605
- if (s === "fiscal_period") return /* @__PURE__ */ i(pt, { value: n, onChange: l });
606
- if (s === "checklist") return /* @__PURE__ */ i(yt, { value: n, onChange: l });
606
+ if (s === "duration") return /* @__PURE__ */ i(yt, { value: n, onChange: l });
607
+ if (s === "fiscal_period") return /* @__PURE__ */ i(_t, { value: n, onChange: l });
608
+ if (s === "checklist") return /* @__PURE__ */ i(ft, { value: n, onChange: l });
607
609
  if (s === "repeater" || e.repeater_schema && e.type === "json")
608
- return /* @__PURE__ */ i(_t, { field: e, value: n, onChange: l });
610
+ return /* @__PURE__ */ i(bt, { field: e, value: n, onChange: l });
609
611
  if (s === "range_slider") {
610
- const r = (Z = _(e.options)) == null ? void 0 : Z.range_end_field;
612
+ const r = (O = _(e.options)) == null ? void 0 : O.range_end_field;
611
613
  return /* @__PURE__ */ i(
612
- ft,
614
+ xt,
613
615
  {
614
616
  field: e,
615
617
  value: n,
616
618
  onChange: l,
617
- pairedValue: r ? (O = D == null ? void 0 : D.draft) == null ? void 0 : O[r] : void 0
619
+ pairedValue: r ? (ee = D == null ? void 0 : D.draft) == null ? void 0 : ee[r] : void 0
618
620
  }
619
621
  );
620
622
  }
621
623
  if (s === "date_range") {
622
- const r = (ee = _(e.options)) == null ? void 0 : ee.range_end_field;
624
+ const r = (te = _(e.options)) == null ? void 0 : te.range_end_field;
623
625
  return /* @__PURE__ */ i(
624
- bt,
626
+ ht,
625
627
  {
626
628
  field: e,
627
629
  value: n,
628
630
  onChange: l,
629
- pairedValue: r ? (te = D == null ? void 0 : D.draft) == null ? void 0 : te[r] : void 0
631
+ pairedValue: r ? (re = D == null ? void 0 : D.draft) == null ? void 0 : re[r] : void 0
630
632
  }
631
633
  );
632
634
  }
633
635
  if (s === "address")
634
636
  return /* @__PURE__ */ i(
635
- xt,
637
+ gt,
636
638
  {
637
639
  field: e,
638
640
  value: n,
@@ -642,7 +644,7 @@ function ir({
642
644
  }
643
645
  );
644
646
  if (s === "tags")
645
- return /* @__PURE__ */ i(Ft, { field: e, value: n, onChange: l });
647
+ return /* @__PURE__ */ i(St, { field: e, value: n, onChange: l });
646
648
  if (s === "select-dropdown" || s === "radio-buttons") {
647
649
  const r = (() => {
648
650
  const o = _(e.options);
@@ -650,42 +652,43 @@ function ir({
650
652
  })();
651
653
  if (r.length > 0)
652
654
  return /* @__PURE__ */ i(
653
- Ye,
655
+ Ue,
654
656
  {
655
657
  value: x,
656
658
  onChange: (o) => l(o || null),
657
659
  options: [
658
660
  { value: "", label: "— Select —" },
659
- ...r.map((o) => ({ value: o.value, label: Ge(o.text) }))
661
+ ...r.map((o) => ({ value: o.value, label: We(o.text) }))
660
662
  ],
661
663
  ariaLabel: e.label ?? e.field,
662
664
  className: "h-9 rounded-md text-sm"
663
665
  }
664
666
  );
665
667
  }
666
- const P = ht(e), M = (() => {
668
+ const I = vt(e), Y = ie(e), M = (() => {
667
669
  const r = _(e.options);
668
670
  if (Number.isFinite(Number(r == null ? void 0 : r.max_length))) return Number(r == null ? void 0 : r.max_length);
669
671
  const o = _(e.validation_rules), a = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
670
- return a && Number.isFinite(Number(a.value)) ? Number(a.value) : null;
671
- })(), Y = /* @__PURE__ */ i(
672
+ return a && Number.isFinite(Number(a.value)) ? Number(a.value) : Y;
673
+ })(), z = /* @__PURE__ */ i(
672
674
  B,
673
675
  {
674
- value: P ? se(P, x).display : x,
676
+ maxLength: I ? void 0 : Y ?? void 0,
677
+ value: I ? de(I, x).display : x,
675
678
  onChange: (r) => {
676
- if (P) {
677
- const { clean: o } = se(P, r.target.value);
679
+ if (I) {
680
+ const { clean: o } = de(I, r.target.value);
678
681
  l(o || null);
679
682
  } else
680
683
  l(r.target.value || null);
681
684
  },
682
- placeholder: e.placeholder ?? P ?? void 0
685
+ placeholder: e.placeholder ?? I ?? void 0
683
686
  }
684
687
  );
685
- if (M != null && M > 0 && !$e(e._overrides)) {
688
+ if (M != null && M > 0 && !Ke(e._overrides)) {
686
689
  const r = x.length;
687
690
  return /* @__PURE__ */ g("div", { children: [
688
- Y,
691
+ z,
689
692
  r >= M * 0.6 && /* @__PURE__ */ g(
690
693
  "p",
691
694
  {
@@ -699,14 +702,14 @@ function ir({
699
702
  )
700
703
  ] });
701
704
  }
702
- return Y;
705
+ return z;
703
706
  }
704
- function Ft({
707
+ function St({
705
708
  field: e,
706
709
  value: n,
707
710
  onChange: l
708
711
  }) {
709
- const [m, y] = Le(""), c = (() => {
712
+ const [m, y] = qe(""), c = (() => {
710
713
  if (Array.isArray(n)) return n.map(String);
711
714
  if (typeof n == "string" && n.trim().startsWith("["))
712
715
  try {
@@ -775,6 +778,6 @@ function Ft({
775
778
  ] });
776
779
  }
777
780
  export {
778
- ir as FieldRenderer,
779
- oe as resolveOptionFilterTokens
781
+ sr as FieldRenderer,
782
+ ne as resolveOptionFilterTokens
780
783
  };