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