@nivaro/react 0.3.63 → 0.3.65

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