@nivaro/react 0.3.57 → 0.3.59

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 (69) 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 +37 -2
  6. package/dist/index.js +523 -520
  7. package/dist/shared/components/CollectionBrowserView.js +2693 -2619
  8. package/dist/shared/components/DataTable.js +538 -495
  9. package/dist/shared/components/ItemEditForm.js +4559 -4386
  10. package/dist/shared/components/PageRenderer.js +537 -508
  11. package/dist/shared/components/ProfileView.js +716 -715
  12. package/dist/shared/components/QueryTable.js +74 -74
  13. package/dist/shared/components/RecordReadView.js +367 -364
  14. package/dist/shared/components/ReportView.js +64 -39
  15. package/dist/shared/components/WidgetSlot.js +543 -520
  16. package/dist/shared/components/alerts/AlertManagerView.js +324 -317
  17. package/dist/shared/components/alerts/types.js +37 -14
  18. package/dist/shared/components/cbv/row-focus.js +19 -0
  19. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  20. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  21. package/dist/shared/components/integrations/console/tone.js +52 -30
  22. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  23. package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
  24. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  25. package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
  26. package/dist/shared/components/item-edit/InlineTableField.js +2487 -2442
  27. package/dist/shared/components/item-edit/M2MCombobox.js +321 -295
  28. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  29. package/dist/shared/components/item-edit/PlanGrid.js +973 -894
  30. package/dist/shared/components/item-edit/QuickCreateButton.js +335 -106
  31. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  32. package/dist/shared/components/item-edit/RelationCombobox.js +452 -335
  33. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +262 -141
  34. package/dist/shared/components/item-edit/SummaryPanel.js +385 -358
  35. package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
  36. package/dist/shared/components/item-edit/line-midair.js +82 -75
  37. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  38. package/dist/shared/components/item-edit/related-missing.js +45 -0
  39. package/dist/shared/components/item-edit/save-outcome.js +9 -7
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  41. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  42. package/dist/shared/components/panels/ItemLockBanner.js +213 -211
  43. package/dist/shared/components/panels/PipelinePanel.js +1140 -1053
  44. package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
  45. package/dist/shared/components/panels/RevisionsPanel.js +316 -299
  46. package/dist/shared/components/panels/TaskPanel.js +265 -249
  47. package/dist/shared/components/panels/landing-state.js +27 -0
  48. package/dist/shared/components/pipeline/PipelineEditorView.js +110 -92
  49. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  50. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  51. package/dist/shared/components/queue/QueueQuickFilters.js +52 -52
  52. package/dist/shared/components/queue/QueueWorklist.js +1050 -1026
  53. package/dist/shared/components/queue/group-sums.js +27 -0
  54. package/dist/shared/components/queue/live-state-aspect.js +9 -5
  55. package/dist/shared/components/widgets/ReviewListWidget.js +175 -154
  56. package/dist/shared/lib/back-closes.js +25 -0
  57. package/dist/shared/lib/display-prefs.js +60 -52
  58. package/dist/shared/lib/draft-store.js +71 -48
  59. package/dist/shared/lib/expression.js +53 -53
  60. package/dist/shared/lib/form-usage-beacon.js +7 -7
  61. package/dist/shared/lib/list-page-memory.js +63 -0
  62. package/dist/shared/lib/live.js +44 -44
  63. package/dist/shared/lib/money-input.js +45 -0
  64. package/dist/shared/lib/own-writes.js +76 -28
  65. package/dist/shared/lib/request-gate.js +110 -109
  66. package/dist/shared/lib/sanitize-html.js +10 -6
  67. package/dist/shared/lib/staged-row-labels.js +18 -0
  68. package/dist/shared/lib/validation-rules.js +34 -19
  69. package/package.json +1 -1
@@ -1,137 +1,159 @@
1
- import { jsxs as s, Fragment as Q, jsx as e } from "react/jsx-runtime";
2
- import { Search as Ge, Pin as Pe, ChevronDown as et, Inbox as tt, ChevronsUpDown as I, ChevronUp as rt, X as G, Check as at, CalendarDays as lt } from "lucide-react";
3
- import nt, { useMemo as Oe, useRef as K, useState as O, useEffect as Y, useLayoutEffect as st } from "react";
4
- import { parseDateFilter as Se, describeDateFilter as it, DATE_FILTER_OPS as dt, formatDateFilter as ot } from "../lib/date-filter.js";
5
- import { parseNumberFilter as $e, describeNumberFilter as ct, NUMBER_FILTER_OPS as pt, formatNumberFilter as bt } from "../lib/number-filter.js";
6
- import { fitPins as ht } from "../lib/table-pins.js";
7
- import { cn as b, formatNumber as be } from "../lib/utils.js";
8
- import { CellCopyLayer as mt } from "./CellCopyLayer.js";
9
- import { EmptyState as ut } from "./EmptyState.js";
10
- import { HScrollProxy as xt } from "./HScrollProxy.js";
11
- import { TableSkeletonRows as ft } from "./Skeletons.js";
12
- import { Button as Ce } from "./ui/button.js";
13
- import { Checkbox as ze } from "./ui/checkbox.js";
14
- import { Command as yt, CommandInput as gt, CommandList as kt, CommandEmpty as vt, CommandItem as Nt } from "./ui/command.js";
15
- import { Input as j } from "./ui/input.js";
1
+ import { jsxs as n, Fragment as H, jsx as t } from "react/jsx-runtime";
2
+ import { Search as tt, Pin as rt, ChevronDown as at, Inbox as lt, ChevronsUpDown as I, ChevronUp as nt, X as G, Check as st, CalendarDays as it } from "lucide-react";
3
+ import dt, { useMemo as Ee, useRef as K, useState as O, useEffect as Q, useLayoutEffect as ot } from "react";
4
+ import { parseDateFilter as Me, describeDateFilter as ct, DATE_FILTER_OPS as pt, formatDateFilter as bt } from "../lib/date-filter.js";
5
+ import { parseNumberFilter as Re, describeNumberFilter as ht, NUMBER_FILTER_OPS as mt, formatNumberFilter as ut } from "../lib/number-filter.js";
6
+ import { fitPins as xt } from "../lib/table-pins.js";
7
+ import { cn as h, formatNumber as be } from "../lib/utils.js";
8
+ import { CellCopyLayer as ft } from "./CellCopyLayer.js";
9
+ import { EmptyState as yt } from "./EmptyState.js";
10
+ import { HScrollProxy as gt } from "./HScrollProxy.js";
11
+ import { TableSkeletonRows as kt } from "./Skeletons.js";
12
+ import { Button as Te } from "./ui/button.js";
13
+ import { Checkbox as Fe } from "./ui/checkbox.js";
14
+ import { Command as vt, CommandInput as Nt, CommandList as wt, CommandEmpty as _t, CommandItem as Ot } from "./ui/command.js";
15
+ import { Input as A } from "./ui/input.js";
16
16
  import { Popover as P, PopoverTrigger as ee, PopoverContent as te } from "./ui/popover.js";
17
- import { Select as wt, SelectTrigger as _t, SelectValue as Ot, SelectContent as St, SelectItem as Me } from "./ui/select.js";
18
- import { Table as Re, TableHeader as Ee, TableRow as U, TableHead as J, TableBody as Te, TableCell as D } from "./ui/table.js";
19
- const $t = [1, 2, 3, 4, 5, 6, 7, 8];
20
- function Ve(a) {
21
- return a.startsWith("-") ? a.slice(1) : a;
17
+ import { Select as St, SelectTrigger as $t, SelectValue as Ct, SelectContent as zt, SelectItem as je } from "./ui/select.js";
18
+ import { Table as Ae, TableHeader as Le, TableRow as U, TableHead as J, TableBody as Ve, TableCell as Z } from "./ui/table.js";
19
+ const Et = [1, 2, 3, 4, 5, 6, 7, 8];
20
+ function me(r) {
21
+ var s;
22
+ return r == null || typeof r == "boolean" ? "" : typeof r == "string" || typeof r == "number" ? String(r) : Array.isArray(r) ? r.map(me).join("") : typeof r == "object" && "props" in r ? me((s = r.props) == null ? void 0 : s.children) : "";
22
23
  }
23
- function je(a) {
24
- return a ? a.startsWith("-") ? "desc" : "asc" : null;
24
+ function Mt(r) {
25
+ const s = me(r.header).replace(/\s+/g, " ").trim();
26
+ if (s) return s;
27
+ const d = (r.key.split(".").pop() ?? r.key).replace(/_/g, " ").trim();
28
+ return d ? d[0].toUpperCase() + d.slice(1) : r.key;
25
29
  }
26
- function Ct(a, i) {
27
- const c = Ve(a), o = je(a);
28
- return c !== i || !a ? i : o === "asc" ? `-${i}` : "";
30
+ function ue(r) {
31
+ return r.startsWith("-") ? r.slice(1) : r;
29
32
  }
30
- function zt({ field: a, sort: i }) {
31
- const c = Ve(i), o = je(i);
32
- return c !== a || !i ? /* @__PURE__ */ e(I, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ e(
33
- rt,
33
+ function xe(r) {
34
+ return r ? r.startsWith("-") ? "desc" : "asc" : null;
35
+ }
36
+ function Rt(r, s) {
37
+ const o = ue(r), d = xe(r);
38
+ return o !== s || !r ? s : d === "asc" ? `-${s}` : "";
39
+ }
40
+ function Tt(r, s) {
41
+ const o = s.trim().toLowerCase().split(/\s+/).filter(Boolean);
42
+ if (o.length === 0) return 1;
43
+ const d = r.toLowerCase();
44
+ return o.every((m) => d.includes(m)) ? 1 : 0;
45
+ }
46
+ function Ft(r, s) {
47
+ return !r || ue(r) !== s ? "none" : xe(r) === "desc" ? "descending" : "ascending";
48
+ }
49
+ function he(r) {
50
+ return typeof r == "string" || typeof r == "number";
51
+ }
52
+ function We({ field: r, sort: s }) {
53
+ const o = ue(s), d = xe(s);
54
+ return o !== r || !s ? /* @__PURE__ */ t(I, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ t(
55
+ nt,
34
56
  {
35
- className: b(
57
+ className: h(
36
58
  "ml-1 inline h-3 w-3 shrink-0 text-nvr-cyan transition-transform duration-200",
37
- o === "desc" && "rotate-180"
59
+ d === "desc" && "rotate-180"
38
60
  )
39
61
  }
40
62
  );
41
63
  }
42
- function Mt({
43
- def: a,
44
- value: i,
45
- onChange: c
64
+ function jt({
65
+ def: r,
66
+ value: s,
67
+ onChange: o
46
68
  }) {
47
- const [o, m] = O(!1), [l, d] = O(""), [y, g] = O([]), [k, u] = O(!1), [p, w] = O({}), r = K(0), S = !!a.loadOptions, v = Array.isArray(i) ? i : i === "" ? [] : [i];
48
- Y(() => {
49
- if (!S || !o) return;
50
- const x = ++r.current;
69
+ const [d, m] = O(!1), [l, p] = O(""), [y, g] = O([]), [k, u] = O(!1), [b, w] = O({}), a = K(0), S = !!r.loadOptions, v = Array.isArray(s) ? s : s === "" ? [] : [s];
70
+ Q(() => {
71
+ if (!S || !d) return;
72
+ const x = ++a.current;
51
73
  u(!0);
52
74
  const C = setTimeout(
53
75
  () => {
54
- var E;
55
- (E = a.loadOptions) == null || E.call(a, l).then((F) => {
56
- r.current === x && g(F);
76
+ var R;
77
+ (R = r.loadOptions) == null || R.call(r, l).then((F) => {
78
+ a.current === x && g(F);
57
79
  }).catch(() => {
58
- r.current === x && g([]);
80
+ a.current === x && g([]);
59
81
  }).finally(() => {
60
- r.current === x && u(!1);
82
+ a.current === x && u(!1);
61
83
  });
62
84
  },
63
85
  l ? 250 : 0
64
86
  );
65
87
  return () => clearTimeout(C);
66
- }, [l, o, S]);
67
- const X = S ? y : a.options ?? [], Z = (x) => {
68
- var C, E;
69
- return ((C = X.find((F) => F.value === x)) == null ? void 0 : C.label) ?? ((E = (a.options ?? []).find((F) => F.value === x)) == null ? void 0 : E.label) ?? p[x] ?? x;
70
- }, R = v.length === 0 ? null : v.length === 1 ? Z(v[0]) : `${Z(v[0])} +${v.length - 1}`;
71
- return /* @__PURE__ */ s(
88
+ }, [l, d, S]);
89
+ const X = S ? y : r.options ?? [], Y = (x) => {
90
+ var C, R;
91
+ return ((C = X.find((F) => F.value === x)) == null ? void 0 : C.label) ?? ((R = (r.options ?? []).find((F) => F.value === x)) == null ? void 0 : R.label) ?? b[x] ?? x;
92
+ }, M = v.length === 0 ? null : v.length === 1 ? Y(v[0]) : `${Y(v[0])} +${v.length - 1}`;
93
+ return /* @__PURE__ */ n(
72
94
  P,
73
95
  {
74
- open: o,
96
+ open: d,
75
97
  onOpenChange: (x) => {
76
- m(x), x || d("");
98
+ m(x), x || p("");
77
99
  },
78
100
  children: [
79
- /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
101
+ /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ n(
80
102
  "button",
81
103
  {
82
104
  type: "button",
83
- className: b(
105
+ className: h(
84
106
  "flex h-8 w-40 items-center justify-between rounded-md border border-slate-200 bg-slate-50 px-2.5 text-[13px] dark:border-border dark:bg-muted/40",
85
- R ? "text-slate-800 dark:text-foreground" : "text-slate-500"
107
+ M ? "text-slate-800 dark:text-foreground" : "text-slate-500"
86
108
  ),
87
109
  children: [
88
- /* @__PURE__ */ e("span", { className: "truncate", children: R ?? a.placeholder }),
89
- /* @__PURE__ */ s("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
110
+ /* @__PURE__ */ t("span", { className: "truncate", children: M ?? r.placeholder }),
111
+ /* @__PURE__ */ n("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
90
112
  v.length > 0 && // biome-ignore lint/a11y/useKeyWithClickEvents: auxiliary clear affordance; Esc + reselect cover keyboard
91
- /* @__PURE__ */ e(
113
+ /* @__PURE__ */ t(
92
114
  "span",
93
115
  {
94
116
  role: "button",
95
117
  tabIndex: -1,
96
118
  "aria-label": "Clear filter",
97
119
  onClick: (x) => {
98
- x.stopPropagation(), c(a.multi ? [] : "");
120
+ x.stopPropagation(), o(r.multi ? [] : "");
99
121
  },
100
122
  className: "rounded p-0.5 text-slate-400 hover:text-slate-600",
101
- children: /* @__PURE__ */ e(G, { className: "h-3 w-3" })
123
+ children: /* @__PURE__ */ t(G, { className: "h-3 w-3" })
102
124
  }
103
125
  ),
104
- /* @__PURE__ */ e(I, { className: "h-3 w-3 text-slate-400" })
126
+ /* @__PURE__ */ t(I, { className: "h-3 w-3 text-slate-400" })
105
127
  ] })
106
128
  ]
107
129
  }
108
130
  ) }),
109
- /* @__PURE__ */ e(te, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ s(yt, { shouldFilter: !S, children: [
110
- /* @__PURE__ */ e(
111
- gt,
131
+ /* @__PURE__ */ t(te, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ n(vt, { shouldFilter: !S, filter: Tt, children: [
132
+ /* @__PURE__ */ t(
133
+ Nt,
112
134
  {
113
135
  placeholder: "Search…",
114
136
  className: "h-8 text-[12px]",
115
137
  value: l,
116
- onValueChange: d
138
+ onValueChange: p
117
139
  }
118
140
  ),
119
- /* @__PURE__ */ s(kt, { children: [
120
- /* @__PURE__ */ e(vt, { className: "py-3 text-center text-[12px] text-slate-400", children: k ? "Searching…" : "No results" }),
141
+ /* @__PURE__ */ n(wt, { children: [
142
+ /* @__PURE__ */ t(_t, { className: "py-3 text-center text-[12px] text-slate-400", children: k ? "Searching…" : "No results" }),
121
143
  X.map((x) => {
122
144
  const C = v.includes(x.value);
123
- return /* @__PURE__ */ s(
124
- Nt,
145
+ return /* @__PURE__ */ n(
146
+ Ot,
125
147
  {
126
148
  value: S ? x.value : x.label,
127
149
  onSelect: () => {
128
- w((E) => ({ ...E, [x.value]: x.label })), a.multi ? c(
129
- C ? v.filter((E) => E !== x.value) : [...v, x.value]
130
- ) : (c(C ? "" : x.value), m(!1));
150
+ w((R) => ({ ...R, [x.value]: x.label })), r.multi ? o(
151
+ C ? v.filter((R) => R !== x.value) : [...v, x.value]
152
+ ) : (o(C ? "" : x.value), m(!1));
131
153
  },
132
154
  className: "text-[12px]",
133
155
  children: [
134
- /* @__PURE__ */ e(at, { className: b("mr-2 h-3 w-3", C ? "opacity-100" : "opacity-0") }),
156
+ /* @__PURE__ */ t(st, { className: h("mr-2 h-3 w-3", C ? "opacity-100" : "opacity-0") }),
135
157
  x.label
136
158
  ]
137
159
  },
@@ -144,80 +166,80 @@ function Mt({
144
166
  }
145
167
  );
146
168
  }
147
- function Rt({
148
- value: a,
149
- placeholder: i,
150
- onChange: c
169
+ function At({
170
+ value: r,
171
+ placeholder: s,
172
+ onChange: o
151
173
  }) {
152
- const [o, m] = O(!1), l = Se(a), [d, y] = O((l == null ? void 0 : l.op) ?? "on"), [g, k] = O((l == null ? void 0 : l.from) ?? ""), [u, p] = O((l == null ? void 0 : l.to) ?? "");
153
- Y(() => {
154
- if (!o) return;
155
- const r = Se(a);
156
- y((r == null ? void 0 : r.op) ?? "on"), k((r == null ? void 0 : r.from) ?? ""), p((r == null ? void 0 : r.to) ?? "");
157
- }, [o, a]);
158
- const w = (r, S, v) => {
159
- S && (c(ot({ op: r, from: S, to: v || S })), (r !== "between" || v) && m(!1));
174
+ const [d, m] = O(!1), l = Me(r), [p, y] = O((l == null ? void 0 : l.op) ?? "on"), [g, k] = O((l == null ? void 0 : l.from) ?? ""), [u, b] = O((l == null ? void 0 : l.to) ?? "");
175
+ Q(() => {
176
+ if (!d) return;
177
+ const a = Me(r);
178
+ y((a == null ? void 0 : a.op) ?? "on"), k((a == null ? void 0 : a.from) ?? ""), b((a == null ? void 0 : a.to) ?? "");
179
+ }, [d, r]);
180
+ const w = (a, S, v) => {
181
+ S && (o(bt({ op: a, from: S, to: v || S })), (a !== "between" || v) && m(!1));
160
182
  };
161
- return /* @__PURE__ */ s(P, { open: o, onOpenChange: m, children: [
162
- /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
183
+ return /* @__PURE__ */ n(P, { open: d, onOpenChange: m, children: [
184
+ /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ n(
163
185
  "button",
164
186
  {
165
187
  type: "button",
166
188
  "data-date-filter": !0,
167
189
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
168
190
  children: [
169
- /* @__PURE__ */ e("span", { className: b("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? it(l) : i }),
170
- l ? /* @__PURE__ */ e(
191
+ /* @__PURE__ */ t("span", { className: h("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ct(l) : s }),
192
+ l ? /* @__PURE__ */ t(
171
193
  G,
172
194
  {
173
195
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
174
- onClick: (r) => {
175
- r.stopPropagation(), c(null);
196
+ onClick: (a) => {
197
+ a.stopPropagation(), o(null);
176
198
  }
177
199
  }
178
- ) : /* @__PURE__ */ e(lt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
200
+ ) : /* @__PURE__ */ t(it, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
179
201
  ]
180
202
  }
181
203
  ) }),
182
- /* @__PURE__ */ s(te, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
183
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children: dt.map((r) => /* @__PURE__ */ e(
204
+ /* @__PURE__ */ n(te, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
205
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-1", children: pt.map((a) => /* @__PURE__ */ t(
184
206
  "button",
185
207
  {
186
208
  type: "button",
187
- "data-date-op": r.op,
188
- "aria-pressed": d === r.op,
209
+ "data-date-op": a.op,
210
+ "aria-pressed": p === a.op,
189
211
  onClick: () => {
190
- y(r.op), g && w(r.op, g, u);
212
+ y(a.op), g && w(a.op, g, u);
191
213
  },
192
- className: b(
214
+ className: h(
193
215
  "rounded border px-1 py-1 text-[11px] leading-tight transition-colors",
194
- d === r.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
216
+ p === a.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
195
217
  ),
196
- children: r.label
218
+ children: a.label
197
219
  },
198
- r.op
220
+ a.op
199
221
  )) }),
200
- /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
201
- /* @__PURE__ */ e(
222
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
223
+ /* @__PURE__ */ t(
202
224
  "input",
203
225
  {
204
226
  type: "date",
205
227
  value: g,
206
- onChange: (r) => {
207
- k(r.target.value), d !== "between" && w(d, r.target.value, "");
228
+ onChange: (a) => {
229
+ k(a.target.value), p !== "between" && w(p, a.target.value, "");
208
230
  },
209
231
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
210
232
  }
211
233
  ),
212
- d === "between" && /* @__PURE__ */ s(Q, { children: [
213
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "to" }),
214
- /* @__PURE__ */ e(
234
+ p === "between" && /* @__PURE__ */ n(H, { children: [
235
+ /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "to" }),
236
+ /* @__PURE__ */ t(
215
237
  "input",
216
238
  {
217
239
  type: "date",
218
240
  value: u,
219
- onChange: (r) => {
220
- p(r.target.value), w("between", g, r.target.value);
241
+ onChange: (a) => {
242
+ b(a.target.value), w("between", g, a.target.value);
221
243
  },
222
244
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
223
245
  }
@@ -227,63 +249,63 @@ function Rt({
227
249
  ] })
228
250
  ] });
229
251
  }
230
- function Et({
231
- value: a,
232
- placeholder: i,
233
- unit: c,
234
- onChange: o
252
+ function Lt({
253
+ value: r,
254
+ placeholder: s,
255
+ unit: o,
256
+ onChange: d
235
257
  }) {
236
- const [m, l] = O(!1), [d, y] = a.split(":"), g = c ?? "", k = d && y ? `${d}–${y}${g}` : d ? `${d}${g}+` : y ? `≤ ${y}${g}` : i, u = (p, w) => o(p === "" && w === "" ? null : `${p}:${w}`);
237
- return /* @__PURE__ */ s(P, { open: m, onOpenChange: l, children: [
238
- /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
258
+ const [m, l] = O(!1), [p, y] = r.split(":"), g = o ?? "", k = p && y ? `${p}–${y}${g}` : p ? `${p}${g}+` : y ? `≤ ${y}${g}` : s, u = (b, w) => d(b === "" && w === "" ? null : `${b}:${w}`);
259
+ return /* @__PURE__ */ n(P, { open: m, onOpenChange: l, children: [
260
+ /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ n(
239
261
  "button",
240
262
  {
241
263
  type: "button",
242
264
  "data-range-filter": !0,
243
265
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
244
266
  children: [
245
- /* @__PURE__ */ e(
267
+ /* @__PURE__ */ t(
246
268
  "span",
247
269
  {
248
- className: b("truncate", !d && !y && "text-slate-500 dark:text-muted-foreground"),
270
+ className: h("truncate", !p && !y && "text-slate-500 dark:text-muted-foreground"),
249
271
  children: k
250
272
  }
251
273
  ),
252
- d || y ? /* @__PURE__ */ e(
274
+ p || y ? /* @__PURE__ */ t(
253
275
  G,
254
276
  {
255
277
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
256
- onClick: (p) => {
257
- p.stopPropagation(), o(null);
278
+ onClick: (b) => {
279
+ b.stopPropagation(), d(null);
258
280
  }
259
281
  }
260
- ) : /* @__PURE__ */ e(I, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
282
+ ) : /* @__PURE__ */ t(I, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
261
283
  ]
262
284
  }
263
285
  ) }),
264
- /* @__PURE__ */ s(te, { align: "start", className: "w-[200px] p-2", children: [
265
- /* @__PURE__ */ e("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: i }),
266
- /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
267
- /* @__PURE__ */ e(
268
- j,
286
+ /* @__PURE__ */ n(te, { align: "start", className: "w-[200px] p-2", children: [
287
+ /* @__PURE__ */ t("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: s }),
288
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
289
+ /* @__PURE__ */ t(
290
+ A,
269
291
  {
270
292
  type: "number",
271
- "aria-label": `Minimum ${i}`,
293
+ "aria-label": `Minimum ${s}`,
272
294
  placeholder: "Min",
273
- value: d ?? "",
274
- onChange: (p) => u(p.target.value, y ?? ""),
295
+ value: p ?? "",
296
+ onChange: (b) => u(b.target.value, y ?? ""),
275
297
  className: "h-7 text-[12px]"
276
298
  }
277
299
  ),
278
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "–" }),
279
- /* @__PURE__ */ e(
280
- j,
300
+ /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
301
+ /* @__PURE__ */ t(
302
+ A,
281
303
  {
282
304
  type: "number",
283
- "aria-label": `Maximum ${i}`,
305
+ "aria-label": `Maximum ${s}`,
284
306
  placeholder: "Max",
285
307
  value: y ?? "",
286
- onChange: (p) => u(d ?? "", p.target.value),
308
+ onChange: (b) => u(p ?? "", b.target.value),
287
309
  className: "h-7 text-[12px]"
288
310
  }
289
311
  )
@@ -291,80 +313,80 @@ function Et({
291
313
  ] })
292
314
  ] });
293
315
  }
294
- function Tt({
295
- value: a,
296
- placeholder: i,
297
- onChange: c
316
+ function Vt({
317
+ value: r,
318
+ placeholder: s,
319
+ onChange: o
298
320
  }) {
299
- const [o, m] = O(!1), l = $e(a), [d, y] = O((l == null ? void 0 : l.op) ?? "eq"), [g, k] = O(l ? String(l.a) : ""), [u, p] = O((l == null ? void 0 : l.b) != null ? String(l.b) : "");
300
- Y(() => {
301
- if (!o) return;
302
- const r = $e(a);
303
- y((r == null ? void 0 : r.op) ?? "eq"), k(r ? String(r.a) : ""), p((r == null ? void 0 : r.b) != null ? String(r.b) : "");
304
- }, [o, a]);
305
- const w = (r, S, v) => {
306
- S === "" || Number.isNaN(Number(S)) || r === "between" && (v === "" || Number.isNaN(Number(v))) || c(bt({ op: r, a: Number(S), b: v === "" ? void 0 : Number(v) }));
321
+ const [d, m] = O(!1), l = Re(r), [p, y] = O((l == null ? void 0 : l.op) ?? "eq"), [g, k] = O(l ? String(l.a) : ""), [u, b] = O((l == null ? void 0 : l.b) != null ? String(l.b) : "");
322
+ Q(() => {
323
+ if (!d) return;
324
+ const a = Re(r);
325
+ y((a == null ? void 0 : a.op) ?? "eq"), k(a ? String(a.a) : ""), b((a == null ? void 0 : a.b) != null ? String(a.b) : "");
326
+ }, [d, r]);
327
+ const w = (a, S, v) => {
328
+ S === "" || Number.isNaN(Number(S)) || a === "between" && (v === "" || Number.isNaN(Number(v))) || o(ut({ op: a, a: Number(S), b: v === "" ? void 0 : Number(v) }));
307
329
  };
308
- return /* @__PURE__ */ s(P, { open: o, onOpenChange: m, children: [
309
- /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ s(
330
+ return /* @__PURE__ */ n(P, { open: d, onOpenChange: m, children: [
331
+ /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ n(
310
332
  "button",
311
333
  {
312
334
  type: "button",
313
335
  "data-number-filter": !0,
314
336
  className: "flex h-8 w-full items-center justify-between gap-1 rounded-md border border-slate-200 bg-slate-50 px-2 text-left text-[12px] dark:border-border dark:bg-muted",
315
337
  children: [
316
- /* @__PURE__ */ e("span", { className: b("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ct(l) : i }),
317
- l ? /* @__PURE__ */ e(
338
+ /* @__PURE__ */ t("span", { className: h("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ht(l) : s }),
339
+ l ? /* @__PURE__ */ t(
318
340
  G,
319
341
  {
320
342
  className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
321
- onClick: (r) => {
322
- r.stopPropagation(), c(null);
343
+ onClick: (a) => {
344
+ a.stopPropagation(), o(null);
323
345
  }
324
346
  }
325
- ) : /* @__PURE__ */ e(I, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
347
+ ) : /* @__PURE__ */ t(I, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
326
348
  ]
327
349
  }
328
350
  ) }),
329
- /* @__PURE__ */ s(te, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
330
- /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-1", children: pt.map((r) => /* @__PURE__ */ e(
351
+ /* @__PURE__ */ n(te, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
352
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-1", children: mt.map((a) => /* @__PURE__ */ t(
331
353
  "button",
332
354
  {
333
355
  type: "button",
334
- "data-number-op": r.op,
335
- "aria-pressed": d === r.op,
356
+ "data-number-op": a.op,
357
+ "aria-pressed": p === a.op,
336
358
  onClick: () => {
337
- y(r.op), w(r.op, g, u);
359
+ y(a.op), w(a.op, g, u);
338
360
  },
339
- className: b(
361
+ className: h(
340
362
  "rounded border px-1 py-1 text-[11px] transition-colors",
341
- d === r.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
363
+ p === a.op ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium" : "border-slate-200 text-slate-600 hover:bg-muted dark:border-border dark:text-muted-foreground"
342
364
  ),
343
- children: r.symbol
365
+ children: a.symbol
344
366
  },
345
- r.op
367
+ a.op
346
368
  )) }),
347
- /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
348
- /* @__PURE__ */ e(
349
- j,
369
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
370
+ /* @__PURE__ */ t(
371
+ A,
350
372
  {
351
373
  type: "number",
352
374
  value: g,
353
- onChange: (r) => {
354
- k(r.target.value), w(d, r.target.value, u);
375
+ onChange: (a) => {
376
+ k(a.target.value), w(p, a.target.value, u);
355
377
  },
356
378
  className: "h-7 text-[12px]"
357
379
  }
358
380
  ),
359
- d === "between" && /* @__PURE__ */ s(Q, { children: [
360
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "–" }),
361
- /* @__PURE__ */ e(
362
- j,
381
+ p === "between" && /* @__PURE__ */ n(H, { children: [
382
+ /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
383
+ /* @__PURE__ */ t(
384
+ A,
363
385
  {
364
386
  type: "number",
365
387
  value: u,
366
- onChange: (r) => {
367
- p(r.target.value), w(d, g, r.target.value);
388
+ onChange: (a) => {
389
+ b(a.target.value), w(p, g, a.target.value);
368
390
  },
369
391
  className: "h-7 text-[12px]"
370
392
  }
@@ -374,108 +396,108 @@ function Tt({
374
396
  ] })
375
397
  ] });
376
398
  }
377
- function Fe({
378
- def: a,
379
- value: i,
380
- onChange: c,
381
- layout: o = "inline"
399
+ function qe({
400
+ def: r,
401
+ value: s,
402
+ onChange: o,
403
+ layout: d = "inline"
382
404
  }) {
383
- const m = o === "stacked", l = o === "cell", d = typeof i == "string" ? i : "", y = m || l ? "w-full" : "w-40", g = l ? "h-7 text-[12px]" : "text-[13px]";
405
+ const m = d === "stacked", l = d === "cell", p = typeof s == "string" ? s : "", y = m || l ? "w-full" : "w-40", g = l ? "h-7 text-[12px]" : "text-[13px]";
384
406
  let k;
385
- if (a.type === "text")
386
- k = /* @__PURE__ */ e(
387
- j,
407
+ if (r.type === "text")
408
+ k = /* @__PURE__ */ t(
409
+ A,
388
410
  {
389
- className: b("h-8 border-slate-200 bg-slate-50", g, y),
390
- placeholder: a.placeholder,
391
- value: d,
392
- onChange: (u) => c(u.target.value)
411
+ className: h("h-8 border-slate-200 bg-slate-50", g, y),
412
+ placeholder: r.placeholder,
413
+ value: p,
414
+ onChange: (u) => o(u.target.value)
393
415
  }
394
416
  );
395
- else if (a.type === "combobox")
396
- k = /* @__PURE__ */ e(
417
+ else if (r.type === "combobox")
418
+ k = /* @__PURE__ */ t(
397
419
  "div",
398
420
  {
399
- className: b(
421
+ className: h(
400
422
  (m || l) && "[&>button]:w-full",
401
423
  l && "[&>button]:h-7 [&>button]:min-w-[88px] [&>button]:px-1.5 [&>button]:text-[12px]"
402
424
  ),
403
- children: /* @__PURE__ */ e(Mt, { def: a, value: i, onChange: c })
425
+ children: /* @__PURE__ */ t(jt, { def: r, value: s, onChange: o })
404
426
  }
405
427
  );
406
- else if (a.type === "date")
407
- k = /* @__PURE__ */ e("div", { className: b(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ e(
408
- Rt,
428
+ else if (r.type === "date")
429
+ k = /* @__PURE__ */ t("div", { className: h(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ t(
430
+ At,
409
431
  {
410
- value: d,
411
- placeholder: a.placeholder,
412
- onChange: (u) => c(u ?? "")
432
+ value: p,
433
+ placeholder: r.placeholder,
434
+ onChange: (u) => o(u ?? "")
413
435
  }
414
436
  ) });
415
- else if (a.type === "number")
416
- k = /* @__PURE__ */ e("div", { className: b(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ e(
417
- Tt,
437
+ else if (r.type === "number")
438
+ k = /* @__PURE__ */ t("div", { className: h(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ t(
439
+ Vt,
418
440
  {
419
- value: d,
420
- placeholder: a.placeholder,
421
- onChange: (u) => c(u ?? "")
441
+ value: p,
442
+ placeholder: r.placeholder,
443
+ onChange: (u) => o(u ?? "")
422
444
  }
423
445
  ) });
424
- else if (a.type === "range" && l)
425
- k = /* @__PURE__ */ e("div", { className: "[&>div>button]:h-7 [&>div>button]:text-[12px] w-full", children: /* @__PURE__ */ e(
426
- Et,
446
+ else if (r.type === "range" && l)
447
+ k = /* @__PURE__ */ t("div", { className: "[&>div>button]:h-7 [&>div>button]:text-[12px] w-full", children: /* @__PURE__ */ t(
448
+ Lt,
427
449
  {
428
- value: d,
429
- placeholder: a.placeholder,
430
- unit: a.range_unit,
431
- onChange: (u) => c(u ?? "")
450
+ value: p,
451
+ placeholder: r.placeholder,
452
+ unit: r.range_unit,
453
+ onChange: (u) => o(u ?? "")
432
454
  }
433
455
  ) });
434
- else if (a.type === "range") {
435
- const [u, p] = d.split(":");
436
- k = /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
437
- /* @__PURE__ */ e(
438
- j,
456
+ else if (r.type === "range") {
457
+ const [u, b] = p.split(":");
458
+ k = /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
459
+ /* @__PURE__ */ t(
460
+ A,
439
461
  {
440
462
  type: "number",
441
- className: b(
463
+ className: h(
442
464
  "h-8 border-slate-200 bg-slate-50",
443
465
  g,
444
466
  m || l ? "w-full min-w-[48px]" : "w-20"
445
467
  ),
446
468
  placeholder: "Min",
447
469
  value: u ?? "",
448
- onChange: (w) => c(`${w.target.value}:${p ?? ""}`)
470
+ onChange: (w) => o(`${w.target.value}:${b ?? ""}`)
449
471
  }
450
472
  ),
451
- /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-400", children: "–" }),
452
- /* @__PURE__ */ e(
453
- j,
473
+ /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-400", children: "–" }),
474
+ /* @__PURE__ */ t(
475
+ A,
454
476
  {
455
477
  type: "number",
456
- className: b(
478
+ className: h(
457
479
  "h-8 border-slate-200 bg-slate-50",
458
480
  g,
459
481
  m || l ? "w-full min-w-[48px]" : "w-20"
460
482
  ),
461
483
  placeholder: "Max",
462
- value: p ?? "",
463
- onChange: (w) => c(`${u ?? ""}:${w.target.value}`)
484
+ value: b ?? "",
485
+ onChange: (w) => o(`${u ?? ""}:${w.target.value}`)
464
486
  }
465
487
  )
466
488
  ] });
467
489
  } else
468
- k = /* @__PURE__ */ s(wt, { value: d === "" ? "__all__" : d, onValueChange: (p) => c(p === "__all__" ? "" : p), children: [
469
- /* @__PURE__ */ e(_t, { className: b("h-8 border-slate-200 bg-slate-50", g, y), children: /* @__PURE__ */ e(Ot, { placeholder: a.placeholder }) }),
470
- /* @__PURE__ */ s(St, { children: [
471
- /* @__PURE__ */ e(Me, { value: "__all__", children: a.placeholder }),
472
- (a.options ?? []).filter((p) => p.value !== "").map((p) => /* @__PURE__ */ e(Me, { value: p.value, children: p.label }, p.value))
490
+ k = /* @__PURE__ */ n(St, { value: p === "" ? "__all__" : p, onValueChange: (b) => o(b === "__all__" ? "" : b), children: [
491
+ /* @__PURE__ */ t($t, { className: h("h-8 border-slate-200 bg-slate-50", g, y), children: /* @__PURE__ */ t(Ct, { placeholder: r.placeholder }) }),
492
+ /* @__PURE__ */ n(zt, { children: [
493
+ /* @__PURE__ */ t(je, { value: "__all__", children: r.placeholder }),
494
+ (r.options ?? []).filter((b) => b.value !== "").map((b) => /* @__PURE__ */ t(je, { value: b.value, children: b.label }, b.value))
473
495
  ] })
474
496
  ] });
475
- return m ? /* @__PURE__ */ s("div", { className: "space-y-1", children: [
476
- /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
477
- Ft(a),
478
- a.restricted && /* @__PURE__ */ e(
497
+ return m ? /* @__PURE__ */ n("div", { className: "space-y-1", children: [
498
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
499
+ Wt(r),
500
+ r.restricted && /* @__PURE__ */ t(
479
501
  "span",
480
502
  {
481
503
  title: "Options limited to your restricted scope",
@@ -485,224 +507,224 @@ function Fe({
485
507
  )
486
508
  ] }),
487
509
  k
488
- ] }) : a.restricted ? /* @__PURE__ */ e(
510
+ ] }) : r.restricted ? /* @__PURE__ */ t(
489
511
  "div",
490
512
  {
491
513
  title: "Options limited to your restricted scope",
492
514
  className: "[&_button]:!border-amber-400 [&_input]:!border-amber-400 dark:[&_button]:!border-amber-500/60 dark:[&_input]:!border-amber-500/60",
493
515
  children: k
494
516
  }
495
- ) : /* @__PURE__ */ e(Q, { children: k });
517
+ ) : /* @__PURE__ */ t(H, { children: k });
496
518
  }
497
- function Ft(a) {
498
- return a.placeholder.replace(/^Search\s+/i, "").replace(/[…]|\.{3}$/g, "");
519
+ function Wt(r) {
520
+ return r.placeholder.replace(/^Search\s+/i, "").replace(/[…]|\.{3}$/g, "");
499
521
  }
500
- function Pt(a, i) {
501
- const c = (o) => {
522
+ function lr(r, s) {
523
+ const o = (d) => {
502
524
  var m, l;
503
- return ((l = (m = a.options) == null ? void 0 : m.find((d) => d.value === o)) == null ? void 0 : l.label) ?? o;
525
+ return ((l = (m = r.options) == null ? void 0 : m.find((p) => p.value === d)) == null ? void 0 : l.label) ?? d;
504
526
  };
505
- if (Array.isArray(i)) {
506
- const o = i.map(c);
507
- return o.slice(0, 2).join(", ") + (o.length > 2 ? ` +${o.length - 2}` : "");
527
+ if (Array.isArray(s)) {
528
+ const d = s.map(o);
529
+ return d.slice(0, 2).join(", ") + (d.length > 2 ? ` +${d.length - 2}` : "");
508
530
  }
509
- if (a.type === "range") {
510
- const [o, m] = i.split(":");
511
- return [o && `≥${o}`, m && `≤${m}`].filter(Boolean).join(" ");
531
+ if (r.type === "range") {
532
+ const [d, m] = s.split(":");
533
+ return [d && `≥${d}`, m && `≤${m}`].filter(Boolean).join(" ");
512
534
  }
513
- return c(i);
535
+ return o(s);
514
536
  }
515
- function er({
516
- columns: a,
517
- rows: i,
518
- rowKey: c,
519
- total: o,
537
+ function nr({
538
+ columns: r,
539
+ rows: s,
540
+ rowKey: o,
541
+ total: d,
520
542
  page: m,
521
543
  limit: l = 25,
522
- isLoading: d,
544
+ isLoading: p,
523
545
  isError: y,
524
546
  errorMessage: g,
525
547
  onRetry: k,
526
548
  sort: u = "",
527
- onSortChange: p,
549
+ onSortChange: b,
528
550
  onPageChange: w,
529
- onRowClick: r,
551
+ onRowClick: a,
530
552
  onRowContextMenu: S,
531
553
  searchValue: v,
532
554
  onSearchChange: X,
533
- searchPlaceholder: Z = "Search…",
534
- filterDefs: R,
555
+ searchPlaceholder: Y = "Search…",
556
+ filterDefs: M,
535
557
  filterValues: x = {},
536
558
  onFilterChange: C,
537
- toolbarRight: E,
559
+ toolbarRight: R,
538
560
  emptyMessage: F = "No records found.",
539
561
  minBodyHeight: q,
540
562
  fillHeight: re = !1,
541
- footer: Ae,
542
- hideFilterRow: Le = !1,
543
- nowrapCells: We = !1,
563
+ footer: Be,
564
+ hideFilterRow: Ue = !1,
565
+ nowrapCells: Je = !1,
544
566
  density: ae = "comfortable",
545
- pinFirstColumn: V = !1,
567
+ pinFirstColumn: j = !1,
546
568
  columnPins: f,
547
569
  onColumnPinChange: le,
548
- columnFilterRow: qe = !1,
549
- hScrollProxy: he = !1,
570
+ columnFilterRow: He = !1,
571
+ hScrollProxy: fe = !1,
550
572
  selectedIds: T,
551
573
  onSelectionChange: z,
552
574
  rowClassName: ne,
553
575
  rowDragProps: se,
554
576
  rowTitle: ie,
555
- enterKey: Be,
556
- rowGroups: A,
577
+ enterKey: Xe,
578
+ rowGroups: L,
557
579
  collapsedGroups: de,
558
580
  onToggleGroup: oe
559
581
  }) {
560
- const me = Math.ceil(o / l), Ue = (m - 1) * l + 1, Je = Math.min(m * l, o), ue = !Le && R && R.length > 0, Xe = v !== void 0 || ue || E !== void 0, He = (t) => {
561
- !t.sortable || !p || p(Ct(u, t.key));
562
- }, _ = f !== void 0, L = Oe(() => {
563
- if (!_ || !f) return a;
564
- const t = a.filter((M) => f[M.key] === "left"), n = a.filter((M) => f[M.key] === "right"), h = a.filter((M) => !f[M.key]);
565
- return [...t, ...h, ...n];
566
- }, [a, f, _]), xe = K({}), H = K(null), fe = K(null), ye = !d && (A ? A.length === 0 : i.length === 0), [ge, Qe] = O(null);
567
- Y(() => {
568
- const t = H.current;
569
- if (!ye || !t) return;
570
- const n = () => Qe(t.clientWidth);
571
- if (n(), typeof ResizeObserver > "u") return;
572
- const h = new ResizeObserver(n);
573
- return h.observe(t), () => h.disconnect();
574
- }, [ye]);
575
- const [ke, Ye] = O({}), [, Ze] = O(0);
576
- Y(() => {
577
- const t = H.current;
578
- if (!_ || !t || typeof ResizeObserver > "u") return;
579
- const n = new ResizeObserver(() => Ze(t.clientWidth));
580
- return n.observe(t), () => n.disconnect();
581
- }, [_, d]), st(() => {
582
- var we, _e;
582
+ const ye = Math.ceil(d / l), De = (m - 1) * l + 1, Qe = Math.min(m * l, d), ge = !Ue && M && M.length > 0, Ye = v !== void 0 || ge || R !== void 0, ke = (e) => {
583
+ !e.sortable || !b || b(Rt(u, e.key));
584
+ }, _ = f !== void 0, V = Ee(() => {
585
+ if (!_ || !f) return r;
586
+ const e = r.filter((E) => f[E.key] === "left"), i = r.filter((E) => f[E.key] === "right"), c = r.filter((E) => !f[E.key]);
587
+ return [...e, ...c, ...i];
588
+ }, [r, f, _]), ve = K({}), D = K(null), Ne = K(null), we = !p && (L ? L.length === 0 : s.length === 0), [_e, Ze] = O(null);
589
+ Q(() => {
590
+ const e = D.current;
591
+ if (!we || !e) return;
592
+ const i = () => Ze(e.clientWidth);
593
+ if (i(), typeof ResizeObserver > "u") return;
594
+ const c = new ResizeObserver(i);
595
+ return c.observe(e), () => c.disconnect();
596
+ }, [we]);
597
+ const [Oe, Ke] = O({}), [, Ie] = O(0);
598
+ Q(() => {
599
+ const e = D.current;
600
+ if (!_ || !e || typeof ResizeObserver > "u") return;
601
+ const i = new ResizeObserver(() => Ie(e.clientWidth));
602
+ return i.observe(e), () => i.disconnect();
603
+ }, [_, p]), ot(() => {
604
+ var Ce, ze;
583
605
  if (!_ || !f) return;
584
- const t = (N) => {
606
+ const e = (N) => {
585
607
  var W;
586
- return ((W = xe.current[N]) == null ? void 0 : W.getBoundingClientRect().width) ?? 120;
587
- }, n = z ? ((we = fe.current) == null ? void 0 : we.getBoundingClientRect().width) ?? 40 : 0, { left: h, right: M } = ht(
588
- L.filter((N) => f[N.key] === "left").map((N) => N.key),
589
- L.filter((N) => f[N.key] === "right").map((N) => N.key),
590
- t,
591
- n,
592
- ((_e = H.current) == null ? void 0 : _e.clientWidth) ?? 0
608
+ return ((W = ve.current[N]) == null ? void 0 : W.getBoundingClientRect().width) ?? 120;
609
+ }, i = z ? ((Ce = Ne.current) == null ? void 0 : Ce.getBoundingClientRect().width) ?? 40 : 0, { left: c, right: E } = xt(
610
+ V.filter((N) => f[N.key] === "left").map((N) => N.key),
611
+ V.filter((N) => f[N.key] === "right").map((N) => N.key),
612
+ e,
613
+ i,
614
+ ((ze = D.current) == null ? void 0 : ze.clientWidth) ?? 0
593
615
  ), $ = {};
594
- let B = n;
595
- h.forEach((N, W) => {
596
- $[N] = { side: "left", offset: Math.floor(B), seam: W === h.length - 1 }, B += t(N);
616
+ let B = i;
617
+ c.forEach((N, W) => {
618
+ $[N] = { side: "left", offset: Math.floor(B), seam: W === c.length - 1 }, B += e(N);
597
619
  });
598
- let Ne = 0;
599
- for (let N = M.length - 1; N >= 0; N--) {
600
- const W = M[N];
601
- $[W] = { side: "right", offset: Math.floor(Ne), seam: N === 0 }, Ne += t(W);
620
+ let $e = 0;
621
+ for (let N = E.length - 1; N >= 0; N--) {
622
+ const W = E[N];
623
+ $[W] = { side: "right", offset: Math.floor($e), seam: N === 0 }, $e += e(W);
602
624
  }
603
- Ye((N) => JSON.stringify(N) === JSON.stringify($) ? N : $);
625
+ Ke((N) => JSON.stringify(N) === JSON.stringify($) ? N : $);
604
626
  });
605
- const ce = (t) => {
606
- const n = ke[t];
607
- if (!(!_ || !n))
608
- return n.side === "left" ? { left: n.offset } : { right: n.offset };
609
- }, pe = (t, n) => {
610
- const h = ke[t];
611
- if (!(!_ || !h))
612
- return b(
627
+ const ce = (e) => {
628
+ const i = Oe[e];
629
+ if (!(!_ || !i))
630
+ return i.side === "left" ? { left: i.offset } : { right: i.offset };
631
+ }, pe = (e, i) => {
632
+ const c = Oe[e];
633
+ if (!(!_ || !c))
634
+ return h(
613
635
  // dt-pinned: pinned headers offset via inline style (not left-0), so the
614
636
  // fillHeight wrapper's z variants need a CLASS to elevate them above the
615
637
  // other header cells — same-z siblings paint in DOM order and a later
616
638
  // header scrolls OVER the pinned one otherwise.
617
- n ? "dt-pinned sticky z-[2]" : "sticky z-[1] bg-inherit",
618
- h.side === "left" && h.seam && "border-r border-slate-200 dark:border-border",
619
- h.side === "right" && h.seam && "border-l border-slate-200 dark:border-border"
639
+ i ? "dt-pinned sticky z-[2]" : "sticky z-[1] bg-inherit",
640
+ c.side === "left" && c.seam && "border-r border-slate-200 dark:border-border",
641
+ c.side === "right" && c.seam && "border-l border-slate-200 dark:border-border"
620
642
  );
621
- }, De = (t) => {
643
+ }, Ge = (e) => {
622
644
  if (!le) return;
623
- const n = (f == null ? void 0 : f[t]) ?? null;
624
- le(t, n === null ? "left" : n === "left" ? "right" : null);
625
- }, Ke = Oe(() => {
626
- const t = /* @__PURE__ */ new Map();
627
- for (const n of R ?? []) t.set(n.key, n);
628
- return t;
629
- }, [R]), Ie = qe && ((R == null ? void 0 : R.length) ?? 0) > 0, ve = (t, n) => {
630
- const h = c ? c(t, n) : String(n), M = (T == null ? void 0 : T.includes(h)) ?? !1;
631
- return /* @__PURE__ */ s(
645
+ const i = (f == null ? void 0 : f[e]) ?? null;
646
+ le(e, i === null ? "left" : i === "left" ? "right" : null);
647
+ }, Pe = Ee(() => {
648
+ const e = /* @__PURE__ */ new Map();
649
+ for (const i of M ?? []) e.set(i.key, i);
650
+ return e;
651
+ }, [M]), et = He && ((M == null ? void 0 : M.length) ?? 0) > 0, Se = (e, i) => {
652
+ const c = o ? o(e, i) : String(i), E = (T == null ? void 0 : T.includes(c)) ?? !1;
653
+ return /* @__PURE__ */ n(
632
654
  U,
633
655
  {
634
- ...se == null ? void 0 : se(t),
635
- className: b(
656
+ ...se == null ? void 0 : se(e),
657
+ className: h(
636
658
  // NAMED group: queue cells already use bare `group-hover:` against
637
659
  // their own local group, and claiming the unnamed one here would
638
660
  // make those reveal on row hover instead.
639
661
  "group/row nvr-row-enter border-slate-100 transition-colors duration-150",
640
- (V || _) && "bg-white dark:bg-card",
641
- r && (V || _ ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
642
- ne == null ? void 0 : ne(t),
662
+ (j || _) && "bg-white dark:bg-card",
663
+ a && (j || _ ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
664
+ ne == null ? void 0 : ne(e),
643
665
  // Pinned sticky cells use bg-inherit, so a selected row's bg must be
644
666
  // OPAQUE or horizontally-scrolled content bleeds through the pinned
645
667
  // column. bg-nvr-cyan/5 is semi-transparent — use an opaque equivalent
646
668
  // (5% nvr-cyan #00ceff over white / card) when pinning.
647
- M && (V || _ ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
669
+ E && (j || _ ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
648
670
  ),
649
- style: { animationDelay: `${Math.min(n, 14) * 16}ms` },
650
- "data-row-key": h,
651
- title: ie == null ? void 0 : ie(t),
652
- onClick: () => r == null ? void 0 : r(t),
653
- onContextMenu: S ? ($) => S(t, $) : void 0,
671
+ style: { animationDelay: `${Math.min(i, 14) * 16}ms` },
672
+ "data-row-key": c,
673
+ title: ie == null ? void 0 : ie(e),
674
+ onClick: () => a == null ? void 0 : a(e),
675
+ onContextMenu: S ? ($) => S(e, $) : void 0,
654
676
  children: [
655
- z && /* @__PURE__ */ e(
656
- D,
677
+ z && /* @__PURE__ */ t(
678
+ Z,
657
679
  {
658
- className: b(
680
+ className: h(
659
681
  "w-9 px-3",
660
682
  ae === "compact" ? "py-1" : "py-2",
661
- (V || _) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
683
+ (j || _) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
662
684
  ),
663
685
  onClick: ($) => {
664
- $.stopPropagation(), z(M ? (T == null ? void 0 : T.filter((B) => B !== h)) ?? [] : [...T ?? [], h]);
686
+ $.stopPropagation(), z(E ? (T == null ? void 0 : T.filter((B) => B !== c)) ?? [] : [...T ?? [], c]);
665
687
  },
666
- children: /* @__PURE__ */ e(ze, { checked: M, "aria-label": "Select row" })
688
+ children: /* @__PURE__ */ t(Fe, { checked: E, "aria-label": "Select row" })
667
689
  }
668
690
  ),
669
- L.map(($, B) => /* @__PURE__ */ e(
670
- D,
691
+ V.map(($, B) => /* @__PURE__ */ t(
692
+ Z,
671
693
  {
672
694
  style: ce($.key),
673
- className: b(
695
+ className: h(
674
696
  "px-3",
675
697
  ae === "compact" ? "py-1" : "py-2",
676
- We && "whitespace-nowrap",
677
- !_ && V && B === 0 && b(
698
+ Je && "whitespace-nowrap",
699
+ !_ && j && B === 0 && h(
678
700
  "sticky z-[1] border-r border-slate-100 bg-inherit dark:border-border",
679
701
  z ? "left-[39px]" : "left-0"
680
702
  ),
681
703
  pe($.key, !1),
682
704
  $.className
683
705
  ),
684
- children: $.render ? $.render(t, n) : String(t[$.key] ?? "—")
706
+ children: $.render ? $.render(e, i) : String(e[$.key] ?? "—")
685
707
  },
686
708
  $.key
687
709
  ))
688
710
  ]
689
711
  },
690
- h
712
+ c
691
713
  );
692
714
  };
693
- return /* @__PURE__ */ s(Q, { children: [
694
- /* @__PURE__ */ e(mt, {}),
695
- y && g && /* @__PURE__ */ s(
715
+ return /* @__PURE__ */ n(H, { children: [
716
+ /* @__PURE__ */ t(ft, {}),
717
+ y && g && /* @__PURE__ */ n(
696
718
  "div",
697
719
  {
698
720
  role: "alert",
699
721
  className: "mb-4 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
700
722
  children: [
701
- /* @__PURE__ */ s("span", { children: [
723
+ /* @__PURE__ */ n("span", { children: [
702
724
  g,
703
- i.length > 0 && " Showing the last list that loaded."
725
+ s.length > 0 && " Showing the last list that loaded."
704
726
  ] }),
705
- k && /* @__PURE__ */ e(
727
+ k && /* @__PURE__ */ t(
706
728
  "button",
707
729
  {
708
730
  type: "button",
@@ -714,85 +736,85 @@ function er({
714
736
  ]
715
737
  }
716
738
  ),
717
- /* @__PURE__ */ s(
739
+ /* @__PURE__ */ n(
718
740
  "div",
719
741
  {
720
- className: b(
742
+ className: h(
721
743
  "overflow-hidden rounded-lg border border-slate-200 bg-white",
722
744
  re && "flex h-full min-h-0 flex-col"
723
745
  ),
724
746
  children: [
725
- Xe && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
726
- X !== void 0 && /* @__PURE__ */ s("div", { className: "relative min-w-0 max-w-full", children: [
727
- /* @__PURE__ */ e(Ge, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
728
- /* @__PURE__ */ e(
729
- j,
747
+ Ye && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
748
+ X !== void 0 && /* @__PURE__ */ n("div", { className: "relative min-w-0 max-w-full", children: [
749
+ /* @__PURE__ */ t(tt, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
750
+ /* @__PURE__ */ t(
751
+ A,
730
752
  {
731
753
  className: "h-8 w-56 max-w-full border-slate-200 bg-slate-50 pl-8 text-[13px]",
732
- placeholder: Z,
754
+ placeholder: Y,
733
755
  value: v ?? "",
734
- onChange: (t) => X(t.target.value)
756
+ onChange: (e) => X(e.target.value)
735
757
  }
736
758
  )
737
759
  ] }),
738
- ue && (R == null ? void 0 : R.map((t) => /* @__PURE__ */ e(
739
- Fe,
760
+ ge && (M == null ? void 0 : M.map((e) => /* @__PURE__ */ t(
761
+ qe,
740
762
  {
741
- def: t,
742
- value: x[t.key] ?? "",
743
- onChange: (n) => C == null ? void 0 : C(t.key, n)
763
+ def: e,
764
+ value: x[e.key] ?? "",
765
+ onChange: (i) => C == null ? void 0 : C(e.key, i)
744
766
  },
745
- t.key
767
+ e.key
746
768
  ))),
747
- /* @__PURE__ */ e("div", { className: "flex-1" }),
748
- E
769
+ /* @__PURE__ */ t("div", { className: "flex-1" }),
770
+ R
749
771
  ] }),
750
- d ? (
772
+ p ? (
751
773
  // #3229 — the real header (same labels, h-9) over rows with the real cell padding
752
774
  // and line height for this density, in the body's real minimum height: the table
753
775
  // keeps its shape when the rows land.
754
- /* @__PURE__ */ e(
776
+ /* @__PURE__ */ t(
755
777
  "div",
756
778
  {
757
779
  "data-skeleton": "table",
758
780
  "aria-busy": "true",
759
- className: b(re && "min-h-0 flex-1 overflow-hidden"),
781
+ className: h(re && "min-h-0 flex-1 overflow-hidden"),
760
782
  style: q ? { minHeight: q } : void 0,
761
- children: /* @__PURE__ */ s(Re, { className: "border-separate border-spacing-0", children: [
762
- /* @__PURE__ */ e(Ee, { children: /* @__PURE__ */ s(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
763
- z && /* @__PURE__ */ e(J, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
764
- L.map((t) => /* @__PURE__ */ e(
783
+ children: /* @__PURE__ */ n(Ae, { className: "border-separate border-spacing-0", children: [
784
+ /* @__PURE__ */ t(Le, { children: /* @__PURE__ */ n(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
785
+ z && /* @__PURE__ */ t(J, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
786
+ V.map((e) => /* @__PURE__ */ t(
765
787
  J,
766
788
  {
767
- className: b(
789
+ className: h(
768
790
  "h-9 whitespace-nowrap border-b border-slate-200 bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500 dark:border-border dark:bg-muted",
769
- t.headerClassName
791
+ e.headerClassName
770
792
  ),
771
- children: t.header
793
+ children: e.header
772
794
  },
773
- t.key
795
+ e.key
774
796
  ))
775
797
  ] }) }),
776
- /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
777
- ft,
798
+ /* @__PURE__ */ t(Ve, { children: /* @__PURE__ */ t(
799
+ kt,
778
800
  {
779
- columns: L.map((t) => ({ key: t.key })),
780
- rows: Math.min(Math.max(l ?? $t.length, 1), 15),
801
+ columns: V.map((e) => ({ key: e.key })),
802
+ rows: Math.min(Math.max(l ?? Et.length, 1), 15),
781
803
  rowClassName: "",
782
- cellClassName: b("px-3", ae === "compact" ? "py-1" : "py-2"),
804
+ cellClassName: h("px-3", ae === "compact" ? "py-1" : "py-2"),
783
805
  leadingCells: z ? 1 : 0
784
806
  }
785
807
  ) })
786
808
  ] })
787
809
  }
788
810
  )
789
- ) : /* @__PURE__ */ s(Q, { children: [
790
- /* @__PURE__ */ e(
811
+ ) : /* @__PURE__ */ n(H, { children: [
812
+ /* @__PURE__ */ t(
791
813
  "div",
792
814
  {
793
- ref: H,
794
- className: b(
795
- he && "overflow-x-hidden [&>div]:overflow-visible",
815
+ ref: D,
816
+ className: h(
817
+ fe && "overflow-x-hidden [&>div]:overflow-visible",
796
818
  // Bounded mode: rows scroll here under a sticky header. Header
797
819
  // cells sit above pinned body cells (z-[1/2]); the pinned
798
820
  // header corner (left-0) tops the other header cells so
@@ -800,32 +822,32 @@ function er({
800
822
  re && "min-h-0 flex-1 overflow-y-auto [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-[5] [&_thead_th.left-0]:z-[6] [&_thead_th.dt-pinned]:z-[6]"
801
823
  ),
802
824
  style: q ? { minHeight: q } : void 0,
803
- children: /* @__PURE__ */ s(
804
- Re,
825
+ children: /* @__PURE__ */ n(
826
+ Ae,
805
827
  {
806
828
  "data-copy-cells": "",
807
829
  className: "border-separate border-spacing-0 [&>tbody>tr.border-b:not(:last-child)>td]:border-b [&>tbody>tr.border-b:not(:last-child)>td]:[border-bottom-color:inherit] [&>thead>tr.border-b>th]:border-b [&>thead>tr.border-b>th]:[border-bottom-color:inherit]",
808
830
  children: [
809
- /* @__PURE__ */ s(Ee, { children: [
810
- /* @__PURE__ */ s(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
811
- z && /* @__PURE__ */ e(
831
+ /* @__PURE__ */ n(Le, { children: [
832
+ /* @__PURE__ */ n(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
833
+ z && /* @__PURE__ */ t(
812
834
  J,
813
835
  {
814
- ref: fe,
815
- className: b(
836
+ ref: Ne,
837
+ className: h(
816
838
  "h-9 w-9 bg-slate-50 px-3 py-0",
817
- (V || _) && "sticky left-0 z-[2] min-w-[40px]"
839
+ (j || _) && "sticky left-0 z-[2] min-w-[40px]"
818
840
  ),
819
- children: /* @__PURE__ */ e(
820
- ze,
841
+ children: /* @__PURE__ */ t(
842
+ Fe,
821
843
  {
822
- checked: i.length > 0 && i.every((t, n) => {
823
- const h = c ? c(t, n) : String(n);
824
- return T == null ? void 0 : T.includes(h);
844
+ checked: s.length > 0 && s.every((e, i) => {
845
+ const c = o ? o(e, i) : String(i);
846
+ return T == null ? void 0 : T.includes(c);
825
847
  }),
826
- onCheckedChange: (t) => {
848
+ onCheckedChange: (e) => {
827
849
  z(
828
- t ? i.map((n, h) => c ? c(n, h) : String(h)) : []
850
+ e ? s.map((i, c) => o ? o(i, c) : String(c)) : []
829
851
  );
830
852
  },
831
853
  "aria-label": "Select all"
@@ -833,47 +855,65 @@ function er({
833
855
  )
834
856
  }
835
857
  ),
836
- L.map((t, n) => /* @__PURE__ */ e(
858
+ V.map((e, i) => /* @__PURE__ */ t(
837
859
  J,
838
860
  {
839
- ref: (h) => {
840
- xe.current[t.key] = h;
861
+ ref: (c) => {
862
+ ve.current[e.key] = c;
841
863
  },
842
- style: ce(t.key),
843
- className: b(
864
+ style: ce(e.key),
865
+ className: h(
844
866
  "group/th h-9 whitespace-nowrap bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500",
845
- t.sortable && p && "cursor-pointer select-none hover:text-slate-600",
846
- !_ && V && n === 0 && b(
867
+ e.sortable && b && "cursor-pointer select-none hover:text-slate-600",
868
+ !_ && j && i === 0 && h(
847
869
  "sticky z-[2] border-r border-slate-200 dark:border-border",
848
870
  z ? "left-[39px]" : "left-0"
849
871
  ),
850
872
  _ && "bg-slate-50 dark:bg-muted",
851
- pe(t.key, !0),
852
- t.headerClassName
873
+ pe(e.key, !0),
874
+ e.headerClassName
853
875
  ),
854
- onClick: () => He(t),
855
- children: /* @__PURE__ */ s("span", { className: "inline-flex items-center", children: [
856
- t.header,
857
- t.sortable && p && /* @__PURE__ */ e(zt, { field: t.key, sort: u }),
858
- _ && le && t.key !== "claim" && /* @__PURE__ */ e(
876
+ onClick: () => ke(e),
877
+ "aria-sort": e.sortable && b ? Ft(u, e.key) : void 0,
878
+ tabIndex: e.sortable && b && !he(e.header) ? 0 : void 0,
879
+ onKeyDown: e.sortable && b && !he(e.header) ? (c) => {
880
+ c.target === c.currentTarget && (c.key === "Enter" || c.key === " ") && (c.preventDefault(), ke(e));
881
+ } : void 0,
882
+ children: /* @__PURE__ */ n("span", { className: "inline-flex items-center", children: [
883
+ e.sortable && b && he(e.header) ? /* @__PURE__ */ n(
884
+ "button",
885
+ {
886
+ type: "button",
887
+ className: "inline-flex items-center rounded-sm text-inherit focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
888
+ "data-dt-sort": e.key,
889
+ children: [
890
+ e.header,
891
+ /* @__PURE__ */ t(We, { field: e.key, sort: u })
892
+ ]
893
+ }
894
+ ) : /* @__PURE__ */ n(H, { children: [
895
+ e.header,
896
+ e.sortable && b && /* @__PURE__ */ t(We, { field: e.key, sort: u })
897
+ ] }),
898
+ _ && le && e.key !== "claim" && /* @__PURE__ */ t(
859
899
  "button",
860
900
  {
861
901
  type: "button",
862
- onClick: (h) => {
863
- h.stopPropagation(), De(t.key);
902
+ onClick: (c) => {
903
+ c.stopPropagation(), Ge(e.key);
864
904
  },
865
- "aria-label": `Pin column ${t.key}`,
866
- title: (f == null ? void 0 : f[t.key]) === "left" ? "Pinned left — click to pin right" : (f == null ? void 0 : f[t.key]) === "right" ? "Pinned right — click to unpin" : "Pin column",
867
- className: b(
905
+ "aria-label": `Pin column ${Mt(e)}`,
906
+ title: (f == null ? void 0 : f[e.key]) === "left" ? "Pinned left — click to pin right" : (f == null ? void 0 : f[e.key]) === "right" ? "Pinned right — click to unpin" : "Pin column",
907
+ className: h(
868
908
  "ml-1 rounded p-0.5 transition-opacity",
869
- f != null && f[t.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
909
+ f != null && f[e.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
870
910
  ),
871
- children: /* @__PURE__ */ e(
872
- Pe,
911
+ children: /* @__PURE__ */ t(
912
+ rt,
873
913
  {
874
- className: b(
914
+ className: h(
875
915
  "h-3 w-3",
876
- (f == null ? void 0 : f[t.key]) === "right" && "rotate-90"
916
+ (f == null ? void 0 : f[e.key]) === "right" && "rotate-90"
877
917
  )
878
918
  }
879
919
  )
@@ -881,115 +921,115 @@ function er({
881
921
  )
882
922
  ] })
883
923
  },
884
- t.key
924
+ e.key
885
925
  ))
886
926
  ] }),
887
- Ie && /* @__PURE__ */ s(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
888
- z && /* @__PURE__ */ e(
927
+ et && /* @__PURE__ */ n(U, { className: "border-b border-slate-200 hover:bg-transparent", children: [
928
+ z && /* @__PURE__ */ t(
889
929
  J,
890
930
  {
891
- className: b(
931
+ className: h(
892
932
  "h-9 w-9 bg-slate-50 px-3 py-1",
893
- (V || _) && "sticky left-0 z-[2] min-w-[40px]"
933
+ (j || _) && "sticky left-0 z-[2] min-w-[40px]"
894
934
  )
895
935
  }
896
936
  ),
897
- L.map((t) => {
898
- const n = Ke.get(t.key);
899
- return /* @__PURE__ */ e(
937
+ V.map((e) => {
938
+ const i = Pe.get(e.key);
939
+ return /* @__PURE__ */ t(
900
940
  J,
901
941
  {
902
- style: ce(t.key),
903
- className: b(
942
+ style: ce(e.key),
943
+ className: h(
904
944
  "h-9 bg-slate-50 px-1.5 py-1 align-middle",
905
945
  _ && "bg-slate-50 dark:bg-muted",
906
- pe(t.key, !0)
946
+ pe(e.key, !0)
907
947
  ),
908
- children: n && C ? /* @__PURE__ */ e(
909
- Fe,
948
+ children: i && C ? /* @__PURE__ */ t(
949
+ qe,
910
950
  {
911
- def: n,
912
- value: x[n.key] ?? "",
913
- onChange: (h) => C(n.key, h),
951
+ def: i,
952
+ value: x[i.key] ?? "",
953
+ onChange: (c) => C(i.key, c),
914
954
  layout: "cell"
915
955
  }
916
956
  ) : null
917
957
  },
918
- t.key
958
+ e.key
919
959
  );
920
960
  })
921
961
  ] })
922
962
  ] }),
923
- /* @__PURE__ */ s(Te, { className: "tabular-nums", children: [
924
- A ? A.map((t) => {
925
- const n = (de == null ? void 0 : de.has(t.key)) ?? !1;
926
- return /* @__PURE__ */ s(nt.Fragment, { children: [
927
- /* @__PURE__ */ e(
963
+ /* @__PURE__ */ n(Ve, { className: "tabular-nums", children: [
964
+ L ? L.map((e) => {
965
+ const i = (de == null ? void 0 : de.has(e.key)) ?? !1;
966
+ return /* @__PURE__ */ n(dt.Fragment, { children: [
967
+ /* @__PURE__ */ t(
928
968
  U,
929
969
  {
930
970
  className: "nvr-row-enter cursor-pointer border-slate-200 bg-slate-50/80 transition-colors hover:bg-slate-100/80 dark:bg-muted/40",
931
- onClick: () => oe == null ? void 0 : oe(t.key),
932
- children: /* @__PURE__ */ e(
933
- D,
971
+ onClick: () => oe == null ? void 0 : oe(e.key),
972
+ children: /* @__PURE__ */ t(
973
+ Z,
934
974
  {
935
- colSpan: a.length + (z ? 1 : 0),
975
+ colSpan: r.length + (z ? 1 : 0),
936
976
  className: "px-3 py-1.5",
937
- children: /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-foreground", children: [
938
- /* @__PURE__ */ e(
939
- et,
977
+ children: /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-foreground", children: [
978
+ /* @__PURE__ */ t(
979
+ at,
940
980
  {
941
- className: b(
981
+ className: h(
942
982
  "h-3.5 w-3.5 text-slate-400 transition-transform duration-200",
943
- n && "-rotate-90"
983
+ i && "-rotate-90"
944
984
  )
945
985
  }
946
986
  ),
947
- t.header
987
+ e.header
948
988
  ] })
949
989
  }
950
990
  )
951
991
  }
952
992
  ),
953
- !n && t.rows.map((h, M) => ve(h, M))
954
- ] }, t.key);
955
- }) : i.map((t, n) => ve(t, n)),
956
- (A ? A.length === 0 : i.length === 0) && /* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(
957
- D,
993
+ !i && e.rows.map((c, E) => Se(c, E))
994
+ ] }, e.key);
995
+ }) : s.map((e, i) => Se(e, i)),
996
+ (L ? L.length === 0 : s.length === 0) && /* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(
997
+ Z,
958
998
  {
959
- colSpan: a.length + (z ? 1 : 0),
999
+ colSpan: r.length + (z ? 1 : 0),
960
1000
  className: "nvr-fade-in p-0 text-center align-middle text-[13px] text-slate-400",
961
1001
  style: q ? { height: Math.max(96, q - 56) } : void 0,
962
- children: /* @__PURE__ */ e(
1002
+ children: /* @__PURE__ */ t(
963
1003
  "div",
964
1004
  {
965
1005
  className: "sticky left-0 py-12",
966
- style: ge ? { width: ge } : void 0,
1006
+ style: _e ? { width: _e } : void 0,
967
1007
  "data-table-empty": !0,
968
- children: typeof F == "string" ? /* @__PURE__ */ e(ut, { icon: tt, title: F }) : F
1008
+ children: typeof F == "string" ? /* @__PURE__ */ t(yt, { icon: lt, title: F }) : F
969
1009
  }
970
1010
  )
971
1011
  }
972
1012
  ) })
973
- ] }, Be)
1013
+ ] }, Xe)
974
1014
  ]
975
1015
  }
976
1016
  )
977
1017
  }
978
1018
  ),
979
- he && /* @__PURE__ */ e(xt, { scrollerRef: H }),
980
- Ae,
981
- !A && o > l && /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2.5", children: [
982
- /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: [
983
- be(Ue),
1019
+ fe && /* @__PURE__ */ t(gt, { scrollerRef: D }),
1020
+ Be,
1021
+ !L && d > l && /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2.5", children: [
1022
+ /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: [
1023
+ be(De),
984
1024
  "–",
985
- be(Je),
1025
+ be(Qe),
986
1026
  " of ",
987
- be(o),
1027
+ be(d),
988
1028
  " records"
989
1029
  ] }),
990
- /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
991
- /* @__PURE__ */ e(
992
- Ce,
1030
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
1031
+ /* @__PURE__ */ t(
1032
+ Te,
993
1033
  {
994
1034
  variant: "ghost",
995
1035
  size: "sm",
@@ -999,18 +1039,18 @@ function er({
999
1039
  children: "← Prev"
1000
1040
  }
1001
1041
  ),
1002
- /* @__PURE__ */ s("span", { className: "px-2 text-[12px] text-slate-400", children: [
1042
+ /* @__PURE__ */ n("span", { className: "px-2 text-[12px] text-slate-400", children: [
1003
1043
  m,
1004
1044
  " / ",
1005
- me
1045
+ ye
1006
1046
  ] }),
1007
- /* @__PURE__ */ e(
1008
- Ce,
1047
+ /* @__PURE__ */ t(
1048
+ Te,
1009
1049
  {
1010
1050
  variant: "ghost",
1011
1051
  size: "sm",
1012
1052
  className: "h-7 px-2.5 text-[12px] text-slate-600",
1013
- disabled: m >= me,
1053
+ disabled: m >= ye,
1014
1054
  onClick: () => w(m + 1),
1015
1055
  children: "Next →"
1016
1056
  }
@@ -1024,8 +1064,11 @@ function er({
1024
1064
  ] });
1025
1065
  }
1026
1066
  export {
1027
- er as DataTable,
1028
- Fe as FilterControl,
1029
- Ft as filterDefLabel,
1030
- Pt as filterValueDisplay
1067
+ nr as DataTable,
1068
+ qe as FilterControl,
1069
+ Ft as ariaSortFor,
1070
+ Tt as containsFilter,
1071
+ Wt as filterDefLabel,
1072
+ lr as filterValueDisplay,
1073
+ Mt as pinColumnName
1031
1074
  };