react-semaphor 0.0.323 → 0.0.325
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-CmI4p14L.js → index-6Q18isJp.js} +417 -409
- package/dist/chunks/{index-eIpnAL0h.js → index-BQPTe8tl.js} +4 -4
- package/dist/chunks/{index-BoOmRr9o.js → index-DggCCDD7.js} +15 -15
- package/dist/chunks/{index-Csp8aNd_.js → index-kzckqacZ.js} +14 -18
- package/dist/chunks/{lucide-react-Du1HXzMf.js → lucide-react-CzZkP9Lz.js} +1 -1
- package/dist/chunks/{lucide-react-DzVyq6Fk.js → lucide-react-DyubCpoB.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as V, p as
|
|
1
|
+
import { c as V, p as zs, u as z, n as Os, o as ke, q as e, r as Fs, s as Is, t as O, j as Ds, v as Ts, w as Ls, x as Ms, y as Es, L as R, z as le, A as la, E as ra, H as ia, J as oa, K as st, M as at, N as tt, O as Js, Q, R as Qe, h as nt, V as m, W as lt, F as ca, Y as Je, Z as Ke, _ as da, $ as rt, a0 as ua, a1 as me, a2 as he, a3 as xe, a4 as pe, a5 as Se, a6 as fe, a7 as K, T as As, a8 as Vs, a9 as qs, aa as Rs, ab as ma, ac as ha, ad as de, ae as it, af as ot, ag as xa, ah as ct, C as dt, ai as ut, aj as pa, B as mt, ak as We, al as ht, am as Ks, an as fa, ao as ys, ap as Ne, aq as Fe, ar as ge, as as ga, at as xt, au as pt, av as ft, aw as gt, I as jt, ax as bt, ay as yt, az as vt, aA as qe, aB as vs, aC as Ct, a as Nt, aD as Ue, aE as Cs, aF as Ae, aG as Ns, aH as St, aI as wt, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as bs, aO as It, aP as Ws, aQ as Dt, aR as Ys, aS as Tt, aT as Lt, aU as Mt, aV as Et, aW as ja, aX as re, aY as _s, aZ as ba, a_ as At, a$ as Vt, b0 as ls, b1 as qt, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, l as Ut, b8 as us, b9 as ya, ba as va, bb as Ca, bc as rs, bd as Na, be as is, bf as Xs, bg as Gt, bh as Qt, bi as ms, bj as hs, bk as xs, bl as Jt, X as Sa, bm as Kt, bn as Wt, bo as Yt, bp as ps, bq as Ie, f as Xt, br as Be, bs as Hs, bt as wa, bu as Zt, bv as en, bw as os, bx as sn, by as an, bz as tn, bA as Zs, bB as nn, bC as ln, bD as rn, bE as on, bF as cn, bG as dn, bH as un, bI as mn, bJ as De, bK as B, bL as U, bM as $s, bN as G, bO as hn, bP as ka, bQ as xn, bR as pn, bS as fn, bT as gn, bU as jn, bV as bn, bW as yn, bX as vn, bY as Cn } from "./index-kzckqacZ.js";
|
|
2
2
|
import * as ea from "react";
|
|
3
3
|
import we, { useState as q, useMemo as Ss, useEffect as Z, useRef as ws, Suspense as Nn } from "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -63,7 +63,7 @@ const Bs = V("ChartLine", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const
|
|
66
|
+
const za = V("ChartNoAxesGantt", [
|
|
67
67
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
68
68
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
69
69
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -74,7 +74,7 @@ const Oa = V("ChartNoAxesGantt", [
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
77
|
+
const Oa = V("ChartPie", [
|
|
78
78
|
[
|
|
79
79
|
"path",
|
|
80
80
|
{
|
|
@@ -115,7 +115,7 @@ const kn = V("CircleX", [
|
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const zn = V("CopyPlus", [
|
|
119
119
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
120
120
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
121
121
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -127,7 +127,7 @@ const On = V("CopyPlus", [
|
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
129
|
*/
|
|
130
|
-
const
|
|
130
|
+
const On = V("Database", [
|
|
131
131
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
132
132
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
133
133
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -528,10 +528,10 @@ function Ma(s) {
|
|
|
528
528
|
return {
|
|
529
529
|
...a,
|
|
530
530
|
frames: (n = a.frames) == null ? void 0 : n.map((l) => {
|
|
531
|
-
var
|
|
531
|
+
var c;
|
|
532
532
|
return {
|
|
533
533
|
...l,
|
|
534
|
-
cards: (
|
|
534
|
+
cards: (c = l.cards) == null ? void 0 : c.map((r) => Yn(r))
|
|
535
535
|
};
|
|
536
536
|
})
|
|
537
537
|
};
|
|
@@ -547,8 +547,8 @@ function Yn(s) {
|
|
|
547
547
|
data: {
|
|
548
548
|
...(t = s.cfg) == null ? void 0 : t.data,
|
|
549
549
|
labels: [],
|
|
550
|
-
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((
|
|
551
|
-
...
|
|
550
|
+
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((c) => ({
|
|
551
|
+
...c,
|
|
552
552
|
data: []
|
|
553
553
|
}))
|
|
554
554
|
}
|
|
@@ -576,7 +576,7 @@ async function Zn(s, t, a, n) {
|
|
|
576
576
|
if (!n)
|
|
577
577
|
return null;
|
|
578
578
|
const l = JSON.stringify(t);
|
|
579
|
-
return await
|
|
579
|
+
return await zs("https://semaphor.cloud/api/v1/lens", n, {
|
|
580
580
|
name: s,
|
|
581
581
|
template: l,
|
|
582
582
|
filterValues: a,
|
|
@@ -586,24 +586,24 @@ async function Zn(s, t, a, n) {
|
|
|
586
586
|
async function ks(s, t) {
|
|
587
587
|
if (!t)
|
|
588
588
|
return null;
|
|
589
|
-
const { id: a, template: n, filterValues: l, isDefault:
|
|
590
|
-
return await
|
|
589
|
+
const { id: a, template: n, filterValues: l, isDefault: c, shared: r } = s;
|
|
590
|
+
return await zs("https://semaphor.cloud/api/v1/lens", t, {
|
|
591
591
|
lensId: a,
|
|
592
592
|
template: n,
|
|
593
593
|
filterValues: l,
|
|
594
|
-
isDefault:
|
|
594
|
+
isDefault: c,
|
|
595
595
|
shared: r,
|
|
596
596
|
operation: "update"
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
599
|
async function el(s, t) {
|
|
600
|
-
return t ? await
|
|
600
|
+
return t ? await zs("https://semaphor.cloud/api/v1/lens", t, {
|
|
601
601
|
operation: "delete",
|
|
602
602
|
lensId: s
|
|
603
603
|
}) : null;
|
|
604
604
|
}
|
|
605
605
|
function sl() {
|
|
606
|
-
const [s, t] = q(""), [a, n] = q(!1), l =
|
|
606
|
+
const [s, t] = q(""), [a, n] = q(!1), l = z((b) => b.lenses), { setLenses: c, setSelectedLensId: r } = Os(), [o, d] = q(!1), [p, u] = q(!1), y = z((b) => b.dashboard), g = z((b) => b.filterValues), { authToken: x } = ke();
|
|
607
607
|
async function j() {
|
|
608
608
|
d(!0);
|
|
609
609
|
const b = Ma(
|
|
@@ -614,11 +614,11 @@ function sl() {
|
|
|
614
614
|
g,
|
|
615
615
|
x == null ? void 0 : x.accessToken
|
|
616
616
|
);
|
|
617
|
-
I && (
|
|
617
|
+
I && (c([...l || [], I]), r(I.id), u(!1)), d(!1);
|
|
618
618
|
}
|
|
619
619
|
return /* @__PURE__ */ e.jsxs(Fs, { open: p, onOpenChange: u, children: [
|
|
620
620
|
/* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
621
|
-
|
|
621
|
+
O,
|
|
622
622
|
{
|
|
623
623
|
variant: "secondary",
|
|
624
624
|
className: "h-7 p-2",
|
|
@@ -650,28 +650,28 @@ function sl() {
|
|
|
650
650
|
] }) }),
|
|
651
651
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
652
652
|
/* @__PURE__ */ e.jsx(la, { children: /* @__PURE__ */ e.jsx(
|
|
653
|
-
|
|
653
|
+
O,
|
|
654
654
|
{
|
|
655
655
|
size: "sm",
|
|
656
656
|
variant: "outline",
|
|
657
657
|
type: "submit",
|
|
658
658
|
onClick: j,
|
|
659
|
-
disabled:
|
|
660
|
-
children:
|
|
659
|
+
disabled: o,
|
|
660
|
+
children: o ? "Creating..." : "Add"
|
|
661
661
|
}
|
|
662
662
|
) })
|
|
663
663
|
] })
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
666
|
function al() {
|
|
667
|
-
const [s, t] = q(!1), a =
|
|
668
|
-
async function
|
|
669
|
-
|
|
667
|
+
const [s, t] = q(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: c } = Os(), { authToken: r } = ke();
|
|
668
|
+
async function o(u) {
|
|
669
|
+
c(u);
|
|
670
670
|
}
|
|
671
671
|
async function d(u) {
|
|
672
672
|
if (await el(u, r == null ? void 0 : r.accessToken)) {
|
|
673
673
|
const g = a == null ? void 0 : a.filter((x) => x.id !== u);
|
|
674
|
-
l(g || []),
|
|
674
|
+
l(g || []), c("original");
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
async function p(u) {
|
|
@@ -698,7 +698,7 @@ function al() {
|
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: t, children: [
|
|
701
|
-
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
701
|
+
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
702
702
|
/* @__PURE__ */ e.jsxs(oa, { align: "end", className: "w-60", children: [
|
|
703
703
|
/* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
|
|
704
704
|
/* @__PURE__ */ e.jsx(at, {}),
|
|
@@ -706,7 +706,7 @@ function al() {
|
|
|
706
706
|
tt,
|
|
707
707
|
{
|
|
708
708
|
value: n,
|
|
709
|
-
onValueChange:
|
|
709
|
+
onValueChange: o,
|
|
710
710
|
children: [
|
|
711
711
|
/* @__PURE__ */ e.jsx(Js, { value: "original", children: "Original" }),
|
|
712
712
|
a == null ? void 0 : a.map((u) => /* @__PURE__ */ e.jsxs(
|
|
@@ -723,7 +723,7 @@ function al() {
|
|
|
723
723
|
onClick: (y) => {
|
|
724
724
|
y.preventDefault(), p(u);
|
|
725
725
|
},
|
|
726
|
-
className:
|
|
726
|
+
className: Q(
|
|
727
727
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
728
728
|
{
|
|
729
729
|
invisible: !u.isDefault,
|
|
@@ -754,56 +754,64 @@ function al() {
|
|
|
754
754
|
] })
|
|
755
755
|
] });
|
|
756
756
|
}
|
|
757
|
-
function tl(
|
|
758
|
-
|
|
759
|
-
|
|
757
|
+
function tl({
|
|
758
|
+
iconClassName: s
|
|
759
|
+
}) {
|
|
760
|
+
const [t, a] = q(!1), { authToken: n } = ke(), l = z((o) => o.theme), c = z((o) => o.filterValues);
|
|
761
|
+
async function r() {
|
|
760
762
|
{
|
|
761
|
-
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
const
|
|
763
|
+
a(!0);
|
|
764
|
+
const o = new URLSearchParams();
|
|
765
|
+
o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(c));
|
|
766
|
+
const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, u = await (await fetch(d, {
|
|
765
767
|
method: "GET",
|
|
766
768
|
headers: {
|
|
767
|
-
Authorization: `Bearer ${
|
|
769
|
+
Authorization: `Bearer ${n == null ? void 0 : n.accessToken}`
|
|
768
770
|
}
|
|
769
|
-
})).blob(),
|
|
770
|
-
window.open(
|
|
771
|
+
})).blob(), y = URL.createObjectURL(u);
|
|
772
|
+
window.open(y, "_blank"), a(!1);
|
|
771
773
|
}
|
|
772
774
|
}
|
|
773
775
|
return /* @__PURE__ */ e.jsx(
|
|
774
|
-
|
|
776
|
+
O,
|
|
775
777
|
{
|
|
776
|
-
variant: "
|
|
777
|
-
className: "h-7 p-2",
|
|
778
|
+
variant: "link",
|
|
779
|
+
className: "group h-7 p-2",
|
|
778
780
|
size: "sm",
|
|
779
|
-
onClick:
|
|
780
|
-
children:
|
|
781
|
+
onClick: r,
|
|
782
|
+
children: t ? /* @__PURE__ */ e.jsx(Ve, { className: Q("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
783
|
+
nt,
|
|
784
|
+
{
|
|
785
|
+
className: Q("size-3.5", s),
|
|
786
|
+
strokeWidth: 1.5
|
|
787
|
+
}
|
|
788
|
+
)
|
|
781
789
|
}
|
|
782
790
|
);
|
|
783
791
|
}
|
|
784
792
|
function nl() {
|
|
785
793
|
q(!1);
|
|
786
794
|
const { authToken: s } = ke();
|
|
787
|
-
|
|
788
|
-
const t =
|
|
789
|
-
|
|
790
|
-
const
|
|
795
|
+
z((f) => f.theme);
|
|
796
|
+
const t = z((f) => f.lenses), a = z((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = z((f) => f.dashboard);
|
|
797
|
+
z((f) => f.selectedSheetId);
|
|
798
|
+
const c = z(
|
|
791
799
|
(f) => f.isDashboardEditing
|
|
792
800
|
), r = m(
|
|
793
801
|
(f) => f.selectedConnectionId
|
|
794
|
-
), [
|
|
795
|
-
|
|
802
|
+
), [o, d] = q(!1), p = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), y = z((f) => f.showFilters);
|
|
803
|
+
z(
|
|
796
804
|
(f) => f.showDashboardJSON
|
|
797
805
|
);
|
|
798
|
-
const g =
|
|
806
|
+
const g = z((f) => f.onSaveFunction), x = z(
|
|
799
807
|
(f) => f.actions.setShowFilters
|
|
800
|
-
), { addFrame: j, setSelectedFrameId: b } =
|
|
808
|
+
), { addFrame: j, setSelectedFrameId: b } = z(
|
|
801
809
|
(f) => f.actions
|
|
802
|
-
), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON: T } =
|
|
810
|
+
), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON: T } = z((f) => f.actions), F = I(), { tenantId: A, endUserId: N } = Ss(
|
|
803
811
|
() => lt(s == null ? void 0 : s.accessToken),
|
|
804
812
|
[s == null ? void 0 : s.accessToken]
|
|
805
813
|
), S = Ss(() => A || N, [A, N]), L = () => {
|
|
806
|
-
if (!
|
|
814
|
+
if (!c || !F) return;
|
|
807
815
|
const f = {
|
|
808
816
|
connectionId: r,
|
|
809
817
|
id: Je(),
|
|
@@ -849,15 +857,15 @@ function nl() {
|
|
|
849
857
|
!u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(R, { children: n == null ? void 0 : n.name }) }),
|
|
850
858
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
851
859
|
/* @__PURE__ */ e.jsx(tl, {}),
|
|
852
|
-
|
|
860
|
+
c && !u && S && /* @__PURE__ */ e.jsx(sl, {}),
|
|
853
861
|
!u && S && /* @__PURE__ */ e.jsx(al, {}),
|
|
854
|
-
|
|
855
|
-
|
|
862
|
+
c && !u && /* @__PURE__ */ e.jsxs(
|
|
863
|
+
O,
|
|
856
864
|
{
|
|
857
865
|
variant: "secondary",
|
|
858
866
|
className: "h-7 p-2",
|
|
859
867
|
size: "sm",
|
|
860
|
-
disabled: !
|
|
868
|
+
disabled: !c,
|
|
861
869
|
onClick: L,
|
|
862
870
|
children: [
|
|
863
871
|
/* @__PURE__ */ e.jsx(Ds, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
@@ -865,8 +873,8 @@ function nl() {
|
|
|
865
873
|
]
|
|
866
874
|
}
|
|
867
875
|
),
|
|
868
|
-
!
|
|
869
|
-
|
|
876
|
+
!c && /* @__PURE__ */ e.jsx(
|
|
877
|
+
O,
|
|
870
878
|
{
|
|
871
879
|
variant: "ghost",
|
|
872
880
|
className: "h-7 p-2",
|
|
@@ -875,8 +883,8 @@ function nl() {
|
|
|
875
883
|
children: /* @__PURE__ */ e.jsx(Ta, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
876
884
|
}
|
|
877
885
|
),
|
|
878
|
-
|
|
879
|
-
|
|
886
|
+
c && !u && /* @__PURE__ */ e.jsx(
|
|
887
|
+
O,
|
|
880
888
|
{
|
|
881
889
|
variant: "ghost",
|
|
882
890
|
role: "close",
|
|
@@ -888,19 +896,19 @@ function nl() {
|
|
|
888
896
|
children: /* @__PURE__ */ e.jsx(Qe, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
889
897
|
}
|
|
890
898
|
),
|
|
891
|
-
|
|
892
|
-
|
|
899
|
+
c && !u && S && /* @__PURE__ */ e.jsx(
|
|
900
|
+
O,
|
|
893
901
|
{
|
|
894
902
|
className: "h-7 p-2",
|
|
895
903
|
variant: "ghost",
|
|
896
|
-
disabled:
|
|
904
|
+
disabled: o,
|
|
897
905
|
onClick: v,
|
|
898
906
|
size: "sm",
|
|
899
907
|
children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
900
908
|
}
|
|
901
909
|
),
|
|
902
|
-
!y && !u &&
|
|
903
|
-
|
|
910
|
+
!y && !u && c && /* @__PURE__ */ e.jsx(
|
|
911
|
+
O,
|
|
904
912
|
{
|
|
905
913
|
className: "h-7 p-2",
|
|
906
914
|
variant: "ghost",
|
|
@@ -909,7 +917,7 @@ function nl() {
|
|
|
909
917
|
children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
910
918
|
}
|
|
911
919
|
),
|
|
912
|
-
!u &&
|
|
920
|
+
!u && c && !1,
|
|
913
921
|
!u && !1
|
|
914
922
|
] })
|
|
915
923
|
]
|
|
@@ -922,9 +930,9 @@ function Pe({
|
|
|
922
930
|
value: a,
|
|
923
931
|
isLoading: n,
|
|
924
932
|
isError: l,
|
|
925
|
-
connectionTooltip:
|
|
933
|
+
connectionTooltip: c,
|
|
926
934
|
onChange: r,
|
|
927
|
-
showNone:
|
|
935
|
+
showNone: o = !1,
|
|
928
936
|
className: d,
|
|
929
937
|
showIcon: p = !0,
|
|
930
938
|
disabled: u = !1
|
|
@@ -934,7 +942,7 @@ function Pe({
|
|
|
934
942
|
if (s === "Connection")
|
|
935
943
|
return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
|
|
936
944
|
if (s === "Database")
|
|
937
|
-
return /* @__PURE__ */ e.jsx(
|
|
945
|
+
return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
|
|
938
946
|
if (s === "Schema")
|
|
939
947
|
return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
|
|
940
948
|
if (s === "Table")
|
|
@@ -943,15 +951,15 @@ function Pe({
|
|
|
943
951
|
return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
|
|
944
952
|
}
|
|
945
953
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
946
|
-
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
954
|
+
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: c ? /* @__PURE__ */ e.jsxs(da, { children: [
|
|
947
955
|
/* @__PURE__ */ e.jsx(rt, { children: g() }),
|
|
948
|
-
/* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children:
|
|
956
|
+
/* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children: c })
|
|
949
957
|
] }) : g() }),
|
|
950
958
|
/* @__PURE__ */ e.jsxs(me, { disabled: u, value: y, onValueChange: r, children: [
|
|
951
959
|
/* @__PURE__ */ e.jsx(
|
|
952
960
|
he,
|
|
953
961
|
{
|
|
954
|
-
className:
|
|
962
|
+
className: Q(
|
|
955
963
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
956
964
|
d
|
|
957
965
|
),
|
|
@@ -966,10 +974,10 @@ function Pe({
|
|
|
966
974
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
967
975
|
n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
968
976
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
969
|
-
|
|
970
|
-
t && t.map((x, j) => /* @__PURE__ */ e.jsx(
|
|
977
|
+
o && /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
978
|
+
t && t.map((x, j) => /* @__PURE__ */ e.jsx(K, { value: x.id, children: x.name }, j))
|
|
971
979
|
] }),
|
|
972
|
-
(n || l) && /* @__PURE__ */ e.jsx(
|
|
980
|
+
(n || l) && /* @__PURE__ */ e.jsx(K, { value: y, children: y })
|
|
973
981
|
] }) })
|
|
974
982
|
] })
|
|
975
983
|
] });
|
|
@@ -977,13 +985,13 @@ function Pe({
|
|
|
977
985
|
function ll({ column: s }) {
|
|
978
986
|
const [t, a] = q(!1), n = m((x) => x.selectedTableName), l = m(
|
|
979
987
|
(x) => x.selectedSchemaName
|
|
980
|
-
),
|
|
988
|
+
), c = m(
|
|
981
989
|
(x) => x.selectedDatamodelId
|
|
982
|
-
), r = m((x) => x.sqlGen), { modelItems:
|
|
990
|
+
), r = m((x) => x.sqlGen), { modelItems: o } = Re(), d = m((x) => x.actions.setSqlGen), p = m((x) => x.actions.setCardSql), u = m((x) => x.actions.setRunSql);
|
|
983
991
|
function y(x, j) {
|
|
984
992
|
var T;
|
|
985
|
-
const b = ma(x, r, j), I = (T =
|
|
986
|
-
(F) => F.id ===
|
|
993
|
+
const b = ma(x, r, j), I = (T = o == null ? void 0 : o.find(
|
|
994
|
+
(F) => F.id === c
|
|
987
995
|
)) == null ? void 0 : T.name;
|
|
988
996
|
d(b);
|
|
989
997
|
const C = ha(
|
|
@@ -1068,17 +1076,17 @@ function rl({
|
|
|
1068
1076
|
columns: a,
|
|
1069
1077
|
status: n
|
|
1070
1078
|
}) {
|
|
1071
|
-
const l = m((h) => h.sqlGen),
|
|
1079
|
+
const l = m((h) => h.sqlGen), c = m(
|
|
1072
1080
|
(h) => h.selectedConnectionId
|
|
1073
1081
|
), r = m(
|
|
1074
1082
|
(h) => h.selectedDatabaseName
|
|
1075
|
-
),
|
|
1083
|
+
), o = m(
|
|
1076
1084
|
(h) => h.selectedSchemaName
|
|
1077
1085
|
), d = m((h) => h.selectedTableName), p = m(
|
|
1078
1086
|
(h) => h.selectedDatamodelId
|
|
1079
|
-
), u =
|
|
1087
|
+
), u = z(
|
|
1080
1088
|
(h) => h.dashboard.aiScopeTables
|
|
1081
|
-
), { setAIScopeTables: y } =
|
|
1089
|
+
), { setAIScopeTables: y } = z((h) => h.actions), g = m((h) => h.actions.setRunSql), x = m((h) => h.actions.setSqlGen), j = m(
|
|
1082
1090
|
(h) => h.actions.setIsShowingVisual
|
|
1083
1091
|
), b = m((h) => h.actions.setCardSql), { connectionType: I, modelItems: C } = Re();
|
|
1084
1092
|
function T(h) {
|
|
@@ -1092,16 +1100,16 @@ function rl({
|
|
|
1092
1100
|
}
|
|
1093
1101
|
function F() {
|
|
1094
1102
|
return (u == null ? void 0 : u.find(
|
|
1095
|
-
(h) => h.connectinonId ===
|
|
1103
|
+
(h) => h.connectinonId === c && h.tableName === d
|
|
1096
1104
|
)) !== void 0;
|
|
1097
1105
|
}
|
|
1098
1106
|
function A(h) {
|
|
1099
|
-
if (h === !0 && d &&
|
|
1107
|
+
if (h === !0 && d && c) {
|
|
1100
1108
|
const v = {
|
|
1101
|
-
connectinonId:
|
|
1109
|
+
connectinonId: c,
|
|
1102
1110
|
connectionType: I,
|
|
1103
1111
|
databaseName: r,
|
|
1104
|
-
schemaName:
|
|
1112
|
+
schemaName: o,
|
|
1105
1113
|
tableName: d
|
|
1106
1114
|
}, k = [...u || [], v].filter(
|
|
1107
1115
|
(M, H, P) => P.findIndex(
|
|
@@ -1115,7 +1123,7 @@ function rl({
|
|
|
1115
1123
|
});
|
|
1116
1124
|
} else {
|
|
1117
1125
|
const v = (u || []).filter(
|
|
1118
|
-
(f) => f.connectinonId !==
|
|
1126
|
+
(f) => f.connectinonId !== c && f.tableName !== d
|
|
1119
1127
|
);
|
|
1120
1128
|
y(v), Ke(`Removed '${d}' from AI Scope`, {
|
|
1121
1129
|
position: "top-right",
|
|
@@ -1157,7 +1165,7 @@ function rl({
|
|
|
1157
1165
|
children: /* @__PURE__ */ e.jsx(
|
|
1158
1166
|
mt,
|
|
1159
1167
|
{
|
|
1160
|
-
className:
|
|
1168
|
+
className: Q("size-4", {
|
|
1161
1169
|
"text-primary": F(),
|
|
1162
1170
|
"text-muted-foreground": !F()
|
|
1163
1171
|
})
|
|
@@ -1166,7 +1174,7 @@ function rl({
|
|
|
1166
1174
|
}
|
|
1167
1175
|
),
|
|
1168
1176
|
/* @__PURE__ */ e.jsxs(
|
|
1169
|
-
|
|
1177
|
+
O,
|
|
1170
1178
|
{
|
|
1171
1179
|
disabled: n !== "Success",
|
|
1172
1180
|
onClick: S,
|
|
@@ -1180,7 +1188,7 @@ function rl({
|
|
|
1180
1188
|
}
|
|
1181
1189
|
),
|
|
1182
1190
|
/* @__PURE__ */ e.jsxs(
|
|
1183
|
-
|
|
1191
|
+
O,
|
|
1184
1192
|
{
|
|
1185
1193
|
disabled: n !== "Success",
|
|
1186
1194
|
onClick: L,
|
|
@@ -1203,7 +1211,7 @@ function rl({
|
|
|
1203
1211
|
"div",
|
|
1204
1212
|
{
|
|
1205
1213
|
onClick: () => T(h),
|
|
1206
|
-
className:
|
|
1214
|
+
className: Q(
|
|
1207
1215
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1208
1216
|
{
|
|
1209
1217
|
"bg-muted": ht(h, l)
|
|
@@ -1238,11 +1246,11 @@ function Re(s, t) {
|
|
|
1238
1246
|
let a = Ss(() => [], []);
|
|
1239
1247
|
const n = ke().authToken || s, l = m(
|
|
1240
1248
|
(i) => i.selectedConnectionId
|
|
1241
|
-
),
|
|
1249
|
+
), c = m(
|
|
1242
1250
|
(i) => i.selectedDatamodelId
|
|
1243
1251
|
), r = m(
|
|
1244
1252
|
(i) => i.selectedDatabaseName
|
|
1245
|
-
),
|
|
1253
|
+
), o = m(
|
|
1246
1254
|
(i) => i.selectedSchemaName
|
|
1247
1255
|
), d = m((i) => i.selectedTableName), p = m(
|
|
1248
1256
|
(i) => i.actions.setCurrentColumns
|
|
@@ -1258,10 +1266,10 @@ function Re(s, t) {
|
|
|
1258
1266
|
(i) => i.actions.setSelectedTableName
|
|
1259
1267
|
), b = m((i) => i.actions.setCardSql);
|
|
1260
1268
|
function I(i) {
|
|
1261
|
-
return l && r &&
|
|
1269
|
+
return l && r && o && r !== "NA" ? !0 : l && i === "API" ? !1 : !!(l && i === "S3");
|
|
1262
1270
|
}
|
|
1263
1271
|
function C(i) {
|
|
1264
|
-
return !!(l && r && r !== "NA" &&
|
|
1272
|
+
return !!(l && r && r !== "NA" && o && d || l && (i === "S3" || i === "API") || c && c);
|
|
1265
1273
|
}
|
|
1266
1274
|
function T(i) {
|
|
1267
1275
|
return l && i ? !(i === "API" || i === "S3") : !1;
|
|
@@ -1313,7 +1321,7 @@ function Re(s, t) {
|
|
|
1313
1321
|
enabled: T(f)
|
|
1314
1322
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1315
1323
|
}), {
|
|
1316
|
-
data:
|
|
1324
|
+
data: W,
|
|
1317
1325
|
isLoading: ae,
|
|
1318
1326
|
isFetching: w,
|
|
1319
1327
|
isError: _,
|
|
@@ -1341,7 +1349,7 @@ function Re(s, t) {
|
|
|
1341
1349
|
"tables",
|
|
1342
1350
|
l,
|
|
1343
1351
|
r,
|
|
1344
|
-
|
|
1352
|
+
o
|
|
1345
1353
|
],
|
|
1346
1354
|
queryFn: () => Fe(
|
|
1347
1355
|
"https://semaphor.cloud/api/v1/tables",
|
|
@@ -1349,22 +1357,22 @@ function Re(s, t) {
|
|
|
1349
1357
|
{
|
|
1350
1358
|
connection_id: l,
|
|
1351
1359
|
database_name: r,
|
|
1352
|
-
schema_name:
|
|
1360
|
+
schema_name: o
|
|
1353
1361
|
}
|
|
1354
1362
|
),
|
|
1355
1363
|
enabled: I(f)
|
|
1356
1364
|
}), {
|
|
1357
1365
|
data: te,
|
|
1358
1366
|
isLoading: Le,
|
|
1359
|
-
isFetching:
|
|
1367
|
+
isFetching: ze,
|
|
1360
1368
|
isError: be
|
|
1361
1369
|
} = Ne({
|
|
1362
1370
|
queryKey: [
|
|
1363
1371
|
"columns",
|
|
1364
1372
|
l,
|
|
1365
1373
|
r,
|
|
1366
|
-
o,
|
|
1367
1374
|
c,
|
|
1375
|
+
o,
|
|
1368
1376
|
d
|
|
1369
1377
|
],
|
|
1370
1378
|
queryFn: () => Fe(
|
|
@@ -1372,10 +1380,10 @@ function Re(s, t) {
|
|
|
1372
1380
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1373
1381
|
{
|
|
1374
1382
|
connection_id: l,
|
|
1375
|
-
datamodel_id:
|
|
1383
|
+
datamodel_id: c || "",
|
|
1376
1384
|
// don't pass undefined. Pass empty string
|
|
1377
1385
|
database_name: r,
|
|
1378
|
-
schema_name:
|
|
1386
|
+
schema_name: o,
|
|
1379
1387
|
table_name: d
|
|
1380
1388
|
}
|
|
1381
1389
|
),
|
|
@@ -1399,20 +1407,20 @@ function Re(s, t) {
|
|
|
1399
1407
|
g,
|
|
1400
1408
|
v
|
|
1401
1409
|
]);
|
|
1402
|
-
const ye = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : d || "",
|
|
1410
|
+
const ye = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : d || "", J = k ? "" : o || "";
|
|
1403
1411
|
function oe(i) {
|
|
1404
1412
|
x(i), j("");
|
|
1405
1413
|
}
|
|
1406
1414
|
function ce(i) {
|
|
1407
1415
|
g(i === "none" ? "" : i), x(""), j(""), i !== "none" && i !== "" && y("");
|
|
1408
1416
|
}
|
|
1409
|
-
function
|
|
1417
|
+
function Oe(i) {
|
|
1410
1418
|
u(i);
|
|
1411
1419
|
}
|
|
1412
1420
|
function Me(i) {
|
|
1413
1421
|
y(i === "none" ? "" : i), i !== "none" && i !== "" && g("");
|
|
1414
1422
|
}
|
|
1415
|
-
M && ((Ze = M == null ? void 0 : M.databases) == null ? void 0 : Ze.length) > 0,
|
|
1423
|
+
M && ((Ze = M == null ? void 0 : M.databases) == null ? void 0 : Ze.length) > 0, W && ((es = W == null ? void 0 : W.schemas) == null ? void 0 : es.length) > 0, te && ((ss = te == null ? void 0 : te.columns) == null ? void 0 : ss.length) > 0 && (a = te.columns.map((i) => ({
|
|
1416
1424
|
...i,
|
|
1417
1425
|
data_type: i.data_type.toLowerCase()
|
|
1418
1426
|
}))), Y && (a = []), (be || N) && (a = []);
|
|
@@ -1428,7 +1436,7 @@ function Re(s, t) {
|
|
|
1428
1436
|
})), Ee = M == null ? void 0 : M.databases.map((i) => ({
|
|
1429
1437
|
id: i.database_name,
|
|
1430
1438
|
name: i.database_name
|
|
1431
|
-
})), gs =
|
|
1439
|
+
})), gs = W == null ? void 0 : W.schemas.map((i) => ({
|
|
1432
1440
|
id: i.schema_name,
|
|
1433
1441
|
name: i.schema_name
|
|
1434
1442
|
})), Ye = E == null ? void 0 : E.tables.map((i) => ({
|
|
@@ -1452,13 +1460,13 @@ function Re(s, t) {
|
|
|
1452
1460
|
isTableLoadingOrFetching: D || se,
|
|
1453
1461
|
isTableError: $,
|
|
1454
1462
|
columns: a,
|
|
1455
|
-
isColumnsLoadingOrFetching: Le ||
|
|
1463
|
+
isColumnsLoadingOrFetching: Le || ze,
|
|
1456
1464
|
isColumnsError: be,
|
|
1457
1465
|
isNonDbConnection: k,
|
|
1458
1466
|
connectionType: f,
|
|
1459
1467
|
tableName: ye,
|
|
1460
|
-
schemaName:
|
|
1461
|
-
handleConnectionChange:
|
|
1468
|
+
schemaName: J,
|
|
1469
|
+
handleConnectionChange: Oe,
|
|
1462
1470
|
handleDatamodelChange: Me,
|
|
1463
1471
|
handleDatabaseChange: ce,
|
|
1464
1472
|
handleSchemaChange: oe
|
|
@@ -1476,10 +1484,10 @@ function Aa({
|
|
|
1476
1484
|
($) => $.selectedDatabaseName
|
|
1477
1485
|
), l = m(
|
|
1478
1486
|
($) => $.selectedSchemaName
|
|
1479
|
-
),
|
|
1487
|
+
), c = m(($) => $.selectedTableName), r = m(
|
|
1480
1488
|
($) => $.actions.setSelectedTableName
|
|
1481
1489
|
), {
|
|
1482
|
-
connectionItems:
|
|
1490
|
+
connectionItems: o,
|
|
1483
1491
|
modelItems: d,
|
|
1484
1492
|
schemaItems: p,
|
|
1485
1493
|
databaseItems: u,
|
|
@@ -1506,7 +1514,7 @@ function Aa({
|
|
|
1506
1514
|
tableName: Y,
|
|
1507
1515
|
schemaName: ie
|
|
1508
1516
|
} = Re();
|
|
1509
|
-
function
|
|
1517
|
+
function W() {
|
|
1510
1518
|
return s ? s(ie, Y, g) : /* @__PURE__ */ e.jsx(
|
|
1511
1519
|
rl,
|
|
1512
1520
|
{
|
|
@@ -1585,7 +1593,7 @@ function Aa({
|
|
|
1585
1593
|
isError: h,
|
|
1586
1594
|
items: y,
|
|
1587
1595
|
isLoading: L,
|
|
1588
|
-
value:
|
|
1596
|
+
value: c || "",
|
|
1589
1597
|
title: "Table"
|
|
1590
1598
|
}
|
|
1591
1599
|
) : null;
|
|
@@ -1595,13 +1603,13 @@ function Aa({
|
|
|
1595
1603
|
/* @__PURE__ */ e.jsx(
|
|
1596
1604
|
Pe,
|
|
1597
1605
|
{
|
|
1598
|
-
items:
|
|
1606
|
+
items: o,
|
|
1599
1607
|
title: "Connection",
|
|
1600
1608
|
value: t || "",
|
|
1601
1609
|
onChange: k,
|
|
1602
1610
|
isLoading: x,
|
|
1603
1611
|
isError: b,
|
|
1604
|
-
connectionTooltip: ((se =
|
|
1612
|
+
connectionTooltip: ((se = o == null ? void 0 : o.find(
|
|
1605
1613
|
($) => $.id === t
|
|
1606
1614
|
)) == null ? void 0 : se.type) || ""
|
|
1607
1615
|
}
|
|
@@ -1612,9 +1620,9 @@ function Aa({
|
|
|
1612
1620
|
E(),
|
|
1613
1621
|
D()
|
|
1614
1622
|
] }),
|
|
1615
|
-
|
|
1623
|
+
W(),
|
|
1616
1624
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1617
|
-
|
|
1625
|
+
O,
|
|
1618
1626
|
{
|
|
1619
1627
|
onClick: ae,
|
|
1620
1628
|
size: "sm",
|
|
@@ -1630,18 +1638,18 @@ function Aa({
|
|
|
1630
1638
|
}
|
|
1631
1639
|
function il(s) {
|
|
1632
1640
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1633
|
-
let
|
|
1634
|
-
if (l !== -1 && (
|
|
1635
|
-
const r = s.substring(0, t),
|
|
1636
|
-
return `${r} {{ filters | where }} AND ${
|
|
1641
|
+
let c = s.length;
|
|
1642
|
+
if (l !== -1 && (c = l), n !== -1 && n < c && (c = n), t !== -1) {
|
|
1643
|
+
const r = s.substring(0, t), o = s.substring(t);
|
|
1644
|
+
return `${r} {{ filters | where }} AND ${o.substring(
|
|
1637
1645
|
6
|
|
1638
1646
|
)}`;
|
|
1639
1647
|
} else if (a !== -1) {
|
|
1640
|
-
const r = s.substring(0, a),
|
|
1641
|
-
return `${r} {{ filters | where }} ${
|
|
1648
|
+
const r = s.substring(0, a), o = s.substring(a);
|
|
1649
|
+
return `${r} {{ filters | where }} ${o}`;
|
|
1642
1650
|
} else {
|
|
1643
|
-
const r = s.substring(0,
|
|
1644
|
-
return `${r} {{ filters | where }} ${
|
|
1651
|
+
const r = s.substring(0, c), o = s.substring(c);
|
|
1652
|
+
return `${r} {{ filters | where }} ${o}`;
|
|
1645
1653
|
}
|
|
1646
1654
|
}
|
|
1647
1655
|
function ol({
|
|
@@ -1651,7 +1659,7 @@ function ol({
|
|
|
1651
1659
|
setTriggerAIRun: n
|
|
1652
1660
|
}) {
|
|
1653
1661
|
return /* @__PURE__ */ e.jsxs(Vs, { openDelay: 0, children: [
|
|
1654
|
-
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1662
|
+
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1655
1663
|
/* @__PURE__ */ e.jsx(
|
|
1656
1664
|
Rs,
|
|
1657
1665
|
{
|
|
@@ -1660,7 +1668,7 @@ function ol({
|
|
|
1660
1668
|
children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1661
1669
|
/* @__PURE__ */ e.jsx(We, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
|
|
1662
1670
|
/* @__PURE__ */ e.jsxs(
|
|
1663
|
-
|
|
1671
|
+
O,
|
|
1664
1672
|
{
|
|
1665
1673
|
onClick: () => {
|
|
1666
1674
|
t(!0), a(s), n(!0);
|
|
@@ -1731,9 +1739,9 @@ function dl({
|
|
|
1731
1739
|
userInput: a,
|
|
1732
1740
|
setUserInput: n,
|
|
1733
1741
|
triggerAIRun: l,
|
|
1734
|
-
setTriggerAIRun:
|
|
1742
|
+
setTriggerAIRun: c
|
|
1735
1743
|
}) {
|
|
1736
|
-
const r = ws(null),
|
|
1744
|
+
const r = ws(null), o = ws(null), { authToken: d } = ke(), [p, u] = q(!1), y = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), x = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [b, I] = q([]), C = m((w) => w.currentColumns), T = m((w) => w.card.sql), F = m((w) => w.selectedTableName), A = `
|
|
1737
1745
|
${a}
|
|
1738
1746
|
|
|
1739
1747
|
Database Query Dialect: ${F === "api" || F === "s3" ? "DuckDb" : ""}
|
|
@@ -1779,8 +1787,8 @@ function dl({
|
|
|
1779
1787
|
}, [S]), Z(() => {
|
|
1780
1788
|
const w = setTimeout(() => {
|
|
1781
1789
|
var _;
|
|
1782
|
-
|
|
1783
|
-
top:
|
|
1790
|
+
o.current && (o.current.scroll({
|
|
1791
|
+
top: o.current.scrollHeight,
|
|
1784
1792
|
behavior: "smooth"
|
|
1785
1793
|
}), (_ = r.current) == null || _.focus());
|
|
1786
1794
|
}, 100);
|
|
@@ -1790,8 +1798,8 @@ function dl({
|
|
|
1790
1798
|
a && (I((w) => [...w, { role: "user", content: a }]), k(a) && u(!0), n(""), f());
|
|
1791
1799
|
}
|
|
1792
1800
|
Z(() => {
|
|
1793
|
-
l && (M(),
|
|
1794
|
-
}, [l,
|
|
1801
|
+
l && (M(), c(!1));
|
|
1802
|
+
}, [l, c]);
|
|
1795
1803
|
const H = {
|
|
1796
1804
|
//seleect a darker color
|
|
1797
1805
|
// color: '#000',
|
|
@@ -1824,12 +1832,12 @@ function dl({
|
|
|
1824
1832
|
pre: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
|
|
1825
1833
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: _.children }),
|
|
1826
1834
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1827
|
-
/* @__PURE__ */ e.jsx(
|
|
1835
|
+
/* @__PURE__ */ e.jsx(O, { onClick: W, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
|
|
1828
1836
|
/* @__PURE__ */ e.jsx(
|
|
1829
|
-
|
|
1837
|
+
O,
|
|
1830
1838
|
{
|
|
1831
1839
|
onClick: (ee) => {
|
|
1832
|
-
const E =
|
|
1840
|
+
const E = W(ee);
|
|
1833
1841
|
E && (t(!1), y(E), x(!0));
|
|
1834
1842
|
},
|
|
1835
1843
|
size: "sm",
|
|
@@ -1842,7 +1850,7 @@ function dl({
|
|
|
1842
1850
|
li: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsx("li", { style: Y, ..._ })
|
|
1843
1851
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1844
1852
|
};
|
|
1845
|
-
function
|
|
1853
|
+
function W(w) {
|
|
1846
1854
|
const _ = w.currentTarget.closest("pre");
|
|
1847
1855
|
if (!_) return;
|
|
1848
1856
|
const ee = _.textContent || _.innerText;
|
|
@@ -1871,7 +1879,7 @@ function dl({
|
|
|
1871
1879
|
}
|
|
1872
1880
|
return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
|
|
1873
1881
|
/* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1874
|
-
|
|
1882
|
+
O,
|
|
1875
1883
|
{
|
|
1876
1884
|
size: "sm",
|
|
1877
1885
|
className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
@@ -1891,7 +1899,7 @@ function dl({
|
|
|
1891
1899
|
/* @__PURE__ */ e.jsx(
|
|
1892
1900
|
"div",
|
|
1893
1901
|
{
|
|
1894
|
-
ref:
|
|
1902
|
+
ref: o,
|
|
1895
1903
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
1896
1904
|
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: ae() })
|
|
1897
1905
|
}
|
|
@@ -1913,7 +1921,7 @@ function dl({
|
|
|
1913
1921
|
const _ = w.target, ee = _.value.length;
|
|
1914
1922
|
_.setSelectionRange(ee, ee);
|
|
1915
1923
|
},
|
|
1916
|
-
className:
|
|
1924
|
+
className: Q(
|
|
1917
1925
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1918
1926
|
),
|
|
1919
1927
|
disabled: L || h,
|
|
@@ -1923,7 +1931,7 @@ function dl({
|
|
|
1923
1931
|
),
|
|
1924
1932
|
" ",
|
|
1925
1933
|
/* @__PURE__ */ e.jsx(
|
|
1926
|
-
|
|
1934
|
+
O,
|
|
1927
1935
|
{
|
|
1928
1936
|
className: "h-8",
|
|
1929
1937
|
size: "sm",
|
|
@@ -1951,9 +1959,9 @@ function ml(s, t) {
|
|
|
1951
1959
|
if (s == null) return {};
|
|
1952
1960
|
var a = hl(s, t), n, l;
|
|
1953
1961
|
if (Object.getOwnPropertySymbols) {
|
|
1954
|
-
var
|
|
1955
|
-
for (l = 0; l <
|
|
1956
|
-
n =
|
|
1962
|
+
var c = Object.getOwnPropertySymbols(s);
|
|
1963
|
+
for (l = 0; l < c.length; l++)
|
|
1964
|
+
n = c[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1957
1965
|
}
|
|
1958
1966
|
return a;
|
|
1959
1967
|
}
|
|
@@ -2030,8 +2038,8 @@ function gl(s) {
|
|
|
2030
2038
|
var {
|
|
2031
2039
|
attr: n,
|
|
2032
2040
|
size: l,
|
|
2033
|
-
title:
|
|
2034
|
-
} = s, r = ml(s, ul),
|
|
2041
|
+
title: c
|
|
2042
|
+
} = s, r = ml(s, ul), o = l || a.size || "1em", d;
|
|
2035
2043
|
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ we.createElement("svg", cs({
|
|
2036
2044
|
stroke: "currentColor",
|
|
2037
2045
|
fill: "currentColor",
|
|
@@ -2041,10 +2049,10 @@ function gl(s) {
|
|
|
2041
2049
|
style: ds(ds({
|
|
2042
2050
|
color: s.color || a.color
|
|
2043
2051
|
}, a.style), s.style),
|
|
2044
|
-
height:
|
|
2045
|
-
width:
|
|
2052
|
+
height: o,
|
|
2053
|
+
width: o,
|
|
2046
2054
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2047
|
-
}),
|
|
2055
|
+
}), c && /* @__PURE__ */ we.createElement("title", null, c), s.children);
|
|
2048
2056
|
};
|
|
2049
2057
|
return sa !== void 0 ? /* @__PURE__ */ we.createElement(sa.Consumer, null, (a) => t(a)) : t(Va);
|
|
2050
2058
|
}
|
|
@@ -2053,7 +2061,7 @@ function jl(s) {
|
|
|
2053
2061
|
}
|
|
2054
2062
|
function bl({ sql: s }) {
|
|
2055
2063
|
return /* @__PURE__ */ e.jsxs(Vs, { children: [
|
|
2056
|
-
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2064
|
+
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2057
2065
|
/* @__PURE__ */ e.jsx(
|
|
2058
2066
|
Rs,
|
|
2059
2067
|
{
|
|
@@ -2071,10 +2079,10 @@ function yl() {
|
|
|
2071
2079
|
const [s, t] = q({
|
|
2072
2080
|
queryKey: [],
|
|
2073
2081
|
queryData: null
|
|
2074
|
-
}), { theme: a } = bt(), n = yt(), l = ws(),
|
|
2075
|
-
|
|
2076
|
-
const C = m((i) => i.card), T =
|
|
2077
|
-
|
|
2082
|
+
}), { theme: a } = bt(), n = yt(), l = ws(), c = vt(), [r, o] = q(!1), [d, p] = q(!1), [u, y] = q(!1), [g, x] = q(""), [j, b] = q(!1), I = z((i) => i.selectedSheetId);
|
|
2083
|
+
z((i) => i.dashboard.baseQueries);
|
|
2084
|
+
const C = m((i) => i.card), T = z((i) => i.theme), F = m((i) => i.isShowingVisual);
|
|
2085
|
+
z((i) => i.onAcceptChanges);
|
|
2078
2086
|
const A = m(
|
|
2079
2087
|
(i) => i.selectedConnectionId
|
|
2080
2088
|
), N = m(
|
|
@@ -2084,15 +2092,15 @@ function yl() {
|
|
|
2084
2092
|
), L = m(
|
|
2085
2093
|
(i) => i.selectedSchemaName
|
|
2086
2094
|
);
|
|
2087
|
-
|
|
2095
|
+
z(
|
|
2088
2096
|
(i) => i.actions.updateFrameCard
|
|
2089
2097
|
);
|
|
2090
|
-
const h = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), M =
|
|
2098
|
+
const h = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), M = z((i) => i.dashboard.filters), H = z((i) => i.filterValues), P = M == null ? void 0 : M.filter(
|
|
2091
2099
|
(i) => i.sheetId === I || !i.sheetId
|
|
2092
2100
|
), Y = H == null ? void 0 : H.filter(
|
|
2093
2101
|
(i) => (P == null ? void 0 : P.some((ne) => ne.id === i.filterId)) || i.filterId.endsWith(I)
|
|
2094
2102
|
), ie = m((i) => i.applyFilters), {
|
|
2095
|
-
setCardCustomCfg:
|
|
2103
|
+
setCardCustomCfg: W,
|
|
2096
2104
|
setQueryResultColumns: ae,
|
|
2097
2105
|
setFilterValues: w,
|
|
2098
2106
|
setCardSql: _,
|
|
@@ -2105,55 +2113,55 @@ function yl() {
|
|
|
2105
2113
|
m(
|
|
2106
2114
|
(i) => i.actions.setApplyFilters
|
|
2107
2115
|
);
|
|
2108
|
-
const te = m((i) => i.onClose), Le = m((i) => i.actions.setSqlGen),
|
|
2116
|
+
const te = m((i) => i.onClose), Le = m((i) => i.actions.setSqlGen), ze = m((i) => i.runSql), be = m((i) => i.actions.setRunSql);
|
|
2109
2117
|
m((i) => i.actions.setCardCfg);
|
|
2110
2118
|
const ye = m(
|
|
2111
2119
|
(i) => i.actions.setIsSqlRunning
|
|
2112
2120
|
), {
|
|
2113
|
-
data:
|
|
2121
|
+
data: J,
|
|
2114
2122
|
isLoading: oe,
|
|
2115
2123
|
isFetching: ce,
|
|
2116
|
-
isSuccess:
|
|
2124
|
+
isSuccess: Oe,
|
|
2117
2125
|
isError: Me,
|
|
2118
2126
|
error: He,
|
|
2119
2127
|
queryKey: $e,
|
|
2120
2128
|
refetch: Ee
|
|
2121
2129
|
} = qe(C);
|
|
2122
2130
|
Z(() => {
|
|
2123
|
-
if (
|
|
2131
|
+
if (J && (J.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2124
2132
|
position: "top-center",
|
|
2125
2133
|
richColors: !0
|
|
2126
|
-
}), se((
|
|
2127
|
-
const { dimensionKeys: i } = vs(
|
|
2134
|
+
}), se((J == null ? void 0 : J.output) || ""), J.records.length > 0)) {
|
|
2135
|
+
const { dimensionKeys: i } = vs(J.records);
|
|
2128
2136
|
ae(i);
|
|
2129
2137
|
}
|
|
2130
2138
|
}, [
|
|
2131
|
-
|
|
2139
|
+
J,
|
|
2132
2140
|
// setCardData,
|
|
2133
2141
|
ae,
|
|
2134
2142
|
se
|
|
2135
2143
|
]), Z(() => {
|
|
2136
|
-
(oe || ce) && ye(!0), (Me ||
|
|
2144
|
+
(oe || ce) && ye(!0), (Me || Oe) && ye(!1), Me ? (D(He.message), ae([]), se("")) : D("");
|
|
2137
2145
|
}, [
|
|
2138
2146
|
oe,
|
|
2139
2147
|
ce,
|
|
2140
|
-
|
|
2148
|
+
J,
|
|
2141
2149
|
se,
|
|
2142
2150
|
Me,
|
|
2143
|
-
|
|
2151
|
+
Oe,
|
|
2144
2152
|
ye,
|
|
2145
2153
|
ae,
|
|
2146
2154
|
D,
|
|
2147
2155
|
He
|
|
2148
2156
|
]), Z(() => {
|
|
2149
|
-
|
|
2150
|
-
}, [
|
|
2157
|
+
ze && (Ee(), be(!1));
|
|
2158
|
+
}, [ze, Ee, be]);
|
|
2151
2159
|
function gs() {
|
|
2152
2160
|
const i = n.getQueryData($e);
|
|
2153
2161
|
s.queryData || t({
|
|
2154
2162
|
queryKey: $e,
|
|
2155
2163
|
queryData: i
|
|
2156
|
-
}), n.setQueryData($e, null), _(""), Le({}),
|
|
2164
|
+
}), n.setQueryData($e, null), _(""), Le({}), W(""), $({});
|
|
2157
2165
|
}
|
|
2158
2166
|
const Ye = (i) => {
|
|
2159
2167
|
l.current = i;
|
|
@@ -2205,9 +2213,9 @@ function yl() {
|
|
|
2205
2213
|
i && ne && n.setQueryData(i, ne), te == null || te();
|
|
2206
2214
|
}
|
|
2207
2215
|
Z(() => {
|
|
2208
|
-
if (!
|
|
2216
|
+
if (!c) return;
|
|
2209
2217
|
const i = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ve = T === "system" ? ne : T;
|
|
2210
|
-
return
|
|
2218
|
+
return c.editor.defineTheme("default", {
|
|
2211
2219
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2212
2220
|
base: ve === "light" ? "vs" : "vs-dark",
|
|
2213
2221
|
inherit: !0,
|
|
@@ -2219,14 +2227,14 @@ function yl() {
|
|
|
2219
2227
|
// ? '#ffffff'
|
|
2220
2228
|
// : getCssVariableValue('--semaphor-background'),
|
|
2221
2229
|
}
|
|
2222
|
-
}),
|
|
2223
|
-
|
|
2230
|
+
}), c.editor.setTheme("default"), i && c && i.addCommand(
|
|
2231
|
+
c.KeyMod.Shift | c.KeyCode.Enter,
|
|
2224
2232
|
function() {
|
|
2225
2233
|
return Ee(), !1;
|
|
2226
2234
|
}
|
|
2227
2235
|
), () => {
|
|
2228
2236
|
};
|
|
2229
|
-
}, [a, T,
|
|
2237
|
+
}, [a, T, c]);
|
|
2230
2238
|
function ss() {
|
|
2231
2239
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2232
2240
|
d && /* @__PURE__ */ e.jsx(
|
|
@@ -2284,7 +2292,7 @@ function yl() {
|
|
|
2284
2292
|
ca,
|
|
2285
2293
|
{
|
|
2286
2294
|
onClick: () => p(!0),
|
|
2287
|
-
className:
|
|
2295
|
+
className: Q(
|
|
2288
2296
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
2289
2297
|
{
|
|
2290
2298
|
"font-bold text-red-800": ie
|
|
@@ -2424,7 +2432,7 @@ function yl() {
|
|
|
2424
2432
|
children: [
|
|
2425
2433
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2426
2434
|
/* @__PURE__ */ e.jsxs(
|
|
2427
|
-
|
|
2435
|
+
O,
|
|
2428
2436
|
{
|
|
2429
2437
|
title: "Shift + Enter",
|
|
2430
2438
|
disabled: oe || ce,
|
|
@@ -2450,7 +2458,7 @@ function yl() {
|
|
|
2450
2458
|
}
|
|
2451
2459
|
),
|
|
2452
2460
|
/* @__PURE__ */ e.jsxs(
|
|
2453
|
-
|
|
2461
|
+
O,
|
|
2454
2462
|
{
|
|
2455
2463
|
onClick: gs,
|
|
2456
2464
|
className: "",
|
|
@@ -2466,7 +2474,7 @@ function yl() {
|
|
|
2466
2474
|
pa,
|
|
2467
2475
|
{
|
|
2468
2476
|
pressed: r,
|
|
2469
|
-
onPressedChange: (i) =>
|
|
2477
|
+
onPressedChange: (i) => o(i),
|
|
2470
2478
|
className: "",
|
|
2471
2479
|
size: "sm",
|
|
2472
2480
|
variant: "outline",
|
|
@@ -2486,9 +2494,9 @@ function yl() {
|
|
|
2486
2494
|
)
|
|
2487
2495
|
] }),
|
|
2488
2496
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2489
|
-
(
|
|
2497
|
+
(J == null ? void 0 : J.sql) && /* @__PURE__ */ e.jsx(bl, { sql: J.sql }),
|
|
2490
2498
|
/* @__PURE__ */ e.jsxs(
|
|
2491
|
-
|
|
2499
|
+
O,
|
|
2492
2500
|
{
|
|
2493
2501
|
onClick: es,
|
|
2494
2502
|
className: "w-full",
|
|
@@ -2501,7 +2509,7 @@ function yl() {
|
|
|
2501
2509
|
}
|
|
2502
2510
|
),
|
|
2503
2511
|
/* @__PURE__ */ e.jsxs(
|
|
2504
|
-
|
|
2512
|
+
O,
|
|
2505
2513
|
{
|
|
2506
2514
|
onClick: Ze,
|
|
2507
2515
|
size: "sm",
|
|
@@ -2523,9 +2531,9 @@ function yl() {
|
|
|
2523
2531
|
}
|
|
2524
2532
|
function vl({ data: s }) {
|
|
2525
2533
|
var r;
|
|
2526
|
-
const [t, a] = we.useState([]), l = Object.keys(s[0]).map((
|
|
2534
|
+
const [t, a] = we.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2527
2535
|
// header: key,
|
|
2528
|
-
accessorKey:
|
|
2536
|
+
accessorKey: o,
|
|
2529
2537
|
header: ({ column: d }) => {
|
|
2530
2538
|
const p = d.getIsSorted();
|
|
2531
2539
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -2534,13 +2542,13 @@ function vl({ data: s }) {
|
|
|
2534
2542
|
className: "flex cursor-pointer items-center",
|
|
2535
2543
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2536
2544
|
children: [
|
|
2537
|
-
|
|
2545
|
+
o,
|
|
2538
2546
|
p === "asc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(kt, { className: "ml-2 h-5 w-5" }) : null
|
|
2539
2547
|
]
|
|
2540
2548
|
}
|
|
2541
2549
|
) });
|
|
2542
2550
|
}
|
|
2543
|
-
})),
|
|
2551
|
+
})), c = zt({
|
|
2544
2552
|
data: s,
|
|
2545
2553
|
columns: l,
|
|
2546
2554
|
getCoreRowModel: Tt(),
|
|
@@ -2552,34 +2560,34 @@ function vl({ data: s }) {
|
|
|
2552
2560
|
sorting: t
|
|
2553
2561
|
}
|
|
2554
2562
|
});
|
|
2555
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2556
|
-
/* @__PURE__ */ e.jsx(Ft, { children:
|
|
2563
|
+
return /* @__PURE__ */ e.jsxs(Ot, { children: [
|
|
2564
|
+
/* @__PURE__ */ e.jsx(Ft, { children: c.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(bs, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(It, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ws(
|
|
2557
2565
|
d.column.columnDef.header,
|
|
2558
2566
|
d.getContext()
|
|
2559
|
-
) }, d.id)) },
|
|
2560
|
-
/* @__PURE__ */ e.jsx(Dt, { children: (r =
|
|
2567
|
+
) }, d.id)) }, o.id)) }),
|
|
2568
|
+
/* @__PURE__ */ e.jsx(Dt, { children: (r = c.getRowModel().rows) != null && r.length ? c.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2561
2569
|
bs,
|
|
2562
2570
|
{
|
|
2563
2571
|
className: "whitespace-nowrap py-2",
|
|
2564
|
-
"data-state":
|
|
2565
|
-
children:
|
|
2572
|
+
"data-state": o.getIsSelected() && "selected",
|
|
2573
|
+
children: o.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Ys, { children: Ws(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2566
2574
|
},
|
|
2567
|
-
|
|
2575
|
+
o.id
|
|
2568
2576
|
)) : /* @__PURE__ */ e.jsx(bs, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2569
2577
|
] });
|
|
2570
2578
|
}
|
|
2571
2579
|
function Cl({ card: s }) {
|
|
2572
2580
|
var g, x, j, b, I, C, T, F, A, N;
|
|
2573
|
-
const { authToken: t } = ke(), a = Et(t == null ? void 0 : t.accessToken), n =
|
|
2581
|
+
const { authToken: t } = ke(), a = Et(t == null ? void 0 : t.accessToken), n = z((S) => S.themeStyle), l = {
|
|
2574
2582
|
colors: ((x = (g = n == null ? void 0 : n.chart) == null ? void 0 : g.dataset) == null ? void 0 : x.backgroundColor) || []
|
|
2575
2583
|
};
|
|
2576
2584
|
(j = s.customCardPreferences) != null && j.inputData;
|
|
2577
|
-
const { getCard:
|
|
2585
|
+
const { getCard: c } = ja(((b = s.customCardPreferences) == null ? void 0 : b.url) || ""), r = ((I = s.customCardPreferences) == null ? void 0 : I.visualType) || "single", o = m((S) => S.frame);
|
|
2578
2586
|
re();
|
|
2579
2587
|
const { data: d } = qe(s);
|
|
2580
2588
|
if (!((C = s.customCardPreferences) != null && C.componentName))
|
|
2581
2589
|
return null;
|
|
2582
|
-
const p =
|
|
2590
|
+
const p = c(
|
|
2583
2591
|
(T = s.customCardPreferences) == null ? void 0 : T.componentName
|
|
2584
2592
|
), u = (S) => {
|
|
2585
2593
|
console.log("data", S), s.customCardPreferences;
|
|
@@ -2587,7 +2595,7 @@ function Cl({ card: s }) {
|
|
|
2587
2595
|
((F = s.customCardPreferences) == null ? void 0 : F.dataInputCardIds) || {}
|
|
2588
2596
|
).map((S) => {
|
|
2589
2597
|
var v, f, k;
|
|
2590
|
-
const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, h = (k =
|
|
2598
|
+
const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, h = (k = o == null ? void 0 : o.cards) == null ? void 0 : k.find((M) => M.id === L);
|
|
2591
2599
|
return h || null;
|
|
2592
2600
|
});
|
|
2593
2601
|
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(
|
|
@@ -2631,9 +2639,9 @@ function Ra({
|
|
|
2631
2639
|
...t
|
|
2632
2640
|
}) {
|
|
2633
2641
|
var x, j;
|
|
2634
|
-
const a = m((b) => b.card), n = ((x = a.customCardPreferences) == null ? void 0 : x.showCardHeader) ?? !0, l = m((b) => b.frame),
|
|
2642
|
+
const a = m((b) => b.card), n = ((x = a.customCardPreferences) == null ? void 0 : x.showCardHeader) ?? !0, l = m((b) => b.frame), c = z((b) => b.dashboard.filters);
|
|
2635
2643
|
m((b) => b.actions.setRunSql);
|
|
2636
|
-
const { updateFilter: r } =
|
|
2644
|
+
const { updateFilter: r } = Os(), o = c == null ? void 0 : c.find((b) => b.id === l.filterId), { data: d } = qe(a), { setCard: p } = re(), { data: u } = _s(a);
|
|
2637
2645
|
if (!a.id) return null;
|
|
2638
2646
|
let y;
|
|
2639
2647
|
d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (y = ba({
|
|
@@ -2651,7 +2659,7 @@ function Ra({
|
|
|
2651
2659
|
At,
|
|
2652
2660
|
{
|
|
2653
2661
|
role: "editor-visual-card",
|
|
2654
|
-
className:
|
|
2662
|
+
className: Q("relative flex h-full flex-col rounded-none", s),
|
|
2655
2663
|
...t,
|
|
2656
2664
|
children: [
|
|
2657
2665
|
n && /* @__PURE__ */ e.jsxs(Vt, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
@@ -2675,17 +2683,17 @@ function Ra({
|
|
|
2675
2683
|
a.description
|
|
2676
2684
|
)
|
|
2677
2685
|
] }),
|
|
2678
|
-
|
|
2686
|
+
o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2679
2687
|
/* @__PURE__ */ e.jsx(
|
|
2680
2688
|
ls,
|
|
2681
2689
|
{
|
|
2682
2690
|
className: "my-1",
|
|
2683
|
-
text:
|
|
2684
|
-
onSave: (b) => r({ ...
|
|
2685
|
-
children: /* @__PURE__ */ e.jsx(R, { children:
|
|
2691
|
+
text: o.title || o.column,
|
|
2692
|
+
onSave: (b) => r({ ...o, title: b }),
|
|
2693
|
+
children: /* @__PURE__ */ e.jsx(R, { children: o.title })
|
|
2686
2694
|
}
|
|
2687
2695
|
),
|
|
2688
|
-
/* @__PURE__ */ e.jsx(_t, { filter:
|
|
2696
|
+
/* @__PURE__ */ e.jsx(_t, { filter: o })
|
|
2689
2697
|
] })
|
|
2690
2698
|
] }),
|
|
2691
2699
|
/* @__PURE__ */ e.jsxs(Ht, { className: "flex grow flex-col", children: [
|
|
@@ -2706,7 +2714,7 @@ function Ra({
|
|
|
2706
2714
|
);
|
|
2707
2715
|
}
|
|
2708
2716
|
function Nl() {
|
|
2709
|
-
const [s, t] = q(!1), [a, n] = q(""), [l,
|
|
2717
|
+
const [s, t] = q(!1), [a, n] = q(""), [l, c] = q(""), [r, o] = q(""), [d, p] = q(""), u = m((N) => N.card), y = m(
|
|
2710
2718
|
(N) => N.card.customCfg
|
|
2711
2719
|
), { data: g } = qe(u), { data: x } = _s(u), { setCardCustomCfg: j, setCustomVisualCode: b } = re();
|
|
2712
2720
|
function I(N) {
|
|
@@ -2733,19 +2741,19 @@ function Nl() {
|
|
|
2733
2741
|
preferences: u.preferences,
|
|
2734
2742
|
topoJson: x
|
|
2735
2743
|
});
|
|
2736
|
-
N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode &&
|
|
2744
|
+
N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && o((L = u == null ? void 0 : u.preferences) == null ? void 0 : L.customVisualCode), y && c(JSON.stringify(y, null, 1)));
|
|
2737
2745
|
}
|
|
2738
2746
|
function T() {
|
|
2739
2747
|
if (r && b(r), !!l)
|
|
2740
2748
|
try {
|
|
2741
2749
|
const N = JSON.parse(l);
|
|
2742
|
-
return N ? (j(N), p(""),
|
|
2750
|
+
return N ? (j(N), p(""), c(""), N) : void 0;
|
|
2743
2751
|
} catch (N) {
|
|
2744
2752
|
console.log(N), p("Invalid JSON");
|
|
2745
2753
|
}
|
|
2746
2754
|
}
|
|
2747
2755
|
function F() {
|
|
2748
|
-
|
|
2756
|
+
c(""), j(null);
|
|
2749
2757
|
}
|
|
2750
2758
|
function A() {
|
|
2751
2759
|
let N;
|
|
@@ -2757,7 +2765,7 @@ function Nl() {
|
|
|
2757
2765
|
}
|
|
2758
2766
|
return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
|
|
2759
2767
|
/* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2760
|
-
|
|
2768
|
+
O,
|
|
2761
2769
|
{
|
|
2762
2770
|
onClick: C,
|
|
2763
2771
|
className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
|
|
@@ -2836,7 +2844,7 @@ function Nl() {
|
|
|
2836
2844
|
},
|
|
2837
2845
|
defaultLanguage: "json",
|
|
2838
2846
|
value: A(),
|
|
2839
|
-
onChange: (N) =>
|
|
2847
|
+
onChange: (N) => c(N)
|
|
2840
2848
|
}
|
|
2841
2849
|
)
|
|
2842
2850
|
}
|
|
@@ -2865,7 +2873,7 @@ function Nl() {
|
|
|
2865
2873
|
},
|
|
2866
2874
|
defaultLanguage: "javascript",
|
|
2867
2875
|
value: r,
|
|
2868
|
-
onChange: (N) =>
|
|
2876
|
+
onChange: (N) => o(N || "")
|
|
2869
2877
|
}
|
|
2870
2878
|
)
|
|
2871
2879
|
}
|
|
@@ -2875,7 +2883,7 @@ function Nl() {
|
|
|
2875
2883
|
/* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
|
|
2876
2884
|
/* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: d }),
|
|
2877
2885
|
/* @__PURE__ */ e.jsx(
|
|
2878
|
-
|
|
2886
|
+
O,
|
|
2879
2887
|
{
|
|
2880
2888
|
disabled: !y,
|
|
2881
2889
|
onClick: F,
|
|
@@ -2883,8 +2891,8 @@ function Nl() {
|
|
|
2883
2891
|
children: "Reset"
|
|
2884
2892
|
}
|
|
2885
2893
|
),
|
|
2886
|
-
/* @__PURE__ */ e.jsx(
|
|
2887
|
-
/* @__PURE__ */ e.jsx(
|
|
2894
|
+
/* @__PURE__ */ e.jsx(O, { onClick: T, variant: "outline", children: "Apply" }),
|
|
2895
|
+
/* @__PURE__ */ e.jsx(O, { onClick: () => t(!1), variant: "outline", children: "Close" })
|
|
2888
2896
|
] })
|
|
2889
2897
|
]
|
|
2890
2898
|
}
|
|
@@ -2919,8 +2927,8 @@ function Ja(s) {
|
|
|
2919
2927
|
const [t, a] = q(null);
|
|
2920
2928
|
return Z(() => {
|
|
2921
2929
|
s && (async () => {
|
|
2922
|
-
const
|
|
2923
|
-
a(
|
|
2930
|
+
const c = (await import("./lucide-react-DyubCpoB.js"))[s];
|
|
2931
|
+
a(c);
|
|
2924
2932
|
})();
|
|
2925
2933
|
}, [s]), t;
|
|
2926
2934
|
}
|
|
@@ -2938,28 +2946,28 @@ function Sl({
|
|
|
2938
2946
|
const [t, a] = q([]), { data: n } = Ka();
|
|
2939
2947
|
return Z(() => {
|
|
2940
2948
|
(async () => {
|
|
2941
|
-
var
|
|
2949
|
+
var c;
|
|
2942
2950
|
if (n) {
|
|
2943
|
-
const
|
|
2944
|
-
(
|
|
2951
|
+
const o = (await Promise.all(
|
|
2952
|
+
(c = n == null ? void 0 : n.plugins) == null ? void 0 : c.map(async (d) => (await Qt(d.value)).visuals.map((y) => ({
|
|
2945
2953
|
name: y.name,
|
|
2946
2954
|
icon: y.icon,
|
|
2947
2955
|
url: d.value
|
|
2948
2956
|
})))
|
|
2949
2957
|
)).flat();
|
|
2950
|
-
a(
|
|
2958
|
+
a(o);
|
|
2951
2959
|
}
|
|
2952
2960
|
})();
|
|
2953
2961
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2954
2962
|
/* @__PURE__ */ e.jsx(ge, { className: "my-2" }),
|
|
2955
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l,
|
|
2963
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, c) => /* @__PURE__ */ e.jsx(
|
|
2956
2964
|
wl,
|
|
2957
2965
|
{
|
|
2958
2966
|
text: l.name,
|
|
2959
2967
|
onClick: () => s("custom", l),
|
|
2960
2968
|
icon: l.icon
|
|
2961
2969
|
},
|
|
2962
|
-
l.url + l.name +
|
|
2970
|
+
l.url + l.name + c
|
|
2963
2971
|
)) })
|
|
2964
2972
|
] });
|
|
2965
2973
|
}
|
|
@@ -2969,13 +2977,13 @@ const wl = ({
|
|
|
2969
2977
|
onClick: a
|
|
2970
2978
|
}) => {
|
|
2971
2979
|
const n = Ja(t || ""), l = s.charAt(0).toUpperCase();
|
|
2972
|
-
return /* @__PURE__ */ e.jsx(
|
|
2980
|
+
return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
|
|
2973
2981
|
};
|
|
2974
2982
|
function kl() {
|
|
2975
2983
|
var u, y;
|
|
2976
|
-
const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences:
|
|
2984
|
+
const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: c, setChartOrientation: r } = m((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = re();
|
|
2977
2985
|
function p(g, x) {
|
|
2978
|
-
|
|
2986
|
+
o(null), c({}), l(g), x && d({
|
|
2979
2987
|
type: "component",
|
|
2980
2988
|
visualType: "single",
|
|
2981
2989
|
url: x.url,
|
|
@@ -2984,8 +2992,8 @@ function kl() {
|
|
|
2984
2992
|
}), t(!1);
|
|
2985
2993
|
}
|
|
2986
2994
|
return /* @__PURE__ */ e.jsxs(ms, { open: s, onOpenChange: t, children: [
|
|
2987
|
-
/* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2988
|
-
|
|
2995
|
+
/* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
2996
|
+
zl,
|
|
2989
2997
|
{
|
|
2990
2998
|
className: "h-4 w-4",
|
|
2991
2999
|
chartType: n,
|
|
@@ -2996,7 +3004,7 @@ function kl() {
|
|
|
2996
3004
|
/* @__PURE__ */ e.jsxs(xs, { className: "w-50", children: [
|
|
2997
3005
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
2998
3006
|
/* @__PURE__ */ e.jsx(
|
|
2999
|
-
|
|
3007
|
+
O,
|
|
3000
3008
|
{
|
|
3001
3009
|
onClick: () => p("bar"),
|
|
3002
3010
|
className: "font-normal",
|
|
@@ -3005,7 +3013,7 @@ function kl() {
|
|
|
3005
3013
|
}
|
|
3006
3014
|
),
|
|
3007
3015
|
/* @__PURE__ */ e.jsx(
|
|
3008
|
-
|
|
3016
|
+
O,
|
|
3009
3017
|
{
|
|
3010
3018
|
onClick: () => p("line"),
|
|
3011
3019
|
variant: "ghost",
|
|
@@ -3013,7 +3021,7 @@ function kl() {
|
|
|
3013
3021
|
}
|
|
3014
3022
|
),
|
|
3015
3023
|
/* @__PURE__ */ e.jsx(
|
|
3016
|
-
|
|
3024
|
+
O,
|
|
3017
3025
|
{
|
|
3018
3026
|
onClick: () => p("stackedBar"),
|
|
3019
3027
|
variant: "ghost",
|
|
@@ -3021,7 +3029,7 @@ function kl() {
|
|
|
3021
3029
|
}
|
|
3022
3030
|
),
|
|
3023
3031
|
/* @__PURE__ */ e.jsx(
|
|
3024
|
-
|
|
3032
|
+
O,
|
|
3025
3033
|
{
|
|
3026
3034
|
onClick: () => p("stackedLine"),
|
|
3027
3035
|
variant: "ghost",
|
|
@@ -3029,7 +3037,7 @@ function kl() {
|
|
|
3029
3037
|
}
|
|
3030
3038
|
),
|
|
3031
3039
|
/* @__PURE__ */ e.jsx(
|
|
3032
|
-
|
|
3040
|
+
O,
|
|
3033
3041
|
{
|
|
3034
3042
|
onClick: () => p("scatter"),
|
|
3035
3043
|
variant: "ghost",
|
|
@@ -3037,7 +3045,7 @@ function kl() {
|
|
|
3037
3045
|
}
|
|
3038
3046
|
),
|
|
3039
3047
|
/* @__PURE__ */ e.jsx(
|
|
3040
|
-
|
|
3048
|
+
O,
|
|
3041
3049
|
{
|
|
3042
3050
|
onClick: () => p("bubble"),
|
|
3043
3051
|
variant: "ghost",
|
|
@@ -3045,15 +3053,15 @@ function kl() {
|
|
|
3045
3053
|
}
|
|
3046
3054
|
),
|
|
3047
3055
|
/* @__PURE__ */ e.jsx(
|
|
3048
|
-
|
|
3056
|
+
O,
|
|
3049
3057
|
{
|
|
3050
3058
|
onClick: () => p("pie"),
|
|
3051
3059
|
variant: "ghost",
|
|
3052
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3060
|
+
children: /* @__PURE__ */ e.jsx(Oa, { className: "size-5" })
|
|
3053
3061
|
}
|
|
3054
3062
|
),
|
|
3055
3063
|
/* @__PURE__ */ e.jsx(
|
|
3056
|
-
|
|
3064
|
+
O,
|
|
3057
3065
|
{
|
|
3058
3066
|
onClick: () => p("doughnut"),
|
|
3059
3067
|
variant: "ghost",
|
|
@@ -3061,7 +3069,7 @@ function kl() {
|
|
|
3061
3069
|
}
|
|
3062
3070
|
),
|
|
3063
3071
|
/* @__PURE__ */ e.jsx(
|
|
3064
|
-
|
|
3072
|
+
O,
|
|
3065
3073
|
{
|
|
3066
3074
|
onClick: () => p("radar"),
|
|
3067
3075
|
variant: "ghost",
|
|
@@ -3075,7 +3083,7 @@ function kl() {
|
|
|
3075
3083
|
}
|
|
3076
3084
|
),
|
|
3077
3085
|
/* @__PURE__ */ e.jsx(
|
|
3078
|
-
|
|
3086
|
+
O,
|
|
3079
3087
|
{
|
|
3080
3088
|
onClick: () => p("polarArea"),
|
|
3081
3089
|
variant: "ghost",
|
|
@@ -3083,7 +3091,7 @@ function kl() {
|
|
|
3083
3091
|
}
|
|
3084
3092
|
),
|
|
3085
3093
|
/* @__PURE__ */ e.jsx(
|
|
3086
|
-
|
|
3094
|
+
O,
|
|
3087
3095
|
{
|
|
3088
3096
|
onClick: () => p("pyramid"),
|
|
3089
3097
|
variant: "ghost",
|
|
@@ -3091,15 +3099,15 @@ function kl() {
|
|
|
3091
3099
|
}
|
|
3092
3100
|
),
|
|
3093
3101
|
/* @__PURE__ */ e.jsx(
|
|
3094
|
-
|
|
3102
|
+
O,
|
|
3095
3103
|
{
|
|
3096
3104
|
onClick: () => p("range"),
|
|
3097
3105
|
variant: "ghost",
|
|
3098
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3106
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "size-5" })
|
|
3099
3107
|
}
|
|
3100
3108
|
),
|
|
3101
3109
|
/* @__PURE__ */ e.jsx(
|
|
3102
|
-
|
|
3110
|
+
O,
|
|
3103
3111
|
{
|
|
3104
3112
|
onClick: () => p("table"),
|
|
3105
3113
|
variant: "ghost",
|
|
@@ -3107,7 +3115,7 @@ function kl() {
|
|
|
3107
3115
|
}
|
|
3108
3116
|
),
|
|
3109
3117
|
/* @__PURE__ */ e.jsx(
|
|
3110
|
-
|
|
3118
|
+
O,
|
|
3111
3119
|
{
|
|
3112
3120
|
onClick: () => p("kpi"),
|
|
3113
3121
|
variant: "ghost",
|
|
@@ -3115,7 +3123,7 @@ function kl() {
|
|
|
3115
3123
|
}
|
|
3116
3124
|
),
|
|
3117
3125
|
/* @__PURE__ */ e.jsx(
|
|
3118
|
-
|
|
3126
|
+
O,
|
|
3119
3127
|
{
|
|
3120
3128
|
onClick: () => p("text"),
|
|
3121
3129
|
variant: "ghost",
|
|
@@ -3123,7 +3131,7 @@ function kl() {
|
|
|
3123
3131
|
}
|
|
3124
3132
|
),
|
|
3125
3133
|
/* @__PURE__ */ e.jsx(
|
|
3126
|
-
|
|
3134
|
+
O,
|
|
3127
3135
|
{
|
|
3128
3136
|
onClick: () => p("map"),
|
|
3129
3137
|
variant: "ghost",
|
|
@@ -3131,7 +3139,7 @@ function kl() {
|
|
|
3131
3139
|
}
|
|
3132
3140
|
),
|
|
3133
3141
|
/* @__PURE__ */ e.jsx(
|
|
3134
|
-
|
|
3142
|
+
O,
|
|
3135
3143
|
{
|
|
3136
3144
|
onClick: () => p("custom"),
|
|
3137
3145
|
variant: "ghost",
|
|
@@ -3143,7 +3151,7 @@ function kl() {
|
|
|
3143
3151
|
] })
|
|
3144
3152
|
] });
|
|
3145
3153
|
}
|
|
3146
|
-
function
|
|
3154
|
+
function zl({
|
|
3147
3155
|
chartType: s,
|
|
3148
3156
|
className: t,
|
|
3149
3157
|
customIcon: a,
|
|
@@ -3156,7 +3164,7 @@ function Ol({
|
|
|
3156
3164
|
case "line":
|
|
3157
3165
|
return /* @__PURE__ */ e.jsx(Bs, { className: t });
|
|
3158
3166
|
case "pie":
|
|
3159
|
-
return /* @__PURE__ */ e.jsx(
|
|
3167
|
+
return /* @__PURE__ */ e.jsx(Oa, { className: t });
|
|
3160
3168
|
case "radar":
|
|
3161
3169
|
return /* @__PURE__ */ e.jsx(_a, { className: t });
|
|
3162
3170
|
case "scatter":
|
|
@@ -3174,7 +3182,7 @@ function Ol({
|
|
|
3174
3182
|
case "pyramid":
|
|
3175
3183
|
return /* @__PURE__ */ e.jsx(Qa, { className: t });
|
|
3176
3184
|
case "range":
|
|
3177
|
-
return /* @__PURE__ */ e.jsx(
|
|
3185
|
+
return /* @__PURE__ */ e.jsx(za, { className: t });
|
|
3178
3186
|
case "kpi":
|
|
3179
3187
|
return /* @__PURE__ */ e.jsx(Ga, { className: t });
|
|
3180
3188
|
case "text":
|
|
@@ -3187,7 +3195,7 @@ function Ol({
|
|
|
3187
3195
|
return /* @__PURE__ */ e.jsx(As, { className: t });
|
|
3188
3196
|
}
|
|
3189
3197
|
}
|
|
3190
|
-
function
|
|
3198
|
+
function Ol() {
|
|
3191
3199
|
var t;
|
|
3192
3200
|
const s = m((a) => a.card);
|
|
3193
3201
|
return (t = s.customCardPreferences) == null || t.showCardHeader, re(), /* @__PURE__ */ e.jsxs(ra, { children: [
|
|
@@ -3208,9 +3216,9 @@ function zl() {
|
|
|
3208
3216
|
] });
|
|
3209
3217
|
}
|
|
3210
3218
|
function ta() {
|
|
3211
|
-
const s = m((h) => h.frame), t = m((h) => h.card), a = m((h) => h.isShowingVisual), n = m((h) => h.isSqlRunning), l = m((h) => h.queryError),
|
|
3219
|
+
const s = m((h) => h.frame), t = m((h) => h.card), a = m((h) => h.isShowingVisual), n = m((h) => h.isSqlRunning), l = m((h) => h.queryError), c = m((h) => h.pythonStdOut), r = m((h) => h.actions.setRunSql);
|
|
3212
3220
|
m((h) => h.onSave), m((h) => h.onClose), m((h) => h.actions.setCardSql), m((h) => h.actions.setCardType), m((h) => h.actions.setSqlGen);
|
|
3213
|
-
const { setFrame:
|
|
3221
|
+
const { setFrame: o, setCard: d, updateCardInFrame: p } = re(), { data: u, isLoading: y, isFetching: g } = qe(t);
|
|
3214
3222
|
if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3215
3223
|
function x() {
|
|
3216
3224
|
const h = {
|
|
@@ -3238,7 +3246,7 @@ function ta() {
|
|
|
3238
3246
|
cards: [...s.cards, h],
|
|
3239
3247
|
activeCardId: h.id
|
|
3240
3248
|
};
|
|
3241
|
-
|
|
3249
|
+
o(v), d(h);
|
|
3242
3250
|
}
|
|
3243
3251
|
function b() {
|
|
3244
3252
|
const h = {
|
|
@@ -3256,7 +3264,7 @@ function ta() {
|
|
|
3256
3264
|
// update the active card to the first card in the frame
|
|
3257
3265
|
activeCardId: f.id
|
|
3258
3266
|
};
|
|
3259
|
-
|
|
3267
|
+
o(k), d(f);
|
|
3260
3268
|
}
|
|
3261
3269
|
function C(h) {
|
|
3262
3270
|
const v = {
|
|
@@ -3264,7 +3272,7 @@ function ta() {
|
|
|
3264
3272
|
cards: s.cards.map((k) => k.id === t.id ? t : k),
|
|
3265
3273
|
activeCardId: h
|
|
3266
3274
|
};
|
|
3267
|
-
|
|
3275
|
+
o(v);
|
|
3268
3276
|
const f = v.cards.find((k) => k.id === h);
|
|
3269
3277
|
f.sql && r(!0), d(f);
|
|
3270
3278
|
}
|
|
@@ -3276,7 +3284,7 @@ function ta() {
|
|
|
3276
3284
|
const f = h.dataTransfer.getData("tabIndex");
|
|
3277
3285
|
if (f === v.toString()) return;
|
|
3278
3286
|
const k = Array.from(s.cards), [M] = k.splice(parseInt(f), 1);
|
|
3279
|
-
k.splice(v, 0, M),
|
|
3287
|
+
k.splice(v, 0, M), o({ ...s, cards: k });
|
|
3280
3288
|
};
|
|
3281
3289
|
function N(h, v) {
|
|
3282
3290
|
return h.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || h.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
|
|
@@ -3336,7 +3344,7 @@ function ta() {
|
|
|
3336
3344
|
h.id
|
|
3337
3345
|
)),
|
|
3338
3346
|
/* @__PURE__ */ e.jsx(
|
|
3339
|
-
|
|
3347
|
+
O,
|
|
3340
3348
|
{
|
|
3341
3349
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3342
3350
|
variant: "outline",
|
|
@@ -3345,12 +3353,12 @@ function ta() {
|
|
|
3345
3353
|
}
|
|
3346
3354
|
),
|
|
3347
3355
|
/* @__PURE__ */ e.jsx(
|
|
3348
|
-
|
|
3356
|
+
O,
|
|
3349
3357
|
{
|
|
3350
3358
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3351
3359
|
variant: "outline",
|
|
3352
3360
|
onClick: b,
|
|
3353
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3361
|
+
children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
|
|
3354
3362
|
}
|
|
3355
3363
|
)
|
|
3356
3364
|
] }) })
|
|
@@ -3374,12 +3382,12 @@ function ta() {
|
|
|
3374
3382
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3375
3383
|
/* @__PURE__ */ e.jsx(kl, {}),
|
|
3376
3384
|
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Nl, {}),
|
|
3377
|
-
/* @__PURE__ */ e.jsx(
|
|
3385
|
+
/* @__PURE__ */ e.jsx(Ol, {})
|
|
3378
3386
|
] }),
|
|
3379
3387
|
/* @__PURE__ */ e.jsx(Il, {})
|
|
3380
3388
|
] }),
|
|
3381
3389
|
a ? S() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
3382
|
-
|
|
3390
|
+
c && /* @__PURE__ */ e.jsx(Fl, {}),
|
|
3383
3391
|
(u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(vl, { data: (u == null ? void 0 : u.records) || [] }),
|
|
3384
3392
|
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
|
|
3385
3393
|
] })
|
|
@@ -3448,13 +3456,13 @@ function ue({
|
|
|
3448
3456
|
/* @__PURE__ */ e.jsx(
|
|
3449
3457
|
he,
|
|
3450
3458
|
{
|
|
3451
|
-
className:
|
|
3459
|
+
className: Q("w-full focus:ring-0 focus:ring-offset-0", l),
|
|
3452
3460
|
children: /* @__PURE__ */ e.jsx(xe, { placeholder: s })
|
|
3453
3461
|
}
|
|
3454
3462
|
),
|
|
3455
3463
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3456
3464
|
/* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
3457
|
-
t.map((
|
|
3465
|
+
t.map((c) => /* @__PURE__ */ e.jsx(K, { value: c.value, children: c.label }, c.value))
|
|
3458
3466
|
] }) })
|
|
3459
3467
|
] });
|
|
3460
3468
|
}
|
|
@@ -3468,7 +3476,7 @@ function Ge({
|
|
|
3468
3476
|
"details",
|
|
3469
3477
|
{
|
|
3470
3478
|
open: a,
|
|
3471
|
-
className:
|
|
3479
|
+
className: Q("space-y-4 [&_summary>svg]:open:-rotate-180", n),
|
|
3472
3480
|
children: [
|
|
3473
3481
|
/* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3474
3482
|
/* @__PURE__ */ e.jsx(R, { children: t }),
|
|
@@ -3483,7 +3491,7 @@ function Tl() {
|
|
|
3483
3491
|
var b, I;
|
|
3484
3492
|
const s = m(
|
|
3485
3493
|
(C) => C.card.customCardPreferences
|
|
3486
|
-
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((C) => C.card), l = m((C) => C.frame),
|
|
3494
|
+
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((C) => C.card), l = m((C) => C.frame), c = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = re(), { components: o, manifest: d } = ja(
|
|
3487
3495
|
(s == null ? void 0 : s.url) || ""
|
|
3488
3496
|
), p = (b = d == null ? void 0 : d.visuals) == null ? void 0 : b.find(
|
|
3489
3497
|
(C) => C.name === (s == null ? void 0 : s.componentName)
|
|
@@ -3616,19 +3624,19 @@ function Tl() {
|
|
|
3616
3624
|
{ value: "single", label: "Single Visual" },
|
|
3617
3625
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3618
3626
|
],
|
|
3619
|
-
value:
|
|
3627
|
+
value: c,
|
|
3620
3628
|
onValueChange: j
|
|
3621
3629
|
}
|
|
3622
3630
|
),
|
|
3623
3631
|
((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: [
|
|
3624
3632
|
/* @__PURE__ */ e.jsx(R, { children: "Component" }),
|
|
3625
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children:
|
|
3633
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: o && /* @__PURE__ */ e.jsx(
|
|
3626
3634
|
ue,
|
|
3627
3635
|
{
|
|
3628
3636
|
className: "h-8 w-full",
|
|
3629
3637
|
label: "",
|
|
3630
|
-
options: (
|
|
3631
|
-
(C) => C.type ===
|
|
3638
|
+
options: (o == null ? void 0 : o.filter(
|
|
3639
|
+
(C) => C.type === c
|
|
3632
3640
|
).map((C) => ({
|
|
3633
3641
|
value: C.name,
|
|
3634
3642
|
label: C.name
|
|
@@ -3661,7 +3669,7 @@ function Te() {
|
|
|
3661
3669
|
m(
|
|
3662
3670
|
(u) => u.card.cfg
|
|
3663
3671
|
);
|
|
3664
|
-
const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences:
|
|
3672
|
+
const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: c } = m((u) => u.actions), r = m(
|
|
3665
3673
|
(u) => u.queryResultColumns
|
|
3666
3674
|
);
|
|
3667
3675
|
m(
|
|
@@ -3672,9 +3680,9 @@ function Te() {
|
|
|
3672
3680
|
), Z(() => {
|
|
3673
3681
|
r && t(new Array(r.length).fill(!1));
|
|
3674
3682
|
}, [r]);
|
|
3675
|
-
function
|
|
3683
|
+
function o(u, y) {
|
|
3676
3684
|
var g, x;
|
|
3677
|
-
y ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ?
|
|
3685
|
+
y ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? c({
|
|
3678
3686
|
...a,
|
|
3679
3687
|
onClickFilter: [
|
|
3680
3688
|
...a.onClickFilter,
|
|
@@ -3683,7 +3691,7 @@ function Te() {
|
|
|
3683
3691
|
expression: ""
|
|
3684
3692
|
}
|
|
3685
3693
|
]
|
|
3686
|
-
}) :
|
|
3694
|
+
}) : c({
|
|
3687
3695
|
...a,
|
|
3688
3696
|
onClickFilter: [
|
|
3689
3697
|
{
|
|
@@ -3691,7 +3699,7 @@ function Te() {
|
|
|
3691
3699
|
expression: ""
|
|
3692
3700
|
}
|
|
3693
3701
|
]
|
|
3694
|
-
}) : (
|
|
3702
|
+
}) : (c({
|
|
3695
3703
|
...a,
|
|
3696
3704
|
onClickFilter: (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.filter(
|
|
3697
3705
|
(j) => j.columnIndex !== u
|
|
@@ -3707,7 +3715,7 @@ function Te() {
|
|
|
3707
3715
|
...j,
|
|
3708
3716
|
expression: y.target.value
|
|
3709
3717
|
} : j);
|
|
3710
|
-
|
|
3718
|
+
c({
|
|
3711
3719
|
...a,
|
|
3712
3720
|
onClickFilter: g
|
|
3713
3721
|
});
|
|
@@ -3742,7 +3750,7 @@ function Te() {
|
|
|
3742
3750
|
checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
|
|
3743
3751
|
(j) => j.columnIndex === y
|
|
3744
3752
|
)),
|
|
3745
|
-
onCheckedChange: (j) =>
|
|
3753
|
+
onCheckedChange: (j) => o(y, j)
|
|
3746
3754
|
}
|
|
3747
3755
|
),
|
|
3748
3756
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3776,19 +3784,19 @@ function Te() {
|
|
|
3776
3784
|
] });
|
|
3777
3785
|
}
|
|
3778
3786
|
function fs() {
|
|
3779
|
-
var r,
|
|
3787
|
+
var r, o, d;
|
|
3780
3788
|
const s = m((p) => p.card.preferences), t = m(
|
|
3781
3789
|
(p) => p.card.cfg
|
|
3782
3790
|
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = m((p) => p.actions);
|
|
3783
3791
|
(r = t == null ? void 0 : t.options) != null && r.indexAxis;
|
|
3784
|
-
function
|
|
3792
|
+
function c(p) {
|
|
3785
3793
|
l(p);
|
|
3786
3794
|
}
|
|
3787
3795
|
return /* @__PURE__ */ e.jsxs(
|
|
3788
3796
|
ps,
|
|
3789
3797
|
{
|
|
3790
|
-
value: ((
|
|
3791
|
-
onValueChange:
|
|
3798
|
+
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = t == null ? void 0 : t.options) == null ? void 0 : d.indexAxis) || "x",
|
|
3799
|
+
onValueChange: c,
|
|
3792
3800
|
className: "flex gap-3",
|
|
3793
3801
|
defaultValue: "x",
|
|
3794
3802
|
children: [
|
|
@@ -3806,37 +3814,37 @@ function fs() {
|
|
|
3806
3814
|
}
|
|
3807
3815
|
const ts = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3808
3816
|
function na(s, t) {
|
|
3809
|
-
var n, l,
|
|
3817
|
+
var n, l, c;
|
|
3810
3818
|
const a = wa(s, t);
|
|
3811
|
-
return ((
|
|
3819
|
+
return ((c = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : c.type) || "linear";
|
|
3812
3820
|
}
|
|
3813
3821
|
function Wa() {
|
|
3814
|
-
var ie,
|
|
3822
|
+
var ie, W, ae, w, _, ee;
|
|
3815
3823
|
const [s, t] = q(!1), a = m((E) => {
|
|
3816
3824
|
var D;
|
|
3817
3825
|
return (D = E.card) == null ? void 0 : D.preferences;
|
|
3818
3826
|
}), n = m((E) => {
|
|
3819
3827
|
var D;
|
|
3820
3828
|
return (D = E.card) == null ? void 0 : D.cfg;
|
|
3821
|
-
}), l = wa(a, n), [
|
|
3829
|
+
}), l = wa(a, n), [c, r] = q(
|
|
3822
3830
|
na(a)
|
|
3823
|
-
), [
|
|
3824
|
-
((ae = (
|
|
3831
|
+
), [o, d] = q(
|
|
3832
|
+
((ae = (W = (ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : W[l]) == null ? void 0 : ae.min) || ""
|
|
3825
3833
|
), [p, u] = q(
|
|
3826
3834
|
((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
|
|
3827
|
-
), [y, g] = q(
|
|
3835
|
+
), [y, g] = q(o || p ? "custom" : "auto"), [x, j] = q(""), [b, I] = q(0), [C, T] = q(""), [F, A] = q(""), [N, S] = q(""), L = m(
|
|
3828
3836
|
(E) => E.actions.setCardPreferences
|
|
3829
3837
|
), { updateCardInFrame: h } = re(), v = m((E) => E.card), f = m((E) => {
|
|
3830
3838
|
var D;
|
|
3831
3839
|
return (D = E.card) == null ? void 0 : D.type;
|
|
3832
3840
|
}), k = ["pie", "doughnut", "polarArea"].includes(f);
|
|
3833
3841
|
Z(() => {
|
|
3834
|
-
var E, D, se, $, X, te, Le,
|
|
3842
|
+
var E, D, se, $, X, te, Le, ze, be, ye, J, oe, ce, Oe;
|
|
3835
3843
|
r(na(a)), d(
|
|
3836
3844
|
((se = (D = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : D[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
|
|
3837
3845
|
), u(((te = (X = ($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : X[l]) == null ? void 0 : te.max) || ""), j(
|
|
3838
|
-
((ye = (be = (
|
|
3839
|
-
), I(((
|
|
3846
|
+
((ye = (be = (ze = (Le = a == null ? void 0 : a.chartOptions) == null ? void 0 : Le.scales) == null ? void 0 : ze[l]) == null ? void 0 : be.ticks) == null ? void 0 : ye.stepSize) || ""
|
|
3847
|
+
), I(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), T(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.locale) || "");
|
|
3840
3848
|
}, [s, a, l]);
|
|
3841
3849
|
function M(E, D) {
|
|
3842
3850
|
return D === "" || /^[0-9\b]+$/.test(D) ? Number(D) : Number(E);
|
|
@@ -3871,8 +3879,8 @@ function Wa() {
|
|
|
3871
3879
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
3872
3880
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3873
3881
|
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
3874
|
-
/* @__PURE__ */ e.jsx(
|
|
3875
|
-
E.map((D) => /* @__PURE__ */ e.jsx(
|
|
3882
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }),
|
|
3883
|
+
E.map((D) => /* @__PURE__ */ e.jsx(K, { value: D, children: D }, D))
|
|
3876
3884
|
] }) })
|
|
3877
3885
|
]
|
|
3878
3886
|
}
|
|
@@ -3887,7 +3895,7 @@ function Wa() {
|
|
|
3887
3895
|
),
|
|
3888
3896
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3889
3897
|
/* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
|
|
3890
|
-
os.map((D) => /* @__PURE__ */ e.jsx(
|
|
3898
|
+
os.map((D) => /* @__PURE__ */ e.jsx(K, { value: D.locale, children: D.locale }, D.locale))
|
|
3891
3899
|
] }) })
|
|
3892
3900
|
] })
|
|
3893
3901
|
] }),
|
|
@@ -3913,7 +3921,7 @@ function Wa() {
|
|
|
3913
3921
|
le,
|
|
3914
3922
|
{
|
|
3915
3923
|
id: "min",
|
|
3916
|
-
value:
|
|
3924
|
+
value: o,
|
|
3917
3925
|
onChange: (E) => d((D) => M(D, E.target.value)),
|
|
3918
3926
|
className: `col-span-1 h-8 w-full ${ts}`
|
|
3919
3927
|
}
|
|
@@ -3946,7 +3954,7 @@ function Wa() {
|
|
|
3946
3954
|
var $;
|
|
3947
3955
|
let E = {};
|
|
3948
3956
|
y === "custom" && (E = {
|
|
3949
|
-
min:
|
|
3957
|
+
min: o,
|
|
3950
3958
|
max: p,
|
|
3951
3959
|
ticks: {
|
|
3952
3960
|
stepSize: x
|
|
@@ -3960,8 +3968,8 @@ function Wa() {
|
|
|
3960
3968
|
...($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales,
|
|
3961
3969
|
[l]: {
|
|
3962
3970
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3963
|
-
type:
|
|
3964
|
-
...
|
|
3971
|
+
type: c,
|
|
3972
|
+
...c === "linear" ? E : {}
|
|
3965
3973
|
}
|
|
3966
3974
|
}
|
|
3967
3975
|
},
|
|
@@ -3993,20 +4001,20 @@ function Wa() {
|
|
|
3993
4001
|
me,
|
|
3994
4002
|
{
|
|
3995
4003
|
disabled: k,
|
|
3996
|
-
value:
|
|
4004
|
+
value: c,
|
|
3997
4005
|
onValueChange: (E) => r(E),
|
|
3998
4006
|
children: [
|
|
3999
4007
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4000
4008
|
/* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4001
4009
|
/* @__PURE__ */ e.jsx(fe, { children: "Option" }),
|
|
4002
|
-
/* @__PURE__ */ e.jsx(
|
|
4003
|
-
/* @__PURE__ */ e.jsx(
|
|
4010
|
+
/* @__PURE__ */ e.jsx(K, { value: "linear", children: "Linear" }),
|
|
4011
|
+
/* @__PURE__ */ e.jsx(K, { value: "logarithmic", children: "Logarithmic" })
|
|
4004
4012
|
] }) })
|
|
4005
4013
|
]
|
|
4006
4014
|
}
|
|
4007
4015
|
)
|
|
4008
4016
|
] }),
|
|
4009
|
-
|
|
4017
|
+
c == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4010
4018
|
/* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
|
|
4011
4019
|
/* @__PURE__ */ e.jsxs(
|
|
4012
4020
|
ps,
|
|
@@ -4030,11 +4038,11 @@ function Wa() {
|
|
|
4030
4038
|
}
|
|
4031
4039
|
)
|
|
4032
4040
|
] }),
|
|
4033
|
-
y === "custom" &&
|
|
4041
|
+
y === "custom" && c == "linear" && P(),
|
|
4034
4042
|
H(),
|
|
4035
4043
|
/* @__PURE__ */ e.jsx(en, {}),
|
|
4036
4044
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
4037
|
-
|
|
4045
|
+
O,
|
|
4038
4046
|
{
|
|
4039
4047
|
onClick: Y,
|
|
4040
4048
|
variant: "secondary",
|
|
@@ -4047,7 +4055,7 @@ function Wa() {
|
|
|
4047
4055
|
] });
|
|
4048
4056
|
}
|
|
4049
4057
|
function Ll({ idx: s }) {
|
|
4050
|
-
var
|
|
4058
|
+
var o;
|
|
4051
4059
|
const t = m((d) => {
|
|
4052
4060
|
var p;
|
|
4053
4061
|
return (p = d.card) == null ? void 0 : p.preferences;
|
|
@@ -4058,7 +4066,7 @@ function Ll({ idx: s }) {
|
|
|
4058
4066
|
}
|
|
4059
4067
|
), n = m(
|
|
4060
4068
|
(d) => d.actions.setCardPreferences
|
|
4061
|
-
), l = (
|
|
4069
|
+
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, c = a == null ? void 0 : a.find((d) => d.idx === s);
|
|
4062
4070
|
function r(d, p) {
|
|
4063
4071
|
(d === "end" || d === "start") && sn(an());
|
|
4064
4072
|
const u = {
|
|
@@ -4067,7 +4075,7 @@ function Ll({ idx: s }) {
|
|
|
4067
4075
|
anchor: d,
|
|
4068
4076
|
clamp: !0
|
|
4069
4077
|
};
|
|
4070
|
-
if (!
|
|
4078
|
+
if (!c)
|
|
4071
4079
|
n({
|
|
4072
4080
|
...t,
|
|
4073
4081
|
datasetOptions: [
|
|
@@ -4079,7 +4087,7 @@ function Ll({ idx: s }) {
|
|
|
4079
4087
|
]
|
|
4080
4088
|
});
|
|
4081
4089
|
else {
|
|
4082
|
-
const y = { ...
|
|
4090
|
+
const y = { ...c };
|
|
4083
4091
|
y.datalabels = u;
|
|
4084
4092
|
const g = a == null ? void 0 : a.map(
|
|
4085
4093
|
(x) => x.idx === p ? y : x
|
|
@@ -4094,7 +4102,7 @@ function Ll({ idx: s }) {
|
|
|
4094
4102
|
/* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Jn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4095
4103
|
/* @__PURE__ */ e.jsx(xs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4096
4104
|
/* @__PURE__ */ e.jsx(
|
|
4097
|
-
|
|
4105
|
+
O,
|
|
4098
4106
|
{
|
|
4099
4107
|
onClick: () => r("none", s),
|
|
4100
4108
|
size: "sm",
|
|
@@ -4104,7 +4112,7 @@ function Ll({ idx: s }) {
|
|
|
4104
4112
|
}
|
|
4105
4113
|
),
|
|
4106
4114
|
/* @__PURE__ */ e.jsx(
|
|
4107
|
-
|
|
4115
|
+
O,
|
|
4108
4116
|
{
|
|
4109
4117
|
onClick: () => r("start", s),
|
|
4110
4118
|
size: "sm",
|
|
@@ -4113,7 +4121,7 @@ function Ll({ idx: s }) {
|
|
|
4113
4121
|
children: /* @__PURE__ */ e.jsx(
|
|
4114
4122
|
Vn,
|
|
4115
4123
|
{
|
|
4116
|
-
className:
|
|
4124
|
+
className: Q("h-4 w-4", {
|
|
4117
4125
|
"rotate-90": l === "y"
|
|
4118
4126
|
})
|
|
4119
4127
|
}
|
|
@@ -4121,7 +4129,7 @@ function Ll({ idx: s }) {
|
|
|
4121
4129
|
}
|
|
4122
4130
|
),
|
|
4123
4131
|
/* @__PURE__ */ e.jsx(
|
|
4124
|
-
|
|
4132
|
+
O,
|
|
4125
4133
|
{
|
|
4126
4134
|
onClick: () => r("center", s),
|
|
4127
4135
|
size: "sm",
|
|
@@ -4130,7 +4138,7 @@ function Ll({ idx: s }) {
|
|
|
4130
4138
|
children: /* @__PURE__ */ e.jsx(
|
|
4131
4139
|
Rn,
|
|
4132
4140
|
{
|
|
4133
|
-
className:
|
|
4141
|
+
className: Q("h-4 w-4", {
|
|
4134
4142
|
"rotate-90": l === "y"
|
|
4135
4143
|
})
|
|
4136
4144
|
}
|
|
@@ -4138,7 +4146,7 @@ function Ll({ idx: s }) {
|
|
|
4138
4146
|
}
|
|
4139
4147
|
),
|
|
4140
4148
|
/* @__PURE__ */ e.jsx(
|
|
4141
|
-
|
|
4149
|
+
O,
|
|
4142
4150
|
{
|
|
4143
4151
|
onClick: () => r("end", s),
|
|
4144
4152
|
size: "sm",
|
|
@@ -4147,7 +4155,7 @@ function Ll({ idx: s }) {
|
|
|
4147
4155
|
children: /* @__PURE__ */ e.jsx(
|
|
4148
4156
|
qn,
|
|
4149
4157
|
{
|
|
4150
|
-
className:
|
|
4158
|
+
className: Q("h-4 w-4", {
|
|
4151
4159
|
"rotate-90": l === "y"
|
|
4152
4160
|
})
|
|
4153
4161
|
}
|
|
@@ -4164,24 +4172,24 @@ function Ya() {
|
|
|
4164
4172
|
return (g = (y = (u = p == null ? void 0 : p.card) == null ? void 0 : u.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : g.indexAxis;
|
|
4165
4173
|
}
|
|
4166
4174
|
), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
|
|
4167
|
-
keys:
|
|
4175
|
+
keys: c,
|
|
4168
4176
|
metricKeys: r,
|
|
4169
|
-
dimensionKeys:
|
|
4177
|
+
dimensionKeys: o
|
|
4170
4178
|
} = vs((a == null ? void 0 : a.records) || []);
|
|
4171
4179
|
let d = r;
|
|
4172
4180
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4173
4181
|
const p = tn({
|
|
4174
4182
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4175
|
-
groupKey:
|
|
4176
|
-
pivotKey:
|
|
4183
|
+
groupKey: o[0],
|
|
4184
|
+
pivotKey: o[1],
|
|
4177
4185
|
valueKey: d[0]
|
|
4178
4186
|
}), { metricKeys: u } = vs(p);
|
|
4179
4187
|
d = u;
|
|
4180
4188
|
}
|
|
4181
|
-
return
|
|
4189
|
+
return c.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4182
4190
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4183
4191
|
/* @__PURE__ */ e.jsx(R, { children: n }),
|
|
4184
|
-
/* @__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:
|
|
4192
|
+
/* @__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] }) }) })
|
|
4185
4193
|
] }),
|
|
4186
4194
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4187
4195
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
@@ -4193,35 +4201,35 @@ function Ya() {
|
|
|
4193
4201
|
] });
|
|
4194
4202
|
}
|
|
4195
4203
|
function Ml({ col: s, idx: t }) {
|
|
4196
|
-
const a = m((
|
|
4204
|
+
const a = m((o) => {
|
|
4197
4205
|
var d;
|
|
4198
|
-
return (d =
|
|
4206
|
+
return (d = o.card) == null ? void 0 : d.preferences;
|
|
4199
4207
|
}), n = m(
|
|
4200
|
-
(
|
|
4208
|
+
(o) => {
|
|
4201
4209
|
var d;
|
|
4202
|
-
return (d =
|
|
4210
|
+
return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
|
|
4203
4211
|
}
|
|
4204
|
-
), l = n == null ? void 0 : n.find((
|
|
4205
|
-
function r(
|
|
4212
|
+
), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: c } = m((o) => o.actions);
|
|
4213
|
+
function r(o) {
|
|
4206
4214
|
if (!l)
|
|
4207
|
-
|
|
4215
|
+
c({
|
|
4208
4216
|
...a,
|
|
4209
4217
|
datasetOptions: [
|
|
4210
4218
|
...n || [],
|
|
4211
4219
|
{
|
|
4212
4220
|
idx: t,
|
|
4213
|
-
type:
|
|
4214
|
-
fill:
|
|
4221
|
+
type: o === "area" ? "line" : o,
|
|
4222
|
+
fill: o === "area" ? "origin" : ""
|
|
4215
4223
|
}
|
|
4216
4224
|
]
|
|
4217
4225
|
});
|
|
4218
4226
|
else {
|
|
4219
4227
|
const d = { ...l };
|
|
4220
|
-
d.type =
|
|
4228
|
+
d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
|
|
4221
4229
|
const p = n == null ? void 0 : n.map(
|
|
4222
4230
|
(u) => u.idx === t ? d : u
|
|
4223
4231
|
);
|
|
4224
|
-
|
|
4232
|
+
c({
|
|
4225
4233
|
...a,
|
|
4226
4234
|
datasetOptions: p
|
|
4227
4235
|
});
|
|
@@ -4256,7 +4264,7 @@ function Ml({ col: s, idx: t }) {
|
|
|
4256
4264
|
] });
|
|
4257
4265
|
}
|
|
4258
4266
|
function Xa() {
|
|
4259
|
-
const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName),
|
|
4267
|
+
const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName), c = z((g) => g.dashboard.filters) || [], r = z((g) => g.actions.addFilter), o = z((g) => g.actions.removeFilter), d = z(
|
|
4260
4268
|
(g) => g.actions.removeFilterValue
|
|
4261
4269
|
), { modelItems: p, tableName: u } = Re();
|
|
4262
4270
|
function y(g, x = "dashboard") {
|
|
@@ -4270,11 +4278,11 @@ function Xa() {
|
|
|
4270
4278
|
(L) => L.id === t
|
|
4271
4279
|
)) == null ? void 0 : S.name;
|
|
4272
4280
|
t && t !== "none" && (F = `${ys}.${A}.${j}`, T = `${ys}.${A}`);
|
|
4273
|
-
const N =
|
|
4281
|
+
const N = c == null ? void 0 : c.find(
|
|
4274
4282
|
(L) => L.column === F && L.table === C && (L.database === b || L.database === a)
|
|
4275
4283
|
);
|
|
4276
4284
|
if (N)
|
|
4277
|
-
d(N.id),
|
|
4285
|
+
d(N.id), o(N.id);
|
|
4278
4286
|
else {
|
|
4279
4287
|
const L = Je();
|
|
4280
4288
|
return u === "api" && s ? (r({
|
|
@@ -4319,17 +4327,17 @@ function Xa() {
|
|
|
4319
4327
|
return { assignFilter: y };
|
|
4320
4328
|
}
|
|
4321
4329
|
function _e() {
|
|
4322
|
-
const s =
|
|
4323
|
-
(
|
|
4324
|
-
), t = m((
|
|
4325
|
-
function o
|
|
4326
|
-
const d = l(
|
|
4330
|
+
const s = z(
|
|
4331
|
+
(o) => o.dashboard.filters
|
|
4332
|
+
), t = m((o) => o.frame), { setFrame: a } = re(), { columns: n } = Re(), { assignFilter: l } = Xa();
|
|
4333
|
+
function c(o) {
|
|
4334
|
+
const d = l(o, "frame");
|
|
4327
4335
|
a({ ...t, filterId: d });
|
|
4328
4336
|
}
|
|
4329
|
-
const r = s == null ? void 0 : s.find((
|
|
4337
|
+
const r = s == null ? void 0 : s.find((o) => o.id === t.filterId);
|
|
4330
4338
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4331
4339
|
/* @__PURE__ */ e.jsx(R, { children: "Card Filter" }),
|
|
4332
|
-
/* @__PURE__ */ e.jsx(El, { onSelect:
|
|
4340
|
+
/* @__PURE__ */ e.jsx(El, { onSelect: c, columns: n }),
|
|
4333
4341
|
r && /* @__PURE__ */ e.jsx(nn, { filter: r })
|
|
4334
4342
|
] });
|
|
4335
4343
|
}
|
|
@@ -4338,10 +4346,10 @@ function El({
|
|
|
4338
4346
|
onSelect: t
|
|
4339
4347
|
}) {
|
|
4340
4348
|
var r;
|
|
4341
|
-
const [a, n] = ea.useState(!1), [l,
|
|
4349
|
+
const [a, n] = ea.useState(!1), [l, c] = ea.useState("");
|
|
4342
4350
|
return /* @__PURE__ */ e.jsxs(ms, { open: a, onOpenChange: n, children: [
|
|
4343
4351
|
/* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4344
|
-
|
|
4352
|
+
O,
|
|
4345
4353
|
{
|
|
4346
4354
|
size: "sm",
|
|
4347
4355
|
variant: "outline",
|
|
@@ -4349,7 +4357,7 @@ function El({
|
|
|
4349
4357
|
"aria-expanded": a,
|
|
4350
4358
|
className: "w-full justify-between font-normal",
|
|
4351
4359
|
children: [
|
|
4352
|
-
l ? (r = s.find((
|
|
4360
|
+
l ? (r = s.find((o) => o.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
|
|
4353
4361
|
/* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4354
4362
|
]
|
|
4355
4363
|
}
|
|
@@ -4358,28 +4366,28 @@ function El({
|
|
|
4358
4366
|
/* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
|
|
4359
4367
|
/* @__PURE__ */ e.jsxs(cn, { children: [
|
|
4360
4368
|
/* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
|
|
4361
|
-
/* @__PURE__ */ e.jsx(un, { children: s.map((
|
|
4369
|
+
/* @__PURE__ */ e.jsx(un, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
4362
4370
|
mn,
|
|
4363
4371
|
{
|
|
4364
|
-
value:
|
|
4372
|
+
value: o.column_name,
|
|
4365
4373
|
onSelect: (d) => {
|
|
4366
4374
|
const p = d === l ? "" : d;
|
|
4367
|
-
|
|
4375
|
+
c(p), n(!1), p && t(o);
|
|
4368
4376
|
},
|
|
4369
4377
|
children: [
|
|
4370
|
-
|
|
4378
|
+
o.column_name,
|
|
4371
4379
|
/* @__PURE__ */ e.jsx(
|
|
4372
4380
|
Na,
|
|
4373
4381
|
{
|
|
4374
|
-
className:
|
|
4382
|
+
className: Q(
|
|
4375
4383
|
"ml-auto h-4 w-4",
|
|
4376
|
-
l ===
|
|
4384
|
+
l === o.column_name ? "opacity-100" : "opacity-0"
|
|
4377
4385
|
)
|
|
4378
4386
|
}
|
|
4379
4387
|
)
|
|
4380
4388
|
]
|
|
4381
4389
|
},
|
|
4382
|
-
|
|
4390
|
+
o.column_name
|
|
4383
4391
|
)) })
|
|
4384
4392
|
] })
|
|
4385
4393
|
] }) })
|
|
@@ -4431,17 +4439,17 @@ function Al({
|
|
|
4431
4439
|
] }) });
|
|
4432
4440
|
}
|
|
4433
4441
|
function Gs() {
|
|
4434
|
-
var l,
|
|
4442
|
+
var l, c, r;
|
|
4435
4443
|
const s = m(
|
|
4436
|
-
(
|
|
4437
|
-
), t = m((
|
|
4438
|
-
function n(
|
|
4444
|
+
(o) => o.card.cfg
|
|
4445
|
+
), t = m((o) => o.actions.setCardCfg), a = m((o) => o.card.type);
|
|
4446
|
+
function n(o) {
|
|
4439
4447
|
var u;
|
|
4440
4448
|
const d = {
|
|
4441
4449
|
datalabels: {
|
|
4442
|
-
display:
|
|
4443
|
-
align:
|
|
4444
|
-
anchor:
|
|
4450
|
+
display: o !== "none",
|
|
4451
|
+
align: o,
|
|
4452
|
+
anchor: o,
|
|
4445
4453
|
clamp: !0
|
|
4446
4454
|
}
|
|
4447
4455
|
}, p = {
|
|
@@ -4454,7 +4462,7 @@ function Gs() {
|
|
|
4454
4462
|
}
|
|
4455
4463
|
}
|
|
4456
4464
|
};
|
|
4457
|
-
t(p), console.log(
|
|
4465
|
+
t(p), console.log(o);
|
|
4458
4466
|
}
|
|
4459
4467
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4460
4468
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4464,17 +4472,17 @@ function Gs() {
|
|
|
4464
4472
|
/* @__PURE__ */ e.jsxs(
|
|
4465
4473
|
me,
|
|
4466
4474
|
{
|
|
4467
|
-
value: (r = (
|
|
4475
|
+
value: (r = (c = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : c.datalabels) == null ? void 0 : r.anchor,
|
|
4468
4476
|
onValueChange: n,
|
|
4469
4477
|
defaultValue: "none",
|
|
4470
4478
|
children: [
|
|
4471
4479
|
/* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, { placeholder: "Select position" }) }),
|
|
4472
4480
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4473
4481
|
/* @__PURE__ */ e.jsx(fe, { children: "Data Labels" }),
|
|
4474
|
-
/* @__PURE__ */ e.jsx(
|
|
4475
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
4476
|
-
/* @__PURE__ */ e.jsx(
|
|
4477
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
4482
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }),
|
|
4483
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(K, { value: "start", children: "Start" }),
|
|
4484
|
+
/* @__PURE__ */ e.jsx(K, { value: "center", children: "Center" }),
|
|
4485
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(K, { value: "end", children: "End" })
|
|
4478
4486
|
] }) })
|
|
4479
4487
|
]
|
|
4480
4488
|
}
|
|
@@ -4500,7 +4508,7 @@ function Vl({
|
|
|
4500
4508
|
"a",
|
|
4501
4509
|
{
|
|
4502
4510
|
target: "_blank",
|
|
4503
|
-
onClick: (
|
|
4511
|
+
onClick: (c) => c.stopPropagation(),
|
|
4504
4512
|
className: "text-blue-700",
|
|
4505
4513
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4506
4514
|
children: "example"
|
|
@@ -4695,14 +4703,14 @@ function $l() {
|
|
|
4695
4703
|
m(
|
|
4696
4704
|
(x) => x.actions.setFilterOnClickField
|
|
4697
4705
|
);
|
|
4698
|
-
const
|
|
4706
|
+
const c = m(
|
|
4699
4707
|
(x) => {
|
|
4700
4708
|
var j, b;
|
|
4701
4709
|
return (b = (j = x.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : b.colorRanges;
|
|
4702
4710
|
}
|
|
4703
4711
|
) || [], r = m(
|
|
4704
4712
|
(x) => x.actions.setColorRanges
|
|
4705
|
-
),
|
|
4713
|
+
), o = [...new Set(os.map((x) => x.currency))];
|
|
4706
4714
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4707
4715
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4708
4716
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4744,8 +4752,8 @@ function $l() {
|
|
|
4744
4752
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4745
4753
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4746
4754
|
/* @__PURE__ */ e.jsx(fe, { children: "Format" }),
|
|
4747
|
-
/* @__PURE__ */ e.jsx(
|
|
4748
|
-
os.map((x) => /* @__PURE__ */ e.jsx(
|
|
4755
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
4756
|
+
os.map((x) => /* @__PURE__ */ e.jsx(K, { value: x.locale, children: x.locale }, x.locale))
|
|
4749
4757
|
] }) })
|
|
4750
4758
|
]
|
|
4751
4759
|
}
|
|
@@ -4770,8 +4778,8 @@ function $l() {
|
|
|
4770
4778
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4771
4779
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4772
4780
|
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
4773
|
-
/* @__PURE__ */ e.jsx(
|
|
4774
|
-
|
|
4781
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
4782
|
+
o.map((x) => /* @__PURE__ */ e.jsx(K, { value: x, children: x }, x))
|
|
4775
4783
|
] }) })
|
|
4776
4784
|
]
|
|
4777
4785
|
}
|
|
@@ -4796,7 +4804,7 @@ function $l() {
|
|
|
4796
4804
|
},
|
|
4797
4805
|
children: [
|
|
4798
4806
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4799
|
-
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(
|
|
4807
|
+
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(K, { value: x, children: x }, x)) })
|
|
4800
4808
|
]
|
|
4801
4809
|
}
|
|
4802
4810
|
)
|
|
@@ -4827,7 +4835,7 @@ function $l() {
|
|
|
4827
4835
|
/* @__PURE__ */ e.jsx(
|
|
4828
4836
|
hn,
|
|
4829
4837
|
{
|
|
4830
|
-
colorRanges:
|
|
4838
|
+
colorRanges: c,
|
|
4831
4839
|
setColorRanges: r
|
|
4832
4840
|
}
|
|
4833
4841
|
)
|
|
@@ -4969,10 +4977,10 @@ function Ql() {
|
|
|
4969
4977
|
var d, p, u, y, g, x, j, b, I, C, T, F, A, N, S, L, h, v;
|
|
4970
4978
|
const s = m((f) => f.card), t = (p = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = q(
|
|
4971
4979
|
((y = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
|
|
4972
|
-
), { setCardPreferences: l } = re(), { data:
|
|
4980
|
+
), { setCardPreferences: l } = re(), { data: c } = _s(s), r = Object.keys((c == null ? void 0 : c.objects) || {}).map((f) => ({
|
|
4973
4981
|
label: f,
|
|
4974
4982
|
value: f
|
|
4975
|
-
})) || [],
|
|
4983
|
+
})) || [], o = [
|
|
4976
4984
|
{
|
|
4977
4985
|
label: "US States 10m",
|
|
4978
4986
|
value: "https://unpkg.com/us-atlas/states-10m.json"
|
|
@@ -4994,7 +5002,7 @@ function Ql() {
|
|
|
4994
5002
|
ue,
|
|
4995
5003
|
{
|
|
4996
5004
|
className: "h-9",
|
|
4997
|
-
options:
|
|
5005
|
+
options: o,
|
|
4998
5006
|
onValueChange: (f) => {
|
|
4999
5007
|
console.log("value", f), l({
|
|
5000
5008
|
...s.preferences,
|
|
@@ -5029,7 +5037,7 @@ function Ql() {
|
|
|
5029
5037
|
placeholder: "Custom URL"
|
|
5030
5038
|
}
|
|
5031
5039
|
),
|
|
5032
|
-
|
|
5040
|
+
c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
5033
5041
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
5034
5042
|
/* @__PURE__ */ e.jsx(R, { children: "Map Object" }),
|
|
5035
5043
|
/* @__PURE__ */ e.jsx(
|
|
@@ -5253,8 +5261,8 @@ function ns({
|
|
|
5253
5261
|
function Kl() {
|
|
5254
5262
|
const s = m(
|
|
5255
5263
|
(n) => {
|
|
5256
|
-
var l,
|
|
5257
|
-
return (
|
|
5264
|
+
var l, c;
|
|
5265
|
+
return (c = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : c.sortChart;
|
|
5258
5266
|
}
|
|
5259
5267
|
), { setSortChart: t } = re();
|
|
5260
5268
|
function a() {
|
|
@@ -5504,13 +5512,13 @@ function sr() {
|
|
|
5504
5512
|
);
|
|
5505
5513
|
}
|
|
5506
5514
|
function ar({ authToken: s, onSave: t, onClose: a }) {
|
|
5507
|
-
|
|
5508
|
-
const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose),
|
|
5515
|
+
z((r) => r.themeStyle);
|
|
5516
|
+
const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose), c = z((r) => r.actions.setAuthToken);
|
|
5509
5517
|
return Z(() => {
|
|
5510
5518
|
t && n(t), a && l(a);
|
|
5511
5519
|
}, [t, n, a, l]), Z(() => {
|
|
5512
|
-
s && s.accessToken &&
|
|
5513
|
-
}, [s,
|
|
5520
|
+
s && s.accessToken && c(s);
|
|
5521
|
+
}, [s, c]), /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
|
|
5514
5522
|
xn,
|
|
5515
5523
|
{
|
|
5516
5524
|
style: {
|
|
@@ -5527,22 +5535,22 @@ function ar({ authToken: s, onSave: t, onClose: a }) {
|
|
|
5527
5535
|
) });
|
|
5528
5536
|
}
|
|
5529
5537
|
function tr() {
|
|
5530
|
-
|
|
5531
|
-
const s =
|
|
5538
|
+
z((r) => r.selectedCardId);
|
|
5539
|
+
const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
|
|
5532
5540
|
function l(r) {
|
|
5533
5541
|
s && (n(s, r), t(!1));
|
|
5534
5542
|
}
|
|
5535
|
-
function
|
|
5543
|
+
function c() {
|
|
5536
5544
|
t(!1);
|
|
5537
5545
|
}
|
|
5538
5546
|
return /* @__PURE__ */ e.jsx(
|
|
5539
5547
|
"div",
|
|
5540
5548
|
{
|
|
5541
5549
|
role: "editor-container",
|
|
5542
|
-
className:
|
|
5550
|
+
className: Q("flex grow", {
|
|
5543
5551
|
"max-h-0 overflow-hidden": !a
|
|
5544
5552
|
}),
|
|
5545
|
-
children: /* @__PURE__ */ e.jsx(ar, { onSave: l, onClose:
|
|
5553
|
+
children: /* @__PURE__ */ e.jsx(ar, { onSave: l, onClose: c })
|
|
5546
5554
|
}
|
|
5547
5555
|
);
|
|
5548
5556
|
}
|
|
@@ -5550,23 +5558,23 @@ function nr() {
|
|
|
5550
5558
|
m((r) => r.selectedConnectionId), m((r) => r.selectedDatamodelId);
|
|
5551
5559
|
const s = m((r) => r.selectedDatabaseName);
|
|
5552
5560
|
m((r) => r.selectedSchemaName);
|
|
5553
|
-
const t = m((r) => r.selectedTableName), a =
|
|
5554
|
-
|
|
5561
|
+
const t = m((r) => r.selectedTableName), a = z((r) => r.dashboard.filters) || [];
|
|
5562
|
+
z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
|
|
5555
5563
|
(r) => r.actions.removeFilterValue
|
|
5556
5564
|
);
|
|
5557
|
-
const { modelItems: n, columns: l } = Re(), { assignFilter:
|
|
5565
|
+
const { modelItems: n, columns: l } = Re(), { assignFilter: c } = Xa();
|
|
5558
5566
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((r) => {
|
|
5559
|
-
const
|
|
5567
|
+
const o = a == null ? void 0 : a.find(
|
|
5560
5568
|
(d) => d.column === de(r.column_name) && d.table === t && d.database === s
|
|
5561
5569
|
);
|
|
5562
5570
|
return /* @__PURE__ */ e.jsx(
|
|
5563
5571
|
"div",
|
|
5564
5572
|
{
|
|
5565
|
-
onClick: () =>
|
|
5566
|
-
className:
|
|
5573
|
+
onClick: () => c(r),
|
|
5574
|
+
className: Q(
|
|
5567
5575
|
"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",
|
|
5568
5576
|
{
|
|
5569
|
-
"bg-muted":
|
|
5577
|
+
"bg-muted": o
|
|
5570
5578
|
}
|
|
5571
5579
|
),
|
|
5572
5580
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -5579,15 +5587,15 @@ function nr() {
|
|
|
5579
5587
|
}) });
|
|
5580
5588
|
}
|
|
5581
5589
|
function lr() {
|
|
5582
|
-
|
|
5583
|
-
const s =
|
|
5590
|
+
z((t) => t.showFilters);
|
|
5591
|
+
const s = z(
|
|
5584
5592
|
(t) => t.actions.setShowFilters
|
|
5585
5593
|
);
|
|
5586
5594
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
5587
5595
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
5588
5596
|
/* @__PURE__ */ e.jsx(R, { className: "text-lg", children: "Filters" }),
|
|
5589
5597
|
/* @__PURE__ */ e.jsx(
|
|
5590
|
-
|
|
5598
|
+
O,
|
|
5591
5599
|
{
|
|
5592
5600
|
onClick: () => s(!1),
|
|
5593
5601
|
className: "h-7 w-7 p-0",
|
|
@@ -5611,12 +5619,12 @@ function lr() {
|
|
|
5611
5619
|
] });
|
|
5612
5620
|
}
|
|
5613
5621
|
function rr() {
|
|
5614
|
-
const s =
|
|
5622
|
+
const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
|
|
5615
5623
|
return /* @__PURE__ */ e.jsxs(
|
|
5616
5624
|
"div",
|
|
5617
5625
|
{
|
|
5618
5626
|
role: "dashboard-plus-main",
|
|
5619
|
-
className:
|
|
5627
|
+
className: Q("", {
|
|
5620
5628
|
"max-h-0 overflow-hidden": t,
|
|
5621
5629
|
"flex grow": !t
|
|
5622
5630
|
}),
|
|
@@ -5628,15 +5636,15 @@ function rr() {
|
|
|
5628
5636
|
);
|
|
5629
5637
|
}
|
|
5630
5638
|
function ir() {
|
|
5631
|
-
const s =
|
|
5639
|
+
const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
|
|
5632
5640
|
(n) => n.showDashboardJSON
|
|
5633
5641
|
);
|
|
5634
|
-
return
|
|
5642
|
+
return z(
|
|
5635
5643
|
(n) => n.actions.setShowDashboardJSON
|
|
5636
5644
|
), /* @__PURE__ */ e.jsx(
|
|
5637
5645
|
"div",
|
|
5638
5646
|
{
|
|
5639
|
-
className:
|
|
5647
|
+
className: Q(" p-2", {
|
|
5640
5648
|
hidden: !a
|
|
5641
5649
|
}),
|
|
5642
5650
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -5708,12 +5716,12 @@ export {
|
|
|
5708
5716
|
Wn as U,
|
|
5709
5717
|
Ps as a,
|
|
5710
5718
|
Bs as b,
|
|
5711
|
-
|
|
5712
|
-
|
|
5719
|
+
za as c,
|
|
5720
|
+
Oa as d,
|
|
5713
5721
|
Fa as e,
|
|
5714
5722
|
kn as f,
|
|
5715
|
-
|
|
5716
|
-
|
|
5723
|
+
zn as g,
|
|
5724
|
+
On as h,
|
|
5717
5725
|
Fn as i,
|
|
5718
5726
|
Dn as j,
|
|
5719
5727
|
In as k,
|