@nivaro/react 0.3.127 → 0.3.128
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 +20 -2
- package/dist/index.js +150 -147
- package/dist/shared/components/CollectionBrowserView.js +3259 -3211
- package/dist/shared/components/DataTable.js +406 -401
- package/dist/shared/components/ItemEditForm.js +4203 -4156
- package/dist/shared/components/MatrixEditor.js +548 -490
- package/dist/shared/components/MyWorkView.js +284 -274
- package/dist/shared/components/NotificationBell.js +264 -218
- package/dist/shared/components/RecordGridEditor.js +582 -472
- package/dist/shared/components/chat/chat-core.js +331 -346
- package/dist/shared/components/chat/chat-typing.js +25 -0
- package/dist/shared/components/command-center/CommandCenterView.js +1 -1
- package/dist/shared/components/command-center/PeekPanel.js +8 -1
- package/dist/shared/components/command-center/api.js +17 -9
- package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
- package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
- package/dist/shared/components/item-edit/GroupSection.js +1 -1
- package/dist/shared/components/item-edit/InlineTableField.js +432 -429
- package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
- package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
- package/dist/shared/components/item-edit/RowComments.js +33 -30
- package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
- package/dist/shared/components/item-edit/live-related.js +29 -16
- package/dist/shared/components/item-edit/record-opened-live.js +86 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
- package/dist/shared/components/queue/QueueItemSheet.js +171 -130
- package/dist/shared/components/record-grid-guard.js +85 -0
- package/dist/shared/components/support/TicketDetailSheet.js +168 -151
- package/dist/shared/lib/at-risk-fields.js +14 -0
- package/dist/shared/lib/live-queries.js +9 -8
- package/dist/shared/lib/live-screen.js +77 -76
- package/dist/shared/lib/presence-hooks.js +190 -127
- package/dist/shared/lib/user-sync.js +78 -65
- package/dist/shared/lib/waiting-count.js +40 -29
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as s, Fragment as
|
|
2
|
-
import { Search as
|
|
3
|
-
import
|
|
4
|
-
import { parseDateFilter as
|
|
5
|
-
import { useKeepRowCheckboxFocus as
|
|
6
|
-
import { parseNumberFilter as
|
|
7
|
-
import { ROW_SURFACE_SELECTED as
|
|
8
|
-
import { fitPins as
|
|
9
|
-
import { useBelowMd as
|
|
10
|
-
import { cn as h, formatNumber as
|
|
11
|
-
import { CellCopyLayer as
|
|
12
|
-
import { EmptyState as
|
|
13
|
-
import { HScrollProxy as
|
|
14
|
-
import { PhonePager as
|
|
15
|
-
import { TableSkeletonRows as
|
|
1
|
+
import { jsxs as s, Fragment as H, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Search as Nt, Pin as wt, ChevronDown as _t, Inbox as Ot, ChevronsUpDown as me, ChevronUp as St, X as he, Check as $t, CalendarDays as zt } from "lucide-react";
|
|
3
|
+
import Et, { useState as z, useMemo as Ze, useRef as be, useEffect as re, useLayoutEffect as Ct } from "react";
|
|
4
|
+
import { parseDateFilter as Ie, describeDateFilter as Mt, DATE_FILTER_OPS as Tt, formatDateFilter as At } from "../lib/date-filter.js";
|
|
5
|
+
import { useKeepRowCheckboxFocus as jt } from "../lib/keep-row-focus.js";
|
|
6
|
+
import { parseNumberFilter as Ke, describeNumberFilter as Vt, NUMBER_FILTER_OPS as Wt, formatNumberFilter as Bt } from "../lib/number-filter.js";
|
|
7
|
+
import { ROW_SURFACE_SELECTED as Ft, ROW_SURFACE as Lt, ROW_SURFACE_HOVER as Rt } from "../lib/row-surface.js";
|
|
8
|
+
import { fitPins as qt } from "../lib/table-pins.js";
|
|
9
|
+
import { useBelowMd as Ht } from "../lib/use-below-md.js";
|
|
10
|
+
import { cn as h, formatNumber as Q } from "../lib/utils.js";
|
|
11
|
+
import { CellCopyLayer as Ut } from "./CellCopyLayer.js";
|
|
12
|
+
import { EmptyState as Dt } from "./EmptyState.js";
|
|
13
|
+
import { HScrollProxy as Jt } from "./HScrollProxy.js";
|
|
14
|
+
import { PhonePager as Xt } from "./list/PhonePager.js";
|
|
15
|
+
import { TableSkeletonRows as Qt } from "./Skeletons.js";
|
|
16
16
|
import { Button as de } from "./ui/button.js";
|
|
17
|
-
import { Checkbox as
|
|
18
|
-
import { Command as
|
|
19
|
-
import { Input as
|
|
17
|
+
import { Checkbox as Pe } from "./ui/checkbox.js";
|
|
18
|
+
import { Command as Yt, CommandInput as Zt, CommandList as It, CommandEmpty as Kt, CommandItem as Pt } from "./ui/command.js";
|
|
19
|
+
import { Input as R } from "./ui/input.js";
|
|
20
20
|
import { Popover as ue, PopoverTrigger as fe, PopoverContent as xe } from "./ui/popover.js";
|
|
21
|
-
import { Select as
|
|
22
|
-
import { Table as
|
|
23
|
-
const
|
|
21
|
+
import { Select as Gt, SelectTrigger as er, SelectValue as tr, SelectContent as rr, SelectItem as Ge } from "./ui/select.js";
|
|
22
|
+
import { Table as et, TableHeader as tt, TableRow as Y, TableHead as Z, TableBody as rt, TableCell as ce } from "./ui/table.js";
|
|
23
|
+
const ar = [1, 2, 3, 4, 5, 6, 7, 8];
|
|
24
24
|
function pe(r) {
|
|
25
25
|
var d;
|
|
26
26
|
return r == null || typeof r == "boolean" ? "" : typeof r == "string" || typeof r == "number" ? String(r) : Array.isArray(r) ? r.map(pe).join("") : typeof r == "object" && "props" in r ? pe((d = r.props) == null ? void 0 : d.children) : "";
|
|
@@ -31,32 +31,32 @@ function oe(r) {
|
|
|
31
31
|
const c = (r.key.split(".").pop() ?? r.key).replace(/_/g, " ").trim();
|
|
32
32
|
return c ? c[0].toUpperCase() + c.slice(1) : r.key;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Me(r) {
|
|
35
35
|
return r.startsWith("-") ? r.slice(1) : r;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Te(r) {
|
|
38
38
|
return r ? r.startsWith("-") ? "desc" : "asc" : null;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const o =
|
|
40
|
+
function lr(r, d) {
|
|
41
|
+
const o = Me(r), c = Te(r);
|
|
42
42
|
return o !== d || !r ? d : c === "asc" ? `-${d}` : "";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function nr(r, d) {
|
|
45
45
|
const o = d.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
46
46
|
if (o.length === 0) return 1;
|
|
47
47
|
const c = r.toLowerCase();
|
|
48
48
|
return o.every((b) => c.includes(b)) ? 1 : 0;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
return !r ||
|
|
50
|
+
function sr(r, d) {
|
|
51
|
+
return !r || Me(r) !== d ? "none" : Te(r) === "desc" ? "descending" : "ascending";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Ce(r) {
|
|
54
54
|
return typeof r == "string" || typeof r == "number";
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const o =
|
|
56
|
+
function at({ field: r, sort: d }) {
|
|
57
|
+
const o = Me(d), c = Te(d);
|
|
58
58
|
return o !== r || !d ? /* @__PURE__ */ t(me, { className: "ml-1 inline h-3 w-3 shrink-0 text-slate-300" }) : /* @__PURE__ */ t(
|
|
59
|
-
|
|
59
|
+
St,
|
|
60
60
|
{
|
|
61
61
|
className: h(
|
|
62
62
|
"ml-1 inline h-3 w-3 shrink-0 text-nvr-cyan transition-transform duration-200",
|
|
@@ -65,41 +65,41 @@ function rt({ field: r, sort: d }) {
|
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function ir({
|
|
69
69
|
def: r,
|
|
70
70
|
value: d,
|
|
71
71
|
onChange: o
|
|
72
72
|
}) {
|
|
73
|
-
const [c, b] =
|
|
73
|
+
const [c, b] = z(!1), [n, p] = z(""), [g, w] = z([]), [N, x] = z(!1), [u, k] = z({}), a = be(0), O = !!r.loadOptions, S = Array.isArray(d) ? d : d === "" ? [] : [d];
|
|
74
74
|
re(() => {
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
75
|
+
if (!O || !c) return;
|
|
76
|
+
const m = ++a.current;
|
|
77
|
+
x(!0);
|
|
78
|
+
const T = setTimeout(
|
|
79
79
|
() => {
|
|
80
|
-
var
|
|
81
|
-
(
|
|
82
|
-
a.current ===
|
|
80
|
+
var C;
|
|
81
|
+
(C = r.loadOptions) == null || C.call(r, n).then((F) => {
|
|
82
|
+
a.current === m && w(F);
|
|
83
83
|
}).catch(() => {
|
|
84
|
-
a.current ===
|
|
84
|
+
a.current === m && w([]);
|
|
85
85
|
}).finally(() => {
|
|
86
|
-
a.current ===
|
|
86
|
+
a.current === m && x(!1);
|
|
87
87
|
});
|
|
88
88
|
},
|
|
89
89
|
n ? 250 : 0
|
|
90
90
|
);
|
|
91
|
-
return () => clearTimeout(
|
|
92
|
-
}, [n, c,
|
|
93
|
-
const
|
|
94
|
-
var
|
|
95
|
-
return ((
|
|
96
|
-
},
|
|
91
|
+
return () => clearTimeout(T);
|
|
92
|
+
}, [n, c, O]);
|
|
93
|
+
const I = O ? g : r.options ?? [], K = (m) => {
|
|
94
|
+
var T, C;
|
|
95
|
+
return ((T = I.find((F) => F.value === m)) == null ? void 0 : T.label) ?? ((C = (r.options ?? []).find((F) => F.value === m)) == null ? void 0 : C.label) ?? u[m] ?? m;
|
|
96
|
+
}, ae = S.length === 0 ? null : S.length === 1 ? K(S[0]) : `${K(S[0])} +${S.length - 1}`;
|
|
97
97
|
return /* @__PURE__ */ s(
|
|
98
98
|
ue,
|
|
99
99
|
{
|
|
100
100
|
open: c,
|
|
101
|
-
onOpenChange: (
|
|
102
|
-
b(
|
|
101
|
+
onOpenChange: (m) => {
|
|
102
|
+
b(m), m || p("");
|
|
103
103
|
},
|
|
104
104
|
children: [
|
|
105
105
|
/* @__PURE__ */ t(fe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
@@ -108,20 +108,20 @@ function sr({
|
|
|
108
108
|
type: "button",
|
|
109
109
|
className: h(
|
|
110
110
|
"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",
|
|
111
|
-
|
|
111
|
+
ae ? "text-slate-800 dark:text-foreground" : "text-slate-500"
|
|
112
112
|
),
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
114
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: ae ?? r.placeholder }),
|
|
115
115
|
/* @__PURE__ */ s("span", { className: "ml-1 flex shrink-0 items-center gap-0.5", children: [
|
|
116
|
-
|
|
116
|
+
S.length > 0 && // biome-ignore lint/a11y/useKeyWithClickEvents: auxiliary clear affordance; Esc + reselect cover keyboard
|
|
117
117
|
/* @__PURE__ */ t(
|
|
118
118
|
"span",
|
|
119
119
|
{
|
|
120
120
|
role: "button",
|
|
121
121
|
tabIndex: -1,
|
|
122
122
|
"aria-label": "Clear filter",
|
|
123
|
-
onClick: (
|
|
124
|
-
|
|
123
|
+
onClick: (m) => {
|
|
124
|
+
m.stopPropagation(), o(r.multi ? [] : "");
|
|
125
125
|
},
|
|
126
126
|
className: "rounded p-0.5 text-slate-400 hover:text-slate-600",
|
|
127
127
|
children: /* @__PURE__ */ t(he, { className: "h-3 w-3" })
|
|
@@ -132,9 +132,9 @@ function sr({
|
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
) }),
|
|
135
|
-
/* @__PURE__ */ t(xe, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ s(
|
|
135
|
+
/* @__PURE__ */ t(xe, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ s(Yt, { shouldFilter: !O, filter: nr, children: [
|
|
136
136
|
/* @__PURE__ */ t(
|
|
137
|
-
|
|
137
|
+
Zt,
|
|
138
138
|
{
|
|
139
139
|
placeholder: "Search…",
|
|
140
140
|
className: "h-8 text-[12px]",
|
|
@@ -142,26 +142,26 @@ function sr({
|
|
|
142
142
|
onValueChange: p
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
/* @__PURE__ */ s(
|
|
146
|
-
/* @__PURE__ */ t(
|
|
147
|
-
|
|
148
|
-
const
|
|
145
|
+
/* @__PURE__ */ s(It, { children: [
|
|
146
|
+
/* @__PURE__ */ t(Kt, { className: "py-3 text-center text-[12px] text-slate-400", children: N ? "Searching…" : "No results" }),
|
|
147
|
+
I.map((m) => {
|
|
148
|
+
const T = S.includes(m.value);
|
|
149
149
|
return /* @__PURE__ */ s(
|
|
150
|
-
|
|
150
|
+
Pt,
|
|
151
151
|
{
|
|
152
|
-
value:
|
|
152
|
+
value: O ? m.value : m.label,
|
|
153
153
|
onSelect: () => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
) : (o(
|
|
154
|
+
k((C) => ({ ...C, [m.value]: m.label })), r.multi ? o(
|
|
155
|
+
T ? S.filter((C) => C !== m.value) : [...S, m.value]
|
|
156
|
+
) : (o(T ? "" : m.value), b(!1));
|
|
157
157
|
},
|
|
158
158
|
className: "text-[12px]",
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */ t(
|
|
161
|
-
|
|
160
|
+
/* @__PURE__ */ t($t, { className: h("mr-2 h-3 w-3", T ? "opacity-100" : "opacity-0") }),
|
|
161
|
+
m.label
|
|
162
162
|
]
|
|
163
163
|
},
|
|
164
|
-
|
|
164
|
+
m.value
|
|
165
165
|
);
|
|
166
166
|
})
|
|
167
167
|
] })
|
|
@@ -170,19 +170,19 @@ function sr({
|
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function dr({
|
|
174
174
|
value: r,
|
|
175
175
|
placeholder: d,
|
|
176
176
|
onChange: o
|
|
177
177
|
}) {
|
|
178
|
-
const [c, b] =
|
|
178
|
+
const [c, b] = z(!1), n = Ie(r), [p, g] = z((n == null ? void 0 : n.op) ?? "on"), [w, N] = z((n == null ? void 0 : n.from) ?? ""), [x, u] = z((n == null ? void 0 : n.to) ?? "");
|
|
179
179
|
re(() => {
|
|
180
180
|
if (!c) return;
|
|
181
|
-
const a =
|
|
182
|
-
|
|
181
|
+
const a = Ie(r);
|
|
182
|
+
g((a == null ? void 0 : a.op) ?? "on"), N((a == null ? void 0 : a.from) ?? ""), u((a == null ? void 0 : a.to) ?? "");
|
|
183
183
|
}, [c, r]);
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const k = (a, O, S) => {
|
|
185
|
+
O && (o(At({ op: a, from: O, to: S || O })), (a !== "between" || S) && b(!1));
|
|
186
186
|
};
|
|
187
187
|
return /* @__PURE__ */ s(ue, { open: c, onOpenChange: b, children: [
|
|
188
188
|
/* @__PURE__ */ t(fe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
@@ -192,7 +192,7 @@ function ir({
|
|
|
192
192
|
"data-date-filter": !0,
|
|
193
193
|
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",
|
|
194
194
|
children: [
|
|
195
|
-
/* @__PURE__ */ t("span", { className: h("truncate", !n && "text-slate-500 dark:text-muted-foreground"), children: n ?
|
|
195
|
+
/* @__PURE__ */ t("span", { className: h("truncate", !n && "text-slate-500 dark:text-muted-foreground"), children: n ? Mt(n) : d }),
|
|
196
196
|
n ? /* @__PURE__ */ t(
|
|
197
197
|
he,
|
|
198
198
|
{
|
|
@@ -201,19 +201,19 @@ function ir({
|
|
|
201
201
|
a.stopPropagation(), o(null);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
) : /* @__PURE__ */ t(
|
|
204
|
+
) : /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
205
205
|
]
|
|
206
206
|
}
|
|
207
207
|
) }),
|
|
208
208
|
/* @__PURE__ */ s(xe, { align: "start", className: "w-[248px] space-y-2 p-2", children: [
|
|
209
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-1", children:
|
|
209
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-1", children: Tt.map((a) => /* @__PURE__ */ t(
|
|
210
210
|
"button",
|
|
211
211
|
{
|
|
212
212
|
type: "button",
|
|
213
213
|
"data-date-op": a.op,
|
|
214
214
|
"aria-pressed": p === a.op,
|
|
215
215
|
onClick: () => {
|
|
216
|
-
|
|
216
|
+
g(a.op), w && k(a.op, w, x);
|
|
217
217
|
},
|
|
218
218
|
className: h(
|
|
219
219
|
"rounded border px-1 py-1 text-[11px] leading-tight transition-colors",
|
|
@@ -228,22 +228,22 @@ function ir({
|
|
|
228
228
|
"input",
|
|
229
229
|
{
|
|
230
230
|
type: "date",
|
|
231
|
-
value:
|
|
231
|
+
value: w,
|
|
232
232
|
onChange: (a) => {
|
|
233
|
-
N(a.target.value), p !== "between" &&
|
|
233
|
+
N(a.target.value), p !== "between" && k(p, a.target.value, "");
|
|
234
234
|
},
|
|
235
235
|
className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
|
|
236
236
|
}
|
|
237
237
|
),
|
|
238
|
-
p === "between" && /* @__PURE__ */ s(
|
|
238
|
+
p === "between" && /* @__PURE__ */ s(H, { children: [
|
|
239
239
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "to" }),
|
|
240
240
|
/* @__PURE__ */ t(
|
|
241
241
|
"input",
|
|
242
242
|
{
|
|
243
243
|
type: "date",
|
|
244
|
-
value:
|
|
244
|
+
value: x,
|
|
245
245
|
onChange: (a) => {
|
|
246
|
-
|
|
246
|
+
u(a.target.value), k("between", w, a.target.value);
|
|
247
247
|
},
|
|
248
248
|
className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
|
|
249
249
|
}
|
|
@@ -253,13 +253,13 @@ function ir({
|
|
|
253
253
|
] })
|
|
254
254
|
] });
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function cr({
|
|
257
257
|
value: r,
|
|
258
258
|
placeholder: d,
|
|
259
259
|
unit: o,
|
|
260
260
|
onChange: c
|
|
261
261
|
}) {
|
|
262
|
-
const [b, n] =
|
|
262
|
+
const [b, n] = z(!1), [p, g] = r.split(":"), w = o ?? "", N = p && g ? `${p}–${g}${w}` : p ? `${p}${w}+` : g ? `≤ ${g}${w}` : d, x = (u, k) => c(u === "" && k === "" ? null : `${u}:${k}`);
|
|
263
263
|
return /* @__PURE__ */ s(ue, { open: b, onOpenChange: n, children: [
|
|
264
264
|
/* @__PURE__ */ t(fe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
265
265
|
"button",
|
|
@@ -271,16 +271,16 @@ function dr({
|
|
|
271
271
|
/* @__PURE__ */ t(
|
|
272
272
|
"span",
|
|
273
273
|
{
|
|
274
|
-
className: h("truncate", !p && !
|
|
274
|
+
className: h("truncate", !p && !g && "text-slate-500 dark:text-muted-foreground"),
|
|
275
275
|
children: N
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
|
-
p ||
|
|
278
|
+
p || g ? /* @__PURE__ */ t(
|
|
279
279
|
he,
|
|
280
280
|
{
|
|
281
281
|
className: "h-3 w-3 shrink-0 text-slate-400 hover:text-slate-700",
|
|
282
|
-
onClick: (
|
|
283
|
-
|
|
282
|
+
onClick: (u) => {
|
|
283
|
+
u.stopPropagation(), c(null);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
) : /* @__PURE__ */ t(me, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
@@ -291,25 +291,25 @@ function dr({
|
|
|
291
291
|
/* @__PURE__ */ t("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: d }),
|
|
292
292
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
293
293
|
/* @__PURE__ */ t(
|
|
294
|
-
|
|
294
|
+
R,
|
|
295
295
|
{
|
|
296
296
|
type: "number",
|
|
297
297
|
"aria-label": `Minimum ${d}`,
|
|
298
298
|
placeholder: "Min",
|
|
299
299
|
value: p ?? "",
|
|
300
|
-
onChange: (
|
|
300
|
+
onChange: (u) => x(u.target.value, g ?? ""),
|
|
301
301
|
className: "h-7 text-[12px]"
|
|
302
302
|
}
|
|
303
303
|
),
|
|
304
304
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
|
|
305
305
|
/* @__PURE__ */ t(
|
|
306
|
-
|
|
306
|
+
R,
|
|
307
307
|
{
|
|
308
308
|
type: "number",
|
|
309
309
|
"aria-label": `Maximum ${d}`,
|
|
310
310
|
placeholder: "Max",
|
|
311
|
-
value:
|
|
312
|
-
onChange: (
|
|
311
|
+
value: g ?? "",
|
|
312
|
+
onChange: (u) => x(p ?? "", u.target.value),
|
|
313
313
|
className: "h-7 text-[12px]"
|
|
314
314
|
}
|
|
315
315
|
)
|
|
@@ -317,19 +317,19 @@ function dr({
|
|
|
317
317
|
] })
|
|
318
318
|
] });
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function or({
|
|
321
321
|
value: r,
|
|
322
322
|
placeholder: d,
|
|
323
323
|
onChange: o
|
|
324
324
|
}) {
|
|
325
|
-
const [c, b] =
|
|
325
|
+
const [c, b] = z(!1), n = Ke(r), [p, g] = z((n == null ? void 0 : n.op) ?? "eq"), [w, N] = z(n ? String(n.a) : ""), [x, u] = z((n == null ? void 0 : n.b) != null ? String(n.b) : "");
|
|
326
326
|
re(() => {
|
|
327
327
|
if (!c) return;
|
|
328
|
-
const a =
|
|
329
|
-
|
|
328
|
+
const a = Ke(r);
|
|
329
|
+
g((a == null ? void 0 : a.op) ?? "eq"), N(a ? String(a.a) : ""), u((a == null ? void 0 : a.b) != null ? String(a.b) : "");
|
|
330
330
|
}, [c, r]);
|
|
331
|
-
const
|
|
332
|
-
|
|
331
|
+
const k = (a, O, S) => {
|
|
332
|
+
O === "" || Number.isNaN(Number(O)) || a === "between" && (S === "" || Number.isNaN(Number(S))) || o(Bt({ op: a, a: Number(O), b: S === "" ? void 0 : Number(S) }));
|
|
333
333
|
};
|
|
334
334
|
return /* @__PURE__ */ s(ue, { open: c, onOpenChange: b, children: [
|
|
335
335
|
/* @__PURE__ */ t(fe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
@@ -339,7 +339,7 @@ function cr({
|
|
|
339
339
|
"data-number-filter": !0,
|
|
340
340
|
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",
|
|
341
341
|
children: [
|
|
342
|
-
/* @__PURE__ */ t("span", { className: h("truncate", !n && "text-slate-500 dark:text-muted-foreground"), children: n ?
|
|
342
|
+
/* @__PURE__ */ t("span", { className: h("truncate", !n && "text-slate-500 dark:text-muted-foreground"), children: n ? Vt(n) : d }),
|
|
343
343
|
n ? /* @__PURE__ */ t(
|
|
344
344
|
he,
|
|
345
345
|
{
|
|
@@ -353,14 +353,14 @@ function cr({
|
|
|
353
353
|
}
|
|
354
354
|
) }),
|
|
355
355
|
/* @__PURE__ */ s(xe, { align: "start", className: "w-[220px] space-y-2 p-2", children: [
|
|
356
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-1", children:
|
|
356
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-1", children: Wt.map((a) => /* @__PURE__ */ t(
|
|
357
357
|
"button",
|
|
358
358
|
{
|
|
359
359
|
type: "button",
|
|
360
360
|
"data-number-op": a.op,
|
|
361
361
|
"aria-pressed": p === a.op,
|
|
362
362
|
onClick: () => {
|
|
363
|
-
|
|
363
|
+
g(a.op), k(a.op, w, x);
|
|
364
364
|
},
|
|
365
365
|
className: h(
|
|
366
366
|
"rounded border px-1 py-1 text-[11px] transition-colors",
|
|
@@ -372,25 +372,25 @@ function cr({
|
|
|
372
372
|
)) }),
|
|
373
373
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
374
374
|
/* @__PURE__ */ t(
|
|
375
|
-
|
|
375
|
+
R,
|
|
376
376
|
{
|
|
377
377
|
type: "number",
|
|
378
|
-
value:
|
|
378
|
+
value: w,
|
|
379
379
|
onChange: (a) => {
|
|
380
|
-
N(a.target.value),
|
|
380
|
+
N(a.target.value), k(p, a.target.value, x);
|
|
381
381
|
},
|
|
382
382
|
className: "h-7 text-[12px]"
|
|
383
383
|
}
|
|
384
384
|
),
|
|
385
|
-
p === "between" && /* @__PURE__ */ s(
|
|
385
|
+
p === "between" && /* @__PURE__ */ s(H, { children: [
|
|
386
386
|
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
|
|
387
387
|
/* @__PURE__ */ t(
|
|
388
|
-
|
|
388
|
+
R,
|
|
389
389
|
{
|
|
390
390
|
type: "number",
|
|
391
|
-
value:
|
|
391
|
+
value: x,
|
|
392
392
|
onChange: (a) => {
|
|
393
|
-
|
|
393
|
+
u(a.target.value), k(p, w, a.target.value);
|
|
394
394
|
},
|
|
395
395
|
className: "h-7 text-[12px]"
|
|
396
396
|
}
|
|
@@ -400,22 +400,22 @@ function cr({
|
|
|
400
400
|
] })
|
|
401
401
|
] });
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function lt({
|
|
404
404
|
def: r,
|
|
405
405
|
value: d,
|
|
406
406
|
onChange: o,
|
|
407
407
|
layout: c = "inline"
|
|
408
408
|
}) {
|
|
409
|
-
const b = c === "stacked", n = c === "cell", p = typeof d == "string" ? d : "",
|
|
409
|
+
const b = c === "stacked", n = c === "cell", p = typeof d == "string" ? d : "", g = b || n ? "w-full" : "w-40", w = n ? "h-7 text-[12px]" : "text-[13px]";
|
|
410
410
|
let N;
|
|
411
411
|
if (r.type === "text")
|
|
412
412
|
N = /* @__PURE__ */ t(
|
|
413
|
-
|
|
413
|
+
R,
|
|
414
414
|
{
|
|
415
|
-
className: h("h-8 border-slate-200 bg-slate-50",
|
|
415
|
+
className: h("h-8 border-slate-200 bg-slate-50", w, g),
|
|
416
416
|
placeholder: r.placeholder,
|
|
417
417
|
value: p,
|
|
418
|
-
onChange: (
|
|
418
|
+
onChange: (x) => o(x.target.value)
|
|
419
419
|
}
|
|
420
420
|
);
|
|
421
421
|
else if (r.type === "combobox")
|
|
@@ -426,88 +426,88 @@ function at({
|
|
|
426
426
|
(b || n) && "[&>button]:w-full",
|
|
427
427
|
n && "[&>button]:h-7 [&>button]:min-w-[88px] [&>button]:px-1.5 [&>button]:text-[12px]"
|
|
428
428
|
),
|
|
429
|
-
children: /* @__PURE__ */ t(
|
|
429
|
+
children: /* @__PURE__ */ t(ir, { def: r, value: d, onChange: o })
|
|
430
430
|
}
|
|
431
431
|
);
|
|
432
432
|
else if (r.type === "date")
|
|
433
|
-
N = /* @__PURE__ */ t("div", { className: h(n && "[&>div>button]:h-7 [&>div>button]:text-[12px]",
|
|
434
|
-
|
|
433
|
+
N = /* @__PURE__ */ t("div", { className: h(n && "[&>div>button]:h-7 [&>div>button]:text-[12px]", g), children: /* @__PURE__ */ t(
|
|
434
|
+
dr,
|
|
435
435
|
{
|
|
436
436
|
value: p,
|
|
437
437
|
placeholder: r.placeholder,
|
|
438
|
-
onChange: (
|
|
438
|
+
onChange: (x) => o(x ?? "")
|
|
439
439
|
}
|
|
440
440
|
) });
|
|
441
441
|
else if (r.type === "number")
|
|
442
|
-
N = /* @__PURE__ */ t("div", { className: h(n && "[&>div>button]:h-7 [&>div>button]:text-[12px]",
|
|
443
|
-
|
|
442
|
+
N = /* @__PURE__ */ t("div", { className: h(n && "[&>div>button]:h-7 [&>div>button]:text-[12px]", g), children: /* @__PURE__ */ t(
|
|
443
|
+
or,
|
|
444
444
|
{
|
|
445
445
|
value: p,
|
|
446
446
|
placeholder: r.placeholder,
|
|
447
|
-
onChange: (
|
|
447
|
+
onChange: (x) => o(x ?? "")
|
|
448
448
|
}
|
|
449
449
|
) });
|
|
450
450
|
else if (r.type === "range" && n)
|
|
451
451
|
N = /* @__PURE__ */ t("div", { className: "[&>div>button]:h-7 [&>div>button]:text-[12px] w-full", children: /* @__PURE__ */ t(
|
|
452
|
-
|
|
452
|
+
cr,
|
|
453
453
|
{
|
|
454
454
|
value: p,
|
|
455
455
|
placeholder: r.placeholder,
|
|
456
456
|
unit: r.range_unit,
|
|
457
|
-
onChange: (
|
|
457
|
+
onChange: (x) => o(x ?? "")
|
|
458
458
|
}
|
|
459
459
|
) });
|
|
460
460
|
else if (r.type === "range") {
|
|
461
|
-
const [
|
|
461
|
+
const [x, u] = p.split(":");
|
|
462
462
|
N = /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
463
463
|
/* @__PURE__ */ t(
|
|
464
|
-
|
|
464
|
+
R,
|
|
465
465
|
{
|
|
466
466
|
type: "number",
|
|
467
467
|
className: h(
|
|
468
468
|
"h-8 border-slate-200 bg-slate-50",
|
|
469
|
-
|
|
469
|
+
w,
|
|
470
470
|
b || n ? "w-full min-w-[48px]" : "w-20"
|
|
471
471
|
),
|
|
472
472
|
placeholder: "Min",
|
|
473
|
-
value:
|
|
474
|
-
onChange: (
|
|
473
|
+
value: x ?? "",
|
|
474
|
+
onChange: (k) => o(`${k.target.value}:${u ?? ""}`)
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
477
|
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-400", children: "–" }),
|
|
478
478
|
/* @__PURE__ */ t(
|
|
479
|
-
|
|
479
|
+
R,
|
|
480
480
|
{
|
|
481
481
|
type: "number",
|
|
482
482
|
className: h(
|
|
483
483
|
"h-8 border-slate-200 bg-slate-50",
|
|
484
|
-
|
|
484
|
+
w,
|
|
485
485
|
b || n ? "w-full min-w-[48px]" : "w-20"
|
|
486
486
|
),
|
|
487
487
|
placeholder: "Max",
|
|
488
|
-
value:
|
|
489
|
-
onChange: (
|
|
488
|
+
value: u ?? "",
|
|
489
|
+
onChange: (k) => o(`${x ?? ""}:${k.target.value}`)
|
|
490
490
|
}
|
|
491
491
|
)
|
|
492
492
|
] });
|
|
493
493
|
} else
|
|
494
|
-
N = /* @__PURE__ */ s(
|
|
494
|
+
N = /* @__PURE__ */ s(Gt, { value: p === "" ? "__all__" : p, onValueChange: (u) => o(u === "__all__" ? "" : u), children: [
|
|
495
495
|
/* @__PURE__ */ t(
|
|
496
|
-
|
|
496
|
+
er,
|
|
497
497
|
{
|
|
498
|
-
"aria-label":
|
|
499
|
-
className: h("h-8 border-slate-200 bg-slate-50",
|
|
500
|
-
children: /* @__PURE__ */ t(
|
|
498
|
+
"aria-label": nt(r),
|
|
499
|
+
className: h("h-8 border-slate-200 bg-slate-50", w, g),
|
|
500
|
+
children: /* @__PURE__ */ t(tr, { placeholder: r.placeholder })
|
|
501
501
|
}
|
|
502
502
|
),
|
|
503
|
-
/* @__PURE__ */ s(
|
|
504
|
-
/* @__PURE__ */ t(
|
|
505
|
-
(r.options ?? []).filter((
|
|
503
|
+
/* @__PURE__ */ s(rr, { children: [
|
|
504
|
+
/* @__PURE__ */ t(Ge, { value: "__all__", children: r.placeholder }),
|
|
505
|
+
(r.options ?? []).filter((u) => u.value !== "").map((u) => /* @__PURE__ */ t(Ge, { value: u.value, children: u.label }, u.value))
|
|
506
506
|
] })
|
|
507
507
|
] });
|
|
508
508
|
return b ? /* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
509
509
|
/* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
|
|
510
|
-
|
|
510
|
+
nt(r),
|
|
511
511
|
r.restricted && /* @__PURE__ */ t(
|
|
512
512
|
"span",
|
|
513
513
|
{
|
|
@@ -525,12 +525,12 @@ function at({
|
|
|
525
525
|
className: "[&_button]:!border-amber-400 [&_input]:!border-amber-400 dark:[&_button]:!border-amber-500/60 dark:[&_input]:!border-amber-500/60",
|
|
526
526
|
children: N
|
|
527
527
|
}
|
|
528
|
-
) : /* @__PURE__ */ t(
|
|
528
|
+
) : /* @__PURE__ */ t(H, { children: N });
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function nt(r) {
|
|
531
531
|
return r.placeholder.replace(/^Search\s+/i, "").replace(/[…]|\.{3}$/g, "");
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function Ar(r, d) {
|
|
534
534
|
const o = (c) => {
|
|
535
535
|
var b, n;
|
|
536
536
|
return ((n = (b = r.options) == null ? void 0 : b.find((p) => p.value === c)) == null ? void 0 : n.label) ?? c;
|
|
@@ -545,7 +545,7 @@ function Tr(r, d) {
|
|
|
545
545
|
}
|
|
546
546
|
return o(d);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function jr({
|
|
549
549
|
columns: r,
|
|
550
550
|
rows: d,
|
|
551
551
|
rowKey: o,
|
|
@@ -553,124 +553,125 @@ function Ar({
|
|
|
553
553
|
page: b,
|
|
554
554
|
limit: n = 25,
|
|
555
555
|
isLoading: p,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
556
|
+
isStale: g,
|
|
557
|
+
isError: w,
|
|
558
|
+
errorMessage: N,
|
|
559
|
+
onRetry: x,
|
|
560
|
+
sort: u = "",
|
|
561
|
+
onSortChange: k,
|
|
562
|
+
onPageChange: a,
|
|
563
|
+
onRowClick: O,
|
|
564
|
+
onRowContextMenu: S,
|
|
565
|
+
searchValue: I,
|
|
565
566
|
onSearchChange: K,
|
|
566
567
|
searchPlaceholder: ae = "Search…",
|
|
567
|
-
filterDefs:
|
|
568
|
-
filterValues:
|
|
569
|
-
onFilterChange:
|
|
570
|
-
toolbarRight:
|
|
571
|
-
emptyMessage:
|
|
572
|
-
minBodyHeight:
|
|
568
|
+
filterDefs: m,
|
|
569
|
+
filterValues: T = {},
|
|
570
|
+
onFilterChange: C,
|
|
571
|
+
toolbarRight: F,
|
|
572
|
+
emptyMessage: ye = "No records found.",
|
|
573
|
+
minBodyHeight: st,
|
|
573
574
|
fillHeight: le = !1,
|
|
574
|
-
footer:
|
|
575
|
-
hideFilterRow:
|
|
576
|
-
nowrapCells:
|
|
577
|
-
density:
|
|
578
|
-
pinFirstColumn:
|
|
579
|
-
columnPins:
|
|
580
|
-
onColumnPinChange:
|
|
581
|
-
pinKeepRank:
|
|
582
|
-
pinRightShare:
|
|
583
|
-
columnFilterRow:
|
|
584
|
-
hScrollProxy:
|
|
585
|
-
selectedIds:
|
|
586
|
-
onSelectionChange:
|
|
587
|
-
rowClassName:
|
|
588
|
-
rowDragProps:
|
|
589
|
-
rowTitle:
|
|
590
|
-
enterKey:
|
|
591
|
-
rowGroups:
|
|
592
|
-
collapsedGroups:
|
|
593
|
-
onToggleGroup:
|
|
594
|
-
onRowFocus:
|
|
575
|
+
footer: it,
|
|
576
|
+
hideFilterRow: dt = !1,
|
|
577
|
+
nowrapCells: ct = !1,
|
|
578
|
+
density: ge = "comfortable",
|
|
579
|
+
pinFirstColumn: A = !1,
|
|
580
|
+
columnPins: v,
|
|
581
|
+
onColumnPinChange: ke,
|
|
582
|
+
pinKeepRank: ve,
|
|
583
|
+
pinRightShare: ot,
|
|
584
|
+
columnFilterRow: bt = !1,
|
|
585
|
+
hScrollProxy: Ae = !1,
|
|
586
|
+
selectedIds: j,
|
|
587
|
+
onSelectionChange: M,
|
|
588
|
+
rowClassName: Ne,
|
|
589
|
+
rowDragProps: we,
|
|
590
|
+
rowTitle: _e,
|
|
591
|
+
enterKey: pt,
|
|
592
|
+
rowGroups: V,
|
|
593
|
+
collapsedGroups: U,
|
|
594
|
+
onToggleGroup: Oe,
|
|
595
|
+
onRowFocus: D,
|
|
595
596
|
activeRowKey: ne,
|
|
596
|
-
rowAriaLabel:
|
|
597
|
+
rowAriaLabel: Se,
|
|
597
598
|
totalsRow: P
|
|
598
599
|
}) {
|
|
599
|
-
const G = Math.ceil(c / n),
|
|
600
|
-
!e.sortable || !
|
|
601
|
-
}, _ =
|
|
602
|
-
if (!_ || !
|
|
603
|
-
const e = new Set(
|
|
604
|
-
return [...i, ...
|
|
605
|
-
}, [r,
|
|
606
|
-
|
|
607
|
-
const
|
|
600
|
+
const G = Math.ceil(c / n), je = (b - 1) * n + 1, Ve = Math.min(b * n, c), We = !dt && m && m.length > 0, mt = I !== void 0 || We || F !== void 0, Be = (e) => {
|
|
601
|
+
!e.sortable || !k || k(lr(u, e.key));
|
|
602
|
+
}, _ = v !== void 0, [Fe, ht] = z([]), L = Ze(() => {
|
|
603
|
+
if (!_ || !v) return r;
|
|
604
|
+
const e = new Set(Fe), l = ($) => v[$] === "right" && !e.has($), i = r.filter(($) => v[$.key] === "left"), E = r.filter(($) => l($.key)), W = r.filter(($) => v[$.key] !== "left" && !l($.key));
|
|
605
|
+
return [...i, ...W, ...E];
|
|
606
|
+
}, [r, v, _, Fe]), Le = be({}), q = be(null);
|
|
607
|
+
jt(q);
|
|
608
|
+
const Re = be(null), qe = !p && (V ? V.length === 0 : d.length === 0), [He, ut] = z(null);
|
|
608
609
|
re(() => {
|
|
609
|
-
const e =
|
|
610
|
-
if (!
|
|
611
|
-
const l = () =>
|
|
610
|
+
const e = q.current;
|
|
611
|
+
if (!qe || !e) return;
|
|
612
|
+
const l = () => ut(e.clientWidth);
|
|
612
613
|
if (l(), typeof ResizeObserver > "u") return;
|
|
613
614
|
const i = new ResizeObserver(l);
|
|
614
615
|
return i.observe(e), () => i.disconnect();
|
|
615
|
-
}, [
|
|
616
|
-
const [ee,
|
|
616
|
+
}, [qe]);
|
|
617
|
+
const [ee, ft] = z({}), [, xt] = z(0), $e = Ht(), J = le && $e ? void 0 : st;
|
|
617
618
|
re(() => {
|
|
618
|
-
const e =
|
|
619
|
+
const e = q.current;
|
|
619
620
|
if (!_ || !e || typeof ResizeObserver > "u") return;
|
|
620
|
-
const l = new ResizeObserver(() =>
|
|
621
|
+
const l = new ResizeObserver(() => xt(e.clientWidth));
|
|
621
622
|
return l.observe(e), () => l.disconnect();
|
|
622
|
-
}, [_, p]),
|
|
623
|
-
var
|
|
624
|
-
if (!_ || !
|
|
625
|
-
const e = (
|
|
626
|
-
var
|
|
627
|
-
return ((
|
|
628
|
-
}, l =
|
|
623
|
+
}, [_, p]), Ct(() => {
|
|
624
|
+
var Xe, Qe;
|
|
625
|
+
if (!_ || !v) return;
|
|
626
|
+
const e = (f) => {
|
|
627
|
+
var B;
|
|
628
|
+
return ((B = Le.current[f]) == null ? void 0 : B.getBoundingClientRect().width) ?? 120;
|
|
629
|
+
}, l = M ? ((Xe = Re.current) == null ? void 0 : Xe.getBoundingClientRect().width) ?? 40 : 0;
|
|
629
630
|
let i = null;
|
|
630
|
-
const
|
|
631
|
-
var
|
|
631
|
+
const E = (f) => {
|
|
632
|
+
var Ye;
|
|
632
633
|
i ?? (i = [
|
|
633
|
-
...((
|
|
634
|
+
...((Ye = q.current) == null ? void 0 : Ye.querySelectorAll("tbody td[data-dt-col]")) ?? []
|
|
634
635
|
]);
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
637
|
-
for (const te of
|
|
636
|
+
const B = i.filter((te) => te.dataset.dtCol === f);
|
|
637
|
+
if (B.length === 0) return !1;
|
|
638
|
+
for (const te of B) {
|
|
638
639
|
if (te.querySelector("[data-cell-empty]")) continue;
|
|
639
640
|
if (te.querySelector("img, svg, button, input, a")) return !1;
|
|
640
|
-
const
|
|
641
|
-
if (
|
|
641
|
+
const Ee = (te.textContent ?? "").trim();
|
|
642
|
+
if (Ee !== "" && Ee !== "—" && Ee !== "-") return !1;
|
|
642
643
|
}
|
|
643
644
|
return !0;
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
|
|
645
|
+
}, W = r.filter((f) => v[f.key] === "right").map((f) => f.key), { left: $, right: y } = qt(
|
|
646
|
+
L.filter((f) => v[f.key] === "left").map((f) => f.key),
|
|
647
|
+
W,
|
|
647
648
|
e,
|
|
648
649
|
l,
|
|
649
|
-
((
|
|
650
|
+
((Qe = q.current) == null ? void 0 : Qe.clientWidth) ?? 0,
|
|
650
651
|
{
|
|
651
|
-
compact:
|
|
652
|
-
rightShare:
|
|
653
|
-
rank:
|
|
652
|
+
compact: $e,
|
|
653
|
+
rightShare: ot,
|
|
654
|
+
rank: ve ? (f) => E(f) ? -1e6 : ve(f) : void 0
|
|
654
655
|
}
|
|
655
|
-
),
|
|
656
|
-
|
|
656
|
+
), X = ve && !$e ? W.filter((f) => !y.includes(f)) : [];
|
|
657
|
+
ht((f) => f.join("|") === X.join("|") ? f : X);
|
|
657
658
|
const ie = {};
|
|
658
|
-
let
|
|
659
|
-
|
|
660
|
-
ie[
|
|
659
|
+
let De = l;
|
|
660
|
+
$.forEach((f, B) => {
|
|
661
|
+
ie[f] = { side: "left", offset: Math.floor(De), seam: B === $.length - 1 }, De += e(f);
|
|
661
662
|
});
|
|
662
|
-
let
|
|
663
|
-
for (let
|
|
664
|
-
const
|
|
665
|
-
ie[
|
|
663
|
+
let Je = 0;
|
|
664
|
+
for (let f = y.length - 1; f >= 0; f--) {
|
|
665
|
+
const B = y[f];
|
|
666
|
+
ie[B] = { side: "right", offset: Math.floor(Je), seam: f === 0 }, Je += e(B);
|
|
666
667
|
}
|
|
667
|
-
|
|
668
|
+
ft((f) => JSON.stringify(f) === JSON.stringify(ie) ? f : ie);
|
|
668
669
|
});
|
|
669
670
|
const se = (e) => {
|
|
670
671
|
const l = ee[e];
|
|
671
672
|
if (!(!_ || !l))
|
|
672
673
|
return l.side === "left" ? { left: l.offset } : { right: l.offset };
|
|
673
|
-
},
|
|
674
|
+
}, ze = (e, l) => {
|
|
674
675
|
const i = ee[e];
|
|
675
676
|
if (!(!_ || !i))
|
|
676
677
|
return h(
|
|
@@ -682,85 +683,85 @@ function Ar({
|
|
|
682
683
|
i.side === "left" && i.seam && "border-r border-slate-200 dark:border-border",
|
|
683
684
|
i.side === "right" && i.seam && "border-l border-slate-200 dark:border-border"
|
|
684
685
|
);
|
|
685
|
-
},
|
|
686
|
-
if (!
|
|
687
|
-
const l = (
|
|
688
|
-
|
|
689
|
-
},
|
|
686
|
+
}, yt = (e) => {
|
|
687
|
+
if (!ke) return;
|
|
688
|
+
const l = (v == null ? void 0 : v[e]) ?? null;
|
|
689
|
+
ke(e, l === null ? "left" : l === "left" ? "right" : null);
|
|
690
|
+
}, gt = Ze(() => {
|
|
690
691
|
const e = /* @__PURE__ */ new Map();
|
|
691
|
-
for (const l of
|
|
692
|
+
for (const l of m ?? []) e.set(l.key, l);
|
|
692
693
|
return e;
|
|
693
|
-
}, [
|
|
694
|
-
if (!
|
|
695
|
-
const e =
|
|
696
|
-
return ne && e.some((i,
|
|
697
|
-
})(),
|
|
698
|
-
const i = o ? o(e, l) : String(l),
|
|
694
|
+
}, [m]), kt = bt && ((m == null ? void 0 : m.length) ?? 0) > 0, vt = (() => {
|
|
695
|
+
if (!D) return null;
|
|
696
|
+
const e = V ? V.flatMap((i) => U != null && U.has(i.key) ? [] : i.rows) : d, l = (i, E) => o ? o(i, E) : String(E);
|
|
697
|
+
return ne && e.some((i, E) => l(i, E) === ne) ? ne : e.length > 0 ? l(e[0], 0) : null;
|
|
698
|
+
})(), Ue = (e, l) => {
|
|
699
|
+
const i = o ? o(e, l) : String(l), E = (j == null ? void 0 : j.includes(i)) ?? !1, W = !!D, $ = W && i === vt;
|
|
699
700
|
return /* @__PURE__ */ s(
|
|
700
|
-
|
|
701
|
+
Y,
|
|
701
702
|
{
|
|
702
|
-
...
|
|
703
|
+
...we == null ? void 0 : we(e),
|
|
703
704
|
className: h(
|
|
704
705
|
// NAMED group: queue cells already use bare `group-hover:` against
|
|
705
706
|
// their own local group, and claiming the unnamed one here would
|
|
706
707
|
// make those reveal on row hover instead.
|
|
707
708
|
"group/row nvr-row-enter border-slate-100 transition-colors duration-150",
|
|
708
|
-
|
|
709
|
+
D && "focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nvr-cyan",
|
|
709
710
|
// Pinned: opaque surface AND opaque hover (the base row's hover:bg-muted/50 is
|
|
710
711
|
// translucent, so the pinned cells would go see-through under the pointer).
|
|
711
|
-
(
|
|
712
|
-
|
|
713
|
-
|
|
712
|
+
(A || _) && `${Lt} ${Rt}`,
|
|
713
|
+
O && (A || _ ? "cursor-pointer" : "cursor-pointer hover:bg-slate-50/80"),
|
|
714
|
+
Ne == null ? void 0 : Ne(e),
|
|
714
715
|
// Pinned sticky cells use bg-inherit, so a selected row's bg must be
|
|
715
716
|
// OPAQUE or horizontally-scrolled content bleeds through the pinned
|
|
716
717
|
// column (lib/row-surface.ts: the accent mixed over the card).
|
|
717
|
-
|
|
718
|
+
E && (A || _ ? Ft : "bg-nvr-cyan/5")
|
|
718
719
|
),
|
|
719
720
|
style: { animationDelay: `${Math.min(l, 14) * 16}ms` },
|
|
720
721
|
"data-row-key": i,
|
|
721
|
-
title:
|
|
722
|
-
onClick: () =>
|
|
723
|
-
onContextMenu:
|
|
724
|
-
...
|
|
725
|
-
tabIndex:
|
|
726
|
-
"aria-current":
|
|
727
|
-
"aria-label":
|
|
722
|
+
title: _e == null ? void 0 : _e(e),
|
|
723
|
+
onClick: () => O == null ? void 0 : O(e),
|
|
724
|
+
onContextMenu: S ? (y) => S(e, y) : void 0,
|
|
725
|
+
...W ? {
|
|
726
|
+
tabIndex: $ ? 0 : -1,
|
|
727
|
+
"aria-current": $ && ne === i ? "true" : void 0,
|
|
728
|
+
"aria-label": Se == null ? void 0 : Se(e),
|
|
728
729
|
onFocus: (y) => {
|
|
729
|
-
y.target === y.currentTarget && (
|
|
730
|
+
y.target === y.currentTarget && (D == null || D(e));
|
|
730
731
|
},
|
|
731
732
|
onKeyDown: (y) => {
|
|
732
|
-
y.key !== "Enter" || y.target !== y.currentTarget || !
|
|
733
|
+
y.key !== "Enter" || y.target !== y.currentTarget || !O || (y.preventDefault(), O(e));
|
|
733
734
|
}
|
|
734
735
|
} : {},
|
|
735
736
|
children: [
|
|
736
|
-
|
|
737
|
+
M && /* @__PURE__ */ t(
|
|
737
738
|
ce,
|
|
738
739
|
{
|
|
739
740
|
className: h(
|
|
740
741
|
"w-9 px-3",
|
|
741
|
-
|
|
742
|
-
(
|
|
742
|
+
ge === "compact" ? "py-1" : "py-2",
|
|
743
|
+
(A || _) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
|
|
743
744
|
),
|
|
744
745
|
onClick: (y) => {
|
|
745
|
-
y.stopPropagation(),
|
|
746
|
+
y.stopPropagation(), M(E ? (j == null ? void 0 : j.filter((X) => X !== i)) ?? [] : [...j ?? [], i]);
|
|
746
747
|
},
|
|
747
|
-
children: /* @__PURE__ */ t(
|
|
748
|
+
children: /* @__PURE__ */ t(Pe, { checked: E, "aria-label": "Select row" })
|
|
748
749
|
}
|
|
749
750
|
),
|
|
750
|
-
|
|
751
|
+
L.map((y, X) => /* @__PURE__ */ t(
|
|
751
752
|
ce,
|
|
752
753
|
{
|
|
753
754
|
"data-dt-col": y.key,
|
|
754
755
|
style: se(y.key),
|
|
755
756
|
className: h(
|
|
756
757
|
"px-3",
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
!_ &&
|
|
758
|
+
ge === "compact" ? "py-1" : "py-2",
|
|
759
|
+
ct && "whitespace-nowrap",
|
|
760
|
+
!_ && A && X === 0 && h(
|
|
760
761
|
"sticky z-[1] border-r border-slate-100 bg-inherit dark:border-border",
|
|
761
|
-
|
|
762
|
+
M ? "left-[39px]" : "left-0"
|
|
762
763
|
),
|
|
763
|
-
|
|
764
|
+
ze(y.key, !1),
|
|
764
765
|
y.className
|
|
765
766
|
),
|
|
766
767
|
children: y.render ? y.render(e, l) : String(e[y.key] ?? "—")
|
|
@@ -772,23 +773,23 @@ function Ar({
|
|
|
772
773
|
i
|
|
773
774
|
);
|
|
774
775
|
};
|
|
775
|
-
return /* @__PURE__ */ s(
|
|
776
|
-
/* @__PURE__ */ t(
|
|
777
|
-
|
|
776
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
777
|
+
/* @__PURE__ */ t(Ut, {}),
|
|
778
|
+
w && N && /* @__PURE__ */ s(
|
|
778
779
|
"div",
|
|
779
780
|
{
|
|
780
781
|
role: "alert",
|
|
781
782
|
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",
|
|
782
783
|
children: [
|
|
783
784
|
/* @__PURE__ */ s("span", { children: [
|
|
784
|
-
|
|
785
|
+
N,
|
|
785
786
|
d.length > 0 && " Showing the last list that loaded."
|
|
786
787
|
] }),
|
|
787
|
-
|
|
788
|
+
x && /* @__PURE__ */ t(
|
|
788
789
|
"button",
|
|
789
790
|
{
|
|
790
791
|
type: "button",
|
|
791
|
-
onClick:
|
|
792
|
+
onClick: x,
|
|
792
793
|
className: "font-medium underline underline-offset-2 hover:text-red-900 dark:hover:text-red-200",
|
|
793
794
|
children: "Try again"
|
|
794
795
|
}
|
|
@@ -804,30 +805,30 @@ function Ar({
|
|
|
804
805
|
le && "flex h-full min-h-0 flex-col"
|
|
805
806
|
),
|
|
806
807
|
children: [
|
|
807
|
-
|
|
808
|
+
mt && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2 border-b border-slate-100 px-3 py-2.5", children: [
|
|
808
809
|
K !== void 0 && /* @__PURE__ */ s("div", { className: "relative min-w-0 max-w-full", children: [
|
|
809
|
-
/* @__PURE__ */ t(
|
|
810
|
+
/* @__PURE__ */ t(Nt, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
810
811
|
/* @__PURE__ */ t(
|
|
811
|
-
|
|
812
|
+
R,
|
|
812
813
|
{
|
|
813
814
|
className: "h-8 w-56 max-w-full border-slate-200 bg-slate-50 pl-8 text-[13px]",
|
|
814
815
|
placeholder: ae,
|
|
815
|
-
value:
|
|
816
|
+
value: I ?? "",
|
|
816
817
|
onChange: (e) => K(e.target.value)
|
|
817
818
|
}
|
|
818
819
|
)
|
|
819
820
|
] }),
|
|
820
|
-
|
|
821
|
-
|
|
821
|
+
We && (m == null ? void 0 : m.map((e) => /* @__PURE__ */ t(
|
|
822
|
+
lt,
|
|
822
823
|
{
|
|
823
824
|
def: e,
|
|
824
|
-
value:
|
|
825
|
-
onChange: (l) =>
|
|
825
|
+
value: T[e.key] ?? "",
|
|
826
|
+
onChange: (l) => C == null ? void 0 : C(e.key, l)
|
|
826
827
|
},
|
|
827
828
|
e.key
|
|
828
829
|
))),
|
|
829
830
|
/* @__PURE__ */ t("div", { className: "flex-1" }),
|
|
830
|
-
|
|
831
|
+
F
|
|
831
832
|
] }),
|
|
832
833
|
p ? (
|
|
833
834
|
// #3229 — the real header (same labels, h-9) over rows with the real cell padding
|
|
@@ -839,12 +840,12 @@ function Ar({
|
|
|
839
840
|
"data-skeleton": "table",
|
|
840
841
|
"aria-busy": "true",
|
|
841
842
|
className: h(le && "min-h-0 flex-1 overflow-hidden"),
|
|
842
|
-
style:
|
|
843
|
-
children: /* @__PURE__ */ s(
|
|
844
|
-
/* @__PURE__ */ t(
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
843
|
+
style: J ? { minHeight: J } : void 0,
|
|
844
|
+
children: /* @__PURE__ */ s(et, { className: "border-separate border-spacing-0", children: [
|
|
845
|
+
/* @__PURE__ */ t(tt, { children: /* @__PURE__ */ s(Y, { className: "border-b border-slate-200 hover:bg-transparent", children: [
|
|
846
|
+
M && /* @__PURE__ */ t(Z, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
|
|
847
|
+
L.map((e) => /* @__PURE__ */ t(
|
|
848
|
+
Z,
|
|
848
849
|
{
|
|
849
850
|
className: h(
|
|
850
851
|
"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",
|
|
@@ -855,58 +856,62 @@ function Ar({
|
|
|
855
856
|
e.key
|
|
856
857
|
))
|
|
857
858
|
] }) }),
|
|
858
|
-
/* @__PURE__ */ t(
|
|
859
|
-
|
|
859
|
+
/* @__PURE__ */ t(rt, { children: /* @__PURE__ */ t(
|
|
860
|
+
Qt,
|
|
860
861
|
{
|
|
861
|
-
columns:
|
|
862
|
-
rows: Math.min(Math.max(n ??
|
|
862
|
+
columns: L.map((e) => ({ key: e.key })),
|
|
863
|
+
rows: Math.min(Math.max(n ?? ar.length, 1), 15),
|
|
863
864
|
rowClassName: "",
|
|
864
|
-
cellClassName: h("px-3",
|
|
865
|
-
leadingCells:
|
|
865
|
+
cellClassName: h("px-3", ge === "compact" ? "py-1" : "py-2"),
|
|
866
|
+
leadingCells: M ? 1 : 0
|
|
866
867
|
}
|
|
867
868
|
) })
|
|
868
869
|
] })
|
|
869
870
|
}
|
|
870
871
|
)
|
|
871
|
-
) : /* @__PURE__ */ s(
|
|
872
|
+
) : /* @__PURE__ */ s(H, { children: [
|
|
872
873
|
/* @__PURE__ */ t(
|
|
873
874
|
"div",
|
|
874
875
|
{
|
|
875
|
-
ref:
|
|
876
|
+
ref: q,
|
|
877
|
+
"data-stale": g ? "" : void 0,
|
|
878
|
+
"aria-busy": g || void 0,
|
|
876
879
|
className: h(
|
|
877
|
-
|
|
880
|
+
"transition-opacity",
|
|
881
|
+
g && "opacity-60",
|
|
882
|
+
Ae && "overflow-x-hidden [&>div]:overflow-visible",
|
|
878
883
|
// Bounded mode: rows scroll here under a sticky header. Header
|
|
879
884
|
// cells sit above pinned body cells (z-[1/2]); the pinned
|
|
880
885
|
// header corner (left-0) tops the other header cells so
|
|
881
886
|
// horizontal scroll cannot bleed through it.
|
|
882
887
|
le && "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]"
|
|
883
888
|
),
|
|
884
|
-
style:
|
|
889
|
+
style: J ? { minHeight: J } : void 0,
|
|
885
890
|
children: /* @__PURE__ */ s(
|
|
886
|
-
|
|
891
|
+
et,
|
|
887
892
|
{
|
|
888
893
|
"data-copy-cells": "",
|
|
889
894
|
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]",
|
|
890
895
|
children: [
|
|
891
|
-
/* @__PURE__ */ s(
|
|
892
|
-
/* @__PURE__ */ s(
|
|
893
|
-
|
|
894
|
-
|
|
896
|
+
/* @__PURE__ */ s(tt, { children: [
|
|
897
|
+
/* @__PURE__ */ s(Y, { className: "border-b border-slate-200 hover:bg-transparent", children: [
|
|
898
|
+
M && /* @__PURE__ */ t(
|
|
899
|
+
Z,
|
|
895
900
|
{
|
|
896
|
-
ref:
|
|
901
|
+
ref: Re,
|
|
897
902
|
className: h(
|
|
898
903
|
"h-9 w-9 bg-slate-50 px-3 py-0",
|
|
899
|
-
(
|
|
904
|
+
(A || _) && "sticky left-0 z-[2] min-w-[40px]"
|
|
900
905
|
),
|
|
901
906
|
children: /* @__PURE__ */ t(
|
|
902
|
-
|
|
907
|
+
Pe,
|
|
903
908
|
{
|
|
904
909
|
checked: d.length > 0 && d.every((e, l) => {
|
|
905
910
|
const i = o ? o(e, l) : String(l);
|
|
906
|
-
return
|
|
911
|
+
return j == null ? void 0 : j.includes(i);
|
|
907
912
|
}),
|
|
908
913
|
onCheckedChange: (e) => {
|
|
909
|
-
|
|
914
|
+
M(
|
|
910
915
|
e ? d.map((l, i) => o ? o(l, i) : String(i)) : []
|
|
911
916
|
);
|
|
912
917
|
},
|
|
@@ -915,32 +920,32 @@ function Ar({
|
|
|
915
920
|
)
|
|
916
921
|
}
|
|
917
922
|
),
|
|
918
|
-
|
|
919
|
-
|
|
923
|
+
L.map((e, l) => /* @__PURE__ */ t(
|
|
924
|
+
Z,
|
|
920
925
|
{
|
|
921
926
|
ref: (i) => {
|
|
922
|
-
|
|
927
|
+
Le.current[e.key] = i;
|
|
923
928
|
},
|
|
924
929
|
style: se(e.key),
|
|
925
930
|
className: h(
|
|
926
931
|
"group/th group/hcell h-9 whitespace-nowrap bg-slate-50 px-3 py-0 text-[11px] font-medium text-slate-500",
|
|
927
|
-
e.sortable &&
|
|
928
|
-
!_ &&
|
|
932
|
+
e.sortable && k && "cursor-pointer select-none hover:text-slate-600",
|
|
933
|
+
!_ && A && l === 0 && h(
|
|
929
934
|
"sticky z-[2] border-r border-slate-200 dark:border-border",
|
|
930
|
-
|
|
935
|
+
M ? "left-[39px]" : "left-0"
|
|
931
936
|
),
|
|
932
937
|
_ && "bg-slate-50 dark:bg-muted",
|
|
933
|
-
|
|
938
|
+
ze(e.key, !0),
|
|
934
939
|
e.headerClassName
|
|
935
940
|
),
|
|
936
|
-
onClick: () =>
|
|
937
|
-
"aria-sort": e.sortable &&
|
|
938
|
-
tabIndex: e.sortable &&
|
|
939
|
-
onKeyDown: e.sortable &&
|
|
940
|
-
i.target === i.currentTarget && (i.key === "Enter" || i.key === " ") && (i.preventDefault(),
|
|
941
|
+
onClick: () => Be(e),
|
|
942
|
+
"aria-sort": e.sortable && k ? sr(u, e.key) : void 0,
|
|
943
|
+
tabIndex: e.sortable && k && !Ce(e.header) ? 0 : void 0,
|
|
944
|
+
onKeyDown: e.sortable && k && !Ce(e.header) ? (i) => {
|
|
945
|
+
i.target === i.currentTarget && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), Be(e));
|
|
941
946
|
} : void 0,
|
|
942
947
|
children: /* @__PURE__ */ s("span", { className: "inline-flex items-center", children: [
|
|
943
|
-
e.sortable &&
|
|
948
|
+
e.sortable && k && Ce(e.header) ? /* @__PURE__ */ s(
|
|
944
949
|
"button",
|
|
945
950
|
{
|
|
946
951
|
type: "button",
|
|
@@ -948,33 +953,33 @@ function Ar({
|
|
|
948
953
|
"data-dt-sort": e.key,
|
|
949
954
|
children: [
|
|
950
955
|
e.header,
|
|
951
|
-
/* @__PURE__ */ t(
|
|
956
|
+
/* @__PURE__ */ t(at, { field: e.key, sort: u })
|
|
952
957
|
]
|
|
953
958
|
}
|
|
954
|
-
) : /* @__PURE__ */ s(
|
|
959
|
+
) : /* @__PURE__ */ s(H, { children: [
|
|
955
960
|
e.header,
|
|
956
961
|
!pe(e.header).trim() && /* @__PURE__ */ t("span", { className: "sr-only", children: oe(e) }),
|
|
957
|
-
e.sortable &&
|
|
962
|
+
e.sortable && k && /* @__PURE__ */ t(at, { field: e.key, sort: u })
|
|
958
963
|
] }),
|
|
959
|
-
_ &&
|
|
964
|
+
_ && ke && e.key !== "claim" && /* @__PURE__ */ t(
|
|
960
965
|
"button",
|
|
961
966
|
{
|
|
962
967
|
type: "button",
|
|
963
968
|
onClick: (i) => {
|
|
964
|
-
i.stopPropagation(),
|
|
969
|
+
i.stopPropagation(), yt(e.key);
|
|
965
970
|
},
|
|
966
971
|
"aria-label": `Pin column ${oe(e)}`,
|
|
967
|
-
title: (
|
|
972
|
+
title: (v == null ? void 0 : v[e.key]) === "left" ? "Pinned left — click to pin right" : (v == null ? void 0 : v[e.key]) === "right" ? "Pinned right — click to unpin" : "Pin column",
|
|
968
973
|
className: h(
|
|
969
974
|
"ml-1 rounded p-0.5 transition-opacity",
|
|
970
|
-
|
|
975
|
+
v != null && v[e.key] ? "text-nvr-cyan opacity-100" : "text-slate-300 opacity-0 hover:text-slate-500 group-hover/th:opacity-100"
|
|
971
976
|
),
|
|
972
977
|
children: /* @__PURE__ */ t(
|
|
973
|
-
|
|
978
|
+
wt,
|
|
974
979
|
{
|
|
975
980
|
className: h(
|
|
976
981
|
"h-3 w-3",
|
|
977
|
-
(
|
|
982
|
+
(v == null ? void 0 : v[e.key]) === "right" && "rotate-90"
|
|
978
983
|
)
|
|
979
984
|
}
|
|
980
985
|
)
|
|
@@ -986,36 +991,36 @@ function Ar({
|
|
|
986
991
|
e.key
|
|
987
992
|
))
|
|
988
993
|
] }),
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
994
|
+
kt && /* @__PURE__ */ s(Y, { className: "border-b border-slate-200 hover:bg-transparent", children: [
|
|
995
|
+
M && /* @__PURE__ */ t(
|
|
996
|
+
Z,
|
|
992
997
|
{
|
|
993
998
|
className: h(
|
|
994
999
|
"h-9 w-9 bg-slate-50 px-3 py-1",
|
|
995
|
-
(
|
|
1000
|
+
(A || _) && "sticky left-0 z-[2] min-w-[40px]"
|
|
996
1001
|
),
|
|
997
1002
|
children: /* @__PURE__ */ t("span", { className: "sr-only", children: "Filters" })
|
|
998
1003
|
}
|
|
999
1004
|
),
|
|
1000
|
-
|
|
1001
|
-
const l =
|
|
1005
|
+
L.map((e) => {
|
|
1006
|
+
const l = gt.get(e.key);
|
|
1002
1007
|
return /* @__PURE__ */ s(
|
|
1003
|
-
|
|
1008
|
+
Z,
|
|
1004
1009
|
{
|
|
1005
1010
|
style: se(e.key),
|
|
1006
1011
|
className: h(
|
|
1007
1012
|
"h-9 bg-slate-50 px-1.5 py-1 align-middle",
|
|
1008
1013
|
_ && "bg-slate-50 dark:bg-muted",
|
|
1009
|
-
|
|
1014
|
+
ze(e.key, !0)
|
|
1010
1015
|
),
|
|
1011
1016
|
children: [
|
|
1012
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children: l &&
|
|
1013
|
-
l &&
|
|
1014
|
-
|
|
1017
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: l && C ? `Filter ${oe(e)}` : `${oe(e)}: no filter` }),
|
|
1018
|
+
l && C ? /* @__PURE__ */ t(
|
|
1019
|
+
lt,
|
|
1015
1020
|
{
|
|
1016
1021
|
def: l,
|
|
1017
|
-
value:
|
|
1018
|
-
onChange: (i) =>
|
|
1022
|
+
value: T[l.key] ?? "",
|
|
1023
|
+
onChange: (i) => C(l.key, i),
|
|
1019
1024
|
layout: "cell"
|
|
1020
1025
|
}
|
|
1021
1026
|
) : null
|
|
@@ -1026,24 +1031,24 @@ function Ar({
|
|
|
1026
1031
|
})
|
|
1027
1032
|
] })
|
|
1028
1033
|
] }),
|
|
1029
|
-
/* @__PURE__ */ s(
|
|
1030
|
-
|
|
1031
|
-
const l = (
|
|
1032
|
-
return /* @__PURE__ */ s(
|
|
1034
|
+
/* @__PURE__ */ s(rt, { className: "tabular-nums", children: [
|
|
1035
|
+
V ? V.map((e) => {
|
|
1036
|
+
const l = (U == null ? void 0 : U.has(e.key)) ?? !1;
|
|
1037
|
+
return /* @__PURE__ */ s(Et.Fragment, { children: [
|
|
1033
1038
|
/* @__PURE__ */ t(
|
|
1034
|
-
|
|
1039
|
+
Y,
|
|
1035
1040
|
{
|
|
1036
1041
|
"data-group-key": e.key,
|
|
1037
1042
|
className: "nvr-row-enter cursor-pointer border-slate-200 bg-slate-50/80 transition-colors hover:bg-slate-100/80 dark:bg-muted/40",
|
|
1038
|
-
onClick: () =>
|
|
1043
|
+
onClick: () => Oe == null ? void 0 : Oe(e.key),
|
|
1039
1044
|
children: /* @__PURE__ */ t(
|
|
1040
1045
|
ce,
|
|
1041
1046
|
{
|
|
1042
|
-
colSpan: r.length + (
|
|
1047
|
+
colSpan: r.length + (M ? 1 : 0),
|
|
1043
1048
|
className: "px-3 py-1.5",
|
|
1044
1049
|
children: /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-foreground", children: [
|
|
1045
1050
|
/* @__PURE__ */ t(
|
|
1046
|
-
|
|
1051
|
+
_t,
|
|
1047
1052
|
{
|
|
1048
1053
|
className: h(
|
|
1049
1054
|
"h-3.5 w-3.5 text-slate-400 transition-transform duration-200",
|
|
@@ -1057,58 +1062,58 @@ function Ar({
|
|
|
1057
1062
|
)
|
|
1058
1063
|
}
|
|
1059
1064
|
),
|
|
1060
|
-
!l && e.rows.map((i,
|
|
1065
|
+
!l && e.rows.map((i, E) => Ue(i, E))
|
|
1061
1066
|
] }, e.key);
|
|
1062
|
-
}) : d.map((e, l) =>
|
|
1063
|
-
(
|
|
1067
|
+
}) : d.map((e, l) => Ue(e, l)),
|
|
1068
|
+
(V ? V.length === 0 : d.length === 0) && /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(
|
|
1064
1069
|
ce,
|
|
1065
1070
|
{
|
|
1066
|
-
colSpan: r.length + (
|
|
1071
|
+
colSpan: r.length + (M ? 1 : 0),
|
|
1067
1072
|
className: "nvr-fade-in p-0 text-center align-middle text-[13px] text-slate-400",
|
|
1068
|
-
style:
|
|
1073
|
+
style: J ? { height: Math.max(96, J - 56) } : void 0,
|
|
1069
1074
|
children: /* @__PURE__ */ t(
|
|
1070
1075
|
"div",
|
|
1071
1076
|
{
|
|
1072
1077
|
className: "sticky left-0 py-12",
|
|
1073
|
-
style:
|
|
1078
|
+
style: He ? { width: He } : void 0,
|
|
1074
1079
|
"data-table-empty": !0,
|
|
1075
|
-
children: typeof
|
|
1080
|
+
children: typeof ye == "string" ? /* @__PURE__ */ t(Dt, { icon: Ot, title: ye }) : ye
|
|
1076
1081
|
}
|
|
1077
1082
|
)
|
|
1078
1083
|
}
|
|
1079
1084
|
) })
|
|
1080
|
-
] },
|
|
1081
|
-
P && !
|
|
1085
|
+
] }, pt),
|
|
1086
|
+
P && !V && d.length > 0 && // Sticky per cell (not per row): a pinned cell sticks left/right AND bottom.
|
|
1082
1087
|
/* @__PURE__ */ t("tfoot", { className: "text-[12px] tabular-nums", "data-dt-totals": !0, children: /* @__PURE__ */ s("tr", { children: [
|
|
1083
|
-
|
|
1088
|
+
M && /* @__PURE__ */ t(
|
|
1084
1089
|
"td",
|
|
1085
1090
|
{
|
|
1086
1091
|
className: h(
|
|
1087
1092
|
"sticky bottom-0 z-[3] border-t-2 border-slate-200 bg-slate-50 px-3 py-1.5 dark:border-border dark:bg-muted",
|
|
1088
|
-
(
|
|
1093
|
+
(A || _) && "left-0 z-[4]"
|
|
1089
1094
|
)
|
|
1090
1095
|
}
|
|
1091
1096
|
),
|
|
1092
1097
|
(() => {
|
|
1093
|
-
const e =
|
|
1098
|
+
const e = L.findIndex(
|
|
1094
1099
|
(l) => P.cells[l.key] == null
|
|
1095
1100
|
);
|
|
1096
|
-
return
|
|
1097
|
-
var
|
|
1098
|
-
const
|
|
1101
|
+
return L.map((l, i) => {
|
|
1102
|
+
var $, y;
|
|
1103
|
+
const E = _ && !!ee[l.key], W = P.cells[l.key];
|
|
1099
1104
|
return /* @__PURE__ */ t(
|
|
1100
1105
|
"td",
|
|
1101
1106
|
{
|
|
1102
1107
|
style: se(l.key),
|
|
1103
|
-
"data-dt-total-cell":
|
|
1108
|
+
"data-dt-total-cell": W != null ? l.key : void 0,
|
|
1104
1109
|
className: h(
|
|
1105
1110
|
"sticky bottom-0 z-[3] whitespace-nowrap border-t-2 border-slate-200 bg-slate-50 px-3 py-1.5 font-medium dark:border-border dark:bg-muted",
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
!_ &&
|
|
1109
|
-
!_ &&
|
|
1111
|
+
E && "z-[4]",
|
|
1112
|
+
E && (($ = ee[l.key]) == null ? void 0 : $.seam) && (((y = ee[l.key]) == null ? void 0 : y.side) === "left" ? "border-r" : "border-l"),
|
|
1113
|
+
!_ && A && i === 0 && "z-[4]",
|
|
1114
|
+
!_ && A && i === 0 && (M ? "left-[39px]" : "left-0")
|
|
1110
1115
|
),
|
|
1111
|
-
children:
|
|
1116
|
+
children: W ?? (i === e && P.label != null ? P.label : null)
|
|
1112
1117
|
},
|
|
1113
1118
|
l.key
|
|
1114
1119
|
);
|
|
@@ -1120,40 +1125,40 @@ function Ar({
|
|
|
1120
1125
|
)
|
|
1121
1126
|
}
|
|
1122
1127
|
),
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
!
|
|
1128
|
+
Ae && /* @__PURE__ */ t(Jt, { scrollerRef: q }),
|
|
1129
|
+
it,
|
|
1130
|
+
!V && c > n && /* @__PURE__ */ s(
|
|
1126
1131
|
"div",
|
|
1127
1132
|
{
|
|
1128
1133
|
className: "flex items-center justify-between border-t border-slate-100 py-1.5 pl-2 dark:border-border md:py-2.5 md:pl-4",
|
|
1129
1134
|
style: { paddingRight: "calc(0.5rem + var(--nvr-corner-float, 0px))" },
|
|
1130
1135
|
children: [
|
|
1131
1136
|
/* @__PURE__ */ t(
|
|
1132
|
-
|
|
1137
|
+
Xt,
|
|
1133
1138
|
{
|
|
1134
1139
|
className: "w-full",
|
|
1135
|
-
range: /* @__PURE__ */ s(
|
|
1140
|
+
range: /* @__PURE__ */ s(H, { children: [
|
|
1136
1141
|
/* @__PURE__ */ s("span", { className: "font-semibold text-slate-700 dark:text-slate-200", children: [
|
|
1137
|
-
|
|
1142
|
+
Q(je),
|
|
1138
1143
|
"–",
|
|
1139
|
-
|
|
1144
|
+
Q(Ve)
|
|
1140
1145
|
] }),
|
|
1141
1146
|
" ",
|
|
1142
1147
|
"of ",
|
|
1143
|
-
|
|
1148
|
+
Q(c)
|
|
1144
1149
|
] }),
|
|
1145
1150
|
prevDisabled: b <= 1,
|
|
1146
1151
|
nextDisabled: b >= G,
|
|
1147
|
-
onPrev: () =>
|
|
1148
|
-
onNext: () =>
|
|
1152
|
+
onPrev: () => a(b - 1),
|
|
1153
|
+
onNext: () => a(b + 1)
|
|
1149
1154
|
}
|
|
1150
1155
|
),
|
|
1151
1156
|
/* @__PURE__ */ s("p", { className: "hidden text-[12px] text-slate-400 md:block", children: [
|
|
1152
|
-
|
|
1157
|
+
Q(je),
|
|
1153
1158
|
"–",
|
|
1154
|
-
|
|
1159
|
+
Q(Ve),
|
|
1155
1160
|
" of ",
|
|
1156
|
-
|
|
1161
|
+
Q(c),
|
|
1157
1162
|
" records"
|
|
1158
1163
|
] }),
|
|
1159
1164
|
/* @__PURE__ */ s("div", { className: "hidden items-center gap-1 md:flex", children: [
|
|
@@ -1164,7 +1169,7 @@ function Ar({
|
|
|
1164
1169
|
size: "sm",
|
|
1165
1170
|
className: "h-7 px-2 text-[12px] text-slate-600",
|
|
1166
1171
|
disabled: b <= 1,
|
|
1167
|
-
onClick: () =>
|
|
1172
|
+
onClick: () => a(1),
|
|
1168
1173
|
"aria-label": "First page",
|
|
1169
1174
|
"data-tip": "First page",
|
|
1170
1175
|
children: "«"
|
|
@@ -1177,7 +1182,7 @@ function Ar({
|
|
|
1177
1182
|
size: "sm",
|
|
1178
1183
|
className: "h-7 px-2.5 text-[12px] text-slate-600",
|
|
1179
1184
|
disabled: b <= 1,
|
|
1180
|
-
onClick: () =>
|
|
1185
|
+
onClick: () => a(b - 1),
|
|
1181
1186
|
children: "← Prev"
|
|
1182
1187
|
}
|
|
1183
1188
|
),
|
|
@@ -1193,7 +1198,7 @@ function Ar({
|
|
|
1193
1198
|
size: "sm",
|
|
1194
1199
|
className: "h-7 px-2.5 text-[12px] text-slate-600",
|
|
1195
1200
|
disabled: b >= G,
|
|
1196
|
-
onClick: () =>
|
|
1201
|
+
onClick: () => a(b + 1),
|
|
1197
1202
|
children: "Next →"
|
|
1198
1203
|
}
|
|
1199
1204
|
),
|
|
@@ -1204,7 +1209,7 @@ function Ar({
|
|
|
1204
1209
|
size: "sm",
|
|
1205
1210
|
className: "h-7 px-2 text-[12px] text-slate-600",
|
|
1206
1211
|
disabled: b >= G,
|
|
1207
|
-
onClick: () =>
|
|
1212
|
+
onClick: () => a(G),
|
|
1208
1213
|
"aria-label": "Last page",
|
|
1209
1214
|
"data-tip": "Last page",
|
|
1210
1215
|
children: "»"
|
|
@@ -1221,11 +1226,11 @@ function Ar({
|
|
|
1221
1226
|
] });
|
|
1222
1227
|
}
|
|
1223
1228
|
export {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1229
|
+
jr as DataTable,
|
|
1230
|
+
lt as FilterControl,
|
|
1231
|
+
sr as ariaSortFor,
|
|
1232
|
+
nr as containsFilter,
|
|
1233
|
+
nt as filterDefLabel,
|
|
1234
|
+
Ar as filterValueDisplay,
|
|
1230
1235
|
oe as pinColumnName
|
|
1231
1236
|
};
|