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