@nivaro/react 0.3.58 → 0.3.60

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 (43) hide show
  1. package/dist/components/fields/RelationField.js +110 -80
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useRelationOptions.js +1 -0
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +32 -1
  6. package/dist/index.js +523 -520
  7. package/dist/shared/components/CollectionBrowserView.js +2083 -2052
  8. package/dist/shared/components/DataTable.js +497 -465
  9. package/dist/shared/components/ItemEditForm.js +4430 -4282
  10. package/dist/shared/components/PageRenderer.js +537 -508
  11. package/dist/shared/components/QueryTable.js +74 -74
  12. package/dist/shared/components/WidgetSlot.js +543 -520
  13. package/dist/shared/components/alerts/AlertManagerView.js +269 -275
  14. package/dist/shared/components/alerts/types.js +37 -14
  15. package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
  16. package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
  17. package/dist/shared/components/item-edit/InlineTableField.js +2461 -2421
  18. package/dist/shared/components/item-edit/M2MCombobox.js +141 -137
  19. package/dist/shared/components/item-edit/PlanGrid.js +876 -820
  20. package/dist/shared/components/item-edit/QuickCreateButton.js +323 -130
  21. package/dist/shared/components/item-edit/RelationCombobox.js +408 -375
  22. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +255 -156
  23. package/dist/shared/components/item-edit/SummaryPanel.js +356 -343
  24. package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
  25. package/dist/shared/components/item-edit/line-midair.js +82 -75
  26. package/dist/shared/components/item-edit/save-outcome.js +6 -4
  27. package/dist/shared/components/panels/ItemLockBanner.js +212 -209
  28. package/dist/shared/components/panels/PipelinePanel.js +775 -737
  29. package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
  30. package/dist/shared/components/panels/RevisionsPanel.js +313 -299
  31. package/dist/shared/components/pipeline/PipelineEditorView.js +26 -16
  32. package/dist/shared/components/queue/QueueQuickFilters.js +13 -13
  33. package/dist/shared/components/queue/QueueWorklist.js +978 -953
  34. package/dist/shared/components/queue/live-state-aspect.js +9 -5
  35. package/dist/shared/components/widgets/ReviewListWidget.js +152 -149
  36. package/dist/shared/lib/display-prefs.js +60 -52
  37. package/dist/shared/lib/draft-store.js +71 -48
  38. package/dist/shared/lib/expression.js +53 -53
  39. package/dist/shared/lib/list-page-memory.js +42 -20
  40. package/dist/shared/lib/money-input.js +45 -0
  41. package/dist/shared/lib/sanitize-html.js +10 -6
  42. package/dist/shared/lib/staged-row-labels.js +18 -0
  43. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- const a = {
1
+ const s = {
2
2
  gt: ">",
3
3
  gte: "≥",
4
4
  lt: "<",
5
5
  lte: "≤",
6
6
  eq: "=",
7
7
  change_pct: "% Δ"
8
- }, i = [
8
+ }, u = [
9
9
  { label: "greater than (>)", value: "gt" },
10
10
  { label: "at least (≥)", value: "gte" },
11
11
  { label: "less than (<)", value: "lt" },
@@ -13,16 +13,16 @@ const a = {
13
13
  { label: "equals (=)", value: "eq" },
14
14
  { label: "% change", value: "change_pct" }
15
15
  ];
16
- function l(e, t) {
17
- const r = Number(e);
18
- if (!Number.isFinite(r)) return String(e ?? "—");
19
- const n = Number.isInteger(r) ? r.toLocaleString() : r.toLocaleString(void 0, { maximumFractionDigits: 2 });
20
- return t === "dollar" ? `$${n}` : t === "percent" ? `${n}%` : t === "days" ? `${n}d` : n;
16
+ function c(e, r) {
17
+ const n = Number(e);
18
+ if (!Number.isFinite(n)) return String(e ?? "—");
19
+ const t = Number.isInteger(n) ? n.toLocaleString() : n.toLocaleString(void 0, { maximumFractionDigits: 2 });
20
+ return r === "dollar" ? `$${t}` : r === "percent" ? `${t}%` : r === "days" ? `${t}d` : t;
21
21
  }
22
- function u(e) {
22
+ function m(e) {
23
23
  if (!e) return "—";
24
- const t = new Date(e);
25
- return Number.isNaN(t.getTime()) ? String(e) : t.toLocaleString(void 0, {
24
+ const r = new Date(e);
25
+ return Number.isNaN(r.getTime()) ? String(e) : r.toLocaleString(void 0, {
26
26
  month: "short",
27
27
  day: "numeric",
28
28
  year: "numeric",
@@ -30,9 +30,32 @@ function u(e) {
30
30
  minute: "2-digit"
31
31
  });
32
32
  }
33
+ function g(e) {
34
+ const r = { gt: ">", gte: "≥", lt: "<", lte: "≤", eq: "=", neq: "≠" }, n = (i) => {
35
+ const a = i.replace(/_/g, " ").trim();
36
+ return a && a.charAt(0).toUpperCase() + a.slice(1);
37
+ };
38
+ let t;
39
+ if (e.field === "value") t = "Value";
40
+ else if (e.field === "row_count") t = "Rows";
41
+ else {
42
+ const i = /^(sum|avg|max|min|tile):(.+)$/.exec(e.field);
43
+ i ? i[1] === "tile" ? t = i[2].trim() : t = `${{ sum: "Total of", avg: "Average", max: "Largest", min: "Smallest" }[i[1]] ?? ""} ${i[2].replace(/_/g, " ").trim()}`.trim() : t = n(e.field);
44
+ }
45
+ const l = Number(e.value), o = Number.isFinite(l) ? l.toLocaleString("en-US", { maximumFractionDigits: 2 }) : String(e.value ?? "");
46
+ return `${t} ${r[e.op] ?? e.op} ${o}`;
47
+ }
48
+ function f(e) {
49
+ const r = { sla: "SLA", ai: "AI", kpi: "KPI", erp: "ERP" }, n = e.trim().toLowerCase();
50
+ if (r[n]) return r[n];
51
+ const t = e.replace(/[_-]+/g, " ").trim();
52
+ return t && t.charAt(0).toUpperCase() + t.slice(1);
53
+ }
33
54
  export {
34
- a as OPERATOR_LABELS,
35
- i as OPERATOR_OPTIONS,
36
- u as fmtDateTime,
37
- l as fmtMetric
55
+ s as OPERATOR_LABELS,
56
+ u as OPERATOR_OPTIONS,
57
+ f as categoryLabel,
58
+ m as fmtDateTime,
59
+ c as fmtMetric,
60
+ g as reportConditionText
38
61
  };
@@ -8,7 +8,7 @@ import { resolveOptionFilterTokens as oe } from "../../lib/option-filter-tokens.
8
8
  import { counterOf as Xe } from "../../lib/placement-behaviour.js";
9
9
  import { choiceLabel as Ze } from "../../lib/utils.js";
10
10
  import { Badge as Ce } from "../ui/badge.js";
11
- import { Input as L } from "../ui/input.js";
11
+ import { Input as B } from "../ui/input.js";
12
12
  import { Label as Oe } from "../ui/label.js";
13
13
  import { NumberDraftInput as et } from "../ui/number-draft-input.js";
14
14
  import { SimpleSelect as tt } from "../ui/SimpleSelect.js";
@@ -19,7 +19,7 @@ import { columnMaxLength as pe } from "./column-length.js";
19
19
  import { useFieldAffordances as nt } from "./FieldAffordances.js";
20
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
21
  import { FilePickerField as ct, FileM2MField as dt } from "./FilePickerField.js";
22
- import { formatDisplayValue as B } from "./GroupSection.js";
22
+ import { formatDisplayValue as L } from "./GroupSection.js";
23
23
  import { parseJson as f, toLocalDatetime as ut } from "./helpers.js";
24
24
  import { InlineGridField as mt } from "./InlineGridField.js";
25
25
  import { InlineTableField as pt } from "./InlineTableField.js";
@@ -86,13 +86,13 @@ function ye(m, e) {
86
86
  onBlur: (c) => d(c.target.value)
87
87
  };
88
88
  }
89
- function Bt({
89
+ function Lt({
90
90
  value: m,
91
91
  commit: e,
92
92
  ...n
93
93
  }) {
94
94
  const a = ye(m, e);
95
- return /* @__PURE__ */ i(L, { ...n, ...a });
95
+ return /* @__PURE__ */ i(B, { ...n, ...a });
96
96
  }
97
97
  function ue({
98
98
  value: m,
@@ -171,7 +171,8 @@ const br = Ke(function({
171
171
  disabled: e.readonly,
172
172
  placeholder: e.placeholder ?? void 0,
173
173
  extraFilter: _,
174
- pinned: $
174
+ pinned: $,
175
+ narrowedBy: u
175
176
  }
176
177
  );
177
178
  }
@@ -212,6 +213,7 @@ const br = Ke(function({
212
213
  {
213
214
  targetCollection: k.one_collection,
214
215
  config: w,
216
+ value: n,
215
217
  onCreated: (y) => a(y)
216
218
  }
217
219
  ),
@@ -302,7 +304,7 @@ const br = Ke(function({
302
304
  title: String(n)
303
305
  }),
304
306
  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",
305
- children: B(n, e)
307
+ children: L(n, e)
306
308
  }
307
309
  ) });
308
310
  }
@@ -310,16 +312,16 @@ const br = Ke(function({
310
312
  if (r && Number.isFinite(Number(r.live))) {
311
313
  const l = Number(r.original), t = Number(r.live) - (Number.isFinite(l) ? l : 0), x = Math.round(t * 100) / 100;
312
314
  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) }),
315
+ /* @__PURE__ */ i("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: L(r.original, e) }),
314
316
  /* @__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) }),
317
+ /* @__PURE__ */ i("span", { className: "text-sm font-medium tabular-nums", children: L(r.live, e) }),
316
318
  x !== 0 && /* @__PURE__ */ h(
317
319
  "span",
318
320
  {
319
321
  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"}`,
320
322
  children: [
321
323
  x > 0 ? "+" : "−",
322
- B(Math.abs(x), e)
324
+ L(Math.abs(x), e)
323
325
  ]
324
326
  }
325
327
  )
@@ -335,7 +337,7 @@ const br = Ke(function({
335
337
  if (s === "color")
336
338
  return /* @__PURE__ */ i(ae, { field: e, value: n, onChange: a, readOnly: !0 });
337
339
  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) });
340
+ 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: L(n, e) });
339
341
  return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: o });
340
342
  }
341
343
  const g = n == null ? "" : String(n);
@@ -349,7 +351,7 @@ const br = Ke(function({
349
351
  if ((r == null ? void 0 : r.date_mode) === "date") {
350
352
  const o = ce(e);
351
353
  return /* @__PURE__ */ i(
352
- L,
354
+ B,
353
355
  {
354
356
  type: "date",
355
357
  value: g.slice(0, 10),
@@ -361,7 +363,7 @@ const br = Ke(function({
361
363
  );
362
364
  }
363
365
  return /* @__PURE__ */ i(
364
- L,
366
+ B,
365
367
  {
366
368
  type: "datetime-local",
367
369
  value: ut(n),
@@ -374,7 +376,7 @@ const br = Ke(function({
374
376
  const r = ((Q = f(e.options)) == null ? void 0 : Q.countdown) === !0, o = ce(e);
375
377
  return /* @__PURE__ */ h("div", { className: "flex items-center", children: [
376
378
  /* @__PURE__ */ i(
377
- L,
379
+ B,
378
380
  {
379
381
  type: "date",
380
382
  value: g.slice(0, 10),
@@ -525,7 +527,7 @@ const br = Ke(function({
525
527
  } catch {
526
528
  return {};
527
529
  }
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;
530
+ })() : 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, Le = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Be = 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;
529
531
  if (R != null && R.key_field && (R != null && R.value_field))
530
532
  return /* @__PURE__ */ i(
531
533
  bt,
@@ -599,8 +601,8 @@ const br = Ke(function({
599
601
  rowDefaults: Te,
600
602
  allocateDrawer: Me,
601
603
  autoAllocate: Pe,
602
- rowBulkActions: Be,
603
- uploadTemplate: Le,
604
+ rowBulkActions: Le,
605
+ uploadTemplate: Be,
604
606
  rowMatchPanel: Ee,
605
607
  lineSla: t.line_sla ?? null,
606
608
  editorMode: t.editor_mode === "split" ? "split" : "drawer",
@@ -684,7 +686,7 @@ const br = Ke(function({
684
686
  }
685
687
  );
686
688
  if (s === "tags")
687
- return /* @__PURE__ */ i(Lt, { field: e, value: n, onChange: a });
689
+ return /* @__PURE__ */ i(Bt, { field: e, value: n, onChange: a });
688
690
  if (s === "select-dropdown" || s === "radio-buttons") {
689
691
  const r = (() => {
690
692
  const o = f(e.options);
@@ -711,7 +713,7 @@ const br = Ke(function({
711
713
  const o = f(e.validation_rules), l = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
712
714
  return l && Number.isFinite(Number(l.value)) ? Number(l.value) : _e;
713
715
  })(), Y = T ? /* @__PURE__ */ i(
714
- L,
716
+ B,
715
717
  {
716
718
  value: se(T, g).display,
717
719
  onChange: (r) => {
@@ -721,7 +723,7 @@ const br = Ke(function({
721
723
  placeholder: e.placeholder ?? T ?? void 0
722
724
  }
723
725
  ) : /* @__PURE__ */ i(
724
- Bt,
726
+ Lt,
725
727
  {
726
728
  maxLength: de(e),
727
729
  value: g,
@@ -748,7 +750,7 @@ const br = Ke(function({
748
750
  }
749
751
  return Y;
750
752
  });
751
- function Lt({
753
+ function Bt({
752
754
  field: m,
753
755
  value: e,
754
756
  onChange: n
@@ -1,104 +1,105 @@
1
- import { jsx as l, jsxs as n, Fragment as z } from "react/jsx-runtime";
2
- import { RotateCcw as A, Loader2 as B } from "lucide-react";
3
- import { useState as y, useMemo as E, useEffect as F } from "react";
4
- import { titleCase as j, cn as L } from "../../lib/utils.js";
5
- import { Dialog as R, DialogContent as G, DialogHeader as H, DialogTitle as I, DialogDescription as M, DialogBody as O, DialogFooter as V } from "../ui/dialog.js";
6
- import { FieldRenderer as q } from "./FieldRenderer.js";
7
- function X({
1
+ import { jsx as l, jsxs as i, Fragment as A } from "react/jsx-runtime";
2
+ import { RotateCcw as B, Loader2 as F } from "lucide-react";
3
+ import { useState as k, useMemo as j, useEffect as L } from "react";
4
+ import { titleCase as R, cn as G } from "../../lib/utils.js";
5
+ import { Dialog as H, DialogContent as M, DialogHeader as O, DialogTitle as V, DialogDescription as q, DialogBody as J, DialogFooter as K } from "../ui/dialog.js";
6
+ import { FieldRenderer as P } from "./FieldRenderer.js";
7
+ function _({
8
8
  open: p,
9
9
  onOpenChange: u,
10
10
  columns: o,
11
11
  rows: d,
12
- relations: N,
13
- collection: w,
12
+ relations: w,
13
+ collection: D,
14
14
  cascadeFilters: f,
15
- onApply: D
15
+ onApply: C,
16
+ onEditIntent: h
16
17
  }) {
17
- const [k, h] = y({}), [i, x] = y(/* @__PURE__ */ new Set()), [s, g] = y(!1), b = E(() => {
18
+ const [N, x] = k({}), [n, g] = k(/* @__PURE__ */ new Set()), [s, b] = k(!1), v = j(() => {
18
19
  const e = {};
19
20
  for (const a of o) {
20
21
  if (d.length === 0) {
21
22
  e[a.field] = { value: null, varies: !1 };
22
23
  continue;
23
24
  }
24
- const t = d[0][a.field] ?? null, c = d.every((v) => String(v[a.field] ?? "") === String(t ?? ""));
25
+ const t = d[0][a.field] ?? null, c = d.every((y) => String(y[a.field] ?? "") === String(t ?? ""));
25
26
  e[a.field] = { value: c ? t : null, varies: !c };
26
27
  }
27
28
  return e;
28
29
  }, [o, d]);
29
- F(() => {
30
+ L(() => {
30
31
  var a;
31
32
  if (!p) return;
32
33
  const e = {};
33
- for (const t of o) e[t.field] = ((a = b[t.field]) == null ? void 0 : a.value) ?? null;
34
- h(e), x(/* @__PURE__ */ new Set()), g(!1);
34
+ for (const t of o) e[t.field] = ((a = v[t.field]) == null ? void 0 : a.value) ?? null;
35
+ x(e), g(/* @__PURE__ */ new Set()), b(!1);
35
36
  }, [p]);
36
- const C = (e, a) => {
37
- h((t) => ({ ...t, [e]: a })), x((t) => /* @__PURE__ */ new Set([...t, e]));
38
- }, $ = (e) => {
39
- h((a) => {
37
+ const $ = (e, a) => {
38
+ h == null || h(), x((t) => ({ ...t, [e]: a })), g((t) => /* @__PURE__ */ new Set([...t, e]));
39
+ }, S = (e) => {
40
+ x((a) => {
40
41
  var t;
41
- return { ...a, [e]: ((t = b[e]) == null ? void 0 : t.value) ?? null };
42
- }), x((a) => {
42
+ return { ...a, [e]: ((t = v[e]) == null ? void 0 : t.value) ?? null };
43
+ }), g((a) => {
43
44
  const t = new Set(a);
44
45
  return t.delete(e), t;
45
46
  });
46
47
  }, r = d.length, m = r === 1 ? "line" : "lines";
47
- async function S() {
48
- if (i.size === 0 || s) return;
48
+ async function T() {
49
+ if (n.size === 0 || s) return;
49
50
  const e = {};
50
- for (const a of i) e[a] = k[a] ?? null;
51
- g(!0);
51
+ for (const a of n) e[a] = N[a] ?? null;
52
+ b(!0);
52
53
  try {
53
- await D(e), u(!1);
54
+ await C(e), u(!1);
54
55
  } finally {
55
- g(!1);
56
+ b(!1);
56
57
  }
57
58
  }
58
- return /* @__PURE__ */ l(R, { open: p, onOpenChange: (e) => !s && u(e), children: /* @__PURE__ */ n(
59
- G,
59
+ return /* @__PURE__ */ l(H, { open: p, onOpenChange: (e) => !s && u(e), children: /* @__PURE__ */ i(
60
+ M,
60
61
  {
61
62
  className: "max-w-3xl dark:bg-card",
62
63
  "data-o2m-editing": "",
63
64
  onOpenAutoFocus: (e) => e.preventDefault(),
64
65
  children: [
65
- /* @__PURE__ */ n(H, { children: [
66
- /* @__PURE__ */ n(I, { children: [
66
+ /* @__PURE__ */ i(O, { children: [
67
+ /* @__PURE__ */ i(V, { children: [
67
68
  "Edit ",
68
69
  r,
69
70
  " selected ",
70
71
  m
71
72
  ] }),
72
- /* @__PURE__ */ l(M, { children: "Only the fields you change here are written. Fields left as prefilled keep each line's own value." })
73
+ /* @__PURE__ */ l(q, { children: "Only the fields you change here are written. Fields left as prefilled keep each line's own value." })
73
74
  ] }),
74
- /* @__PURE__ */ l(O, { className: "max-h-[60vh] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ l("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "This table has no columns that can be edited in bulk." }) : /* @__PURE__ */ l(
75
+ /* @__PURE__ */ l(J, { className: "max-h-[60vh] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ l("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "This table has no columns that can be edited in bulk." }) : /* @__PURE__ */ l(
75
76
  "div",
76
77
  {
77
78
  className: "grid items-start gap-x-4 gap-y-3",
78
79
  style: { gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))" },
79
80
  children: o.map((e) => {
80
- const a = e.label || j(e.field), t = b[e.field], c = i.has(e.field), v = t != null && t.varies ? { ...e, placeholder: "(varies)", sort: e.sort ?? 0 } : { ...e, sort: e.sort ?? 0 };
81
- return /* @__PURE__ */ n(
81
+ const a = e.label || R(e.field), t = v[e.field], c = n.has(e.field), y = t != null && t.varies ? { ...e, placeholder: "(varies)", sort: e.sort ?? 0 } : { ...e, sort: e.sort ?? 0 };
82
+ return /* @__PURE__ */ i(
82
83
  "div",
83
84
  {
84
- className: L(
85
+ className: G(
85
86
  "flex min-w-0 flex-col gap-1 rounded-md p-1.5 -m-1.5 transition-colors",
86
87
  c && "bg-amber-50/70 dark:bg-amber-400/10"
87
88
  ),
88
89
  children: [
89
- /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: [
90
+ /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: [
90
91
  /* @__PURE__ */ l("span", { className: "truncate", children: a }),
91
- c ? /* @__PURE__ */ n(z, { children: [
92
+ c ? /* @__PURE__ */ i(A, { children: [
92
93
  /* @__PURE__ */ l("span", { className: "rounded bg-amber-100 px-1 py-px text-[9px] normal-case tracking-normal text-amber-700 dark:bg-amber-400/20 dark:text-amber-300", children: "will apply" }),
93
- /* @__PURE__ */ n(
94
+ /* @__PURE__ */ i(
94
95
  "button",
95
96
  {
96
97
  type: "button",
97
- onClick: () => $(e.field),
98
+ onClick: () => S(e.field),
98
99
  className: "ml-auto inline-flex items-center gap-0.5 rounded px-1 text-[10px] normal-case tracking-normal text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",
99
100
  "data-tip": "Leave this field as each line has it",
100
101
  children: [
101
- /* @__PURE__ */ l(A, { className: "h-2.5 w-2.5", "aria-hidden": "true" }),
102
+ /* @__PURE__ */ l(B, { className: "h-2.5 w-2.5", "aria-hidden": "true" }),
102
103
  "keep"
103
104
  ]
104
105
  }
@@ -113,13 +114,13 @@ function X({
113
114
  ) : null
114
115
  ] }),
115
116
  /* @__PURE__ */ l(
116
- q,
117
+ P,
117
118
  {
118
- field: v,
119
- value: k[e.field] ?? null,
120
- onChange: (T) => C(e.field, T),
121
- relations: N,
122
- collection: w,
119
+ field: y,
120
+ value: N[e.field] ?? null,
121
+ onChange: (z) => $(e.field, z),
122
+ relations: w,
123
+ collection: D,
123
124
  itemId: "new",
124
125
  cascadeFilter: f == null ? void 0 : f[e.field]
125
126
  }
@@ -131,8 +132,8 @@ function X({
131
132
  })
132
133
  }
133
134
  ) }),
134
- /* @__PURE__ */ n(V, { className: "items-center", children: [
135
- /* @__PURE__ */ l("span", { className: "mr-auto text-[11px] text-slate-500 dark:text-slate-400", children: i.size === 0 ? "Change a field to enable Apply" : `${i.size} ${i.size === 1 ? "field" : "fields"} → ${r} ${m}` }),
135
+ /* @__PURE__ */ i(K, { className: "items-center", children: [
136
+ /* @__PURE__ */ l("span", { className: "mr-auto text-[11px] text-slate-500 dark:text-slate-400", children: n.size === 0 ? "Change a field to enable Apply" : `${n.size} ${n.size === 1 ? "field" : "fields"} → ${r} ${m}` }),
136
137
  /* @__PURE__ */ l(
137
138
  "button",
138
139
  {
@@ -143,15 +144,15 @@ function X({
143
144
  children: "Cancel"
144
145
  }
145
146
  ),
146
- /* @__PURE__ */ n(
147
+ /* @__PURE__ */ i(
147
148
  "button",
148
149
  {
149
150
  type: "button",
150
- disabled: s || i.size === 0 || r === 0,
151
- onClick: () => void S(),
151
+ disabled: s || n.size === 0 || r === 0,
152
+ onClick: () => void T(),
152
153
  className: "inline-flex items-center gap-1.5 rounded bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-50",
153
154
  children: [
154
- s && /* @__PURE__ */ l(B, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": "true" }),
155
+ s && /* @__PURE__ */ l(F, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": "true" }),
155
156
  s ? "Applying…" : `Apply to ${r} ${m}`
156
157
  ]
157
158
  }
@@ -162,5 +163,5 @@ function X({
162
163
  ) });
163
164
  }
164
165
  export {
165
- X as GridBulkEditDialog
166
+ _ as GridBulkEditDialog
166
167
  };