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