react-semaphor 0.0.389 → 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
|
|
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
|
|
@@ -475,7 +475,7 @@ const dl = R("MessageSquareMore", [
|
|
|
475
475
|
* This source code is licensed under the ISC license.
|
|
476
476
|
* See the LICENSE file in the root directory of this source tree.
|
|
477
477
|
*/
|
|
478
|
-
const
|
|
478
|
+
const ul = R("Network", [
|
|
479
479
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
480
480
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
481
481
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -488,7 +488,7 @@ const hl = R("Network", [
|
|
|
488
488
|
* This source code is licensed under the ISC license.
|
|
489
489
|
* See the LICENSE file in the root directory of this source tree.
|
|
490
490
|
*/
|
|
491
|
-
const
|
|
491
|
+
const hl = R("Plug2", [
|
|
492
492
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
493
493
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
494
494
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -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,9 +772,9 @@ 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(
|
|
779
779
|
b
|
|
780
780
|
), C = await kl(
|
|
@@ -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(
|
|
@@ -806,7 +806,7 @@ function Ml() {
|
|
|
806
806
|
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
807
807
|
/* @__PURE__ */ e($, { className: "text-right", children: "Name" }),
|
|
808
808
|
/* @__PURE__ */ e(
|
|
809
|
-
|
|
809
|
+
he,
|
|
810
810
|
{
|
|
811
811
|
value: t,
|
|
812
812
|
onChange: (g) => {
|
|
@@ -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
|
-
async function
|
|
841
|
-
if (await Ol(m,
|
|
840
|
+
async function u(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: [
|
|
@@ -872,7 +872,7 @@ function Il() {
|
|
|
872
872
|
/* @__PURE__ */ e(ra, { className: "px-3", children: "Lenses" }),
|
|
873
873
|
/* @__PURE__ */ e(oa, {}),
|
|
874
874
|
/* @__PURE__ */ n(
|
|
875
|
-
|
|
875
|
+
un,
|
|
876
876
|
{
|
|
877
877
|
value: l,
|
|
878
878
|
onValueChange: d,
|
|
@@ -903,10 +903,10 @@ function Il() {
|
|
|
903
903
|
}
|
|
904
904
|
),
|
|
905
905
|
/* @__PURE__ */ e(
|
|
906
|
-
|
|
906
|
+
ut,
|
|
907
907
|
{
|
|
908
908
|
onClick: (b) => {
|
|
909
|
-
b.preventDefault(),
|
|
909
|
+
b.preventDefault(), u(m.id);
|
|
910
910
|
},
|
|
911
911
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
912
912
|
strokeWidth: 1.5
|
|
@@ -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() {
|
|
@@ -962,7 +962,7 @@ function Dl({
|
|
|
962
962
|
size: "sm",
|
|
963
963
|
onClick: l,
|
|
964
964
|
children: a ? /* @__PURE__ */ e(Ue, { className: se("size-3.5 animate-spin", t) }) : /* @__PURE__ */ e(
|
|
965
|
-
|
|
965
|
+
hn,
|
|
966
966
|
{
|
|
967
967
|
className: se("size-3.5", t),
|
|
968
968
|
strokeWidth: 1.5
|
|
@@ -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,
|
|
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",
|
|
@@ -1019,7 +1019,7 @@ function zl() {
|
|
|
1019
1019
|
v(!0);
|
|
1020
1020
|
};
|
|
1021
1021
|
async function B() {
|
|
1022
|
-
if (
|
|
1022
|
+
if (u(!0), !a || !l) return;
|
|
1023
1023
|
const p = $a(
|
|
1024
1024
|
i
|
|
1025
1025
|
), E = JSON.stringify(p), W = {
|
|
@@ -1027,7 +1027,7 @@ function zl() {
|
|
|
1027
1027
|
template: E,
|
|
1028
1028
|
filterValues: f
|
|
1029
1029
|
};
|
|
1030
|
-
await kt(W, t == null ? void 0 : t.accessToken), nt.success("Lens saved"), x == null || x(p),
|
|
1030
|
+
await kt(W, t == null ? void 0 : t.accessToken), nt.success("Lens saved"), x == null || x(p), u(!1);
|
|
1031
1031
|
}
|
|
1032
1032
|
return m ? null : /* @__PURE__ */ n(
|
|
1033
1033
|
"div",
|
|
@@ -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",
|
|
@@ -1075,10 +1075,10 @@ function zl() {
|
|
|
1075
1075
|
v(!1), D(!1);
|
|
1076
1076
|
},
|
|
1077
1077
|
size: "sm",
|
|
1078
|
-
children: /* @__PURE__ */ e(
|
|
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,10 +1112,10 @@ 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
|
-
showNone:
|
|
1118
|
+
showNone: u = !1,
|
|
1119
1119
|
className: f,
|
|
1120
1120
|
showIcon: m = !0,
|
|
1121
1121
|
disabled: b = !1
|
|
@@ -1123,20 +1123,20 @@ function He({
|
|
|
1123
1123
|
const x = l ? "Loading..." : i ? "Error" : a;
|
|
1124
1124
|
function r() {
|
|
1125
1125
|
if (t === "Connection")
|
|
1126
|
-
return /* @__PURE__ */ e(
|
|
1126
|
+
return /* @__PURE__ */ e(hl, { className: "size-4 rotate-90" });
|
|
1127
1127
|
if (t === "Database")
|
|
1128
1128
|
return /* @__PURE__ */ e(Qs, { className: "size-4" });
|
|
1129
1129
|
if (t === "Schema")
|
|
1130
|
-
return /* @__PURE__ */ e(
|
|
1130
|
+
return /* @__PURE__ */ e(ul, { className: "size-4" });
|
|
1131
1131
|
if (t === "Table")
|
|
1132
1132
|
return /* @__PURE__ */ e(xl, { className: "size-4" });
|
|
1133
1133
|
if (t === "Model")
|
|
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(
|
|
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,12 +1161,12 @@ 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
|
] }),
|
|
1168
1168
|
/* @__PURE__ */ n(le, { children: [
|
|
1169
|
-
|
|
1169
|
+
u && /* @__PURE__ */ e(Q, { value: "none", children: "None" }, "none"),
|
|
1170
1170
|
s && s.map((y, g) => /* @__PURE__ */ e(Q, { value: y.id, children: y.name }, g))
|
|
1171
1171
|
] }),
|
|
1172
1172
|
(l || i) && /* @__PURE__ */ e(Q, { value: x, children: x })
|
|
@@ -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(
|
|
@@ -1191,7 +1191,7 @@ function Ll({ column: t }) {
|
|
|
1191
1191
|
ve(i || ""),
|
|
1192
1192
|
ve(l),
|
|
1193
1193
|
v,
|
|
1194
|
-
|
|
1194
|
+
u
|
|
1195
1195
|
);
|
|
1196
1196
|
D && (m(D), b(!0)), a(!1);
|
|
1197
1197
|
}
|
|
@@ -1252,9 +1252,9 @@ function Ll({ column: t }) {
|
|
|
1252
1252
|
] });
|
|
1253
1253
|
}
|
|
1254
1254
|
function Ga({ column: t }) {
|
|
1255
|
-
return /* @__PURE__ */ n(
|
|
1255
|
+
return /* @__PURE__ */ n(ua, { children: [
|
|
1256
1256
|
/* @__PURE__ */ e(gn, { asChild: !0, children: yn(t.data_type) ? /* @__PURE__ */ e(Pa, { className: "size-3" }) : ba(t.data_type) ? /* @__PURE__ */ e(nl, { className: "size-3" }) : bn(t.data_type) ? /* @__PURE__ */ e(xn, { className: "size-3" }) : vn(t.data_type) ? /* @__PURE__ */ e(Cl, { className: "size-3" }) : t.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e(Bs, { className: "size-3" }) : /* @__PURE__ */ e(gl, { className: "size-3" }) }),
|
|
1257
|
-
/* @__PURE__ */ e(
|
|
1257
|
+
/* @__PURE__ */ e(ha, { children: /* @__PURE__ */ e("p", { className: "font-mono text-xs", children: t.data_type }) })
|
|
1258
1258
|
] });
|
|
1259
1259
|
}
|
|
1260
1260
|
function Fl({
|
|
@@ -1263,19 +1263,19 @@ function Fl({
|
|
|
1263
1263
|
columns: a,
|
|
1264
1264
|
status: l
|
|
1265
1265
|
}) {
|
|
1266
|
-
const i =
|
|
1266
|
+
const i = h((p) => p.sqlGen), o = h(
|
|
1267
1267
|
(p) => p.selectedConnectionId
|
|
1268
|
-
),
|
|
1268
|
+
), c = h(
|
|
1269
1269
|
(p) => p.selectedDatabaseName
|
|
1270
|
-
), d =
|
|
1270
|
+
), d = h(
|
|
1271
1271
|
(p) => p.selectedSchemaName
|
|
1272
|
-
),
|
|
1272
|
+
), u = h((p) => p.selectedTableName), f = h(
|
|
1273
1273
|
(p) => p.selectedDatamodelId
|
|
1274
1274
|
), m = T(
|
|
1275
1275
|
(p) => p.dashboard.aiScopeTables
|
|
1276
|
-
), { addToAIScope: b, removeFromAIScope: x } = Je(), { setAIScopeTables: r } = T((p) => p.actions), y =
|
|
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 =
|
|
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 && (
|
|
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
|
-
tableName:
|
|
1306
|
-
datamodelName: st(
|
|
1305
|
+
tableName: u || "",
|
|
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
|
-
tableName:
|
|
1316
|
-
datamodelName: st(
|
|
1315
|
+
tableName: u || "",
|
|
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);
|
|
@@ -1440,33 +1440,33 @@ function Fl({
|
|
|
1440
1440
|
function Ae(t, s) {
|
|
1441
1441
|
var jt, Rt, _t, Ht, Pt, $t;
|
|
1442
1442
|
let a = wt(() => [], []);
|
|
1443
|
-
const l = Te().authToken || t, i =
|
|
1443
|
+
const l = Te().authToken || t, i = h(
|
|
1444
1444
|
(w) => w.selectedConnectionId
|
|
1445
|
-
),
|
|
1445
|
+
), o = h(
|
|
1446
1446
|
(w) => w.selectedDatamodelId
|
|
1447
|
-
),
|
|
1447
|
+
), c = h(
|
|
1448
1448
|
(w) => w.selectedDatabaseName
|
|
1449
|
-
), d =
|
|
1449
|
+
), d = h(
|
|
1450
1450
|
(w) => w.selectedSchemaName
|
|
1451
|
-
),
|
|
1451
|
+
), u = h((w) => w.selectedTableName), f = h(
|
|
1452
1452
|
(w) => w.actions.setCurrentColumns
|
|
1453
|
-
), m =
|
|
1453
|
+
), m = h(
|
|
1454
1454
|
(w) => w.actions.setSelectedConnectionId
|
|
1455
|
-
), b =
|
|
1455
|
+
), b = h(
|
|
1456
1456
|
(w) => w.actions.setSelectedDatamodelId
|
|
1457
|
-
), x =
|
|
1457
|
+
), x = h(
|
|
1458
1458
|
(w) => w.actions.setSelectedDatabaseName
|
|
1459
|
-
), r =
|
|
1459
|
+
), r = h(
|
|
1460
1460
|
(w) => w.actions.setSelectedSchemaName
|
|
1461
|
-
), y =
|
|
1461
|
+
), y = h(
|
|
1462
1462
|
(w) => w.actions.setSelectedTableName
|
|
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,26 +1520,26 @@ 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,
|
|
1542
|
-
isLoading:
|
|
1542
|
+
isLoading: ue,
|
|
1543
1543
|
isFetching: k,
|
|
1544
1544
|
isError: J,
|
|
1545
1545
|
refetch: ne
|
|
@@ -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,21 +1570,21 @@ 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
|
],
|
|
1578
1578
|
queryFn: () => Ve(
|
|
1579
1579
|
"https://semaphor.cloud/api/v1/columns",
|
|
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
|
-
table_name:
|
|
1587
|
+
table_name: u
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
1590
|
enabled: C(E)
|
|
@@ -1607,7 +1607,7 @@ function Ae(t, s) {
|
|
|
1607
1607
|
r,
|
|
1608
1608
|
b
|
|
1609
1609
|
]);
|
|
1610
|
-
const I = (p == null ? void 0 : p.type) === "API" ? (jt = p == null ? void 0 : p.type) == null ? void 0 : jt.toLowerCase() :
|
|
1610
|
+
const I = (p == null ? void 0 : p.type) === "API" ? (jt = p == null ? void 0 : p.type) == null ? void 0 : jt.toLowerCase() : u || "", re = W ? "" : d || "";
|
|
1611
1611
|
function ye(w) {
|
|
1612
1612
|
r(w), y("");
|
|
1613
1613
|
}
|
|
@@ -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,10 +1658,10 @@ 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
|
-
isTableLoadingOrFetching:
|
|
1664
|
+
isTableLoadingOrFetching: ue || k,
|
|
1665
1665
|
isTableError: J,
|
|
1666
1666
|
columns: a,
|
|
1667
1667
|
isColumnsLoadingOrFetching: Se || xe,
|
|
@@ -1686,19 +1686,19 @@ function Ba({
|
|
|
1686
1686
|
ColumnsComponent: t
|
|
1687
1687
|
}) {
|
|
1688
1688
|
var xe;
|
|
1689
|
-
const s =
|
|
1689
|
+
const s = h(
|
|
1690
1690
|
(Y) => Y.selectedConnectionId
|
|
1691
|
-
), a =
|
|
1691
|
+
), a = h(
|
|
1692
1692
|
(Y) => Y.selectedDatamodelId
|
|
1693
|
-
), l =
|
|
1693
|
+
), l = h(
|
|
1694
1694
|
(Y) => Y.selectedDatabaseName
|
|
1695
|
-
), i =
|
|
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,
|
|
1701
|
-
modelItems:
|
|
1701
|
+
modelItems: u,
|
|
1702
1702
|
schemaItems: f,
|
|
1703
1703
|
databaseItems: m,
|
|
1704
1704
|
tableItems: b,
|
|
@@ -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
|
|
@@ -1741,7 +1741,7 @@ function Ba({
|
|
|
1741
1741
|
}
|
|
1742
1742
|
);
|
|
1743
1743
|
}
|
|
1744
|
-
function
|
|
1744
|
+
function ue() {
|
|
1745
1745
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1746
1746
|
}
|
|
1747
1747
|
function k() {
|
|
@@ -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,
|
|
@@ -1780,7 +1780,7 @@ function Ba({
|
|
|
1780
1780
|
onChange: Z,
|
|
1781
1781
|
isError: C,
|
|
1782
1782
|
isLoading: y,
|
|
1783
|
-
items:
|
|
1783
|
+
items: u,
|
|
1784
1784
|
value: a || "",
|
|
1785
1785
|
title: "Model"
|
|
1786
1786
|
}
|
|
@@ -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;
|
|
@@ -1845,7 +1845,7 @@ function Ba({
|
|
|
1845
1845
|
/* @__PURE__ */ e("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ n(
|
|
1846
1846
|
L,
|
|
1847
1847
|
{
|
|
1848
|
-
onClick:
|
|
1848
|
+
onClick: ue,
|
|
1849
1849
|
size: "sm",
|
|
1850
1850
|
variant: "secondary",
|
|
1851
1851
|
className: "w-full",
|
|
@@ -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,23 +1899,23 @@ 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) => {
|
|
1906
1906
|
var J;
|
|
1907
1907
|
return (J = k == null ? void 0 : k.card) == null ? void 0 : J.python;
|
|
1908
|
-
}), f =
|
|
1908
|
+
}), f = h((k) => k.actions.setCardSql), m = h((k) => k.actions.setRunSql), b = h(
|
|
1909
1909
|
(k) => k.actions.switchCardType
|
|
1910
|
-
), x =
|
|
1910
|
+
), x = h((k) => k.userInputForAI), r = h((k) => k.triggerAIRun), y = h(
|
|
1911
1911
|
(k) => k.selectedDatabaseName
|
|
1912
|
-
), g =
|
|
1912
|
+
), g = h((k) => k.selectedTableName), C = h(
|
|
1913
1913
|
(k) => k.selectedConnectionId
|
|
1914
|
-
), v =
|
|
1914
|
+
), v = h(
|
|
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(() => {
|
|
@@ -1972,7 +1972,7 @@ function Vl() {
|
|
|
1972
1972
|
return d ? {
|
|
1973
1973
|
status: "success",
|
|
1974
1974
|
sql: d,
|
|
1975
|
-
python:
|
|
1975
|
+
python: u || ""
|
|
1976
1976
|
} : {
|
|
1977
1977
|
status: "error",
|
|
1978
1978
|
message: "No SQL found"
|
|
@@ -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 || ""
|
|
@@ -2049,7 +2049,7 @@ function Vl() {
|
|
|
2049
2049
|
X(ne);
|
|
2050
2050
|
}
|
|
2051
2051
|
}
|
|
2052
|
-
const
|
|
2052
|
+
const ue = !["ready", "error"].includes(A);
|
|
2053
2053
|
return {
|
|
2054
2054
|
messages: G,
|
|
2055
2055
|
setMessages: _,
|
|
@@ -2057,10 +2057,10 @@ function Vl() {
|
|
|
2057
2057
|
append: p,
|
|
2058
2058
|
input: E,
|
|
2059
2059
|
setInput: W,
|
|
2060
|
-
isLoading:
|
|
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 =
|
|
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
|
}
|
|
@@ -2132,7 +2132,7 @@ function jl() {
|
|
|
2132
2132
|
/* @__PURE__ */ e(
|
|
2133
2133
|
bt,
|
|
2134
2134
|
{
|
|
2135
|
-
checked:
|
|
2135
|
+
checked: u,
|
|
2136
2136
|
onCheckedChange: f,
|
|
2137
2137
|
children: "System Message"
|
|
2138
2138
|
}
|
|
@@ -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,9 +2220,9 @@ function jl() {
|
|
|
2220
2220
|
Mn,
|
|
2221
2221
|
{
|
|
2222
2222
|
messages: r,
|
|
2223
|
-
showTools:
|
|
2223
|
+
showTools: c,
|
|
2224
2224
|
handleRun: U,
|
|
2225
|
-
showSystemMessage:
|
|
2225
|
+
showSystemMessage: u
|
|
2226
2226
|
}
|
|
2227
2227
|
),
|
|
2228
2228
|
/* @__PURE__ */ e(
|
|
@@ -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,21 +2349,21 @@ function Bl(t) {
|
|
|
2349
2349
|
var {
|
|
2350
2350
|
attr: l,
|
|
2351
2351
|
size: i,
|
|
2352
|
-
title:
|
|
2353
|
-
} = t,
|
|
2354
|
-
return a.className && (
|
|
2352
|
+
title: o
|
|
2353
|
+
} = t, c = _l(t, Rl), d = i || a.size || "1em", u;
|
|
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,
|
|
2359
|
-
className:
|
|
2358
|
+
}, a.attr, l, c, {
|
|
2359
|
+
className: u,
|
|
2360
2360
|
style: dt(dt({
|
|
2361
2361
|
color: t.color || a.color
|
|
2362
2362
|
}, a.style), t.style),
|
|
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 =
|
|
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
|
-
|
|
2390
|
+
u(o, i), f(!0);
|
|
2391
2391
|
}
|
|
2392
2392
|
}, [
|
|
2393
|
-
c,
|
|
2394
|
-
i,
|
|
2395
|
-
h,
|
|
2396
2393
|
o,
|
|
2394
|
+
i,
|
|
2395
|
+
u,
|
|
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 =
|
|
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: {
|
|
@@ -2461,12 +2461,12 @@ function Jl() {
|
|
|
2461
2461
|
);
|
|
2462
2462
|
}
|
|
2463
2463
|
function Wl() {
|
|
2464
|
-
const t =
|
|
2464
|
+
const t = h((i) => i.card.python), { setCardPython: s } = ie(), { handleEditorDidMount: a } = Wa("python");
|
|
2465
2465
|
function l(i) {
|
|
2466
2466
|
s(i);
|
|
2467
2467
|
}
|
|
2468
2468
|
return /* @__PURE__ */ e(
|
|
2469
|
-
|
|
2469
|
+
ht,
|
|
2470
2470
|
{
|
|
2471
2471
|
className: "pt-3",
|
|
2472
2472
|
theme: "default",
|
|
@@ -2491,7 +2491,7 @@ function Wl() {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
function Kl({ jsonString: t }) {
|
|
2493
2493
|
return /* @__PURE__ */ e(
|
|
2494
|
-
|
|
2494
|
+
ht,
|
|
2495
2495
|
{
|
|
2496
2496
|
theme: "default",
|
|
2497
2497
|
defaultLanguage: "json",
|
|
@@ -2517,18 +2517,18 @@ 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
|
-
), b =
|
|
2525
|
+
), b = h(
|
|
2526
2526
|
(I) => I.selectedDatabaseName
|
|
2527
|
-
), x =
|
|
2527
|
+
), x = h(
|
|
2528
2528
|
(I) => I.selectedDatamodelId
|
|
2529
|
-
), r =
|
|
2529
|
+
), r = h(
|
|
2530
2530
|
(I) => I.selectedSchemaName
|
|
2531
|
-
), y =
|
|
2531
|
+
), y = h((I) => I.selectedTableName), g = h((I) => {
|
|
2532
2532
|
var re;
|
|
2533
2533
|
return (re = I == null ? void 0 : I.card) == null ? void 0 : re.sql;
|
|
2534
2534
|
}), { sheetFilterValues: C } = Vn(), {
|
|
@@ -2536,40 +2536,40 @@ 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,
|
|
2543
2543
|
runAssistant: _
|
|
2544
|
-
} = ie(), B =
|
|
2544
|
+
} = ie(), B = h((I) => I.onSave), p = h((I) => I.onClose), E = h((I) => I.actions.setSqlGen), W = h((I) => I.runSql), A = h((I) => I.actions.setRunSql), U = h((I) => I.actions.setCardCfg), K = h(
|
|
2545
2545
|
(I) => I.actions.setIsSqlRunning
|
|
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,
|
|
2554
2554
|
refetch: z
|
|
2555
|
-
} = Le(
|
|
2555
|
+
} = Le(u);
|
|
2556
2556
|
de(() => {
|
|
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,
|
|
@@ -2577,7 +2577,7 @@ function Ql() {
|
|
|
2577
2577
|
]), de(() => {
|
|
2578
2578
|
W && (a.getQueryData(j) || z(), A(!1));
|
|
2579
2579
|
}, [W, z, A, j, a]);
|
|
2580
|
-
function
|
|
2580
|
+
function ue() {
|
|
2581
2581
|
const I = a.getQueryData(j);
|
|
2582
2582
|
t.queryData || s({
|
|
2583
2583
|
queryKey: j,
|
|
@@ -2608,17 +2608,17 @@ function Ql() {
|
|
|
2608
2608
|
let I = g;
|
|
2609
2609
|
g && !g.includes("{{") && (I = Al(g), S(I));
|
|
2610
2610
|
const re = {
|
|
2611
|
-
...
|
|
2611
|
+
...u,
|
|
2612
2612
|
lastSelectedSchema: r,
|
|
2613
2613
|
lastSelectedDatamodelId: x,
|
|
2614
2614
|
lastSelectedDatabase: b,
|
|
2615
2615
|
lastSelectedTable: y,
|
|
2616
2616
|
connectionId: m,
|
|
2617
|
-
type: f ?
|
|
2617
|
+
type: f ? u.type : "table",
|
|
2618
2618
|
sql: I,
|
|
2619
|
-
customCfg: f ?
|
|
2619
|
+
customCfg: f ? u.customCfg : null
|
|
2620
2620
|
}, ye = d.cards.map(
|
|
2621
|
-
(_e) => _e.id ===
|
|
2621
|
+
(_e) => _e.id === u.id ? re : _e
|
|
2622
2622
|
), be = {
|
|
2623
2623
|
...d,
|
|
2624
2624
|
cards: ye,
|
|
@@ -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
|
}
|
|
@@ -2772,7 +2772,7 @@ function Ql() {
|
|
|
2772
2772
|
/* @__PURE__ */ n(
|
|
2773
2773
|
L,
|
|
2774
2774
|
{
|
|
2775
|
-
onClick:
|
|
2775
|
+
onClick: ue,
|
|
2776
2776
|
className: "",
|
|
2777
2777
|
size: "sm",
|
|
2778
2778
|
variant: "secondary",
|
|
@@ -2803,7 +2803,7 @@ function Ql() {
|
|
|
2803
2803
|
size: "sm",
|
|
2804
2804
|
variant: "secondary",
|
|
2805
2805
|
children: [
|
|
2806
|
-
/* @__PURE__ */ e(
|
|
2806
|
+
/* @__PURE__ */ e(ut, { className: "mr-2 size-4" }),
|
|
2807
2807
|
"Close"
|
|
2808
2808
|
]
|
|
2809
2809
|
}
|
|
@@ -2830,17 +2830,17 @@ 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,
|
|
2837
|
-
header: ({ column:
|
|
2838
|
-
const f =
|
|
2837
|
+
header: ({ column: u }) => {
|
|
2838
|
+
const f = u.getIsSorted();
|
|
2839
2839
|
return /* @__PURE__ */ e("div", { className: "flex gap-2", children: /* @__PURE__ */ n(
|
|
2840
2840
|
"div",
|
|
2841
2841
|
{
|
|
2842
2842
|
className: "flex cursor-pointer items-center",
|
|
2843
|
-
onClick: () =>
|
|
2843
|
+
onClick: () => u.toggleSorting(u.getIsSorted() === "asc"),
|
|
2844
2844
|
children: [
|
|
2845
2845
|
d,
|
|
2846
2846
|
f === "asc" ? /* @__PURE__ */ e(Rn, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e(_n, { className: "ml-2 h-5 w-5" }) : null
|
|
@@ -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,37 +2861,37 @@ 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",
|
|
2868
|
-
children:
|
|
2869
|
-
|
|
2870
|
-
|
|
2868
|
+
children: u.isPlaceholder ? null : Ut(
|
|
2869
|
+
u.column.columnDef.header,
|
|
2870
|
+
u.getContext()
|
|
2871
2871
|
)
|
|
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",
|
|
2879
2879
|
"data-state": d.getIsSelected() && "selected",
|
|
2880
|
-
children: d.getVisibleCells().map((
|
|
2880
|
+
children: d.getVisibleCells().map((u) => /* @__PURE__ */ e(Jt, { className: "py-3", children: Ut(u.column.columnDef.cell, u.getContext()) }, u.id))
|
|
2881
2881
|
},
|
|
2882
2882
|
d.id
|
|
2883
2883
|
)) : /* @__PURE__ */ e(xt, { children: /* @__PURE__ */ e(Jt, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
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
|
-
(
|
|
2894
|
-
const { getCard: f } = Na(((q = t.customCardPreferences) == null ? void 0 : q.url) || ""), m = ((F = t.customCardPreferences) == null ? void 0 : F.visualType) || "single", b =
|
|
2893
|
+
(M = t.customCardPreferences) != null && M.inputData;
|
|
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,
|
|
2897
2897
|
[A]: U
|
|
@@ -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,8 +2920,8 @@ function Xl({ card: t }) {
|
|
|
2920
2920
|
g && m === "single" && /* @__PURE__ */ e(
|
|
2921
2921
|
g,
|
|
2922
2922
|
{
|
|
2923
|
-
params:
|
|
2924
|
-
theme:
|
|
2923
|
+
params: c,
|
|
2924
|
+
theme: u,
|
|
2925
2925
|
settings: (p = t.customCardPreferences) == null ? void 0 : p.settings,
|
|
2926
2926
|
onDataChange: y,
|
|
2927
2927
|
data: (r == null ? void 0 : r.records) || []
|
|
@@ -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(
|
|
@@ -2950,7 +2950,7 @@ function Xl({ card: t }) {
|
|
|
2950
2950
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e(
|
|
2951
2951
|
g,
|
|
2952
2952
|
{
|
|
2953
|
-
theme:
|
|
2953
|
+
theme: u,
|
|
2954
2954
|
onDataChange: y,
|
|
2955
2955
|
settings: v.map(
|
|
2956
2956
|
(A) => {
|
|
@@ -2974,13 +2974,13 @@ function Ka({
|
|
|
2974
2974
|
...s
|
|
2975
2975
|
}) {
|
|
2976
2976
|
var C;
|
|
2977
|
-
const a =
|
|
2978
|
-
|
|
2979
|
-
const { updateFilter:
|
|
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
|
+
h((v) => v.actions.setRunSql);
|
|
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
|
-
|
|
2983
|
-
data:
|
|
2982
|
+
u != null && u.records && (u == null ? void 0 : u.records.length) > 0 && (r = Ca({
|
|
2983
|
+
data: u == null ? void 0 : u.records,
|
|
2984
2984
|
cardType: a.type,
|
|
2985
2985
|
cfg: a.cfg,
|
|
2986
2986
|
customCfg: a.customCfg,
|
|
@@ -2992,7 +2992,7 @@ function Ka({
|
|
|
2992
2992
|
}
|
|
2993
2993
|
function g() {
|
|
2994
2994
|
var v;
|
|
2995
|
-
if (
|
|
2995
|
+
if (u != null && u.records && (u == null ? void 0 : u.records.length) === 0 && !f && !m)
|
|
2996
2996
|
return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2997
2997
|
/* @__PURE__ */ e(ts, { className: "size-8 text-muted-foreground" }),
|
|
2998
2998
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
@@ -3007,9 +3007,9 @@ function Ka({
|
|
|
3007
3007
|
},
|
|
3008
3008
|
JSON.stringify(r) + JSON.stringify(a.preferences) + ((v = a == null ? void 0 : a.preferences) == null ? void 0 : v.customVisualCode)
|
|
3009
3009
|
);
|
|
3010
|
-
if (a.type === "table" && (
|
|
3010
|
+
if (a.type === "table" && (u != null && u.records) && (u == null ? void 0 : u.records.length) > 0)
|
|
3011
3011
|
return /* @__PURE__ */ n(Ie, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
|
|
3012
|
-
/* @__PURE__ */ e(ns, { card: a, data:
|
|
3012
|
+
/* @__PURE__ */ e(ns, { card: a, data: u == null ? void 0 : u.records }),
|
|
3013
3013
|
/* @__PURE__ */ e(qe, { orientation: "horizontal" })
|
|
3014
3014
|
] });
|
|
3015
3015
|
}
|
|
@@ -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
|
),
|
|
@@ -3065,7 +3065,7 @@ const Yt = ({
|
|
|
3065
3065
|
onChange: a,
|
|
3066
3066
|
readonly: l
|
|
3067
3067
|
}) => /* @__PURE__ */ e(
|
|
3068
|
-
|
|
3068
|
+
ht,
|
|
3069
3069
|
{
|
|
3070
3070
|
className: "h-full w-full overflow-hidden text-xs",
|
|
3071
3071
|
theme: "default",
|
|
@@ -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
|
)
|
|
@@ -3212,21 +3212,21 @@ function ai() {
|
|
|
3212
3212
|
/* @__PURE__ */ e(
|
|
3213
3213
|
ti,
|
|
3214
3214
|
{
|
|
3215
|
-
error:
|
|
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,16 +3268,16 @@ 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
|
-
url:
|
|
3280
|
+
url: u.value
|
|
3281
3281
|
})))
|
|
3282
3282
|
)).flat();
|
|
3283
3283
|
a(d);
|
|
@@ -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,
|
|
@@ -3515,20 +3515,20 @@ function ri({
|
|
|
3515
3515
|
}
|
|
3516
3516
|
}
|
|
3517
3517
|
function oi() {
|
|
3518
|
-
const t =
|
|
3518
|
+
const t = h(
|
|
3519
3519
|
(d) => {
|
|
3520
|
-
var
|
|
3521
|
-
return (b = (m = (f = (
|
|
3520
|
+
var u, f, m, b;
|
|
3521
|
+
return (b = (m = (f = (u = d.card.preferences) == null ? void 0 : u.chartOptions) == null ? void 0 : f.plugins) == null ? void 0 : m.legend) == null ? void 0 : b.position;
|
|
3522
3522
|
}
|
|
3523
|
-
), s =
|
|
3523
|
+
), s = h(
|
|
3524
3524
|
(d) => {
|
|
3525
|
-
var
|
|
3526
|
-
return (b = (m = (f = (
|
|
3525
|
+
var u, f, m, b;
|
|
3526
|
+
return (b = (m = (f = (u = d.card.preferences) == null ? void 0 : u.chartOptions) == null ? void 0 : f.plugins) == null ? void 0 : m.legend) == null ? void 0 : b.align;
|
|
3527
3527
|
}
|
|
3528
|
-
), a =
|
|
3528
|
+
), a = h(
|
|
3529
3529
|
(d) => {
|
|
3530
|
-
var
|
|
3531
|
-
return (b = (m = (f = (
|
|
3530
|
+
var u, f, m, b;
|
|
3531
|
+
return (b = (m = (f = (u = d.card.preferences) == null ? void 0 : u.chartOptions) == null ? void 0 : f.plugins) == null ? void 0 : m.legend) == null ? void 0 : b.display;
|
|
3532
3532
|
}
|
|
3533
3533
|
), { setLegendOptions: l } = ie();
|
|
3534
3534
|
return /* @__PURE__ */ n(Qe, { children: [
|
|
@@ -3544,6 +3544,7 @@ function oi() {
|
|
|
3544
3544
|
/* @__PURE__ */ e("div", { className: "col-span-2 flex h-8 items-center", children: /* @__PURE__ */ e(
|
|
3545
3545
|
cs,
|
|
3546
3546
|
{
|
|
3547
|
+
checked: a,
|
|
3547
3548
|
onCheckedChange: (d) => {
|
|
3548
3549
|
l({
|
|
3549
3550
|
display: d,
|
|
@@ -3558,7 +3559,7 @@ function oi() {
|
|
|
3558
3559
|
] }),
|
|
3559
3560
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-4", children: [
|
|
3560
3561
|
/* @__PURE__ */ e($, { htmlFor: "position", children: "Position" }),
|
|
3561
|
-
/* @__PURE__ */ n(me, { onValueChange: (d) => {
|
|
3562
|
+
/* @__PURE__ */ n(me, { value: t, onValueChange: (d) => {
|
|
3562
3563
|
l({
|
|
3563
3564
|
display: a,
|
|
3564
3565
|
position: d,
|
|
@@ -3576,7 +3577,7 @@ function oi() {
|
|
|
3576
3577
|
] }),
|
|
3577
3578
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-4", children: [
|
|
3578
3579
|
/* @__PURE__ */ e($, { htmlFor: "align", children: "Align" }),
|
|
3579
|
-
/* @__PURE__ */ n(me, { onValueChange: (d) => {
|
|
3580
|
+
/* @__PURE__ */ n(me, { value: s, onValueChange: (d) => {
|
|
3580
3581
|
l({
|
|
3581
3582
|
display: a,
|
|
3582
3583
|
position: t,
|
|
@@ -3597,16 +3598,16 @@ function oi() {
|
|
|
3597
3598
|
}
|
|
3598
3599
|
function ea() {
|
|
3599
3600
|
var V;
|
|
3600
|
-
const t =
|
|
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(
|
|
3601
3602
|
(N) => {
|
|
3602
|
-
var
|
|
3603
|
-
return (
|
|
3603
|
+
var O;
|
|
3604
|
+
return (O = N.card.preferences) == null ? void 0 : O.chartOptions;
|
|
3604
3605
|
}
|
|
3605
3606
|
);
|
|
3606
|
-
|
|
3607
|
-
const
|
|
3607
|
+
h((N) => N.actions.setRunSql);
|
|
3608
|
+
const c = ds(o), {
|
|
3608
3609
|
setFrame: d,
|
|
3609
|
-
setCard:
|
|
3610
|
+
setCard: u,
|
|
3610
3611
|
updateCardInFrame: f,
|
|
3611
3612
|
setActiveTabCardId: m,
|
|
3612
3613
|
runAssistant: b,
|
|
@@ -3634,12 +3635,12 @@ function ea() {
|
|
|
3634
3635
|
D(N);
|
|
3635
3636
|
}
|
|
3636
3637
|
function D(N) {
|
|
3637
|
-
const
|
|
3638
|
+
const O = {
|
|
3638
3639
|
...t,
|
|
3639
3640
|
cards: [...t.cards, N],
|
|
3640
3641
|
activeCardId: N.id
|
|
3641
3642
|
};
|
|
3642
|
-
d(
|
|
3643
|
+
d(O), m(N.id);
|
|
3643
3644
|
}
|
|
3644
3645
|
function S() {
|
|
3645
3646
|
const N = {
|
|
@@ -3650,40 +3651,40 @@ function ea() {
|
|
|
3650
3651
|
};
|
|
3651
3652
|
D(N);
|
|
3652
3653
|
}
|
|
3653
|
-
function
|
|
3654
|
-
const
|
|
3654
|
+
function M(N) {
|
|
3655
|
+
const O = t.cards.filter((X) => X.id !== N), H = O[0], Z = {
|
|
3655
3656
|
...t,
|
|
3656
|
-
cards:
|
|
3657
|
+
cards: O,
|
|
3657
3658
|
// update the active card to the first card in the frame
|
|
3658
|
-
activeCardId:
|
|
3659
|
+
activeCardId: H.id
|
|
3659
3660
|
};
|
|
3660
|
-
d(Z), m(
|
|
3661
|
+
d(Z), m(H.id), u(H);
|
|
3661
3662
|
}
|
|
3662
3663
|
function q(N) {
|
|
3663
3664
|
m(N);
|
|
3664
3665
|
}
|
|
3665
|
-
const F = (N,
|
|
3666
|
-
console.log("handleDragStart",
|
|
3666
|
+
const F = (N, O) => {
|
|
3667
|
+
console.log("handleDragStart", O), N.dataTransfer.setData("tabIndex", O.toString());
|
|
3667
3668
|
}, G = (N) => {
|
|
3668
3669
|
N.preventDefault();
|
|
3669
|
-
}, _ = (N,
|
|
3670
|
-
const
|
|
3671
|
-
if (
|
|
3672
|
-
const Z = Array.from(t.cards), [X] = Z.splice(parseInt(
|
|
3673
|
-
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 });
|
|
3674
3675
|
};
|
|
3675
|
-
function B(N,
|
|
3676
|
-
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(
|
|
3677
3678
|
"div",
|
|
3678
3679
|
{
|
|
3679
3680
|
onClick: () => {
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3682
|
-
...
|
|
3683
|
-
displayTab:
|
|
3681
|
+
const H = O.displayTab === void 0 ? !1 : !O.displayTab;
|
|
3682
|
+
u({ ...O, displayTab: H }), f({
|
|
3683
|
+
...O,
|
|
3684
|
+
displayTab: H
|
|
3684
3685
|
});
|
|
3685
3686
|
},
|
|
3686
|
-
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" })
|
|
3687
3688
|
}
|
|
3688
3689
|
);
|
|
3689
3690
|
}
|
|
@@ -3697,20 +3698,20 @@ function ea() {
|
|
|
3697
3698
|
children: [
|
|
3698
3699
|
t.cards.map((N) => /* @__PURE__ */ e(St, { className: "mt-0 grow", value: N.id, children: E() }, N.id)),
|
|
3699
3700
|
/* @__PURE__ */ e(Oa, { className: "group mx-6 justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center", children: [
|
|
3700
|
-
t.cards.map((N,
|
|
3701
|
+
t.cards.map((N, O) => /* @__PURE__ */ e(
|
|
3701
3702
|
at,
|
|
3702
3703
|
{
|
|
3703
3704
|
text: N.tabTitle || N.title,
|
|
3704
|
-
onSave: (
|
|
3705
|
-
|
|
3705
|
+
onSave: (H) => {
|
|
3706
|
+
u({ ...s, tabTitle: H }), f({ ...s, tabTitle: H });
|
|
3706
3707
|
},
|
|
3707
3708
|
children: /* @__PURE__ */ n(
|
|
3708
3709
|
Ct,
|
|
3709
3710
|
{
|
|
3710
3711
|
draggable: !0,
|
|
3711
|
-
onDragStart: (
|
|
3712
|
+
onDragStart: (H) => F(H, O),
|
|
3712
3713
|
onDragOver: G,
|
|
3713
|
-
onDrop: (
|
|
3714
|
+
onDrop: (H) => _(H, O),
|
|
3714
3715
|
className: "",
|
|
3715
3716
|
value: N.id,
|
|
3716
3717
|
children: [
|
|
@@ -3720,7 +3721,7 @@ function ea() {
|
|
|
3720
3721
|
Ke,
|
|
3721
3722
|
{
|
|
3722
3723
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3723
|
-
onClick: () =>
|
|
3724
|
+
onClick: () => M(N.id)
|
|
3724
3725
|
}
|
|
3725
3726
|
)
|
|
3726
3727
|
]
|
|
@@ -3753,7 +3754,7 @@ function ea() {
|
|
|
3753
3754
|
);
|
|
3754
3755
|
}
|
|
3755
3756
|
function E() {
|
|
3756
|
-
return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(
|
|
3757
|
+
return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(hs, { card: s, data: r == null ? void 0 : r.records }) }) }) : s.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Ie, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
|
|
3757
3758
|
ms,
|
|
3758
3759
|
{
|
|
3759
3760
|
isLoading: l,
|
|
@@ -3763,17 +3764,17 @@ function ea() {
|
|
|
3763
3764
|
) }) }) }) : /* @__PURE__ */ e(mt, { FallbackComponent: wa, children: /* @__PURE__ */ e(Ka, { className: "grow border-none shadow-none" }) });
|
|
3764
3765
|
}
|
|
3765
3766
|
function W() {
|
|
3766
|
-
const N = JSON.stringify(r == null ? void 0 : r.records, null, 2),
|
|
3767
|
-
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();
|
|
3768
3769
|
}
|
|
3769
3770
|
function A() {
|
|
3770
|
-
const
|
|
3771
|
+
const O = [
|
|
3771
3772
|
Object.keys(
|
|
3772
3773
|
r == null ? void 0 : r.records.reduce((j, z) => ({ ...j, ...z }), {})
|
|
3773
3774
|
).join(","),
|
|
3774
3775
|
...((r == null ? void 0 : r.records) || []).map((j) => Object.values(j).join(","))
|
|
3775
3776
|
].join(`
|
|
3776
|
-
`),
|
|
3777
|
+
`), H = new Blob([O], { type: "text/csv" }), Z = URL.createObjectURL(H), X = document.createElement("a");
|
|
3777
3778
|
X.href = Z, X.download = `${s.title}.csv`, X.click();
|
|
3778
3779
|
}
|
|
3779
3780
|
function U() {
|
|
@@ -3781,7 +3782,8 @@ function ea() {
|
|
|
3781
3782
|
b(N);
|
|
3782
3783
|
}
|
|
3783
3784
|
function K() {
|
|
3784
|
-
|
|
3785
|
+
const N = ["xy", "none", "x", "y"], H = (N.indexOf(c) + 1) % N.length;
|
|
3786
|
+
x(N[H]);
|
|
3785
3787
|
}
|
|
3786
3788
|
return /* @__PURE__ */ n("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3787
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" }) }),
|
|
@@ -3813,7 +3815,7 @@ function ea() {
|
|
|
3813
3815
|
}
|
|
3814
3816
|
),
|
|
3815
3817
|
/* @__PURE__ */ e(
|
|
3816
|
-
|
|
3818
|
+
us,
|
|
3817
3819
|
{
|
|
3818
3820
|
text: JSON.stringify(r == null ? void 0 : r.records, null, 2),
|
|
3819
3821
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70"
|
|
@@ -3821,12 +3823,22 @@ function ea() {
|
|
|
3821
3823
|
)
|
|
3822
3824
|
] }),
|
|
3823
3825
|
a && /* @__PURE__ */ n("div", { className: "flex items-center", children: [
|
|
3824
|
-
/* @__PURE__ */ e(oi, {}),
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3826
|
+
!["kpi", "text", "custom", "table"].includes(s.type) && /* @__PURE__ */ e(oi, {}),
|
|
3827
|
+
![
|
|
3828
|
+
"pie",
|
|
3829
|
+
"doughnut",
|
|
3830
|
+
"radar",
|
|
3831
|
+
"polarArea",
|
|
3832
|
+
"table",
|
|
3833
|
+
"custom",
|
|
3834
|
+
"kpi",
|
|
3835
|
+
"text",
|
|
3836
|
+
"map"
|
|
3837
|
+
].includes(s.type) && /* @__PURE__ */ n(rt, { tooltip: "Grid Style", onClick: K, children: [
|
|
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" })
|
|
3830
3842
|
] })
|
|
3831
3843
|
] }),
|
|
3832
3844
|
/* @__PURE__ */ e(di, {})
|
|
@@ -3871,7 +3883,7 @@ function ea() {
|
|
|
3871
3883
|
] });
|
|
3872
3884
|
}
|
|
3873
3885
|
function ci() {
|
|
3874
|
-
const t =
|
|
3886
|
+
const t = h((a) => a.pythonStdOut);
|
|
3875
3887
|
if (!t) return null;
|
|
3876
3888
|
const s = t.replace(/\n/g, "<br>");
|
|
3877
3889
|
return /* @__PURE__ */ n("div", { className: "relative flex w-full flex-col border-r", children: [
|
|
@@ -3883,7 +3895,7 @@ function ci() {
|
|
|
3883
3895
|
] });
|
|
3884
3896
|
}
|
|
3885
3897
|
function di() {
|
|
3886
|
-
const t =
|
|
3898
|
+
const t = h((a) => a.isShowingVisual), s = h(
|
|
3887
3899
|
(a) => a.actions.setIsShowingVisual
|
|
3888
3900
|
);
|
|
3889
3901
|
return /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
|
|
@@ -3899,7 +3911,7 @@ function di() {
|
|
|
3899
3911
|
)
|
|
3900
3912
|
] });
|
|
3901
3913
|
}
|
|
3902
|
-
function
|
|
3914
|
+
function ui({
|
|
3903
3915
|
options: t,
|
|
3904
3916
|
value: s,
|
|
3905
3917
|
onValueChange: a
|
|
@@ -3935,7 +3947,7 @@ function Ne({
|
|
|
3935
3947
|
),
|
|
3936
3948
|
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
|
|
3937
3949
|
/* @__PURE__ */ e(Ce, { children: t }),
|
|
3938
|
-
s.map((
|
|
3950
|
+
s.map((o) => /* @__PURE__ */ e(Q, { value: o.value, children: o.label }, o.value))
|
|
3939
3951
|
] }) })
|
|
3940
3952
|
] });
|
|
3941
3953
|
}
|
|
@@ -3960,31 +3972,31 @@ function Ge({
|
|
|
3960
3972
|
}
|
|
3961
3973
|
);
|
|
3962
3974
|
}
|
|
3963
|
-
function
|
|
3975
|
+
function hi() {
|
|
3964
3976
|
var g, C;
|
|
3965
|
-
const t =
|
|
3977
|
+
const t = h(
|
|
3966
3978
|
(v) => v.card.customCardPreferences
|
|
3967
|
-
), { data: s } = tn(), a = (s == null ? void 0 : s.plugins) || [], l =
|
|
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(
|
|
3968
3980
|
(t == null ? void 0 : t.url) || ""
|
|
3969
|
-
), f = (g =
|
|
3981
|
+
), f = (g = u == null ? void 0 : u.visuals) == null ? void 0 : g.find(
|
|
3970
3982
|
(v) => v.name === (t == null ? void 0 : t.componentName)
|
|
3971
3983
|
);
|
|
3972
3984
|
function m(v, D) {
|
|
3973
3985
|
if (!t) return;
|
|
3974
|
-
const
|
|
3986
|
+
const M = {
|
|
3975
3987
|
...(t == null ? void 0 : t.dataInputCardIds) || {},
|
|
3976
3988
|
[v]: {
|
|
3977
3989
|
cardId: D,
|
|
3978
3990
|
hookRef: null
|
|
3979
3991
|
}
|
|
3980
3992
|
};
|
|
3981
|
-
|
|
3993
|
+
c({
|
|
3982
3994
|
...t,
|
|
3983
|
-
dataInputCardIds:
|
|
3995
|
+
dataInputCardIds: M
|
|
3984
3996
|
});
|
|
3985
3997
|
}
|
|
3986
3998
|
function b(v) {
|
|
3987
|
-
var S,
|
|
3999
|
+
var S, M;
|
|
3988
4000
|
const D = (S = i == null ? void 0 : i.cards) == null ? void 0 : S.filter((q) => {
|
|
3989
4001
|
var F;
|
|
3990
4002
|
return ((F = q == null ? void 0 : q.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
|
|
@@ -3992,7 +4004,7 @@ function ui() {
|
|
|
3992
4004
|
value: q.id,
|
|
3993
4005
|
label: q.tabTitle || q.title
|
|
3994
4006
|
}));
|
|
3995
|
-
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) => {
|
|
3996
4008
|
var G, _;
|
|
3997
4009
|
return /* @__PURE__ */ n(
|
|
3998
4010
|
"div",
|
|
@@ -4017,14 +4029,14 @@ function ui() {
|
|
|
4017
4029
|
}) });
|
|
4018
4030
|
}
|
|
4019
4031
|
function x(v, D, S = []) {
|
|
4020
|
-
var
|
|
4032
|
+
var M, q;
|
|
4021
4033
|
return t ? v === "input" ? /* @__PURE__ */ e(
|
|
4022
|
-
|
|
4034
|
+
he,
|
|
4023
4035
|
{
|
|
4024
4036
|
className: `h-8 w-full ${Pe}`,
|
|
4025
|
-
value: ((
|
|
4037
|
+
value: ((M = t == null ? void 0 : t.settings) == null ? void 0 : M[D]) || "",
|
|
4026
4038
|
onChange: (F) => {
|
|
4027
|
-
|
|
4039
|
+
c({
|
|
4028
4040
|
...t,
|
|
4029
4041
|
settings: {
|
|
4030
4042
|
...t == null ? void 0 : t.settings,
|
|
@@ -4042,7 +4054,7 @@ function ui() {
|
|
|
4042
4054
|
options: S,
|
|
4043
4055
|
value: ((q = t == null ? void 0 : t.settings) == null ? void 0 : q[D]) || "",
|
|
4044
4056
|
onValueChange: (F) => {
|
|
4045
|
-
|
|
4057
|
+
c({
|
|
4046
4058
|
...t,
|
|
4047
4059
|
settings: { ...t == null ? void 0 : t.settings, [D]: F }
|
|
4048
4060
|
});
|
|
@@ -4052,17 +4064,17 @@ function ui() {
|
|
|
4052
4064
|
}
|
|
4053
4065
|
function r(v) {
|
|
4054
4066
|
const D = Object.entries((v == null ? void 0 : v.settings) || {});
|
|
4055
|
-
return /* @__PURE__ */ e("div", { className: "space-y-3", children: D.map(([S,
|
|
4056
|
-
/* @__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 }),
|
|
4057
4069
|
x(
|
|
4058
|
-
|
|
4070
|
+
M.ui,
|
|
4059
4071
|
S,
|
|
4060
|
-
|
|
4072
|
+
M.options
|
|
4061
4073
|
)
|
|
4062
4074
|
] }, S)) });
|
|
4063
4075
|
}
|
|
4064
4076
|
function y(v) {
|
|
4065
|
-
t &&
|
|
4077
|
+
t && c({
|
|
4066
4078
|
...t,
|
|
4067
4079
|
visualType: v,
|
|
4068
4080
|
componentName: ""
|
|
@@ -4081,7 +4093,7 @@ function ui() {
|
|
|
4081
4093
|
label: "",
|
|
4082
4094
|
options: a,
|
|
4083
4095
|
value: (t == null ? void 0 : t.url) || "",
|
|
4084
|
-
onValueChange: (v) =>
|
|
4096
|
+
onValueChange: (v) => c({
|
|
4085
4097
|
...t || {
|
|
4086
4098
|
url: "",
|
|
4087
4099
|
componentName: ""
|
|
@@ -4091,13 +4103,13 @@ function ui() {
|
|
|
4091
4103
|
}
|
|
4092
4104
|
) }) }),
|
|
4093
4105
|
((t == null ? void 0 : t.type) === "component" || (t == null ? void 0 : t.type) === void 0) && /* @__PURE__ */ e(
|
|
4094
|
-
|
|
4106
|
+
ui,
|
|
4095
4107
|
{
|
|
4096
4108
|
options: [
|
|
4097
4109
|
{ value: "single", label: "Single Visual" },
|
|
4098
4110
|
{ value: "multiple", label: "Multi-Visual" }
|
|
4099
4111
|
],
|
|
4100
|
-
value:
|
|
4112
|
+
value: o,
|
|
4101
4113
|
onValueChange: y
|
|
4102
4114
|
}
|
|
4103
4115
|
),
|
|
@@ -4109,14 +4121,14 @@ function ui() {
|
|
|
4109
4121
|
className: "h-8 w-full",
|
|
4110
4122
|
label: "",
|
|
4111
4123
|
options: (d == null ? void 0 : d.filter(
|
|
4112
|
-
(v) => v.type ===
|
|
4124
|
+
(v) => v.type === o
|
|
4113
4125
|
).map((v) => ({
|
|
4114
4126
|
value: v.name,
|
|
4115
4127
|
label: v.name
|
|
4116
4128
|
}))) || [],
|
|
4117
4129
|
value: t.componentName,
|
|
4118
4130
|
onValueChange: (v) => {
|
|
4119
|
-
console.log("changing value", v),
|
|
4131
|
+
console.log("changing value", v), c({
|
|
4120
4132
|
...t,
|
|
4121
4133
|
componentName: v
|
|
4122
4134
|
});
|
|
@@ -4138,24 +4150,24 @@ function ui() {
|
|
|
4138
4150
|
);
|
|
4139
4151
|
}
|
|
4140
4152
|
function Ee() {
|
|
4141
|
-
const [t, s] =
|
|
4142
|
-
|
|
4153
|
+
const [t, s] = P([]);
|
|
4154
|
+
h(
|
|
4143
4155
|
(m) => m.card.cfg
|
|
4144
4156
|
);
|
|
4145
|
-
const a =
|
|
4157
|
+
const a = h((m) => m.card.preferences), { setCardCfg: l, setFilterOnClickColumnIndex: i, setCardPreferences: o } = h((m) => m.actions), c = h(
|
|
4146
4158
|
(m) => m.queryResultColumns
|
|
4147
4159
|
);
|
|
4148
|
-
|
|
4160
|
+
h(
|
|
4149
4161
|
(m) => {
|
|
4150
4162
|
var b;
|
|
4151
4163
|
return (b = m.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
4152
4164
|
}
|
|
4153
4165
|
), de(() => {
|
|
4154
|
-
|
|
4155
|
-
}, [
|
|
4166
|
+
c && s(new Array(c.length).fill(!1));
|
|
4167
|
+
}, [c]);
|
|
4156
4168
|
function d(m, b) {
|
|
4157
4169
|
var x, r;
|
|
4158
|
-
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({
|
|
4159
4171
|
...a,
|
|
4160
4172
|
onClickFilter: [
|
|
4161
4173
|
...a.onClickFilter,
|
|
@@ -4164,7 +4176,7 @@ function Ee() {
|
|
|
4164
4176
|
expression: ""
|
|
4165
4177
|
}
|
|
4166
4178
|
]
|
|
4167
|
-
}) :
|
|
4179
|
+
}) : o({
|
|
4168
4180
|
...a,
|
|
4169
4181
|
onClickFilter: [
|
|
4170
4182
|
{
|
|
@@ -4172,7 +4184,7 @@ function Ee() {
|
|
|
4172
4184
|
expression: ""
|
|
4173
4185
|
}
|
|
4174
4186
|
]
|
|
4175
|
-
}) : (
|
|
4187
|
+
}) : (o({
|
|
4176
4188
|
...a,
|
|
4177
4189
|
onClickFilter: (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.filter(
|
|
4178
4190
|
(y) => y.columnIndex !== m
|
|
@@ -4182,13 +4194,13 @@ function Ee() {
|
|
|
4182
4194
|
return g[m] = !1, g;
|
|
4183
4195
|
}));
|
|
4184
4196
|
}
|
|
4185
|
-
function
|
|
4197
|
+
function u(m, b) {
|
|
4186
4198
|
var r;
|
|
4187
4199
|
const x = (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.map((y) => y.columnIndex === m ? {
|
|
4188
4200
|
...y,
|
|
4189
4201
|
expression: b.target.value
|
|
4190
4202
|
} : y);
|
|
4191
|
-
|
|
4203
|
+
o({
|
|
4192
4204
|
...a,
|
|
4193
4205
|
onClickFilter: x
|
|
4194
4206
|
});
|
|
@@ -4197,10 +4209,10 @@ function Ee() {
|
|
|
4197
4209
|
var b, x, r, y;
|
|
4198
4210
|
if (t != null && t[m] || (x = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((g) => g.columnIndex === m)) != null && x.expression)
|
|
4199
4211
|
return /* @__PURE__ */ e(
|
|
4200
|
-
|
|
4212
|
+
he,
|
|
4201
4213
|
{
|
|
4202
4214
|
value: (y = (r = a == null ? void 0 : a.onClickFilter) == null ? void 0 : r.find((g) => g.columnIndex === m)) == null ? void 0 : y.expression,
|
|
4203
|
-
onChange: (g) =>
|
|
4215
|
+
onChange: (g) => u(m, g),
|
|
4204
4216
|
type: "text",
|
|
4205
4217
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
4206
4218
|
placeholder: "Expression"
|
|
@@ -4209,7 +4221,7 @@ function Ee() {
|
|
|
4209
4221
|
}
|
|
4210
4222
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4211
4223
|
/* @__PURE__ */ e($, { children: "On Click" }),
|
|
4212
|
-
|
|
4224
|
+
c == null ? void 0 : c.map((m, b) => {
|
|
4213
4225
|
var x, r;
|
|
4214
4226
|
return /* @__PURE__ */ e(
|
|
4215
4227
|
"div",
|
|
@@ -4257,19 +4269,19 @@ function Ee() {
|
|
|
4257
4269
|
] });
|
|
4258
4270
|
}
|
|
4259
4271
|
function ft() {
|
|
4260
|
-
var
|
|
4261
|
-
const t =
|
|
4272
|
+
var c, d, u;
|
|
4273
|
+
const t = h((f) => f.card.preferences), s = h(
|
|
4262
4274
|
(f) => f.card.cfg
|
|
4263
|
-
), { setCardCfg: a, setCardPreferences: l, setChartOrientation: i } =
|
|
4264
|
-
(
|
|
4265
|
-
function
|
|
4275
|
+
), { setCardCfg: a, setCardPreferences: l, setChartOrientation: i } = h((f) => f.actions);
|
|
4276
|
+
(c = s == null ? void 0 : s.options) != null && c.indexAxis;
|
|
4277
|
+
function o(f) {
|
|
4266
4278
|
i(f);
|
|
4267
4279
|
}
|
|
4268
4280
|
return /* @__PURE__ */ n(
|
|
4269
4281
|
pt,
|
|
4270
4282
|
{
|
|
4271
|
-
value: ((d = t == null ? void 0 : t.chartOptions) == null ? void 0 : d.indexAxis) || ((
|
|
4272
|
-
onValueChange:
|
|
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",
|
|
4284
|
+
onValueChange: o,
|
|
4273
4285
|
className: "flex gap-3",
|
|
4274
4286
|
defaultValue: "x",
|
|
4275
4287
|
children: [
|
|
@@ -4287,37 +4299,37 @@ function ft() {
|
|
|
4287
4299
|
}
|
|
4288
4300
|
const et = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
4289
4301
|
function ta(t, s) {
|
|
4290
|
-
var l, i,
|
|
4302
|
+
var l, i, o;
|
|
4291
4303
|
const a = Ia(t, s);
|
|
4292
|
-
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";
|
|
4293
4305
|
}
|
|
4294
4306
|
function an() {
|
|
4295
|
-
var V, N,
|
|
4296
|
-
const [t, s] =
|
|
4307
|
+
var V, N, O, H, Z, X;
|
|
4308
|
+
const [t, s] = P(!1), a = h((j) => {
|
|
4297
4309
|
var z;
|
|
4298
4310
|
return (z = j.card) == null ? void 0 : z.preferences;
|
|
4299
|
-
}), l =
|
|
4311
|
+
}), l = h((j) => {
|
|
4300
4312
|
var z;
|
|
4301
4313
|
return (z = j.card) == null ? void 0 : z.cfg;
|
|
4302
|
-
}), i = Ia(a, l), [
|
|
4314
|
+
}), i = Ia(a, l), [o, c] = P(
|
|
4303
4315
|
ta(a)
|
|
4304
|
-
), [d,
|
|
4305
|
-
((
|
|
4306
|
-
), [f, m] =
|
|
4307
|
-
((X = (Z = (
|
|
4308
|
-
), [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(
|
|
4309
4321
|
(j) => j.actions.setCardPreferences
|
|
4310
|
-
), { updateCardInFrame: _ } = ie(), B =
|
|
4322
|
+
), { updateCardInFrame: _ } = ie(), B = h((j) => j.card), p = h((j) => {
|
|
4311
4323
|
var z;
|
|
4312
4324
|
return (z = j.card) == null ? void 0 : z.type;
|
|
4313
4325
|
}), E = ["pie", "doughnut", "polarArea"].includes(p);
|
|
4314
4326
|
de(() => {
|
|
4315
|
-
var j, z,
|
|
4316
|
-
|
|
4317
|
-
((
|
|
4327
|
+
var j, z, ue, k, J, ne, oe, Se, xe, Y, ce, I, re, ye;
|
|
4328
|
+
c(ta(a)), u(
|
|
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 : ""
|
|
4318
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(
|
|
4319
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) || ""
|
|
4320
|
-
), 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) || "");
|
|
4321
4333
|
}, [t, a, i]);
|
|
4322
4334
|
function W(j, z) {
|
|
4323
4335
|
return z === "" || /^[0-9\b]+$/.test(z) ? Number(z) : Number(j);
|
|
@@ -4347,7 +4359,7 @@ function an() {
|
|
|
4347
4359
|
me,
|
|
4348
4360
|
{
|
|
4349
4361
|
value: S || "none",
|
|
4350
|
-
onValueChange: (z) =>
|
|
4362
|
+
onValueChange: (z) => M(z === "none" ? "" : z),
|
|
4351
4363
|
children: [
|
|
4352
4364
|
/* @__PURE__ */ e(pe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, {}) }),
|
|
4353
4365
|
/* @__PURE__ */ e(ge, { children: /* @__PURE__ */ n(ke, { children: [
|
|
@@ -4375,7 +4387,7 @@ function an() {
|
|
|
4375
4387
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-9 items-center gap-2", children: [
|
|
4376
4388
|
/* @__PURE__ */ e($, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
|
|
4377
4389
|
/* @__PURE__ */ e(
|
|
4378
|
-
|
|
4390
|
+
he,
|
|
4379
4391
|
{
|
|
4380
4392
|
value: g,
|
|
4381
4393
|
onChange: (z) => C(Number(z.target.value)),
|
|
@@ -4391,16 +4403,16 @@ function an() {
|
|
|
4391
4403
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
4392
4404
|
/* @__PURE__ */ e($, { htmlFor: "range", children: "Range" }),
|
|
4393
4405
|
/* @__PURE__ */ e(
|
|
4394
|
-
|
|
4406
|
+
he,
|
|
4395
4407
|
{
|
|
4396
4408
|
id: "min",
|
|
4397
4409
|
value: d,
|
|
4398
|
-
onChange: (j) =>
|
|
4410
|
+
onChange: (j) => u((z) => W(z, j.target.value)),
|
|
4399
4411
|
className: `col-span-1 h-8 w-full ${et}`
|
|
4400
4412
|
}
|
|
4401
4413
|
),
|
|
4402
4414
|
/* @__PURE__ */ e(
|
|
4403
|
-
|
|
4415
|
+
he,
|
|
4404
4416
|
{
|
|
4405
4417
|
value: f,
|
|
4406
4418
|
onChange: (j) => m((z) => W(z, j.target.value)),
|
|
@@ -4412,7 +4424,7 @@ function an() {
|
|
|
4412
4424
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
4413
4425
|
/* @__PURE__ */ e($, { htmlFor: "step-size", children: "Step Size" }),
|
|
4414
4426
|
/* @__PURE__ */ e(
|
|
4415
|
-
|
|
4427
|
+
he,
|
|
4416
4428
|
{
|
|
4417
4429
|
value: r,
|
|
4418
4430
|
onChange: (j) => y((z) => W(z, j.target.value)),
|
|
@@ -4441,8 +4453,8 @@ function an() {
|
|
|
4441
4453
|
...(k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales,
|
|
4442
4454
|
[i]: {
|
|
4443
4455
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
4444
|
-
type:
|
|
4445
|
-
...
|
|
4456
|
+
type: o,
|
|
4457
|
+
...o === "linear" ? j : {}
|
|
4446
4458
|
}
|
|
4447
4459
|
}
|
|
4448
4460
|
},
|
|
@@ -4454,11 +4466,11 @@ function an() {
|
|
|
4454
4466
|
}
|
|
4455
4467
|
};
|
|
4456
4468
|
console.log(z), G(z);
|
|
4457
|
-
const
|
|
4469
|
+
const ue = {
|
|
4458
4470
|
...B,
|
|
4459
4471
|
preferences: z
|
|
4460
4472
|
};
|
|
4461
|
-
_(
|
|
4473
|
+
_(ue);
|
|
4462
4474
|
}
|
|
4463
4475
|
return /* @__PURE__ */ n(Qe, { onOpenChange: (j) => s(j), children: [
|
|
4464
4476
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(ys, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
@@ -4474,8 +4486,8 @@ function an() {
|
|
|
4474
4486
|
me,
|
|
4475
4487
|
{
|
|
4476
4488
|
disabled: E,
|
|
4477
|
-
value:
|
|
4478
|
-
onValueChange: (j) =>
|
|
4489
|
+
value: o,
|
|
4490
|
+
onValueChange: (j) => c(j),
|
|
4479
4491
|
children: [
|
|
4480
4492
|
/* @__PURE__ */ e(pe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(fe, {}) }),
|
|
4481
4493
|
/* @__PURE__ */ e(ge, { id: "type", children: /* @__PURE__ */ n(ke, { children: [
|
|
@@ -4487,7 +4499,7 @@ function an() {
|
|
|
4487
4499
|
}
|
|
4488
4500
|
)
|
|
4489
4501
|
] }),
|
|
4490
|
-
|
|
4502
|
+
o == "linear" && /* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4491
4503
|
/* @__PURE__ */ e($, { htmlFor: "scale-option", children: "Setup" }),
|
|
4492
4504
|
/* @__PURE__ */ n(
|
|
4493
4505
|
pt,
|
|
@@ -4511,7 +4523,7 @@ function an() {
|
|
|
4511
4523
|
}
|
|
4512
4524
|
)
|
|
4513
4525
|
] }),
|
|
4514
|
-
b === "custom" &&
|
|
4526
|
+
b === "custom" && o == "linear" && U(),
|
|
4515
4527
|
A(),
|
|
4516
4528
|
/* @__PURE__ */ e(bs, {}),
|
|
4517
4529
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e(
|
|
@@ -4529,26 +4541,26 @@ function an() {
|
|
|
4529
4541
|
}
|
|
4530
4542
|
function mi({ idx: t }) {
|
|
4531
4543
|
var d;
|
|
4532
|
-
const s =
|
|
4544
|
+
const s = h((u) => {
|
|
4533
4545
|
var f;
|
|
4534
|
-
return (f =
|
|
4535
|
-
}), a =
|
|
4536
|
-
(
|
|
4546
|
+
return (f = u.card) == null ? void 0 : f.preferences;
|
|
4547
|
+
}), a = h(
|
|
4548
|
+
(u) => {
|
|
4537
4549
|
var f;
|
|
4538
|
-
return (f =
|
|
4550
|
+
return (f = u.card.preferences) == null ? void 0 : f.datasetOptions;
|
|
4539
4551
|
}
|
|
4540
|
-
), l =
|
|
4541
|
-
(
|
|
4542
|
-
), i = (d = s == null ? void 0 : s.chartOptions) == null ? void 0 : d.indexAxis,
|
|
4543
|
-
function
|
|
4544
|
-
(
|
|
4552
|
+
), l = h(
|
|
4553
|
+
(u) => u.actions.setCardPreferences
|
|
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) {
|
|
4556
|
+
(u === "end" || u === "start") && xs(vs());
|
|
4545
4557
|
const m = {
|
|
4546
|
-
display:
|
|
4547
|
-
align:
|
|
4548
|
-
anchor:
|
|
4558
|
+
display: u !== "none",
|
|
4559
|
+
align: u,
|
|
4560
|
+
anchor: u,
|
|
4549
4561
|
clamp: !0
|
|
4550
4562
|
};
|
|
4551
|
-
if (!
|
|
4563
|
+
if (!o)
|
|
4552
4564
|
l({
|
|
4553
4565
|
...s,
|
|
4554
4566
|
datasetOptions: [
|
|
@@ -4560,7 +4572,7 @@ function mi({ idx: t }) {
|
|
|
4560
4572
|
]
|
|
4561
4573
|
});
|
|
4562
4574
|
else {
|
|
4563
|
-
const b = { ...
|
|
4575
|
+
const b = { ...o };
|
|
4564
4576
|
b.datalabels = m;
|
|
4565
4577
|
const x = a == null ? void 0 : a.map(
|
|
4566
4578
|
(r) => r.idx === f ? b : r
|
|
@@ -4577,7 +4589,7 @@ function mi({ idx: t }) {
|
|
|
4577
4589
|
/* @__PURE__ */ e(
|
|
4578
4590
|
L,
|
|
4579
4591
|
{
|
|
4580
|
-
onClick: () =>
|
|
4592
|
+
onClick: () => c("none", t),
|
|
4581
4593
|
size: "sm",
|
|
4582
4594
|
variant: "secondary",
|
|
4583
4595
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4587,7 +4599,7 @@ function mi({ idx: t }) {
|
|
|
4587
4599
|
/* @__PURE__ */ e(
|
|
4588
4600
|
L,
|
|
4589
4601
|
{
|
|
4590
|
-
onClick: () =>
|
|
4602
|
+
onClick: () => c("start", t),
|
|
4591
4603
|
size: "sm",
|
|
4592
4604
|
variant: "secondary",
|
|
4593
4605
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4604,7 +4616,7 @@ function mi({ idx: t }) {
|
|
|
4604
4616
|
/* @__PURE__ */ e(
|
|
4605
4617
|
L,
|
|
4606
4618
|
{
|
|
4607
|
-
onClick: () =>
|
|
4619
|
+
onClick: () => c("center", t),
|
|
4608
4620
|
size: "sm",
|
|
4609
4621
|
variant: "secondary",
|
|
4610
4622
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4621,7 +4633,7 @@ function mi({ idx: t }) {
|
|
|
4621
4633
|
/* @__PURE__ */ e(
|
|
4622
4634
|
L,
|
|
4623
4635
|
{
|
|
4624
|
-
onClick: () =>
|
|
4636
|
+
onClick: () => c("end", t),
|
|
4625
4637
|
size: "sm",
|
|
4626
4638
|
variant: "secondary",
|
|
4627
4639
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4639,27 +4651,27 @@ function mi({ idx: t }) {
|
|
|
4639
4651
|
] });
|
|
4640
4652
|
}
|
|
4641
4653
|
function nn() {
|
|
4642
|
-
const t =
|
|
4654
|
+
const t = h((f) => f.card), s = h(
|
|
4643
4655
|
(f) => {
|
|
4644
4656
|
var m, b, x;
|
|
4645
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;
|
|
4646
4658
|
}
|
|
4647
4659
|
), { data: a } = Le(t), l = s === "y" ? "Y axis" : "X axis", i = s === "y" ? "X axis" : "Y axis", {
|
|
4648
|
-
keys:
|
|
4649
|
-
metricKeys:
|
|
4660
|
+
keys: o,
|
|
4661
|
+
metricKeys: c,
|
|
4650
4662
|
dimensionKeys: d
|
|
4651
4663
|
} = Nt((a == null ? void 0 : a.records) || []);
|
|
4652
|
-
let
|
|
4664
|
+
let u = c;
|
|
4653
4665
|
if (["stackedBar", "stackedLine"].includes(t.type)) {
|
|
4654
4666
|
const f = Ns({
|
|
4655
4667
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4656
4668
|
groupKey: d[0],
|
|
4657
4669
|
pivotKey: d[1],
|
|
4658
|
-
valueKey:
|
|
4670
|
+
valueKey: u[0]
|
|
4659
4671
|
}), { metricKeys: m } = Nt(f);
|
|
4660
|
-
|
|
4672
|
+
u = m;
|
|
4661
4673
|
}
|
|
4662
|
-
return
|
|
4674
|
+
return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
4663
4675
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4664
4676
|
/* @__PURE__ */ e($, { children: l }),
|
|
4665
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]) }) }) })
|
|
@@ -4669,7 +4681,7 @@ function nn() {
|
|
|
4669
4681
|
/* @__PURE__ */ e($, { children: i }),
|
|
4670
4682
|
/* @__PURE__ */ e(an, {})
|
|
4671
4683
|
] }),
|
|
4672
|
-
/* @__PURE__ */ e("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children:
|
|
4684
|
+
/* @__PURE__ */ e("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children: u.map((f, m) => /* @__PURE__ */ e(pi, { col: f, idx: m }, f)) })
|
|
4673
4685
|
] })
|
|
4674
4686
|
] });
|
|
4675
4687
|
}
|
|
@@ -4677,18 +4689,18 @@ function sn(t, s = 30) {
|
|
|
4677
4689
|
return t.length > s ? t.slice(0, s) + "..." : t;
|
|
4678
4690
|
}
|
|
4679
4691
|
function pi({ col: t, idx: s }) {
|
|
4680
|
-
const a =
|
|
4681
|
-
var
|
|
4682
|
-
return (
|
|
4683
|
-
}), l =
|
|
4692
|
+
const a = h((d) => {
|
|
4693
|
+
var u;
|
|
4694
|
+
return (u = d.card) == null ? void 0 : u.preferences;
|
|
4695
|
+
}), l = h(
|
|
4684
4696
|
(d) => {
|
|
4685
|
-
var
|
|
4686
|
-
return (
|
|
4697
|
+
var u;
|
|
4698
|
+
return (u = d.card.preferences) == null ? void 0 : u.datasetOptions;
|
|
4687
4699
|
}
|
|
4688
|
-
), i = l == null ? void 0 : l.find((d) => d.idx === s), { setCardPreferences:
|
|
4689
|
-
function
|
|
4700
|
+
), i = l == null ? void 0 : l.find((d) => d.idx === s), { setCardPreferences: o } = h((d) => d.actions);
|
|
4701
|
+
function c(d) {
|
|
4690
4702
|
if (!i)
|
|
4691
|
-
|
|
4703
|
+
o({
|
|
4692
4704
|
...a,
|
|
4693
4705
|
datasetOptions: [
|
|
4694
4706
|
...l || [],
|
|
@@ -4700,12 +4712,12 @@ function pi({ col: t, idx: s }) {
|
|
|
4700
4712
|
]
|
|
4701
4713
|
});
|
|
4702
4714
|
else {
|
|
4703
|
-
const
|
|
4704
|
-
|
|
4715
|
+
const u = { ...i };
|
|
4716
|
+
u.type = d === "area" ? "line" : d, u.fill = d === "area" ? "origin" : "";
|
|
4705
4717
|
const f = l == null ? void 0 : l.map(
|
|
4706
|
-
(m) => m.idx === s ?
|
|
4718
|
+
(m) => m.idx === s ? u : m
|
|
4707
4719
|
);
|
|
4708
|
-
|
|
4720
|
+
o({
|
|
4709
4721
|
...a,
|
|
4710
4722
|
datasetOptions: f
|
|
4711
4723
|
});
|
|
@@ -4717,21 +4729,21 @@ function pi({ col: t, idx: s }) {
|
|
|
4717
4729
|
/* @__PURE__ */ e(
|
|
4718
4730
|
Et,
|
|
4719
4731
|
{
|
|
4720
|
-
onClick: () =>
|
|
4732
|
+
onClick: () => c("bar"),
|
|
4721
4733
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4722
4734
|
}
|
|
4723
4735
|
),
|
|
4724
4736
|
/* @__PURE__ */ e(
|
|
4725
4737
|
Vt,
|
|
4726
4738
|
{
|
|
4727
|
-
onClick: () =>
|
|
4739
|
+
onClick: () => c("line"),
|
|
4728
4740
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4729
4741
|
}
|
|
4730
4742
|
),
|
|
4731
4743
|
/* @__PURE__ */ e(
|
|
4732
4744
|
Us,
|
|
4733
4745
|
{
|
|
4734
|
-
onClick: () =>
|
|
4746
|
+
onClick: () => c("area"),
|
|
4735
4747
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4736
4748
|
}
|
|
4737
4749
|
),
|
|
@@ -4740,7 +4752,7 @@ function pi({ col: t, idx: s }) {
|
|
|
4740
4752
|
] });
|
|
4741
4753
|
}
|
|
4742
4754
|
function ln() {
|
|
4743
|
-
const t =
|
|
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();
|
|
4744
4756
|
function x(r, y = "dashboard") {
|
|
4745
4757
|
var G;
|
|
4746
4758
|
const g = ve(r.column_name), C = ve(a || ""), v = ve(l || ""), D = ve(m);
|
|
@@ -4748,23 +4760,23 @@ function ln() {
|
|
|
4748
4760
|
v,
|
|
4749
4761
|
D,
|
|
4750
4762
|
b
|
|
4751
|
-
),
|
|
4763
|
+
), M = `${S}.${g}`;
|
|
4752
4764
|
const q = (G = f == null ? void 0 : f.find(
|
|
4753
4765
|
(_) => _.id === s
|
|
4754
4766
|
)) == null ? void 0 : G.name;
|
|
4755
|
-
s && s !== "none" && (
|
|
4756
|
-
const F =
|
|
4757
|
-
(_) => _.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)
|
|
4758
4770
|
);
|
|
4759
4771
|
if (F)
|
|
4760
|
-
|
|
4772
|
+
u(F.id), d(F.id);
|
|
4761
4773
|
else {
|
|
4762
4774
|
const _ = Be();
|
|
4763
|
-
return m === "api" && t ? (
|
|
4775
|
+
return m === "api" && t ? (c({
|
|
4764
4776
|
location: y,
|
|
4765
4777
|
id: _,
|
|
4766
4778
|
//uuidv4(),
|
|
4767
|
-
column:
|
|
4779
|
+
column: M,
|
|
4768
4780
|
title: r.column_name,
|
|
4769
4781
|
dataType: r.data_type,
|
|
4770
4782
|
table: "api",
|
|
@@ -4778,11 +4790,11 @@ function ln() {
|
|
|
4778
4790
|
g
|
|
4779
4791
|
)
|
|
4780
4792
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4781
|
-
}), _) : (
|
|
4793
|
+
}), _) : (c({
|
|
4782
4794
|
id: _,
|
|
4783
4795
|
//uuidv4(),
|
|
4784
4796
|
location: y,
|
|
4785
|
-
column:
|
|
4797
|
+
column: M,
|
|
4786
4798
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4787
4799
|
title: r.column_name,
|
|
4788
4800
|
dataType: r.data_type,
|
|
@@ -4804,24 +4816,24 @@ function ln() {
|
|
|
4804
4816
|
function Re() {
|
|
4805
4817
|
const t = T(
|
|
4806
4818
|
(d) => d.dashboard.filters
|
|
4807
|
-
), s =
|
|
4808
|
-
function
|
|
4809
|
-
const
|
|
4810
|
-
a({ ...s, filterId:
|
|
4819
|
+
), s = h((d) => d.frame), { setFrame: a } = ie(), { columns: l } = Ae(), { assignFilter: i } = ln();
|
|
4820
|
+
function o(d) {
|
|
4821
|
+
const u = i(d, "frame");
|
|
4822
|
+
a({ ...s, filterId: u });
|
|
4811
4823
|
}
|
|
4812
|
-
const
|
|
4824
|
+
const c = t == null ? void 0 : t.find((d) => d.id === s.filterId);
|
|
4813
4825
|
return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
|
|
4814
4826
|
/* @__PURE__ */ e($, { children: "Card Filter" }),
|
|
4815
|
-
/* @__PURE__ */ e(fi, { onSelect:
|
|
4816
|
-
|
|
4827
|
+
/* @__PURE__ */ e(fi, { onSelect: o, columns: l }),
|
|
4828
|
+
c && /* @__PURE__ */ e(Ta, { filter: c })
|
|
4817
4829
|
] });
|
|
4818
4830
|
}
|
|
4819
4831
|
function fi({
|
|
4820
4832
|
columns: t,
|
|
4821
4833
|
onSelect: s
|
|
4822
4834
|
}) {
|
|
4823
|
-
var
|
|
4824
|
-
const [a, l] = Qt.useState(!1), [i,
|
|
4835
|
+
var c;
|
|
4836
|
+
const [a, l] = Qt.useState(!1), [i, o] = Qt.useState("");
|
|
4825
4837
|
return /* @__PURE__ */ n(Qe, { open: a, onOpenChange: l, children: [
|
|
4826
4838
|
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ n(
|
|
4827
4839
|
L,
|
|
@@ -4832,7 +4844,7 @@ function fi({
|
|
|
4832
4844
|
"aria-expanded": a,
|
|
4833
4845
|
className: "w-full justify-between font-normal",
|
|
4834
4846
|
children: [
|
|
4835
|
-
i ? (
|
|
4847
|
+
i ? (c = t.find((d) => d.column_name === i)) == null ? void 0 : c.column_name : "Select Column...",
|
|
4836
4848
|
/* @__PURE__ */ e(Ss, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4837
4849
|
]
|
|
4838
4850
|
}
|
|
@@ -4845,9 +4857,9 @@ function fi({
|
|
|
4845
4857
|
Ts,
|
|
4846
4858
|
{
|
|
4847
4859
|
value: d.column_name,
|
|
4848
|
-
onSelect: (
|
|
4849
|
-
const f =
|
|
4850
|
-
|
|
4860
|
+
onSelect: (u) => {
|
|
4861
|
+
const f = u === i ? "" : u;
|
|
4862
|
+
o(f), l(!1), f && s(d);
|
|
4851
4863
|
},
|
|
4852
4864
|
children: [
|
|
4853
4865
|
d.column_name,
|
|
@@ -4914,13 +4926,13 @@ function gi({
|
|
|
4914
4926
|
] }) });
|
|
4915
4927
|
}
|
|
4916
4928
|
function qt() {
|
|
4917
|
-
var i,
|
|
4918
|
-
const t =
|
|
4929
|
+
var i, o, c;
|
|
4930
|
+
const t = h(
|
|
4919
4931
|
(d) => d.card.cfg
|
|
4920
|
-
), s =
|
|
4932
|
+
), s = h((d) => d.actions.setCardCfg), a = h((d) => d.card.type);
|
|
4921
4933
|
function l(d) {
|
|
4922
4934
|
var m;
|
|
4923
|
-
const
|
|
4935
|
+
const u = {
|
|
4924
4936
|
datalabels: {
|
|
4925
4937
|
display: d !== "none",
|
|
4926
4938
|
align: d,
|
|
@@ -4933,7 +4945,7 @@ function qt() {
|
|
|
4933
4945
|
...t == null ? void 0 : t.options,
|
|
4934
4946
|
plugins: {
|
|
4935
4947
|
...(m = t == null ? void 0 : t.options) == null ? void 0 : m.plugins,
|
|
4936
|
-
...
|
|
4948
|
+
...u
|
|
4937
4949
|
}
|
|
4938
4950
|
}
|
|
4939
4951
|
};
|
|
@@ -4947,7 +4959,7 @@ function qt() {
|
|
|
4947
4959
|
/* @__PURE__ */ n(
|
|
4948
4960
|
me,
|
|
4949
4961
|
{
|
|
4950
|
-
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,
|
|
4951
4963
|
onValueChange: l,
|
|
4952
4964
|
defaultValue: "none",
|
|
4953
4965
|
children: [
|
|
@@ -4983,7 +4995,7 @@ function yi({
|
|
|
4983
4995
|
"a",
|
|
4984
4996
|
{
|
|
4985
4997
|
target: "_blank",
|
|
4986
|
-
onClick: (
|
|
4998
|
+
onClick: (o) => o.stopPropagation(),
|
|
4987
4999
|
className: "text-blue-700",
|
|
4988
5000
|
href: "https://docs.semaphor.cloud/docs/charts/bubble",
|
|
4989
5001
|
children: "example"
|
|
@@ -5035,7 +5047,7 @@ const bi = {
|
|
|
5035
5047
|
]
|
|
5036
5048
|
};
|
|
5037
5049
|
function vi() {
|
|
5038
|
-
const t =
|
|
5050
|
+
const t = h((s) => s.card.type);
|
|
5039
5051
|
return /* @__PURE__ */ n("div", { className: "space-y-6 p-6", children: [
|
|
5040
5052
|
/* @__PURE__ */ e(
|
|
5041
5053
|
Fe,
|
|
@@ -5152,38 +5164,38 @@ function Ni(t) {
|
|
|
5152
5164
|
] }) });
|
|
5153
5165
|
}
|
|
5154
5166
|
function Ci() {
|
|
5155
|
-
var
|
|
5156
|
-
const t =
|
|
5167
|
+
var u, f, m, b, x;
|
|
5168
|
+
const t = h((r) => r.card.preferences), s = h(
|
|
5157
5169
|
(r) => r.actions.setCardPreferences
|
|
5158
|
-
), a =
|
|
5170
|
+
), a = h(
|
|
5159
5171
|
(r) => r.actions.setNumberFormat
|
|
5160
5172
|
);
|
|
5161
|
-
|
|
5173
|
+
h(
|
|
5162
5174
|
(r) => {
|
|
5163
5175
|
var y, g;
|
|
5164
5176
|
return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.decimalPlaces;
|
|
5165
5177
|
}
|
|
5166
5178
|
);
|
|
5167
|
-
const l =
|
|
5179
|
+
const l = h(
|
|
5168
5180
|
(r) => {
|
|
5169
5181
|
var y, g;
|
|
5170
5182
|
return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.locale;
|
|
5171
5183
|
}
|
|
5172
|
-
), i =
|
|
5184
|
+
), i = h(
|
|
5173
5185
|
(r) => {
|
|
5174
5186
|
var y, g;
|
|
5175
5187
|
return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.currency;
|
|
5176
5188
|
}
|
|
5177
5189
|
);
|
|
5178
|
-
|
|
5190
|
+
h(
|
|
5179
5191
|
(r) => r.actions.setFilterOnClickField
|
|
5180
5192
|
);
|
|
5181
|
-
const
|
|
5193
|
+
const o = h(
|
|
5182
5194
|
(r) => {
|
|
5183
5195
|
var y, g;
|
|
5184
5196
|
return (g = (y = r.card.preferences) == null ? void 0 : y.formatNumber) == null ? void 0 : g.colorRanges;
|
|
5185
5197
|
}
|
|
5186
|
-
) || [],
|
|
5198
|
+
) || [], c = h(
|
|
5187
5199
|
(r) => r.actions.setColorRanges
|
|
5188
5200
|
), d = [...new Set(ot.map((r) => r.currency))];
|
|
5189
5201
|
return /* @__PURE__ */ n("div", { children: [
|
|
@@ -5191,7 +5203,7 @@ function Ci() {
|
|
|
5191
5203
|
/* @__PURE__ */ e(
|
|
5192
5204
|
Ft,
|
|
5193
5205
|
{
|
|
5194
|
-
checked: !!((
|
|
5206
|
+
checked: !!((u = t == null ? void 0 : t.formatNumber) != null && u.enabled),
|
|
5195
5207
|
onCheckedChange: (r) => {
|
|
5196
5208
|
s({
|
|
5197
5209
|
...t,
|
|
@@ -5287,7 +5299,7 @@ function Ci() {
|
|
|
5287
5299
|
/* @__PURE__ */ n("div", { className: "w-full space-y-1", children: [
|
|
5288
5300
|
/* @__PURE__ */ e($, { children: "Suffix" }),
|
|
5289
5301
|
/* @__PURE__ */ e(
|
|
5290
|
-
|
|
5302
|
+
he,
|
|
5291
5303
|
{
|
|
5292
5304
|
value: ((x = t == null ? void 0 : t.formatNumber) == null ? void 0 : x.suffix) || "",
|
|
5293
5305
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
@@ -5310,8 +5322,8 @@ function Ci() {
|
|
|
5310
5322
|
/* @__PURE__ */ e(
|
|
5311
5323
|
zs,
|
|
5312
5324
|
{
|
|
5313
|
-
colorRanges:
|
|
5314
|
-
setColorRanges:
|
|
5325
|
+
colorRanges: o,
|
|
5326
|
+
setColorRanges: c
|
|
5315
5327
|
}
|
|
5316
5328
|
)
|
|
5317
5329
|
] })
|
|
@@ -5449,10 +5461,10 @@ const wi = [
|
|
|
5449
5461
|
value: t
|
|
5450
5462
|
}));
|
|
5451
5463
|
function Mi() {
|
|
5452
|
-
var
|
|
5453
|
-
const t =
|
|
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(
|
|
5454
5466
|
((b = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
|
|
5455
|
-
), { setCardPreferences: i } = ie(), { data:
|
|
5467
|
+
), { setCardPreferences: i } = ie(), { data: o } = Lt(t), c = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
|
|
5456
5468
|
label: p,
|
|
5457
5469
|
value: p
|
|
5458
5470
|
})) || [];
|
|
@@ -5492,7 +5504,7 @@ function Mi() {
|
|
|
5492
5504
|
}
|
|
5493
5505
|
),
|
|
5494
5506
|
s === "custom" && /* @__PURE__ */ e(
|
|
5495
|
-
|
|
5507
|
+
he,
|
|
5496
5508
|
{
|
|
5497
5509
|
onChange: (p) => {
|
|
5498
5510
|
l(p.target.value);
|
|
@@ -5512,14 +5524,14 @@ function Mi() {
|
|
|
5512
5524
|
placeholder: "Custom URL"
|
|
5513
5525
|
}
|
|
5514
5526
|
),
|
|
5515
|
-
|
|
5527
|
+
o && /* @__PURE__ */ n(le, { children: [
|
|
5516
5528
|
/* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
5517
5529
|
/* @__PURE__ */ e($, { children: "Map Object" }),
|
|
5518
5530
|
/* @__PURE__ */ e(
|
|
5519
5531
|
Ne,
|
|
5520
5532
|
{
|
|
5521
5533
|
className: "h-9",
|
|
5522
|
-
options:
|
|
5534
|
+
options: c,
|
|
5523
5535
|
value: ((r = (x = t.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : r.objectKey) || "",
|
|
5524
5536
|
label: "Map Object",
|
|
5525
5537
|
onValueChange: (p) => {
|
|
@@ -5584,7 +5596,7 @@ function Mi() {
|
|
|
5584
5596
|
/* @__PURE__ */ e(Oe, { className: "my-4" }),
|
|
5585
5597
|
/* @__PURE__ */ e(Ge, { className: "", summary: "Scale Options", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
5586
5598
|
/* @__PURE__ */ e(
|
|
5587
|
-
|
|
5599
|
+
he,
|
|
5588
5600
|
{
|
|
5589
5601
|
className: `h-9 w-full ${Pe}`,
|
|
5590
5602
|
type: "number",
|
|
@@ -5604,12 +5616,12 @@ function Mi() {
|
|
|
5604
5616
|
),
|
|
5605
5617
|
/* @__PURE__ */ e($, { children: "X" }),
|
|
5606
5618
|
/* @__PURE__ */ e(
|
|
5607
|
-
|
|
5619
|
+
he,
|
|
5608
5620
|
{
|
|
5609
5621
|
className: `h-9 w-full ${Pe}`,
|
|
5610
5622
|
type: "number",
|
|
5611
5623
|
step: 10,
|
|
5612
|
-
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,
|
|
5613
5625
|
onChange: (p) => {
|
|
5614
5626
|
var E, W, A, U;
|
|
5615
5627
|
i({
|
|
@@ -5627,7 +5639,7 @@ function Mi() {
|
|
|
5627
5639
|
),
|
|
5628
5640
|
/* @__PURE__ */ e($, { children: "Y" }),
|
|
5629
5641
|
/* @__PURE__ */ e(
|
|
5630
|
-
|
|
5642
|
+
he,
|
|
5631
5643
|
{
|
|
5632
5644
|
className: `h-9 w-full ${Pe}`,
|
|
5633
5645
|
type: "number",
|
|
@@ -5655,7 +5667,7 @@ function Mi() {
|
|
|
5655
5667
|
}
|
|
5656
5668
|
function Ii() {
|
|
5657
5669
|
var l;
|
|
5658
|
-
const t =
|
|
5670
|
+
const t = h((i) => i.card.preferences), { setCardPreferences: s } = h((i) => i.actions);
|
|
5659
5671
|
function a(i) {
|
|
5660
5672
|
s({
|
|
5661
5673
|
...t,
|
|
@@ -5733,10 +5745,10 @@ function tt({
|
|
|
5733
5745
|
] }) });
|
|
5734
5746
|
}
|
|
5735
5747
|
function Ti() {
|
|
5736
|
-
const t =
|
|
5748
|
+
const t = h(
|
|
5737
5749
|
(l) => {
|
|
5738
|
-
var i,
|
|
5739
|
-
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;
|
|
5740
5752
|
}
|
|
5741
5753
|
), { setSortChart: s } = ie();
|
|
5742
5754
|
function a() {
|
|
@@ -5816,10 +5828,10 @@ function Di({
|
|
|
5816
5828
|
cardType: t = "table"
|
|
5817
5829
|
}) {
|
|
5818
5830
|
console.log("cardType", t);
|
|
5819
|
-
const s =
|
|
5820
|
-
var
|
|
5821
|
-
return (
|
|
5822
|
-
}), a =
|
|
5831
|
+
const s = h((i) => {
|
|
5832
|
+
var o;
|
|
5833
|
+
return (o = i.card) == null ? void 0 : o.preferences;
|
|
5834
|
+
}), a = h(
|
|
5823
5835
|
(i) => i.actions.setCardPreferences
|
|
5824
5836
|
);
|
|
5825
5837
|
return /* @__PURE__ */ n("div", { className: "space-y-6 px-6 py-2", children: [
|
|
@@ -5898,7 +5910,7 @@ const zi = /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs",
|
|
|
5898
5910
|
] })
|
|
5899
5911
|
] });
|
|
5900
5912
|
function Ai() {
|
|
5901
|
-
const t =
|
|
5913
|
+
const t = h((a) => a.card.type);
|
|
5902
5914
|
function s(a) {
|
|
5903
5915
|
switch (a) {
|
|
5904
5916
|
case "stackedBar":
|
|
@@ -5935,7 +5947,7 @@ function Ai() {
|
|
|
5935
5947
|
case "map":
|
|
5936
5948
|
return /* @__PURE__ */ e(Mi, {});
|
|
5937
5949
|
case "custom":
|
|
5938
|
-
return /* @__PURE__ */ e(
|
|
5950
|
+
return /* @__PURE__ */ e(hi, {});
|
|
5939
5951
|
default:
|
|
5940
5952
|
return /* @__PURE__ */ e(vi, {});
|
|
5941
5953
|
}
|
|
@@ -5946,7 +5958,7 @@ function Ai() {
|
|
|
5946
5958
|
] });
|
|
5947
5959
|
}
|
|
5948
5960
|
function Ei() {
|
|
5949
|
-
const t =
|
|
5961
|
+
const t = h((s) => s.isShowingVisual);
|
|
5950
5962
|
return /* @__PURE__ */ n(
|
|
5951
5963
|
lt,
|
|
5952
5964
|
{
|
|
@@ -5992,13 +6004,13 @@ function Ei() {
|
|
|
5992
6004
|
);
|
|
5993
6005
|
}
|
|
5994
6006
|
function Vi({ authToken: t, onSave: s, onClose: a }) {
|
|
5995
|
-
T((
|
|
5996
|
-
const l =
|
|
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);
|
|
5997
6009
|
return de(() => {
|
|
5998
6010
|
s && l(s), a && i(a);
|
|
5999
6011
|
}, [s, l, a, i]), de(() => {
|
|
6000
|
-
t && t.accessToken &&
|
|
6001
|
-
}, [t,
|
|
6012
|
+
t && t.accessToken && o(t);
|
|
6013
|
+
}, [t, o]), /* @__PURE__ */ e(mt, { FallbackComponent: Da, children: /* @__PURE__ */ n(
|
|
6002
6014
|
Ls,
|
|
6003
6015
|
{
|
|
6004
6016
|
style: {
|
|
@@ -6015,12 +6027,12 @@ function Vi({ authToken: t, onSave: s, onClose: a }) {
|
|
|
6015
6027
|
) });
|
|
6016
6028
|
}
|
|
6017
6029
|
function qi() {
|
|
6018
|
-
T((
|
|
6019
|
-
const t = T((
|
|
6020
|
-
function i(
|
|
6021
|
-
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));
|
|
6022
6034
|
}
|
|
6023
|
-
function
|
|
6035
|
+
function o() {
|
|
6024
6036
|
s(!1);
|
|
6025
6037
|
}
|
|
6026
6038
|
return /* @__PURE__ */ e(
|
|
@@ -6030,32 +6042,32 @@ function qi() {
|
|
|
6030
6042
|
className: se("flex grow", {
|
|
6031
6043
|
"max-h-0 overflow-hidden": !a
|
|
6032
6044
|
}),
|
|
6033
|
-
children: /* @__PURE__ */ e(Vi, { onSave: i, onClose:
|
|
6045
|
+
children: /* @__PURE__ */ e(Vi, { onSave: i, onClose: o })
|
|
6034
6046
|
}
|
|
6035
6047
|
);
|
|
6036
6048
|
}
|
|
6037
6049
|
function ji() {
|
|
6038
|
-
const t =
|
|
6039
|
-
return /* @__PURE__ */ e(Ie, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((
|
|
6040
|
-
const
|
|
6041
|
-
(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
|
|
6042
6054
|
);
|
|
6043
6055
|
return /* @__PURE__ */ e(
|
|
6044
6056
|
"div",
|
|
6045
6057
|
{
|
|
6046
|
-
onClick: () => i(
|
|
6058
|
+
onClick: () => i(o),
|
|
6047
6059
|
className: se(
|
|
6048
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",
|
|
6049
6061
|
{
|
|
6050
|
-
"bg-muted":
|
|
6062
|
+
"bg-muted": c
|
|
6051
6063
|
}
|
|
6052
6064
|
),
|
|
6053
6065
|
children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
6054
|
-
/* @__PURE__ */ e(Ga, { column:
|
|
6055
|
-
/* @__PURE__ */ e("span", { children:
|
|
6066
|
+
/* @__PURE__ */ e(Ga, { column: o }),
|
|
6067
|
+
/* @__PURE__ */ e("span", { children: o.column_name })
|
|
6056
6068
|
] })
|
|
6057
6069
|
},
|
|
6058
|
-
|
|
6070
|
+
o.column_name
|
|
6059
6071
|
);
|
|
6060
6072
|
}) });
|
|
6061
6073
|
}
|
|
@@ -6073,7 +6085,7 @@ function Ri() {
|
|
|
6073
6085
|
onClick: () => t(!1),
|
|
6074
6086
|
className: "h-7 w-7 p-0",
|
|
6075
6087
|
variant: "ghost",
|
|
6076
|
-
children: /* @__PURE__ */ e(
|
|
6088
|
+
children: /* @__PURE__ */ e(ut, {})
|
|
6077
6089
|
}
|
|
6078
6090
|
)
|
|
6079
6091
|
] }),
|
|
@@ -6245,6 +6257,6 @@ export {
|
|
|
6245
6257
|
sr as useDateFilterHook,
|
|
6246
6258
|
ie as useEditorActions,
|
|
6247
6259
|
Ae as useEditorAside,
|
|
6248
|
-
|
|
6260
|
+
h as useEditorStore,
|
|
6249
6261
|
lr as useTextFilterHook
|
|
6250
6262
|
};
|