semaphor 0.0.80 → 0.0.82
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-6-OHYvoS.js +245 -0
- package/dist/chunks/index-BTonSpSL.js +367 -0
- package/dist/chunks/index-CQJxYR8z.js +60633 -0
- package/dist/chunks/{index-j7G0u0x7.js → index-CtrJ6W5f.js} +342 -356
- package/dist/chunks/{lucide-react-bxB0wxx1.js → lucide-react-BmrZWURY.js} +6 -8
- package/dist/chunks/{lucide-react-HGNW6zQR.js → lucide-react-C5W0mSbU.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -4
- 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 +2 -5
- package/dist/types/dashboard.d.ts +5 -0
- package/dist/types/main.d.ts +35 -1656
- package/dist/types/surfboard.d.ts +5 -0
- package/dist/types/types.d.ts +5 -0
- package/package.json +39 -33
- package/dist/chunks/index-M3d2p2oT.js +0 -61950
- package/dist/chunks/index-gBqhG8u9.js +0 -245
- package/dist/chunks/index-qredEfng.js +0 -443
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as q, p as hs, u as
|
|
1
|
+
import { c as q, p as hs, u as z, n as Is, o as ve, q as e, r as Ts, s as Ds, t as F, j as Ms, v as Ls, w as Es, x as As, y as Vs, L as H, z as re, A as oa, E as ca, H as da, J as ua, K as rt, M as it, N as ot, O as Ys, Q as W, R as Je, V as u, W as ct, F as ha, Y as We, Z as Ye, _ as qs, $ as ma, a0 as Rs, a1 as fe, a2 as ge, a3 as je, a4 as be, a5 as Oe, a6 as ye, a7 as Q, T as _s, a8 as Hs, a9 as $s, aa as Ps, ab as xa, ac as pa, ad as xe, ae as dt, af as ut, ag as fa, ah as ht, C as mt, ai as xt, aj as ga, B as pt, ak as ms, al as ft, am as Xs, an as ja, ao as Ss, ap as me, aq as ke, ar as de, as as xs, at as ba, au as gt, av as jt, aw as ya, ax as bt, ay as yt, az as vt, aA as Ct, aB as Nt, aC as qe, aD as ws, aE as St, a as wt, aF as Ke, aG as ks, aH as Ve, aI as Os, aJ as kt, aK as Ot, aL as zt, aM as Ft, aN as It, aO as Tt, aP as Ns, aQ as Dt, aR as Zs, aS as Mt, aT as ea, aU as Lt, aV as Et, aW as At, aX as Vt, aY as va, aZ as ce, a_ as Bs, a$ as Ca, b0 as qt, b1 as Rt, b2 as rs, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, b8 as Ut, b9 as Gt, l as Kt, ba as ps, bb as Na, bc as Sa, bd as wa, be as is, bf as ka, bg as os, bh as sa, bi as Qt, bj as Jt, bk as fs, bl as gs, bm as js, bn as Wt, bo as Yt, X as Oa, bp as Xt, bq as Zt, br as en, bs, bt as Te, f as sn, bu as Ge, bv as za, bw as an, bx as tn, by as cs, bz as nn, bA as ln, bB as rn, bC as aa, bD as on, bE as cn, bF as dn, bG as un, bH as hn, bI as mn, bJ as xn, bK as pn, bL as De, bM as U, bN as G, bO as Us, bP as K, bQ as fn, bR as Fa, bS as gn, bT as jn, bU as bn, bV as yn, bW as vn, bX as Cn, bY as Nn, bZ as Sn, b_ as wn } from "./index-CQJxYR8z.js";
|
|
2
2
|
import * as ta from "react";
|
|
3
|
-
import
|
|
3
|
+
import ze, { useState as R, useMemo as zs, useEffect as Z, useRef as Xe, Suspense as kn } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -8,7 +8,7 @@ import "react-dom";
|
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const On = q("Box", [
|
|
12
12
|
[
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
@@ -25,7 +25,7 @@ const zn = q("Box", [
|
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const zn = q("ChartArea", [
|
|
29
29
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
30
30
|
[
|
|
31
31
|
"path",
|
|
@@ -526,10 +526,10 @@ function qa(s) {
|
|
|
526
526
|
return {
|
|
527
527
|
...a,
|
|
528
528
|
frames: (n = a.frames) == null ? void 0 : n.map((l) => {
|
|
529
|
-
var
|
|
529
|
+
var o;
|
|
530
530
|
return {
|
|
531
531
|
...l,
|
|
532
|
-
cards: (
|
|
532
|
+
cards: (o = l.cards) == null ? void 0 : o.map((r) => Zn(r))
|
|
533
533
|
};
|
|
534
534
|
})
|
|
535
535
|
};
|
|
@@ -545,8 +545,8 @@ function Zn(s) {
|
|
|
545
545
|
data: {
|
|
546
546
|
...(t = s.cfg) == null ? void 0 : t.data,
|
|
547
547
|
labels: [],
|
|
548
|
-
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((
|
|
549
|
-
...
|
|
548
|
+
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((o) => ({
|
|
549
|
+
...o,
|
|
550
550
|
data: []
|
|
551
551
|
}))
|
|
552
552
|
}
|
|
@@ -584,12 +584,12 @@ async function sl(s, t, a, n) {
|
|
|
584
584
|
async function Fs(s, t) {
|
|
585
585
|
if (!t)
|
|
586
586
|
return null;
|
|
587
|
-
const { id: a, template: n, filterValues: l, isDefault:
|
|
587
|
+
const { id: a, template: n, filterValues: l, isDefault: o, shared: r } = s;
|
|
588
588
|
return await hs("https://semaphor.cloud/api/v1/lens", t, {
|
|
589
589
|
lensId: a,
|
|
590
590
|
template: n,
|
|
591
591
|
filterValues: l,
|
|
592
|
-
isDefault:
|
|
592
|
+
isDefault: o,
|
|
593
593
|
shared: r,
|
|
594
594
|
operation: "update"
|
|
595
595
|
});
|
|
@@ -601,9 +601,9 @@ async function al(s, t) {
|
|
|
601
601
|
}) : null;
|
|
602
602
|
}
|
|
603
603
|
function tl() {
|
|
604
|
-
const [s, t] = R(""), [a, n] = R(!1), l =
|
|
604
|
+
const [s, t] = R(""), [a, n] = R(!1), l = z((j) => j.lenses), { setLenses: o, setSelectedLensId: r } = Is(), [c, i] = R(!1), [x, d] = R(!1), y = z((j) => j.dashboard), f = z((j) => j.filterValues), { authToken: m } = ve();
|
|
605
605
|
async function g() {
|
|
606
|
-
|
|
606
|
+
i(!0);
|
|
607
607
|
const j = qa(
|
|
608
608
|
y
|
|
609
609
|
), T = await sl(
|
|
@@ -612,7 +612,7 @@ function tl() {
|
|
|
612
612
|
f,
|
|
613
613
|
m == null ? void 0 : m.accessToken
|
|
614
614
|
);
|
|
615
|
-
T && (
|
|
615
|
+
T && (o([...l || [], T]), r(T.id), d(!1)), i(!1);
|
|
616
616
|
}
|
|
617
617
|
return /* @__PURE__ */ e.jsxs(Ts, { open: x, onOpenChange: d, children: [
|
|
618
618
|
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -662,14 +662,14 @@ function tl() {
|
|
|
662
662
|
] });
|
|
663
663
|
}
|
|
664
664
|
function nl() {
|
|
665
|
-
const [s, t] = R(!1), a =
|
|
665
|
+
const [s, t] = R(!1), a = z((d) => d.lenses), n = z((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: o } = Is(), { authToken: r } = ve();
|
|
666
666
|
async function c(d) {
|
|
667
|
-
|
|
667
|
+
o(d);
|
|
668
668
|
}
|
|
669
|
-
async function
|
|
669
|
+
async function i(d) {
|
|
670
670
|
if (await al(d, r == null ? void 0 : r.accessToken)) {
|
|
671
671
|
const f = a == null ? void 0 : a.filter((m) => m.id !== d);
|
|
672
|
-
l(f || []),
|
|
672
|
+
l(f || []), o("original");
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
async function x(d) {
|
|
@@ -735,7 +735,7 @@ function nl() {
|
|
|
735
735
|
Je,
|
|
736
736
|
{
|
|
737
737
|
onClick: (y) => {
|
|
738
|
-
y.preventDefault(),
|
|
738
|
+
y.preventDefault(), i(d.id);
|
|
739
739
|
},
|
|
740
740
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
741
741
|
strokeWidth: 1.5
|
|
@@ -753,26 +753,25 @@ function nl() {
|
|
|
753
753
|
] });
|
|
754
754
|
}
|
|
755
755
|
function ll() {
|
|
756
|
-
const { authToken: s } = ve(), t =
|
|
757
|
-
|
|
758
|
-
const
|
|
756
|
+
const { authToken: s } = ve(), t = z((p) => p.lenses), a = z((p) => p.selectedLensId), n = t == null ? void 0 : t.find((p) => p.id === a), l = z((p) => p.dashboard);
|
|
757
|
+
z((p) => p.selectedSheetId);
|
|
758
|
+
const o = z(
|
|
759
759
|
(p) => p.isDashboardEditing
|
|
760
760
|
), r = u(
|
|
761
761
|
(p) => p.selectedConnectionId
|
|
762
|
-
), [c,
|
|
763
|
-
|
|
762
|
+
), [c, i] = R(!1), x = z((p) => p.filterValues), d = z((p) => p.isVisualEditing), y = z((p) => p.showFilters);
|
|
763
|
+
z(
|
|
764
764
|
(p) => p.showDashboardJSON
|
|
765
765
|
);
|
|
766
|
-
const f =
|
|
766
|
+
const f = z((p) => p.onSaveFunction), m = z(
|
|
767
767
|
(p) => p.actions.setShowFilters
|
|
768
|
-
), { addFrame: g, setSelectedFrameId: j } =
|
|
768
|
+
), { addFrame: g, setSelectedFrameId: j } = z(
|
|
769
769
|
(p) => p.actions
|
|
770
|
-
), { getSelectedSheet: T, setIsDashboardEditing: C, setShowDashboardJSON: M } =
|
|
770
|
+
), { getSelectedSheet: T, setIsDashboardEditing: C, setShowDashboardJSON: M } = z((p) => p.actions), I = T(), { tenantId: V, endUserId: N } = zs(
|
|
771
771
|
() => ct(s == null ? void 0 : s.accessToken),
|
|
772
772
|
[s == null ? void 0 : s.accessToken]
|
|
773
|
-
), w =
|
|
774
|
-
if (!
|
|
775
|
-
return;
|
|
773
|
+
), w = zs(() => V || N, [V, N]), L = () => {
|
|
774
|
+
if (!o || !I) return;
|
|
776
775
|
const p = {
|
|
777
776
|
connectionId: r,
|
|
778
777
|
id: We(),
|
|
@@ -789,26 +788,25 @@ function ll() {
|
|
|
789
788
|
type: "bar",
|
|
790
789
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
791
790
|
data: []
|
|
792
|
-
},
|
|
791
|
+
}, O = {
|
|
793
792
|
id: We(),
|
|
794
793
|
cards: [p],
|
|
795
794
|
activeCardId: p.id
|
|
796
795
|
};
|
|
797
|
-
g(I.id,
|
|
796
|
+
g(I.id, O), j(O.id);
|
|
798
797
|
}, h = () => {
|
|
799
798
|
C(!0);
|
|
800
799
|
};
|
|
801
800
|
async function v() {
|
|
802
|
-
if (
|
|
803
|
-
return;
|
|
801
|
+
if (i(!0), !a || !n) return;
|
|
804
802
|
const p = qa(
|
|
805
803
|
l
|
|
806
|
-
),
|
|
804
|
+
), O = JSON.stringify(p), E = {
|
|
807
805
|
...n,
|
|
808
|
-
template:
|
|
806
|
+
template: O,
|
|
809
807
|
filterValues: x
|
|
810
808
|
};
|
|
811
|
-
await Fs(E, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), f == null || f(p),
|
|
809
|
+
await Fs(E, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), f == null || f(p), i(!1);
|
|
812
810
|
}
|
|
813
811
|
return d ? null : /* @__PURE__ */ e.jsxs(
|
|
814
812
|
"div",
|
|
@@ -818,15 +816,15 @@ function ll() {
|
|
|
818
816
|
children: [
|
|
819
817
|
!d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: n == null ? void 0 : n.name }) }),
|
|
820
818
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
821
|
-
|
|
819
|
+
o && !d && w && /* @__PURE__ */ e.jsx(tl, {}),
|
|
822
820
|
!d && w && /* @__PURE__ */ e.jsx(nl, {}),
|
|
823
|
-
|
|
821
|
+
o && !d && /* @__PURE__ */ e.jsxs(
|
|
824
822
|
F,
|
|
825
823
|
{
|
|
826
824
|
variant: "secondary",
|
|
827
825
|
className: "h-7 p-2",
|
|
828
826
|
size: "sm",
|
|
829
|
-
disabled: !
|
|
827
|
+
disabled: !o,
|
|
830
828
|
onClick: L,
|
|
831
829
|
children: [
|
|
832
830
|
/* @__PURE__ */ e.jsx(Ms, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
@@ -834,7 +832,7 @@ function ll() {
|
|
|
834
832
|
]
|
|
835
833
|
}
|
|
836
834
|
),
|
|
837
|
-
!
|
|
835
|
+
!o && /* @__PURE__ */ e.jsx(
|
|
838
836
|
F,
|
|
839
837
|
{
|
|
840
838
|
variant: "ghost",
|
|
@@ -844,7 +842,7 @@ function ll() {
|
|
|
844
842
|
children: /* @__PURE__ */ e.jsx(Aa, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
845
843
|
}
|
|
846
844
|
),
|
|
847
|
-
|
|
845
|
+
o && !d && /* @__PURE__ */ e.jsx(
|
|
848
846
|
F,
|
|
849
847
|
{
|
|
850
848
|
variant: "ghost",
|
|
@@ -857,7 +855,7 @@ function ll() {
|
|
|
857
855
|
children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
858
856
|
}
|
|
859
857
|
),
|
|
860
|
-
|
|
858
|
+
o && !d && w && /* @__PURE__ */ e.jsx(
|
|
861
859
|
F,
|
|
862
860
|
{
|
|
863
861
|
className: "h-7 p-2",
|
|
@@ -868,7 +866,7 @@ function ll() {
|
|
|
868
866
|
children: /* @__PURE__ */ e.jsx(Gn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
869
867
|
}
|
|
870
868
|
),
|
|
871
|
-
!y && !d &&
|
|
869
|
+
!y && !d && o && /* @__PURE__ */ e.jsx(
|
|
872
870
|
F,
|
|
873
871
|
{
|
|
874
872
|
className: "h-7 p-2",
|
|
@@ -878,7 +876,7 @@ function ll() {
|
|
|
878
876
|
children: /* @__PURE__ */ e.jsx(ha, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
879
877
|
}
|
|
880
878
|
),
|
|
881
|
-
!d &&
|
|
879
|
+
!d && o && !1,
|
|
882
880
|
!d && !1
|
|
883
881
|
] })
|
|
884
882
|
]
|
|
@@ -891,10 +889,10 @@ function Ue({
|
|
|
891
889
|
value: a,
|
|
892
890
|
isLoading: n,
|
|
893
891
|
isError: l,
|
|
894
|
-
connectionTooltip:
|
|
892
|
+
connectionTooltip: o,
|
|
895
893
|
onChange: r,
|
|
896
894
|
showNone: c = !1,
|
|
897
|
-
className:
|
|
895
|
+
className: i,
|
|
898
896
|
showIcon: x = !0,
|
|
899
897
|
disabled: d = !1
|
|
900
898
|
}) {
|
|
@@ -909,12 +907,12 @@ function Ue({
|
|
|
909
907
|
if (s === "Table")
|
|
910
908
|
return /* @__PURE__ */ e.jsx(_s, { className: "size-4" });
|
|
911
909
|
if (s === "Model")
|
|
912
|
-
return /* @__PURE__ */ e.jsx(
|
|
910
|
+
return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
|
|
913
911
|
}
|
|
914
912
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
915
|
-
x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
913
|
+
x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(qs, { children: [
|
|
916
914
|
/* @__PURE__ */ e.jsx(ma, { children: f() }),
|
|
917
|
-
/* @__PURE__ */ e.jsx(Rs, { className: "text-xs", align: "start", children:
|
|
915
|
+
/* @__PURE__ */ e.jsx(Rs, { className: "text-xs", align: "start", children: o })
|
|
918
916
|
] }) : f() }),
|
|
919
917
|
/* @__PURE__ */ e.jsxs(fe, { disabled: d, value: y, onValueChange: r, children: [
|
|
920
918
|
/* @__PURE__ */ e.jsx(
|
|
@@ -922,7 +920,7 @@ function Ue({
|
|
|
922
920
|
{
|
|
923
921
|
className: W(
|
|
924
922
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
925
|
-
|
|
923
|
+
i
|
|
926
924
|
),
|
|
927
925
|
children: /* @__PURE__ */ e.jsx(
|
|
928
926
|
je,
|
|
@@ -932,7 +930,7 @@ function Ue({
|
|
|
932
930
|
)
|
|
933
931
|
}
|
|
934
932
|
),
|
|
935
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
933
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
936
934
|
n ? /* @__PURE__ */ e.jsx(ye, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(ye, { children: s }),
|
|
937
935
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
938
936
|
c && /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
@@ -946,15 +944,15 @@ function Ue({
|
|
|
946
944
|
function rl({ column: s }) {
|
|
947
945
|
const [t, a] = R(!1), n = u((m) => m.selectedTableName), l = u(
|
|
948
946
|
(m) => m.selectedSchemaName
|
|
949
|
-
),
|
|
947
|
+
), o = u(
|
|
950
948
|
(m) => m.selectedDatamodelId
|
|
951
|
-
), r = u((m) => m.sqlGen), { modelItems: c } = Re(),
|
|
949
|
+
), r = u((m) => m.sqlGen), { modelItems: c } = Re(), i = u((m) => m.actions.setSqlGen), x = u((m) => m.actions.setCardSql), d = u((m) => m.actions.setRunSql);
|
|
952
950
|
function y(m, g) {
|
|
953
951
|
var M;
|
|
954
952
|
const j = xa(m, r, g), T = (M = c == null ? void 0 : c.find(
|
|
955
|
-
(I) => I.id ===
|
|
953
|
+
(I) => I.id === o
|
|
956
954
|
)) == null ? void 0 : M.name;
|
|
957
|
-
|
|
955
|
+
i(j);
|
|
958
956
|
const C = pa(
|
|
959
957
|
j,
|
|
960
958
|
xe(l || ""),
|
|
@@ -1037,17 +1035,17 @@ function il({
|
|
|
1037
1035
|
columns: a,
|
|
1038
1036
|
status: n
|
|
1039
1037
|
}) {
|
|
1040
|
-
const l = u((h) => h.sqlGen),
|
|
1038
|
+
const l = u((h) => h.sqlGen), o = u(
|
|
1041
1039
|
(h) => h.selectedConnectionId
|
|
1042
1040
|
), r = u(
|
|
1043
1041
|
(h) => h.selectedDatabaseName
|
|
1044
1042
|
), c = u(
|
|
1045
1043
|
(h) => h.selectedSchemaName
|
|
1046
|
-
),
|
|
1044
|
+
), i = u((h) => h.selectedTableName), x = u(
|
|
1047
1045
|
(h) => h.selectedDatamodelId
|
|
1048
|
-
), d =
|
|
1046
|
+
), d = z(
|
|
1049
1047
|
(h) => h.dashboard.aiScopeTables
|
|
1050
|
-
), { setAIScopeTables: y } =
|
|
1048
|
+
), { setAIScopeTables: y } = z((h) => h.actions), f = u((h) => h.actions.setRunSql), m = u((h) => h.actions.setSqlGen), g = u(
|
|
1051
1049
|
(h) => h.actions.setIsShowingVisual
|
|
1052
1050
|
), j = u((h) => h.actions.setCardSql), { connectionType: T, modelItems: C } = Re();
|
|
1053
1051
|
function M(h) {
|
|
@@ -1056,37 +1054,37 @@ function il({
|
|
|
1056
1054
|
m(v);
|
|
1057
1055
|
const p = (E = C == null ? void 0 : C.find(
|
|
1058
1056
|
($) => $.id === x
|
|
1059
|
-
)) == null ? void 0 : E.name,
|
|
1060
|
-
|
|
1057
|
+
)) == null ? void 0 : E.name, O = pa(v, xe(s), xe(t), p);
|
|
1058
|
+
O && (j(O), f(!0));
|
|
1061
1059
|
}
|
|
1062
1060
|
function I() {
|
|
1063
1061
|
return (d == null ? void 0 : d.find(
|
|
1064
|
-
(h) => h.connectinonId ===
|
|
1062
|
+
(h) => h.connectinonId === o && h.tableName === i
|
|
1065
1063
|
)) !== void 0;
|
|
1066
1064
|
}
|
|
1067
1065
|
function V(h) {
|
|
1068
|
-
if (h === !0 &&
|
|
1066
|
+
if (h === !0 && i && o) {
|
|
1069
1067
|
const v = {
|
|
1070
|
-
connectinonId:
|
|
1068
|
+
connectinonId: o,
|
|
1071
1069
|
connectionType: T,
|
|
1072
1070
|
databaseName: r,
|
|
1073
1071
|
schemaName: c,
|
|
1074
|
-
tableName:
|
|
1075
|
-
},
|
|
1072
|
+
tableName: i
|
|
1073
|
+
}, O = [...d || [], v].filter(
|
|
1076
1074
|
(E, $, B) => B.findIndex(
|
|
1077
1075
|
(Y) => Y.connectinonId === E.connectinonId && Y.tableName === E.tableName
|
|
1078
1076
|
) === $
|
|
1079
1077
|
);
|
|
1080
|
-
y(
|
|
1078
|
+
y(O), Ye.success(`Added '${i}' to AI Scope`, {
|
|
1081
1079
|
position: "top-right",
|
|
1082
1080
|
duration: 2500,
|
|
1083
1081
|
richColors: !0
|
|
1084
1082
|
});
|
|
1085
1083
|
} else {
|
|
1086
1084
|
const v = (d || []).filter(
|
|
1087
|
-
(p) => p.connectinonId !==
|
|
1085
|
+
(p) => p.connectinonId !== o && p.tableName !== i
|
|
1088
1086
|
);
|
|
1089
|
-
y(v), Ye(`Removed '${
|
|
1087
|
+
y(v), Ye(`Removed '${i}' from AI Scope`, {
|
|
1090
1088
|
position: "top-right",
|
|
1091
1089
|
duration: 2e3,
|
|
1092
1090
|
richColors: !0
|
|
@@ -1204,16 +1202,16 @@ function il({
|
|
|
1204
1202
|
}
|
|
1205
1203
|
function Re(s, t) {
|
|
1206
1204
|
var Pe, ss, as, ts, Be;
|
|
1207
|
-
let a =
|
|
1205
|
+
let a = zs(() => [], []);
|
|
1208
1206
|
const n = ve().authToken || s, l = u(
|
|
1209
1207
|
(S) => S.selectedConnectionId
|
|
1210
|
-
),
|
|
1208
|
+
), o = u(
|
|
1211
1209
|
(S) => S.selectedDatamodelId
|
|
1212
1210
|
), r = u(
|
|
1213
1211
|
(S) => S.selectedDatabaseName
|
|
1214
1212
|
), c = u(
|
|
1215
1213
|
(S) => S.selectedSchemaName
|
|
1216
|
-
),
|
|
1214
|
+
), i = u((S) => S.selectedTableName), x = u(
|
|
1217
1215
|
(S) => S.actions.setCurrentColumns
|
|
1218
1216
|
), d = u(
|
|
1219
1217
|
(S) => S.actions.setSelectedConnectionId
|
|
@@ -1230,7 +1228,7 @@ function Re(s, t) {
|
|
|
1230
1228
|
return l && r && c && r !== "NA" ? !0 : l && S === "API" ? !1 : !!(l && S === "S3");
|
|
1231
1229
|
}
|
|
1232
1230
|
function C(S) {
|
|
1233
|
-
return !!(l && r && r !== "NA" && c &&
|
|
1231
|
+
return !!(l && r && r !== "NA" && c && i || l && (S === "S3" || S === "API") || o && o);
|
|
1234
1232
|
}
|
|
1235
1233
|
function M(S) {
|
|
1236
1234
|
return l && S ? !(S === "API" || S === "S3") : !1;
|
|
@@ -1264,7 +1262,7 @@ function Re(s, t) {
|
|
|
1264
1262
|
// Only fetch if authToken is present
|
|
1265
1263
|
}), v = I == null ? void 0 : I.connections.find(
|
|
1266
1264
|
(S) => S.id === l
|
|
1267
|
-
), p = v == null ? void 0 : v.type,
|
|
1265
|
+
), p = v == null ? void 0 : v.type, O = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1268
1266
|
data: E,
|
|
1269
1267
|
isLoading: $,
|
|
1270
1268
|
isFetching: B,
|
|
@@ -1297,7 +1295,7 @@ function Re(s, t) {
|
|
|
1297
1295
|
database_name: r
|
|
1298
1296
|
}
|
|
1299
1297
|
),
|
|
1300
|
-
enabled: !!l && !!r && !
|
|
1298
|
+
enabled: !!l && !!r && !O && r !== "NA"
|
|
1301
1299
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1302
1300
|
}), {
|
|
1303
1301
|
data: A,
|
|
@@ -1332,20 +1330,20 @@ function Re(s, t) {
|
|
|
1332
1330
|
"columns",
|
|
1333
1331
|
l,
|
|
1334
1332
|
r,
|
|
1335
|
-
|
|
1333
|
+
o,
|
|
1336
1334
|
c,
|
|
1337
|
-
|
|
1335
|
+
i
|
|
1338
1336
|
],
|
|
1339
1337
|
queryFn: () => ke(
|
|
1340
1338
|
"https://semaphor.cloud/api/v1/columns",
|
|
1341
1339
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1342
1340
|
{
|
|
1343
1341
|
connection_id: l,
|
|
1344
|
-
datamodel_id:
|
|
1342
|
+
datamodel_id: o || "",
|
|
1345
1343
|
// don't pass undefined. Pass empty string
|
|
1346
1344
|
database_name: r,
|
|
1347
1345
|
schema_name: c,
|
|
1348
|
-
table_name:
|
|
1346
|
+
table_name: i
|
|
1349
1347
|
}
|
|
1350
1348
|
),
|
|
1351
1349
|
enabled: C(p)
|
|
@@ -1361,14 +1359,14 @@ function Re(s, t) {
|
|
|
1361
1359
|
x(a);
|
|
1362
1360
|
}, [ie, x, a]), Z(() => {
|
|
1363
1361
|
}, [
|
|
1364
|
-
|
|
1362
|
+
O,
|
|
1365
1363
|
j,
|
|
1366
1364
|
g,
|
|
1367
1365
|
m,
|
|
1368
1366
|
f,
|
|
1369
1367
|
v
|
|
1370
1368
|
]);
|
|
1371
|
-
const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() :
|
|
1369
|
+
const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() : i || "", we = O ? "" : c || "";
|
|
1372
1370
|
function ae(S) {
|
|
1373
1371
|
m(S), g("");
|
|
1374
1372
|
}
|
|
@@ -1423,7 +1421,7 @@ function Re(s, t) {
|
|
|
1423
1421
|
columns: a,
|
|
1424
1422
|
isColumnsLoadingOrFetching: Ne || Le,
|
|
1425
1423
|
isColumnsError: Se,
|
|
1426
|
-
isNonDbConnection:
|
|
1424
|
+
isNonDbConnection: O,
|
|
1427
1425
|
connectionType: p,
|
|
1428
1426
|
tableName: Fe,
|
|
1429
1427
|
schemaName: we,
|
|
@@ -1445,11 +1443,11 @@ function _a({
|
|
|
1445
1443
|
(P) => P.selectedDatabaseName
|
|
1446
1444
|
), l = u(
|
|
1447
1445
|
(P) => P.selectedSchemaName
|
|
1448
|
-
),
|
|
1446
|
+
), o = u((P) => P.selectedTableName), r = u(
|
|
1449
1447
|
(P) => P.actions.setSelectedTableName
|
|
1450
1448
|
), {
|
|
1451
1449
|
connectionItems: c,
|
|
1452
|
-
modelItems:
|
|
1450
|
+
modelItems: i,
|
|
1453
1451
|
schemaItems: x,
|
|
1454
1452
|
databaseItems: d,
|
|
1455
1453
|
tableItems: y,
|
|
@@ -1468,7 +1466,7 @@ function _a({
|
|
|
1468
1466
|
isTableError: h,
|
|
1469
1467
|
connectionType: v,
|
|
1470
1468
|
isNonDbConnection: p,
|
|
1471
|
-
handleConnectionChange:
|
|
1469
|
+
handleConnectionChange: O,
|
|
1472
1470
|
handleDatabaseChange: E,
|
|
1473
1471
|
handleSchemaChange: $,
|
|
1474
1472
|
handleDatamodelChange: B,
|
|
@@ -1490,8 +1488,7 @@ function _a({
|
|
|
1490
1488
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1491
1489
|
}
|
|
1492
1490
|
function k() {
|
|
1493
|
-
if (!t || v === "S3" || v === "API")
|
|
1494
|
-
return null;
|
|
1491
|
+
if (!t || v === "S3" || v === "API") return null;
|
|
1495
1492
|
if (!a || a === "none")
|
|
1496
1493
|
return /* @__PURE__ */ e.jsx(
|
|
1497
1494
|
Ue,
|
|
@@ -1515,8 +1512,7 @@ function _a({
|
|
|
1515
1512
|
] });
|
|
1516
1513
|
}
|
|
1517
1514
|
function ee() {
|
|
1518
|
-
if (!t || v === "S3" || v === "API")
|
|
1519
|
-
return null;
|
|
1515
|
+
if (!t || v === "S3" || v === "API") return null;
|
|
1520
1516
|
if (!n || n === "none")
|
|
1521
1517
|
return /* @__PURE__ */ e.jsx(
|
|
1522
1518
|
Ue,
|
|
@@ -1525,7 +1521,7 @@ function _a({
|
|
|
1525
1521
|
onChange: B,
|
|
1526
1522
|
isError: T,
|
|
1527
1523
|
isLoading: g,
|
|
1528
|
-
items:
|
|
1524
|
+
items: i,
|
|
1529
1525
|
value: a || "",
|
|
1530
1526
|
title: "Model"
|
|
1531
1527
|
}
|
|
@@ -1556,7 +1552,7 @@ function _a({
|
|
|
1556
1552
|
isError: h,
|
|
1557
1553
|
items: y,
|
|
1558
1554
|
isLoading: L,
|
|
1559
|
-
value:
|
|
1555
|
+
value: o || "",
|
|
1560
1556
|
title: "Table"
|
|
1561
1557
|
}
|
|
1562
1558
|
) : null;
|
|
@@ -1569,7 +1565,7 @@ function _a({
|
|
|
1569
1565
|
items: c,
|
|
1570
1566
|
title: "Connection",
|
|
1571
1567
|
value: t || "",
|
|
1572
|
-
onChange:
|
|
1568
|
+
onChange: O,
|
|
1573
1569
|
isLoading: m,
|
|
1574
1570
|
isError: j,
|
|
1575
1571
|
connectionTooltip: ((se = c == null ? void 0 : c.find(
|
|
@@ -1601,8 +1597,8 @@ function _a({
|
|
|
1601
1597
|
}
|
|
1602
1598
|
function ol(s) {
|
|
1603
1599
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1604
|
-
let
|
|
1605
|
-
if (l !== -1 && (
|
|
1600
|
+
let o = s.length;
|
|
1601
|
+
if (l !== -1 && (o = l), n !== -1 && n < o && (o = n), t !== -1) {
|
|
1606
1602
|
const r = s.substring(0, t), c = s.substring(t);
|
|
1607
1603
|
return `${r} {{ filters | where }} AND ${c.substring(
|
|
1608
1604
|
6
|
|
@@ -1611,7 +1607,7 @@ function ol(s) {
|
|
|
1611
1607
|
const r = s.substring(0, a), c = s.substring(a);
|
|
1612
1608
|
return `${r} {{ filters | where }} ${c}`;
|
|
1613
1609
|
} else {
|
|
1614
|
-
const r = s.substring(0,
|
|
1610
|
+
const r = s.substring(0, o), c = s.substring(o);
|
|
1615
1611
|
return `${r} {{ filters | where }} ${c}`;
|
|
1616
1612
|
}
|
|
1617
1613
|
}
|
|
@@ -1654,7 +1650,7 @@ function dl({
|
|
|
1654
1650
|
}
|
|
1655
1651
|
function ul() {
|
|
1656
1652
|
const { authToken: s } = ve(), t = u(
|
|
1657
|
-
(
|
|
1653
|
+
(o) => o.selectedConnectionId
|
|
1658
1654
|
), { data: a } = me({
|
|
1659
1655
|
queryKey: ["connections"],
|
|
1660
1656
|
queryFn: () => ke(
|
|
@@ -1664,26 +1660,25 @@ function ul() {
|
|
|
1664
1660
|
enabled: !!(s != null && s.accessToken)
|
|
1665
1661
|
// Only fetch if authToken is present
|
|
1666
1662
|
}), n = a == null ? void 0 : a.connections.find(
|
|
1667
|
-
(
|
|
1663
|
+
(o) => o.id === t
|
|
1668
1664
|
);
|
|
1669
1665
|
return n == null ? void 0 : n.type;
|
|
1670
1666
|
}
|
|
1671
1667
|
function hl() {
|
|
1672
|
-
const { authToken: s } = ve(), t = Xe(null), a = u((
|
|
1668
|
+
const { authToken: s } = ve(), t = Xe(null), a = u((i) => i.applyFilters), [n, l] = R(""), o = u((i) => i.filterValues), r = u((i) => i.card.sql), c = ul();
|
|
1673
1669
|
return /* @__PURE__ */ e.jsxs(
|
|
1674
1670
|
Hs,
|
|
1675
1671
|
{
|
|
1676
1672
|
openDelay: 0,
|
|
1677
|
-
onOpenChange: async (
|
|
1678
|
-
if (!
|
|
1679
|
-
return;
|
|
1673
|
+
onOpenChange: async (i) => {
|
|
1674
|
+
if (!i) return;
|
|
1680
1675
|
console.log("onOpenChange");
|
|
1681
1676
|
const x = await hs(
|
|
1682
1677
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1683
1678
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1684
1679
|
{
|
|
1685
1680
|
sql: r,
|
|
1686
|
-
active_filters:
|
|
1681
|
+
active_filters: o,
|
|
1687
1682
|
connection_type: c
|
|
1688
1683
|
}
|
|
1689
1684
|
);
|
|
@@ -1764,9 +1759,9 @@ function xl({
|
|
|
1764
1759
|
userInput: a,
|
|
1765
1760
|
setUserInput: n,
|
|
1766
1761
|
triggerAIRun: l,
|
|
1767
|
-
setTriggerAIRun:
|
|
1762
|
+
setTriggerAIRun: o
|
|
1768
1763
|
}) {
|
|
1769
|
-
const r = Xe(null), c = Xe(null), { authToken:
|
|
1764
|
+
const r = Xe(null), c = Xe(null), { authToken: i } = ve(), [x, d] = R(!1), y = u((k) => k.actions.setCardSql), f = z((k) => k.dashboard.baseQueries), m = u((k) => k.actions.setRunSql), g = u((k) => k.actions.setCardType), [j, T] = R([]), C = u((k) => k.currentColumns), M = u((k) => k.card.sql), I = u((k) => k.selectedTableName), V = `
|
|
1770
1765
|
${a}
|
|
1771
1766
|
|
|
1772
1767
|
Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
|
|
@@ -1778,7 +1773,7 @@ function xl({
|
|
|
1778
1773
|
queryKey: ["ai-query"],
|
|
1779
1774
|
queryFn: () => ke(
|
|
1780
1775
|
"https://semaphor.cloud/api/v1/ai",
|
|
1781
|
-
(
|
|
1776
|
+
(i == null ? void 0 : i.accessToken) || "",
|
|
1782
1777
|
{
|
|
1783
1778
|
user_content: `userContent: ${V} ${x ? N : ""}`
|
|
1784
1779
|
}
|
|
@@ -1786,7 +1781,7 @@ function xl({
|
|
|
1786
1781
|
enabled: !1
|
|
1787
1782
|
// Do not run by default.
|
|
1788
1783
|
});
|
|
1789
|
-
function
|
|
1784
|
+
function O(k) {
|
|
1790
1785
|
if (k.toLowerCase().includes("bar"))
|
|
1791
1786
|
g("bar");
|
|
1792
1787
|
else if (k.toLowerCase().includes("line"))
|
|
@@ -1820,11 +1815,11 @@ function xl({
|
|
|
1820
1815
|
return () => clearTimeout(k);
|
|
1821
1816
|
}, [j]);
|
|
1822
1817
|
function E() {
|
|
1823
|
-
a && (T((k) => [...k, { role: "user", content: a }]),
|
|
1818
|
+
a && (T((k) => [...k, { role: "user", content: a }]), O(a) && d(!0), n(""), p());
|
|
1824
1819
|
}
|
|
1825
1820
|
Z(() => {
|
|
1826
|
-
l && (E(),
|
|
1827
|
-
}, [l,
|
|
1821
|
+
l && (E(), o(!1));
|
|
1822
|
+
}, [l, o]);
|
|
1828
1823
|
const $ = {
|
|
1829
1824
|
//seleect a darker color
|
|
1830
1825
|
// color: '#000',
|
|
@@ -1877,8 +1872,7 @@ function xl({
|
|
|
1877
1872
|
};
|
|
1878
1873
|
function J(k) {
|
|
1879
1874
|
const _ = k.currentTarget.closest("pre");
|
|
1880
|
-
if (!_)
|
|
1881
|
-
return;
|
|
1875
|
+
if (!_) return;
|
|
1882
1876
|
const ee = _.textContent || _.innerText;
|
|
1883
1877
|
return navigator.clipboard.writeText(ee).then(() => console.log("Text copied to clipboard")).catch((A) => console.error("Error in copying text: ", A)), ee;
|
|
1884
1878
|
}
|
|
@@ -1980,24 +1974,25 @@ var Ha = {
|
|
|
1980
1974
|
className: void 0,
|
|
1981
1975
|
style: void 0,
|
|
1982
1976
|
attr: void 0
|
|
1983
|
-
}, na =
|
|
1977
|
+
}, na = ze.createContext && /* @__PURE__ */ ze.createContext(Ha), pl = ["attr", "size", "title"];
|
|
1984
1978
|
function fl(s, t) {
|
|
1985
|
-
if (s == null)
|
|
1986
|
-
return {};
|
|
1979
|
+
if (s == null) return {};
|
|
1987
1980
|
var a = gl(s, t), n, l;
|
|
1988
1981
|
if (Object.getOwnPropertySymbols) {
|
|
1989
|
-
var
|
|
1990
|
-
for (l = 0; l <
|
|
1991
|
-
n =
|
|
1982
|
+
var o = Object.getOwnPropertySymbols(s);
|
|
1983
|
+
for (l = 0; l < o.length; l++)
|
|
1984
|
+
n = o[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1992
1985
|
}
|
|
1993
1986
|
return a;
|
|
1994
1987
|
}
|
|
1995
1988
|
function gl(s, t) {
|
|
1996
|
-
if (s == null)
|
|
1997
|
-
|
|
1998
|
-
var
|
|
1999
|
-
|
|
2000
|
-
|
|
1989
|
+
if (s == null) return {};
|
|
1990
|
+
var a = {};
|
|
1991
|
+
for (var n in s)
|
|
1992
|
+
if (Object.prototype.hasOwnProperty.call(s, n)) {
|
|
1993
|
+
if (t.indexOf(n) >= 0) continue;
|
|
1994
|
+
a[n] = s[n];
|
|
1995
|
+
}
|
|
2001
1996
|
return a;
|
|
2002
1997
|
}
|
|
2003
1998
|
function ds() {
|
|
@@ -2036,27 +2031,25 @@ function jl(s, t, a) {
|
|
|
2036
2031
|
}
|
|
2037
2032
|
function bl(s) {
|
|
2038
2033
|
var t = yl(s, "string");
|
|
2039
|
-
return typeof t == "symbol" ? t :
|
|
2034
|
+
return typeof t == "symbol" ? t : t + "";
|
|
2040
2035
|
}
|
|
2041
2036
|
function yl(s, t) {
|
|
2042
|
-
if (typeof s != "object" || s
|
|
2043
|
-
return s;
|
|
2037
|
+
if (typeof s != "object" || !s) return s;
|
|
2044
2038
|
var a = s[Symbol.toPrimitive];
|
|
2045
2039
|
if (a !== void 0) {
|
|
2046
2040
|
var n = a.call(s, t || "default");
|
|
2047
|
-
if (typeof n != "object")
|
|
2048
|
-
return n;
|
|
2041
|
+
if (typeof n != "object") return n;
|
|
2049
2042
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2050
2043
|
}
|
|
2051
2044
|
return (t === "string" ? String : Number)(s);
|
|
2052
2045
|
}
|
|
2053
2046
|
function $a(s) {
|
|
2054
|
-
return s && s.map((t, a) => /* @__PURE__ */
|
|
2047
|
+
return s && s.map((t, a) => /* @__PURE__ */ ze.createElement(t.tag, us({
|
|
2055
2048
|
key: a
|
|
2056
2049
|
}, t.attr), $a(t.child)));
|
|
2057
2050
|
}
|
|
2058
2051
|
function Ce(s) {
|
|
2059
|
-
return (t) => /* @__PURE__ */
|
|
2052
|
+
return (t) => /* @__PURE__ */ ze.createElement(vl, ds({
|
|
2060
2053
|
attr: us({}, s.attr)
|
|
2061
2054
|
}, t), $a(s.child));
|
|
2062
2055
|
}
|
|
@@ -2065,23 +2058,23 @@ function vl(s) {
|
|
|
2065
2058
|
var {
|
|
2066
2059
|
attr: n,
|
|
2067
2060
|
size: l,
|
|
2068
|
-
title:
|
|
2069
|
-
} = s, r = fl(s, pl), c = l || a.size || "1em",
|
|
2070
|
-
return a.className && (
|
|
2061
|
+
title: o
|
|
2062
|
+
} = s, r = fl(s, pl), c = l || a.size || "1em", i;
|
|
2063
|
+
return a.className && (i = a.className), s.className && (i = (i ? i + " " : "") + s.className), /* @__PURE__ */ ze.createElement("svg", ds({
|
|
2071
2064
|
stroke: "currentColor",
|
|
2072
2065
|
fill: "currentColor",
|
|
2073
2066
|
strokeWidth: "0"
|
|
2074
2067
|
}, a.attr, n, r, {
|
|
2075
|
-
className:
|
|
2068
|
+
className: i,
|
|
2076
2069
|
style: us(us({
|
|
2077
2070
|
color: s.color || a.color
|
|
2078
2071
|
}, a.style), s.style),
|
|
2079
2072
|
height: c,
|
|
2080
2073
|
width: c,
|
|
2081
2074
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2082
|
-
}),
|
|
2075
|
+
}), o && /* @__PURE__ */ ze.createElement("title", null, o), s.children);
|
|
2083
2076
|
};
|
|
2084
|
-
return na !== void 0 ? /* @__PURE__ */
|
|
2077
|
+
return na !== void 0 ? /* @__PURE__ */ ze.createElement(na.Consumer, null, (a) => t(a)) : t(Ha);
|
|
2085
2078
|
}
|
|
2086
2079
|
function Cl(s) {
|
|
2087
2080
|
return Ce({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
@@ -2090,10 +2083,10 @@ function Nl() {
|
|
|
2090
2083
|
const [s, t] = R({
|
|
2091
2084
|
queryKey: [],
|
|
2092
2085
|
queryData: null
|
|
2093
|
-
}), { theme: a } = Ct(), n = Nt(), l = Xe(),
|
|
2094
|
-
|
|
2095
|
-
const C = u((b) => b.card), M =
|
|
2096
|
-
|
|
2086
|
+
}), { theme: a } = Ct(), n = Nt(), l = Xe(), o = Xe(), [r, c] = R(!1), [i, x] = R(!1), [d, y] = R(!1), [f, m] = R(""), [g, j] = R(!1), T = z((b) => b.selectedSheetId);
|
|
2087
|
+
z((b) => b.dashboard.baseQueries);
|
|
2088
|
+
const C = u((b) => b.card), M = z((b) => b.theme), I = u((b) => b.isShowingVisual);
|
|
2089
|
+
z((b) => b.onAcceptChanges);
|
|
2097
2090
|
const V = u(
|
|
2098
2091
|
(b) => b.selectedConnectionId
|
|
2099
2092
|
), N = u(
|
|
@@ -2103,10 +2096,10 @@ function Nl() {
|
|
|
2103
2096
|
), L = u(
|
|
2104
2097
|
(b) => b.selectedSchemaName
|
|
2105
2098
|
);
|
|
2106
|
-
|
|
2099
|
+
z(
|
|
2107
2100
|
(b) => b.actions.updateFrameCard
|
|
2108
2101
|
);
|
|
2109
|
-
const h = u((b) => b.selectedTableName), v = u((b) => b.card.sql), p = u((b) => b.card.python),
|
|
2102
|
+
const h = u((b) => b.selectedTableName), v = u((b) => b.card.sql), p = u((b) => b.card.python), O = u((b) => b.frame), E = z((b) => b.dashboard.filters), $ = z((b) => b.filterValues), B = E == null ? void 0 : E.filter(
|
|
2110
2103
|
(b) => b.sheetId === T || !b.sheetId
|
|
2111
2104
|
), Y = $ == null ? void 0 : $.filter(
|
|
2112
2105
|
(b) => (B == null ? void 0 : B.some((te) => te.id === b.filterId)) || b.filterId.endsWith(T)
|
|
@@ -2173,7 +2166,7 @@ function Nl() {
|
|
|
2173
2166
|
}), n.setQueryData($e, null), _(""), Le({}), J(""), P({});
|
|
2174
2167
|
}
|
|
2175
2168
|
const Pe = (b) => {
|
|
2176
|
-
|
|
2169
|
+
o.current = b;
|
|
2177
2170
|
};
|
|
2178
2171
|
function ss(b, te) {
|
|
2179
2172
|
if (b.length === 0)
|
|
@@ -2208,12 +2201,12 @@ function Nl() {
|
|
|
2208
2201
|
type: I ? C.type : "table",
|
|
2209
2202
|
sql: b,
|
|
2210
2203
|
customCfg: I ? C.customCfg : null
|
|
2211
|
-
}, Ie =
|
|
2204
|
+
}, Ie = O.cards.map(
|
|
2212
2205
|
(Cs) => Cs.id === C.id ? te : Cs
|
|
2213
2206
|
), oe = {
|
|
2214
|
-
...
|
|
2207
|
+
...O,
|
|
2215
2208
|
cards: Ie,
|
|
2216
|
-
activeCardId: ss(Ie,
|
|
2209
|
+
activeCardId: ss(Ie, O.activeCardId)
|
|
2217
2210
|
};
|
|
2218
2211
|
X == null || X(oe);
|
|
2219
2212
|
}
|
|
@@ -2222,7 +2215,7 @@ function Nl() {
|
|
|
2222
2215
|
b && te && n.setQueryData(b, te), Ne == null || Ne();
|
|
2223
2216
|
}
|
|
2224
2217
|
Z(() => {
|
|
2225
|
-
const b = l.current, te =
|
|
2218
|
+
const b = l.current, te = o.current;
|
|
2226
2219
|
if (b) {
|
|
2227
2220
|
const Ie = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe = M === "system" ? Ie : M;
|
|
2228
2221
|
b.editor.defineTheme("default", {
|
|
@@ -2249,7 +2242,7 @@ function Nl() {
|
|
|
2249
2242
|
}
|
|
2250
2243
|
function S() {
|
|
2251
2244
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2252
|
-
|
|
2245
|
+
i && /* @__PURE__ */ e.jsx(
|
|
2253
2246
|
"div",
|
|
2254
2247
|
{
|
|
2255
2248
|
className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
|
|
@@ -2265,7 +2258,7 @@ function Nl() {
|
|
|
2265
2258
|
}
|
|
2266
2259
|
),
|
|
2267
2260
|
/* @__PURE__ */ e.jsx(hl, {}),
|
|
2268
|
-
Y &&
|
|
2261
|
+
Y && i && /* @__PURE__ */ e.jsx(
|
|
2269
2262
|
Je,
|
|
2270
2263
|
{
|
|
2271
2264
|
onClick: () => x(!1),
|
|
@@ -2307,7 +2300,7 @@ function Nl() {
|
|
|
2307
2300
|
] })
|
|
2308
2301
|
}
|
|
2309
2302
|
),
|
|
2310
|
-
Y && !
|
|
2303
|
+
Y && !i && /* @__PURE__ */ e.jsx(
|
|
2311
2304
|
ha,
|
|
2312
2305
|
{
|
|
2313
2306
|
onClick: () => x(!0),
|
|
@@ -2375,7 +2368,7 @@ function Nl() {
|
|
|
2375
2368
|
}
|
|
2376
2369
|
),
|
|
2377
2370
|
r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2378
|
-
/* @__PURE__ */ e.jsx(
|
|
2371
|
+
/* @__PURE__ */ e.jsx(Os, { withHandle: !0, className: "border" }),
|
|
2379
2372
|
/* @__PURE__ */ e.jsxs(
|
|
2380
2373
|
Ve,
|
|
2381
2374
|
{
|
|
@@ -2551,24 +2544,24 @@ function Nl() {
|
|
|
2551
2544
|
}
|
|
2552
2545
|
function Sl({ data: s }) {
|
|
2553
2546
|
var r;
|
|
2554
|
-
const [t, a] =
|
|
2547
|
+
const [t, a] = ze.useState([]), l = Object.keys(s[0]).map((c) => ({
|
|
2555
2548
|
// header: key,
|
|
2556
2549
|
accessorKey: c,
|
|
2557
|
-
header: ({ column:
|
|
2558
|
-
const x =
|
|
2550
|
+
header: ({ column: i }) => {
|
|
2551
|
+
const x = i.getIsSorted();
|
|
2559
2552
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2560
2553
|
"div",
|
|
2561
2554
|
{
|
|
2562
2555
|
className: "flex cursor-pointer items-center",
|
|
2563
|
-
onClick: () =>
|
|
2556
|
+
onClick: () => i.toggleSorting(i.getIsSorted() === "asc"),
|
|
2564
2557
|
children: [
|
|
2565
2558
|
c,
|
|
2566
|
-
x === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2559
|
+
x === "asc" ? /* @__PURE__ */ e.jsx(Ot, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(zt, { className: "ml-2 h-5 w-5" }) : null
|
|
2567
2560
|
]
|
|
2568
2561
|
}
|
|
2569
2562
|
) });
|
|
2570
2563
|
}
|
|
2571
|
-
})),
|
|
2564
|
+
})), o = Ft({
|
|
2572
2565
|
data: s,
|
|
2573
2566
|
columns: l,
|
|
2574
2567
|
getCoreRowModel: Lt(),
|
|
@@ -2581,16 +2574,16 @@ function Sl({ data: s }) {
|
|
|
2581
2574
|
}
|
|
2582
2575
|
});
|
|
2583
2576
|
return /* @__PURE__ */ e.jsxs(It, { children: [
|
|
2584
|
-
/* @__PURE__ */ e.jsx(Tt, { children:
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
) },
|
|
2588
|
-
/* @__PURE__ */ e.jsx(Mt, { children: (r =
|
|
2577
|
+
/* @__PURE__ */ e.jsx(Tt, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(Ns, { children: c.headers.map((i) => /* @__PURE__ */ e.jsx(Dt, { className: "sticky top-0 bg-muted", children: i.isPlaceholder ? null : Zs(
|
|
2578
|
+
i.column.columnDef.header,
|
|
2579
|
+
i.getContext()
|
|
2580
|
+
) }, i.id)) }, c.id)) }),
|
|
2581
|
+
/* @__PURE__ */ e.jsx(Mt, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
|
|
2589
2582
|
Ns,
|
|
2590
2583
|
{
|
|
2591
2584
|
className: "whitespace-nowrap py-2",
|
|
2592
2585
|
"data-state": c.getIsSelected() && "selected",
|
|
2593
|
-
children: c.getVisibleCells().map((
|
|
2586
|
+
children: c.getVisibleCells().map((i) => /* @__PURE__ */ e.jsx(ea, { children: Zs(i.column.columnDef.cell, i.getContext()) }, i.id))
|
|
2594
2587
|
},
|
|
2595
2588
|
c.id
|
|
2596
2589
|
)) : /* @__PURE__ */ e.jsx(Ns, { children: /* @__PURE__ */ e.jsx(ea, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
@@ -2598,24 +2591,24 @@ function Sl({ data: s }) {
|
|
|
2598
2591
|
}
|
|
2599
2592
|
function wl({ card: s }) {
|
|
2600
2593
|
var f, m, g, j, T, C, M, I, V, N;
|
|
2601
|
-
const { authToken: t } = ve(), a = Vt(t == null ? void 0 : t.accessToken), n =
|
|
2594
|
+
const { authToken: t } = ve(), a = Vt(t == null ? void 0 : t.accessToken), n = z((w) => w.themeStyle), l = {
|
|
2602
2595
|
colors: ((m = (f = n == null ? void 0 : n.chart) == null ? void 0 : f.dataset) == null ? void 0 : m.backgroundColor) || []
|
|
2603
2596
|
};
|
|
2604
2597
|
(g = s.customCardPreferences) != null && g.inputData;
|
|
2605
|
-
const { getCard:
|
|
2598
|
+
const { getCard: o } = va(((j = s.customCardPreferences) == null ? void 0 : j.url) || ""), r = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", c = u((w) => w.frame);
|
|
2606
2599
|
ce();
|
|
2607
|
-
const { data:
|
|
2600
|
+
const { data: i } = qe(s);
|
|
2608
2601
|
if (!((C = s.customCardPreferences) != null && C.componentName))
|
|
2609
2602
|
return null;
|
|
2610
|
-
const x =
|
|
2603
|
+
const x = o(
|
|
2611
2604
|
(M = s.customCardPreferences) == null ? void 0 : M.componentName
|
|
2612
2605
|
), d = (w) => {
|
|
2613
2606
|
console.log("data", w), s.customCardPreferences;
|
|
2614
2607
|
}, y = Object.keys(
|
|
2615
2608
|
((I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) || {}
|
|
2616
2609
|
).map((w) => {
|
|
2617
|
-
var v, p,
|
|
2618
|
-
const L = (p = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : p[w].cardId, h = (
|
|
2610
|
+
var v, p, O;
|
|
2611
|
+
const L = (p = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : p[w].cardId, h = (O = c == null ? void 0 : c.cards) == null ? void 0 : O.find((E) => E.id === L);
|
|
2619
2612
|
return h || null;
|
|
2620
2613
|
});
|
|
2621
2614
|
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(
|
|
@@ -2630,7 +2623,7 @@ function wl({ card: s }) {
|
|
|
2630
2623
|
theme: l,
|
|
2631
2624
|
settings: (V = s.customCardPreferences) == null ? void 0 : V.settings,
|
|
2632
2625
|
onDataChange: d,
|
|
2633
|
-
data: (
|
|
2626
|
+
data: (i == null ? void 0 : i.records) || []
|
|
2634
2627
|
}
|
|
2635
2628
|
),
|
|
2636
2629
|
x && r === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
@@ -2659,14 +2652,13 @@ function Pa({
|
|
|
2659
2652
|
...t
|
|
2660
2653
|
}) {
|
|
2661
2654
|
var m, g;
|
|
2662
|
-
const a = u((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = u((j) => j.frame),
|
|
2655
|
+
const a = u((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = u((j) => j.frame), o = z((j) => j.dashboard.filters);
|
|
2663
2656
|
u((j) => j.actions.setRunSql);
|
|
2664
|
-
const { updateFilter: r } = Is(), c =
|
|
2665
|
-
if (!a.id)
|
|
2666
|
-
return null;
|
|
2657
|
+
const { updateFilter: r } = Is(), c = o == null ? void 0 : o.find((j) => j.id === l.filterId), { data: i } = qe(a), { setCard: x } = ce(), { data: d } = Bs(a);
|
|
2658
|
+
if (!a.id) return null;
|
|
2667
2659
|
let y;
|
|
2668
|
-
|
|
2669
|
-
data:
|
|
2660
|
+
i != null && i.records && (i == null ? void 0 : i.records.length) > 0 && (y = Ca({
|
|
2661
|
+
data: i == null ? void 0 : i.records,
|
|
2670
2662
|
cardType: a.type,
|
|
2671
2663
|
cfg: a.cfg,
|
|
2672
2664
|
customCfg: a.customCfg,
|
|
@@ -2727,15 +2719,15 @@ function Pa({
|
|
|
2727
2719
|
},
|
|
2728
2720
|
JSON.stringify(y) + JSON.stringify(a.preferences) + ((g = a == null ? void 0 : a.preferences) == null ? void 0 : g.customVisualCode)
|
|
2729
2721
|
),
|
|
2730
|
-
a.type === "table" && (
|
|
2731
|
-
/* @__PURE__ */ e.jsx(Ut, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Gt, { card: a, data:
|
|
2722
|
+
a.type === "table" && (i == null ? void 0 : i.records) && (i == null ? void 0 : i.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2723
|
+
/* @__PURE__ */ e.jsx(Ut, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Gt, { card: a, data: i == null ? void 0 : i.records }) })
|
|
2732
2724
|
] })
|
|
2733
2725
|
]
|
|
2734
2726
|
}
|
|
2735
2727
|
);
|
|
2736
2728
|
}
|
|
2737
2729
|
function kl() {
|
|
2738
|
-
const [s, t] = R(!1), [a, n] = R(""), [l,
|
|
2730
|
+
const [s, t] = R(!1), [a, n] = R(""), [l, o] = R(""), [r, c] = R(""), [i, x] = R(""), d = u((N) => N.card), y = u(
|
|
2739
2731
|
(N) => N.card.customCfg
|
|
2740
2732
|
), { data: f } = qe(d), { data: m } = Bs(d), { setCardCustomCfg: g, setCustomVisualCode: j } = ce();
|
|
2741
2733
|
function T(N) {
|
|
@@ -2754,8 +2746,7 @@ function kl() {
|
|
|
2754
2746
|
}
|
|
2755
2747
|
function C() {
|
|
2756
2748
|
var w, L;
|
|
2757
|
-
if (!(f != null && f.records) || (f == null ? void 0 : f.records.length) === 0)
|
|
2758
|
-
return;
|
|
2749
|
+
if (!(f != null && f.records) || (f == null ? void 0 : f.records.length) === 0) return;
|
|
2759
2750
|
const N = Ca({
|
|
2760
2751
|
data: f == null ? void 0 : f.records,
|
|
2761
2752
|
cardType: d.type,
|
|
@@ -2763,19 +2754,19 @@ function kl() {
|
|
|
2763
2754
|
preferences: d.preferences,
|
|
2764
2755
|
topoJson: m
|
|
2765
2756
|
});
|
|
2766
|
-
N && (n(JSON.stringify(N, null, 1)), (w = d == null ? void 0 : d.preferences) != null && w.customVisualCode && c((L = d == null ? void 0 : d.preferences) == null ? void 0 : L.customVisualCode), y &&
|
|
2757
|
+
N && (n(JSON.stringify(N, null, 1)), (w = d == null ? void 0 : d.preferences) != null && w.customVisualCode && c((L = d == null ? void 0 : d.preferences) == null ? void 0 : L.customVisualCode), y && o(JSON.stringify(y, null, 1)));
|
|
2767
2758
|
}
|
|
2768
2759
|
function M() {
|
|
2769
2760
|
if (r && j(r), !!l)
|
|
2770
2761
|
try {
|
|
2771
2762
|
const N = JSON.parse(l);
|
|
2772
|
-
return N ? (g(N), x(""),
|
|
2763
|
+
return N ? (g(N), x(""), o(""), N) : void 0;
|
|
2773
2764
|
} catch (N) {
|
|
2774
2765
|
console.log(N), x("Invalid JSON");
|
|
2775
2766
|
}
|
|
2776
2767
|
}
|
|
2777
2768
|
function I() {
|
|
2778
|
-
|
|
2769
|
+
o(""), g(null);
|
|
2779
2770
|
}
|
|
2780
2771
|
function V() {
|
|
2781
2772
|
let N;
|
|
@@ -2880,7 +2871,7 @@ function kl() {
|
|
|
2880
2871
|
},
|
|
2881
2872
|
defaultLanguage: "json",
|
|
2882
2873
|
value: V(),
|
|
2883
|
-
onChange: (N) =>
|
|
2874
|
+
onChange: (N) => o(N)
|
|
2884
2875
|
}
|
|
2885
2876
|
)
|
|
2886
2877
|
}
|
|
@@ -2917,7 +2908,7 @@ function kl() {
|
|
|
2917
2908
|
] })
|
|
2918
2909
|
] }),
|
|
2919
2910
|
/* @__PURE__ */ e.jsxs(oa, { className: "flex items-center", children: [
|
|
2920
|
-
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children:
|
|
2911
|
+
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: i }),
|
|
2921
2912
|
/* @__PURE__ */ e.jsx(
|
|
2922
2913
|
F,
|
|
2923
2914
|
{
|
|
@@ -2939,13 +2930,13 @@ function Ba(s) {
|
|
|
2939
2930
|
return Ce({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2940
2931
|
}
|
|
2941
2932
|
function Ua(s) {
|
|
2942
|
-
return Ce({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "
|
|
2933
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
|
|
2943
2934
|
}
|
|
2944
2935
|
function Ga(s) {
|
|
2945
2936
|
return Ce({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2946
2937
|
}
|
|
2947
2938
|
function Ka(s) {
|
|
2948
|
-
return Ce({ tag: "svg", attr: { viewBox: "0 0 24 24",
|
|
2939
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2949
2940
|
}
|
|
2950
2941
|
function Qa(s) {
|
|
2951
2942
|
return Ce({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
@@ -2963,8 +2954,8 @@ function Xa(s) {
|
|
|
2963
2954
|
const [t, a] = R(null);
|
|
2964
2955
|
return Z(() => {
|
|
2965
2956
|
s && (async () => {
|
|
2966
|
-
const
|
|
2967
|
-
a(
|
|
2957
|
+
const o = (await import("./lucide-react-BmrZWURY.js"))[s];
|
|
2958
|
+
a(o);
|
|
2968
2959
|
})();
|
|
2969
2960
|
}, [s]), t;
|
|
2970
2961
|
}
|
|
@@ -2976,19 +2967,19 @@ function Za() {
|
|
|
2976
2967
|
});
|
|
2977
2968
|
return { data: t, isLoading: a, isFetching: n, isError: l };
|
|
2978
2969
|
}
|
|
2979
|
-
function
|
|
2970
|
+
function Ol({
|
|
2980
2971
|
onChartTypeChange: s
|
|
2981
2972
|
}) {
|
|
2982
2973
|
const [t, a] = R([]), { data: n } = Za();
|
|
2983
2974
|
return Z(() => {
|
|
2984
2975
|
(async () => {
|
|
2985
|
-
var
|
|
2976
|
+
var o;
|
|
2986
2977
|
if (n) {
|
|
2987
2978
|
const c = (await Promise.all(
|
|
2988
|
-
(
|
|
2979
|
+
(o = n == null ? void 0 : n.plugins) == null ? void 0 : o.map(async (i) => (await Jt(i.value)).visuals.map((y) => ({
|
|
2989
2980
|
name: y.name,
|
|
2990
2981
|
icon: y.icon,
|
|
2991
|
-
url:
|
|
2982
|
+
url: i.value
|
|
2992
2983
|
})))
|
|
2993
2984
|
)).flat();
|
|
2994
2985
|
a(c);
|
|
@@ -2996,18 +2987,18 @@ function zl({
|
|
|
2996
2987
|
})();
|
|
2997
2988
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2998
2989
|
/* @__PURE__ */ e.jsx(de, { className: "my-2" }),
|
|
2999
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l,
|
|
3000
|
-
|
|
2990
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, o) => /* @__PURE__ */ e.jsx(
|
|
2991
|
+
zl,
|
|
3001
2992
|
{
|
|
3002
2993
|
text: l.name,
|
|
3003
2994
|
onClick: () => s("custom", l),
|
|
3004
2995
|
icon: l.icon
|
|
3005
2996
|
},
|
|
3006
|
-
l.url + l.name +
|
|
2997
|
+
l.url + l.name + o
|
|
3007
2998
|
)) })
|
|
3008
2999
|
] });
|
|
3009
3000
|
}
|
|
3010
|
-
const
|
|
3001
|
+
const zl = ({
|
|
3011
3002
|
text: s,
|
|
3012
3003
|
icon: t,
|
|
3013
3004
|
onClick: a
|
|
@@ -3017,9 +3008,9 @@ const Ol = ({
|
|
|
3017
3008
|
};
|
|
3018
3009
|
function Fl() {
|
|
3019
3010
|
var d, y;
|
|
3020
|
-
const [s, t] = R(!1), a = u((f) => f.card), n = a.type, { setCardType: l, setCardPreferences:
|
|
3011
|
+
const [s, t] = R(!1), a = u((f) => f.card), n = a.type, { setCardType: l, setCardPreferences: o, setChartOrientation: r } = u((f) => f.actions), { setCardCustomCfg: c, setCustomCardPreferences: i } = ce();
|
|
3021
3012
|
function x(f, m) {
|
|
3022
|
-
c(null),
|
|
3013
|
+
c(null), o({}), l(f), m && i({
|
|
3023
3014
|
type: "component",
|
|
3024
3015
|
visualType: "single",
|
|
3025
3016
|
url: m.url,
|
|
@@ -3183,7 +3174,7 @@ function Fl() {
|
|
|
3183
3174
|
}
|
|
3184
3175
|
)
|
|
3185
3176
|
] }),
|
|
3186
|
-
/* @__PURE__ */ e.jsx(
|
|
3177
|
+
/* @__PURE__ */ e.jsx(Ol, { onChartTypeChange: x })
|
|
3187
3178
|
] })
|
|
3188
3179
|
] });
|
|
3189
3180
|
}
|
|
@@ -3233,10 +3224,10 @@ function Il({
|
|
|
3233
3224
|
}
|
|
3234
3225
|
function Tl() {
|
|
3235
3226
|
var l;
|
|
3236
|
-
const s = u((
|
|
3227
|
+
const s = u((o) => o.card), t = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = ce(), n = (o) => {
|
|
3237
3228
|
s.customCardPreferences && a({
|
|
3238
3229
|
...s.customCardPreferences,
|
|
3239
|
-
showCardHeader:
|
|
3230
|
+
showCardHeader: o === !0
|
|
3240
3231
|
});
|
|
3241
3232
|
};
|
|
3242
3233
|
return /* @__PURE__ */ e.jsxs(ca, { children: [
|
|
@@ -3267,11 +3258,10 @@ function Tl() {
|
|
|
3267
3258
|
] });
|
|
3268
3259
|
}
|
|
3269
3260
|
function ra() {
|
|
3270
|
-
const s = u((h) => h.frame), t = u((h) => h.card), a = u((h) => h.isShowingVisual), n = u((h) => h.isSqlRunning), l = u((h) => h.queryError),
|
|
3261
|
+
const s = u((h) => h.frame), t = u((h) => h.card), a = u((h) => h.isShowingVisual), n = u((h) => h.isSqlRunning), l = u((h) => h.queryError), o = u((h) => h.pythonStdOut), r = u((h) => h.actions.setRunSql);
|
|
3271
3262
|
u((h) => h.onSave), u((h) => h.onClose), u((h) => h.actions.setCardSql), u((h) => h.actions.setCardType), u((h) => h.actions.setSqlGen);
|
|
3272
|
-
const { setFrame: c, setCard:
|
|
3273
|
-
if (!t)
|
|
3274
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3263
|
+
const { setFrame: c, setCard: i, updateCardInFrame: x } = ce(), { data: d, isLoading: y, isFetching: f } = qe(t);
|
|
3264
|
+
if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3275
3265
|
function m() {
|
|
3276
3266
|
const h = {
|
|
3277
3267
|
connectionId: t.connectionId,
|
|
@@ -3298,7 +3288,7 @@ function ra() {
|
|
|
3298
3288
|
cards: [...s.cards, h],
|
|
3299
3289
|
activeCardId: h.id
|
|
3300
3290
|
};
|
|
3301
|
-
c(v),
|
|
3291
|
+
c(v), i(h);
|
|
3302
3292
|
}
|
|
3303
3293
|
function j() {
|
|
3304
3294
|
const h = {
|
|
@@ -3310,23 +3300,23 @@ function ra() {
|
|
|
3310
3300
|
g(h);
|
|
3311
3301
|
}
|
|
3312
3302
|
function T(h) {
|
|
3313
|
-
const v = s.cards.filter((E) => E.id !== h), p = v[0],
|
|
3303
|
+
const v = s.cards.filter((E) => E.id !== h), p = v[0], O = {
|
|
3314
3304
|
...s,
|
|
3315
3305
|
cards: v,
|
|
3316
3306
|
// update the active card to the first card in the frame
|
|
3317
3307
|
activeCardId: p.id
|
|
3318
3308
|
};
|
|
3319
|
-
c(
|
|
3309
|
+
c(O), i(p);
|
|
3320
3310
|
}
|
|
3321
3311
|
function C(h) {
|
|
3322
3312
|
const v = {
|
|
3323
3313
|
...s,
|
|
3324
|
-
cards: s.cards.map((
|
|
3314
|
+
cards: s.cards.map((O) => O.id === t.id ? t : O),
|
|
3325
3315
|
activeCardId: h
|
|
3326
3316
|
};
|
|
3327
3317
|
c(v);
|
|
3328
|
-
const p = v.cards.find((
|
|
3329
|
-
p.sql && r(!0),
|
|
3318
|
+
const p = v.cards.find((O) => O.id === h);
|
|
3319
|
+
p.sql && r(!0), i(p);
|
|
3330
3320
|
}
|
|
3331
3321
|
const M = (h, v) => {
|
|
3332
3322
|
console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
|
|
@@ -3334,10 +3324,9 @@ function ra() {
|
|
|
3334
3324
|
h.preventDefault();
|
|
3335
3325
|
}, V = (h, v) => {
|
|
3336
3326
|
const p = h.dataTransfer.getData("tabIndex");
|
|
3337
|
-
if (p === v.toString())
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
z.splice(v, 0, E), c({ ...s, cards: z });
|
|
3327
|
+
if (p === v.toString()) return;
|
|
3328
|
+
const O = Array.from(s.cards), [E] = O.splice(parseInt(p), 1);
|
|
3329
|
+
O.splice(v, 0, E), c({ ...s, cards: O });
|
|
3341
3330
|
};
|
|
3342
3331
|
function N(h, v) {
|
|
3343
3332
|
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(
|
|
@@ -3345,7 +3334,7 @@ function ra() {
|
|
|
3345
3334
|
{
|
|
3346
3335
|
onClick: () => {
|
|
3347
3336
|
const p = v.displayTab === void 0 ? !1 : !v.displayTab;
|
|
3348
|
-
|
|
3337
|
+
i({ ...v, displayTab: p }), x({
|
|
3349
3338
|
...v,
|
|
3350
3339
|
displayTab: p
|
|
3351
3340
|
});
|
|
@@ -3369,7 +3358,7 @@ function ra() {
|
|
|
3369
3358
|
{
|
|
3370
3359
|
text: h.tabTitle || h.title,
|
|
3371
3360
|
onSave: (p) => {
|
|
3372
|
-
|
|
3361
|
+
i({ ...t, tabTitle: p }), x({ ...t, tabTitle: p });
|
|
3373
3362
|
},
|
|
3374
3363
|
children: /* @__PURE__ */ e.jsxs(
|
|
3375
3364
|
is,
|
|
@@ -3384,7 +3373,7 @@ function ra() {
|
|
|
3384
3373
|
N(s, h),
|
|
3385
3374
|
h.tabTitle || h.title,
|
|
3386
3375
|
s.activeCardId === h.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
|
|
3387
|
-
|
|
3376
|
+
Oa,
|
|
3388
3377
|
{
|
|
3389
3378
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3390
3379
|
onClick: () => T(h.id)
|
|
@@ -3440,7 +3429,7 @@ function ra() {
|
|
|
3440
3429
|
/* @__PURE__ */ e.jsx(Ml, {})
|
|
3441
3430
|
] }),
|
|
3442
3431
|
a ? w() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
3443
|
-
|
|
3432
|
+
o && /* @__PURE__ */ e.jsx(Dl, {}),
|
|
3444
3433
|
(d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(Sl, { data: (d == null ? void 0 : d.records) || [] }),
|
|
3445
3434
|
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
|
|
3446
3435
|
] })
|
|
@@ -3448,8 +3437,7 @@ function ra() {
|
|
|
3448
3437
|
}
|
|
3449
3438
|
function Dl() {
|
|
3450
3439
|
const s = u((a) => a.pythonStdOut);
|
|
3451
|
-
if (!s)
|
|
3452
|
-
return null;
|
|
3440
|
+
if (!s) return null;
|
|
3453
3441
|
const t = s.replace(/\n/g, "<br>");
|
|
3454
3442
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3455
3443
|
/* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: "Output:" }),
|
|
@@ -3514,9 +3502,9 @@ function pe({
|
|
|
3514
3502
|
children: /* @__PURE__ */ e.jsx(je, { placeholder: s })
|
|
3515
3503
|
}
|
|
3516
3504
|
),
|
|
3517
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
3505
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
3518
3506
|
/* @__PURE__ */ e.jsx(ye, { children: s }),
|
|
3519
|
-
t.map((
|
|
3507
|
+
t.map((o) => /* @__PURE__ */ e.jsx(Q, { value: o.value, children: o.label }, o.value))
|
|
3520
3508
|
] }) })
|
|
3521
3509
|
] });
|
|
3522
3510
|
}
|
|
@@ -3545,14 +3533,13 @@ function El() {
|
|
|
3545
3533
|
var j, T;
|
|
3546
3534
|
const s = u(
|
|
3547
3535
|
(C) => C.card.customCardPreferences
|
|
3548
|
-
), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = u((C) => C.card), l = u((C) => C.frame),
|
|
3536
|
+
), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = u((C) => C.card), l = u((C) => C.frame), o = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = ce(), { components: c, manifest: i } = va(
|
|
3549
3537
|
(s == null ? void 0 : s.url) || ""
|
|
3550
|
-
), x = (j =
|
|
3538
|
+
), x = (j = i == null ? void 0 : i.visuals) == null ? void 0 : j.find(
|
|
3551
3539
|
(C) => C.name === (s == null ? void 0 : s.componentName)
|
|
3552
3540
|
);
|
|
3553
3541
|
function d(C, M) {
|
|
3554
|
-
if (!s)
|
|
3555
|
-
return;
|
|
3542
|
+
if (!s) return;
|
|
3556
3543
|
const V = {
|
|
3557
3544
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3558
3545
|
[C]: {
|
|
@@ -3679,7 +3666,7 @@ function El() {
|
|
|
3679
3666
|
{ value: "single", label: "Single Visual" },
|
|
3680
3667
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3681
3668
|
],
|
|
3682
|
-
value:
|
|
3669
|
+
value: o,
|
|
3683
3670
|
onValueChange: g
|
|
3684
3671
|
}
|
|
3685
3672
|
),
|
|
@@ -3691,7 +3678,7 @@ function El() {
|
|
|
3691
3678
|
className: "h-8 w-full",
|
|
3692
3679
|
label: "",
|
|
3693
3680
|
options: (c == null ? void 0 : c.filter(
|
|
3694
|
-
(C) => C.type ===
|
|
3681
|
+
(C) => C.type === o
|
|
3695
3682
|
).map((C) => ({
|
|
3696
3683
|
value: C.name,
|
|
3697
3684
|
label: C.name
|
|
@@ -3724,7 +3711,7 @@ function Me() {
|
|
|
3724
3711
|
u(
|
|
3725
3712
|
(d) => d.card.cfg
|
|
3726
3713
|
);
|
|
3727
|
-
const a = u((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences:
|
|
3714
|
+
const a = u((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: o } = u((d) => d.actions), r = u(
|
|
3728
3715
|
(d) => d.queryResultColumns
|
|
3729
3716
|
);
|
|
3730
3717
|
u(
|
|
@@ -3737,7 +3724,7 @@ function Me() {
|
|
|
3737
3724
|
}, [r]);
|
|
3738
3725
|
function c(d, y) {
|
|
3739
3726
|
var f, m;
|
|
3740
|
-
y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ?
|
|
3727
|
+
y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? o({
|
|
3741
3728
|
...a,
|
|
3742
3729
|
onClickFilter: [
|
|
3743
3730
|
...a.onClickFilter,
|
|
@@ -3746,7 +3733,7 @@ function Me() {
|
|
|
3746
3733
|
expression: ""
|
|
3747
3734
|
}
|
|
3748
3735
|
]
|
|
3749
|
-
}) :
|
|
3736
|
+
}) : o({
|
|
3750
3737
|
...a,
|
|
3751
3738
|
onClickFilter: [
|
|
3752
3739
|
{
|
|
@@ -3754,7 +3741,7 @@ function Me() {
|
|
|
3754
3741
|
expression: ""
|
|
3755
3742
|
}
|
|
3756
3743
|
]
|
|
3757
|
-
}) : (
|
|
3744
|
+
}) : (o({
|
|
3758
3745
|
...a,
|
|
3759
3746
|
onClickFilter: (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.filter(
|
|
3760
3747
|
(g) => g.columnIndex !== d
|
|
@@ -3764,13 +3751,13 @@ function Me() {
|
|
|
3764
3751
|
return j[d] = !1, j;
|
|
3765
3752
|
}));
|
|
3766
3753
|
}
|
|
3767
|
-
function
|
|
3754
|
+
function i(d, y) {
|
|
3768
3755
|
var m;
|
|
3769
3756
|
const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === d ? {
|
|
3770
3757
|
...g,
|
|
3771
3758
|
expression: y.target.value
|
|
3772
3759
|
} : g);
|
|
3773
|
-
|
|
3760
|
+
o({
|
|
3774
3761
|
...a,
|
|
3775
3762
|
onClickFilter: f
|
|
3776
3763
|
});
|
|
@@ -3782,7 +3769,7 @@ function Me() {
|
|
|
3782
3769
|
re,
|
|
3783
3770
|
{
|
|
3784
3771
|
value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((j) => j.columnIndex === d)) == null ? void 0 : g.expression,
|
|
3785
|
-
onChange: (j) =>
|
|
3772
|
+
onChange: (j) => i(d, j),
|
|
3786
3773
|
type: "text",
|
|
3787
3774
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3788
3775
|
placeholder: "Expression"
|
|
@@ -3839,19 +3826,19 @@ function Me() {
|
|
|
3839
3826
|
] });
|
|
3840
3827
|
}
|
|
3841
3828
|
function ys() {
|
|
3842
|
-
var r, c,
|
|
3829
|
+
var r, c, i;
|
|
3843
3830
|
const s = u((x) => x.card.preferences), t = u(
|
|
3844
3831
|
(x) => x.card.cfg
|
|
3845
3832
|
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = u((x) => x.actions);
|
|
3846
3833
|
(r = t == null ? void 0 : t.options) != null && r.indexAxis;
|
|
3847
|
-
function
|
|
3834
|
+
function o(x) {
|
|
3848
3835
|
l(x);
|
|
3849
3836
|
}
|
|
3850
3837
|
return /* @__PURE__ */ e.jsxs(
|
|
3851
3838
|
bs,
|
|
3852
3839
|
{
|
|
3853
|
-
value: ((c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis) || ((
|
|
3854
|
-
onValueChange:
|
|
3840
|
+
value: ((c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis) || ((i = t == null ? void 0 : t.options) == null ? void 0 : i.indexAxis) || "x",
|
|
3841
|
+
onValueChange: o,
|
|
3855
3842
|
className: "flex gap-3",
|
|
3856
3843
|
defaultValue: "x",
|
|
3857
3844
|
children: [
|
|
@@ -3869,9 +3856,9 @@ function ys() {
|
|
|
3869
3856
|
}
|
|
3870
3857
|
const ns = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3871
3858
|
function ia(s, t) {
|
|
3872
|
-
var n, l,
|
|
3873
|
-
const a =
|
|
3874
|
-
return ((
|
|
3859
|
+
var n, l, o;
|
|
3860
|
+
const a = za(s, t);
|
|
3861
|
+
return ((o = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : o.type) || "linear";
|
|
3875
3862
|
}
|
|
3876
3863
|
function et() {
|
|
3877
3864
|
var le, J, ne, k, _, ee;
|
|
@@ -3881,9 +3868,9 @@ function et() {
|
|
|
3881
3868
|
}), n = u((A) => {
|
|
3882
3869
|
var D;
|
|
3883
3870
|
return (D = A.card) == null ? void 0 : D.cfg;
|
|
3884
|
-
}), l =
|
|
3871
|
+
}), l = za(a, n), [o, r] = R(
|
|
3885
3872
|
ia(a)
|
|
3886
|
-
), [c,
|
|
3873
|
+
), [c, i] = R(
|
|
3887
3874
|
((ne = (J = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : J[l]) == null ? void 0 : ne.min) || ""
|
|
3888
3875
|
), [x, d] = R(
|
|
3889
3876
|
((ee = (_ = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
|
|
@@ -3892,10 +3879,10 @@ function et() {
|
|
|
3892
3879
|
), { updateCardInFrame: h } = ce(), v = u((A) => A.card), p = u((A) => {
|
|
3893
3880
|
var D;
|
|
3894
3881
|
return (D = A.card) == null ? void 0 : D.type;
|
|
3895
|
-
}),
|
|
3882
|
+
}), O = ["pie", "doughnut", "polarArea"].includes(p);
|
|
3896
3883
|
Z(() => {
|
|
3897
3884
|
var A, D, se, P, X, ie, Ne, Le, Se, Fe, we, ae, ue, he;
|
|
3898
|
-
r(ia(a)),
|
|
3885
|
+
r(ia(a)), i(
|
|
3899
3886
|
((se = (D = (A = a == null ? void 0 : a.chartOptions) == null ? void 0 : A.scales) == null ? void 0 : D[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
|
|
3900
3887
|
), d(((ie = (X = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : X[l]) == null ? void 0 : ie.max) || ""), g(
|
|
3901
3888
|
((Fe = (Se = (Le = (Ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ne.scales) == null ? void 0 : Le[l]) == null ? void 0 : Se.ticks) == null ? void 0 : Fe.stepSize) || ""
|
|
@@ -3932,7 +3919,7 @@ function et() {
|
|
|
3932
3919
|
onValueChange: (D) => V(D === "none" ? "" : D),
|
|
3933
3920
|
children: [
|
|
3934
3921
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
3935
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
3922
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
3936
3923
|
/* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
|
|
3937
3924
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
|
|
3938
3925
|
A.map((D) => /* @__PURE__ */ e.jsx(Q, { value: D, children: D }, D))
|
|
@@ -3948,7 +3935,7 @@ function et() {
|
|
|
3948
3935
|
children: /* @__PURE__ */ e.jsx(je, {})
|
|
3949
3936
|
}
|
|
3950
3937
|
),
|
|
3951
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
3938
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
3952
3939
|
/* @__PURE__ */ e.jsx(ye, { children: "Locale" }),
|
|
3953
3940
|
cs.map((D) => /* @__PURE__ */ e.jsx(Q, { value: D.locale, children: D.locale }, D.locale))
|
|
3954
3941
|
] }) })
|
|
@@ -3977,7 +3964,7 @@ function et() {
|
|
|
3977
3964
|
{
|
|
3978
3965
|
id: "min",
|
|
3979
3966
|
value: c,
|
|
3980
|
-
onChange: (A) =>
|
|
3967
|
+
onChange: (A) => i((D) => E(D, A.target.value)),
|
|
3981
3968
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
3982
3969
|
}
|
|
3983
3970
|
),
|
|
@@ -4023,8 +4010,8 @@ function et() {
|
|
|
4023
4010
|
...(P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales,
|
|
4024
4011
|
[l]: {
|
|
4025
4012
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
4026
|
-
type:
|
|
4027
|
-
...
|
|
4013
|
+
type: o,
|
|
4014
|
+
...o === "linear" ? A : {}
|
|
4028
4015
|
}
|
|
4029
4016
|
}
|
|
4030
4017
|
},
|
|
@@ -4055,12 +4042,12 @@ function et() {
|
|
|
4055
4042
|
/* @__PURE__ */ e.jsxs(
|
|
4056
4043
|
fe,
|
|
4057
4044
|
{
|
|
4058
|
-
disabled:
|
|
4059
|
-
value:
|
|
4045
|
+
disabled: O,
|
|
4046
|
+
value: o,
|
|
4060
4047
|
onValueChange: (A) => r(A),
|
|
4061
4048
|
children: [
|
|
4062
4049
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
4063
|
-
/* @__PURE__ */ e.jsx(be, { id: "type", children: /* @__PURE__ */ e.jsxs(
|
|
4050
|
+
/* @__PURE__ */ e.jsx(be, { id: "type", children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4064
4051
|
/* @__PURE__ */ e.jsx(ye, { children: "Option" }),
|
|
4065
4052
|
/* @__PURE__ */ e.jsx(Q, { value: "linear", children: "Linear" }),
|
|
4066
4053
|
/* @__PURE__ */ e.jsx(Q, { value: "logarithmic", children: "Logarithmic" })
|
|
@@ -4069,12 +4056,12 @@ function et() {
|
|
|
4069
4056
|
}
|
|
4070
4057
|
)
|
|
4071
4058
|
] }),
|
|
4072
|
-
|
|
4059
|
+
o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4073
4060
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
|
|
4074
4061
|
/* @__PURE__ */ e.jsxs(
|
|
4075
4062
|
bs,
|
|
4076
4063
|
{
|
|
4077
|
-
disabled:
|
|
4064
|
+
disabled: O,
|
|
4078
4065
|
id: "scale-option",
|
|
4079
4066
|
value: y,
|
|
4080
4067
|
onValueChange: (A) => f(A),
|
|
@@ -4093,7 +4080,7 @@ function et() {
|
|
|
4093
4080
|
}
|
|
4094
4081
|
)
|
|
4095
4082
|
] }),
|
|
4096
|
-
y === "custom" &&
|
|
4083
|
+
y === "custom" && o == "linear" && B(),
|
|
4097
4084
|
$(),
|
|
4098
4085
|
/* @__PURE__ */ e.jsx(tn, {}),
|
|
4099
4086
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
@@ -4111,26 +4098,26 @@ function et() {
|
|
|
4111
4098
|
}
|
|
4112
4099
|
function Al({ idx: s }) {
|
|
4113
4100
|
var c;
|
|
4114
|
-
const t = u((
|
|
4101
|
+
const t = u((i) => {
|
|
4115
4102
|
var x;
|
|
4116
|
-
return (x =
|
|
4103
|
+
return (x = i.card) == null ? void 0 : x.preferences;
|
|
4117
4104
|
}), a = u(
|
|
4118
|
-
(
|
|
4105
|
+
(i) => {
|
|
4119
4106
|
var x;
|
|
4120
|
-
return (x =
|
|
4107
|
+
return (x = i.card.preferences) == null ? void 0 : x.datasetOptions;
|
|
4121
4108
|
}
|
|
4122
4109
|
), n = u(
|
|
4123
|
-
(
|
|
4124
|
-
), l = (c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis,
|
|
4125
|
-
function r(
|
|
4126
|
-
(
|
|
4110
|
+
(i) => i.actions.setCardPreferences
|
|
4111
|
+
), l = (c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((i) => i.idx === s);
|
|
4112
|
+
function r(i, x) {
|
|
4113
|
+
(i === "end" || i === "start") && nn(ln());
|
|
4127
4114
|
const d = {
|
|
4128
|
-
display:
|
|
4129
|
-
align:
|
|
4130
|
-
anchor:
|
|
4115
|
+
display: i !== "none",
|
|
4116
|
+
align: i,
|
|
4117
|
+
anchor: i,
|
|
4131
4118
|
clamp: !0
|
|
4132
4119
|
};
|
|
4133
|
-
if (!
|
|
4120
|
+
if (!o)
|
|
4134
4121
|
n({
|
|
4135
4122
|
...t,
|
|
4136
4123
|
datasetOptions: [
|
|
@@ -4142,7 +4129,7 @@ function Al({ idx: s }) {
|
|
|
4142
4129
|
]
|
|
4143
4130
|
});
|
|
4144
4131
|
else {
|
|
4145
|
-
const y = { ...
|
|
4132
|
+
const y = { ...o };
|
|
4146
4133
|
y.datalabels = d;
|
|
4147
4134
|
const f = a == null ? void 0 : a.map(
|
|
4148
4135
|
(m) => m.idx === x ? y : m
|
|
@@ -4163,7 +4150,7 @@ function Al({ idx: s }) {
|
|
|
4163
4150
|
size: "sm",
|
|
4164
4151
|
variant: "secondary",
|
|
4165
4152
|
className: "h-7 p-1 text-xs font-normal",
|
|
4166
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4153
|
+
children: /* @__PURE__ */ e.jsx(Oa, { className: "size-4" })
|
|
4167
4154
|
}
|
|
4168
4155
|
),
|
|
4169
4156
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4227,21 +4214,21 @@ function st() {
|
|
|
4227
4214
|
return (f = (y = (d = x == null ? void 0 : x.card) == null ? void 0 : d.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : f.indexAxis;
|
|
4228
4215
|
}
|
|
4229
4216
|
), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
|
|
4230
|
-
keys:
|
|
4217
|
+
keys: o,
|
|
4231
4218
|
metricKeys: r,
|
|
4232
4219
|
dimensionKeys: c
|
|
4233
4220
|
} = ws((a == null ? void 0 : a.records) || []);
|
|
4234
|
-
let
|
|
4221
|
+
let i = r;
|
|
4235
4222
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4236
4223
|
const x = rn({
|
|
4237
4224
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4238
4225
|
groupKey: c[0],
|
|
4239
4226
|
pivotKey: c[1],
|
|
4240
|
-
valueKey:
|
|
4227
|
+
valueKey: i[0]
|
|
4241
4228
|
}), { metricKeys: d } = ws(x);
|
|
4242
|
-
|
|
4229
|
+
i = d;
|
|
4243
4230
|
}
|
|
4244
|
-
return
|
|
4231
|
+
return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4245
4232
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4246
4233
|
/* @__PURE__ */ e.jsx(H, { children: n }),
|
|
4247
4234
|
/* @__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: c[0] }) }) })
|
|
@@ -4251,23 +4238,23 @@ function st() {
|
|
|
4251
4238
|
/* @__PURE__ */ e.jsx(H, { children: l }),
|
|
4252
4239
|
/* @__PURE__ */ e.jsx(et, {})
|
|
4253
4240
|
] }),
|
|
4254
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
4241
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: i.map((x, d) => /* @__PURE__ */ e.jsx(Vl, { col: x, idx: d }, x)) })
|
|
4255
4242
|
] })
|
|
4256
4243
|
] });
|
|
4257
4244
|
}
|
|
4258
4245
|
function Vl({ col: s, idx: t }) {
|
|
4259
4246
|
const a = u((c) => {
|
|
4260
|
-
var
|
|
4261
|
-
return (
|
|
4247
|
+
var i;
|
|
4248
|
+
return (i = c.card) == null ? void 0 : i.preferences;
|
|
4262
4249
|
}), n = u(
|
|
4263
4250
|
(c) => {
|
|
4264
|
-
var
|
|
4265
|
-
return (
|
|
4251
|
+
var i;
|
|
4252
|
+
return (i = c.card.preferences) == null ? void 0 : i.datasetOptions;
|
|
4266
4253
|
}
|
|
4267
|
-
), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences:
|
|
4254
|
+
), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences: o } = u((c) => c.actions);
|
|
4268
4255
|
function r(c) {
|
|
4269
4256
|
if (!l)
|
|
4270
|
-
|
|
4257
|
+
o({
|
|
4271
4258
|
...a,
|
|
4272
4259
|
datasetOptions: [
|
|
4273
4260
|
...n || [],
|
|
@@ -4279,12 +4266,12 @@ function Vl({ col: s, idx: t }) {
|
|
|
4279
4266
|
]
|
|
4280
4267
|
});
|
|
4281
4268
|
else {
|
|
4282
|
-
const
|
|
4283
|
-
|
|
4269
|
+
const i = { ...l };
|
|
4270
|
+
i.type = c === "area" ? "line" : c, i.fill = c === "area" ? "origin" : "";
|
|
4284
4271
|
const x = n == null ? void 0 : n.map(
|
|
4285
|
-
(d) => d.idx === t ?
|
|
4272
|
+
(d) => d.idx === t ? i : d
|
|
4286
4273
|
);
|
|
4287
|
-
|
|
4274
|
+
o({
|
|
4288
4275
|
...a,
|
|
4289
4276
|
datasetOptions: x
|
|
4290
4277
|
});
|
|
@@ -4308,7 +4295,7 @@ function Vl({ col: s, idx: t }) {
|
|
|
4308
4295
|
}
|
|
4309
4296
|
),
|
|
4310
4297
|
/* @__PURE__ */ e.jsx(
|
|
4311
|
-
|
|
4298
|
+
zn,
|
|
4312
4299
|
{
|
|
4313
4300
|
onClick: () => r("area"),
|
|
4314
4301
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -4326,7 +4313,7 @@ function Vl({ col: s, idx: t }) {
|
|
|
4326
4313
|
] });
|
|
4327
4314
|
}
|
|
4328
4315
|
function at() {
|
|
4329
|
-
const s = u((f) => f.selectedConnectionId), t = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), n = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName),
|
|
4316
|
+
const s = u((f) => f.selectedConnectionId), t = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), n = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName), o = z((f) => f.dashboard.filters) || [], r = z((f) => f.actions.addFilter), c = z((f) => f.actions.removeFilter), i = z(
|
|
4330
4317
|
(f) => f.actions.removeFilterValue
|
|
4331
4318
|
), { modelItems: x, tableName: d } = Re();
|
|
4332
4319
|
function y(f, m = "dashboard") {
|
|
@@ -4340,11 +4327,11 @@ function at() {
|
|
|
4340
4327
|
(L) => L.id === t
|
|
4341
4328
|
)) == null ? void 0 : w.name;
|
|
4342
4329
|
t && t !== "none" && (I = `${Ss}.${V}.${g}`, M = `${Ss}.${V}`);
|
|
4343
|
-
const N =
|
|
4330
|
+
const N = o == null ? void 0 : o.find(
|
|
4344
4331
|
(L) => L.column === I && L.table === C && (L.database === j || L.database === a)
|
|
4345
4332
|
);
|
|
4346
4333
|
if (N)
|
|
4347
|
-
|
|
4334
|
+
i(N.id), c(N.id);
|
|
4348
4335
|
else {
|
|
4349
4336
|
const L = We();
|
|
4350
4337
|
return d === "api" && s ? (r({
|
|
@@ -4389,17 +4376,17 @@ function at() {
|
|
|
4389
4376
|
return { assignFilter: y };
|
|
4390
4377
|
}
|
|
4391
4378
|
function _e() {
|
|
4392
|
-
const s =
|
|
4379
|
+
const s = z(
|
|
4393
4380
|
(c) => c.dashboard.filters
|
|
4394
4381
|
), t = u((c) => c.frame), { setFrame: a } = ce(), { columns: n } = Re(), { assignFilter: l } = at();
|
|
4395
|
-
function
|
|
4396
|
-
const
|
|
4397
|
-
a({ ...t, filterId:
|
|
4382
|
+
function o(c) {
|
|
4383
|
+
const i = l(c, "frame");
|
|
4384
|
+
a({ ...t, filterId: i });
|
|
4398
4385
|
}
|
|
4399
4386
|
const r = s == null ? void 0 : s.find((c) => c.id === t.filterId);
|
|
4400
4387
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4401
4388
|
/* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
|
|
4402
|
-
/* @__PURE__ */ e.jsx(ql, { onSelect:
|
|
4389
|
+
/* @__PURE__ */ e.jsx(ql, { onSelect: o, columns: n }),
|
|
4403
4390
|
r && /* @__PURE__ */ e.jsx(on, { filter: r })
|
|
4404
4391
|
] });
|
|
4405
4392
|
}
|
|
@@ -4408,7 +4395,7 @@ function ql({
|
|
|
4408
4395
|
onSelect: t
|
|
4409
4396
|
}) {
|
|
4410
4397
|
var r;
|
|
4411
|
-
const [a, n] = ta.useState(!1), [l,
|
|
4398
|
+
const [a, n] = ta.useState(!1), [l, o] = ta.useState("");
|
|
4412
4399
|
return /* @__PURE__ */ e.jsxs(fs, { open: a, onOpenChange: n, children: [
|
|
4413
4400
|
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4414
4401
|
F,
|
|
@@ -4432,9 +4419,9 @@ function ql({
|
|
|
4432
4419
|
pn,
|
|
4433
4420
|
{
|
|
4434
4421
|
value: c.column_name,
|
|
4435
|
-
onSelect: (
|
|
4436
|
-
const x =
|
|
4437
|
-
|
|
4422
|
+
onSelect: (i) => {
|
|
4423
|
+
const x = i === l ? "" : i;
|
|
4424
|
+
o(x), n(!1), x && t(c);
|
|
4438
4425
|
},
|
|
4439
4426
|
children: [
|
|
4440
4427
|
c.column_name,
|
|
@@ -4501,13 +4488,13 @@ function Rl({
|
|
|
4501
4488
|
] }) });
|
|
4502
4489
|
}
|
|
4503
4490
|
function Js() {
|
|
4504
|
-
var l,
|
|
4491
|
+
var l, o, r;
|
|
4505
4492
|
const s = u(
|
|
4506
4493
|
(c) => c.card.cfg
|
|
4507
4494
|
), t = u((c) => c.actions.setCardCfg), a = u((c) => c.card.type);
|
|
4508
4495
|
function n(c) {
|
|
4509
4496
|
var d;
|
|
4510
|
-
const
|
|
4497
|
+
const i = {
|
|
4511
4498
|
datalabels: {
|
|
4512
4499
|
display: c !== "none",
|
|
4513
4500
|
align: c,
|
|
@@ -4520,7 +4507,7 @@ function Js() {
|
|
|
4520
4507
|
...s == null ? void 0 : s.options,
|
|
4521
4508
|
plugins: {
|
|
4522
4509
|
...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
|
|
4523
|
-
...
|
|
4510
|
+
...i
|
|
4524
4511
|
}
|
|
4525
4512
|
}
|
|
4526
4513
|
};
|
|
@@ -4534,12 +4521,12 @@ function Js() {
|
|
|
4534
4521
|
/* @__PURE__ */ e.jsxs(
|
|
4535
4522
|
fe,
|
|
4536
4523
|
{
|
|
4537
|
-
value: (r = (
|
|
4524
|
+
value: (r = (o = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : r.anchor,
|
|
4538
4525
|
onValueChange: n,
|
|
4539
4526
|
defaultValue: "none",
|
|
4540
4527
|
children: [
|
|
4541
4528
|
/* @__PURE__ */ e.jsx(ge, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, { placeholder: "Select position" }) }),
|
|
4542
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
4529
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4543
4530
|
/* @__PURE__ */ e.jsx(ye, { children: "Data Labels" }),
|
|
4544
4531
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
|
|
4545
4532
|
a !== "pyramid" && /* @__PURE__ */ e.jsx(Q, { value: "start", children: "Start" }),
|
|
@@ -4555,9 +4542,8 @@ function _l({
|
|
|
4555
4542
|
cardType: s
|
|
4556
4543
|
}) {
|
|
4557
4544
|
function t(a) {
|
|
4558
|
-
const n = "SELECT label, [group], x-axis, y-axis, radius FROM table", l = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
4559
4545
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4560
|
-
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: a === "bubble" ?
|
|
4546
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: a === "bubble" ? "SELECT label, [group], x-axis, y-axis, radius FROM table" : "SELECT label, [group], x-axis, y-axis FROM table" }),
|
|
4561
4547
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4562
4548
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
4563
4549
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
@@ -4571,7 +4557,7 @@ function _l({
|
|
|
4571
4557
|
"a",
|
|
4572
4558
|
{
|
|
4573
4559
|
target: "_blank",
|
|
4574
|
-
onClick: (
|
|
4560
|
+
onClick: (o) => o.stopPropagation(),
|
|
4575
4561
|
className: "text-blue-700",
|
|
4576
4562
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4577
4563
|
children: "example"
|
|
@@ -4740,7 +4726,7 @@ function Bl(s) {
|
|
|
4740
4726
|
] }) });
|
|
4741
4727
|
}
|
|
4742
4728
|
function Ul() {
|
|
4743
|
-
var
|
|
4729
|
+
var i, x, d, y, f;
|
|
4744
4730
|
const s = u((m) => m.card.preferences), t = u(
|
|
4745
4731
|
(m) => m.actions.setCardPreferences
|
|
4746
4732
|
), a = u(
|
|
@@ -4766,7 +4752,7 @@ function Ul() {
|
|
|
4766
4752
|
u(
|
|
4767
4753
|
(m) => m.actions.setFilterOnClickField
|
|
4768
4754
|
);
|
|
4769
|
-
const
|
|
4755
|
+
const o = u(
|
|
4770
4756
|
(m) => {
|
|
4771
4757
|
var g, j;
|
|
4772
4758
|
return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.colorRanges;
|
|
@@ -4779,7 +4765,7 @@ function Ul() {
|
|
|
4779
4765
|
/* @__PURE__ */ e.jsx(
|
|
4780
4766
|
xs,
|
|
4781
4767
|
{
|
|
4782
|
-
checked: !!((
|
|
4768
|
+
checked: !!((i = s == null ? void 0 : s.formatNumber) != null && i.enabled),
|
|
4783
4769
|
onCheckedChange: (m) => {
|
|
4784
4770
|
t({
|
|
4785
4771
|
...s,
|
|
@@ -4813,7 +4799,7 @@ function Ul() {
|
|
|
4813
4799
|
},
|
|
4814
4800
|
children: [
|
|
4815
4801
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
4816
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
4802
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4817
4803
|
/* @__PURE__ */ e.jsx(ye, { children: "Format" }),
|
|
4818
4804
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
4819
4805
|
cs.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m.locale, children: m.locale }, m.locale))
|
|
@@ -4839,7 +4825,7 @@ function Ul() {
|
|
|
4839
4825
|
},
|
|
4840
4826
|
children: [
|
|
4841
4827
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
4842
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
4828
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4843
4829
|
/* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
|
|
4844
4830
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
4845
4831
|
c.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m))
|
|
@@ -4898,7 +4884,7 @@ function Ul() {
|
|
|
4898
4884
|
/* @__PURE__ */ e.jsx(
|
|
4899
4885
|
fn,
|
|
4900
4886
|
{
|
|
4901
|
-
colorRanges:
|
|
4887
|
+
colorRanges: o,
|
|
4902
4888
|
setColorRanges: r
|
|
4903
4889
|
}
|
|
4904
4890
|
)
|
|
@@ -5037,10 +5023,10 @@ const Kl = [
|
|
|
5037
5023
|
value: s
|
|
5038
5024
|
}));
|
|
5039
5025
|
function Wl() {
|
|
5040
|
-
var
|
|
5041
|
-
const s = u((p) => p.card), t = (x = (
|
|
5026
|
+
var i, x, d, y, f, m, g, j, T, C, M, I, V, N, w, L, h, v;
|
|
5027
|
+
const s = u((p) => p.card), t = (x = (i = s == null ? void 0 : s.preferences) == null ? void 0 : i.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, n] = R(
|
|
5042
5028
|
((y = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
|
|
5043
|
-
), { setCardPreferences: l } = ce(), { data:
|
|
5029
|
+
), { setCardPreferences: l } = ce(), { data: o } = Bs(s), r = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
|
|
5044
5030
|
label: p,
|
|
5045
5031
|
value: p
|
|
5046
5032
|
})) || [], c = [
|
|
@@ -5100,7 +5086,7 @@ function Wl() {
|
|
|
5100
5086
|
placeholder: "Custom URL"
|
|
5101
5087
|
}
|
|
5102
5088
|
),
|
|
5103
|
-
|
|
5089
|
+
o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
5104
5090
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
5105
5091
|
/* @__PURE__ */ e.jsx(H, { children: "Map Object" }),
|
|
5106
5092
|
/* @__PURE__ */ e.jsx(
|
|
@@ -5111,11 +5097,11 @@ function Wl() {
|
|
|
5111
5097
|
value: ((m = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : m.objectKey) || "",
|
|
5112
5098
|
label: "Map Object",
|
|
5113
5099
|
onValueChange: (p) => {
|
|
5114
|
-
var
|
|
5100
|
+
var O;
|
|
5115
5101
|
l({
|
|
5116
5102
|
...s.preferences,
|
|
5117
5103
|
mapVisualOptions: {
|
|
5118
|
-
...(
|
|
5104
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5119
5105
|
objectKey: p
|
|
5120
5106
|
}
|
|
5121
5107
|
});
|
|
@@ -5133,11 +5119,11 @@ function Wl() {
|
|
|
5133
5119
|
value: ((j = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : j.projection) || "",
|
|
5134
5120
|
label: "Projection",
|
|
5135
5121
|
onValueChange: (p) => {
|
|
5136
|
-
var
|
|
5122
|
+
var O;
|
|
5137
5123
|
l({
|
|
5138
5124
|
...s.preferences,
|
|
5139
5125
|
mapVisualOptions: {
|
|
5140
|
-
...(
|
|
5126
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5141
5127
|
projection: p
|
|
5142
5128
|
}
|
|
5143
5129
|
});
|
|
@@ -5155,11 +5141,11 @@ function Wl() {
|
|
|
5155
5141
|
value: ((C = (T = s.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
|
|
5156
5142
|
label: "Select Color Scale",
|
|
5157
5143
|
onValueChange: (p) => {
|
|
5158
|
-
var
|
|
5144
|
+
var O;
|
|
5159
5145
|
l({
|
|
5160
5146
|
...s.preferences,
|
|
5161
5147
|
mapVisualOptions: {
|
|
5162
|
-
...(
|
|
5148
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5163
5149
|
colorScale: p
|
|
5164
5150
|
}
|
|
5165
5151
|
});
|
|
@@ -5179,11 +5165,11 @@ function Wl() {
|
|
|
5179
5165
|
step: 0.1,
|
|
5180
5166
|
value: ((I = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
|
|
5181
5167
|
onChange: (p) => {
|
|
5182
|
-
var
|
|
5168
|
+
var O;
|
|
5183
5169
|
l({
|
|
5184
5170
|
...s.preferences,
|
|
5185
5171
|
mapVisualOptions: {
|
|
5186
|
-
...(
|
|
5172
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5187
5173
|
projectionScale: Number(p.target.value)
|
|
5188
5174
|
}
|
|
5189
5175
|
});
|
|
@@ -5199,11 +5185,11 @@ function Wl() {
|
|
|
5199
5185
|
step: 10,
|
|
5200
5186
|
value: ((w = (N = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : w[0]) || 0,
|
|
5201
5187
|
onChange: (p) => {
|
|
5202
|
-
var
|
|
5188
|
+
var O, E, $, B;
|
|
5203
5189
|
l({
|
|
5204
5190
|
...s.preferences,
|
|
5205
5191
|
mapVisualOptions: {
|
|
5206
|
-
...(
|
|
5192
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5207
5193
|
projectionOffset: [
|
|
5208
5194
|
Number(p.target.value),
|
|
5209
5195
|
((B = ($ = (E = s.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : $.projectionOffset) == null ? void 0 : B[1]) || 0
|
|
@@ -5222,11 +5208,11 @@ function Wl() {
|
|
|
5222
5208
|
step: 10,
|
|
5223
5209
|
value: ((v = (h = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5224
5210
|
onChange: (p) => {
|
|
5225
|
-
var
|
|
5211
|
+
var O, E, $, B;
|
|
5226
5212
|
l({
|
|
5227
5213
|
...s.preferences,
|
|
5228
5214
|
mapVisualOptions: {
|
|
5229
|
-
...(
|
|
5215
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5230
5216
|
projectionOffset: [
|
|
5231
5217
|
((B = ($ = (E = s.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : $.projectionOffset) == null ? void 0 : B[0]) || 0,
|
|
5232
5218
|
Number(p.target.value)
|
|
@@ -5323,8 +5309,8 @@ function ls({
|
|
|
5323
5309
|
function Xl() {
|
|
5324
5310
|
const s = u(
|
|
5325
5311
|
(n) => {
|
|
5326
|
-
var l,
|
|
5327
|
-
return (
|
|
5312
|
+
var l, o;
|
|
5313
|
+
return (o = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : o.sortChart;
|
|
5328
5314
|
}
|
|
5329
5315
|
), { setSortChart: t } = ce();
|
|
5330
5316
|
function a() {
|
|
@@ -5545,7 +5531,7 @@ function nr() {
|
|
|
5545
5531
|
children: /* @__PURE__ */ e.jsx(Nl, {})
|
|
5546
5532
|
}
|
|
5547
5533
|
),
|
|
5548
|
-
/* @__PURE__ */ e.jsx(
|
|
5534
|
+
/* @__PURE__ */ e.jsx(Os, { withHandle: !0, className: "border" }),
|
|
5549
5535
|
/* @__PURE__ */ e.jsx(
|
|
5550
5536
|
Ve,
|
|
5551
5537
|
{
|
|
@@ -5564,7 +5550,7 @@ function nr() {
|
|
|
5564
5550
|
children: /* @__PURE__ */ e.jsx(tr, {})
|
|
5565
5551
|
}
|
|
5566
5552
|
) }),
|
|
5567
|
-
/* @__PURE__ */ e.jsx(
|
|
5553
|
+
/* @__PURE__ */ e.jsx(Os, { className: "border" }),
|
|
5568
5554
|
/* @__PURE__ */ e.jsx(Ve, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(ra, {}) })
|
|
5569
5555
|
] }) : /* @__PURE__ */ e.jsx(ra, {})
|
|
5570
5556
|
}
|
|
@@ -5574,13 +5560,13 @@ function nr() {
|
|
|
5574
5560
|
);
|
|
5575
5561
|
}
|
|
5576
5562
|
function lr({ authToken: s, onSave: t, onClose: a }) {
|
|
5577
|
-
|
|
5578
|
-
const n = u((r) => r.actions.setOnSave), l = u((r) => r.actions.setOnClose),
|
|
5563
|
+
z((r) => r.themeStyle);
|
|
5564
|
+
const n = u((r) => r.actions.setOnSave), l = u((r) => r.actions.setOnClose), o = z((r) => r.actions.setAuthToken);
|
|
5579
5565
|
return Z(() => {
|
|
5580
5566
|
t && n(t), a && l(a);
|
|
5581
5567
|
}, [t, n, a, l]), Z(() => {
|
|
5582
|
-
s && s.accessToken &&
|
|
5583
|
-
}, [s,
|
|
5568
|
+
s && s.accessToken && o(s);
|
|
5569
|
+
}, [s, o]), /* @__PURE__ */ e.jsx(ps, { FallbackComponent: Fa, children: /* @__PURE__ */ e.jsxs(
|
|
5584
5570
|
gn,
|
|
5585
5571
|
{
|
|
5586
5572
|
style: {
|
|
@@ -5597,12 +5583,12 @@ function lr({ authToken: s, onSave: t, onClose: a }) {
|
|
|
5597
5583
|
) });
|
|
5598
5584
|
}
|
|
5599
5585
|
function rr() {
|
|
5600
|
-
|
|
5601
|
-
const s =
|
|
5586
|
+
z((r) => r.selectedCardId);
|
|
5587
|
+
const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
|
|
5602
5588
|
function l(r) {
|
|
5603
5589
|
s && (n(s, r), t(!1));
|
|
5604
5590
|
}
|
|
5605
|
-
function
|
|
5591
|
+
function o() {
|
|
5606
5592
|
t(!1);
|
|
5607
5593
|
}
|
|
5608
5594
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -5612,7 +5598,7 @@ function rr() {
|
|
|
5612
5598
|
className: W("flex grow", {
|
|
5613
5599
|
"max-h-0 overflow-hidden": !a
|
|
5614
5600
|
}),
|
|
5615
|
-
children: /* @__PURE__ */ e.jsx(lr, { onSave: l, onClose:
|
|
5601
|
+
children: /* @__PURE__ */ e.jsx(lr, { onSave: l, onClose: o })
|
|
5616
5602
|
}
|
|
5617
5603
|
);
|
|
5618
5604
|
}
|
|
@@ -5620,19 +5606,19 @@ function ir() {
|
|
|
5620
5606
|
u((r) => r.selectedConnectionId), u((r) => r.selectedDatamodelId);
|
|
5621
5607
|
const s = u((r) => r.selectedDatabaseName);
|
|
5622
5608
|
u((r) => r.selectedSchemaName);
|
|
5623
|
-
const t = u((r) => r.selectedTableName), a =
|
|
5624
|
-
|
|
5609
|
+
const t = u((r) => r.selectedTableName), a = z((r) => r.dashboard.filters) || [];
|
|
5610
|
+
z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
|
|
5625
5611
|
(r) => r.actions.removeFilterValue
|
|
5626
5612
|
);
|
|
5627
|
-
const { modelItems: n, columns: l } = Re(), { assignFilter:
|
|
5613
|
+
const { modelItems: n, columns: l } = Re(), { assignFilter: o } = at();
|
|
5628
5614
|
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) => {
|
|
5629
5615
|
const c = a == null ? void 0 : a.find(
|
|
5630
|
-
(
|
|
5616
|
+
(i) => i.column === xe(r.column_name) && i.table === t && i.database === s
|
|
5631
5617
|
);
|
|
5632
5618
|
return /* @__PURE__ */ e.jsx(
|
|
5633
5619
|
"div",
|
|
5634
5620
|
{
|
|
5635
|
-
onClick: () =>
|
|
5621
|
+
onClick: () => o(r),
|
|
5636
5622
|
className: W(
|
|
5637
5623
|
"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",
|
|
5638
5624
|
{
|
|
@@ -5649,8 +5635,8 @@ function ir() {
|
|
|
5649
5635
|
}) });
|
|
5650
5636
|
}
|
|
5651
5637
|
function or() {
|
|
5652
|
-
|
|
5653
|
-
const s =
|
|
5638
|
+
z((t) => t.showFilters);
|
|
5639
|
+
const s = z(
|
|
5654
5640
|
(t) => t.actions.setShowFilters
|
|
5655
5641
|
);
|
|
5656
5642
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
@@ -5681,7 +5667,7 @@ function or() {
|
|
|
5681
5667
|
] });
|
|
5682
5668
|
}
|
|
5683
5669
|
function cr() {
|
|
5684
|
-
const s =
|
|
5670
|
+
const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
|
|
5685
5671
|
return /* @__PURE__ */ e.jsxs(
|
|
5686
5672
|
"div",
|
|
5687
5673
|
{
|
|
@@ -5698,10 +5684,10 @@ function cr() {
|
|
|
5698
5684
|
);
|
|
5699
5685
|
}
|
|
5700
5686
|
function dr() {
|
|
5701
|
-
const s =
|
|
5687
|
+
const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
|
|
5702
5688
|
(n) => n.showDashboardJSON
|
|
5703
5689
|
);
|
|
5704
|
-
return
|
|
5690
|
+
return z(
|
|
5705
5691
|
(n) => n.actions.setShowDashboardJSON
|
|
5706
5692
|
), /* @__PURE__ */ e.jsx(
|
|
5707
5693
|
"div",
|
|
@@ -5760,8 +5746,8 @@ function xr({
|
|
|
5760
5746
|
}
|
|
5761
5747
|
export {
|
|
5762
5748
|
Ue as A,
|
|
5763
|
-
|
|
5764
|
-
|
|
5749
|
+
On as B,
|
|
5750
|
+
zn as C,
|
|
5765
5751
|
xr as D,
|
|
5766
5752
|
Ma as E,
|
|
5767
5753
|
qa as F,
|