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