react-semaphor 0.0.344 → 0.0.345
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/chunks/{index-Bmw6Tt4N.js → index-CpN3tEgm.js} +969 -966
- package/dist/chunks/index-DVjMwTyC.js +240 -0
- package/dist/chunks/{index-DzAvZhsF.js → index-ggRRMgwy.js} +49 -53
- package/dist/chunks/{index-CcxLUxGu.js → index-iepZTd2s.js} +2 -2
- package/dist/chunks/{lucide-react-RZyiVtvC.js → lucide-react-Dkhi6K56.js} +1 -1
- package/dist/chunks/{lucide-react-DzzsKkzx.js → lucide-react-g0ln-XxW.js} +3 -3
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-B0NJ_phi.js +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as
|
|
1
|
+
import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, P as ia, F as oa, a5 as Ue, a6 as Ge, a7 as Ds, a8 as ca, a9 as Ms, aa as ue, ab as he, ac as me, ad as xe, ae as ve, af as pe, ag as X, T as Is, ah as Ts, ai as Ls, aj as Fs, ak as da, al as ua, am as ce, an as rt, ao as it, ap as ha, aq as ot, C as ct, ar as dt, as as ma, B as ut, at as fe, au as ht, av as Ke, aw as xa, ax as gs, ay as be, az as ze, aA as Ce, aB as pa, aC as mt, aD as xt, aE as pt, aF as ft, l as gt, aG as jt, aH as bt, aI as De, aJ as ne, aK as fa, aL as yt, aM as os, aN as vt, aO as Ct, aP as js, a as Nt, aQ as ss, aR as ye, aS as as, aT as St, aU as wt, aV as kt, aW as zt, aX as fs, aY as Ot, aZ as Ks, a_ as Dt, a$ as Qs, b0 as Mt, b1 as It, b2 as Tt, b3 as Lt, b4 as ga, b5 as Ft, b6 as Es, b7 as ja, b8 as Et, b9 as At, ba as Xe, bb as Vt, bc as qt, bd as ba, be as Rt, s as _t, bf as Ht, bg as Pt, r as $t, bh as cs, bi as ya, bj as va, bk as Ca, bl as Ze, bm as Na, bn as es, bo as Js, bp as Bt, bq as Ut, br as ds, bs as us, bt as hs, bu as Gt, I as Kt, X as Sa, bv as Qt, bw as Jt, bx as Wt, E as Yt, by as ms, bz as Oe, f as Xt, bA as Pe, bB as As, bC as wa, bD as Zt, bE as en, bF as ts, bG as sn, bH as an, bI as tn, bJ as Ws, bK as ka, bL as nn, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as Me, bT as Q, bU as J, bV as Vs, bW as W, bX as hn, bY as za, bZ as mn, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn } from "./index-ggRRMgwy.js";
|
|
2
2
|
import * as Ys from "react";
|
|
3
3
|
import Ne, { useState as q, useMemo as bs, useEffect as Z, useRef as ns, useCallback as Oa, Suspense as Cn } from "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -516,7 +516,7 @@ function Ea(s) {
|
|
|
516
516
|
var r;
|
|
517
517
|
return {
|
|
518
518
|
...l,
|
|
519
|
-
cards: (r = l.cards) == null ? void 0 : r.map((
|
|
519
|
+
cards: (r = l.cards) == null ? void 0 : r.map((i) => Wn(i))
|
|
520
520
|
};
|
|
521
521
|
})
|
|
522
522
|
};
|
|
@@ -571,13 +571,13 @@ async function Xn(s, n, a, t) {
|
|
|
571
571
|
async function ys(s, n) {
|
|
572
572
|
if (!n)
|
|
573
573
|
return null;
|
|
574
|
-
const { id: a, template: t, filterValues: l, isDefault: r, shared:
|
|
574
|
+
const { id: a, template: t, filterValues: l, isDefault: r, shared: i } = s;
|
|
575
575
|
return await vs("https://semaphor.cloud/api/v1/lens", n, {
|
|
576
576
|
lensId: a,
|
|
577
577
|
template: t,
|
|
578
578
|
filterValues: l,
|
|
579
579
|
isDefault: r,
|
|
580
|
-
shared:
|
|
580
|
+
shared: i,
|
|
581
581
|
operation: "update"
|
|
582
582
|
});
|
|
583
583
|
}
|
|
@@ -588,20 +588,20 @@ async function Zn(s, n) {
|
|
|
588
588
|
}) : null;
|
|
589
589
|
}
|
|
590
590
|
function el() {
|
|
591
|
-
const [s, n] = q(""), [a, t] = q(!1), l = M((
|
|
592
|
-
async function
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
),
|
|
591
|
+
const [s, n] = q(""), [a, t] = q(!1), l = M((p) => p.lenses), { setLenses: r, setSelectedLensId: i } = is(), [o, d] = q(!1), [x, c] = q(!1), b = M((p) => p.dashboard), g = M((p) => p.filterValues), { authToken: h } = Se();
|
|
592
|
+
async function f() {
|
|
593
|
+
d(!0);
|
|
594
|
+
const p = Ea(
|
|
595
|
+
b
|
|
596
|
+
), N = await Xn(
|
|
597
597
|
s,
|
|
598
|
-
|
|
598
|
+
p,
|
|
599
599
|
g,
|
|
600
|
-
|
|
600
|
+
h == null ? void 0 : h.accessToken
|
|
601
601
|
);
|
|
602
|
-
|
|
602
|
+
N && (r([...l || [], N]), i(N.id), c(!1)), d(!1);
|
|
603
603
|
}
|
|
604
|
-
return /* @__PURE__ */ e.jsxs(Cs, { open:
|
|
604
|
+
return /* @__PURE__ */ e.jsxs(Cs, { open: x, onOpenChange: c, children: [
|
|
605
605
|
/* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
606
606
|
O,
|
|
607
607
|
{
|
|
@@ -622,11 +622,11 @@ function el() {
|
|
|
622
622
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
623
623
|
/* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
|
|
624
624
|
/* @__PURE__ */ e.jsx(
|
|
625
|
-
|
|
625
|
+
ie,
|
|
626
626
|
{
|
|
627
627
|
value: s,
|
|
628
|
-
onChange: (
|
|
629
|
-
n(
|
|
628
|
+
onChange: (p) => {
|
|
629
|
+
n(p.target.value);
|
|
630
630
|
},
|
|
631
631
|
id: "name",
|
|
632
632
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -640,46 +640,46 @@ function el() {
|
|
|
640
640
|
size: "sm",
|
|
641
641
|
variant: "outline",
|
|
642
642
|
type: "submit",
|
|
643
|
-
onClick:
|
|
644
|
-
disabled:
|
|
645
|
-
children:
|
|
643
|
+
onClick: f,
|
|
644
|
+
disabled: o,
|
|
645
|
+
children: o ? "Creating..." : "Add"
|
|
646
646
|
}
|
|
647
647
|
) })
|
|
648
648
|
] })
|
|
649
649
|
] });
|
|
650
650
|
}
|
|
651
651
|
function sl() {
|
|
652
|
-
const [s, n] = q(!1), a = M((
|
|
653
|
-
async function
|
|
654
|
-
r(
|
|
652
|
+
const [s, n] = q(!1), a = M((c) => c.lenses), t = M((c) => c.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: i } = Se();
|
|
653
|
+
async function o(c) {
|
|
654
|
+
r(c);
|
|
655
655
|
}
|
|
656
|
-
async function
|
|
657
|
-
if (await Zn(
|
|
658
|
-
const g = a == null ? void 0 : a.filter((
|
|
656
|
+
async function d(c) {
|
|
657
|
+
if (await Zn(c, i == null ? void 0 : i.accessToken)) {
|
|
658
|
+
const g = a == null ? void 0 : a.filter((h) => h.id !== c);
|
|
659
659
|
l(g || []), r("original");
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
async function
|
|
663
|
-
const
|
|
664
|
-
...
|
|
665
|
-
isDefault: !
|
|
662
|
+
async function x(c) {
|
|
663
|
+
const b = a == null ? void 0 : a.map((f) => f.id === c.id ? {
|
|
664
|
+
...f,
|
|
665
|
+
isDefault: !c.isDefault
|
|
666
666
|
} : {
|
|
667
|
-
...
|
|
667
|
+
...f,
|
|
668
668
|
isDefault: !1
|
|
669
669
|
});
|
|
670
|
-
l(
|
|
670
|
+
l(b || []);
|
|
671
671
|
const g = {
|
|
672
|
-
...
|
|
673
|
-
isDefault: !
|
|
672
|
+
...c,
|
|
673
|
+
isDefault: !c.isDefault
|
|
674
674
|
};
|
|
675
|
-
await ys(g,
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
678
|
-
const
|
|
679
|
-
...
|
|
675
|
+
await ys(g, i == null ? void 0 : i.accessToken);
|
|
676
|
+
const h = a == null ? void 0 : a.find((f) => f.isDefault);
|
|
677
|
+
if (h && h.id !== c.id) {
|
|
678
|
+
const f = {
|
|
679
|
+
...h,
|
|
680
680
|
isDefault: !1
|
|
681
681
|
};
|
|
682
|
-
await ys(
|
|
682
|
+
await ys(f, i == null ? void 0 : i.accessToken);
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
return /* @__PURE__ */ e.jsxs(na, { open: s, onOpenChange: n, children: [
|
|
@@ -691,28 +691,28 @@ function sl() {
|
|
|
691
691
|
tt,
|
|
692
692
|
{
|
|
693
693
|
value: t,
|
|
694
|
-
onValueChange:
|
|
694
|
+
onValueChange: o,
|
|
695
695
|
children: [
|
|
696
696
|
/* @__PURE__ */ e.jsx(Gs, { value: "original", children: "Original" }),
|
|
697
|
-
a == null ? void 0 : a.map((
|
|
697
|
+
a == null ? void 0 : a.map((c) => /* @__PURE__ */ e.jsxs(
|
|
698
698
|
Gs,
|
|
699
699
|
{
|
|
700
700
|
className: "group flex justify-between gap-2",
|
|
701
|
-
value:
|
|
701
|
+
value: c.id,
|
|
702
702
|
children: [
|
|
703
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
703
|
+
/* @__PURE__ */ e.jsx("p", { children: c.name }),
|
|
704
704
|
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
|
|
705
705
|
/* @__PURE__ */ e.jsx(
|
|
706
706
|
Fn,
|
|
707
707
|
{
|
|
708
|
-
onClick: (
|
|
709
|
-
|
|
708
|
+
onClick: (b) => {
|
|
709
|
+
b.preventDefault(), x(c);
|
|
710
710
|
},
|
|
711
711
|
className: Y(
|
|
712
712
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
713
713
|
{
|
|
714
|
-
invisible: !
|
|
715
|
-
"text-green-500":
|
|
714
|
+
invisible: !c.isDefault,
|
|
715
|
+
"text-green-500": c.isDefault
|
|
716
716
|
}
|
|
717
717
|
),
|
|
718
718
|
strokeWidth: 1.5
|
|
@@ -721,8 +721,8 @@ function sl() {
|
|
|
721
721
|
/* @__PURE__ */ e.jsx(
|
|
722
722
|
Be,
|
|
723
723
|
{
|
|
724
|
-
onClick: (
|
|
725
|
-
|
|
724
|
+
onClick: (b) => {
|
|
725
|
+
b.preventDefault(), d(c.id);
|
|
726
726
|
},
|
|
727
727
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
728
728
|
strokeWidth: 1.5
|
|
@@ -731,7 +731,7 @@ function sl() {
|
|
|
731
731
|
] })
|
|
732
732
|
]
|
|
733
733
|
},
|
|
734
|
-
|
|
734
|
+
c.id
|
|
735
735
|
))
|
|
736
736
|
]
|
|
737
737
|
}
|
|
@@ -742,19 +742,19 @@ function sl() {
|
|
|
742
742
|
function al({
|
|
743
743
|
iconClassName: s
|
|
744
744
|
}) {
|
|
745
|
-
const [n, a] = q(!1), { authToken: t } = Se(), l = M((
|
|
746
|
-
async function
|
|
745
|
+
const [n, a] = q(!1), { authToken: t } = Se(), l = M((o) => o.theme), r = M((o) => o.filterValues);
|
|
746
|
+
async function i() {
|
|
747
747
|
{
|
|
748
748
|
a(!0);
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
const
|
|
749
|
+
const o = new URLSearchParams();
|
|
750
|
+
o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
|
|
751
|
+
const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, c = await (await fetch(d, {
|
|
752
752
|
method: "GET",
|
|
753
753
|
headers: {
|
|
754
754
|
Authorization: `Bearer ${t == null ? void 0 : t.accessToken}`
|
|
755
755
|
}
|
|
756
|
-
})).blob(),
|
|
757
|
-
window.open(
|
|
756
|
+
})).blob(), b = URL.createObjectURL(c);
|
|
757
|
+
window.open(b, "_blank"), a(!1);
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
760
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -763,7 +763,7 @@ function al({
|
|
|
763
763
|
variant: "link",
|
|
764
764
|
className: "group h-7 p-2",
|
|
765
765
|
size: "sm",
|
|
766
|
-
onClick:
|
|
766
|
+
onClick: i,
|
|
767
767
|
children: n ? /* @__PURE__ */ e.jsx(Ve, { className: Y("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
768
768
|
nt,
|
|
769
769
|
{
|
|
@@ -777,28 +777,28 @@ function al({
|
|
|
777
777
|
function tl() {
|
|
778
778
|
q(!1);
|
|
779
779
|
const { authToken: s } = Se();
|
|
780
|
-
M((
|
|
781
|
-
const n = M((
|
|
782
|
-
M((
|
|
780
|
+
M((j) => j.theme);
|
|
781
|
+
const n = M((j) => j.lenses), a = M((j) => j.selectedLensId), t = n == null ? void 0 : n.find((j) => j.id === a), l = M((j) => j.dashboard);
|
|
782
|
+
M((j) => j.selectedSheetId);
|
|
783
783
|
const r = M(
|
|
784
|
-
(
|
|
785
|
-
),
|
|
786
|
-
(
|
|
787
|
-
), [
|
|
784
|
+
(j) => j.isDashboardEditing
|
|
785
|
+
), i = u(
|
|
786
|
+
(j) => j.selectedConnectionId
|
|
787
|
+
), [o, d] = q(!1), x = M((j) => j.filterValues), c = M((j) => j.isVisualEditing), b = M((j) => j.showFilters);
|
|
788
788
|
M(
|
|
789
|
-
(
|
|
789
|
+
(j) => j.showDashboardJSON
|
|
790
790
|
);
|
|
791
|
-
const g = M((
|
|
792
|
-
(
|
|
793
|
-
), { addFrame:
|
|
794
|
-
(
|
|
795
|
-
), { getSelectedSheet:
|
|
791
|
+
const g = M((j) => j.onSaveFunction), h = M(
|
|
792
|
+
(j) => j.actions.setShowFilters
|
|
793
|
+
), { addFrame: f, setSelectedFrameId: p } = M(
|
|
794
|
+
(j) => j.actions
|
|
795
|
+
), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: A } = M((j) => j.actions), I = N(), { tenantId: z, endUserId: T } = bs(
|
|
796
796
|
() => lt(s == null ? void 0 : s.accessToken),
|
|
797
797
|
[s == null ? void 0 : s.accessToken]
|
|
798
|
-
), L = bs(() =>
|
|
798
|
+
), L = bs(() => z || T, [z, T]), V = () => {
|
|
799
799
|
if (!r || !I) return;
|
|
800
|
-
const
|
|
801
|
-
connectionId:
|
|
800
|
+
const j = {
|
|
801
|
+
connectionId: i,
|
|
802
802
|
id: Ue(),
|
|
803
803
|
title: "Title",
|
|
804
804
|
description: "Description",
|
|
@@ -815,36 +815,36 @@ function tl() {
|
|
|
815
815
|
data: []
|
|
816
816
|
}, D = {
|
|
817
817
|
id: Ue(),
|
|
818
|
-
cards: [
|
|
819
|
-
activeCardId:
|
|
818
|
+
cards: [j],
|
|
819
|
+
activeCardId: j.id
|
|
820
820
|
};
|
|
821
|
-
|
|
821
|
+
f(I.id, D), p(D.id);
|
|
822
822
|
}, m = () => {
|
|
823
|
-
|
|
823
|
+
y(!0);
|
|
824
824
|
};
|
|
825
825
|
async function v() {
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
826
|
+
if (d(!0), !a || !t) return;
|
|
827
|
+
const j = Ea(
|
|
828
828
|
l
|
|
829
|
-
), D = JSON.stringify(
|
|
829
|
+
), D = JSON.stringify(j), S = {
|
|
830
830
|
...t,
|
|
831
831
|
template: D,
|
|
832
|
-
filterValues:
|
|
832
|
+
filterValues: x
|
|
833
833
|
};
|
|
834
|
-
await ys(
|
|
834
|
+
await ys(S, s == null ? void 0 : s.accessToken), Ge.success("Lens saved"), g == null || g(j), d(!1);
|
|
835
835
|
}
|
|
836
|
-
return
|
|
836
|
+
return c ? null : /* @__PURE__ */ e.jsxs(
|
|
837
837
|
"div",
|
|
838
838
|
{
|
|
839
839
|
className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
|
|
840
840
|
role: "dashboard-controls",
|
|
841
841
|
children: [
|
|
842
|
-
!
|
|
842
|
+
!c && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: t == null ? void 0 : t.name }) }),
|
|
843
843
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
844
844
|
/* @__PURE__ */ e.jsx(al, {}),
|
|
845
|
-
r && !
|
|
846
|
-
!
|
|
847
|
-
r && !
|
|
845
|
+
r && !c && L && /* @__PURE__ */ e.jsx(el, {}),
|
|
846
|
+
!c && L && /* @__PURE__ */ e.jsx(sl, {}),
|
|
847
|
+
r && !c && /* @__PURE__ */ e.jsxs(
|
|
848
848
|
O,
|
|
849
849
|
{
|
|
850
850
|
variant: "secondary",
|
|
@@ -868,42 +868,42 @@ function tl() {
|
|
|
868
868
|
children: /* @__PURE__ */ e.jsx(ia, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
869
869
|
}
|
|
870
870
|
),
|
|
871
|
-
r && !
|
|
871
|
+
r && !c && /* @__PURE__ */ e.jsx(
|
|
872
872
|
O,
|
|
873
873
|
{
|
|
874
874
|
variant: "ghost",
|
|
875
875
|
role: "close",
|
|
876
876
|
className: "h-7 p-2",
|
|
877
877
|
onClick: () => {
|
|
878
|
-
|
|
878
|
+
y(!1), A(!1);
|
|
879
879
|
},
|
|
880
880
|
size: "sm",
|
|
881
881
|
children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
882
882
|
}
|
|
883
883
|
),
|
|
884
|
-
r && !
|
|
884
|
+
r && !c && L && /* @__PURE__ */ e.jsx(
|
|
885
885
|
O,
|
|
886
886
|
{
|
|
887
887
|
className: "h-7 p-2",
|
|
888
888
|
variant: "ghost",
|
|
889
|
-
disabled:
|
|
889
|
+
disabled: o,
|
|
890
890
|
onClick: v,
|
|
891
891
|
size: "sm",
|
|
892
892
|
children: /* @__PURE__ */ e.jsx($n, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
893
893
|
}
|
|
894
894
|
),
|
|
895
|
-
!
|
|
895
|
+
!b && !c && r && /* @__PURE__ */ e.jsx(
|
|
896
896
|
O,
|
|
897
897
|
{
|
|
898
898
|
className: "h-7 p-2",
|
|
899
899
|
variant: "ghost",
|
|
900
|
-
onClick: () =>
|
|
900
|
+
onClick: () => h(!0),
|
|
901
901
|
size: "sm",
|
|
902
902
|
children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
903
903
|
}
|
|
904
904
|
),
|
|
905
|
-
!
|
|
906
|
-
!
|
|
905
|
+
!c && r && !1,
|
|
906
|
+
!c && !1
|
|
907
907
|
] })
|
|
908
908
|
]
|
|
909
909
|
}
|
|
@@ -916,13 +916,13 @@ function He({
|
|
|
916
916
|
isLoading: t,
|
|
917
917
|
isError: l,
|
|
918
918
|
connectionTooltip: r,
|
|
919
|
-
onChange:
|
|
920
|
-
showNone:
|
|
921
|
-
className:
|
|
922
|
-
showIcon:
|
|
923
|
-
disabled:
|
|
919
|
+
onChange: i,
|
|
920
|
+
showNone: o = !1,
|
|
921
|
+
className: d,
|
|
922
|
+
showIcon: x = !0,
|
|
923
|
+
disabled: c = !1
|
|
924
924
|
}) {
|
|
925
|
-
const
|
|
925
|
+
const b = t ? "Loading..." : l ? "Error" : a;
|
|
926
926
|
function g() {
|
|
927
927
|
if (s === "Connection")
|
|
928
928
|
return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
|
|
@@ -936,17 +936,17 @@ function He({
|
|
|
936
936
|
return /* @__PURE__ */ e.jsx(Nn, { className: "size-4" });
|
|
937
937
|
}
|
|
938
938
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
939
|
-
|
|
939
|
+
x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(Ds, { children: [
|
|
940
940
|
/* @__PURE__ */ e.jsx(ca, { children: g() }),
|
|
941
941
|
/* @__PURE__ */ e.jsx(Ms, { className: "text-xs", align: "start", children: r })
|
|
942
942
|
] }) : g() }),
|
|
943
|
-
/* @__PURE__ */ e.jsxs(ue, { disabled:
|
|
943
|
+
/* @__PURE__ */ e.jsxs(ue, { disabled: c, value: b, onValueChange: i, children: [
|
|
944
944
|
/* @__PURE__ */ e.jsx(
|
|
945
945
|
he,
|
|
946
946
|
{
|
|
947
947
|
className: Y(
|
|
948
948
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
949
|
-
|
|
949
|
+
d
|
|
950
950
|
),
|
|
951
951
|
children: /* @__PURE__ */ e.jsx(
|
|
952
952
|
me,
|
|
@@ -959,40 +959,40 @@ function He({
|
|
|
959
959
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
960
960
|
t ? /* @__PURE__ */ e.jsx(pe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(pe, { children: s }),
|
|
961
961
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
962
|
-
|
|
963
|
-
n && n.map((
|
|
962
|
+
o && /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
963
|
+
n && n.map((h, f) => /* @__PURE__ */ e.jsx(X, { value: h.id, children: h.name }, f))
|
|
964
964
|
] }),
|
|
965
|
-
(t || l) && /* @__PURE__ */ e.jsx(X, { value:
|
|
965
|
+
(t || l) && /* @__PURE__ */ e.jsx(X, { value: b, children: b })
|
|
966
966
|
] }) })
|
|
967
967
|
] })
|
|
968
968
|
] });
|
|
969
969
|
}
|
|
970
970
|
function nl({ column: s }) {
|
|
971
|
-
const [n, a] = q(!1), t =
|
|
972
|
-
(
|
|
973
|
-
), r =
|
|
974
|
-
(
|
|
975
|
-
),
|
|
976
|
-
function
|
|
971
|
+
const [n, a] = q(!1), t = u((h) => h.selectedTableName), l = u(
|
|
972
|
+
(h) => h.selectedSchemaName
|
|
973
|
+
), r = u(
|
|
974
|
+
(h) => h.selectedDatamodelId
|
|
975
|
+
), i = u((h) => h.sqlGen), { modelItems: o } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
|
|
976
|
+
function b(h, f) {
|
|
977
977
|
var A;
|
|
978
|
-
const
|
|
978
|
+
const p = da(h, i, f), N = (A = o == null ? void 0 : o.find(
|
|
979
979
|
(I) => I.id === r
|
|
980
980
|
)) == null ? void 0 : A.name;
|
|
981
|
-
|
|
982
|
-
const
|
|
983
|
-
|
|
981
|
+
d(p);
|
|
982
|
+
const y = ua(
|
|
983
|
+
p,
|
|
984
984
|
ce(l || ""),
|
|
985
985
|
ce(t),
|
|
986
|
-
|
|
986
|
+
N
|
|
987
987
|
);
|
|
988
|
-
|
|
988
|
+
y && (x(y), c(!0)), a(!1);
|
|
989
989
|
}
|
|
990
990
|
function g() {
|
|
991
991
|
return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
|
|
992
992
|
/* @__PURE__ */ e.jsx(
|
|
993
993
|
"li",
|
|
994
994
|
{
|
|
995
|
-
onClick: () =>
|
|
995
|
+
onClick: () => b(s, "COUNT"),
|
|
996
996
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
997
997
|
children: "Count"
|
|
998
998
|
}
|
|
@@ -1000,7 +1000,7 @@ function nl({ column: s }) {
|
|
|
1000
1000
|
/* @__PURE__ */ e.jsx(
|
|
1001
1001
|
"li",
|
|
1002
1002
|
{
|
|
1003
|
-
onClick: () =>
|
|
1003
|
+
onClick: () => b(s, "AVG"),
|
|
1004
1004
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1005
1005
|
children: "Avg"
|
|
1006
1006
|
}
|
|
@@ -1008,7 +1008,7 @@ function nl({ column: s }) {
|
|
|
1008
1008
|
/* @__PURE__ */ e.jsx(
|
|
1009
1009
|
"li",
|
|
1010
1010
|
{
|
|
1011
|
-
onClick: () =>
|
|
1011
|
+
onClick: () => b(s, "SUM"),
|
|
1012
1012
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1013
1013
|
children: "Sum"
|
|
1014
1014
|
}
|
|
@@ -1016,7 +1016,7 @@ function nl({ column: s }) {
|
|
|
1016
1016
|
/* @__PURE__ */ e.jsx(
|
|
1017
1017
|
"li",
|
|
1018
1018
|
{
|
|
1019
|
-
onClick: () =>
|
|
1019
|
+
onClick: () => b(s, "MAX"),
|
|
1020
1020
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1021
1021
|
children: "Max"
|
|
1022
1022
|
}
|
|
@@ -1024,7 +1024,7 @@ function nl({ column: s }) {
|
|
|
1024
1024
|
/* @__PURE__ */ e.jsx(
|
|
1025
1025
|
"li",
|
|
1026
1026
|
{
|
|
1027
|
-
onClick: () =>
|
|
1027
|
+
onClick: () => b(s, "MIN"),
|
|
1028
1028
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
1029
1029
|
children: "Min"
|
|
1030
1030
|
}
|
|
@@ -1061,56 +1061,56 @@ function ll({
|
|
|
1061
1061
|
columns: a,
|
|
1062
1062
|
status: t
|
|
1063
1063
|
}) {
|
|
1064
|
-
const l =
|
|
1064
|
+
const l = u((m) => m.sqlGen), r = u(
|
|
1065
1065
|
(m) => m.selectedConnectionId
|
|
1066
|
-
),
|
|
1066
|
+
), i = u(
|
|
1067
1067
|
(m) => m.selectedDatabaseName
|
|
1068
|
-
),
|
|
1068
|
+
), o = u(
|
|
1069
1069
|
(m) => m.selectedSchemaName
|
|
1070
|
-
),
|
|
1070
|
+
), d = u((m) => m.selectedTableName), x = u(
|
|
1071
1071
|
(m) => m.selectedDatamodelId
|
|
1072
|
-
),
|
|
1072
|
+
), c = M(
|
|
1073
1073
|
(m) => m.dashboard.aiScopeTables
|
|
1074
|
-
), { setAIScopeTables:
|
|
1074
|
+
), { setAIScopeTables: b } = M((m) => m.actions), g = u((m) => m.actions.setRunSql), h = u((m) => m.actions.setSqlGen), f = u(
|
|
1075
1075
|
(m) => m.actions.setIsShowingVisual
|
|
1076
|
-
),
|
|
1076
|
+
), p = u((m) => m.actions.setCardSql), { connectionType: N, modelItems: y } = qe();
|
|
1077
1077
|
function A(m) {
|
|
1078
|
-
var
|
|
1078
|
+
var S;
|
|
1079
1079
|
const v = da(m, l);
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1082
|
-
(_) => _.id ===
|
|
1083
|
-
)) == null ? void 0 :
|
|
1084
|
-
D && (
|
|
1080
|
+
h(v);
|
|
1081
|
+
const j = (S = y == null ? void 0 : y.find(
|
|
1082
|
+
(_) => _.id === x
|
|
1083
|
+
)) == null ? void 0 : S.name, D = ua(v, ce(s), ce(n), j);
|
|
1084
|
+
D && (p(D), g(!0));
|
|
1085
1085
|
}
|
|
1086
1086
|
function I() {
|
|
1087
|
-
return (
|
|
1088
|
-
(m) => m.connectinonId === r && m.tableName ===
|
|
1087
|
+
return (c == null ? void 0 : c.find(
|
|
1088
|
+
(m) => m.connectinonId === r && m.tableName === d
|
|
1089
1089
|
)) !== void 0;
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1092
|
-
if (m === !0 &&
|
|
1091
|
+
function z(m) {
|
|
1092
|
+
if (m === !0 && d && r) {
|
|
1093
1093
|
const v = {
|
|
1094
1094
|
connectinonId: r,
|
|
1095
|
-
connectionType:
|
|
1096
|
-
databaseName:
|
|
1097
|
-
schemaName:
|
|
1098
|
-
tableName:
|
|
1099
|
-
}, D = [...
|
|
1100
|
-
(
|
|
1101
|
-
(K) => K.connectinonId ===
|
|
1095
|
+
connectionType: N,
|
|
1096
|
+
databaseName: i,
|
|
1097
|
+
schemaName: o,
|
|
1098
|
+
tableName: d
|
|
1099
|
+
}, D = [...c || [], v].filter(
|
|
1100
|
+
(S, _, $) => $.findIndex(
|
|
1101
|
+
(K) => K.connectinonId === S.connectinonId && K.tableName === S.tableName
|
|
1102
1102
|
) === _
|
|
1103
1103
|
);
|
|
1104
|
-
|
|
1104
|
+
b(D), Ge.success(`Added '${d}' to AI Scope`, {
|
|
1105
1105
|
position: "top-right",
|
|
1106
1106
|
duration: 2500,
|
|
1107
1107
|
richColors: !0
|
|
1108
1108
|
});
|
|
1109
1109
|
} else {
|
|
1110
|
-
const v = (
|
|
1111
|
-
(
|
|
1110
|
+
const v = (c || []).filter(
|
|
1111
|
+
(j) => j.connectinonId !== r && j.tableName !== d
|
|
1112
1112
|
);
|
|
1113
|
-
|
|
1113
|
+
b(v), Ge(`Removed '${d}' from AI Scope`, {
|
|
1114
1114
|
position: "top-right",
|
|
1115
1115
|
duration: 2e3,
|
|
1116
1116
|
richColors: !0
|
|
@@ -1118,24 +1118,24 @@ function ll({
|
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
1120
|
function T() {
|
|
1121
|
-
var
|
|
1121
|
+
var S;
|
|
1122
1122
|
let m = xa(s, n);
|
|
1123
|
-
const v = (
|
|
1124
|
-
(_) => _.id ===
|
|
1125
|
-
)) == null ? void 0 :
|
|
1126
|
-
|
|
1127
|
-
let
|
|
1128
|
-
return ((_) => /[A-Z]/.test(_))(n) && (
|
|
1123
|
+
const v = (S = y == null ? void 0 : y.find(
|
|
1124
|
+
(_) => _.id === x
|
|
1125
|
+
)) == null ? void 0 : S.name;
|
|
1126
|
+
x && x !== "none" && (m = `${gs}.${v}`);
|
|
1127
|
+
let j = m;
|
|
1128
|
+
return ((_) => /[A-Z]/.test(_))(n) && (j = j.split(".").map(($) => `"${$}"`).join(".")), j;
|
|
1129
1129
|
}
|
|
1130
1130
|
function L() {
|
|
1131
1131
|
const m = T();
|
|
1132
|
-
|
|
1133
|
-
const v =
|
|
1134
|
-
|
|
1132
|
+
f(!1);
|
|
1133
|
+
const v = N === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
|
|
1134
|
+
p(v), g(!0);
|
|
1135
1135
|
}
|
|
1136
1136
|
function V() {
|
|
1137
1137
|
const m = T();
|
|
1138
|
-
|
|
1138
|
+
p(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
|
|
1139
1139
|
}
|
|
1140
1140
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
1141
1141
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
@@ -1144,7 +1144,7 @@ function ll({
|
|
|
1144
1144
|
{
|
|
1145
1145
|
title: `${I() ? "Remove from" : "Add to"} AI Scope`,
|
|
1146
1146
|
pressed: I(),
|
|
1147
|
-
onPressedChange:
|
|
1147
|
+
onPressedChange: z,
|
|
1148
1148
|
variant: "outline",
|
|
1149
1149
|
className: "h-9 px-2",
|
|
1150
1150
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -1229,39 +1229,39 @@ function ll({
|
|
|
1229
1229
|
function qe(s, n) {
|
|
1230
1230
|
var Je, Ps, $s, Bs, Us;
|
|
1231
1231
|
let a = bs(() => [], []);
|
|
1232
|
-
const t = Se().authToken || s, l =
|
|
1232
|
+
const t = Se().authToken || s, l = u(
|
|
1233
1233
|
(C) => C.selectedConnectionId
|
|
1234
|
-
), r =
|
|
1234
|
+
), r = u(
|
|
1235
1235
|
(C) => C.selectedDatamodelId
|
|
1236
|
-
),
|
|
1236
|
+
), i = u(
|
|
1237
1237
|
(C) => C.selectedDatabaseName
|
|
1238
|
-
),
|
|
1238
|
+
), o = u(
|
|
1239
1239
|
(C) => C.selectedSchemaName
|
|
1240
|
-
),
|
|
1240
|
+
), d = u((C) => C.selectedTableName), x = u(
|
|
1241
1241
|
(C) => C.actions.setCurrentColumns
|
|
1242
|
-
),
|
|
1242
|
+
), c = u(
|
|
1243
1243
|
(C) => C.actions.setSelectedConnectionId
|
|
1244
|
-
),
|
|
1244
|
+
), b = u(
|
|
1245
1245
|
(C) => C.actions.setSelectedDatamodelId
|
|
1246
|
-
), g =
|
|
1246
|
+
), g = u(
|
|
1247
1247
|
(C) => C.actions.setSelectedDatabaseName
|
|
1248
|
-
),
|
|
1248
|
+
), h = u(
|
|
1249
1249
|
(C) => C.actions.setSelectedSchemaName
|
|
1250
|
-
),
|
|
1250
|
+
), f = u(
|
|
1251
1251
|
(C) => C.actions.setSelectedTableName
|
|
1252
|
-
),
|
|
1253
|
-
function
|
|
1254
|
-
return l &&
|
|
1252
|
+
), p = u((C) => C.actions.setCardSql);
|
|
1253
|
+
function N(C) {
|
|
1254
|
+
return l && i && o && i !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1257
|
-
return !!(l &&
|
|
1256
|
+
function y(C) {
|
|
1257
|
+
return !!(l && i && i !== "NA" && o && d || l && (C === "S3" || C === "API") || r && r);
|
|
1258
1258
|
}
|
|
1259
1259
|
function A(C) {
|
|
1260
1260
|
return l && C ? !(C === "API" || C === "S3") : !1;
|
|
1261
1261
|
}
|
|
1262
1262
|
const {
|
|
1263
1263
|
data: I,
|
|
1264
|
-
isLoading:
|
|
1264
|
+
isLoading: z,
|
|
1265
1265
|
isError: T
|
|
1266
1266
|
} = be({
|
|
1267
1267
|
queryKey: ["connections"],
|
|
@@ -1288,8 +1288,8 @@ function qe(s, n) {
|
|
|
1288
1288
|
// Only fetch if authToken is present
|
|
1289
1289
|
}), v = I == null ? void 0 : I.connections.find(
|
|
1290
1290
|
(C) => C.id === l
|
|
1291
|
-
),
|
|
1292
|
-
data:
|
|
1291
|
+
), j = v == null ? void 0 : v.type, D = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1292
|
+
data: S,
|
|
1293
1293
|
isLoading: _,
|
|
1294
1294
|
isFetching: $,
|
|
1295
1295
|
isError: K,
|
|
@@ -1303,49 +1303,49 @@ function qe(s, n) {
|
|
|
1303
1303
|
connection_id: l
|
|
1304
1304
|
}
|
|
1305
1305
|
),
|
|
1306
|
-
enabled: A(
|
|
1306
|
+
enabled: A(j)
|
|
1307
1307
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1308
1308
|
}), {
|
|
1309
1309
|
data: G,
|
|
1310
1310
|
isLoading: se,
|
|
1311
|
-
isFetching:
|
|
1311
|
+
isFetching: k,
|
|
1312
1312
|
isError: P,
|
|
1313
1313
|
refetch: U
|
|
1314
1314
|
} = be({
|
|
1315
|
-
queryKey: ["schemas", l,
|
|
1315
|
+
queryKey: ["schemas", l, i],
|
|
1316
1316
|
queryFn: () => ze(
|
|
1317
1317
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1318
1318
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1319
1319
|
{
|
|
1320
1320
|
connection_id: l,
|
|
1321
|
-
database_name:
|
|
1321
|
+
database_name: i
|
|
1322
1322
|
}
|
|
1323
1323
|
),
|
|
1324
|
-
enabled: !!l && !!
|
|
1324
|
+
enabled: !!l && !!i && !D && i !== "NA"
|
|
1325
1325
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1326
1326
|
}), {
|
|
1327
1327
|
data: E,
|
|
1328
1328
|
isLoading: F,
|
|
1329
|
-
isFetching:
|
|
1329
|
+
isFetching: re,
|
|
1330
1330
|
isError: B,
|
|
1331
1331
|
refetch: ae
|
|
1332
1332
|
} = be({
|
|
1333
1333
|
queryKey: [
|
|
1334
1334
|
"tables",
|
|
1335
1335
|
l,
|
|
1336
|
-
|
|
1337
|
-
|
|
1336
|
+
i,
|
|
1337
|
+
o
|
|
1338
1338
|
],
|
|
1339
1339
|
queryFn: () => ze(
|
|
1340
1340
|
"https://semaphor.cloud/api/v1/tables",
|
|
1341
1341
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1342
1342
|
{
|
|
1343
1343
|
connection_id: l,
|
|
1344
|
-
database_name:
|
|
1345
|
-
schema_name:
|
|
1344
|
+
database_name: i,
|
|
1345
|
+
schema_name: o
|
|
1346
1346
|
}
|
|
1347
1347
|
),
|
|
1348
|
-
enabled:
|
|
1348
|
+
enabled: N(j)
|
|
1349
1349
|
}), {
|
|
1350
1350
|
data: te,
|
|
1351
1351
|
isLoading: je,
|
|
@@ -1355,10 +1355,10 @@ function qe(s, n) {
|
|
|
1355
1355
|
queryKey: [
|
|
1356
1356
|
"columns",
|
|
1357
1357
|
l,
|
|
1358
|
-
c,
|
|
1359
|
-
r,
|
|
1360
1358
|
i,
|
|
1361
|
-
|
|
1359
|
+
r,
|
|
1360
|
+
o,
|
|
1361
|
+
d
|
|
1362
1362
|
],
|
|
1363
1363
|
queryFn: () => ze(
|
|
1364
1364
|
"https://semaphor.cloud/api/v1/columns",
|
|
@@ -1367,12 +1367,12 @@ function qe(s, n) {
|
|
|
1367
1367
|
connection_id: l,
|
|
1368
1368
|
datamodel_id: r || "",
|
|
1369
1369
|
// don't pass undefined. Pass empty string
|
|
1370
|
-
database_name:
|
|
1371
|
-
schema_name:
|
|
1372
|
-
table_name:
|
|
1370
|
+
database_name: i,
|
|
1371
|
+
schema_name: o,
|
|
1372
|
+
table_name: d
|
|
1373
1373
|
}
|
|
1374
1374
|
),
|
|
1375
|
-
enabled:
|
|
1375
|
+
enabled: y(j)
|
|
1376
1376
|
// (!!selectedConnectionId &&
|
|
1377
1377
|
// !!selectedDatabaseName &&
|
|
1378
1378
|
// !!selectedSchemaName &&
|
|
@@ -1382,30 +1382,30 @@ function qe(s, n) {
|
|
|
1382
1382
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1383
1383
|
});
|
|
1384
1384
|
Z(() => {
|
|
1385
|
-
|
|
1386
|
-
}, [te,
|
|
1385
|
+
x(a);
|
|
1386
|
+
}, [te, x, a]), Z(() => {
|
|
1387
1387
|
}, [
|
|
1388
1388
|
D,
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1389
|
+
p,
|
|
1390
|
+
f,
|
|
1391
|
+
h,
|
|
1392
1392
|
g,
|
|
1393
1393
|
v
|
|
1394
1394
|
]);
|
|
1395
|
-
const Le = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() :
|
|
1395
|
+
const Le = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Fe = D ? "" : o || "";
|
|
1396
1396
|
function Ee(C) {
|
|
1397
|
-
|
|
1397
|
+
h(C), f("");
|
|
1398
1398
|
}
|
|
1399
1399
|
function Ae(C) {
|
|
1400
|
-
g(C === "none" ? "" : C),
|
|
1400
|
+
g(C === "none" ? "" : C), h(""), f(""), C !== "none" && C !== "" && b("");
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1403
|
-
|
|
1402
|
+
function w(C) {
|
|
1403
|
+
c(C);
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1406
|
-
|
|
1405
|
+
function le(C) {
|
|
1406
|
+
b(C === "none" ? "" : C), C !== "none" && C !== "" && g("");
|
|
1407
1407
|
}
|
|
1408
|
-
|
|
1408
|
+
S && ((Ps = S == null ? void 0 : S.databases) == null ? void 0 : Ps.length) > 0, G && (($s = G == null ? void 0 : G.schemas) == null ? void 0 : $s.length) > 0, te && ((Bs = te == null ? void 0 : te.columns) == null ? void 0 : Bs.length) > 0 && (a = te.columns.map((C) => ({
|
|
1409
1409
|
...C,
|
|
1410
1410
|
data_type: C.data_type.toLowerCase()
|
|
1411
1411
|
}))), K && (a = []), (we || T) && (a = []);
|
|
@@ -1418,7 +1418,7 @@ function qe(s, n) {
|
|
|
1418
1418
|
), oe = (Us = L == null ? void 0 : L.datamodels) == null ? void 0 : Us.map((C) => ({
|
|
1419
1419
|
id: C.id,
|
|
1420
1420
|
name: C.name
|
|
1421
|
-
})), _e =
|
|
1421
|
+
})), _e = S == null ? void 0 : S.databases.map((C) => ({
|
|
1422
1422
|
id: C.database_name,
|
|
1423
1423
|
name: C.database_name
|
|
1424
1424
|
})), ps = G == null ? void 0 : G.schemas.map((C) => ({
|
|
@@ -1430,7 +1430,7 @@ function qe(s, n) {
|
|
|
1430
1430
|
}));
|
|
1431
1431
|
return {
|
|
1432
1432
|
connectionItems: ke,
|
|
1433
|
-
isConnectionsLoading:
|
|
1433
|
+
isConnectionsLoading: z,
|
|
1434
1434
|
isConnectionsError: T,
|
|
1435
1435
|
modelItems: oe,
|
|
1436
1436
|
isModelsLoading: V,
|
|
@@ -1439,20 +1439,20 @@ function qe(s, n) {
|
|
|
1439
1439
|
isDatabasesLoadingOrFetching: _ || $,
|
|
1440
1440
|
isDatabaseError: K,
|
|
1441
1441
|
schemaItems: ps,
|
|
1442
|
-
isSchemaLoadingOrFetching: se ||
|
|
1442
|
+
isSchemaLoadingOrFetching: se || k,
|
|
1443
1443
|
isSchemaError: P,
|
|
1444
1444
|
tableItems: Qe,
|
|
1445
|
-
isTableLoadingOrFetching: F ||
|
|
1445
|
+
isTableLoadingOrFetching: F || re,
|
|
1446
1446
|
isTableError: B,
|
|
1447
1447
|
columns: a,
|
|
1448
1448
|
isColumnsLoadingOrFetching: je || Te,
|
|
1449
1449
|
isColumnsError: we,
|
|
1450
1450
|
isNonDbConnection: D,
|
|
1451
|
-
connectionType:
|
|
1451
|
+
connectionType: j,
|
|
1452
1452
|
tableName: Le,
|
|
1453
1453
|
schemaName: Fe,
|
|
1454
|
-
handleConnectionChange:
|
|
1455
|
-
handleDatamodelChange:
|
|
1454
|
+
handleConnectionChange: w,
|
|
1455
|
+
handleDatamodelChange: le,
|
|
1456
1456
|
handleDatabaseChange: Ae,
|
|
1457
1457
|
handleSchemaChange: Ee
|
|
1458
1458
|
};
|
|
@@ -1460,40 +1460,40 @@ function qe(s, n) {
|
|
|
1460
1460
|
function Va({
|
|
1461
1461
|
ColumnsComponent: s
|
|
1462
1462
|
}) {
|
|
1463
|
-
var
|
|
1464
|
-
const n =
|
|
1463
|
+
var re;
|
|
1464
|
+
const n = u(
|
|
1465
1465
|
(B) => B.selectedConnectionId
|
|
1466
|
-
), a =
|
|
1466
|
+
), a = u(
|
|
1467
1467
|
(B) => B.selectedDatamodelId
|
|
1468
|
-
), t =
|
|
1468
|
+
), t = u(
|
|
1469
1469
|
(B) => B.selectedDatabaseName
|
|
1470
|
-
), l =
|
|
1470
|
+
), l = u(
|
|
1471
1471
|
(B) => B.selectedSchemaName
|
|
1472
|
-
), r =
|
|
1472
|
+
), r = u((B) => B.selectedTableName), i = u(
|
|
1473
1473
|
(B) => B.actions.setSelectedTableName
|
|
1474
1474
|
), {
|
|
1475
|
-
connectionItems:
|
|
1476
|
-
modelItems:
|
|
1477
|
-
schemaItems:
|
|
1478
|
-
databaseItems:
|
|
1479
|
-
tableItems:
|
|
1475
|
+
connectionItems: o,
|
|
1476
|
+
modelItems: d,
|
|
1477
|
+
schemaItems: x,
|
|
1478
|
+
databaseItems: c,
|
|
1479
|
+
tableItems: b,
|
|
1480
1480
|
columns: g,
|
|
1481
|
-
isConnectionsLoading:
|
|
1482
|
-
isModelsLoading:
|
|
1483
|
-
isConnectionsError:
|
|
1484
|
-
isModelsError:
|
|
1485
|
-
isDatabasesLoadingOrFetching:
|
|
1481
|
+
isConnectionsLoading: h,
|
|
1482
|
+
isModelsLoading: f,
|
|
1483
|
+
isConnectionsError: p,
|
|
1484
|
+
isModelsError: N,
|
|
1485
|
+
isDatabasesLoadingOrFetching: y,
|
|
1486
1486
|
isDatabaseError: A,
|
|
1487
1487
|
isSchemaLoadingOrFetching: I,
|
|
1488
|
-
isSchemaError:
|
|
1488
|
+
isSchemaError: z,
|
|
1489
1489
|
isColumnsError: T,
|
|
1490
1490
|
isColumnsLoadingOrFetching: L,
|
|
1491
1491
|
isTableLoadingOrFetching: V,
|
|
1492
1492
|
isTableError: m,
|
|
1493
1493
|
connectionType: v,
|
|
1494
|
-
isNonDbConnection:
|
|
1494
|
+
isNonDbConnection: j,
|
|
1495
1495
|
handleConnectionChange: D,
|
|
1496
|
-
handleDatabaseChange:
|
|
1496
|
+
handleDatabaseChange: S,
|
|
1497
1497
|
handleSchemaChange: _,
|
|
1498
1498
|
handleDatamodelChange: $,
|
|
1499
1499
|
tableName: K,
|
|
@@ -1513,24 +1513,24 @@ function Va({
|
|
|
1513
1513
|
function se() {
|
|
1514
1514
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function k() {
|
|
1517
1517
|
if (!n || v === "S3" || v === "API") return null;
|
|
1518
1518
|
if (!a || a === "none")
|
|
1519
1519
|
return /* @__PURE__ */ e.jsx(
|
|
1520
1520
|
He,
|
|
1521
1521
|
{
|
|
1522
1522
|
showNone: !0,
|
|
1523
|
-
onChange:
|
|
1523
|
+
onChange: S,
|
|
1524
1524
|
isError: A,
|
|
1525
|
-
isLoading:
|
|
1526
|
-
items:
|
|
1525
|
+
isLoading: y,
|
|
1526
|
+
items: c,
|
|
1527
1527
|
value: t || "",
|
|
1528
1528
|
title: "Database"
|
|
1529
1529
|
}
|
|
1530
1530
|
);
|
|
1531
1531
|
}
|
|
1532
1532
|
function P() {
|
|
1533
|
-
if (n && !
|
|
1533
|
+
if (n && !j && (!t || t === "none") && (!a || a === "none"))
|
|
1534
1534
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1535
1535
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ce, {}) }),
|
|
1536
1536
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(H, { children: "OR" }) }),
|
|
@@ -1545,9 +1545,9 @@ function Va({
|
|
|
1545
1545
|
{
|
|
1546
1546
|
showNone: !0,
|
|
1547
1547
|
onChange: $,
|
|
1548
|
-
isError:
|
|
1549
|
-
isLoading:
|
|
1550
|
-
items:
|
|
1548
|
+
isError: N,
|
|
1549
|
+
isLoading: f,
|
|
1550
|
+
items: d,
|
|
1551
1551
|
value: a || "",
|
|
1552
1552
|
title: "Model"
|
|
1553
1553
|
}
|
|
@@ -1558,9 +1558,9 @@ function Va({
|
|
|
1558
1558
|
He,
|
|
1559
1559
|
{
|
|
1560
1560
|
onChange: _,
|
|
1561
|
-
isError:
|
|
1561
|
+
isError: z,
|
|
1562
1562
|
isLoading: I,
|
|
1563
|
-
items:
|
|
1563
|
+
items: x,
|
|
1564
1564
|
value: l || "",
|
|
1565
1565
|
title: "Schema"
|
|
1566
1566
|
}
|
|
@@ -1574,9 +1574,9 @@ function Va({
|
|
|
1574
1574
|
return B() ? /* @__PURE__ */ e.jsx(
|
|
1575
1575
|
He,
|
|
1576
1576
|
{
|
|
1577
|
-
onChange:
|
|
1577
|
+
onChange: i,
|
|
1578
1578
|
isError: m,
|
|
1579
|
-
items:
|
|
1579
|
+
items: b,
|
|
1580
1580
|
isLoading: V,
|
|
1581
1581
|
value: r || "",
|
|
1582
1582
|
title: "Table"
|
|
@@ -1588,20 +1588,20 @@ function Va({
|
|
|
1588
1588
|
/* @__PURE__ */ e.jsx(
|
|
1589
1589
|
He,
|
|
1590
1590
|
{
|
|
1591
|
-
items:
|
|
1591
|
+
items: o,
|
|
1592
1592
|
title: "Connection",
|
|
1593
1593
|
value: n || "",
|
|
1594
1594
|
onChange: D,
|
|
1595
|
-
isLoading:
|
|
1596
|
-
isError:
|
|
1597
|
-
connectionTooltip: ((
|
|
1595
|
+
isLoading: h,
|
|
1596
|
+
isError: p,
|
|
1597
|
+
connectionTooltip: ((re = o == null ? void 0 : o.find(
|
|
1598
1598
|
(B) => B.id === n
|
|
1599
|
-
)) == null ? void 0 :
|
|
1599
|
+
)) == null ? void 0 : re.type) || ""
|
|
1600
1600
|
}
|
|
1601
1601
|
),
|
|
1602
1602
|
U(),
|
|
1603
1603
|
P(),
|
|
1604
|
-
|
|
1604
|
+
k(),
|
|
1605
1605
|
E(),
|
|
1606
1606
|
F()
|
|
1607
1607
|
] }),
|
|
@@ -1625,16 +1625,16 @@ function rl(s) {
|
|
|
1625
1625
|
const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1626
1626
|
let r = s.length;
|
|
1627
1627
|
if (l !== -1 && (r = l), t !== -1 && t < r && (r = t), n !== -1) {
|
|
1628
|
-
const
|
|
1629
|
-
return `${
|
|
1628
|
+
const i = s.substring(0, n), o = s.substring(n);
|
|
1629
|
+
return `${i} {{ filters | where }} AND ${o.substring(
|
|
1630
1630
|
6
|
|
1631
1631
|
)}`;
|
|
1632
1632
|
} else if (a !== -1) {
|
|
1633
|
-
const
|
|
1634
|
-
return `${
|
|
1633
|
+
const i = s.substring(0, a), o = s.substring(a);
|
|
1634
|
+
return `${i} {{ filters | where }} ${o}`;
|
|
1635
1635
|
} else {
|
|
1636
|
-
const
|
|
1637
|
-
return `${
|
|
1636
|
+
const i = s.substring(0, r), o = s.substring(r);
|
|
1637
|
+
return `${i} {{ filters | where }} ${o}`;
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
1640
|
function il({
|
|
@@ -1726,64 +1726,64 @@ function cl({
|
|
|
1726
1726
|
triggerAIRun: l,
|
|
1727
1727
|
setTriggerAIRun: r
|
|
1728
1728
|
}) {
|
|
1729
|
-
const
|
|
1729
|
+
const i = ns(null), o = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), A = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
|
|
1730
1730
|
${a}
|
|
1731
1731
|
|
|
1732
1732
|
Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
|
|
1733
1733
|
Table Name: ${I}
|
|
1734
|
-
Table Columns: ${
|
|
1734
|
+
Table Columns: ${y == null ? void 0 : y.map((k) => `${k.column_name} | ${k.data_type}`).join(", ")}
|
|
1735
1735
|
User SQL: ${A}
|
|
1736
1736
|
${g && `Base Queries: ${JSON.stringify(g)} `}`, T = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1737
|
-
Visual Query Syntax: ${ol}`, { data: L, isLoading: V, isFetching: m, isError: v, refetch:
|
|
1737
|
+
Visual Query Syntax: ${ol}`, { data: L, isLoading: V, isFetching: m, isError: v, refetch: j } = be({
|
|
1738
1738
|
queryKey: ["ai-query"],
|
|
1739
1739
|
queryFn: () => ze(
|
|
1740
1740
|
"https://semaphor.cloud/api/v1/ai",
|
|
1741
|
-
(
|
|
1741
|
+
(d == null ? void 0 : d.accessToken) || "",
|
|
1742
1742
|
{
|
|
1743
|
-
user_content: `userContent: ${
|
|
1743
|
+
user_content: `userContent: ${z} ${x ? T : ""}`
|
|
1744
1744
|
}
|
|
1745
1745
|
),
|
|
1746
1746
|
enabled: !1
|
|
1747
1747
|
// Do not run by default.
|
|
1748
1748
|
});
|
|
1749
|
-
function D(
|
|
1750
|
-
if (
|
|
1751
|
-
|
|
1752
|
-
else if (
|
|
1753
|
-
|
|
1754
|
-
else if (
|
|
1755
|
-
|
|
1756
|
-
else if (
|
|
1757
|
-
|
|
1758
|
-
else if (
|
|
1759
|
-
|
|
1760
|
-
else if (
|
|
1761
|
-
|
|
1762
|
-
else if (
|
|
1763
|
-
|
|
1764
|
-
else if (
|
|
1765
|
-
|
|
1749
|
+
function D(k) {
|
|
1750
|
+
if (k.toLowerCase().includes("bar"))
|
|
1751
|
+
f("bar");
|
|
1752
|
+
else if (k.toLowerCase().includes("line"))
|
|
1753
|
+
f("line");
|
|
1754
|
+
else if (k.toLowerCase().includes("bubble"))
|
|
1755
|
+
f("bubble");
|
|
1756
|
+
else if (k.toLowerCase().includes("scatter"))
|
|
1757
|
+
f("scatter");
|
|
1758
|
+
else if (k.toLowerCase().includes("stacked"))
|
|
1759
|
+
f("stackedBar");
|
|
1760
|
+
else if (k.toLowerCase().includes("pie"))
|
|
1761
|
+
f("pie");
|
|
1762
|
+
else if (k.toLowerCase().includes("donut") || k.toLowerCase().includes("doughnut"))
|
|
1763
|
+
f("doughnut");
|
|
1764
|
+
else if (k.toLowerCase().includes("radar"))
|
|
1765
|
+
f("radar");
|
|
1766
1766
|
else
|
|
1767
|
-
return
|
|
1767
|
+
return f("bar"), !1;
|
|
1768
1768
|
return !0;
|
|
1769
1769
|
}
|
|
1770
1770
|
Z(() => {
|
|
1771
|
-
L &&
|
|
1771
|
+
L && N((k) => [...k, { role: "ai", content: L.response }]);
|
|
1772
1772
|
}, [L]), Z(() => {
|
|
1773
|
-
const
|
|
1773
|
+
const k = setTimeout(() => {
|
|
1774
1774
|
var P;
|
|
1775
|
-
|
|
1776
|
-
top:
|
|
1775
|
+
o.current && (o.current.scroll({
|
|
1776
|
+
top: o.current.scrollHeight,
|
|
1777
1777
|
behavior: "smooth"
|
|
1778
|
-
}), (P =
|
|
1778
|
+
}), (P = i.current) == null || P.focus());
|
|
1779
1779
|
}, 100);
|
|
1780
|
-
return () => clearTimeout(
|
|
1781
|
-
}, [
|
|
1782
|
-
function
|
|
1783
|
-
a && (
|
|
1780
|
+
return () => clearTimeout(k);
|
|
1781
|
+
}, [p]);
|
|
1782
|
+
function S() {
|
|
1783
|
+
a && (N((k) => [...k, { role: "user", content: a }]), D(a) && c(!0), t(""), j());
|
|
1784
1784
|
}
|
|
1785
1785
|
Z(() => {
|
|
1786
|
-
l && (
|
|
1786
|
+
l && (S(), r(!1));
|
|
1787
1787
|
}, [l, r]);
|
|
1788
1788
|
const _ = {
|
|
1789
1789
|
//seleect a darker color
|
|
@@ -1812,9 +1812,9 @@ function cl({
|
|
|
1812
1812
|
listStyleType: "disc"
|
|
1813
1813
|
}, ee = {
|
|
1814
1814
|
// Override how paragraphs are rendered
|
|
1815
|
-
p: ({ node:
|
|
1816
|
-
code: ({ node:
|
|
1817
|
-
pre: ({ node:
|
|
1815
|
+
p: ({ node: k, ...P }) => /* @__PURE__ */ e.jsx("p", { style: _, ...P }),
|
|
1816
|
+
code: ({ node: k, ...P }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...P }),
|
|
1817
|
+
pre: ({ node: k, ...P }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: $, children: [
|
|
1818
1818
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: P.children }),
|
|
1819
1819
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1820
1820
|
/* @__PURE__ */ e.jsx(O, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(pt, {}) }),
|
|
@@ -1823,7 +1823,7 @@ function cl({
|
|
|
1823
1823
|
{
|
|
1824
1824
|
onClick: (U) => {
|
|
1825
1825
|
const E = G(U);
|
|
1826
|
-
E && (n(!1),
|
|
1826
|
+
E && (n(!1), b(E), h(!0));
|
|
1827
1827
|
},
|
|
1828
1828
|
size: "sm",
|
|
1829
1829
|
variant: "outline",
|
|
@@ -1832,27 +1832,27 @@ function cl({
|
|
|
1832
1832
|
)
|
|
1833
1833
|
] })
|
|
1834
1834
|
] }),
|
|
1835
|
-
li: ({ node:
|
|
1835
|
+
li: ({ node: k, ...P }) => /* @__PURE__ */ e.jsx("li", { style: K, ...P })
|
|
1836
1836
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1837
1837
|
};
|
|
1838
|
-
function G(
|
|
1839
|
-
const P =
|
|
1838
|
+
function G(k) {
|
|
1839
|
+
const P = k.currentTarget.closest("pre");
|
|
1840
1840
|
if (!P) return;
|
|
1841
1841
|
const U = P.textContent || P.innerText;
|
|
1842
1842
|
return navigator.clipboard.writeText(U).then(() => console.log("Text copied to clipboard")).catch((E) => console.error("Error in copying text: ", E)), U;
|
|
1843
1843
|
}
|
|
1844
1844
|
function se() {
|
|
1845
|
-
return
|
|
1845
|
+
return p == null ? void 0 : p.map((k, P) => k.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1846
1846
|
"div",
|
|
1847
1847
|
{
|
|
1848
1848
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1849
1849
|
children: [
|
|
1850
1850
|
/* @__PURE__ */ e.jsx(Jn, { className: "mr-2 h-5 w-5" }),
|
|
1851
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1851
|
+
/* @__PURE__ */ e.jsx("div", { children: k.content })
|
|
1852
1852
|
]
|
|
1853
1853
|
},
|
|
1854
1854
|
P
|
|
1855
|
-
) :
|
|
1855
|
+
) : k.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1856
1856
|
xt,
|
|
1857
1857
|
{
|
|
1858
1858
|
className: "w-full overflow-auto py-1",
|
|
@@ -1884,7 +1884,7 @@ function cl({
|
|
|
1884
1884
|
/* @__PURE__ */ e.jsx(
|
|
1885
1885
|
"div",
|
|
1886
1886
|
{
|
|
1887
|
-
ref:
|
|
1887
|
+
ref: o,
|
|
1888
1888
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
1889
1889
|
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: se() })
|
|
1890
1890
|
}
|
|
@@ -1897,13 +1897,13 @@ function cl({
|
|
|
1897
1897
|
pa,
|
|
1898
1898
|
{
|
|
1899
1899
|
autoFocus: !0,
|
|
1900
|
-
ref:
|
|
1901
|
-
onKeyDown: (
|
|
1902
|
-
|
|
1900
|
+
ref: i,
|
|
1901
|
+
onKeyDown: (k) => {
|
|
1902
|
+
k.key === "Enter" && !k.shiftKey && (k.preventDefault(), t(""), S());
|
|
1903
1903
|
},
|
|
1904
1904
|
placeholder: "Type your question here...",
|
|
1905
|
-
onFocus: (
|
|
1906
|
-
const P =
|
|
1905
|
+
onFocus: (k) => {
|
|
1906
|
+
const P = k.target, U = P.value.length;
|
|
1907
1907
|
P.setSelectionRange(U, U);
|
|
1908
1908
|
},
|
|
1909
1909
|
className: Y(
|
|
@@ -1911,7 +1911,7 @@ function cl({
|
|
|
1911
1911
|
),
|
|
1912
1912
|
disabled: V || m,
|
|
1913
1913
|
value: a,
|
|
1914
|
-
onChange: (
|
|
1914
|
+
onChange: (k) => t(k.target.value)
|
|
1915
1915
|
}
|
|
1916
1916
|
),
|
|
1917
1917
|
" ",
|
|
@@ -1921,7 +1921,7 @@ function cl({
|
|
|
1921
1921
|
className: "h-8",
|
|
1922
1922
|
size: "sm",
|
|
1923
1923
|
variant: "ghost",
|
|
1924
|
-
onClick:
|
|
1924
|
+
onClick: S,
|
|
1925
1925
|
children: !V && !m ? /* @__PURE__ */ e.jsx(mt, {}) : /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1926
1926
|
}
|
|
1927
1927
|
)
|
|
@@ -2024,18 +2024,18 @@ function fl(s) {
|
|
|
2024
2024
|
attr: t,
|
|
2025
2025
|
size: l,
|
|
2026
2026
|
title: r
|
|
2027
|
-
} = s,
|
|
2028
|
-
return a.className && (
|
|
2027
|
+
} = s, i = ul(s, dl), o = l || a.size || "1em", d;
|
|
2028
|
+
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ Ne.createElement("svg", ls({
|
|
2029
2029
|
stroke: "currentColor",
|
|
2030
2030
|
fill: "currentColor",
|
|
2031
2031
|
strokeWidth: "0"
|
|
2032
|
-
}, a.attr, t,
|
|
2033
|
-
className:
|
|
2032
|
+
}, a.attr, t, i, {
|
|
2033
|
+
className: d,
|
|
2034
2034
|
style: rs(rs({
|
|
2035
2035
|
color: s.color || a.color
|
|
2036
2036
|
}, a.style), s.style),
|
|
2037
|
-
height:
|
|
2038
|
-
width:
|
|
2037
|
+
height: o,
|
|
2038
|
+
width: o,
|
|
2039
2039
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2040
2040
|
}), r && /* @__PURE__ */ Ne.createElement("title", null, r), s.children);
|
|
2041
2041
|
};
|
|
@@ -2061,70 +2061,70 @@ function jl({ sql: s }) {
|
|
|
2061
2061
|
] });
|
|
2062
2062
|
}
|
|
2063
2063
|
function _a(s) {
|
|
2064
|
-
const { theme: n } = jt(), a = M((
|
|
2065
|
-
let
|
|
2066
|
-
return s === "python" && (
|
|
2067
|
-
}, [s]);
|
|
2064
|
+
const { theme: n } = jt(), a = M((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), i = bt(), { refetch: o } = De(l), { updateCardTab: d, setRunSql: x } = ne(), c = ns(), b = ns({}), g = t.cards.find((p) => p.id === r), h = Oa(() => {
|
|
2065
|
+
let p = "";
|
|
2066
|
+
return s === "python" && (p = (g == null ? void 0 : g.python) || fa), s === "sql" && (p = (g == null ? void 0 : g.sql) || ""), p;
|
|
2067
|
+
}, [s, g]);
|
|
2068
2068
|
Z(() => {
|
|
2069
|
-
if (
|
|
2070
|
-
if (
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2073
|
-
let
|
|
2074
|
-
if (!
|
|
2075
|
-
const y =
|
|
2076
|
-
|
|
2069
|
+
if (r && l.id && l.id !== r) {
|
|
2070
|
+
if (c.current && i) {
|
|
2071
|
+
const p = c.current.getModel();
|
|
2072
|
+
p && (b.current[l.id] = p);
|
|
2073
|
+
let N = b.current[r];
|
|
2074
|
+
if (!N) {
|
|
2075
|
+
const y = h();
|
|
2076
|
+
N = i.editor.createModel(y, s), b.current[r] = N;
|
|
2077
2077
|
}
|
|
2078
|
-
|
|
2078
|
+
c.current.setModel(N);
|
|
2079
2079
|
}
|
|
2080
|
-
|
|
2080
|
+
d(r, l), x(!0);
|
|
2081
2081
|
}
|
|
2082
2082
|
}, [
|
|
2083
|
+
r,
|
|
2083
2084
|
l,
|
|
2084
|
-
|
|
2085
|
+
d,
|
|
2085
2086
|
i,
|
|
2086
|
-
|
|
2087
|
-
u,
|
|
2087
|
+
x,
|
|
2088
2088
|
s,
|
|
2089
|
-
|
|
2089
|
+
h
|
|
2090
2090
|
]), Z(() => {
|
|
2091
|
-
if (!
|
|
2092
|
-
const
|
|
2093
|
-
|
|
2091
|
+
if (!i) return;
|
|
2092
|
+
const p = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = a === "system" ? p : a;
|
|
2093
|
+
i.editor.defineTheme("default", {
|
|
2094
2094
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2095
|
-
base:
|
|
2095
|
+
base: N === "light" ? "vs" : "vs-dark",
|
|
2096
2096
|
inherit: !0,
|
|
2097
2097
|
rules: [],
|
|
2098
2098
|
colors: {
|
|
2099
|
-
"editor.background":
|
|
2099
|
+
"editor.background": N === "light" ? "#ffffff" : yt("240 10% 10%")
|
|
2100
2100
|
// 'editor.background':
|
|
2101
2101
|
// activeTheme === 'light'
|
|
2102
2102
|
// ? '#ffffff'
|
|
2103
2103
|
// : getCssVariableValue('--semaphor-background'),
|
|
2104
2104
|
}
|
|
2105
|
-
}),
|
|
2106
|
-
}, [n, a,
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2109
|
-
|
|
2105
|
+
}), i.editor.setTheme("default");
|
|
2106
|
+
}, [n, a, i]), Z(() => {
|
|
2107
|
+
const p = c.current;
|
|
2108
|
+
p && i && l && p.addCommand(
|
|
2109
|
+
i.KeyMod.Shift | i.KeyCode.Enter,
|
|
2110
2110
|
function() {
|
|
2111
|
-
return
|
|
2111
|
+
return o(), !1;
|
|
2112
2112
|
}
|
|
2113
2113
|
);
|
|
2114
|
-
}, [
|
|
2115
|
-
function
|
|
2116
|
-
if (
|
|
2117
|
-
const y =
|
|
2118
|
-
|
|
2114
|
+
}, [i, o, l]);
|
|
2115
|
+
function f(p, N) {
|
|
2116
|
+
if (c.current = p, !b.current[l.id]) {
|
|
2117
|
+
const y = p.getModel(), A = h();
|
|
2118
|
+
b.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(A, s)) || p.getModel();
|
|
2119
2119
|
}
|
|
2120
|
-
|
|
2120
|
+
p.setModel(b.current[l.id]);
|
|
2121
2121
|
}
|
|
2122
|
-
return { handleEditorDidMount:
|
|
2122
|
+
return { handleEditorDidMount: f };
|
|
2123
2123
|
}
|
|
2124
2124
|
function bl() {
|
|
2125
|
-
const s =
|
|
2126
|
-
function r(
|
|
2127
|
-
|
|
2125
|
+
const s = u((i) => i.card.sql), n = u((i) => i.sqlGen), { setCardSql: a, setSqlGen: t } = ne(), { handleEditorDidMount: l } = _a("sql");
|
|
2126
|
+
function r(i) {
|
|
2127
|
+
i !== void 0 && (a(i.trim()), vt(n) || t({}));
|
|
2128
2128
|
}
|
|
2129
2129
|
return /* @__PURE__ */ e.jsx(
|
|
2130
2130
|
os,
|
|
@@ -2132,7 +2132,7 @@ function bl() {
|
|
|
2132
2132
|
theme: "default",
|
|
2133
2133
|
className: "pt-3",
|
|
2134
2134
|
onChange: r,
|
|
2135
|
-
value: s,
|
|
2135
|
+
value: s || "",
|
|
2136
2136
|
options: {
|
|
2137
2137
|
minimap: {
|
|
2138
2138
|
enabled: !1
|
|
@@ -2151,7 +2151,7 @@ function bl() {
|
|
|
2151
2151
|
);
|
|
2152
2152
|
}
|
|
2153
2153
|
function yl() {
|
|
2154
|
-
const s =
|
|
2154
|
+
const s = u((t) => t.card.python), { setCardPython: n } = ne(), { handleEditorDidMount: a } = _a("python");
|
|
2155
2155
|
return /* @__PURE__ */ e.jsx(
|
|
2156
2156
|
os,
|
|
2157
2157
|
{
|
|
@@ -2182,7 +2182,7 @@ function vl() {
|
|
|
2182
2182
|
const s = M((r) => r.dashboard.filters), n = M((r) => r.filterValues), a = M((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
|
|
2183
2183
|
(r) => r.sheetId === a || !r.sheetId
|
|
2184
2184
|
), l = n == null ? void 0 : n.filter(
|
|
2185
|
-
(r) => (t == null ? void 0 : t.some((
|
|
2185
|
+
(r) => (t == null ? void 0 : t.some((i) => i.id === r.filterId)) || r.filterId.endsWith(a)
|
|
2186
2186
|
);
|
|
2187
2187
|
return /* @__PURE__ */ e.jsx(
|
|
2188
2188
|
os,
|
|
@@ -2213,110 +2213,113 @@ function Cl() {
|
|
|
2213
2213
|
const [s, n] = q({
|
|
2214
2214
|
queryKey: [],
|
|
2215
2215
|
queryData: null
|
|
2216
|
-
}), a = Ct(), [t, l] = q(!1), [r,
|
|
2217
|
-
(
|
|
2218
|
-
),
|
|
2219
|
-
(
|
|
2220
|
-
), A =
|
|
2221
|
-
(
|
|
2222
|
-
), I =
|
|
2223
|
-
(
|
|
2224
|
-
),
|
|
2216
|
+
}), a = Ct(), [t, l] = q(!1), [r, i] = q(!1), [o, d] = q(!1), [x, c] = q(""), [b, g] = q(!1), h = u((w) => w.frame), f = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
|
|
2217
|
+
(w) => w.selectedConnectionId
|
|
2218
|
+
), y = u(
|
|
2219
|
+
(w) => w.selectedDatabaseName
|
|
2220
|
+
), A = u(
|
|
2221
|
+
(w) => w.selectedDatamodelId
|
|
2222
|
+
), I = u(
|
|
2223
|
+
(w) => w.selectedSchemaName
|
|
2224
|
+
), z = u((w) => w.selectedTableName), T = u((w) => {
|
|
2225
|
+
var le;
|
|
2226
|
+
return (le = w == null ? void 0 : w.card) == null ? void 0 : le.sql;
|
|
2227
|
+
}), L = u((w) => w.applyFilters), {
|
|
2225
2228
|
setCardCustomCfg: V,
|
|
2226
2229
|
setQueryResultColumns: m,
|
|
2227
2230
|
setCardSql: v,
|
|
2228
|
-
setQueryError:
|
|
2231
|
+
setQueryError: j,
|
|
2229
2232
|
setPythonStdOut: D,
|
|
2230
|
-
setCardPreferences:
|
|
2233
|
+
setCardPreferences: S,
|
|
2231
2234
|
setCardType: _
|
|
2232
|
-
} = ne(), $ =
|
|
2233
|
-
(
|
|
2235
|
+
} = ne(), $ = u((w) => w.onSave), K = u((w) => w.onClose), ee = u((w) => w.actions.setSqlGen), G = u((w) => w.runSql), se = u((w) => w.actions.setRunSql), k = u((w) => w.actions.setCardCfg), P = u(
|
|
2236
|
+
(w) => w.actions.setIsSqlRunning
|
|
2234
2237
|
), {
|
|
2235
2238
|
data: U,
|
|
2236
2239
|
isLoading: E,
|
|
2237
2240
|
isFetching: F,
|
|
2238
|
-
isSuccess:
|
|
2241
|
+
isSuccess: re,
|
|
2239
2242
|
isError: B,
|
|
2240
2243
|
error: ae,
|
|
2241
2244
|
queryKey: te,
|
|
2242
2245
|
refetch: je
|
|
2243
|
-
} = De(
|
|
2246
|
+
} = De(f);
|
|
2244
2247
|
Z(() => {
|
|
2245
2248
|
if (U && (U.rowLimitExceeded && Ge.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2246
2249
|
position: "top-center",
|
|
2247
2250
|
richColors: !0
|
|
2248
2251
|
}), D((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
|
|
2249
|
-
const { dimensionKeys:
|
|
2250
|
-
m(
|
|
2252
|
+
const { dimensionKeys: w } = js(U.records);
|
|
2253
|
+
m(w);
|
|
2251
2254
|
}
|
|
2252
2255
|
}, [U, m, D]), Z(() => {
|
|
2253
|
-
(E || F) && P(!0), (B ||
|
|
2256
|
+
(E || F) && P(!0), (B || re) && P(!1), B ? (j(ae.message), m([]), D("")) : j("");
|
|
2254
2257
|
}, [
|
|
2255
2258
|
E,
|
|
2256
2259
|
F,
|
|
2257
2260
|
U,
|
|
2258
2261
|
D,
|
|
2259
2262
|
B,
|
|
2260
|
-
|
|
2263
|
+
re,
|
|
2261
2264
|
P,
|
|
2262
2265
|
m,
|
|
2263
|
-
|
|
2266
|
+
j,
|
|
2264
2267
|
ae
|
|
2265
2268
|
]), Z(() => {
|
|
2266
2269
|
G && (a.getQueryData(te) || je(), se(!1));
|
|
2267
2270
|
}, [G, je, se, te, a]);
|
|
2268
2271
|
function Te() {
|
|
2269
|
-
const
|
|
2272
|
+
const w = a.getQueryData(te);
|
|
2270
2273
|
s.queryData || n({
|
|
2271
2274
|
queryKey: te,
|
|
2272
|
-
queryData:
|
|
2273
|
-
}), a.setQueryData(te, null), v(""), ee({}),
|
|
2275
|
+
queryData: w
|
|
2276
|
+
}), a.setQueryData(te, null), v(""), ee({}), k(void 0), V(""), S({}), _("bar");
|
|
2274
2277
|
}
|
|
2275
|
-
function we(
|
|
2276
|
-
if (
|
|
2278
|
+
function we(w, le) {
|
|
2279
|
+
if (w.length === 0)
|
|
2277
2280
|
return "";
|
|
2278
|
-
if (
|
|
2279
|
-
const ke =
|
|
2281
|
+
if (le) {
|
|
2282
|
+
const ke = w.find((oe) => oe.id === le);
|
|
2280
2283
|
if (ke) {
|
|
2281
2284
|
const oe = ke.tabTitle;
|
|
2282
2285
|
if (oe == "All__Header")
|
|
2283
|
-
return
|
|
2286
|
+
return w[0].id;
|
|
2284
2287
|
if (oe && oe.endsWith("__Header")) {
|
|
2285
|
-
const ps = oe.split("__")[0], Qe =
|
|
2288
|
+
const ps = oe.split("__")[0], Qe = w.find(
|
|
2286
2289
|
(Je) => Je.tabTitle === ps
|
|
2287
2290
|
);
|
|
2288
|
-
return Qe ? Qe.id :
|
|
2291
|
+
return Qe ? Qe.id : w[0].id;
|
|
2289
2292
|
}
|
|
2290
|
-
return
|
|
2293
|
+
return le;
|
|
2291
2294
|
}
|
|
2292
2295
|
}
|
|
2293
|
-
return
|
|
2296
|
+
return w[0].id;
|
|
2294
2297
|
}
|
|
2295
2298
|
function Le() {
|
|
2296
|
-
let
|
|
2297
|
-
T && !T.includes("{{") && (
|
|
2298
|
-
const
|
|
2299
|
-
...
|
|
2299
|
+
let w = T;
|
|
2300
|
+
T && !T.includes("{{") && (w = rl(T), v(w));
|
|
2301
|
+
const le = {
|
|
2302
|
+
...f,
|
|
2300
2303
|
lastSelectedSchema: I,
|
|
2301
2304
|
lastSelectedDatamodelId: A,
|
|
2302
|
-
lastSelectedDatabase:
|
|
2303
|
-
lastSelectedTable:
|
|
2304
|
-
connectionId:
|
|
2305
|
-
type:
|
|
2306
|
-
sql:
|
|
2307
|
-
customCfg:
|
|
2308
|
-
}, ke =
|
|
2309
|
-
(_e) => _e.id ===
|
|
2305
|
+
lastSelectedDatabase: y,
|
|
2306
|
+
lastSelectedTable: z,
|
|
2307
|
+
connectionId: N,
|
|
2308
|
+
type: p ? f.type : "table",
|
|
2309
|
+
sql: w,
|
|
2310
|
+
customCfg: p ? f.customCfg : null
|
|
2311
|
+
}, ke = h.cards.map(
|
|
2312
|
+
(_e) => _e.id === f.id ? le : _e
|
|
2310
2313
|
), oe = {
|
|
2311
|
-
...
|
|
2314
|
+
...h,
|
|
2312
2315
|
cards: ke,
|
|
2313
|
-
activeCardId: we(ke,
|
|
2316
|
+
activeCardId: we(ke, h.activeCardId)
|
|
2314
2317
|
};
|
|
2315
2318
|
$ == null || $(oe);
|
|
2316
2319
|
}
|
|
2317
2320
|
function Fe() {
|
|
2318
|
-
const { queryKey:
|
|
2319
|
-
|
|
2321
|
+
const { queryKey: w, queryData: le } = s;
|
|
2322
|
+
w && le && a.setQueryData(w, le), K == null || K();
|
|
2320
2323
|
}
|
|
2321
2324
|
function Ee() {
|
|
2322
2325
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -2331,7 +2334,7 @@ function Cl() {
|
|
|
2331
2334
|
r && /* @__PURE__ */ e.jsx(
|
|
2332
2335
|
Be,
|
|
2333
2336
|
{
|
|
2334
|
-
onClick: () =>
|
|
2337
|
+
onClick: () => i(!1),
|
|
2335
2338
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
2336
2339
|
}
|
|
2337
2340
|
)
|
|
@@ -2343,7 +2346,7 @@ function Cl() {
|
|
|
2343
2346
|
!r && /* @__PURE__ */ e.jsx(
|
|
2344
2347
|
oa,
|
|
2345
2348
|
{
|
|
2346
|
-
onClick: () =>
|
|
2349
|
+
onClick: () => i(!0),
|
|
2347
2350
|
className: Y(
|
|
2348
2351
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
2349
2352
|
{
|
|
@@ -2449,9 +2452,9 @@ function Cl() {
|
|
|
2449
2452
|
il,
|
|
2450
2453
|
{
|
|
2451
2454
|
error: ae.message,
|
|
2452
|
-
setShowAIDialog:
|
|
2455
|
+
setShowAIDialog: d,
|
|
2453
2456
|
setTriggerAIRun: g,
|
|
2454
|
-
setUserInputforAI:
|
|
2457
|
+
setUserInputforAI: c
|
|
2455
2458
|
}
|
|
2456
2459
|
),
|
|
2457
2460
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2471,7 +2474,7 @@ function Cl() {
|
|
|
2471
2474
|
ma,
|
|
2472
2475
|
{
|
|
2473
2476
|
pressed: t,
|
|
2474
|
-
onPressedChange: (
|
|
2477
|
+
onPressedChange: (w) => l(w),
|
|
2475
2478
|
className: "",
|
|
2476
2479
|
size: "sm",
|
|
2477
2480
|
variant: "outline",
|
|
@@ -2481,12 +2484,12 @@ function Cl() {
|
|
|
2481
2484
|
/* @__PURE__ */ e.jsx(
|
|
2482
2485
|
cl,
|
|
2483
2486
|
{
|
|
2484
|
-
open:
|
|
2485
|
-
setOpen:
|
|
2486
|
-
userInput:
|
|
2487
|
-
triggerAIRun:
|
|
2487
|
+
open: o,
|
|
2488
|
+
setOpen: d,
|
|
2489
|
+
userInput: x,
|
|
2490
|
+
triggerAIRun: b,
|
|
2488
2491
|
setTriggerAIRun: g,
|
|
2489
|
-
setUserInput: (
|
|
2492
|
+
setUserInput: (w) => c(w)
|
|
2490
2493
|
}
|
|
2491
2494
|
)
|
|
2492
2495
|
] }),
|
|
@@ -2527,20 +2530,20 @@ function Cl() {
|
|
|
2527
2530
|
);
|
|
2528
2531
|
}
|
|
2529
2532
|
function Nl({ data: s }) {
|
|
2530
|
-
var
|
|
2531
|
-
const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((
|
|
2533
|
+
var i;
|
|
2534
|
+
const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2532
2535
|
// header: key,
|
|
2533
|
-
accessorKey:
|
|
2534
|
-
header: ({ column:
|
|
2535
|
-
const
|
|
2536
|
+
accessorKey: o,
|
|
2537
|
+
header: ({ column: d }) => {
|
|
2538
|
+
const x = d.getIsSorted();
|
|
2536
2539
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2537
2540
|
"div",
|
|
2538
2541
|
{
|
|
2539
2542
|
className: "flex cursor-pointer items-center",
|
|
2540
|
-
onClick: () =>
|
|
2543
|
+
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2541
2544
|
children: [
|
|
2542
|
-
|
|
2543
|
-
|
|
2545
|
+
o,
|
|
2546
|
+
x === "asc" ? /* @__PURE__ */ e.jsx(St, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : null
|
|
2544
2547
|
]
|
|
2545
2548
|
}
|
|
2546
2549
|
) });
|
|
@@ -2558,57 +2561,57 @@ function Nl({ data: s }) {
|
|
|
2558
2561
|
}
|
|
2559
2562
|
});
|
|
2560
2563
|
return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
|
|
2561
|
-
/* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((
|
|
2564
|
+
/* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(fs, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(
|
|
2562
2565
|
Ot,
|
|
2563
2566
|
{
|
|
2564
2567
|
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
2565
|
-
children:
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
+
children: d.isPlaceholder ? null : Ks(
|
|
2569
|
+
d.column.columnDef.header,
|
|
2570
|
+
d.getContext()
|
|
2568
2571
|
)
|
|
2569
2572
|
},
|
|
2570
|
-
|
|
2571
|
-
)) },
|
|
2572
|
-
/* @__PURE__ */ e.jsx(Dt, { children: (
|
|
2573
|
+
d.id
|
|
2574
|
+
)) }, o.id)) }),
|
|
2575
|
+
/* @__PURE__ */ e.jsx(Dt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2573
2576
|
fs,
|
|
2574
2577
|
{
|
|
2575
2578
|
className: "whitespace-nowrap py-2",
|
|
2576
|
-
"data-state":
|
|
2577
|
-
children:
|
|
2579
|
+
"data-state": o.getIsSelected() && "selected",
|
|
2580
|
+
children: o.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Qs, { className: "py-3", children: Ks(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2578
2581
|
},
|
|
2579
|
-
|
|
2582
|
+
o.id
|
|
2580
2583
|
)) : /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2581
2584
|
] }) });
|
|
2582
2585
|
}
|
|
2583
2586
|
function Sl({ card: s }) {
|
|
2584
|
-
var
|
|
2587
|
+
var y, A, I, z, T, L, V, m, v, j, D;
|
|
2585
2588
|
const [n, a] = q(!1), [t, l] = q(
|
|
2586
2589
|
[]
|
|
2587
|
-
), { authToken: r } = Se(),
|
|
2588
|
-
colors: ((A = (
|
|
2590
|
+
), { authToken: r } = Se(), i = Lt(r == null ? void 0 : r.accessToken), o = M((S) => S.themeStyle), d = {
|
|
2591
|
+
colors: ((A = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : A.backgroundColor) || []
|
|
2589
2592
|
};
|
|
2590
2593
|
(I = s.customCardPreferences) != null && I.inputData;
|
|
2591
|
-
const { getCard:
|
|
2594
|
+
const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", b = u((S) => S.frame);
|
|
2592
2595
|
ne();
|
|
2593
|
-
const { data: g } = De(s),
|
|
2596
|
+
const { data: g } = De(s), h = Oa((S, _) => {
|
|
2594
2597
|
l(($) => ({
|
|
2595
2598
|
...$,
|
|
2596
|
-
[
|
|
2599
|
+
[S]: _
|
|
2597
2600
|
}));
|
|
2598
2601
|
}, []);
|
|
2599
2602
|
if (!((L = s.customCardPreferences) != null && L.componentName))
|
|
2600
2603
|
return null;
|
|
2601
|
-
const
|
|
2604
|
+
const f = x(
|
|
2602
2605
|
(V = s.customCardPreferences) == null ? void 0 : V.componentName
|
|
2603
2606
|
);
|
|
2604
|
-
function
|
|
2605
|
-
a(
|
|
2607
|
+
function p(S) {
|
|
2608
|
+
a(S);
|
|
2606
2609
|
}
|
|
2607
|
-
const
|
|
2610
|
+
const N = Object.keys(
|
|
2608
2611
|
((m = s.customCardPreferences) == null ? void 0 : m.dataInputCardIds) || {}
|
|
2609
|
-
).map((
|
|
2612
|
+
).map((S) => {
|
|
2610
2613
|
var K, ee, G;
|
|
2611
|
-
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[
|
|
2614
|
+
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, $ = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find((se) => se.id === _);
|
|
2612
2615
|
return $ || null;
|
|
2613
2616
|
});
|
|
2614
2617
|
return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -2616,48 +2619,48 @@ function Sl({ card: s }) {
|
|
|
2616
2619
|
{
|
|
2617
2620
|
fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
2618
2621
|
children: [
|
|
2619
|
-
|
|
2620
|
-
|
|
2622
|
+
f && c === "single" && /* @__PURE__ */ e.jsx(
|
|
2623
|
+
f,
|
|
2621
2624
|
{
|
|
2622
|
-
params:
|
|
2623
|
-
theme:
|
|
2625
|
+
params: i,
|
|
2626
|
+
theme: d,
|
|
2624
2627
|
settings: (v = s.customCardPreferences) == null ? void 0 : v.settings,
|
|
2625
|
-
onDataChange:
|
|
2628
|
+
onDataChange: h,
|
|
2626
2629
|
data: (g == null ? void 0 : g.records) || []
|
|
2627
2630
|
}
|
|
2628
2631
|
),
|
|
2629
|
-
|
|
2632
|
+
f && c === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2630
2633
|
Object.keys(
|
|
2631
|
-
((
|
|
2632
|
-
).map((
|
|
2634
|
+
((j = s.customCardPreferences) == null ? void 0 : j.dataInputCardIds) || {}
|
|
2635
|
+
).map((S) => {
|
|
2633
2636
|
var K, ee, G;
|
|
2634
|
-
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[
|
|
2637
|
+
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, $ = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find(
|
|
2635
2638
|
(se) => se.id === _
|
|
2636
2639
|
);
|
|
2637
2640
|
if ($)
|
|
2638
2641
|
return /* @__PURE__ */ e.jsx(
|
|
2639
2642
|
Ft,
|
|
2640
2643
|
{
|
|
2641
|
-
onLoadingStatus:
|
|
2642
|
-
onDataChange:
|
|
2643
|
-
dataInputIndex:
|
|
2644
|
+
onLoadingStatus: p,
|
|
2645
|
+
onDataChange: h,
|
|
2646
|
+
dataInputIndex: S,
|
|
2644
2647
|
card: $
|
|
2645
2648
|
},
|
|
2646
|
-
$.id +
|
|
2649
|
+
$.id + S
|
|
2647
2650
|
);
|
|
2648
2651
|
}),
|
|
2649
2652
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2650
|
-
|
|
2653
|
+
f,
|
|
2651
2654
|
{
|
|
2652
|
-
theme:
|
|
2653
|
-
onDataChange:
|
|
2654
|
-
settings:
|
|
2655
|
-
(
|
|
2655
|
+
theme: d,
|
|
2656
|
+
onDataChange: h,
|
|
2657
|
+
settings: N.map(
|
|
2658
|
+
(S) => {
|
|
2656
2659
|
var _;
|
|
2657
|
-
return (_ =
|
|
2660
|
+
return (_ = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : _.settings;
|
|
2658
2661
|
}
|
|
2659
2662
|
),
|
|
2660
|
-
data:
|
|
2663
|
+
data: N.map((S) => S != null && S.id ? t == null ? void 0 : t[S.id] : [])
|
|
2661
2664
|
}
|
|
2662
2665
|
) })
|
|
2663
2666
|
] })
|
|
@@ -2672,43 +2675,43 @@ function Ha({
|
|
|
2672
2675
|
className: s,
|
|
2673
2676
|
...n
|
|
2674
2677
|
}) {
|
|
2675
|
-
var
|
|
2676
|
-
const a =
|
|
2677
|
-
|
|
2678
|
-
const { updateFilter:
|
|
2678
|
+
var N;
|
|
2679
|
+
const a = u((y) => y.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((y) => y.frame), r = M((y) => y.dashboard.filters);
|
|
2680
|
+
u((y) => y.actions.setRunSql);
|
|
2681
|
+
const { updateFilter: i } = is(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: d, isLoading: x, isFetching: c } = De(a), { setCard: b } = ne(), { data: g } = Es(a);
|
|
2679
2682
|
if (!a.id) return null;
|
|
2680
|
-
let
|
|
2681
|
-
|
|
2682
|
-
data:
|
|
2683
|
+
let h;
|
|
2684
|
+
d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (h = ja({
|
|
2685
|
+
data: d == null ? void 0 : d.records,
|
|
2683
2686
|
cardType: a.type,
|
|
2684
2687
|
cfg: a.cfg,
|
|
2685
2688
|
customCfg: a.customCfg,
|
|
2686
2689
|
preferences: a.preferences,
|
|
2687
2690
|
topoJson: g
|
|
2688
2691
|
}));
|
|
2689
|
-
function
|
|
2690
|
-
return /* @__PURE__ */ e.jsx(Sl, { card:
|
|
2692
|
+
function f(y) {
|
|
2693
|
+
return /* @__PURE__ */ e.jsx(Sl, { card: y });
|
|
2691
2694
|
}
|
|
2692
|
-
function
|
|
2693
|
-
var
|
|
2694
|
-
if (
|
|
2695
|
+
function p() {
|
|
2696
|
+
var y;
|
|
2697
|
+
if (d != null && d.records && (d == null ? void 0 : d.records.length) === 0 && !x && !c)
|
|
2695
2698
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2696
2699
|
/* @__PURE__ */ e.jsx(_t, { className: "size-8 text-muted-foreground" }),
|
|
2697
2700
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
2698
2701
|
] });
|
|
2699
2702
|
if (a.type === "custom")
|
|
2700
|
-
return
|
|
2701
|
-
if (!["table", "custom"].includes(a.type) &&
|
|
2703
|
+
return f(a);
|
|
2704
|
+
if (!["table", "custom"].includes(a.type) && h)
|
|
2702
2705
|
return /* @__PURE__ */ e.jsx(
|
|
2703
2706
|
Ht,
|
|
2704
2707
|
{
|
|
2705
|
-
cfg:
|
|
2708
|
+
cfg: h
|
|
2706
2709
|
},
|
|
2707
|
-
JSON.stringify(
|
|
2710
|
+
JSON.stringify(h) + JSON.stringify(a.preferences) + ((y = a == null ? void 0 : a.preferences) == null ? void 0 : y.customVisualCode)
|
|
2708
2711
|
);
|
|
2709
|
-
if (a.type === "table" && (
|
|
2712
|
+
if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
|
|
2710
2713
|
return /* @__PURE__ */ e.jsxs(fe, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
|
|
2711
|
-
/* @__PURE__ */ e.jsx(Pt, { card: a, data:
|
|
2714
|
+
/* @__PURE__ */ e.jsx(Pt, { card: a, data: d == null ? void 0 : d.records }),
|
|
2712
2715
|
/* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
|
|
2713
2716
|
] });
|
|
2714
2717
|
}
|
|
@@ -2725,7 +2728,7 @@ function Ha({
|
|
|
2725
2728
|
Xe,
|
|
2726
2729
|
{
|
|
2727
2730
|
text: a.title,
|
|
2728
|
-
onSave: (
|
|
2731
|
+
onSave: (y) => b({ ...a, title: y }),
|
|
2729
2732
|
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(Vt, { className: "text-base", children: a.title || "Edit title..." }) })
|
|
2730
2733
|
},
|
|
2731
2734
|
a.title
|
|
@@ -2734,26 +2737,26 @@ function Ha({
|
|
|
2734
2737
|
Xe,
|
|
2735
2738
|
{
|
|
2736
2739
|
text: a.description || "",
|
|
2737
|
-
onSave: (
|
|
2740
|
+
onSave: (y) => b({ ...a, description: y }),
|
|
2738
2741
|
children: /* @__PURE__ */ e.jsx(qt, { children: a.description || "Edit description..." })
|
|
2739
2742
|
},
|
|
2740
2743
|
a.description
|
|
2741
2744
|
)
|
|
2742
2745
|
] }),
|
|
2743
|
-
|
|
2746
|
+
o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2744
2747
|
/* @__PURE__ */ e.jsx(
|
|
2745
2748
|
Xe,
|
|
2746
2749
|
{
|
|
2747
2750
|
className: "my-1",
|
|
2748
|
-
text:
|
|
2749
|
-
onSave: (
|
|
2750
|
-
children: /* @__PURE__ */ e.jsx(H, { children:
|
|
2751
|
+
text: o.title || o.column,
|
|
2752
|
+
onSave: (y) => i({ ...o, title: y }),
|
|
2753
|
+
children: /* @__PURE__ */ e.jsx(H, { children: o.title })
|
|
2751
2754
|
}
|
|
2752
2755
|
),
|
|
2753
|
-
/* @__PURE__ */ e.jsx(ba, { filter:
|
|
2756
|
+
/* @__PURE__ */ e.jsx(ba, { filter: o })
|
|
2754
2757
|
] })
|
|
2755
2758
|
] }),
|
|
2756
|
-
/* @__PURE__ */ e.jsx(Rt, { className: "flex grow flex-col", children:
|
|
2759
|
+
/* @__PURE__ */ e.jsx(Rt, { className: "flex grow flex-col", children: p() })
|
|
2757
2760
|
]
|
|
2758
2761
|
}
|
|
2759
2762
|
);
|
|
@@ -2876,14 +2879,14 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
2876
2879
|
/* @__PURE__ */ e.jsx(O, { onClick: l, variant: "outline", children: "Close" })
|
|
2877
2880
|
] });
|
|
2878
2881
|
function Ol() {
|
|
2879
|
-
const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [
|
|
2882
|
+
const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i, o] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = ne(), N = (z) => {
|
|
2880
2883
|
var T, L;
|
|
2881
2884
|
return JSON.stringify(
|
|
2882
2885
|
{
|
|
2883
|
-
...
|
|
2886
|
+
...z,
|
|
2884
2887
|
data: {
|
|
2885
|
-
...
|
|
2886
|
-
datasets: (L = (T =
|
|
2888
|
+
...z.data,
|
|
2889
|
+
datasets: (L = (T = z.data) == null ? void 0 : T.datasets) == null ? void 0 : L.map((V) => ({
|
|
2887
2890
|
...V,
|
|
2888
2891
|
data: []
|
|
2889
2892
|
}))
|
|
@@ -2892,68 +2895,68 @@ function Ol() {
|
|
|
2892
2895
|
null,
|
|
2893
2896
|
2
|
|
2894
2897
|
);
|
|
2895
|
-
},
|
|
2898
|
+
}, y = () => {
|
|
2896
2899
|
var T, L;
|
|
2897
2900
|
if (!((T = g == null ? void 0 : g.records) != null && T.length)) return;
|
|
2898
|
-
const
|
|
2901
|
+
const z = ja({
|
|
2899
2902
|
data: g.records,
|
|
2900
|
-
cardType:
|
|
2901
|
-
cfg:
|
|
2902
|
-
preferences:
|
|
2903
|
-
topoJson:
|
|
2903
|
+
cardType: c.type,
|
|
2904
|
+
cfg: c.cfg,
|
|
2905
|
+
preferences: c.preferences,
|
|
2906
|
+
topoJson: h
|
|
2904
2907
|
});
|
|
2905
|
-
|
|
2906
|
-
|
|
2908
|
+
z && (t(N(z)), o(((L = c.preferences) == null ? void 0 : L.customVisualCode) || ""), r(
|
|
2909
|
+
b ? JSON.stringify(b, null, 2) : ""
|
|
2907
2910
|
));
|
|
2908
2911
|
}, A = () => {
|
|
2909
2912
|
try {
|
|
2910
|
-
if (
|
|
2911
|
-
const
|
|
2912
|
-
|
|
2913
|
+
if (i && p(i), l) {
|
|
2914
|
+
const z = JSON.parse(l);
|
|
2915
|
+
f(z), x("");
|
|
2913
2916
|
}
|
|
2914
2917
|
} catch {
|
|
2915
|
-
|
|
2918
|
+
x("Invalid JSON configuration");
|
|
2916
2919
|
}
|
|
2917
2920
|
}, I = () => {
|
|
2918
|
-
if (
|
|
2919
|
-
const
|
|
2920
|
-
return z
|
|
2921
|
+
if (b) {
|
|
2922
|
+
const z = Js.merge(Js.cloneDeep(c.cfg), b);
|
|
2923
|
+
return N(z);
|
|
2921
2924
|
}
|
|
2922
|
-
return a ?
|
|
2925
|
+
return a ? N(JSON.parse(a)) : "";
|
|
2923
2926
|
};
|
|
2924
2927
|
return /* @__PURE__ */ e.jsxs(Cs, { open: s, onOpenChange: n, children: [
|
|
2925
2928
|
/* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2926
2929
|
O,
|
|
2927
2930
|
{
|
|
2928
|
-
onClick:
|
|
2931
|
+
onClick: y,
|
|
2929
2932
|
size: "sm",
|
|
2930
2933
|
variant: "outline",
|
|
2931
|
-
className:
|
|
2934
|
+
className: b ? "border-foreground/50 dark:border-foreground/70" : "",
|
|
2932
2935
|
children: /* @__PURE__ */ e.jsx($t, { className: "h-4 w-4" })
|
|
2933
2936
|
}
|
|
2934
2937
|
) }),
|
|
2935
2938
|
/* @__PURE__ */ e.jsxs(ws, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
|
|
2936
|
-
/* @__PURE__ */ e.jsx(wl, { card:
|
|
2939
|
+
/* @__PURE__ */ e.jsx(wl, { card: c }),
|
|
2937
2940
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2938
2941
|
/* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "w-1/2 rounded shadow-none" }) }),
|
|
2939
2942
|
/* @__PURE__ */ e.jsx(
|
|
2940
2943
|
kl,
|
|
2941
2944
|
{
|
|
2942
2945
|
defaultConfig: a,
|
|
2943
|
-
customCode:
|
|
2946
|
+
customCode: i,
|
|
2944
2947
|
customConfig: I(),
|
|
2945
|
-
onConfigChange: (
|
|
2946
|
-
onCodeChange: (
|
|
2948
|
+
onConfigChange: (z) => r(z ?? ""),
|
|
2949
|
+
onCodeChange: (z) => o(z ?? "")
|
|
2947
2950
|
}
|
|
2948
2951
|
)
|
|
2949
2952
|
] }),
|
|
2950
2953
|
/* @__PURE__ */ e.jsx(
|
|
2951
2954
|
zl,
|
|
2952
2955
|
{
|
|
2953
|
-
error:
|
|
2954
|
-
hasCustomConfig: !!
|
|
2956
|
+
error: d,
|
|
2957
|
+
hasCustomConfig: !!b,
|
|
2955
2958
|
onReset: () => {
|
|
2956
|
-
r(""),
|
|
2959
|
+
r(""), f(null);
|
|
2957
2960
|
},
|
|
2958
2961
|
onApply: A,
|
|
2959
2962
|
onClose: () => n(!1)
|
|
@@ -2990,7 +2993,7 @@ function Wa(s) {
|
|
|
2990
2993
|
const [n, a] = q(null);
|
|
2991
2994
|
return Z(() => {
|
|
2992
2995
|
s && (async () => {
|
|
2993
|
-
const r = (await import("./lucide-react-
|
|
2996
|
+
const r = (await import("./lucide-react-g0ln-XxW.js"))[s];
|
|
2994
2997
|
a(r);
|
|
2995
2998
|
})();
|
|
2996
2999
|
}, [s]), n;
|
|
@@ -3011,14 +3014,14 @@ function Dl({
|
|
|
3011
3014
|
(async () => {
|
|
3012
3015
|
var r;
|
|
3013
3016
|
if (t) {
|
|
3014
|
-
const
|
|
3015
|
-
(r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (
|
|
3016
|
-
name:
|
|
3017
|
-
icon:
|
|
3018
|
-
url:
|
|
3017
|
+
const o = (await Promise.all(
|
|
3018
|
+
(r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (d) => (await Ut(d.value)).visuals.map((b) => ({
|
|
3019
|
+
name: b.name,
|
|
3020
|
+
icon: b.icon,
|
|
3021
|
+
url: d.value
|
|
3019
3022
|
})))
|
|
3020
3023
|
)).flat();
|
|
3021
|
-
a(
|
|
3024
|
+
a(o);
|
|
3022
3025
|
}
|
|
3023
3026
|
})();
|
|
3024
3027
|
}, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -3043,15 +3046,15 @@ const Ml = ({
|
|
|
3043
3046
|
return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
|
|
3044
3047
|
};
|
|
3045
3048
|
function Il() {
|
|
3046
|
-
var
|
|
3047
|
-
const [s, n] = q(!1), a =
|
|
3048
|
-
function
|
|
3049
|
-
|
|
3049
|
+
var c, b;
|
|
3050
|
+
const [s, n] = q(!1), a = u((g) => g.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = ne();
|
|
3051
|
+
function x(g, h) {
|
|
3052
|
+
o(null), r({}), l(g), h && d({
|
|
3050
3053
|
type: "component",
|
|
3051
3054
|
visualType: "single",
|
|
3052
|
-
url:
|
|
3053
|
-
componentName:
|
|
3054
|
-
icon:
|
|
3055
|
+
url: h.url,
|
|
3056
|
+
componentName: h.name,
|
|
3057
|
+
icon: h.icon
|
|
3055
3058
|
}), n(!1);
|
|
3056
3059
|
}
|
|
3057
3060
|
return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
|
|
@@ -3060,8 +3063,8 @@ function Il() {
|
|
|
3060
3063
|
{
|
|
3061
3064
|
className: "h-4 w-4",
|
|
3062
3065
|
chartType: t,
|
|
3063
|
-
customIcon: (
|
|
3064
|
-
componentName: (
|
|
3066
|
+
customIcon: (c = a.customCardPreferences) == null ? void 0 : c.icon,
|
|
3067
|
+
componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
|
|
3065
3068
|
}
|
|
3066
3069
|
) }) }),
|
|
3067
3070
|
/* @__PURE__ */ e.jsxs(hs, { className: "w-50", children: [
|
|
@@ -3069,7 +3072,7 @@ function Il() {
|
|
|
3069
3072
|
/* @__PURE__ */ e.jsx(
|
|
3070
3073
|
O,
|
|
3071
3074
|
{
|
|
3072
|
-
onClick: () =>
|
|
3075
|
+
onClick: () => x("bar"),
|
|
3073
3076
|
className: "font-normal",
|
|
3074
3077
|
variant: "ghost",
|
|
3075
3078
|
children: /* @__PURE__ */ e.jsx(qs, { className: "size-5" })
|
|
@@ -3078,7 +3081,7 @@ function Il() {
|
|
|
3078
3081
|
/* @__PURE__ */ e.jsx(
|
|
3079
3082
|
O,
|
|
3080
3083
|
{
|
|
3081
|
-
onClick: () =>
|
|
3084
|
+
onClick: () => x("line"),
|
|
3082
3085
|
variant: "ghost",
|
|
3083
3086
|
children: /* @__PURE__ */ e.jsx(Rs, { className: "size-5" })
|
|
3084
3087
|
}
|
|
@@ -3086,7 +3089,7 @@ function Il() {
|
|
|
3086
3089
|
/* @__PURE__ */ e.jsx(
|
|
3087
3090
|
O,
|
|
3088
3091
|
{
|
|
3089
|
-
onClick: () =>
|
|
3092
|
+
onClick: () => x("stackedBar"),
|
|
3090
3093
|
variant: "ghost",
|
|
3091
3094
|
children: /* @__PURE__ */ e.jsx(Ka, { className: "size-5", strokeWidth: 0 })
|
|
3092
3095
|
}
|
|
@@ -3094,7 +3097,7 @@ function Il() {
|
|
|
3094
3097
|
/* @__PURE__ */ e.jsx(
|
|
3095
3098
|
O,
|
|
3096
3099
|
{
|
|
3097
|
-
onClick: () =>
|
|
3100
|
+
onClick: () => x("stackedLine"),
|
|
3098
3101
|
variant: "ghost",
|
|
3099
3102
|
children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5", strokeWidth: 0 })
|
|
3100
3103
|
}
|
|
@@ -3102,7 +3105,7 @@ function Il() {
|
|
|
3102
3105
|
/* @__PURE__ */ e.jsx(
|
|
3103
3106
|
O,
|
|
3104
3107
|
{
|
|
3105
|
-
onClick: () =>
|
|
3108
|
+
onClick: () => x("scatter"),
|
|
3106
3109
|
variant: "ghost",
|
|
3107
3110
|
children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
|
|
3108
3111
|
}
|
|
@@ -3110,7 +3113,7 @@ function Il() {
|
|
|
3110
3113
|
/* @__PURE__ */ e.jsx(
|
|
3111
3114
|
O,
|
|
3112
3115
|
{
|
|
3113
|
-
onClick: () =>
|
|
3116
|
+
onClick: () => x("bubble"),
|
|
3114
3117
|
variant: "ghost",
|
|
3115
3118
|
children: /* @__PURE__ */ e.jsx(Ua, { className: "size-4" })
|
|
3116
3119
|
}
|
|
@@ -3118,7 +3121,7 @@ function Il() {
|
|
|
3118
3121
|
/* @__PURE__ */ e.jsx(
|
|
3119
3122
|
O,
|
|
3120
3123
|
{
|
|
3121
|
-
onClick: () =>
|
|
3124
|
+
onClick: () => x("pie"),
|
|
3122
3125
|
variant: "ghost",
|
|
3123
3126
|
children: /* @__PURE__ */ e.jsx(Ma, { className: "size-5" })
|
|
3124
3127
|
}
|
|
@@ -3126,7 +3129,7 @@ function Il() {
|
|
|
3126
3129
|
/* @__PURE__ */ e.jsx(
|
|
3127
3130
|
O,
|
|
3128
3131
|
{
|
|
3129
|
-
onClick: () =>
|
|
3132
|
+
onClick: () => x("doughnut"),
|
|
3130
3133
|
variant: "ghost",
|
|
3131
3134
|
children: /* @__PURE__ */ e.jsx($a, { className: "size-5", strokeWidth: 1 })
|
|
3132
3135
|
}
|
|
@@ -3134,7 +3137,7 @@ function Il() {
|
|
|
3134
3137
|
/* @__PURE__ */ e.jsx(
|
|
3135
3138
|
O,
|
|
3136
3139
|
{
|
|
3137
|
-
onClick: () =>
|
|
3140
|
+
onClick: () => x("radar"),
|
|
3138
3141
|
variant: "ghost",
|
|
3139
3142
|
children: /* @__PURE__ */ e.jsx(
|
|
3140
3143
|
Pa,
|
|
@@ -3148,7 +3151,7 @@ function Il() {
|
|
|
3148
3151
|
/* @__PURE__ */ e.jsx(
|
|
3149
3152
|
O,
|
|
3150
3153
|
{
|
|
3151
|
-
onClick: () =>
|
|
3154
|
+
onClick: () => x("polarArea"),
|
|
3152
3155
|
variant: "ghost",
|
|
3153
3156
|
children: /* @__PURE__ */ e.jsx(Ba, { className: "size-5" })
|
|
3154
3157
|
}
|
|
@@ -3156,7 +3159,7 @@ function Il() {
|
|
|
3156
3159
|
/* @__PURE__ */ e.jsx(
|
|
3157
3160
|
O,
|
|
3158
3161
|
{
|
|
3159
|
-
onClick: () =>
|
|
3162
|
+
onClick: () => x("pyramid"),
|
|
3160
3163
|
variant: "ghost",
|
|
3161
3164
|
children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5" })
|
|
3162
3165
|
}
|
|
@@ -3164,7 +3167,7 @@ function Il() {
|
|
|
3164
3167
|
/* @__PURE__ */ e.jsx(
|
|
3165
3168
|
O,
|
|
3166
3169
|
{
|
|
3167
|
-
onClick: () =>
|
|
3170
|
+
onClick: () => x("range"),
|
|
3168
3171
|
variant: "ghost",
|
|
3169
3172
|
children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
|
|
3170
3173
|
}
|
|
@@ -3172,7 +3175,7 @@ function Il() {
|
|
|
3172
3175
|
/* @__PURE__ */ e.jsx(
|
|
3173
3176
|
O,
|
|
3174
3177
|
{
|
|
3175
|
-
onClick: () =>
|
|
3178
|
+
onClick: () => x("table"),
|
|
3176
3179
|
variant: "ghost",
|
|
3177
3180
|
children: /* @__PURE__ */ e.jsx(Is, { className: "size-5" })
|
|
3178
3181
|
}
|
|
@@ -3180,7 +3183,7 @@ function Il() {
|
|
|
3180
3183
|
/* @__PURE__ */ e.jsx(
|
|
3181
3184
|
O,
|
|
3182
3185
|
{
|
|
3183
|
-
onClick: () =>
|
|
3186
|
+
onClick: () => x("kpi"),
|
|
3184
3187
|
variant: "ghost",
|
|
3185
3188
|
children: /* @__PURE__ */ e.jsx(Qa, { className: "size-6" })
|
|
3186
3189
|
}
|
|
@@ -3188,7 +3191,7 @@ function Il() {
|
|
|
3188
3191
|
/* @__PURE__ */ e.jsx(
|
|
3189
3192
|
O,
|
|
3190
3193
|
{
|
|
3191
|
-
onClick: () =>
|
|
3194
|
+
onClick: () => x("text"),
|
|
3192
3195
|
variant: "ghost",
|
|
3193
3196
|
children: /* @__PURE__ */ e.jsx(_s, { className: "size-4" })
|
|
3194
3197
|
}
|
|
@@ -3196,7 +3199,7 @@ function Il() {
|
|
|
3196
3199
|
/* @__PURE__ */ e.jsx(
|
|
3197
3200
|
O,
|
|
3198
3201
|
{
|
|
3199
|
-
onClick: () =>
|
|
3202
|
+
onClick: () => x("map"),
|
|
3200
3203
|
variant: "ghost",
|
|
3201
3204
|
children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
|
|
3202
3205
|
}
|
|
@@ -3204,13 +3207,13 @@ function Il() {
|
|
|
3204
3207
|
/* @__PURE__ */ e.jsx(
|
|
3205
3208
|
O,
|
|
3206
3209
|
{
|
|
3207
|
-
onClick: () =>
|
|
3210
|
+
onClick: () => x("custom"),
|
|
3208
3211
|
variant: "ghost",
|
|
3209
3212
|
children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4" })
|
|
3210
3213
|
}
|
|
3211
3214
|
)
|
|
3212
3215
|
] }),
|
|
3213
|
-
/* @__PURE__ */ e.jsx(Dl, { onChartTypeChange:
|
|
3216
|
+
/* @__PURE__ */ e.jsx(Dl, { onChartTypeChange: x })
|
|
3214
3217
|
] })
|
|
3215
3218
|
] });
|
|
3216
3219
|
}
|
|
@@ -3260,7 +3263,7 @@ function Tl({
|
|
|
3260
3263
|
}
|
|
3261
3264
|
function Ll() {
|
|
3262
3265
|
var n;
|
|
3263
|
-
const s =
|
|
3266
|
+
const s = u((a) => a.card);
|
|
3264
3267
|
return (n = s.customCardPreferences) == null || n.showCardHeader, ne(), /* @__PURE__ */ e.jsxs(na, { children: [
|
|
3265
3268
|
/* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
|
|
3266
3269
|
/* @__PURE__ */ e.jsx(ra, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -3279,11 +3282,11 @@ function Ll() {
|
|
|
3279
3282
|
] });
|
|
3280
3283
|
}
|
|
3281
3284
|
function sa() {
|
|
3282
|
-
const s =
|
|
3283
|
-
|
|
3284
|
-
const { setFrame:
|
|
3285
|
+
const s = u((m) => m.frame), n = u((m) => m.card), a = u((m) => m.isShowingVisual), t = u((m) => m.isSqlRunning), l = u((m) => m.queryError), r = u((m) => m.pythonStdOut);
|
|
3286
|
+
u((m) => m.actions.setRunSql);
|
|
3287
|
+
const { setFrame: i, setCard: o, updateCardInFrame: d, setActiveTabCardId: x } = ne(), { data: c, isLoading: b, isFetching: g } = De(n);
|
|
3285
3288
|
if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3286
|
-
function
|
|
3289
|
+
function h() {
|
|
3287
3290
|
const m = {
|
|
3288
3291
|
connectionId: n.connectionId,
|
|
3289
3292
|
id: Ue(),
|
|
@@ -3301,56 +3304,56 @@ function sa() {
|
|
|
3301
3304
|
sql: "",
|
|
3302
3305
|
data: []
|
|
3303
3306
|
};
|
|
3304
|
-
|
|
3307
|
+
f(m);
|
|
3305
3308
|
}
|
|
3306
|
-
function
|
|
3309
|
+
function f(m) {
|
|
3307
3310
|
const v = {
|
|
3308
3311
|
...s,
|
|
3309
3312
|
cards: [...s.cards, m],
|
|
3310
3313
|
activeCardId: m.id
|
|
3311
3314
|
};
|
|
3312
|
-
|
|
3315
|
+
i(v), x(m.id);
|
|
3313
3316
|
}
|
|
3314
|
-
function
|
|
3317
|
+
function p() {
|
|
3315
3318
|
const m = {
|
|
3316
3319
|
...n,
|
|
3317
3320
|
id: Ue(),
|
|
3318
3321
|
title: `${n.title} Copy`,
|
|
3319
3322
|
tabTitle: `${n.tabTitle || n.title} Copy`
|
|
3320
3323
|
};
|
|
3321
|
-
|
|
3324
|
+
f(m);
|
|
3322
3325
|
}
|
|
3323
|
-
function
|
|
3324
|
-
const v = s.cards.filter((
|
|
3326
|
+
function N(m) {
|
|
3327
|
+
const v = s.cards.filter((S) => S.id !== m), j = v[0], D = {
|
|
3325
3328
|
...s,
|
|
3326
3329
|
cards: v,
|
|
3327
3330
|
// update the active card to the first card in the frame
|
|
3328
|
-
activeCardId:
|
|
3331
|
+
activeCardId: j.id
|
|
3329
3332
|
};
|
|
3330
|
-
|
|
3333
|
+
i(D), o(j);
|
|
3331
3334
|
}
|
|
3332
|
-
function
|
|
3333
|
-
|
|
3335
|
+
function y(m) {
|
|
3336
|
+
x(m);
|
|
3334
3337
|
}
|
|
3335
3338
|
const A = (m, v) => {
|
|
3336
3339
|
console.log("handleDragStart", v), m.dataTransfer.setData("tabIndex", v.toString());
|
|
3337
3340
|
}, I = (m) => {
|
|
3338
3341
|
m.preventDefault();
|
|
3339
|
-
},
|
|
3340
|
-
const
|
|
3341
|
-
if (
|
|
3342
|
-
const D = Array.from(s.cards), [
|
|
3343
|
-
D.splice(v, 0,
|
|
3342
|
+
}, z = (m, v) => {
|
|
3343
|
+
const j = m.dataTransfer.getData("tabIndex");
|
|
3344
|
+
if (j === v.toString()) return;
|
|
3345
|
+
const D = Array.from(s.cards), [S] = D.splice(parseInt(j), 1);
|
|
3346
|
+
D.splice(v, 0, S), i({ ...s, cards: D });
|
|
3344
3347
|
};
|
|
3345
3348
|
function T(m, v) {
|
|
3346
3349
|
return m.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || m.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
|
|
3347
3350
|
"div",
|
|
3348
3351
|
{
|
|
3349
3352
|
onClick: () => {
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3353
|
+
const j = v.displayTab === void 0 ? !1 : !v.displayTab;
|
|
3354
|
+
o({ ...v, displayTab: j }), d({
|
|
3352
3355
|
...v,
|
|
3353
|
-
displayTab:
|
|
3356
|
+
displayTab: j
|
|
3354
3357
|
});
|
|
3355
3358
|
},
|
|
3356
3359
|
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
@@ -3361,7 +3364,7 @@ function sa() {
|
|
|
3361
3364
|
return /* @__PURE__ */ e.jsxs(
|
|
3362
3365
|
va,
|
|
3363
3366
|
{
|
|
3364
|
-
onValueChange:
|
|
3367
|
+
onValueChange: y,
|
|
3365
3368
|
value: s.activeCardId,
|
|
3366
3369
|
className: "flex grow flex-col",
|
|
3367
3370
|
children: [
|
|
@@ -3371,16 +3374,16 @@ function sa() {
|
|
|
3371
3374
|
Xe,
|
|
3372
3375
|
{
|
|
3373
3376
|
text: m.tabTitle || m.title,
|
|
3374
|
-
onSave: (
|
|
3375
|
-
|
|
3377
|
+
onSave: (j) => {
|
|
3378
|
+
o({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
|
|
3376
3379
|
},
|
|
3377
3380
|
children: /* @__PURE__ */ e.jsxs(
|
|
3378
3381
|
Ze,
|
|
3379
3382
|
{
|
|
3380
3383
|
draggable: !0,
|
|
3381
|
-
onDragStart: (
|
|
3384
|
+
onDragStart: (j) => A(j, v),
|
|
3382
3385
|
onDragOver: I,
|
|
3383
|
-
onDrop: (
|
|
3386
|
+
onDrop: (j) => z(j, v),
|
|
3384
3387
|
className: "",
|
|
3385
3388
|
value: m.id,
|
|
3386
3389
|
children: [
|
|
@@ -3390,7 +3393,7 @@ function sa() {
|
|
|
3390
3393
|
Sa,
|
|
3391
3394
|
{
|
|
3392
3395
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3393
|
-
onClick: () =>
|
|
3396
|
+
onClick: () => N(m.id)
|
|
3394
3397
|
}
|
|
3395
3398
|
)
|
|
3396
3399
|
]
|
|
@@ -3404,7 +3407,7 @@ function sa() {
|
|
|
3404
3407
|
{
|
|
3405
3408
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3406
3409
|
variant: "outline",
|
|
3407
|
-
onClick:
|
|
3410
|
+
onClick: h,
|
|
3408
3411
|
children: /* @__PURE__ */ e.jsx(Ss, { className: "h-4 w-4" })
|
|
3409
3412
|
}
|
|
3410
3413
|
),
|
|
@@ -3413,7 +3416,7 @@ function sa() {
|
|
|
3413
3416
|
{
|
|
3414
3417
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3415
3418
|
variant: "outline",
|
|
3416
|
-
onClick:
|
|
3419
|
+
onClick: p,
|
|
3417
3420
|
children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
|
|
3418
3421
|
}
|
|
3419
3422
|
)
|
|
@@ -3423,17 +3426,17 @@ function sa() {
|
|
|
3423
3426
|
);
|
|
3424
3427
|
}
|
|
3425
3428
|
function V() {
|
|
3426
|
-
return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Qt, { card: n, data:
|
|
3429
|
+
return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Qt, { card: n, data: c == null ? void 0 : c.records }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3427
3430
|
Jt,
|
|
3428
3431
|
{
|
|
3429
3432
|
isLoading: t,
|
|
3430
3433
|
card: n,
|
|
3431
|
-
data:
|
|
3434
|
+
data: c == null ? void 0 : c.records
|
|
3432
3435
|
}
|
|
3433
3436
|
) }) }) }) : /* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "grow border-none shadow-none" }) });
|
|
3434
3437
|
}
|
|
3435
3438
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3436
|
-
(
|
|
3439
|
+
(b || g) && /* @__PURE__ */ e.jsx(Ve, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3437
3440
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3438
3441
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3439
3442
|
/* @__PURE__ */ e.jsx(Il, {}),
|
|
@@ -3470,7 +3473,7 @@ function sa() {
|
|
|
3470
3473
|
minSize: 10,
|
|
3471
3474
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3472
3475
|
children: /* @__PURE__ */ e.jsxs(fe, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
|
|
3473
|
-
(
|
|
3476
|
+
(c == null ? void 0 : c.records) && (c == null ? void 0 : c.records.length) > 0 && /* @__PURE__ */ e.jsx(Nl, { data: (c == null ? void 0 : c.records) || [] }),
|
|
3474
3477
|
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: l }),
|
|
3475
3478
|
/* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
|
|
3476
3479
|
] })
|
|
@@ -3482,7 +3485,7 @@ function sa() {
|
|
|
3482
3485
|
] });
|
|
3483
3486
|
}
|
|
3484
3487
|
function Fl() {
|
|
3485
|
-
const s =
|
|
3488
|
+
const s = u((a) => a.pythonStdOut);
|
|
3486
3489
|
if (!s) return null;
|
|
3487
3490
|
const n = s.replace(/\n/g, "<br>");
|
|
3488
3491
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col border-r", children: [
|
|
@@ -3494,7 +3497,7 @@ function Fl() {
|
|
|
3494
3497
|
] });
|
|
3495
3498
|
}
|
|
3496
3499
|
function El() {
|
|
3497
|
-
const s =
|
|
3500
|
+
const s = u((a) => a.isShowingVisual), n = u(
|
|
3498
3501
|
(a) => a.actions.setIsShowingVisual
|
|
3499
3502
|
);
|
|
3500
3503
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
@@ -3572,30 +3575,30 @@ function $e({
|
|
|
3572
3575
|
);
|
|
3573
3576
|
}
|
|
3574
3577
|
function Vl() {
|
|
3575
|
-
var
|
|
3576
|
-
const s =
|
|
3577
|
-
(
|
|
3578
|
-
), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t =
|
|
3578
|
+
var p, N;
|
|
3579
|
+
const s = u(
|
|
3580
|
+
(y) => y.card.customCardPreferences
|
|
3581
|
+
), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components: o, manifest: d } = ga(
|
|
3579
3582
|
(s == null ? void 0 : s.url) || ""
|
|
3580
|
-
),
|
|
3581
|
-
(
|
|
3583
|
+
), x = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
|
|
3584
|
+
(y) => y.name === (s == null ? void 0 : s.componentName)
|
|
3582
3585
|
);
|
|
3583
|
-
function
|
|
3586
|
+
function c(y, A) {
|
|
3584
3587
|
if (!s) return;
|
|
3585
|
-
const
|
|
3588
|
+
const z = {
|
|
3586
3589
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3587
|
-
[
|
|
3590
|
+
[y]: {
|
|
3588
3591
|
cardId: A,
|
|
3589
3592
|
hookRef: null
|
|
3590
3593
|
}
|
|
3591
3594
|
};
|
|
3592
|
-
|
|
3595
|
+
i({
|
|
3593
3596
|
...s,
|
|
3594
|
-
dataInputCardIds:
|
|
3597
|
+
dataInputCardIds: z
|
|
3595
3598
|
});
|
|
3596
3599
|
}
|
|
3597
|
-
function
|
|
3598
|
-
var I,
|
|
3600
|
+
function b(y) {
|
|
3601
|
+
var I, z;
|
|
3599
3602
|
const A = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((T) => {
|
|
3600
3603
|
var L;
|
|
3601
3604
|
return ((L = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : L.visualType) !== "multiple";
|
|
@@ -3603,7 +3606,7 @@ function Vl() {
|
|
|
3603
3606
|
value: T.id,
|
|
3604
3607
|
label: T.tabTitle || T.title
|
|
3605
3608
|
}));
|
|
3606
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (
|
|
3609
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((T, L) => {
|
|
3607
3610
|
var V, m;
|
|
3608
3611
|
return /* @__PURE__ */ e.jsxs(
|
|
3609
3612
|
"div",
|
|
@@ -3618,7 +3621,7 @@ function Vl() {
|
|
|
3618
3621
|
label: "",
|
|
3619
3622
|
options: A || [],
|
|
3620
3623
|
value: ((m = (V = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : V[L]) == null ? void 0 : m.cardId) || "",
|
|
3621
|
-
onValueChange: (v) =>
|
|
3624
|
+
onValueChange: (v) => c(L, v)
|
|
3622
3625
|
}
|
|
3623
3626
|
)
|
|
3624
3627
|
]
|
|
@@ -3627,15 +3630,15 @@ function Vl() {
|
|
|
3627
3630
|
);
|
|
3628
3631
|
}) });
|
|
3629
3632
|
}
|
|
3630
|
-
function g(
|
|
3631
|
-
var
|
|
3632
|
-
return s ?
|
|
3633
|
-
|
|
3633
|
+
function g(y, A, I = []) {
|
|
3634
|
+
var z, T;
|
|
3635
|
+
return s ? y === "input" ? /* @__PURE__ */ e.jsx(
|
|
3636
|
+
ie,
|
|
3634
3637
|
{
|
|
3635
3638
|
className: `h-8 w-full ${Pe}`,
|
|
3636
|
-
value: ((
|
|
3639
|
+
value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[A]) || "",
|
|
3637
3640
|
onChange: (L) => {
|
|
3638
|
-
|
|
3641
|
+
i({
|
|
3639
3642
|
...s,
|
|
3640
3643
|
settings: {
|
|
3641
3644
|
...s == null ? void 0 : s.settings,
|
|
@@ -3645,7 +3648,7 @@ function Vl() {
|
|
|
3645
3648
|
}
|
|
3646
3649
|
},
|
|
3647
3650
|
A
|
|
3648
|
-
) :
|
|
3651
|
+
) : y === "select" ? /* @__PURE__ */ e.jsx(
|
|
3649
3652
|
de,
|
|
3650
3653
|
{
|
|
3651
3654
|
className: "h-8 w-full",
|
|
@@ -3653,7 +3656,7 @@ function Vl() {
|
|
|
3653
3656
|
options: I,
|
|
3654
3657
|
value: ((T = s == null ? void 0 : s.settings) == null ? void 0 : T[A]) || "",
|
|
3655
3658
|
onValueChange: (L) => {
|
|
3656
|
-
|
|
3659
|
+
i({
|
|
3657
3660
|
...s,
|
|
3658
3661
|
settings: { ...s == null ? void 0 : s.settings, [A]: L }
|
|
3659
3662
|
});
|
|
@@ -3661,21 +3664,21 @@ function Vl() {
|
|
|
3661
3664
|
}
|
|
3662
3665
|
) : null : null;
|
|
3663
3666
|
}
|
|
3664
|
-
function
|
|
3665
|
-
const A = Object.entries((
|
|
3666
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: A.map(([I,
|
|
3667
|
-
/* @__PURE__ */ e.jsx(H, { children:
|
|
3667
|
+
function h(y) {
|
|
3668
|
+
const A = Object.entries((y == null ? void 0 : y.settings) || {});
|
|
3669
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: A.map(([I, z]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3670
|
+
/* @__PURE__ */ e.jsx(H, { children: z.title }),
|
|
3668
3671
|
g(
|
|
3669
|
-
|
|
3672
|
+
z.ui,
|
|
3670
3673
|
I,
|
|
3671
|
-
|
|
3674
|
+
z.options
|
|
3672
3675
|
)
|
|
3673
3676
|
] }, I)) });
|
|
3674
3677
|
}
|
|
3675
|
-
function
|
|
3676
|
-
s &&
|
|
3678
|
+
function f(y) {
|
|
3679
|
+
s && i({
|
|
3677
3680
|
...s,
|
|
3678
|
-
visualType:
|
|
3681
|
+
visualType: y,
|
|
3679
3682
|
componentName: ""
|
|
3680
3683
|
});
|
|
3681
3684
|
}
|
|
@@ -3692,12 +3695,12 @@ function Vl() {
|
|
|
3692
3695
|
label: "",
|
|
3693
3696
|
options: a,
|
|
3694
3697
|
value: (s == null ? void 0 : s.url) || "",
|
|
3695
|
-
onValueChange: (
|
|
3698
|
+
onValueChange: (y) => i({
|
|
3696
3699
|
...s || {
|
|
3697
3700
|
url: "",
|
|
3698
3701
|
componentName: ""
|
|
3699
3702
|
},
|
|
3700
|
-
url:
|
|
3703
|
+
url: y
|
|
3701
3704
|
})
|
|
3702
3705
|
}
|
|
3703
3706
|
) }) }),
|
|
@@ -3709,27 +3712,27 @@ function Vl() {
|
|
|
3709
3712
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3710
3713
|
],
|
|
3711
3714
|
value: r,
|
|
3712
|
-
onValueChange:
|
|
3715
|
+
onValueChange: f
|
|
3713
3716
|
}
|
|
3714
3717
|
),
|
|
3715
3718
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3716
3719
|
/* @__PURE__ */ e.jsx(H, { children: "Component" }),
|
|
3717
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children:
|
|
3720
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: o && /* @__PURE__ */ e.jsx(
|
|
3718
3721
|
de,
|
|
3719
3722
|
{
|
|
3720
3723
|
className: "h-8 w-full",
|
|
3721
3724
|
label: "",
|
|
3722
|
-
options: (
|
|
3723
|
-
(
|
|
3724
|
-
).map((
|
|
3725
|
-
value:
|
|
3726
|
-
label:
|
|
3725
|
+
options: (o == null ? void 0 : o.filter(
|
|
3726
|
+
(y) => y.type === r
|
|
3727
|
+
).map((y) => ({
|
|
3728
|
+
value: y.name,
|
|
3729
|
+
label: y.name
|
|
3727
3730
|
}))) || [],
|
|
3728
3731
|
value: s.componentName,
|
|
3729
|
-
onValueChange: (
|
|
3730
|
-
console.log("changing value",
|
|
3732
|
+
onValueChange: (y) => {
|
|
3733
|
+
console.log("changing value", y), i({
|
|
3731
3734
|
...s,
|
|
3732
|
-
componentName:
|
|
3735
|
+
componentName: y
|
|
3733
3736
|
});
|
|
3734
3737
|
}
|
|
3735
3738
|
}
|
|
@@ -3737,12 +3740,12 @@ function Vl() {
|
|
|
3737
3740
|
] }) })
|
|
3738
3741
|
] }) }) }),
|
|
3739
3742
|
/* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
|
|
3740
|
-
((
|
|
3741
|
-
|
|
3743
|
+
((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs($e, { summary: "Component Settings", children: [
|
|
3744
|
+
x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3742
3745
|
/* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
|
|
3743
|
-
/* @__PURE__ */ e.jsx("div", { className: "px-2", children:
|
|
3746
|
+
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(x) })
|
|
3744
3747
|
] }),
|
|
3745
|
-
|
|
3748
|
+
x && x.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(x) }) })
|
|
3746
3749
|
] })
|
|
3747
3750
|
]
|
|
3748
3751
|
}
|
|
@@ -3750,28 +3753,28 @@ function Vl() {
|
|
|
3750
3753
|
}
|
|
3751
3754
|
function Ie() {
|
|
3752
3755
|
const [s, n] = q([]);
|
|
3753
|
-
|
|
3754
|
-
(
|
|
3756
|
+
u(
|
|
3757
|
+
(c) => c.card.cfg
|
|
3755
3758
|
);
|
|
3756
|
-
const a =
|
|
3757
|
-
(
|
|
3759
|
+
const a = u((c) => c.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = u((c) => c.actions), i = u(
|
|
3760
|
+
(c) => c.queryResultColumns
|
|
3758
3761
|
);
|
|
3759
|
-
|
|
3760
|
-
(
|
|
3761
|
-
var
|
|
3762
|
-
return (
|
|
3762
|
+
u(
|
|
3763
|
+
(c) => {
|
|
3764
|
+
var b;
|
|
3765
|
+
return (b = c.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
3763
3766
|
}
|
|
3764
3767
|
), Z(() => {
|
|
3765
|
-
|
|
3766
|
-
}, [
|
|
3767
|
-
function
|
|
3768
|
-
var g,
|
|
3769
|
-
|
|
3768
|
+
i && n(new Array(i.length).fill(!1));
|
|
3769
|
+
}, [i]);
|
|
3770
|
+
function o(c, b) {
|
|
3771
|
+
var g, h;
|
|
3772
|
+
b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? r({
|
|
3770
3773
|
...a,
|
|
3771
3774
|
onClickFilter: [
|
|
3772
3775
|
...a.onClickFilter,
|
|
3773
3776
|
{
|
|
3774
|
-
columnIndex:
|
|
3777
|
+
columnIndex: c,
|
|
3775
3778
|
expression: ""
|
|
3776
3779
|
}
|
|
3777
3780
|
]
|
|
@@ -3779,39 +3782,39 @@ function Ie() {
|
|
|
3779
3782
|
...a,
|
|
3780
3783
|
onClickFilter: [
|
|
3781
3784
|
{
|
|
3782
|
-
columnIndex:
|
|
3785
|
+
columnIndex: c,
|
|
3783
3786
|
expression: ""
|
|
3784
3787
|
}
|
|
3785
3788
|
]
|
|
3786
3789
|
}) : (r({
|
|
3787
3790
|
...a,
|
|
3788
|
-
onClickFilter: (
|
|
3789
|
-
(
|
|
3791
|
+
onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
|
|
3792
|
+
(f) => f.columnIndex !== c
|
|
3790
3793
|
)
|
|
3791
|
-
}), n((
|
|
3792
|
-
const
|
|
3793
|
-
return
|
|
3794
|
+
}), n((f) => {
|
|
3795
|
+
const p = [...f];
|
|
3796
|
+
return p[c] = !1, p;
|
|
3794
3797
|
}));
|
|
3795
3798
|
}
|
|
3796
|
-
function
|
|
3797
|
-
var
|
|
3798
|
-
const g = (
|
|
3799
|
-
...
|
|
3800
|
-
expression:
|
|
3801
|
-
} :
|
|
3799
|
+
function d(c, b) {
|
|
3800
|
+
var h;
|
|
3801
|
+
const g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((f) => f.columnIndex === c ? {
|
|
3802
|
+
...f,
|
|
3803
|
+
expression: b.target.value
|
|
3804
|
+
} : f);
|
|
3802
3805
|
r({
|
|
3803
3806
|
...a,
|
|
3804
3807
|
onClickFilter: g
|
|
3805
3808
|
});
|
|
3806
3809
|
}
|
|
3807
|
-
function
|
|
3808
|
-
var
|
|
3809
|
-
if (s != null && s[
|
|
3810
|
+
function x(c) {
|
|
3811
|
+
var b, g, h, f;
|
|
3812
|
+
if (s != null && s[c] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((p) => p.columnIndex === c)) != null && g.expression)
|
|
3810
3813
|
return /* @__PURE__ */ e.jsx(
|
|
3811
|
-
|
|
3814
|
+
ie,
|
|
3812
3815
|
{
|
|
3813
|
-
value: (
|
|
3814
|
-
onChange: (
|
|
3816
|
+
value: (f = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((p) => p.columnIndex === c)) == null ? void 0 : f.expression,
|
|
3817
|
+
onChange: (p) => d(c, p),
|
|
3815
3818
|
type: "text",
|
|
3816
3819
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3817
3820
|
placeholder: "Expression"
|
|
@@ -3820,8 +3823,8 @@ function Ie() {
|
|
|
3820
3823
|
}
|
|
3821
3824
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3822
3825
|
/* @__PURE__ */ e.jsx(H, { children: "On Click" }),
|
|
3823
|
-
|
|
3824
|
-
var g,
|
|
3826
|
+
i == null ? void 0 : i.map((c, b) => {
|
|
3827
|
+
var g, h;
|
|
3825
3828
|
return /* @__PURE__ */ e.jsx(
|
|
3826
3829
|
"div",
|
|
3827
3830
|
{
|
|
@@ -3832,54 +3835,54 @@ function Ie() {
|
|
|
3832
3835
|
As,
|
|
3833
3836
|
{
|
|
3834
3837
|
checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
|
|
3835
|
-
(
|
|
3838
|
+
(f) => f.columnIndex === b
|
|
3836
3839
|
)),
|
|
3837
|
-
onCheckedChange: (
|
|
3840
|
+
onCheckedChange: (f) => o(b, f)
|
|
3838
3841
|
}
|
|
3839
3842
|
),
|
|
3840
3843
|
/* @__PURE__ */ e.jsx(
|
|
3841
3844
|
"label",
|
|
3842
3845
|
{
|
|
3843
3846
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
3844
|
-
children:
|
|
3847
|
+
children: c
|
|
3845
3848
|
}
|
|
3846
3849
|
),
|
|
3847
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((
|
|
3848
|
-
(
|
|
3850
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
|
|
3851
|
+
(f) => f.columnIndex === b
|
|
3849
3852
|
)) && /* @__PURE__ */ e.jsx(
|
|
3850
3853
|
ia,
|
|
3851
3854
|
{
|
|
3852
3855
|
onClick: () => {
|
|
3853
|
-
n((
|
|
3854
|
-
const
|
|
3855
|
-
return
|
|
3856
|
+
n((f) => {
|
|
3857
|
+
const p = [...f];
|
|
3858
|
+
return p[b] = !f[b], p;
|
|
3856
3859
|
});
|
|
3857
3860
|
},
|
|
3858
3861
|
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
3859
3862
|
}
|
|
3860
3863
|
) })
|
|
3861
3864
|
] }),
|
|
3862
|
-
|
|
3865
|
+
x(b)
|
|
3863
3866
|
] })
|
|
3864
3867
|
},
|
|
3865
|
-
|
|
3868
|
+
c
|
|
3866
3869
|
);
|
|
3867
3870
|
})
|
|
3868
3871
|
] });
|
|
3869
3872
|
}
|
|
3870
3873
|
function xs() {
|
|
3871
|
-
var
|
|
3872
|
-
const s =
|
|
3873
|
-
(
|
|
3874
|
-
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } =
|
|
3875
|
-
(
|
|
3876
|
-
function r(
|
|
3877
|
-
l(
|
|
3874
|
+
var i, o, d;
|
|
3875
|
+
const s = u((x) => x.card.preferences), n = u(
|
|
3876
|
+
(x) => x.card.cfg
|
|
3877
|
+
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((x) => x.actions);
|
|
3878
|
+
(i = n == null ? void 0 : n.options) != null && i.indexAxis;
|
|
3879
|
+
function r(x) {
|
|
3880
|
+
l(x);
|
|
3878
3881
|
}
|
|
3879
3882
|
return /* @__PURE__ */ e.jsxs(
|
|
3880
3883
|
ms,
|
|
3881
3884
|
{
|
|
3882
|
-
value: ((
|
|
3885
|
+
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
|
|
3883
3886
|
onValueChange: r,
|
|
3884
3887
|
className: "flex gap-3",
|
|
3885
3888
|
defaultValue: "x",
|
|
@@ -3903,34 +3906,34 @@ function aa(s, n) {
|
|
|
3903
3906
|
return ((r = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
|
|
3904
3907
|
}
|
|
3905
3908
|
function Xa() {
|
|
3906
|
-
var ee, G, se,
|
|
3907
|
-
const [s, n] = q(!1), a =
|
|
3909
|
+
var ee, G, se, k, P, U;
|
|
3910
|
+
const [s, n] = q(!1), a = u((E) => {
|
|
3908
3911
|
var F;
|
|
3909
3912
|
return (F = E.card) == null ? void 0 : F.preferences;
|
|
3910
|
-
}), t =
|
|
3913
|
+
}), t = u((E) => {
|
|
3911
3914
|
var F;
|
|
3912
3915
|
return (F = E.card) == null ? void 0 : F.cfg;
|
|
3913
|
-
}), l = wa(a, t), [r,
|
|
3916
|
+
}), l = wa(a, t), [r, i] = q(
|
|
3914
3917
|
aa(a)
|
|
3915
|
-
), [
|
|
3918
|
+
), [o, d] = q(
|
|
3916
3919
|
((se = (G = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : G[l]) == null ? void 0 : se.min) || ""
|
|
3917
|
-
), [
|
|
3918
|
-
((U = (P = (
|
|
3919
|
-
), [
|
|
3920
|
+
), [x, c] = q(
|
|
3921
|
+
((U = (P = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : P[l]) == null ? void 0 : U.max) || ""
|
|
3922
|
+
), [b, g] = q(o || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, A] = q(""), [I, z] = q(""), [T, L] = q(""), V = u(
|
|
3920
3923
|
(E) => E.actions.setCardPreferences
|
|
3921
|
-
), { updateCardInFrame: m } = ne(), v =
|
|
3924
|
+
), { updateCardInFrame: m } = ne(), v = u((E) => E.card), j = u((E) => {
|
|
3922
3925
|
var F;
|
|
3923
3926
|
return (F = E.card) == null ? void 0 : F.type;
|
|
3924
|
-
}), D = ["pie", "doughnut", "polarArea"].includes(
|
|
3927
|
+
}), D = ["pie", "doughnut", "polarArea"].includes(j);
|
|
3925
3928
|
Z(() => {
|
|
3926
|
-
var E, F,
|
|
3927
|
-
|
|
3928
|
-
((
|
|
3929
|
-
),
|
|
3929
|
+
var E, F, re, B, ae, te, je, Te, we, Le, Fe, Ee, Ae, w;
|
|
3930
|
+
i(aa(a)), d(
|
|
3931
|
+
((re = (F = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : F[l]) == null ? void 0 : re.min) === 0 ? 0 : ""
|
|
3932
|
+
), c(((te = (ae = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : ae[l]) == null ? void 0 : te.max) || ""), f(
|
|
3930
3933
|
((Le = (we = (Te = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Te[l]) == null ? void 0 : we.ticks) == null ? void 0 : Le.stepSize) || ""
|
|
3931
|
-
),
|
|
3934
|
+
), N(((Fe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Fe.decimalPlaces) || 0), A(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.suffix) || ""), z(((Ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ae.currency) || ""), L(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
|
|
3932
3935
|
}, [s, a, l]);
|
|
3933
|
-
function
|
|
3936
|
+
function S(E, F) {
|
|
3934
3937
|
return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(E);
|
|
3935
3938
|
}
|
|
3936
3939
|
function _() {
|
|
@@ -3958,7 +3961,7 @@ function Xa() {
|
|
|
3958
3961
|
ue,
|
|
3959
3962
|
{
|
|
3960
3963
|
value: I || "none",
|
|
3961
|
-
onValueChange: (F) =>
|
|
3964
|
+
onValueChange: (F) => z(F === "none" ? "" : F),
|
|
3962
3965
|
children: [
|
|
3963
3966
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
3964
3967
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
@@ -3986,10 +3989,10 @@ function Xa() {
|
|
|
3986
3989
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
|
|
3987
3990
|
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
|
|
3988
3991
|
/* @__PURE__ */ e.jsx(
|
|
3989
|
-
|
|
3992
|
+
ie,
|
|
3990
3993
|
{
|
|
3991
|
-
value:
|
|
3992
|
-
onChange: (F) =>
|
|
3994
|
+
value: p,
|
|
3995
|
+
onChange: (F) => N(Number(F.target.value)),
|
|
3993
3996
|
id: "format",
|
|
3994
3997
|
className: `col-span-6 h-8 w-full tracking-wide ${We}`
|
|
3995
3998
|
}
|
|
@@ -4002,19 +4005,19 @@ function Xa() {
|
|
|
4002
4005
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
4003
4006
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
|
|
4004
4007
|
/* @__PURE__ */ e.jsx(
|
|
4005
|
-
|
|
4008
|
+
ie,
|
|
4006
4009
|
{
|
|
4007
4010
|
id: "min",
|
|
4008
|
-
value:
|
|
4009
|
-
onChange: (E) =>
|
|
4011
|
+
value: o,
|
|
4012
|
+
onChange: (E) => d((F) => S(F, E.target.value)),
|
|
4010
4013
|
className: `col-span-1 h-8 w-full ${We}`
|
|
4011
4014
|
}
|
|
4012
4015
|
),
|
|
4013
4016
|
/* @__PURE__ */ e.jsx(
|
|
4014
|
-
|
|
4017
|
+
ie,
|
|
4015
4018
|
{
|
|
4016
|
-
value:
|
|
4017
|
-
onChange: (E) =>
|
|
4019
|
+
value: x,
|
|
4020
|
+
onChange: (E) => c((F) => S(F, E.target.value)),
|
|
4018
4021
|
id: "max",
|
|
4019
4022
|
className: `col-span-1 h-8 w-full ${We}`
|
|
4020
4023
|
}
|
|
@@ -4023,10 +4026,10 @@ function Xa() {
|
|
|
4023
4026
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
4024
4027
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
|
|
4025
4028
|
/* @__PURE__ */ e.jsx(
|
|
4026
|
-
|
|
4029
|
+
ie,
|
|
4027
4030
|
{
|
|
4028
|
-
value:
|
|
4029
|
-
onChange: (E) =>
|
|
4031
|
+
value: h,
|
|
4032
|
+
onChange: (E) => f((F) => S(F, E.target.value)),
|
|
4030
4033
|
id: "step-size",
|
|
4031
4034
|
className: `col-span-1 h-8 w-full ${We}`
|
|
4032
4035
|
}
|
|
@@ -4037,11 +4040,11 @@ function Xa() {
|
|
|
4037
4040
|
function K() {
|
|
4038
4041
|
var B;
|
|
4039
4042
|
let E = {};
|
|
4040
|
-
|
|
4041
|
-
min:
|
|
4042
|
-
max:
|
|
4043
|
+
b === "custom" && (E = {
|
|
4044
|
+
min: o,
|
|
4045
|
+
max: x,
|
|
4043
4046
|
ticks: {
|
|
4044
|
-
stepSize:
|
|
4047
|
+
stepSize: h
|
|
4045
4048
|
}
|
|
4046
4049
|
});
|
|
4047
4050
|
const F = {
|
|
@@ -4058,18 +4061,18 @@ function Xa() {
|
|
|
4058
4061
|
}
|
|
4059
4062
|
},
|
|
4060
4063
|
numberAxisFormat: {
|
|
4061
|
-
decimalPlaces:
|
|
4062
|
-
suffix:
|
|
4064
|
+
decimalPlaces: p,
|
|
4065
|
+
suffix: y,
|
|
4063
4066
|
currency: I,
|
|
4064
4067
|
locale: T
|
|
4065
4068
|
}
|
|
4066
4069
|
};
|
|
4067
4070
|
console.log(F), V(F);
|
|
4068
|
-
const
|
|
4071
|
+
const re = {
|
|
4069
4072
|
...v,
|
|
4070
4073
|
preferences: F
|
|
4071
4074
|
};
|
|
4072
|
-
m(
|
|
4075
|
+
m(re);
|
|
4073
4076
|
}
|
|
4074
4077
|
return /* @__PURE__ */ e.jsxs(ds, { onOpenChange: (E) => n(E), children: [
|
|
4075
4078
|
/* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
@@ -4086,7 +4089,7 @@ function Xa() {
|
|
|
4086
4089
|
{
|
|
4087
4090
|
disabled: D,
|
|
4088
4091
|
value: r,
|
|
4089
|
-
onValueChange: (E) =>
|
|
4092
|
+
onValueChange: (E) => i(E),
|
|
4090
4093
|
children: [
|
|
4091
4094
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
4092
4095
|
/* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
@@ -4105,7 +4108,7 @@ function Xa() {
|
|
|
4105
4108
|
{
|
|
4106
4109
|
disabled: D,
|
|
4107
4110
|
id: "scale-option",
|
|
4108
|
-
value:
|
|
4111
|
+
value: b,
|
|
4109
4112
|
onValueChange: (E) => g(E),
|
|
4110
4113
|
className: "col-span-2 flex gap-3",
|
|
4111
4114
|
defaultValue: "x",
|
|
@@ -4122,7 +4125,7 @@ function Xa() {
|
|
|
4122
4125
|
}
|
|
4123
4126
|
)
|
|
4124
4127
|
] }),
|
|
4125
|
-
|
|
4128
|
+
b === "custom" && r == "linear" && $(),
|
|
4126
4129
|
_(),
|
|
4127
4130
|
/* @__PURE__ */ e.jsx(en, {}),
|
|
4128
4131
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
@@ -4139,24 +4142,24 @@ function Xa() {
|
|
|
4139
4142
|
] });
|
|
4140
4143
|
}
|
|
4141
4144
|
function ql({ idx: s }) {
|
|
4142
|
-
var
|
|
4143
|
-
const n =
|
|
4144
|
-
var
|
|
4145
|
-
return (
|
|
4146
|
-
}), a =
|
|
4147
|
-
(
|
|
4148
|
-
var
|
|
4149
|
-
return (
|
|
4145
|
+
var o;
|
|
4146
|
+
const n = u((d) => {
|
|
4147
|
+
var x;
|
|
4148
|
+
return (x = d.card) == null ? void 0 : x.preferences;
|
|
4149
|
+
}), a = u(
|
|
4150
|
+
(d) => {
|
|
4151
|
+
var x;
|
|
4152
|
+
return (x = d.card.preferences) == null ? void 0 : x.datasetOptions;
|
|
4150
4153
|
}
|
|
4151
|
-
), t =
|
|
4152
|
-
(
|
|
4153
|
-
), l = (
|
|
4154
|
-
function
|
|
4155
|
-
(
|
|
4156
|
-
const
|
|
4157
|
-
display:
|
|
4158
|
-
align:
|
|
4159
|
-
anchor:
|
|
4154
|
+
), t = u(
|
|
4155
|
+
(d) => d.actions.setCardPreferences
|
|
4156
|
+
), l = (o = n == null ? void 0 : n.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((d) => d.idx === s);
|
|
4157
|
+
function i(d, x) {
|
|
4158
|
+
(d === "end" || d === "start") && sn(an());
|
|
4159
|
+
const c = {
|
|
4160
|
+
display: d !== "none",
|
|
4161
|
+
align: d,
|
|
4162
|
+
anchor: d,
|
|
4160
4163
|
clamp: !0
|
|
4161
4164
|
};
|
|
4162
4165
|
if (!r)
|
|
@@ -4165,16 +4168,16 @@ function ql({ idx: s }) {
|
|
|
4165
4168
|
datasetOptions: [
|
|
4166
4169
|
...a || [],
|
|
4167
4170
|
{
|
|
4168
|
-
idx:
|
|
4169
|
-
datalabels:
|
|
4171
|
+
idx: x,
|
|
4172
|
+
datalabels: c
|
|
4170
4173
|
}
|
|
4171
4174
|
]
|
|
4172
4175
|
});
|
|
4173
4176
|
else {
|
|
4174
|
-
const
|
|
4175
|
-
|
|
4177
|
+
const b = { ...r };
|
|
4178
|
+
b.datalabels = c;
|
|
4176
4179
|
const g = a == null ? void 0 : a.map(
|
|
4177
|
-
(
|
|
4180
|
+
(h) => h.idx === x ? b : h
|
|
4178
4181
|
);
|
|
4179
4182
|
t({
|
|
4180
4183
|
...n,
|
|
@@ -4188,7 +4191,7 @@ function ql({ idx: s }) {
|
|
|
4188
4191
|
/* @__PURE__ */ e.jsx(
|
|
4189
4192
|
O,
|
|
4190
4193
|
{
|
|
4191
|
-
onClick: () =>
|
|
4194
|
+
onClick: () => i("none", s),
|
|
4192
4195
|
size: "sm",
|
|
4193
4196
|
variant: "secondary",
|
|
4194
4197
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4198,7 +4201,7 @@ function ql({ idx: s }) {
|
|
|
4198
4201
|
/* @__PURE__ */ e.jsx(
|
|
4199
4202
|
O,
|
|
4200
4203
|
{
|
|
4201
|
-
onClick: () =>
|
|
4204
|
+
onClick: () => i("start", s),
|
|
4202
4205
|
size: "sm",
|
|
4203
4206
|
variant: "secondary",
|
|
4204
4207
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4215,7 +4218,7 @@ function ql({ idx: s }) {
|
|
|
4215
4218
|
/* @__PURE__ */ e.jsx(
|
|
4216
4219
|
O,
|
|
4217
4220
|
{
|
|
4218
|
-
onClick: () =>
|
|
4221
|
+
onClick: () => i("center", s),
|
|
4219
4222
|
size: "sm",
|
|
4220
4223
|
variant: "secondary",
|
|
4221
4224
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4232,7 +4235,7 @@ function ql({ idx: s }) {
|
|
|
4232
4235
|
/* @__PURE__ */ e.jsx(
|
|
4233
4236
|
O,
|
|
4234
4237
|
{
|
|
4235
|
-
onClick: () =>
|
|
4238
|
+
onClick: () => i("end", s),
|
|
4236
4239
|
size: "sm",
|
|
4237
4240
|
variant: "secondary",
|
|
4238
4241
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4250,51 +4253,51 @@ function ql({ idx: s }) {
|
|
|
4250
4253
|
] });
|
|
4251
4254
|
}
|
|
4252
4255
|
function Za() {
|
|
4253
|
-
const s =
|
|
4254
|
-
(
|
|
4255
|
-
var
|
|
4256
|
-
return (g = (
|
|
4256
|
+
const s = u((x) => x.card), n = u(
|
|
4257
|
+
(x) => {
|
|
4258
|
+
var c, b, g;
|
|
4259
|
+
return (g = (b = (c = x == null ? void 0 : x.card) == null ? void 0 : c.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : g.indexAxis;
|
|
4257
4260
|
}
|
|
4258
4261
|
), { data: a } = De(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
|
|
4259
4262
|
keys: r,
|
|
4260
|
-
metricKeys:
|
|
4261
|
-
dimensionKeys:
|
|
4263
|
+
metricKeys: i,
|
|
4264
|
+
dimensionKeys: o
|
|
4262
4265
|
} = js((a == null ? void 0 : a.records) || []);
|
|
4263
|
-
let
|
|
4266
|
+
let d = i;
|
|
4264
4267
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4265
|
-
const
|
|
4268
|
+
const x = tn({
|
|
4266
4269
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4267
|
-
groupKey:
|
|
4268
|
-
pivotKey:
|
|
4269
|
-
valueKey:
|
|
4270
|
-
}), { metricKeys:
|
|
4271
|
-
|
|
4270
|
+
groupKey: o[0],
|
|
4271
|
+
pivotKey: o[1],
|
|
4272
|
+
valueKey: d[0]
|
|
4273
|
+
}), { metricKeys: c } = js(x);
|
|
4274
|
+
d = c;
|
|
4272
4275
|
}
|
|
4273
4276
|
return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4274
4277
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4275
4278
|
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
4276
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children:
|
|
4279
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
|
|
4277
4280
|
] }),
|
|
4278
4281
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4279
4282
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
4280
4283
|
/* @__PURE__ */ e.jsx(H, { children: l }),
|
|
4281
4284
|
/* @__PURE__ */ e.jsx(Xa, {})
|
|
4282
4285
|
] }),
|
|
4283
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
4286
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((x, c) => /* @__PURE__ */ e.jsx(Rl, { col: x, idx: c }, x)) })
|
|
4284
4287
|
] })
|
|
4285
4288
|
] });
|
|
4286
4289
|
}
|
|
4287
4290
|
function Rl({ col: s, idx: n }) {
|
|
4288
|
-
const a =
|
|
4289
|
-
var
|
|
4290
|
-
return (
|
|
4291
|
-
}), t =
|
|
4292
|
-
(
|
|
4293
|
-
var
|
|
4294
|
-
return (
|
|
4291
|
+
const a = u((o) => {
|
|
4292
|
+
var d;
|
|
4293
|
+
return (d = o.card) == null ? void 0 : d.preferences;
|
|
4294
|
+
}), t = u(
|
|
4295
|
+
(o) => {
|
|
4296
|
+
var d;
|
|
4297
|
+
return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
|
|
4295
4298
|
}
|
|
4296
|
-
), l = t == null ? void 0 : t.find((
|
|
4297
|
-
function
|
|
4299
|
+
), l = t == null ? void 0 : t.find((o) => o.idx === n), { setCardPreferences: r } = u((o) => o.actions);
|
|
4300
|
+
function i(o) {
|
|
4298
4301
|
if (!l)
|
|
4299
4302
|
r({
|
|
4300
4303
|
...a,
|
|
@@ -4302,20 +4305,20 @@ function Rl({ col: s, idx: n }) {
|
|
|
4302
4305
|
...t || [],
|
|
4303
4306
|
{
|
|
4304
4307
|
idx: n,
|
|
4305
|
-
type:
|
|
4306
|
-
fill:
|
|
4308
|
+
type: o === "area" ? "line" : o,
|
|
4309
|
+
fill: o === "area" ? "origin" : ""
|
|
4307
4310
|
}
|
|
4308
4311
|
]
|
|
4309
4312
|
});
|
|
4310
4313
|
else {
|
|
4311
|
-
const
|
|
4312
|
-
|
|
4313
|
-
const
|
|
4314
|
-
(
|
|
4314
|
+
const d = { ...l };
|
|
4315
|
+
d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
|
|
4316
|
+
const x = t == null ? void 0 : t.map(
|
|
4317
|
+
(c) => c.idx === n ? d : c
|
|
4315
4318
|
);
|
|
4316
4319
|
r({
|
|
4317
4320
|
...a,
|
|
4318
|
-
datasetOptions:
|
|
4321
|
+
datasetOptions: x
|
|
4319
4322
|
});
|
|
4320
4323
|
}
|
|
4321
4324
|
}
|
|
@@ -4325,21 +4328,21 @@ function Rl({ col: s, idx: n }) {
|
|
|
4325
4328
|
/* @__PURE__ */ e.jsx(
|
|
4326
4329
|
qs,
|
|
4327
4330
|
{
|
|
4328
|
-
onClick: () =>
|
|
4331
|
+
onClick: () => i("bar"),
|
|
4329
4332
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4330
4333
|
}
|
|
4331
4334
|
),
|
|
4332
4335
|
/* @__PURE__ */ e.jsx(
|
|
4333
4336
|
Rs,
|
|
4334
4337
|
{
|
|
4335
|
-
onClick: () =>
|
|
4338
|
+
onClick: () => i("line"),
|
|
4336
4339
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4337
4340
|
}
|
|
4338
4341
|
),
|
|
4339
4342
|
/* @__PURE__ */ e.jsx(
|
|
4340
4343
|
wn,
|
|
4341
4344
|
{
|
|
4342
|
-
onClick: () =>
|
|
4345
|
+
onClick: () => i("area"),
|
|
4343
4346
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4344
4347
|
}
|
|
4345
4348
|
),
|
|
@@ -4348,27 +4351,27 @@ function Rl({ col: s, idx: n }) {
|
|
|
4348
4351
|
] });
|
|
4349
4352
|
}
|
|
4350
4353
|
function et() {
|
|
4351
|
-
const s =
|
|
4352
|
-
function
|
|
4354
|
+
const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], i = M((g) => g.actions.addFilter), o = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
|
|
4355
|
+
function b(g, h = "dashboard") {
|
|
4353
4356
|
var L;
|
|
4354
|
-
const
|
|
4357
|
+
const f = ce(g.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(c);
|
|
4355
4358
|
let A = xa(
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
), I = `${A}.${
|
|
4359
|
-
const
|
|
4359
|
+
N,
|
|
4360
|
+
y
|
|
4361
|
+
), I = `${A}.${f}`;
|
|
4362
|
+
const z = (L = x == null ? void 0 : x.find(
|
|
4360
4363
|
(V) => V.id === n
|
|
4361
4364
|
)) == null ? void 0 : L.name;
|
|
4362
|
-
n && n !== "none" && (I = `${gs}.${
|
|
4365
|
+
n && n !== "none" && (I = `${gs}.${z}.${f}`, A = `${gs}.${z}`);
|
|
4363
4366
|
const T = r == null ? void 0 : r.find(
|
|
4364
|
-
(V) => V.column === I && V.table ===
|
|
4367
|
+
(V) => V.column === I && V.table === y && (V.database === p || V.database === a)
|
|
4365
4368
|
);
|
|
4366
4369
|
if (T)
|
|
4367
|
-
|
|
4370
|
+
d(T.id), o(T.id);
|
|
4368
4371
|
else {
|
|
4369
4372
|
const V = Ue();
|
|
4370
|
-
return
|
|
4371
|
-
location:
|
|
4373
|
+
return c === "api" && s ? (i({
|
|
4374
|
+
location: h,
|
|
4372
4375
|
id: V,
|
|
4373
4376
|
//uuidv4(),
|
|
4374
4377
|
column: I,
|
|
@@ -4382,13 +4385,13 @@ function et() {
|
|
|
4382
4385
|
sql: Ws(
|
|
4383
4386
|
g.data_type,
|
|
4384
4387
|
A,
|
|
4385
|
-
|
|
4388
|
+
f
|
|
4386
4389
|
)
|
|
4387
4390
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4388
|
-
}), V) : (
|
|
4391
|
+
}), V) : (i({
|
|
4389
4392
|
id: V,
|
|
4390
4393
|
//uuidv4(),
|
|
4391
|
-
location:
|
|
4394
|
+
location: h,
|
|
4392
4395
|
column: I,
|
|
4393
4396
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4394
4397
|
title: g.column_name,
|
|
@@ -4400,34 +4403,34 @@ function et() {
|
|
|
4400
4403
|
sql: Ws(
|
|
4401
4404
|
g.data_type,
|
|
4402
4405
|
A,
|
|
4403
|
-
|
|
4406
|
+
f
|
|
4404
4407
|
)
|
|
4405
4408
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4406
4409
|
}), V);
|
|
4407
4410
|
}
|
|
4408
4411
|
}
|
|
4409
|
-
return { assignFilter:
|
|
4412
|
+
return { assignFilter: b };
|
|
4410
4413
|
}
|
|
4411
4414
|
function Re() {
|
|
4412
4415
|
const s = M(
|
|
4413
|
-
(
|
|
4414
|
-
), n =
|
|
4415
|
-
function r(
|
|
4416
|
-
const
|
|
4417
|
-
a({ ...n, filterId:
|
|
4416
|
+
(o) => o.dashboard.filters
|
|
4417
|
+
), n = u((o) => o.frame), { setFrame: a } = ne(), { columns: t } = qe(), { assignFilter: l } = et();
|
|
4418
|
+
function r(o) {
|
|
4419
|
+
const d = l(o, "frame");
|
|
4420
|
+
a({ ...n, filterId: d });
|
|
4418
4421
|
}
|
|
4419
|
-
const
|
|
4422
|
+
const i = s == null ? void 0 : s.find((o) => o.id === n.filterId);
|
|
4420
4423
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4421
4424
|
/* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
|
|
4422
4425
|
/* @__PURE__ */ e.jsx(_l, { onSelect: r, columns: t }),
|
|
4423
|
-
|
|
4426
|
+
i && /* @__PURE__ */ e.jsx(ka, { filter: i })
|
|
4424
4427
|
] });
|
|
4425
4428
|
}
|
|
4426
4429
|
function _l({
|
|
4427
4430
|
columns: s,
|
|
4428
4431
|
onSelect: n
|
|
4429
4432
|
}) {
|
|
4430
|
-
var
|
|
4433
|
+
var i;
|
|
4431
4434
|
const [a, t] = Ys.useState(!1), [l, r] = Ys.useState("");
|
|
4432
4435
|
return /* @__PURE__ */ e.jsxs(ds, { open: a, onOpenChange: t, children: [
|
|
4433
4436
|
/* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -4439,7 +4442,7 @@ function _l({
|
|
|
4439
4442
|
"aria-expanded": a,
|
|
4440
4443
|
className: "w-full justify-between font-normal",
|
|
4441
4444
|
children: [
|
|
4442
|
-
l ? (
|
|
4445
|
+
l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
|
|
4443
4446
|
/* @__PURE__ */ e.jsx(nn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4444
4447
|
]
|
|
4445
4448
|
}
|
|
@@ -4448,28 +4451,28 @@ function _l({
|
|
|
4448
4451
|
/* @__PURE__ */ e.jsx(rn, { placeholder: "Search column", className: "h-9" }),
|
|
4449
4452
|
/* @__PURE__ */ e.jsxs(on, { children: [
|
|
4450
4453
|
/* @__PURE__ */ e.jsx(cn, { children: "No framework found." }),
|
|
4451
|
-
/* @__PURE__ */ e.jsx(dn, { children: s.map((
|
|
4454
|
+
/* @__PURE__ */ e.jsx(dn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
4452
4455
|
un,
|
|
4453
4456
|
{
|
|
4454
|
-
value:
|
|
4455
|
-
onSelect: (
|
|
4456
|
-
const
|
|
4457
|
-
r(
|
|
4457
|
+
value: o.column_name,
|
|
4458
|
+
onSelect: (d) => {
|
|
4459
|
+
const x = d === l ? "" : d;
|
|
4460
|
+
r(x), t(!1), x && n(o);
|
|
4458
4461
|
},
|
|
4459
4462
|
children: [
|
|
4460
|
-
|
|
4463
|
+
o.column_name,
|
|
4461
4464
|
/* @__PURE__ */ e.jsx(
|
|
4462
4465
|
Na,
|
|
4463
4466
|
{
|
|
4464
4467
|
className: Y(
|
|
4465
4468
|
"ml-auto h-4 w-4",
|
|
4466
|
-
l ===
|
|
4469
|
+
l === o.column_name ? "opacity-100" : "opacity-0"
|
|
4467
4470
|
)
|
|
4468
4471
|
}
|
|
4469
4472
|
)
|
|
4470
4473
|
]
|
|
4471
4474
|
},
|
|
4472
|
-
|
|
4475
|
+
o.column_name
|
|
4473
4476
|
)) })
|
|
4474
4477
|
] })
|
|
4475
4478
|
] }) })
|
|
@@ -4521,30 +4524,30 @@ function Hl({
|
|
|
4521
4524
|
] }) });
|
|
4522
4525
|
}
|
|
4523
4526
|
function Hs() {
|
|
4524
|
-
var l, r,
|
|
4525
|
-
const s =
|
|
4526
|
-
(
|
|
4527
|
-
), n =
|
|
4528
|
-
function t(
|
|
4529
|
-
var
|
|
4530
|
-
const
|
|
4527
|
+
var l, r, i;
|
|
4528
|
+
const s = u(
|
|
4529
|
+
(o) => o.card.cfg
|
|
4530
|
+
), n = u((o) => o.actions.setCardCfg), a = u((o) => o.card.type);
|
|
4531
|
+
function t(o) {
|
|
4532
|
+
var c;
|
|
4533
|
+
const d = {
|
|
4531
4534
|
datalabels: {
|
|
4532
|
-
display:
|
|
4533
|
-
align:
|
|
4534
|
-
anchor:
|
|
4535
|
+
display: o !== "none",
|
|
4536
|
+
align: o,
|
|
4537
|
+
anchor: o,
|
|
4535
4538
|
clamp: !0
|
|
4536
4539
|
}
|
|
4537
|
-
},
|
|
4540
|
+
}, x = {
|
|
4538
4541
|
...s,
|
|
4539
4542
|
options: {
|
|
4540
4543
|
...s == null ? void 0 : s.options,
|
|
4541
4544
|
plugins: {
|
|
4542
|
-
...(
|
|
4543
|
-
...
|
|
4545
|
+
...(c = s == null ? void 0 : s.options) == null ? void 0 : c.plugins,
|
|
4546
|
+
...d
|
|
4544
4547
|
}
|
|
4545
4548
|
}
|
|
4546
4549
|
};
|
|
4547
|
-
n(
|
|
4550
|
+
n(x), console.log(o);
|
|
4548
4551
|
}
|
|
4549
4552
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4550
4553
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4554,7 +4557,7 @@ function Hs() {
|
|
|
4554
4557
|
/* @__PURE__ */ e.jsxs(
|
|
4555
4558
|
ue,
|
|
4556
4559
|
{
|
|
4557
|
-
value: (
|
|
4560
|
+
value: (i = (r = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : i.anchor,
|
|
4558
4561
|
onValueChange: t,
|
|
4559
4562
|
defaultValue: "none",
|
|
4560
4563
|
children: [
|
|
@@ -4642,7 +4645,7 @@ const $l = {
|
|
|
4642
4645
|
]
|
|
4643
4646
|
};
|
|
4644
4647
|
function Ul() {
|
|
4645
|
-
const s =
|
|
4648
|
+
const s = u((n) => n.card.type);
|
|
4646
4649
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4647
4650
|
/* @__PURE__ */ e.jsx(
|
|
4648
4651
|
Me,
|
|
@@ -4759,52 +4762,52 @@ function Gl(s) {
|
|
|
4759
4762
|
] }) });
|
|
4760
4763
|
}
|
|
4761
4764
|
function Kl() {
|
|
4762
|
-
var
|
|
4763
|
-
const s =
|
|
4764
|
-
(
|
|
4765
|
-
), a =
|
|
4766
|
-
(
|
|
4765
|
+
var d, x, c, b, g;
|
|
4766
|
+
const s = u((h) => h.card.preferences), n = u(
|
|
4767
|
+
(h) => h.actions.setCardPreferences
|
|
4768
|
+
), a = u(
|
|
4769
|
+
(h) => h.actions.setNumberFormat
|
|
4767
4770
|
);
|
|
4768
|
-
|
|
4769
|
-
(
|
|
4770
|
-
var
|
|
4771
|
-
return (
|
|
4771
|
+
u(
|
|
4772
|
+
(h) => {
|
|
4773
|
+
var f, p;
|
|
4774
|
+
return (p = (f = h.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : p.decimalPlaces;
|
|
4772
4775
|
}
|
|
4773
4776
|
);
|
|
4774
|
-
const t =
|
|
4775
|
-
(
|
|
4776
|
-
var
|
|
4777
|
-
return (
|
|
4777
|
+
const t = u(
|
|
4778
|
+
(h) => {
|
|
4779
|
+
var f, p;
|
|
4780
|
+
return (p = (f = h.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : p.locale;
|
|
4778
4781
|
}
|
|
4779
|
-
), l =
|
|
4780
|
-
(
|
|
4781
|
-
var
|
|
4782
|
-
return (
|
|
4782
|
+
), l = u(
|
|
4783
|
+
(h) => {
|
|
4784
|
+
var f, p;
|
|
4785
|
+
return (p = (f = h.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : p.currency;
|
|
4783
4786
|
}
|
|
4784
4787
|
);
|
|
4785
|
-
|
|
4786
|
-
(
|
|
4788
|
+
u(
|
|
4789
|
+
(h) => h.actions.setFilterOnClickField
|
|
4787
4790
|
);
|
|
4788
|
-
const r =
|
|
4789
|
-
(
|
|
4790
|
-
var
|
|
4791
|
-
return (
|
|
4791
|
+
const r = u(
|
|
4792
|
+
(h) => {
|
|
4793
|
+
var f, p;
|
|
4794
|
+
return (p = (f = h.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : p.colorRanges;
|
|
4792
4795
|
}
|
|
4793
|
-
) || [],
|
|
4794
|
-
(
|
|
4795
|
-
),
|
|
4796
|
+
) || [], i = u(
|
|
4797
|
+
(h) => h.actions.setColorRanges
|
|
4798
|
+
), o = [...new Set(ts.map((h) => h.currency))];
|
|
4796
4799
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4797
4800
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4798
4801
|
/* @__PURE__ */ e.jsx(
|
|
4799
4802
|
As,
|
|
4800
4803
|
{
|
|
4801
|
-
checked: !!((
|
|
4802
|
-
onCheckedChange: (
|
|
4804
|
+
checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
|
|
4805
|
+
onCheckedChange: (h) => {
|
|
4803
4806
|
n({
|
|
4804
4807
|
...s,
|
|
4805
4808
|
formatNumber: {
|
|
4806
4809
|
...s == null ? void 0 : s.formatNumber,
|
|
4807
|
-
enabled:
|
|
4810
|
+
enabled: h
|
|
4808
4811
|
}
|
|
4809
4812
|
});
|
|
4810
4813
|
}
|
|
@@ -4812,7 +4815,7 @@ function Kl() {
|
|
|
4812
4815
|
),
|
|
4813
4816
|
/* @__PURE__ */ e.jsx(H, { children: "Format Number" })
|
|
4814
4817
|
] }),
|
|
4815
|
-
((
|
|
4818
|
+
((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4816
4819
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
|
|
4817
4820
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4818
4821
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
@@ -4821,13 +4824,13 @@ function Kl() {
|
|
|
4821
4824
|
ue,
|
|
4822
4825
|
{
|
|
4823
4826
|
value: t || "none",
|
|
4824
|
-
onValueChange: (
|
|
4825
|
-
var
|
|
4827
|
+
onValueChange: (h) => {
|
|
4828
|
+
var f, p, N;
|
|
4826
4829
|
return a(
|
|
4827
|
-
((
|
|
4828
|
-
((
|
|
4829
|
-
|
|
4830
|
-
((
|
|
4830
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
|
|
4831
|
+
((p = s == null ? void 0 : s.formatNumber) == null ? void 0 : p.currency) || "",
|
|
4832
|
+
h,
|
|
4833
|
+
((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.suffix) || ""
|
|
4831
4834
|
);
|
|
4832
4835
|
},
|
|
4833
4836
|
children: [
|
|
@@ -4835,7 +4838,7 @@ function Kl() {
|
|
|
4835
4838
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
4836
4839
|
/* @__PURE__ */ e.jsx(pe, { children: "Format" }),
|
|
4837
4840
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
4838
|
-
ts.map((
|
|
4841
|
+
ts.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
|
|
4839
4842
|
] }) })
|
|
4840
4843
|
]
|
|
4841
4844
|
}
|
|
@@ -4847,13 +4850,13 @@ function Kl() {
|
|
|
4847
4850
|
ue,
|
|
4848
4851
|
{
|
|
4849
4852
|
value: l || "none",
|
|
4850
|
-
onValueChange: (
|
|
4851
|
-
var
|
|
4852
|
-
console.log("currency",
|
|
4853
|
-
((
|
|
4854
|
-
|
|
4855
|
-
((
|
|
4856
|
-
((
|
|
4853
|
+
onValueChange: (h) => {
|
|
4854
|
+
var f, p, N;
|
|
4855
|
+
console.log("currency", h), a(
|
|
4856
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
|
|
4857
|
+
h === "none" ? "" : h,
|
|
4858
|
+
((p = s == null ? void 0 : s.formatNumber) == null ? void 0 : p.locale) || "",
|
|
4859
|
+
((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.suffix) || ""
|
|
4857
4860
|
);
|
|
4858
4861
|
},
|
|
4859
4862
|
children: [
|
|
@@ -4861,7 +4864,7 @@ function Kl() {
|
|
|
4861
4864
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
4862
4865
|
/* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
|
|
4863
4866
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
4864
|
-
|
|
4867
|
+
o.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
|
|
4865
4868
|
] }) })
|
|
4866
4869
|
]
|
|
4867
4870
|
}
|
|
@@ -4874,19 +4877,19 @@ function Kl() {
|
|
|
4874
4877
|
/* @__PURE__ */ e.jsxs(
|
|
4875
4878
|
ue,
|
|
4876
4879
|
{
|
|
4877
|
-
value: ((
|
|
4878
|
-
onValueChange: (
|
|
4879
|
-
var
|
|
4880
|
+
value: ((b = (c = s == null ? void 0 : s.formatNumber) == null ? void 0 : c.decimalPlaces) == null ? void 0 : b.toString()) || "0",
|
|
4881
|
+
onValueChange: (h) => {
|
|
4882
|
+
var f, p, N;
|
|
4880
4883
|
return a(
|
|
4881
|
-
Number(
|
|
4882
|
-
((
|
|
4883
|
-
((
|
|
4884
|
-
((
|
|
4884
|
+
Number(h),
|
|
4885
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
|
|
4886
|
+
((p = s == null ? void 0 : s.formatNumber) == null ? void 0 : p.locale) || "",
|
|
4887
|
+
((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.suffix) || ""
|
|
4885
4888
|
);
|
|
4886
4889
|
},
|
|
4887
4890
|
children: [
|
|
4888
4891
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
4889
|
-
/* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((
|
|
4892
|
+
/* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h)) })
|
|
4890
4893
|
]
|
|
4891
4894
|
}
|
|
4892
4895
|
)
|
|
@@ -4894,18 +4897,18 @@ function Kl() {
|
|
|
4894
4897
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4895
4898
|
/* @__PURE__ */ e.jsx(H, { children: "Suffix" }),
|
|
4896
4899
|
/* @__PURE__ */ e.jsx(
|
|
4897
|
-
|
|
4900
|
+
ie,
|
|
4898
4901
|
{
|
|
4899
4902
|
value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
|
|
4900
4903
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
4901
4904
|
placeholder: "K, M, B, %",
|
|
4902
|
-
onChange: (
|
|
4903
|
-
var
|
|
4905
|
+
onChange: (h) => {
|
|
4906
|
+
var f, p, N;
|
|
4904
4907
|
return a(
|
|
4905
|
-
((
|
|
4906
|
-
((
|
|
4907
|
-
((
|
|
4908
|
-
|
|
4908
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
|
|
4909
|
+
((p = s == null ? void 0 : s.formatNumber) == null ? void 0 : p.currency) || "",
|
|
4910
|
+
((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.locale) || "",
|
|
4911
|
+
h.target.value
|
|
4909
4912
|
);
|
|
4910
4913
|
}
|
|
4911
4914
|
}
|
|
@@ -4918,7 +4921,7 @@ function Kl() {
|
|
|
4918
4921
|
hn,
|
|
4919
4922
|
{
|
|
4920
4923
|
colorRanges: r,
|
|
4921
|
-
setColorRanges:
|
|
4924
|
+
setColorRanges: i
|
|
4922
4925
|
}
|
|
4923
4926
|
)
|
|
4924
4927
|
] })
|
|
@@ -5056,13 +5059,13 @@ const Jl = [
|
|
|
5056
5059
|
value: s
|
|
5057
5060
|
}));
|
|
5058
5061
|
function Xl() {
|
|
5059
|
-
var
|
|
5060
|
-
const s =
|
|
5061
|
-
((
|
|
5062
|
-
), { setCardPreferences: l } = ne(), { data: r } = Es(s),
|
|
5063
|
-
label:
|
|
5064
|
-
value:
|
|
5065
|
-
})) || [],
|
|
5062
|
+
var d, x, c, b, g, h, f, p, N, y, A, I, z, T, L, V, m, v;
|
|
5063
|
+
const s = u((j) => j.card), n = (x = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, t] = q(
|
|
5064
|
+
((b = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
|
|
5065
|
+
), { setCardPreferences: l } = ne(), { data: r } = Es(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
|
|
5066
|
+
label: j,
|
|
5067
|
+
value: j
|
|
5068
|
+
})) || [], o = [
|
|
5066
5069
|
{
|
|
5067
5070
|
label: "US States 10m",
|
|
5068
5071
|
value: "https://unpkg.com/us-atlas/states-10m.json"
|
|
@@ -5084,12 +5087,12 @@ function Xl() {
|
|
|
5084
5087
|
de,
|
|
5085
5088
|
{
|
|
5086
5089
|
className: "h-9",
|
|
5087
|
-
options:
|
|
5088
|
-
onValueChange: (
|
|
5089
|
-
console.log("value",
|
|
5090
|
+
options: o,
|
|
5091
|
+
onValueChange: (j) => {
|
|
5092
|
+
console.log("value", j), l({
|
|
5090
5093
|
...s.preferences,
|
|
5091
5094
|
mapVisualOptions: {
|
|
5092
|
-
topoJsonUrl:
|
|
5095
|
+
topoJsonUrl: j
|
|
5093
5096
|
// customTopoJson: undefined,
|
|
5094
5097
|
}
|
|
5095
5098
|
});
|
|
@@ -5099,17 +5102,17 @@ function Xl() {
|
|
|
5099
5102
|
}
|
|
5100
5103
|
),
|
|
5101
5104
|
n === "custom" && /* @__PURE__ */ e.jsx(
|
|
5102
|
-
|
|
5105
|
+
ie,
|
|
5103
5106
|
{
|
|
5104
|
-
onChange: (
|
|
5105
|
-
t(
|
|
5107
|
+
onChange: (j) => {
|
|
5108
|
+
t(j.target.value);
|
|
5106
5109
|
},
|
|
5107
5110
|
onBlur: () => {
|
|
5108
|
-
var
|
|
5111
|
+
var j;
|
|
5109
5112
|
console.log("onBlur", a), l({
|
|
5110
5113
|
...s.preferences,
|
|
5111
5114
|
mapVisualOptions: {
|
|
5112
|
-
...(
|
|
5115
|
+
...(j = s.preferences) == null ? void 0 : j.mapVisualOptions,
|
|
5113
5116
|
customTopoJsonUrl: a
|
|
5114
5117
|
}
|
|
5115
5118
|
});
|
|
@@ -5126,16 +5129,16 @@ function Xl() {
|
|
|
5126
5129
|
de,
|
|
5127
5130
|
{
|
|
5128
5131
|
className: "h-9",
|
|
5129
|
-
options:
|
|
5130
|
-
value: ((
|
|
5132
|
+
options: i,
|
|
5133
|
+
value: ((h = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
|
|
5131
5134
|
label: "Map Object",
|
|
5132
|
-
onValueChange: (
|
|
5135
|
+
onValueChange: (j) => {
|
|
5133
5136
|
var D;
|
|
5134
5137
|
l({
|
|
5135
5138
|
...s.preferences,
|
|
5136
5139
|
mapVisualOptions: {
|
|
5137
5140
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5138
|
-
objectKey:
|
|
5141
|
+
objectKey: j
|
|
5139
5142
|
}
|
|
5140
5143
|
});
|
|
5141
5144
|
}
|
|
@@ -5149,15 +5152,15 @@ function Xl() {
|
|
|
5149
5152
|
{
|
|
5150
5153
|
className: "h-9",
|
|
5151
5154
|
options: Jl,
|
|
5152
|
-
value: ((
|
|
5155
|
+
value: ((p = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : p.projection) || "",
|
|
5153
5156
|
label: "Projection",
|
|
5154
|
-
onValueChange: (
|
|
5157
|
+
onValueChange: (j) => {
|
|
5155
5158
|
var D;
|
|
5156
5159
|
l({
|
|
5157
5160
|
...s.preferences,
|
|
5158
5161
|
mapVisualOptions: {
|
|
5159
5162
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5160
|
-
projection:
|
|
5163
|
+
projection: j
|
|
5161
5164
|
}
|
|
5162
5165
|
});
|
|
5163
5166
|
}
|
|
@@ -5171,15 +5174,15 @@ function Xl() {
|
|
|
5171
5174
|
{
|
|
5172
5175
|
className: "h-9",
|
|
5173
5176
|
options: Yl,
|
|
5174
|
-
value: ((
|
|
5177
|
+
value: ((y = (N = s.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : y.colorScale) || "",
|
|
5175
5178
|
label: "Select Color Scale",
|
|
5176
|
-
onValueChange: (
|
|
5179
|
+
onValueChange: (j) => {
|
|
5177
5180
|
var D;
|
|
5178
5181
|
l({
|
|
5179
5182
|
...s.preferences,
|
|
5180
5183
|
mapVisualOptions: {
|
|
5181
5184
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5182
|
-
colorScale:
|
|
5185
|
+
colorScale: j
|
|
5183
5186
|
}
|
|
5184
5187
|
});
|
|
5185
5188
|
}
|
|
@@ -5191,19 +5194,19 @@ function Xl() {
|
|
|
5191
5194
|
/* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
|
|
5192
5195
|
/* @__PURE__ */ e.jsx($e, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5193
5196
|
/* @__PURE__ */ e.jsx(
|
|
5194
|
-
|
|
5197
|
+
ie,
|
|
5195
5198
|
{
|
|
5196
5199
|
className: `h-9 w-full ${Pe}`,
|
|
5197
5200
|
type: "number",
|
|
5198
5201
|
step: 0.1,
|
|
5199
5202
|
value: ((I = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
|
|
5200
|
-
onChange: (
|
|
5203
|
+
onChange: (j) => {
|
|
5201
5204
|
var D;
|
|
5202
5205
|
l({
|
|
5203
5206
|
...s.preferences,
|
|
5204
5207
|
mapVisualOptions: {
|
|
5205
5208
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5206
|
-
projectionScale: Number(
|
|
5209
|
+
projectionScale: Number(j.target.value)
|
|
5207
5210
|
}
|
|
5208
5211
|
});
|
|
5209
5212
|
}
|
|
@@ -5211,21 +5214,21 @@ function Xl() {
|
|
|
5211
5214
|
),
|
|
5212
5215
|
/* @__PURE__ */ e.jsx(H, { children: "X" }),
|
|
5213
5216
|
/* @__PURE__ */ e.jsx(
|
|
5214
|
-
|
|
5217
|
+
ie,
|
|
5215
5218
|
{
|
|
5216
5219
|
className: `h-9 w-full ${Pe}`,
|
|
5217
5220
|
type: "number",
|
|
5218
5221
|
step: 10,
|
|
5219
|
-
value: ((L = (T = (
|
|
5220
|
-
onChange: (
|
|
5221
|
-
var D,
|
|
5222
|
+
value: ((L = (T = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : L[0]) || 0,
|
|
5223
|
+
onChange: (j) => {
|
|
5224
|
+
var D, S, _, $;
|
|
5222
5225
|
l({
|
|
5223
5226
|
...s.preferences,
|
|
5224
5227
|
mapVisualOptions: {
|
|
5225
5228
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5226
5229
|
projectionOffset: [
|
|
5227
|
-
Number(
|
|
5228
|
-
(($ = (_ = (
|
|
5230
|
+
Number(j.target.value),
|
|
5231
|
+
(($ = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : $[1]) || 0
|
|
5229
5232
|
]
|
|
5230
5233
|
}
|
|
5231
5234
|
});
|
|
@@ -5234,21 +5237,21 @@ function Xl() {
|
|
|
5234
5237
|
),
|
|
5235
5238
|
/* @__PURE__ */ e.jsx(H, { children: "Y" }),
|
|
5236
5239
|
/* @__PURE__ */ e.jsx(
|
|
5237
|
-
|
|
5240
|
+
ie,
|
|
5238
5241
|
{
|
|
5239
5242
|
className: `h-9 w-full ${Pe}`,
|
|
5240
5243
|
type: "number",
|
|
5241
5244
|
step: 10,
|
|
5242
5245
|
value: ((v = (m = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : m.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5243
|
-
onChange: (
|
|
5244
|
-
var D,
|
|
5246
|
+
onChange: (j) => {
|
|
5247
|
+
var D, S, _, $;
|
|
5245
5248
|
l({
|
|
5246
5249
|
...s.preferences,
|
|
5247
5250
|
mapVisualOptions: {
|
|
5248
5251
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5249
5252
|
projectionOffset: [
|
|
5250
|
-
(($ = (_ = (
|
|
5251
|
-
Number(
|
|
5253
|
+
(($ = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : $[0]) || 0,
|
|
5254
|
+
Number(j.target.value)
|
|
5252
5255
|
]
|
|
5253
5256
|
}
|
|
5254
5257
|
});
|
|
@@ -5262,7 +5265,7 @@ function Xl() {
|
|
|
5262
5265
|
}
|
|
5263
5266
|
function Zl() {
|
|
5264
5267
|
var t;
|
|
5265
|
-
const s =
|
|
5268
|
+
const s = u((l) => l.card.preferences), { setCardPreferences: n } = u((l) => l.actions);
|
|
5266
5269
|
function a(l) {
|
|
5267
5270
|
n({
|
|
5268
5271
|
...s,
|
|
@@ -5341,7 +5344,7 @@ function Ye({
|
|
|
5341
5344
|
] }) });
|
|
5342
5345
|
}
|
|
5343
5346
|
function er() {
|
|
5344
|
-
const s =
|
|
5347
|
+
const s = u(
|
|
5345
5348
|
(t) => {
|
|
5346
5349
|
var l, r;
|
|
5347
5350
|
return (r = (l = t == null ? void 0 : t.card) == null ? void 0 : l.preferences) == null ? void 0 : r.sortChart;
|
|
@@ -5421,10 +5424,10 @@ function er() {
|
|
|
5421
5424
|
] }) });
|
|
5422
5425
|
}
|
|
5423
5426
|
function sr({}) {
|
|
5424
|
-
const s =
|
|
5427
|
+
const s = u((t) => {
|
|
5425
5428
|
var l;
|
|
5426
5429
|
return (l = t.card) == null ? void 0 : l.preferences;
|
|
5427
|
-
}), n =
|
|
5430
|
+
}), n = u(
|
|
5428
5431
|
(t) => t.actions.setCardPreferences
|
|
5429
5432
|
), a = (t) => {
|
|
5430
5433
|
n({
|
|
@@ -5503,7 +5506,7 @@ const ar = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5503
5506
|
] })
|
|
5504
5507
|
] });
|
|
5505
5508
|
function lr() {
|
|
5506
|
-
const s =
|
|
5509
|
+
const s = u((a) => a.card.type);
|
|
5507
5510
|
function n(a) {
|
|
5508
5511
|
switch (a) {
|
|
5509
5512
|
case "stackedBar":
|
|
@@ -5548,7 +5551,7 @@ function lr() {
|
|
|
5548
5551
|
return /* @__PURE__ */ e.jsx(fe, { className: "h-full w-full text-sm", children: n(s) });
|
|
5549
5552
|
}
|
|
5550
5553
|
function rr() {
|
|
5551
|
-
const s =
|
|
5554
|
+
const s = u((n) => n.isShowingVisual);
|
|
5552
5555
|
return /* @__PURE__ */ e.jsxs(
|
|
5553
5556
|
ss,
|
|
5554
5557
|
{
|
|
@@ -5594,8 +5597,8 @@ function rr() {
|
|
|
5594
5597
|
);
|
|
5595
5598
|
}
|
|
5596
5599
|
function ir({ authToken: s, onSave: n, onClose: a }) {
|
|
5597
|
-
M((
|
|
5598
|
-
const t =
|
|
5600
|
+
M((i) => i.themeStyle);
|
|
5601
|
+
const t = u((i) => i.actions.setOnSave), l = u((i) => i.actions.setOnClose), r = M((i) => i.actions.setAuthToken);
|
|
5599
5602
|
return Z(() => {
|
|
5600
5603
|
n && t(n), a && l(a);
|
|
5601
5604
|
}, [n, t, a, l]), Z(() => {
|
|
@@ -5617,10 +5620,10 @@ function ir({ authToken: s, onSave: n, onClose: a }) {
|
|
|
5617
5620
|
) });
|
|
5618
5621
|
}
|
|
5619
5622
|
function or() {
|
|
5620
|
-
M((
|
|
5621
|
-
const s = M((
|
|
5622
|
-
function l(
|
|
5623
|
-
s && (t(s,
|
|
5623
|
+
M((i) => i.selectedCardId);
|
|
5624
|
+
const s = M((i) => i.selectedSheetId), { setIsVisualEditing: n } = M((i) => i.actions), a = M((i) => i.isVisualEditing), t = M((i) => i.actions.updateFrame);
|
|
5625
|
+
function l(i) {
|
|
5626
|
+
s && (t(s, i), n(!1));
|
|
5624
5627
|
}
|
|
5625
5628
|
function r() {
|
|
5626
5629
|
n(!1);
|
|
@@ -5637,10 +5640,10 @@ function or() {
|
|
|
5637
5640
|
);
|
|
5638
5641
|
}
|
|
5639
5642
|
function cr() {
|
|
5640
|
-
const s =
|
|
5643
|
+
const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = M((r) => r.dashboard.filters) || [], { columns: t } = qe(), { assignFilter: l } = et();
|
|
5641
5644
|
return /* @__PURE__ */ e.jsx(fe, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
|
|
5642
|
-
const
|
|
5643
|
-
(
|
|
5645
|
+
const i = a == null ? void 0 : a.find(
|
|
5646
|
+
(o) => o.column === ce(r.column_name) && o.table === n && o.database === s
|
|
5644
5647
|
);
|
|
5645
5648
|
return /* @__PURE__ */ e.jsx(
|
|
5646
5649
|
"div",
|
|
@@ -5649,7 +5652,7 @@ function cr() {
|
|
|
5649
5652
|
className: Y(
|
|
5650
5653
|
"group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
5651
5654
|
{
|
|
5652
|
-
"bg-muted":
|
|
5655
|
+
"bg-muted": i
|
|
5653
5656
|
}
|
|
5654
5657
|
),
|
|
5655
5658
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|