react-semaphor 0.0.390 → 0.0.391
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/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as R, p as Ot, u as T, a as Je, b as Te, d as Mt, e as It, B as L, P as We, f as Tt, g as Dt, h as zt, i as aa, L as $, I as he, j as na, k as sa, l as la, m as ia, n as ra, o as oa, q as un, r as Gt, s as se, C as ut, t as hn, v as h, w as mn, x as pn, y as ca, F as da, z as Be, A as nt, T as ua, E as fn, G as ha, S as me, H as pe, J as fe, K as ge, M as ke, N as Ce, O as Q, Q as ma, R as pa, U as fa, V as ga, W as ya, X as ve, Y as gn, Z as yn, _ as ba, $ as bn, a0 as xn, a1 as vn, a2 as xa, a3 as Ie, a4 as Nn, a5 as qe, a6 as st, a7 as vt, a8 as De, a9 as Ve, aa as Oe, ab as Cn, ac as ie, ad as Sn, ae as wn, af as Bt, ag as kn, ah as Ke, ai as On, aj as Mn, ak as In, al as Tn, am as Dn, an as bt, ao as zn, ap as Ln, aq as Le, ar as va, as as Fn, at as ht, au as An, av as En, aw as Vn, ax as Nt, ay as qn, az as jn, aA as lt, aB as we, aC as it, aD as Rn, aE as _n, aF as Hn, aG as Pn, aH as xt, aI as $n, aJ as Ut, aK as Gn, aL as Jt, aM as Bn, aN as Un, aO as Jn, aP as Wn, aQ as Na, aR as Kn, aS as Lt, aT as Ca, aU as Qn, aV as Zn, aW as at, aX as Xn, aY as Yn, aZ as Sa, a_ as es, a$ as ts, b0 as as, b1 as ns, b2 as rt, b3 as ss, b4 as mt, b5 as wa, b6 as ls, b7 as ka, b8 as Oa, b9 as Ct, ba as St, bb as is, bc as rs, bd as os, be as Qe, bf as Ze, bg as Xe, bh as Ma, bi as cs, bj as ds, bk as us, bl as hs, bm as ms, bn as ps, bo as fs, bp as pt, bq as ze, br as gs, bs as Pe, bt as Ft, bu as Ia, bv as ys, bw as bs, bx as ot, by as xs, bz as vs, bA as Ns, bB as Cs, bC as Wt, bD as Kt, bE as Ta, bF as Ss, bG as ws, bH as ks, bI as Os, bJ as Ms, bK as Is, bL as Ts, bM as Ds, bN as Fe, bO as ee, bP as te, bQ as At, bR as ae, bS as zs, bT as Da, bU as Ls, bV as Fs, bW as As, bX as Es, bY as Vs, bZ as qs, b_ as js, b$ as Rs, c0 as _s } from "./chunks/index-
|
|
2
|
-
import { D as Qi, c5 as Zi, c3 as Xi, c3 as Yi, c7 as er, c6 as tr, c8 as ar, c4 as nr, c1 as sr, c2 as lr } from "./chunks/index-
|
|
1
|
+
import { c as R, p as Ot, u as T, a as Je, b as Te, d as Mt, e as It, B as L, P as We, f as Tt, g as Dt, h as zt, i as aa, L as $, I as he, j as na, k as sa, l as la, m as ia, n as ra, o as oa, q as un, r as Gt, s as se, C as ut, t as hn, v as h, w as mn, x as pn, y as ca, F as da, z as Be, A as nt, T as ua, E as fn, G as ha, S as me, H as pe, J as fe, K as ge, M as ke, N as Ce, O as Q, Q as ma, R as pa, U as fa, V as ga, W as ya, X as ve, Y as gn, Z as yn, _ as ba, $ as bn, a0 as xn, a1 as vn, a2 as xa, a3 as Ie, a4 as Nn, a5 as qe, a6 as st, a7 as vt, a8 as De, a9 as Ve, aa as Oe, ab as Cn, ac as ie, ad as Sn, ae as wn, af as Bt, ag as kn, ah as Ke, ai as On, aj as Mn, ak as In, al as Tn, am as Dn, an as bt, ao as zn, ap as Ln, aq as Le, ar as va, as as Fn, at as ht, au as An, av as En, aw as Vn, ax as Nt, ay as qn, az as jn, aA as lt, aB as we, aC as it, aD as Rn, aE as _n, aF as Hn, aG as Pn, aH as xt, aI as $n, aJ as Ut, aK as Gn, aL as Jt, aM as Bn, aN as Un, aO as Jn, aP as Wn, aQ as Na, aR as Kn, aS as Lt, aT as Ca, aU as Qn, aV as Zn, aW as at, aX as Xn, aY as Yn, aZ as Sa, a_ as es, a$ as ts, b0 as as, b1 as ns, b2 as rt, b3 as ss, b4 as mt, b5 as wa, b6 as ls, b7 as ka, b8 as Oa, b9 as Ct, ba as St, bb as is, bc as rs, bd as os, be as Qe, bf as Ze, bg as Xe, bh as Ma, bi as cs, bj as ds, bk as us, bl as hs, bm as ms, bn as ps, bo as fs, bp as pt, bq as ze, br as gs, bs as Pe, bt as Ft, bu as Ia, bv as ys, bw as bs, bx as ot, by as xs, bz as vs, bA as Ns, bB as Cs, bC as Wt, bD as Kt, bE as Ta, bF as Ss, bG as ws, bH as ks, bI as Os, bJ as Ms, bK as Is, bL as Ts, bM as Ds, bN as Fe, bO as ee, bP as te, bQ as At, bR as ae, bS as zs, bT as Da, bU as Ls, bV as Fs, bW as As, bX as Es, bY as Vs, bZ as qs, b_ as js, b$ as Rs, c0 as _s } from "./chunks/index-D6WPwotp.js";
|
|
2
|
+
import { D as Qi, c5 as Zi, c3 as Xi, c3 as Yi, c7 as er, c6 as tr, c8 as ar, c4 as nr, c1 as sr, c2 as lr } from "./chunks/index-D6WPwotp.js";
|
|
3
3
|
import { jsxs as n, jsx as e, Fragment as le } from "react/jsx-runtime";
|
|
4
4
|
import * as Qt from "react";
|
|
5
|
-
import Me, { useState as
|
|
5
|
+
import Me, { useState as P, useMemo as wt, useEffect as de, useRef as $e, useCallback as za, Suspense as Hs } from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -697,10 +697,10 @@ function $a(t) {
|
|
|
697
697
|
return {
|
|
698
698
|
...a,
|
|
699
699
|
frames: (l = a.frames) == null ? void 0 : l.map((i) => {
|
|
700
|
-
var
|
|
700
|
+
var o;
|
|
701
701
|
return {
|
|
702
702
|
...i,
|
|
703
|
-
cards: (
|
|
703
|
+
cards: (o = i.cards) == null ? void 0 : o.map((c) => Sl(c))
|
|
704
704
|
};
|
|
705
705
|
})
|
|
706
706
|
};
|
|
@@ -716,8 +716,8 @@ function Sl(t) {
|
|
|
716
716
|
data: {
|
|
717
717
|
...(s = t.cfg) == null ? void 0 : s.data,
|
|
718
718
|
labels: [],
|
|
719
|
-
datasets: (i = (l = (a = t.cfg) == null ? void 0 : a.data) == null ? void 0 : l.datasets) == null ? void 0 : i.map((
|
|
720
|
-
...
|
|
719
|
+
datasets: (i = (l = (a = t.cfg) == null ? void 0 : a.data) == null ? void 0 : l.datasets) == null ? void 0 : i.map((o) => ({
|
|
720
|
+
...o,
|
|
721
721
|
data: []
|
|
722
722
|
}))
|
|
723
723
|
}
|
|
@@ -755,13 +755,13 @@ async function kl(t, s, a, l) {
|
|
|
755
755
|
async function kt(t, s) {
|
|
756
756
|
if (!s)
|
|
757
757
|
return null;
|
|
758
|
-
const { id: a, template: l, filterValues: i, isDefault:
|
|
758
|
+
const { id: a, template: l, filterValues: i, isDefault: o, shared: c } = t;
|
|
759
759
|
return await Ot("https://semaphor.cloud/api/v1/lens", s, {
|
|
760
760
|
lensId: a,
|
|
761
761
|
template: l,
|
|
762
762
|
filterValues: i,
|
|
763
|
-
isDefault:
|
|
764
|
-
shared:
|
|
763
|
+
isDefault: o,
|
|
764
|
+
shared: c,
|
|
765
765
|
operation: "update"
|
|
766
766
|
});
|
|
767
767
|
}
|
|
@@ -772,7 +772,7 @@ async function Ol(t, s) {
|
|
|
772
772
|
}) : null;
|
|
773
773
|
}
|
|
774
774
|
function Ml() {
|
|
775
|
-
const [t, s] =
|
|
775
|
+
const [t, s] = P(""), [a, l] = P(!1), i = T((g) => g.lenses), { setLenses: o, setSelectedLensId: c } = Je(), [d, u] = P(!1), [f, m] = P(!1), b = T((g) => g.dashboard), x = T((g) => g.filterValues), { authToken: r } = Te();
|
|
776
776
|
async function y() {
|
|
777
777
|
u(!0);
|
|
778
778
|
const g = $a(
|
|
@@ -783,7 +783,7 @@ function Ml() {
|
|
|
783
783
|
x,
|
|
784
784
|
r == null ? void 0 : r.accessToken
|
|
785
785
|
);
|
|
786
|
-
C && (
|
|
786
|
+
C && (o([...i || [], C]), c(C.id), m(!1)), u(!1);
|
|
787
787
|
}
|
|
788
788
|
return /* @__PURE__ */ n(Mt, { open: f, onOpenChange: m, children: [
|
|
789
789
|
/* @__PURE__ */ e(It, { asChild: !0, children: /* @__PURE__ */ n(
|
|
@@ -833,14 +833,14 @@ function Ml() {
|
|
|
833
833
|
] });
|
|
834
834
|
}
|
|
835
835
|
function Il() {
|
|
836
|
-
const [t, s] =
|
|
836
|
+
const [t, s] = P(!1), a = T((m) => m.lenses), l = T((m) => m.selectedLensId), { setLenses: i, setSelectedLensId: o } = Je(), { authToken: c } = Te();
|
|
837
837
|
async function d(m) {
|
|
838
|
-
|
|
838
|
+
o(m);
|
|
839
839
|
}
|
|
840
840
|
async function u(m) {
|
|
841
|
-
if (await Ol(m,
|
|
841
|
+
if (await Ol(m, c == null ? void 0 : c.accessToken)) {
|
|
842
842
|
const x = a == null ? void 0 : a.filter((r) => r.id !== m);
|
|
843
|
-
i(x || []),
|
|
843
|
+
i(x || []), o("original");
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
async function f(m) {
|
|
@@ -856,14 +856,14 @@ function Il() {
|
|
|
856
856
|
...m,
|
|
857
857
|
isDefault: !m.isDefault
|
|
858
858
|
};
|
|
859
|
-
await kt(x,
|
|
859
|
+
await kt(x, c == null ? void 0 : c.accessToken);
|
|
860
860
|
const r = a == null ? void 0 : a.find((y) => y.isDefault);
|
|
861
861
|
if (r && r.id !== m.id) {
|
|
862
862
|
const y = {
|
|
863
863
|
...r,
|
|
864
864
|
isDefault: !1
|
|
865
865
|
};
|
|
866
|
-
await kt(y,
|
|
866
|
+
await kt(y, c == null ? void 0 : c.accessToken);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
return /* @__PURE__ */ n(sa, { open: t, onOpenChange: s, children: [
|
|
@@ -925,12 +925,12 @@ function Il() {
|
|
|
925
925
|
}
|
|
926
926
|
async function Tl() {
|
|
927
927
|
var r;
|
|
928
|
-
const t = T.getState().authToken, s = T.getState().theme, a = T.getState().filterValues, l = (r = T.getState().dashboard) == null ? void 0 : r.title, i = T.getState().isDownloadingPdf,
|
|
928
|
+
const t = T.getState().authToken, s = T.getState().theme, a = T.getState().filterValues, l = (r = T.getState().dashboard) == null ? void 0 : r.title, i = T.getState().isDownloadingPdf, o = T.getState().selectedSheetId;
|
|
929
929
|
if (i)
|
|
930
930
|
return;
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(
|
|
931
|
+
const c = new URLSearchParams();
|
|
932
|
+
c.set("token", (t == null ? void 0 : t.accessToken) || ""), c.set("theme", s || "light"), c.set("filterValues", JSON.stringify(a)), c.set("selectedSheetId", o || "");
|
|
933
|
+
const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(c.toString())}`;
|
|
934
934
|
T.setState({ isDownloadingPdf: !0 });
|
|
935
935
|
const m = (await (await fetch(d, {
|
|
936
936
|
method: "GET",
|
|
@@ -947,8 +947,8 @@ function Dl({
|
|
|
947
947
|
}) {
|
|
948
948
|
const { authToken: s } = Te();
|
|
949
949
|
T((i) => {
|
|
950
|
-
var
|
|
951
|
-
return (
|
|
950
|
+
var o;
|
|
951
|
+
return (o = i.dashboard) == null ? void 0 : o.title;
|
|
952
952
|
}), T((i) => i.theme), T((i) => i.filterValues);
|
|
953
953
|
const a = T((i) => i.isDownloadingPdf);
|
|
954
954
|
async function l() {
|
|
@@ -976,11 +976,11 @@ function zl() {
|
|
|
976
976
|
T((p) => p.theme);
|
|
977
977
|
const s = T((p) => p.lenses), a = T((p) => p.selectedLensId), l = s == null ? void 0 : s.find((p) => p.id === a), i = T((p) => p.dashboard);
|
|
978
978
|
T((p) => p.selectedSheetId);
|
|
979
|
-
const
|
|
979
|
+
const o = T(
|
|
980
980
|
(p) => p.isDashboardEditing
|
|
981
|
-
),
|
|
981
|
+
), c = h(
|
|
982
982
|
(p) => p.selectedConnectionId
|
|
983
|
-
), [d, u] =
|
|
983
|
+
), [d, u] = P(!1), f = T((p) => p.filterValues), m = T((p) => p.isVisualEditing), b = T((p) => p.showFilters);
|
|
984
984
|
T(
|
|
985
985
|
(p) => p.showDashboardJSON
|
|
986
986
|
);
|
|
@@ -988,13 +988,13 @@ function zl() {
|
|
|
988
988
|
(p) => p.actions.setShowFilters
|
|
989
989
|
), { addFrame: y, setSelectedFrameId: g } = T(
|
|
990
990
|
(p) => p.actions
|
|
991
|
-
), { getSelectedSheet: C, setIsDashboardEditing: v, setShowDashboardJSON: D } = T((p) => p.actions), S = C(), { tenantId:
|
|
991
|
+
), { getSelectedSheet: C, setIsDashboardEditing: v, setShowDashboardJSON: D } = T((p) => p.actions), S = C(), { tenantId: M, endUserId: q } = wt(
|
|
992
992
|
() => mn(t == null ? void 0 : t.accessToken),
|
|
993
993
|
[t == null ? void 0 : t.accessToken]
|
|
994
|
-
), F = wt(() =>
|
|
995
|
-
if (!
|
|
994
|
+
), F = wt(() => M || q, [M, q]), G = () => {
|
|
995
|
+
if (!o || !S) return;
|
|
996
996
|
const p = {
|
|
997
|
-
connectionId:
|
|
997
|
+
connectionId: c,
|
|
998
998
|
id: Be(),
|
|
999
999
|
title: "Title",
|
|
1000
1000
|
description: "Description",
|
|
@@ -1039,15 +1039,15 @@ function zl() {
|
|
|
1039
1039
|
/* @__PURE__ */ n("div", { className: "flex gap-2", children: [
|
|
1040
1040
|
/* @__PURE__ */ e("button", { onClick: pn, children: /* @__PURE__ */ e(Nl, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
|
|
1041
1041
|
/* @__PURE__ */ e(Dl, {}),
|
|
1042
|
-
|
|
1042
|
+
o && !m && F && /* @__PURE__ */ e(Ml, {}),
|
|
1043
1043
|
!m && F && /* @__PURE__ */ e(Il, {}),
|
|
1044
|
-
|
|
1044
|
+
o && !m && /* @__PURE__ */ n(
|
|
1045
1045
|
L,
|
|
1046
1046
|
{
|
|
1047
1047
|
variant: "secondary",
|
|
1048
1048
|
className: "h-7 p-2",
|
|
1049
1049
|
size: "sm",
|
|
1050
|
-
disabled: !
|
|
1050
|
+
disabled: !o,
|
|
1051
1051
|
onClick: G,
|
|
1052
1052
|
children: [
|
|
1053
1053
|
/* @__PURE__ */ e(We, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
@@ -1055,7 +1055,7 @@ function zl() {
|
|
|
1055
1055
|
]
|
|
1056
1056
|
}
|
|
1057
1057
|
),
|
|
1058
|
-
!
|
|
1058
|
+
!o && /* @__PURE__ */ e(
|
|
1059
1059
|
L,
|
|
1060
1060
|
{
|
|
1061
1061
|
variant: "ghost",
|
|
@@ -1065,7 +1065,7 @@ function zl() {
|
|
|
1065
1065
|
children: /* @__PURE__ */ e(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
1066
1066
|
}
|
|
1067
1067
|
),
|
|
1068
|
-
|
|
1068
|
+
o && !m && /* @__PURE__ */ e(
|
|
1069
1069
|
L,
|
|
1070
1070
|
{
|
|
1071
1071
|
variant: "ghost",
|
|
@@ -1078,7 +1078,7 @@ function zl() {
|
|
|
1078
1078
|
children: /* @__PURE__ */ e(ut, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
1079
1079
|
}
|
|
1080
1080
|
),
|
|
1081
|
-
|
|
1081
|
+
o && !m && F && /* @__PURE__ */ e(
|
|
1082
1082
|
L,
|
|
1083
1083
|
{
|
|
1084
1084
|
className: "h-7 p-2",
|
|
@@ -1089,7 +1089,7 @@ function zl() {
|
|
|
1089
1089
|
children: /* @__PURE__ */ e(fl, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
1090
1090
|
}
|
|
1091
1091
|
),
|
|
1092
|
-
!b && !m &&
|
|
1092
|
+
!b && !m && o && /* @__PURE__ */ e(
|
|
1093
1093
|
L,
|
|
1094
1094
|
{
|
|
1095
1095
|
className: "h-7 p-2",
|
|
@@ -1099,7 +1099,7 @@ function zl() {
|
|
|
1099
1099
|
children: /* @__PURE__ */ e(da, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
1100
1100
|
}
|
|
1101
1101
|
),
|
|
1102
|
-
!m &&
|
|
1102
|
+
!m && o && !1,
|
|
1103
1103
|
!m && !1
|
|
1104
1104
|
] })
|
|
1105
1105
|
]
|
|
@@ -1112,8 +1112,8 @@ function He({
|
|
|
1112
1112
|
value: a,
|
|
1113
1113
|
isLoading: l,
|
|
1114
1114
|
isError: i,
|
|
1115
|
-
refetch:
|
|
1116
|
-
connectionTooltip:
|
|
1115
|
+
refetch: o,
|
|
1116
|
+
connectionTooltip: c,
|
|
1117
1117
|
onChange: d,
|
|
1118
1118
|
showNone: u = !1,
|
|
1119
1119
|
className: f,
|
|
@@ -1134,9 +1134,9 @@ function He({
|
|
|
1134
1134
|
return /* @__PURE__ */ e(Gs, { className: "size-4" });
|
|
1135
1135
|
}
|
|
1136
1136
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1137
|
-
m && /* @__PURE__ */ e("div", { className: "shrink-0", children:
|
|
1137
|
+
m && /* @__PURE__ */ e("div", { className: "shrink-0", children: c ? /* @__PURE__ */ n(ua, { children: [
|
|
1138
1138
|
/* @__PURE__ */ e(fn, { children: r() }),
|
|
1139
|
-
/* @__PURE__ */ e(ha, { className: "text-xs", align: "start", children:
|
|
1139
|
+
/* @__PURE__ */ e(ha, { className: "text-xs", align: "start", children: c })
|
|
1140
1140
|
] }) : r() }),
|
|
1141
1141
|
/* @__PURE__ */ n(me, { disabled: b, value: x, onValueChange: d, children: [
|
|
1142
1142
|
/* @__PURE__ */ e(
|
|
@@ -1161,7 +1161,7 @@ function He({
|
|
|
1161
1161
|
ml,
|
|
1162
1162
|
{
|
|
1163
1163
|
className: "mr-1 size-3 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
1164
|
-
onClick:
|
|
1164
|
+
onClick: o
|
|
1165
1165
|
}
|
|
1166
1166
|
)
|
|
1167
1167
|
] }),
|
|
@@ -1175,15 +1175,15 @@ function He({
|
|
|
1175
1175
|
] });
|
|
1176
1176
|
}
|
|
1177
1177
|
function Ll({ column: t }) {
|
|
1178
|
-
const [s, a] =
|
|
1178
|
+
const [s, a] = P(!1), l = h((y) => y.selectedTableName), i = h(
|
|
1179
1179
|
(y) => y.selectedSchemaName
|
|
1180
|
-
),
|
|
1180
|
+
), o = h(
|
|
1181
1181
|
(y) => y.selectedDatamodelId
|
|
1182
|
-
),
|
|
1182
|
+
), c = h((y) => y.sqlGen), { modelItems: d, connectionType: u } = Ae(), f = h((y) => y.actions.setSqlGen), m = h((y) => y.actions.setCardSql), b = h((y) => y.actions.setRunSql);
|
|
1183
1183
|
function x(y, g) {
|
|
1184
1184
|
var S;
|
|
1185
|
-
const C = ga(y,
|
|
1186
|
-
(
|
|
1185
|
+
const C = ga(y, c, g), v = (S = d == null ? void 0 : d.find(
|
|
1186
|
+
(M) => M.id === o
|
|
1187
1187
|
)) == null ? void 0 : S.name;
|
|
1188
1188
|
f(C);
|
|
1189
1189
|
const D = ya(
|
|
@@ -1263,9 +1263,9 @@ function Fl({
|
|
|
1263
1263
|
columns: a,
|
|
1264
1264
|
status: l
|
|
1265
1265
|
}) {
|
|
1266
|
-
const i = h((p) => p.sqlGen),
|
|
1266
|
+
const i = h((p) => p.sqlGen), o = h(
|
|
1267
1267
|
(p) => p.selectedConnectionId
|
|
1268
|
-
),
|
|
1268
|
+
), c = h(
|
|
1269
1269
|
(p) => p.selectedDatabaseName
|
|
1270
1270
|
), d = h(
|
|
1271
1271
|
(p) => p.selectedSchemaName
|
|
@@ -1275,7 +1275,7 @@ function Fl({
|
|
|
1275
1275
|
(p) => p.dashboard.aiScopeTables
|
|
1276
1276
|
), { addToAIScope: b, removeFromAIScope: x } = Je(), { setAIScopeTables: r } = T((p) => p.actions), y = h((p) => p.actions.setRunSql), g = h((p) => p.actions.setSqlGen), C = h(
|
|
1277
1277
|
(p) => p.actions.setIsShowingVisual
|
|
1278
|
-
), v = h((p) => p.actions.setCardSql), { connectionType: D, modelItems: S, selectedDatamodelName:
|
|
1278
|
+
), v = h((p) => p.actions.setCardSql), { connectionType: D, modelItems: S, selectedDatamodelName: M } = Ae();
|
|
1279
1279
|
function q(p) {
|
|
1280
1280
|
var U;
|
|
1281
1281
|
const E = ga(p, i);
|
|
@@ -1293,29 +1293,29 @@ function Fl({
|
|
|
1293
1293
|
}
|
|
1294
1294
|
function F() {
|
|
1295
1295
|
return (m == null ? void 0 : m.find(
|
|
1296
|
-
(p) => p.connectionId ===
|
|
1296
|
+
(p) => p.connectionId === o && (p.tableName === u || p.datamodelName === M)
|
|
1297
1297
|
)) !== void 0;
|
|
1298
1298
|
}
|
|
1299
1299
|
function G(p) {
|
|
1300
|
-
p === !0 && (u ||
|
|
1301
|
-
connectionId:
|
|
1300
|
+
p === !0 && (u || M) && o ? (b({
|
|
1301
|
+
connectionId: o,
|
|
1302
1302
|
connectionType: D === "S3" || D === "API" ? "DuckDb" : D,
|
|
1303
|
-
databaseName:
|
|
1303
|
+
databaseName: c || "",
|
|
1304
1304
|
schemaName: d || "",
|
|
1305
1305
|
tableName: u || "",
|
|
1306
|
-
datamodelName: st(
|
|
1306
|
+
datamodelName: st(M),
|
|
1307
1307
|
datamodelId: f || ""
|
|
1308
1308
|
}), nt.success("Added to Assistant Scope", {
|
|
1309
1309
|
position: "top-right",
|
|
1310
1310
|
duration: 2500,
|
|
1311
1311
|
richColors: !0
|
|
1312
1312
|
})) : (x({
|
|
1313
|
-
connectionId:
|
|
1313
|
+
connectionId: o || "",
|
|
1314
1314
|
connectionType: D || "",
|
|
1315
1315
|
tableName: u || "",
|
|
1316
|
-
datamodelName: st(
|
|
1316
|
+
datamodelName: st(M),
|
|
1317
1317
|
datamodelId: f || "",
|
|
1318
|
-
databaseName:
|
|
1318
|
+
databaseName: c || "",
|
|
1319
1319
|
schemaName: d || ""
|
|
1320
1320
|
}), nt("Removed from Assistant Scope", {
|
|
1321
1321
|
position: "top-right",
|
|
@@ -1327,7 +1327,7 @@ function Fl({
|
|
|
1327
1327
|
const p = vt({
|
|
1328
1328
|
schemaName: t,
|
|
1329
1329
|
tableName: s,
|
|
1330
|
-
modelName:
|
|
1330
|
+
modelName: M,
|
|
1331
1331
|
connectionType: D
|
|
1332
1332
|
});
|
|
1333
1333
|
C(!1);
|
|
@@ -1338,7 +1338,7 @@ function Fl({
|
|
|
1338
1338
|
const p = vt({
|
|
1339
1339
|
schemaName: t,
|
|
1340
1340
|
tableName: s,
|
|
1341
|
-
modelName:
|
|
1341
|
+
modelName: M,
|
|
1342
1342
|
connectionType: D
|
|
1343
1343
|
});
|
|
1344
1344
|
v(`SELECT COUNT(*) as count FROM ${p}`), y(!0);
|
|
@@ -1442,9 +1442,9 @@ function Ae(t, s) {
|
|
|
1442
1442
|
let a = wt(() => [], []);
|
|
1443
1443
|
const l = Te().authToken || t, i = h(
|
|
1444
1444
|
(w) => w.selectedConnectionId
|
|
1445
|
-
), c = h(
|
|
1446
|
-
(w) => w.selectedDatamodelId
|
|
1447
1445
|
), o = h(
|
|
1446
|
+
(w) => w.selectedDatamodelId
|
|
1447
|
+
), c = h(
|
|
1448
1448
|
(w) => w.selectedDatabaseName
|
|
1449
1449
|
), d = h(
|
|
1450
1450
|
(w) => w.selectedSchemaName
|
|
@@ -1463,10 +1463,10 @@ function Ae(t, s) {
|
|
|
1463
1463
|
);
|
|
1464
1464
|
h((w) => w.actions.setCardSql);
|
|
1465
1465
|
function g(w) {
|
|
1466
|
-
return i &&
|
|
1466
|
+
return i && c && d && c !== "NA" ? !0 : i && w === "API" ? !1 : !!(i && w === "S3");
|
|
1467
1467
|
}
|
|
1468
1468
|
function C(w) {
|
|
1469
|
-
return !!(i &&
|
|
1469
|
+
return !!(i && c && c !== "NA" && d && u || i && (w === "S3" || w === "API") || o && o);
|
|
1470
1470
|
}
|
|
1471
1471
|
function v(w) {
|
|
1472
1472
|
return i && w ? !(w === "API" || w === "S3") : !1;
|
|
@@ -1474,7 +1474,7 @@ function Ae(t, s) {
|
|
|
1474
1474
|
const {
|
|
1475
1475
|
refetch: D,
|
|
1476
1476
|
data: S,
|
|
1477
|
-
isLoading:
|
|
1477
|
+
isLoading: M,
|
|
1478
1478
|
isError: q
|
|
1479
1479
|
} = De({
|
|
1480
1480
|
queryKey: ["connections"],
|
|
@@ -1520,22 +1520,22 @@ function Ae(t, s) {
|
|
|
1520
1520
|
enabled: v(E)
|
|
1521
1521
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1522
1522
|
}), {
|
|
1523
|
-
data:
|
|
1524
|
-
isLoading:
|
|
1523
|
+
data: O,
|
|
1524
|
+
isLoading: H,
|
|
1525
1525
|
isFetching: Z,
|
|
1526
1526
|
isError: X,
|
|
1527
1527
|
refetch: j
|
|
1528
1528
|
} = De({
|
|
1529
|
-
queryKey: ["schemas", i,
|
|
1529
|
+
queryKey: ["schemas", i, c],
|
|
1530
1530
|
queryFn: () => Ve(
|
|
1531
1531
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1532
1532
|
(l == null ? void 0 : l.accessToken) || "",
|
|
1533
1533
|
{
|
|
1534
1534
|
connection_id: i,
|
|
1535
|
-
database_name:
|
|
1535
|
+
database_name: c
|
|
1536
1536
|
}
|
|
1537
1537
|
),
|
|
1538
|
-
enabled: !!i && !!
|
|
1538
|
+
enabled: !!i && !!c && !W && c !== "NA"
|
|
1539
1539
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1540
1540
|
}), {
|
|
1541
1541
|
data: z,
|
|
@@ -1547,7 +1547,7 @@ function Ae(t, s) {
|
|
|
1547
1547
|
queryKey: [
|
|
1548
1548
|
"tables",
|
|
1549
1549
|
i,
|
|
1550
|
-
|
|
1550
|
+
c,
|
|
1551
1551
|
d
|
|
1552
1552
|
],
|
|
1553
1553
|
queryFn: () => Ve(
|
|
@@ -1555,7 +1555,7 @@ function Ae(t, s) {
|
|
|
1555
1555
|
(l == null ? void 0 : l.accessToken) || "",
|
|
1556
1556
|
{
|
|
1557
1557
|
connection_id: i,
|
|
1558
|
-
database_name:
|
|
1558
|
+
database_name: c,
|
|
1559
1559
|
schema_name: d
|
|
1560
1560
|
}
|
|
1561
1561
|
),
|
|
@@ -1570,8 +1570,8 @@ function Ae(t, s) {
|
|
|
1570
1570
|
queryKey: [
|
|
1571
1571
|
"columns",
|
|
1572
1572
|
i,
|
|
1573
|
-
o,
|
|
1574
1573
|
c,
|
|
1574
|
+
o,
|
|
1575
1575
|
d,
|
|
1576
1576
|
u
|
|
1577
1577
|
],
|
|
@@ -1580,9 +1580,9 @@ function Ae(t, s) {
|
|
|
1580
1580
|
(l == null ? void 0 : l.accessToken) || "",
|
|
1581
1581
|
{
|
|
1582
1582
|
connection_id: i,
|
|
1583
|
-
datamodel_id:
|
|
1583
|
+
datamodel_id: o || "",
|
|
1584
1584
|
// don't pass undefined. Pass empty string
|
|
1585
|
-
database_name:
|
|
1585
|
+
database_name: c,
|
|
1586
1586
|
schema_name: d,
|
|
1587
1587
|
table_name: u
|
|
1588
1588
|
}
|
|
@@ -1620,7 +1620,7 @@ function Ae(t, s) {
|
|
|
1620
1620
|
function gt(w) {
|
|
1621
1621
|
b(w === "none" ? "" : w), w !== "none" && w !== "" && x("");
|
|
1622
1622
|
}
|
|
1623
|
-
A && ((Rt = A == null ? void 0 : A.databases) == null ? void 0 : Rt.length) > 0,
|
|
1623
|
+
A && ((Rt = A == null ? void 0 : A.databases) == null ? void 0 : Rt.length) > 0, O && ((_t = O == null ? void 0 : O.schemas) == null ? void 0 : _t.length) > 0, oe && ((Ht = oe == null ? void 0 : oe.columns) == null ? void 0 : Ht.length) > 0 && (a = oe.columns.map((w) => ({
|
|
1624
1624
|
...w,
|
|
1625
1625
|
data_type: w.data_type.toLowerCase()
|
|
1626
1626
|
}))), V && (a = []), (Y || q) && (a = []);
|
|
@@ -1636,21 +1636,21 @@ function Ae(t, s) {
|
|
|
1636
1636
|
})), rn = A == null ? void 0 : A.databases.map((w) => ({
|
|
1637
1637
|
id: w.database_name,
|
|
1638
1638
|
name: w.database_name
|
|
1639
|
-
})), on =
|
|
1639
|
+
})), on = O == null ? void 0 : O.schemas.map((w) => ({
|
|
1640
1640
|
id: w.schema_name,
|
|
1641
1641
|
name: w.schema_name
|
|
1642
1642
|
})), cn = z == null ? void 0 : z.tables.map((w) => ({
|
|
1643
1643
|
id: w.table_name,
|
|
1644
1644
|
name: w.table_name
|
|
1645
1645
|
})), dn = ($t = G == null ? void 0 : G.datamodels.find(
|
|
1646
|
-
(w) => w.id ===
|
|
1646
|
+
(w) => w.id === o
|
|
1647
1647
|
)) == null ? void 0 : $t.name;
|
|
1648
1648
|
return {
|
|
1649
1649
|
connectionItems: Ye,
|
|
1650
|
-
isConnectionsLoading:
|
|
1650
|
+
isConnectionsLoading: M,
|
|
1651
1651
|
isConnectionsError: q,
|
|
1652
1652
|
modelItems: yt,
|
|
1653
|
-
selectedDatamodelId:
|
|
1653
|
+
selectedDatamodelId: o,
|
|
1654
1654
|
selectedDatamodelName: dn,
|
|
1655
1655
|
isModelsLoading: _,
|
|
1656
1656
|
isModelsError: B,
|
|
@@ -1658,7 +1658,7 @@ function Ae(t, s) {
|
|
|
1658
1658
|
isDatabasesLoadingOrFetching: U || K,
|
|
1659
1659
|
isDatabaseError: V,
|
|
1660
1660
|
schemaItems: on,
|
|
1661
|
-
isSchemaLoadingOrFetching:
|
|
1661
|
+
isSchemaLoadingOrFetching: H || Z,
|
|
1662
1662
|
isSchemaError: X,
|
|
1663
1663
|
tableItems: cn,
|
|
1664
1664
|
isTableLoadingOrFetching: ue || k,
|
|
@@ -1694,7 +1694,7 @@ function Ba({
|
|
|
1694
1694
|
(Y) => Y.selectedDatabaseName
|
|
1695
1695
|
), i = h(
|
|
1696
1696
|
(Y) => Y.selectedSchemaName
|
|
1697
|
-
),
|
|
1697
|
+
), o = h((Y) => Y.selectedTableName), c = h(
|
|
1698
1698
|
(Y) => Y.actions.setSelectedTableName
|
|
1699
1699
|
), {
|
|
1700
1700
|
connectionItems: d,
|
|
@@ -1710,7 +1710,7 @@ function Ba({
|
|
|
1710
1710
|
isDatabasesLoadingOrFetching: v,
|
|
1711
1711
|
isDatabaseError: D,
|
|
1712
1712
|
isSchemaLoadingOrFetching: S,
|
|
1713
|
-
isSchemaError:
|
|
1713
|
+
isSchemaError: M,
|
|
1714
1714
|
isColumnsError: q,
|
|
1715
1715
|
isColumnsLoadingOrFetching: F,
|
|
1716
1716
|
isTableLoadingOrFetching: G,
|
|
@@ -1724,8 +1724,8 @@ function Ba({
|
|
|
1724
1724
|
refetchColumns: K,
|
|
1725
1725
|
refetchConnections: V,
|
|
1726
1726
|
handleConnectionChange: N,
|
|
1727
|
-
handleDatabaseChange:
|
|
1728
|
-
handleSchemaChange:
|
|
1727
|
+
handleDatabaseChange: O,
|
|
1728
|
+
handleSchemaChange: H,
|
|
1729
1729
|
handleDatamodelChange: Z,
|
|
1730
1730
|
tableName: X,
|
|
1731
1731
|
schemaName: j
|
|
@@ -1752,7 +1752,7 @@ function Ba({
|
|
|
1752
1752
|
{
|
|
1753
1753
|
refetch: E,
|
|
1754
1754
|
showNone: !0,
|
|
1755
|
-
onChange:
|
|
1755
|
+
onChange: O,
|
|
1756
1756
|
isError: D,
|
|
1757
1757
|
isLoading: v,
|
|
1758
1758
|
items: m,
|
|
@@ -1791,8 +1791,8 @@ function Ba({
|
|
|
1791
1791
|
He,
|
|
1792
1792
|
{
|
|
1793
1793
|
refetch: A,
|
|
1794
|
-
onChange:
|
|
1795
|
-
isError:
|
|
1794
|
+
onChange: H,
|
|
1795
|
+
isError: M,
|
|
1796
1796
|
isLoading: S,
|
|
1797
1797
|
items: f,
|
|
1798
1798
|
value: i || "",
|
|
@@ -1809,11 +1809,11 @@ function Ba({
|
|
|
1809
1809
|
He,
|
|
1810
1810
|
{
|
|
1811
1811
|
refetch: U,
|
|
1812
|
-
onChange:
|
|
1812
|
+
onChange: c,
|
|
1813
1813
|
isError: _,
|
|
1814
1814
|
items: b,
|
|
1815
1815
|
isLoading: G,
|
|
1816
|
-
value:
|
|
1816
|
+
value: o || "",
|
|
1817
1817
|
title: "Table"
|
|
1818
1818
|
}
|
|
1819
1819
|
) : null;
|
|
@@ -1859,18 +1859,18 @@ function Ba({
|
|
|
1859
1859
|
}
|
|
1860
1860
|
function Al(t) {
|
|
1861
1861
|
const s = t.toUpperCase().indexOf("WHERE"), a = t.toUpperCase().indexOf("GROUP BY"), l = t.toUpperCase().indexOf("LIMIT"), i = t.toUpperCase().indexOf("ORDER BY");
|
|
1862
|
-
let
|
|
1863
|
-
if (i !== -1 && (
|
|
1864
|
-
const
|
|
1865
|
-
return `${
|
|
1862
|
+
let o = t.length;
|
|
1863
|
+
if (i !== -1 && (o = i), l !== -1 && l < o && (o = l), s !== -1) {
|
|
1864
|
+
const c = t.substring(0, s), d = t.substring(s);
|
|
1865
|
+
return `${c} {{ filters | where }} AND ${d.substring(
|
|
1866
1866
|
6
|
|
1867
1867
|
)}`;
|
|
1868
1868
|
} else if (a !== -1) {
|
|
1869
|
-
const
|
|
1870
|
-
return `${
|
|
1869
|
+
const c = t.substring(0, a), d = t.substring(a);
|
|
1870
|
+
return `${c} {{ filters | where }} ${d}`;
|
|
1871
1871
|
} else {
|
|
1872
|
-
const
|
|
1873
|
-
return console.log("beforeClause",
|
|
1872
|
+
const c = t.substring(0, o), d = t.substring(o);
|
|
1873
|
+
return console.log("beforeClause", c), console.log("afterClause", d), d ? `${c} {{ filters | where }} ${d}` : `${c.replace(/;$/, "")} {{ filters | where }}`;
|
|
1874
1874
|
}
|
|
1875
1875
|
}
|
|
1876
1876
|
function El({ sql: t, error: s, onClick: a }) {
|
|
@@ -1899,7 +1899,7 @@ function El({ sql: t, error: s, onClick: a }) {
|
|
|
1899
1899
|
] });
|
|
1900
1900
|
}
|
|
1901
1901
|
function Vl() {
|
|
1902
|
-
const [t, s] =
|
|
1902
|
+
const [t, s] = P([]), [a, l] = P(""), [i, o] = P(null), { authToken: c } = Te(), d = h((k) => {
|
|
1903
1903
|
var J;
|
|
1904
1904
|
return (J = k == null ? void 0 : k.card) == null ? void 0 : J.sql;
|
|
1905
1905
|
}), u = h((k) => {
|
|
@@ -1915,7 +1915,7 @@ function Vl() {
|
|
|
1915
1915
|
(k) => k.selectedSchemaName
|
|
1916
1916
|
), D = T(
|
|
1917
1917
|
(k) => k.dashboard.aiScopeTables
|
|
1918
|
-
), { setTriggerAIRun: S } = ie(), { selectedDatamodelName:
|
|
1918
|
+
), { setTriggerAIRun: S } = ie(), { selectedDatamodelName: M, connectionType: q, selectedDatamodelId: F } = Ae(), {
|
|
1919
1919
|
messages: G,
|
|
1920
1920
|
setMessages: _,
|
|
1921
1921
|
reload: B,
|
|
@@ -1929,7 +1929,7 @@ function Vl() {
|
|
|
1929
1929
|
} = Sn({
|
|
1930
1930
|
api: "https://semaphor.cloud/api/v1/assistant",
|
|
1931
1931
|
headers: {
|
|
1932
|
-
Authorization: `Bearer ${
|
|
1932
|
+
Authorization: `Bearer ${c == null ? void 0 : c.accessToken}`
|
|
1933
1933
|
},
|
|
1934
1934
|
body: {
|
|
1935
1935
|
random: Math.random()
|
|
@@ -1938,7 +1938,7 @@ function Vl() {
|
|
|
1938
1938
|
//maxToolRoundtrips: 5,
|
|
1939
1939
|
onToolCall: N,
|
|
1940
1940
|
onFinish(k, J) {
|
|
1941
|
-
|
|
1941
|
+
O(J.usage), l(""), console.log("onFinish", k, J), J.finishReason === "stop" && l("");
|
|
1942
1942
|
}
|
|
1943
1943
|
});
|
|
1944
1944
|
de(() => {
|
|
@@ -1985,14 +1985,14 @@ function Vl() {
|
|
|
1985
1985
|
l("Analyzing...");
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1989
|
-
|
|
1988
|
+
function O(k) {
|
|
1989
|
+
o((J) => J ? {
|
|
1990
1990
|
promptTokens: J.promptTokens + k.promptTokens,
|
|
1991
1991
|
completionTokens: J.completionTokens + k.completionTokens,
|
|
1992
1992
|
totalTokens: J.totalTokens + k.totalTokens
|
|
1993
1993
|
} : k);
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1995
|
+
function H(k) {
|
|
1996
1996
|
const J = kn(t, k);
|
|
1997
1997
|
X(J);
|
|
1998
1998
|
}
|
|
@@ -2019,7 +2019,7 @@ function Vl() {
|
|
|
2019
2019
|
schemaName: v || "",
|
|
2020
2020
|
tableName: g || "",
|
|
2021
2021
|
datamodelId: F || "",
|
|
2022
|
-
datamodelName: st(
|
|
2022
|
+
datamodelName: st(M),
|
|
2023
2023
|
connectionId: C || "",
|
|
2024
2024
|
connectionType: q || ""
|
|
2025
2025
|
}, J = Bt([...t, k]);
|
|
@@ -2030,7 +2030,7 @@ function Vl() {
|
|
|
2030
2030
|
databaseName: y || "",
|
|
2031
2031
|
schemaName: v || "",
|
|
2032
2032
|
tableName: g || "",
|
|
2033
|
-
datamodelName: st(
|
|
2033
|
+
datamodelName: st(M),
|
|
2034
2034
|
connectionId: C || "",
|
|
2035
2035
|
connectionType: q || "",
|
|
2036
2036
|
datamodelId: F || ""
|
|
@@ -2060,7 +2060,7 @@ function Vl() {
|
|
|
2060
2060
|
isLoading: ue,
|
|
2061
2061
|
handleSetAIScope: z,
|
|
2062
2062
|
handleAddCurrentTableToScope: j,
|
|
2063
|
-
removeFromCurrentSelections:
|
|
2063
|
+
removeFromCurrentSelections: H,
|
|
2064
2064
|
currentScope: t,
|
|
2065
2065
|
setCurrentScope: s,
|
|
2066
2066
|
handleInputChange: U,
|
|
@@ -2073,7 +2073,7 @@ function Vl() {
|
|
|
2073
2073
|
}
|
|
2074
2074
|
const ql = !1;
|
|
2075
2075
|
function jl() {
|
|
2076
|
-
const t = h((V) => V.showAIDialog), s = $e(t), a = $e(null), l = $e(null), [i,
|
|
2076
|
+
const t = h((V) => V.showAIDialog), s = $e(t), a = $e(null), l = $e(null), [i, o] = P(!1), [c, d] = P(ql), [u, f] = P(!1), m = h((V) => V.actions.setCardSql), b = h((V) => V.actions.setRunSql), { setShowAIDialog: x } = ie(), {
|
|
2077
2077
|
messages: r,
|
|
2078
2078
|
setMessages: y,
|
|
2079
2079
|
reload: g,
|
|
@@ -2081,7 +2081,7 @@ function jl() {
|
|
|
2081
2081
|
setInput: v,
|
|
2082
2082
|
isLoading: D,
|
|
2083
2083
|
handleSetAIScope: S,
|
|
2084
|
-
handleAddCurrentTableToScope:
|
|
2084
|
+
handleAddCurrentTableToScope: M,
|
|
2085
2085
|
removeFromCurrentSelections: q,
|
|
2086
2086
|
currentScope: F,
|
|
2087
2087
|
setCurrentScope: G,
|
|
@@ -2096,11 +2096,11 @@ function jl() {
|
|
|
2096
2096
|
const V = s.current ? "smooth" : "auto";
|
|
2097
2097
|
s.current = t;
|
|
2098
2098
|
const N = setTimeout(() => {
|
|
2099
|
-
var
|
|
2099
|
+
var O;
|
|
2100
2100
|
a.current && (a.current.scroll({
|
|
2101
2101
|
top: a.current.scrollHeight,
|
|
2102
2102
|
behavior: V
|
|
2103
|
-
}), (
|
|
2103
|
+
}), (O = l.current) == null || O.focus());
|
|
2104
2104
|
}, 50);
|
|
2105
2105
|
return () => clearTimeout(N);
|
|
2106
2106
|
}, [r, t]);
|
|
@@ -2117,14 +2117,14 @@ function jl() {
|
|
|
2117
2117
|
bt,
|
|
2118
2118
|
{
|
|
2119
2119
|
checked: i,
|
|
2120
|
-
onCheckedChange:
|
|
2120
|
+
onCheckedChange: o,
|
|
2121
2121
|
children: "Token Usage"
|
|
2122
2122
|
}
|
|
2123
2123
|
),
|
|
2124
2124
|
/* @__PURE__ */ e(
|
|
2125
2125
|
bt,
|
|
2126
2126
|
{
|
|
2127
|
-
checked:
|
|
2127
|
+
checked: c,
|
|
2128
2128
|
onCheckedChange: d,
|
|
2129
2129
|
children: "Tool Invocations"
|
|
2130
2130
|
}
|
|
@@ -2190,7 +2190,7 @@ function jl() {
|
|
|
2190
2190
|
className: "h-6 text-xs",
|
|
2191
2191
|
size: "sm",
|
|
2192
2192
|
variant: "secondary",
|
|
2193
|
-
onClick:
|
|
2193
|
+
onClick: M,
|
|
2194
2194
|
children: [
|
|
2195
2195
|
/* @__PURE__ */ e(We, { className: "mr-2 size-3" }),
|
|
2196
2196
|
"Current Table"
|
|
@@ -2220,7 +2220,7 @@ function jl() {
|
|
|
2220
2220
|
Mn,
|
|
2221
2221
|
{
|
|
2222
2222
|
messages: r,
|
|
2223
|
-
showTools:
|
|
2223
|
+
showTools: c,
|
|
2224
2224
|
handleRun: U,
|
|
2225
2225
|
showSystemMessage: u
|
|
2226
2226
|
}
|
|
@@ -2270,9 +2270,9 @@ function _l(t, s) {
|
|
|
2270
2270
|
if (t == null) return {};
|
|
2271
2271
|
var a = Hl(t, s), l, i;
|
|
2272
2272
|
if (Object.getOwnPropertySymbols) {
|
|
2273
|
-
var
|
|
2274
|
-
for (i = 0; i <
|
|
2275
|
-
l =
|
|
2273
|
+
var o = Object.getOwnPropertySymbols(t);
|
|
2274
|
+
for (i = 0; i < o.length; i++)
|
|
2275
|
+
l = o[i], !(s.indexOf(l) >= 0) && Object.prototype.propertyIsEnumerable.call(t, l) && (a[l] = t[l]);
|
|
2276
2276
|
}
|
|
2277
2277
|
return a;
|
|
2278
2278
|
}
|
|
@@ -2349,13 +2349,13 @@ function Bl(t) {
|
|
|
2349
2349
|
var {
|
|
2350
2350
|
attr: l,
|
|
2351
2351
|
size: i,
|
|
2352
|
-
title:
|
|
2353
|
-
} = t,
|
|
2352
|
+
title: o
|
|
2353
|
+
} = t, c = _l(t, Rl), d = i || a.size || "1em", u;
|
|
2354
2354
|
return a.className && (u = a.className), t.className && (u = (u ? u + " " : "") + t.className), /* @__PURE__ */ Me.createElement("svg", ct({
|
|
2355
2355
|
stroke: "currentColor",
|
|
2356
2356
|
fill: "currentColor",
|
|
2357
2357
|
strokeWidth: "0"
|
|
2358
|
-
}, a.attr, l,
|
|
2358
|
+
}, a.attr, l, c, {
|
|
2359
2359
|
className: u,
|
|
2360
2360
|
style: dt(dt({
|
|
2361
2361
|
color: t.color || a.color
|
|
@@ -2363,7 +2363,7 @@ function Bl(t) {
|
|
|
2363
2363
|
height: d,
|
|
2364
2364
|
width: d,
|
|
2365
2365
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2366
|
-
}),
|
|
2366
|
+
}), o && /* @__PURE__ */ Me.createElement("title", null, o), t.children);
|
|
2367
2367
|
};
|
|
2368
2368
|
return Zt !== void 0 ? /* @__PURE__ */ Me.createElement(Zt.Consumer, null, (a) => s(a)) : s(Ua);
|
|
2369
2369
|
}
|
|
@@ -2371,36 +2371,36 @@ function Ul(t) {
|
|
|
2371
2371
|
return je({ 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: [] }] })(t);
|
|
2372
2372
|
}
|
|
2373
2373
|
function Wa(t) {
|
|
2374
|
-
const { theme: s } = zn(), a = T((g) => g.theme), l = h((g) => g.frame), i = h((g) => g.card),
|
|
2374
|
+
const { theme: s } = zn(), a = T((g) => g.theme), l = h((g) => g.frame), i = h((g) => g.card), o = h((g) => g.activeTabCardId), c = Ln(), { refetch: d } = Le(i), { updateCardTab: u, setRunSql: f } = ie(), m = $e(), b = $e({}), x = l.cards.find((g) => g.id === o), r = za(() => {
|
|
2375
2375
|
let g = "";
|
|
2376
2376
|
return t === "python" && (g = (x == null ? void 0 : x.python) || va), t === "sql" && (g = (x == null ? void 0 : x.sql) || ""), g;
|
|
2377
2377
|
}, [t, x]);
|
|
2378
2378
|
de(() => {
|
|
2379
|
-
if (
|
|
2380
|
-
if (m.current &&
|
|
2379
|
+
if (o && i.id && i.id !== o) {
|
|
2380
|
+
if (m.current && c) {
|
|
2381
2381
|
const g = m.current.getModel();
|
|
2382
2382
|
g && (b.current[i.id] = g);
|
|
2383
|
-
let C = b.current[
|
|
2383
|
+
let C = b.current[o];
|
|
2384
2384
|
if (!C) {
|
|
2385
2385
|
const v = r();
|
|
2386
|
-
C =
|
|
2386
|
+
C = c.editor.createModel(v, t), b.current[o] = C;
|
|
2387
2387
|
}
|
|
2388
2388
|
m.current.setModel(C);
|
|
2389
2389
|
}
|
|
2390
|
-
u(
|
|
2390
|
+
u(o, i), f(!0);
|
|
2391
2391
|
}
|
|
2392
2392
|
}, [
|
|
2393
|
-
|
|
2393
|
+
o,
|
|
2394
2394
|
i,
|
|
2395
2395
|
u,
|
|
2396
|
-
|
|
2396
|
+
c,
|
|
2397
2397
|
f,
|
|
2398
2398
|
t,
|
|
2399
2399
|
r
|
|
2400
2400
|
]), de(() => {
|
|
2401
|
-
if (!
|
|
2401
|
+
if (!c) return;
|
|
2402
2402
|
const g = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", C = a === "system" ? g : a;
|
|
2403
|
-
|
|
2403
|
+
c.editor.defineTheme("default", {
|
|
2404
2404
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2405
2405
|
base: C === "light" ? "vs" : "vs-dark",
|
|
2406
2406
|
inherit: !0,
|
|
@@ -2412,16 +2412,16 @@ function Wa(t) {
|
|
|
2412
2412
|
// ? '#ffffff'
|
|
2413
2413
|
// : getCssVariableValue('--semaphor-background'),
|
|
2414
2414
|
}
|
|
2415
|
-
}),
|
|
2416
|
-
}, [s, a,
|
|
2415
|
+
}), c.editor.setTheme("default");
|
|
2416
|
+
}, [s, a, c]), de(() => {
|
|
2417
2417
|
const g = m.current;
|
|
2418
|
-
g &&
|
|
2419
|
-
|
|
2418
|
+
g && c && i && g.addCommand(
|
|
2419
|
+
c.KeyMod.Shift | c.KeyCode.Enter,
|
|
2420
2420
|
function() {
|
|
2421
2421
|
return d(), !1;
|
|
2422
2422
|
}
|
|
2423
2423
|
);
|
|
2424
|
-
}, [
|
|
2424
|
+
}, [c, d, i]);
|
|
2425
2425
|
function y(g, C) {
|
|
2426
2426
|
if (m.current = g, !b.current[i.id]) {
|
|
2427
2427
|
const v = g.getModel(), D = r();
|
|
@@ -2432,16 +2432,16 @@ function Wa(t) {
|
|
|
2432
2432
|
return { handleEditorDidMount: y };
|
|
2433
2433
|
}
|
|
2434
2434
|
function Jl() {
|
|
2435
|
-
const t = h((
|
|
2436
|
-
function c
|
|
2437
|
-
a(
|
|
2435
|
+
const t = h((c) => c.card.sql), s = h((c) => c.sqlGen), { setCardSql: a, setSqlGen: l } = ie(), { handleEditorDidMount: i } = Wa("sql");
|
|
2436
|
+
function o(c) {
|
|
2437
|
+
a(c), An(s) || l({});
|
|
2438
2438
|
}
|
|
2439
2439
|
return /* @__PURE__ */ e(
|
|
2440
2440
|
ht,
|
|
2441
2441
|
{
|
|
2442
2442
|
theme: "default",
|
|
2443
2443
|
className: "pt-3",
|
|
2444
|
-
onChange:
|
|
2444
|
+
onChange: o,
|
|
2445
2445
|
value: t || "",
|
|
2446
2446
|
options: {
|
|
2447
2447
|
minimap: {
|
|
@@ -2517,10 +2517,10 @@ function Kl({ jsonString: t }) {
|
|
|
2517
2517
|
}
|
|
2518
2518
|
function Ql() {
|
|
2519
2519
|
var ce;
|
|
2520
|
-
const [t, s] =
|
|
2520
|
+
const [t, s] = P({
|
|
2521
2521
|
queryKey: [],
|
|
2522
2522
|
queryData: null
|
|
2523
|
-
}), a = En(), [l, i] =
|
|
2523
|
+
}), a = En(), [l, i] = P(!1), [o, c] = P(!1), d = h((I) => I.frame), u = h((I) => I.card), f = h((I) => I.isShowingVisual), m = h(
|
|
2524
2524
|
(I) => I.selectedConnectionId
|
|
2525
2525
|
), b = h(
|
|
2526
2526
|
(I) => I.selectedDatabaseName
|
|
@@ -2536,7 +2536,7 @@ function Ql() {
|
|
|
2536
2536
|
setQueryResultColumns: D,
|
|
2537
2537
|
setCardSql: S,
|
|
2538
2538
|
// setQueryError,
|
|
2539
|
-
setPythonStdOut:
|
|
2539
|
+
setPythonStdOut: M,
|
|
2540
2540
|
setCardPreferences: q,
|
|
2541
2541
|
setCardType: F,
|
|
2542
2542
|
setCardPython: G,
|
|
@@ -2546,8 +2546,8 @@ function Ql() {
|
|
|
2546
2546
|
), {
|
|
2547
2547
|
data: V,
|
|
2548
2548
|
isLoading: N,
|
|
2549
|
-
isFetching:
|
|
2550
|
-
isSuccess:
|
|
2549
|
+
isFetching: O,
|
|
2550
|
+
isSuccess: H,
|
|
2551
2551
|
isError: Z,
|
|
2552
2552
|
error: X,
|
|
2553
2553
|
queryKey: j,
|
|
@@ -2557,19 +2557,19 @@ function Ql() {
|
|
|
2557
2557
|
if (V && (V.rowLimitExceeded && nt.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2558
2558
|
position: "top-center",
|
|
2559
2559
|
richColors: !0
|
|
2560
|
-
}),
|
|
2560
|
+
}), M((V == null ? void 0 : V.output) || ""), V.records.length > 0)) {
|
|
2561
2561
|
const { dimensionKeys: I } = Nt(V.records);
|
|
2562
2562
|
D(I);
|
|
2563
2563
|
}
|
|
2564
|
-
}, [V, D,
|
|
2565
|
-
(N ||
|
|
2564
|
+
}, [V, D, M]), de(() => {
|
|
2565
|
+
(N || O) && K(!0), (Z || H) && K(!1), Z && (D([]), M(""));
|
|
2566
2566
|
}, [
|
|
2567
2567
|
N,
|
|
2568
|
-
M,
|
|
2569
|
-
V,
|
|
2570
2568
|
O,
|
|
2569
|
+
V,
|
|
2570
|
+
M,
|
|
2571
2571
|
Z,
|
|
2572
|
-
|
|
2572
|
+
H,
|
|
2573
2573
|
K,
|
|
2574
2574
|
D,
|
|
2575
2575
|
// setQueryError,
|
|
@@ -2646,7 +2646,7 @@ function Ql() {
|
|
|
2646
2646
|
}
|
|
2647
2647
|
function Se() {
|
|
2648
2648
|
return /* @__PURE__ */ n(le, { children: [
|
|
2649
|
-
|
|
2649
|
+
o && /* @__PURE__ */ e(
|
|
2650
2650
|
"div",
|
|
2651
2651
|
{
|
|
2652
2652
|
className: "relative flex w-1/3 min-w-0 grow overflow-hidden text-xs",
|
|
@@ -2663,9 +2663,9 @@ function Ql() {
|
|
|
2663
2663
|
L,
|
|
2664
2664
|
{
|
|
2665
2665
|
variant: "ghost",
|
|
2666
|
-
onClick: () =>
|
|
2666
|
+
onClick: () => c(!o),
|
|
2667
2667
|
className: "absolute bottom-0 right-6 size-7 p-1",
|
|
2668
|
-
children:
|
|
2668
|
+
children: o ? /* @__PURE__ */ e(Ke, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ e(da, { className: "size-3.5 text-muted-foreground" })
|
|
2669
2669
|
}
|
|
2670
2670
|
)
|
|
2671
2671
|
] });
|
|
@@ -2749,14 +2749,14 @@ function Ql() {
|
|
|
2749
2749
|
L,
|
|
2750
2750
|
{
|
|
2751
2751
|
title: "Shift + Enter",
|
|
2752
|
-
disabled: N ||
|
|
2752
|
+
disabled: N || O,
|
|
2753
2753
|
onClick: () => {
|
|
2754
2754
|
z();
|
|
2755
2755
|
},
|
|
2756
2756
|
className: "shrink-0",
|
|
2757
2757
|
size: "sm",
|
|
2758
2758
|
children: [
|
|
2759
|
-
N ||
|
|
2759
|
+
N || O ? /* @__PURE__ */ e(Ue, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(qn, { className: "mr-2 h-4 w-4" }),
|
|
2760
2760
|
"Run"
|
|
2761
2761
|
]
|
|
2762
2762
|
}
|
|
@@ -2830,7 +2830,7 @@ function Ql() {
|
|
|
2830
2830
|
);
|
|
2831
2831
|
}
|
|
2832
2832
|
function Zl({ data: t }) {
|
|
2833
|
-
var
|
|
2833
|
+
var c;
|
|
2834
2834
|
const [s, a] = Me.useState([]), i = Object.keys(t[0]).map((d) => ({
|
|
2835
2835
|
// header: key,
|
|
2836
2836
|
accessorKey: d,
|
|
@@ -2848,7 +2848,7 @@ function Zl({ data: t }) {
|
|
|
2848
2848
|
}
|
|
2849
2849
|
) });
|
|
2850
2850
|
}
|
|
2851
|
-
})),
|
|
2851
|
+
})), o = Hn({
|
|
2852
2852
|
data: t,
|
|
2853
2853
|
columns: i,
|
|
2854
2854
|
getCoreRowModel: Jn(),
|
|
@@ -2861,7 +2861,7 @@ function Zl({ data: t }) {
|
|
|
2861
2861
|
}
|
|
2862
2862
|
});
|
|
2863
2863
|
return /* @__PURE__ */ e("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ n("table", { className: "w-full", children: [
|
|
2864
|
-
/* @__PURE__ */ e(Pn, { children:
|
|
2864
|
+
/* @__PURE__ */ e(Pn, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e(xt, { children: d.headers.map((u) => /* @__PURE__ */ e(
|
|
2865
2865
|
$n,
|
|
2866
2866
|
{
|
|
2867
2867
|
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
@@ -2872,7 +2872,7 @@ function Zl({ data: t }) {
|
|
|
2872
2872
|
},
|
|
2873
2873
|
u.id
|
|
2874
2874
|
)) }, d.id)) }),
|
|
2875
|
-
/* @__PURE__ */ e(Gn, { children: (
|
|
2875
|
+
/* @__PURE__ */ e(Gn, { children: (c = o.getRowModel().rows) != null && c.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e(
|
|
2876
2876
|
xt,
|
|
2877
2877
|
{
|
|
2878
2878
|
className: "whitespace-nowrap py-2",
|
|
@@ -2884,13 +2884,13 @@ function Zl({ data: t }) {
|
|
|
2884
2884
|
] }) });
|
|
2885
2885
|
}
|
|
2886
2886
|
function Xl({ card: t }) {
|
|
2887
|
-
var D, S,
|
|
2888
|
-
const [s, a] =
|
|
2887
|
+
var D, S, M, q, F, G, _, B, p, E, W;
|
|
2888
|
+
const [s, a] = P(!1), [l, i] = P(
|
|
2889
2889
|
[]
|
|
2890
|
-
), { authToken:
|
|
2890
|
+
), { authToken: o } = Te(), c = Wn(o == null ? void 0 : o.accessToken), d = T((A) => A.themeStyle), u = {
|
|
2891
2891
|
colors: ((S = (D = d == null ? void 0 : d.chart) == null ? void 0 : D.dataset) == null ? void 0 : S.backgroundColor) || []
|
|
2892
2892
|
};
|
|
2893
|
-
(
|
|
2893
|
+
(M = t.customCardPreferences) != null && M.inputData;
|
|
2894
2894
|
const { getCard: f } = Na(((q = t.customCardPreferences) == null ? void 0 : q.url) || ""), m = ((F = t.customCardPreferences) == null ? void 0 : F.visualType) || "single", b = h((A) => A.frame), { setCustomCardPreferences: x } = ie(), { data: r } = Le(t), y = za((A, U) => {
|
|
2895
2895
|
i((K) => ({
|
|
2896
2896
|
...K,
|
|
@@ -2908,8 +2908,8 @@ function Xl({ card: t }) {
|
|
|
2908
2908
|
const v = Object.keys(
|
|
2909
2909
|
((B = t.customCardPreferences) == null ? void 0 : B.dataInputCardIds) || {}
|
|
2910
2910
|
).map((A) => {
|
|
2911
|
-
var V, N,
|
|
2912
|
-
const U = (N = (V = t.customCardPreferences) == null ? void 0 : V.dataInputCardIds) == null ? void 0 : N[A].cardId, K = (
|
|
2911
|
+
var V, N, O;
|
|
2912
|
+
const U = (N = (V = t.customCardPreferences) == null ? void 0 : V.dataInputCardIds) == null ? void 0 : N[A].cardId, K = (O = b == null ? void 0 : b.cards) == null ? void 0 : O.find((H) => H.id === U);
|
|
2913
2913
|
return K || null;
|
|
2914
2914
|
});
|
|
2915
2915
|
return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ n(
|
|
@@ -2920,7 +2920,7 @@ function Xl({ card: t }) {
|
|
|
2920
2920
|
g && m === "single" && /* @__PURE__ */ e(
|
|
2921
2921
|
g,
|
|
2922
2922
|
{
|
|
2923
|
-
params:
|
|
2923
|
+
params: c,
|
|
2924
2924
|
theme: u,
|
|
2925
2925
|
settings: (p = t.customCardPreferences) == null ? void 0 : p.settings,
|
|
2926
2926
|
onDataChange: y,
|
|
@@ -2931,9 +2931,9 @@ function Xl({ card: t }) {
|
|
|
2931
2931
|
Object.keys(
|
|
2932
2932
|
((E = t.customCardPreferences) == null ? void 0 : E.dataInputCardIds) || {}
|
|
2933
2933
|
).map((A) => {
|
|
2934
|
-
var V, N,
|
|
2935
|
-
const U = (N = (V = t.customCardPreferences) == null ? void 0 : V.dataInputCardIds) == null ? void 0 : N[A].cardId, K = (
|
|
2936
|
-
(
|
|
2934
|
+
var V, N, O;
|
|
2935
|
+
const U = (N = (V = t.customCardPreferences) == null ? void 0 : V.dataInputCardIds) == null ? void 0 : N[A].cardId, K = (O = b == null ? void 0 : b.cards) == null ? void 0 : O.find(
|
|
2936
|
+
(H) => H.id === U
|
|
2937
2937
|
);
|
|
2938
2938
|
if (K)
|
|
2939
2939
|
return /* @__PURE__ */ e(
|
|
@@ -2974,9 +2974,9 @@ function Ka({
|
|
|
2974
2974
|
...s
|
|
2975
2975
|
}) {
|
|
2976
2976
|
var C;
|
|
2977
|
-
const a = h((v) => v.card), l = ((C = a.customCardPreferences) == null ? void 0 : C.showCardHeader) ?? !0, i = h((v) => v.frame),
|
|
2977
|
+
const a = h((v) => v.card), l = ((C = a.customCardPreferences) == null ? void 0 : C.showCardHeader) ?? !0, i = h((v) => v.frame), o = T((v) => v.dashboard.filters);
|
|
2978
2978
|
h((v) => v.actions.setRunSql);
|
|
2979
|
-
const { updateFilter:
|
|
2979
|
+
const { updateFilter: c } = Je(), d = o == null ? void 0 : o.find((v) => v.id === i.filterId), { data: u, isLoading: f, isFetching: m } = Le(a), { setCard: b } = ie(), { data: x } = Lt(a);
|
|
2980
2980
|
if (!a.id) return null;
|
|
2981
2981
|
let r;
|
|
2982
2982
|
u != null && u.records && (u == null ? void 0 : u.records.length) > 0 && (r = Ca({
|
|
@@ -3047,7 +3047,7 @@ function Ka({
|
|
|
3047
3047
|
{
|
|
3048
3048
|
className: "my-1",
|
|
3049
3049
|
text: d.title || d.column,
|
|
3050
|
-
onSave: (v) =>
|
|
3050
|
+
onSave: (v) => c({ ...d, title: v }),
|
|
3051
3051
|
children: /* @__PURE__ */ e($, { children: d.title })
|
|
3052
3052
|
}
|
|
3053
3053
|
),
|
|
@@ -3153,14 +3153,14 @@ const Yt = ({
|
|
|
3153
3153
|
/* @__PURE__ */ e(L, { onClick: i, variant: "outline", children: "Close" })
|
|
3154
3154
|
] });
|
|
3155
3155
|
function ai() {
|
|
3156
|
-
const [t, s] =
|
|
3157
|
-
var
|
|
3156
|
+
const [t, s] = P(!1), [a, l] = P(""), [i, o] = P(""), [c, d] = P(""), [u, f] = P(""), m = h((S) => S.card), b = h((S) => S.card.customCfg), { data: x } = Le(m), { data: r } = Lt(m), { setCardCustomCfg: y, setCustomVisualCode: g } = ie(), C = (S) => {
|
|
3157
|
+
var M, q;
|
|
3158
3158
|
return JSON.stringify(
|
|
3159
3159
|
{
|
|
3160
3160
|
...S,
|
|
3161
3161
|
data: {
|
|
3162
3162
|
...S.data,
|
|
3163
|
-
datasets: (q = (
|
|
3163
|
+
datasets: (q = (M = S.data) == null ? void 0 : M.datasets) == null ? void 0 : q.map((F) => ({
|
|
3164
3164
|
...F,
|
|
3165
3165
|
data: []
|
|
3166
3166
|
}))
|
|
@@ -3176,8 +3176,8 @@ function ai() {
|
|
|
3176
3176
|
{
|
|
3177
3177
|
tooltip: "Customize Visual",
|
|
3178
3178
|
onClick: () => {
|
|
3179
|
-
var
|
|
3180
|
-
if (!((
|
|
3179
|
+
var M, q;
|
|
3180
|
+
if (!((M = x == null ? void 0 : x.records) != null && M.length)) return;
|
|
3181
3181
|
const S = Ca({
|
|
3182
3182
|
data: x.records,
|
|
3183
3183
|
cardType: m.type,
|
|
@@ -3188,7 +3188,7 @@ function ai() {
|
|
|
3188
3188
|
if (S) {
|
|
3189
3189
|
l(C(S)), d(((q = m.preferences) == null ? void 0 : q.customVisualCode) || "");
|
|
3190
3190
|
const F = ls(S, b);
|
|
3191
|
-
|
|
3191
|
+
o(C(F));
|
|
3192
3192
|
}
|
|
3193
3193
|
},
|
|
3194
3194
|
className: b ? "text-green-600 hover:text-green-700" : "",
|
|
@@ -3202,9 +3202,9 @@ function ai() {
|
|
|
3202
3202
|
/* @__PURE__ */ e(
|
|
3203
3203
|
ei,
|
|
3204
3204
|
{
|
|
3205
|
-
customCode:
|
|
3205
|
+
customCode: c,
|
|
3206
3206
|
customConfig: i,
|
|
3207
|
-
onConfigChange: (S) =>
|
|
3207
|
+
onConfigChange: (S) => o(S ?? ""),
|
|
3208
3208
|
onCodeChange: (S) => d(S ?? "")
|
|
3209
3209
|
}
|
|
3210
3210
|
)
|
|
@@ -3215,18 +3215,18 @@ function ai() {
|
|
|
3215
3215
|
error: u,
|
|
3216
3216
|
hasCustomConfig: !!b,
|
|
3217
3217
|
onReset: () => {
|
|
3218
|
-
|
|
3218
|
+
o(a), y(null);
|
|
3219
3219
|
},
|
|
3220
3220
|
onApply: () => {
|
|
3221
3221
|
try {
|
|
3222
|
-
if (
|
|
3222
|
+
if (c && g(c), i) {
|
|
3223
3223
|
const S = JSON.parse(
|
|
3224
3224
|
i
|
|
3225
|
-
),
|
|
3225
|
+
), M = is(
|
|
3226
3226
|
JSON.parse(a),
|
|
3227
3227
|
S
|
|
3228
3228
|
);
|
|
3229
|
-
y(
|
|
3229
|
+
y(M), f("");
|
|
3230
3230
|
}
|
|
3231
3231
|
} catch {
|
|
3232
3232
|
f("Invalid JSON configuration");
|
|
@@ -3254,7 +3254,7 @@ function Ya(t) {
|
|
|
3254
3254
|
return je({ attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(t);
|
|
3255
3255
|
}
|
|
3256
3256
|
function en(t) {
|
|
3257
|
-
const [s, a] =
|
|
3257
|
+
const [s, a] = P(null);
|
|
3258
3258
|
return s;
|
|
3259
3259
|
}
|
|
3260
3260
|
function tn() {
|
|
@@ -3268,13 +3268,13 @@ function tn() {
|
|
|
3268
3268
|
function si({
|
|
3269
3269
|
onChartTypeChange: t
|
|
3270
3270
|
}) {
|
|
3271
|
-
const [s, a] =
|
|
3271
|
+
const [s, a] = P([]), { data: l } = tn();
|
|
3272
3272
|
return de(() => {
|
|
3273
3273
|
(async () => {
|
|
3274
|
-
var
|
|
3274
|
+
var o;
|
|
3275
3275
|
if (l) {
|
|
3276
3276
|
const d = (await Promise.all(
|
|
3277
|
-
(
|
|
3277
|
+
(o = l == null ? void 0 : l.plugins) == null ? void 0 : o.map(async (u) => (await os(u.value)).visuals.map((b) => ({
|
|
3278
3278
|
name: b.name,
|
|
3279
3279
|
icon: b.icon,
|
|
3280
3280
|
url: u.value
|
|
@@ -3285,14 +3285,14 @@ function si({
|
|
|
3285
3285
|
})();
|
|
3286
3286
|
}, [l]), s.length === 0 ? null : /* @__PURE__ */ n(le, { children: [
|
|
3287
3287
|
/* @__PURE__ */ e(Oe, { className: "my-2" }),
|
|
3288
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 place-items-center", children: s.map((i,
|
|
3288
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 place-items-center", children: s.map((i, o) => /* @__PURE__ */ e(
|
|
3289
3289
|
li,
|
|
3290
3290
|
{
|
|
3291
3291
|
text: i.name,
|
|
3292
3292
|
onClick: () => t("custom", i),
|
|
3293
3293
|
icon: i.icon
|
|
3294
3294
|
},
|
|
3295
|
-
i.url + i.name +
|
|
3295
|
+
i.url + i.name + o
|
|
3296
3296
|
)) })
|
|
3297
3297
|
] });
|
|
3298
3298
|
}
|
|
@@ -3306,9 +3306,9 @@ const li = ({
|
|
|
3306
3306
|
};
|
|
3307
3307
|
function ii() {
|
|
3308
3308
|
var m, b;
|
|
3309
|
-
const [t, s] =
|
|
3309
|
+
const [t, s] = P(!1), a = h((x) => x.card), l = a.type, { setCardType: i, setCardPreferences: o, setChartOrientation: c } = h((x) => x.actions), { setCardCustomCfg: d, setCustomCardPreferences: u } = ie();
|
|
3310
3310
|
function f(x, r) {
|
|
3311
|
-
d(null),
|
|
3311
|
+
d(null), o({}), i(x), r && u({
|
|
3312
3312
|
type: "component",
|
|
3313
3313
|
visualType: "single",
|
|
3314
3314
|
url: r.url,
|
|
@@ -3598,14 +3598,14 @@ function oi() {
|
|
|
3598
3598
|
}
|
|
3599
3599
|
function ea() {
|
|
3600
3600
|
var V;
|
|
3601
|
-
const t = h((N) => N.frame), s = h((N) => N.card), a = h((N) => N.isShowingVisual), l = h((N) => N.isSqlRunning), i = h((N) => N.pythonStdOut),
|
|
3601
|
+
const t = h((N) => N.frame), s = h((N) => N.card), a = h((N) => N.isShowingVisual), l = h((N) => N.isSqlRunning), i = h((N) => N.pythonStdOut), o = h(
|
|
3602
3602
|
(N) => {
|
|
3603
|
-
var
|
|
3604
|
-
return (
|
|
3603
|
+
var O;
|
|
3604
|
+
return (O = N.card.preferences) == null ? void 0 : O.chartOptions;
|
|
3605
3605
|
}
|
|
3606
3606
|
);
|
|
3607
3607
|
h((N) => N.actions.setRunSql);
|
|
3608
|
-
const
|
|
3608
|
+
const c = ds(o), {
|
|
3609
3609
|
setFrame: d,
|
|
3610
3610
|
setCard: u,
|
|
3611
3611
|
updateCardInFrame: f,
|
|
@@ -3635,12 +3635,12 @@ function ea() {
|
|
|
3635
3635
|
D(N);
|
|
3636
3636
|
}
|
|
3637
3637
|
function D(N) {
|
|
3638
|
-
const
|
|
3638
|
+
const O = {
|
|
3639
3639
|
...t,
|
|
3640
3640
|
cards: [...t.cards, N],
|
|
3641
3641
|
activeCardId: N.id
|
|
3642
3642
|
};
|
|
3643
|
-
d(
|
|
3643
|
+
d(O), m(N.id);
|
|
3644
3644
|
}
|
|
3645
3645
|
function S() {
|
|
3646
3646
|
const N = {
|
|
@@ -3651,40 +3651,40 @@ function ea() {
|
|
|
3651
3651
|
};
|
|
3652
3652
|
D(N);
|
|
3653
3653
|
}
|
|
3654
|
-
function
|
|
3655
|
-
const
|
|
3654
|
+
function M(N) {
|
|
3655
|
+
const O = t.cards.filter((X) => X.id !== N), H = O[0], Z = {
|
|
3656
3656
|
...t,
|
|
3657
|
-
cards:
|
|
3657
|
+
cards: O,
|
|
3658
3658
|
// update the active card to the first card in the frame
|
|
3659
|
-
activeCardId:
|
|
3659
|
+
activeCardId: H.id
|
|
3660
3660
|
};
|
|
3661
|
-
d(Z), m(
|
|
3661
|
+
d(Z), m(H.id), u(H);
|
|
3662
3662
|
}
|
|
3663
3663
|
function q(N) {
|
|
3664
3664
|
m(N);
|
|
3665
3665
|
}
|
|
3666
|
-
const F = (N,
|
|
3667
|
-
console.log("handleDragStart",
|
|
3666
|
+
const F = (N, O) => {
|
|
3667
|
+
console.log("handleDragStart", O), N.dataTransfer.setData("tabIndex", O.toString());
|
|
3668
3668
|
}, G = (N) => {
|
|
3669
3669
|
N.preventDefault();
|
|
3670
|
-
}, _ = (N,
|
|
3671
|
-
const
|
|
3672
|
-
if (
|
|
3673
|
-
const Z = Array.from(t.cards), [X] = Z.splice(parseInt(
|
|
3674
|
-
Z.splice(
|
|
3670
|
+
}, _ = (N, O) => {
|
|
3671
|
+
const H = N.dataTransfer.getData("tabIndex");
|
|
3672
|
+
if (H === O.toString()) return;
|
|
3673
|
+
const Z = Array.from(t.cards), [X] = Z.splice(parseInt(H), 1);
|
|
3674
|
+
Z.splice(O, 0, X), d({ ...t, cards: Z });
|
|
3675
3675
|
};
|
|
3676
|
-
function B(N,
|
|
3677
|
-
return N.cards.length === 1 && (
|
|
3676
|
+
function B(N, O) {
|
|
3677
|
+
return N.cards.length === 1 && (O.displayTab === !0 || O.displayTab === void 0) || N.activeCardId !== O.id && (O.displayTab === !0 || O.displayTab === void 0) ? null : /* @__PURE__ */ e(
|
|
3678
3678
|
"div",
|
|
3679
3679
|
{
|
|
3680
3680
|
onClick: () => {
|
|
3681
|
-
const
|
|
3682
|
-
u({ ...
|
|
3683
|
-
...
|
|
3684
|
-
displayTab:
|
|
3681
|
+
const H = O.displayTab === void 0 ? !1 : !O.displayTab;
|
|
3682
|
+
u({ ...O, displayTab: H }), f({
|
|
3683
|
+
...O,
|
|
3684
|
+
displayTab: H
|
|
3685
3685
|
});
|
|
3686
3686
|
},
|
|
3687
|
-
children:
|
|
3687
|
+
children: O.displayTab === !0 || O.displayTab === void 0 ? /* @__PURE__ */ e(fs, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e(Xs, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
3688
3688
|
}
|
|
3689
3689
|
);
|
|
3690
3690
|
}
|
|
@@ -3698,20 +3698,20 @@ function ea() {
|
|
|
3698
3698
|
children: [
|
|
3699
3699
|
t.cards.map((N) => /* @__PURE__ */ e(St, { className: "mt-0 grow", value: N.id, children: E() }, N.id)),
|
|
3700
3700
|
/* @__PURE__ */ e(Oa, { className: "group mx-6 justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center", children: [
|
|
3701
|
-
t.cards.map((N,
|
|
3701
|
+
t.cards.map((N, O) => /* @__PURE__ */ e(
|
|
3702
3702
|
at,
|
|
3703
3703
|
{
|
|
3704
3704
|
text: N.tabTitle || N.title,
|
|
3705
|
-
onSave: (
|
|
3706
|
-
u({ ...s, tabTitle:
|
|
3705
|
+
onSave: (H) => {
|
|
3706
|
+
u({ ...s, tabTitle: H }), f({ ...s, tabTitle: H });
|
|
3707
3707
|
},
|
|
3708
3708
|
children: /* @__PURE__ */ n(
|
|
3709
3709
|
Ct,
|
|
3710
3710
|
{
|
|
3711
3711
|
draggable: !0,
|
|
3712
|
-
onDragStart: (
|
|
3712
|
+
onDragStart: (H) => F(H, O),
|
|
3713
3713
|
onDragOver: G,
|
|
3714
|
-
onDrop: (
|
|
3714
|
+
onDrop: (H) => _(H, O),
|
|
3715
3715
|
className: "",
|
|
3716
3716
|
value: N.id,
|
|
3717
3717
|
children: [
|
|
@@ -3721,7 +3721,7 @@ function ea() {
|
|
|
3721
3721
|
Ke,
|
|
3722
3722
|
{
|
|
3723
3723
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3724
|
-
onClick: () =>
|
|
3724
|
+
onClick: () => M(N.id)
|
|
3725
3725
|
}
|
|
3726
3726
|
)
|
|
3727
3727
|
]
|
|
@@ -3764,17 +3764,17 @@ function ea() {
|
|
|
3764
3764
|
) }) }) }) : /* @__PURE__ */ e(mt, { FallbackComponent: wa, children: /* @__PURE__ */ e(Ka, { className: "grow border-none shadow-none" }) });
|
|
3765
3765
|
}
|
|
3766
3766
|
function W() {
|
|
3767
|
-
const N = JSON.stringify(r == null ? void 0 : r.records, null, 2),
|
|
3768
|
-
Z.href =
|
|
3767
|
+
const N = JSON.stringify(r == null ? void 0 : r.records, null, 2), O = new Blob([N], { type: "application/json" }), H = URL.createObjectURL(O), Z = document.createElement("a");
|
|
3768
|
+
Z.href = H, Z.download = `${s.title}.json`, Z.click();
|
|
3769
3769
|
}
|
|
3770
3770
|
function A() {
|
|
3771
|
-
const
|
|
3771
|
+
const O = [
|
|
3772
3772
|
Object.keys(
|
|
3773
3773
|
r == null ? void 0 : r.records.reduce((j, z) => ({ ...j, ...z }), {})
|
|
3774
3774
|
).join(","),
|
|
3775
3775
|
...((r == null ? void 0 : r.records) || []).map((j) => Object.values(j).join(","))
|
|
3776
3776
|
].join(`
|
|
3777
|
-
`),
|
|
3777
|
+
`), H = new Blob([O], { type: "text/csv" }), Z = URL.createObjectURL(H), X = document.createElement("a");
|
|
3778
3778
|
X.href = Z, X.download = `${s.title}.csv`, X.click();
|
|
3779
3779
|
}
|
|
3780
3780
|
function U() {
|
|
@@ -3782,7 +3782,8 @@ function ea() {
|
|
|
3782
3782
|
b(N);
|
|
3783
3783
|
}
|
|
3784
3784
|
function K() {
|
|
3785
|
-
|
|
3785
|
+
const N = ["xy", "none", "x", "y"], H = (N.indexOf(c) + 1) % N.length;
|
|
3786
|
+
x(N[H]);
|
|
3786
3787
|
}
|
|
3787
3788
|
return /* @__PURE__ */ n("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3788
3789
|
(y || g) && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e(Ue, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
|
|
@@ -3834,10 +3835,10 @@ function ea() {
|
|
|
3834
3835
|
"text",
|
|
3835
3836
|
"map"
|
|
3836
3837
|
].includes(s.type) && /* @__PURE__ */ n(rt, { tooltip: "Grid Style", onClick: K, children: [
|
|
3837
|
-
(
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3838
|
+
(c === "xy" || !c) && /* @__PURE__ */ e(tl, { className: "size-4" }),
|
|
3839
|
+
c === "x" && /* @__PURE__ */ e(Ws, { className: "size-4" }),
|
|
3840
|
+
c === "y" && /* @__PURE__ */ e(pl, { className: "size-4" }),
|
|
3841
|
+
c === "none" && /* @__PURE__ */ e(bl, { className: "size-4" })
|
|
3841
3842
|
] })
|
|
3842
3843
|
] }),
|
|
3843
3844
|
/* @__PURE__ */ e(di, {})
|
|
@@ -3946,7 +3947,7 @@ function Ne({
|
|
|
3946
3947
|
),
|
|
3947
3948
|
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
|
|
3948
3949
|
/* @__PURE__ */ e(Ce, { children: t }),
|
|
3949
|
-
s.map((
|
|
3950
|
+
s.map((o) => /* @__PURE__ */ e(Q, { value: o.value, children: o.label }, o.value))
|
|
3950
3951
|
] }) })
|
|
3951
3952
|
] });
|
|
3952
3953
|
}
|
|
@@ -3975,27 +3976,27 @@ function hi() {
|
|
|
3975
3976
|
var g, C;
|
|
3976
3977
|
const t = h(
|
|
3977
3978
|
(v) => v.card.customCardPreferences
|
|
3978
|
-
), { data: s } = tn(), a = (s == null ? void 0 : s.plugins) || [], l = h((v) => v.card), i = h((v) => v.frame),
|
|
3979
|
+
), { data: s } = tn(), a = (s == null ? void 0 : s.plugins) || [], l = h((v) => v.card), i = h((v) => v.frame), o = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: c } = ie(), { components: d, manifest: u } = Na(
|
|
3979
3980
|
(t == null ? void 0 : t.url) || ""
|
|
3980
3981
|
), f = (g = u == null ? void 0 : u.visuals) == null ? void 0 : g.find(
|
|
3981
3982
|
(v) => v.name === (t == null ? void 0 : t.componentName)
|
|
3982
3983
|
);
|
|
3983
3984
|
function m(v, D) {
|
|
3984
3985
|
if (!t) return;
|
|
3985
|
-
const
|
|
3986
|
+
const M = {
|
|
3986
3987
|
...(t == null ? void 0 : t.dataInputCardIds) || {},
|
|
3987
3988
|
[v]: {
|
|
3988
3989
|
cardId: D,
|
|
3989
3990
|
hookRef: null
|
|
3990
3991
|
}
|
|
3991
3992
|
};
|
|
3992
|
-
|
|
3993
|
+
c({
|
|
3993
3994
|
...t,
|
|
3994
|
-
dataInputCardIds:
|
|
3995
|
+
dataInputCardIds: M
|
|
3995
3996
|
});
|
|
3996
3997
|
}
|
|
3997
3998
|
function b(v) {
|
|
3998
|
-
var S,
|
|
3999
|
+
var S, M;
|
|
3999
4000
|
const D = (S = i == null ? void 0 : i.cards) == null ? void 0 : S.filter((q) => {
|
|
4000
4001
|
var F;
|
|
4001
4002
|
return ((F = q == null ? void 0 : q.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
|
|
@@ -4003,7 +4004,7 @@ function hi() {
|
|
|
4003
4004
|
value: q.id,
|
|
4004
4005
|
label: q.tabTitle || q.title
|
|
4005
4006
|
}));
|
|
4006
|
-
return /* @__PURE__ */ e("div", { className: "space-y-2", children: (
|
|
4007
|
+
return /* @__PURE__ */ e("div", { className: "space-y-2", children: (M = v == null ? void 0 : v.dataInputs) == null ? void 0 : M.map((q, F) => {
|
|
4007
4008
|
var G, _;
|
|
4008
4009
|
return /* @__PURE__ */ n(
|
|
4009
4010
|
"div",
|
|
@@ -4028,14 +4029,14 @@ function hi() {
|
|
|
4028
4029
|
}) });
|
|
4029
4030
|
}
|
|
4030
4031
|
function x(v, D, S = []) {
|
|
4031
|
-
var
|
|
4032
|
+
var M, q;
|
|
4032
4033
|
return t ? v === "input" ? /* @__PURE__ */ e(
|
|
4033
4034
|
he,
|
|
4034
4035
|
{
|
|
4035
4036
|
className: `h-8 w-full ${Pe}`,
|
|
4036
|
-
value: ((
|
|
4037
|
+
value: ((M = t == null ? void 0 : t.settings) == null ? void 0 : M[D]) || "",
|
|
4037
4038
|
onChange: (F) => {
|
|
4038
|
-
|
|
4039
|
+
c({
|
|
4039
4040
|
...t,
|
|
4040
4041
|
settings: {
|
|
4041
4042
|
...t == null ? void 0 : t.settings,
|
|
@@ -4053,7 +4054,7 @@ function hi() {
|
|
|
4053
4054
|
options: S,
|
|
4054
4055
|
value: ((q = t == null ? void 0 : t.settings) == null ? void 0 : q[D]) || "",
|
|
4055
4056
|
onValueChange: (F) => {
|
|
4056
|
-
|
|
4057
|
+
c({
|
|
4057
4058
|
...t,
|
|
4058
4059
|
settings: { ...t == null ? void 0 : t.settings, [D]: F }
|
|
4059
4060
|
});
|
|
@@ -4063,17 +4064,17 @@ function hi() {
|
|
|
4063
4064
|
}
|
|
4064
4065
|
function r(v) {
|
|
4065
4066
|
const D = Object.entries((v == null ? void 0 : v.settings) || {});
|
|
4066
|
-
return /* @__PURE__ */ e("div", { className: "space-y-3", children: D.map(([S,
|
|
4067
|
-
/* @__PURE__ */ e($, { children:
|
|
4067
|
+
return /* @__PURE__ */ e("div", { className: "space-y-3", children: D.map(([S, M]) => /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4068
|
+
/* @__PURE__ */ e($, { children: M.title }),
|
|
4068
4069
|
x(
|
|
4069
|
-
|
|
4070
|
+
M.ui,
|
|
4070
4071
|
S,
|
|
4071
|
-
|
|
4072
|
+
M.options
|
|
4072
4073
|
)
|
|
4073
4074
|
] }, S)) });
|
|
4074
4075
|
}
|
|
4075
4076
|
function y(v) {
|
|
4076
|
-
t &&
|
|
4077
|
+
t && c({
|
|
4077
4078
|
...t,
|
|
4078
4079
|
visualType: v,
|
|
4079
4080
|
componentName: ""
|
|
@@ -4092,7 +4093,7 @@ function hi() {
|
|
|
4092
4093
|
label: "",
|
|
4093
4094
|
options: a,
|
|
4094
4095
|
value: (t == null ? void 0 : t.url) || "",
|
|
4095
|
-
onValueChange: (v) =>
|
|
4096
|
+
onValueChange: (v) => c({
|
|
4096
4097
|
...t || {
|
|
4097
4098
|
url: "",
|
|
4098
4099
|
componentName: ""
|
|
@@ -4108,7 +4109,7 @@ function hi() {
|
|
|
4108
4109
|
{ value: "single", label: "Single Visual" },
|
|
4109
4110
|
{ value: "multiple", label: "Multi-Visual" }
|
|
4110
4111
|
],
|
|
4111
|
-
value:
|
|
4112
|
+
value: o,
|
|
4112
4113
|
onValueChange: y
|
|
4113
4114
|
}
|
|
4114
4115
|
),
|
|
@@ -4120,14 +4121,14 @@ function hi() {
|
|
|
4120
4121
|
className: "h-8 w-full",
|
|
4121
4122
|
label: "",
|
|
4122
4123
|
options: (d == null ? void 0 : d.filter(
|
|
4123
|
-
(v) => v.type ===
|
|
4124
|
+
(v) => v.type === o
|
|
4124
4125
|
).map((v) => ({
|
|
4125
4126
|
value: v.name,
|
|
4126
4127
|
label: v.name
|
|
4127
4128
|
}))) || [],
|
|
4128
4129
|
value: t.componentName,
|
|
4129
4130
|
onValueChange: (v) => {
|
|
4130
|
-
console.log("changing value", v),
|
|
4131
|
+
console.log("changing value", v), c({
|
|
4131
4132
|
...t,
|
|
4132
4133
|
componentName: v
|
|
4133
4134
|
});
|
|
@@ -4149,11 +4150,11 @@ function hi() {
|
|
|
4149
4150
|
);
|
|
4150
4151
|
}
|
|
4151
4152
|
function Ee() {
|
|
4152
|
-
const [t, s] =
|
|
4153
|
+
const [t, s] = P([]);
|
|
4153
4154
|
h(
|
|
4154
4155
|
(m) => m.card.cfg
|
|
4155
4156
|
);
|
|
4156
|
-
const a = h((m) => m.card.preferences), { setCardCfg: l, setFilterOnClickColumnIndex: i, setCardPreferences:
|
|
4157
|
+
const a = h((m) => m.card.preferences), { setCardCfg: l, setFilterOnClickColumnIndex: i, setCardPreferences: o } = h((m) => m.actions), c = h(
|
|
4157
4158
|
(m) => m.queryResultColumns
|
|
4158
4159
|
);
|
|
4159
4160
|
h(
|
|
@@ -4162,11 +4163,11 @@ function Ee() {
|
|
|
4162
4163
|
return (b = m.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
4163
4164
|
}
|
|
4164
4165
|
), de(() => {
|
|
4165
|
-
|
|
4166
|
-
}, [
|
|
4166
|
+
c && s(new Array(c.length).fill(!1));
|
|
4167
|
+
}, [c]);
|
|
4167
4168
|
function d(m, b) {
|
|
4168
4169
|
var x, r;
|
|
4169
|
-
b ? a != null && a.onClickFilter && ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.length) > 0 ?
|
|
4170
|
+
b ? a != null && a.onClickFilter && ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.length) > 0 ? o({
|
|
4170
4171
|
...a,
|
|
4171
4172
|
onClickFilter: [
|
|
4172
4173
|
...a.onClickFilter,
|
|
@@ -4175,7 +4176,7 @@ function Ee() {
|
|
|
4175
4176
|
expression: ""
|
|
4176
4177
|
}
|
|
4177
4178
|
]
|
|
4178
|
-
}) :
|
|
4179
|
+
}) : o({
|
|
4179
4180
|
...a,
|
|
4180
4181
|
onClickFilter: [
|
|
4181
4182
|
{
|
|
@@ -4183,7 +4184,7 @@ function Ee() {
|
|
|
4183
4184
|
expression: ""
|
|
4184
4185
|
}
|
|
4185
4186
|
]
|
|
4186
|
-
}) : (
|
|
4187
|
+
}) : (o({
|
|
4187
4188
|
...a,
|
|
4188
4189
|
onClickFilter: (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.filter(
|
|
4189
4190
|
(y) => y.columnIndex !== m
|
|
@@ -4199,7 +4200,7 @@ function Ee() {
|
|
|
4199
4200
|
...y,
|
|
4200
4201
|
expression: b.target.value
|
|
4201
4202
|
} : y);
|
|
4202
|
-
|
|
4203
|
+
o({
|
|
4203
4204
|
...a,
|
|
4204
4205
|
onClickFilter: x
|
|
4205
4206
|
});
|
|
@@ -4220,7 +4221,7 @@ function Ee() {
|
|
|
4220
4221
|
}
|
|
4221
4222
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4222
4223
|
/* @__PURE__ */ e($, { children: "On Click" }),
|
|
4223
|
-
|
|
4224
|
+
c == null ? void 0 : c.map((m, b) => {
|
|
4224
4225
|
var x, r;
|
|
4225
4226
|
return /* @__PURE__ */ e(
|
|
4226
4227
|
"div",
|
|
@@ -4268,19 +4269,19 @@ function Ee() {
|
|
|
4268
4269
|
] });
|
|
4269
4270
|
}
|
|
4270
4271
|
function ft() {
|
|
4271
|
-
var
|
|
4272
|
+
var c, d, u;
|
|
4272
4273
|
const t = h((f) => f.card.preferences), s = h(
|
|
4273
4274
|
(f) => f.card.cfg
|
|
4274
4275
|
), { setCardCfg: a, setCardPreferences: l, setChartOrientation: i } = h((f) => f.actions);
|
|
4275
|
-
(
|
|
4276
|
-
function
|
|
4276
|
+
(c = s == null ? void 0 : s.options) != null && c.indexAxis;
|
|
4277
|
+
function o(f) {
|
|
4277
4278
|
i(f);
|
|
4278
4279
|
}
|
|
4279
4280
|
return /* @__PURE__ */ n(
|
|
4280
4281
|
pt,
|
|
4281
4282
|
{
|
|
4282
4283
|
value: ((d = t == null ? void 0 : t.chartOptions) == null ? void 0 : d.indexAxis) || ((u = s == null ? void 0 : s.options) == null ? void 0 : u.indexAxis) || "x",
|
|
4283
|
-
onValueChange:
|
|
4284
|
+
onValueChange: o,
|
|
4284
4285
|
className: "flex gap-3",
|
|
4285
4286
|
defaultValue: "x",
|
|
4286
4287
|
children: [
|
|
@@ -4298,25 +4299,25 @@ function ft() {
|
|
|
4298
4299
|
}
|
|
4299
4300
|
const et = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
4300
4301
|
function ta(t, s) {
|
|
4301
|
-
var l, i,
|
|
4302
|
+
var l, i, o;
|
|
4302
4303
|
const a = Ia(t, s);
|
|
4303
|
-
return ((
|
|
4304
|
+
return ((o = (i = (l = t == null ? void 0 : t.chartOptions) == null ? void 0 : l.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
|
|
4304
4305
|
}
|
|
4305
4306
|
function an() {
|
|
4306
|
-
var V, N,
|
|
4307
|
-
const [t, s] =
|
|
4307
|
+
var V, N, O, H, Z, X;
|
|
4308
|
+
const [t, s] = P(!1), a = h((j) => {
|
|
4308
4309
|
var z;
|
|
4309
4310
|
return (z = j.card) == null ? void 0 : z.preferences;
|
|
4310
4311
|
}), l = h((j) => {
|
|
4311
4312
|
var z;
|
|
4312
4313
|
return (z = j.card) == null ? void 0 : z.cfg;
|
|
4313
|
-
}), i = Ia(a, l), [
|
|
4314
|
+
}), i = Ia(a, l), [o, c] = P(
|
|
4314
4315
|
ta(a)
|
|
4315
|
-
), [d, u] =
|
|
4316
|
-
((
|
|
4317
|
-
), [f, m] =
|
|
4318
|
-
((X = (Z = (
|
|
4319
|
-
), [b, x] =
|
|
4316
|
+
), [d, u] = P(
|
|
4317
|
+
((O = (N = (V = a == null ? void 0 : a.chartOptions) == null ? void 0 : V.scales) == null ? void 0 : N[i]) == null ? void 0 : O.min) || ""
|
|
4318
|
+
), [f, m] = P(
|
|
4319
|
+
((X = (Z = (H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : Z[i]) == null ? void 0 : X.max) || ""
|
|
4320
|
+
), [b, x] = P(d || f ? "custom" : "auto"), [r, y] = P(""), [g, C] = P(0), [v, D] = P(""), [S, M] = P(""), [q, F] = P(""), G = h(
|
|
4320
4321
|
(j) => j.actions.setCardPreferences
|
|
4321
4322
|
), { updateCardInFrame: _ } = ie(), B = h((j) => j.card), p = h((j) => {
|
|
4322
4323
|
var z;
|
|
@@ -4324,11 +4325,11 @@ function an() {
|
|
|
4324
4325
|
}), E = ["pie", "doughnut", "polarArea"].includes(p);
|
|
4325
4326
|
de(() => {
|
|
4326
4327
|
var j, z, ue, k, J, ne, oe, Se, xe, Y, ce, I, re, ye;
|
|
4327
|
-
|
|
4328
|
+
c(ta(a)), u(
|
|
4328
4329
|
((ue = (z = (j = a == null ? void 0 : a.chartOptions) == null ? void 0 : j.scales) == null ? void 0 : z[i]) == null ? void 0 : ue.min) === 0 ? 0 : ""
|
|
4329
4330
|
), m(((ne = (J = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : J[i]) == null ? void 0 : ne.max) || ""), y(
|
|
4330
4331
|
((Y = (xe = (Se = (oe = a == null ? void 0 : a.chartOptions) == null ? void 0 : oe.scales) == null ? void 0 : Se[i]) == null ? void 0 : xe.ticks) == null ? void 0 : Y.stepSize) || ""
|
|
4331
|
-
), C(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.decimalPlaces) || 0), D(((I = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : I.suffix) || ""),
|
|
4332
|
+
), C(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.decimalPlaces) || 0), D(((I = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : I.suffix) || ""), M(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.currency) || ""), F(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.locale) || "");
|
|
4332
4333
|
}, [t, a, i]);
|
|
4333
4334
|
function W(j, z) {
|
|
4334
4335
|
return z === "" || /^[0-9\b]+$/.test(z) ? Number(z) : Number(j);
|
|
@@ -4358,7 +4359,7 @@ function an() {
|
|
|
4358
4359
|
me,
|
|
4359
4360
|
{
|
|
4360
4361
|
value: S || "none",
|
|
4361
|
-
onValueChange: (z) =>
|
|
4362
|
+
onValueChange: (z) => M(z === "none" ? "" : z),
|
|
4362
4363
|
children: [
|
|
4363
4364
|
/* @__PURE__ */ e(pe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, {}) }),
|
|
4364
4365
|
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
|
|
@@ -4452,8 +4453,8 @@ function an() {
|
|
|
4452
4453
|
...(k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales,
|
|
4453
4454
|
[i]: {
|
|
4454
4455
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
4455
|
-
type:
|
|
4456
|
-
...
|
|
4456
|
+
type: o,
|
|
4457
|
+
...o === "linear" ? j : {}
|
|
4457
4458
|
}
|
|
4458
4459
|
}
|
|
4459
4460
|
},
|
|
@@ -4485,8 +4486,8 @@ function an() {
|
|
|
4485
4486
|
me,
|
|
4486
4487
|
{
|
|
4487
4488
|
disabled: E,
|
|
4488
|
-
value:
|
|
4489
|
-
onValueChange: (j) =>
|
|
4489
|
+
value: o,
|
|
4490
|
+
onValueChange: (j) => c(j),
|
|
4490
4491
|
children: [
|
|
4491
4492
|
/* @__PURE__ */ e(pe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, {}) }),
|
|
4492
4493
|
/* @__PURE__ */ e(ge, { id: "type", children: /* @__PURE__ */ n(ke, { children: [
|
|
@@ -4498,7 +4499,7 @@ function an() {
|
|
|
4498
4499
|
}
|
|
4499
4500
|
)
|
|
4500
4501
|
] }),
|
|
4501
|
-
|
|
4502
|
+
o == "linear" && /* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4502
4503
|
/* @__PURE__ */ e($, { htmlFor: "scale-option", children: "Setup" }),
|
|
4503
4504
|
/* @__PURE__ */ n(
|
|
4504
4505
|
pt,
|
|
@@ -4522,7 +4523,7 @@ function an() {
|
|
|
4522
4523
|
}
|
|
4523
4524
|
)
|
|
4524
4525
|
] }),
|
|
4525
|
-
b === "custom" &&
|
|
4526
|
+
b === "custom" && o == "linear" && U(),
|
|
4526
4527
|
A(),
|
|
4527
4528
|
/* @__PURE__ */ e(bs, {}),
|
|
4528
4529
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e(
|
|
@@ -4550,8 +4551,8 @@ function mi({ idx: t }) {
|
|
|
4550
4551
|
}
|
|
4551
4552
|
), l = h(
|
|
4552
4553
|
(u) => u.actions.setCardPreferences
|
|
4553
|
-
), i = (d = s == null ? void 0 : s.chartOptions) == null ? void 0 : d.indexAxis,
|
|
4554
|
-
function
|
|
4554
|
+
), i = (d = s == null ? void 0 : s.chartOptions) == null ? void 0 : d.indexAxis, o = a == null ? void 0 : a.find((u) => u.idx === t);
|
|
4555
|
+
function c(u, f) {
|
|
4555
4556
|
(u === "end" || u === "start") && xs(vs());
|
|
4556
4557
|
const m = {
|
|
4557
4558
|
display: u !== "none",
|
|
@@ -4559,7 +4560,7 @@ function mi({ idx: t }) {
|
|
|
4559
4560
|
anchor: u,
|
|
4560
4561
|
clamp: !0
|
|
4561
4562
|
};
|
|
4562
|
-
if (!
|
|
4563
|
+
if (!o)
|
|
4563
4564
|
l({
|
|
4564
4565
|
...s,
|
|
4565
4566
|
datasetOptions: [
|
|
@@ -4571,7 +4572,7 @@ function mi({ idx: t }) {
|
|
|
4571
4572
|
]
|
|
4572
4573
|
});
|
|
4573
4574
|
else {
|
|
4574
|
-
const b = { ...
|
|
4575
|
+
const b = { ...o };
|
|
4575
4576
|
b.datalabels = m;
|
|
4576
4577
|
const x = a == null ? void 0 : a.map(
|
|
4577
4578
|
(r) => r.idx === f ? b : r
|
|
@@ -4588,7 +4589,7 @@ function mi({ idx: t }) {
|
|
|
4588
4589
|
/* @__PURE__ */ e(
|
|
4589
4590
|
L,
|
|
4590
4591
|
{
|
|
4591
|
-
onClick: () =>
|
|
4592
|
+
onClick: () => c("none", t),
|
|
4592
4593
|
size: "sm",
|
|
4593
4594
|
variant: "secondary",
|
|
4594
4595
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4598,7 +4599,7 @@ function mi({ idx: t }) {
|
|
|
4598
4599
|
/* @__PURE__ */ e(
|
|
4599
4600
|
L,
|
|
4600
4601
|
{
|
|
4601
|
-
onClick: () =>
|
|
4602
|
+
onClick: () => c("start", t),
|
|
4602
4603
|
size: "sm",
|
|
4603
4604
|
variant: "secondary",
|
|
4604
4605
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4615,7 +4616,7 @@ function mi({ idx: t }) {
|
|
|
4615
4616
|
/* @__PURE__ */ e(
|
|
4616
4617
|
L,
|
|
4617
4618
|
{
|
|
4618
|
-
onClick: () =>
|
|
4619
|
+
onClick: () => c("center", t),
|
|
4619
4620
|
size: "sm",
|
|
4620
4621
|
variant: "secondary",
|
|
4621
4622
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4632,7 +4633,7 @@ function mi({ idx: t }) {
|
|
|
4632
4633
|
/* @__PURE__ */ e(
|
|
4633
4634
|
L,
|
|
4634
4635
|
{
|
|
4635
|
-
onClick: () =>
|
|
4636
|
+
onClick: () => c("end", t),
|
|
4636
4637
|
size: "sm",
|
|
4637
4638
|
variant: "secondary",
|
|
4638
4639
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4656,11 +4657,11 @@ function nn() {
|
|
|
4656
4657
|
return (x = (b = (m = f == null ? void 0 : f.card) == null ? void 0 : m.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : x.indexAxis;
|
|
4657
4658
|
}
|
|
4658
4659
|
), { data: a } = Le(t), l = s === "y" ? "Y axis" : "X axis", i = s === "y" ? "X axis" : "Y axis", {
|
|
4659
|
-
keys:
|
|
4660
|
-
metricKeys:
|
|
4660
|
+
keys: o,
|
|
4661
|
+
metricKeys: c,
|
|
4661
4662
|
dimensionKeys: d
|
|
4662
4663
|
} = Nt((a == null ? void 0 : a.records) || []);
|
|
4663
|
-
let u =
|
|
4664
|
+
let u = c;
|
|
4664
4665
|
if (["stackedBar", "stackedLine"].includes(t.type)) {
|
|
4665
4666
|
const f = Ns({
|
|
4666
4667
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
@@ -4670,7 +4671,7 @@ function nn() {
|
|
|
4670
4671
|
}), { metricKeys: m } = Nt(f);
|
|
4671
4672
|
u = m;
|
|
4672
4673
|
}
|
|
4673
|
-
return
|
|
4674
|
+
return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
4674
4675
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4675
4676
|
/* @__PURE__ */ e($, { children: l }),
|
|
4676
4677
|
/* @__PURE__ */ e("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e("div", { className: "rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: /* @__PURE__ */ e("p", { title: d[0], children: sn(d[0]) }) }) })
|
|
@@ -4696,10 +4697,10 @@ function pi({ col: t, idx: s }) {
|
|
|
4696
4697
|
var u;
|
|
4697
4698
|
return (u = d.card.preferences) == null ? void 0 : u.datasetOptions;
|
|
4698
4699
|
}
|
|
4699
|
-
), i = l == null ? void 0 : l.find((d) => d.idx === s), { setCardPreferences:
|
|
4700
|
-
function
|
|
4700
|
+
), i = l == null ? void 0 : l.find((d) => d.idx === s), { setCardPreferences: o } = h((d) => d.actions);
|
|
4701
|
+
function c(d) {
|
|
4701
4702
|
if (!i)
|
|
4702
|
-
|
|
4703
|
+
o({
|
|
4703
4704
|
...a,
|
|
4704
4705
|
datasetOptions: [
|
|
4705
4706
|
...l || [],
|
|
@@ -4716,7 +4717,7 @@ function pi({ col: t, idx: s }) {
|
|
|
4716
4717
|
const f = l == null ? void 0 : l.map(
|
|
4717
4718
|
(m) => m.idx === s ? u : m
|
|
4718
4719
|
);
|
|
4719
|
-
|
|
4720
|
+
o({
|
|
4720
4721
|
...a,
|
|
4721
4722
|
datasetOptions: f
|
|
4722
4723
|
});
|
|
@@ -4728,21 +4729,21 @@ function pi({ col: t, idx: s }) {
|
|
|
4728
4729
|
/* @__PURE__ */ e(
|
|
4729
4730
|
Et,
|
|
4730
4731
|
{
|
|
4731
|
-
onClick: () =>
|
|
4732
|
+
onClick: () => c("bar"),
|
|
4732
4733
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4733
4734
|
}
|
|
4734
4735
|
),
|
|
4735
4736
|
/* @__PURE__ */ e(
|
|
4736
4737
|
Vt,
|
|
4737
4738
|
{
|
|
4738
|
-
onClick: () =>
|
|
4739
|
+
onClick: () => c("line"),
|
|
4739
4740
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4740
4741
|
}
|
|
4741
4742
|
),
|
|
4742
4743
|
/* @__PURE__ */ e(
|
|
4743
4744
|
Us,
|
|
4744
4745
|
{
|
|
4745
|
-
onClick: () =>
|
|
4746
|
+
onClick: () => c("area"),
|
|
4746
4747
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4747
4748
|
}
|
|
4748
4749
|
),
|
|
@@ -4751,7 +4752,7 @@ function pi({ col: t, idx: s }) {
|
|
|
4751
4752
|
] });
|
|
4752
4753
|
}
|
|
4753
4754
|
function ln() {
|
|
4754
|
-
const t = h((r) => r.selectedConnectionId), s = h((r) => r.selectedDatamodelId), a = h((r) => r.selectedDatabaseName), l = h((r) => r.selectedSchemaName), i = h((r) => r.selectedTableName),
|
|
4755
|
+
const t = h((r) => r.selectedConnectionId), s = h((r) => r.selectedDatamodelId), a = h((r) => r.selectedDatabaseName), l = h((r) => r.selectedSchemaName), i = h((r) => r.selectedTableName), o = T((r) => r.dashboard.filters) || [], c = T((r) => r.actions.addFilter), d = T((r) => r.actions.removeFilter), { removeFilterValues: u } = Je(), { modelItems: f, tableName: m, connectionType: b } = Ae();
|
|
4755
4756
|
function x(r, y = "dashboard") {
|
|
4756
4757
|
var G;
|
|
4757
4758
|
const g = ve(r.column_name), C = ve(a || ""), v = ve(l || ""), D = ve(m);
|
|
@@ -4759,23 +4760,23 @@ function ln() {
|
|
|
4759
4760
|
v,
|
|
4760
4761
|
D,
|
|
4761
4762
|
b
|
|
4762
|
-
),
|
|
4763
|
+
), M = `${S}.${g}`;
|
|
4763
4764
|
const q = (G = f == null ? void 0 : f.find(
|
|
4764
4765
|
(_) => _.id === s
|
|
4765
4766
|
)) == null ? void 0 : G.name;
|
|
4766
|
-
s && s !== "none" && (
|
|
4767
|
-
const F =
|
|
4768
|
-
(_) => _.column ===
|
|
4767
|
+
s && s !== "none" && (M = `${Kt}.${q}.${g}`, S = `${Kt}.${q}`);
|
|
4768
|
+
const F = o == null ? void 0 : o.find(
|
|
4769
|
+
(_) => _.column === M && _.table === D && (_.database === C || _.database === a)
|
|
4769
4770
|
);
|
|
4770
4771
|
if (F)
|
|
4771
4772
|
u(F.id), d(F.id);
|
|
4772
4773
|
else {
|
|
4773
4774
|
const _ = Be();
|
|
4774
|
-
return m === "api" && t ? (
|
|
4775
|
+
return m === "api" && t ? (c({
|
|
4775
4776
|
location: y,
|
|
4776
4777
|
id: _,
|
|
4777
4778
|
//uuidv4(),
|
|
4778
|
-
column:
|
|
4779
|
+
column: M,
|
|
4779
4780
|
title: r.column_name,
|
|
4780
4781
|
dataType: r.data_type,
|
|
4781
4782
|
table: "api",
|
|
@@ -4789,11 +4790,11 @@ function ln() {
|
|
|
4789
4790
|
g
|
|
4790
4791
|
)
|
|
4791
4792
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4792
|
-
}), _) : (
|
|
4793
|
+
}), _) : (c({
|
|
4793
4794
|
id: _,
|
|
4794
4795
|
//uuidv4(),
|
|
4795
4796
|
location: y,
|
|
4796
|
-
column:
|
|
4797
|
+
column: M,
|
|
4797
4798
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4798
4799
|
title: r.column_name,
|
|
4799
4800
|
dataType: r.data_type,
|
|
@@ -4816,23 +4817,23 @@ function Re() {
|
|
|
4816
4817
|
const t = T(
|
|
4817
4818
|
(d) => d.dashboard.filters
|
|
4818
4819
|
), s = h((d) => d.frame), { setFrame: a } = ie(), { columns: l } = Ae(), { assignFilter: i } = ln();
|
|
4819
|
-
function
|
|
4820
|
+
function o(d) {
|
|
4820
4821
|
const u = i(d, "frame");
|
|
4821
4822
|
a({ ...s, filterId: u });
|
|
4822
4823
|
}
|
|
4823
|
-
const
|
|
4824
|
+
const c = t == null ? void 0 : t.find((d) => d.id === s.filterId);
|
|
4824
4825
|
return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
|
|
4825
4826
|
/* @__PURE__ */ e($, { children: "Card Filter" }),
|
|
4826
|
-
/* @__PURE__ */ e(fi, { onSelect:
|
|
4827
|
-
|
|
4827
|
+
/* @__PURE__ */ e(fi, { onSelect: o, columns: l }),
|
|
4828
|
+
c && /* @__PURE__ */ e(Ta, { filter: c })
|
|
4828
4829
|
] });
|
|
4829
4830
|
}
|
|
4830
4831
|
function fi({
|
|
4831
4832
|
columns: t,
|
|
4832
4833
|
onSelect: s
|
|
4833
4834
|
}) {
|
|
4834
|
-
var
|
|
4835
|
-
const [a, l] = Qt.useState(!1), [i,
|
|
4835
|
+
var c;
|
|
4836
|
+
const [a, l] = Qt.useState(!1), [i, o] = Qt.useState("");
|
|
4836
4837
|
return /* @__PURE__ */ n(Qe, { open: a, onOpenChange: l, children: [
|
|
4837
4838
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ n(
|
|
4838
4839
|
L,
|
|
@@ -4843,7 +4844,7 @@ function fi({
|
|
|
4843
4844
|
"aria-expanded": a,
|
|
4844
4845
|
className: "w-full justify-between font-normal",
|
|
4845
4846
|
children: [
|
|
4846
|
-
i ? (
|
|
4847
|
+
i ? (c = t.find((d) => d.column_name === i)) == null ? void 0 : c.column_name : "Select Column...",
|
|
4847
4848
|
/* @__PURE__ */ e(Ss, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4848
4849
|
]
|
|
4849
4850
|
}
|
|
@@ -4858,7 +4859,7 @@ function fi({
|
|
|
4858
4859
|
value: d.column_name,
|
|
4859
4860
|
onSelect: (u) => {
|
|
4860
4861
|
const f = u === i ? "" : u;
|
|
4861
|
-
|
|
4862
|
+
o(f), l(!1), f && s(d);
|
|
4862
4863
|
},
|
|
4863
4864
|
children: [
|
|
4864
4865
|
d.column_name,
|
|
@@ -4925,7 +4926,7 @@ function gi({
|
|
|
4925
4926
|
] }) });
|
|
4926
4927
|
}
|
|
4927
4928
|
function qt() {
|
|
4928
|
-
var i,
|
|
4929
|
+
var i, o, c;
|
|
4929
4930
|
const t = h(
|
|
4930
4931
|
(d) => d.card.cfg
|
|
4931
4932
|
), s = h((d) => d.actions.setCardCfg), a = h((d) => d.card.type);
|
|
@@ -4958,7 +4959,7 @@ function qt() {
|
|
|
4958
4959
|
/* @__PURE__ */ n(
|
|
4959
4960
|
me,
|
|
4960
4961
|
{
|
|
4961
|
-
value: (
|
|
4962
|
+
value: (c = (o = (i = t == null ? void 0 : t.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : c.anchor,
|
|
4962
4963
|
onValueChange: l,
|
|
4963
4964
|
defaultValue: "none",
|
|
4964
4965
|
children: [
|
|
@@ -4994,7 +4995,7 @@ function yi({
|
|
|
4994
4995
|
"a",
|
|
4995
4996
|
{
|
|
4996
4997
|
target: "_blank",
|
|
4997
|
-
onClick: (
|
|
4998
|
+
onClick: (o) => o.stopPropagation(),
|
|
4998
4999
|
className: "text-blue-700",
|
|
4999
5000
|
href: "https://docs.semaphor.cloud/docs/charts/bubble",
|
|
5000
5001
|
children: "example"
|
|
@@ -5189,12 +5190,12 @@ function Ci() {
|
|
|
5189
5190
|
h(
|
|
5190
5191
|
(r) => r.actions.setFilterOnClickField
|
|
5191
5192
|
);
|
|
5192
|
-
const
|
|
5193
|
+
const o = h(
|
|
5193
5194
|
(r) => {
|
|
5194
5195
|
var y, g;
|
|
5195
5196
|
return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.colorRanges;
|
|
5196
5197
|
}
|
|
5197
|
-
) || [],
|
|
5198
|
+
) || [], c = h(
|
|
5198
5199
|
(r) => r.actions.setColorRanges
|
|
5199
5200
|
), d = [...new Set(ot.map((r) => r.currency))];
|
|
5200
5201
|
return /* @__PURE__ */ n("div", { children: [
|
|
@@ -5321,8 +5322,8 @@ function Ci() {
|
|
|
5321
5322
|
/* @__PURE__ */ e(
|
|
5322
5323
|
zs,
|
|
5323
5324
|
{
|
|
5324
|
-
colorRanges:
|
|
5325
|
-
setColorRanges:
|
|
5325
|
+
colorRanges: o,
|
|
5326
|
+
setColorRanges: c
|
|
5326
5327
|
}
|
|
5327
5328
|
)
|
|
5328
5329
|
] })
|
|
@@ -5460,10 +5461,10 @@ const wi = [
|
|
|
5460
5461
|
value: t
|
|
5461
5462
|
}));
|
|
5462
5463
|
function Mi() {
|
|
5463
|
-
var u, f, m, b, x, r, y, g, C, v, D, S,
|
|
5464
|
-
const t = h((p) => p.card), s = (f = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : f.topoJsonUrl, [a, l] =
|
|
5464
|
+
var u, f, m, b, x, r, y, g, C, v, D, S, M, q, F, G, _, B;
|
|
5465
|
+
const t = h((p) => p.card), s = (f = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : f.topoJsonUrl, [a, l] = P(
|
|
5465
5466
|
((b = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
|
|
5466
|
-
), { setCardPreferences: i } = ie(), { data:
|
|
5467
|
+
), { setCardPreferences: i } = ie(), { data: o } = Lt(t), c = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
|
|
5467
5468
|
label: p,
|
|
5468
5469
|
value: p
|
|
5469
5470
|
})) || [];
|
|
@@ -5523,14 +5524,14 @@ function Mi() {
|
|
|
5523
5524
|
placeholder: "Custom URL"
|
|
5524
5525
|
}
|
|
5525
5526
|
),
|
|
5526
|
-
|
|
5527
|
+
o && /* @__PURE__ */ n(le, { children: [
|
|
5527
5528
|
/* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
5528
5529
|
/* @__PURE__ */ e($, { children: "Map Object" }),
|
|
5529
5530
|
/* @__PURE__ */ e(
|
|
5530
5531
|
Ne,
|
|
5531
5532
|
{
|
|
5532
5533
|
className: "h-9",
|
|
5533
|
-
options:
|
|
5534
|
+
options: c,
|
|
5534
5535
|
value: ((r = (x = t.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : r.objectKey) || "",
|
|
5535
5536
|
label: "Map Object",
|
|
5536
5537
|
onValueChange: (p) => {
|
|
@@ -5620,7 +5621,7 @@ function Mi() {
|
|
|
5620
5621
|
className: `h-9 w-full ${Pe}`,
|
|
5621
5622
|
type: "number",
|
|
5622
5623
|
step: 10,
|
|
5623
|
-
value: ((F = (q = (
|
|
5624
|
+
value: ((F = (q = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : F[0]) || 0,
|
|
5624
5625
|
onChange: (p) => {
|
|
5625
5626
|
var E, W, A, U;
|
|
5626
5627
|
i({
|
|
@@ -5746,8 +5747,8 @@ function tt({
|
|
|
5746
5747
|
function Ti() {
|
|
5747
5748
|
const t = h(
|
|
5748
5749
|
(l) => {
|
|
5749
|
-
var i,
|
|
5750
|
-
return (
|
|
5750
|
+
var i, o;
|
|
5751
|
+
return (o = (i = l == null ? void 0 : l.card) == null ? void 0 : i.preferences) == null ? void 0 : o.sortChart;
|
|
5751
5752
|
}
|
|
5752
5753
|
), { setSortChart: s } = ie();
|
|
5753
5754
|
function a() {
|
|
@@ -5828,8 +5829,8 @@ function Di({
|
|
|
5828
5829
|
}) {
|
|
5829
5830
|
console.log("cardType", t);
|
|
5830
5831
|
const s = h((i) => {
|
|
5831
|
-
var
|
|
5832
|
-
return (
|
|
5832
|
+
var o;
|
|
5833
|
+
return (o = i.card) == null ? void 0 : o.preferences;
|
|
5833
5834
|
}), a = h(
|
|
5834
5835
|
(i) => i.actions.setCardPreferences
|
|
5835
5836
|
);
|
|
@@ -6003,13 +6004,13 @@ function Ei() {
|
|
|
6003
6004
|
);
|
|
6004
6005
|
}
|
|
6005
6006
|
function Vi({ authToken: t, onSave: s, onClose: a }) {
|
|
6006
|
-
T((
|
|
6007
|
-
const l = h((
|
|
6007
|
+
T((c) => c.themeStyle);
|
|
6008
|
+
const l = h((c) => c.actions.setOnSave), i = h((c) => c.actions.setOnClose), o = T((c) => c.actions.setAuthToken);
|
|
6008
6009
|
return de(() => {
|
|
6009
6010
|
s && l(s), a && i(a);
|
|
6010
6011
|
}, [s, l, a, i]), de(() => {
|
|
6011
|
-
t && t.accessToken &&
|
|
6012
|
-
}, [t,
|
|
6012
|
+
t && t.accessToken && o(t);
|
|
6013
|
+
}, [t, o]), /* @__PURE__ */ e(mt, { FallbackComponent: Da, children: /* @__PURE__ */ n(
|
|
6013
6014
|
Ls,
|
|
6014
6015
|
{
|
|
6015
6016
|
style: {
|
|
@@ -6026,12 +6027,12 @@ function Vi({ authToken: t, onSave: s, onClose: a }) {
|
|
|
6026
6027
|
) });
|
|
6027
6028
|
}
|
|
6028
6029
|
function qi() {
|
|
6029
|
-
T((
|
|
6030
|
-
const t = T((
|
|
6031
|
-
function i(
|
|
6032
|
-
t && (l(t,
|
|
6030
|
+
T((c) => c.selectedCardId);
|
|
6031
|
+
const t = T((c) => c.selectedSheetId), { setIsVisualEditing: s } = T((c) => c.actions), a = T((c) => c.isVisualEditing), l = T((c) => c.actions.updateFrame);
|
|
6032
|
+
function i(c) {
|
|
6033
|
+
t && (l(t, c), s(!1));
|
|
6033
6034
|
}
|
|
6034
|
-
function
|
|
6035
|
+
function o() {
|
|
6035
6036
|
s(!1);
|
|
6036
6037
|
}
|
|
6037
6038
|
return /* @__PURE__ */ e(
|
|
@@ -6041,32 +6042,32 @@ function qi() {
|
|
|
6041
6042
|
className: se("flex grow", {
|
|
6042
6043
|
"max-h-0 overflow-hidden": !a
|
|
6043
6044
|
}),
|
|
6044
|
-
children: /* @__PURE__ */ e(Vi, { onSave: i, onClose:
|
|
6045
|
+
children: /* @__PURE__ */ e(Vi, { onSave: i, onClose: o })
|
|
6045
6046
|
}
|
|
6046
6047
|
);
|
|
6047
6048
|
}
|
|
6048
6049
|
function ji() {
|
|
6049
|
-
const t = h((
|
|
6050
|
-
return /* @__PURE__ */ e(Ie, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((
|
|
6051
|
-
const
|
|
6052
|
-
(d) => d.column === ve(
|
|
6050
|
+
const t = h((o) => o.selectedDatabaseName), s = h((o) => o.selectedTableName), a = T((o) => o.dashboard.filters) || [], { columns: l } = Ae(), { assignFilter: i } = ln();
|
|
6051
|
+
return /* @__PURE__ */ e(Ie, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((o) => {
|
|
6052
|
+
const c = a == null ? void 0 : a.find(
|
|
6053
|
+
(d) => d.column === ve(o.column_name) && d.table === s && d.database === t
|
|
6053
6054
|
);
|
|
6054
6055
|
return /* @__PURE__ */ e(
|
|
6055
6056
|
"div",
|
|
6056
6057
|
{
|
|
6057
|
-
onClick: () => i(
|
|
6058
|
+
onClick: () => i(o),
|
|
6058
6059
|
className: se(
|
|
6059
6060
|
"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",
|
|
6060
6061
|
{
|
|
6061
|
-
"bg-muted":
|
|
6062
|
+
"bg-muted": c
|
|
6062
6063
|
}
|
|
6063
6064
|
),
|
|
6064
6065
|
children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
6065
|
-
/* @__PURE__ */ e(Ga, { column:
|
|
6066
|
-
/* @__PURE__ */ e("span", { children:
|
|
6066
|
+
/* @__PURE__ */ e(Ga, { column: o }),
|
|
6067
|
+
/* @__PURE__ */ e("span", { children: o.column_name })
|
|
6067
6068
|
] })
|
|
6068
6069
|
},
|
|
6069
|
-
|
|
6070
|
+
o.column_name
|
|
6070
6071
|
);
|
|
6071
6072
|
}) });
|
|
6072
6073
|
}
|