@nivaro/react 0.3.115 → 0.3.116

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