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