react-semaphor 0.0.324 → 0.0.325
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{index-BtbfL36X.js → index-6Q18isJp.js} +948 -903
- package/dist/chunks/index-BQPTe8tl.js +245 -0
- package/dist/chunks/{index-TH3j1Unm.js → index-DggCCDD7.js} +82 -87
- package/dist/chunks/{index-B8TJTP6w.js → index-kzckqacZ.js} +5776 -5823
- package/dist/chunks/{lucide-react-B8sneZam.js → lucide-react-CzZkP9Lz.js} +2 -2
- package/dist/chunks/{lucide-react-QRCXH2cF.js → lucide-react-DyubCpoB.js} +160 -160
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -13
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-QZuwimXt.js +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as V, p as
|
|
1
|
+
import { c as V, p as zs, u as z, n as Os, o as ke, q as e, r as Fs, s as Is, t as O, j as Ds, v as Ts, w as Ls, x as Ms, y as Es, L as R, z as le, A as la, E as ra, H as ia, J as oa, K as st, M as at, N as tt, O as Js, Q, R as Qe, h as nt, V as m, W as lt, F as ca, Y as Je, Z as Ke, _ as da, $ as rt, a0 as ua, a1 as me, a2 as he, a3 as xe, a4 as pe, a5 as Se, a6 as fe, a7 as K, T as As, a8 as Vs, a9 as qs, aa as Rs, ab as ma, ac as ha, ad as de, ae as it, af as ot, ag as xa, ah as ct, C as dt, ai as ut, aj as pa, B as mt, ak as We, al as ht, am as Ks, an as fa, ao as ys, ap as Ne, aq as Fe, ar as ge, as as ga, at as xt, au as pt, av as ft, aw as gt, I as jt, ax as bt, ay as yt, az as vt, aA as qe, aB as vs, aC as Ct, a as Nt, aD as Ue, aE as Cs, aF as Ae, aG as Ns, aH as St, aI as wt, aJ as kt, aK as zt, aL as Ot, aM as Ft, aN as bs, aO as It, aP as Ws, aQ as Dt, aR as Ys, aS as Tt, aT as Lt, aU as Mt, aV as Et, aW as ja, aX as re, aY as _s, aZ as ba, a_ as At, a$ as Vt, b0 as ls, b1 as qt, b2 as Rt, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, l as Ut, b8 as us, b9 as ya, ba as va, bb as Ca, bc as rs, bd as Na, be as is, bf as Xs, bg as Gt, bh as Qt, bi as ms, bj as hs, bk as xs, bl as Jt, X as Sa, bm as Kt, bn as Wt, bo as Yt, bp as ps, bq as Ie, f as Xt, br as Be, bs as Hs, bt as wa, bu as Zt, bv as en, bw as os, bx as sn, by as an, bz as tn, bA as Zs, bB as nn, bC as ln, bD as rn, bE as on, bF as cn, bG as dn, bH as un, bI as mn, bJ as De, bK as B, bL as U, bM as $s, bN as G, bO as hn, bP as ka, bQ as xn, bR as pn, bS as fn, bT as gn, bU as jn, bV as bn, bW as yn, bX as vn, bY as Cn } from "./index-kzckqacZ.js";
|
|
2
2
|
import * as ea from "react";
|
|
3
3
|
import we, { useState as q, useMemo as Ss, useEffect as Z, useRef as ws, Suspense as Nn } from "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -63,7 +63,7 @@ const Bs = V("ChartLine", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const
|
|
66
|
+
const za = V("ChartNoAxesGantt", [
|
|
67
67
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
68
68
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
69
69
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -74,7 +74,7 @@ const Oa = V("ChartNoAxesGantt", [
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
77
|
+
const Oa = V("ChartPie", [
|
|
78
78
|
[
|
|
79
79
|
"path",
|
|
80
80
|
{
|
|
@@ -115,7 +115,7 @@ const kn = V("CircleX", [
|
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const zn = V("CopyPlus", [
|
|
119
119
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
120
120
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
121
121
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -127,7 +127,7 @@ const On = V("CopyPlus", [
|
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
129
|
*/
|
|
130
|
-
const
|
|
130
|
+
const On = V("Database", [
|
|
131
131
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
132
132
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
133
133
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -179,7 +179,7 @@ const In = V("EyeClosed", [
|
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
181
|
*/
|
|
182
|
-
const
|
|
182
|
+
const Dn = V("Eye", [
|
|
183
183
|
[
|
|
184
184
|
"path",
|
|
185
185
|
{
|
|
@@ -195,7 +195,7 @@ const Tn = V("Eye", [
|
|
|
195
195
|
* This source code is licensed under the ISC license.
|
|
196
196
|
* See the LICENSE file in the root directory of this source tree.
|
|
197
197
|
*/
|
|
198
|
-
const
|
|
198
|
+
const Tn = V("Glasses", [
|
|
199
199
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
200
200
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
201
201
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -208,7 +208,7 @@ const Dn = V("Glasses", [
|
|
|
208
208
|
* This source code is licensed under the ISC license.
|
|
209
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
210
|
*/
|
|
211
|
-
const
|
|
211
|
+
const Ln = V("Hammer", [
|
|
212
212
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
213
213
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
214
214
|
[
|
|
@@ -225,7 +225,7 @@ const Mn = V("Hammer", [
|
|
|
225
225
|
* This source code is licensed under the ISC license.
|
|
226
226
|
* See the LICENSE file in the root directory of this source tree.
|
|
227
227
|
*/
|
|
228
|
-
const
|
|
228
|
+
const Mn = V("Hash", [
|
|
229
229
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
230
230
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
231
231
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -305,7 +305,16 @@ const Rn = V("ListX", [
|
|
|
305
305
|
* This source code is licensed under the ISC license.
|
|
306
306
|
* See the LICENSE file in the root directory of this source tree.
|
|
307
307
|
*/
|
|
308
|
-
const
|
|
308
|
+
const Ve = V("LoaderCircle", [
|
|
309
|
+
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
310
|
+
]);
|
|
311
|
+
/**
|
|
312
|
+
* @license lucide-react v0.453.0 - ISC
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the ISC license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/
|
|
317
|
+
const Da = V("Map", [
|
|
309
318
|
[
|
|
310
319
|
"path",
|
|
311
320
|
{
|
|
@@ -347,7 +356,7 @@ const Hn = V("Network", [
|
|
|
347
356
|
* This source code is licensed under the ISC license.
|
|
348
357
|
* See the LICENSE file in the root directory of this source tree.
|
|
349
358
|
*/
|
|
350
|
-
const
|
|
359
|
+
const Ta = V("Pencil", [
|
|
351
360
|
[
|
|
352
361
|
"path",
|
|
353
362
|
{
|
|
@@ -402,7 +411,7 @@ const Bn = V("Save", [
|
|
|
402
411
|
* This source code is licensed under the ISC license.
|
|
403
412
|
* See the LICENSE file in the root directory of this source tree.
|
|
404
413
|
*/
|
|
405
|
-
const
|
|
414
|
+
const La = V("Shapes", [
|
|
406
415
|
[
|
|
407
416
|
"path",
|
|
408
417
|
{
|
|
@@ -510,7 +519,7 @@ const Wn = V("User", [
|
|
|
510
519
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
511
520
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
512
521
|
]);
|
|
513
|
-
function
|
|
522
|
+
function Ma(s) {
|
|
514
523
|
var t;
|
|
515
524
|
return {
|
|
516
525
|
...s,
|
|
@@ -519,10 +528,10 @@ function La(s) {
|
|
|
519
528
|
return {
|
|
520
529
|
...a,
|
|
521
530
|
frames: (n = a.frames) == null ? void 0 : n.map((l) => {
|
|
522
|
-
var
|
|
531
|
+
var c;
|
|
523
532
|
return {
|
|
524
533
|
...l,
|
|
525
|
-
cards: (
|
|
534
|
+
cards: (c = l.cards) == null ? void 0 : c.map((r) => Yn(r))
|
|
526
535
|
};
|
|
527
536
|
})
|
|
528
537
|
};
|
|
@@ -538,8 +547,8 @@ function Yn(s) {
|
|
|
538
547
|
data: {
|
|
539
548
|
...(t = s.cfg) == null ? void 0 : t.data,
|
|
540
549
|
labels: [],
|
|
541
|
-
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((
|
|
542
|
-
...
|
|
550
|
+
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((c) => ({
|
|
551
|
+
...c,
|
|
543
552
|
data: []
|
|
544
553
|
}))
|
|
545
554
|
}
|
|
@@ -567,7 +576,7 @@ async function Zn(s, t, a, n) {
|
|
|
567
576
|
if (!n)
|
|
568
577
|
return null;
|
|
569
578
|
const l = JSON.stringify(t);
|
|
570
|
-
return await
|
|
579
|
+
return await zs("https://semaphor.cloud/api/v1/lens", n, {
|
|
571
580
|
name: s,
|
|
572
581
|
template: l,
|
|
573
582
|
filterValues: a,
|
|
@@ -577,27 +586,27 @@ async function Zn(s, t, a, n) {
|
|
|
577
586
|
async function ks(s, t) {
|
|
578
587
|
if (!t)
|
|
579
588
|
return null;
|
|
580
|
-
const { id: a, template: n, filterValues: l, isDefault:
|
|
581
|
-
return await
|
|
589
|
+
const { id: a, template: n, filterValues: l, isDefault: c, shared: r } = s;
|
|
590
|
+
return await zs("https://semaphor.cloud/api/v1/lens", t, {
|
|
582
591
|
lensId: a,
|
|
583
592
|
template: n,
|
|
584
593
|
filterValues: l,
|
|
585
|
-
isDefault:
|
|
586
|
-
shared:
|
|
594
|
+
isDefault: c,
|
|
595
|
+
shared: r,
|
|
587
596
|
operation: "update"
|
|
588
597
|
});
|
|
589
598
|
}
|
|
590
599
|
async function el(s, t) {
|
|
591
|
-
return t ? await
|
|
600
|
+
return t ? await zs("https://semaphor.cloud/api/v1/lens", t, {
|
|
592
601
|
operation: "delete",
|
|
593
602
|
lensId: s
|
|
594
603
|
}) : null;
|
|
595
604
|
}
|
|
596
605
|
function sl() {
|
|
597
|
-
const [s, t] = q(""), [a, n] = q(!1), l =
|
|
606
|
+
const [s, t] = q(""), [a, n] = q(!1), l = z((b) => b.lenses), { setLenses: c, setSelectedLensId: r } = Os(), [o, d] = q(!1), [p, u] = q(!1), y = z((b) => b.dashboard), g = z((b) => b.filterValues), { authToken: x } = ke();
|
|
598
607
|
async function j() {
|
|
599
608
|
d(!0);
|
|
600
|
-
const b =
|
|
609
|
+
const b = Ma(
|
|
601
610
|
y
|
|
602
611
|
), I = await Zn(
|
|
603
612
|
s,
|
|
@@ -605,24 +614,24 @@ function sl() {
|
|
|
605
614
|
g,
|
|
606
615
|
x == null ? void 0 : x.accessToken
|
|
607
616
|
);
|
|
608
|
-
I && (
|
|
617
|
+
I && (c([...l || [], I]), r(I.id), u(!1)), d(!1);
|
|
609
618
|
}
|
|
610
619
|
return /* @__PURE__ */ e.jsxs(Fs, { open: p, onOpenChange: u, children: [
|
|
611
620
|
/* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
612
|
-
|
|
621
|
+
O,
|
|
613
622
|
{
|
|
614
623
|
variant: "secondary",
|
|
615
624
|
className: "h-7 p-2",
|
|
616
625
|
size: "sm",
|
|
617
626
|
children: [
|
|
618
|
-
/* @__PURE__ */ e.jsx(
|
|
627
|
+
/* @__PURE__ */ e.jsx(Ds, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
619
628
|
"Lens"
|
|
620
629
|
]
|
|
621
630
|
}
|
|
622
631
|
) }),
|
|
623
|
-
/* @__PURE__ */ e.jsxs(
|
|
624
|
-
/* @__PURE__ */ e.jsxs(
|
|
625
|
-
/* @__PURE__ */ e.jsx(
|
|
632
|
+
/* @__PURE__ */ e.jsxs(Ts, { className: "sm:max-w-[425px]", children: [
|
|
633
|
+
/* @__PURE__ */ e.jsxs(Ls, { children: [
|
|
634
|
+
/* @__PURE__ */ e.jsx(Ms, { children: "Create Lens" }),
|
|
626
635
|
/* @__PURE__ */ e.jsx(Es, { children: "Lenses are private by default and are only visible to you." })
|
|
627
636
|
] }),
|
|
628
637
|
/* @__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: [
|
|
@@ -641,28 +650,28 @@ function sl() {
|
|
|
641
650
|
] }) }),
|
|
642
651
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
643
652
|
/* @__PURE__ */ e.jsx(la, { children: /* @__PURE__ */ e.jsx(
|
|
644
|
-
|
|
653
|
+
O,
|
|
645
654
|
{
|
|
646
655
|
size: "sm",
|
|
647
656
|
variant: "outline",
|
|
648
657
|
type: "submit",
|
|
649
658
|
onClick: j,
|
|
650
|
-
disabled:
|
|
651
|
-
children:
|
|
659
|
+
disabled: o,
|
|
660
|
+
children: o ? "Creating..." : "Add"
|
|
652
661
|
}
|
|
653
662
|
) })
|
|
654
663
|
] })
|
|
655
664
|
] });
|
|
656
665
|
}
|
|
657
666
|
function al() {
|
|
658
|
-
const [s, t] = q(!1), a =
|
|
659
|
-
async function
|
|
660
|
-
|
|
667
|
+
const [s, t] = q(!1), a = z((u) => u.lenses), n = z((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: c } = Os(), { authToken: r } = ke();
|
|
668
|
+
async function o(u) {
|
|
669
|
+
c(u);
|
|
661
670
|
}
|
|
662
671
|
async function d(u) {
|
|
663
|
-
if (await el(u,
|
|
672
|
+
if (await el(u, r == null ? void 0 : r.accessToken)) {
|
|
664
673
|
const g = a == null ? void 0 : a.filter((x) => x.id !== u);
|
|
665
|
-
l(g || []),
|
|
674
|
+
l(g || []), c("original");
|
|
666
675
|
}
|
|
667
676
|
}
|
|
668
677
|
async function p(u) {
|
|
@@ -678,18 +687,18 @@ function al() {
|
|
|
678
687
|
...u,
|
|
679
688
|
isDefault: !u.isDefault
|
|
680
689
|
};
|
|
681
|
-
await ks(g,
|
|
690
|
+
await ks(g, r == null ? void 0 : r.accessToken);
|
|
682
691
|
const x = a == null ? void 0 : a.find((j) => j.isDefault);
|
|
683
692
|
if (x && x.id !== u.id) {
|
|
684
693
|
const j = {
|
|
685
694
|
...x,
|
|
686
695
|
isDefault: !1
|
|
687
696
|
};
|
|
688
|
-
await ks(j,
|
|
697
|
+
await ks(j, r == null ? void 0 : r.accessToken);
|
|
689
698
|
}
|
|
690
699
|
}
|
|
691
700
|
return /* @__PURE__ */ e.jsxs(ra, { open: s, onOpenChange: t, children: [
|
|
692
|
-
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
701
|
+
/* @__PURE__ */ e.jsx(ia, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
693
702
|
/* @__PURE__ */ e.jsxs(oa, { align: "end", className: "w-60", children: [
|
|
694
703
|
/* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
|
|
695
704
|
/* @__PURE__ */ e.jsx(at, {}),
|
|
@@ -697,7 +706,7 @@ function al() {
|
|
|
697
706
|
tt,
|
|
698
707
|
{
|
|
699
708
|
value: n,
|
|
700
|
-
onValueChange:
|
|
709
|
+
onValueChange: o,
|
|
701
710
|
children: [
|
|
702
711
|
/* @__PURE__ */ e.jsx(Js, { value: "original", children: "Original" }),
|
|
703
712
|
a == null ? void 0 : a.map((u) => /* @__PURE__ */ e.jsxs(
|
|
@@ -714,7 +723,7 @@ function al() {
|
|
|
714
723
|
onClick: (y) => {
|
|
715
724
|
y.preventDefault(), p(u);
|
|
716
725
|
},
|
|
717
|
-
className:
|
|
726
|
+
className: Q(
|
|
718
727
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
719
728
|
{
|
|
720
729
|
invisible: !u.isDefault,
|
|
@@ -725,7 +734,7 @@ function al() {
|
|
|
725
734
|
}
|
|
726
735
|
),
|
|
727
736
|
/* @__PURE__ */ e.jsx(
|
|
728
|
-
|
|
737
|
+
Qe,
|
|
729
738
|
{
|
|
730
739
|
onClick: (y) => {
|
|
731
740
|
y.preventDefault(), d(u.id);
|
|
@@ -745,32 +754,67 @@ function al() {
|
|
|
745
754
|
] })
|
|
746
755
|
] });
|
|
747
756
|
}
|
|
748
|
-
function tl(
|
|
757
|
+
function tl({
|
|
758
|
+
iconClassName: s
|
|
759
|
+
}) {
|
|
760
|
+
const [t, a] = q(!1), { authToken: n } = ke(), l = z((o) => o.theme), c = z((o) => o.filterValues);
|
|
761
|
+
async function r() {
|
|
762
|
+
{
|
|
763
|
+
a(!0);
|
|
764
|
+
const o = new URLSearchParams();
|
|
765
|
+
o.set("token", (n == null ? void 0 : n.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(c));
|
|
766
|
+
const d = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, u = await (await fetch(d, {
|
|
767
|
+
method: "GET",
|
|
768
|
+
headers: {
|
|
769
|
+
Authorization: `Bearer ${n == null ? void 0 : n.accessToken}`
|
|
770
|
+
}
|
|
771
|
+
})).blob(), y = URL.createObjectURL(u);
|
|
772
|
+
window.open(y, "_blank"), a(!1);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
return /* @__PURE__ */ e.jsx(
|
|
776
|
+
O,
|
|
777
|
+
{
|
|
778
|
+
variant: "link",
|
|
779
|
+
className: "group h-7 p-2",
|
|
780
|
+
size: "sm",
|
|
781
|
+
onClick: r,
|
|
782
|
+
children: t ? /* @__PURE__ */ e.jsx(Ve, { className: Q("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
783
|
+
nt,
|
|
784
|
+
{
|
|
785
|
+
className: Q("size-3.5", s),
|
|
786
|
+
strokeWidth: 1.5
|
|
787
|
+
}
|
|
788
|
+
)
|
|
789
|
+
}
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
function nl() {
|
|
749
793
|
q(!1);
|
|
750
|
-
const { authToken: s } =
|
|
751
|
-
|
|
752
|
-
const t =
|
|
753
|
-
|
|
754
|
-
const
|
|
794
|
+
const { authToken: s } = ke();
|
|
795
|
+
z((f) => f.theme);
|
|
796
|
+
const t = z((f) => f.lenses), a = z((f) => f.selectedLensId), n = t == null ? void 0 : t.find((f) => f.id === a), l = z((f) => f.dashboard);
|
|
797
|
+
z((f) => f.selectedSheetId);
|
|
798
|
+
const c = z(
|
|
755
799
|
(f) => f.isDashboardEditing
|
|
756
|
-
),
|
|
800
|
+
), r = m(
|
|
757
801
|
(f) => f.selectedConnectionId
|
|
758
|
-
), [
|
|
759
|
-
|
|
802
|
+
), [o, d] = q(!1), p = z((f) => f.filterValues), u = z((f) => f.isVisualEditing), y = z((f) => f.showFilters);
|
|
803
|
+
z(
|
|
760
804
|
(f) => f.showDashboardJSON
|
|
761
805
|
);
|
|
762
|
-
const g =
|
|
806
|
+
const g = z((f) => f.onSaveFunction), x = z(
|
|
763
807
|
(f) => f.actions.setShowFilters
|
|
764
|
-
), { addFrame: j, setSelectedFrameId: b } =
|
|
808
|
+
), { addFrame: j, setSelectedFrameId: b } = z(
|
|
765
809
|
(f) => f.actions
|
|
766
|
-
), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON:
|
|
767
|
-
() =>
|
|
810
|
+
), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON: T } = z((f) => f.actions), F = I(), { tenantId: A, endUserId: N } = Ss(
|
|
811
|
+
() => lt(s == null ? void 0 : s.accessToken),
|
|
768
812
|
[s == null ? void 0 : s.accessToken]
|
|
769
|
-
), S = Ss(() => A || N, [A, N]),
|
|
770
|
-
if (!
|
|
813
|
+
), S = Ss(() => A || N, [A, N]), L = () => {
|
|
814
|
+
if (!c || !F) return;
|
|
771
815
|
const f = {
|
|
772
|
-
connectionId:
|
|
773
|
-
id:
|
|
816
|
+
connectionId: r,
|
|
817
|
+
id: Je(),
|
|
774
818
|
title: "Title",
|
|
775
819
|
description: "Description",
|
|
776
820
|
preferences: {
|
|
@@ -785,7 +829,7 @@ function tl() {
|
|
|
785
829
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
786
830
|
data: []
|
|
787
831
|
}, k = {
|
|
788
|
-
id:
|
|
832
|
+
id: Je(),
|
|
789
833
|
cards: [f],
|
|
790
834
|
activeCardId: f.id
|
|
791
835
|
};
|
|
@@ -795,14 +839,14 @@ function tl() {
|
|
|
795
839
|
};
|
|
796
840
|
async function v() {
|
|
797
841
|
if (d(!0), !a || !n) return;
|
|
798
|
-
const f =
|
|
842
|
+
const f = Ma(
|
|
799
843
|
l
|
|
800
|
-
), k = JSON.stringify(f),
|
|
844
|
+
), k = JSON.stringify(f), M = {
|
|
801
845
|
...n,
|
|
802
846
|
template: k,
|
|
803
847
|
filterValues: p
|
|
804
848
|
};
|
|
805
|
-
await ks(
|
|
849
|
+
await ks(M, s == null ? void 0 : s.accessToken), Ke.success("Lens saved"), g == null || g(f), d(!1);
|
|
806
850
|
}
|
|
807
851
|
return u ? null : /* @__PURE__ */ e.jsxs(
|
|
808
852
|
"div",
|
|
@@ -812,59 +856,59 @@ function tl() {
|
|
|
812
856
|
children: [
|
|
813
857
|
!u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(R, { children: n == null ? void 0 : n.name }) }),
|
|
814
858
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
815
|
-
/* @__PURE__ */ e.jsx(
|
|
816
|
-
|
|
859
|
+
/* @__PURE__ */ e.jsx(tl, {}),
|
|
860
|
+
c && !u && S && /* @__PURE__ */ e.jsx(sl, {}),
|
|
817
861
|
!u && S && /* @__PURE__ */ e.jsx(al, {}),
|
|
818
|
-
|
|
819
|
-
|
|
862
|
+
c && !u && /* @__PURE__ */ e.jsxs(
|
|
863
|
+
O,
|
|
820
864
|
{
|
|
821
865
|
variant: "secondary",
|
|
822
866
|
className: "h-7 p-2",
|
|
823
867
|
size: "sm",
|
|
824
|
-
disabled: !
|
|
825
|
-
onClick:
|
|
868
|
+
disabled: !c,
|
|
869
|
+
onClick: L,
|
|
826
870
|
children: [
|
|
827
|
-
/* @__PURE__ */ e.jsx(
|
|
871
|
+
/* @__PURE__ */ e.jsx(Ds, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
828
872
|
"Frame"
|
|
829
873
|
]
|
|
830
874
|
}
|
|
831
875
|
),
|
|
832
|
-
!
|
|
833
|
-
|
|
876
|
+
!c && /* @__PURE__ */ e.jsx(
|
|
877
|
+
O,
|
|
834
878
|
{
|
|
835
879
|
variant: "ghost",
|
|
836
880
|
className: "h-7 p-2",
|
|
837
881
|
onClick: h,
|
|
838
882
|
size: "sm",
|
|
839
|
-
children: /* @__PURE__ */ e.jsx(
|
|
883
|
+
children: /* @__PURE__ */ e.jsx(Ta, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
840
884
|
}
|
|
841
885
|
),
|
|
842
|
-
|
|
843
|
-
|
|
886
|
+
c && !u && /* @__PURE__ */ e.jsx(
|
|
887
|
+
O,
|
|
844
888
|
{
|
|
845
889
|
variant: "ghost",
|
|
846
890
|
role: "close",
|
|
847
891
|
className: "h-7 p-2",
|
|
848
892
|
onClick: () => {
|
|
849
|
-
C(!1),
|
|
893
|
+
C(!1), T(!1);
|
|
850
894
|
},
|
|
851
895
|
size: "sm",
|
|
852
|
-
children: /* @__PURE__ */ e.jsx(
|
|
896
|
+
children: /* @__PURE__ */ e.jsx(Qe, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
853
897
|
}
|
|
854
898
|
),
|
|
855
|
-
|
|
856
|
-
|
|
899
|
+
c && !u && S && /* @__PURE__ */ e.jsx(
|
|
900
|
+
O,
|
|
857
901
|
{
|
|
858
902
|
className: "h-7 p-2",
|
|
859
903
|
variant: "ghost",
|
|
860
|
-
disabled:
|
|
904
|
+
disabled: o,
|
|
861
905
|
onClick: v,
|
|
862
906
|
size: "sm",
|
|
863
907
|
children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
864
908
|
}
|
|
865
909
|
),
|
|
866
|
-
!y && !u &&
|
|
867
|
-
|
|
910
|
+
!y && !u && c && /* @__PURE__ */ e.jsx(
|
|
911
|
+
O,
|
|
868
912
|
{
|
|
869
913
|
className: "h-7 p-2",
|
|
870
914
|
variant: "ghost",
|
|
@@ -873,22 +917,22 @@ function tl() {
|
|
|
873
917
|
children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
874
918
|
}
|
|
875
919
|
),
|
|
876
|
-
!u &&
|
|
920
|
+
!u && c && !1,
|
|
877
921
|
!u && !1
|
|
878
922
|
] })
|
|
879
923
|
]
|
|
880
924
|
}
|
|
881
925
|
);
|
|
882
926
|
}
|
|
883
|
-
function
|
|
927
|
+
function Pe({
|
|
884
928
|
title: s,
|
|
885
929
|
items: t,
|
|
886
930
|
value: a,
|
|
887
931
|
isLoading: n,
|
|
888
932
|
isError: l,
|
|
889
|
-
connectionTooltip:
|
|
890
|
-
onChange:
|
|
891
|
-
showNone:
|
|
933
|
+
connectionTooltip: c,
|
|
934
|
+
onChange: r,
|
|
935
|
+
showNone: o = !1,
|
|
892
936
|
className: d,
|
|
893
937
|
showIcon: p = !0,
|
|
894
938
|
disabled: u = !1
|
|
@@ -898,7 +942,7 @@ function $e({
|
|
|
898
942
|
if (s === "Connection")
|
|
899
943
|
return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
|
|
900
944
|
if (s === "Database")
|
|
901
|
-
return /* @__PURE__ */ e.jsx(
|
|
945
|
+
return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
|
|
902
946
|
if (s === "Schema")
|
|
903
947
|
return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
|
|
904
948
|
if (s === "Table")
|
|
@@ -907,15 +951,15 @@ function $e({
|
|
|
907
951
|
return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
|
|
908
952
|
}
|
|
909
953
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
910
|
-
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
954
|
+
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: c ? /* @__PURE__ */ e.jsxs(da, { children: [
|
|
911
955
|
/* @__PURE__ */ e.jsx(rt, { children: g() }),
|
|
912
|
-
/* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children:
|
|
956
|
+
/* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children: c })
|
|
913
957
|
] }) : g() }),
|
|
914
|
-
/* @__PURE__ */ e.jsxs(me, { disabled: u, value: y, onValueChange:
|
|
958
|
+
/* @__PURE__ */ e.jsxs(me, { disabled: u, value: y, onValueChange: r, children: [
|
|
915
959
|
/* @__PURE__ */ e.jsx(
|
|
916
960
|
he,
|
|
917
961
|
{
|
|
918
|
-
className:
|
|
962
|
+
className: Q(
|
|
919
963
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
920
964
|
d
|
|
921
965
|
),
|
|
@@ -930,25 +974,25 @@ function $e({
|
|
|
930
974
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
931
975
|
n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
932
976
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
933
|
-
|
|
934
|
-
t && t.map((x, j) => /* @__PURE__ */ e.jsx(
|
|
977
|
+
o && /* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
978
|
+
t && t.map((x, j) => /* @__PURE__ */ e.jsx(K, { value: x.id, children: x.name }, j))
|
|
935
979
|
] }),
|
|
936
|
-
(n || l) && /* @__PURE__ */ e.jsx(
|
|
980
|
+
(n || l) && /* @__PURE__ */ e.jsx(K, { value: y, children: y })
|
|
937
981
|
] }) })
|
|
938
982
|
] })
|
|
939
983
|
] });
|
|
940
984
|
}
|
|
941
|
-
function
|
|
985
|
+
function ll({ column: s }) {
|
|
942
986
|
const [t, a] = q(!1), n = m((x) => x.selectedTableName), l = m(
|
|
943
987
|
(x) => x.selectedSchemaName
|
|
944
|
-
),
|
|
988
|
+
), c = m(
|
|
945
989
|
(x) => x.selectedDatamodelId
|
|
946
|
-
),
|
|
990
|
+
), r = m((x) => x.sqlGen), { modelItems: o } = Re(), d = m((x) => x.actions.setSqlGen), p = m((x) => x.actions.setCardSql), u = m((x) => x.actions.setRunSql);
|
|
947
991
|
function y(x, j) {
|
|
948
|
-
var
|
|
949
|
-
const b = ma(x,
|
|
950
|
-
(F) => F.id ===
|
|
951
|
-
)) == null ? void 0 :
|
|
992
|
+
var T;
|
|
993
|
+
const b = ma(x, r, j), I = (T = o == null ? void 0 : o.find(
|
|
994
|
+
(F) => F.id === c
|
|
995
|
+
)) == null ? void 0 : T.name;
|
|
952
996
|
d(b);
|
|
953
997
|
const C = ha(
|
|
954
998
|
b,
|
|
@@ -1021,67 +1065,67 @@ function Ea({ column: s }) {
|
|
|
1021
1065
|
/* @__PURE__ */ e.jsx(Us, { className: "size-3" })
|
|
1022
1066
|
) : xa.includes(s.data_type.toLowerCase()) ? (
|
|
1023
1067
|
//
|
|
1024
|
-
/* @__PURE__ */ e.jsx(
|
|
1068
|
+
/* @__PURE__ */ e.jsx(Mn, { className: "size-3" })
|
|
1025
1069
|
) : ct.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Kn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Un, { className: "size-3" }) }),
|
|
1026
1070
|
/* @__PURE__ */ e.jsx(ua, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
1027
1071
|
] });
|
|
1028
1072
|
}
|
|
1029
|
-
function
|
|
1073
|
+
function rl({
|
|
1030
1074
|
schemaName: s,
|
|
1031
1075
|
tableName: t,
|
|
1032
1076
|
columns: a,
|
|
1033
1077
|
status: n
|
|
1034
1078
|
}) {
|
|
1035
|
-
const l = m((h) => h.sqlGen),
|
|
1079
|
+
const l = m((h) => h.sqlGen), c = m(
|
|
1036
1080
|
(h) => h.selectedConnectionId
|
|
1037
|
-
),
|
|
1081
|
+
), r = m(
|
|
1038
1082
|
(h) => h.selectedDatabaseName
|
|
1039
|
-
),
|
|
1083
|
+
), o = m(
|
|
1040
1084
|
(h) => h.selectedSchemaName
|
|
1041
1085
|
), d = m((h) => h.selectedTableName), p = m(
|
|
1042
1086
|
(h) => h.selectedDatamodelId
|
|
1043
|
-
), u =
|
|
1087
|
+
), u = z(
|
|
1044
1088
|
(h) => h.dashboard.aiScopeTables
|
|
1045
|
-
), { setAIScopeTables: y } =
|
|
1089
|
+
), { setAIScopeTables: y } = z((h) => h.actions), g = m((h) => h.actions.setRunSql), x = m((h) => h.actions.setSqlGen), j = m(
|
|
1046
1090
|
(h) => h.actions.setIsShowingVisual
|
|
1047
|
-
), b = m((h) => h.actions.setCardSql), { connectionType: I, modelItems: C } =
|
|
1048
|
-
function
|
|
1049
|
-
var
|
|
1091
|
+
), b = m((h) => h.actions.setCardSql), { connectionType: I, modelItems: C } = Re();
|
|
1092
|
+
function T(h) {
|
|
1093
|
+
var M;
|
|
1050
1094
|
const v = ma(h, l);
|
|
1051
1095
|
x(v);
|
|
1052
|
-
const f = (
|
|
1096
|
+
const f = (M = C == null ? void 0 : C.find(
|
|
1053
1097
|
(H) => H.id === p
|
|
1054
|
-
)) == null ? void 0 :
|
|
1098
|
+
)) == null ? void 0 : M.name, k = ha(v, de(s), de(t), f);
|
|
1055
1099
|
k && (b(k), g(!0));
|
|
1056
1100
|
}
|
|
1057
1101
|
function F() {
|
|
1058
1102
|
return (u == null ? void 0 : u.find(
|
|
1059
|
-
(h) => h.connectinonId ===
|
|
1103
|
+
(h) => h.connectinonId === c && h.tableName === d
|
|
1060
1104
|
)) !== void 0;
|
|
1061
1105
|
}
|
|
1062
1106
|
function A(h) {
|
|
1063
|
-
if (h === !0 && d &&
|
|
1107
|
+
if (h === !0 && d && c) {
|
|
1064
1108
|
const v = {
|
|
1065
|
-
connectinonId:
|
|
1109
|
+
connectinonId: c,
|
|
1066
1110
|
connectionType: I,
|
|
1067
|
-
databaseName:
|
|
1068
|
-
schemaName:
|
|
1111
|
+
databaseName: r,
|
|
1112
|
+
schemaName: o,
|
|
1069
1113
|
tableName: d
|
|
1070
1114
|
}, k = [...u || [], v].filter(
|
|
1071
|
-
(
|
|
1072
|
-
(Y) => Y.connectinonId ===
|
|
1115
|
+
(M, H, P) => P.findIndex(
|
|
1116
|
+
(Y) => Y.connectinonId === M.connectinonId && Y.tableName === M.tableName
|
|
1073
1117
|
) === H
|
|
1074
1118
|
);
|
|
1075
|
-
y(k),
|
|
1119
|
+
y(k), Ke.success(`Added '${d}' to AI Scope`, {
|
|
1076
1120
|
position: "top-right",
|
|
1077
1121
|
duration: 2500,
|
|
1078
1122
|
richColors: !0
|
|
1079
1123
|
});
|
|
1080
1124
|
} else {
|
|
1081
1125
|
const v = (u || []).filter(
|
|
1082
|
-
(f) => f.connectinonId !==
|
|
1126
|
+
(f) => f.connectinonId !== c && f.tableName !== d
|
|
1083
1127
|
);
|
|
1084
|
-
y(v),
|
|
1128
|
+
y(v), Ke(`Removed '${d}' from AI Scope`, {
|
|
1085
1129
|
position: "top-right",
|
|
1086
1130
|
duration: 2e3,
|
|
1087
1131
|
richColors: !0
|
|
@@ -1089,11 +1133,11 @@ function ll({
|
|
|
1089
1133
|
}
|
|
1090
1134
|
}
|
|
1091
1135
|
function N() {
|
|
1092
|
-
var
|
|
1136
|
+
var M;
|
|
1093
1137
|
let h = fa(s, t);
|
|
1094
|
-
const v = (
|
|
1138
|
+
const v = (M = C == null ? void 0 : C.find(
|
|
1095
1139
|
(H) => H.id === p
|
|
1096
|
-
)) == null ? void 0 :
|
|
1140
|
+
)) == null ? void 0 : M.name;
|
|
1097
1141
|
console.log("modelName", v), p && p !== "none" && (h = `${ys}.${v}`);
|
|
1098
1142
|
let f = h;
|
|
1099
1143
|
return ((H) => /[A-Z]/.test(H))(t) && (f = f.split(".").map((P) => `"${P}"`).join(".")), f;
|
|
@@ -1104,7 +1148,7 @@ function ll({
|
|
|
1104
1148
|
const v = I === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
|
|
1105
1149
|
b(v), g(!0);
|
|
1106
1150
|
}
|
|
1107
|
-
function
|
|
1151
|
+
function L() {
|
|
1108
1152
|
const h = N();
|
|
1109
1153
|
b(`SELECT COUNT(*) as count FROM ${h}`), g(!0);
|
|
1110
1154
|
}
|
|
@@ -1121,7 +1165,7 @@ function ll({
|
|
|
1121
1165
|
children: /* @__PURE__ */ e.jsx(
|
|
1122
1166
|
mt,
|
|
1123
1167
|
{
|
|
1124
|
-
className:
|
|
1168
|
+
className: Q("size-4", {
|
|
1125
1169
|
"text-primary": F(),
|
|
1126
1170
|
"text-muted-foreground": !F()
|
|
1127
1171
|
})
|
|
@@ -1130,7 +1174,7 @@ function ll({
|
|
|
1130
1174
|
}
|
|
1131
1175
|
),
|
|
1132
1176
|
/* @__PURE__ */ e.jsxs(
|
|
1133
|
-
|
|
1177
|
+
O,
|
|
1134
1178
|
{
|
|
1135
1179
|
disabled: n !== "Success",
|
|
1136
1180
|
onClick: S,
|
|
@@ -1138,21 +1182,21 @@ function ll({
|
|
|
1138
1182
|
variant: "secondary",
|
|
1139
1183
|
className: "flex",
|
|
1140
1184
|
children: [
|
|
1141
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
1185
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Qn, { className: "mr-2 size-4" }),
|
|
1142
1186
|
"Top 10"
|
|
1143
1187
|
]
|
|
1144
1188
|
}
|
|
1145
1189
|
),
|
|
1146
1190
|
/* @__PURE__ */ e.jsxs(
|
|
1147
|
-
|
|
1191
|
+
O,
|
|
1148
1192
|
{
|
|
1149
1193
|
disabled: n !== "Success",
|
|
1150
|
-
onClick:
|
|
1194
|
+
onClick: L,
|
|
1151
1195
|
size: "sm",
|
|
1152
1196
|
variant: "secondary",
|
|
1153
1197
|
className: "flex",
|
|
1154
1198
|
children: [
|
|
1155
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
1199
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
|
|
1156
1200
|
"Count"
|
|
1157
1201
|
]
|
|
1158
1202
|
}
|
|
@@ -1166,8 +1210,8 @@ function ll({
|
|
|
1166
1210
|
a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
|
|
1167
1211
|
"div",
|
|
1168
1212
|
{
|
|
1169
|
-
onClick: () =>
|
|
1170
|
-
className:
|
|
1213
|
+
onClick: () => T(h),
|
|
1214
|
+
className: Q(
|
|
1171
1215
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1172
1216
|
{
|
|
1173
1217
|
"bg-muted": ht(h, l)
|
|
@@ -1183,7 +1227,7 @@ function ll({
|
|
|
1183
1227
|
{
|
|
1184
1228
|
onClick: (v) => v.stopPropagation(),
|
|
1185
1229
|
className: "flex items-center justify-end",
|
|
1186
|
-
children: xa.includes(h.data_type) && /* @__PURE__ */ e.jsx(
|
|
1230
|
+
children: xa.includes(h.data_type) && /* @__PURE__ */ e.jsx(ll, { column: h })
|
|
1187
1231
|
}
|
|
1188
1232
|
)
|
|
1189
1233
|
]
|
|
@@ -1197,38 +1241,38 @@ function ll({
|
|
|
1197
1241
|
)
|
|
1198
1242
|
] });
|
|
1199
1243
|
}
|
|
1200
|
-
function
|
|
1244
|
+
function Re(s, t) {
|
|
1201
1245
|
var Xe, Ze, es, ss, as;
|
|
1202
1246
|
let a = Ss(() => [], []);
|
|
1203
|
-
const n =
|
|
1204
|
-
(
|
|
1205
|
-
), o = m(
|
|
1206
|
-
(r) => r.selectedDatamodelId
|
|
1207
|
-
), i = m(
|
|
1208
|
-
(r) => r.selectedDatabaseName
|
|
1247
|
+
const n = ke().authToken || s, l = m(
|
|
1248
|
+
(i) => i.selectedConnectionId
|
|
1209
1249
|
), c = m(
|
|
1210
|
-
(
|
|
1211
|
-
),
|
|
1212
|
-
(
|
|
1250
|
+
(i) => i.selectedDatamodelId
|
|
1251
|
+
), r = m(
|
|
1252
|
+
(i) => i.selectedDatabaseName
|
|
1253
|
+
), o = m(
|
|
1254
|
+
(i) => i.selectedSchemaName
|
|
1255
|
+
), d = m((i) => i.selectedTableName), p = m(
|
|
1256
|
+
(i) => i.actions.setCurrentColumns
|
|
1213
1257
|
), u = m(
|
|
1214
|
-
(
|
|
1258
|
+
(i) => i.actions.setSelectedConnectionId
|
|
1215
1259
|
), y = m(
|
|
1216
|
-
(
|
|
1260
|
+
(i) => i.actions.setSelectedDatamodelId
|
|
1217
1261
|
), g = m(
|
|
1218
|
-
(
|
|
1262
|
+
(i) => i.actions.setSelectedDatabaseName
|
|
1219
1263
|
), x = m(
|
|
1220
|
-
(
|
|
1264
|
+
(i) => i.actions.setSelectedSchemaName
|
|
1221
1265
|
), j = m(
|
|
1222
|
-
(
|
|
1223
|
-
), b = m((
|
|
1224
|
-
function I(
|
|
1225
|
-
return l &&
|
|
1266
|
+
(i) => i.actions.setSelectedTableName
|
|
1267
|
+
), b = m((i) => i.actions.setCardSql);
|
|
1268
|
+
function I(i) {
|
|
1269
|
+
return l && r && o && r !== "NA" ? !0 : l && i === "API" ? !1 : !!(l && i === "S3");
|
|
1226
1270
|
}
|
|
1227
|
-
function C(
|
|
1228
|
-
return !!(l &&
|
|
1271
|
+
function C(i) {
|
|
1272
|
+
return !!(l && r && r !== "NA" && o && d || l && (i === "S3" || i === "API") || c && c);
|
|
1229
1273
|
}
|
|
1230
|
-
function
|
|
1231
|
-
return l &&
|
|
1274
|
+
function T(i) {
|
|
1275
|
+
return l && i ? !(i === "API" || i === "S3") : !1;
|
|
1232
1276
|
}
|
|
1233
1277
|
const {
|
|
1234
1278
|
data: F,
|
|
@@ -1236,7 +1280,7 @@ function qe(s, t) {
|
|
|
1236
1280
|
isError: N
|
|
1237
1281
|
} = Ne({
|
|
1238
1282
|
queryKey: ["connections"],
|
|
1239
|
-
queryFn: () =>
|
|
1283
|
+
queryFn: () => Fe(
|
|
1240
1284
|
"https://semaphor.cloud/api/v1/connections",
|
|
1241
1285
|
(n == null ? void 0 : n.accessToken) || ""
|
|
1242
1286
|
),
|
|
@@ -1244,11 +1288,11 @@ function qe(s, t) {
|
|
|
1244
1288
|
// Only fetch if authToken is present
|
|
1245
1289
|
}), {
|
|
1246
1290
|
data: S,
|
|
1247
|
-
isLoading:
|
|
1291
|
+
isLoading: L,
|
|
1248
1292
|
isError: h
|
|
1249
1293
|
} = Ne({
|
|
1250
1294
|
queryKey: ["models", l],
|
|
1251
|
-
queryFn: () =>
|
|
1295
|
+
queryFn: () => Fe(
|
|
1252
1296
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
1253
1297
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1254
1298
|
{
|
|
@@ -1258,45 +1302,45 @@ function qe(s, t) {
|
|
|
1258
1302
|
enabled: !!(n != null && n.accessToken) && !!l
|
|
1259
1303
|
// Only fetch if authToken is present
|
|
1260
1304
|
}), v = F == null ? void 0 : F.connections.find(
|
|
1261
|
-
(
|
|
1305
|
+
(i) => i.id === l
|
|
1262
1306
|
), f = v == null ? void 0 : v.type, k = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1263
|
-
data:
|
|
1307
|
+
data: M,
|
|
1264
1308
|
isLoading: H,
|
|
1265
1309
|
isFetching: P,
|
|
1266
1310
|
isError: Y,
|
|
1267
1311
|
refetch: ie
|
|
1268
1312
|
} = Ne({
|
|
1269
1313
|
queryKey: ["databases", l],
|
|
1270
|
-
queryFn: () =>
|
|
1314
|
+
queryFn: () => Fe(
|
|
1271
1315
|
"https://semaphor.cloud/api/v1/databases",
|
|
1272
1316
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1273
1317
|
{
|
|
1274
1318
|
connection_id: l
|
|
1275
1319
|
}
|
|
1276
1320
|
),
|
|
1277
|
-
enabled:
|
|
1321
|
+
enabled: T(f)
|
|
1278
1322
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1279
1323
|
}), {
|
|
1280
|
-
data:
|
|
1324
|
+
data: W,
|
|
1281
1325
|
isLoading: ae,
|
|
1282
1326
|
isFetching: w,
|
|
1283
1327
|
isError: _,
|
|
1284
1328
|
refetch: ee
|
|
1285
1329
|
} = Ne({
|
|
1286
|
-
queryKey: ["schemas", l,
|
|
1287
|
-
queryFn: () =>
|
|
1330
|
+
queryKey: ["schemas", l, r],
|
|
1331
|
+
queryFn: () => Fe(
|
|
1288
1332
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1289
1333
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1290
1334
|
{
|
|
1291
1335
|
connection_id: l,
|
|
1292
|
-
database_name:
|
|
1336
|
+
database_name: r
|
|
1293
1337
|
}
|
|
1294
1338
|
),
|
|
1295
|
-
enabled: !!l && !!
|
|
1339
|
+
enabled: !!l && !!r && !k && r !== "NA"
|
|
1296
1340
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1297
1341
|
}), {
|
|
1298
1342
|
data: E,
|
|
1299
|
-
isLoading:
|
|
1343
|
+
isLoading: D,
|
|
1300
1344
|
isFetching: se,
|
|
1301
1345
|
isError: $,
|
|
1302
1346
|
refetch: X
|
|
@@ -1304,42 +1348,42 @@ function qe(s, t) {
|
|
|
1304
1348
|
queryKey: [
|
|
1305
1349
|
"tables",
|
|
1306
1350
|
l,
|
|
1307
|
-
|
|
1308
|
-
|
|
1351
|
+
r,
|
|
1352
|
+
o
|
|
1309
1353
|
],
|
|
1310
|
-
queryFn: () =>
|
|
1354
|
+
queryFn: () => Fe(
|
|
1311
1355
|
"https://semaphor.cloud/api/v1/tables",
|
|
1312
1356
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1313
1357
|
{
|
|
1314
1358
|
connection_id: l,
|
|
1315
|
-
database_name:
|
|
1316
|
-
schema_name:
|
|
1359
|
+
database_name: r,
|
|
1360
|
+
schema_name: o
|
|
1317
1361
|
}
|
|
1318
1362
|
),
|
|
1319
1363
|
enabled: I(f)
|
|
1320
1364
|
}), {
|
|
1321
1365
|
data: te,
|
|
1322
|
-
isLoading:
|
|
1323
|
-
isFetching:
|
|
1366
|
+
isLoading: Le,
|
|
1367
|
+
isFetching: ze,
|
|
1324
1368
|
isError: be
|
|
1325
1369
|
} = Ne({
|
|
1326
1370
|
queryKey: [
|
|
1327
1371
|
"columns",
|
|
1328
1372
|
l,
|
|
1329
|
-
|
|
1330
|
-
o,
|
|
1373
|
+
r,
|
|
1331
1374
|
c,
|
|
1375
|
+
o,
|
|
1332
1376
|
d
|
|
1333
1377
|
],
|
|
1334
|
-
queryFn: () =>
|
|
1378
|
+
queryFn: () => Fe(
|
|
1335
1379
|
"https://semaphor.cloud/api/v1/columns",
|
|
1336
1380
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1337
1381
|
{
|
|
1338
1382
|
connection_id: l,
|
|
1339
|
-
datamodel_id:
|
|
1383
|
+
datamodel_id: c || "",
|
|
1340
1384
|
// don't pass undefined. Pass empty string
|
|
1341
|
-
database_name:
|
|
1342
|
-
schema_name:
|
|
1385
|
+
database_name: r,
|
|
1386
|
+
schema_name: o,
|
|
1343
1387
|
table_name: d
|
|
1344
1388
|
}
|
|
1345
1389
|
),
|
|
@@ -1363,48 +1407,48 @@ function qe(s, t) {
|
|
|
1363
1407
|
g,
|
|
1364
1408
|
v
|
|
1365
1409
|
]);
|
|
1366
|
-
const ye = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : d || "",
|
|
1367
|
-
function oe(
|
|
1368
|
-
x(
|
|
1410
|
+
const ye = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : d || "", J = k ? "" : o || "";
|
|
1411
|
+
function oe(i) {
|
|
1412
|
+
x(i), j("");
|
|
1369
1413
|
}
|
|
1370
|
-
function ce(
|
|
1371
|
-
g(
|
|
1414
|
+
function ce(i) {
|
|
1415
|
+
g(i === "none" ? "" : i), x(""), j(""), i !== "none" && i !== "" && y("");
|
|
1372
1416
|
}
|
|
1373
|
-
function Oe(
|
|
1374
|
-
u(
|
|
1417
|
+
function Oe(i) {
|
|
1418
|
+
u(i);
|
|
1375
1419
|
}
|
|
1376
|
-
function
|
|
1377
|
-
y(
|
|
1420
|
+
function Me(i) {
|
|
1421
|
+
y(i === "none" ? "" : i), i !== "none" && i !== "" && g("");
|
|
1378
1422
|
}
|
|
1379
|
-
|
|
1380
|
-
...
|
|
1381
|
-
data_type:
|
|
1423
|
+
M && ((Ze = M == null ? void 0 : M.databases) == null ? void 0 : Ze.length) > 0, W && ((es = W == null ? void 0 : W.schemas) == null ? void 0 : es.length) > 0, te && ((ss = te == null ? void 0 : te.columns) == null ? void 0 : ss.length) > 0 && (a = te.columns.map((i) => ({
|
|
1424
|
+
...i,
|
|
1425
|
+
data_type: i.data_type.toLowerCase()
|
|
1382
1426
|
}))), Y && (a = []), (be || N) && (a = []);
|
|
1383
|
-
const
|
|
1384
|
-
(
|
|
1385
|
-
id:
|
|
1386
|
-
name:
|
|
1387
|
-
type:
|
|
1427
|
+
const He = F == null ? void 0 : F.connections.map(
|
|
1428
|
+
(i) => ({
|
|
1429
|
+
id: i.id,
|
|
1430
|
+
name: i.name,
|
|
1431
|
+
type: i.type
|
|
1388
1432
|
})
|
|
1389
|
-
),
|
|
1390
|
-
id:
|
|
1391
|
-
name:
|
|
1392
|
-
})), Ee =
|
|
1393
|
-
id:
|
|
1394
|
-
name:
|
|
1395
|
-
})), gs =
|
|
1396
|
-
id:
|
|
1397
|
-
name:
|
|
1398
|
-
})), Ye = E == null ? void 0 : E.tables.map((
|
|
1399
|
-
id:
|
|
1400
|
-
name:
|
|
1433
|
+
), $e = (as = S == null ? void 0 : S.datamodels) == null ? void 0 : as.map((i) => ({
|
|
1434
|
+
id: i.id,
|
|
1435
|
+
name: i.name
|
|
1436
|
+
})), Ee = M == null ? void 0 : M.databases.map((i) => ({
|
|
1437
|
+
id: i.database_name,
|
|
1438
|
+
name: i.database_name
|
|
1439
|
+
})), gs = W == null ? void 0 : W.schemas.map((i) => ({
|
|
1440
|
+
id: i.schema_name,
|
|
1441
|
+
name: i.schema_name
|
|
1442
|
+
})), Ye = E == null ? void 0 : E.tables.map((i) => ({
|
|
1443
|
+
id: i.table_name,
|
|
1444
|
+
name: i.table_name
|
|
1401
1445
|
}));
|
|
1402
1446
|
return {
|
|
1403
|
-
connectionItems:
|
|
1447
|
+
connectionItems: He,
|
|
1404
1448
|
isConnectionsLoading: A,
|
|
1405
1449
|
isConnectionsError: N,
|
|
1406
|
-
modelItems:
|
|
1407
|
-
isModelsLoading:
|
|
1450
|
+
modelItems: $e,
|
|
1451
|
+
isModelsLoading: L,
|
|
1408
1452
|
isModelsError: h,
|
|
1409
1453
|
databaseItems: Ee,
|
|
1410
1454
|
isDatabasesLoadingOrFetching: H || P,
|
|
@@ -1413,17 +1457,17 @@ function qe(s, t) {
|
|
|
1413
1457
|
isSchemaLoadingOrFetching: ae || w,
|
|
1414
1458
|
isSchemaError: _,
|
|
1415
1459
|
tableItems: Ye,
|
|
1416
|
-
isTableLoadingOrFetching:
|
|
1460
|
+
isTableLoadingOrFetching: D || se,
|
|
1417
1461
|
isTableError: $,
|
|
1418
1462
|
columns: a,
|
|
1419
|
-
isColumnsLoadingOrFetching:
|
|
1463
|
+
isColumnsLoadingOrFetching: Le || ze,
|
|
1420
1464
|
isColumnsError: be,
|
|
1421
1465
|
isNonDbConnection: k,
|
|
1422
1466
|
connectionType: f,
|
|
1423
1467
|
tableName: ye,
|
|
1424
|
-
schemaName:
|
|
1468
|
+
schemaName: J,
|
|
1425
1469
|
handleConnectionChange: Oe,
|
|
1426
|
-
handleDatamodelChange:
|
|
1470
|
+
handleDatamodelChange: Me,
|
|
1427
1471
|
handleDatabaseChange: ce,
|
|
1428
1472
|
handleSchemaChange: oe
|
|
1429
1473
|
};
|
|
@@ -1440,10 +1484,10 @@ function Aa({
|
|
|
1440
1484
|
($) => $.selectedDatabaseName
|
|
1441
1485
|
), l = m(
|
|
1442
1486
|
($) => $.selectedSchemaName
|
|
1443
|
-
),
|
|
1487
|
+
), c = m(($) => $.selectedTableName), r = m(
|
|
1444
1488
|
($) => $.actions.setSelectedTableName
|
|
1445
1489
|
), {
|
|
1446
|
-
connectionItems:
|
|
1490
|
+
connectionItems: o,
|
|
1447
1491
|
modelItems: d,
|
|
1448
1492
|
schemaItems: p,
|
|
1449
1493
|
databaseItems: u,
|
|
@@ -1454,25 +1498,25 @@ function Aa({
|
|
|
1454
1498
|
isConnectionsError: b,
|
|
1455
1499
|
isModelsError: I,
|
|
1456
1500
|
isDatabasesLoadingOrFetching: C,
|
|
1457
|
-
isDatabaseError:
|
|
1501
|
+
isDatabaseError: T,
|
|
1458
1502
|
isSchemaLoadingOrFetching: F,
|
|
1459
1503
|
isSchemaError: A,
|
|
1460
1504
|
isColumnsError: N,
|
|
1461
1505
|
isColumnsLoadingOrFetching: S,
|
|
1462
|
-
isTableLoadingOrFetching:
|
|
1506
|
+
isTableLoadingOrFetching: L,
|
|
1463
1507
|
isTableError: h,
|
|
1464
1508
|
connectionType: v,
|
|
1465
1509
|
isNonDbConnection: f,
|
|
1466
1510
|
handleConnectionChange: k,
|
|
1467
|
-
handleDatabaseChange:
|
|
1511
|
+
handleDatabaseChange: M,
|
|
1468
1512
|
handleSchemaChange: H,
|
|
1469
1513
|
handleDatamodelChange: P,
|
|
1470
1514
|
tableName: Y,
|
|
1471
1515
|
schemaName: ie
|
|
1472
|
-
} =
|
|
1473
|
-
function
|
|
1516
|
+
} = Re();
|
|
1517
|
+
function W() {
|
|
1474
1518
|
return s ? s(ie, Y, g) : /* @__PURE__ */ e.jsx(
|
|
1475
|
-
|
|
1519
|
+
rl,
|
|
1476
1520
|
{
|
|
1477
1521
|
schemaName: ie,
|
|
1478
1522
|
tableName: Y,
|
|
@@ -1488,11 +1532,11 @@ function Aa({
|
|
|
1488
1532
|
if (!t || v === "S3" || v === "API") return null;
|
|
1489
1533
|
if (!a || a === "none")
|
|
1490
1534
|
return /* @__PURE__ */ e.jsx(
|
|
1491
|
-
|
|
1535
|
+
Pe,
|
|
1492
1536
|
{
|
|
1493
1537
|
showNone: !0,
|
|
1494
|
-
onChange:
|
|
1495
|
-
isError:
|
|
1538
|
+
onChange: M,
|
|
1539
|
+
isError: T,
|
|
1496
1540
|
isLoading: C,
|
|
1497
1541
|
items: u,
|
|
1498
1542
|
value: n || "",
|
|
@@ -1512,7 +1556,7 @@ function Aa({
|
|
|
1512
1556
|
if (!t || v === "S3" || v === "API") return null;
|
|
1513
1557
|
if (!n || n === "none")
|
|
1514
1558
|
return /* @__PURE__ */ e.jsx(
|
|
1515
|
-
|
|
1559
|
+
Pe,
|
|
1516
1560
|
{
|
|
1517
1561
|
showNone: !0,
|
|
1518
1562
|
onChange: P,
|
|
@@ -1526,7 +1570,7 @@ function Aa({
|
|
|
1526
1570
|
}
|
|
1527
1571
|
function E() {
|
|
1528
1572
|
return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1529
|
-
|
|
1573
|
+
Pe,
|
|
1530
1574
|
{
|
|
1531
1575
|
onChange: H,
|
|
1532
1576
|
isError: A,
|
|
@@ -1537,19 +1581,19 @@ function Aa({
|
|
|
1537
1581
|
}
|
|
1538
1582
|
);
|
|
1539
1583
|
}
|
|
1540
|
-
function
|
|
1584
|
+
function D() {
|
|
1541
1585
|
function $() {
|
|
1542
1586
|
let X = !1;
|
|
1543
1587
|
return v === "API" ? (X = !1, X) : ((v === "S3" || t && n && n !== "none" && l) && (X = !0), X);
|
|
1544
1588
|
}
|
|
1545
1589
|
return $() ? /* @__PURE__ */ e.jsx(
|
|
1546
|
-
|
|
1590
|
+
Pe,
|
|
1547
1591
|
{
|
|
1548
|
-
onChange:
|
|
1592
|
+
onChange: r,
|
|
1549
1593
|
isError: h,
|
|
1550
1594
|
items: y,
|
|
1551
|
-
isLoading:
|
|
1552
|
-
value:
|
|
1595
|
+
isLoading: L,
|
|
1596
|
+
value: c || "",
|
|
1553
1597
|
title: "Table"
|
|
1554
1598
|
}
|
|
1555
1599
|
) : null;
|
|
@@ -1557,15 +1601,15 @@ function Aa({
|
|
|
1557
1601
|
return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
|
|
1558
1602
|
/* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
|
|
1559
1603
|
/* @__PURE__ */ e.jsx(
|
|
1560
|
-
|
|
1604
|
+
Pe,
|
|
1561
1605
|
{
|
|
1562
|
-
items:
|
|
1606
|
+
items: o,
|
|
1563
1607
|
title: "Connection",
|
|
1564
1608
|
value: t || "",
|
|
1565
1609
|
onChange: k,
|
|
1566
1610
|
isLoading: x,
|
|
1567
1611
|
isError: b,
|
|
1568
|
-
connectionTooltip: ((se =
|
|
1612
|
+
connectionTooltip: ((se = o == null ? void 0 : o.find(
|
|
1569
1613
|
($) => $.id === t
|
|
1570
1614
|
)) == null ? void 0 : se.type) || ""
|
|
1571
1615
|
}
|
|
@@ -1574,11 +1618,11 @@ function Aa({
|
|
|
1574
1618
|
_(),
|
|
1575
1619
|
w(),
|
|
1576
1620
|
E(),
|
|
1577
|
-
|
|
1621
|
+
D()
|
|
1578
1622
|
] }),
|
|
1579
|
-
|
|
1623
|
+
W(),
|
|
1580
1624
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1581
|
-
|
|
1625
|
+
O,
|
|
1582
1626
|
{
|
|
1583
1627
|
onClick: ae,
|
|
1584
1628
|
size: "sm",
|
|
@@ -1592,30 +1636,30 @@ function Aa({
|
|
|
1592
1636
|
) })
|
|
1593
1637
|
] });
|
|
1594
1638
|
}
|
|
1595
|
-
function
|
|
1639
|
+
function il(s) {
|
|
1596
1640
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1597
|
-
let
|
|
1598
|
-
if (l !== -1 && (
|
|
1599
|
-
const
|
|
1600
|
-
return `${
|
|
1641
|
+
let c = s.length;
|
|
1642
|
+
if (l !== -1 && (c = l), n !== -1 && n < c && (c = n), t !== -1) {
|
|
1643
|
+
const r = s.substring(0, t), o = s.substring(t);
|
|
1644
|
+
return `${r} {{ filters | where }} AND ${o.substring(
|
|
1601
1645
|
6
|
|
1602
1646
|
)}`;
|
|
1603
1647
|
} else if (a !== -1) {
|
|
1604
|
-
const
|
|
1605
|
-
return `${
|
|
1648
|
+
const r = s.substring(0, a), o = s.substring(a);
|
|
1649
|
+
return `${r} {{ filters | where }} ${o}`;
|
|
1606
1650
|
} else {
|
|
1607
|
-
const
|
|
1608
|
-
return `${
|
|
1651
|
+
const r = s.substring(0, c), o = s.substring(c);
|
|
1652
|
+
return `${r} {{ filters | where }} ${o}`;
|
|
1609
1653
|
}
|
|
1610
1654
|
}
|
|
1611
|
-
function
|
|
1655
|
+
function ol({
|
|
1612
1656
|
error: s,
|
|
1613
1657
|
setShowAIDialog: t,
|
|
1614
1658
|
setUserInputforAI: a,
|
|
1615
1659
|
setTriggerAIRun: n
|
|
1616
1660
|
}) {
|
|
1617
1661
|
return /* @__PURE__ */ e.jsxs(Vs, { openDelay: 0, children: [
|
|
1618
|
-
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1662
|
+
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1619
1663
|
/* @__PURE__ */ e.jsx(
|
|
1620
1664
|
Rs,
|
|
1621
1665
|
{
|
|
@@ -1624,7 +1668,7 @@ function il({
|
|
|
1624
1668
|
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: [
|
|
1625
1669
|
/* @__PURE__ */ e.jsx(We, { 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 }) }),
|
|
1626
1670
|
/* @__PURE__ */ e.jsxs(
|
|
1627
|
-
|
|
1671
|
+
O,
|
|
1628
1672
|
{
|
|
1629
1673
|
onClick: () => {
|
|
1630
1674
|
t(!0), a(s), n(!0);
|
|
@@ -1632,7 +1676,7 @@ function il({
|
|
|
1632
1676
|
size: "sm",
|
|
1633
1677
|
variant: "outline",
|
|
1634
1678
|
children: [
|
|
1635
|
-
/* @__PURE__ */ e.jsx(
|
|
1679
|
+
/* @__PURE__ */ e.jsx(Ln, { className: "mr-2 h-4 w-4" }),
|
|
1636
1680
|
"Debug with AI"
|
|
1637
1681
|
]
|
|
1638
1682
|
}
|
|
@@ -1642,7 +1686,7 @@ function il({
|
|
|
1642
1686
|
)
|
|
1643
1687
|
] });
|
|
1644
1688
|
}
|
|
1645
|
-
const
|
|
1689
|
+
const cl = `
|
|
1646
1690
|
|
|
1647
1691
|
Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
|
|
1648
1692
|
|
|
@@ -1689,25 +1733,25 @@ SELECT label, measure FROM table
|
|
|
1689
1733
|
- Label - Category
|
|
1690
1734
|
- Measure - Number
|
|
1691
1735
|
`;
|
|
1692
|
-
function
|
|
1736
|
+
function dl({
|
|
1693
1737
|
open: s,
|
|
1694
1738
|
setOpen: t,
|
|
1695
1739
|
userInput: a,
|
|
1696
1740
|
setUserInput: n,
|
|
1697
1741
|
triggerAIRun: l,
|
|
1698
|
-
setTriggerAIRun:
|
|
1742
|
+
setTriggerAIRun: c
|
|
1699
1743
|
}) {
|
|
1700
|
-
const
|
|
1744
|
+
const r = ws(null), o = ws(null), { authToken: d } = ke(), [p, u] = q(!1), y = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), x = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [b, I] = q([]), C = m((w) => w.currentColumns), T = m((w) => w.card.sql), F = m((w) => w.selectedTableName), A = `
|
|
1701
1745
|
${a}
|
|
1702
1746
|
|
|
1703
1747
|
Database Query Dialect: ${F === "api" || F === "s3" ? "DuckDb" : ""}
|
|
1704
1748
|
Table Name: ${F}
|
|
1705
1749
|
Table Columns: ${C == null ? void 0 : C.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
|
|
1706
|
-
User SQL: ${
|
|
1750
|
+
User SQL: ${T}
|
|
1707
1751
|
${g && `Base Queries: ${JSON.stringify(g)} `}`, N = ` 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.
|
|
1708
|
-
Visual Query Syntax: ${
|
|
1752
|
+
Visual Query Syntax: ${cl}`, { data: S, isLoading: L, isFetching: h, isError: v, refetch: f } = Ne({
|
|
1709
1753
|
queryKey: ["ai-query"],
|
|
1710
|
-
queryFn: () =>
|
|
1754
|
+
queryFn: () => Fe(
|
|
1711
1755
|
"https://semaphor.cloud/api/v1/ai",
|
|
1712
1756
|
(d == null ? void 0 : d.accessToken) || "",
|
|
1713
1757
|
{
|
|
@@ -1743,19 +1787,19 @@ function cl({
|
|
|
1743
1787
|
}, [S]), Z(() => {
|
|
1744
1788
|
const w = setTimeout(() => {
|
|
1745
1789
|
var _;
|
|
1746
|
-
|
|
1747
|
-
top:
|
|
1790
|
+
o.current && (o.current.scroll({
|
|
1791
|
+
top: o.current.scrollHeight,
|
|
1748
1792
|
behavior: "smooth"
|
|
1749
|
-
}), (_ =
|
|
1793
|
+
}), (_ = r.current) == null || _.focus());
|
|
1750
1794
|
}, 100);
|
|
1751
1795
|
return () => clearTimeout(w);
|
|
1752
1796
|
}, [b]);
|
|
1753
|
-
function
|
|
1797
|
+
function M() {
|
|
1754
1798
|
a && (I((w) => [...w, { role: "user", content: a }]), k(a) && u(!0), n(""), f());
|
|
1755
1799
|
}
|
|
1756
1800
|
Z(() => {
|
|
1757
|
-
l && (
|
|
1758
|
-
}, [l,
|
|
1801
|
+
l && (M(), c(!1));
|
|
1802
|
+
}, [l, c]);
|
|
1759
1803
|
const H = {
|
|
1760
1804
|
//seleect a darker color
|
|
1761
1805
|
// color: '#000',
|
|
@@ -1788,12 +1832,12 @@ function cl({
|
|
|
1788
1832
|
pre: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
|
|
1789
1833
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: _.children }),
|
|
1790
1834
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1791
|
-
/* @__PURE__ */ e.jsx(
|
|
1835
|
+
/* @__PURE__ */ e.jsx(O, { onClick: W, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
|
|
1792
1836
|
/* @__PURE__ */ e.jsx(
|
|
1793
|
-
|
|
1837
|
+
O,
|
|
1794
1838
|
{
|
|
1795
1839
|
onClick: (ee) => {
|
|
1796
|
-
const E =
|
|
1840
|
+
const E = W(ee);
|
|
1797
1841
|
E && (t(!1), y(E), x(!0));
|
|
1798
1842
|
},
|
|
1799
1843
|
size: "sm",
|
|
@@ -1806,7 +1850,7 @@ function cl({
|
|
|
1806
1850
|
li: ({ node: w, ..._ }) => /* @__PURE__ */ e.jsx("li", { style: Y, ..._ })
|
|
1807
1851
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1808
1852
|
};
|
|
1809
|
-
function
|
|
1853
|
+
function W(w) {
|
|
1810
1854
|
const _ = w.currentTarget.closest("pre");
|
|
1811
1855
|
if (!_) return;
|
|
1812
1856
|
const ee = _.textContent || _.innerText;
|
|
@@ -1835,7 +1879,7 @@ function cl({
|
|
|
1835
1879
|
}
|
|
1836
1880
|
return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
|
|
1837
1881
|
/* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1838
|
-
|
|
1882
|
+
O,
|
|
1839
1883
|
{
|
|
1840
1884
|
size: "sm",
|
|
1841
1885
|
className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
@@ -1844,18 +1888,18 @@ function cl({
|
|
|
1844
1888
|
}
|
|
1845
1889
|
) }),
|
|
1846
1890
|
/* @__PURE__ */ e.jsxs(
|
|
1847
|
-
|
|
1891
|
+
Ts,
|
|
1848
1892
|
{
|
|
1849
1893
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1850
1894
|
children: [
|
|
1851
|
-
/* @__PURE__ */ e.jsxs(
|
|
1852
|
-
/* @__PURE__ */ e.jsx(
|
|
1895
|
+
/* @__PURE__ */ e.jsxs(Ls, { children: [
|
|
1896
|
+
/* @__PURE__ */ e.jsx(Ms, { children: "Assistant" }),
|
|
1853
1897
|
/* @__PURE__ */ e.jsx(Es, { children: "What can I help you with?" })
|
|
1854
1898
|
] }),
|
|
1855
1899
|
/* @__PURE__ */ e.jsx(
|
|
1856
1900
|
"div",
|
|
1857
1901
|
{
|
|
1858
|
-
ref:
|
|
1902
|
+
ref: o,
|
|
1859
1903
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
1860
1904
|
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: ae() })
|
|
1861
1905
|
}
|
|
@@ -1868,32 +1912,32 @@ function cl({
|
|
|
1868
1912
|
ga,
|
|
1869
1913
|
{
|
|
1870
1914
|
autoFocus: !0,
|
|
1871
|
-
ref:
|
|
1915
|
+
ref: r,
|
|
1872
1916
|
onKeyDown: (w) => {
|
|
1873
|
-
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), n(""),
|
|
1917
|
+
w.key === "Enter" && !w.shiftKey && (w.preventDefault(), n(""), M());
|
|
1874
1918
|
},
|
|
1875
1919
|
placeholder: "Type your question here...",
|
|
1876
1920
|
onFocus: (w) => {
|
|
1877
1921
|
const _ = w.target, ee = _.value.length;
|
|
1878
1922
|
_.setSelectionRange(ee, ee);
|
|
1879
1923
|
},
|
|
1880
|
-
className:
|
|
1924
|
+
className: Q(
|
|
1881
1925
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1882
1926
|
),
|
|
1883
|
-
disabled:
|
|
1927
|
+
disabled: L || h,
|
|
1884
1928
|
value: a,
|
|
1885
1929
|
onChange: (w) => n(w.target.value)
|
|
1886
1930
|
}
|
|
1887
1931
|
),
|
|
1888
1932
|
" ",
|
|
1889
1933
|
/* @__PURE__ */ e.jsx(
|
|
1890
|
-
|
|
1934
|
+
O,
|
|
1891
1935
|
{
|
|
1892
1936
|
className: "h-8",
|
|
1893
1937
|
size: "sm",
|
|
1894
1938
|
variant: "ghost",
|
|
1895
|
-
onClick:
|
|
1896
|
-
children: !
|
|
1939
|
+
onClick: M,
|
|
1940
|
+
children: !L && !h ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1897
1941
|
}
|
|
1898
1942
|
)
|
|
1899
1943
|
] })
|
|
@@ -1910,18 +1954,18 @@ var Va = {
|
|
|
1910
1954
|
className: void 0,
|
|
1911
1955
|
style: void 0,
|
|
1912
1956
|
attr: void 0
|
|
1913
|
-
}, sa = we.createContext && /* @__PURE__ */ we.createContext(Va),
|
|
1914
|
-
function
|
|
1957
|
+
}, sa = we.createContext && /* @__PURE__ */ we.createContext(Va), ul = ["attr", "size", "title"];
|
|
1958
|
+
function ml(s, t) {
|
|
1915
1959
|
if (s == null) return {};
|
|
1916
|
-
var a =
|
|
1960
|
+
var a = hl(s, t), n, l;
|
|
1917
1961
|
if (Object.getOwnPropertySymbols) {
|
|
1918
|
-
var
|
|
1919
|
-
for (l = 0; l <
|
|
1920
|
-
n =
|
|
1962
|
+
var c = Object.getOwnPropertySymbols(s);
|
|
1963
|
+
for (l = 0; l < c.length; l++)
|
|
1964
|
+
n = c[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1921
1965
|
}
|
|
1922
1966
|
return a;
|
|
1923
1967
|
}
|
|
1924
|
-
function
|
|
1968
|
+
function hl(s, t) {
|
|
1925
1969
|
if (s == null) return {};
|
|
1926
1970
|
var a = {};
|
|
1927
1971
|
for (var n in s)
|
|
@@ -1955,21 +1999,21 @@ function ds(s) {
|
|
|
1955
1999
|
for (var t = 1; t < arguments.length; t++) {
|
|
1956
2000
|
var a = arguments[t] != null ? arguments[t] : {};
|
|
1957
2001
|
t % 2 ? aa(Object(a), !0).forEach(function(n) {
|
|
1958
|
-
|
|
2002
|
+
xl(s, n, a[n]);
|
|
1959
2003
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : aa(Object(a)).forEach(function(n) {
|
|
1960
2004
|
Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(a, n));
|
|
1961
2005
|
});
|
|
1962
2006
|
}
|
|
1963
2007
|
return s;
|
|
1964
2008
|
}
|
|
1965
|
-
function
|
|
1966
|
-
return t =
|
|
2009
|
+
function xl(s, t, a) {
|
|
2010
|
+
return t = pl(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
|
|
1967
2011
|
}
|
|
1968
|
-
function
|
|
1969
|
-
var t =
|
|
2012
|
+
function pl(s) {
|
|
2013
|
+
var t = fl(s, "string");
|
|
1970
2014
|
return typeof t == "symbol" ? t : t + "";
|
|
1971
2015
|
}
|
|
1972
|
-
function
|
|
2016
|
+
function fl(s, t) {
|
|
1973
2017
|
if (typeof s != "object" || !s) return s;
|
|
1974
2018
|
var a = s[Symbol.toPrimitive];
|
|
1975
2019
|
if (a !== void 0) {
|
|
@@ -1985,39 +2029,39 @@ function qa(s) {
|
|
|
1985
2029
|
}, t.attr), qa(t.child)));
|
|
1986
2030
|
}
|
|
1987
2031
|
function je(s) {
|
|
1988
|
-
return (t) => /* @__PURE__ */ we.createElement(
|
|
2032
|
+
return (t) => /* @__PURE__ */ we.createElement(gl, cs({
|
|
1989
2033
|
attr: ds({}, s.attr)
|
|
1990
2034
|
}, t), qa(s.child));
|
|
1991
2035
|
}
|
|
1992
|
-
function
|
|
2036
|
+
function gl(s) {
|
|
1993
2037
|
var t = (a) => {
|
|
1994
2038
|
var {
|
|
1995
2039
|
attr: n,
|
|
1996
2040
|
size: l,
|
|
1997
|
-
title:
|
|
1998
|
-
} = s,
|
|
2041
|
+
title: c
|
|
2042
|
+
} = s, r = ml(s, ul), o = l || a.size || "1em", d;
|
|
1999
2043
|
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ we.createElement("svg", cs({
|
|
2000
2044
|
stroke: "currentColor",
|
|
2001
2045
|
fill: "currentColor",
|
|
2002
2046
|
strokeWidth: "0"
|
|
2003
|
-
}, a.attr, n,
|
|
2047
|
+
}, a.attr, n, r, {
|
|
2004
2048
|
className: d,
|
|
2005
2049
|
style: ds(ds({
|
|
2006
2050
|
color: s.color || a.color
|
|
2007
2051
|
}, a.style), s.style),
|
|
2008
|
-
height:
|
|
2009
|
-
width:
|
|
2052
|
+
height: o,
|
|
2053
|
+
width: o,
|
|
2010
2054
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2011
|
-
}),
|
|
2055
|
+
}), c && /* @__PURE__ */ we.createElement("title", null, c), s.children);
|
|
2012
2056
|
};
|
|
2013
2057
|
return sa !== void 0 ? /* @__PURE__ */ we.createElement(sa.Consumer, null, (a) => t(a)) : t(Va);
|
|
2014
2058
|
}
|
|
2015
|
-
function
|
|
2059
|
+
function jl(s) {
|
|
2016
2060
|
return je({ 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);
|
|
2017
2061
|
}
|
|
2018
|
-
function
|
|
2062
|
+
function bl({ sql: s }) {
|
|
2019
2063
|
return /* @__PURE__ */ e.jsxs(Vs, { children: [
|
|
2020
|
-
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2064
|
+
/* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2021
2065
|
/* @__PURE__ */ e.jsx(
|
|
2022
2066
|
Rs,
|
|
2023
2067
|
{
|
|
@@ -2031,129 +2075,129 @@ function jl({ sql: s }) {
|
|
|
2031
2075
|
)
|
|
2032
2076
|
] });
|
|
2033
2077
|
}
|
|
2034
|
-
function
|
|
2078
|
+
function yl() {
|
|
2035
2079
|
const [s, t] = q({
|
|
2036
2080
|
queryKey: [],
|
|
2037
2081
|
queryData: null
|
|
2038
|
-
}), { theme: a } = bt(), n = yt(), l = ws(),
|
|
2039
|
-
|
|
2040
|
-
const C = m((
|
|
2041
|
-
|
|
2082
|
+
}), { theme: a } = bt(), n = yt(), l = ws(), c = vt(), [r, o] = q(!1), [d, p] = q(!1), [u, y] = q(!1), [g, x] = q(""), [j, b] = q(!1), I = z((i) => i.selectedSheetId);
|
|
2083
|
+
z((i) => i.dashboard.baseQueries);
|
|
2084
|
+
const C = m((i) => i.card), T = z((i) => i.theme), F = m((i) => i.isShowingVisual);
|
|
2085
|
+
z((i) => i.onAcceptChanges);
|
|
2042
2086
|
const A = m(
|
|
2043
|
-
(
|
|
2087
|
+
(i) => i.selectedConnectionId
|
|
2044
2088
|
), N = m(
|
|
2045
|
-
(
|
|
2089
|
+
(i) => i.selectedDatabaseName
|
|
2046
2090
|
), S = m(
|
|
2047
|
-
(
|
|
2048
|
-
),
|
|
2049
|
-
(
|
|
2091
|
+
(i) => i.selectedDatamodelId
|
|
2092
|
+
), L = m(
|
|
2093
|
+
(i) => i.selectedSchemaName
|
|
2050
2094
|
);
|
|
2051
|
-
|
|
2052
|
-
(
|
|
2095
|
+
z(
|
|
2096
|
+
(i) => i.actions.updateFrameCard
|
|
2053
2097
|
);
|
|
2054
|
-
const h = m((
|
|
2055
|
-
(
|
|
2098
|
+
const h = m((i) => i.selectedTableName), v = m((i) => i.card.sql), f = m((i) => i.card.python), k = m((i) => i.frame), M = z((i) => i.dashboard.filters), H = z((i) => i.filterValues), P = M == null ? void 0 : M.filter(
|
|
2099
|
+
(i) => i.sheetId === I || !i.sheetId
|
|
2056
2100
|
), Y = H == null ? void 0 : H.filter(
|
|
2057
|
-
(
|
|
2058
|
-
), ie = m((
|
|
2059
|
-
setCardCustomCfg:
|
|
2101
|
+
(i) => (P == null ? void 0 : P.some((ne) => ne.id === i.filterId)) || i.filterId.endsWith(I)
|
|
2102
|
+
), ie = m((i) => i.applyFilters), {
|
|
2103
|
+
setCardCustomCfg: W,
|
|
2060
2104
|
setQueryResultColumns: ae,
|
|
2061
2105
|
setFilterValues: w,
|
|
2062
2106
|
setCardSql: _,
|
|
2063
2107
|
setCard: ee,
|
|
2064
2108
|
setCardPython: E,
|
|
2065
|
-
setQueryError:
|
|
2109
|
+
setQueryError: D,
|
|
2066
2110
|
setPythonStdOut: se,
|
|
2067
2111
|
setCardPreferences: $
|
|
2068
|
-
} = m((
|
|
2112
|
+
} = m((i) => i.actions), X = m((i) => i.onSave);
|
|
2069
2113
|
m(
|
|
2070
|
-
(
|
|
2114
|
+
(i) => i.actions.setApplyFilters
|
|
2071
2115
|
);
|
|
2072
|
-
const te = m((
|
|
2073
|
-
m((
|
|
2116
|
+
const te = m((i) => i.onClose), Le = m((i) => i.actions.setSqlGen), ze = m((i) => i.runSql), be = m((i) => i.actions.setRunSql);
|
|
2117
|
+
m((i) => i.actions.setCardCfg);
|
|
2074
2118
|
const ye = m(
|
|
2075
|
-
(
|
|
2119
|
+
(i) => i.actions.setIsSqlRunning
|
|
2076
2120
|
), {
|
|
2077
|
-
data:
|
|
2121
|
+
data: J,
|
|
2078
2122
|
isLoading: oe,
|
|
2079
2123
|
isFetching: ce,
|
|
2080
2124
|
isSuccess: Oe,
|
|
2081
|
-
isError:
|
|
2082
|
-
error:
|
|
2083
|
-
queryKey:
|
|
2125
|
+
isError: Me,
|
|
2126
|
+
error: He,
|
|
2127
|
+
queryKey: $e,
|
|
2084
2128
|
refetch: Ee
|
|
2085
|
-
} =
|
|
2129
|
+
} = qe(C);
|
|
2086
2130
|
Z(() => {
|
|
2087
|
-
if (
|
|
2131
|
+
if (J && (J.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2088
2132
|
position: "top-center",
|
|
2089
2133
|
richColors: !0
|
|
2090
|
-
}), se((
|
|
2091
|
-
const { dimensionKeys:
|
|
2092
|
-
ae(
|
|
2134
|
+
}), se((J == null ? void 0 : J.output) || ""), J.records.length > 0)) {
|
|
2135
|
+
const { dimensionKeys: i } = vs(J.records);
|
|
2136
|
+
ae(i);
|
|
2093
2137
|
}
|
|
2094
2138
|
}, [
|
|
2095
|
-
|
|
2139
|
+
J,
|
|
2096
2140
|
// setCardData,
|
|
2097
2141
|
ae,
|
|
2098
2142
|
se
|
|
2099
2143
|
]), Z(() => {
|
|
2100
|
-
(oe || ce) && ye(!0), (
|
|
2144
|
+
(oe || ce) && ye(!0), (Me || Oe) && ye(!1), Me ? (D(He.message), ae([]), se("")) : D("");
|
|
2101
2145
|
}, [
|
|
2102
2146
|
oe,
|
|
2103
2147
|
ce,
|
|
2104
|
-
|
|
2148
|
+
J,
|
|
2105
2149
|
se,
|
|
2106
|
-
|
|
2150
|
+
Me,
|
|
2107
2151
|
Oe,
|
|
2108
2152
|
ye,
|
|
2109
2153
|
ae,
|
|
2110
|
-
|
|
2111
|
-
|
|
2154
|
+
D,
|
|
2155
|
+
He
|
|
2112
2156
|
]), Z(() => {
|
|
2113
|
-
|
|
2114
|
-
}, [
|
|
2157
|
+
ze && (Ee(), be(!1));
|
|
2158
|
+
}, [ze, Ee, be]);
|
|
2115
2159
|
function gs() {
|
|
2116
|
-
const
|
|
2160
|
+
const i = n.getQueryData($e);
|
|
2117
2161
|
s.queryData || t({
|
|
2118
|
-
queryKey:
|
|
2119
|
-
queryData:
|
|
2120
|
-
}), n.setQueryData(
|
|
2162
|
+
queryKey: $e,
|
|
2163
|
+
queryData: i
|
|
2164
|
+
}), n.setQueryData($e, null), _(""), Le({}), W(""), $({});
|
|
2121
2165
|
}
|
|
2122
|
-
const Ye = (
|
|
2123
|
-
l.current =
|
|
2166
|
+
const Ye = (i) => {
|
|
2167
|
+
l.current = i;
|
|
2124
2168
|
};
|
|
2125
|
-
function Xe(
|
|
2126
|
-
if (
|
|
2169
|
+
function Xe(i, ne) {
|
|
2170
|
+
if (i.length === 0)
|
|
2127
2171
|
return "";
|
|
2128
2172
|
if (ne) {
|
|
2129
|
-
const ve =
|
|
2173
|
+
const ve = i.find((Ce) => Ce.id === ne);
|
|
2130
2174
|
if (ve) {
|
|
2131
2175
|
const Ce = ve.tabTitle;
|
|
2132
2176
|
if (Ce == "All__Header")
|
|
2133
|
-
return
|
|
2177
|
+
return i[0].id;
|
|
2134
2178
|
if (Ce && Ce.endsWith("__Header")) {
|
|
2135
|
-
const Za = Ce.split("__")[0], Qs =
|
|
2179
|
+
const Za = Ce.split("__")[0], Qs = i.find(
|
|
2136
2180
|
(et) => et.tabTitle === Za
|
|
2137
2181
|
);
|
|
2138
|
-
return Qs ? Qs.id :
|
|
2182
|
+
return Qs ? Qs.id : i[0].id;
|
|
2139
2183
|
}
|
|
2140
2184
|
return ne;
|
|
2141
2185
|
}
|
|
2142
2186
|
}
|
|
2143
|
-
return
|
|
2187
|
+
return i[0].id;
|
|
2144
2188
|
}
|
|
2145
2189
|
function Ze() {
|
|
2146
|
-
let
|
|
2147
|
-
v && !v.includes("{{") && (
|
|
2190
|
+
let i = v;
|
|
2191
|
+
v && !v.includes("{{") && (i = il(v), _(i));
|
|
2148
2192
|
const ne = {
|
|
2149
2193
|
...C,
|
|
2150
|
-
lastSelectedSchema:
|
|
2194
|
+
lastSelectedSchema: L,
|
|
2151
2195
|
lastSelectedDatamodelId: S,
|
|
2152
2196
|
lastSelectedDatabase: N,
|
|
2153
2197
|
lastSelectedTable: h,
|
|
2154
2198
|
connectionId: A,
|
|
2155
2199
|
type: F ? C.type : "table",
|
|
2156
|
-
sql:
|
|
2200
|
+
sql: i,
|
|
2157
2201
|
customCfg: F ? C.customCfg : null
|
|
2158
2202
|
}, ve = k.cards.map(
|
|
2159
2203
|
(js) => js.id === C.id ? ne : js
|
|
@@ -2165,13 +2209,13 @@ function bl() {
|
|
|
2165
2209
|
X == null || X(Ce);
|
|
2166
2210
|
}
|
|
2167
2211
|
function es() {
|
|
2168
|
-
const { queryKey:
|
|
2169
|
-
|
|
2212
|
+
const { queryKey: i, queryData: ne } = s;
|
|
2213
|
+
i && ne && n.setQueryData(i, ne), te == null || te();
|
|
2170
2214
|
}
|
|
2171
2215
|
Z(() => {
|
|
2172
|
-
if (!
|
|
2173
|
-
const
|
|
2174
|
-
return
|
|
2216
|
+
if (!c) return;
|
|
2217
|
+
const i = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ve = T === "system" ? ne : T;
|
|
2218
|
+
return c.editor.defineTheme("default", {
|
|
2175
2219
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2176
2220
|
base: ve === "light" ? "vs" : "vs-dark",
|
|
2177
2221
|
inherit: !0,
|
|
@@ -2183,14 +2227,14 @@ function bl() {
|
|
|
2183
2227
|
// ? '#ffffff'
|
|
2184
2228
|
// : getCssVariableValue('--semaphor-background'),
|
|
2185
2229
|
}
|
|
2186
|
-
}),
|
|
2187
|
-
|
|
2230
|
+
}), c.editor.setTheme("default"), i && c && i.addCommand(
|
|
2231
|
+
c.KeyMod.Shift | c.KeyCode.Enter,
|
|
2188
2232
|
function() {
|
|
2189
2233
|
return Ee(), !1;
|
|
2190
2234
|
}
|
|
2191
2235
|
), () => {
|
|
2192
2236
|
};
|
|
2193
|
-
}, [a,
|
|
2237
|
+
}, [a, T, c]);
|
|
2194
2238
|
function ss() {
|
|
2195
2239
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2196
2240
|
d && /* @__PURE__ */ e.jsx(
|
|
@@ -2202,7 +2246,7 @@ function bl() {
|
|
|
2202
2246
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
2203
2247
|
/* @__PURE__ */ e.jsx(R, { className: "ml-6 text-xs font-semibold", children: "Filters" }),
|
|
2204
2248
|
Y && d && /* @__PURE__ */ e.jsx(
|
|
2205
|
-
|
|
2249
|
+
Qe,
|
|
2206
2250
|
{
|
|
2207
2251
|
onClick: () => p(!1),
|
|
2208
2252
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
@@ -2210,13 +2254,13 @@ function bl() {
|
|
|
2210
2254
|
)
|
|
2211
2255
|
] }),
|
|
2212
2256
|
/* @__PURE__ */ e.jsx(
|
|
2213
|
-
|
|
2257
|
+
Ue,
|
|
2214
2258
|
{
|
|
2215
2259
|
theme: "default",
|
|
2216
|
-
onChange: (
|
|
2217
|
-
if (
|
|
2260
|
+
onChange: (i) => {
|
|
2261
|
+
if (i)
|
|
2218
2262
|
try {
|
|
2219
|
-
JSON.parse(
|
|
2263
|
+
JSON.parse(i), w(JSON.parse(i));
|
|
2220
2264
|
} catch {
|
|
2221
2265
|
}
|
|
2222
2266
|
},
|
|
@@ -2239,7 +2283,7 @@ function bl() {
|
|
|
2239
2283
|
renderLineHighlight: "none"
|
|
2240
2284
|
}
|
|
2241
2285
|
},
|
|
2242
|
-
|
|
2286
|
+
T
|
|
2243
2287
|
)
|
|
2244
2288
|
] })
|
|
2245
2289
|
}
|
|
@@ -2248,7 +2292,7 @@ function bl() {
|
|
|
2248
2292
|
ca,
|
|
2249
2293
|
{
|
|
2250
2294
|
onClick: () => p(!0),
|
|
2251
|
-
className:
|
|
2295
|
+
className: Q(
|
|
2252
2296
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
2253
2297
|
{
|
|
2254
2298
|
"font-bold text-red-800": ie
|
|
@@ -2271,7 +2315,7 @@ function bl() {
|
|
|
2271
2315
|
{
|
|
2272
2316
|
id: "1",
|
|
2273
2317
|
order: 1,
|
|
2274
|
-
defaultSize:
|
|
2318
|
+
defaultSize: r ? 20 : 100,
|
|
2275
2319
|
className: "relative flex grow",
|
|
2276
2320
|
children: [
|
|
2277
2321
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2280,12 +2324,12 @@ function bl() {
|
|
|
2280
2324
|
role: "sql-container",
|
|
2281
2325
|
className: "relative flex w-[99%]",
|
|
2282
2326
|
children: /* @__PURE__ */ e.jsx(
|
|
2283
|
-
|
|
2327
|
+
Ue,
|
|
2284
2328
|
{
|
|
2285
2329
|
theme: "default",
|
|
2286
2330
|
className: "pt-3",
|
|
2287
|
-
onChange: (
|
|
2288
|
-
_(
|
|
2331
|
+
onChange: (i) => {
|
|
2332
|
+
_(i);
|
|
2289
2333
|
},
|
|
2290
2334
|
value: v,
|
|
2291
2335
|
options: {
|
|
@@ -2306,11 +2350,11 @@ function bl() {
|
|
|
2306
2350
|
)
|
|
2307
2351
|
}
|
|
2308
2352
|
),
|
|
2309
|
-
|
|
2353
|
+
r && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
|
|
2310
2354
|
]
|
|
2311
2355
|
}
|
|
2312
2356
|
),
|
|
2313
|
-
|
|
2357
|
+
r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2314
2358
|
/* @__PURE__ */ e.jsx(Ns, { withHandle: !0, className: "border" }),
|
|
2315
2359
|
/* @__PURE__ */ e.jsxs(
|
|
2316
2360
|
Ae,
|
|
@@ -2326,12 +2370,12 @@ function bl() {
|
|
|
2326
2370
|
role: "python-container",
|
|
2327
2371
|
className: "relative flex w-[99%] pt-0",
|
|
2328
2372
|
children: /* @__PURE__ */ e.jsx(
|
|
2329
|
-
|
|
2373
|
+
Ue,
|
|
2330
2374
|
{
|
|
2331
2375
|
className: "pt-3",
|
|
2332
2376
|
theme: "default",
|
|
2333
|
-
onChange: (
|
|
2334
|
-
E(
|
|
2377
|
+
onChange: (i) => {
|
|
2378
|
+
E(i && i.trim() || "");
|
|
2335
2379
|
},
|
|
2336
2380
|
value: f || St,
|
|
2337
2381
|
options: {
|
|
@@ -2388,7 +2432,7 @@ function bl() {
|
|
|
2388
2432
|
children: [
|
|
2389
2433
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2390
2434
|
/* @__PURE__ */ e.jsxs(
|
|
2391
|
-
|
|
2435
|
+
O,
|
|
2392
2436
|
{
|
|
2393
2437
|
title: "Shift + Enter",
|
|
2394
2438
|
disabled: oe || ce,
|
|
@@ -2399,22 +2443,22 @@ function bl() {
|
|
|
2399
2443
|
size: "sm",
|
|
2400
2444
|
variant: "outline",
|
|
2401
2445
|
children: [
|
|
2402
|
-
oe || ce ? /* @__PURE__ */ e.jsx(
|
|
2446
|
+
oe || ce ? /* @__PURE__ */ e.jsx(Ve, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 h-4 w-4" }),
|
|
2403
2447
|
"Run"
|
|
2404
2448
|
]
|
|
2405
2449
|
}
|
|
2406
2450
|
),
|
|
2407
|
-
|
|
2408
|
-
|
|
2451
|
+
Me && /* @__PURE__ */ e.jsx(
|
|
2452
|
+
ol,
|
|
2409
2453
|
{
|
|
2410
|
-
error:
|
|
2454
|
+
error: He.message,
|
|
2411
2455
|
setShowAIDialog: y,
|
|
2412
2456
|
setTriggerAIRun: b,
|
|
2413
2457
|
setUserInputforAI: x
|
|
2414
2458
|
}
|
|
2415
2459
|
),
|
|
2416
2460
|
/* @__PURE__ */ e.jsxs(
|
|
2417
|
-
|
|
2461
|
+
O,
|
|
2418
2462
|
{
|
|
2419
2463
|
onClick: gs,
|
|
2420
2464
|
className: "",
|
|
@@ -2429,43 +2473,43 @@ function bl() {
|
|
|
2429
2473
|
/* @__PURE__ */ e.jsx(
|
|
2430
2474
|
pa,
|
|
2431
2475
|
{
|
|
2432
|
-
pressed:
|
|
2433
|
-
onPressedChange: (
|
|
2476
|
+
pressed: r,
|
|
2477
|
+
onPressedChange: (i) => o(i),
|
|
2434
2478
|
className: "",
|
|
2435
2479
|
size: "sm",
|
|
2436
2480
|
variant: "outline",
|
|
2437
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2481
|
+
children: /* @__PURE__ */ e.jsx(jl, { className: "size-4 text-foreground/70" })
|
|
2438
2482
|
}
|
|
2439
2483
|
),
|
|
2440
2484
|
/* @__PURE__ */ e.jsx(
|
|
2441
|
-
|
|
2485
|
+
dl,
|
|
2442
2486
|
{
|
|
2443
2487
|
open: u,
|
|
2444
2488
|
setOpen: y,
|
|
2445
2489
|
userInput: g,
|
|
2446
2490
|
triggerAIRun: j,
|
|
2447
2491
|
setTriggerAIRun: b,
|
|
2448
|
-
setUserInput: (
|
|
2492
|
+
setUserInput: (i) => x(i)
|
|
2449
2493
|
}
|
|
2450
2494
|
)
|
|
2451
2495
|
] }),
|
|
2452
2496
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2453
|
-
(
|
|
2497
|
+
(J == null ? void 0 : J.sql) && /* @__PURE__ */ e.jsx(bl, { sql: J.sql }),
|
|
2454
2498
|
/* @__PURE__ */ e.jsxs(
|
|
2455
|
-
|
|
2499
|
+
O,
|
|
2456
2500
|
{
|
|
2457
2501
|
onClick: es,
|
|
2458
2502
|
className: "w-full",
|
|
2459
2503
|
size: "sm",
|
|
2460
2504
|
variant: "outline",
|
|
2461
2505
|
children: [
|
|
2462
|
-
/* @__PURE__ */ e.jsx(
|
|
2506
|
+
/* @__PURE__ */ e.jsx(Qe, { className: "mr-2 size-4" }),
|
|
2463
2507
|
"Close"
|
|
2464
2508
|
]
|
|
2465
2509
|
}
|
|
2466
2510
|
),
|
|
2467
2511
|
/* @__PURE__ */ e.jsxs(
|
|
2468
|
-
|
|
2512
|
+
O,
|
|
2469
2513
|
{
|
|
2470
2514
|
onClick: Ze,
|
|
2471
2515
|
size: "sm",
|
|
@@ -2485,11 +2529,11 @@ function bl() {
|
|
|
2485
2529
|
)
|
|
2486
2530
|
);
|
|
2487
2531
|
}
|
|
2488
|
-
function
|
|
2489
|
-
var
|
|
2490
|
-
const [t, a] = we.useState([]), l = Object.keys(s[0]).map((
|
|
2532
|
+
function vl({ data: s }) {
|
|
2533
|
+
var r;
|
|
2534
|
+
const [t, a] = we.useState([]), l = Object.keys(s[0]).map((o) => ({
|
|
2491
2535
|
// header: key,
|
|
2492
|
-
accessorKey:
|
|
2536
|
+
accessorKey: o,
|
|
2493
2537
|
header: ({ column: d }) => {
|
|
2494
2538
|
const p = d.getIsSorted();
|
|
2495
2539
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -2498,60 +2542,60 @@ function yl({ data: s }) {
|
|
|
2498
2542
|
className: "flex cursor-pointer items-center",
|
|
2499
2543
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2500
2544
|
children: [
|
|
2501
|
-
|
|
2545
|
+
o,
|
|
2502
2546
|
p === "asc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(kt, { className: "ml-2 h-5 w-5" }) : null
|
|
2503
2547
|
]
|
|
2504
2548
|
}
|
|
2505
2549
|
) });
|
|
2506
2550
|
}
|
|
2507
|
-
})),
|
|
2551
|
+
})), c = zt({
|
|
2508
2552
|
data: s,
|
|
2509
2553
|
columns: l,
|
|
2510
|
-
getCoreRowModel:
|
|
2511
|
-
getPaginationRowModel:
|
|
2554
|
+
getCoreRowModel: Tt(),
|
|
2555
|
+
getPaginationRowModel: Lt(),
|
|
2512
2556
|
onSortingChange: a,
|
|
2513
|
-
getSortedRowModel:
|
|
2557
|
+
getSortedRowModel: Mt(),
|
|
2514
2558
|
manualPagination: !0,
|
|
2515
2559
|
state: {
|
|
2516
2560
|
sorting: t
|
|
2517
2561
|
}
|
|
2518
2562
|
});
|
|
2519
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2520
|
-
/* @__PURE__ */ e.jsx(Ft, { children:
|
|
2563
|
+
return /* @__PURE__ */ e.jsxs(Ot, { children: [
|
|
2564
|
+
/* @__PURE__ */ e.jsx(Ft, { children: c.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(bs, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(It, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ws(
|
|
2521
2565
|
d.column.columnDef.header,
|
|
2522
2566
|
d.getContext()
|
|
2523
|
-
) }, d.id)) },
|
|
2524
|
-
/* @__PURE__ */ e.jsx(
|
|
2567
|
+
) }, d.id)) }, o.id)) }),
|
|
2568
|
+
/* @__PURE__ */ e.jsx(Dt, { children: (r = c.getRowModel().rows) != null && r.length ? c.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2525
2569
|
bs,
|
|
2526
2570
|
{
|
|
2527
2571
|
className: "whitespace-nowrap py-2",
|
|
2528
|
-
"data-state":
|
|
2529
|
-
children:
|
|
2572
|
+
"data-state": o.getIsSelected() && "selected",
|
|
2573
|
+
children: o.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Ys, { children: Ws(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2530
2574
|
},
|
|
2531
|
-
|
|
2575
|
+
o.id
|
|
2532
2576
|
)) : /* @__PURE__ */ e.jsx(bs, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2533
2577
|
] });
|
|
2534
2578
|
}
|
|
2535
|
-
function
|
|
2536
|
-
var g, x, j, b, I, C,
|
|
2537
|
-
const { authToken: t } =
|
|
2579
|
+
function Cl({ card: s }) {
|
|
2580
|
+
var g, x, j, b, I, C, T, F, A, N;
|
|
2581
|
+
const { authToken: t } = ke(), a = Et(t == null ? void 0 : t.accessToken), n = z((S) => S.themeStyle), l = {
|
|
2538
2582
|
colors: ((x = (g = n == null ? void 0 : n.chart) == null ? void 0 : g.dataset) == null ? void 0 : x.backgroundColor) || []
|
|
2539
2583
|
};
|
|
2540
2584
|
(j = s.customCardPreferences) != null && j.inputData;
|
|
2541
|
-
const { getCard:
|
|
2585
|
+
const { getCard: c } = ja(((b = s.customCardPreferences) == null ? void 0 : b.url) || ""), r = ((I = s.customCardPreferences) == null ? void 0 : I.visualType) || "single", o = m((S) => S.frame);
|
|
2542
2586
|
re();
|
|
2543
|
-
const { data: d } =
|
|
2587
|
+
const { data: d } = qe(s);
|
|
2544
2588
|
if (!((C = s.customCardPreferences) != null && C.componentName))
|
|
2545
2589
|
return null;
|
|
2546
|
-
const p =
|
|
2547
|
-
(
|
|
2590
|
+
const p = c(
|
|
2591
|
+
(T = s.customCardPreferences) == null ? void 0 : T.componentName
|
|
2548
2592
|
), u = (S) => {
|
|
2549
2593
|
console.log("data", S), s.customCardPreferences;
|
|
2550
2594
|
}, y = Object.keys(
|
|
2551
2595
|
((F = s.customCardPreferences) == null ? void 0 : F.dataInputCardIds) || {}
|
|
2552
2596
|
).map((S) => {
|
|
2553
2597
|
var v, f, k;
|
|
2554
|
-
const
|
|
2598
|
+
const L = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, h = (k = o == null ? void 0 : o.cards) == null ? void 0 : k.find((M) => M.id === L);
|
|
2555
2599
|
return h || null;
|
|
2556
2600
|
});
|
|
2557
2601
|
return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -2559,7 +2603,7 @@ function vl({ card: s }) {
|
|
|
2559
2603
|
{
|
|
2560
2604
|
fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
2561
2605
|
children: [
|
|
2562
|
-
p &&
|
|
2606
|
+
p && r === "single" && /* @__PURE__ */ e.jsx(
|
|
2563
2607
|
p,
|
|
2564
2608
|
{
|
|
2565
2609
|
params: a,
|
|
@@ -2569,15 +2613,15 @@ function vl({ card: s }) {
|
|
|
2569
2613
|
data: (d == null ? void 0 : d.records) || []
|
|
2570
2614
|
}
|
|
2571
2615
|
),
|
|
2572
|
-
p &&
|
|
2616
|
+
p && r === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2573
2617
|
p,
|
|
2574
2618
|
{
|
|
2575
2619
|
theme: l,
|
|
2576
2620
|
onDataChange: u,
|
|
2577
2621
|
settings: y.map(
|
|
2578
2622
|
(S) => {
|
|
2579
|
-
var
|
|
2580
|
-
return (
|
|
2623
|
+
var L;
|
|
2624
|
+
return (L = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : L.settings;
|
|
2581
2625
|
}
|
|
2582
2626
|
),
|
|
2583
2627
|
data: y.map((S) => (S == null ? void 0 : S.data) || [])
|
|
@@ -2595,9 +2639,9 @@ function Ra({
|
|
|
2595
2639
|
...t
|
|
2596
2640
|
}) {
|
|
2597
2641
|
var x, j;
|
|
2598
|
-
const a = m((b) => b.card), n = ((x = a.customCardPreferences) == null ? void 0 : x.showCardHeader) ?? !0, l = m((b) => b.frame),
|
|
2642
|
+
const a = m((b) => b.card), n = ((x = a.customCardPreferences) == null ? void 0 : x.showCardHeader) ?? !0, l = m((b) => b.frame), c = z((b) => b.dashboard.filters);
|
|
2599
2643
|
m((b) => b.actions.setRunSql);
|
|
2600
|
-
const { updateFilter:
|
|
2644
|
+
const { updateFilter: r } = Os(), o = c == null ? void 0 : c.find((b) => b.id === l.filterId), { data: d } = qe(a), { setCard: p } = re(), { data: u } = _s(a);
|
|
2601
2645
|
if (!a.id) return null;
|
|
2602
2646
|
let y;
|
|
2603
2647
|
d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (y = ba({
|
|
@@ -2609,13 +2653,13 @@ function Ra({
|
|
|
2609
2653
|
topoJson: u
|
|
2610
2654
|
}));
|
|
2611
2655
|
function g(b) {
|
|
2612
|
-
return /* @__PURE__ */ e.jsx(
|
|
2656
|
+
return /* @__PURE__ */ e.jsx(Cl, { card: b });
|
|
2613
2657
|
}
|
|
2614
2658
|
return /* @__PURE__ */ e.jsxs(
|
|
2615
2659
|
At,
|
|
2616
2660
|
{
|
|
2617
2661
|
role: "editor-visual-card",
|
|
2618
|
-
className:
|
|
2662
|
+
className: Q("relative flex h-full flex-col rounded-none", s),
|
|
2619
2663
|
...t,
|
|
2620
2664
|
children: [
|
|
2621
2665
|
n && /* @__PURE__ */ e.jsxs(Vt, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
@@ -2639,17 +2683,17 @@ function Ra({
|
|
|
2639
2683
|
a.description
|
|
2640
2684
|
)
|
|
2641
2685
|
] }),
|
|
2642
|
-
|
|
2686
|
+
o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2643
2687
|
/* @__PURE__ */ e.jsx(
|
|
2644
2688
|
ls,
|
|
2645
2689
|
{
|
|
2646
2690
|
className: "my-1",
|
|
2647
|
-
text:
|
|
2648
|
-
onSave: (b) =>
|
|
2649
|
-
children: /* @__PURE__ */ e.jsx(R, { children:
|
|
2691
|
+
text: o.title || o.column,
|
|
2692
|
+
onSave: (b) => r({ ...o, title: b }),
|
|
2693
|
+
children: /* @__PURE__ */ e.jsx(R, { children: o.title })
|
|
2650
2694
|
}
|
|
2651
2695
|
),
|
|
2652
|
-
/* @__PURE__ */ e.jsx(_t, { filter:
|
|
2696
|
+
/* @__PURE__ */ e.jsx(_t, { filter: o })
|
|
2653
2697
|
] })
|
|
2654
2698
|
] }),
|
|
2655
2699
|
/* @__PURE__ */ e.jsxs(Ht, { className: "flex grow flex-col", children: [
|
|
@@ -2669,10 +2713,10 @@ function Ra({
|
|
|
2669
2713
|
}
|
|
2670
2714
|
);
|
|
2671
2715
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const [s, t] = q(!1), [a, n] = q(""), [l,
|
|
2716
|
+
function Nl() {
|
|
2717
|
+
const [s, t] = q(!1), [a, n] = q(""), [l, c] = q(""), [r, o] = q(""), [d, p] = q(""), u = m((N) => N.card), y = m(
|
|
2674
2718
|
(N) => N.card.customCfg
|
|
2675
|
-
), { data: g } =
|
|
2719
|
+
), { data: g } = qe(u), { data: x } = _s(u), { setCardCustomCfg: j, setCustomVisualCode: b } = re();
|
|
2676
2720
|
function I(N) {
|
|
2677
2721
|
var h, v;
|
|
2678
2722
|
const S = {
|
|
@@ -2688,7 +2732,7 @@ function Cl() {
|
|
|
2688
2732
|
return JSON.stringify(S, null, 1);
|
|
2689
2733
|
}
|
|
2690
2734
|
function C() {
|
|
2691
|
-
var S,
|
|
2735
|
+
var S, L;
|
|
2692
2736
|
if (!(g != null && g.records) || (g == null ? void 0 : g.records.length) === 0) return;
|
|
2693
2737
|
const N = ba({
|
|
2694
2738
|
data: g == null ? void 0 : g.records,
|
|
@@ -2697,31 +2741,31 @@ function Cl() {
|
|
|
2697
2741
|
preferences: u.preferences,
|
|
2698
2742
|
topoJson: x
|
|
2699
2743
|
});
|
|
2700
|
-
N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode &&
|
|
2744
|
+
N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && o((L = u == null ? void 0 : u.preferences) == null ? void 0 : L.customVisualCode), y && c(JSON.stringify(y, null, 1)));
|
|
2701
2745
|
}
|
|
2702
|
-
function
|
|
2703
|
-
if (
|
|
2746
|
+
function T() {
|
|
2747
|
+
if (r && b(r), !!l)
|
|
2704
2748
|
try {
|
|
2705
2749
|
const N = JSON.parse(l);
|
|
2706
|
-
return N ? (j(N), p(""),
|
|
2750
|
+
return N ? (j(N), p(""), c(""), N) : void 0;
|
|
2707
2751
|
} catch (N) {
|
|
2708
2752
|
console.log(N), p("Invalid JSON");
|
|
2709
2753
|
}
|
|
2710
2754
|
}
|
|
2711
2755
|
function F() {
|
|
2712
|
-
|
|
2756
|
+
c(""), j(null);
|
|
2713
2757
|
}
|
|
2714
2758
|
function A() {
|
|
2715
2759
|
let N;
|
|
2716
2760
|
if (y) {
|
|
2717
|
-
const S = Xs.cloneDeep(u.cfg),
|
|
2718
|
-
return N = I(
|
|
2761
|
+
const S = Xs.cloneDeep(u.cfg), L = Xs.merge(S, y);
|
|
2762
|
+
return N = I(L), N;
|
|
2719
2763
|
}
|
|
2720
2764
|
return a ? (N = I(JSON.parse(a)), N) : "";
|
|
2721
2765
|
}
|
|
2722
2766
|
return /* @__PURE__ */ e.jsxs(Fs, { open: s, onOpenChange: t, children: [
|
|
2723
2767
|
/* @__PURE__ */ e.jsx(Is, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2724
|
-
|
|
2768
|
+
O,
|
|
2725
2769
|
{
|
|
2726
2770
|
onClick: C,
|
|
2727
2771
|
className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
|
|
@@ -2731,12 +2775,12 @@ function Cl() {
|
|
|
2731
2775
|
}
|
|
2732
2776
|
) }),
|
|
2733
2777
|
/* @__PURE__ */ e.jsxs(
|
|
2734
|
-
|
|
2778
|
+
Ts,
|
|
2735
2779
|
{
|
|
2736
2780
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2737
2781
|
children: [
|
|
2738
|
-
/* @__PURE__ */ e.jsxs(
|
|
2739
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2782
|
+
/* @__PURE__ */ e.jsxs(Ls, { className: "", children: [
|
|
2783
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Ms, { children: "Customize Card" }) }),
|
|
2740
2784
|
/* @__PURE__ */ e.jsxs(Es, { children: [
|
|
2741
2785
|
"See the configuration options and documentation",
|
|
2742
2786
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2782,7 +2826,7 @@ function Cl() {
|
|
|
2782
2826
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2783
2827
|
value: "custom-config",
|
|
2784
2828
|
children: /* @__PURE__ */ e.jsx(
|
|
2785
|
-
|
|
2829
|
+
Ue,
|
|
2786
2830
|
{
|
|
2787
2831
|
className: "h-full w-full overflow-hidden",
|
|
2788
2832
|
theme: "default",
|
|
@@ -2800,7 +2844,7 @@ function Cl() {
|
|
|
2800
2844
|
},
|
|
2801
2845
|
defaultLanguage: "json",
|
|
2802
2846
|
value: A(),
|
|
2803
|
-
onChange: (N) =>
|
|
2847
|
+
onChange: (N) => c(N)
|
|
2804
2848
|
}
|
|
2805
2849
|
)
|
|
2806
2850
|
}
|
|
@@ -2811,7 +2855,7 @@ function Cl() {
|
|
|
2811
2855
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2812
2856
|
value: "custom-code",
|
|
2813
2857
|
children: /* @__PURE__ */ e.jsx(
|
|
2814
|
-
|
|
2858
|
+
Ue,
|
|
2815
2859
|
{
|
|
2816
2860
|
className: "h-full w-full overflow-hidden",
|
|
2817
2861
|
theme: "default",
|
|
@@ -2828,8 +2872,8 @@ function Cl() {
|
|
|
2828
2872
|
renderLineHighlight: "none"
|
|
2829
2873
|
},
|
|
2830
2874
|
defaultLanguage: "javascript",
|
|
2831
|
-
value:
|
|
2832
|
-
onChange: (N) =>
|
|
2875
|
+
value: r,
|
|
2876
|
+
onChange: (N) => o(N || "")
|
|
2833
2877
|
}
|
|
2834
2878
|
)
|
|
2835
2879
|
}
|
|
@@ -2839,7 +2883,7 @@ function Cl() {
|
|
|
2839
2883
|
/* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
|
|
2840
2884
|
/* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: d }),
|
|
2841
2885
|
/* @__PURE__ */ e.jsx(
|
|
2842
|
-
|
|
2886
|
+
O,
|
|
2843
2887
|
{
|
|
2844
2888
|
disabled: !y,
|
|
2845
2889
|
onClick: F,
|
|
@@ -2847,8 +2891,8 @@ function Cl() {
|
|
|
2847
2891
|
children: "Reset"
|
|
2848
2892
|
}
|
|
2849
2893
|
),
|
|
2850
|
-
/* @__PURE__ */ e.jsx(
|
|
2851
|
-
/* @__PURE__ */ e.jsx(
|
|
2894
|
+
/* @__PURE__ */ e.jsx(O, { onClick: T, variant: "outline", children: "Apply" }),
|
|
2895
|
+
/* @__PURE__ */ e.jsx(O, { onClick: () => t(!1), variant: "outline", children: "Close" })
|
|
2852
2896
|
] })
|
|
2853
2897
|
]
|
|
2854
2898
|
}
|
|
@@ -2883,63 +2927,63 @@ function Ja(s) {
|
|
|
2883
2927
|
const [t, a] = q(null);
|
|
2884
2928
|
return Z(() => {
|
|
2885
2929
|
s && (async () => {
|
|
2886
|
-
const
|
|
2887
|
-
a(
|
|
2930
|
+
const c = (await import("./lucide-react-DyubCpoB.js"))[s];
|
|
2931
|
+
a(c);
|
|
2888
2932
|
})();
|
|
2889
2933
|
}, [s]), t;
|
|
2890
2934
|
}
|
|
2891
2935
|
function Ka() {
|
|
2892
|
-
const { authToken: s } =
|
|
2936
|
+
const { authToken: s } = ke(), { data: t, isLoading: a, isFetching: n, isError: l } = Ne({
|
|
2893
2937
|
queryKey: ["plugins", s == null ? void 0 : s.accessToken],
|
|
2894
2938
|
queryFn: () => Gt(s == null ? void 0 : s.accessToken)
|
|
2895
2939
|
// staleTime: Infinity,
|
|
2896
2940
|
});
|
|
2897
2941
|
return { data: t, isLoading: a, isFetching: n, isError: l };
|
|
2898
2942
|
}
|
|
2899
|
-
function
|
|
2943
|
+
function Sl({
|
|
2900
2944
|
onChartTypeChange: s
|
|
2901
2945
|
}) {
|
|
2902
2946
|
const [t, a] = q([]), { data: n } = Ka();
|
|
2903
2947
|
return Z(() => {
|
|
2904
2948
|
(async () => {
|
|
2905
|
-
var
|
|
2949
|
+
var c;
|
|
2906
2950
|
if (n) {
|
|
2907
|
-
const
|
|
2908
|
-
(
|
|
2951
|
+
const o = (await Promise.all(
|
|
2952
|
+
(c = n == null ? void 0 : n.plugins) == null ? void 0 : c.map(async (d) => (await Qt(d.value)).visuals.map((y) => ({
|
|
2909
2953
|
name: y.name,
|
|
2910
2954
|
icon: y.icon,
|
|
2911
2955
|
url: d.value
|
|
2912
2956
|
})))
|
|
2913
2957
|
)).flat();
|
|
2914
|
-
a(
|
|
2958
|
+
a(o);
|
|
2915
2959
|
}
|
|
2916
2960
|
})();
|
|
2917
2961
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2918
2962
|
/* @__PURE__ */ e.jsx(ge, { className: "my-2" }),
|
|
2919
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l,
|
|
2920
|
-
|
|
2963
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, c) => /* @__PURE__ */ e.jsx(
|
|
2964
|
+
wl,
|
|
2921
2965
|
{
|
|
2922
2966
|
text: l.name,
|
|
2923
2967
|
onClick: () => s("custom", l),
|
|
2924
2968
|
icon: l.icon
|
|
2925
2969
|
},
|
|
2926
|
-
l.url + l.name +
|
|
2970
|
+
l.url + l.name + c
|
|
2927
2971
|
)) })
|
|
2928
2972
|
] });
|
|
2929
2973
|
}
|
|
2930
|
-
const
|
|
2974
|
+
const wl = ({
|
|
2931
2975
|
text: s,
|
|
2932
2976
|
icon: t,
|
|
2933
2977
|
onClick: a
|
|
2934
2978
|
}) => {
|
|
2935
2979
|
const n = Ja(t || ""), l = s.charAt(0).toUpperCase();
|
|
2936
|
-
return /* @__PURE__ */ e.jsx(
|
|
2980
|
+
return /* @__PURE__ */ e.jsx(O, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
|
|
2937
2981
|
};
|
|
2938
|
-
function
|
|
2982
|
+
function kl() {
|
|
2939
2983
|
var u, y;
|
|
2940
|
-
const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences:
|
|
2984
|
+
const [s, t] = q(!1), a = m((g) => g.card), n = a.type, { setCardType: l, setCardPreferences: c, setChartOrientation: r } = m((g) => g.actions), { setCardCustomCfg: o, setCustomCardPreferences: d } = re();
|
|
2941
2985
|
function p(g, x) {
|
|
2942
|
-
|
|
2986
|
+
o(null), c({}), l(g), x && d({
|
|
2943
2987
|
type: "component",
|
|
2944
2988
|
visualType: "single",
|
|
2945
2989
|
url: x.url,
|
|
@@ -2948,8 +2992,8 @@ function wl() {
|
|
|
2948
2992
|
}), t(!1);
|
|
2949
2993
|
}
|
|
2950
2994
|
return /* @__PURE__ */ e.jsxs(ms, { open: s, onOpenChange: t, children: [
|
|
2951
|
-
/* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2952
|
-
|
|
2995
|
+
/* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
2996
|
+
zl,
|
|
2953
2997
|
{
|
|
2954
2998
|
className: "h-4 w-4",
|
|
2955
2999
|
chartType: n,
|
|
@@ -2960,7 +3004,7 @@ function wl() {
|
|
|
2960
3004
|
/* @__PURE__ */ e.jsxs(xs, { className: "w-50", children: [
|
|
2961
3005
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
2962
3006
|
/* @__PURE__ */ e.jsx(
|
|
2963
|
-
|
|
3007
|
+
O,
|
|
2964
3008
|
{
|
|
2965
3009
|
onClick: () => p("bar"),
|
|
2966
3010
|
className: "font-normal",
|
|
@@ -2969,7 +3013,7 @@ function wl() {
|
|
|
2969
3013
|
}
|
|
2970
3014
|
),
|
|
2971
3015
|
/* @__PURE__ */ e.jsx(
|
|
2972
|
-
|
|
3016
|
+
O,
|
|
2973
3017
|
{
|
|
2974
3018
|
onClick: () => p("line"),
|
|
2975
3019
|
variant: "ghost",
|
|
@@ -2977,7 +3021,7 @@ function wl() {
|
|
|
2977
3021
|
}
|
|
2978
3022
|
),
|
|
2979
3023
|
/* @__PURE__ */ e.jsx(
|
|
2980
|
-
|
|
3024
|
+
O,
|
|
2981
3025
|
{
|
|
2982
3026
|
onClick: () => p("stackedBar"),
|
|
2983
3027
|
variant: "ghost",
|
|
@@ -2985,7 +3029,7 @@ function wl() {
|
|
|
2985
3029
|
}
|
|
2986
3030
|
),
|
|
2987
3031
|
/* @__PURE__ */ e.jsx(
|
|
2988
|
-
|
|
3032
|
+
O,
|
|
2989
3033
|
{
|
|
2990
3034
|
onClick: () => p("stackedLine"),
|
|
2991
3035
|
variant: "ghost",
|
|
@@ -2993,7 +3037,7 @@ function wl() {
|
|
|
2993
3037
|
}
|
|
2994
3038
|
),
|
|
2995
3039
|
/* @__PURE__ */ e.jsx(
|
|
2996
|
-
|
|
3040
|
+
O,
|
|
2997
3041
|
{
|
|
2998
3042
|
onClick: () => p("scatter"),
|
|
2999
3043
|
variant: "ghost",
|
|
@@ -3001,7 +3045,7 @@ function wl() {
|
|
|
3001
3045
|
}
|
|
3002
3046
|
),
|
|
3003
3047
|
/* @__PURE__ */ e.jsx(
|
|
3004
|
-
|
|
3048
|
+
O,
|
|
3005
3049
|
{
|
|
3006
3050
|
onClick: () => p("bubble"),
|
|
3007
3051
|
variant: "ghost",
|
|
@@ -3009,15 +3053,15 @@ function wl() {
|
|
|
3009
3053
|
}
|
|
3010
3054
|
),
|
|
3011
3055
|
/* @__PURE__ */ e.jsx(
|
|
3012
|
-
|
|
3056
|
+
O,
|
|
3013
3057
|
{
|
|
3014
3058
|
onClick: () => p("pie"),
|
|
3015
3059
|
variant: "ghost",
|
|
3016
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3060
|
+
children: /* @__PURE__ */ e.jsx(Oa, { className: "size-5" })
|
|
3017
3061
|
}
|
|
3018
3062
|
),
|
|
3019
3063
|
/* @__PURE__ */ e.jsx(
|
|
3020
|
-
|
|
3064
|
+
O,
|
|
3021
3065
|
{
|
|
3022
3066
|
onClick: () => p("doughnut"),
|
|
3023
3067
|
variant: "ghost",
|
|
@@ -3025,7 +3069,7 @@ function wl() {
|
|
|
3025
3069
|
}
|
|
3026
3070
|
),
|
|
3027
3071
|
/* @__PURE__ */ e.jsx(
|
|
3028
|
-
|
|
3072
|
+
O,
|
|
3029
3073
|
{
|
|
3030
3074
|
onClick: () => p("radar"),
|
|
3031
3075
|
variant: "ghost",
|
|
@@ -3039,7 +3083,7 @@ function wl() {
|
|
|
3039
3083
|
}
|
|
3040
3084
|
),
|
|
3041
3085
|
/* @__PURE__ */ e.jsx(
|
|
3042
|
-
|
|
3086
|
+
O,
|
|
3043
3087
|
{
|
|
3044
3088
|
onClick: () => p("polarArea"),
|
|
3045
3089
|
variant: "ghost",
|
|
@@ -3047,7 +3091,7 @@ function wl() {
|
|
|
3047
3091
|
}
|
|
3048
3092
|
),
|
|
3049
3093
|
/* @__PURE__ */ e.jsx(
|
|
3050
|
-
|
|
3094
|
+
O,
|
|
3051
3095
|
{
|
|
3052
3096
|
onClick: () => p("pyramid"),
|
|
3053
3097
|
variant: "ghost",
|
|
@@ -3055,15 +3099,15 @@ function wl() {
|
|
|
3055
3099
|
}
|
|
3056
3100
|
),
|
|
3057
3101
|
/* @__PURE__ */ e.jsx(
|
|
3058
|
-
|
|
3102
|
+
O,
|
|
3059
3103
|
{
|
|
3060
3104
|
onClick: () => p("range"),
|
|
3061
3105
|
variant: "ghost",
|
|
3062
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3106
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "size-5" })
|
|
3063
3107
|
}
|
|
3064
3108
|
),
|
|
3065
3109
|
/* @__PURE__ */ e.jsx(
|
|
3066
|
-
|
|
3110
|
+
O,
|
|
3067
3111
|
{
|
|
3068
3112
|
onClick: () => p("table"),
|
|
3069
3113
|
variant: "ghost",
|
|
@@ -3071,7 +3115,7 @@ function wl() {
|
|
|
3071
3115
|
}
|
|
3072
3116
|
),
|
|
3073
3117
|
/* @__PURE__ */ e.jsx(
|
|
3074
|
-
|
|
3118
|
+
O,
|
|
3075
3119
|
{
|
|
3076
3120
|
onClick: () => p("kpi"),
|
|
3077
3121
|
variant: "ghost",
|
|
@@ -3079,7 +3123,7 @@ function wl() {
|
|
|
3079
3123
|
}
|
|
3080
3124
|
),
|
|
3081
3125
|
/* @__PURE__ */ e.jsx(
|
|
3082
|
-
|
|
3126
|
+
O,
|
|
3083
3127
|
{
|
|
3084
3128
|
onClick: () => p("text"),
|
|
3085
3129
|
variant: "ghost",
|
|
@@ -3087,27 +3131,27 @@ function wl() {
|
|
|
3087
3131
|
}
|
|
3088
3132
|
),
|
|
3089
3133
|
/* @__PURE__ */ e.jsx(
|
|
3090
|
-
|
|
3134
|
+
O,
|
|
3091
3135
|
{
|
|
3092
3136
|
onClick: () => p("map"),
|
|
3093
3137
|
variant: "ghost",
|
|
3094
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3138
|
+
children: /* @__PURE__ */ e.jsx(Da, { className: "size-4" })
|
|
3095
3139
|
}
|
|
3096
3140
|
),
|
|
3097
3141
|
/* @__PURE__ */ e.jsx(
|
|
3098
|
-
|
|
3142
|
+
O,
|
|
3099
3143
|
{
|
|
3100
3144
|
onClick: () => p("custom"),
|
|
3101
3145
|
variant: "ghost",
|
|
3102
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3146
|
+
children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
|
|
3103
3147
|
}
|
|
3104
3148
|
)
|
|
3105
3149
|
] }),
|
|
3106
|
-
/* @__PURE__ */ e.jsx(
|
|
3150
|
+
/* @__PURE__ */ e.jsx(Sl, { onChartTypeChange: p })
|
|
3107
3151
|
] })
|
|
3108
3152
|
] });
|
|
3109
3153
|
}
|
|
3110
|
-
function
|
|
3154
|
+
function zl({
|
|
3111
3155
|
chartType: s,
|
|
3112
3156
|
className: t,
|
|
3113
3157
|
customIcon: a,
|
|
@@ -3120,7 +3164,7 @@ function kl({
|
|
|
3120
3164
|
case "line":
|
|
3121
3165
|
return /* @__PURE__ */ e.jsx(Bs, { className: t });
|
|
3122
3166
|
case "pie":
|
|
3123
|
-
return /* @__PURE__ */ e.jsx(
|
|
3167
|
+
return /* @__PURE__ */ e.jsx(Oa, { className: t });
|
|
3124
3168
|
case "radar":
|
|
3125
3169
|
return /* @__PURE__ */ e.jsx(_a, { className: t });
|
|
3126
3170
|
case "scatter":
|
|
@@ -3138,15 +3182,15 @@ function kl({
|
|
|
3138
3182
|
case "pyramid":
|
|
3139
3183
|
return /* @__PURE__ */ e.jsx(Qa, { className: t });
|
|
3140
3184
|
case "range":
|
|
3141
|
-
return /* @__PURE__ */ e.jsx(
|
|
3185
|
+
return /* @__PURE__ */ e.jsx(za, { className: t });
|
|
3142
3186
|
case "kpi":
|
|
3143
3187
|
return /* @__PURE__ */ e.jsx(Ga, { className: t });
|
|
3144
3188
|
case "text":
|
|
3145
3189
|
return /* @__PURE__ */ e.jsx(Us, { className: t });
|
|
3146
3190
|
case "map":
|
|
3147
|
-
return /* @__PURE__ */ e.jsx(
|
|
3191
|
+
return /* @__PURE__ */ e.jsx(Da, { className: t });
|
|
3148
3192
|
case "custom":
|
|
3149
|
-
return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(
|
|
3193
|
+
return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: t });
|
|
3150
3194
|
default:
|
|
3151
3195
|
return /* @__PURE__ */ e.jsx(As, { className: t });
|
|
3152
3196
|
}
|
|
@@ -3160,7 +3204,7 @@ function Ol() {
|
|
|
3160
3204
|
Jt,
|
|
3161
3205
|
{
|
|
3162
3206
|
onClick: () => {
|
|
3163
|
-
navigator.clipboard.writeText(s.id),
|
|
3207
|
+
navigator.clipboard.writeText(s.id), Ke.success("Card ID copied to clipboard");
|
|
3164
3208
|
},
|
|
3165
3209
|
className: "cursor-pointer space-x-2",
|
|
3166
3210
|
children: [
|
|
@@ -3172,14 +3216,14 @@ function Ol() {
|
|
|
3172
3216
|
] });
|
|
3173
3217
|
}
|
|
3174
3218
|
function ta() {
|
|
3175
|
-
const s = m((h) => h.frame), t = m((h) => h.card), a = m((h) => h.isShowingVisual), n = m((h) => h.isSqlRunning), l = m((h) => h.queryError),
|
|
3219
|
+
const s = m((h) => h.frame), t = m((h) => h.card), a = m((h) => h.isShowingVisual), n = m((h) => h.isSqlRunning), l = m((h) => h.queryError), c = m((h) => h.pythonStdOut), r = m((h) => h.actions.setRunSql);
|
|
3176
3220
|
m((h) => h.onSave), m((h) => h.onClose), m((h) => h.actions.setCardSql), m((h) => h.actions.setCardType), m((h) => h.actions.setSqlGen);
|
|
3177
|
-
const { setFrame:
|
|
3221
|
+
const { setFrame: o, setCard: d, updateCardInFrame: p } = re(), { data: u, isLoading: y, isFetching: g } = qe(t);
|
|
3178
3222
|
if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3179
3223
|
function x() {
|
|
3180
3224
|
const h = {
|
|
3181
3225
|
connectionId: t.connectionId,
|
|
3182
|
-
id:
|
|
3226
|
+
id: Je(),
|
|
3183
3227
|
title: "Title",
|
|
3184
3228
|
description: "Description",
|
|
3185
3229
|
preferences: {
|
|
@@ -3202,25 +3246,25 @@ function ta() {
|
|
|
3202
3246
|
cards: [...s.cards, h],
|
|
3203
3247
|
activeCardId: h.id
|
|
3204
3248
|
};
|
|
3205
|
-
|
|
3249
|
+
o(v), d(h);
|
|
3206
3250
|
}
|
|
3207
3251
|
function b() {
|
|
3208
3252
|
const h = {
|
|
3209
3253
|
...t,
|
|
3210
|
-
id:
|
|
3254
|
+
id: Je(),
|
|
3211
3255
|
title: `${t.title} Copy`,
|
|
3212
3256
|
tabTitle: `${t.tabTitle} Copy`
|
|
3213
3257
|
};
|
|
3214
3258
|
j(h);
|
|
3215
3259
|
}
|
|
3216
3260
|
function I(h) {
|
|
3217
|
-
const v = s.cards.filter((
|
|
3261
|
+
const v = s.cards.filter((M) => M.id !== h), f = v[0], k = {
|
|
3218
3262
|
...s,
|
|
3219
3263
|
cards: v,
|
|
3220
3264
|
// update the active card to the first card in the frame
|
|
3221
3265
|
activeCardId: f.id
|
|
3222
3266
|
};
|
|
3223
|
-
|
|
3267
|
+
o(k), d(f);
|
|
3224
3268
|
}
|
|
3225
3269
|
function C(h) {
|
|
3226
3270
|
const v = {
|
|
@@ -3228,19 +3272,19 @@ function ta() {
|
|
|
3228
3272
|
cards: s.cards.map((k) => k.id === t.id ? t : k),
|
|
3229
3273
|
activeCardId: h
|
|
3230
3274
|
};
|
|
3231
|
-
|
|
3275
|
+
o(v);
|
|
3232
3276
|
const f = v.cards.find((k) => k.id === h);
|
|
3233
|
-
f.sql &&
|
|
3277
|
+
f.sql && r(!0), d(f);
|
|
3234
3278
|
}
|
|
3235
|
-
const
|
|
3279
|
+
const T = (h, v) => {
|
|
3236
3280
|
console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
|
|
3237
3281
|
}, F = (h) => {
|
|
3238
3282
|
h.preventDefault();
|
|
3239
3283
|
}, A = (h, v) => {
|
|
3240
3284
|
const f = h.dataTransfer.getData("tabIndex");
|
|
3241
3285
|
if (f === v.toString()) return;
|
|
3242
|
-
const k = Array.from(s.cards), [
|
|
3243
|
-
k.splice(v, 0,
|
|
3286
|
+
const k = Array.from(s.cards), [M] = k.splice(parseInt(f), 1);
|
|
3287
|
+
k.splice(v, 0, M), o({ ...s, cards: k });
|
|
3244
3288
|
};
|
|
3245
3289
|
function N(h, v) {
|
|
3246
3290
|
return h.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || h.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
|
|
@@ -3253,7 +3297,7 @@ function ta() {
|
|
|
3253
3297
|
displayTab: f
|
|
3254
3298
|
});
|
|
3255
3299
|
},
|
|
3256
|
-
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(
|
|
3300
|
+
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
3257
3301
|
}
|
|
3258
3302
|
);
|
|
3259
3303
|
}
|
|
@@ -3265,7 +3309,7 @@ function ta() {
|
|
|
3265
3309
|
value: s.activeCardId,
|
|
3266
3310
|
className: "flex grow flex-col",
|
|
3267
3311
|
children: [
|
|
3268
|
-
s.cards.map((h) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: h.id, children:
|
|
3312
|
+
s.cards.map((h) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: h.id, children: L() }, h.id)),
|
|
3269
3313
|
/* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
3270
3314
|
s.cards.map((h, v) => /* @__PURE__ */ e.jsx(
|
|
3271
3315
|
ls,
|
|
@@ -3278,7 +3322,7 @@ function ta() {
|
|
|
3278
3322
|
rs,
|
|
3279
3323
|
{
|
|
3280
3324
|
draggable: !0,
|
|
3281
|
-
onDragStart: (f) =>
|
|
3325
|
+
onDragStart: (f) => T(f, v),
|
|
3282
3326
|
onDragOver: F,
|
|
3283
3327
|
onDrop: (f) => A(f, v),
|
|
3284
3328
|
className: "",
|
|
@@ -3300,21 +3344,21 @@ function ta() {
|
|
|
3300
3344
|
h.id
|
|
3301
3345
|
)),
|
|
3302
3346
|
/* @__PURE__ */ e.jsx(
|
|
3303
|
-
|
|
3347
|
+
O,
|
|
3304
3348
|
{
|
|
3305
3349
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3306
3350
|
variant: "outline",
|
|
3307
3351
|
onClick: x,
|
|
3308
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3352
|
+
children: /* @__PURE__ */ e.jsx(Ds, { className: "h-4 w-4" })
|
|
3309
3353
|
}
|
|
3310
3354
|
),
|
|
3311
3355
|
/* @__PURE__ */ e.jsx(
|
|
3312
|
-
|
|
3356
|
+
O,
|
|
3313
3357
|
{
|
|
3314
3358
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3315
3359
|
variant: "outline",
|
|
3316
3360
|
onClick: b,
|
|
3317
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3361
|
+
children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4" })
|
|
3318
3362
|
}
|
|
3319
3363
|
)
|
|
3320
3364
|
] }) })
|
|
@@ -3322,7 +3366,7 @@ function ta() {
|
|
|
3322
3366
|
}
|
|
3323
3367
|
);
|
|
3324
3368
|
}
|
|
3325
|
-
function
|
|
3369
|
+
function L() {
|
|
3326
3370
|
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Kt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(We, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3327
3371
|
Wt,
|
|
3328
3372
|
{
|
|
@@ -3333,23 +3377,23 @@ function ta() {
|
|
|
3333
3377
|
) }) }) }) : /* @__PURE__ */ e.jsx(us, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ra, { className: "grow border-none shadow-none" }) });
|
|
3334
3378
|
}
|
|
3335
3379
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3336
|
-
(y || g) && /* @__PURE__ */ e.jsx(
|
|
3380
|
+
(y || g) && /* @__PURE__ */ e.jsx(Ve, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3337
3381
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3338
3382
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3339
|
-
/* @__PURE__ */ e.jsx(
|
|
3340
|
-
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(
|
|
3383
|
+
/* @__PURE__ */ e.jsx(kl, {}),
|
|
3384
|
+
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(Nl, {}),
|
|
3341
3385
|
/* @__PURE__ */ e.jsx(Ol, {})
|
|
3342
3386
|
] }),
|
|
3343
|
-
/* @__PURE__ */ e.jsx(
|
|
3387
|
+
/* @__PURE__ */ e.jsx(Il, {})
|
|
3344
3388
|
] }),
|
|
3345
3389
|
a ? S() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
3346
|
-
|
|
3347
|
-
(u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(
|
|
3390
|
+
c && /* @__PURE__ */ e.jsx(Fl, {}),
|
|
3391
|
+
(u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(vl, { data: (u == null ? void 0 : u.records) || [] }),
|
|
3348
3392
|
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
|
|
3349
3393
|
] })
|
|
3350
3394
|
] });
|
|
3351
3395
|
}
|
|
3352
|
-
function
|
|
3396
|
+
function Fl() {
|
|
3353
3397
|
const s = m((a) => a.pythonStdOut);
|
|
3354
3398
|
if (!s) return null;
|
|
3355
3399
|
const t = s.replace(/\n/g, "<br>");
|
|
@@ -3365,7 +3409,7 @@ function zl() {
|
|
|
3365
3409
|
/* @__PURE__ */ e.jsx(ge, { className: "mb-2" })
|
|
3366
3410
|
] });
|
|
3367
3411
|
}
|
|
3368
|
-
function
|
|
3412
|
+
function Il() {
|
|
3369
3413
|
const s = m((a) => a.isShowingVisual), t = m(
|
|
3370
3414
|
(a) => a.actions.setIsShowingVisual
|
|
3371
3415
|
);
|
|
@@ -3382,7 +3426,7 @@ function Fl() {
|
|
|
3382
3426
|
)
|
|
3383
3427
|
] });
|
|
3384
3428
|
}
|
|
3385
|
-
function
|
|
3429
|
+
function Dl({
|
|
3386
3430
|
options: s,
|
|
3387
3431
|
value: t,
|
|
3388
3432
|
onValueChange: a
|
|
@@ -3395,7 +3439,7 @@ function Il({
|
|
|
3395
3439
|
className: "flex gap-4",
|
|
3396
3440
|
defaultValue: s[0].value,
|
|
3397
3441
|
children: s.map((n) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3398
|
-
/* @__PURE__ */ e.jsx(
|
|
3442
|
+
/* @__PURE__ */ e.jsx(Ie, { value: n.value, id: n.value }),
|
|
3399
3443
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: n.value, children: n.label })
|
|
3400
3444
|
] }, n.value))
|
|
3401
3445
|
}
|
|
@@ -3412,17 +3456,17 @@ function ue({
|
|
|
3412
3456
|
/* @__PURE__ */ e.jsx(
|
|
3413
3457
|
he,
|
|
3414
3458
|
{
|
|
3415
|
-
className:
|
|
3459
|
+
className: Q("w-full focus:ring-0 focus:ring-offset-0", l),
|
|
3416
3460
|
children: /* @__PURE__ */ e.jsx(xe, { placeholder: s })
|
|
3417
3461
|
}
|
|
3418
3462
|
),
|
|
3419
3463
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3420
3464
|
/* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
3421
|
-
t.map((
|
|
3465
|
+
t.map((c) => /* @__PURE__ */ e.jsx(K, { value: c.value, children: c.label }, c.value))
|
|
3422
3466
|
] }) })
|
|
3423
3467
|
] });
|
|
3424
3468
|
}
|
|
3425
|
-
function
|
|
3469
|
+
function Ge({
|
|
3426
3470
|
children: s,
|
|
3427
3471
|
summary: t,
|
|
3428
3472
|
open: a,
|
|
@@ -3432,7 +3476,7 @@ function Ue({
|
|
|
3432
3476
|
"details",
|
|
3433
3477
|
{
|
|
3434
3478
|
open: a,
|
|
3435
|
-
className:
|
|
3479
|
+
className: Q("space-y-4 [&_summary>svg]:open:-rotate-180", n),
|
|
3436
3480
|
children: [
|
|
3437
3481
|
/* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3438
3482
|
/* @__PURE__ */ e.jsx(R, { children: t }),
|
|
@@ -3447,28 +3491,28 @@ function Tl() {
|
|
|
3447
3491
|
var b, I;
|
|
3448
3492
|
const s = m(
|
|
3449
3493
|
(C) => C.card.customCardPreferences
|
|
3450
|
-
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((C) => C.card), l = m((C) => C.frame),
|
|
3494
|
+
), { data: t } = Ka(), a = (t == null ? void 0 : t.plugins) || [], n = m((C) => C.card), l = m((C) => C.frame), c = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = re(), { components: o, manifest: d } = ja(
|
|
3451
3495
|
(s == null ? void 0 : s.url) || ""
|
|
3452
3496
|
), p = (b = d == null ? void 0 : d.visuals) == null ? void 0 : b.find(
|
|
3453
3497
|
(C) => C.name === (s == null ? void 0 : s.componentName)
|
|
3454
3498
|
);
|
|
3455
|
-
function u(C,
|
|
3499
|
+
function u(C, T) {
|
|
3456
3500
|
if (!s) return;
|
|
3457
3501
|
const A = {
|
|
3458
3502
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3459
3503
|
[C]: {
|
|
3460
|
-
cardId:
|
|
3504
|
+
cardId: T,
|
|
3461
3505
|
hookRef: null
|
|
3462
3506
|
}
|
|
3463
3507
|
};
|
|
3464
|
-
|
|
3508
|
+
r({
|
|
3465
3509
|
...s,
|
|
3466
3510
|
dataInputCardIds: A
|
|
3467
3511
|
});
|
|
3468
3512
|
}
|
|
3469
3513
|
function y(C) {
|
|
3470
3514
|
var F, A;
|
|
3471
|
-
const
|
|
3515
|
+
const T = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((N) => {
|
|
3472
3516
|
var S;
|
|
3473
3517
|
return ((S = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : S.visualType) !== "multiple";
|
|
3474
3518
|
}).map((N) => ({
|
|
@@ -3476,7 +3520,7 @@ function Tl() {
|
|
|
3476
3520
|
label: N.tabTitle || N.title
|
|
3477
3521
|
}));
|
|
3478
3522
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = C == null ? void 0 : C.dataInputs) == null ? void 0 : A.map((N, S) => {
|
|
3479
|
-
var
|
|
3523
|
+
var L, h;
|
|
3480
3524
|
return /* @__PURE__ */ e.jsxs(
|
|
3481
3525
|
"div",
|
|
3482
3526
|
{
|
|
@@ -3488,8 +3532,8 @@ function Tl() {
|
|
|
3488
3532
|
{
|
|
3489
3533
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3490
3534
|
label: "",
|
|
3491
|
-
options:
|
|
3492
|
-
value: ((h = (
|
|
3535
|
+
options: T || [],
|
|
3536
|
+
value: ((h = (L = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : L[S]) == null ? void 0 : h.cardId) || "",
|
|
3493
3537
|
onValueChange: (v) => u(S, v)
|
|
3494
3538
|
}
|
|
3495
3539
|
)
|
|
@@ -3499,43 +3543,43 @@ function Tl() {
|
|
|
3499
3543
|
);
|
|
3500
3544
|
}) });
|
|
3501
3545
|
}
|
|
3502
|
-
function g(C,
|
|
3546
|
+
function g(C, T, F = []) {
|
|
3503
3547
|
var A, N;
|
|
3504
3548
|
return s ? C === "input" ? /* @__PURE__ */ e.jsx(
|
|
3505
3549
|
le,
|
|
3506
3550
|
{
|
|
3507
|
-
className: `h-8 w-full ${
|
|
3508
|
-
value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[
|
|
3551
|
+
className: `h-8 w-full ${Be}`,
|
|
3552
|
+
value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[T]) || "",
|
|
3509
3553
|
onChange: (S) => {
|
|
3510
|
-
|
|
3554
|
+
r({
|
|
3511
3555
|
...s,
|
|
3512
3556
|
settings: {
|
|
3513
3557
|
...s == null ? void 0 : s.settings,
|
|
3514
|
-
[
|
|
3558
|
+
[T]: S.target.value
|
|
3515
3559
|
}
|
|
3516
3560
|
});
|
|
3517
3561
|
}
|
|
3518
3562
|
},
|
|
3519
|
-
|
|
3563
|
+
T
|
|
3520
3564
|
) : C === "select" ? /* @__PURE__ */ e.jsx(
|
|
3521
3565
|
ue,
|
|
3522
3566
|
{
|
|
3523
3567
|
className: "h-8 w-full",
|
|
3524
3568
|
label: "",
|
|
3525
3569
|
options: F,
|
|
3526
|
-
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[
|
|
3570
|
+
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[T]) || "",
|
|
3527
3571
|
onValueChange: (S) => {
|
|
3528
|
-
|
|
3572
|
+
r({
|
|
3529
3573
|
...s,
|
|
3530
|
-
settings: { ...s == null ? void 0 : s.settings, [
|
|
3574
|
+
settings: { ...s == null ? void 0 : s.settings, [T]: S }
|
|
3531
3575
|
});
|
|
3532
3576
|
}
|
|
3533
3577
|
}
|
|
3534
3578
|
) : null : null;
|
|
3535
3579
|
}
|
|
3536
3580
|
function x(C) {
|
|
3537
|
-
const
|
|
3538
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children:
|
|
3581
|
+
const T = Object.entries((C == null ? void 0 : C.settings) || {});
|
|
3582
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: T.map(([F, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3539
3583
|
/* @__PURE__ */ e.jsx(R, { children: A.title }),
|
|
3540
3584
|
g(
|
|
3541
3585
|
A.ui,
|
|
@@ -3545,7 +3589,7 @@ function Tl() {
|
|
|
3545
3589
|
] }, F)) });
|
|
3546
3590
|
}
|
|
3547
3591
|
function j(C) {
|
|
3548
|
-
s &&
|
|
3592
|
+
s && r({
|
|
3549
3593
|
...s,
|
|
3550
3594
|
visualType: C,
|
|
3551
3595
|
componentName: ""
|
|
@@ -3556,7 +3600,7 @@ function Tl() {
|
|
|
3556
3600
|
{
|
|
3557
3601
|
className: "p-6",
|
|
3558
3602
|
children: [
|
|
3559
|
-
/* @__PURE__ */ e.jsx(
|
|
3603
|
+
/* @__PURE__ */ e.jsx(Ge, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
|
|
3560
3604
|
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3561
3605
|
ue,
|
|
3562
3606
|
{
|
|
@@ -3564,7 +3608,7 @@ function Tl() {
|
|
|
3564
3608
|
label: "",
|
|
3565
3609
|
options: a,
|
|
3566
3610
|
value: (s == null ? void 0 : s.url) || "",
|
|
3567
|
-
onValueChange: (C) =>
|
|
3611
|
+
onValueChange: (C) => r({
|
|
3568
3612
|
...s || {
|
|
3569
3613
|
url: "",
|
|
3570
3614
|
componentName: ""
|
|
@@ -3574,32 +3618,32 @@ function Tl() {
|
|
|
3574
3618
|
}
|
|
3575
3619
|
) }) }),
|
|
3576
3620
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
|
|
3577
|
-
|
|
3621
|
+
Dl,
|
|
3578
3622
|
{
|
|
3579
3623
|
options: [
|
|
3580
3624
|
{ value: "single", label: "Single Visual" },
|
|
3581
3625
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3582
3626
|
],
|
|
3583
|
-
value:
|
|
3627
|
+
value: c,
|
|
3584
3628
|
onValueChange: j
|
|
3585
3629
|
}
|
|
3586
3630
|
),
|
|
3587
3631
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3588
3632
|
/* @__PURE__ */ e.jsx(R, { children: "Component" }),
|
|
3589
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children:
|
|
3633
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: o && /* @__PURE__ */ e.jsx(
|
|
3590
3634
|
ue,
|
|
3591
3635
|
{
|
|
3592
3636
|
className: "h-8 w-full",
|
|
3593
3637
|
label: "",
|
|
3594
|
-
options: (
|
|
3595
|
-
(C) => C.type ===
|
|
3638
|
+
options: (o == null ? void 0 : o.filter(
|
|
3639
|
+
(C) => C.type === c
|
|
3596
3640
|
).map((C) => ({
|
|
3597
3641
|
value: C.name,
|
|
3598
3642
|
label: C.name
|
|
3599
3643
|
}))) || [],
|
|
3600
3644
|
value: s.componentName,
|
|
3601
3645
|
onValueChange: (C) => {
|
|
3602
|
-
console.log("changing value", C),
|
|
3646
|
+
console.log("changing value", C), r({
|
|
3603
3647
|
...s,
|
|
3604
3648
|
componentName: C
|
|
3605
3649
|
});
|
|
@@ -3609,7 +3653,7 @@ function Tl() {
|
|
|
3609
3653
|
] }) })
|
|
3610
3654
|
] }) }) }),
|
|
3611
3655
|
/* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
|
|
3612
|
-
((I = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : I.componentName) && /* @__PURE__ */ e.jsxs(
|
|
3656
|
+
((I = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : I.componentName) && /* @__PURE__ */ e.jsxs(Ge, { summary: "Component Settings", children: [
|
|
3613
3657
|
p && p.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3614
3658
|
/* @__PURE__ */ e.jsx(R, { children: "Input Mapping" }),
|
|
3615
3659
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(p) })
|
|
@@ -3620,12 +3664,12 @@ function Tl() {
|
|
|
3620
3664
|
}
|
|
3621
3665
|
);
|
|
3622
3666
|
}
|
|
3623
|
-
function
|
|
3667
|
+
function Te() {
|
|
3624
3668
|
const [s, t] = q([]);
|
|
3625
3669
|
m(
|
|
3626
3670
|
(u) => u.card.cfg
|
|
3627
3671
|
);
|
|
3628
|
-
const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences:
|
|
3672
|
+
const a = m((u) => u.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: c } = m((u) => u.actions), r = m(
|
|
3629
3673
|
(u) => u.queryResultColumns
|
|
3630
3674
|
);
|
|
3631
3675
|
m(
|
|
@@ -3634,11 +3678,11 @@ function De() {
|
|
|
3634
3678
|
return (y = u.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
|
|
3635
3679
|
}
|
|
3636
3680
|
), Z(() => {
|
|
3637
|
-
|
|
3638
|
-
}, [
|
|
3639
|
-
function
|
|
3681
|
+
r && t(new Array(r.length).fill(!1));
|
|
3682
|
+
}, [r]);
|
|
3683
|
+
function o(u, y) {
|
|
3640
3684
|
var g, x;
|
|
3641
|
-
y ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ?
|
|
3685
|
+
y ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? c({
|
|
3642
3686
|
...a,
|
|
3643
3687
|
onClickFilter: [
|
|
3644
3688
|
...a.onClickFilter,
|
|
@@ -3647,7 +3691,7 @@ function De() {
|
|
|
3647
3691
|
expression: ""
|
|
3648
3692
|
}
|
|
3649
3693
|
]
|
|
3650
|
-
}) :
|
|
3694
|
+
}) : c({
|
|
3651
3695
|
...a,
|
|
3652
3696
|
onClickFilter: [
|
|
3653
3697
|
{
|
|
@@ -3655,7 +3699,7 @@ function De() {
|
|
|
3655
3699
|
expression: ""
|
|
3656
3700
|
}
|
|
3657
3701
|
]
|
|
3658
|
-
}) : (
|
|
3702
|
+
}) : (c({
|
|
3659
3703
|
...a,
|
|
3660
3704
|
onClickFilter: (x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.filter(
|
|
3661
3705
|
(j) => j.columnIndex !== u
|
|
@@ -3671,7 +3715,7 @@ function De() {
|
|
|
3671
3715
|
...j,
|
|
3672
3716
|
expression: y.target.value
|
|
3673
3717
|
} : j);
|
|
3674
|
-
|
|
3718
|
+
c({
|
|
3675
3719
|
...a,
|
|
3676
3720
|
onClickFilter: g
|
|
3677
3721
|
});
|
|
@@ -3692,7 +3736,7 @@ function De() {
|
|
|
3692
3736
|
}
|
|
3693
3737
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3694
3738
|
/* @__PURE__ */ e.jsx(R, { children: "On Click" }),
|
|
3695
|
-
|
|
3739
|
+
r == null ? void 0 : r.map((u, y) => {
|
|
3696
3740
|
var g, x;
|
|
3697
3741
|
return /* @__PURE__ */ e.jsx(
|
|
3698
3742
|
"div",
|
|
@@ -3706,7 +3750,7 @@ function De() {
|
|
|
3706
3750
|
checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
|
|
3707
3751
|
(j) => j.columnIndex === y
|
|
3708
3752
|
)),
|
|
3709
|
-
onCheckedChange: (j) =>
|
|
3753
|
+
onCheckedChange: (j) => o(y, j)
|
|
3710
3754
|
}
|
|
3711
3755
|
),
|
|
3712
3756
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3719,7 +3763,7 @@ function De() {
|
|
|
3719
3763
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.find(
|
|
3720
3764
|
(j) => j.columnIndex === y
|
|
3721
3765
|
)) && /* @__PURE__ */ e.jsx(
|
|
3722
|
-
|
|
3766
|
+
Ta,
|
|
3723
3767
|
{
|
|
3724
3768
|
onClick: () => {
|
|
3725
3769
|
t((j) => {
|
|
@@ -3740,28 +3784,28 @@ function De() {
|
|
|
3740
3784
|
] });
|
|
3741
3785
|
}
|
|
3742
3786
|
function fs() {
|
|
3743
|
-
var
|
|
3787
|
+
var r, o, d;
|
|
3744
3788
|
const s = m((p) => p.card.preferences), t = m(
|
|
3745
3789
|
(p) => p.card.cfg
|
|
3746
3790
|
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = m((p) => p.actions);
|
|
3747
|
-
(
|
|
3748
|
-
function
|
|
3791
|
+
(r = t == null ? void 0 : t.options) != null && r.indexAxis;
|
|
3792
|
+
function c(p) {
|
|
3749
3793
|
l(p);
|
|
3750
3794
|
}
|
|
3751
3795
|
return /* @__PURE__ */ e.jsxs(
|
|
3752
3796
|
ps,
|
|
3753
3797
|
{
|
|
3754
|
-
value: ((
|
|
3755
|
-
onValueChange:
|
|
3798
|
+
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = t == null ? void 0 : t.options) == null ? void 0 : d.indexAxis) || "x",
|
|
3799
|
+
onValueChange: c,
|
|
3756
3800
|
className: "flex gap-3",
|
|
3757
3801
|
defaultValue: "x",
|
|
3758
3802
|
children: [
|
|
3759
3803
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3760
|
-
/* @__PURE__ */ e.jsx(
|
|
3804
|
+
/* @__PURE__ */ e.jsx(Ie, { value: "x", id: "r1" }),
|
|
3761
3805
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
|
|
3762
3806
|
] }),
|
|
3763
3807
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3764
|
-
/* @__PURE__ */ e.jsx(
|
|
3808
|
+
/* @__PURE__ */ e.jsx(Ie, { value: "y", id: "r2" }),
|
|
3765
3809
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
|
|
3766
3810
|
] })
|
|
3767
3811
|
]
|
|
@@ -3770,44 +3814,44 @@ function fs() {
|
|
|
3770
3814
|
}
|
|
3771
3815
|
const ts = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3772
3816
|
function na(s, t) {
|
|
3773
|
-
var n, l,
|
|
3817
|
+
var n, l, c;
|
|
3774
3818
|
const a = wa(s, t);
|
|
3775
|
-
return ((
|
|
3819
|
+
return ((c = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : c.type) || "linear";
|
|
3776
3820
|
}
|
|
3777
3821
|
function Wa() {
|
|
3778
|
-
var ie,
|
|
3822
|
+
var ie, W, ae, w, _, ee;
|
|
3779
3823
|
const [s, t] = q(!1), a = m((E) => {
|
|
3780
|
-
var
|
|
3781
|
-
return (
|
|
3824
|
+
var D;
|
|
3825
|
+
return (D = E.card) == null ? void 0 : D.preferences;
|
|
3782
3826
|
}), n = m((E) => {
|
|
3783
|
-
var
|
|
3784
|
-
return (
|
|
3785
|
-
}), l = wa(a, n), [
|
|
3827
|
+
var D;
|
|
3828
|
+
return (D = E.card) == null ? void 0 : D.cfg;
|
|
3829
|
+
}), l = wa(a, n), [c, r] = q(
|
|
3786
3830
|
na(a)
|
|
3787
|
-
), [
|
|
3788
|
-
((ae = (
|
|
3831
|
+
), [o, d] = q(
|
|
3832
|
+
((ae = (W = (ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : W[l]) == null ? void 0 : ae.min) || ""
|
|
3789
3833
|
), [p, u] = q(
|
|
3790
3834
|
((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
|
|
3791
|
-
), [y, g] = q(
|
|
3835
|
+
), [y, g] = q(o || p ? "custom" : "auto"), [x, j] = q(""), [b, I] = q(0), [C, T] = q(""), [F, A] = q(""), [N, S] = q(""), L = m(
|
|
3792
3836
|
(E) => E.actions.setCardPreferences
|
|
3793
3837
|
), { updateCardInFrame: h } = re(), v = m((E) => E.card), f = m((E) => {
|
|
3794
|
-
var
|
|
3795
|
-
return (
|
|
3838
|
+
var D;
|
|
3839
|
+
return (D = E.card) == null ? void 0 : D.type;
|
|
3796
3840
|
}), k = ["pie", "doughnut", "polarArea"].includes(f);
|
|
3797
3841
|
Z(() => {
|
|
3798
|
-
var E,
|
|
3799
|
-
|
|
3800
|
-
((se = (
|
|
3842
|
+
var E, D, se, $, X, te, Le, ze, be, ye, J, oe, ce, Oe;
|
|
3843
|
+
r(na(a)), d(
|
|
3844
|
+
((se = (D = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : D[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
|
|
3801
3845
|
), u(((te = (X = ($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : X[l]) == null ? void 0 : te.max) || ""), j(
|
|
3802
|
-
((ye = (be = (
|
|
3803
|
-
), I(((
|
|
3846
|
+
((ye = (be = (ze = (Le = a == null ? void 0 : a.chartOptions) == null ? void 0 : Le.scales) == null ? void 0 : ze[l]) == null ? void 0 : be.ticks) == null ? void 0 : ye.stepSize) || ""
|
|
3847
|
+
), I(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), T(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.locale) || "");
|
|
3804
3848
|
}, [s, a, l]);
|
|
3805
|
-
function
|
|
3806
|
-
return
|
|
3849
|
+
function M(E, D) {
|
|
3850
|
+
return D === "" || /^[0-9\b]+$/.test(D) ? Number(D) : Number(E);
|
|
3807
3851
|
}
|
|
3808
3852
|
function H() {
|
|
3809
3853
|
const E = [
|
|
3810
|
-
...new Set(os.map((
|
|
3854
|
+
...new Set(os.map((D) => D.currency))
|
|
3811
3855
|
];
|
|
3812
3856
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3813
3857
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
@@ -3830,18 +3874,18 @@ function Wa() {
|
|
|
3830
3874
|
me,
|
|
3831
3875
|
{
|
|
3832
3876
|
value: F || "none",
|
|
3833
|
-
onValueChange: (
|
|
3877
|
+
onValueChange: (D) => A(D === "none" ? "" : D),
|
|
3834
3878
|
children: [
|
|
3835
3879
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
3836
3880
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3837
3881
|
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
3838
|
-
/* @__PURE__ */ e.jsx(
|
|
3839
|
-
E.map((
|
|
3882
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }),
|
|
3883
|
+
E.map((D) => /* @__PURE__ */ e.jsx(K, { value: D, children: D }, D))
|
|
3840
3884
|
] }) })
|
|
3841
3885
|
]
|
|
3842
3886
|
}
|
|
3843
3887
|
),
|
|
3844
|
-
/* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (
|
|
3888
|
+
/* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (D) => S(D), children: [
|
|
3845
3889
|
/* @__PURE__ */ e.jsx(
|
|
3846
3890
|
he,
|
|
3847
3891
|
{
|
|
@@ -3851,7 +3895,7 @@ function Wa() {
|
|
|
3851
3895
|
),
|
|
3852
3896
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3853
3897
|
/* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
|
|
3854
|
-
os.map((
|
|
3898
|
+
os.map((D) => /* @__PURE__ */ e.jsx(K, { value: D.locale, children: D.locale }, D.locale))
|
|
3855
3899
|
] }) })
|
|
3856
3900
|
] })
|
|
3857
3901
|
] }),
|
|
@@ -3861,7 +3905,7 @@ function Wa() {
|
|
|
3861
3905
|
le,
|
|
3862
3906
|
{
|
|
3863
3907
|
value: b,
|
|
3864
|
-
onChange: (
|
|
3908
|
+
onChange: (D) => I(Number(D.target.value)),
|
|
3865
3909
|
id: "format",
|
|
3866
3910
|
className: `col-span-6 h-8 w-full tracking-wide ${ts}`
|
|
3867
3911
|
}
|
|
@@ -3877,8 +3921,8 @@ function Wa() {
|
|
|
3877
3921
|
le,
|
|
3878
3922
|
{
|
|
3879
3923
|
id: "min",
|
|
3880
|
-
value:
|
|
3881
|
-
onChange: (E) => d((
|
|
3924
|
+
value: o,
|
|
3925
|
+
onChange: (E) => d((D) => M(D, E.target.value)),
|
|
3882
3926
|
className: `col-span-1 h-8 w-full ${ts}`
|
|
3883
3927
|
}
|
|
3884
3928
|
),
|
|
@@ -3886,7 +3930,7 @@ function Wa() {
|
|
|
3886
3930
|
le,
|
|
3887
3931
|
{
|
|
3888
3932
|
value: p,
|
|
3889
|
-
onChange: (E) => u((
|
|
3933
|
+
onChange: (E) => u((D) => M(D, E.target.value)),
|
|
3890
3934
|
id: "max",
|
|
3891
3935
|
className: `col-span-1 h-8 w-full ${ts}`
|
|
3892
3936
|
}
|
|
@@ -3898,7 +3942,7 @@ function Wa() {
|
|
|
3898
3942
|
le,
|
|
3899
3943
|
{
|
|
3900
3944
|
value: x,
|
|
3901
|
-
onChange: (E) => j((
|
|
3945
|
+
onChange: (E) => j((D) => M(D, E.target.value)),
|
|
3902
3946
|
id: "step-size",
|
|
3903
3947
|
className: `col-span-1 h-8 w-full ${ts}`
|
|
3904
3948
|
}
|
|
@@ -3910,13 +3954,13 @@ function Wa() {
|
|
|
3910
3954
|
var $;
|
|
3911
3955
|
let E = {};
|
|
3912
3956
|
y === "custom" && (E = {
|
|
3913
|
-
min:
|
|
3957
|
+
min: o,
|
|
3914
3958
|
max: p,
|
|
3915
3959
|
ticks: {
|
|
3916
3960
|
stepSize: x
|
|
3917
3961
|
}
|
|
3918
3962
|
});
|
|
3919
|
-
const
|
|
3963
|
+
const D = {
|
|
3920
3964
|
...a || {},
|
|
3921
3965
|
chartOptions: {
|
|
3922
3966
|
...a == null ? void 0 : a.chartOptions,
|
|
@@ -3924,8 +3968,8 @@ function Wa() {
|
|
|
3924
3968
|
...($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales,
|
|
3925
3969
|
[l]: {
|
|
3926
3970
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3927
|
-
type:
|
|
3928
|
-
...
|
|
3971
|
+
type: c,
|
|
3972
|
+
...c === "linear" ? E : {}
|
|
3929
3973
|
}
|
|
3930
3974
|
}
|
|
3931
3975
|
},
|
|
@@ -3936,10 +3980,10 @@ function Wa() {
|
|
|
3936
3980
|
locale: N
|
|
3937
3981
|
}
|
|
3938
3982
|
};
|
|
3939
|
-
console.log(
|
|
3983
|
+
console.log(D), L(D);
|
|
3940
3984
|
const se = {
|
|
3941
3985
|
...v,
|
|
3942
|
-
preferences:
|
|
3986
|
+
preferences: D
|
|
3943
3987
|
};
|
|
3944
3988
|
h(se);
|
|
3945
3989
|
}
|
|
@@ -3957,20 +4001,20 @@ function Wa() {
|
|
|
3957
4001
|
me,
|
|
3958
4002
|
{
|
|
3959
4003
|
disabled: k,
|
|
3960
|
-
value:
|
|
3961
|
-
onValueChange: (E) =>
|
|
4004
|
+
value: c,
|
|
4005
|
+
onValueChange: (E) => r(E),
|
|
3962
4006
|
children: [
|
|
3963
4007
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
3964
4008
|
/* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3965
4009
|
/* @__PURE__ */ e.jsx(fe, { children: "Option" }),
|
|
3966
|
-
/* @__PURE__ */ e.jsx(
|
|
3967
|
-
/* @__PURE__ */ e.jsx(
|
|
4010
|
+
/* @__PURE__ */ e.jsx(K, { value: "linear", children: "Linear" }),
|
|
4011
|
+
/* @__PURE__ */ e.jsx(K, { value: "logarithmic", children: "Logarithmic" })
|
|
3968
4012
|
] }) })
|
|
3969
4013
|
]
|
|
3970
4014
|
}
|
|
3971
4015
|
)
|
|
3972
4016
|
] }),
|
|
3973
|
-
|
|
4017
|
+
c == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3974
4018
|
/* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
|
|
3975
4019
|
/* @__PURE__ */ e.jsxs(
|
|
3976
4020
|
ps,
|
|
@@ -3983,22 +4027,22 @@ function Wa() {
|
|
|
3983
4027
|
defaultValue: "x",
|
|
3984
4028
|
children: [
|
|
3985
4029
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3986
|
-
/* @__PURE__ */ e.jsx(
|
|
4030
|
+
/* @__PURE__ */ e.jsx(Ie, { value: "auto", id: "r1" }),
|
|
3987
4031
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
|
|
3988
4032
|
] }),
|
|
3989
4033
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3990
|
-
/* @__PURE__ */ e.jsx(
|
|
4034
|
+
/* @__PURE__ */ e.jsx(Ie, { value: "custom", id: "r2" }),
|
|
3991
4035
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
|
|
3992
4036
|
] })
|
|
3993
4037
|
]
|
|
3994
4038
|
}
|
|
3995
4039
|
)
|
|
3996
4040
|
] }),
|
|
3997
|
-
y === "custom" &&
|
|
4041
|
+
y === "custom" && c == "linear" && P(),
|
|
3998
4042
|
H(),
|
|
3999
4043
|
/* @__PURE__ */ e.jsx(en, {}),
|
|
4000
4044
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
4001
|
-
|
|
4045
|
+
O,
|
|
4002
4046
|
{
|
|
4003
4047
|
onClick: Y,
|
|
4004
4048
|
variant: "secondary",
|
|
@@ -4010,8 +4054,8 @@ function Wa() {
|
|
|
4010
4054
|
] }) })
|
|
4011
4055
|
] });
|
|
4012
4056
|
}
|
|
4013
|
-
function
|
|
4014
|
-
var
|
|
4057
|
+
function Ll({ idx: s }) {
|
|
4058
|
+
var o;
|
|
4015
4059
|
const t = m((d) => {
|
|
4016
4060
|
var p;
|
|
4017
4061
|
return (p = d.card) == null ? void 0 : p.preferences;
|
|
@@ -4022,8 +4066,8 @@ function Dl({ idx: s }) {
|
|
|
4022
4066
|
}
|
|
4023
4067
|
), n = m(
|
|
4024
4068
|
(d) => d.actions.setCardPreferences
|
|
4025
|
-
), l = (
|
|
4026
|
-
function
|
|
4069
|
+
), l = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, c = a == null ? void 0 : a.find((d) => d.idx === s);
|
|
4070
|
+
function r(d, p) {
|
|
4027
4071
|
(d === "end" || d === "start") && sn(an());
|
|
4028
4072
|
const u = {
|
|
4029
4073
|
display: d !== "none",
|
|
@@ -4031,7 +4075,7 @@ function Dl({ idx: s }) {
|
|
|
4031
4075
|
anchor: d,
|
|
4032
4076
|
clamp: !0
|
|
4033
4077
|
};
|
|
4034
|
-
if (!
|
|
4078
|
+
if (!c)
|
|
4035
4079
|
n({
|
|
4036
4080
|
...t,
|
|
4037
4081
|
datasetOptions: [
|
|
@@ -4043,7 +4087,7 @@ function Dl({ idx: s }) {
|
|
|
4043
4087
|
]
|
|
4044
4088
|
});
|
|
4045
4089
|
else {
|
|
4046
|
-
const y = { ...
|
|
4090
|
+
const y = { ...c };
|
|
4047
4091
|
y.datalabels = u;
|
|
4048
4092
|
const g = a == null ? void 0 : a.map(
|
|
4049
4093
|
(x) => x.idx === p ? y : x
|
|
@@ -4058,9 +4102,9 @@ function Dl({ idx: s }) {
|
|
|
4058
4102
|
/* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Jn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4059
4103
|
/* @__PURE__ */ e.jsx(xs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4060
4104
|
/* @__PURE__ */ e.jsx(
|
|
4061
|
-
|
|
4105
|
+
O,
|
|
4062
4106
|
{
|
|
4063
|
-
onClick: () =>
|
|
4107
|
+
onClick: () => r("none", s),
|
|
4064
4108
|
size: "sm",
|
|
4065
4109
|
variant: "secondary",
|
|
4066
4110
|
className: "h-7 p-1 text-xs font-normal",
|
|
@@ -4068,16 +4112,16 @@ function Dl({ idx: s }) {
|
|
|
4068
4112
|
}
|
|
4069
4113
|
),
|
|
4070
4114
|
/* @__PURE__ */ e.jsx(
|
|
4071
|
-
|
|
4115
|
+
O,
|
|
4072
4116
|
{
|
|
4073
|
-
onClick: () =>
|
|
4117
|
+
onClick: () => r("start", s),
|
|
4074
4118
|
size: "sm",
|
|
4075
4119
|
variant: "secondary",
|
|
4076
4120
|
className: "h-7 p-1 text-xs font-normal",
|
|
4077
4121
|
children: /* @__PURE__ */ e.jsx(
|
|
4078
4122
|
Vn,
|
|
4079
4123
|
{
|
|
4080
|
-
className:
|
|
4124
|
+
className: Q("h-4 w-4", {
|
|
4081
4125
|
"rotate-90": l === "y"
|
|
4082
4126
|
})
|
|
4083
4127
|
}
|
|
@@ -4085,16 +4129,16 @@ function Dl({ idx: s }) {
|
|
|
4085
4129
|
}
|
|
4086
4130
|
),
|
|
4087
4131
|
/* @__PURE__ */ e.jsx(
|
|
4088
|
-
|
|
4132
|
+
O,
|
|
4089
4133
|
{
|
|
4090
|
-
onClick: () =>
|
|
4134
|
+
onClick: () => r("center", s),
|
|
4091
4135
|
size: "sm",
|
|
4092
4136
|
variant: "secondary",
|
|
4093
4137
|
className: "h-7 p-1 text-xs font-normal",
|
|
4094
4138
|
children: /* @__PURE__ */ e.jsx(
|
|
4095
4139
|
Rn,
|
|
4096
4140
|
{
|
|
4097
|
-
className:
|
|
4141
|
+
className: Q("h-4 w-4", {
|
|
4098
4142
|
"rotate-90": l === "y"
|
|
4099
4143
|
})
|
|
4100
4144
|
}
|
|
@@ -4102,16 +4146,16 @@ function Dl({ idx: s }) {
|
|
|
4102
4146
|
}
|
|
4103
4147
|
),
|
|
4104
4148
|
/* @__PURE__ */ e.jsx(
|
|
4105
|
-
|
|
4149
|
+
O,
|
|
4106
4150
|
{
|
|
4107
|
-
onClick: () =>
|
|
4151
|
+
onClick: () => r("end", s),
|
|
4108
4152
|
size: "sm",
|
|
4109
4153
|
variant: "secondary",
|
|
4110
4154
|
className: "h-7 p-1 text-xs font-normal",
|
|
4111
4155
|
children: /* @__PURE__ */ e.jsx(
|
|
4112
4156
|
qn,
|
|
4113
4157
|
{
|
|
4114
|
-
className:
|
|
4158
|
+
className: Q("h-4 w-4", {
|
|
4115
4159
|
"rotate-90": l === "y"
|
|
4116
4160
|
})
|
|
4117
4161
|
}
|
|
@@ -4127,25 +4171,25 @@ function Ya() {
|
|
|
4127
4171
|
var u, y, g;
|
|
4128
4172
|
return (g = (y = (u = p == null ? void 0 : p.card) == null ? void 0 : u.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : g.indexAxis;
|
|
4129
4173
|
}
|
|
4130
|
-
), { data: a } =
|
|
4131
|
-
keys:
|
|
4132
|
-
metricKeys:
|
|
4133
|
-
dimensionKeys:
|
|
4174
|
+
), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
|
|
4175
|
+
keys: c,
|
|
4176
|
+
metricKeys: r,
|
|
4177
|
+
dimensionKeys: o
|
|
4134
4178
|
} = vs((a == null ? void 0 : a.records) || []);
|
|
4135
|
-
let d =
|
|
4179
|
+
let d = r;
|
|
4136
4180
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4137
4181
|
const p = tn({
|
|
4138
4182
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4139
|
-
groupKey:
|
|
4140
|
-
pivotKey:
|
|
4183
|
+
groupKey: o[0],
|
|
4184
|
+
pivotKey: o[1],
|
|
4141
4185
|
valueKey: d[0]
|
|
4142
4186
|
}), { metricKeys: u } = vs(p);
|
|
4143
4187
|
d = u;
|
|
4144
4188
|
}
|
|
4145
|
-
return
|
|
4189
|
+
return c.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4146
4190
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4147
4191
|
/* @__PURE__ */ e.jsx(R, { children: n }),
|
|
4148
|
-
/* @__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:
|
|
4192
|
+
/* @__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] }) }) })
|
|
4149
4193
|
] }),
|
|
4150
4194
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4151
4195
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
@@ -4157,35 +4201,35 @@ function Ya() {
|
|
|
4157
4201
|
] });
|
|
4158
4202
|
}
|
|
4159
4203
|
function Ml({ col: s, idx: t }) {
|
|
4160
|
-
const a = m((
|
|
4204
|
+
const a = m((o) => {
|
|
4161
4205
|
var d;
|
|
4162
|
-
return (d =
|
|
4206
|
+
return (d = o.card) == null ? void 0 : d.preferences;
|
|
4163
4207
|
}), n = m(
|
|
4164
|
-
(
|
|
4208
|
+
(o) => {
|
|
4165
4209
|
var d;
|
|
4166
|
-
return (d =
|
|
4210
|
+
return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
|
|
4167
4211
|
}
|
|
4168
|
-
), l = n == null ? void 0 : n.find((
|
|
4169
|
-
function
|
|
4212
|
+
), l = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: c } = m((o) => o.actions);
|
|
4213
|
+
function r(o) {
|
|
4170
4214
|
if (!l)
|
|
4171
|
-
|
|
4215
|
+
c({
|
|
4172
4216
|
...a,
|
|
4173
4217
|
datasetOptions: [
|
|
4174
4218
|
...n || [],
|
|
4175
4219
|
{
|
|
4176
4220
|
idx: t,
|
|
4177
|
-
type:
|
|
4178
|
-
fill:
|
|
4221
|
+
type: o === "area" ? "line" : o,
|
|
4222
|
+
fill: o === "area" ? "origin" : ""
|
|
4179
4223
|
}
|
|
4180
4224
|
]
|
|
4181
4225
|
});
|
|
4182
4226
|
else {
|
|
4183
4227
|
const d = { ...l };
|
|
4184
|
-
d.type =
|
|
4228
|
+
d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
|
|
4185
4229
|
const p = n == null ? void 0 : n.map(
|
|
4186
4230
|
(u) => u.idx === t ? d : u
|
|
4187
4231
|
);
|
|
4188
|
-
|
|
4232
|
+
c({
|
|
4189
4233
|
...a,
|
|
4190
4234
|
datasetOptions: p
|
|
4191
4235
|
});
|
|
@@ -4197,53 +4241,53 @@ function Ml({ col: s, idx: t }) {
|
|
|
4197
4241
|
/* @__PURE__ */ e.jsx(
|
|
4198
4242
|
Ps,
|
|
4199
4243
|
{
|
|
4200
|
-
onClick: () =>
|
|
4244
|
+
onClick: () => r("bar"),
|
|
4201
4245
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4202
4246
|
}
|
|
4203
4247
|
),
|
|
4204
4248
|
/* @__PURE__ */ e.jsx(
|
|
4205
4249
|
Bs,
|
|
4206
4250
|
{
|
|
4207
|
-
onClick: () =>
|
|
4251
|
+
onClick: () => r("line"),
|
|
4208
4252
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4209
4253
|
}
|
|
4210
4254
|
),
|
|
4211
4255
|
/* @__PURE__ */ e.jsx(
|
|
4212
4256
|
wn,
|
|
4213
4257
|
{
|
|
4214
|
-
onClick: () =>
|
|
4258
|
+
onClick: () => r("area"),
|
|
4215
4259
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4216
4260
|
}
|
|
4217
4261
|
),
|
|
4218
|
-
/* @__PURE__ */ e.jsx(
|
|
4262
|
+
/* @__PURE__ */ e.jsx(Ll, { idx: t })
|
|
4219
4263
|
] })
|
|
4220
4264
|
] });
|
|
4221
4265
|
}
|
|
4222
4266
|
function Xa() {
|
|
4223
|
-
const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName),
|
|
4267
|
+
const s = m((g) => g.selectedConnectionId), t = m((g) => g.selectedDatamodelId), a = m((g) => g.selectedDatabaseName), n = m((g) => g.selectedSchemaName), l = m((g) => g.selectedTableName), c = z((g) => g.dashboard.filters) || [], r = z((g) => g.actions.addFilter), o = z((g) => g.actions.removeFilter), d = z(
|
|
4224
4268
|
(g) => g.actions.removeFilterValue
|
|
4225
|
-
), { modelItems: p, tableName: u } =
|
|
4269
|
+
), { modelItems: p, tableName: u } = Re();
|
|
4226
4270
|
function y(g, x = "dashboard") {
|
|
4227
4271
|
var S;
|
|
4228
4272
|
const j = de(g.column_name), b = de(a || ""), I = de(n || ""), C = de(u);
|
|
4229
|
-
let
|
|
4273
|
+
let T = fa(
|
|
4230
4274
|
I,
|
|
4231
4275
|
C
|
|
4232
|
-
), F = `${
|
|
4276
|
+
), F = `${T}.${j}`;
|
|
4233
4277
|
const A = (S = p == null ? void 0 : p.find(
|
|
4234
|
-
(
|
|
4278
|
+
(L) => L.id === t
|
|
4235
4279
|
)) == null ? void 0 : S.name;
|
|
4236
|
-
t && t !== "none" && (F = `${ys}.${A}.${j}`,
|
|
4237
|
-
const N =
|
|
4238
|
-
(
|
|
4280
|
+
t && t !== "none" && (F = `${ys}.${A}.${j}`, T = `${ys}.${A}`);
|
|
4281
|
+
const N = c == null ? void 0 : c.find(
|
|
4282
|
+
(L) => L.column === F && L.table === C && (L.database === b || L.database === a)
|
|
4239
4283
|
);
|
|
4240
4284
|
if (N)
|
|
4241
|
-
d(N.id),
|
|
4285
|
+
d(N.id), o(N.id);
|
|
4242
4286
|
else {
|
|
4243
|
-
const
|
|
4244
|
-
return u === "api" && s ? (
|
|
4287
|
+
const L = Je();
|
|
4288
|
+
return u === "api" && s ? (r({
|
|
4245
4289
|
location: x,
|
|
4246
|
-
id:
|
|
4290
|
+
id: L,
|
|
4247
4291
|
//uuidv4(),
|
|
4248
4292
|
column: F,
|
|
4249
4293
|
title: g.column_name,
|
|
@@ -4255,12 +4299,12 @@ function Xa() {
|
|
|
4255
4299
|
operation: "in",
|
|
4256
4300
|
sql: Zs(
|
|
4257
4301
|
g.data_type,
|
|
4258
|
-
|
|
4302
|
+
T,
|
|
4259
4303
|
j
|
|
4260
4304
|
)
|
|
4261
4305
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4262
|
-
}),
|
|
4263
|
-
id:
|
|
4306
|
+
}), L) : (r({
|
|
4307
|
+
id: L,
|
|
4264
4308
|
//uuidv4(),
|
|
4265
4309
|
location: x,
|
|
4266
4310
|
column: F,
|
|
@@ -4273,39 +4317,39 @@ function Xa() {
|
|
|
4273
4317
|
operation: "in",
|
|
4274
4318
|
sql: Zs(
|
|
4275
4319
|
g.data_type,
|
|
4276
|
-
|
|
4320
|
+
T,
|
|
4277
4321
|
j
|
|
4278
4322
|
)
|
|
4279
4323
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4280
|
-
}),
|
|
4324
|
+
}), L);
|
|
4281
4325
|
}
|
|
4282
4326
|
}
|
|
4283
4327
|
return { assignFilter: y };
|
|
4284
4328
|
}
|
|
4285
|
-
function
|
|
4286
|
-
const s =
|
|
4287
|
-
(
|
|
4288
|
-
), t = m((
|
|
4289
|
-
function o
|
|
4290
|
-
const d = l(
|
|
4329
|
+
function _e() {
|
|
4330
|
+
const s = z(
|
|
4331
|
+
(o) => o.dashboard.filters
|
|
4332
|
+
), t = m((o) => o.frame), { setFrame: a } = re(), { columns: n } = Re(), { assignFilter: l } = Xa();
|
|
4333
|
+
function c(o) {
|
|
4334
|
+
const d = l(o, "frame");
|
|
4291
4335
|
a({ ...t, filterId: d });
|
|
4292
4336
|
}
|
|
4293
|
-
const
|
|
4337
|
+
const r = s == null ? void 0 : s.find((o) => o.id === t.filterId);
|
|
4294
4338
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4295
4339
|
/* @__PURE__ */ e.jsx(R, { children: "Card Filter" }),
|
|
4296
|
-
/* @__PURE__ */ e.jsx(
|
|
4297
|
-
|
|
4340
|
+
/* @__PURE__ */ e.jsx(El, { onSelect: c, columns: n }),
|
|
4341
|
+
r && /* @__PURE__ */ e.jsx(nn, { filter: r })
|
|
4298
4342
|
] });
|
|
4299
4343
|
}
|
|
4300
|
-
function
|
|
4344
|
+
function El({
|
|
4301
4345
|
columns: s,
|
|
4302
4346
|
onSelect: t
|
|
4303
4347
|
}) {
|
|
4304
|
-
var
|
|
4305
|
-
const [a, n] = ea.useState(!1), [l,
|
|
4348
|
+
var r;
|
|
4349
|
+
const [a, n] = ea.useState(!1), [l, c] = ea.useState("");
|
|
4306
4350
|
return /* @__PURE__ */ e.jsxs(ms, { open: a, onOpenChange: n, children: [
|
|
4307
4351
|
/* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4308
|
-
|
|
4352
|
+
O,
|
|
4309
4353
|
{
|
|
4310
4354
|
size: "sm",
|
|
4311
4355
|
variant: "outline",
|
|
@@ -4313,7 +4357,7 @@ function Ll({
|
|
|
4313
4357
|
"aria-expanded": a,
|
|
4314
4358
|
className: "w-full justify-between font-normal",
|
|
4315
4359
|
children: [
|
|
4316
|
-
l ? (
|
|
4360
|
+
l ? (r = s.find((o) => o.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
|
|
4317
4361
|
/* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4318
4362
|
]
|
|
4319
4363
|
}
|
|
@@ -4322,37 +4366,37 @@ function Ll({
|
|
|
4322
4366
|
/* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
|
|
4323
4367
|
/* @__PURE__ */ e.jsxs(cn, { children: [
|
|
4324
4368
|
/* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
|
|
4325
|
-
/* @__PURE__ */ e.jsx(un, { children: s.map((
|
|
4369
|
+
/* @__PURE__ */ e.jsx(un, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
4326
4370
|
mn,
|
|
4327
4371
|
{
|
|
4328
|
-
value:
|
|
4372
|
+
value: o.column_name,
|
|
4329
4373
|
onSelect: (d) => {
|
|
4330
4374
|
const p = d === l ? "" : d;
|
|
4331
|
-
|
|
4375
|
+
c(p), n(!1), p && t(o);
|
|
4332
4376
|
},
|
|
4333
4377
|
children: [
|
|
4334
|
-
|
|
4378
|
+
o.column_name,
|
|
4335
4379
|
/* @__PURE__ */ e.jsx(
|
|
4336
4380
|
Na,
|
|
4337
4381
|
{
|
|
4338
|
-
className:
|
|
4382
|
+
className: Q(
|
|
4339
4383
|
"ml-auto h-4 w-4",
|
|
4340
|
-
l ===
|
|
4384
|
+
l === o.column_name ? "opacity-100" : "opacity-0"
|
|
4341
4385
|
)
|
|
4342
4386
|
}
|
|
4343
4387
|
)
|
|
4344
4388
|
]
|
|
4345
4389
|
},
|
|
4346
|
-
|
|
4390
|
+
o.column_name
|
|
4347
4391
|
)) })
|
|
4348
4392
|
] })
|
|
4349
4393
|
] }) })
|
|
4350
4394
|
] });
|
|
4351
4395
|
}
|
|
4352
|
-
function
|
|
4396
|
+
function Al({
|
|
4353
4397
|
cardType: s
|
|
4354
4398
|
}) {
|
|
4355
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4399
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4356
4400
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4357
4401
|
/* @__PURE__ */ e.jsx(U, { children: `${$s(s)} Chart` }),
|
|
4358
4402
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -4388,24 +4432,24 @@ function El({
|
|
|
4388
4432
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4389
4433
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
4390
4434
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4391
|
-
/* @__PURE__ */ e.jsx(
|
|
4392
|
-
/* @__PURE__ */ e.jsx(
|
|
4435
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
4436
|
+
/* @__PURE__ */ e.jsx(_e, {})
|
|
4393
4437
|
] })
|
|
4394
4438
|
] })
|
|
4395
4439
|
] }) });
|
|
4396
4440
|
}
|
|
4397
4441
|
function Gs() {
|
|
4398
|
-
var l,
|
|
4442
|
+
var l, c, r;
|
|
4399
4443
|
const s = m(
|
|
4400
|
-
(
|
|
4401
|
-
), t = m((
|
|
4402
|
-
function n(
|
|
4444
|
+
(o) => o.card.cfg
|
|
4445
|
+
), t = m((o) => o.actions.setCardCfg), a = m((o) => o.card.type);
|
|
4446
|
+
function n(o) {
|
|
4403
4447
|
var u;
|
|
4404
4448
|
const d = {
|
|
4405
4449
|
datalabels: {
|
|
4406
|
-
display:
|
|
4407
|
-
align:
|
|
4408
|
-
anchor:
|
|
4450
|
+
display: o !== "none",
|
|
4451
|
+
align: o,
|
|
4452
|
+
anchor: o,
|
|
4409
4453
|
clamp: !0
|
|
4410
4454
|
}
|
|
4411
4455
|
}, p = {
|
|
@@ -4418,7 +4462,7 @@ function Gs() {
|
|
|
4418
4462
|
}
|
|
4419
4463
|
}
|
|
4420
4464
|
};
|
|
4421
|
-
t(p), console.log(
|
|
4465
|
+
t(p), console.log(o);
|
|
4422
4466
|
}
|
|
4423
4467
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4424
4468
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4428,24 +4472,24 @@ function Gs() {
|
|
|
4428
4472
|
/* @__PURE__ */ e.jsxs(
|
|
4429
4473
|
me,
|
|
4430
4474
|
{
|
|
4431
|
-
value: (
|
|
4475
|
+
value: (r = (c = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : c.datalabels) == null ? void 0 : r.anchor,
|
|
4432
4476
|
onValueChange: n,
|
|
4433
4477
|
defaultValue: "none",
|
|
4434
4478
|
children: [
|
|
4435
4479
|
/* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, { placeholder: "Select position" }) }),
|
|
4436
4480
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4437
4481
|
/* @__PURE__ */ e.jsx(fe, { children: "Data Labels" }),
|
|
4438
|
-
/* @__PURE__ */ e.jsx(
|
|
4439
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
4440
|
-
/* @__PURE__ */ e.jsx(
|
|
4441
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
4482
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }),
|
|
4483
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(K, { value: "start", children: "Start" }),
|
|
4484
|
+
/* @__PURE__ */ e.jsx(K, { value: "center", children: "Center" }),
|
|
4485
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(K, { value: "end", children: "End" })
|
|
4442
4486
|
] }) })
|
|
4443
4487
|
]
|
|
4444
4488
|
}
|
|
4445
4489
|
)
|
|
4446
4490
|
] });
|
|
4447
4491
|
}
|
|
4448
|
-
function
|
|
4492
|
+
function Vl({
|
|
4449
4493
|
cardType: s
|
|
4450
4494
|
}) {
|
|
4451
4495
|
function t(a) {
|
|
@@ -4464,7 +4508,7 @@ function Al({
|
|
|
4464
4508
|
"a",
|
|
4465
4509
|
{
|
|
4466
4510
|
target: "_blank",
|
|
4467
|
-
onClick: (
|
|
4511
|
+
onClick: (c) => c.stopPropagation(),
|
|
4468
4512
|
className: "text-blue-700",
|
|
4469
4513
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4470
4514
|
children: "example"
|
|
@@ -4474,7 +4518,7 @@ function Al({
|
|
|
4474
4518
|
] })
|
|
4475
4519
|
] });
|
|
4476
4520
|
}
|
|
4477
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
4521
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4478
4522
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4479
4523
|
/* @__PURE__ */ e.jsx(U, { children: `${$s(s)} Chart` }),
|
|
4480
4524
|
/* @__PURE__ */ e.jsx(G, { className: "space-y-4 font-mono text-xs", children: t(s) })
|
|
@@ -4486,13 +4530,13 @@ function Al({
|
|
|
4486
4530
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4487
4531
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
4488
4532
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
4489
|
-
/* @__PURE__ */ e.jsx(
|
|
4490
|
-
/* @__PURE__ */ e.jsx(
|
|
4533
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
4534
|
+
/* @__PURE__ */ e.jsx(_e, {})
|
|
4491
4535
|
] })
|
|
4492
4536
|
] })
|
|
4493
4537
|
] }) });
|
|
4494
4538
|
}
|
|
4495
|
-
const
|
|
4539
|
+
const ql = {
|
|
4496
4540
|
datasets: [
|
|
4497
4541
|
{
|
|
4498
4542
|
type: "line",
|
|
@@ -4505,7 +4549,7 @@ const Vl = {
|
|
|
4505
4549
|
data: []
|
|
4506
4550
|
}
|
|
4507
4551
|
]
|
|
4508
|
-
},
|
|
4552
|
+
}, Rl = {
|
|
4509
4553
|
datasets: [
|
|
4510
4554
|
{
|
|
4511
4555
|
fill: "origin",
|
|
@@ -4515,27 +4559,27 @@ const Vl = {
|
|
|
4515
4559
|
}
|
|
4516
4560
|
]
|
|
4517
4561
|
};
|
|
4518
|
-
function
|
|
4562
|
+
function _l() {
|
|
4519
4563
|
const s = m((t) => t.card.type);
|
|
4520
4564
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4521
4565
|
/* @__PURE__ */ e.jsx(
|
|
4522
|
-
|
|
4566
|
+
De,
|
|
4523
4567
|
{
|
|
4524
4568
|
className: " ",
|
|
4525
4569
|
type: "single",
|
|
4526
4570
|
collapsible: !0,
|
|
4527
|
-
children:
|
|
4571
|
+
children: Hl(s)
|
|
4528
4572
|
}
|
|
4529
4573
|
),
|
|
4530
4574
|
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(fs, {}) }),
|
|
4531
4575
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4532
4576
|
/* @__PURE__ */ e.jsx(Gs, {}),
|
|
4533
|
-
/* @__PURE__ */ e.jsx(
|
|
4534
|
-
/* @__PURE__ */ e.jsx(
|
|
4577
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
4578
|
+
/* @__PURE__ */ e.jsx(_e, {})
|
|
4535
4579
|
] })
|
|
4536
4580
|
] });
|
|
4537
4581
|
}
|
|
4538
|
-
function
|
|
4582
|
+
function Hl(s) {
|
|
4539
4583
|
if (["line", "bar"].includes(s))
|
|
4540
4584
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4541
4585
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
@@ -4556,7 +4600,7 @@ function _l(s) {
|
|
|
4556
4600
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
4557
4601
|
" and change the `type` property in the dataset."
|
|
4558
4602
|
] }),
|
|
4559
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4603
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(ql, null, 2) })
|
|
4560
4604
|
] })
|
|
4561
4605
|
] }),
|
|
4562
4606
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
@@ -4577,7 +4621,7 @@ function _l(s) {
|
|
|
4577
4621
|
),
|
|
4578
4622
|
"for more options."
|
|
4579
4623
|
] }),
|
|
4580
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4624
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Rl, null, 2) })
|
|
4581
4625
|
] })
|
|
4582
4626
|
] })
|
|
4583
4627
|
] });
|
|
@@ -4632,7 +4676,7 @@ function _l(s) {
|
|
|
4632
4676
|
] })
|
|
4633
4677
|
] }) });
|
|
4634
4678
|
}
|
|
4635
|
-
function
|
|
4679
|
+
function $l() {
|
|
4636
4680
|
var d, p, u, y, g;
|
|
4637
4681
|
const s = m((x) => x.card.preferences), t = m(
|
|
4638
4682
|
(x) => x.actions.setCardPreferences
|
|
@@ -4659,14 +4703,14 @@ function Hl() {
|
|
|
4659
4703
|
m(
|
|
4660
4704
|
(x) => x.actions.setFilterOnClickField
|
|
4661
4705
|
);
|
|
4662
|
-
const
|
|
4706
|
+
const c = m(
|
|
4663
4707
|
(x) => {
|
|
4664
4708
|
var j, b;
|
|
4665
4709
|
return (b = (j = x.card.preferences) == null ? void 0 : j.formatNumber) == null ? void 0 : b.colorRanges;
|
|
4666
4710
|
}
|
|
4667
|
-
) || [],
|
|
4711
|
+
) || [], r = m(
|
|
4668
4712
|
(x) => x.actions.setColorRanges
|
|
4669
|
-
),
|
|
4713
|
+
), o = [...new Set(os.map((x) => x.currency))];
|
|
4670
4714
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4671
4715
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4672
4716
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4708,8 +4752,8 @@ function Hl() {
|
|
|
4708
4752
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4709
4753
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4710
4754
|
/* @__PURE__ */ e.jsx(fe, { children: "Format" }),
|
|
4711
|
-
/* @__PURE__ */ e.jsx(
|
|
4712
|
-
os.map((x) => /* @__PURE__ */ e.jsx(
|
|
4755
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
4756
|
+
os.map((x) => /* @__PURE__ */ e.jsx(K, { value: x.locale, children: x.locale }, x.locale))
|
|
4713
4757
|
] }) })
|
|
4714
4758
|
]
|
|
4715
4759
|
}
|
|
@@ -4734,8 +4778,8 @@ function Hl() {
|
|
|
4734
4778
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4735
4779
|
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4736
4780
|
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
4737
|
-
/* @__PURE__ */ e.jsx(
|
|
4738
|
-
|
|
4781
|
+
/* @__PURE__ */ e.jsx(K, { value: "none", children: "None" }, "none"),
|
|
4782
|
+
o.map((x) => /* @__PURE__ */ e.jsx(K, { value: x, children: x }, x))
|
|
4739
4783
|
] }) })
|
|
4740
4784
|
]
|
|
4741
4785
|
}
|
|
@@ -4760,7 +4804,7 @@ function Hl() {
|
|
|
4760
4804
|
},
|
|
4761
4805
|
children: [
|
|
4762
4806
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4763
|
-
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(
|
|
4807
|
+
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(K, { value: x, children: x }, x)) })
|
|
4764
4808
|
]
|
|
4765
4809
|
}
|
|
4766
4810
|
)
|
|
@@ -4791,16 +4835,16 @@ function Hl() {
|
|
|
4791
4835
|
/* @__PURE__ */ e.jsx(
|
|
4792
4836
|
hn,
|
|
4793
4837
|
{
|
|
4794
|
-
colorRanges:
|
|
4795
|
-
setColorRanges:
|
|
4838
|
+
colorRanges: c,
|
|
4839
|
+
setColorRanges: r
|
|
4796
4840
|
}
|
|
4797
4841
|
)
|
|
4798
4842
|
] })
|
|
4799
4843
|
] });
|
|
4800
4844
|
}
|
|
4801
|
-
function
|
|
4845
|
+
function Pl() {
|
|
4802
4846
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4803
|
-
/* @__PURE__ */ e.jsx(
|
|
4847
|
+
/* @__PURE__ */ e.jsx(De, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4804
4848
|
/* @__PURE__ */ e.jsx(U, { className: "", children: "KPI Query" }),
|
|
4805
4849
|
/* @__PURE__ */ e.jsxs(G, { className: "font-mono", children: [
|
|
4806
4850
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -4824,12 +4868,12 @@ function $l() {
|
|
|
4824
4868
|
] })
|
|
4825
4869
|
] })
|
|
4826
4870
|
] }) }),
|
|
4827
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
4871
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx($l, {}) }),
|
|
4828
4872
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
4829
4873
|
/* @__PURE__ */ e.jsx("div", {})
|
|
4830
4874
|
] });
|
|
4831
4875
|
}
|
|
4832
|
-
const
|
|
4876
|
+
const Bl = [
|
|
4833
4877
|
{
|
|
4834
4878
|
label: "Mercator",
|
|
4835
4879
|
value: "mercator"
|
|
@@ -4886,7 +4930,7 @@ const Pl = [
|
|
|
4886
4930
|
label: "Natural Earth 1",
|
|
4887
4931
|
value: "naturalEarth1"
|
|
4888
4932
|
}
|
|
4889
|
-
],
|
|
4933
|
+
], Ul = [
|
|
4890
4934
|
"blues",
|
|
4891
4935
|
"brBG",
|
|
4892
4936
|
"buGn",
|
|
@@ -4925,18 +4969,18 @@ const Pl = [
|
|
|
4925
4969
|
"ylGnBu",
|
|
4926
4970
|
"ylOrBr",
|
|
4927
4971
|
"ylOrRd"
|
|
4928
|
-
],
|
|
4972
|
+
], Gl = Ul.map((s) => ({
|
|
4929
4973
|
label: s,
|
|
4930
4974
|
value: s
|
|
4931
4975
|
}));
|
|
4932
|
-
function
|
|
4933
|
-
var d, p, u, y, g, x, j, b, I, C,
|
|
4976
|
+
function Ql() {
|
|
4977
|
+
var d, p, u, y, g, x, j, b, I, C, T, F, A, N, S, L, h, v;
|
|
4934
4978
|
const s = m((f) => f.card), t = (p = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = q(
|
|
4935
4979
|
((y = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
|
|
4936
|
-
), { setCardPreferences: l } = re(), { data:
|
|
4980
|
+
), { setCardPreferences: l } = re(), { data: c } = _s(s), r = Object.keys((c == null ? void 0 : c.objects) || {}).map((f) => ({
|
|
4937
4981
|
label: f,
|
|
4938
4982
|
value: f
|
|
4939
|
-
})) || [],
|
|
4983
|
+
})) || [], o = [
|
|
4940
4984
|
{
|
|
4941
4985
|
label: "US States 10m",
|
|
4942
4986
|
value: "https://unpkg.com/us-atlas/states-10m.json"
|
|
@@ -4951,14 +4995,14 @@ function Gl() {
|
|
|
4951
4995
|
}
|
|
4952
4996
|
];
|
|
4953
4997
|
return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
|
|
4954
|
-
/* @__PURE__ */ e.jsx(
|
|
4998
|
+
/* @__PURE__ */ e.jsx(Ge, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
|
|
4955
4999
|
/* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
|
|
4956
|
-
/* @__PURE__ */ e.jsx(
|
|
5000
|
+
/* @__PURE__ */ e.jsx(Ge, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
|
|
4957
5001
|
/* @__PURE__ */ e.jsx(
|
|
4958
5002
|
ue,
|
|
4959
5003
|
{
|
|
4960
5004
|
className: "h-9",
|
|
4961
|
-
options:
|
|
5005
|
+
options: o,
|
|
4962
5006
|
onValueChange: (f) => {
|
|
4963
5007
|
console.log("value", f), l({
|
|
4964
5008
|
...s.preferences,
|
|
@@ -4989,18 +5033,18 @@ function Gl() {
|
|
|
4989
5033
|
});
|
|
4990
5034
|
},
|
|
4991
5035
|
value: a,
|
|
4992
|
-
className: `h-9 w-full ${
|
|
5036
|
+
className: `h-9 w-full ${Be}`,
|
|
4993
5037
|
placeholder: "Custom URL"
|
|
4994
5038
|
}
|
|
4995
5039
|
),
|
|
4996
|
-
|
|
5040
|
+
c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4997
5041
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
4998
5042
|
/* @__PURE__ */ e.jsx(R, { children: "Map Object" }),
|
|
4999
5043
|
/* @__PURE__ */ e.jsx(
|
|
5000
5044
|
ue,
|
|
5001
5045
|
{
|
|
5002
5046
|
className: "h-9",
|
|
5003
|
-
options:
|
|
5047
|
+
options: r,
|
|
5004
5048
|
value: ((x = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : x.objectKey) || "",
|
|
5005
5049
|
label: "Map Object",
|
|
5006
5050
|
onValueChange: (f) => {
|
|
@@ -5022,7 +5066,7 @@ function Gl() {
|
|
|
5022
5066
|
ue,
|
|
5023
5067
|
{
|
|
5024
5068
|
className: "h-9",
|
|
5025
|
-
options:
|
|
5069
|
+
options: Bl,
|
|
5026
5070
|
value: ((b = (j = s.preferences) == null ? void 0 : j.mapVisualOptions) == null ? void 0 : b.projection) || "",
|
|
5027
5071
|
label: "Projection",
|
|
5028
5072
|
onValueChange: (f) => {
|
|
@@ -5044,7 +5088,7 @@ function Gl() {
|
|
|
5044
5088
|
ue,
|
|
5045
5089
|
{
|
|
5046
5090
|
className: "h-9",
|
|
5047
|
-
options:
|
|
5091
|
+
options: Gl,
|
|
5048
5092
|
value: ((C = (I = s.preferences) == null ? void 0 : I.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
|
|
5049
5093
|
label: "Select Color Scale",
|
|
5050
5094
|
onValueChange: (f) => {
|
|
@@ -5063,14 +5107,14 @@ function Gl() {
|
|
|
5063
5107
|
] })
|
|
5064
5108
|
] }) }),
|
|
5065
5109
|
/* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
|
|
5066
|
-
/* @__PURE__ */ e.jsx(
|
|
5110
|
+
/* @__PURE__ */ e.jsx(Ge, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5067
5111
|
/* @__PURE__ */ e.jsx(
|
|
5068
5112
|
le,
|
|
5069
5113
|
{
|
|
5070
|
-
className: `h-9 w-full ${
|
|
5114
|
+
className: `h-9 w-full ${Be}`,
|
|
5071
5115
|
type: "number",
|
|
5072
5116
|
step: 0.1,
|
|
5073
|
-
value: ((F = (
|
|
5117
|
+
value: ((F = (T = s.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
|
|
5074
5118
|
onChange: (f) => {
|
|
5075
5119
|
var k;
|
|
5076
5120
|
l({
|
|
@@ -5087,19 +5131,19 @@ function Gl() {
|
|
|
5087
5131
|
/* @__PURE__ */ e.jsx(
|
|
5088
5132
|
le,
|
|
5089
5133
|
{
|
|
5090
|
-
className: `h-9 w-full ${
|
|
5134
|
+
className: `h-9 w-full ${Be}`,
|
|
5091
5135
|
type: "number",
|
|
5092
5136
|
step: 10,
|
|
5093
5137
|
value: ((S = (N = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : S[0]) || 0,
|
|
5094
5138
|
onChange: (f) => {
|
|
5095
|
-
var k,
|
|
5139
|
+
var k, M, H, P;
|
|
5096
5140
|
l({
|
|
5097
5141
|
...s.preferences,
|
|
5098
5142
|
mapVisualOptions: {
|
|
5099
5143
|
...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
|
|
5100
5144
|
projectionOffset: [
|
|
5101
5145
|
Number(f.target.value),
|
|
5102
|
-
((P = (H = (
|
|
5146
|
+
((P = (H = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : H.projectionOffset) == null ? void 0 : P[1]) || 0
|
|
5103
5147
|
]
|
|
5104
5148
|
}
|
|
5105
5149
|
});
|
|
@@ -5110,18 +5154,18 @@ function Gl() {
|
|
|
5110
5154
|
/* @__PURE__ */ e.jsx(
|
|
5111
5155
|
le,
|
|
5112
5156
|
{
|
|
5113
|
-
className: `h-9 w-full ${
|
|
5157
|
+
className: `h-9 w-full ${Be}`,
|
|
5114
5158
|
type: "number",
|
|
5115
5159
|
step: 10,
|
|
5116
|
-
value: ((v = (h = (
|
|
5160
|
+
value: ((v = (h = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5117
5161
|
onChange: (f) => {
|
|
5118
|
-
var k,
|
|
5162
|
+
var k, M, H, P;
|
|
5119
5163
|
l({
|
|
5120
5164
|
...s.preferences,
|
|
5121
5165
|
mapVisualOptions: {
|
|
5122
5166
|
...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
|
|
5123
5167
|
projectionOffset: [
|
|
5124
|
-
((P = (H = (
|
|
5168
|
+
((P = (H = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : H.projectionOffset) == null ? void 0 : P[0]) || 0,
|
|
5125
5169
|
Number(f.target.value)
|
|
5126
5170
|
]
|
|
5127
5171
|
}
|
|
@@ -5131,10 +5175,10 @@ function Gl() {
|
|
|
5131
5175
|
)
|
|
5132
5176
|
] }) }),
|
|
5133
5177
|
/* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
|
|
5134
|
-
/* @__PURE__ */ e.jsx(
|
|
5178
|
+
/* @__PURE__ */ e.jsx(Te, {})
|
|
5135
5179
|
] });
|
|
5136
5180
|
}
|
|
5137
|
-
function
|
|
5181
|
+
function Jl() {
|
|
5138
5182
|
var n;
|
|
5139
5183
|
const s = m((l) => l.card.preferences), { setCardPreferences: t } = m((l) => l.actions);
|
|
5140
5184
|
function a(l) {
|
|
@@ -5155,11 +5199,11 @@ function Ql() {
|
|
|
5155
5199
|
defaultValue: "x",
|
|
5156
5200
|
children: [
|
|
5157
5201
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5158
|
-
/* @__PURE__ */ e.jsx(
|
|
5202
|
+
/* @__PURE__ */ e.jsx(Ie, { value: "static", id: "r1" }),
|
|
5159
5203
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
|
|
5160
5204
|
] }),
|
|
5161
5205
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5162
|
-
/* @__PURE__ */ e.jsx(
|
|
5206
|
+
/* @__PURE__ */ e.jsx(Ie, { value: "dynamic", id: "r2" }),
|
|
5163
5207
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
|
|
5164
5208
|
] })
|
|
5165
5209
|
]
|
|
@@ -5172,7 +5216,7 @@ function ns({
|
|
|
5172
5216
|
suffix: a = "Chart"
|
|
5173
5217
|
}) {
|
|
5174
5218
|
let n = "pie-chart";
|
|
5175
|
-
return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
5219
|
+
return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5176
5220
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
5177
5221
|
/* @__PURE__ */ e.jsx(U, { children: `${$s(s)} ${a}` }),
|
|
5178
5222
|
/* @__PURE__ */ e.jsx(G, { children: t || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -5202,23 +5246,23 @@ function ns({
|
|
|
5202
5246
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5203
5247
|
s === "range" && /* @__PURE__ */ e.jsx(fs, {}),
|
|
5204
5248
|
s !== "text" && /* @__PURE__ */ e.jsx(Gs, {}),
|
|
5205
|
-
s === "text" && /* @__PURE__ */ e.jsx(
|
|
5249
|
+
s === "text" && /* @__PURE__ */ e.jsx(Jl, {})
|
|
5206
5250
|
] })
|
|
5207
5251
|
] }),
|
|
5208
5252
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
5209
5253
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
5210
5254
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5211
|
-
/* @__PURE__ */ e.jsx(
|
|
5212
|
-
/* @__PURE__ */ e.jsx(
|
|
5255
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
5256
|
+
/* @__PURE__ */ e.jsx(_e, {})
|
|
5213
5257
|
] })
|
|
5214
5258
|
] })
|
|
5215
5259
|
] }) });
|
|
5216
5260
|
}
|
|
5217
|
-
function
|
|
5261
|
+
function Kl() {
|
|
5218
5262
|
const s = m(
|
|
5219
5263
|
(n) => {
|
|
5220
|
-
var l,
|
|
5221
|
-
return (
|
|
5264
|
+
var l, c;
|
|
5265
|
+
return (c = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : c.sortChart;
|
|
5222
5266
|
}
|
|
5223
5267
|
), { setSortChart: t } = re();
|
|
5224
5268
|
function a() {
|
|
@@ -5251,7 +5295,7 @@ function Jl() {
|
|
|
5251
5295
|
)
|
|
5252
5296
|
] });
|
|
5253
5297
|
}
|
|
5254
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
5298
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5255
5299
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
5256
5300
|
/* @__PURE__ */ e.jsx(U, { children: "Stacked Chart" }),
|
|
5257
5301
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 font-mono text-xs", children: [
|
|
@@ -5288,13 +5332,13 @@ function Jl() {
|
|
|
5288
5332
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
5289
5333
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
5290
5334
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5291
|
-
/* @__PURE__ */ e.jsx(
|
|
5292
|
-
/* @__PURE__ */ e.jsx(
|
|
5335
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
5336
|
+
/* @__PURE__ */ e.jsx(_e, {})
|
|
5293
5337
|
] })
|
|
5294
5338
|
] })
|
|
5295
5339
|
] }) });
|
|
5296
5340
|
}
|
|
5297
|
-
function
|
|
5341
|
+
function Wl({}) {
|
|
5298
5342
|
const s = m((n) => {
|
|
5299
5343
|
var l;
|
|
5300
5344
|
return (l = n.card) == null ? void 0 : l.preferences;
|
|
@@ -5307,11 +5351,11 @@ function Kl({}) {
|
|
|
5307
5351
|
});
|
|
5308
5352
|
};
|
|
5309
5353
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
5310
|
-
/* @__PURE__ */ e.jsx(
|
|
5354
|
+
/* @__PURE__ */ e.jsx(De, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
5311
5355
|
/* @__PURE__ */ e.jsx(U, { children: "Filters" }),
|
|
5312
5356
|
/* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
|
|
5313
|
-
/* @__PURE__ */ e.jsx(
|
|
5314
|
-
/* @__PURE__ */ e.jsx(
|
|
5357
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
5358
|
+
/* @__PURE__ */ e.jsx(_e, {})
|
|
5315
5359
|
] })
|
|
5316
5360
|
] }) }),
|
|
5317
5361
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
@@ -5327,7 +5371,7 @@ function Kl({}) {
|
|
|
5327
5371
|
] })
|
|
5328
5372
|
] });
|
|
5329
5373
|
}
|
|
5330
|
-
const
|
|
5374
|
+
const Yl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5331
5375
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
5332
5376
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5333
5377
|
"See ",
|
|
@@ -5343,7 +5387,7 @@ const Wl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5343
5387
|
),
|
|
5344
5388
|
" in the docs."
|
|
5345
5389
|
] })
|
|
5346
|
-
] }),
|
|
5390
|
+
] }), Xl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5347
5391
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
|
|
5348
5392
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5349
5393
|
"See ",
|
|
@@ -5359,7 +5403,7 @@ const Wl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5359
5403
|
),
|
|
5360
5404
|
" in the docs."
|
|
5361
5405
|
] })
|
|
5362
|
-
] }),
|
|
5406
|
+
] }), Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5363
5407
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
|
|
5364
5408
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5365
5409
|
"See ",
|
|
@@ -5376,22 +5420,22 @@ const Wl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5376
5420
|
" in the docs."
|
|
5377
5421
|
] })
|
|
5378
5422
|
] });
|
|
5379
|
-
function
|
|
5423
|
+
function er() {
|
|
5380
5424
|
const s = m((a) => a.card.type);
|
|
5381
5425
|
function t(a) {
|
|
5382
5426
|
switch (a) {
|
|
5383
5427
|
case "stackedBar":
|
|
5384
5428
|
case "stackedLine":
|
|
5385
|
-
return /* @__PURE__ */ e.jsx(
|
|
5429
|
+
return /* @__PURE__ */ e.jsx(Kl, {});
|
|
5386
5430
|
case "pyramid":
|
|
5387
|
-
return /* @__PURE__ */ e.jsx(ns, { docContent:
|
|
5431
|
+
return /* @__PURE__ */ e.jsx(ns, { docContent: Yl, cardType: a });
|
|
5388
5432
|
case "kpi":
|
|
5389
|
-
return /* @__PURE__ */ e.jsx(
|
|
5433
|
+
return /* @__PURE__ */ e.jsx(Pl, {});
|
|
5390
5434
|
case "line":
|
|
5391
5435
|
case "bar":
|
|
5392
|
-
return /* @__PURE__ */ e.jsx(
|
|
5436
|
+
return /* @__PURE__ */ e.jsx(Al, { cardType: a });
|
|
5393
5437
|
case "range":
|
|
5394
|
-
return /* @__PURE__ */ e.jsx(ns, { docContent:
|
|
5438
|
+
return /* @__PURE__ */ e.jsx(ns, { docContent: Xl, cardType: a });
|
|
5395
5439
|
case "pie":
|
|
5396
5440
|
case "doughnut":
|
|
5397
5441
|
case "polarArea":
|
|
@@ -5399,29 +5443,29 @@ function Zl() {
|
|
|
5399
5443
|
return /* @__PURE__ */ e.jsx(ns, { cardType: a });
|
|
5400
5444
|
case "bubble":
|
|
5401
5445
|
case "scatter":
|
|
5402
|
-
return /* @__PURE__ */ e.jsx(
|
|
5446
|
+
return /* @__PURE__ */ e.jsx(Vl, { cardType: a });
|
|
5403
5447
|
case "table":
|
|
5404
|
-
return /* @__PURE__ */ e.jsx(
|
|
5448
|
+
return /* @__PURE__ */ e.jsx(Wl, { cardType: a });
|
|
5405
5449
|
case "text":
|
|
5406
5450
|
return /* @__PURE__ */ e.jsx(
|
|
5407
5451
|
ns,
|
|
5408
5452
|
{
|
|
5409
|
-
docContent:
|
|
5453
|
+
docContent: Zl,
|
|
5410
5454
|
cardType: a,
|
|
5411
5455
|
suffix: "Visual"
|
|
5412
5456
|
}
|
|
5413
5457
|
);
|
|
5414
5458
|
case "map":
|
|
5415
|
-
return /* @__PURE__ */ e.jsx(
|
|
5459
|
+
return /* @__PURE__ */ e.jsx(Ql, {});
|
|
5416
5460
|
case "custom":
|
|
5417
5461
|
return /* @__PURE__ */ e.jsx(Tl, {});
|
|
5418
5462
|
default:
|
|
5419
|
-
return /* @__PURE__ */ e.jsx(
|
|
5463
|
+
return /* @__PURE__ */ e.jsx(_l, {});
|
|
5420
5464
|
}
|
|
5421
5465
|
}
|
|
5422
5466
|
return /* @__PURE__ */ e.jsx(We, { className: "h-full w-full text-sm", children: t(s) });
|
|
5423
5467
|
}
|
|
5424
|
-
function
|
|
5468
|
+
function sr() {
|
|
5425
5469
|
const s = m((t) => t.isShowingVisual);
|
|
5426
5470
|
return /* @__PURE__ */ e.jsxs(
|
|
5427
5471
|
Cs,
|
|
@@ -5436,7 +5480,7 @@ function er() {
|
|
|
5436
5480
|
className: "flex",
|
|
5437
5481
|
minSize: 20,
|
|
5438
5482
|
defaultSize: 40,
|
|
5439
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5483
|
+
children: /* @__PURE__ */ e.jsx(yl, {})
|
|
5440
5484
|
}
|
|
5441
5485
|
),
|
|
5442
5486
|
/* @__PURE__ */ e.jsx(Ns, { withHandle: !0, className: "border" }),
|
|
@@ -5455,7 +5499,7 @@ function er() {
|
|
|
5455
5499
|
minSize: 20,
|
|
5456
5500
|
defaultSize: 25,
|
|
5457
5501
|
maxSize: 30,
|
|
5458
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5502
|
+
children: /* @__PURE__ */ e.jsx(er, {})
|
|
5459
5503
|
}
|
|
5460
5504
|
) }),
|
|
5461
5505
|
/* @__PURE__ */ e.jsx(Ns, { className: "border" }),
|
|
@@ -5467,14 +5511,14 @@ function er() {
|
|
|
5467
5511
|
}
|
|
5468
5512
|
);
|
|
5469
5513
|
}
|
|
5470
|
-
function
|
|
5471
|
-
|
|
5472
|
-
const n = m((
|
|
5514
|
+
function ar({ authToken: s, onSave: t, onClose: a }) {
|
|
5515
|
+
z((r) => r.themeStyle);
|
|
5516
|
+
const n = m((r) => r.actions.setOnSave), l = m((r) => r.actions.setOnClose), c = z((r) => r.actions.setAuthToken);
|
|
5473
5517
|
return Z(() => {
|
|
5474
5518
|
t && n(t), a && l(a);
|
|
5475
5519
|
}, [t, n, a, l]), Z(() => {
|
|
5476
|
-
s && s.accessToken &&
|
|
5477
|
-
}, [s,
|
|
5520
|
+
s && s.accessToken && c(s);
|
|
5521
|
+
}, [s, c]), /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
|
|
5478
5522
|
xn,
|
|
5479
5523
|
{
|
|
5480
5524
|
style: {
|
|
@@ -5485,78 +5529,78 @@ function sr({ authToken: s, onSave: t, onClose: a }) {
|
|
|
5485
5529
|
role: "editor-panel",
|
|
5486
5530
|
children: [
|
|
5487
5531
|
/* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
|
|
5488
|
-
/* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(
|
|
5532
|
+
/* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(sr, {}) })
|
|
5489
5533
|
]
|
|
5490
5534
|
}
|
|
5491
5535
|
) });
|
|
5492
5536
|
}
|
|
5493
|
-
function
|
|
5494
|
-
|
|
5495
|
-
const s =
|
|
5496
|
-
function l(
|
|
5497
|
-
s && (n(s,
|
|
5537
|
+
function tr() {
|
|
5538
|
+
z((r) => r.selectedCardId);
|
|
5539
|
+
const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
|
|
5540
|
+
function l(r) {
|
|
5541
|
+
s && (n(s, r), t(!1));
|
|
5498
5542
|
}
|
|
5499
|
-
function
|
|
5543
|
+
function c() {
|
|
5500
5544
|
t(!1);
|
|
5501
5545
|
}
|
|
5502
5546
|
return /* @__PURE__ */ e.jsx(
|
|
5503
5547
|
"div",
|
|
5504
5548
|
{
|
|
5505
5549
|
role: "editor-container",
|
|
5506
|
-
className:
|
|
5550
|
+
className: Q("flex grow", {
|
|
5507
5551
|
"max-h-0 overflow-hidden": !a
|
|
5508
5552
|
}),
|
|
5509
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5553
|
+
children: /* @__PURE__ */ e.jsx(ar, { onSave: l, onClose: c })
|
|
5510
5554
|
}
|
|
5511
5555
|
);
|
|
5512
5556
|
}
|
|
5513
|
-
function
|
|
5514
|
-
m((
|
|
5515
|
-
const s = m((
|
|
5516
|
-
m((
|
|
5517
|
-
const t = m((
|
|
5518
|
-
|
|
5519
|
-
(
|
|
5557
|
+
function nr() {
|
|
5558
|
+
m((r) => r.selectedConnectionId), m((r) => r.selectedDatamodelId);
|
|
5559
|
+
const s = m((r) => r.selectedDatabaseName);
|
|
5560
|
+
m((r) => r.selectedSchemaName);
|
|
5561
|
+
const t = m((r) => r.selectedTableName), a = z((r) => r.dashboard.filters) || [];
|
|
5562
|
+
z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
|
|
5563
|
+
(r) => r.actions.removeFilterValue
|
|
5520
5564
|
);
|
|
5521
|
-
const { modelItems: n, columns: l } =
|
|
5522
|
-
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((
|
|
5523
|
-
const
|
|
5524
|
-
(d) => d.column === de(
|
|
5565
|
+
const { modelItems: n, columns: l } = Re(), { assignFilter: c } = Xa();
|
|
5566
|
+
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((r) => {
|
|
5567
|
+
const o = a == null ? void 0 : a.find(
|
|
5568
|
+
(d) => d.column === de(r.column_name) && d.table === t && d.database === s
|
|
5525
5569
|
);
|
|
5526
5570
|
return /* @__PURE__ */ e.jsx(
|
|
5527
5571
|
"div",
|
|
5528
5572
|
{
|
|
5529
|
-
onClick: () =>
|
|
5530
|
-
className:
|
|
5573
|
+
onClick: () => c(r),
|
|
5574
|
+
className: Q(
|
|
5531
5575
|
"group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
5532
5576
|
{
|
|
5533
|
-
"bg-muted":
|
|
5577
|
+
"bg-muted": o
|
|
5534
5578
|
}
|
|
5535
5579
|
),
|
|
5536
5580
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5537
|
-
/* @__PURE__ */ e.jsx(Ea, { column:
|
|
5538
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
5581
|
+
/* @__PURE__ */ e.jsx(Ea, { column: r }),
|
|
5582
|
+
/* @__PURE__ */ e.jsx("span", { children: r.column_name })
|
|
5539
5583
|
] })
|
|
5540
5584
|
},
|
|
5541
|
-
|
|
5585
|
+
r.column_name
|
|
5542
5586
|
);
|
|
5543
5587
|
}) });
|
|
5544
5588
|
}
|
|
5545
|
-
function
|
|
5546
|
-
|
|
5547
|
-
const s =
|
|
5589
|
+
function lr() {
|
|
5590
|
+
z((t) => t.showFilters);
|
|
5591
|
+
const s = z(
|
|
5548
5592
|
(t) => t.actions.setShowFilters
|
|
5549
5593
|
);
|
|
5550
5594
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
5551
5595
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
5552
5596
|
/* @__PURE__ */ e.jsx(R, { className: "text-lg", children: "Filters" }),
|
|
5553
5597
|
/* @__PURE__ */ e.jsx(
|
|
5554
|
-
|
|
5598
|
+
O,
|
|
5555
5599
|
{
|
|
5556
5600
|
onClick: () => s(!1),
|
|
5557
5601
|
className: "h-7 w-7 p-0",
|
|
5558
5602
|
variant: "ghost",
|
|
5559
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5603
|
+
children: /* @__PURE__ */ e.jsx(Qe, {})
|
|
5560
5604
|
}
|
|
5561
5605
|
)
|
|
5562
5606
|
] }),
|
|
@@ -5566,7 +5610,7 @@ function nr() {
|
|
|
5566
5610
|
ColumnsComponent: () => (
|
|
5567
5611
|
// schemaName, tableName, columns
|
|
5568
5612
|
/* @__PURE__ */ e.jsx(
|
|
5569
|
-
|
|
5613
|
+
nr,
|
|
5570
5614
|
{}
|
|
5571
5615
|
)
|
|
5572
5616
|
)
|
|
@@ -5574,33 +5618,33 @@ function nr() {
|
|
|
5574
5618
|
) })
|
|
5575
5619
|
] });
|
|
5576
5620
|
}
|
|
5577
|
-
function
|
|
5578
|
-
const s =
|
|
5621
|
+
function rr() {
|
|
5622
|
+
const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
|
|
5579
5623
|
return /* @__PURE__ */ e.jsxs(
|
|
5580
5624
|
"div",
|
|
5581
5625
|
{
|
|
5582
5626
|
role: "dashboard-plus-main",
|
|
5583
|
-
className:
|
|
5627
|
+
className: Q("", {
|
|
5584
5628
|
"max-h-0 overflow-hidden": t,
|
|
5585
5629
|
"flex grow": !t
|
|
5586
5630
|
}),
|
|
5587
5631
|
children: [
|
|
5588
5632
|
/* @__PURE__ */ e.jsx(gn, {}),
|
|
5589
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
5633
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(lr, {}) })
|
|
5590
5634
|
]
|
|
5591
5635
|
}
|
|
5592
5636
|
);
|
|
5593
5637
|
}
|
|
5594
|
-
function
|
|
5595
|
-
const s =
|
|
5638
|
+
function ir() {
|
|
5639
|
+
const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
|
|
5596
5640
|
(n) => n.showDashboardJSON
|
|
5597
5641
|
);
|
|
5598
|
-
return
|
|
5642
|
+
return z(
|
|
5599
5643
|
(n) => n.actions.setShowDashboardJSON
|
|
5600
5644
|
), /* @__PURE__ */ e.jsx(
|
|
5601
5645
|
"div",
|
|
5602
5646
|
{
|
|
5603
|
-
className:
|
|
5647
|
+
className: Q(" p-2", {
|
|
5604
5648
|
hidden: !a
|
|
5605
5649
|
}),
|
|
5606
5650
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -5635,7 +5679,7 @@ function rr() {
|
|
|
5635
5679
|
}
|
|
5636
5680
|
);
|
|
5637
5681
|
}
|
|
5638
|
-
function
|
|
5682
|
+
function ur({
|
|
5639
5683
|
showControls: s = !1,
|
|
5640
5684
|
showFooter: t = !0,
|
|
5641
5685
|
...a
|
|
@@ -5643,56 +5687,57 @@ function dr({
|
|
|
5643
5687
|
return /* @__PURE__ */ e.jsx(us, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
|
|
5644
5688
|
/* @__PURE__ */ e.jsx(yn, {}),
|
|
5645
5689
|
/* @__PURE__ */ e.jsxs(vn, { children: [
|
|
5646
|
-
/* @__PURE__ */ e.jsx(
|
|
5690
|
+
/* @__PURE__ */ e.jsx(ir, {}),
|
|
5647
5691
|
/* @__PURE__ */ e.jsxs(Cn, { ...a, children: [
|
|
5648
|
-
s && /* @__PURE__ */ e.jsx(
|
|
5649
|
-
/* @__PURE__ */ e.jsx(
|
|
5650
|
-
/* @__PURE__ */ e.jsx(
|
|
5692
|
+
s && /* @__PURE__ */ e.jsx(nl, {}),
|
|
5693
|
+
/* @__PURE__ */ e.jsx(tr, {}),
|
|
5694
|
+
/* @__PURE__ */ e.jsx(rr, {})
|
|
5651
5695
|
] })
|
|
5652
5696
|
] })
|
|
5653
5697
|
] }) });
|
|
5654
5698
|
}
|
|
5655
5699
|
export {
|
|
5656
|
-
|
|
5700
|
+
Pe as A,
|
|
5657
5701
|
Sn as B,
|
|
5658
5702
|
wn as C,
|
|
5659
|
-
|
|
5703
|
+
ur as D,
|
|
5660
5704
|
Ia as E,
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5705
|
+
Ma as F,
|
|
5706
|
+
Tn as G,
|
|
5707
|
+
Ln as H,
|
|
5664
5708
|
An as I,
|
|
5709
|
+
Yn as J,
|
|
5665
5710
|
Vn as L,
|
|
5666
|
-
|
|
5711
|
+
Da as M,
|
|
5667
5712
|
Hn as N,
|
|
5668
|
-
|
|
5713
|
+
Ta as P,
|
|
5669
5714
|
Bn as S,
|
|
5670
5715
|
Jn as T,
|
|
5671
5716
|
Wn as U,
|
|
5672
5717
|
Ps as a,
|
|
5673
5718
|
Bs as b,
|
|
5674
|
-
|
|
5675
|
-
|
|
5719
|
+
za as c,
|
|
5720
|
+
Oa as d,
|
|
5676
5721
|
Fa as e,
|
|
5677
5722
|
kn as f,
|
|
5678
|
-
|
|
5679
|
-
|
|
5723
|
+
zn as g,
|
|
5724
|
+
On as h,
|
|
5680
5725
|
Fn as i,
|
|
5681
|
-
|
|
5726
|
+
Dn as j,
|
|
5682
5727
|
In as k,
|
|
5683
|
-
|
|
5728
|
+
Mn as l,
|
|
5684
5729
|
En as m,
|
|
5685
5730
|
qn as n,
|
|
5686
5731
|
Rn as o,
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5732
|
+
Ve as p,
|
|
5733
|
+
_n as q,
|
|
5734
|
+
$n as r,
|
|
5735
|
+
Pn as s,
|
|
5736
|
+
La as t,
|
|
5737
|
+
Un as u,
|
|
5738
|
+
Gn as v,
|
|
5739
|
+
Qn as w,
|
|
5740
|
+
Kn as x,
|
|
5741
|
+
Us as y,
|
|
5742
|
+
Re as z
|
|
5698
5743
|
};
|