@nivaro/react 0.3.49 → 0.3.51
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/InlineGridField.js +166 -105
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/shared/components/ItemEditForm.js +5258 -5034
- package/dist/shared/components/QueryTable.js +489 -347
- package/dist/shared/components/ReportView.js +105 -99
- package/dist/shared/components/alerts/AlertManagerView.js +327 -301
- package/dist/shared/components/item-edit/CatalogPickerField.js +1230 -1175
- package/dist/shared/components/item-edit/CloneDialog.js +192 -142
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
- package/dist/shared/components/item-edit/FieldRenderer.js +249 -244
- package/dist/shared/components/item-edit/FieldRow.js +402 -370
- package/dist/shared/components/item-edit/FilePickerField.js +315 -307
- package/dist/shared/components/item-edit/InlineGridField.js +92 -90
- package/dist/shared/components/item-edit/InlineTableField.js +3119 -2951
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
- package/dist/shared/components/item-edit/PlanGrid.js +162 -162
- package/dist/shared/components/item-edit/PolishFields.js +169 -162
- package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
- package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
- package/dist/shared/components/item-edit/RelationCombobox.js +198 -191
- package/dist/shared/components/item-edit/SummaryPanel.js +282 -259
- package/dist/shared/components/item-edit/UserChip.js +233 -200
- package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
- package/dist/shared/components/item-edit/header-midair.js +51 -0
- package/dist/shared/components/item-edit/helpers.js +181 -155
- package/dist/shared/components/item-edit/line-midair.js +207 -0
- package/dist/shared/components/item-edit/soft-rules.js +27 -0
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/panels/CommentPanel.js +290 -284
- package/dist/shared/components/panels/ItemLockBanner.js +414 -358
- package/dist/shared/components/panels/PipelinePanel.js +1241 -992
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/panels/TaskPanel.js +71 -61
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
- package/dist/shared/components/panels/requirement-side-effects.js +40 -0
- package/dist/shared/components/queue/QueueWorklist.js +925 -871
- package/dist/shared/components/queue/column-chooser.js +21 -0
- package/dist/shared/components/queue/live-state-aspect.js +6 -0
- package/dist/shared/components/ui/number-draft-input.js +93 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
- package/dist/shared/lib/draft-store.js +48 -34
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/query-stats.js +60 -60
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as He } from "react/jsx-runtime";
|
|
2
2
|
import { saveReportFilterPreset as Kt, listReportFilterPresets as ua, deleteReportFilterPreset as pa, readReport as ha, executeCustomQuery as fa, readItems as xa, readReportFilterOptions as ba, aiReportFilters as ga, readReportWidgetData as kt, listReportAlerts as va, createReportAlert as ya, toggleReportAlert as ka, deleteReportAlert as Na, readReportAlertLog as wa, resolveReportAlert as Sa } from "@nivaro/sdk";
|
|
3
3
|
import { useQuery as Ne, useQueryClient as Ct, useMutation as Me, isCancelledError as _a } from "@tanstack/react-query";
|
|
4
|
-
import { X as Ae, Check as Ut, Plus as
|
|
4
|
+
import { X as Ae, Check as Ut, Plus as Yt, Camera as wt, Bell as Vt, RefreshCw as Ft, ChevronsUpDown as Jt, Sparkles as Dt, Info as Ca, Table as $a, Sigma as qa, StickyNote as Ma, Download as Fa, TrendingUp as Gt, TrendingDown as Ht, Trash2 as Aa } from "lucide-react";
|
|
5
5
|
import { useState as C, useEffect as mt, useCallback as At, useRef as St, useMemo as ut, Suspense as qt, lazy as Rt, memo as Ta } from "react";
|
|
6
6
|
import { toast as Xt } from "sonner";
|
|
7
7
|
import { useNivaroClient as Ke, useDrilldown as Zt, useOverlayState as La } from "../context.js";
|
|
@@ -17,7 +17,7 @@ import { RechartsGate as Re } from "./charts/RechartsGate.js";
|
|
|
17
17
|
import { LoadErrorNote as ta } from "./LoadErrorNote.js";
|
|
18
18
|
import { RecordDrilldownSheet as Ba } from "./RecordDrilldownSheet.js";
|
|
19
19
|
import { TipLayer as Qa } from "./TipLayer.js";
|
|
20
|
-
import { Command as Ua, CommandInput as
|
|
20
|
+
import { Command as Ua, CommandInput as Ya, CommandList as Va, CommandEmpty as Ja, CommandItem as Ga } from "./ui/command.js";
|
|
21
21
|
import { Popover as aa, PopoverTrigger as la, PopoverContent as ra } from "./ui/popover.js";
|
|
22
22
|
import { SimpleSelect as Nt } from "./ui/SimpleSelect.js";
|
|
23
23
|
import { Skeleton as Oe } from "./ui/skeleton.js";
|
|
@@ -64,8 +64,12 @@ const Ce = (t) => Math.abs(t) >= 1e9 ? `${(t / 1e9).toFixed(1).replace(/\.0$/, "
|
|
|
64
64
|
}, _t = (t) => ({
|
|
65
65
|
interval: t > 12 ? Math.ceil(t / 12) - 1 : 0,
|
|
66
66
|
tickFormatter: Za,
|
|
67
|
-
minTickGap: 4
|
|
68
|
-
|
|
67
|
+
minTickGap: 4,
|
|
68
|
+
...t > 5 && t <= 12 ? { angle: -35, textAnchor: "end", height: 56 } : {}
|
|
69
|
+
}), Ia = (t) => {
|
|
70
|
+
const n = String(t ?? "");
|
|
71
|
+
return n.length > 22 ? `${n.slice(0, 21)}…` : n;
|
|
72
|
+
}, Ot = () => import("./ReportEditMode.js"), el = Rt(() => Ot().then((t) => ({ default: t.AddWidgetBar }))), tl = Rt(() => Ot().then((t) => ({ default: t.WidgetConfigSheet }))), al = Rt(() => Ot().then((t) => ({ default: t.WidgetEditBar }))), Ge = "rgb(var(--nvr-cyan-rgb, 0 206 255))", oe = [Ge, "#172940", "#10b981", "#f59e0b", "#8b5cf6", "#ef4444", "#64748b"], ll = [
|
|
69
73
|
{ id: "", label: "All time" },
|
|
70
74
|
{ id: "this_month", label: "This month" },
|
|
71
75
|
{ id: "last_30_days", label: "Last 30 days" },
|
|
@@ -150,8 +154,8 @@ function na({
|
|
|
150
154
|
}
|
|
151
155
|
) }),
|
|
152
156
|
/* @__PURE__ */ e(ra, { className: "w-[240px] p-0", align: "start", children: /* @__PURE__ */ i(Ua, { children: [
|
|
153
|
-
/* @__PURE__ */ e(
|
|
154
|
-
/* @__PURE__ */ i(
|
|
157
|
+
/* @__PURE__ */ e(Ya, { placeholder: `Filter ${a}…`, className: "h-8 text-[12.5px]" }),
|
|
158
|
+
/* @__PURE__ */ i(Va, { className: "max-h-52", children: [
|
|
155
159
|
/* @__PURE__ */ e(Ja, { children: "No values." }),
|
|
156
160
|
w.map((u) => {
|
|
157
161
|
const N = c.some((U) => String(U) === u.value);
|
|
@@ -248,12 +252,12 @@ function ia(t, n, a) {
|
|
|
248
252
|
}
|
|
249
253
|
return o;
|
|
250
254
|
}
|
|
251
|
-
const
|
|
255
|
+
const rl = (t) => `$${Ce(Math.round(t))}`, nl = [
|
|
252
256
|
{ gte: 90, color: "#ef4444" },
|
|
253
257
|
{ gte: 70, color: "#f59e0b" },
|
|
254
258
|
{ gte: -1 / 0, color: "#10b981" }
|
|
255
259
|
];
|
|
256
|
-
function
|
|
260
|
+
function sl({
|
|
257
261
|
rows: t,
|
|
258
262
|
cfg: n,
|
|
259
263
|
onDrill: a
|
|
@@ -278,7 +282,7 @@ function nl({
|
|
|
278
282
|
};
|
|
279
283
|
N(m), f(u), L(!0);
|
|
280
284
|
}, [m, p]);
|
|
281
|
-
const q = (o == null ? void 0 : o.thresholds) ??
|
|
285
|
+
const q = (o == null ? void 0 : o.thresholds) ?? nl, w = (u) => {
|
|
282
286
|
var N;
|
|
283
287
|
return u == null ? void 0 : ((N = q.find((U) => u >= U.gte)) == null ? void 0 : N.color) ?? "#10b981";
|
|
284
288
|
}, E = (u) => {
|
|
@@ -362,7 +366,7 @@ function nl({
|
|
|
362
366
|
/* @__PURE__ */ e("div", { className: "ml-[18px] mt-0.5 flex flex-wrap gap-x-3 text-[10px] tabular-nums text-slate-400", children: c.map((H) => /* @__PURE__ */ i("span", { children: [
|
|
363
367
|
H.label ?? H.field,
|
|
364
368
|
" ",
|
|
365
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-slate-500 dark:text-slate-300", children: u.sums[H.field] == null ? H.empty_label ?? "—" : n.value_format === "currency" ?
|
|
369
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-slate-500 dark:text-slate-300", children: u.sums[H.field] == null ? H.empty_label ?? "—" : n.value_format === "currency" ? rl(u.sums[H.field]) : u.sums[H.field].toLocaleString() })
|
|
366
370
|
] }, H.field)) })
|
|
367
371
|
]
|
|
368
372
|
}
|
|
@@ -372,7 +376,7 @@ function nl({
|
|
|
372
376
|
};
|
|
373
377
|
return !o || m.length === 0 ? /* @__PURE__ */ e("p", { className: "px-1 text-[12px] text-slate-400", children: "No data." }) : /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 space-y-0.5 overflow-y-auto pr-1", children: m.map(E) });
|
|
374
378
|
}
|
|
375
|
-
function
|
|
379
|
+
function il(t) {
|
|
376
380
|
const [n, a] = C(() => typeof IntersectionObserver > "u");
|
|
377
381
|
return mt(() => {
|
|
378
382
|
if (n) return;
|
|
@@ -394,7 +398,7 @@ function sl(t) {
|
|
|
394
398
|
};
|
|
395
399
|
}, [n, t]), n;
|
|
396
400
|
}
|
|
397
|
-
function
|
|
401
|
+
function ol(t) {
|
|
398
402
|
const n = Ke(), a = St(!1);
|
|
399
403
|
return async (o) => {
|
|
400
404
|
if (!(!t || a.current)) {
|
|
@@ -438,7 +442,7 @@ function da(t, n, a, o) {
|
|
|
438
442
|
const c = fa(n, a);
|
|
439
443
|
return t.request(o ? { ...c, _signal: o } : c).then((m) => m.data ?? []);
|
|
440
444
|
}
|
|
441
|
-
function
|
|
445
|
+
function dl({
|
|
442
446
|
cfg: t,
|
|
443
447
|
dateRange: n,
|
|
444
448
|
entityFilters: a,
|
|
@@ -448,7 +452,7 @@ function ol({
|
|
|
448
452
|
deferred: h = !1
|
|
449
453
|
}) {
|
|
450
454
|
var le, ae;
|
|
451
|
-
const f = Ke(), p =
|
|
455
|
+
const f = Ke(), p = ol(m), [L, q] = C(""), [w, E] = C(0), [u, N] = C(null), U = ia(t, n, a), { data: O, isLoading: ee, error: H, isFetching: ue, refetch: pe } = Ne({
|
|
452
456
|
queryKey: ["nivaro-report-query", t.slug, U],
|
|
453
457
|
queryFn: ({ signal: S }) => da(f, t.slug, U, S),
|
|
454
458
|
enabled: !h,
|
|
@@ -492,18 +496,18 @@ function ol({
|
|
|
492
496
|
const de = t.columns && t.columns.length > 0 ? t.columns : Object.keys(X[0] ?? {}).map((S) => ({ field: S }));
|
|
493
497
|
if (t.display === "kpis") {
|
|
494
498
|
const S = t.x_field ? X.map((T, P) => {
|
|
495
|
-
var
|
|
499
|
+
var V, ne, ce, fe, _;
|
|
496
500
|
return {
|
|
497
501
|
label: String(T[t.x_field] ?? ""),
|
|
498
|
-
value: T[((ne = (
|
|
502
|
+
value: T[((ne = (V = t.series) == null ? void 0 : V[0]) == null ? void 0 : ne.field) ?? ((ce = de.find((D) => D.field !== t.x_field)) == null ? void 0 : ce.field) ?? ""],
|
|
499
503
|
color: ((_ = (fe = t.series) == null ? void 0 : fe[0]) == null ? void 0 : _.color) ?? oe[P % oe.length],
|
|
500
504
|
format: t.value_format
|
|
501
505
|
};
|
|
502
506
|
}) : de.map((T, P) => {
|
|
503
|
-
var
|
|
507
|
+
var V;
|
|
504
508
|
return {
|
|
505
509
|
label: T.label ?? T.field,
|
|
506
|
-
value: (
|
|
510
|
+
value: (V = X[0]) == null ? void 0 : V[T.field],
|
|
507
511
|
color: oe[P % oe.length],
|
|
508
512
|
format: T.format ?? t.value_format
|
|
509
513
|
};
|
|
@@ -529,15 +533,15 @@ function ol({
|
|
|
529
533
|
);
|
|
530
534
|
}
|
|
531
535
|
if (t.display === "tree")
|
|
532
|
-
return /* @__PURE__ */ e(
|
|
536
|
+
return /* @__PURE__ */ e(sl, { rows: X, cfg: t, onDrill: (S) => m == null ? void 0 : m(S) });
|
|
533
537
|
if (t.display === "table") {
|
|
534
538
|
const S = de.filter((_) => ze.has(_.format ?? "")), T = L.trim().toLowerCase(), P = T ? X.filter(
|
|
535
539
|
(_) => Object.values(_).some(
|
|
536
540
|
(D) => String(D ?? "").toLowerCase().includes(T)
|
|
537
541
|
)
|
|
538
|
-
) : X,
|
|
542
|
+
) : X, V = 12, ne = Math.max(1, Math.ceil(P.length / V)), ce = Math.min(w, ne - 1), fe = P.length > V ? P.slice(ce * V, ce * V + V) : P;
|
|
539
543
|
return /* @__PURE__ */ i("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
540
|
-
X.length >
|
|
544
|
+
X.length > V && /* @__PURE__ */ i("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
541
545
|
/* @__PURE__ */ e(
|
|
542
546
|
"input",
|
|
543
547
|
{
|
|
@@ -636,7 +640,7 @@ function ol({
|
|
|
636
640
|
if (!m) return;
|
|
637
641
|
const T = (O ?? []).filter((P) => String(P[xe] ?? "") === S);
|
|
638
642
|
T.length > 0 && N({ label: S, rows: T });
|
|
639
|
-
},
|
|
643
|
+
}, Y = u ? /* @__PURE__ */ e(
|
|
640
644
|
"div",
|
|
641
645
|
{
|
|
642
646
|
className: "fixed inset-0 z-[126] flex items-center justify-center bg-black/30 p-6",
|
|
@@ -697,10 +701,10 @@ function ol({
|
|
|
697
701
|
}
|
|
698
702
|
) : null;
|
|
699
703
|
if (t.display === "donut") {
|
|
700
|
-
const S = ((ae = be[0]) == null ? void 0 : ae.field) ?? "", T = ge.map((
|
|
704
|
+
const S = ((ae = be[0]) == null ? void 0 : ae.field) ?? "", T = ge.map((V) => ({ dim: String(V[xe]), value: Number(V[S]) || 0 })), P = T.reduce((V, ne) => V + ne.value, 0);
|
|
701
705
|
return /* @__PURE__ */ i("div", { className: "flex min-h-0 flex-1 items-stretch gap-3", children: [
|
|
702
706
|
/* @__PURE__ */ i("div", { className: "relative min-h-[110px] min-w-0 flex-1", children: [
|
|
703
|
-
/* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e(Oe, { className: "h-full w-full", "aria-busy": "true" }), children: ({ Cell:
|
|
707
|
+
/* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e(Oe, { className: "h-full w-full", "aria-busy": "true" }), children: ({ Cell: V, Pie: ne, PieChart: ce, ResponsiveContainer: fe, Tooltip: _ }) => /* @__PURE__ */ e(fe, { width: "100%", height: "100%", children: /* @__PURE__ */ i(ce, { children: [
|
|
704
708
|
/* @__PURE__ */ e(
|
|
705
709
|
ne,
|
|
706
710
|
{
|
|
@@ -717,7 +721,7 @@ function ol({
|
|
|
717
721
|
const me = (ve = D == null ? void 0 : D.payload) == null ? void 0 : ve.dim;
|
|
718
722
|
me && te(String(me));
|
|
719
723
|
},
|
|
720
|
-
children: T.map((D, me) => /* @__PURE__ */ e(
|
|
724
|
+
children: T.map((D, me) => /* @__PURE__ */ e(V, { fill: oe[me % oe.length] }, D.dim))
|
|
721
725
|
}
|
|
722
726
|
),
|
|
723
727
|
/* @__PURE__ */ e(
|
|
@@ -741,7 +745,7 @@ function ol({
|
|
|
741
745
|
/* @__PURE__ */ e("span", { className: "text-[9.5px] text-slate-400", children: "total" })
|
|
742
746
|
] })
|
|
743
747
|
] }),
|
|
744
|
-
/* @__PURE__ */ e("div", { className: "max-h-full w-[40%] shrink-0 space-y-0.5 self-center overflow-y-auto pr-1", children: T.slice(0, 12).map((
|
|
748
|
+
/* @__PURE__ */ e("div", { className: "max-h-full w-[40%] shrink-0 space-y-0.5 self-center overflow-y-auto pr-1", children: T.slice(0, 12).map((V, ne) => /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 text-[10.5px]", children: [
|
|
745
749
|
/* @__PURE__ */ e(
|
|
746
750
|
"span",
|
|
747
751
|
{
|
|
@@ -749,15 +753,15 @@ function ol({
|
|
|
749
753
|
style: { background: oe[ne % oe.length] }
|
|
750
754
|
}
|
|
751
755
|
),
|
|
752
|
-
/* @__PURE__ */ e("span", { className: "truncate text-slate-600 dark:text-slate-300", children:
|
|
753
|
-
/* @__PURE__ */ e("span", { className: "ml-auto tabular-nums text-slate-400", children: x(
|
|
754
|
-
] },
|
|
755
|
-
|
|
756
|
+
/* @__PURE__ */ e("span", { className: "truncate text-slate-600 dark:text-slate-300", children: V.dim }),
|
|
757
|
+
/* @__PURE__ */ e("span", { className: "ml-auto tabular-nums text-slate-400", children: x(V.value) })
|
|
758
|
+
] }, V.dim)) }),
|
|
759
|
+
Y
|
|
756
760
|
] });
|
|
757
761
|
}
|
|
758
762
|
if (t.display === "line" || t.display === "area")
|
|
759
763
|
return /* @__PURE__ */ i("div", { className: "min-h-[110px] min-w-0 flex-1", children: [
|
|
760
|
-
/* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e(Oe, { className: "h-full w-full", "aria-busy": "true" }), children: ({ Area: S, AreaChart: T, Legend: P, ResponsiveContainer:
|
|
764
|
+
/* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e(Oe, { className: "h-full w-full", "aria-busy": "true" }), children: ({ Area: S, AreaChart: T, Legend: P, ResponsiveContainer: V, Tooltip: ne, XAxis: ce, YAxis: fe }) => /* @__PURE__ */ e(V, { width: "100%", height: "100%", children: /* @__PURE__ */ i(T, { data: ge, margin: { top: 6, right: 8, left: -6, bottom: 0 }, children: [
|
|
761
765
|
/* @__PURE__ */ e(
|
|
762
766
|
ce,
|
|
763
767
|
{
|
|
@@ -799,11 +803,11 @@ function ol({
|
|
|
799
803
|
_.field
|
|
800
804
|
))
|
|
801
805
|
] }) }) }),
|
|
802
|
-
|
|
806
|
+
Y
|
|
803
807
|
] });
|
|
804
808
|
const he = t.display === "stacked_bar";
|
|
805
809
|
return /* @__PURE__ */ i("div", { className: "min-h-[110px] min-w-0 flex-1", children: [
|
|
806
|
-
/* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e(Oe, { className: "h-full w-full", "aria-busy": "true" }), children: ({ Bar: S, BarChart: T, Cell: P, Legend:
|
|
810
|
+
/* @__PURE__ */ e(Re, { fallback: /* @__PURE__ */ e(Oe, { className: "h-full w-full", "aria-busy": "true" }), children: ({ Bar: S, BarChart: T, Cell: P, Legend: V, ResponsiveContainer: ne, Tooltip: ce, XAxis: fe, YAxis: _ }) => /* @__PURE__ */ e(ne, { width: "100%", height: "100%", children: /* @__PURE__ */ i(
|
|
807
811
|
T,
|
|
808
812
|
{
|
|
809
813
|
data: ge,
|
|
@@ -857,7 +861,7 @@ function ol({
|
|
|
857
861
|
formatter: (D) => x(D)
|
|
858
862
|
}
|
|
859
863
|
),
|
|
860
|
-
be.length > 1 && /* @__PURE__ */ e(
|
|
864
|
+
be.length > 1 && /* @__PURE__ */ e(V, { wrapperStyle: { fontSize: 11 } }),
|
|
861
865
|
be.map((D, me) => /* @__PURE__ */ e(
|
|
862
866
|
S,
|
|
863
867
|
{
|
|
@@ -879,11 +883,11 @@ function ol({
|
|
|
879
883
|
]
|
|
880
884
|
}
|
|
881
885
|
) }) }),
|
|
882
|
-
|
|
886
|
+
Y
|
|
883
887
|
] });
|
|
884
888
|
}
|
|
885
|
-
const
|
|
886
|
-
function
|
|
889
|
+
const cl = ["gt", "gte", "lt", "lte", "eq"], ca = { gt: ">", gte: "≥", lt: "<", lte: "≤", eq: "=" }, ml = ["sum", "avg", "max", "min"];
|
|
890
|
+
function ul(t) {
|
|
887
891
|
var o, c, m;
|
|
888
892
|
const n = [
|
|
889
893
|
{ value: "value", label: "Value (widget metric)" },
|
|
@@ -916,7 +920,7 @@ function jt(t, n) {
|
|
|
916
920
|
const a = /^(sum|avg|max|min|tile):(.+)$/.exec(t.field), o = a ? a[2] : t.field, c = ((h = n.find((f) => f.value === t.field || f.value === o)) == null ? void 0 : h.label) ?? o;
|
|
917
921
|
return `${a && a[1] !== "sum" && a[1] !== "tile" ? `${a[1]} ` : ""}${c} ${ca[t.op] ?? t.op} ${t.value.toLocaleString()}`;
|
|
918
922
|
}
|
|
919
|
-
function
|
|
923
|
+
function pl({ reportId: t, alert: n }) {
|
|
920
924
|
const a = Ke(), o = Ct(), { data: c = [] } = Ne({
|
|
921
925
|
queryKey: ["nivaro-report-alert-log", t, n.id],
|
|
922
926
|
queryFn: () => a.request(wa(t, n.id)).then((h) => h.data),
|
|
@@ -953,20 +957,20 @@ function ul({ reportId: t, alert: n }) {
|
|
|
953
957
|
)
|
|
954
958
|
] }, h.id)) });
|
|
955
959
|
}
|
|
956
|
-
function
|
|
960
|
+
function hl({
|
|
957
961
|
reportId: t,
|
|
958
962
|
widget: n,
|
|
959
963
|
filterBar: a
|
|
960
964
|
}) {
|
|
961
965
|
const o = Ke(), c = Ct(), [m, h] = C(!1), [f, p] = C(""), [L, q] = C([
|
|
962
966
|
{ field: "value", agg: "sum", op: "gt", value: "" }
|
|
963
|
-
]), [w, E] = C([]), [u, N] = C(!1), [U, O] = C(null), ee =
|
|
967
|
+
]), [w, E] = C([]), [u, N] = C(!1), [U, O] = C(null), ee = ul(n), { data: H = [] } = Ne({
|
|
964
968
|
queryKey: ["nivaro-report-alerts", t],
|
|
965
969
|
queryFn: () => o.request(va(t)).then((x) => x.data),
|
|
966
970
|
enabled: m,
|
|
967
971
|
staleTime: 3e4
|
|
968
972
|
}), ue = H.filter((x) => x.widget === n.id), pe = () => void c.invalidateQueries({ queryKey: ["nivaro-report-alerts", t] }), X = () => L.filter((x) => x.value.trim() !== "" && !Number.isNaN(Number(x.value))).map((x) => {
|
|
969
|
-
const Z = ee.find((
|
|
973
|
+
const Z = ee.find((Y) => Y.value === x.field);
|
|
970
974
|
return { field: Z != null && Z.aggregatable && x.agg !== "sum" ? `${x.agg}:${x.field}` : x.field, op: x.op, value: Number(x.value) };
|
|
971
975
|
}), de = Me({
|
|
972
976
|
mutationFn: () => {
|
|
@@ -1002,7 +1006,7 @@ function pl({
|
|
|
1002
1006
|
"rounded p-0.5",
|
|
1003
1007
|
$e ? "text-amber-500" : "text-slate-300 hover:text-amber-500 dark:text-slate-600"
|
|
1004
1008
|
),
|
|
1005
|
-
children: /* @__PURE__ */ e(
|
|
1009
|
+
children: /* @__PURE__ */ e(Vt, { className: "h-3 w-3" })
|
|
1006
1010
|
}
|
|
1007
1011
|
) }),
|
|
1008
1012
|
/* @__PURE__ */ i(ra, { className: "w-[380px] p-3", align: "end", children: [
|
|
@@ -1062,7 +1066,7 @@ function pl({
|
|
|
1062
1066
|
" · Last fired: ",
|
|
1063
1067
|
x.last_fired ? new Date(x.last_fired).toLocaleString() : "Never"
|
|
1064
1068
|
] }),
|
|
1065
|
-
U === x.id && /* @__PURE__ */ e(
|
|
1069
|
+
U === x.id && /* @__PURE__ */ e(pl, { reportId: t, alert: x })
|
|
1066
1070
|
]
|
|
1067
1071
|
},
|
|
1068
1072
|
x.id
|
|
@@ -1078,14 +1082,14 @@ function pl({
|
|
|
1078
1082
|
}
|
|
1079
1083
|
),
|
|
1080
1084
|
L.map((x, Z) => {
|
|
1081
|
-
const te = ee.find((
|
|
1085
|
+
const te = ee.find((Y) => Y.value === x.field);
|
|
1082
1086
|
return /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
1083
1087
|
/* @__PURE__ */ e(
|
|
1084
1088
|
Nt,
|
|
1085
1089
|
{
|
|
1086
1090
|
value: x.field,
|
|
1087
|
-
onChange: (
|
|
1088
|
-
options: ee.map((
|
|
1091
|
+
onChange: (Y) => q((he) => he.map((le, ae) => ae === Z ? { ...le, field: Y } : le)),
|
|
1092
|
+
options: ee.map((Y) => ({ value: Y.value, label: Y.label })),
|
|
1089
1093
|
ariaLabel: "Alert metric field",
|
|
1090
1094
|
className: "h-7 min-w-0 flex-1 rounded-md px-1.5 py-0 text-[11.5px] dark:border-border dark:bg-card"
|
|
1091
1095
|
}
|
|
@@ -1094,10 +1098,10 @@ function pl({
|
|
|
1094
1098
|
Nt,
|
|
1095
1099
|
{
|
|
1096
1100
|
value: x.agg,
|
|
1097
|
-
onChange: (
|
|
1098
|
-
(he) => he.map((le, ae) => ae === Z ? { ...le, agg:
|
|
1101
|
+
onChange: (Y) => q(
|
|
1102
|
+
(he) => he.map((le, ae) => ae === Z ? { ...le, agg: Y } : le)
|
|
1099
1103
|
),
|
|
1100
|
-
options:
|
|
1104
|
+
options: ml.map((Y) => ({ value: Y, label: Y })),
|
|
1101
1105
|
ariaLabel: "Aggregate",
|
|
1102
1106
|
className: "h-7 w-[62px] rounded-md px-1.5 py-0 text-[11.5px] dark:border-border dark:bg-card"
|
|
1103
1107
|
}
|
|
@@ -1106,10 +1110,10 @@ function pl({
|
|
|
1106
1110
|
Nt,
|
|
1107
1111
|
{
|
|
1108
1112
|
value: x.op,
|
|
1109
|
-
onChange: (
|
|
1110
|
-
(he) => he.map((le, ae) => ae === Z ? { ...le, op:
|
|
1113
|
+
onChange: (Y) => q(
|
|
1114
|
+
(he) => he.map((le, ae) => ae === Z ? { ...le, op: Y } : le)
|
|
1111
1115
|
),
|
|
1112
|
-
options:
|
|
1116
|
+
options: cl.map((Y) => ({ value: Y, label: ca[Y] })),
|
|
1113
1117
|
ariaLabel: "Operator",
|
|
1114
1118
|
className: "h-7 w-[52px] rounded-md px-1.5 py-0 text-[11.5px] dark:border-border dark:bg-card"
|
|
1115
1119
|
}
|
|
@@ -1118,8 +1122,8 @@ function pl({
|
|
|
1118
1122
|
"input",
|
|
1119
1123
|
{
|
|
1120
1124
|
value: x.value,
|
|
1121
|
-
onChange: (
|
|
1122
|
-
(he) => he.map((le, ae) => ae === Z ? { ...le, value:
|
|
1125
|
+
onChange: (Y) => q(
|
|
1126
|
+
(he) => he.map((le, ae) => ae === Z ? { ...le, value: Y.target.value } : le)
|
|
1123
1127
|
),
|
|
1124
1128
|
placeholder: "0",
|
|
1125
1129
|
inputMode: "decimal",
|
|
@@ -1131,7 +1135,7 @@ function pl({
|
|
|
1131
1135
|
{
|
|
1132
1136
|
type: "button",
|
|
1133
1137
|
className: "text-slate-300 hover:text-red-500",
|
|
1134
|
-
onClick: () => q((
|
|
1138
|
+
onClick: () => q((Y) => Y.filter((he, le) => le !== Z)),
|
|
1135
1139
|
children: /* @__PURE__ */ e(Ae, { className: "h-3 w-3" })
|
|
1136
1140
|
}
|
|
1137
1141
|
)
|
|
@@ -1158,9 +1162,9 @@ function pl({
|
|
|
1158
1162
|
label: x.label,
|
|
1159
1163
|
optionSource: x.options,
|
|
1160
1164
|
selected: ((Z = w.find((te) => te.field === x.field)) == null ? void 0 : Z.values) ?? [],
|
|
1161
|
-
onChange: (te,
|
|
1165
|
+
onChange: (te, Y) => E((he) => [
|
|
1162
1166
|
...he.filter((le) => le.field !== x.field),
|
|
1163
|
-
...te.length > 0 ? [{ field: x.field, values: te, labels:
|
|
1167
|
+
...te.length > 0 ? [{ field: x.field, values: te, labels: Y }] : []
|
|
1164
1168
|
])
|
|
1165
1169
|
},
|
|
1166
1170
|
x.field
|
|
@@ -1188,7 +1192,7 @@ function pl({
|
|
|
1188
1192
|
onClick: () => de.mutate(),
|
|
1189
1193
|
className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2 text-[11.5px] font-semibold text-white disabled:opacity-50",
|
|
1190
1194
|
children: [
|
|
1191
|
-
/* @__PURE__ */ e(
|
|
1195
|
+
/* @__PURE__ */ e(Yt, { className: "h-3 w-3" }),
|
|
1192
1196
|
" Add alert"
|
|
1193
1197
|
]
|
|
1194
1198
|
}
|
|
@@ -1199,7 +1203,7 @@ function pl({
|
|
|
1199
1203
|
] })
|
|
1200
1204
|
] });
|
|
1201
1205
|
}
|
|
1202
|
-
const
|
|
1206
|
+
const fl = {
|
|
1203
1207
|
eq: "_eq",
|
|
1204
1208
|
neq: "_neq",
|
|
1205
1209
|
gt: "_gt",
|
|
@@ -1215,7 +1219,7 @@ function Mt(t, n, a, o) {
|
|
|
1215
1219
|
var L, q;
|
|
1216
1220
|
const c = t.config ?? {}, m = [];
|
|
1217
1221
|
for (const w of c.filters ?? []) {
|
|
1218
|
-
const E =
|
|
1222
|
+
const E = fl[w.op];
|
|
1219
1223
|
if (!E) continue;
|
|
1220
1224
|
let u = w.value;
|
|
1221
1225
|
w.op === "in" && typeof u == "string" && (u = u.split(",").map((N) => N.trim())), m.push({ path: [w.field], op: E, value: u });
|
|
@@ -1258,7 +1262,7 @@ function Et(t) {
|
|
|
1258
1262
|
}
|
|
1259
1263
|
return a.length > 0 ? a.join(" · ") : "No configuration details";
|
|
1260
1264
|
}
|
|
1261
|
-
function
|
|
1265
|
+
function xl(t) {
|
|
1262
1266
|
var n, a;
|
|
1263
1267
|
return t ? t.value != null ? Number(t.value) : t.series ? t.series.reduce((o, c) => o + (Number(c.value) || 0), 0) : (n = t.tiles) != null && n.length ? Number(((a = t.tiles[0]) == null ? void 0 : a.value) ?? 0) : t.row_count != null ? Number(t.row_count) : null : null;
|
|
1264
1268
|
}
|
|
@@ -1292,7 +1296,7 @@ function Wt(t, n, a) {
|
|
|
1292
1296
|
const L = p.href;
|
|
1293
1297
|
setTimeout(() => URL.revokeObjectURL(L), 1e4);
|
|
1294
1298
|
}
|
|
1295
|
-
function
|
|
1299
|
+
function bl({
|
|
1296
1300
|
collection: t,
|
|
1297
1301
|
conditions: n,
|
|
1298
1302
|
title: a,
|
|
@@ -1418,8 +1422,8 @@ const Lt = Ta(function({
|
|
|
1418
1422
|
reportUrl: N,
|
|
1419
1423
|
currentFilters: U
|
|
1420
1424
|
}) {
|
|
1421
|
-
var ft, Ue, xt,
|
|
1422
|
-
const O = Ke(), [ee, H] = C(""), [ue, pe] = C(0), [X, de] = C(null), [xe, be] = C(!1), [ge, $e] = C(""), [x, Z] = C(""), [te,
|
|
1425
|
+
var ft, Ue, xt, Ye, bt, gt, tt, vt, Ve, at, Je, lt, rt, nt, re, yt, st, it, ot, Le;
|
|
1426
|
+
const O = Ke(), [ee, H] = C(""), [ue, pe] = C(0), [X, de] = C(null), [xe, be] = C(!1), [ge, $e] = C(""), [x, Z] = C(""), [te, Y] = C(!1), [he, le] = C(!1), [ae, S] = C([]), T = St(null), P = il(T), [V, ne] = C(!1), [ce, fe] = C(null), [_, D] = C(!1), [me, ve] = C(null), we = ["bar", "line", "donut", "pareto", "area"].includes(a.type) || a.type === "kpi" && !!((ft = a.config) != null && ft.compare || (Ue = a.config) != null && Ue.sparkline), Te = Ct(), [Xe, ye] = C(!1), Ze = async () => {
|
|
1423
1427
|
ye(!0);
|
|
1424
1428
|
try {
|
|
1425
1429
|
const l = await O.request(
|
|
@@ -1475,7 +1479,7 @@ const Lt = Ta(function({
|
|
|
1475
1479
|
Number((xt = a.config) == null ? void 0 : xt.refresh_secs) >= 10 ? Number(a.config.refresh_secs) * 1e3 : m
|
|
1476
1480
|
),
|
|
1477
1481
|
retry: !1
|
|
1478
|
-
}), Be = (((
|
|
1482
|
+
}), Be = (((Ye = a.config) == null ? void 0 : Ye.drill_levels) ?? []).filter(
|
|
1479
1483
|
(l) => typeof l == "string" && l
|
|
1480
1484
|
), { data: ht } = Ne({
|
|
1481
1485
|
queryKey: ["nvr-report-drill", n, a.id, ae, o, c],
|
|
@@ -1505,7 +1509,7 @@ const Lt = Ta(function({
|
|
|
1505
1509
|
let J = null;
|
|
1506
1510
|
if (_e != null && _e.slug)
|
|
1507
1511
|
J = /* @__PURE__ */ e(
|
|
1508
|
-
|
|
1512
|
+
dl,
|
|
1509
1513
|
{
|
|
1510
1514
|
cfg: _e,
|
|
1511
1515
|
dateRange: o,
|
|
@@ -1978,7 +1982,7 @@ const Lt = Ta(function({
|
|
|
1978
1982
|
)
|
|
1979
1983
|
] }, s.dim)) });
|
|
1980
1984
|
} else if (a.type === "table") {
|
|
1981
|
-
const l = R.rows ?? [], s = (
|
|
1985
|
+
const l = R.rows ?? [], s = (Ve = a.config) != null && Ve.columns && a.config.columns.length > 0 ? a.config.columns.map((d) => typeof d == "string" ? { field: d } : d) : l[0] ? Object.keys(l[0]).filter((d) => d !== "id").map((d) => ({ field: d })) : [], b = s.map((d) => d.field), M = (d) => s.find((y) => y.field === d), $ = ((at = a.config) == null ? void 0 : at.format_rules) ?? [], K = (d) => {
|
|
1982
1986
|
var y;
|
|
1983
1987
|
for (const F of $)
|
|
1984
1988
|
if ((F.scope ?? "cell") === "row" && Qt(F, d[F.field]))
|
|
@@ -2375,7 +2379,7 @@ const Lt = Ta(function({
|
|
|
2375
2379
|
{
|
|
2376
2380
|
data: l,
|
|
2377
2381
|
layout: A ? "vertical" : "horizontal",
|
|
2378
|
-
margin: { top: 6, right: 8, left: A ?
|
|
2382
|
+
margin: { top: 6, right: 8, left: A ? 10 : -10, bottom: 0 },
|
|
2379
2383
|
children: [
|
|
2380
2384
|
A ? /* @__PURE__ */ i(He, { children: [
|
|
2381
2385
|
/* @__PURE__ */ e(y, { type: "number", tick: { fontSize: 10 }, stroke: "#94a3b8" }),
|
|
@@ -2386,7 +2390,9 @@ const Lt = Ta(function({
|
|
|
2386
2390
|
dataKey: "dim",
|
|
2387
2391
|
tick: { fontSize: 10 },
|
|
2388
2392
|
stroke: "#94a3b8",
|
|
2389
|
-
|
|
2393
|
+
tickFormatter: Ia,
|
|
2394
|
+
interval: 0,
|
|
2395
|
+
width: 140
|
|
2390
2396
|
}
|
|
2391
2397
|
)
|
|
2392
2398
|
] }) : /* @__PURE__ */ i(He, { children: [
|
|
@@ -2573,7 +2579,7 @@ const Lt = Ta(function({
|
|
|
2573
2579
|
"data-explain-trend": we ? "1" : void 0,
|
|
2574
2580
|
className: "rounded p-0.5 text-slate-300 hover:text-[#00a5cc]",
|
|
2575
2581
|
onClick: () => {
|
|
2576
|
-
if (
|
|
2582
|
+
if (V) {
|
|
2577
2583
|
ne(!1);
|
|
2578
2584
|
return;
|
|
2579
2585
|
}
|
|
@@ -2638,7 +2644,7 @@ const Lt = Ta(function({
|
|
|
2638
2644
|
"rounded p-0.5",
|
|
2639
2645
|
te ? "text-[#00a5cc]" : "text-slate-300 hover:text-slate-500"
|
|
2640
2646
|
),
|
|
2641
|
-
onClick: () =>
|
|
2647
|
+
onClick: () => Y((l) => !l),
|
|
2642
2648
|
children: /* @__PURE__ */ e(qa, { className: "h-3 w-3" })
|
|
2643
2649
|
}
|
|
2644
2650
|
),
|
|
@@ -2678,7 +2684,7 @@ const Lt = Ta(function({
|
|
|
2678
2684
|
children: /* @__PURE__ */ e(Fa, { className: "h-3 w-3" })
|
|
2679
2685
|
}
|
|
2680
2686
|
),
|
|
2681
|
-
/* @__PURE__ */ e(
|
|
2687
|
+
/* @__PURE__ */ e(hl, { reportId: n, widget: a, filterBar: h }),
|
|
2682
2688
|
/* @__PURE__ */ e(
|
|
2683
2689
|
"button",
|
|
2684
2690
|
{
|
|
@@ -2755,7 +2761,7 @@ const Lt = Ta(function({
|
|
|
2755
2761
|
] })
|
|
2756
2762
|
] }),
|
|
2757
2763
|
p && (() => {
|
|
2758
|
-
const l =
|
|
2764
|
+
const l = xl(R), s = p.value;
|
|
2759
2765
|
if (l == null || s == null) return null;
|
|
2760
2766
|
const b = s === 0 ? null : (l - s) / Math.abs(s) * 100;
|
|
2761
2767
|
return /* @__PURE__ */ i("p", { className: "mb-1 flex items-center gap-1 text-[10.5px] text-slate-400", children: [
|
|
@@ -2779,7 +2785,7 @@ const Lt = Ta(function({
|
|
|
2779
2785
|
)
|
|
2780
2786
|
] });
|
|
2781
2787
|
})(),
|
|
2782
|
-
|
|
2788
|
+
V && /* @__PURE__ */ i(
|
|
2783
2789
|
"div",
|
|
2784
2790
|
{
|
|
2785
2791
|
className: "mb-1.5 rounded-md border border-nvr-cyan/25 bg-nvr-cyan/5 px-2.5 py-1.5 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300",
|
|
@@ -2847,7 +2853,7 @@ const Lt = Ta(function({
|
|
|
2847
2853
|
] }) }) : J }),
|
|
2848
2854
|
((Le = a.config) == null ? void 0 : Le.footnote) && /* @__PURE__ */ e("p", { className: "mt-1 border-t border-slate-100 pt-1 text-[10.5px] leading-snug text-slate-400 dark:border-border/50", children: a.config.footnote }),
|
|
2849
2855
|
X && /* @__PURE__ */ e(
|
|
2850
|
-
|
|
2856
|
+
bl,
|
|
2851
2857
|
{
|
|
2852
2858
|
collection: a.collection ?? "",
|
|
2853
2859
|
conditions: X.conditions,
|
|
@@ -2869,7 +2875,7 @@ const Lt = Ta(function({
|
|
|
2869
2875
|
}
|
|
2870
2876
|
);
|
|
2871
2877
|
});
|
|
2872
|
-
function
|
|
2878
|
+
function El({
|
|
2873
2879
|
reportId: t,
|
|
2874
2880
|
widget: n,
|
|
2875
2881
|
dateRange: a = null,
|
|
@@ -2890,7 +2896,7 @@ function jl({
|
|
|
2890
2896
|
}
|
|
2891
2897
|
);
|
|
2892
2898
|
}
|
|
2893
|
-
function
|
|
2899
|
+
function Wl({
|
|
2894
2900
|
reportId: t,
|
|
2895
2901
|
showFilterBar: n = !0,
|
|
2896
2902
|
dateRange: a,
|
|
@@ -2926,7 +2932,7 @@ function El({
|
|
|
2926
2932
|
return p.request(ua(t)).then((r) => r.data);
|
|
2927
2933
|
},
|
|
2928
2934
|
staleTime: 6e4
|
|
2929
|
-
}), te = () => void x.invalidateQueries({ queryKey: ["nivaro-report-presets", t] }),
|
|
2935
|
+
}), te = () => void x.invalidateQueries({ queryKey: ["nivaro-report-presets", t] }), Y = Me({
|
|
2930
2936
|
mutationFn: (r) => p.request(
|
|
2931
2937
|
Kt(t, {
|
|
2932
2938
|
name: r,
|
|
@@ -2938,7 +2944,7 @@ function El({
|
|
|
2938
2944
|
}), he = Me({
|
|
2939
2945
|
mutationFn: (r) => p.request(pa(t, r)),
|
|
2940
2946
|
onSuccess: te
|
|
2941
|
-
}), [le, ae] = C(""), [S, T] = C(!1), [P,
|
|
2947
|
+
}), [le, ae] = C(""), [S, T] = C(!1), [P, V] = C(null), [ne, ce] = C(!1), { data: fe = [] } = Ne({
|
|
2942
2948
|
queryKey: ["nvr-report-snaps", t],
|
|
2943
2949
|
queryFn: () => p.request(
|
|
2944
2950
|
ct(`/report-studio/${t}/snapshots`)
|
|
@@ -2991,7 +2997,7 @@ function El({
|
|
|
2991
2997
|
staleTime: 6e4,
|
|
2992
2998
|
refetchInterval: 5 * 6e4,
|
|
2993
2999
|
retry: !1
|
|
2994
|
-
}), [se, et] = C(null), [Qe, _e] = C(!1), [J, ft] = C(""), [Ue, xt] = C(""), [
|
|
3000
|
+
}), [se, et] = C(null), [Qe, _e] = C(!1), [J, ft] = C(""), [Ue, xt] = C(""), [Ye, bt] = C("");
|
|
2995
3001
|
mt(() => {
|
|
2996
3002
|
try {
|
|
2997
3003
|
const r = sessionStorage.getItem(`nvr-report-xf:${t}`);
|
|
@@ -3010,7 +3016,7 @@ function El({
|
|
|
3010
3016
|
if (d < 0 || y < 0 || y >= k.length) return k;
|
|
3011
3017
|
const F = k[d], B = k[y];
|
|
3012
3018
|
return k[d] = { ...B, x: F.x, y: F.y }, k[y] = { ...F, x: B.x, y: B.y }, k;
|
|
3013
|
-
}), [
|
|
3019
|
+
}), [Ve, at] = C(""), [Je, lt] = C(!1), [rt, nt] = C(null), { data: re, isLoading: yt } = Ne({
|
|
3014
3020
|
queryKey: ["nivaro-report", t],
|
|
3015
3021
|
queryFn: () => p.request(ha(t)).then((r) => r.data),
|
|
3016
3022
|
staleTime: 3e4
|
|
@@ -3073,7 +3079,7 @@ function El({
|
|
|
3073
3079
|
pe(r.entity_filters), O(r.entity_filters), N(r.date_range), H(void 0);
|
|
3074
3080
|
}, A = async () => {
|
|
3075
3081
|
var v, g;
|
|
3076
|
-
const r =
|
|
3082
|
+
const r = Ve.trim();
|
|
3077
3083
|
if (!(!r || Je)) {
|
|
3078
3084
|
lt(!0), nt(null);
|
|
3079
3085
|
try {
|
|
@@ -3112,7 +3118,7 @@ function El({
|
|
|
3112
3118
|
{
|
|
3113
3119
|
value: (b == null ? void 0 : b.preset) ?? "",
|
|
3114
3120
|
onChange: (r) => H(r ? { preset: r } : null),
|
|
3115
|
-
options:
|
|
3121
|
+
options: ll.map((r) => ({ value: r.id, label: r.label })),
|
|
3116
3122
|
ariaLabel: "Date range",
|
|
3117
3123
|
className: "h-7 w-auto rounded-md px-1.5 py-0 text-[12px] text-slate-600 dark:border-border dark:bg-card dark:text-slate-300"
|
|
3118
3124
|
}
|
|
@@ -3194,7 +3200,7 @@ function El({
|
|
|
3194
3200
|
placeholder: "Preset name",
|
|
3195
3201
|
autoFocus: !0,
|
|
3196
3202
|
onKeyDown: (r) => {
|
|
3197
|
-
r.key === "Enter" && le.trim() && (
|
|
3203
|
+
r.key === "Enter" && le.trim() && (Y.mutate(le.trim()), ae(""), T(!1)), r.key === "Escape" && T(!1);
|
|
3198
3204
|
},
|
|
3199
3205
|
className: "h-6 w-[130px] rounded-md border border-slate-200 bg-white px-2 text-[11px] dark:border-border dark:bg-card"
|
|
3200
3206
|
}
|
|
@@ -3205,7 +3211,7 @@ function El({
|
|
|
3205
3211
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-dashed border-slate-200 px-2 text-[11px] text-slate-400 hover:border-slate-300 hover:text-slate-600 dark:border-border",
|
|
3206
3212
|
onClick: () => T(!0),
|
|
3207
3213
|
children: [
|
|
3208
|
-
/* @__PURE__ */ e(
|
|
3214
|
+
/* @__PURE__ */ e(Yt, { className: "h-2.5 w-2.5" }),
|
|
3209
3215
|
" Save preset"
|
|
3210
3216
|
]
|
|
3211
3217
|
}
|
|
@@ -3231,7 +3237,7 @@ function El({
|
|
|
3231
3237
|
{
|
|
3232
3238
|
type: "button",
|
|
3233
3239
|
title: `Compare against ${r.name} (${new Date(r.taken_at).toLocaleDateString()})`,
|
|
3234
|
-
onClick: () =>
|
|
3240
|
+
onClick: () => V((v) => v === r.id ? null : r.id),
|
|
3235
3241
|
className: j(
|
|
3236
3242
|
"inline-flex h-6 items-center gap-1 rounded-full border px-2 text-[11px]",
|
|
3237
3243
|
P === r.id ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] font-medium text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-400 hover:text-slate-600 dark:border-border"
|
|
@@ -3264,7 +3270,7 @@ function El({
|
|
|
3264
3270
|
/* @__PURE__ */ e(
|
|
3265
3271
|
"input",
|
|
3266
3272
|
{
|
|
3267
|
-
value:
|
|
3273
|
+
value: Ve,
|
|
3268
3274
|
onChange: (r) => at(r.target.value),
|
|
3269
3275
|
onKeyDown: (r) => {
|
|
3270
3276
|
r.key === "Enter" && A();
|
|
@@ -3277,7 +3283,7 @@ function El({
|
|
|
3277
3283
|
"button",
|
|
3278
3284
|
{
|
|
3279
3285
|
type: "button",
|
|
3280
|
-
disabled: Je || !
|
|
3286
|
+
disabled: Je || !Ve.trim(),
|
|
3281
3287
|
onClick: () => void A(),
|
|
3282
3288
|
className: "text-[11px] font-semibold text-nvr-navy disabled:opacity-40 dark:text-nvr-cyan",
|
|
3283
3289
|
children: Je ? "…" : "Set"
|
|
@@ -3288,7 +3294,7 @@ function El({
|
|
|
3288
3294
|
] })
|
|
3289
3295
|
] }),
|
|
3290
3296
|
R.length > 0 && /* @__PURE__ */ i("div", { className: "mb-2 flex items-center gap-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 dark:border-red-500/40 dark:bg-red-500/10", children: [
|
|
3291
|
-
/* @__PURE__ */ e(
|
|
3297
|
+
/* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5 shrink-0 text-red-500" }),
|
|
3292
3298
|
/* @__PURE__ */ e("p", { className: "min-w-0 flex-1 truncate text-[12px] text-red-700 dark:text-red-300", children: R.length === 1 ? `Alert firing: ${R[0].name}` : `${R.length} alerts firing: ${R.map((r) => r.name).join(" · ")}` })
|
|
3293
3299
|
] }),
|
|
3294
3300
|
/* @__PURE__ */ i("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
@@ -3355,7 +3361,7 @@ function El({
|
|
|
3355
3361
|
/* @__PURE__ */ e(
|
|
3356
3362
|
"input",
|
|
3357
3363
|
{
|
|
3358
|
-
value:
|
|
3364
|
+
value: Ye,
|
|
3359
3365
|
onChange: (r) => bt(r.target.value),
|
|
3360
3366
|
placeholder: "Value B",
|
|
3361
3367
|
className: "h-7 min-w-0 flex-1 rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-card dark:text-slate-200"
|
|
@@ -3366,9 +3372,9 @@ function El({
|
|
|
3366
3372
|
"button",
|
|
3367
3373
|
{
|
|
3368
3374
|
type: "button",
|
|
3369
|
-
disabled: !J.trim() || !Ue.trim() || !
|
|
3375
|
+
disabled: !J.trim() || !Ue.trim() || !Ye.trim(),
|
|
3370
3376
|
onClick: () => {
|
|
3371
|
-
et({ field: J.trim(), a: Ue.trim(), b:
|
|
3377
|
+
et({ field: J.trim(), a: Ue.trim(), b: Ye.trim() }), _e(!1);
|
|
3372
3378
|
},
|
|
3373
3379
|
className: "h-7 rounded-md bg-nvr-cyan text-[11.5px] font-semibold text-white hover:brightness-110 disabled:opacity-40",
|
|
3374
3380
|
children: "Compare"
|
|
@@ -3434,7 +3440,7 @@ function El({
|
|
|
3434
3440
|
}
|
|
3435
3441
|
) }),
|
|
3436
3442
|
ye && ke && /* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(qt, { fallback: null, children: /* @__PURE__ */ e(
|
|
3437
|
-
|
|
3443
|
+
el,
|
|
3438
3444
|
{
|
|
3439
3445
|
maxY: Math.max(0, ...ke.map((r) => (r.y ?? 0) + (r.h ?? 1))),
|
|
3440
3446
|
onAdd: (r) => Fe((v) => [...v ?? [], r])
|
|
@@ -3481,7 +3487,7 @@ function El({
|
|
|
3481
3487
|
)
|
|
3482
3488
|
] }, k)) }) : /* @__PURE__ */ i(He, { children: [
|
|
3483
3489
|
ye && /* @__PURE__ */ e(qt, { fallback: null, children: /* @__PURE__ */ e(
|
|
3484
|
-
|
|
3490
|
+
al,
|
|
3485
3491
|
{
|
|
3486
3492
|
widget: r,
|
|
3487
3493
|
onConfigure: () => Ee(r.id),
|
|
@@ -3522,7 +3528,7 @@ function El({
|
|
|
3522
3528
|
}
|
|
3523
3529
|
),
|
|
3524
3530
|
ye && Ie && (ke == null ? void 0 : ke.some((r) => r.id === Ie)) && /* @__PURE__ */ e(qt, { fallback: null, children: /* @__PURE__ */ e(
|
|
3525
|
-
|
|
3531
|
+
tl,
|
|
3526
3532
|
{
|
|
3527
3533
|
widget: ke.find((r) => r.id === Ie),
|
|
3528
3534
|
allWidgets: ke,
|
|
@@ -3547,9 +3553,9 @@ function El({
|
|
|
3547
3553
|
] }) : /* @__PURE__ */ e("div", { className: j("p-6 text-[13px] text-slate-400", m), children: "Report not found." });
|
|
3548
3554
|
}
|
|
3549
3555
|
export {
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3556
|
+
hl as AlertBell,
|
|
3557
|
+
dl as QueryWidgetBody,
|
|
3558
|
+
Wl as ReportView,
|
|
3559
|
+
El as ReportWidgetCard,
|
|
3554
3560
|
oa as shapeQueryRows
|
|
3555
3561
|
};
|