@nivaro/react 0.3.73 → 0.3.74
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.
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/CollectionBrowserView.js +1493 -1469
- package/dist/shared/components/DataTable.js +315 -289
- package/dist/shared/components/RecordReadView.js +661 -573
- package/dist/shared/components/item-edit/RecordLiveSync.js +46 -46
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +183 -165
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +47 -46
- package/dist/shared/lib/record-loader.js +30 -24
- package/package.json +1 -1
|
@@ -1,60 +1,60 @@
|
|
|
1
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
|
|
3
|
-
import
|
|
4
|
-
import { parseDateFilter as
|
|
5
|
-
import { parseNumberFilter as
|
|
2
|
+
import { Search as nt, Pin as st, ChevronDown as it, Inbox as dt, ChevronsUpDown as le, ChevronUp as ct, X as ne, Check as ot, CalendarDays as pt } from "lucide-react";
|
|
3
|
+
import bt, { useMemo as Ve, useRef as ae, useState as $, useEffect as K, useLayoutEffect as ht } from "react";
|
|
4
|
+
import { parseDateFilter as Ae, describeDateFilter as mt, DATE_FILTER_OPS as ut, formatDateFilter as xt } from "../lib/date-filter.js";
|
|
5
|
+
import { parseNumberFilter as Le, describeNumberFilter as ft, NUMBER_FILTER_OPS as yt, formatNumberFilter as gt } from "../lib/number-filter.js";
|
|
6
6
|
import { fitPins as vt } from "../lib/table-pins.js";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as m, formatNumber as ge } from "../lib/utils.js";
|
|
8
8
|
import { CellCopyLayer as kt } from "./CellCopyLayer.js";
|
|
9
9
|
import { EmptyState as Nt } from "./EmptyState.js";
|
|
10
10
|
import { HScrollProxy as wt } from "./HScrollProxy.js";
|
|
11
11
|
import { TableSkeletonRows as _t } from "./Skeletons.js";
|
|
12
|
-
import { Button as
|
|
13
|
-
import { Checkbox as
|
|
14
|
-
import { Command as Ot, CommandInput as St, CommandList as $t, CommandEmpty as
|
|
15
|
-
import { Input as
|
|
16
|
-
import { Popover as
|
|
17
|
-
import { Select as Tt, SelectTrigger as Et, SelectValue as Mt, SelectContent as jt, SelectItem as
|
|
18
|
-
import { Table as qe, TableHeader as Be, TableRow as H, TableHead as X, TableBody as Ue, TableCell as
|
|
12
|
+
import { Button as te } from "./ui/button.js";
|
|
13
|
+
import { Checkbox as Fe } from "./ui/checkbox.js";
|
|
14
|
+
import { Command as Ot, CommandInput as St, CommandList as $t, CommandEmpty as zt, CommandItem as Ct } from "./ui/command.js";
|
|
15
|
+
import { Input as F } from "./ui/input.js";
|
|
16
|
+
import { Popover as se, PopoverTrigger as ie, PopoverContent as de } from "./ui/popover.js";
|
|
17
|
+
import { Select as Tt, SelectTrigger as Et, SelectValue as Mt, SelectContent as jt, SelectItem as We } from "./ui/select.js";
|
|
18
|
+
import { Table as qe, TableHeader as Be, TableRow as H, TableHead as X, TableBody as Ue, TableCell as re } from "./ui/table.js";
|
|
19
19
|
const Vt = [1, 2, 3, 4, 5, 6, 7, 8];
|
|
20
|
-
function
|
|
20
|
+
function ke(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(
|
|
22
|
+
return r == null || typeof r == "boolean" ? "" : typeof r == "string" || typeof r == "number" ? String(r) : Array.isArray(r) ? r.map(ke).join("") : typeof r == "object" && "props" in r ? ke((s = r.props) == null ? void 0 : s.children) : "";
|
|
23
23
|
}
|
|
24
24
|
function At(r) {
|
|
25
|
-
const s =
|
|
25
|
+
const s = ke(r.header).replace(/\s+/g, " ").trim();
|
|
26
26
|
if (s) return s;
|
|
27
27
|
const c = (r.key.split(".").pop() ?? r.key).replace(/_/g, " ").trim();
|
|
28
28
|
return c ? c[0].toUpperCase() + c.slice(1) : r.key;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Ne(r) {
|
|
31
31
|
return r.startsWith("-") ? r.slice(1) : r;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function we(r) {
|
|
34
34
|
return r ? r.startsWith("-") ? "desc" : "asc" : null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const o =
|
|
36
|
+
function Lt(r, s) {
|
|
37
|
+
const o = Ne(r), c = we(r);
|
|
38
38
|
return o !== s || !r ? s : c === "asc" ? `-${s}` : "";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Ft(r, s) {
|
|
41
41
|
const o = s.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
42
42
|
if (o.length === 0) return 1;
|
|
43
43
|
const c = r.toLowerCase();
|
|
44
|
-
return o.every((
|
|
44
|
+
return o.every((h) => c.includes(h)) ? 1 : 0;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return !r ||
|
|
46
|
+
function Wt(r, s) {
|
|
47
|
+
return !r || Ne(r) !== s ? "none" : we(r) === "desc" ? "descending" : "ascending";
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function ve(r) {
|
|
50
50
|
return typeof r == "string" || typeof r == "number";
|
|
51
51
|
}
|
|
52
52
|
function De({ field: r, sort: s }) {
|
|
53
|
-
const o =
|
|
54
|
-
return o !== r || !s ? /* @__PURE__ */ t(
|
|
53
|
+
const o = Ne(s), c = we(s);
|
|
54
|
+
return o !== r || !s ? /* @__PURE__ */ t(le, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ t(
|
|
55
55
|
ct,
|
|
56
56
|
{
|
|
57
|
-
className:
|
|
57
|
+
className: m(
|
|
58
58
|
"ml-1 inline h-3 w-3 shrink-0 text-nvr-cyan transition-transform duration-200",
|
|
59
59
|
c === "desc" && "rotate-180"
|
|
60
60
|
)
|
|
@@ -66,98 +66,98 @@ function qt({
|
|
|
66
66
|
value: s,
|
|
67
67
|
onChange: o
|
|
68
68
|
}) {
|
|
69
|
-
const [c,
|
|
69
|
+
const [c, h] = $(!1), [l, p] = $(""), [y, g] = $([]), [v, u] = $(!1), [b, N] = $({}), a = ae(0), z = !!r.loadOptions, w = Array.isArray(s) ? s : s === "" ? [] : [s];
|
|
70
70
|
K(() => {
|
|
71
|
-
if (!
|
|
72
|
-
const
|
|
71
|
+
if (!z || !c) return;
|
|
72
|
+
const x = ++a.current;
|
|
73
73
|
u(!0);
|
|
74
|
-
const
|
|
74
|
+
const C = setTimeout(
|
|
75
75
|
() => {
|
|
76
76
|
var M;
|
|
77
77
|
(M = r.loadOptions) == null || M.call(r, l).then((V) => {
|
|
78
|
-
a.current ===
|
|
78
|
+
a.current === x && g(V);
|
|
79
79
|
}).catch(() => {
|
|
80
|
-
a.current ===
|
|
80
|
+
a.current === x && g([]);
|
|
81
81
|
}).finally(() => {
|
|
82
|
-
a.current ===
|
|
82
|
+
a.current === x && u(!1);
|
|
83
83
|
});
|
|
84
84
|
},
|
|
85
85
|
l ? 250 : 0
|
|
86
86
|
);
|
|
87
|
-
return () => clearTimeout(
|
|
88
|
-
}, [l, c,
|
|
89
|
-
const Y =
|
|
90
|
-
var
|
|
91
|
-
return ((
|
|
92
|
-
}, E =
|
|
87
|
+
return () => clearTimeout(C);
|
|
88
|
+
}, [l, c, z]);
|
|
89
|
+
const Y = z ? y : r.options ?? [], P = (x) => {
|
|
90
|
+
var C, M;
|
|
91
|
+
return ((C = Y.find((V) => V.value === x)) == null ? void 0 : C.label) ?? ((M = (r.options ?? []).find((V) => V.value === x)) == null ? void 0 : M.label) ?? b[x] ?? x;
|
|
92
|
+
}, E = w.length === 0 ? null : w.length === 1 ? P(w[0]) : `${P(w[0])} +${w.length - 1}`;
|
|
93
93
|
return /* @__PURE__ */ i(
|
|
94
|
-
|
|
94
|
+
se,
|
|
95
95
|
{
|
|
96
96
|
open: c,
|
|
97
|
-
onOpenChange: (
|
|
98
|
-
|
|
97
|
+
onOpenChange: (x) => {
|
|
98
|
+
h(x), x || p("");
|
|
99
99
|
},
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */ t(
|
|
101
|
+
/* @__PURE__ */ t(ie, { asChild: !0, children: /* @__PURE__ */ i(
|
|
102
102
|
"button",
|
|
103
103
|
{
|
|
104
104
|
type: "button",
|
|
105
|
-
className:
|
|
105
|
+
className: m(
|
|
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
107
|
E ? "text-slate-800 dark:text-foreground" : "text-slate-500"
|
|
108
108
|
),
|
|
109
109
|
children: [
|
|
110
110
|
/* @__PURE__ */ t("span", { className: "truncate", children: E ?? r.placeholder }),
|
|
111
111
|
/* @__PURE__ */ i("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
|
|
112
|
-
|
|
112
|
+
w.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: (
|
|
120
|
-
|
|
119
|
+
onClick: (x) => {
|
|
120
|
+
x.stopPropagation(), o(r.multi ? [] : "");
|
|
121
121
|
},
|
|
122
122
|
className: "rounded p-0.5 text-slate-400 hover:text-slate-600",
|
|
123
|
-
children: /* @__PURE__ */ t(
|
|
123
|
+
children: /* @__PURE__ */ t(ne, { className: "h-3 w-3" })
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
-
/* @__PURE__ */ t(
|
|
126
|
+
/* @__PURE__ */ t(le, { className: "h-3 w-3 text-slate-400" })
|
|
127
127
|
] })
|
|
128
128
|
]
|
|
129
129
|
}
|
|
130
130
|
) }),
|
|
131
|
-
/* @__PURE__ */ t(
|
|
131
|
+
/* @__PURE__ */ t(de, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ i(Ot, { shouldFilter: !z, filter: Ft, children: [
|
|
132
132
|
/* @__PURE__ */ t(
|
|
133
133
|
St,
|
|
134
134
|
{
|
|
135
135
|
placeholder: "Search…",
|
|
136
136
|
className: "h-8 text-[12px]",
|
|
137
137
|
value: l,
|
|
138
|
-
onValueChange:
|
|
138
|
+
onValueChange: p
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
141
|
/* @__PURE__ */ i($t, { children: [
|
|
142
|
-
/* @__PURE__ */ t(
|
|
143
|
-
Y.map((
|
|
144
|
-
const
|
|
142
|
+
/* @__PURE__ */ t(zt, { className: "py-3 text-center text-[12px] text-slate-400", children: v ? "Searching…" : "No results" }),
|
|
143
|
+
Y.map((x) => {
|
|
144
|
+
const C = w.includes(x.value);
|
|
145
145
|
return /* @__PURE__ */ i(
|
|
146
|
-
|
|
146
|
+
Ct,
|
|
147
147
|
{
|
|
148
|
-
value:
|
|
148
|
+
value: z ? x.value : x.label,
|
|
149
149
|
onSelect: () => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
) : (o(
|
|
150
|
+
N((M) => ({ ...M, [x.value]: x.label })), r.multi ? o(
|
|
151
|
+
C ? w.filter((M) => M !== x.value) : [...w, x.value]
|
|
152
|
+
) : (o(C ? "" : x.value), h(!1));
|
|
153
153
|
},
|
|
154
154
|
className: "text-[12px]",
|
|
155
155
|
children: [
|
|
156
|
-
/* @__PURE__ */ t(ot, { className:
|
|
157
|
-
|
|
156
|
+
/* @__PURE__ */ t(ot, { className: m("mr-2 h-3 w-3", C ? "opacity-100" : "opacity-0") }),
|
|
157
|
+
x.label
|
|
158
158
|
]
|
|
159
159
|
},
|
|
160
|
-
|
|
160
|
+
x.value
|
|
161
161
|
);
|
|
162
162
|
})
|
|
163
163
|
] })
|
|
@@ -171,49 +171,49 @@ function Bt({
|
|
|
171
171
|
placeholder: s,
|
|
172
172
|
onChange: o
|
|
173
173
|
}) {
|
|
174
|
-
const [c,
|
|
174
|
+
const [c, h] = $(!1), l = Ae(r), [p, y] = $((l == null ? void 0 : l.op) ?? "on"), [g, v] = $((l == null ? void 0 : l.from) ?? ""), [u, b] = $((l == null ? void 0 : l.to) ?? "");
|
|
175
175
|
K(() => {
|
|
176
176
|
if (!c) return;
|
|
177
|
-
const a =
|
|
178
|
-
y((a == null ? void 0 : a.op) ?? "on"), v((a == null ? void 0 : a.from) ?? ""),
|
|
177
|
+
const a = Ae(r);
|
|
178
|
+
y((a == null ? void 0 : a.op) ?? "on"), v((a == null ? void 0 : a.from) ?? ""), b((a == null ? void 0 : a.to) ?? "");
|
|
179
179
|
}, [c, r]);
|
|
180
|
-
const
|
|
181
|
-
|
|
180
|
+
const N = (a, z, w) => {
|
|
181
|
+
z && (o(xt({ op: a, from: z, to: w || z })), (a !== "between" || w) && h(!1));
|
|
182
182
|
};
|
|
183
|
-
return /* @__PURE__ */ i(
|
|
184
|
-
/* @__PURE__ */ t(
|
|
183
|
+
return /* @__PURE__ */ i(se, { open: c, onOpenChange: h, children: [
|
|
184
|
+
/* @__PURE__ */ t(ie, { 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:
|
|
191
|
+
/* @__PURE__ */ t("span", { className: m("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? mt(l) : s }),
|
|
192
192
|
l ? /* @__PURE__ */ t(
|
|
193
|
-
|
|
193
|
+
ne,
|
|
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(
|
|
200
|
+
) : /* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
) }),
|
|
204
|
-
/* @__PURE__ */ i(
|
|
204
|
+
/* @__PURE__ */ i(de, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
|
|
205
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":
|
|
210
|
+
"aria-pressed": p === a.op,
|
|
211
211
|
onClick: () => {
|
|
212
|
-
y(a.op), g &&
|
|
212
|
+
y(a.op), g && N(a.op, g, u);
|
|
213
213
|
},
|
|
214
|
-
className:
|
|
214
|
+
className: m(
|
|
215
215
|
"rounded border px-1 py-1 text-[11px] leading-tight transition-colors",
|
|
216
|
-
|
|
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"
|
|
217
217
|
),
|
|
218
218
|
children: a.label
|
|
219
219
|
},
|
|
@@ -226,12 +226,12 @@ function Bt({
|
|
|
226
226
|
type: "date",
|
|
227
227
|
value: g,
|
|
228
228
|
onChange: (a) => {
|
|
229
|
-
v(a.target.value),
|
|
229
|
+
v(a.target.value), p !== "between" && N(p, 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
|
-
|
|
234
|
+
p === "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 Bt({
|
|
|
239
239
|
type: "date",
|
|
240
240
|
value: u,
|
|
241
241
|
onChange: (a) => {
|
|
242
|
-
|
|
242
|
+
b(a.target.value), N("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
|
}
|
|
@@ -255,9 +255,9 @@ function Ut({
|
|
|
255
255
|
unit: o,
|
|
256
256
|
onChange: c
|
|
257
257
|
}) {
|
|
258
|
-
const [
|
|
259
|
-
return /* @__PURE__ */ i(
|
|
260
|
-
/* @__PURE__ */ t(
|
|
258
|
+
const [h, l] = $(!1), [p, y] = r.split(":"), g = o ?? "", v = p && y ? `${p}–${y}${g}` : p ? `${p}${g}+` : y ? `≤ ${y}${g}` : s, u = (b, N) => c(b === "" && N === "" ? null : `${b}:${N}`);
|
|
259
|
+
return /* @__PURE__ */ i(se, { open: h, onOpenChange: l, children: [
|
|
260
|
+
/* @__PURE__ */ t(ie, { asChild: !0, children: /* @__PURE__ */ i(
|
|
261
261
|
"button",
|
|
262
262
|
{
|
|
263
263
|
type: "button",
|
|
@@ -267,45 +267,45 @@ function Ut({
|
|
|
267
267
|
/* @__PURE__ */ t(
|
|
268
268
|
"span",
|
|
269
269
|
{
|
|
270
|
-
className:
|
|
270
|
+
className: m("truncate", !p && !y && "text-slate-500 dark:text-muted-foreground"),
|
|
271
271
|
children: v
|
|
272
272
|
}
|
|
273
273
|
),
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
p || y ? /* @__PURE__ */ t(
|
|
275
|
+
ne,
|
|
276
276
|
{
|
|
277
277
|
className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
|
|
278
|
-
onClick: (
|
|
279
|
-
|
|
278
|
+
onClick: (b) => {
|
|
279
|
+
b.stopPropagation(), c(null);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
) : /* @__PURE__ */ t(
|
|
282
|
+
) : /* @__PURE__ */ t(le, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
283
283
|
]
|
|
284
284
|
}
|
|
285
285
|
) }),
|
|
286
|
-
/* @__PURE__ */ i(
|
|
286
|
+
/* @__PURE__ */ i(de, { 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
288
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
289
289
|
/* @__PURE__ */ t(
|
|
290
|
-
|
|
290
|
+
F,
|
|
291
291
|
{
|
|
292
292
|
type: "number",
|
|
293
293
|
"aria-label": `Minimum ${s}`,
|
|
294
294
|
placeholder: "Min",
|
|
295
|
-
value:
|
|
296
|
-
onChange: (
|
|
295
|
+
value: p ?? "",
|
|
296
|
+
onChange: (b) => u(b.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
|
-
|
|
302
|
+
F,
|
|
303
303
|
{
|
|
304
304
|
type: "number",
|
|
305
305
|
"aria-label": `Maximum ${s}`,
|
|
306
306
|
placeholder: "Max",
|
|
307
307
|
value: y ?? "",
|
|
308
|
-
onChange: (
|
|
308
|
+
onChange: (b) => u(p ?? "", b.target.value),
|
|
309
309
|
className: "h-7 text-[12px]"
|
|
310
310
|
}
|
|
311
311
|
)
|
|
@@ -318,49 +318,49 @@ function Dt({
|
|
|
318
318
|
placeholder: s,
|
|
319
319
|
onChange: o
|
|
320
320
|
}) {
|
|
321
|
-
const [c,
|
|
321
|
+
const [c, h] = $(!1), l = Le(r), [p, y] = $((l == null ? void 0 : l.op) ?? "eq"), [g, v] = $(l ? String(l.a) : ""), [u, b] = $((l == null ? void 0 : l.b) != null ? String(l.b) : "");
|
|
322
322
|
K(() => {
|
|
323
323
|
if (!c) return;
|
|
324
|
-
const a =
|
|
325
|
-
y((a == null ? void 0 : a.op) ?? "eq"), v(a ? String(a.a) : ""),
|
|
324
|
+
const a = Le(r);
|
|
325
|
+
y((a == null ? void 0 : a.op) ?? "eq"), v(a ? String(a.a) : ""), b((a == null ? void 0 : a.b) != null ? String(a.b) : "");
|
|
326
326
|
}, [c, r]);
|
|
327
|
-
const
|
|
328
|
-
|
|
327
|
+
const N = (a, z, w) => {
|
|
328
|
+
z === "" || Number.isNaN(Number(z)) || a === "between" && (w === "" || Number.isNaN(Number(w))) || o(gt({ op: a, a: Number(z), b: w === "" ? void 0 : Number(w) }));
|
|
329
329
|
};
|
|
330
|
-
return /* @__PURE__ */ i(
|
|
331
|
-
/* @__PURE__ */ t(
|
|
330
|
+
return /* @__PURE__ */ i(se, { open: c, onOpenChange: h, children: [
|
|
331
|
+
/* @__PURE__ */ t(ie, { 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:
|
|
338
|
+
/* @__PURE__ */ t("span", { className: m("truncate", !l && "text-slate-500 dark:text-muted-foreground"), children: l ? ft(l) : s }),
|
|
339
339
|
l ? /* @__PURE__ */ t(
|
|
340
|
-
|
|
340
|
+
ne,
|
|
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(
|
|
347
|
+
) : /* @__PURE__ */ t(le, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
348
348
|
]
|
|
349
349
|
}
|
|
350
350
|
) }),
|
|
351
|
-
/* @__PURE__ */ i(
|
|
351
|
+
/* @__PURE__ */ i(de, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
|
|
352
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":
|
|
357
|
+
"aria-pressed": p === a.op,
|
|
358
358
|
onClick: () => {
|
|
359
|
-
y(a.op),
|
|
359
|
+
y(a.op), N(a.op, g, u);
|
|
360
360
|
},
|
|
361
|
-
className:
|
|
361
|
+
className: m(
|
|
362
362
|
"rounded border px-1 py-1 text-[11px] transition-colors",
|
|
363
|
-
|
|
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"
|
|
364
364
|
),
|
|
365
365
|
children: a.symbol
|
|
366
366
|
},
|
|
@@ -368,25 +368,25 @@ function Dt({
|
|
|
368
368
|
)) }),
|
|
369
369
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
370
370
|
/* @__PURE__ */ t(
|
|
371
|
-
|
|
371
|
+
F,
|
|
372
372
|
{
|
|
373
373
|
type: "number",
|
|
374
374
|
value: g,
|
|
375
375
|
onChange: (a) => {
|
|
376
|
-
v(a.target.value),
|
|
376
|
+
v(a.target.value), N(p, a.target.value, u);
|
|
377
377
|
},
|
|
378
378
|
className: "h-7 text-[12px]"
|
|
379
379
|
}
|
|
380
380
|
),
|
|
381
|
-
|
|
381
|
+
p === "between" && /* @__PURE__ */ i(Q, { children: [
|
|
382
382
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
|
|
383
383
|
/* @__PURE__ */ t(
|
|
384
|
-
|
|
384
|
+
F,
|
|
385
385
|
{
|
|
386
386
|
type: "number",
|
|
387
387
|
value: u,
|
|
388
388
|
onChange: (a) => {
|
|
389
|
-
|
|
389
|
+
b(a.target.value), N(p, g, a.target.value);
|
|
390
390
|
},
|
|
391
391
|
className: "h-7 text-[12px]"
|
|
392
392
|
}
|
|
@@ -402,15 +402,15 @@ function Je({
|
|
|
402
402
|
onChange: o,
|
|
403
403
|
layout: c = "inline"
|
|
404
404
|
}) {
|
|
405
|
-
const
|
|
405
|
+
const h = c === "stacked", l = c === "cell", p = typeof s == "string" ? s : "", y = h || l ? "w-full" : "w-40", g = l ? "h-7 text-[12px]" : "text-[13px]";
|
|
406
406
|
let v;
|
|
407
407
|
if (r.type === "text")
|
|
408
408
|
v = /* @__PURE__ */ t(
|
|
409
|
-
|
|
409
|
+
F,
|
|
410
410
|
{
|
|
411
|
-
className:
|
|
411
|
+
className: m("h-8 border-slate-200 bg-slate-50", g, y),
|
|
412
412
|
placeholder: r.placeholder,
|
|
413
|
-
value:
|
|
413
|
+
value: p,
|
|
414
414
|
onChange: (u) => o(u.target.value)
|
|
415
415
|
}
|
|
416
416
|
);
|
|
@@ -418,27 +418,27 @@ function Je({
|
|
|
418
418
|
v = /* @__PURE__ */ t(
|
|
419
419
|
"div",
|
|
420
420
|
{
|
|
421
|
-
className:
|
|
422
|
-
(
|
|
421
|
+
className: m(
|
|
422
|
+
(h || l) && "[&>button]:w-full",
|
|
423
423
|
l && "[&>button]:h-7 [&>button]:min-w-[88px] [&>button]:px-1.5 [&>button]:text-[12px]"
|
|
424
424
|
),
|
|
425
425
|
children: /* @__PURE__ */ t(qt, { def: r, value: s, onChange: o })
|
|
426
426
|
}
|
|
427
427
|
);
|
|
428
428
|
else if (r.type === "date")
|
|
429
|
-
v = /* @__PURE__ */ t("div", { className:
|
|
429
|
+
v = /* @__PURE__ */ t("div", { className: m(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ t(
|
|
430
430
|
Bt,
|
|
431
431
|
{
|
|
432
|
-
value:
|
|
432
|
+
value: p,
|
|
433
433
|
placeholder: r.placeholder,
|
|
434
434
|
onChange: (u) => o(u ?? "")
|
|
435
435
|
}
|
|
436
436
|
) });
|
|
437
437
|
else if (r.type === "number")
|
|
438
|
-
v = /* @__PURE__ */ t("div", { className:
|
|
438
|
+
v = /* @__PURE__ */ t("div", { className: m(l && "[&>div>button]:h-7 [&>div>button]:text-[12px]", y), children: /* @__PURE__ */ t(
|
|
439
439
|
Dt,
|
|
440
440
|
{
|
|
441
|
-
value:
|
|
441
|
+
value: p,
|
|
442
442
|
placeholder: r.placeholder,
|
|
443
443
|
onChange: (u) => o(u ?? "")
|
|
444
444
|
}
|
|
@@ -447,54 +447,54 @@ function Je({
|
|
|
447
447
|
v = /* @__PURE__ */ t("div", { className: "[&>div>button]:h-7 [&>div>button]:text-[12px] w-full", children: /* @__PURE__ */ t(
|
|
448
448
|
Ut,
|
|
449
449
|
{
|
|
450
|
-
value:
|
|
450
|
+
value: p,
|
|
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,
|
|
457
|
+
const [u, b] = p.split(":");
|
|
458
458
|
v = /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
459
459
|
/* @__PURE__ */ t(
|
|
460
|
-
|
|
460
|
+
F,
|
|
461
461
|
{
|
|
462
462
|
type: "number",
|
|
463
|
-
className:
|
|
463
|
+
className: m(
|
|
464
464
|
"h-8 border-slate-200 bg-slate-50",
|
|
465
465
|
g,
|
|
466
|
-
|
|
466
|
+
h || l ? "w-full min-w-[48px]" : "w-20"
|
|
467
467
|
),
|
|
468
468
|
placeholder: "Min",
|
|
469
469
|
value: u ?? "",
|
|
470
|
-
onChange: (
|
|
470
|
+
onChange: (N) => o(`${N.target.value}:${b ?? ""}`)
|
|
471
471
|
}
|
|
472
472
|
),
|
|
473
473
|
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-400", children: "–" }),
|
|
474
474
|
/* @__PURE__ */ t(
|
|
475
|
-
|
|
475
|
+
F,
|
|
476
476
|
{
|
|
477
477
|
type: "number",
|
|
478
|
-
className:
|
|
478
|
+
className: m(
|
|
479
479
|
"h-8 border-slate-200 bg-slate-50",
|
|
480
480
|
g,
|
|
481
|
-
|
|
481
|
+
h || l ? "w-full min-w-[48px]" : "w-20"
|
|
482
482
|
),
|
|
483
483
|
placeholder: "Max",
|
|
484
|
-
value:
|
|
485
|
-
onChange: (
|
|
484
|
+
value: b ?? "",
|
|
485
|
+
onChange: (N) => o(`${u ?? ""}:${N.target.value}`)
|
|
486
486
|
}
|
|
487
487
|
)
|
|
488
488
|
] });
|
|
489
489
|
} else
|
|
490
|
-
v = /* @__PURE__ */ i(Tt, { value:
|
|
491
|
-
/* @__PURE__ */ t(Et, { className:
|
|
490
|
+
v = /* @__PURE__ */ i(Tt, { value: p === "" ? "__all__" : p, onValueChange: (b) => o(b === "__all__" ? "" : b), children: [
|
|
491
|
+
/* @__PURE__ */ t(Et, { className: m("h-8 border-slate-200 bg-slate-50", g, y), children: /* @__PURE__ */ t(Mt, { placeholder: r.placeholder }) }),
|
|
492
492
|
/* @__PURE__ */ i(jt, { children: [
|
|
493
|
-
/* @__PURE__ */ t(
|
|
494
|
-
(r.options ?? []).filter((
|
|
493
|
+
/* @__PURE__ */ t(We, { value: "__all__", children: r.placeholder }),
|
|
494
|
+
(r.options ?? []).filter((b) => b.value !== "").map((b) => /* @__PURE__ */ t(We, { value: b.value, children: b.label }, b.value))
|
|
495
495
|
] })
|
|
496
496
|
] });
|
|
497
|
-
return
|
|
497
|
+
return h ? /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
498
498
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
|
|
499
499
|
Jt(r),
|
|
500
500
|
r.restricted && /* @__PURE__ */ t(
|
|
@@ -521,16 +521,16 @@ function Jt(r) {
|
|
|
521
521
|
}
|
|
522
522
|
function dr(r, s) {
|
|
523
523
|
const o = (c) => {
|
|
524
|
-
var
|
|
525
|
-
return ((l = (
|
|
524
|
+
var h, l;
|
|
525
|
+
return ((l = (h = r.options) == null ? void 0 : h.find((p) => p.value === c)) == null ? void 0 : l.label) ?? c;
|
|
526
526
|
};
|
|
527
527
|
if (Array.isArray(s)) {
|
|
528
528
|
const c = s.map(o);
|
|
529
529
|
return c.slice(0, 2).join(", ") + (c.length > 2 ? ` +${c.length - 2}` : "");
|
|
530
530
|
}
|
|
531
531
|
if (r.type === "range") {
|
|
532
|
-
const [c,
|
|
533
|
-
return [c && `≥${c}`,
|
|
532
|
+
const [c, h] = s.split(":");
|
|
533
|
+
return [c && `≥${c}`, h && `≤${h}`].filter(Boolean).join(" ");
|
|
534
534
|
}
|
|
535
535
|
return o(s);
|
|
536
536
|
}
|
|
@@ -539,56 +539,56 @@ function cr({
|
|
|
539
539
|
rows: s,
|
|
540
540
|
rowKey: o,
|
|
541
541
|
total: c,
|
|
542
|
-
page:
|
|
542
|
+
page: h,
|
|
543
543
|
limit: l = 25,
|
|
544
|
-
isLoading:
|
|
544
|
+
isLoading: p,
|
|
545
545
|
isError: y,
|
|
546
546
|
errorMessage: g,
|
|
547
547
|
onRetry: v,
|
|
548
548
|
sort: u = "",
|
|
549
|
-
onSortChange:
|
|
550
|
-
onPageChange:
|
|
549
|
+
onSortChange: b,
|
|
550
|
+
onPageChange: N,
|
|
551
551
|
onRowClick: a,
|
|
552
|
-
onRowContextMenu:
|
|
553
|
-
searchValue:
|
|
552
|
+
onRowContextMenu: z,
|
|
553
|
+
searchValue: w,
|
|
554
554
|
onSearchChange: Y,
|
|
555
555
|
searchPlaceholder: P = "Search…",
|
|
556
556
|
filterDefs: E,
|
|
557
|
-
filterValues:
|
|
558
|
-
onFilterChange:
|
|
557
|
+
filterValues: x = {},
|
|
558
|
+
onFilterChange: C,
|
|
559
559
|
toolbarRight: M,
|
|
560
560
|
emptyMessage: V = "No records found.",
|
|
561
561
|
minBodyHeight: U,
|
|
562
|
-
fillHeight:
|
|
562
|
+
fillHeight: ce = !1,
|
|
563
563
|
footer: Re,
|
|
564
564
|
hideFilterRow: He = !1,
|
|
565
565
|
nowrapCells: Xe = !1,
|
|
566
|
-
density:
|
|
567
|
-
pinFirstColumn:
|
|
568
|
-
columnPins:
|
|
569
|
-
onColumnPinChange:
|
|
566
|
+
density: oe = "comfortable",
|
|
567
|
+
pinFirstColumn: L = !1,
|
|
568
|
+
columnPins: f,
|
|
569
|
+
onColumnPinChange: pe,
|
|
570
570
|
columnFilterRow: Qe = !1,
|
|
571
|
-
hScrollProxy:
|
|
571
|
+
hScrollProxy: _e = !1,
|
|
572
572
|
selectedIds: j,
|
|
573
573
|
onSelectionChange: T,
|
|
574
|
-
rowClassName:
|
|
575
|
-
rowDragProps:
|
|
576
|
-
rowTitle:
|
|
574
|
+
rowClassName: be,
|
|
575
|
+
rowDragProps: he,
|
|
576
|
+
rowTitle: me,
|
|
577
577
|
enterKey: Ye,
|
|
578
578
|
rowGroups: A,
|
|
579
579
|
collapsedGroups: D,
|
|
580
|
-
onToggleGroup:
|
|
580
|
+
onToggleGroup: ue,
|
|
581
581
|
onRowFocus: J,
|
|
582
582
|
activeRowKey: G,
|
|
583
|
-
rowAriaLabel:
|
|
583
|
+
rowAriaLabel: xe
|
|
584
584
|
}) {
|
|
585
|
-
const
|
|
586
|
-
!e.sortable || !
|
|
587
|
-
}, S =
|
|
588
|
-
if (!S || !
|
|
589
|
-
const e = r.filter((O) =>
|
|
585
|
+
const ee = Math.ceil(c / l), Ze = (h - 1) * l + 1, Ie = Math.min(h * l, c), Oe = !He && E && E.length > 0, Ke = w !== void 0 || Oe || M !== void 0, Se = (e) => {
|
|
586
|
+
!e.sortable || !b || b(Lt(u, e.key));
|
|
587
|
+
}, S = f !== void 0, W = Ve(() => {
|
|
588
|
+
if (!S || !f) return r;
|
|
589
|
+
const e = r.filter((O) => f[O.key] === "left"), n = r.filter((O) => f[O.key] === "right"), d = r.filter((O) => !f[O.key]);
|
|
590
590
|
return [...e, ...d, ...n];
|
|
591
|
-
}, [r,
|
|
591
|
+
}, [r, f, S]), $e = ae({}), Z = ae(null), ze = ae(null), Ce = !p && (A ? A.length === 0 : s.length === 0), [Te, Pe] = $(null);
|
|
592
592
|
K(() => {
|
|
593
593
|
const e = Z.current;
|
|
594
594
|
if (!Ce || !e) return;
|
|
@@ -597,44 +597,44 @@ function cr({
|
|
|
597
597
|
const d = new ResizeObserver(n);
|
|
598
598
|
return d.observe(e), () => d.disconnect();
|
|
599
599
|
}, [Ce]);
|
|
600
|
-
const [
|
|
600
|
+
const [Ee, Ge] = $({}), [, et] = $(0);
|
|
601
601
|
K(() => {
|
|
602
602
|
const e = Z.current;
|
|
603
603
|
if (!S || !e || typeof ResizeObserver > "u") return;
|
|
604
604
|
const n = new ResizeObserver(() => et(e.clientWidth));
|
|
605
605
|
return n.observe(e), () => n.disconnect();
|
|
606
|
-
}, [S,
|
|
607
|
-
var R,
|
|
608
|
-
if (!S || !
|
|
609
|
-
const e = (
|
|
606
|
+
}, [S, p]), ht(() => {
|
|
607
|
+
var R, je;
|
|
608
|
+
if (!S || !f) return;
|
|
609
|
+
const e = (_) => {
|
|
610
610
|
var B;
|
|
611
|
-
return ((B =
|
|
612
|
-
}, n = T ? ((R =
|
|
613
|
-
|
|
614
|
-
|
|
611
|
+
return ((B = $e.current[_]) == null ? void 0 : B.getBoundingClientRect().width) ?? 120;
|
|
612
|
+
}, n = T ? ((R = ze.current) == null ? void 0 : R.getBoundingClientRect().width) ?? 40 : 0, { left: d, right: O } = vt(
|
|
613
|
+
W.filter((_) => f[_.key] === "left").map((_) => _.key),
|
|
614
|
+
W.filter((_) => f[_.key] === "right").map((_) => _.key),
|
|
615
615
|
e,
|
|
616
616
|
n,
|
|
617
|
-
((
|
|
617
|
+
((je = Z.current) == null ? void 0 : je.clientWidth) ?? 0
|
|
618
618
|
), q = {};
|
|
619
619
|
let I = n;
|
|
620
|
-
d.forEach((
|
|
621
|
-
q[
|
|
620
|
+
d.forEach((_, B) => {
|
|
621
|
+
q[_] = { side: "left", offset: Math.floor(I), seam: B === d.length - 1 }, I += e(_);
|
|
622
622
|
});
|
|
623
623
|
let k = 0;
|
|
624
|
-
for (let
|
|
625
|
-
const B = O[
|
|
626
|
-
q[B] = { side: "right", offset: Math.floor(k), seam:
|
|
624
|
+
for (let _ = O.length - 1; _ >= 0; _--) {
|
|
625
|
+
const B = O[_];
|
|
626
|
+
q[B] = { side: "right", offset: Math.floor(k), seam: _ === 0 }, k += e(B);
|
|
627
627
|
}
|
|
628
|
-
Ge((
|
|
628
|
+
Ge((_) => JSON.stringify(_) === JSON.stringify(q) ? _ : q);
|
|
629
629
|
});
|
|
630
|
-
const
|
|
631
|
-
const n =
|
|
630
|
+
const fe = (e) => {
|
|
631
|
+
const n = Ee[e];
|
|
632
632
|
if (!(!S || !n))
|
|
633
633
|
return n.side === "left" ? { left: n.offset } : { right: n.offset };
|
|
634
|
-
},
|
|
635
|
-
const d =
|
|
634
|
+
}, ye = (e, n) => {
|
|
635
|
+
const d = Ee[e];
|
|
636
636
|
if (!(!S || !d))
|
|
637
|
-
return
|
|
637
|
+
return m(
|
|
638
638
|
// dt-pinned: pinned headers offset via inline style (not left-0), so the
|
|
639
639
|
// fillHeight wrapper's z variants need a CLASS to elevate them above the
|
|
640
640
|
// other header cells — same-z siblings paint in DOM order and a later
|
|
@@ -644,10 +644,10 @@ function cr({
|
|
|
644
644
|
d.side === "right" && d.seam && "border-l border-slate-200 dark:border-border"
|
|
645
645
|
);
|
|
646
646
|
}, tt = (e) => {
|
|
647
|
-
if (!
|
|
648
|
-
const n = (
|
|
649
|
-
|
|
650
|
-
}, rt =
|
|
647
|
+
if (!pe) return;
|
|
648
|
+
const n = (f == null ? void 0 : f[e]) ?? null;
|
|
649
|
+
pe(e, n === null ? "left" : n === "left" ? "right" : null);
|
|
650
|
+
}, rt = Ve(() => {
|
|
651
651
|
const e = /* @__PURE__ */ new Map();
|
|
652
652
|
for (const n of E ?? []) e.set(n.key, n);
|
|
653
653
|
return e;
|
|
@@ -655,36 +655,36 @@ function cr({
|
|
|
655
655
|
if (!J) return null;
|
|
656
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
657
|
return G && e.some((d, O) => n(d, O) === G) ? G : e.length > 0 ? n(e[0], 0) : null;
|
|
658
|
-
})(),
|
|
658
|
+
})(), Me = (e, n) => {
|
|
659
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
660
|
return /* @__PURE__ */ i(
|
|
661
661
|
H,
|
|
662
662
|
{
|
|
663
|
-
...
|
|
664
|
-
className:
|
|
663
|
+
...he == null ? void 0 : he(e),
|
|
664
|
+
className: m(
|
|
665
665
|
// NAMED group: queue cells already use bare `group-hover:` against
|
|
666
666
|
// their own local group, and claiming the unnamed one here would
|
|
667
667
|
// make those reveal on row hover instead.
|
|
668
668
|
"group/row nvr-row-enter border-slate-100 transition-colors duration-150",
|
|
669
669
|
J && "focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nvr-cyan",
|
|
670
|
-
(
|
|
671
|
-
a && (
|
|
672
|
-
|
|
670
|
+
(L || S) && "bg-white dark:bg-card",
|
|
671
|
+
a && (L || S ? "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted" : "cursor-pointer hover:bg-slate-50/80"),
|
|
672
|
+
be == null ? void 0 : be(e),
|
|
673
673
|
// Pinned sticky cells use bg-inherit, so a selected row's bg must be
|
|
674
674
|
// OPAQUE or horizontally-scrolled content bleeds through the pinned
|
|
675
675
|
// column. bg-nvr-cyan/5 is semi-transparent — use an opaque equivalent
|
|
676
676
|
// (5% nvr-cyan #00ceff over white / card) when pinning.
|
|
677
|
-
O && (
|
|
677
|
+
O && (L || S ? "bg-[#f2fdff] dark:bg-[#20303a]" : "bg-nvr-cyan/5")
|
|
678
678
|
),
|
|
679
679
|
style: { animationDelay: `${Math.min(n, 14) * 16}ms` },
|
|
680
680
|
"data-row-key": d,
|
|
681
|
-
title:
|
|
681
|
+
title: me == null ? void 0 : me(e),
|
|
682
682
|
onClick: () => a == null ? void 0 : a(e),
|
|
683
|
-
onContextMenu:
|
|
683
|
+
onContextMenu: z ? (k) => z(e, k) : void 0,
|
|
684
684
|
...q ? {
|
|
685
685
|
tabIndex: I ? 0 : -1,
|
|
686
686
|
"aria-current": I && G === d ? "true" : void 0,
|
|
687
|
-
"aria-label":
|
|
687
|
+
"aria-label": xe == null ? void 0 : xe(e),
|
|
688
688
|
onFocus: (k) => {
|
|
689
689
|
k.target === k.currentTarget && (J == null || J(e));
|
|
690
690
|
},
|
|
@@ -694,32 +694,32 @@ function cr({
|
|
|
694
694
|
} : {},
|
|
695
695
|
children: [
|
|
696
696
|
T && /* @__PURE__ */ t(
|
|
697
|
-
|
|
697
|
+
re,
|
|
698
698
|
{
|
|
699
|
-
className:
|
|
699
|
+
className: m(
|
|
700
700
|
"w-9 px-3",
|
|
701
|
-
|
|
702
|
-
(
|
|
701
|
+
oe === "compact" ? "py-1" : "py-2",
|
|
702
|
+
(L || S) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
|
|
703
703
|
),
|
|
704
704
|
onClick: (k) => {
|
|
705
705
|
k.stopPropagation(), T(O ? (j == null ? void 0 : j.filter((R) => R !== d)) ?? [] : [...j ?? [], d]);
|
|
706
706
|
},
|
|
707
|
-
children: /* @__PURE__ */ t(
|
|
707
|
+
children: /* @__PURE__ */ t(Fe, { checked: O, "aria-label": "Select row" })
|
|
708
708
|
}
|
|
709
709
|
),
|
|
710
|
-
|
|
711
|
-
|
|
710
|
+
W.map((k, R) => /* @__PURE__ */ t(
|
|
711
|
+
re,
|
|
712
712
|
{
|
|
713
|
-
style:
|
|
714
|
-
className:
|
|
713
|
+
style: fe(k.key),
|
|
714
|
+
className: m(
|
|
715
715
|
"px-3",
|
|
716
|
-
|
|
716
|
+
oe === "compact" ? "py-1" : "py-2",
|
|
717
717
|
Xe && "whitespace-nowrap",
|
|
718
|
-
!S &&
|
|
718
|
+
!S && L && R === 0 && m(
|
|
719
719
|
"sticky z-[1] border-r border-slate-100 bg-inherit dark:border-border",
|
|
720
720
|
T ? "left-[39px]" : "left-0"
|
|
721
721
|
),
|
|
722
|
-
|
|
722
|
+
ye(k.key, !1),
|
|
723
723
|
k.className
|
|
724
724
|
),
|
|
725
725
|
children: k.render ? k.render(e, n) : String(e[k.key] ?? "—")
|
|
@@ -758,37 +758,37 @@ function cr({
|
|
|
758
758
|
/* @__PURE__ */ i(
|
|
759
759
|
"div",
|
|
760
760
|
{
|
|
761
|
-
className:
|
|
761
|
+
className: m(
|
|
762
762
|
"overflow-hidden rounded-lg border border-slate-200 bg-white",
|
|
763
|
-
|
|
763
|
+
ce && "flex h-full min-h-0 flex-col"
|
|
764
764
|
),
|
|
765
765
|
children: [
|
|
766
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
767
|
Y !== void 0 && /* @__PURE__ */ i("div", { className: "relative min-w-0 max-w-full", children: [
|
|
768
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" }),
|
|
769
769
|
/* @__PURE__ */ t(
|
|
770
|
-
|
|
770
|
+
F,
|
|
771
771
|
{
|
|
772
772
|
className: "h-8 w-56 max-w-full border-slate-200 bg-slate-50 pl-8 text-[13px]",
|
|
773
773
|
placeholder: P,
|
|
774
|
-
value:
|
|
774
|
+
value: w ?? "",
|
|
775
775
|
onChange: (e) => Y(e.target.value)
|
|
776
776
|
}
|
|
777
777
|
)
|
|
778
778
|
] }),
|
|
779
|
-
|
|
779
|
+
Oe && (E == null ? void 0 : E.map((e) => /* @__PURE__ */ t(
|
|
780
780
|
Je,
|
|
781
781
|
{
|
|
782
782
|
def: e,
|
|
783
|
-
value:
|
|
784
|
-
onChange: (n) =>
|
|
783
|
+
value: x[e.key] ?? "",
|
|
784
|
+
onChange: (n) => C == null ? void 0 : C(e.key, n)
|
|
785
785
|
},
|
|
786
786
|
e.key
|
|
787
787
|
))),
|
|
788
788
|
/* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
789
789
|
M
|
|
790
790
|
] }),
|
|
791
|
-
|
|
791
|
+
p ? (
|
|
792
792
|
// #3229 — the real header (same labels, h-9) over rows with the real cell padding
|
|
793
793
|
// and line height for this density, in the body's real minimum height: the table
|
|
794
794
|
// keeps its shape when the rows land.
|
|
@@ -797,15 +797,15 @@ function cr({
|
|
|
797
797
|
{
|
|
798
798
|
"data-skeleton": "table",
|
|
799
799
|
"aria-busy": "true",
|
|
800
|
-
className:
|
|
800
|
+
className: m(ce && "min-h-0 flex-1 overflow-hidden"),
|
|
801
801
|
style: U ? { minHeight: U } : void 0,
|
|
802
802
|
children: /* @__PURE__ */ i(qe, { className: "border-separate border-spacing-0", children: [
|
|
803
803
|
/* @__PURE__ */ t(Be, { children: /* @__PURE__ */ i(H, { className: "border-b border-slate-200 hover:bg-transparent", children: [
|
|
804
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
|
-
|
|
805
|
+
W.map((e) => /* @__PURE__ */ t(
|
|
806
806
|
X,
|
|
807
807
|
{
|
|
808
|
-
className:
|
|
808
|
+
className: m(
|
|
809
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",
|
|
810
810
|
e.headerClassName
|
|
811
811
|
),
|
|
@@ -817,10 +817,10 @@ function cr({
|
|
|
817
817
|
/* @__PURE__ */ t(Ue, { children: /* @__PURE__ */ t(
|
|
818
818
|
_t,
|
|
819
819
|
{
|
|
820
|
-
columns:
|
|
820
|
+
columns: W.map((e) => ({ key: e.key })),
|
|
821
821
|
rows: Math.min(Math.max(l ?? Vt.length, 1), 15),
|
|
822
822
|
rowClassName: "",
|
|
823
|
-
cellClassName:
|
|
823
|
+
cellClassName: m("px-3", oe === "compact" ? "py-1" : "py-2"),
|
|
824
824
|
leadingCells: T ? 1 : 0
|
|
825
825
|
}
|
|
826
826
|
) })
|
|
@@ -832,13 +832,13 @@ function cr({
|
|
|
832
832
|
"div",
|
|
833
833
|
{
|
|
834
834
|
ref: Z,
|
|
835
|
-
className:
|
|
836
|
-
|
|
835
|
+
className: m(
|
|
836
|
+
_e && "overflow-x-hidden [&>div]:overflow-visible",
|
|
837
837
|
// Bounded mode: rows scroll here under a sticky header. Header
|
|
838
838
|
// cells sit above pinned body cells (z-[1/2]); the pinned
|
|
839
839
|
// header corner (left-0) tops the other header cells so
|
|
840
840
|
// horizontal scroll cannot bleed through it.
|
|
841
|
-
|
|
841
|
+
ce && "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]"
|
|
842
842
|
),
|
|
843
843
|
style: U ? { minHeight: U } : void 0,
|
|
844
844
|
children: /* @__PURE__ */ i(
|
|
@@ -852,13 +852,13 @@ function cr({
|
|
|
852
852
|
T && /* @__PURE__ */ t(
|
|
853
853
|
X,
|
|
854
854
|
{
|
|
855
|
-
ref:
|
|
856
|
-
className:
|
|
855
|
+
ref: ze,
|
|
856
|
+
className: m(
|
|
857
857
|
"h-9 w-9 bg-slate-50 px-3 py-0",
|
|
858
|
-
(
|
|
858
|
+
(L || S) && "sticky left-0 z-[2] min-w-[40px]"
|
|
859
859
|
),
|
|
860
860
|
children: /* @__PURE__ */ t(
|
|
861
|
-
|
|
861
|
+
Fe,
|
|
862
862
|
{
|
|
863
863
|
checked: s.length > 0 && s.every((e, n) => {
|
|
864
864
|
const d = o ? o(e, n) : String(n);
|
|
@@ -874,32 +874,32 @@ function cr({
|
|
|
874
874
|
)
|
|
875
875
|
}
|
|
876
876
|
),
|
|
877
|
-
|
|
877
|
+
W.map((e, n) => /* @__PURE__ */ t(
|
|
878
878
|
X,
|
|
879
879
|
{
|
|
880
880
|
ref: (d) => {
|
|
881
|
-
|
|
881
|
+
$e.current[e.key] = d;
|
|
882
882
|
},
|
|
883
|
-
style:
|
|
884
|
-
className:
|
|
883
|
+
style: fe(e.key),
|
|
884
|
+
className: m(
|
|
885
885
|
"group/th h-9 whitespace-nowrap bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500",
|
|
886
|
-
e.sortable &&
|
|
887
|
-
!S &&
|
|
886
|
+
e.sortable && b && "cursor-pointer select-none hover:text-slate-600",
|
|
887
|
+
!S && L && n === 0 && m(
|
|
888
888
|
"sticky z-[2] border-r border-slate-200 dark:border-border",
|
|
889
889
|
T ? "left-[39px]" : "left-0"
|
|
890
890
|
),
|
|
891
891
|
S && "bg-slate-50 dark:bg-muted",
|
|
892
|
-
|
|
892
|
+
ye(e.key, !0),
|
|
893
893
|
e.headerClassName
|
|
894
894
|
),
|
|
895
|
-
onClick: () =>
|
|
896
|
-
"aria-sort": e.sortable &&
|
|
897
|
-
tabIndex: e.sortable &&
|
|
898
|
-
onKeyDown: e.sortable &&
|
|
899
|
-
d.target === d.currentTarget && (d.key === "Enter" || d.key === " ") && (d.preventDefault(),
|
|
895
|
+
onClick: () => Se(e),
|
|
896
|
+
"aria-sort": e.sortable && b ? Wt(u, e.key) : void 0,
|
|
897
|
+
tabIndex: e.sortable && b && !ve(e.header) ? 0 : void 0,
|
|
898
|
+
onKeyDown: e.sortable && b && !ve(e.header) ? (d) => {
|
|
899
|
+
d.target === d.currentTarget && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), Se(e));
|
|
900
900
|
} : void 0,
|
|
901
901
|
children: /* @__PURE__ */ i("span", { className: "inline-flex items-center", children: [
|
|
902
|
-
e.sortable &&
|
|
902
|
+
e.sortable && b && ve(e.header) ? /* @__PURE__ */ i(
|
|
903
903
|
"button",
|
|
904
904
|
{
|
|
905
905
|
type: "button",
|
|
@@ -912,9 +912,9 @@ function cr({
|
|
|
912
912
|
}
|
|
913
913
|
) : /* @__PURE__ */ i(Q, { children: [
|
|
914
914
|
e.header,
|
|
915
|
-
e.sortable &&
|
|
915
|
+
e.sortable && b && /* @__PURE__ */ t(De, { field: e.key, sort: u })
|
|
916
916
|
] }),
|
|
917
|
-
S &&
|
|
917
|
+
S && pe && e.key !== "claim" && /* @__PURE__ */ t(
|
|
918
918
|
"button",
|
|
919
919
|
{
|
|
920
920
|
type: "button",
|
|
@@ -922,17 +922,17 @@ function cr({
|
|
|
922
922
|
d.stopPropagation(), tt(e.key);
|
|
923
923
|
},
|
|
924
924
|
"aria-label": `Pin column ${At(e)}`,
|
|
925
|
-
title: (
|
|
926
|
-
className:
|
|
925
|
+
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",
|
|
926
|
+
className: m(
|
|
927
927
|
"ml-1 rounded p-0.5 transition-opacity",
|
|
928
|
-
|
|
928
|
+
f != null && f[e.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
|
|
929
929
|
),
|
|
930
930
|
children: /* @__PURE__ */ t(
|
|
931
931
|
st,
|
|
932
932
|
{
|
|
933
|
-
className:
|
|
933
|
+
className: m(
|
|
934
934
|
"h-3 w-3",
|
|
935
|
-
(
|
|
935
|
+
(f == null ? void 0 : f[e.key]) === "right" && "rotate-90"
|
|
936
936
|
)
|
|
937
937
|
}
|
|
938
938
|
)
|
|
@@ -947,29 +947,29 @@ function cr({
|
|
|
947
947
|
T && /* @__PURE__ */ t(
|
|
948
948
|
X,
|
|
949
949
|
{
|
|
950
|
-
className:
|
|
950
|
+
className: m(
|
|
951
951
|
"h-9 w-9 bg-slate-50 px-3 py-1",
|
|
952
|
-
(
|
|
952
|
+
(L || S) && "sticky left-0 z-[2] min-w-[40px]"
|
|
953
953
|
)
|
|
954
954
|
}
|
|
955
955
|
),
|
|
956
|
-
|
|
956
|
+
W.map((e) => {
|
|
957
957
|
const n = rt.get(e.key);
|
|
958
958
|
return /* @__PURE__ */ t(
|
|
959
959
|
X,
|
|
960
960
|
{
|
|
961
|
-
style:
|
|
962
|
-
className:
|
|
961
|
+
style: fe(e.key),
|
|
962
|
+
className: m(
|
|
963
963
|
"h-9 bg-slate-50 px-1.5 py-1 align-middle",
|
|
964
964
|
S && "bg-slate-50 dark:bg-muted",
|
|
965
|
-
|
|
965
|
+
ye(e.key, !0)
|
|
966
966
|
),
|
|
967
|
-
children: n &&
|
|
967
|
+
children: n && C ? /* @__PURE__ */ t(
|
|
968
968
|
Je,
|
|
969
969
|
{
|
|
970
970
|
def: n,
|
|
971
|
-
value:
|
|
972
|
-
onChange: (d) =>
|
|
971
|
+
value: x[n.key] ?? "",
|
|
972
|
+
onChange: (d) => C(n.key, d),
|
|
973
973
|
layout: "cell"
|
|
974
974
|
}
|
|
975
975
|
) : null
|
|
@@ -982,14 +982,14 @@ function cr({
|
|
|
982
982
|
/* @__PURE__ */ i(Ue, { className: "tabular-nums", children: [
|
|
983
983
|
A ? A.map((e) => {
|
|
984
984
|
const n = (D == null ? void 0 : D.has(e.key)) ?? !1;
|
|
985
|
-
return /* @__PURE__ */ i(
|
|
985
|
+
return /* @__PURE__ */ i(bt.Fragment, { children: [
|
|
986
986
|
/* @__PURE__ */ t(
|
|
987
987
|
H,
|
|
988
988
|
{
|
|
989
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",
|
|
990
|
-
onClick: () =>
|
|
990
|
+
onClick: () => ue == null ? void 0 : ue(e.key),
|
|
991
991
|
children: /* @__PURE__ */ t(
|
|
992
|
-
|
|
992
|
+
re,
|
|
993
993
|
{
|
|
994
994
|
colSpan: r.length + (T ? 1 : 0),
|
|
995
995
|
className: "px-3 py-1.5",
|
|
@@ -997,7 +997,7 @@ function cr({
|
|
|
997
997
|
/* @__PURE__ */ t(
|
|
998
998
|
it,
|
|
999
999
|
{
|
|
1000
|
-
className:
|
|
1000
|
+
className: m(
|
|
1001
1001
|
"h-3.5 w-3.5 text-slate-400 transition-transform duration-200",
|
|
1002
1002
|
n && "-rotate-90"
|
|
1003
1003
|
)
|
|
@@ -1009,11 +1009,11 @@ function cr({
|
|
|
1009
1009
|
)
|
|
1010
1010
|
}
|
|
1011
1011
|
),
|
|
1012
|
-
!n && e.rows.map((d, O) =>
|
|
1012
|
+
!n && e.rows.map((d, O) => Me(d, O))
|
|
1013
1013
|
] }, e.key);
|
|
1014
|
-
}) : s.map((e, n) =>
|
|
1014
|
+
}) : s.map((e, n) => Me(e, n)),
|
|
1015
1015
|
(A ? A.length === 0 : s.length === 0) && /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(
|
|
1016
|
-
|
|
1016
|
+
re,
|
|
1017
1017
|
{
|
|
1018
1018
|
colSpan: r.length + (T ? 1 : 0),
|
|
1019
1019
|
className: "nvr-fade-in p-0 text-center align-middle text-[13px] text-slate-400",
|
|
@@ -1022,7 +1022,7 @@ function cr({
|
|
|
1022
1022
|
"div",
|
|
1023
1023
|
{
|
|
1024
1024
|
className: "sticky left-0 py-12",
|
|
1025
|
-
style:
|
|
1025
|
+
style: Te ? { width: Te } : void 0,
|
|
1026
1026
|
"data-table-empty": !0,
|
|
1027
1027
|
children: typeof V == "string" ? /* @__PURE__ */ t(Nt, { icon: dt, title: V }) : V
|
|
1028
1028
|
}
|
|
@@ -1035,44 +1035,70 @@ function cr({
|
|
|
1035
1035
|
)
|
|
1036
1036
|
}
|
|
1037
1037
|
),
|
|
1038
|
-
|
|
1038
|
+
_e && /* @__PURE__ */ t(wt, { scrollerRef: Z }),
|
|
1039
1039
|
Re,
|
|
1040
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
1041
|
/* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400", children: [
|
|
1042
|
-
|
|
1042
|
+
ge(Ze),
|
|
1043
1043
|
"–",
|
|
1044
|
-
|
|
1044
|
+
ge(Ie),
|
|
1045
1045
|
" of ",
|
|
1046
|
-
|
|
1046
|
+
ge(c),
|
|
1047
1047
|
" records"
|
|
1048
1048
|
] }),
|
|
1049
1049
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
1050
1050
|
/* @__PURE__ */ t(
|
|
1051
|
-
|
|
1051
|
+
te,
|
|
1052
|
+
{
|
|
1053
|
+
variant: "ghost",
|
|
1054
|
+
size: "sm",
|
|
1055
|
+
className: "h-7 px-2 text-[12px] text-slate-600",
|
|
1056
|
+
disabled: h <= 1,
|
|
1057
|
+
onClick: () => N(1),
|
|
1058
|
+
"aria-label": "First page",
|
|
1059
|
+
"data-tip": "First page",
|
|
1060
|
+
children: "«"
|
|
1061
|
+
}
|
|
1062
|
+
),
|
|
1063
|
+
/* @__PURE__ */ t(
|
|
1064
|
+
te,
|
|
1052
1065
|
{
|
|
1053
1066
|
variant: "ghost",
|
|
1054
1067
|
size: "sm",
|
|
1055
1068
|
className: "h-7 px-2.5 text-[12px] text-slate-600",
|
|
1056
|
-
disabled:
|
|
1057
|
-
onClick: () =>
|
|
1069
|
+
disabled: h <= 1,
|
|
1070
|
+
onClick: () => N(h - 1),
|
|
1058
1071
|
children: "← Prev"
|
|
1059
1072
|
}
|
|
1060
1073
|
),
|
|
1061
1074
|
/* @__PURE__ */ i("span", { className: "px-2 text-[12px] text-slate-400", children: [
|
|
1062
|
-
|
|
1075
|
+
h,
|
|
1063
1076
|
" / ",
|
|
1064
|
-
|
|
1077
|
+
ee
|
|
1065
1078
|
] }),
|
|
1066
1079
|
/* @__PURE__ */ t(
|
|
1067
|
-
|
|
1080
|
+
te,
|
|
1068
1081
|
{
|
|
1069
1082
|
variant: "ghost",
|
|
1070
1083
|
size: "sm",
|
|
1071
1084
|
className: "h-7 px-2.5 text-[12px] text-slate-600",
|
|
1072
|
-
disabled:
|
|
1073
|
-
onClick: () =>
|
|
1085
|
+
disabled: h >= ee,
|
|
1086
|
+
onClick: () => N(h + 1),
|
|
1074
1087
|
children: "Next →"
|
|
1075
1088
|
}
|
|
1089
|
+
),
|
|
1090
|
+
/* @__PURE__ */ t(
|
|
1091
|
+
te,
|
|
1092
|
+
{
|
|
1093
|
+
variant: "ghost",
|
|
1094
|
+
size: "sm",
|
|
1095
|
+
className: "h-7 px-2 text-[12px] text-slate-600",
|
|
1096
|
+
disabled: h >= ee,
|
|
1097
|
+
onClick: () => N(ee),
|
|
1098
|
+
"aria-label": "Last page",
|
|
1099
|
+
"data-tip": "Last page",
|
|
1100
|
+
children: "»"
|
|
1101
|
+
}
|
|
1076
1102
|
)
|
|
1077
1103
|
] })
|
|
1078
1104
|
] })
|
|
@@ -1085,8 +1111,8 @@ function cr({
|
|
|
1085
1111
|
export {
|
|
1086
1112
|
cr as DataTable,
|
|
1087
1113
|
Je as FilterControl,
|
|
1088
|
-
|
|
1089
|
-
|
|
1114
|
+
Wt as ariaSortFor,
|
|
1115
|
+
Ft as containsFilter,
|
|
1090
1116
|
Jt as filterDefLabel,
|
|
1091
1117
|
dr as filterValueDisplay,
|
|
1092
1118
|
At as pinColumnName
|