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