react-semaphor 0.0.240 → 0.0.242
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/{dashboard-plus-GPlhkQkC.js → dashboard-plus-0MaxXa-T.js} +622 -617
- package/dist/chunks/dashboard-plus-8LCpWuiF.js +215 -0
- package/dist/chunks/{index-PY-6Ljll.js → index-OBmpOLUc.js} +32 -32
- package/dist/chunks/{index-xW8lpCWr.js → index-v8Xeg1na.js} +595 -569
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-XvX2Tcuc.js +0 -215
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as D, b as
|
|
1
|
+
import { O as D, b as k, j as e, P as gs, Q as js, R as z, U as bs, V as ys, W as vs, X as Ns, Y as Cs, Z as H, _ as de, $ as Zs, J as Xs, M as Oe, a0 as Va, a1 as _a, a2 as Ra, a3 as Ha, a4 as Ba, a5 as $a, a6 as _s, a7 as Ve, a8 as $e, a9 as ea, aa as Xe, T as Ss, e as sa, g as ks, ab as ke, ac as we, f as Z, ad as ze, ae as Fe, af as _e, ag as Me, ah as ae, ai as ws, G as c, aj as zs, ak as Fs, al as Os, w as aa, v as ta, t as me, am as Pa, r as Ka, N as na, s as Ga, an as Ja, B as Ua, ao as la, ap as Qa, S as Ms, z as Wa, n as Rs, aq as ms, A as ra, ar as us, u as Pe, as as he, at as ge, au as Re, av as ia, aw as oa, ax as Ya, ay as Za, az as ca, aA as Xa, aB as et, aC as st, aD as at, aE as tt, aF as xs, aG as nt, aH as lt, aI as qe, aJ as ps, aK as Se, aL as fs, aM as Hs, aN as rt, aO as it, aP as ot, aQ as ct, aR as dt, aS as hs, aT as ht, aU as Bs, aV as mt, aW as $s, aX as ut, aY as xt, aZ as pt, c as ft, a_ as da, l as gt, C as jt, E as We, d as bt, h as yt, a$ as vt, i as Nt, o as Ct, b0 as St, m as kt, H as as, b1 as wt, b2 as ha, b3 as ma, b4 as Ye, b5 as ua, b6 as Ze, b7 as Ps, b8 as ts, b9 as ns, ba as ls, bb as xa, K as zt, bc as Ft, bd as Ot, be as Ts, bf as Te, bg as pa, bh as Mt, bi as Tt, bj as At, bk as Dt, bl as Lt, bm as Ks, bn as It, bo as Et, bp as qt, bq as Vt, br as _t, bs as Rt, bt as Ht, bu as Bt, bv as ve, bw as P, bx as K, by as As, bz as G, bA as Gs, bB as $t, bC as Pt, bD as Kt, bE as Gt, bF as Jt, bG as Ut, bH as Qt, bI as Wt, bJ as Yt, bK as Zt } from "./index-v8Xeg1na.js";
|
|
2
2
|
import * as Js from "react";
|
|
3
|
-
import
|
|
3
|
+
import ue, { useState as T, useEffect as Q, useMemo as Xt, useRef as He } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-react v0.379.0 - ISC
|
|
6
6
|
*
|
|
@@ -402,9 +402,9 @@ const Sn = D("User", [
|
|
|
402
402
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
403
403
|
]);
|
|
404
404
|
function kn() {
|
|
405
|
-
const [s, n] = T(""), [a, t] = T(!1), [r, h] = T(!1), o =
|
|
405
|
+
const [s, n] = T(""), [a, t] = T(!1), [r, h] = T(!1), o = k((d) => d.dashboard);
|
|
406
406
|
function i() {
|
|
407
|
-
const d = Xs(o), m =
|
|
407
|
+
const d = Xs(o), m = Oe(o.id), x = JSON.parse(localStorage.getItem(m) || "[]");
|
|
408
408
|
if (x.some(
|
|
409
409
|
(g) => g.name === s
|
|
410
410
|
)) {
|
|
@@ -416,28 +416,28 @@ function kn() {
|
|
|
416
416
|
template: d
|
|
417
417
|
}), localStorage.setItem(m, JSON.stringify(x)), h(!1);
|
|
418
418
|
}
|
|
419
|
-
return /* @__PURE__ */ e.jsxs(
|
|
420
|
-
/* @__PURE__ */ e.jsx(
|
|
419
|
+
return /* @__PURE__ */ e.jsxs(gs, { open: r, onOpenChange: h, children: [
|
|
420
|
+
/* @__PURE__ */ e.jsx(js, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
421
421
|
z,
|
|
422
422
|
{
|
|
423
423
|
variant: "outline",
|
|
424
424
|
className: "h-7 p-2",
|
|
425
425
|
size: "sm",
|
|
426
426
|
children: [
|
|
427
|
-
/* @__PURE__ */ e.jsx(
|
|
427
|
+
/* @__PURE__ */ e.jsx(bs, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
428
428
|
"Add Lens"
|
|
429
429
|
]
|
|
430
430
|
}
|
|
431
431
|
) }),
|
|
432
|
-
/* @__PURE__ */ e.jsxs(
|
|
433
|
-
/* @__PURE__ */ e.jsxs(
|
|
434
|
-
/* @__PURE__ */ e.jsx(
|
|
435
|
-
/* @__PURE__ */ e.jsx(
|
|
432
|
+
/* @__PURE__ */ e.jsxs(ys, { className: "sm:max-w-[425px]", children: [
|
|
433
|
+
/* @__PURE__ */ e.jsxs(vs, { children: [
|
|
434
|
+
/* @__PURE__ */ e.jsx(Ns, { children: "Add a Lens" }),
|
|
435
|
+
/* @__PURE__ */ e.jsx(Cs, { children: "Lenses are private by default and are only visible to you." })
|
|
436
436
|
] }),
|
|
437
437
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
438
|
-
/* @__PURE__ */ e.jsx(
|
|
438
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
|
|
439
439
|
/* @__PURE__ */ e.jsx(
|
|
440
|
-
|
|
440
|
+
de,
|
|
441
441
|
{
|
|
442
442
|
value: s,
|
|
443
443
|
onChange: (d) => {
|
|
@@ -463,13 +463,13 @@ function kn() {
|
|
|
463
463
|
] });
|
|
464
464
|
}
|
|
465
465
|
function wn() {
|
|
466
|
-
const [s, n] = T(!1), [a, t] = T(""), r =
|
|
466
|
+
const [s, n] = T(!1), [a, t] = T(""), r = k((l) => l.dashboard), h = k((l) => l.bookmarkKey), [o, i] = T([]), d = k((l) => l.actions.setDashboard), m = k(
|
|
467
467
|
(l) => l.actions.setFilterValues
|
|
468
|
-
), x =
|
|
468
|
+
), x = k(
|
|
469
469
|
(l) => l.actions.setBookmarkKey
|
|
470
470
|
);
|
|
471
471
|
Q(() => {
|
|
472
|
-
const l =
|
|
472
|
+
const l = Oe(r.id), u = JSON.parse(localStorage.getItem(l) || "[]");
|
|
473
473
|
i(u);
|
|
474
474
|
const b = u.find(
|
|
475
475
|
(f) => f.default
|
|
@@ -483,7 +483,7 @@ function wn() {
|
|
|
483
483
|
b && (d(b), m(u.filterValues || []), x(l === "Original" ? "" : l)), t(l);
|
|
484
484
|
}
|
|
485
485
|
function g(l) {
|
|
486
|
-
const u =
|
|
486
|
+
const u = Oe(r.id), f = JSON.parse(localStorage.getItem(u) || "[]").filter(
|
|
487
487
|
(N) => N.name !== l
|
|
488
488
|
);
|
|
489
489
|
localStorage.setItem(u, JSON.stringify(f)), i(f);
|
|
@@ -529,13 +529,13 @@ function wn() {
|
|
|
529
529
|
] });
|
|
530
530
|
}
|
|
531
531
|
function zn() {
|
|
532
|
-
const [s, n] = T(!1), a =
|
|
532
|
+
const [s, n] = T(!1), a = k((h) => h.dashboard), t = k((h) => h.bookmarkKey);
|
|
533
533
|
Q(() => {
|
|
534
534
|
if (!t) {
|
|
535
535
|
n(!1);
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
|
-
const h =
|
|
538
|
+
const h = Oe(a.id), i = JSON.parse(
|
|
539
539
|
localStorage.getItem(h) || "[]"
|
|
540
540
|
).find(
|
|
541
541
|
(d) => d.name === t
|
|
@@ -545,7 +545,7 @@ function zn() {
|
|
|
545
545
|
function r(h) {
|
|
546
546
|
if (n(h), !t)
|
|
547
547
|
return;
|
|
548
|
-
const o =
|
|
548
|
+
const o = Oe(a.id), d = JSON.parse(
|
|
549
549
|
localStorage.getItem(o) || "[]"
|
|
550
550
|
).map((m) => (m.name === t ? m.default = h : m.default = !1, m));
|
|
551
551
|
console.log(d), localStorage.setItem(o, JSON.stringify(d));
|
|
@@ -570,19 +570,19 @@ function zn() {
|
|
|
570
570
|
] });
|
|
571
571
|
}
|
|
572
572
|
function Fn() {
|
|
573
|
-
const s =
|
|
574
|
-
|
|
575
|
-
const a =
|
|
573
|
+
const s = k((N) => N.bookmarkKey), n = k((N) => N.dashboard);
|
|
574
|
+
k((N) => N.selectedSheetId);
|
|
575
|
+
const a = k(
|
|
576
576
|
(N) => N.isDashboardEditing
|
|
577
|
-
), t =
|
|
578
|
-
|
|
577
|
+
), t = k((N) => N.filterValues), r = k((N) => N.isVisualEditing), h = k((N) => N.showFilters);
|
|
578
|
+
k(
|
|
579
579
|
(N) => N.showDashboardJSON
|
|
580
580
|
);
|
|
581
|
-
const o =
|
|
581
|
+
const o = k((N) => N.onSaveFunction), i = k(
|
|
582
582
|
(N) => N.actions.setShowFilters
|
|
583
|
-
), { addFrame: d, setSelectedFrameId: m } =
|
|
583
|
+
), { addFrame: d, setSelectedFrameId: m } = k(
|
|
584
584
|
(N) => N.actions
|
|
585
|
-
), { getSelectedSheet: x, setIsDashboardEditing: y, setShowDashboardJSON: g } =
|
|
585
|
+
), { getSelectedSheet: x, setIsDashboardEditing: y, setShowDashboardJSON: g } = k((N) => N.actions), l = x(), u = () => {
|
|
586
586
|
if (!a || !l)
|
|
587
587
|
return;
|
|
588
588
|
const N = {
|
|
@@ -600,31 +600,31 @@ function Fn() {
|
|
|
600
600
|
type: "bar",
|
|
601
601
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
602
602
|
data: []
|
|
603
|
-
},
|
|
603
|
+
}, O = {
|
|
604
604
|
id: Xe(),
|
|
605
605
|
cards: [N],
|
|
606
606
|
activeCardId: N.id
|
|
607
607
|
};
|
|
608
|
-
d(l.id,
|
|
608
|
+
d(l.id, O), m(O.id);
|
|
609
609
|
}, b = () => {
|
|
610
610
|
y(!0);
|
|
611
611
|
};
|
|
612
612
|
function f() {
|
|
613
613
|
if (!s || s === "")
|
|
614
614
|
return;
|
|
615
|
-
const N = Xs(n),
|
|
616
|
-
(
|
|
615
|
+
const N = Xs(n), O = Oe(n.id), v = JSON.parse(localStorage.getItem(O) || "[]"), q = v.findIndex(
|
|
616
|
+
(V) => V.name === s
|
|
617
617
|
);
|
|
618
|
-
|
|
618
|
+
q !== -1 ? v[q] = {
|
|
619
619
|
name: s,
|
|
620
620
|
template: N,
|
|
621
|
-
default: v[
|
|
621
|
+
default: v[q].default,
|
|
622
622
|
filterValues: t
|
|
623
623
|
} : v.push({
|
|
624
624
|
name: s,
|
|
625
625
|
template: N,
|
|
626
626
|
filterValues: t
|
|
627
|
-
}), localStorage.setItem(
|
|
627
|
+
}), localStorage.setItem(O, JSON.stringify(v)), o == null || o(N);
|
|
628
628
|
}
|
|
629
629
|
return r ? null : /* @__PURE__ */ e.jsxs(
|
|
630
630
|
"div",
|
|
@@ -633,7 +633,7 @@ function Fn() {
|
|
|
633
633
|
role: "dashboard-controls",
|
|
634
634
|
children: [
|
|
635
635
|
!r && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
636
|
-
/* @__PURE__ */ e.jsx(
|
|
636
|
+
/* @__PURE__ */ e.jsx(H, { children: s }),
|
|
637
637
|
!!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
638
638
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
|
|
639
639
|
/* @__PURE__ */ e.jsx(zn, {})
|
|
@@ -651,7 +651,7 @@ function Fn() {
|
|
|
651
651
|
disabled: !a,
|
|
652
652
|
onClick: u,
|
|
653
653
|
children: [
|
|
654
|
-
/* @__PURE__ */ e.jsx(
|
|
654
|
+
/* @__PURE__ */ e.jsx(bs, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
655
655
|
"Add Frame"
|
|
656
656
|
]
|
|
657
657
|
}
|
|
@@ -728,38 +728,38 @@ function Ee({
|
|
|
728
728
|
if (s === "Schema")
|
|
729
729
|
return /* @__PURE__ */ e.jsx(pn, { className: "size-4" });
|
|
730
730
|
if (s === "Table")
|
|
731
|
-
return /* @__PURE__ */ e.jsx(
|
|
731
|
+
return /* @__PURE__ */ e.jsx(ws, { className: "size-4" });
|
|
732
732
|
if (s === "Model")
|
|
733
733
|
return /* @__PURE__ */ e.jsx(sn, { className: "size-4" });
|
|
734
734
|
}
|
|
735
735
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
736
|
-
m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: h ? /* @__PURE__ */ e.jsxs(
|
|
736
|
+
m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: h ? /* @__PURE__ */ e.jsxs(Ss, { children: [
|
|
737
737
|
/* @__PURE__ */ e.jsx(sa, { children: g() }),
|
|
738
|
-
/* @__PURE__ */ e.jsx(
|
|
738
|
+
/* @__PURE__ */ e.jsx(ks, { className: "text-xs", align: "start", children: h })
|
|
739
739
|
] }) : g() }),
|
|
740
|
-
/* @__PURE__ */ e.jsxs(
|
|
740
|
+
/* @__PURE__ */ e.jsxs(ke, { disabled: x, value: y, onValueChange: o, children: [
|
|
741
741
|
/* @__PURE__ */ e.jsx(
|
|
742
|
-
|
|
742
|
+
we,
|
|
743
743
|
{
|
|
744
744
|
className: Z(
|
|
745
745
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
746
746
|
d
|
|
747
747
|
),
|
|
748
748
|
children: /* @__PURE__ */ e.jsx(
|
|
749
|
-
|
|
749
|
+
ze,
|
|
750
750
|
{
|
|
751
751
|
placeholder: t ? "Loading..." : r ? "Error" : `Select ${s}`
|
|
752
752
|
}
|
|
753
753
|
)
|
|
754
754
|
}
|
|
755
755
|
),
|
|
756
|
-
/* @__PURE__ */ e.jsx(
|
|
757
|
-
t ? /* @__PURE__ */ e.jsx(
|
|
756
|
+
/* @__PURE__ */ e.jsx(Fe, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
|
|
757
|
+
t ? /* @__PURE__ */ e.jsx(Me, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Me, { children: s }),
|
|
758
758
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
759
|
-
i && /* @__PURE__ */ e.jsx(
|
|
760
|
-
n && n.map((l, u) => /* @__PURE__ */ e.jsx(
|
|
759
|
+
i && /* @__PURE__ */ e.jsx(ae, { value: "none", children: "None" }, "none"),
|
|
760
|
+
n && n.map((l, u) => /* @__PURE__ */ e.jsx(ae, { value: l.id, children: l.name }, u))
|
|
761
761
|
] }),
|
|
762
|
-
(t || r) && /* @__PURE__ */ e.jsx(
|
|
762
|
+
(t || r) && /* @__PURE__ */ e.jsx(ae, { value: y, children: y })
|
|
763
763
|
] }) })
|
|
764
764
|
] })
|
|
765
765
|
] });
|
|
@@ -769,17 +769,17 @@ function On({ column: s }) {
|
|
|
769
769
|
(l) => l.selectedSchemaName
|
|
770
770
|
), h = c(
|
|
771
771
|
(l) => l.selectedDatamodelId
|
|
772
|
-
), o = c((l) => l.sqlGen), { modelItems: i } =
|
|
772
|
+
), o = c((l) => l.sqlGen), { modelItems: i } = Ae(), d = c((l) => l.actions.setSqlGen), m = c((l) => l.actions.setCardSql), x = c((l) => l.actions.setRunSql);
|
|
773
773
|
function y(l, u) {
|
|
774
|
-
var
|
|
775
|
-
const b = aa(l, o, u), f = (
|
|
774
|
+
var O;
|
|
775
|
+
const b = aa(l, o, u), f = (O = i == null ? void 0 : i.find(
|
|
776
776
|
(v) => v.id === h
|
|
777
|
-
)) == null ? void 0 :
|
|
777
|
+
)) == null ? void 0 : O.name;
|
|
778
778
|
d(b);
|
|
779
779
|
const N = ta(
|
|
780
780
|
b,
|
|
781
|
-
|
|
782
|
-
|
|
781
|
+
me(r || ""),
|
|
782
|
+
me(t),
|
|
783
783
|
f
|
|
784
784
|
);
|
|
785
785
|
N && (m(N), x(!0)), a(!1);
|
|
@@ -828,10 +828,10 @@ function On({ column: s }) {
|
|
|
828
828
|
)
|
|
829
829
|
] });
|
|
830
830
|
}
|
|
831
|
-
return /* @__PURE__ */ e.jsxs(
|
|
832
|
-
/* @__PURE__ */ e.jsx(
|
|
831
|
+
return /* @__PURE__ */ e.jsxs(zs, { openDelay: 0, open: n, onOpenChange: a, children: [
|
|
832
|
+
/* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(nn, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
833
833
|
/* @__PURE__ */ e.jsx(
|
|
834
|
-
|
|
834
|
+
Os,
|
|
835
835
|
{
|
|
836
836
|
align: "center",
|
|
837
837
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
@@ -841,7 +841,7 @@ function On({ column: s }) {
|
|
|
841
841
|
] });
|
|
842
842
|
}
|
|
843
843
|
function ya({ column: s }) {
|
|
844
|
-
return /* @__PURE__ */ e.jsxs(
|
|
844
|
+
return /* @__PURE__ */ e.jsxs(Ss, { children: [
|
|
845
845
|
/* @__PURE__ */ e.jsx(Pa, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
|
|
846
846
|
// <span className=" font-thin">T</span>
|
|
847
847
|
/* @__PURE__ */ e.jsx(Is, { className: "size-3" })
|
|
@@ -849,7 +849,7 @@ function ya({ column: s }) {
|
|
|
849
849
|
//
|
|
850
850
|
/* @__PURE__ */ e.jsx(cn, { className: "size-3" })
|
|
851
851
|
) : Ga.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Cn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(bn, { className: "size-3" }) }),
|
|
852
|
-
/* @__PURE__ */ e.jsx(
|
|
852
|
+
/* @__PURE__ */ e.jsx(ks, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
853
853
|
] });
|
|
854
854
|
}
|
|
855
855
|
function Mn({
|
|
@@ -858,35 +858,35 @@ function Mn({
|
|
|
858
858
|
columns: a,
|
|
859
859
|
status: t
|
|
860
860
|
}) {
|
|
861
|
-
const r = c((
|
|
862
|
-
(
|
|
861
|
+
const r = c((C) => C.sqlGen), h = c(
|
|
862
|
+
(C) => C.selectedConnectionId
|
|
863
863
|
), o = c(
|
|
864
|
-
(
|
|
864
|
+
(C) => C.selectedDatabaseName
|
|
865
865
|
), i = c(
|
|
866
|
-
(
|
|
867
|
-
), d = c((
|
|
868
|
-
(
|
|
869
|
-
), x =
|
|
870
|
-
(
|
|
871
|
-
), { setAIScopeTables: y } =
|
|
872
|
-
(
|
|
873
|
-
), b = c((
|
|
874
|
-
function
|
|
866
|
+
(C) => C.selectedSchemaName
|
|
867
|
+
), d = c((C) => C.selectedTableName), m = c(
|
|
868
|
+
(C) => C.selectedDatamodelId
|
|
869
|
+
), x = k(
|
|
870
|
+
(C) => C.dashboard.aiScopeTables
|
|
871
|
+
), { setAIScopeTables: y } = k((C) => C.actions), g = c((C) => C.actions.setRunSql), l = c((C) => C.actions.setSqlGen), u = c(
|
|
872
|
+
(C) => C.actions.setIsShowingVisual
|
|
873
|
+
), b = c((C) => C.actions.setCardSql), { connectionType: f, modelItems: N } = Ae();
|
|
874
|
+
function O(C) {
|
|
875
875
|
var L;
|
|
876
|
-
const F = aa(
|
|
876
|
+
const F = aa(C, r);
|
|
877
877
|
l(F);
|
|
878
|
-
const
|
|
879
|
-
(
|
|
880
|
-
)) == null ? void 0 : L.name, B = ta(F,
|
|
878
|
+
const R = (L = N == null ? void 0 : N.find(
|
|
879
|
+
($) => $.id === m
|
|
880
|
+
)) == null ? void 0 : L.name, B = ta(F, me(s), me(n), R);
|
|
881
881
|
B && (b(B), g(!0));
|
|
882
882
|
}
|
|
883
883
|
function v() {
|
|
884
884
|
return (x == null ? void 0 : x.find(
|
|
885
|
-
(
|
|
885
|
+
(C) => C.connectinonId === h && C.tableName === d
|
|
886
886
|
)) !== void 0;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
if (
|
|
888
|
+
function q(C) {
|
|
889
|
+
if (C === !0 && d && h) {
|
|
890
890
|
const F = {
|
|
891
891
|
connectinonId: h,
|
|
892
892
|
connectionType: f,
|
|
@@ -894,45 +894,45 @@ function Mn({
|
|
|
894
894
|
schemaName: i,
|
|
895
895
|
tableName: d
|
|
896
896
|
}, B = [...x || [], F].filter(
|
|
897
|
-
(L,
|
|
897
|
+
(L, $, X) => X.findIndex(
|
|
898
898
|
(U) => U.connectinonId === L.connectinonId && U.tableName === L.tableName
|
|
899
|
-
) ===
|
|
899
|
+
) === $
|
|
900
900
|
);
|
|
901
|
-
y(B),
|
|
901
|
+
y(B), ms.success(`Added '${d}' to AI Scope`, {
|
|
902
902
|
position: "top-right",
|
|
903
903
|
duration: 2500,
|
|
904
904
|
richColors: !0
|
|
905
905
|
});
|
|
906
906
|
} else {
|
|
907
907
|
const F = (x || []).filter(
|
|
908
|
-
(
|
|
908
|
+
(R) => R.connectinonId !== h && R.tableName !== d
|
|
909
909
|
);
|
|
910
|
-
y(F),
|
|
910
|
+
y(F), ms(`Removed '${d}' from AI Scope`, {
|
|
911
911
|
position: "top-right",
|
|
912
912
|
duration: 2e3,
|
|
913
913
|
richColors: !0
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function V() {
|
|
918
918
|
var L;
|
|
919
|
-
let
|
|
919
|
+
let C = ra(s, n);
|
|
920
920
|
const F = (L = N == null ? void 0 : N.find(
|
|
921
|
-
(
|
|
921
|
+
($) => $.id === m
|
|
922
922
|
)) == null ? void 0 : L.name;
|
|
923
|
-
console.log("modelName", F), m && m !== "none" && (
|
|
924
|
-
let
|
|
925
|
-
return ((
|
|
923
|
+
console.log("modelName", F), m && m !== "none" && (C = `${us}.${F}`);
|
|
924
|
+
let R = C;
|
|
925
|
+
return (($) => /[A-Z]/.test($))(n) && (R = R.split(".").map((X) => `"${X}"`).join(".")), R;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
const
|
|
927
|
+
function _() {
|
|
928
|
+
const C = V();
|
|
929
929
|
u(!1);
|
|
930
|
-
const F = f === "MSSQL" ? `SELECT top 10 * FROM ${
|
|
930
|
+
const F = f === "MSSQL" ? `SELECT top 10 * FROM ${C}` : `SELECT * FROM ${C} LIMIT 10`;
|
|
931
931
|
b(F), g(!0);
|
|
932
932
|
}
|
|
933
933
|
function A() {
|
|
934
|
-
const
|
|
935
|
-
b(`SELECT COUNT(*) as count FROM ${
|
|
934
|
+
const C = V();
|
|
935
|
+
b(`SELECT COUNT(*) as count FROM ${C}`), g(!0);
|
|
936
936
|
}
|
|
937
937
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
938
938
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
@@ -941,7 +941,7 @@ function Mn({
|
|
|
941
941
|
{
|
|
942
942
|
title: `${v() ? "Remove from" : "Add to"} AI Scope`,
|
|
943
943
|
pressed: v(),
|
|
944
|
-
onPressedChange:
|
|
944
|
+
onPressedChange: q,
|
|
945
945
|
variant: "outline",
|
|
946
946
|
className: "h-9 px-2",
|
|
947
947
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -959,7 +959,7 @@ function Mn({
|
|
|
959
959
|
z,
|
|
960
960
|
{
|
|
961
961
|
disabled: t !== "Success",
|
|
962
|
-
onClick:
|
|
962
|
+
onClick: _,
|
|
963
963
|
size: "sm",
|
|
964
964
|
variant: "secondary",
|
|
965
965
|
className: "flex",
|
|
@@ -985,36 +985,36 @@ function Mn({
|
|
|
985
985
|
)
|
|
986
986
|
] }),
|
|
987
987
|
/* @__PURE__ */ e.jsxs(
|
|
988
|
-
|
|
988
|
+
Ms,
|
|
989
989
|
{
|
|
990
990
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
991
991
|
children: [
|
|
992
|
-
a == null ? void 0 : a.map((
|
|
992
|
+
a == null ? void 0 : a.map((C) => /* @__PURE__ */ e.jsxs(
|
|
993
993
|
"div",
|
|
994
994
|
{
|
|
995
|
-
onClick: () =>
|
|
995
|
+
onClick: () => O(C),
|
|
996
996
|
className: Z(
|
|
997
997
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
998
998
|
{
|
|
999
|
-
"bg-muted": Wa(
|
|
999
|
+
"bg-muted": Wa(C, r)
|
|
1000
1000
|
}
|
|
1001
1001
|
),
|
|
1002
1002
|
children: [
|
|
1003
1003
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1004
|
-
/* @__PURE__ */ e.jsx(ya, { column:
|
|
1005
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1004
|
+
/* @__PURE__ */ e.jsx(ya, { column: C }),
|
|
1005
|
+
/* @__PURE__ */ e.jsx("span", { children: C.column_name })
|
|
1006
1006
|
] }),
|
|
1007
1007
|
/* @__PURE__ */ e.jsx(
|
|
1008
1008
|
"div",
|
|
1009
1009
|
{
|
|
1010
1010
|
onClick: (F) => F.stopPropagation(),
|
|
1011
1011
|
className: "flex items-center justify-end",
|
|
1012
|
-
children: na.includes(
|
|
1012
|
+
children: na.includes(C.data_type) && /* @__PURE__ */ e.jsx(On, { column: C })
|
|
1013
1013
|
}
|
|
1014
1014
|
)
|
|
1015
1015
|
]
|
|
1016
1016
|
},
|
|
1017
|
-
|
|
1017
|
+
C.column_name
|
|
1018
1018
|
)),
|
|
1019
1019
|
/* @__PURE__ */ e.jsx(Rs, { orientation: "vertical" }),
|
|
1020
1020
|
/* @__PURE__ */ e.jsx(Rs, { orientation: "horizontal" })
|
|
@@ -1023,7 +1023,7 @@ function Mn({
|
|
|
1023
1023
|
)
|
|
1024
1024
|
] });
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function Ae(s, n) {
|
|
1027
1027
|
var Ge, Ie, Je, Ue, p;
|
|
1028
1028
|
let a = Xt(() => [], []);
|
|
1029
1029
|
const t = Pe().authToken || s, r = c(
|
|
@@ -1053,28 +1053,28 @@ function Te(s, n) {
|
|
|
1053
1053
|
function N(j) {
|
|
1054
1054
|
return !!(r && o && o !== "NA" && i && d || r && (j === "S3" || j === "API") || h && h);
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function O(j) {
|
|
1057
1057
|
return r && j ? !(j === "API" || j === "S3") : !1;
|
|
1058
1058
|
}
|
|
1059
1059
|
const {
|
|
1060
1060
|
data: v,
|
|
1061
|
-
isLoading:
|
|
1062
|
-
isError:
|
|
1063
|
-
} =
|
|
1061
|
+
isLoading: q,
|
|
1062
|
+
isError: V
|
|
1063
|
+
} = he({
|
|
1064
1064
|
queryKey: ["connections"],
|
|
1065
|
-
queryFn: () =>
|
|
1065
|
+
queryFn: () => ge(
|
|
1066
1066
|
"https://semaphor.cloud/api/v1/connections",
|
|
1067
1067
|
(t == null ? void 0 : t.accessToken) || ""
|
|
1068
1068
|
),
|
|
1069
1069
|
enabled: !!(t != null && t.accessToken)
|
|
1070
1070
|
// Only fetch if authToken is present
|
|
1071
1071
|
}), {
|
|
1072
|
-
data:
|
|
1072
|
+
data: _,
|
|
1073
1073
|
isLoading: A,
|
|
1074
|
-
isError:
|
|
1075
|
-
} =
|
|
1074
|
+
isError: C
|
|
1075
|
+
} = he({
|
|
1076
1076
|
queryKey: ["models", r],
|
|
1077
|
-
queryFn: () =>
|
|
1077
|
+
queryFn: () => ge(
|
|
1078
1078
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
1079
1079
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1080
1080
|
{
|
|
@@ -1085,32 +1085,32 @@ function Te(s, n) {
|
|
|
1085
1085
|
// Only fetch if authToken is present
|
|
1086
1086
|
}), F = v == null ? void 0 : v.connections.find(
|
|
1087
1087
|
(j) => j.id === r
|
|
1088
|
-
),
|
|
1088
|
+
), R = F == null ? void 0 : F.type, B = (F == null ? void 0 : F.type) === "API" || (F == null ? void 0 : F.type) === "S3", {
|
|
1089
1089
|
data: L,
|
|
1090
|
-
isLoading:
|
|
1091
|
-
isFetching:
|
|
1090
|
+
isLoading: $,
|
|
1091
|
+
isFetching: X,
|
|
1092
1092
|
isError: U,
|
|
1093
|
-
refetch:
|
|
1094
|
-
} =
|
|
1093
|
+
refetch: le
|
|
1094
|
+
} = he({
|
|
1095
1095
|
queryKey: ["databases", r],
|
|
1096
|
-
queryFn: () =>
|
|
1096
|
+
queryFn: () => ge(
|
|
1097
1097
|
"https://semaphor.cloud/api/v1/databases",
|
|
1098
1098
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1099
1099
|
{
|
|
1100
1100
|
connection_id: r
|
|
1101
1101
|
}
|
|
1102
1102
|
),
|
|
1103
|
-
enabled:
|
|
1103
|
+
enabled: O(R)
|
|
1104
1104
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1105
1105
|
}), {
|
|
1106
1106
|
data: J,
|
|
1107
|
-
isLoading:
|
|
1108
|
-
isFetching:
|
|
1109
|
-
isError:
|
|
1110
|
-
refetch:
|
|
1111
|
-
} =
|
|
1107
|
+
isLoading: re,
|
|
1108
|
+
isFetching: S,
|
|
1109
|
+
isError: M,
|
|
1110
|
+
refetch: Y
|
|
1111
|
+
} = he({
|
|
1112
1112
|
queryKey: ["schemas", r, o],
|
|
1113
|
-
queryFn: () =>
|
|
1113
|
+
queryFn: () => ge(
|
|
1114
1114
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1115
1115
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1116
1116
|
{
|
|
@@ -1121,19 +1121,19 @@ function Te(s, n) {
|
|
|
1121
1121
|
enabled: !!r && !!o && !B && o !== "NA"
|
|
1122
1122
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1123
1123
|
}), {
|
|
1124
|
-
data:
|
|
1125
|
-
isLoading:
|
|
1126
|
-
isFetching:
|
|
1127
|
-
isError:
|
|
1128
|
-
refetch:
|
|
1129
|
-
} =
|
|
1124
|
+
data: w,
|
|
1125
|
+
isLoading: I,
|
|
1126
|
+
isFetching: ee,
|
|
1127
|
+
isError: E,
|
|
1128
|
+
refetch: se
|
|
1129
|
+
} = he({
|
|
1130
1130
|
queryKey: [
|
|
1131
1131
|
"tables",
|
|
1132
1132
|
r,
|
|
1133
1133
|
o,
|
|
1134
1134
|
i
|
|
1135
1135
|
],
|
|
1136
|
-
queryFn: () =>
|
|
1136
|
+
queryFn: () => ge(
|
|
1137
1137
|
"https://semaphor.cloud/api/v1/tables",
|
|
1138
1138
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1139
1139
|
{
|
|
@@ -1142,13 +1142,13 @@ function Te(s, n) {
|
|
|
1142
1142
|
schema_name: i
|
|
1143
1143
|
}
|
|
1144
1144
|
),
|
|
1145
|
-
enabled: f(
|
|
1145
|
+
enabled: f(R)
|
|
1146
1146
|
}), {
|
|
1147
|
-
data:
|
|
1148
|
-
isLoading:
|
|
1149
|
-
isFetching:
|
|
1147
|
+
data: te,
|
|
1148
|
+
isLoading: je,
|
|
1149
|
+
isFetching: pe,
|
|
1150
1150
|
isError: W
|
|
1151
|
-
} =
|
|
1151
|
+
} = he({
|
|
1152
1152
|
queryKey: [
|
|
1153
1153
|
"columns",
|
|
1154
1154
|
r,
|
|
@@ -1157,7 +1157,7 @@ function Te(s, n) {
|
|
|
1157
1157
|
i,
|
|
1158
1158
|
d
|
|
1159
1159
|
],
|
|
1160
|
-
queryFn: () =>
|
|
1160
|
+
queryFn: () => ge(
|
|
1161
1161
|
"https://semaphor.cloud/api/v1/columns",
|
|
1162
1162
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1163
1163
|
{
|
|
@@ -1169,7 +1169,7 @@ function Te(s, n) {
|
|
|
1169
1169
|
table_name: d
|
|
1170
1170
|
}
|
|
1171
1171
|
),
|
|
1172
|
-
enabled: N(
|
|
1172
|
+
enabled: N(R)
|
|
1173
1173
|
// (!!selectedConnectionId &&
|
|
1174
1174
|
// !!selectedDatabaseName &&
|
|
1175
1175
|
// !!selectedSchemaName &&
|
|
@@ -1180,7 +1180,7 @@ function Te(s, n) {
|
|
|
1180
1180
|
});
|
|
1181
1181
|
Q(() => {
|
|
1182
1182
|
m(a);
|
|
1183
|
-
}, [
|
|
1183
|
+
}, [te, m, a]), Q(() => {
|
|
1184
1184
|
}, [
|
|
1185
1185
|
B,
|
|
1186
1186
|
b,
|
|
@@ -1189,85 +1189,85 @@ function Te(s, n) {
|
|
|
1189
1189
|
g,
|
|
1190
1190
|
F
|
|
1191
1191
|
]);
|
|
1192
|
-
const
|
|
1193
|
-
function
|
|
1192
|
+
const ie = (F == null ? void 0 : F.type) === "API" ? (Ge = F == null ? void 0 : F.type) == null ? void 0 : Ge.toLowerCase() : d || "", oe = B ? "" : i || "";
|
|
1193
|
+
function be(j) {
|
|
1194
1194
|
l(j), u("");
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function ce(j) {
|
|
1197
1197
|
g(j === "none" ? "" : j), l(""), u(""), j !== "none" && j !== "" && y("");
|
|
1198
1198
|
}
|
|
1199
|
-
function
|
|
1199
|
+
function fe(j) {
|
|
1200
1200
|
x(j);
|
|
1201
1201
|
}
|
|
1202
1202
|
function qs(j) {
|
|
1203
1203
|
y(j === "none" ? "" : j), j !== "none" && j !== "" && g("");
|
|
1204
1204
|
}
|
|
1205
|
-
L && ((Ie = L == null ? void 0 : L.databases) == null ? void 0 : Ie.length) > 0, J && ((Je = J == null ? void 0 : J.schemas) == null ? void 0 : Je.length) > 0,
|
|
1205
|
+
L && ((Ie = L == null ? void 0 : L.databases) == null ? void 0 : Ie.length) > 0, J && ((Je = J == null ? void 0 : J.schemas) == null ? void 0 : Je.length) > 0, te && ((Ue = te == null ? void 0 : te.columns) == null ? void 0 : Ue.length) > 0 && (a = te.columns.map((j) => ({
|
|
1206
1206
|
...j,
|
|
1207
1207
|
data_type: j.data_type.toLowerCase()
|
|
1208
|
-
}))), U && (a = []), (W ||
|
|
1209
|
-
const
|
|
1208
|
+
}))), U && (a = []), (W || V) && (a = []);
|
|
1209
|
+
const Ne = v == null ? void 0 : v.connections.map(
|
|
1210
1210
|
(j) => ({
|
|
1211
1211
|
id: j.id,
|
|
1212
1212
|
name: j.name,
|
|
1213
1213
|
type: j.type
|
|
1214
1214
|
})
|
|
1215
|
-
),
|
|
1215
|
+
), is = (p = _ == null ? void 0 : _.datamodels) == null ? void 0 : p.map((j) => ({
|
|
1216
1216
|
id: j.id,
|
|
1217
1217
|
name: j.name
|
|
1218
1218
|
})), Ke = L == null ? void 0 : L.databases.map((j) => ({
|
|
1219
1219
|
id: j.database_name,
|
|
1220
1220
|
name: j.database_name
|
|
1221
|
-
})),
|
|
1221
|
+
})), os = J == null ? void 0 : J.schemas.map((j) => ({
|
|
1222
1222
|
id: j.schema_name,
|
|
1223
1223
|
name: j.schema_name
|
|
1224
|
-
})),
|
|
1224
|
+
})), cs = w == null ? void 0 : w.tables.map((j) => ({
|
|
1225
1225
|
id: j.table_name,
|
|
1226
1226
|
name: j.table_name
|
|
1227
1227
|
}));
|
|
1228
1228
|
return {
|
|
1229
|
-
connectionItems:
|
|
1230
|
-
isConnectionsLoading:
|
|
1231
|
-
isConnectionsError:
|
|
1232
|
-
modelItems:
|
|
1229
|
+
connectionItems: Ne,
|
|
1230
|
+
isConnectionsLoading: q,
|
|
1231
|
+
isConnectionsError: V,
|
|
1232
|
+
modelItems: is,
|
|
1233
1233
|
isModelsLoading: A,
|
|
1234
|
-
isModelsError:
|
|
1234
|
+
isModelsError: C,
|
|
1235
1235
|
databaseItems: Ke,
|
|
1236
|
-
isDatabasesLoadingOrFetching:
|
|
1236
|
+
isDatabasesLoadingOrFetching: $ || X,
|
|
1237
1237
|
isDatabaseError: U,
|
|
1238
|
-
schemaItems:
|
|
1239
|
-
isSchemaLoadingOrFetching:
|
|
1240
|
-
isSchemaError:
|
|
1241
|
-
tableItems:
|
|
1242
|
-
isTableLoadingOrFetching:
|
|
1243
|
-
isTableError:
|
|
1238
|
+
schemaItems: os,
|
|
1239
|
+
isSchemaLoadingOrFetching: re || S,
|
|
1240
|
+
isSchemaError: M,
|
|
1241
|
+
tableItems: cs,
|
|
1242
|
+
isTableLoadingOrFetching: I || ee,
|
|
1243
|
+
isTableError: E,
|
|
1244
1244
|
columns: a,
|
|
1245
|
-
isColumnsLoadingOrFetching:
|
|
1245
|
+
isColumnsLoadingOrFetching: je || pe,
|
|
1246
1246
|
isColumnsError: W,
|
|
1247
1247
|
isNonDbConnection: B,
|
|
1248
|
-
connectionType:
|
|
1249
|
-
tableName:
|
|
1250
|
-
schemaName:
|
|
1251
|
-
handleConnectionChange:
|
|
1248
|
+
connectionType: R,
|
|
1249
|
+
tableName: ie,
|
|
1250
|
+
schemaName: oe,
|
|
1251
|
+
handleConnectionChange: fe,
|
|
1252
1252
|
handleDatamodelChange: qs,
|
|
1253
|
-
handleDatabaseChange:
|
|
1254
|
-
handleSchemaChange:
|
|
1253
|
+
handleDatabaseChange: ce,
|
|
1254
|
+
handleSchemaChange: be
|
|
1255
1255
|
};
|
|
1256
1256
|
}
|
|
1257
1257
|
function va({
|
|
1258
1258
|
ColumnsComponent: s
|
|
1259
1259
|
}) {
|
|
1260
|
-
var
|
|
1260
|
+
var ee;
|
|
1261
1261
|
const n = c(
|
|
1262
|
-
(
|
|
1262
|
+
(E) => E.selectedConnectionId
|
|
1263
1263
|
), a = c(
|
|
1264
|
-
(
|
|
1264
|
+
(E) => E.selectedDatamodelId
|
|
1265
1265
|
), t = c(
|
|
1266
|
-
(
|
|
1266
|
+
(E) => E.selectedDatabaseName
|
|
1267
1267
|
), r = c(
|
|
1268
|
-
(
|
|
1269
|
-
), h = c((
|
|
1270
|
-
(
|
|
1268
|
+
(E) => E.selectedSchemaName
|
|
1269
|
+
), h = c((E) => E.selectedTableName), o = c(
|
|
1270
|
+
(E) => E.actions.setSelectedTableName
|
|
1271
1271
|
), {
|
|
1272
1272
|
connectionItems: i,
|
|
1273
1273
|
modelItems: d,
|
|
@@ -1280,37 +1280,37 @@ function va({
|
|
|
1280
1280
|
isConnectionsError: b,
|
|
1281
1281
|
isModelsError: f,
|
|
1282
1282
|
isDatabasesLoadingOrFetching: N,
|
|
1283
|
-
isDatabaseError:
|
|
1283
|
+
isDatabaseError: O,
|
|
1284
1284
|
isSchemaLoadingOrFetching: v,
|
|
1285
|
-
isSchemaError:
|
|
1286
|
-
isColumnsError:
|
|
1287
|
-
isColumnsLoadingOrFetching:
|
|
1285
|
+
isSchemaError: q,
|
|
1286
|
+
isColumnsError: V,
|
|
1287
|
+
isColumnsLoadingOrFetching: _,
|
|
1288
1288
|
isTableLoadingOrFetching: A,
|
|
1289
|
-
isTableError:
|
|
1289
|
+
isTableError: C,
|
|
1290
1290
|
connectionType: F,
|
|
1291
|
-
isNonDbConnection:
|
|
1291
|
+
isNonDbConnection: R,
|
|
1292
1292
|
handleConnectionChange: B,
|
|
1293
1293
|
handleDatabaseChange: L,
|
|
1294
|
-
handleSchemaChange:
|
|
1295
|
-
handleDatamodelChange:
|
|
1294
|
+
handleSchemaChange: $,
|
|
1295
|
+
handleDatamodelChange: X,
|
|
1296
1296
|
tableName: U,
|
|
1297
|
-
schemaName:
|
|
1298
|
-
} =
|
|
1297
|
+
schemaName: le
|
|
1298
|
+
} = Ae();
|
|
1299
1299
|
function J() {
|
|
1300
|
-
return s ? s(
|
|
1300
|
+
return s ? s(le, U, g) : /* @__PURE__ */ e.jsx(
|
|
1301
1301
|
Mn,
|
|
1302
1302
|
{
|
|
1303
|
-
schemaName:
|
|
1303
|
+
schemaName: le,
|
|
1304
1304
|
tableName: U,
|
|
1305
1305
|
columns: g,
|
|
1306
|
-
status:
|
|
1306
|
+
status: _ ? "Loading..." : V ? "Error" : "Success"
|
|
1307
1307
|
}
|
|
1308
1308
|
);
|
|
1309
1309
|
}
|
|
1310
|
-
function
|
|
1310
|
+
function re() {
|
|
1311
1311
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1313
|
+
function S() {
|
|
1314
1314
|
if (!n || F === "S3" || F === "API")
|
|
1315
1315
|
return null;
|
|
1316
1316
|
if (!a || a === "none")
|
|
@@ -1319,7 +1319,7 @@ function va({
|
|
|
1319
1319
|
{
|
|
1320
1320
|
showNone: !0,
|
|
1321
1321
|
onChange: L,
|
|
1322
|
-
isError:
|
|
1322
|
+
isError: O,
|
|
1323
1323
|
isLoading: N,
|
|
1324
1324
|
items: x,
|
|
1325
1325
|
value: t || "",
|
|
@@ -1327,15 +1327,15 @@ function va({
|
|
|
1327
1327
|
}
|
|
1328
1328
|
);
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1331
|
-
if (n && !
|
|
1330
|
+
function M() {
|
|
1331
|
+
if (n && !R && (!t || t === "none") && (!a || a === "none"))
|
|
1332
1332
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1333
1333
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Re, {}) }),
|
|
1334
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
1334
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(H, { children: "OR" }) }),
|
|
1335
1335
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Re, {}) })
|
|
1336
1336
|
] });
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function Y() {
|
|
1339
1339
|
if (!n || F === "S3" || F === "API")
|
|
1340
1340
|
return null;
|
|
1341
1341
|
if (!t || t === "none")
|
|
@@ -1343,7 +1343,7 @@ function va({
|
|
|
1343
1343
|
Ee,
|
|
1344
1344
|
{
|
|
1345
1345
|
showNone: !0,
|
|
1346
|
-
onChange:
|
|
1346
|
+
onChange: X,
|
|
1347
1347
|
isError: f,
|
|
1348
1348
|
isLoading: u,
|
|
1349
1349
|
items: d,
|
|
@@ -1352,12 +1352,12 @@ function va({
|
|
|
1352
1352
|
}
|
|
1353
1353
|
);
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1355
|
+
function w() {
|
|
1356
1356
|
return !n || F === "S3" || F === "API" || !t || t === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1357
1357
|
Ee,
|
|
1358
1358
|
{
|
|
1359
|
-
onChange:
|
|
1360
|
-
isError:
|
|
1359
|
+
onChange: $,
|
|
1360
|
+
isError: q,
|
|
1361
1361
|
isLoading: v,
|
|
1362
1362
|
items: m,
|
|
1363
1363
|
value: r || "",
|
|
@@ -1365,16 +1365,16 @@ function va({
|
|
|
1365
1365
|
}
|
|
1366
1366
|
);
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1369
|
-
function
|
|
1370
|
-
let
|
|
1371
|
-
return F === "API" ? (
|
|
1368
|
+
function I() {
|
|
1369
|
+
function E() {
|
|
1370
|
+
let se = !1;
|
|
1371
|
+
return F === "API" ? (se = !1, se) : ((F === "S3" || n && t && t !== "none" && r) && (se = !0), se);
|
|
1372
1372
|
}
|
|
1373
|
-
return
|
|
1373
|
+
return E() ? /* @__PURE__ */ e.jsx(
|
|
1374
1374
|
Ee,
|
|
1375
1375
|
{
|
|
1376
1376
|
onChange: o,
|
|
1377
|
-
isError:
|
|
1377
|
+
isError: C,
|
|
1378
1378
|
items: y,
|
|
1379
1379
|
isLoading: A,
|
|
1380
1380
|
value: h || "",
|
|
@@ -1393,22 +1393,22 @@ function va({
|
|
|
1393
1393
|
onChange: B,
|
|
1394
1394
|
isLoading: l,
|
|
1395
1395
|
isError: b,
|
|
1396
|
-
connectionTooltip: ((
|
|
1397
|
-
(
|
|
1398
|
-
)) == null ? void 0 :
|
|
1396
|
+
connectionTooltip: ((ee = i == null ? void 0 : i.find(
|
|
1397
|
+
(E) => E.id === n
|
|
1398
|
+
)) == null ? void 0 : ee.type) || ""
|
|
1399
1399
|
}
|
|
1400
1400
|
),
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1401
|
+
Y(),
|
|
1402
|
+
M(),
|
|
1403
|
+
S(),
|
|
1404
|
+
w(),
|
|
1405
|
+
I()
|
|
1406
1406
|
] }),
|
|
1407
1407
|
J(),
|
|
1408
1408
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1409
1409
|
z,
|
|
1410
1410
|
{
|
|
1411
|
-
onClick:
|
|
1411
|
+
onClick: re,
|
|
1412
1412
|
size: "sm",
|
|
1413
1413
|
variant: "secondary",
|
|
1414
1414
|
className: "w-full",
|
|
@@ -1442,10 +1442,10 @@ function An({
|
|
|
1442
1442
|
setUserInputforAI: a,
|
|
1443
1443
|
setTriggerAIRun: t
|
|
1444
1444
|
}) {
|
|
1445
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1446
|
-
/* @__PURE__ */ e.jsx(
|
|
1447
|
-
/* @__PURE__ */ e.jsx(
|
|
1448
|
-
/* @__PURE__ */ e.jsx(
|
|
1445
|
+
return /* @__PURE__ */ e.jsxs(zs, { openDelay: 0, children: [
|
|
1446
|
+
/* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(an, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1447
|
+
/* @__PURE__ */ e.jsx(Os, { align: "start", className: "min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1448
|
+
/* @__PURE__ */ e.jsx(Ms, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
|
|
1449
1449
|
/* @__PURE__ */ e.jsxs(
|
|
1450
1450
|
z,
|
|
1451
1451
|
{
|
|
@@ -1476,9 +1476,9 @@ function Dn({
|
|
|
1476
1476
|
function Ln() {
|
|
1477
1477
|
const { authToken: s } = Pe(), n = c(
|
|
1478
1478
|
(h) => h.selectedConnectionId
|
|
1479
|
-
), { data: a } =
|
|
1479
|
+
), { data: a } = he({
|
|
1480
1480
|
queryKey: ["connections"],
|
|
1481
|
-
queryFn: () =>
|
|
1481
|
+
queryFn: () => ge(
|
|
1482
1482
|
"https://semaphor.cloud/api/v1/connections",
|
|
1483
1483
|
(s == null ? void 0 : s.accessToken) || ""
|
|
1484
1484
|
),
|
|
@@ -1492,7 +1492,7 @@ function Ln() {
|
|
|
1492
1492
|
function In() {
|
|
1493
1493
|
const { authToken: s } = Pe(), n = He(null), a = c((d) => d.applyFilters), [t, r] = T(""), h = c((d) => d.filterValues), o = c((d) => d.card.sql), i = Ln();
|
|
1494
1494
|
return /* @__PURE__ */ e.jsxs(
|
|
1495
|
-
|
|
1495
|
+
zs,
|
|
1496
1496
|
{
|
|
1497
1497
|
openDelay: 0,
|
|
1498
1498
|
onOpenChange: async (d) => {
|
|
@@ -1511,8 +1511,8 @@ function In() {
|
|
|
1511
1511
|
console.log(m), m.sql ? (console.log(m.records), r(m.sql)) : r("Error");
|
|
1512
1512
|
},
|
|
1513
1513
|
children: [
|
|
1514
|
-
/* @__PURE__ */ e.jsx(
|
|
1515
|
-
/* @__PURE__ */ e.jsxs(
|
|
1514
|
+
/* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
1515
|
+
/* @__PURE__ */ e.jsxs(Os, { align: "end", className: "w-[600px]", children: [
|
|
1516
1516
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
|
|
1517
1517
|
t,
|
|
1518
1518
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1587,66 +1587,66 @@ function qn({
|
|
|
1587
1587
|
triggerAIRun: r,
|
|
1588
1588
|
setTriggerAIRun: h
|
|
1589
1589
|
}) {
|
|
1590
|
-
const o = He(null), i = He(null), { authToken: d } = Pe(), [m, x] = T(!1), y = c((
|
|
1590
|
+
const o = He(null), i = He(null), { authToken: d } = Pe(), [m, x] = T(!1), y = c((S) => S.actions.setCardSql), g = k((S) => S.dashboard.baseQueries), l = c((S) => S.actions.setRunSql), u = c((S) => S.actions.setCardType), [b, f] = T([]), N = c((S) => S.currentColumns), O = c((S) => S.card.sql), v = c((S) => S.selectedTableName), q = `
|
|
1591
1591
|
${a}
|
|
1592
1592
|
|
|
1593
1593
|
Database Query Dialect: ${v === "api" || v === "s3" ? "DuckDb" : ""}
|
|
1594
1594
|
Table Name: ${v}
|
|
1595
|
-
Table Columns: ${N == null ? void 0 : N.map((
|
|
1596
|
-
User SQL: ${
|
|
1597
|
-
${g && `Base Queries: ${JSON.stringify(g)} `}`,
|
|
1598
|
-
Visual Query Syntax: ${En}`, { data:
|
|
1595
|
+
Table Columns: ${N == null ? void 0 : N.map((S) => `${S.column_name} | ${S.data_type}`).join(", ")}
|
|
1596
|
+
User SQL: ${O}
|
|
1597
|
+
${g && `Base Queries: ${JSON.stringify(g)} `}`, V = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1598
|
+
Visual Query Syntax: ${En}`, { data: _, isLoading: A, isFetching: C, isError: F, refetch: R } = he({
|
|
1599
1599
|
queryKey: ["ai-query"],
|
|
1600
|
-
queryFn: () =>
|
|
1600
|
+
queryFn: () => ge(
|
|
1601
1601
|
"https://semaphor.cloud/api/v1/ai",
|
|
1602
1602
|
(d == null ? void 0 : d.accessToken) || "",
|
|
1603
1603
|
{
|
|
1604
|
-
user_content: `userContent: ${
|
|
1604
|
+
user_content: `userContent: ${q} ${m ? V : ""}`
|
|
1605
1605
|
}
|
|
1606
1606
|
),
|
|
1607
1607
|
enabled: !1
|
|
1608
1608
|
// Do not run by default.
|
|
1609
1609
|
});
|
|
1610
|
-
function B(
|
|
1611
|
-
if (
|
|
1610
|
+
function B(S) {
|
|
1611
|
+
if (S.toLowerCase().includes("bar"))
|
|
1612
1612
|
u("bar");
|
|
1613
|
-
else if (
|
|
1613
|
+
else if (S.toLowerCase().includes("line"))
|
|
1614
1614
|
u("line");
|
|
1615
|
-
else if (
|
|
1615
|
+
else if (S.toLowerCase().includes("bubble"))
|
|
1616
1616
|
u("bubble");
|
|
1617
|
-
else if (
|
|
1617
|
+
else if (S.toLowerCase().includes("scatter"))
|
|
1618
1618
|
u("scatter");
|
|
1619
|
-
else if (
|
|
1619
|
+
else if (S.toLowerCase().includes("stacked"))
|
|
1620
1620
|
u("stackedBar");
|
|
1621
|
-
else if (
|
|
1621
|
+
else if (S.toLowerCase().includes("pie"))
|
|
1622
1622
|
u("pie");
|
|
1623
|
-
else if (
|
|
1623
|
+
else if (S.toLowerCase().includes("donut") || S.toLowerCase().includes("doughnut"))
|
|
1624
1624
|
u("doughnut");
|
|
1625
|
-
else if (
|
|
1625
|
+
else if (S.toLowerCase().includes("radar"))
|
|
1626
1626
|
u("radar");
|
|
1627
1627
|
else
|
|
1628
1628
|
return u("bar"), !1;
|
|
1629
1629
|
return !0;
|
|
1630
1630
|
}
|
|
1631
1631
|
Q(() => {
|
|
1632
|
-
|
|
1633
|
-
}, [
|
|
1634
|
-
const
|
|
1635
|
-
var
|
|
1632
|
+
_ && f((S) => [...S, { role: "ai", content: _.response }]);
|
|
1633
|
+
}, [_]), Q(() => {
|
|
1634
|
+
const S = setTimeout(() => {
|
|
1635
|
+
var M;
|
|
1636
1636
|
i.current && (i.current.scroll({
|
|
1637
1637
|
top: i.current.scrollHeight,
|
|
1638
1638
|
behavior: "smooth"
|
|
1639
|
-
}), (
|
|
1639
|
+
}), (M = o.current) == null || M.focus());
|
|
1640
1640
|
}, 100);
|
|
1641
|
-
return () => clearTimeout(
|
|
1641
|
+
return () => clearTimeout(S);
|
|
1642
1642
|
}, [b]);
|
|
1643
1643
|
function L() {
|
|
1644
|
-
a && (f((
|
|
1644
|
+
a && (f((S) => [...S, { role: "user", content: a }]), B(a) && x(!0), t(""), R());
|
|
1645
1645
|
}
|
|
1646
1646
|
Q(() => {
|
|
1647
1647
|
r && (L(), h(!1));
|
|
1648
1648
|
}, [r, h]);
|
|
1649
|
-
const
|
|
1649
|
+
const $ = {
|
|
1650
1650
|
//seleect a darker color
|
|
1651
1651
|
// color: '#000',
|
|
1652
1652
|
fontFamily: "Arial, sans-serif",
|
|
@@ -1654,7 +1654,7 @@ function qn({
|
|
|
1654
1654
|
fontSize: 15,
|
|
1655
1655
|
// padding: '5px',
|
|
1656
1656
|
width: "100%"
|
|
1657
|
-
},
|
|
1657
|
+
}, X = {
|
|
1658
1658
|
// background: '#f6f8fa',
|
|
1659
1659
|
// color: '#000',
|
|
1660
1660
|
fontFamily: "monospace",
|
|
@@ -1671,20 +1671,20 @@ function qn({
|
|
|
1671
1671
|
marginLeft: 20,
|
|
1672
1672
|
// add bullet points for unordered lists
|
|
1673
1673
|
listStyleType: "disc"
|
|
1674
|
-
},
|
|
1674
|
+
}, le = {
|
|
1675
1675
|
// Override how paragraphs are rendered
|
|
1676
|
-
p: ({ node:
|
|
1677
|
-
code: ({ node:
|
|
1678
|
-
pre: ({ node:
|
|
1679
|
-
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children:
|
|
1676
|
+
p: ({ node: S, ...M }) => /* @__PURE__ */ e.jsx("p", { style: $, ...M }),
|
|
1677
|
+
code: ({ node: S, ...M }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...M }),
|
|
1678
|
+
pre: ({ node: S, ...M }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: X, children: [
|
|
1679
|
+
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: M.children }),
|
|
1680
1680
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1681
1681
|
/* @__PURE__ */ e.jsx(z, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(oa, {}) }),
|
|
1682
1682
|
/* @__PURE__ */ e.jsx(
|
|
1683
1683
|
z,
|
|
1684
1684
|
{
|
|
1685
|
-
onClick: (
|
|
1686
|
-
const
|
|
1687
|
-
|
|
1685
|
+
onClick: (Y) => {
|
|
1686
|
+
const w = J(Y);
|
|
1687
|
+
w && (n(!1), y(w), l(!0));
|
|
1688
1688
|
},
|
|
1689
1689
|
size: "sm",
|
|
1690
1690
|
variant: "outline",
|
|
@@ -1693,39 +1693,39 @@ function qn({
|
|
|
1693
1693
|
)
|
|
1694
1694
|
] })
|
|
1695
1695
|
] }),
|
|
1696
|
-
li: ({ node:
|
|
1696
|
+
li: ({ node: S, ...M }) => /* @__PURE__ */ e.jsx("li", { style: U, ...M })
|
|
1697
1697
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1698
1698
|
};
|
|
1699
|
-
function J(
|
|
1700
|
-
const
|
|
1701
|
-
if (!
|
|
1699
|
+
function J(S) {
|
|
1700
|
+
const M = S.currentTarget.closest("pre");
|
|
1701
|
+
if (!M)
|
|
1702
1702
|
return;
|
|
1703
|
-
const
|
|
1704
|
-
return navigator.clipboard.writeText(
|
|
1703
|
+
const Y = M.textContent || M.innerText;
|
|
1704
|
+
return navigator.clipboard.writeText(Y).then(() => console.log("Text copied to clipboard")).catch((w) => console.error("Error in copying text: ", w)), Y;
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return b == null ? void 0 : b.map((
|
|
1706
|
+
function re() {
|
|
1707
|
+
return b == null ? void 0 : b.map((S, M) => S.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1708
1708
|
"div",
|
|
1709
1709
|
{
|
|
1710
1710
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1711
1711
|
children: [
|
|
1712
1712
|
/* @__PURE__ */ e.jsx(Sn, { className: "mr-2 h-5 w-5" }),
|
|
1713
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1713
|
+
/* @__PURE__ */ e.jsx("div", { children: S.content })
|
|
1714
1714
|
]
|
|
1715
1715
|
},
|
|
1716
|
-
|
|
1717
|
-
) :
|
|
1716
|
+
M
|
|
1717
|
+
) : S.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1718
1718
|
et,
|
|
1719
1719
|
{
|
|
1720
1720
|
className: "w-full overflow-auto py-1",
|
|
1721
|
-
components:
|
|
1722
|
-
children:
|
|
1721
|
+
components: le,
|
|
1722
|
+
children: _ == null ? void 0 : _.response.replace(/DuckDB/gi, "Semaphor")
|
|
1723
1723
|
},
|
|
1724
|
-
|
|
1725
|
-
) : /* @__PURE__ */ e.jsx("div", {},
|
|
1724
|
+
M
|
|
1725
|
+
) : /* @__PURE__ */ e.jsx("div", {}, M));
|
|
1726
1726
|
}
|
|
1727
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1728
|
-
/* @__PURE__ */ e.jsx(
|
|
1727
|
+
return /* @__PURE__ */ e.jsxs(gs, { open: s, onOpenChange: n, children: [
|
|
1728
|
+
/* @__PURE__ */ e.jsx(js, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1729
1729
|
z,
|
|
1730
1730
|
{
|
|
1731
1731
|
size: "sm",
|
|
@@ -1735,20 +1735,20 @@ function qn({
|
|
|
1735
1735
|
}
|
|
1736
1736
|
) }),
|
|
1737
1737
|
/* @__PURE__ */ e.jsxs(
|
|
1738
|
-
|
|
1738
|
+
ys,
|
|
1739
1739
|
{
|
|
1740
1740
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1741
1741
|
children: [
|
|
1742
|
-
/* @__PURE__ */ e.jsxs(
|
|
1743
|
-
/* @__PURE__ */ e.jsx(
|
|
1744
|
-
/* @__PURE__ */ e.jsx(
|
|
1742
|
+
/* @__PURE__ */ e.jsxs(vs, { children: [
|
|
1743
|
+
/* @__PURE__ */ e.jsx(Ns, { children: "Assistant" }),
|
|
1744
|
+
/* @__PURE__ */ e.jsx(Cs, { children: "What can I help you with?" })
|
|
1745
1745
|
] }),
|
|
1746
1746
|
/* @__PURE__ */ e.jsx(
|
|
1747
1747
|
"div",
|
|
1748
1748
|
{
|
|
1749
1749
|
ref: i,
|
|
1750
1750
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
1751
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children:
|
|
1751
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: re() })
|
|
1752
1752
|
}
|
|
1753
1753
|
),
|
|
1754
1754
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1760,20 +1760,20 @@ function qn({
|
|
|
1760
1760
|
{
|
|
1761
1761
|
autoFocus: !0,
|
|
1762
1762
|
ref: o,
|
|
1763
|
-
onKeyDown: (
|
|
1764
|
-
|
|
1763
|
+
onKeyDown: (S) => {
|
|
1764
|
+
S.key === "Enter" && !S.shiftKey && (S.preventDefault(), t(""), L());
|
|
1765
1765
|
},
|
|
1766
1766
|
placeholder: "Type your question here...",
|
|
1767
|
-
onFocus: (
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1767
|
+
onFocus: (S) => {
|
|
1768
|
+
const M = S.target, Y = M.value.length;
|
|
1769
|
+
M.setSelectionRange(Y, Y);
|
|
1770
1770
|
},
|
|
1771
1771
|
className: Z(
|
|
1772
1772
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1773
1773
|
),
|
|
1774
|
-
disabled: A ||
|
|
1774
|
+
disabled: A || C,
|
|
1775
1775
|
value: a,
|
|
1776
|
-
onChange: (
|
|
1776
|
+
onChange: (S) => t(S.target.value)
|
|
1777
1777
|
}
|
|
1778
1778
|
),
|
|
1779
1779
|
" ",
|
|
@@ -1784,7 +1784,7 @@ function qn({
|
|
|
1784
1784
|
size: "sm",
|
|
1785
1785
|
variant: "ghost",
|
|
1786
1786
|
onClick: L,
|
|
1787
|
-
children: !A && !
|
|
1787
|
+
children: !A && !C ? /* @__PURE__ */ e.jsx(Xa, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1788
1788
|
}
|
|
1789
1789
|
)
|
|
1790
1790
|
] })
|
|
@@ -1801,7 +1801,7 @@ var Na = {
|
|
|
1801
1801
|
className: void 0,
|
|
1802
1802
|
style: void 0,
|
|
1803
1803
|
attr: void 0
|
|
1804
|
-
}, Us =
|
|
1804
|
+
}, Us = ue.createContext && /* @__PURE__ */ ue.createContext(Na), Vn = ["attr", "size", "title"];
|
|
1805
1805
|
function _n(s, n) {
|
|
1806
1806
|
if (s == null)
|
|
1807
1807
|
return {};
|
|
@@ -1872,12 +1872,12 @@ function $n(s, n) {
|
|
|
1872
1872
|
return (n === "string" ? String : Number)(s);
|
|
1873
1873
|
}
|
|
1874
1874
|
function Ca(s) {
|
|
1875
|
-
return s && s.map((n, a) => /* @__PURE__ */
|
|
1875
|
+
return s && s.map((n, a) => /* @__PURE__ */ ue.createElement(n.tag, ss({
|
|
1876
1876
|
key: a
|
|
1877
1877
|
}, n.attr), Ca(n.child)));
|
|
1878
1878
|
}
|
|
1879
|
-
function
|
|
1880
|
-
return (n) => /* @__PURE__ */
|
|
1879
|
+
function xe(s) {
|
|
1880
|
+
return (n) => /* @__PURE__ */ ue.createElement(Pn, es({
|
|
1881
1881
|
attr: ss({}, s.attr)
|
|
1882
1882
|
}, n), Ca(s.child));
|
|
1883
1883
|
}
|
|
@@ -1888,7 +1888,7 @@ function Pn(s) {
|
|
|
1888
1888
|
size: r,
|
|
1889
1889
|
title: h
|
|
1890
1890
|
} = s, o = _n(s, Vn), i = r || a.size || "1em", d;
|
|
1891
|
-
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */
|
|
1891
|
+
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ ue.createElement("svg", es({
|
|
1892
1892
|
stroke: "currentColor",
|
|
1893
1893
|
fill: "currentColor",
|
|
1894
1894
|
strokeWidth: "0"
|
|
@@ -1900,107 +1900,107 @@ function Pn(s) {
|
|
|
1900
1900
|
height: i,
|
|
1901
1901
|
width: i,
|
|
1902
1902
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1903
|
-
}), h && /* @__PURE__ */
|
|
1903
|
+
}), h && /* @__PURE__ */ ue.createElement("title", null, h), s.children);
|
|
1904
1904
|
};
|
|
1905
|
-
return Us !== void 0 ? /* @__PURE__ */
|
|
1905
|
+
return Us !== void 0 ? /* @__PURE__ */ ue.createElement(Us.Consumer, null, (a) => n(a)) : n(Na);
|
|
1906
1906
|
}
|
|
1907
1907
|
function Kn(s) {
|
|
1908
|
-
return
|
|
1908
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
1909
1909
|
}
|
|
1910
1910
|
function Gn() {
|
|
1911
1911
|
const { theme: s } = at(), n = He(), a = He(), [t, r] = T(!1), [h, o] = T(!1), [i, d] = T(!1), [m, x] = T(""), [y, g] = T(!1), { authToken: l } = Pe();
|
|
1912
|
-
|
|
1913
|
-
const u =
|
|
1912
|
+
k((p) => p.selectedSheetId);
|
|
1913
|
+
const u = k((p) => p.dashboard.baseQueries), b = c((p) => p.card), f = k((p) => p.theme), N = c((p) => p.isShowingVisual), O = c(
|
|
1914
1914
|
(p) => p.selectedConnectionId
|
|
1915
1915
|
), v = c(
|
|
1916
1916
|
(p) => p.selectedDatabaseName
|
|
1917
|
-
),
|
|
1917
|
+
), q = c(
|
|
1918
1918
|
(p) => p.selectedDatamodelId
|
|
1919
|
-
),
|
|
1919
|
+
), V = c(
|
|
1920
1920
|
(p) => p.selectedSchemaName
|
|
1921
1921
|
);
|
|
1922
|
-
|
|
1922
|
+
k(
|
|
1923
1923
|
(p) => p.actions.updateFrameCard
|
|
1924
1924
|
);
|
|
1925
|
-
const
|
|
1926
|
-
setCardCustomCfg:
|
|
1925
|
+
const _ = c((p) => p.selectedTableName), A = c((p) => p.card.sql), C = c((p) => p.card.python), F = tt(A, u), R = c((p) => p.selectedConnectionId), B = c((p) => p.frame), L = k((p) => p.filterValues), $ = c((p) => p.applyFilters), {
|
|
1926
|
+
setCardCustomCfg: X,
|
|
1927
1927
|
setQueryResultColumns: U,
|
|
1928
|
-
setFilterValues:
|
|
1928
|
+
setFilterValues: le,
|
|
1929
1929
|
setCardSql: J,
|
|
1930
|
-
setCardPython:
|
|
1931
|
-
setQueryError:
|
|
1932
|
-
setPythonStdOut:
|
|
1933
|
-
setCardPreferences:
|
|
1934
|
-
} = c((p) => p.actions),
|
|
1930
|
+
setCardPython: re,
|
|
1931
|
+
setQueryError: S,
|
|
1932
|
+
setPythonStdOut: M,
|
|
1933
|
+
setCardPreferences: Y
|
|
1934
|
+
} = c((p) => p.actions), w = c((p) => p.onSave), I = c(
|
|
1935
1935
|
(p) => p.actions.setApplyFilters
|
|
1936
|
-
),
|
|
1936
|
+
), ee = c((p) => p.onClose), E = c((p) => p.actions.setCardData), se = c((p) => p.actions.setSqlGen), te = c((p) => p.runSql), je = c((p) => p.actions.setRunSql), pe = c(
|
|
1937
1937
|
(p) => p.actions.setIsSqlRunning
|
|
1938
1938
|
), {
|
|
1939
1939
|
data: W,
|
|
1940
|
-
isLoading:
|
|
1941
|
-
isFetching:
|
|
1942
|
-
isSuccess:
|
|
1943
|
-
isError:
|
|
1944
|
-
error:
|
|
1940
|
+
isLoading: ie,
|
|
1941
|
+
isFetching: oe,
|
|
1942
|
+
isSuccess: be,
|
|
1943
|
+
isError: ce,
|
|
1944
|
+
error: fe,
|
|
1945
1945
|
status: qs,
|
|
1946
|
-
refetch:
|
|
1947
|
-
} =
|
|
1948
|
-
queryKey: [F,
|
|
1946
|
+
refetch: Ne
|
|
1947
|
+
} = he({
|
|
1948
|
+
queryKey: [F, C],
|
|
1949
1949
|
queryFn: () => ia(
|
|
1950
1950
|
"https://semaphor.cloud/api/v1/query",
|
|
1951
1951
|
(l == null ? void 0 : l.accessToken) || "",
|
|
1952
1952
|
{
|
|
1953
|
-
connection_id:
|
|
1953
|
+
connection_id: R,
|
|
1954
1954
|
sql: F,
|
|
1955
|
-
python:
|
|
1956
|
-
active_filters:
|
|
1955
|
+
python: C === Hs ? "" : C,
|
|
1956
|
+
active_filters: $ ? L : []
|
|
1957
1957
|
}
|
|
1958
1958
|
),
|
|
1959
1959
|
enabled: !1,
|
|
1960
1960
|
retry: !1
|
|
1961
1961
|
});
|
|
1962
1962
|
Q(() => {
|
|
1963
|
-
if (W && (
|
|
1963
|
+
if (W && (E(W.records), W.rowLimitExceeded && ms.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
1964
1964
|
position: "top-center",
|
|
1965
1965
|
richColors: !0
|
|
1966
|
-
}),
|
|
1967
|
-
const { dimensionKeys: p } =
|
|
1966
|
+
}), M((W == null ? void 0 : W.output) || ""), W.records.length > 0)) {
|
|
1967
|
+
const { dimensionKeys: p } = xs(W.records);
|
|
1968
1968
|
U(p);
|
|
1969
1969
|
}
|
|
1970
|
-
}, [W,
|
|
1971
|
-
|
|
1972
|
-
}, [
|
|
1973
|
-
(
|
|
1970
|
+
}, [W, E, U, M]), Q(() => {
|
|
1971
|
+
te && (Ne(), je(!1));
|
|
1972
|
+
}, [te, Ne, je]), Q(() => {
|
|
1973
|
+
(ie || oe) && pe(!0), (ce || be) && pe(!1), ce ? (S(fe.message), E([]), U([]), M("")) : S("");
|
|
1974
1974
|
}, [
|
|
1975
|
-
re,
|
|
1976
1975
|
ie,
|
|
1976
|
+
oe,
|
|
1977
1977
|
W,
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1978
|
+
M,
|
|
1979
|
+
ce,
|
|
1980
|
+
be,
|
|
1981
|
+
pe,
|
|
1982
|
+
E,
|
|
1983
1983
|
U,
|
|
1984
|
-
|
|
1985
|
-
|
|
1984
|
+
S,
|
|
1985
|
+
fe
|
|
1986
1986
|
]);
|
|
1987
|
-
function
|
|
1988
|
-
J(""),
|
|
1987
|
+
function is() {
|
|
1988
|
+
J(""), E([]), se({}), X(""), Y({});
|
|
1989
1989
|
}
|
|
1990
1990
|
const Ke = (p) => {
|
|
1991
1991
|
a.current = p;
|
|
1992
1992
|
};
|
|
1993
|
-
function
|
|
1993
|
+
function os(p, j) {
|
|
1994
1994
|
if (p.length === 0)
|
|
1995
1995
|
return "";
|
|
1996
1996
|
if (j) {
|
|
1997
|
-
const
|
|
1998
|
-
if (
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
1997
|
+
const ye = p.find((ne) => ne.id === j);
|
|
1998
|
+
if (ye) {
|
|
1999
|
+
const ne = ye.tabTitle;
|
|
2000
|
+
if (ne == "All__Header")
|
|
2001
2001
|
return p[0].id;
|
|
2002
|
-
if (
|
|
2003
|
-
const Ea =
|
|
2002
|
+
if (ne && ne.endsWith("__Header")) {
|
|
2003
|
+
const Ea = ne.split("__")[0], Vs = p.find(
|
|
2004
2004
|
(qa) => qa.tabTitle === Ea
|
|
2005
2005
|
);
|
|
2006
2006
|
return Vs ? Vs.id : p[0].id;
|
|
@@ -2010,50 +2010,50 @@ function Gn() {
|
|
|
2010
2010
|
}
|
|
2011
2011
|
return p[0].id;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function cs() {
|
|
2014
2014
|
let p = A;
|
|
2015
2015
|
A && !A.includes("{{") && (p = Tn(A), J(p));
|
|
2016
2016
|
const j = {
|
|
2017
2017
|
...b,
|
|
2018
|
-
lastSelectedSchema:
|
|
2019
|
-
lastSelectedDatamodelId:
|
|
2018
|
+
lastSelectedSchema: V,
|
|
2019
|
+
lastSelectedDatamodelId: q,
|
|
2020
2020
|
lastSelectedDatabase: v,
|
|
2021
|
-
lastSelectedTable:
|
|
2022
|
-
connectionId:
|
|
2021
|
+
lastSelectedTable: _,
|
|
2022
|
+
connectionId: O,
|
|
2023
2023
|
type: N ? b.type : "table",
|
|
2024
2024
|
sql: p,
|
|
2025
2025
|
customCfg: N ? b.customCfg : null
|
|
2026
|
-
},
|
|
2027
|
-
(
|
|
2028
|
-
),
|
|
2026
|
+
}, ye = B.cards.map(
|
|
2027
|
+
(ds) => ds.id === b.id ? j : ds
|
|
2028
|
+
), ne = {
|
|
2029
2029
|
...B,
|
|
2030
|
-
cards:
|
|
2031
|
-
activeCardId:
|
|
2030
|
+
cards: ye,
|
|
2031
|
+
activeCardId: os(ye, B.activeCardId)
|
|
2032
2032
|
};
|
|
2033
|
-
|
|
2033
|
+
w == null || w(ne);
|
|
2034
2034
|
}
|
|
2035
2035
|
function Ge() {
|
|
2036
|
-
|
|
2036
|
+
ee == null || ee();
|
|
2037
2037
|
}
|
|
2038
2038
|
Q(() => {
|
|
2039
2039
|
const p = n.current, j = a.current;
|
|
2040
2040
|
if (p) {
|
|
2041
|
-
const
|
|
2041
|
+
const ye = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ne = f === "system" ? ye : f;
|
|
2042
2042
|
p.editor.defineTheme("default", {
|
|
2043
2043
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2044
|
-
base:
|
|
2044
|
+
base: ne === "light" ? "vs" : "vs-dark",
|
|
2045
2045
|
inherit: !0,
|
|
2046
2046
|
rules: [],
|
|
2047
2047
|
colors: {
|
|
2048
2048
|
// 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
|
|
2049
|
-
"editor.background":
|
|
2049
|
+
"editor.background": ne === "light" ? "#ffffff" : nt("--semaphor-background")
|
|
2050
2050
|
}
|
|
2051
2051
|
}), p.editor.setTheme("default");
|
|
2052
2052
|
}
|
|
2053
2053
|
return j && p && j.addCommand(
|
|
2054
2054
|
p.KeyMod.Shift | p.KeyCode.Enter,
|
|
2055
2055
|
function() {
|
|
2056
|
-
return console.log("Executing query..."),
|
|
2056
|
+
return console.log("Executing query..."), Ne(), !1;
|
|
2057
2057
|
}
|
|
2058
2058
|
), () => {
|
|
2059
2059
|
};
|
|
@@ -2073,8 +2073,8 @@ function Gn() {
|
|
|
2073
2073
|
/* @__PURE__ */ e.jsx(
|
|
2074
2074
|
Dn,
|
|
2075
2075
|
{
|
|
2076
|
-
checked:
|
|
2077
|
-
onCheckedChange: () =>
|
|
2076
|
+
checked: $,
|
|
2077
|
+
onCheckedChange: () => I(!$),
|
|
2078
2078
|
text: "Apply Filters"
|
|
2079
2079
|
}
|
|
2080
2080
|
),
|
|
@@ -2094,7 +2094,7 @@ function Gn() {
|
|
|
2094
2094
|
onChange: (p) => {
|
|
2095
2095
|
if (p)
|
|
2096
2096
|
try {
|
|
2097
|
-
JSON.parse(p),
|
|
2097
|
+
JSON.parse(p), le(JSON.parse(p));
|
|
2098
2098
|
} catch {
|
|
2099
2099
|
}
|
|
2100
2100
|
},
|
|
@@ -2128,7 +2128,7 @@ function Gn() {
|
|
|
2128
2128
|
className: Z(
|
|
2129
2129
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
2130
2130
|
{
|
|
2131
|
-
"font-bold text-red-800":
|
|
2131
|
+
"font-bold text-red-800": $
|
|
2132
2132
|
}
|
|
2133
2133
|
)
|
|
2134
2134
|
}
|
|
@@ -2137,14 +2137,14 @@ function Gn() {
|
|
|
2137
2137
|
}
|
|
2138
2138
|
function Ue() {
|
|
2139
2139
|
return /* @__PURE__ */ e.jsxs(
|
|
2140
|
-
|
|
2140
|
+
ps,
|
|
2141
2141
|
{
|
|
2142
2142
|
className: "flex grow pb-1",
|
|
2143
2143
|
direction: "vertical",
|
|
2144
2144
|
role: "editor-resizable-group",
|
|
2145
2145
|
children: [
|
|
2146
2146
|
/* @__PURE__ */ e.jsxs(
|
|
2147
|
-
|
|
2147
|
+
Se,
|
|
2148
2148
|
{
|
|
2149
2149
|
id: "1",
|
|
2150
2150
|
order: 1,
|
|
@@ -2189,9 +2189,9 @@ function Gn() {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
),
|
|
2191
2191
|
t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2192
|
-
/* @__PURE__ */ e.jsx(
|
|
2192
|
+
/* @__PURE__ */ e.jsx(fs, { withHandle: !0, className: "border" }),
|
|
2193
2193
|
/* @__PURE__ */ e.jsxs(
|
|
2194
|
-
|
|
2194
|
+
Se,
|
|
2195
2195
|
{
|
|
2196
2196
|
id: "2",
|
|
2197
2197
|
order: 2,
|
|
@@ -2209,9 +2209,9 @@ function Gn() {
|
|
|
2209
2209
|
className: "pt-3",
|
|
2210
2210
|
theme: "default",
|
|
2211
2211
|
onChange: (p) => {
|
|
2212
|
-
|
|
2212
|
+
re(p && p.trim() || "");
|
|
2213
2213
|
},
|
|
2214
|
-
value:
|
|
2214
|
+
value: C || Hs,
|
|
2215
2215
|
options: {
|
|
2216
2216
|
minimap: {
|
|
2217
2217
|
enabled: !1
|
|
@@ -2270,23 +2270,23 @@ function Gn() {
|
|
|
2270
2270
|
z,
|
|
2271
2271
|
{
|
|
2272
2272
|
title: "Shift + Enter",
|
|
2273
|
-
disabled:
|
|
2273
|
+
disabled: ie || oe,
|
|
2274
2274
|
onClick: () => {
|
|
2275
|
-
|
|
2275
|
+
Ne();
|
|
2276
2276
|
},
|
|
2277
2277
|
className: "shrink-0",
|
|
2278
2278
|
size: "sm",
|
|
2279
2279
|
variant: "outline",
|
|
2280
2280
|
children: [
|
|
2281
|
-
|
|
2281
|
+
ie || oe ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(fn, { className: "mr-2 h-4 w-4" }),
|
|
2282
2282
|
"Run"
|
|
2283
2283
|
]
|
|
2284
2284
|
}
|
|
2285
2285
|
),
|
|
2286
|
-
|
|
2286
|
+
ce && /* @__PURE__ */ e.jsx(
|
|
2287
2287
|
An,
|
|
2288
2288
|
{
|
|
2289
|
-
error:
|
|
2289
|
+
error: fe.message,
|
|
2290
2290
|
setShowAIDialog: d,
|
|
2291
2291
|
setTriggerAIRun: g,
|
|
2292
2292
|
setUserInputforAI: x
|
|
@@ -2295,7 +2295,7 @@ function Gn() {
|
|
|
2295
2295
|
/* @__PURE__ */ e.jsxs(
|
|
2296
2296
|
z,
|
|
2297
2297
|
{
|
|
2298
|
-
onClick:
|
|
2298
|
+
onClick: is,
|
|
2299
2299
|
className: "",
|
|
2300
2300
|
size: "sm",
|
|
2301
2301
|
variant: "outline",
|
|
@@ -2332,7 +2332,7 @@ function Gn() {
|
|
|
2332
2332
|
/* @__PURE__ */ e.jsxs(
|
|
2333
2333
|
z,
|
|
2334
2334
|
{
|
|
2335
|
-
onClick:
|
|
2335
|
+
onClick: cs,
|
|
2336
2336
|
size: "sm",
|
|
2337
2337
|
variant: "outline",
|
|
2338
2338
|
children: [
|
|
@@ -2365,7 +2365,7 @@ function Gn() {
|
|
|
2365
2365
|
}
|
|
2366
2366
|
function Jn({ data: s }) {
|
|
2367
2367
|
var o;
|
|
2368
|
-
const [n, a] =
|
|
2368
|
+
const [n, a] = ue.useState([]), r = Object.keys(s[0]).map((i) => ({
|
|
2369
2369
|
// header: key,
|
|
2370
2370
|
accessorKey: i,
|
|
2371
2371
|
header: ({ column: d }) => {
|
|
@@ -2395,19 +2395,19 @@ function Jn({ data: s }) {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
});
|
|
2397
2397
|
return /* @__PURE__ */ e.jsxs(ct, { children: [
|
|
2398
|
-
/* @__PURE__ */ e.jsx(dt, { children: h.getHeaderGroups().map((i) => /* @__PURE__ */ e.jsx(
|
|
2398
|
+
/* @__PURE__ */ e.jsx(dt, { children: h.getHeaderGroups().map((i) => /* @__PURE__ */ e.jsx(hs, { children: i.headers.map((d) => /* @__PURE__ */ e.jsx(ht, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Bs(
|
|
2399
2399
|
d.column.columnDef.header,
|
|
2400
2400
|
d.getContext()
|
|
2401
2401
|
) }, d.id)) }, i.id)) }),
|
|
2402
2402
|
/* @__PURE__ */ e.jsx(mt, { children: (o = h.getRowModel().rows) != null && o.length ? h.getRowModel().rows.map((i) => /* @__PURE__ */ e.jsx(
|
|
2403
|
-
|
|
2403
|
+
hs,
|
|
2404
2404
|
{
|
|
2405
2405
|
className: "whitespace-nowrap py-2",
|
|
2406
2406
|
"data-state": i.getIsSelected() && "selected",
|
|
2407
2407
|
children: i.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx($s, { children: Bs(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2408
2408
|
},
|
|
2409
2409
|
i.id
|
|
2410
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
2410
|
+
)) : /* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx($s, { colSpan: r.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2411
2411
|
] });
|
|
2412
2412
|
}
|
|
2413
2413
|
function Sa({
|
|
@@ -2417,8 +2417,8 @@ function Sa({
|
|
|
2417
2417
|
...n
|
|
2418
2418
|
}) {
|
|
2419
2419
|
var g;
|
|
2420
|
-
|
|
2421
|
-
const a =
|
|
2420
|
+
ue.useState(0);
|
|
2421
|
+
const a = k((l) => l.themeStyle), t = c((l) => l.card), r = c((l) => l.frame), h = k((l) => l.dashboard.filters), o = k((l) => l.filterValues), i = c((l) => l.actions.setRunSql), { updateFilter: d } = ft(), m = h == null ? void 0 : h.find((l) => l.id === r.filterId), x = c((l) => l.actions.setCard);
|
|
2422
2422
|
if (Q(() => {
|
|
2423
2423
|
t.sql && i(!0);
|
|
2424
2424
|
}, [o]), Q(() => {
|
|
@@ -2476,7 +2476,7 @@ function Sa({
|
|
|
2476
2476
|
className: "my-1",
|
|
2477
2477
|
text: m.title || m.column,
|
|
2478
2478
|
onSave: (l) => d({ ...m, title: l }),
|
|
2479
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2479
|
+
children: /* @__PURE__ */ e.jsx(H, { children: m.title })
|
|
2480
2480
|
}
|
|
2481
2481
|
),
|
|
2482
2482
|
vt(m)
|
|
@@ -2501,23 +2501,23 @@ function Sa({
|
|
|
2501
2501
|
function Un() {
|
|
2502
2502
|
const [s, n] = T(!1), [a, t] = T(""), [r, h] = T(""), [o, i] = T(""), [d, m] = T(""), x = c((v) => v.card), y = c(
|
|
2503
2503
|
(v) => v.card.customCfg
|
|
2504
|
-
), { setCardCustomCfg: g, setCustomVisualCode: l } =
|
|
2504
|
+
), { setCardCustomCfg: g, setCustomVisualCode: l } = as();
|
|
2505
2505
|
function u(v) {
|
|
2506
|
-
var
|
|
2507
|
-
const
|
|
2506
|
+
var _, A;
|
|
2507
|
+
const q = {
|
|
2508
2508
|
...v,
|
|
2509
2509
|
data: {
|
|
2510
2510
|
...v == null ? void 0 : v.data,
|
|
2511
|
-
datasets: (A = (
|
|
2512
|
-
...
|
|
2511
|
+
datasets: (A = (_ = v == null ? void 0 : v.data) == null ? void 0 : _.datasets) == null ? void 0 : A.map((C) => ({
|
|
2512
|
+
...C,
|
|
2513
2513
|
data: []
|
|
2514
2514
|
}))
|
|
2515
2515
|
}
|
|
2516
2516
|
};
|
|
2517
|
-
return JSON.stringify(
|
|
2517
|
+
return JSON.stringify(q, null, 1);
|
|
2518
2518
|
}
|
|
2519
2519
|
function b() {
|
|
2520
|
-
var
|
|
2520
|
+
var q, V;
|
|
2521
2521
|
if (!x.data || x.data.length === 0)
|
|
2522
2522
|
return;
|
|
2523
2523
|
const v = da({
|
|
@@ -2526,7 +2526,7 @@ function Un() {
|
|
|
2526
2526
|
cfg: x.cfg,
|
|
2527
2527
|
preferences: x.preferences
|
|
2528
2528
|
});
|
|
2529
|
-
v && (t(JSON.stringify(v, null, 1)), (
|
|
2529
|
+
v && (t(JSON.stringify(v, null, 1)), (q = x == null ? void 0 : x.preferences) != null && q.customVisualCode && i((V = x == null ? void 0 : x.preferences) == null ? void 0 : V.customVisualCode), y && h(JSON.stringify(y, null, 1)));
|
|
2530
2530
|
}
|
|
2531
2531
|
function f() {
|
|
2532
2532
|
if (o && l(o), !!r)
|
|
@@ -2540,16 +2540,16 @@ function Un() {
|
|
|
2540
2540
|
function N() {
|
|
2541
2541
|
h(""), g(null);
|
|
2542
2542
|
}
|
|
2543
|
-
function
|
|
2543
|
+
function O() {
|
|
2544
2544
|
let v;
|
|
2545
2545
|
if (y) {
|
|
2546
|
-
const
|
|
2547
|
-
return v = u(
|
|
2546
|
+
const q = Ps.cloneDeep(x.cfg), V = Ps.merge(q, y);
|
|
2547
|
+
return v = u(V), v;
|
|
2548
2548
|
}
|
|
2549
2549
|
return a ? (v = u(JSON.parse(a)), v) : "";
|
|
2550
2550
|
}
|
|
2551
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2552
|
-
/* @__PURE__ */ e.jsx(
|
|
2551
|
+
return /* @__PURE__ */ e.jsxs(gs, { open: s, onOpenChange: n, children: [
|
|
2552
|
+
/* @__PURE__ */ e.jsx(js, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2553
2553
|
z,
|
|
2554
2554
|
{
|
|
2555
2555
|
onClick: b,
|
|
@@ -2560,14 +2560,14 @@ function Un() {
|
|
|
2560
2560
|
}
|
|
2561
2561
|
) }),
|
|
2562
2562
|
/* @__PURE__ */ e.jsxs(
|
|
2563
|
-
|
|
2563
|
+
ys,
|
|
2564
2564
|
{
|
|
2565
2565
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2566
2566
|
children: [
|
|
2567
|
-
/* @__PURE__ */ e.jsxs(
|
|
2567
|
+
/* @__PURE__ */ e.jsxs(vs, { className: "", children: [
|
|
2568
2568
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2569
|
-
/* @__PURE__ */ e.jsx(
|
|
2570
|
-
/* @__PURE__ */ e.jsxs(
|
|
2569
|
+
/* @__PURE__ */ e.jsx(Ns, { children: "Customize Card" }),
|
|
2570
|
+
/* @__PURE__ */ e.jsxs(Ss, { children: [
|
|
2571
2571
|
/* @__PURE__ */ e.jsx(sa, { children: /* @__PURE__ */ e.jsx(
|
|
2572
2572
|
dn,
|
|
2573
2573
|
{
|
|
@@ -2577,10 +2577,10 @@ function Un() {
|
|
|
2577
2577
|
className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
|
|
2578
2578
|
}
|
|
2579
2579
|
) }),
|
|
2580
|
-
/* @__PURE__ */ e.jsx(
|
|
2580
|
+
/* @__PURE__ */ e.jsx(ks, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
|
|
2581
2581
|
] })
|
|
2582
2582
|
] }),
|
|
2583
|
-
/* @__PURE__ */ e.jsxs(
|
|
2583
|
+
/* @__PURE__ */ e.jsxs(Cs, { children: [
|
|
2584
2584
|
"See the configuration options and documentation",
|
|
2585
2585
|
/* @__PURE__ */ e.jsx(
|
|
2586
2586
|
"a",
|
|
@@ -2642,7 +2642,7 @@ function Un() {
|
|
|
2642
2642
|
renderLineHighlight: "none"
|
|
2643
2643
|
},
|
|
2644
2644
|
defaultLanguage: "json",
|
|
2645
|
-
value:
|
|
2645
|
+
value: O(),
|
|
2646
2646
|
onChange: (v) => h(v)
|
|
2647
2647
|
}
|
|
2648
2648
|
)
|
|
@@ -2680,7 +2680,7 @@ function Un() {
|
|
|
2680
2680
|
] })
|
|
2681
2681
|
] }),
|
|
2682
2682
|
/* @__PURE__ */ e.jsxs(Zs, { className: "flex items-center", children: [
|
|
2683
|
-
/* @__PURE__ */ e.jsx(
|
|
2683
|
+
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: d }),
|
|
2684
2684
|
/* @__PURE__ */ e.jsx(
|
|
2685
2685
|
z,
|
|
2686
2686
|
{
|
|
@@ -2699,28 +2699,28 @@ function Un() {
|
|
|
2699
2699
|
] });
|
|
2700
2700
|
}
|
|
2701
2701
|
function ka(s) {
|
|
2702
|
-
return
|
|
2702
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2703
2703
|
}
|
|
2704
2704
|
function wa(s) {
|
|
2705
|
-
return
|
|
2705
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
|
|
2706
2706
|
}
|
|
2707
2707
|
function za(s) {
|
|
2708
|
-
return
|
|
2708
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2709
2709
|
}
|
|
2710
2710
|
function Fa(s) {
|
|
2711
|
-
return
|
|
2711
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2712
2712
|
}
|
|
2713
2713
|
function Oa(s) {
|
|
2714
|
-
return
|
|
2714
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
2715
2715
|
}
|
|
2716
2716
|
function Ma(s) {
|
|
2717
|
-
return
|
|
2717
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
|
|
2718
2718
|
}
|
|
2719
2719
|
function Ta(s) {
|
|
2720
|
-
return
|
|
2720
|
+
return xe({ tag: "svg", 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: [] }] })(s);
|
|
2721
2721
|
}
|
|
2722
2722
|
function Aa(s) {
|
|
2723
|
-
return
|
|
2723
|
+
return xe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
|
|
2724
2724
|
}
|
|
2725
2725
|
function Qn() {
|
|
2726
2726
|
const [s, n] = T(!1), a = c((d) => d.card.type), { setCardType: t, setCardPreferences: r, setChartOrientation: h } = c((d) => d.actions), o = c(
|
|
@@ -2729,9 +2729,9 @@ function Qn() {
|
|
|
2729
2729
|
function i(d) {
|
|
2730
2730
|
o(null), r({}), t(d), n(!1);
|
|
2731
2731
|
}
|
|
2732
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2733
|
-
/* @__PURE__ */ e.jsx(
|
|
2734
|
-
/* @__PURE__ */ e.jsx(
|
|
2732
|
+
return /* @__PURE__ */ e.jsxs(ts, { open: s, onOpenChange: n, children: [
|
|
2733
|
+
/* @__PURE__ */ e.jsx(ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Wn, { className: "h-4 w-4", chartType: a }) }) }),
|
|
2734
|
+
/* @__PURE__ */ e.jsx(ls, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2735
2735
|
/* @__PURE__ */ e.jsx(
|
|
2736
2736
|
z,
|
|
2737
2737
|
{
|
|
@@ -2840,7 +2840,7 @@ function Qn() {
|
|
|
2840
2840
|
{
|
|
2841
2841
|
onClick: () => i("table"),
|
|
2842
2842
|
variant: "ghost",
|
|
2843
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2843
|
+
children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
|
|
2844
2844
|
}
|
|
2845
2845
|
),
|
|
2846
2846
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2893,13 +2893,13 @@ function Wn({ chartType: s, className: n }) {
|
|
|
2893
2893
|
case "text":
|
|
2894
2894
|
return /* @__PURE__ */ e.jsx(Is, { className: n });
|
|
2895
2895
|
default:
|
|
2896
|
-
return /* @__PURE__ */ e.jsx(
|
|
2896
|
+
return /* @__PURE__ */ e.jsx(ws, { className: n });
|
|
2897
2897
|
}
|
|
2898
2898
|
}
|
|
2899
2899
|
function Ws() {
|
|
2900
2900
|
const s = c((f) => f.frame), n = c((f) => f.card), a = c((f) => f.card.data), t = c((f) => f.isShowingVisual), r = c((f) => f.isSqlRunning), h = c((f) => f.queryError), o = c((f) => f.pythonStdOut), i = c((f) => f.actions.setRunSql);
|
|
2901
2901
|
c((f) => f.onSave), c((f) => f.onClose), c((f) => f.actions.setCardSql), c((f) => f.actions.setCardType), c((f) => f.actions.setSqlGen);
|
|
2902
|
-
const { setFrame: d, setCard: m, updateCardInFrame: x } =
|
|
2902
|
+
const { setFrame: d, setCard: m, updateCardInFrame: x } = as();
|
|
2903
2903
|
if (!n)
|
|
2904
2904
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2905
2905
|
function y() {
|
|
@@ -2926,13 +2926,13 @@ function Ws() {
|
|
|
2926
2926
|
d(N), m(f);
|
|
2927
2927
|
}
|
|
2928
2928
|
function g(f) {
|
|
2929
|
-
const N = s.cards.filter((
|
|
2929
|
+
const N = s.cards.filter((q) => q.id !== f), O = N[0], v = {
|
|
2930
2930
|
...s,
|
|
2931
2931
|
cards: N,
|
|
2932
2932
|
// update the active card to the first card in the frame
|
|
2933
|
-
activeCardId:
|
|
2933
|
+
activeCardId: O.id
|
|
2934
2934
|
};
|
|
2935
|
-
d(v), m(
|
|
2935
|
+
d(v), m(O);
|
|
2936
2936
|
}
|
|
2937
2937
|
function l(f) {
|
|
2938
2938
|
const N = {
|
|
@@ -2941,8 +2941,8 @@ function Ws() {
|
|
|
2941
2941
|
activeCardId: f
|
|
2942
2942
|
};
|
|
2943
2943
|
d(N);
|
|
2944
|
-
const
|
|
2945
|
-
m(
|
|
2944
|
+
const O = N.cards.find((v) => v.id === f);
|
|
2945
|
+
m(O), O.sql && (console.log("newActiveCard.sql", O.sql), O.data && O.data.length === 0 && i(!0));
|
|
2946
2946
|
}
|
|
2947
2947
|
function u() {
|
|
2948
2948
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -2980,7 +2980,7 @@ function Ws() {
|
|
|
2980
2980
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
2981
2981
|
variant: "outline",
|
|
2982
2982
|
onClick: y,
|
|
2983
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2983
|
+
children: /* @__PURE__ */ e.jsx(bs, { className: "h-4 w-4" })
|
|
2984
2984
|
}
|
|
2985
2985
|
)
|
|
2986
2986
|
] }) })
|
|
@@ -3029,7 +3029,7 @@ function Zn() {
|
|
|
3029
3029
|
(a) => a.actions.setIsShowingVisual
|
|
3030
3030
|
);
|
|
3031
3031
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3032
|
-
/* @__PURE__ */ e.jsx(
|
|
3032
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
|
|
3033
3033
|
/* @__PURE__ */ e.jsx(
|
|
3034
3034
|
Ot,
|
|
3035
3035
|
{
|
|
@@ -3041,7 +3041,7 @@ function Zn() {
|
|
|
3041
3041
|
)
|
|
3042
3042
|
] });
|
|
3043
3043
|
}
|
|
3044
|
-
function
|
|
3044
|
+
function De() {
|
|
3045
3045
|
const [s, n] = T([]);
|
|
3046
3046
|
c(
|
|
3047
3047
|
(x) => x.card.cfg
|
|
@@ -3101,7 +3101,7 @@ function Ae() {
|
|
|
3101
3101
|
var y, g, l, u;
|
|
3102
3102
|
if (s != null && s[x] || (g = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((b) => b.columnIndex === x)) != null && g.expression)
|
|
3103
3103
|
return /* @__PURE__ */ e.jsx(
|
|
3104
|
-
|
|
3104
|
+
de,
|
|
3105
3105
|
{
|
|
3106
3106
|
value: (u = (l = a == null ? void 0 : a.onClickFilter) == null ? void 0 : l.find((b) => b.columnIndex === x)) == null ? void 0 : u.expression,
|
|
3107
3107
|
onChange: (b) => d(x, b),
|
|
@@ -3112,7 +3112,7 @@ function Ae() {
|
|
|
3112
3112
|
);
|
|
3113
3113
|
}
|
|
3114
3114
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3115
|
-
/* @__PURE__ */ e.jsx(
|
|
3115
|
+
/* @__PURE__ */ e.jsx(H, { children: "On Click" }),
|
|
3116
3116
|
o == null ? void 0 : o.map((x, y) => {
|
|
3117
3117
|
var g, l;
|
|
3118
3118
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -3160,7 +3160,7 @@ function Ae() {
|
|
|
3160
3160
|
})
|
|
3161
3161
|
] });
|
|
3162
3162
|
}
|
|
3163
|
-
function
|
|
3163
|
+
function rs() {
|
|
3164
3164
|
var o, i, d;
|
|
3165
3165
|
const s = c((m) => m.card.preferences), n = c(
|
|
3166
3166
|
(m) => m.card.cfg
|
|
@@ -3178,59 +3178,59 @@ function ls() {
|
|
|
3178
3178
|
defaultValue: "x",
|
|
3179
3179
|
children: [
|
|
3180
3180
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3181
|
-
/* @__PURE__ */ e.jsx(
|
|
3181
|
+
/* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
|
|
3182
3182
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
|
|
3183
3183
|
] }),
|
|
3184
3184
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3185
|
-
/* @__PURE__ */ e.jsx(
|
|
3185
|
+
/* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
|
|
3186
3186
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
|
|
3187
3187
|
] })
|
|
3188
3188
|
]
|
|
3189
3189
|
}
|
|
3190
3190
|
);
|
|
3191
3191
|
}
|
|
3192
|
-
const
|
|
3192
|
+
const Ce = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3193
3193
|
function Ys(s, n) {
|
|
3194
3194
|
var t, r, h;
|
|
3195
3195
|
const a = pa(s, n);
|
|
3196
3196
|
return ((h = (r = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : r[a]) == null ? void 0 : h.type) || "linear";
|
|
3197
3197
|
}
|
|
3198
3198
|
function Da() {
|
|
3199
|
-
var
|
|
3200
|
-
const [s, n] = T(!1), a = c((
|
|
3201
|
-
var
|
|
3202
|
-
return (
|
|
3203
|
-
}), t = c((
|
|
3204
|
-
var
|
|
3205
|
-
return (
|
|
3199
|
+
var le, J, re, S, M, Y;
|
|
3200
|
+
const [s, n] = T(!1), a = c((w) => {
|
|
3201
|
+
var I;
|
|
3202
|
+
return (I = w.card) == null ? void 0 : I.preferences;
|
|
3203
|
+
}), t = c((w) => {
|
|
3204
|
+
var I;
|
|
3205
|
+
return (I = w.card) == null ? void 0 : I.cfg;
|
|
3206
3206
|
}), r = pa(a, t), [h, o] = T(
|
|
3207
3207
|
Ys(a)
|
|
3208
3208
|
), [i, d] = T(
|
|
3209
|
-
((
|
|
3209
|
+
((re = (J = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : J[r]) == null ? void 0 : re.min) || ""
|
|
3210
3210
|
), [m, x] = T(
|
|
3211
|
-
((
|
|
3212
|
-
), [y, g] = T(i || m ? "custom" : "auto"), [l, u] = T(""), [b, f] = T(0), [N,
|
|
3213
|
-
(
|
|
3214
|
-
),
|
|
3215
|
-
var
|
|
3216
|
-
return (
|
|
3217
|
-
}),
|
|
3211
|
+
((Y = (M = (S = a == null ? void 0 : a.chartOptions) == null ? void 0 : S.scales) == null ? void 0 : M[r]) == null ? void 0 : Y.max) || ""
|
|
3212
|
+
), [y, g] = T(i || m ? "custom" : "auto"), [l, u] = T(""), [b, f] = T(0), [N, O] = T(""), [v, q] = T(""), [V, _] = T(""), A = c(
|
|
3213
|
+
(w) => w.actions.setCardPreferences
|
|
3214
|
+
), { updateCardInFrame: C } = as(), F = c((w) => w.card), R = c((w) => {
|
|
3215
|
+
var I;
|
|
3216
|
+
return (I = w.card) == null ? void 0 : I.type;
|
|
3217
|
+
}), B = ["pie", "doughnut", "polarArea"].includes(R);
|
|
3218
3218
|
Q(() => {
|
|
3219
|
-
var
|
|
3219
|
+
var w, I, ee, E, se, te, je, pe, W, ie, oe, be, ce, fe;
|
|
3220
3220
|
o(Ys(a)), d(
|
|
3221
|
-
((
|
|
3222
|
-
), x(((
|
|
3223
|
-
((
|
|
3224
|
-
), f(((
|
|
3221
|
+
((ee = (I = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : I[r]) == null ? void 0 : ee.min) === 0 ? 0 : ""
|
|
3222
|
+
), x(((te = (se = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : se[r]) == null ? void 0 : te.max) || ""), u(
|
|
3223
|
+
((ie = (W = (pe = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : pe[r]) == null ? void 0 : W.ticks) == null ? void 0 : ie.stepSize) || ""
|
|
3224
|
+
), f(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.decimalPlaces) || 0), O(((be = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : be.suffix) || ""), q(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), _(((fe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : fe.locale) || "");
|
|
3225
3225
|
}, [s, a, r]);
|
|
3226
|
-
function
|
|
3227
|
-
return
|
|
3226
|
+
function L(w, I) {
|
|
3227
|
+
return I === "" || /^[0-9\b]+$/.test(I) ? Number(I) : Number(w);
|
|
3228
3228
|
}
|
|
3229
|
-
function
|
|
3229
|
+
function $() {
|
|
3230
3230
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3231
3231
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
3232
3232
|
/* @__PURE__ */ e.jsx(
|
|
3233
|
-
|
|
3233
|
+
H,
|
|
3234
3234
|
{
|
|
3235
3235
|
className: "col-span-2 hover:cursor-pointer hover:underline",
|
|
3236
3236
|
htmlFor: "currency",
|
|
@@ -3245,97 +3245,97 @@ function Da() {
|
|
|
3245
3245
|
}
|
|
3246
3246
|
),
|
|
3247
3247
|
/* @__PURE__ */ e.jsx(
|
|
3248
|
-
|
|
3248
|
+
de,
|
|
3249
3249
|
{
|
|
3250
3250
|
value: v,
|
|
3251
3251
|
placeholder: "USD",
|
|
3252
|
-
onChange: (
|
|
3252
|
+
onChange: (w) => q(w.target.value),
|
|
3253
3253
|
id: "currency",
|
|
3254
|
-
className: `col-span-2 h-8 w-full ${
|
|
3254
|
+
className: `col-span-2 h-8 w-full ${Ce}`
|
|
3255
3255
|
}
|
|
3256
3256
|
),
|
|
3257
3257
|
/* @__PURE__ */ e.jsx(
|
|
3258
|
-
|
|
3258
|
+
de,
|
|
3259
3259
|
{
|
|
3260
|
-
value:
|
|
3260
|
+
value: V,
|
|
3261
3261
|
placeholder: "en-US",
|
|
3262
|
-
onChange: (
|
|
3262
|
+
onChange: (w) => _(w.target.value),
|
|
3263
3263
|
id: "locale",
|
|
3264
|
-
className: `col-span-2 h-8 w-full ${
|
|
3264
|
+
className: `col-span-2 h-8 w-full ${Ce}`
|
|
3265
3265
|
}
|
|
3266
3266
|
)
|
|
3267
3267
|
] }),
|
|
3268
3268
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
|
|
3269
|
-
/* @__PURE__ */ e.jsx(
|
|
3269
|
+
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
|
|
3270
3270
|
/* @__PURE__ */ e.jsx(
|
|
3271
|
-
|
|
3271
|
+
de,
|
|
3272
3272
|
{
|
|
3273
3273
|
value: b,
|
|
3274
|
-
onChange: (
|
|
3274
|
+
onChange: (w) => f(Number(w.target.value)),
|
|
3275
3275
|
id: "format",
|
|
3276
|
-
className: `col-span-6 h-8 w-full tracking-wide ${
|
|
3276
|
+
className: `col-span-6 h-8 w-full tracking-wide ${Ce}`
|
|
3277
3277
|
}
|
|
3278
3278
|
)
|
|
3279
3279
|
] })
|
|
3280
3280
|
] });
|
|
3281
3281
|
}
|
|
3282
|
-
function
|
|
3282
|
+
function X() {
|
|
3283
3283
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3284
3284
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3285
|
-
/* @__PURE__ */ e.jsx(
|
|
3285
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
|
|
3286
3286
|
/* @__PURE__ */ e.jsx(
|
|
3287
|
-
|
|
3287
|
+
de,
|
|
3288
3288
|
{
|
|
3289
3289
|
id: "min",
|
|
3290
3290
|
value: i,
|
|
3291
|
-
onChange: (
|
|
3292
|
-
className: `col-span-1 h-8 w-full ${
|
|
3291
|
+
onChange: (w) => d((I) => L(I, w.target.value)),
|
|
3292
|
+
className: `col-span-1 h-8 w-full ${Ce}`
|
|
3293
3293
|
}
|
|
3294
3294
|
),
|
|
3295
3295
|
/* @__PURE__ */ e.jsx(
|
|
3296
|
-
|
|
3296
|
+
de,
|
|
3297
3297
|
{
|
|
3298
3298
|
value: m,
|
|
3299
|
-
onChange: (
|
|
3299
|
+
onChange: (w) => x((I) => L(I, w.target.value)),
|
|
3300
3300
|
id: "max",
|
|
3301
|
-
className: `col-span-1 h-8 w-full ${
|
|
3301
|
+
className: `col-span-1 h-8 w-full ${Ce}`
|
|
3302
3302
|
}
|
|
3303
3303
|
)
|
|
3304
3304
|
] }),
|
|
3305
3305
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3306
|
-
/* @__PURE__ */ e.jsx(
|
|
3306
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
|
|
3307
3307
|
/* @__PURE__ */ e.jsx(
|
|
3308
|
-
|
|
3308
|
+
de,
|
|
3309
3309
|
{
|
|
3310
3310
|
value: l,
|
|
3311
|
-
onChange: (
|
|
3311
|
+
onChange: (w) => u((I) => L(I, w.target.value)),
|
|
3312
3312
|
id: "step-size",
|
|
3313
|
-
className: `col-span-1 h-8 w-full ${
|
|
3313
|
+
className: `col-span-1 h-8 w-full ${Ce}`
|
|
3314
3314
|
}
|
|
3315
3315
|
)
|
|
3316
3316
|
] })
|
|
3317
3317
|
] });
|
|
3318
3318
|
}
|
|
3319
|
-
function
|
|
3320
|
-
var
|
|
3321
|
-
let
|
|
3322
|
-
y === "custom" && (
|
|
3319
|
+
function U() {
|
|
3320
|
+
var E;
|
|
3321
|
+
let w = {};
|
|
3322
|
+
y === "custom" && (w = {
|
|
3323
3323
|
min: i,
|
|
3324
3324
|
max: m,
|
|
3325
3325
|
ticks: {
|
|
3326
3326
|
stepSize: l
|
|
3327
3327
|
}
|
|
3328
3328
|
});
|
|
3329
|
-
const
|
|
3329
|
+
const I = {
|
|
3330
3330
|
...a || {},
|
|
3331
3331
|
chartOptions: {
|
|
3332
3332
|
...a == null ? void 0 : a.chartOptions,
|
|
3333
3333
|
scales: {
|
|
3334
|
-
...(
|
|
3334
|
+
...(E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales,
|
|
3335
3335
|
[r]: {
|
|
3336
3336
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3337
3337
|
type: h,
|
|
3338
|
-
...h === "linear" ?
|
|
3338
|
+
...h === "linear" ? w : {}
|
|
3339
3339
|
}
|
|
3340
3340
|
}
|
|
3341
3341
|
},
|
|
@@ -3343,69 +3343,74 @@ function Da() {
|
|
|
3343
3343
|
decimalPlaces: b,
|
|
3344
3344
|
suffix: N,
|
|
3345
3345
|
currency: v,
|
|
3346
|
-
locale:
|
|
3346
|
+
locale: V
|
|
3347
3347
|
}
|
|
3348
3348
|
};
|
|
3349
|
-
console.log(
|
|
3349
|
+
console.log(I), A(I);
|
|
3350
|
+
const ee = {
|
|
3351
|
+
...F,
|
|
3352
|
+
preferences: I
|
|
3353
|
+
};
|
|
3354
|
+
C(ee);
|
|
3350
3355
|
}
|
|
3351
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3352
|
-
/* @__PURE__ */ e.jsx(
|
|
3353
|
-
/* @__PURE__ */ e.jsx(
|
|
3356
|
+
return /* @__PURE__ */ e.jsxs(ts, { onOpenChange: (w) => n(w), children: [
|
|
3357
|
+
/* @__PURE__ */ e.jsx(ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3358
|
+
/* @__PURE__ */ e.jsx(ls, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3354
3359
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3355
3360
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3356
3361
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
3357
3362
|
] }),
|
|
3358
3363
|
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
|
|
3359
3364
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3360
|
-
/* @__PURE__ */ e.jsx(
|
|
3365
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
|
|
3361
3366
|
/* @__PURE__ */ e.jsxs(
|
|
3362
|
-
|
|
3367
|
+
ke,
|
|
3363
3368
|
{
|
|
3364
|
-
disabled:
|
|
3369
|
+
disabled: B,
|
|
3365
3370
|
value: h,
|
|
3366
|
-
onValueChange: (
|
|
3371
|
+
onValueChange: (w) => o(w),
|
|
3367
3372
|
children: [
|
|
3368
|
-
/* @__PURE__ */ e.jsx(
|
|
3369
|
-
/* @__PURE__ */ e.jsx(
|
|
3370
|
-
/* @__PURE__ */ e.jsx(
|
|
3371
|
-
/* @__PURE__ */ e.jsx(
|
|
3372
|
-
/* @__PURE__ */ e.jsx(
|
|
3373
|
+
/* @__PURE__ */ e.jsx(we, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(ze, {}) }),
|
|
3374
|
+
/* @__PURE__ */ e.jsx(Fe, { id: "type", children: /* @__PURE__ */ e.jsxs(_e, { children: [
|
|
3375
|
+
/* @__PURE__ */ e.jsx(Me, { children: "Option" }),
|
|
3376
|
+
/* @__PURE__ */ e.jsx(ae, { value: "linear", children: "Linear" }),
|
|
3377
|
+
/* @__PURE__ */ e.jsx(ae, { value: "logarithmic", children: "Logarithmic" })
|
|
3373
3378
|
] }) })
|
|
3374
3379
|
]
|
|
3375
3380
|
}
|
|
3376
3381
|
)
|
|
3377
3382
|
] }),
|
|
3378
3383
|
h == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3379
|
-
/* @__PURE__ */ e.jsx(
|
|
3384
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
|
|
3380
3385
|
/* @__PURE__ */ e.jsxs(
|
|
3381
3386
|
Ts,
|
|
3382
3387
|
{
|
|
3383
|
-
disabled:
|
|
3388
|
+
disabled: B,
|
|
3384
3389
|
id: "scale-option",
|
|
3385
3390
|
value: y,
|
|
3386
|
-
onValueChange: (
|
|
3391
|
+
onValueChange: (w) => g(w),
|
|
3387
3392
|
className: "col-span-2 flex gap-3",
|
|
3388
3393
|
defaultValue: "x",
|
|
3389
3394
|
children: [
|
|
3390
3395
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3391
|
-
/* @__PURE__ */ e.jsx(
|
|
3396
|
+
/* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
|
|
3392
3397
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
|
|
3393
3398
|
] }),
|
|
3394
3399
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3395
|
-
/* @__PURE__ */ e.jsx(
|
|
3400
|
+
/* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
|
|
3396
3401
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
|
|
3397
3402
|
] })
|
|
3398
3403
|
]
|
|
3399
3404
|
}
|
|
3400
3405
|
)
|
|
3401
3406
|
] }),
|
|
3402
|
-
y === "custom" && h == "linear" &&
|
|
3403
|
-
|
|
3407
|
+
y === "custom" && h == "linear" && X(),
|
|
3408
|
+
$(),
|
|
3404
3409
|
/* @__PURE__ */ e.jsx(Tt, {}),
|
|
3405
3410
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3406
3411
|
z,
|
|
3407
3412
|
{
|
|
3408
|
-
onClick:
|
|
3413
|
+
onClick: U,
|
|
3409
3414
|
variant: "secondary",
|
|
3410
3415
|
className: "col-span-1 col-start-3 h-8 w-full",
|
|
3411
3416
|
children: "Apply"
|
|
@@ -3459,9 +3464,9 @@ function Xn({ idx: s }) {
|
|
|
3459
3464
|
});
|
|
3460
3465
|
}
|
|
3461
3466
|
}
|
|
3462
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3463
|
-
/* @__PURE__ */ e.jsx(
|
|
3464
|
-
/* @__PURE__ */ e.jsx(
|
|
3467
|
+
return /* @__PURE__ */ e.jsxs(ts, { children: [
|
|
3468
|
+
/* @__PURE__ */ e.jsx(ns, { children: /* @__PURE__ */ e.jsx(Nn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
3469
|
+
/* @__PURE__ */ e.jsx(ls, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3465
3470
|
/* @__PURE__ */ e.jsx(
|
|
3466
3471
|
z,
|
|
3467
3472
|
{
|
|
@@ -3536,7 +3541,7 @@ function La() {
|
|
|
3536
3541
|
keys: r,
|
|
3537
3542
|
metricKeys: h,
|
|
3538
3543
|
dimensionKeys: o
|
|
3539
|
-
} =
|
|
3544
|
+
} = xs(s.data || []);
|
|
3540
3545
|
let i = h;
|
|
3541
3546
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
3542
3547
|
const d = Lt({
|
|
@@ -3544,17 +3549,17 @@ function La() {
|
|
|
3544
3549
|
groupKey: o[0],
|
|
3545
3550
|
pivotKey: o[1],
|
|
3546
3551
|
valueKey: i[0]
|
|
3547
|
-
}), { metricKeys: m } =
|
|
3552
|
+
}), { metricKeys: m } = xs(d);
|
|
3548
3553
|
i = m;
|
|
3549
3554
|
}
|
|
3550
3555
|
return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3551
3556
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3552
|
-
/* @__PURE__ */ e.jsx(
|
|
3557
|
+
/* @__PURE__ */ e.jsx(H, { children: a }),
|
|
3553
3558
|
/* @__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] }) }) })
|
|
3554
3559
|
] }),
|
|
3555
3560
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3556
3561
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3557
|
-
/* @__PURE__ */ e.jsx(
|
|
3562
|
+
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
3558
3563
|
/* @__PURE__ */ e.jsx(Da, {})
|
|
3559
3564
|
] }),
|
|
3560
3565
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: i.map((d, m) => /* @__PURE__ */ e.jsx(el, { col: d, idx: m }, d)) })
|
|
@@ -3632,25 +3637,25 @@ function el({ col: s, idx: n }) {
|
|
|
3632
3637
|
] });
|
|
3633
3638
|
}
|
|
3634
3639
|
function Ia() {
|
|
3635
|
-
const s = c((g) => g.selectedConnectionId), n = c((g) => g.selectedDatamodelId), a = c((g) => g.selectedDatabaseName), t = c((g) => g.selectedSchemaName), r = c((g) => g.selectedTableName), h =
|
|
3640
|
+
const s = c((g) => g.selectedConnectionId), n = c((g) => g.selectedDatamodelId), a = c((g) => g.selectedDatabaseName), t = c((g) => g.selectedSchemaName), r = c((g) => g.selectedTableName), h = k((g) => g.dashboard.filters) || [], o = k((g) => g.actions.addFilter), i = k((g) => g.actions.removeFilter), d = k(
|
|
3636
3641
|
(g) => g.actions.removeFilterValue
|
|
3637
|
-
), { modelItems: m, tableName: x } =
|
|
3642
|
+
), { modelItems: m, tableName: x } = Ae();
|
|
3638
3643
|
function y(g, l = "dashboard") {
|
|
3639
|
-
var
|
|
3640
|
-
const u =
|
|
3641
|
-
let
|
|
3644
|
+
var _;
|
|
3645
|
+
const u = me(g.column_name), b = me(a || ""), f = me(t || ""), N = me(x);
|
|
3646
|
+
let O = ra(
|
|
3642
3647
|
f,
|
|
3643
3648
|
N
|
|
3644
|
-
), v = `${
|
|
3645
|
-
const
|
|
3649
|
+
), v = `${O}.${u}`;
|
|
3650
|
+
const q = (_ = m == null ? void 0 : m.find(
|
|
3646
3651
|
(A) => A.id === n
|
|
3647
|
-
)) == null ? void 0 :
|
|
3648
|
-
n && n !== "none" && (v = `${
|
|
3649
|
-
const
|
|
3652
|
+
)) == null ? void 0 : _.name;
|
|
3653
|
+
n && n !== "none" && (v = `${us}.${q}.${u}`, O = `${us}.${q}`);
|
|
3654
|
+
const V = h == null ? void 0 : h.find(
|
|
3650
3655
|
(A) => A.column === v && A.table === N && (A.database === b || A.database === a)
|
|
3651
3656
|
);
|
|
3652
|
-
if (
|
|
3653
|
-
d(
|
|
3657
|
+
if (V)
|
|
3658
|
+
d(V.id), i(V.id);
|
|
3654
3659
|
else {
|
|
3655
3660
|
const A = Xe();
|
|
3656
3661
|
return x === "api" && s ? (o({
|
|
@@ -3667,7 +3672,7 @@ function Ia() {
|
|
|
3667
3672
|
operation: "in",
|
|
3668
3673
|
sql: Ks(
|
|
3669
3674
|
g.data_type,
|
|
3670
|
-
|
|
3675
|
+
O,
|
|
3671
3676
|
u
|
|
3672
3677
|
)
|
|
3673
3678
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
@@ -3685,7 +3690,7 @@ function Ia() {
|
|
|
3685
3690
|
operation: "in",
|
|
3686
3691
|
sql: Ks(
|
|
3687
3692
|
g.data_type,
|
|
3688
|
-
|
|
3693
|
+
O,
|
|
3689
3694
|
u
|
|
3690
3695
|
)
|
|
3691
3696
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
@@ -3694,17 +3699,17 @@ function Ia() {
|
|
|
3694
3699
|
}
|
|
3695
3700
|
return { assignFilter: y };
|
|
3696
3701
|
}
|
|
3697
|
-
function
|
|
3698
|
-
const s =
|
|
3702
|
+
function Le() {
|
|
3703
|
+
const s = k(
|
|
3699
3704
|
(i) => i.dashboard.filters
|
|
3700
|
-
), n = c((i) => i.frame), { setFrame: a } =
|
|
3705
|
+
), n = c((i) => i.frame), { setFrame: a } = as(), { columns: t } = Ae(), { assignFilter: r } = Ia();
|
|
3701
3706
|
function h(i) {
|
|
3702
3707
|
const d = r(i, "frame");
|
|
3703
3708
|
a({ ...n, filterId: d });
|
|
3704
3709
|
}
|
|
3705
3710
|
const o = s == null ? void 0 : s.find((i) => i.id === n.filterId);
|
|
3706
3711
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3707
|
-
/* @__PURE__ */ e.jsx(
|
|
3712
|
+
/* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
|
|
3708
3713
|
/* @__PURE__ */ e.jsx(sl, { onSelect: h, columns: t }),
|
|
3709
3714
|
o && /* @__PURE__ */ e.jsx(It, { filter: o })
|
|
3710
3715
|
] });
|
|
@@ -3715,8 +3720,8 @@ function sl({
|
|
|
3715
3720
|
}) {
|
|
3716
3721
|
var o;
|
|
3717
3722
|
const [a, t] = Js.useState(!1), [r, h] = Js.useState("");
|
|
3718
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3719
|
-
/* @__PURE__ */ e.jsx(
|
|
3723
|
+
return /* @__PURE__ */ e.jsxs(ts, { open: a, onOpenChange: t, children: [
|
|
3724
|
+
/* @__PURE__ */ e.jsx(ns, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3720
3725
|
z,
|
|
3721
3726
|
{
|
|
3722
3727
|
size: "sm",
|
|
@@ -3730,7 +3735,7 @@ function sl({
|
|
|
3730
3735
|
]
|
|
3731
3736
|
}
|
|
3732
3737
|
) }),
|
|
3733
|
-
/* @__PURE__ */ e.jsx(
|
|
3738
|
+
/* @__PURE__ */ e.jsx(ls, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(qt, { children: [
|
|
3734
3739
|
/* @__PURE__ */ e.jsx(Vt, { placeholder: "Search column", className: "h-9" }),
|
|
3735
3740
|
/* @__PURE__ */ e.jsxs(_t, { children: [
|
|
3736
3741
|
/* @__PURE__ */ e.jsx(Rt, { children: "No framework found." }),
|
|
@@ -3764,7 +3769,7 @@ function sl({
|
|
|
3764
3769
|
function al({
|
|
3765
3770
|
cardType: s
|
|
3766
3771
|
}) {
|
|
3767
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
3772
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3768
3773
|
/* @__PURE__ */ e.jsxs(P, { value: "item-1", children: [
|
|
3769
3774
|
/* @__PURE__ */ e.jsx(K, { children: `${As(s)} Chart` }),
|
|
3770
3775
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -3793,15 +3798,15 @@ function al({
|
|
|
3793
3798
|
/* @__PURE__ */ e.jsxs(P, { value: "item-2", children: [
|
|
3794
3799
|
/* @__PURE__ */ e.jsx(K, { children: "Settings" }),
|
|
3795
3800
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
3796
|
-
/* @__PURE__ */ e.jsx(
|
|
3801
|
+
/* @__PURE__ */ e.jsx(rs, {}),
|
|
3797
3802
|
/* @__PURE__ */ e.jsx(La, {})
|
|
3798
3803
|
] })
|
|
3799
3804
|
] }),
|
|
3800
3805
|
/* @__PURE__ */ e.jsxs(P, { value: "item-3", children: [
|
|
3801
3806
|
/* @__PURE__ */ e.jsx(K, { children: "Filters" }),
|
|
3802
3807
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
3803
|
-
/* @__PURE__ */ e.jsx(
|
|
3804
|
-
/* @__PURE__ */ e.jsx(
|
|
3808
|
+
/* @__PURE__ */ e.jsx(De, {}),
|
|
3809
|
+
/* @__PURE__ */ e.jsx(Le, {})
|
|
3805
3810
|
] })
|
|
3806
3811
|
] })
|
|
3807
3812
|
] }) });
|
|
@@ -3838,19 +3843,19 @@ function Es() {
|
|
|
3838
3843
|
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Da, {})
|
|
3839
3844
|
] }),
|
|
3840
3845
|
/* @__PURE__ */ e.jsxs(
|
|
3841
|
-
|
|
3846
|
+
ke,
|
|
3842
3847
|
{
|
|
3843
3848
|
value: (o = (h = (r = s == null ? void 0 : s.options) == null ? void 0 : r.plugins) == null ? void 0 : h.datalabels) == null ? void 0 : o.anchor,
|
|
3844
3849
|
onValueChange: t,
|
|
3845
3850
|
defaultValue: "none",
|
|
3846
3851
|
children: [
|
|
3847
|
-
/* @__PURE__ */ e.jsx(
|
|
3848
|
-
/* @__PURE__ */ e.jsx(
|
|
3849
|
-
/* @__PURE__ */ e.jsx(
|
|
3850
|
-
/* @__PURE__ */ e.jsx(
|
|
3851
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
3852
|
-
/* @__PURE__ */ e.jsx(
|
|
3853
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
3852
|
+
/* @__PURE__ */ e.jsx(we, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(ze, { placeholder: "Select position" }) }),
|
|
3853
|
+
/* @__PURE__ */ e.jsx(Fe, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
|
|
3854
|
+
/* @__PURE__ */ e.jsx(Me, { children: "Data Labels" }),
|
|
3855
|
+
/* @__PURE__ */ e.jsx(ae, { value: "none", children: "None" }),
|
|
3856
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(ae, { value: "start", children: "Start" }),
|
|
3857
|
+
/* @__PURE__ */ e.jsx(ae, { value: "center", children: "Center" }),
|
|
3858
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(ae, { value: "end", children: "End" })
|
|
3854
3859
|
] }) })
|
|
3855
3860
|
]
|
|
3856
3861
|
}
|
|
@@ -3887,7 +3892,7 @@ function tl({
|
|
|
3887
3892
|
] })
|
|
3888
3893
|
] });
|
|
3889
3894
|
}
|
|
3890
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
3895
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3891
3896
|
/* @__PURE__ */ e.jsxs(P, { value: "item-1", children: [
|
|
3892
3897
|
/* @__PURE__ */ e.jsx(K, { children: `${As(s)} Chart` }),
|
|
3893
3898
|
/* @__PURE__ */ e.jsx(G, { className: "space-y-4 font-mono text-xs", children: n(s) })
|
|
@@ -3899,8 +3904,8 @@ function tl({
|
|
|
3899
3904
|
/* @__PURE__ */ e.jsxs(P, { value: "item-3", children: [
|
|
3900
3905
|
/* @__PURE__ */ e.jsx(K, { children: "Filters" }),
|
|
3901
3906
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
3902
|
-
/* @__PURE__ */ e.jsx(
|
|
3903
|
-
/* @__PURE__ */ e.jsx(
|
|
3907
|
+
/* @__PURE__ */ e.jsx(De, {}),
|
|
3908
|
+
/* @__PURE__ */ e.jsx(Le, {})
|
|
3904
3909
|
] })
|
|
3905
3910
|
] })
|
|
3906
3911
|
] }) });
|
|
@@ -3932,7 +3937,7 @@ function rl() {
|
|
|
3932
3937
|
const s = c((n) => n.card.type);
|
|
3933
3938
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
3934
3939
|
/* @__PURE__ */ e.jsx(
|
|
3935
|
-
|
|
3940
|
+
ve,
|
|
3936
3941
|
{
|
|
3937
3942
|
className: " ",
|
|
3938
3943
|
type: "single",
|
|
@@ -3940,11 +3945,11 @@ function rl() {
|
|
|
3940
3945
|
children: il(s)
|
|
3941
3946
|
}
|
|
3942
3947
|
),
|
|
3943
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3948
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(rs, {}) }),
|
|
3944
3949
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3945
3950
|
/* @__PURE__ */ e.jsx(Es, {}),
|
|
3946
|
-
/* @__PURE__ */ e.jsx(
|
|
3947
|
-
/* @__PURE__ */ e.jsx(
|
|
3951
|
+
/* @__PURE__ */ e.jsx(De, {}),
|
|
3952
|
+
/* @__PURE__ */ e.jsx(Le, {})
|
|
3948
3953
|
] })
|
|
3949
3954
|
] });
|
|
3950
3955
|
}
|
|
@@ -4097,15 +4102,15 @@ function ol() {
|
|
|
4097
4102
|
}
|
|
4098
4103
|
}
|
|
4099
4104
|
),
|
|
4100
|
-
/* @__PURE__ */ e.jsx(
|
|
4105
|
+
/* @__PURE__ */ e.jsx(H, { children: "Format Number" })
|
|
4101
4106
|
] }),
|
|
4102
4107
|
((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4103
4108
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
|
|
4104
4109
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4105
4110
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4106
|
-
/* @__PURE__ */ e.jsx(
|
|
4111
|
+
/* @__PURE__ */ e.jsx(H, { children: "Locale" }),
|
|
4107
4112
|
/* @__PURE__ */ e.jsxs(
|
|
4108
|
-
|
|
4113
|
+
ke,
|
|
4109
4114
|
{
|
|
4110
4115
|
value: t || "en-US",
|
|
4111
4116
|
onValueChange: (l) => {
|
|
@@ -4118,19 +4123,19 @@ function ol() {
|
|
|
4118
4123
|
);
|
|
4119
4124
|
},
|
|
4120
4125
|
children: [
|
|
4121
|
-
/* @__PURE__ */ e.jsx(
|
|
4122
|
-
/* @__PURE__ */ e.jsx(
|
|
4123
|
-
/* @__PURE__ */ e.jsx(
|
|
4124
|
-
Gs.map((l) => /* @__PURE__ */ e.jsx(
|
|
4126
|
+
/* @__PURE__ */ e.jsx(we, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(ze, {}) }),
|
|
4127
|
+
/* @__PURE__ */ e.jsx(Fe, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
|
|
4128
|
+
/* @__PURE__ */ e.jsx(Me, { children: "Format" }),
|
|
4129
|
+
Gs.map((l) => /* @__PURE__ */ e.jsx(ae, { value: l.locale, children: l.locale }, l.locale))
|
|
4125
4130
|
] }) })
|
|
4126
4131
|
]
|
|
4127
4132
|
}
|
|
4128
4133
|
)
|
|
4129
4134
|
] }),
|
|
4130
4135
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4131
|
-
/* @__PURE__ */ e.jsx(
|
|
4136
|
+
/* @__PURE__ */ e.jsx(H, { children: "Currency" }),
|
|
4132
4137
|
/* @__PURE__ */ e.jsxs(
|
|
4133
|
-
|
|
4138
|
+
ke,
|
|
4134
4139
|
{
|
|
4135
4140
|
value: r || "none",
|
|
4136
4141
|
onValueChange: (l) => {
|
|
@@ -4143,11 +4148,11 @@ function ol() {
|
|
|
4143
4148
|
);
|
|
4144
4149
|
},
|
|
4145
4150
|
children: [
|
|
4146
|
-
/* @__PURE__ */ e.jsx(
|
|
4147
|
-
/* @__PURE__ */ e.jsx(
|
|
4148
|
-
/* @__PURE__ */ e.jsx(
|
|
4149
|
-
/* @__PURE__ */ e.jsx(
|
|
4150
|
-
i.map((l) => /* @__PURE__ */ e.jsx(
|
|
4151
|
+
/* @__PURE__ */ e.jsx(we, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(ze, {}) }),
|
|
4152
|
+
/* @__PURE__ */ e.jsx(Fe, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
|
|
4153
|
+
/* @__PURE__ */ e.jsx(Me, { children: "Currency" }),
|
|
4154
|
+
/* @__PURE__ */ e.jsx(ae, { value: "none", children: "None" }, "none"),
|
|
4155
|
+
i.map((l) => /* @__PURE__ */ e.jsx(ae, { value: l, children: l }, l))
|
|
4151
4156
|
] }) })
|
|
4152
4157
|
]
|
|
4153
4158
|
}
|
|
@@ -4156,9 +4161,9 @@ function ol() {
|
|
|
4156
4161
|
] }),
|
|
4157
4162
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
4158
4163
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4159
|
-
/* @__PURE__ */ e.jsx(
|
|
4164
|
+
/* @__PURE__ */ e.jsx(H, { children: "Decimals" }),
|
|
4160
4165
|
/* @__PURE__ */ e.jsxs(
|
|
4161
|
-
|
|
4166
|
+
ke,
|
|
4162
4167
|
{
|
|
4163
4168
|
value: ((y = (x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) == null ? void 0 : y.toString()) || "0",
|
|
4164
4169
|
onValueChange: (l) => {
|
|
@@ -4171,16 +4176,16 @@ function ol() {
|
|
|
4171
4176
|
);
|
|
4172
4177
|
},
|
|
4173
4178
|
children: [
|
|
4174
|
-
/* @__PURE__ */ e.jsx(
|
|
4175
|
-
/* @__PURE__ */ e.jsx(
|
|
4179
|
+
/* @__PURE__ */ e.jsx(we, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(ze, {}) }),
|
|
4180
|
+
/* @__PURE__ */ e.jsx(Fe, { children: ["0", "1", "2", "3", "4"].map((l) => /* @__PURE__ */ e.jsx(ae, { value: l, children: l }, l)) })
|
|
4176
4181
|
]
|
|
4177
4182
|
}
|
|
4178
4183
|
)
|
|
4179
4184
|
] }),
|
|
4180
4185
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4181
|
-
/* @__PURE__ */ e.jsx(
|
|
4186
|
+
/* @__PURE__ */ e.jsx(H, { children: "Suffix" }),
|
|
4182
4187
|
/* @__PURE__ */ e.jsx(
|
|
4183
|
-
|
|
4188
|
+
de,
|
|
4184
4189
|
{
|
|
4185
4190
|
value: ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || "",
|
|
4186
4191
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
@@ -4212,7 +4217,7 @@ function ol() {
|
|
|
4212
4217
|
}
|
|
4213
4218
|
function cl() {
|
|
4214
4219
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4215
|
-
/* @__PURE__ */ e.jsx(
|
|
4220
|
+
/* @__PURE__ */ e.jsx(ve, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(P, { value: "item-1", children: [
|
|
4216
4221
|
/* @__PURE__ */ e.jsx(K, { className: "", children: "KPI Query" }),
|
|
4217
4222
|
/* @__PURE__ */ e.jsxs(G, { className: "font-mono", children: [
|
|
4218
4223
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -4262,11 +4267,11 @@ function dl() {
|
|
|
4262
4267
|
defaultValue: "x",
|
|
4263
4268
|
children: [
|
|
4264
4269
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4265
|
-
/* @__PURE__ */ e.jsx(
|
|
4270
|
+
/* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
|
|
4266
4271
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
|
|
4267
4272
|
] }),
|
|
4268
4273
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4269
|
-
/* @__PURE__ */ e.jsx(
|
|
4274
|
+
/* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
|
|
4270
4275
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
|
|
4271
4276
|
] })
|
|
4272
4277
|
]
|
|
@@ -4278,7 +4283,7 @@ function Qe({
|
|
|
4278
4283
|
docContent: n,
|
|
4279
4284
|
suffix: a = "Chart"
|
|
4280
4285
|
}) {
|
|
4281
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4286
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4282
4287
|
/* @__PURE__ */ e.jsxs(P, { value: "item-1", children: [
|
|
4283
4288
|
/* @__PURE__ */ e.jsx(K, { children: `${As(s)} ${a}` }),
|
|
4284
4289
|
/* @__PURE__ */ e.jsx(G, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -4306,7 +4311,7 @@ function Qe({
|
|
|
4306
4311
|
/* @__PURE__ */ e.jsxs(P, { value: "item-2", children: [
|
|
4307
4312
|
/* @__PURE__ */ e.jsx(K, { children: "Settings" }),
|
|
4308
4313
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4309
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
4314
|
+
s === "range" && /* @__PURE__ */ e.jsx(rs, {}),
|
|
4310
4315
|
s !== "text" && /* @__PURE__ */ e.jsx(Es, {}),
|
|
4311
4316
|
s === "text" && /* @__PURE__ */ e.jsx(dl, {})
|
|
4312
4317
|
] })
|
|
@@ -4314,14 +4319,14 @@ function Qe({
|
|
|
4314
4319
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(P, { value: "item-3", children: [
|
|
4315
4320
|
/* @__PURE__ */ e.jsx(K, { children: "Filters" }),
|
|
4316
4321
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4317
|
-
/* @__PURE__ */ e.jsx(
|
|
4318
|
-
/* @__PURE__ */ e.jsx(
|
|
4322
|
+
/* @__PURE__ */ e.jsx(De, {}),
|
|
4323
|
+
/* @__PURE__ */ e.jsx(Le, {})
|
|
4319
4324
|
] })
|
|
4320
4325
|
] })
|
|
4321
4326
|
] }) });
|
|
4322
4327
|
}
|
|
4323
4328
|
function hl() {
|
|
4324
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4329
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ve, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4325
4330
|
/* @__PURE__ */ e.jsxs(P, { value: "item-1", children: [
|
|
4326
4331
|
/* @__PURE__ */ e.jsx(K, { children: "Stacked Chart" }),
|
|
4327
4332
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -4350,15 +4355,15 @@ function hl() {
|
|
|
4350
4355
|
/* @__PURE__ */ e.jsxs(P, { value: "item-2", children: [
|
|
4351
4356
|
/* @__PURE__ */ e.jsx(K, { children: "Settings" }),
|
|
4352
4357
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4353
|
-
/* @__PURE__ */ e.jsx(
|
|
4358
|
+
/* @__PURE__ */ e.jsx(rs, {}),
|
|
4354
4359
|
/* @__PURE__ */ e.jsx(La, {})
|
|
4355
4360
|
] })
|
|
4356
4361
|
] }),
|
|
4357
4362
|
/* @__PURE__ */ e.jsxs(P, { value: "item-3", children: [
|
|
4358
4363
|
/* @__PURE__ */ e.jsx(K, { children: "Filters" }),
|
|
4359
4364
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4360
|
-
/* @__PURE__ */ e.jsx(
|
|
4361
|
-
/* @__PURE__ */ e.jsx(
|
|
4365
|
+
/* @__PURE__ */ e.jsx(De, {}),
|
|
4366
|
+
/* @__PURE__ */ e.jsx(Le, {})
|
|
4362
4367
|
] })
|
|
4363
4368
|
] })
|
|
4364
4369
|
] }) });
|
|
@@ -4376,11 +4381,11 @@ function ml({}) {
|
|
|
4376
4381
|
});
|
|
4377
4382
|
};
|
|
4378
4383
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4379
|
-
/* @__PURE__ */ e.jsx(
|
|
4384
|
+
/* @__PURE__ */ e.jsx(ve, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(P, { value: "item-3", children: [
|
|
4380
4385
|
/* @__PURE__ */ e.jsx(K, { children: "Filters" }),
|
|
4381
4386
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4382
|
-
/* @__PURE__ */ e.jsx(
|
|
4383
|
-
/* @__PURE__ */ e.jsx(
|
|
4387
|
+
/* @__PURE__ */ e.jsx(De, {}),
|
|
4388
|
+
/* @__PURE__ */ e.jsx(Le, {})
|
|
4384
4389
|
] })
|
|
4385
4390
|
] }) }),
|
|
4386
4391
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
@@ -4484,18 +4489,18 @@ function fl() {
|
|
|
4484
4489
|
return /* @__PURE__ */ e.jsx(rl, {});
|
|
4485
4490
|
}
|
|
4486
4491
|
}
|
|
4487
|
-
return /* @__PURE__ */ e.jsx(
|
|
4492
|
+
return /* @__PURE__ */ e.jsx(Ms, { className: "h-full w-full text-sm", children: n(s) });
|
|
4488
4493
|
}
|
|
4489
4494
|
function gl() {
|
|
4490
4495
|
const s = c((n) => n.isShowingVisual);
|
|
4491
4496
|
return /* @__PURE__ */ e.jsxs(
|
|
4492
|
-
|
|
4497
|
+
ps,
|
|
4493
4498
|
{
|
|
4494
4499
|
direction: "vertical",
|
|
4495
4500
|
className: "min-h-[250px] min-w-full max-w-lg",
|
|
4496
4501
|
children: [
|
|
4497
4502
|
/* @__PURE__ */ e.jsx(
|
|
4498
|
-
|
|
4503
|
+
Se,
|
|
4499
4504
|
{
|
|
4500
4505
|
role: "query-section",
|
|
4501
4506
|
className: "flex",
|
|
@@ -4504,17 +4509,17 @@ function gl() {
|
|
|
4504
4509
|
children: /* @__PURE__ */ e.jsx(Gn, {})
|
|
4505
4510
|
}
|
|
4506
4511
|
),
|
|
4507
|
-
/* @__PURE__ */ e.jsx(
|
|
4512
|
+
/* @__PURE__ */ e.jsx(fs, { withHandle: !0, className: "border" }),
|
|
4508
4513
|
/* @__PURE__ */ e.jsx(
|
|
4509
|
-
|
|
4514
|
+
Se,
|
|
4510
4515
|
{
|
|
4511
4516
|
className: "pb-1",
|
|
4512
4517
|
role: "visual-section",
|
|
4513
4518
|
minSize: 0,
|
|
4514
4519
|
defaultSize: 60,
|
|
4515
|
-
children: s ? /* @__PURE__ */ e.jsxs(
|
|
4520
|
+
children: s ? /* @__PURE__ */ e.jsxs(ps, { direction: "horizontal", children: [
|
|
4516
4521
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
4517
|
-
|
|
4522
|
+
Se,
|
|
4518
4523
|
{
|
|
4519
4524
|
className: "flex min-w-[275px]",
|
|
4520
4525
|
minSize: 20,
|
|
@@ -4523,8 +4528,8 @@ function gl() {
|
|
|
4523
4528
|
children: /* @__PURE__ */ e.jsx(fl, {})
|
|
4524
4529
|
}
|
|
4525
4530
|
) }),
|
|
4526
|
-
/* @__PURE__ */ e.jsx(
|
|
4527
|
-
/* @__PURE__ */ e.jsx(
|
|
4531
|
+
/* @__PURE__ */ e.jsx(fs, { className: "border" }),
|
|
4532
|
+
/* @__PURE__ */ e.jsx(Se, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Ws, {}) })
|
|
4528
4533
|
] }) : /* @__PURE__ */ e.jsx(Ws, {})
|
|
4529
4534
|
}
|
|
4530
4535
|
)
|
|
@@ -4533,7 +4538,7 @@ function gl() {
|
|
|
4533
4538
|
);
|
|
4534
4539
|
}
|
|
4535
4540
|
function jl({ authToken: s, onSave: n, onClose: a }) {
|
|
4536
|
-
const t = c((o) => o.actions.setOnSave), r = c((o) => o.actions.setOnClose), h =
|
|
4541
|
+
const t = c((o) => o.actions.setOnSave), r = c((o) => o.actions.setOnClose), h = k((o) => o.actions.setAuthToken);
|
|
4537
4542
|
return Q(() => {
|
|
4538
4543
|
n && t(n), a && r(a);
|
|
4539
4544
|
}, [n, t, a, r]), Q(() => {
|
|
@@ -4544,8 +4549,8 @@ function jl({ authToken: s, onSave: n, onClose: a }) {
|
|
|
4544
4549
|
] });
|
|
4545
4550
|
}
|
|
4546
4551
|
function bl() {
|
|
4547
|
-
|
|
4548
|
-
const s =
|
|
4552
|
+
k((o) => o.selectedCardId);
|
|
4553
|
+
const s = k((o) => o.selectedSheetId), { setIsVisualEditing: n } = k((o) => o.actions), a = k((o) => o.isVisualEditing), t = k((o) => o.actions.updateFrame);
|
|
4549
4554
|
function r(o) {
|
|
4550
4555
|
s && (t(s, o), n(!1));
|
|
4551
4556
|
}
|
|
@@ -4568,14 +4573,14 @@ function yl() {
|
|
|
4568
4573
|
c((o) => o.selectedConnectionId), c((o) => o.selectedDatamodelId);
|
|
4569
4574
|
const s = c((o) => o.selectedDatabaseName);
|
|
4570
4575
|
c((o) => o.selectedSchemaName);
|
|
4571
|
-
const n = c((o) => o.selectedTableName), a =
|
|
4572
|
-
|
|
4576
|
+
const n = c((o) => o.selectedTableName), a = k((o) => o.dashboard.filters) || [];
|
|
4577
|
+
k((o) => o.actions.addFilter), k((o) => o.actions.removeFilter), k(
|
|
4573
4578
|
(o) => o.actions.removeFilterValue
|
|
4574
4579
|
);
|
|
4575
|
-
const { modelItems: t, columns: r } =
|
|
4580
|
+
const { modelItems: t, columns: r } = Ae(), { assignFilter: h } = Ia();
|
|
4576
4581
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: r == null ? void 0 : r.map((o) => {
|
|
4577
4582
|
const i = a == null ? void 0 : a.find(
|
|
4578
|
-
(d) => d.column ===
|
|
4583
|
+
(d) => d.column === me(o.column_name) && d.table === n && d.database === s
|
|
4579
4584
|
);
|
|
4580
4585
|
return /* @__PURE__ */ e.jsx(
|
|
4581
4586
|
"div",
|
|
@@ -4597,13 +4602,13 @@ function yl() {
|
|
|
4597
4602
|
}) });
|
|
4598
4603
|
}
|
|
4599
4604
|
function vl() {
|
|
4600
|
-
|
|
4601
|
-
const s =
|
|
4605
|
+
k((n) => n.showFilters);
|
|
4606
|
+
const s = k(
|
|
4602
4607
|
(n) => n.actions.setShowFilters
|
|
4603
4608
|
);
|
|
4604
4609
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
4605
4610
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
4606
|
-
/* @__PURE__ */ e.jsx(
|
|
4611
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
|
|
4607
4612
|
/* @__PURE__ */ e.jsx(
|
|
4608
4613
|
z,
|
|
4609
4614
|
{
|
|
@@ -4629,9 +4634,9 @@ function vl() {
|
|
|
4629
4634
|
] });
|
|
4630
4635
|
}
|
|
4631
4636
|
function Nl() {
|
|
4632
|
-
|
|
4633
|
-
const s =
|
|
4634
|
-
return
|
|
4637
|
+
k((a) => a.dashboard);
|
|
4638
|
+
const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
|
|
4639
|
+
return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
|
|
4635
4640
|
"div",
|
|
4636
4641
|
{
|
|
4637
4642
|
role: "dashboard-plus-main",
|
|
@@ -4647,10 +4652,10 @@ function Nl() {
|
|
|
4647
4652
|
);
|
|
4648
4653
|
}
|
|
4649
4654
|
function Cl() {
|
|
4650
|
-
const s =
|
|
4655
|
+
const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
|
|
4651
4656
|
(t) => t.showDashboardJSON
|
|
4652
4657
|
);
|
|
4653
|
-
return
|
|
4658
|
+
return k(
|
|
4654
4659
|
(t) => t.actions.setShowDashboardJSON
|
|
4655
4660
|
), /* @__PURE__ */ e.jsx(
|
|
4656
4661
|
"div",
|
|
@@ -4711,5 +4716,5 @@ export {
|
|
|
4711
4716
|
wl as D,
|
|
4712
4717
|
Be as L,
|
|
4713
4718
|
Ee as S,
|
|
4714
|
-
|
|
4719
|
+
Ae as u
|
|
4715
4720
|
};
|