react-semaphor 0.0.366 → 0.0.367
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{index-0sZ1-IXK.js → index-C1Qa1YD4.js} +25 -25
- package/dist/chunks/index-CON6ISXt.js +181 -0
- package/dist/chunks/{index-DMKp0FF7.js → index-CnL0rGKB.js} +214 -214
- package/dist/chunks/{index-B0y-9ayw.js → index-Dn9R0tUI.js} +1294 -1289
- package/dist/chunks/{lucide-react-Cui-03tX.js → lucide-react-7GsiI7eS.js} +1 -1
- package/dist/chunks/{lucide-react-Ch7fAUq1.js → lucide-react-DGNkJZmc.js} +3 -3
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +4 -0
- package/dist/types/main.d.ts +4 -0
- package/dist/types/surfboard.d.ts +4 -0
- package/dist/types/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/chunks/index-ckeXgCi_.js +0 -181
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as _, w as Cs, x as k, y as Re, z as Ie, A as e, B as Ss, H as ws, J as T, p as Qe, K as ks, M as zs, N as Is, Q as ca, R as H, V as oe, W as da, Y as Os, Z as Ds, _ as Ts, $ as ua, a0 as ma, a1 as tt, a2 as Zs, a3 as Z, a4 as Ge, i as nt, a5 as u, a6 as lt, a7 as rt, P as ha, F as xa, a8 as Ue, a9 as Je, aa as pa, ab as it, ac as fa, ad as pe, ae as fe, af as ge, ag as je, ah as we, ai as be, aj as ee, ak as Ms, al as Fs, am as Ls, an as ga, ao as ja, ap as he, aq as ot, ar as ct, as as ba, at as dt, C as ut, au as mt, av as va, aw as ve, ax as ht, ay as We, az as ts, aA as Te, aB as qe, aC as ke, aD as xt, X as Es, aE as Xs, aF as pt, aG as ft, aH as gt, aI as jt, l as bt, aJ as vt, aK as yt, aL as Fe, aM as ne, aN as ya, aO as Nt, aP as ds, aQ as Ct, aR as St, aS as vs, o as wt, a as kt, aT as ns, aU as Se, aV as ls, aW as zt, aX as It, aY as Ot, aZ as Dt, a_ as bs, a$ as Tt, b0 as Ys, b1 as Mt, b2 as ea, b3 as Ft, b4 as Lt, b5 as Et, b6 as Vt, b7 as Na, b8 as At, b9 as Vs, ba as Ca, bb as qt, bc as Rt, bd as es, be as _t, bf as Ht, bg as Sa, bh as Pt, t as $t, bi as Bt, bj as Gt, s as Ut, bk as us, bl as wa, bm as ka, bn as za, bo as ss, bp as as, bq as Jt, br as Ce, bs as Wt, bt as Kt, bu as ms, bv as hs, bw as xs, bx as Qt, I as Zt, by as Xt, bz as Yt, bA as en, E as sn, bB as ps, bC as Me, f as an, bD as $e, bE as As, bF as Ia, bG as tn, bH as nn, bI as rs, bJ as ln, bK as rn, bL as on, bM as cn, bN as sa, bO as aa, bP as Oa, bQ as dn, bR as un, bS as mn, bT as hn, bU as xn, bV as pn, bW as fn, bX as gn, bY as Le, bZ as W, b_ as K, b$ as qs, c0 as Q, c1 as jn, c2 as Da, c3 as bn, c4 as vn, c5 as yn, c6 as Nn, c7 as Cn, c8 as Sn, c9 as wn, ca as kn, cb as zn } from "./index-
|
|
1
|
+
import { c as _, w as Cs, x as k, y as Re, z as Ie, A as e, B as Ss, H as ws, J as T, p as Qe, K as ks, M as zs, N as Is, Q as ca, R as H, V as oe, W as da, Y as Os, Z as Ds, _ as Ts, $ as ua, a0 as ma, a1 as tt, a2 as Zs, a3 as Z, a4 as Ge, i as nt, a5 as u, a6 as lt, a7 as rt, P as ha, F as xa, a8 as Ue, a9 as Je, aa as pa, ab as it, ac as fa, ad as pe, ae as fe, af as ge, ag as je, ah as we, ai as be, aj as ee, ak as Ms, al as Fs, am as Ls, an as ga, ao as ja, ap as he, aq as ot, ar as ct, as as ba, at as dt, C as ut, au as mt, av as va, aw as ve, ax as ht, ay as We, az as ts, aA as Te, aB as qe, aC as ke, aD as xt, X as Es, aE as Xs, aF as pt, aG as ft, aH as gt, aI as jt, l as bt, aJ as vt, aK as yt, aL as Fe, aM as ne, aN as ya, aO as Nt, aP as ds, aQ as Ct, aR as St, aS as vs, o as wt, a as kt, aT as ns, aU as Se, aV as ls, aW as zt, aX as It, aY as Ot, aZ as Dt, a_ as bs, a$ as Tt, b0 as Ys, b1 as Mt, b2 as ea, b3 as Ft, b4 as Lt, b5 as Et, b6 as Vt, b7 as Na, b8 as At, b9 as Vs, ba as Ca, bb as qt, bc as Rt, bd as es, be as _t, bf as Ht, bg as Sa, bh as Pt, t as $t, bi as Bt, bj as Gt, s as Ut, bk as us, bl as wa, bm as ka, bn as za, bo as ss, bp as as, bq as Jt, br as Ce, bs as Wt, bt as Kt, bu as ms, bv as hs, bw as xs, bx as Qt, I as Zt, by as Xt, bz as Yt, bA as en, E as sn, bB as ps, bC as Me, f as an, bD as $e, bE as As, bF as Ia, bG as tn, bH as nn, bI as rs, bJ as ln, bK as rn, bL as on, bM as cn, bN as sa, bO as aa, bP as Oa, bQ as dn, bR as un, bS as mn, bT as hn, bU as xn, bV as pn, bW as fn, bX as gn, bY as Le, bZ as W, b_ as K, b$ as qs, c0 as Q, c1 as jn, c2 as Da, c3 as bn, c4 as vn, c5 as yn, c6 as Nn, c7 as Cn, c8 as Sn, c9 as wn, ca as kn, cb as zn } from "./index-Dn9R0tUI.js";
|
|
2
2
|
import * as ta from "react";
|
|
3
3
|
import ze, { useState as q, useMemo as ys, useEffect as se, useRef as is, useCallback as Ta, Suspense as In } from "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -587,9 +587,9 @@ async function tl(s, n) {
|
|
|
587
587
|
}) : null;
|
|
588
588
|
}
|
|
589
589
|
function nl() {
|
|
590
|
-
const [s, n] = q(""), [a, t] = q(!1), l = k((g) => g.lenses), { setLenses: r, setSelectedLensId: i } = Re(), [
|
|
590
|
+
const [s, n] = q(""), [a, t] = q(!1), l = k((g) => g.lenses), { setLenses: r, setSelectedLensId: i } = Re(), [o, c] = q(!1), [m, x] = q(!1), j = k((g) => g.dashboard), b = k((g) => g.filterValues), { authToken: d } = Ie();
|
|
591
591
|
async function f() {
|
|
592
|
-
|
|
592
|
+
c(!0);
|
|
593
593
|
const g = Aa(
|
|
594
594
|
j
|
|
595
595
|
), N = await al(
|
|
@@ -598,7 +598,7 @@ function nl() {
|
|
|
598
598
|
b,
|
|
599
599
|
d == null ? void 0 : d.accessToken
|
|
600
600
|
);
|
|
601
|
-
N && (r([...l || [], N]), i(N.id), x(!1)),
|
|
601
|
+
N && (r([...l || [], N]), i(N.id), x(!1)), c(!1);
|
|
602
602
|
}
|
|
603
603
|
return /* @__PURE__ */ e.jsxs(Ss, { open: m, onOpenChange: x, children: [
|
|
604
604
|
/* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -640,8 +640,8 @@ function nl() {
|
|
|
640
640
|
variant: "outline",
|
|
641
641
|
type: "submit",
|
|
642
642
|
onClick: f,
|
|
643
|
-
disabled:
|
|
644
|
-
children:
|
|
643
|
+
disabled: o,
|
|
644
|
+
children: o ? "Creating..." : "Add"
|
|
645
645
|
}
|
|
646
646
|
) })
|
|
647
647
|
] })
|
|
@@ -649,10 +649,10 @@ function nl() {
|
|
|
649
649
|
}
|
|
650
650
|
function ll() {
|
|
651
651
|
const [s, n] = q(!1), a = k((x) => x.lenses), t = k((x) => x.selectedLensId), { setLenses: l, setSelectedLensId: r } = Re(), { authToken: i } = Ie();
|
|
652
|
-
async function
|
|
652
|
+
async function o(x) {
|
|
653
653
|
r(x);
|
|
654
654
|
}
|
|
655
|
-
async function
|
|
655
|
+
async function c(x) {
|
|
656
656
|
if (await tl(x, i == null ? void 0 : i.accessToken)) {
|
|
657
657
|
const b = a == null ? void 0 : a.filter((d) => d.id !== x);
|
|
658
658
|
l(b || []), r("original");
|
|
@@ -690,7 +690,7 @@ function ll() {
|
|
|
690
690
|
tt,
|
|
691
691
|
{
|
|
692
692
|
value: t,
|
|
693
|
-
onValueChange:
|
|
693
|
+
onValueChange: o,
|
|
694
694
|
children: [
|
|
695
695
|
/* @__PURE__ */ e.jsx(Zs, { value: "original", children: "Original" }),
|
|
696
696
|
a == null ? void 0 : a.map((x) => /* @__PURE__ */ e.jsxs(
|
|
@@ -721,7 +721,7 @@ function ll() {
|
|
|
721
721
|
Ge,
|
|
722
722
|
{
|
|
723
723
|
onClick: (j) => {
|
|
724
|
-
j.preventDefault(),
|
|
724
|
+
j.preventDefault(), c(x.id);
|
|
725
725
|
},
|
|
726
726
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
727
727
|
strokeWidth: 1.5
|
|
@@ -739,23 +739,23 @@ function ll() {
|
|
|
739
739
|
] });
|
|
740
740
|
}
|
|
741
741
|
async function rl() {
|
|
742
|
-
var
|
|
743
|
-
const s = k.getState().authToken, n = k.getState().theme, a = k.getState().filterValues, t = (
|
|
744
|
-
if (
|
|
742
|
+
var d;
|
|
743
|
+
const s = k.getState().authToken, n = k.getState().theme, a = k.getState().filterValues, t = (d = k.getState().dashboard) == null ? void 0 : d.title, l = k.getState().isDownloadingPdf, r = k.getState().selectedSheetId;
|
|
744
|
+
if (l)
|
|
745
745
|
return;
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
const
|
|
746
|
+
const i = new URLSearchParams();
|
|
747
|
+
i.set("token", (s == null ? void 0 : s.accessToken) || ""), i.set("theme", n || "light"), i.set("filterValues", JSON.stringify(a)), i.set("selectedSheetId", r || "");
|
|
748
|
+
const o = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(i.toString())}`;
|
|
749
749
|
k.setState({ isDownloadingPdf: !0 });
|
|
750
|
-
const
|
|
750
|
+
const x = (await (await fetch(o, {
|
|
751
751
|
method: "GET",
|
|
752
752
|
headers: {
|
|
753
753
|
Authorization: `Bearer ${s == null ? void 0 : s.accessToken}`
|
|
754
754
|
}
|
|
755
|
-
})).json()).url,
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
|
|
755
|
+
})).json()).url, j = document.createElement("a");
|
|
756
|
+
j.href = x;
|
|
757
|
+
const b = `${t}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
|
|
758
|
+
j.download = b, j.click(), k.setState({ isDownloadingPdf: !1 });
|
|
759
759
|
}
|
|
760
760
|
function il({
|
|
761
761
|
iconClassName: s
|
|
@@ -794,7 +794,7 @@ function ol() {
|
|
|
794
794
|
(p) => p.isDashboardEditing
|
|
795
795
|
), i = u(
|
|
796
796
|
(p) => p.selectedConnectionId
|
|
797
|
-
), [
|
|
797
|
+
), [o, c] = q(!1), m = k((p) => p.filterValues), x = k((p) => p.isVisualEditing), j = k((p) => p.showFilters);
|
|
798
798
|
k(
|
|
799
799
|
(p) => p.showDashboardJSON
|
|
800
800
|
);
|
|
@@ -833,7 +833,7 @@ function ol() {
|
|
|
833
833
|
v(!0);
|
|
834
834
|
};
|
|
835
835
|
async function h() {
|
|
836
|
-
if (
|
|
836
|
+
if (c(!0), !a || !t) return;
|
|
837
837
|
const p = Aa(
|
|
838
838
|
l
|
|
839
839
|
), I = JSON.stringify(p), O = {
|
|
@@ -841,7 +841,7 @@ function ol() {
|
|
|
841
841
|
template: I,
|
|
842
842
|
filterValues: m
|
|
843
843
|
};
|
|
844
|
-
await Ns(O, s == null ? void 0 : s.accessToken), Je.success("Lens saved"), b == null || b(p),
|
|
844
|
+
await Ns(O, s == null ? void 0 : s.accessToken), Je.success("Lens saved"), b == null || b(p), c(!1);
|
|
845
845
|
}
|
|
846
846
|
return x ? null : /* @__PURE__ */ e.jsxs(
|
|
847
847
|
"div",
|
|
@@ -897,7 +897,7 @@ function ol() {
|
|
|
897
897
|
{
|
|
898
898
|
className: "h-7 p-2",
|
|
899
899
|
variant: "ghost",
|
|
900
|
-
disabled:
|
|
900
|
+
disabled: o,
|
|
901
901
|
onClick: h,
|
|
902
902
|
size: "sm",
|
|
903
903
|
children: /* @__PURE__ */ e.jsx(Jn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
@@ -928,8 +928,8 @@ function Pe({
|
|
|
928
928
|
isError: l,
|
|
929
929
|
connectionTooltip: r,
|
|
930
930
|
onChange: i,
|
|
931
|
-
showNone:
|
|
932
|
-
className:
|
|
931
|
+
showNone: o = !1,
|
|
932
|
+
className: c,
|
|
933
933
|
showIcon: m = !0,
|
|
934
934
|
disabled: x = !1
|
|
935
935
|
}) {
|
|
@@ -957,7 +957,7 @@ function Pe({
|
|
|
957
957
|
{
|
|
958
958
|
className: Z(
|
|
959
959
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
960
|
-
|
|
960
|
+
c
|
|
961
961
|
),
|
|
962
962
|
children: /* @__PURE__ */ e.jsx(
|
|
963
963
|
ge,
|
|
@@ -970,7 +970,7 @@ function Pe({
|
|
|
970
970
|
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(we, { children: [
|
|
971
971
|
t ? /* @__PURE__ */ e.jsx(be, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(be, { children: s }),
|
|
972
972
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
973
|
-
|
|
973
|
+
o && /* @__PURE__ */ e.jsx(ee, { value: "none", children: "None" }, "none"),
|
|
974
974
|
n && n.map((d, f) => /* @__PURE__ */ e.jsx(ee, { value: d.id, children: d.name }, f))
|
|
975
975
|
] }),
|
|
976
976
|
(t || l) && /* @__PURE__ */ e.jsx(ee, { value: j, children: j })
|
|
@@ -983,10 +983,10 @@ function cl({ column: s }) {
|
|
|
983
983
|
(f) => f.selectedSchemaName
|
|
984
984
|
), r = u(
|
|
985
985
|
(f) => f.selectedDatamodelId
|
|
986
|
-
), i = u((f) => f.sqlGen), { modelItems:
|
|
986
|
+
), i = u((f) => f.sqlGen), { modelItems: o, connectionType: c } = Ee(), m = u((f) => f.actions.setSqlGen), x = u((f) => f.actions.setCardSql), j = u((f) => f.actions.setRunSql);
|
|
987
987
|
function b(f, g) {
|
|
988
988
|
var F;
|
|
989
|
-
const N = ga(f, i, g), v = (F =
|
|
989
|
+
const N = ga(f, i, g), v = (F = o == null ? void 0 : o.find(
|
|
990
990
|
(S) => S.id === r
|
|
991
991
|
)) == null ? void 0 : F.name;
|
|
992
992
|
m(N);
|
|
@@ -995,7 +995,7 @@ function cl({ column: s }) {
|
|
|
995
995
|
he(l || ""),
|
|
996
996
|
he(t),
|
|
997
997
|
v,
|
|
998
|
-
|
|
998
|
+
c
|
|
999
999
|
);
|
|
1000
1000
|
V && (x(V), j(!0)), a(!1);
|
|
1001
1001
|
}
|
|
@@ -1071,9 +1071,9 @@ function dl({
|
|
|
1071
1071
|
(h) => h.selectedConnectionId
|
|
1072
1072
|
), i = u(
|
|
1073
1073
|
(h) => h.selectedDatabaseName
|
|
1074
|
-
),
|
|
1074
|
+
), o = u(
|
|
1075
1075
|
(h) => h.selectedSchemaName
|
|
1076
|
-
),
|
|
1076
|
+
), c = u((h) => h.selectedTableName), m = u(
|
|
1077
1077
|
(h) => h.selectedDatamodelId
|
|
1078
1078
|
), x = k(
|
|
1079
1079
|
(h) => h.dashboard.aiScopeTables
|
|
@@ -1099,16 +1099,16 @@ function dl({
|
|
|
1099
1099
|
}
|
|
1100
1100
|
function w() {
|
|
1101
1101
|
return (x == null ? void 0 : x.find(
|
|
1102
|
-
(h) => h.connectionId === r && (h.tableName ===
|
|
1102
|
+
(h) => h.connectionId === r && (h.tableName === c || h.datamodelName === F)
|
|
1103
1103
|
)) !== void 0;
|
|
1104
1104
|
}
|
|
1105
1105
|
function D(h) {
|
|
1106
|
-
h === !0 && (
|
|
1106
|
+
h === !0 && (c || F) && r ? (j({
|
|
1107
1107
|
connectionId: r,
|
|
1108
1108
|
connectionType: v,
|
|
1109
1109
|
databaseName: i,
|
|
1110
|
-
schemaName:
|
|
1111
|
-
tableName:
|
|
1110
|
+
schemaName: o,
|
|
1111
|
+
tableName: c,
|
|
1112
1112
|
datamodelName: F
|
|
1113
1113
|
}), Je.success("Added to Assistant Scope", {
|
|
1114
1114
|
position: "top-right",
|
|
@@ -1117,7 +1117,7 @@ function dl({
|
|
|
1117
1117
|
})) : (b({
|
|
1118
1118
|
connectionId: r || "",
|
|
1119
1119
|
connectionType: v || "",
|
|
1120
|
-
tableName:
|
|
1120
|
+
tableName: c || "",
|
|
1121
1121
|
datamodelName: F || ""
|
|
1122
1122
|
}), Je("Removed from Assistant Scope", {
|
|
1123
1123
|
position: "top-right",
|
|
@@ -1248,9 +1248,9 @@ function Ee(s, n) {
|
|
|
1248
1248
|
(y) => y.selectedDatamodelId
|
|
1249
1249
|
), i = u(
|
|
1250
1250
|
(y) => y.selectedDatabaseName
|
|
1251
|
-
),
|
|
1251
|
+
), o = u(
|
|
1252
1252
|
(y) => y.selectedSchemaName
|
|
1253
|
-
),
|
|
1253
|
+
), c = u((y) => y.selectedTableName), m = u(
|
|
1254
1254
|
(y) => y.actions.setCurrentColumns
|
|
1255
1255
|
), x = u(
|
|
1256
1256
|
(y) => y.actions.setSelectedConnectionId
|
|
@@ -1264,10 +1264,10 @@ function Ee(s, n) {
|
|
|
1264
1264
|
(y) => y.actions.setSelectedTableName
|
|
1265
1265
|
), g = u((y) => y.actions.setCardSql);
|
|
1266
1266
|
function N(y) {
|
|
1267
|
-
return l && i &&
|
|
1267
|
+
return l && i && o && i !== "NA" ? !0 : l && y === "API" ? !1 : !!(l && y === "S3");
|
|
1268
1268
|
}
|
|
1269
1269
|
function v(y) {
|
|
1270
|
-
return !!(l && i && i !== "NA" &&
|
|
1270
|
+
return !!(l && i && i !== "NA" && o && c || l && (y === "S3" || y === "API") || r && r);
|
|
1271
1271
|
}
|
|
1272
1272
|
function V(y) {
|
|
1273
1273
|
return l && y ? !(y === "API" || y === "S3") : !1;
|
|
@@ -1347,7 +1347,7 @@ function Ee(s, n) {
|
|
|
1347
1347
|
"tables",
|
|
1348
1348
|
l,
|
|
1349
1349
|
i,
|
|
1350
|
-
|
|
1350
|
+
o
|
|
1351
1351
|
],
|
|
1352
1352
|
queryFn: () => qe(
|
|
1353
1353
|
"https://semaphor.cloud/api/v1/tables",
|
|
@@ -1355,7 +1355,7 @@ function Ee(s, n) {
|
|
|
1355
1355
|
{
|
|
1356
1356
|
connection_id: l,
|
|
1357
1357
|
database_name: i,
|
|
1358
|
-
schema_name:
|
|
1358
|
+
schema_name: o
|
|
1359
1359
|
}
|
|
1360
1360
|
),
|
|
1361
1361
|
enabled: N(p)
|
|
@@ -1370,8 +1370,8 @@ function Ee(s, n) {
|
|
|
1370
1370
|
l,
|
|
1371
1371
|
i,
|
|
1372
1372
|
r,
|
|
1373
|
-
|
|
1374
|
-
|
|
1373
|
+
o,
|
|
1374
|
+
c
|
|
1375
1375
|
],
|
|
1376
1376
|
queryFn: () => qe(
|
|
1377
1377
|
"https://semaphor.cloud/api/v1/columns",
|
|
@@ -1381,8 +1381,8 @@ function Ee(s, n) {
|
|
|
1381
1381
|
datamodel_id: r || "",
|
|
1382
1382
|
// don't pass undefined. Pass empty string
|
|
1383
1383
|
database_name: i,
|
|
1384
|
-
schema_name:
|
|
1385
|
-
table_name:
|
|
1384
|
+
schema_name: o,
|
|
1385
|
+
table_name: c
|
|
1386
1386
|
}
|
|
1387
1387
|
),
|
|
1388
1388
|
enabled: v(p)
|
|
@@ -1406,7 +1406,7 @@ function Ee(s, n) {
|
|
|
1406
1406
|
b,
|
|
1407
1407
|
h
|
|
1408
1408
|
]);
|
|
1409
|
-
const G = (h == null ? void 0 : h.type) === "API" ? (Gs = h == null ? void 0 : h.type) == null ? void 0 : Gs.toLowerCase() :
|
|
1409
|
+
const G = (h == null ? void 0 : h.type) === "API" ? (Gs = h == null ? void 0 : h.type) == null ? void 0 : Gs.toLowerCase() : c || "", de = I ? "" : o || "";
|
|
1410
1410
|
function Ae(y) {
|
|
1411
1411
|
d(y), f("");
|
|
1412
1412
|
}
|
|
@@ -1490,8 +1490,8 @@ function Ra({
|
|
|
1490
1490
|
), r = u((P) => P.selectedTableName), i = u(
|
|
1491
1491
|
(P) => P.actions.setSelectedTableName
|
|
1492
1492
|
), {
|
|
1493
|
-
connectionItems:
|
|
1494
|
-
modelItems:
|
|
1493
|
+
connectionItems: o,
|
|
1494
|
+
modelItems: c,
|
|
1495
1495
|
schemaItems: m,
|
|
1496
1496
|
databaseItems: x,
|
|
1497
1497
|
tableItems: j,
|
|
@@ -1565,7 +1565,7 @@ function Ra({
|
|
|
1565
1565
|
onChange: $,
|
|
1566
1566
|
isError: N,
|
|
1567
1567
|
isLoading: f,
|
|
1568
|
-
items:
|
|
1568
|
+
items: c,
|
|
1569
1569
|
value: a || "",
|
|
1570
1570
|
title: "Model"
|
|
1571
1571
|
}
|
|
@@ -1606,13 +1606,13 @@ function Ra({
|
|
|
1606
1606
|
/* @__PURE__ */ e.jsx(
|
|
1607
1607
|
Pe,
|
|
1608
1608
|
{
|
|
1609
|
-
items:
|
|
1609
|
+
items: o,
|
|
1610
1610
|
title: "Connection",
|
|
1611
1611
|
value: n || "",
|
|
1612
1612
|
onChange: I,
|
|
1613
1613
|
isLoading: d,
|
|
1614
1614
|
isError: g,
|
|
1615
|
-
connectionTooltip: ((ae =
|
|
1615
|
+
connectionTooltip: ((ae = o == null ? void 0 : o.find(
|
|
1616
1616
|
(P) => P.id === n
|
|
1617
1617
|
)) == null ? void 0 : ae.type) || ""
|
|
1618
1618
|
}
|
|
@@ -1643,16 +1643,16 @@ function ul(s) {
|
|
|
1643
1643
|
const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1644
1644
|
let r = s.length;
|
|
1645
1645
|
if (l !== -1 && (r = l), t !== -1 && t < r && (r = t), n !== -1) {
|
|
1646
|
-
const i = s.substring(0, n),
|
|
1647
|
-
return `${i} {{ filters | where }} AND ${
|
|
1646
|
+
const i = s.substring(0, n), o = s.substring(n);
|
|
1647
|
+
return `${i} {{ filters | where }} AND ${o.substring(
|
|
1648
1648
|
6
|
|
1649
1649
|
)}`;
|
|
1650
1650
|
} else if (a !== -1) {
|
|
1651
|
-
const i = s.substring(0, a),
|
|
1652
|
-
return `${i} {{ filters | where }} ${
|
|
1651
|
+
const i = s.substring(0, a), o = s.substring(a);
|
|
1652
|
+
return `${i} {{ filters | where }} ${o}`;
|
|
1653
1653
|
} else {
|
|
1654
|
-
const i = s.substring(0, r),
|
|
1655
|
-
return console.log("beforeClause", i), console.log("afterClause",
|
|
1654
|
+
const i = s.substring(0, r), o = s.substring(r);
|
|
1655
|
+
return console.log("beforeClause", i), console.log("afterClause", o), o ? `${i} {{ filters | where }} ${o}` : `${i.replace(/;$/, "")} {{ filters | where }}`;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
function ml({
|
|
@@ -1696,7 +1696,7 @@ function hl({
|
|
|
1696
1696
|
triggerAIRun: t,
|
|
1697
1697
|
setTriggerAIRun: l
|
|
1698
1698
|
}) {
|
|
1699
|
-
const r = is(null), i = is(null), [
|
|
1699
|
+
const r = is(null), i = is(null), [o, c] = q(""), [m, x] = q(null), { authToken: j } = Ie(), [b, d] = q(!1), [f, g] = q(!1), N = u((L) => L.actions.setCardSql), v = u((L) => L.actions.setRunSql), V = u(
|
|
1700
1700
|
(L) => L.actions.switchCardType
|
|
1701
1701
|
), F = u((L) => L.currentColumns), S = u(
|
|
1702
1702
|
(L) => L.selectedDatabaseName
|
|
@@ -1783,7 +1783,7 @@ function hl({
|
|
|
1783
1783
|
// }
|
|
1784
1784
|
// },
|
|
1785
1785
|
onFinish(L, G) {
|
|
1786
|
-
J(G.usage),
|
|
1786
|
+
J(G.usage), c(""), console.log("onFinish", L, G), G.finishReason === "stop" && c("");
|
|
1787
1787
|
}
|
|
1788
1788
|
});
|
|
1789
1789
|
se(() => {
|
|
@@ -1820,7 +1820,7 @@ function hl({
|
|
|
1820
1820
|
toolCall: L
|
|
1821
1821
|
}) {
|
|
1822
1822
|
if (L.toolName === "getAiScopeTables")
|
|
1823
|
-
return
|
|
1823
|
+
return c("Getting tables in scope..."), { status: "success", tables: C == null ? void 0 : C.map((de) => ({
|
|
1824
1824
|
...de,
|
|
1825
1825
|
sqlDialect: A === "S3" || A === "API" ? "DuckDb" : A
|
|
1826
1826
|
})) };
|
|
@@ -1832,13 +1832,13 @@ function hl({
|
|
|
1832
1832
|
query: G
|
|
1833
1833
|
};
|
|
1834
1834
|
}
|
|
1835
|
-
if (L.toolName === "getTableColumns" &&
|
|
1836
|
-
return
|
|
1835
|
+
if (L.toolName === "getTableColumns" && c("Getting table columns..."), L.toolName === "getCurrentSchema")
|
|
1836
|
+
return c("Getting current table columns..."), {
|
|
1837
1837
|
sqlDialect: X,
|
|
1838
1838
|
tableName: $,
|
|
1839
1839
|
columns: F
|
|
1840
1840
|
};
|
|
1841
|
-
|
|
1841
|
+
c("Thinking...");
|
|
1842
1842
|
}
|
|
1843
1843
|
function Ne(L) {
|
|
1844
1844
|
n(!1), N(L), v(!0);
|
|
@@ -1976,7 +1976,7 @@ function hl({
|
|
|
1976
1976
|
/* @__PURE__ */ e.jsx(
|
|
1977
1977
|
ft,
|
|
1978
1978
|
{
|
|
1979
|
-
status: gt(re,
|
|
1979
|
+
status: gt(re, o),
|
|
1980
1980
|
isLoading: me
|
|
1981
1981
|
}
|
|
1982
1982
|
)
|
|
@@ -2099,18 +2099,18 @@ function vl(s) {
|
|
|
2099
2099
|
attr: t,
|
|
2100
2100
|
size: l,
|
|
2101
2101
|
title: r
|
|
2102
|
-
} = s, i = pl(s, xl),
|
|
2103
|
-
return a.className && (
|
|
2102
|
+
} = s, i = pl(s, xl), o = l || a.size || "1em", c;
|
|
2103
|
+
return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ze.createElement("svg", os({
|
|
2104
2104
|
stroke: "currentColor",
|
|
2105
2105
|
fill: "currentColor",
|
|
2106
2106
|
strokeWidth: "0"
|
|
2107
2107
|
}, a.attr, t, i, {
|
|
2108
|
-
className:
|
|
2108
|
+
className: c,
|
|
2109
2109
|
style: cs(cs({
|
|
2110
2110
|
color: s.color || a.color
|
|
2111
2111
|
}, a.style), s.style),
|
|
2112
|
-
height:
|
|
2113
|
-
width:
|
|
2112
|
+
height: o,
|
|
2113
|
+
width: o,
|
|
2114
2114
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2115
2115
|
}), r && /* @__PURE__ */ ze.createElement("title", null, r), s.children);
|
|
2116
2116
|
};
|
|
@@ -2136,7 +2136,7 @@ function Nl({ sql: s }) {
|
|
|
2136
2136
|
] });
|
|
2137
2137
|
}
|
|
2138
2138
|
function Pa(s) {
|
|
2139
|
-
const { theme: n } = vt(), a = k((g) => g.theme), t = u((g) => g.frame), l = u((g) => g.card), r = u((g) => g.activeTabCardId), i = yt(), { refetch:
|
|
2139
|
+
const { theme: n } = vt(), a = k((g) => g.theme), t = u((g) => g.frame), l = u((g) => g.card), r = u((g) => g.activeTabCardId), i = yt(), { refetch: o } = Fe(l), { updateCardTab: c, setRunSql: m } = ne(), x = is(), j = is({}), b = t.cards.find((g) => g.id === r), d = Ta(() => {
|
|
2140
2140
|
let g = "";
|
|
2141
2141
|
return s === "python" && (g = (b == null ? void 0 : b.python) || ya), s === "sql" && (g = (b == null ? void 0 : b.sql) || ""), g;
|
|
2142
2142
|
}, [s, b]);
|
|
@@ -2152,12 +2152,12 @@ function Pa(s) {
|
|
|
2152
2152
|
}
|
|
2153
2153
|
x.current.setModel(N);
|
|
2154
2154
|
}
|
|
2155
|
-
|
|
2155
|
+
c(r, l), m(!0);
|
|
2156
2156
|
}
|
|
2157
2157
|
}, [
|
|
2158
2158
|
r,
|
|
2159
2159
|
l,
|
|
2160
|
-
|
|
2160
|
+
c,
|
|
2161
2161
|
i,
|
|
2162
2162
|
m,
|
|
2163
2163
|
s,
|
|
@@ -2183,10 +2183,10 @@ function Pa(s) {
|
|
|
2183
2183
|
g && i && l && g.addCommand(
|
|
2184
2184
|
i.KeyMod.Shift | i.KeyCode.Enter,
|
|
2185
2185
|
function() {
|
|
2186
|
-
return
|
|
2186
|
+
return o(), !1;
|
|
2187
2187
|
}
|
|
2188
2188
|
);
|
|
2189
|
-
}, [i,
|
|
2189
|
+
}, [i, o, l]);
|
|
2190
2190
|
function f(g, N) {
|
|
2191
2191
|
if (x.current = g, !j.current[l.id]) {
|
|
2192
2192
|
const v = g.getModel(), V = d();
|
|
@@ -2290,7 +2290,7 @@ function kl() {
|
|
|
2290
2290
|
const [s, n] = q({
|
|
2291
2291
|
queryKey: [],
|
|
2292
2292
|
queryData: null
|
|
2293
|
-
}), a = St(), [t, l] = q(!1), [r, i] = q(!1), [
|
|
2293
|
+
}), a = St(), [t, l] = q(!1), [r, i] = q(!1), [o, c] = q(!1), [m, x] = q(""), [j, b] = q(!1), d = u((z) => z.frame), f = u((z) => z.card), g = u((z) => z.isShowingVisual), N = u(
|
|
2294
2294
|
(z) => z.selectedConnectionId
|
|
2295
2295
|
), v = u(
|
|
2296
2296
|
(z) => z.selectedDatabaseName
|
|
@@ -2529,7 +2529,7 @@ function kl() {
|
|
|
2529
2529
|
ml,
|
|
2530
2530
|
{
|
|
2531
2531
|
error: (P == null ? void 0 : P.message) || ((Oe = B == null ? void 0 : B.error) == null ? void 0 : Oe.message),
|
|
2532
|
-
setShowAIDialog:
|
|
2532
|
+
setShowAIDialog: c,
|
|
2533
2533
|
setTriggerAIRun: b,
|
|
2534
2534
|
setUserInputforAI: x
|
|
2535
2535
|
}
|
|
@@ -2561,8 +2561,8 @@ function kl() {
|
|
|
2561
2561
|
/* @__PURE__ */ e.jsx(
|
|
2562
2562
|
hl,
|
|
2563
2563
|
{
|
|
2564
|
-
open:
|
|
2565
|
-
setOpen:
|
|
2564
|
+
open: o,
|
|
2565
|
+
setOpen: c,
|
|
2566
2566
|
userInput: m,
|
|
2567
2567
|
triggerAIRun: j,
|
|
2568
2568
|
setTriggerAIRun: b
|
|
@@ -2607,18 +2607,18 @@ function kl() {
|
|
|
2607
2607
|
}
|
|
2608
2608
|
function zl({ data: s }) {
|
|
2609
2609
|
var i;
|
|
2610
|
-
const [n, a] = ze.useState([]), l = Object.keys(s[0]).map((
|
|
2610
|
+
const [n, a] = ze.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2611
2611
|
// header: key,
|
|
2612
|
-
accessorKey:
|
|
2613
|
-
header: ({ column:
|
|
2614
|
-
const m =
|
|
2612
|
+
accessorKey: o,
|
|
2613
|
+
header: ({ column: c }) => {
|
|
2614
|
+
const m = c.getIsSorted();
|
|
2615
2615
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2616
2616
|
"div",
|
|
2617
2617
|
{
|
|
2618
2618
|
className: "flex cursor-pointer items-center",
|
|
2619
|
-
onClick: () =>
|
|
2619
|
+
onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
|
|
2620
2620
|
children: [
|
|
2621
|
-
|
|
2621
|
+
o,
|
|
2622
2622
|
m === "asc" ? /* @__PURE__ */ e.jsx(zt, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(It, { className: "ml-2 h-5 w-5" }) : null
|
|
2623
2623
|
]
|
|
2624
2624
|
}
|
|
@@ -2637,25 +2637,25 @@ function zl({ data: s }) {
|
|
|
2637
2637
|
}
|
|
2638
2638
|
});
|
|
2639
2639
|
return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
|
|
2640
|
-
/* @__PURE__ */ e.jsx(Dt, { children: r.getHeaderGroups().map((
|
|
2640
|
+
/* @__PURE__ */ e.jsx(Dt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(bs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
|
|
2641
2641
|
Tt,
|
|
2642
2642
|
{
|
|
2643
2643
|
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
2644
|
-
children:
|
|
2645
|
-
|
|
2646
|
-
|
|
2644
|
+
children: c.isPlaceholder ? null : Ys(
|
|
2645
|
+
c.column.columnDef.header,
|
|
2646
|
+
c.getContext()
|
|
2647
2647
|
)
|
|
2648
2648
|
},
|
|
2649
|
-
|
|
2650
|
-
)) },
|
|
2651
|
-
/* @__PURE__ */ e.jsx(Mt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((
|
|
2649
|
+
c.id
|
|
2650
|
+
)) }, o.id)) }),
|
|
2651
|
+
/* @__PURE__ */ e.jsx(Mt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2652
2652
|
bs,
|
|
2653
2653
|
{
|
|
2654
2654
|
className: "whitespace-nowrap py-2",
|
|
2655
|
-
"data-state":
|
|
2656
|
-
children:
|
|
2655
|
+
"data-state": o.getIsSelected() && "selected",
|
|
2656
|
+
children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(ea, { className: "py-3", children: Ys(c.column.columnDef.cell, c.getContext()) }, c.id))
|
|
2657
2657
|
},
|
|
2658
|
-
|
|
2658
|
+
o.id
|
|
2659
2659
|
)) : /* @__PURE__ */ e.jsx(bs, { children: /* @__PURE__ */ e.jsx(ea, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2660
2660
|
] }) });
|
|
2661
2661
|
}
|
|
@@ -2663,8 +2663,8 @@ function Il({ card: s }) {
|
|
|
2663
2663
|
var v, V, F, S, w, D, R, C, h, p, I;
|
|
2664
2664
|
const [n, a] = q(!1), [t, l] = q(
|
|
2665
2665
|
[]
|
|
2666
|
-
), { authToken: r } = Ie(), i = Vt(r == null ? void 0 : r.accessToken),
|
|
2667
|
-
colors: ((V = (v =
|
|
2666
|
+
), { authToken: r } = Ie(), i = Vt(r == null ? void 0 : r.accessToken), o = k((O) => O.themeStyle), c = {
|
|
2667
|
+
colors: ((V = (v = o == null ? void 0 : o.chart) == null ? void 0 : v.dataset) == null ? void 0 : V.backgroundColor) || []
|
|
2668
2668
|
};
|
|
2669
2669
|
(F = s.customCardPreferences) != null && F.inputData;
|
|
2670
2670
|
const { getCard: m } = Na(((S = s.customCardPreferences) == null ? void 0 : S.url) || ""), x = ((w = s.customCardPreferences) == null ? void 0 : w.visualType) || "single", j = u((O) => O.frame);
|
|
@@ -2699,7 +2699,7 @@ function Il({ card: s }) {
|
|
|
2699
2699
|
f,
|
|
2700
2700
|
{
|
|
2701
2701
|
params: i,
|
|
2702
|
-
theme:
|
|
2702
|
+
theme: c,
|
|
2703
2703
|
settings: (h = s.customCardPreferences) == null ? void 0 : h.settings,
|
|
2704
2704
|
onDataChange: d,
|
|
2705
2705
|
data: (b == null ? void 0 : b.records) || []
|
|
@@ -2728,7 +2728,7 @@ function Il({ card: s }) {
|
|
|
2728
2728
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2729
2729
|
f,
|
|
2730
2730
|
{
|
|
2731
|
-
theme:
|
|
2731
|
+
theme: c,
|
|
2732
2732
|
onDataChange: d,
|
|
2733
2733
|
settings: N.map(
|
|
2734
2734
|
(O) => {
|
|
@@ -2754,11 +2754,11 @@ function $a({
|
|
|
2754
2754
|
var N;
|
|
2755
2755
|
const a = u((v) => v.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((v) => v.frame), r = k((v) => v.dashboard.filters);
|
|
2756
2756
|
u((v) => v.actions.setRunSql);
|
|
2757
|
-
const { updateFilter: i } = Re(),
|
|
2757
|
+
const { updateFilter: i } = Re(), o = r == null ? void 0 : r.find((v) => v.id === l.filterId), { data: c, isLoading: m, isFetching: x } = Fe(a), { setCard: j } = ne(), { data: b } = Vs(a);
|
|
2758
2758
|
if (!a.id) return null;
|
|
2759
2759
|
let d;
|
|
2760
|
-
|
|
2761
|
-
data:
|
|
2760
|
+
c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (d = Ca({
|
|
2761
|
+
data: c == null ? void 0 : c.records,
|
|
2762
2762
|
cardType: a.type,
|
|
2763
2763
|
cfg: a.cfg,
|
|
2764
2764
|
customCfg: a.customCfg,
|
|
@@ -2770,7 +2770,7 @@ function $a({
|
|
|
2770
2770
|
}
|
|
2771
2771
|
function g() {
|
|
2772
2772
|
var v;
|
|
2773
|
-
if (
|
|
2773
|
+
if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !m && !x)
|
|
2774
2774
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2775
2775
|
/* @__PURE__ */ e.jsx($t, { className: "size-8 text-muted-foreground" }),
|
|
2776
2776
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
@@ -2785,9 +2785,9 @@ function $a({
|
|
|
2785
2785
|
},
|
|
2786
2786
|
JSON.stringify(d) + JSON.stringify(a.preferences) + ((v = a == null ? void 0 : a.preferences) == null ? void 0 : v.customVisualCode)
|
|
2787
2787
|
);
|
|
2788
|
-
if (a.type === "table" && (
|
|
2788
|
+
if (a.type === "table" && (c != null && c.records) && (c == null ? void 0 : c.records.length) > 0)
|
|
2789
2789
|
return /* @__PURE__ */ e.jsxs(ve, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
|
|
2790
|
-
/* @__PURE__ */ e.jsx(Gt, { card: a, data:
|
|
2790
|
+
/* @__PURE__ */ e.jsx(Gt, { card: a, data: c == null ? void 0 : c.records }),
|
|
2791
2791
|
/* @__PURE__ */ e.jsx(We, { orientation: "horizontal" })
|
|
2792
2792
|
] });
|
|
2793
2793
|
}
|
|
@@ -2819,17 +2819,17 @@ function $a({
|
|
|
2819
2819
|
a.description
|
|
2820
2820
|
)
|
|
2821
2821
|
] }),
|
|
2822
|
-
|
|
2822
|
+
o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2823
2823
|
/* @__PURE__ */ e.jsx(
|
|
2824
2824
|
es,
|
|
2825
2825
|
{
|
|
2826
2826
|
className: "my-1",
|
|
2827
|
-
text:
|
|
2828
|
-
onSave: (v) => i({ ...
|
|
2829
|
-
children: /* @__PURE__ */ e.jsx(H, { children:
|
|
2827
|
+
text: o.title || o.column,
|
|
2828
|
+
onSave: (v) => i({ ...o, title: v }),
|
|
2829
|
+
children: /* @__PURE__ */ e.jsx(H, { children: o.title })
|
|
2830
2830
|
}
|
|
2831
2831
|
),
|
|
2832
|
-
/* @__PURE__ */ e.jsx(Sa, { filter:
|
|
2832
|
+
/* @__PURE__ */ e.jsx(Sa, { filter: o })
|
|
2833
2833
|
] })
|
|
2834
2834
|
] }),
|
|
2835
2835
|
/* @__PURE__ */ e.jsx(Pt, { className: "flex grow flex-col", children: g() })
|
|
@@ -2941,7 +2941,7 @@ const ra = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
2941
2941
|
/* @__PURE__ */ e.jsx(T, { onClick: l, variant: "outline", children: "Close" })
|
|
2942
2942
|
] });
|
|
2943
2943
|
function Ml() {
|
|
2944
|
-
const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i,
|
|
2944
|
+
const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i, o] = q(""), [c, m] = q(""), x = u((S) => S.card), j = u((S) => S.card.customCfg), { data: b } = Fe(x), { data: d } = Vs(x), { setCardCustomCfg: f, setCustomVisualCode: g } = ne(), N = (S, w) => Ce.transform(S, (D, R, C) => {
|
|
2945
2945
|
if (!Ce.isEqual(R, w[C]))
|
|
2946
2946
|
if (Ce.isArray(R) && Ce.isArray(w[C]))
|
|
2947
2947
|
D[C] = w[C];
|
|
@@ -2977,7 +2977,7 @@ function Ml() {
|
|
|
2977
2977
|
topoJson: d
|
|
2978
2978
|
});
|
|
2979
2979
|
if (S) {
|
|
2980
|
-
t(v(S)),
|
|
2980
|
+
t(v(S)), o(((D = x.preferences) == null ? void 0 : D.customVisualCode) || "");
|
|
2981
2981
|
const R = Ce.merge(S, j);
|
|
2982
2982
|
r(v(R));
|
|
2983
2983
|
}
|
|
@@ -3018,14 +3018,14 @@ function Ml() {
|
|
|
3018
3018
|
customCode: i,
|
|
3019
3019
|
customConfig: l,
|
|
3020
3020
|
onConfigChange: (S) => r(S ?? ""),
|
|
3021
|
-
onCodeChange: (S) =>
|
|
3021
|
+
onCodeChange: (S) => o(S ?? "")
|
|
3022
3022
|
}
|
|
3023
3023
|
)
|
|
3024
3024
|
] }),
|
|
3025
3025
|
/* @__PURE__ */ e.jsx(
|
|
3026
3026
|
Tl,
|
|
3027
3027
|
{
|
|
3028
|
-
error:
|
|
3028
|
+
error: c,
|
|
3029
3029
|
hasCustomConfig: !!j,
|
|
3030
3030
|
onReset: () => {
|
|
3031
3031
|
r(a), f(null);
|
|
@@ -3065,7 +3065,7 @@ function Xa(s) {
|
|
|
3065
3065
|
const [n, a] = q(null);
|
|
3066
3066
|
return se(() => {
|
|
3067
3067
|
s && (async () => {
|
|
3068
|
-
const r = (await import("./lucide-react-
|
|
3068
|
+
const r = (await import("./lucide-react-DGNkJZmc.js"))[s];
|
|
3069
3069
|
a(r);
|
|
3070
3070
|
})();
|
|
3071
3071
|
}, [s]), n;
|
|
@@ -3086,14 +3086,14 @@ function Fl({
|
|
|
3086
3086
|
(async () => {
|
|
3087
3087
|
var r;
|
|
3088
3088
|
if (t) {
|
|
3089
|
-
const
|
|
3090
|
-
(r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (
|
|
3089
|
+
const o = (await Promise.all(
|
|
3090
|
+
(r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (c) => (await Kt(c.value)).visuals.map((j) => ({
|
|
3091
3091
|
name: j.name,
|
|
3092
3092
|
icon: j.icon,
|
|
3093
|
-
url:
|
|
3093
|
+
url: c.value
|
|
3094
3094
|
})))
|
|
3095
3095
|
)).flat();
|
|
3096
|
-
a(
|
|
3096
|
+
a(o);
|
|
3097
3097
|
}
|
|
3098
3098
|
})();
|
|
3099
3099
|
}, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -3119,9 +3119,9 @@ const Ll = ({
|
|
|
3119
3119
|
};
|
|
3120
3120
|
function El() {
|
|
3121
3121
|
var x, j;
|
|
3122
|
-
const [s, n] = q(!1), a = u((b) => b.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((b) => b.actions), { setCardCustomCfg:
|
|
3122
|
+
const [s, n] = q(!1), a = u((b) => b.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((b) => b.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ne();
|
|
3123
3123
|
function m(b, d) {
|
|
3124
|
-
|
|
3124
|
+
o(null), r({}), l(b), d && c({
|
|
3125
3125
|
type: "component",
|
|
3126
3126
|
visualType: "single",
|
|
3127
3127
|
url: d.url,
|
|
@@ -3357,7 +3357,7 @@ function ia() {
|
|
|
3357
3357
|
var C;
|
|
3358
3358
|
const s = u((h) => h.frame), n = u((h) => h.card), a = u((h) => h.isShowingVisual), t = u((h) => h.isSqlRunning), l = u((h) => h.pythonStdOut);
|
|
3359
3359
|
u((h) => h.actions.setRunSql);
|
|
3360
|
-
const { setFrame: r, setCard: i, updateCardInFrame:
|
|
3360
|
+
const { setFrame: r, setCard: i, updateCardInFrame: o, setActiveTabCardId: c } = ne(), { data: m, isLoading: x, isFetching: j, error: b } = Fe(n);
|
|
3361
3361
|
if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3362
3362
|
function d() {
|
|
3363
3363
|
const h = {
|
|
@@ -3385,7 +3385,7 @@ function ia() {
|
|
|
3385
3385
|
cards: [...s.cards, h],
|
|
3386
3386
|
activeCardId: h.id
|
|
3387
3387
|
};
|
|
3388
|
-
r(p),
|
|
3388
|
+
r(p), c(h.id);
|
|
3389
3389
|
}
|
|
3390
3390
|
function g() {
|
|
3391
3391
|
const h = {
|
|
@@ -3403,10 +3403,10 @@ function ia() {
|
|
|
3403
3403
|
// update the active card to the first card in the frame
|
|
3404
3404
|
activeCardId: I.id
|
|
3405
3405
|
};
|
|
3406
|
-
r(O),
|
|
3406
|
+
r(O), c(I.id), i(I);
|
|
3407
3407
|
}
|
|
3408
3408
|
function v(h) {
|
|
3409
|
-
|
|
3409
|
+
c(h);
|
|
3410
3410
|
}
|
|
3411
3411
|
const V = (h, p) => {
|
|
3412
3412
|
console.log("handleDragStart", p), h.dataTransfer.setData("tabIndex", p.toString());
|
|
@@ -3424,7 +3424,7 @@ function ia() {
|
|
|
3424
3424
|
{
|
|
3425
3425
|
onClick: () => {
|
|
3426
3426
|
const I = p.displayTab === void 0 ? !1 : !p.displayTab;
|
|
3427
|
-
i({ ...p, displayTab: I }),
|
|
3427
|
+
i({ ...p, displayTab: I }), o({
|
|
3428
3428
|
...p,
|
|
3429
3429
|
displayTab: I
|
|
3430
3430
|
});
|
|
@@ -3448,7 +3448,7 @@ function ia() {
|
|
|
3448
3448
|
{
|
|
3449
3449
|
text: h.tabTitle || h.title,
|
|
3450
3450
|
onSave: (I) => {
|
|
3451
|
-
i({ ...n, tabTitle: I }),
|
|
3451
|
+
i({ ...n, tabTitle: I }), o({ ...n, tabTitle: I });
|
|
3452
3452
|
},
|
|
3453
3453
|
children: /* @__PURE__ */ e.jsxs(
|
|
3454
3454
|
ss,
|
|
@@ -3651,9 +3651,9 @@ function Hl() {
|
|
|
3651
3651
|
var g, N;
|
|
3652
3652
|
const s = u(
|
|
3653
3653
|
(v) => v.card.customCardPreferences
|
|
3654
|
-
), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((v) => v.card), l = u((v) => v.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components:
|
|
3654
|
+
), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((v) => v.card), l = u((v) => v.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components: o, manifest: c } = Na(
|
|
3655
3655
|
(s == null ? void 0 : s.url) || ""
|
|
3656
|
-
), m = (g =
|
|
3656
|
+
), m = (g = c == null ? void 0 : c.visuals) == null ? void 0 : g.find(
|
|
3657
3657
|
(v) => v.name === (s == null ? void 0 : s.componentName)
|
|
3658
3658
|
);
|
|
3659
3659
|
function x(v, V) {
|
|
@@ -3790,12 +3790,12 @@ function Hl() {
|
|
|
3790
3790
|
),
|
|
3791
3791
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3792
3792
|
/* @__PURE__ */ e.jsx(H, { children: "Component" }),
|
|
3793
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children:
|
|
3793
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: o && /* @__PURE__ */ e.jsx(
|
|
3794
3794
|
xe,
|
|
3795
3795
|
{
|
|
3796
3796
|
className: "h-8 w-full",
|
|
3797
3797
|
label: "",
|
|
3798
|
-
options: (
|
|
3798
|
+
options: (o == null ? void 0 : o.filter(
|
|
3799
3799
|
(v) => v.type === r
|
|
3800
3800
|
).map((v) => ({
|
|
3801
3801
|
value: v.name,
|
|
@@ -3840,7 +3840,7 @@ function Ve() {
|
|
|
3840
3840
|
), se(() => {
|
|
3841
3841
|
i && n(new Array(i.length).fill(!1));
|
|
3842
3842
|
}, [i]);
|
|
3843
|
-
function
|
|
3843
|
+
function o(x, j) {
|
|
3844
3844
|
var b, d;
|
|
3845
3845
|
j ? a != null && a.onClickFilter && ((b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.length) > 0 ? r({
|
|
3846
3846
|
...a,
|
|
@@ -3869,7 +3869,7 @@ function Ve() {
|
|
|
3869
3869
|
return g[x] = !1, g;
|
|
3870
3870
|
}));
|
|
3871
3871
|
}
|
|
3872
|
-
function
|
|
3872
|
+
function c(x, j) {
|
|
3873
3873
|
var d;
|
|
3874
3874
|
const b = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((f) => f.columnIndex === x ? {
|
|
3875
3875
|
...f,
|
|
@@ -3887,7 +3887,7 @@ function Ve() {
|
|
|
3887
3887
|
oe,
|
|
3888
3888
|
{
|
|
3889
3889
|
value: (f = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((g) => g.columnIndex === x)) == null ? void 0 : f.expression,
|
|
3890
|
-
onChange: (g) =>
|
|
3890
|
+
onChange: (g) => c(x, g),
|
|
3891
3891
|
type: "text",
|
|
3892
3892
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3893
3893
|
placeholder: "Expression"
|
|
@@ -3910,7 +3910,7 @@ function Ve() {
|
|
|
3910
3910
|
checked: !!((b = a == null ? void 0 : a.onClickFilter) != null && b.find(
|
|
3911
3911
|
(f) => f.columnIndex === j
|
|
3912
3912
|
)),
|
|
3913
|
-
onCheckedChange: (f) =>
|
|
3913
|
+
onCheckedChange: (f) => o(j, f)
|
|
3914
3914
|
}
|
|
3915
3915
|
),
|
|
3916
3916
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3944,7 +3944,7 @@ function Ve() {
|
|
|
3944
3944
|
] });
|
|
3945
3945
|
}
|
|
3946
3946
|
function fs() {
|
|
3947
|
-
var i,
|
|
3947
|
+
var i, o, c;
|
|
3948
3948
|
const s = u((m) => m.card.preferences), n = u(
|
|
3949
3949
|
(m) => m.card.cfg
|
|
3950
3950
|
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((m) => m.actions);
|
|
@@ -3955,7 +3955,7 @@ function fs() {
|
|
|
3955
3955
|
return /* @__PURE__ */ e.jsxs(
|
|
3956
3956
|
ps,
|
|
3957
3957
|
{
|
|
3958
|
-
value: ((
|
|
3958
|
+
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
|
|
3959
3959
|
onValueChange: r,
|
|
3960
3960
|
className: "flex gap-3",
|
|
3961
3961
|
defaultValue: "x",
|
|
@@ -3988,11 +3988,11 @@ function et() {
|
|
|
3988
3988
|
return (M = E.card) == null ? void 0 : M.cfg;
|
|
3989
3989
|
}), l = Ia(a, t), [r, i] = q(
|
|
3990
3990
|
oa(a)
|
|
3991
|
-
), [
|
|
3991
|
+
), [o, c] = q(
|
|
3992
3992
|
((le = (U = (Y = a == null ? void 0 : a.chartOptions) == null ? void 0 : Y.scales) == null ? void 0 : U[l]) == null ? void 0 : le.min) || ""
|
|
3993
3993
|
), [m, x] = q(
|
|
3994
3994
|
((re = (B = (ce = a == null ? void 0 : a.chartOptions) == null ? void 0 : ce.scales) == null ? void 0 : B[l]) == null ? void 0 : re.max) || ""
|
|
3995
|
-
), [j, b] = q(
|
|
3995
|
+
), [j, b] = q(o || m ? "custom" : "auto"), [d, f] = q(""), [g, N] = q(0), [v, V] = q(""), [F, S] = q(""), [w, D] = q(""), R = u(
|
|
3996
3996
|
(E) => E.actions.setCardPreferences
|
|
3997
3997
|
), { updateCardInFrame: C } = ne(), h = u((E) => E.card), p = u((E) => {
|
|
3998
3998
|
var M;
|
|
@@ -4000,7 +4000,7 @@ function et() {
|
|
|
4000
4000
|
}), I = ["pie", "doughnut", "polarArea"].includes(p);
|
|
4001
4001
|
se(() => {
|
|
4002
4002
|
var E, M, ae, P, J, te, Ne, me, L, G, de, Ae, Oe, z;
|
|
4003
|
-
i(oa(a)),
|
|
4003
|
+
i(oa(a)), c(
|
|
4004
4004
|
((ae = (M = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : M[l]) == null ? void 0 : ae.min) === 0 ? 0 : ""
|
|
4005
4005
|
), x(((te = (J = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : J[l]) == null ? void 0 : te.max) || ""), f(
|
|
4006
4006
|
((G = (L = (me = (Ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ne.scales) == null ? void 0 : me[l]) == null ? void 0 : L.ticks) == null ? void 0 : G.stepSize) || ""
|
|
@@ -4081,8 +4081,8 @@ function et() {
|
|
|
4081
4081
|
oe,
|
|
4082
4082
|
{
|
|
4083
4083
|
id: "min",
|
|
4084
|
-
value:
|
|
4085
|
-
onChange: (E) =>
|
|
4084
|
+
value: o,
|
|
4085
|
+
onChange: (E) => c((M) => O(M, E.target.value)),
|
|
4086
4086
|
className: `col-span-1 h-8 w-full ${Xe}`
|
|
4087
4087
|
}
|
|
4088
4088
|
),
|
|
@@ -4114,7 +4114,7 @@ function et() {
|
|
|
4114
4114
|
var P;
|
|
4115
4115
|
let E = {};
|
|
4116
4116
|
j === "custom" && (E = {
|
|
4117
|
-
min:
|
|
4117
|
+
min: o,
|
|
4118
4118
|
max: m,
|
|
4119
4119
|
ticks: {
|
|
4120
4120
|
stepSize: d
|
|
@@ -4215,24 +4215,24 @@ function et() {
|
|
|
4215
4215
|
] });
|
|
4216
4216
|
}
|
|
4217
4217
|
function Pl({ idx: s }) {
|
|
4218
|
-
var
|
|
4219
|
-
const n = u((
|
|
4218
|
+
var o;
|
|
4219
|
+
const n = u((c) => {
|
|
4220
4220
|
var m;
|
|
4221
|
-
return (m =
|
|
4221
|
+
return (m = c.card) == null ? void 0 : m.preferences;
|
|
4222
4222
|
}), a = u(
|
|
4223
|
-
(
|
|
4223
|
+
(c) => {
|
|
4224
4224
|
var m;
|
|
4225
|
-
return (m =
|
|
4225
|
+
return (m = c.card.preferences) == null ? void 0 : m.datasetOptions;
|
|
4226
4226
|
}
|
|
4227
4227
|
), t = u(
|
|
4228
|
-
(
|
|
4229
|
-
), l = (
|
|
4230
|
-
function i(
|
|
4231
|
-
(
|
|
4228
|
+
(c) => c.actions.setCardPreferences
|
|
4229
|
+
), l = (o = n == null ? void 0 : n.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((c) => c.idx === s);
|
|
4230
|
+
function i(c, m) {
|
|
4231
|
+
(c === "end" || c === "start") && ln(rn());
|
|
4232
4232
|
const x = {
|
|
4233
|
-
display:
|
|
4234
|
-
align:
|
|
4235
|
-
anchor:
|
|
4233
|
+
display: c !== "none",
|
|
4234
|
+
align: c,
|
|
4235
|
+
anchor: c,
|
|
4236
4236
|
clamp: !0
|
|
4237
4237
|
};
|
|
4238
4238
|
if (!r)
|
|
@@ -4334,43 +4334,43 @@ function st() {
|
|
|
4334
4334
|
), { data: a } = Fe(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
|
|
4335
4335
|
keys: r,
|
|
4336
4336
|
metricKeys: i,
|
|
4337
|
-
dimensionKeys:
|
|
4337
|
+
dimensionKeys: o
|
|
4338
4338
|
} = vs((a == null ? void 0 : a.records) || []);
|
|
4339
|
-
let
|
|
4339
|
+
let c = i;
|
|
4340
4340
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4341
4341
|
const m = on({
|
|
4342
4342
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4343
|
-
groupKey:
|
|
4344
|
-
pivotKey:
|
|
4345
|
-
valueKey:
|
|
4343
|
+
groupKey: o[0],
|
|
4344
|
+
pivotKey: o[1],
|
|
4345
|
+
valueKey: c[0]
|
|
4346
4346
|
}), { metricKeys: x } = vs(m);
|
|
4347
|
-
|
|
4347
|
+
c = x;
|
|
4348
4348
|
}
|
|
4349
4349
|
return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4350
4350
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4351
4351
|
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
4352
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children:
|
|
4352
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: o[0] }) }) })
|
|
4353
4353
|
] }),
|
|
4354
4354
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4355
4355
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
4356
4356
|
/* @__PURE__ */ e.jsx(H, { children: l }),
|
|
4357
4357
|
/* @__PURE__ */ e.jsx(et, {})
|
|
4358
4358
|
] }),
|
|
4359
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
4359
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((m, x) => /* @__PURE__ */ e.jsx($l, { col: m, idx: x }, m)) })
|
|
4360
4360
|
] })
|
|
4361
4361
|
] });
|
|
4362
4362
|
}
|
|
4363
4363
|
function $l({ col: s, idx: n }) {
|
|
4364
|
-
const a = u((
|
|
4365
|
-
var
|
|
4366
|
-
return (
|
|
4364
|
+
const a = u((o) => {
|
|
4365
|
+
var c;
|
|
4366
|
+
return (c = o.card) == null ? void 0 : c.preferences;
|
|
4367
4367
|
}), t = u(
|
|
4368
|
-
(
|
|
4369
|
-
var
|
|
4370
|
-
return (
|
|
4368
|
+
(o) => {
|
|
4369
|
+
var c;
|
|
4370
|
+
return (c = o.card.preferences) == null ? void 0 : c.datasetOptions;
|
|
4371
4371
|
}
|
|
4372
|
-
), l = t == null ? void 0 : t.find((
|
|
4373
|
-
function i(
|
|
4372
|
+
), l = t == null ? void 0 : t.find((o) => o.idx === n), { setCardPreferences: r } = u((o) => o.actions);
|
|
4373
|
+
function i(o) {
|
|
4374
4374
|
if (!l)
|
|
4375
4375
|
r({
|
|
4376
4376
|
...a,
|
|
@@ -4378,16 +4378,16 @@ function $l({ col: s, idx: n }) {
|
|
|
4378
4378
|
...t || [],
|
|
4379
4379
|
{
|
|
4380
4380
|
idx: n,
|
|
4381
|
-
type:
|
|
4382
|
-
fill:
|
|
4381
|
+
type: o === "area" ? "line" : o,
|
|
4382
|
+
fill: o === "area" ? "origin" : ""
|
|
4383
4383
|
}
|
|
4384
4384
|
]
|
|
4385
4385
|
});
|
|
4386
4386
|
else {
|
|
4387
|
-
const
|
|
4388
|
-
|
|
4387
|
+
const c = { ...l };
|
|
4388
|
+
c.type = o === "area" ? "line" : o, c.fill = o === "area" ? "origin" : "";
|
|
4389
4389
|
const m = t == null ? void 0 : t.map(
|
|
4390
|
-
(x) => x.idx === n ?
|
|
4390
|
+
(x) => x.idx === n ? c : x
|
|
4391
4391
|
);
|
|
4392
4392
|
r({
|
|
4393
4393
|
...a,
|
|
@@ -4424,7 +4424,7 @@ function $l({ col: s, idx: n }) {
|
|
|
4424
4424
|
] });
|
|
4425
4425
|
}
|
|
4426
4426
|
function at() {
|
|
4427
|
-
const s = u((d) => d.selectedConnectionId), n = u((d) => d.selectedDatamodelId), a = u((d) => d.selectedDatabaseName), t = u((d) => d.selectedSchemaName), l = u((d) => d.selectedTableName), r = k((d) => d.dashboard.filters) || [], i = k((d) => d.actions.addFilter),
|
|
4427
|
+
const s = u((d) => d.selectedConnectionId), n = u((d) => d.selectedDatamodelId), a = u((d) => d.selectedDatabaseName), t = u((d) => d.selectedSchemaName), l = u((d) => d.selectedTableName), r = k((d) => d.dashboard.filters) || [], i = k((d) => d.actions.addFilter), o = k((d) => d.actions.removeFilter), { removeFilterValues: c } = Re(), { modelItems: m, tableName: x, connectionType: j } = Ee();
|
|
4428
4428
|
function b(d, f = "dashboard") {
|
|
4429
4429
|
var R;
|
|
4430
4430
|
const g = he(d.column_name), N = he(a || ""), v = he(t || ""), V = he(x);
|
|
@@ -4441,7 +4441,7 @@ function at() {
|
|
|
4441
4441
|
(C) => C.column === S && C.table === V && (C.database === N || C.database === a)
|
|
4442
4442
|
);
|
|
4443
4443
|
if (D)
|
|
4444
|
-
|
|
4444
|
+
c(D.id), o(D.id);
|
|
4445
4445
|
else {
|
|
4446
4446
|
const C = Ue();
|
|
4447
4447
|
return x === "api" && s ? (i({
|
|
@@ -4487,13 +4487,13 @@ function at() {
|
|
|
4487
4487
|
}
|
|
4488
4488
|
function _e() {
|
|
4489
4489
|
const s = k(
|
|
4490
|
-
(
|
|
4491
|
-
), n = u((
|
|
4492
|
-
function r(
|
|
4493
|
-
const
|
|
4494
|
-
a({ ...n, filterId:
|
|
4490
|
+
(o) => o.dashboard.filters
|
|
4491
|
+
), n = u((o) => o.frame), { setFrame: a } = ne(), { columns: t } = Ee(), { assignFilter: l } = at();
|
|
4492
|
+
function r(o) {
|
|
4493
|
+
const c = l(o, "frame");
|
|
4494
|
+
a({ ...n, filterId: c });
|
|
4495
4495
|
}
|
|
4496
|
-
const i = s == null ? void 0 : s.find((
|
|
4496
|
+
const i = s == null ? void 0 : s.find((o) => o.id === n.filterId);
|
|
4497
4497
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4498
4498
|
/* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
|
|
4499
4499
|
/* @__PURE__ */ e.jsx(Bl, { onSelect: r, columns: t }),
|
|
@@ -4516,7 +4516,7 @@ function Bl({
|
|
|
4516
4516
|
"aria-expanded": a,
|
|
4517
4517
|
className: "w-full justify-between font-normal",
|
|
4518
4518
|
children: [
|
|
4519
|
-
l ? (i = s.find((
|
|
4519
|
+
l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
|
|
4520
4520
|
/* @__PURE__ */ e.jsx(dn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4521
4521
|
]
|
|
4522
4522
|
}
|
|
@@ -4525,28 +4525,28 @@ function Bl({
|
|
|
4525
4525
|
/* @__PURE__ */ e.jsx(mn, { placeholder: "Search column", className: "h-9" }),
|
|
4526
4526
|
/* @__PURE__ */ e.jsxs(hn, { children: [
|
|
4527
4527
|
/* @__PURE__ */ e.jsx(xn, { children: "No framework found." }),
|
|
4528
|
-
/* @__PURE__ */ e.jsx(pn, { children: s.map((
|
|
4528
|
+
/* @__PURE__ */ e.jsx(pn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
4529
4529
|
fn,
|
|
4530
4530
|
{
|
|
4531
|
-
value:
|
|
4532
|
-
onSelect: (
|
|
4533
|
-
const m =
|
|
4534
|
-
r(m), t(!1), m && n(
|
|
4531
|
+
value: o.column_name,
|
|
4532
|
+
onSelect: (c) => {
|
|
4533
|
+
const m = c === l ? "" : c;
|
|
4534
|
+
r(m), t(!1), m && n(o);
|
|
4535
4535
|
},
|
|
4536
4536
|
children: [
|
|
4537
|
-
|
|
4537
|
+
o.column_name,
|
|
4538
4538
|
/* @__PURE__ */ e.jsx(
|
|
4539
4539
|
gn,
|
|
4540
4540
|
{
|
|
4541
4541
|
className: Z(
|
|
4542
4542
|
"ml-auto h-4 w-4",
|
|
4543
|
-
l ===
|
|
4543
|
+
l === o.column_name ? "opacity-100" : "opacity-0"
|
|
4544
4544
|
)
|
|
4545
4545
|
}
|
|
4546
4546
|
)
|
|
4547
4547
|
]
|
|
4548
4548
|
},
|
|
4549
|
-
|
|
4549
|
+
o.column_name
|
|
4550
4550
|
)) })
|
|
4551
4551
|
] })
|
|
4552
4552
|
] }) })
|
|
@@ -4600,15 +4600,15 @@ function Gl({
|
|
|
4600
4600
|
function Bs() {
|
|
4601
4601
|
var l, r, i;
|
|
4602
4602
|
const s = u(
|
|
4603
|
-
(
|
|
4604
|
-
), n = u((
|
|
4605
|
-
function t(
|
|
4603
|
+
(o) => o.card.cfg
|
|
4604
|
+
), n = u((o) => o.actions.setCardCfg), a = u((o) => o.card.type);
|
|
4605
|
+
function t(o) {
|
|
4606
4606
|
var x;
|
|
4607
|
-
const
|
|
4607
|
+
const c = {
|
|
4608
4608
|
datalabels: {
|
|
4609
|
-
display:
|
|
4610
|
-
align:
|
|
4611
|
-
anchor:
|
|
4609
|
+
display: o !== "none",
|
|
4610
|
+
align: o,
|
|
4611
|
+
anchor: o,
|
|
4612
4612
|
clamp: !0
|
|
4613
4613
|
}
|
|
4614
4614
|
}, m = {
|
|
@@ -4617,11 +4617,11 @@ function Bs() {
|
|
|
4617
4617
|
...s == null ? void 0 : s.options,
|
|
4618
4618
|
plugins: {
|
|
4619
4619
|
...(x = s == null ? void 0 : s.options) == null ? void 0 : x.plugins,
|
|
4620
|
-
...
|
|
4620
|
+
...c
|
|
4621
4621
|
}
|
|
4622
4622
|
}
|
|
4623
4623
|
};
|
|
4624
|
-
n(m), console.log(
|
|
4624
|
+
n(m), console.log(o);
|
|
4625
4625
|
}
|
|
4626
4626
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4627
4627
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4836,7 +4836,7 @@ function Ql(s) {
|
|
|
4836
4836
|
] }) });
|
|
4837
4837
|
}
|
|
4838
4838
|
function Zl() {
|
|
4839
|
-
var
|
|
4839
|
+
var c, m, x, j, b;
|
|
4840
4840
|
const s = u((d) => d.card.preferences), n = u(
|
|
4841
4841
|
(d) => d.actions.setCardPreferences
|
|
4842
4842
|
), a = u(
|
|
@@ -4869,13 +4869,13 @@ function Zl() {
|
|
|
4869
4869
|
}
|
|
4870
4870
|
) || [], i = u(
|
|
4871
4871
|
(d) => d.actions.setColorRanges
|
|
4872
|
-
),
|
|
4872
|
+
), o = [...new Set(rs.map((d) => d.currency))];
|
|
4873
4873
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4874
4874
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4875
4875
|
/* @__PURE__ */ e.jsx(
|
|
4876
4876
|
As,
|
|
4877
4877
|
{
|
|
4878
|
-
checked: !!((
|
|
4878
|
+
checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
|
|
4879
4879
|
onCheckedChange: (d) => {
|
|
4880
4880
|
n({
|
|
4881
4881
|
...s,
|
|
@@ -4938,7 +4938,7 @@ function Zl() {
|
|
|
4938
4938
|
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(we, { children: [
|
|
4939
4939
|
/* @__PURE__ */ e.jsx(be, { children: "Currency" }),
|
|
4940
4940
|
/* @__PURE__ */ e.jsx(ee, { value: "none", children: "None" }, "none"),
|
|
4941
|
-
|
|
4941
|
+
o.map((d) => /* @__PURE__ */ e.jsx(ee, { value: d, children: d }, d))
|
|
4942
4942
|
] }) })
|
|
4943
4943
|
]
|
|
4944
4944
|
}
|
|
@@ -5133,13 +5133,13 @@ const Yl = [
|
|
|
5133
5133
|
value: s
|
|
5134
5134
|
}));
|
|
5135
5135
|
function ar() {
|
|
5136
|
-
var
|
|
5137
|
-
const s = u((p) => p.card), n = (m = (
|
|
5136
|
+
var c, m, x, j, b, d, f, g, N, v, V, F, S, w, D, R, C, h;
|
|
5137
|
+
const s = u((p) => p.card), n = (m = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : m.topoJsonUrl, [a, t] = q(
|
|
5138
5138
|
((j = (x = s == null ? void 0 : s.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : j.customTopoJsonUrl) || ""
|
|
5139
5139
|
), { setCardPreferences: l } = ne(), { data: r } = Vs(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((p) => ({
|
|
5140
5140
|
label: p,
|
|
5141
5141
|
value: p
|
|
5142
|
-
})) || [],
|
|
5142
|
+
})) || [], o = [
|
|
5143
5143
|
{
|
|
5144
5144
|
label: "US States 10m",
|
|
5145
5145
|
value: "https://unpkg.com/us-atlas/states-10m.json"
|
|
@@ -5161,7 +5161,7 @@ function ar() {
|
|
|
5161
5161
|
xe,
|
|
5162
5162
|
{
|
|
5163
5163
|
className: "h-9",
|
|
5164
|
-
options:
|
|
5164
|
+
options: o,
|
|
5165
5165
|
onValueChange: (p) => {
|
|
5166
5166
|
console.log("value", p), l({
|
|
5167
5167
|
...s.preferences,
|
|
@@ -5717,7 +5717,7 @@ function hr() {
|
|
|
5717
5717
|
const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = k((r) => r.dashboard.filters) || [], { columns: t } = Ee(), { assignFilter: l } = at();
|
|
5718
5718
|
return /* @__PURE__ */ e.jsx(ve, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
|
|
5719
5719
|
const i = a == null ? void 0 : a.find(
|
|
5720
|
-
(
|
|
5720
|
+
(o) => o.column === he(r.column_name) && o.table === n && o.database === s
|
|
5721
5721
|
);
|
|
5722
5722
|
return /* @__PURE__ */ e.jsx(
|
|
5723
5723
|
"div",
|