react-semaphor 0.0.258 → 0.0.260
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/dashboard-plus-QpBn82cW.js +245 -0
- package/dist/chunks/{dashboard-plus-FX4aBajk.js → dashboard-plus-vZ6i2W6N.js} +1058 -1068
- package/dist/chunks/{index-wsauSY2B.js → index-TgixBDWy.js} +3328 -3318
- package/dist/chunks/{index-RiPhpkfr.js → index-VoUC6Gje.js} +74 -74
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +7 -0
- package/dist/types/main.d.ts +7 -0
- package/dist/types/surfboard.d.ts +7 -0
- package/dist/types/types.d.ts +7 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-5at88oIA.js +0 -245
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { J as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import { J as O, L as Ue, b as z, c as Cs, u as je, j as e, M as Ss, O as ws, P as F, Q as ks, R as zs, U as Fs, V as Ls, W as Ts, X as H, Y as Ce, Z as aa, _ as Ja, $ as Ya, a0 as Xa, a1 as Za, a2 as et, a3 as st, a4 as Gs, f as J, a5 as Re, a6 as at, a7 as ta, a8 as _e, a9 as ts, T as Ds, e as na, g as Is, aa as he, ab as me, ac as xe, ad as pe, ae as Se, af as fe, ag as Q, ah as Ms, G as c, ai as Os, aj as As, ak as Es, w as la, v as ia, t as ue, al as tt, r as nt, N as ra, s as lt, am as it, B as rt, an as oa, ao as ot, S as Vs, z as ct, n as Ks, A as ca, ap as fs, aq as re, ar as Ne, as as He, at as rs, au as da, av as dt, aw as ut, ax as ua, ay as ht, az as mt, aA as xt, aB as pt, aC as ft, aD as gs, aE as gt, aF as ha, aG as qe, aH as js, aI as De, aJ as bs, aK as Ps, aL as jt, aM as bt, aN as yt, aO as vt, aP as Nt, aQ as xs, aR as Ct, aS as Ws, aT as St, aU as Qs, aV as wt, aW as kt, aX as zt, aY as ma, H as Ie, aZ as xa, l as Ft, C as Lt, E as es, d as Tt, h as Dt, a_ as It, i as Mt, o as Ot, a$ as At, m as Et, b0 as Vt, b1 as pa, b2 as fa, b3 as ss, b4 as ga, b5 as as, b6 as Js, b7 as Ge, b8 as Ke, b9 as Pe, ba as ja, K as qt, bb as Rt, bc as _t, bd as ba, be as ya, bf as va, bg as Na, bh as Ca, bi as Sa, bj as os, bk as Fe, bl as Ht, bm as $t, bn as wa, bo as Bt, bp as Ut, bq as ns, br as Gt, bs as Kt, bt as Pt, bu as Ys, bv as Wt, bw as Qt, bx as Le, by as U, bz as G, bA as qs, bB as K, bC as Jt, bD as Yt, bE as Xt, bF as Zt, bG as en, bH as sn, bI as an, bJ as tn, bK as nn, bL as ln } from "./index-TgixBDWy.js";
|
|
2
|
+
import * as ys from "react";
|
|
3
|
+
import ge, { useState as V, useMemo as vs, useEffect as Z, useRef as $e, Suspense as rn } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-react v0.453.0 - ISC
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the ISC license.
|
|
8
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
const on =
|
|
10
|
+
const on = O("Box", [
|
|
11
11
|
[
|
|
12
12
|
"path",
|
|
13
13
|
{
|
|
@@ -24,7 +24,7 @@ const on = M("Box", [
|
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
26
|
*/
|
|
27
|
-
const cn =
|
|
27
|
+
const cn = O("ChartArea", [
|
|
28
28
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
29
29
|
[
|
|
30
30
|
"path",
|
|
@@ -40,7 +40,7 @@ const cn = M("ChartArea", [
|
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
42
|
*/
|
|
43
|
-
const
|
|
43
|
+
const Rs = O("ChartColumnIncreasing", [
|
|
44
44
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
45
45
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
46
46
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
@@ -52,7 +52,7 @@ const qs = M("ChartColumnIncreasing", [
|
|
|
52
52
|
* This source code is licensed under the ISC license.
|
|
53
53
|
* See the LICENSE file in the root directory of this source tree.
|
|
54
54
|
*/
|
|
55
|
-
const
|
|
55
|
+
const _s = O("ChartLine", [
|
|
56
56
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
57
57
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
58
58
|
]);
|
|
@@ -62,7 +62,7 @@ const Rs = M("ChartLine", [
|
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
64
|
*/
|
|
65
|
-
const
|
|
65
|
+
const ka = O("ChartNoAxesGantt", [
|
|
66
66
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
67
67
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
68
68
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -73,7 +73,7 @@ const Fa = M("ChartNoAxesGantt", [
|
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/
|
|
76
|
-
const
|
|
76
|
+
const za = O("ChartPie", [
|
|
77
77
|
[
|
|
78
78
|
"path",
|
|
79
79
|
{
|
|
@@ -89,7 +89,7 @@ const La = M("ChartPie", [
|
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
91
|
*/
|
|
92
|
-
const
|
|
92
|
+
const Fa = O("ChartScatter", [
|
|
93
93
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
94
94
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
95
95
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -103,7 +103,7 @@ const Ta = M("ChartScatter", [
|
|
|
103
103
|
* This source code is licensed under the ISC license.
|
|
104
104
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
105
|
*/
|
|
106
|
-
const dn =
|
|
106
|
+
const dn = O("ChevronsUpDown", [
|
|
107
107
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
108
108
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
109
109
|
]);
|
|
@@ -113,7 +113,7 @@ const dn = M("ChevronsUpDown", [
|
|
|
113
113
|
* This source code is licensed under the ISC license.
|
|
114
114
|
* See the LICENSE file in the root directory of this source tree.
|
|
115
115
|
*/
|
|
116
|
-
const un =
|
|
116
|
+
const un = O("CircleX", [
|
|
117
117
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
118
118
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
119
119
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -124,7 +124,7 @@ const un = M("CircleX", [
|
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
126
|
*/
|
|
127
|
-
const hn =
|
|
127
|
+
const hn = O("CopyPlus", [
|
|
128
128
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
129
129
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
130
130
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -136,7 +136,7 @@ const hn = M("CopyPlus", [
|
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/
|
|
139
|
-
const mn =
|
|
139
|
+
const mn = O("Database", [
|
|
140
140
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
141
141
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
142
142
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -147,7 +147,7 @@ const mn = M("Database", [
|
|
|
147
147
|
* This source code is licensed under the ISC license.
|
|
148
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
149
149
|
*/
|
|
150
|
-
const xn =
|
|
150
|
+
const xn = O("EllipsisVertical", [
|
|
151
151
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
152
152
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
153
153
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
@@ -158,7 +158,7 @@ const xn = M("EllipsisVertical", [
|
|
|
158
158
|
* This source code is licensed under the ISC license.
|
|
159
159
|
* See the LICENSE file in the root directory of this source tree.
|
|
160
160
|
*/
|
|
161
|
-
const pn =
|
|
161
|
+
const pn = O("Eraser", [
|
|
162
162
|
[
|
|
163
163
|
"path",
|
|
164
164
|
{
|
|
@@ -175,7 +175,7 @@ const pn = M("Eraser", [
|
|
|
175
175
|
* This source code is licensed under the ISC license.
|
|
176
176
|
* See the LICENSE file in the root directory of this source tree.
|
|
177
177
|
*/
|
|
178
|
-
const fn =
|
|
178
|
+
const fn = O("EyeClosed", [
|
|
179
179
|
["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
|
|
180
180
|
["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
|
|
181
181
|
["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
|
|
@@ -188,7 +188,7 @@ const fn = M("EyeClosed", [
|
|
|
188
188
|
* This source code is licensed under the ISC license.
|
|
189
189
|
* See the LICENSE file in the root directory of this source tree.
|
|
190
190
|
*/
|
|
191
|
-
const gn =
|
|
191
|
+
const gn = O("Eye", [
|
|
192
192
|
[
|
|
193
193
|
"path",
|
|
194
194
|
{
|
|
@@ -204,7 +204,7 @@ const gn = M("Eye", [
|
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
206
|
*/
|
|
207
|
-
const jn =
|
|
207
|
+
const jn = O("Glasses", [
|
|
208
208
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
209
209
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
210
210
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -217,7 +217,7 @@ const jn = M("Glasses", [
|
|
|
217
217
|
* This source code is licensed under the ISC license.
|
|
218
218
|
* See the LICENSE file in the root directory of this source tree.
|
|
219
219
|
*/
|
|
220
|
-
const bn =
|
|
220
|
+
const bn = O("Hammer", [
|
|
221
221
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
222
222
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
223
223
|
[
|
|
@@ -234,7 +234,7 @@ const bn = M("Hammer", [
|
|
|
234
234
|
* This source code is licensed under the ISC license.
|
|
235
235
|
* See the LICENSE file in the root directory of this source tree.
|
|
236
236
|
*/
|
|
237
|
-
const yn =
|
|
237
|
+
const yn = O("Hash", [
|
|
238
238
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
239
239
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
240
240
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -246,7 +246,7 @@ const yn = M("Hash", [
|
|
|
246
246
|
* This source code is licensed under the ISC license.
|
|
247
247
|
* See the LICENSE file in the root directory of this source tree.
|
|
248
248
|
*/
|
|
249
|
-
const vn =
|
|
249
|
+
const vn = O("House", [
|
|
250
250
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
251
251
|
[
|
|
252
252
|
"path",
|
|
@@ -262,7 +262,7 @@ const vn = M("House", [
|
|
|
262
262
|
* This source code is licensed under the ISC license.
|
|
263
263
|
* See the LICENSE file in the root directory of this source tree.
|
|
264
264
|
*/
|
|
265
|
-
const Nn =
|
|
265
|
+
const Nn = O("Key", [
|
|
266
266
|
["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
|
|
267
267
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
268
268
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -273,7 +273,7 @@ const Nn = M("Key", [
|
|
|
273
273
|
* This source code is licensed under the ISC license.
|
|
274
274
|
* See the LICENSE file in the root directory of this source tree.
|
|
275
275
|
*/
|
|
276
|
-
const Cn =
|
|
276
|
+
const Cn = O("ListEnd", [
|
|
277
277
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
278
278
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
279
279
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -286,7 +286,7 @@ const Cn = M("ListEnd", [
|
|
|
286
286
|
* This source code is licensed under the ISC license.
|
|
287
287
|
* See the LICENSE file in the root directory of this source tree.
|
|
288
288
|
*/
|
|
289
|
-
const Sn =
|
|
289
|
+
const Sn = O("ListStart", [
|
|
290
290
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
291
291
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
292
292
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -299,7 +299,7 @@ const Sn = M("ListStart", [
|
|
|
299
299
|
* This source code is licensed under the ISC license.
|
|
300
300
|
* See the LICENSE file in the root directory of this source tree.
|
|
301
301
|
*/
|
|
302
|
-
const wn =
|
|
302
|
+
const wn = O("ListX", [
|
|
303
303
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
304
304
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
305
305
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -312,7 +312,7 @@ const wn = M("ListX", [
|
|
|
312
312
|
* This source code is licensed under the ISC license.
|
|
313
313
|
* See the LICENSE file in the root directory of this source tree.
|
|
314
314
|
*/
|
|
315
|
-
const Be =
|
|
315
|
+
const Be = O("LoaderCircle", [
|
|
316
316
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
317
317
|
]);
|
|
318
318
|
/**
|
|
@@ -321,7 +321,7 @@ const Be = M("LoaderCircle", [
|
|
|
321
321
|
* This source code is licensed under the ISC license.
|
|
322
322
|
* See the LICENSE file in the root directory of this source tree.
|
|
323
323
|
*/
|
|
324
|
-
const kn =
|
|
324
|
+
const kn = O("MessageSquareMore", [
|
|
325
325
|
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
|
|
326
326
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
327
327
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -333,7 +333,7 @@ const kn = M("MessageSquareMore", [
|
|
|
333
333
|
* This source code is licensed under the ISC license.
|
|
334
334
|
* See the LICENSE file in the root directory of this source tree.
|
|
335
335
|
*/
|
|
336
|
-
const zn =
|
|
336
|
+
const zn = O("Network", [
|
|
337
337
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
338
338
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
339
339
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -346,7 +346,7 @@ const zn = M("Network", [
|
|
|
346
346
|
* This source code is licensed under the ISC license.
|
|
347
347
|
* See the LICENSE file in the root directory of this source tree.
|
|
348
348
|
*/
|
|
349
|
-
const
|
|
349
|
+
const La = O("Pencil", [
|
|
350
350
|
[
|
|
351
351
|
"path",
|
|
352
352
|
{
|
|
@@ -362,7 +362,7 @@ const Da = M("Pencil", [
|
|
|
362
362
|
* This source code is licensed under the ISC license.
|
|
363
363
|
* See the LICENSE file in the root directory of this source tree.
|
|
364
364
|
*/
|
|
365
|
-
const Fn =
|
|
365
|
+
const Fn = O("Play", [
|
|
366
366
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
367
367
|
]);
|
|
368
368
|
/**
|
|
@@ -371,7 +371,7 @@ const Fn = M("Play", [
|
|
|
371
371
|
* This source code is licensed under the ISC license.
|
|
372
372
|
* See the LICENSE file in the root directory of this source tree.
|
|
373
373
|
*/
|
|
374
|
-
const Ln =
|
|
374
|
+
const Ln = O("Plug2", [
|
|
375
375
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
376
376
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
377
377
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -384,7 +384,7 @@ const Ln = M("Plug2", [
|
|
|
384
384
|
* This source code is licensed under the ISC license.
|
|
385
385
|
* See the LICENSE file in the root directory of this source tree.
|
|
386
386
|
*/
|
|
387
|
-
const Tn =
|
|
387
|
+
const Tn = O("Save", [
|
|
388
388
|
[
|
|
389
389
|
"path",
|
|
390
390
|
{
|
|
@@ -401,7 +401,7 @@ const Tn = M("Save", [
|
|
|
401
401
|
* This source code is licensed under the ISC license.
|
|
402
402
|
* See the LICENSE file in the root directory of this source tree.
|
|
403
403
|
*/
|
|
404
|
-
const
|
|
404
|
+
const Ta = O("Shapes", [
|
|
405
405
|
[
|
|
406
406
|
"path",
|
|
407
407
|
{
|
|
@@ -418,7 +418,7 @@ const Ia = M("Shapes", [
|
|
|
418
418
|
* This source code is licensed under the ISC license.
|
|
419
419
|
* See the LICENSE file in the root directory of this source tree.
|
|
420
420
|
*/
|
|
421
|
-
const Dn =
|
|
421
|
+
const Dn = O("ShieldQuestion", [
|
|
422
422
|
[
|
|
423
423
|
"path",
|
|
424
424
|
{
|
|
@@ -435,7 +435,7 @@ const Dn = M("ShieldQuestion", [
|
|
|
435
435
|
* This source code is licensed under the ISC license.
|
|
436
436
|
* See the LICENSE file in the root directory of this source tree.
|
|
437
437
|
*/
|
|
438
|
-
const In =
|
|
438
|
+
const In = O("Sigma", [
|
|
439
439
|
[
|
|
440
440
|
"path",
|
|
441
441
|
{
|
|
@@ -450,7 +450,7 @@ const In = M("Sigma", [
|
|
|
450
450
|
* This source code is licensed under the ISC license.
|
|
451
451
|
* See the LICENSE file in the root directory of this source tree.
|
|
452
452
|
*/
|
|
453
|
-
const Mn =
|
|
453
|
+
const Mn = O("SwatchBook", [
|
|
454
454
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
455
455
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
456
456
|
["path", { d: "M 7 17h.01", key: "1euzgo" }],
|
|
@@ -468,7 +468,7 @@ const Mn = M("SwatchBook", [
|
|
|
468
468
|
* This source code is licensed under the ISC license.
|
|
469
469
|
* See the LICENSE file in the root directory of this source tree.
|
|
470
470
|
*/
|
|
471
|
-
const On =
|
|
471
|
+
const On = O("Tag", [
|
|
472
472
|
[
|
|
473
473
|
"path",
|
|
474
474
|
{
|
|
@@ -484,7 +484,7 @@ const On = M("Tag", [
|
|
|
484
484
|
* This source code is licensed under the ISC license.
|
|
485
485
|
* See the LICENSE file in the root directory of this source tree.
|
|
486
486
|
*/
|
|
487
|
-
const An =
|
|
487
|
+
const An = O("ToggleLeft", [
|
|
488
488
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
489
489
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
490
490
|
]);
|
|
@@ -494,7 +494,7 @@ const An = M("ToggleLeft", [
|
|
|
494
494
|
* This source code is licensed under the ISC license.
|
|
495
495
|
* See the LICENSE file in the root directory of this source tree.
|
|
496
496
|
*/
|
|
497
|
-
const
|
|
497
|
+
const Hs = O("Type", [
|
|
498
498
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
499
499
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
500
500
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -505,11 +505,11 @@ const _s = M("Type", [
|
|
|
505
505
|
* This source code is licensed under the ISC license.
|
|
506
506
|
* See the LICENSE file in the root directory of this source tree.
|
|
507
507
|
*/
|
|
508
|
-
const En =
|
|
508
|
+
const En = O("User", [
|
|
509
509
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
510
510
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
511
511
|
]);
|
|
512
|
-
function
|
|
512
|
+
function Da(s) {
|
|
513
513
|
var n;
|
|
514
514
|
return {
|
|
515
515
|
...s,
|
|
@@ -518,10 +518,10 @@ function Ma(s) {
|
|
|
518
518
|
return {
|
|
519
519
|
...a,
|
|
520
520
|
frames: (t = a.frames) == null ? void 0 : t.map((i) => {
|
|
521
|
-
var
|
|
521
|
+
var o;
|
|
522
522
|
return {
|
|
523
523
|
...i,
|
|
524
|
-
cards: (
|
|
524
|
+
cards: (o = i.cards) == null ? void 0 : o.map((l) => Vn(l))
|
|
525
525
|
};
|
|
526
526
|
})
|
|
527
527
|
};
|
|
@@ -537,8 +537,8 @@ function Vn(s) {
|
|
|
537
537
|
data: {
|
|
538
538
|
...(n = s.cfg) == null ? void 0 : n.data,
|
|
539
539
|
labels: [],
|
|
540
|
-
datasets: (i = (t = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : t.datasets) == null ? void 0 : i.map((
|
|
541
|
-
...
|
|
540
|
+
datasets: (i = (t = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : t.datasets) == null ? void 0 : i.map((o) => ({
|
|
541
|
+
...o,
|
|
542
542
|
data: []
|
|
543
543
|
}))
|
|
544
544
|
}
|
|
@@ -566,72 +566,72 @@ async function Rn(s, n, a, t) {
|
|
|
566
566
|
if (!t)
|
|
567
567
|
return null;
|
|
568
568
|
const i = JSON.stringify(n);
|
|
569
|
-
return await
|
|
569
|
+
return await Ue("https://semaphor.cloud/api/v1/lens", t, {
|
|
570
570
|
name: s,
|
|
571
571
|
template: i,
|
|
572
572
|
filterValues: a,
|
|
573
573
|
operation: "create"
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
|
-
async function
|
|
576
|
+
async function Ns(s, n) {
|
|
577
577
|
if (!n)
|
|
578
578
|
return null;
|
|
579
|
-
const { id: a, template: t, filterValues: i, isDefault:
|
|
580
|
-
return await
|
|
579
|
+
const { id: a, template: t, filterValues: i, isDefault: o, shared: l } = s;
|
|
580
|
+
return await Ue("https://semaphor.cloud/api/v1/lens", n, {
|
|
581
581
|
lensId: a,
|
|
582
582
|
template: t,
|
|
583
583
|
filterValues: i,
|
|
584
|
-
isDefault:
|
|
584
|
+
isDefault: o,
|
|
585
585
|
shared: l,
|
|
586
586
|
operation: "update"
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
async function _n(s, n) {
|
|
590
|
-
return n ? await
|
|
590
|
+
return n ? await Ue("https://semaphor.cloud/api/v1/lens", n, {
|
|
591
591
|
operation: "delete",
|
|
592
592
|
lensId: s
|
|
593
593
|
}) : null;
|
|
594
594
|
}
|
|
595
595
|
function Hn() {
|
|
596
|
-
const [s, n] = V(""), [a, t] = V(!1), i = z((
|
|
597
|
-
async function
|
|
596
|
+
const [s, n] = V(""), [a, t] = V(!1), i = z((u) => u.lenses), { setLenses: o, setSelectedLensId: l } = Cs(), [r, d] = V(!1), [p, h] = V(!1), y = z((u) => u.dashboard), x = z((u) => u.filterValues), { authToken: m } = je();
|
|
597
|
+
async function f() {
|
|
598
598
|
d(!0);
|
|
599
|
-
const
|
|
599
|
+
const u = Da(
|
|
600
600
|
y
|
|
601
601
|
), k = await Rn(
|
|
602
602
|
s,
|
|
603
|
-
|
|
603
|
+
u,
|
|
604
604
|
x,
|
|
605
|
-
|
|
605
|
+
m == null ? void 0 : m.accessToken
|
|
606
606
|
);
|
|
607
|
-
k && (
|
|
607
|
+
k && (o([...i || [], k]), l(k.id), h(!1)), d(!1);
|
|
608
608
|
}
|
|
609
|
-
return /* @__PURE__ */ e.jsxs(
|
|
610
|
-
/* @__PURE__ */ e.jsx(
|
|
609
|
+
return /* @__PURE__ */ e.jsxs(Ss, { open: p, onOpenChange: h, children: [
|
|
610
|
+
/* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
611
611
|
F,
|
|
612
612
|
{
|
|
613
613
|
variant: "secondary",
|
|
614
614
|
className: "h-7 p-2",
|
|
615
615
|
size: "sm",
|
|
616
616
|
children: [
|
|
617
|
-
/* @__PURE__ */ e.jsx(
|
|
617
|
+
/* @__PURE__ */ e.jsx(ks, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
618
618
|
"Lens"
|
|
619
619
|
]
|
|
620
620
|
}
|
|
621
621
|
) }),
|
|
622
|
-
/* @__PURE__ */ e.jsxs(
|
|
623
|
-
/* @__PURE__ */ e.jsxs(
|
|
624
|
-
/* @__PURE__ */ e.jsx(
|
|
625
|
-
/* @__PURE__ */ e.jsx(
|
|
622
|
+
/* @__PURE__ */ e.jsxs(zs, { className: "sm:max-w-[425px]", children: [
|
|
623
|
+
/* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
624
|
+
/* @__PURE__ */ e.jsx(Ls, { children: "Create Lens" }),
|
|
625
|
+
/* @__PURE__ */ e.jsx(Ts, { children: "Lenses are private by default and are only visible to you." })
|
|
626
626
|
] }),
|
|
627
627
|
/* @__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: [
|
|
628
628
|
/* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
|
|
629
629
|
/* @__PURE__ */ e.jsx(
|
|
630
|
-
|
|
630
|
+
Ce,
|
|
631
631
|
{
|
|
632
632
|
value: s,
|
|
633
|
-
onChange: (
|
|
634
|
-
n(
|
|
633
|
+
onChange: (u) => {
|
|
634
|
+
n(u.target.value);
|
|
635
635
|
},
|
|
636
636
|
id: "name",
|
|
637
637
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -639,13 +639,13 @@ function Hn() {
|
|
|
639
639
|
)
|
|
640
640
|
] }) }),
|
|
641
641
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
642
|
-
/* @__PURE__ */ e.jsx(
|
|
642
|
+
/* @__PURE__ */ e.jsx(aa, { children: /* @__PURE__ */ e.jsx(
|
|
643
643
|
F,
|
|
644
644
|
{
|
|
645
645
|
size: "sm",
|
|
646
646
|
variant: "outline",
|
|
647
647
|
type: "submit",
|
|
648
|
-
onClick:
|
|
648
|
+
onClick: f,
|
|
649
649
|
disabled: r,
|
|
650
650
|
children: r ? "Creating..." : "Add"
|
|
651
651
|
}
|
|
@@ -654,70 +654,70 @@ function Hn() {
|
|
|
654
654
|
] });
|
|
655
655
|
}
|
|
656
656
|
function $n() {
|
|
657
|
-
const [s, n] = V(!1), a = z((
|
|
658
|
-
async function r(
|
|
659
|
-
|
|
657
|
+
const [s, n] = V(!1), a = z((h) => h.lenses), t = z((h) => h.selectedLensId), { setLenses: i, setSelectedLensId: o } = Cs(), { authToken: l } = je();
|
|
658
|
+
async function r(h) {
|
|
659
|
+
o(h);
|
|
660
660
|
}
|
|
661
|
-
async function d(
|
|
662
|
-
if (await _n(
|
|
663
|
-
const x = a == null ? void 0 : a.filter((
|
|
664
|
-
i(x || []),
|
|
661
|
+
async function d(h) {
|
|
662
|
+
if (await _n(h, l == null ? void 0 : l.accessToken)) {
|
|
663
|
+
const x = a == null ? void 0 : a.filter((m) => m.id !== h);
|
|
664
|
+
i(x || []), o("original");
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
async function p(
|
|
668
|
-
const y = a == null ? void 0 : a.map((
|
|
669
|
-
...
|
|
670
|
-
isDefault: !
|
|
667
|
+
async function p(h) {
|
|
668
|
+
const y = a == null ? void 0 : a.map((f) => f.id === h.id ? {
|
|
669
|
+
...f,
|
|
670
|
+
isDefault: !h.isDefault
|
|
671
671
|
} : {
|
|
672
|
-
...
|
|
672
|
+
...f,
|
|
673
673
|
isDefault: !1
|
|
674
674
|
});
|
|
675
675
|
i(y || []);
|
|
676
676
|
const x = {
|
|
677
|
-
...
|
|
678
|
-
isDefault: !
|
|
677
|
+
...h,
|
|
678
|
+
isDefault: !h.isDefault
|
|
679
679
|
};
|
|
680
|
-
await
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
683
|
-
const
|
|
684
|
-
...
|
|
680
|
+
await Ns(x, l == null ? void 0 : l.accessToken);
|
|
681
|
+
const m = a == null ? void 0 : a.find((f) => f.isDefault);
|
|
682
|
+
if (m && m.id !== h.id) {
|
|
683
|
+
const f = {
|
|
684
|
+
...m,
|
|
685
685
|
isDefault: !1
|
|
686
686
|
};
|
|
687
|
-
await
|
|
687
|
+
await Ns(f, l == null ? void 0 : l.accessToken);
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
return /* @__PURE__ */ e.jsxs(
|
|
691
|
-
/* @__PURE__ */ e.jsx(
|
|
692
|
-
/* @__PURE__ */ e.jsxs(
|
|
693
|
-
/* @__PURE__ */ e.jsx(
|
|
694
|
-
/* @__PURE__ */ e.jsx(
|
|
690
|
+
return /* @__PURE__ */ e.jsxs(Ja, { open: s, onOpenChange: n, children: [
|
|
691
|
+
/* @__PURE__ */ e.jsx(Ya, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(jn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
692
|
+
/* @__PURE__ */ e.jsxs(Xa, { align: "end", className: "w-60", children: [
|
|
693
|
+
/* @__PURE__ */ e.jsx(Za, { className: "px-3", children: "Lenses" }),
|
|
694
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
695
695
|
/* @__PURE__ */ e.jsxs(
|
|
696
|
-
|
|
696
|
+
st,
|
|
697
697
|
{
|
|
698
698
|
value: t,
|
|
699
699
|
onValueChange: r,
|
|
700
700
|
children: [
|
|
701
|
-
/* @__PURE__ */ e.jsx(
|
|
702
|
-
a == null ? void 0 : a.map((
|
|
703
|
-
|
|
701
|
+
/* @__PURE__ */ e.jsx(Gs, { value: "original", children: "Original" }),
|
|
702
|
+
a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
|
|
703
|
+
Gs,
|
|
704
704
|
{
|
|
705
705
|
className: "group flex justify-between",
|
|
706
|
-
value:
|
|
706
|
+
value: h.id,
|
|
707
707
|
children: [
|
|
708
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
708
|
+
/* @__PURE__ */ e.jsx("p", { children: h.name }),
|
|
709
709
|
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
|
|
710
710
|
/* @__PURE__ */ e.jsx(
|
|
711
711
|
vn,
|
|
712
712
|
{
|
|
713
713
|
onClick: (y) => {
|
|
714
|
-
y.preventDefault(), p(
|
|
714
|
+
y.preventDefault(), p(h);
|
|
715
715
|
},
|
|
716
716
|
className: J(
|
|
717
717
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
718
718
|
{
|
|
719
|
-
invisible: !
|
|
720
|
-
"text-green-500":
|
|
719
|
+
invisible: !h.isDefault,
|
|
720
|
+
"text-green-500": h.isDefault
|
|
721
721
|
}
|
|
722
722
|
),
|
|
723
723
|
strokeWidth: 1.5
|
|
@@ -727,7 +727,7 @@ function $n() {
|
|
|
727
727
|
Re,
|
|
728
728
|
{
|
|
729
729
|
onClick: (y) => {
|
|
730
|
-
y.preventDefault(), d(
|
|
730
|
+
y.preventDefault(), d(h.id);
|
|
731
731
|
},
|
|
732
732
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
733
733
|
strokeWidth: 1.5
|
|
@@ -736,7 +736,7 @@ function $n() {
|
|
|
736
736
|
] })
|
|
737
737
|
]
|
|
738
738
|
},
|
|
739
|
-
|
|
739
|
+
h.id
|
|
740
740
|
))
|
|
741
741
|
]
|
|
742
742
|
}
|
|
@@ -745,23 +745,23 @@ function $n() {
|
|
|
745
745
|
] });
|
|
746
746
|
}
|
|
747
747
|
function Bn() {
|
|
748
|
-
const { authToken: s } =
|
|
748
|
+
const { authToken: s } = je(), n = z((b) => b.lenses), a = z((b) => b.selectedLensId), t = n == null ? void 0 : n.find((b) => b.id === a), i = z((b) => b.dashboard);
|
|
749
749
|
z((b) => b.selectedSheetId);
|
|
750
|
-
const
|
|
750
|
+
const o = z(
|
|
751
751
|
(b) => b.isDashboardEditing
|
|
752
|
-
), [l, r] = V(!1), d = z((b) => b.filterValues), p = z((b) => b.isVisualEditing),
|
|
752
|
+
), [l, r] = V(!1), d = z((b) => b.filterValues), p = z((b) => b.isVisualEditing), h = z((b) => b.showFilters);
|
|
753
753
|
z(
|
|
754
754
|
(b) => b.showDashboardJSON
|
|
755
755
|
);
|
|
756
756
|
const y = z((b) => b.onSaveFunction), x = z(
|
|
757
757
|
(b) => b.actions.setShowFilters
|
|
758
|
-
), { addFrame:
|
|
758
|
+
), { addFrame: m, setSelectedFrameId: f } = z(
|
|
759
759
|
(b) => b.actions
|
|
760
|
-
), { getSelectedSheet:
|
|
761
|
-
() =>
|
|
760
|
+
), { getSelectedSheet: u, setIsDashboardEditing: k, setShowDashboardJSON: D } = z((b) => b.actions), I = u(), { tenantId: N, endUserId: M } = vs(
|
|
761
|
+
() => at(s == null ? void 0 : s.accessToken),
|
|
762
762
|
[s == null ? void 0 : s.accessToken]
|
|
763
|
-
),
|
|
764
|
-
if (!
|
|
763
|
+
), A = vs(() => N || M, [N, M]), j = () => {
|
|
764
|
+
if (!o || !I)
|
|
765
765
|
return;
|
|
766
766
|
const b = {
|
|
767
767
|
id: _e(),
|
|
@@ -783,21 +783,21 @@ function Bn() {
|
|
|
783
783
|
cards: [b],
|
|
784
784
|
activeCardId: b.id
|
|
785
785
|
};
|
|
786
|
-
|
|
786
|
+
m(I.id, q), f(q.id);
|
|
787
787
|
}, S = () => {
|
|
788
788
|
k(!0);
|
|
789
789
|
};
|
|
790
790
|
async function v() {
|
|
791
791
|
if (r(!0), !a || !t)
|
|
792
792
|
return;
|
|
793
|
-
const b =
|
|
793
|
+
const b = Da(
|
|
794
794
|
i
|
|
795
795
|
), q = JSON.stringify(b), $ = {
|
|
796
796
|
...t,
|
|
797
797
|
template: q,
|
|
798
798
|
filterValues: d
|
|
799
799
|
};
|
|
800
|
-
await
|
|
800
|
+
await Ns($, s == null ? void 0 : s.accessToken), ts.success("Lens saved"), y == null || y(b), r(!1);
|
|
801
801
|
}
|
|
802
802
|
return p ? null : /* @__PURE__ */ e.jsxs(
|
|
803
803
|
"div",
|
|
@@ -807,46 +807,46 @@ function Bn() {
|
|
|
807
807
|
children: [
|
|
808
808
|
!p && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: t == null ? void 0 : t.name }) }),
|
|
809
809
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
810
|
-
|
|
811
|
-
!p &&
|
|
812
|
-
|
|
810
|
+
o && !p && A && /* @__PURE__ */ e.jsx(Hn, {}),
|
|
811
|
+
!p && A && /* @__PURE__ */ e.jsx($n, {}),
|
|
812
|
+
o && !p && /* @__PURE__ */ e.jsxs(
|
|
813
813
|
F,
|
|
814
814
|
{
|
|
815
815
|
variant: "secondary",
|
|
816
816
|
className: "h-7 p-2",
|
|
817
817
|
size: "sm",
|
|
818
|
-
disabled: !
|
|
818
|
+
disabled: !o,
|
|
819
819
|
onClick: j,
|
|
820
820
|
children: [
|
|
821
|
-
/* @__PURE__ */ e.jsx(
|
|
821
|
+
/* @__PURE__ */ e.jsx(ks, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
822
822
|
"Frame"
|
|
823
823
|
]
|
|
824
824
|
}
|
|
825
825
|
),
|
|
826
|
-
!
|
|
826
|
+
!o && /* @__PURE__ */ e.jsx(
|
|
827
827
|
F,
|
|
828
828
|
{
|
|
829
829
|
variant: "ghost",
|
|
830
830
|
className: "h-7 p-2",
|
|
831
831
|
onClick: S,
|
|
832
832
|
size: "sm",
|
|
833
|
-
children: /* @__PURE__ */ e.jsx(
|
|
833
|
+
children: /* @__PURE__ */ e.jsx(La, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
834
834
|
}
|
|
835
835
|
),
|
|
836
|
-
|
|
836
|
+
o && !p && /* @__PURE__ */ e.jsx(
|
|
837
837
|
F,
|
|
838
838
|
{
|
|
839
839
|
variant: "ghost",
|
|
840
840
|
role: "close",
|
|
841
841
|
className: "h-7 p-2",
|
|
842
842
|
onClick: () => {
|
|
843
|
-
k(!1),
|
|
843
|
+
k(!1), D(!1);
|
|
844
844
|
},
|
|
845
845
|
size: "sm",
|
|
846
846
|
children: /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
847
847
|
}
|
|
848
848
|
),
|
|
849
|
-
|
|
849
|
+
o && !p && A && /* @__PURE__ */ e.jsx(
|
|
850
850
|
F,
|
|
851
851
|
{
|
|
852
852
|
className: "h-7 p-2",
|
|
@@ -857,17 +857,17 @@ function Bn() {
|
|
|
857
857
|
children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
858
858
|
}
|
|
859
859
|
),
|
|
860
|
-
!
|
|
860
|
+
!h && !p && o && /* @__PURE__ */ e.jsx(
|
|
861
861
|
F,
|
|
862
862
|
{
|
|
863
863
|
className: "h-7 p-2",
|
|
864
864
|
variant: "ghost",
|
|
865
865
|
onClick: () => x(!0),
|
|
866
866
|
size: "sm",
|
|
867
|
-
children: /* @__PURE__ */ e.jsx(
|
|
867
|
+
children: /* @__PURE__ */ e.jsx(ta, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
868
868
|
}
|
|
869
869
|
),
|
|
870
|
-
!p &&
|
|
870
|
+
!p && o && !1,
|
|
871
871
|
!p && !1
|
|
872
872
|
] })
|
|
873
873
|
]
|
|
@@ -880,12 +880,12 @@ function Ve({
|
|
|
880
880
|
value: a,
|
|
881
881
|
isLoading: t,
|
|
882
882
|
isError: i,
|
|
883
|
-
connectionTooltip:
|
|
883
|
+
connectionTooltip: o,
|
|
884
884
|
onChange: l,
|
|
885
885
|
showNone: r = !1,
|
|
886
886
|
className: d,
|
|
887
887
|
showIcon: p = !0,
|
|
888
|
-
disabled:
|
|
888
|
+
disabled: h = !1
|
|
889
889
|
}) {
|
|
890
890
|
const y = t ? "Loading..." : i ? "Error" : a;
|
|
891
891
|
function x() {
|
|
@@ -896,61 +896,61 @@ function Ve({
|
|
|
896
896
|
if (s === "Schema")
|
|
897
897
|
return /* @__PURE__ */ e.jsx(zn, { className: "size-4" });
|
|
898
898
|
if (s === "Table")
|
|
899
|
-
return /* @__PURE__ */ e.jsx(
|
|
899
|
+
return /* @__PURE__ */ e.jsx(Ms, { className: "size-4" });
|
|
900
900
|
if (s === "Model")
|
|
901
901
|
return /* @__PURE__ */ e.jsx(on, { className: "size-4" });
|
|
902
902
|
}
|
|
903
903
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
904
|
-
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
905
|
-
/* @__PURE__ */ e.jsx(
|
|
906
|
-
/* @__PURE__ */ e.jsx(
|
|
904
|
+
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(Ds, { children: [
|
|
905
|
+
/* @__PURE__ */ e.jsx(na, { children: x() }),
|
|
906
|
+
/* @__PURE__ */ e.jsx(Is, { className: "text-xs", align: "start", children: o })
|
|
907
907
|
] }) : x() }),
|
|
908
|
-
/* @__PURE__ */ e.jsxs(
|
|
908
|
+
/* @__PURE__ */ e.jsxs(he, { disabled: h, value: y, onValueChange: l, children: [
|
|
909
909
|
/* @__PURE__ */ e.jsx(
|
|
910
|
-
|
|
910
|
+
me,
|
|
911
911
|
{
|
|
912
912
|
className: J(
|
|
913
913
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
914
914
|
d
|
|
915
915
|
),
|
|
916
916
|
children: /* @__PURE__ */ e.jsx(
|
|
917
|
-
|
|
917
|
+
xe,
|
|
918
918
|
{
|
|
919
919
|
placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
|
|
920
920
|
}
|
|
921
921
|
)
|
|
922
922
|
}
|
|
923
923
|
),
|
|
924
|
-
/* @__PURE__ */ e.jsx(
|
|
925
|
-
t ? /* @__PURE__ */ e.jsx(
|
|
924
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
925
|
+
t ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
926
926
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
927
927
|
r && /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
928
|
-
n && n.map((
|
|
928
|
+
n && n.map((m, f) => /* @__PURE__ */ e.jsx(Q, { value: m.id, children: m.name }, f))
|
|
929
929
|
] }),
|
|
930
930
|
(t || i) && /* @__PURE__ */ e.jsx(Q, { value: y, children: y })
|
|
931
931
|
] }) })
|
|
932
932
|
] })
|
|
933
933
|
] });
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
const [n, a] = V(!1), t =
|
|
937
|
-
(
|
|
938
|
-
),
|
|
939
|
-
(
|
|
940
|
-
), l =
|
|
941
|
-
function y(
|
|
935
|
+
function Un({ column: s }) {
|
|
936
|
+
const [n, a] = V(!1), t = c((m) => m.selectedTableName), i = c(
|
|
937
|
+
(m) => m.selectedSchemaName
|
|
938
|
+
), o = c(
|
|
939
|
+
(m) => m.selectedDatamodelId
|
|
940
|
+
), l = c((m) => m.sqlGen), { modelItems: r } = Me(), d = c((m) => m.actions.setSqlGen), p = c((m) => m.actions.setCardSql), h = c((m) => m.actions.setRunSql);
|
|
941
|
+
function y(m, f) {
|
|
942
942
|
var I;
|
|
943
|
-
const
|
|
944
|
-
(N) => N.id ===
|
|
943
|
+
const u = la(m, l, f), k = (I = r == null ? void 0 : r.find(
|
|
944
|
+
(N) => N.id === o
|
|
945
945
|
)) == null ? void 0 : I.name;
|
|
946
|
-
d(
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
946
|
+
d(u);
|
|
947
|
+
const D = ia(
|
|
948
|
+
u,
|
|
949
|
+
ue(i || ""),
|
|
950
|
+
ue(t),
|
|
951
951
|
k
|
|
952
952
|
);
|
|
953
|
-
|
|
953
|
+
D && (p(D), h(!0)), a(!1);
|
|
954
954
|
}
|
|
955
955
|
function x() {
|
|
956
956
|
return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
|
|
@@ -996,10 +996,10 @@ function Pn({ column: s }) {
|
|
|
996
996
|
)
|
|
997
997
|
] });
|
|
998
998
|
}
|
|
999
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1000
|
-
/* @__PURE__ */ e.jsx(
|
|
999
|
+
return /* @__PURE__ */ e.jsxs(Os, { openDelay: 0, open: n, onOpenChange: a, children: [
|
|
1000
|
+
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: /* @__PURE__ */ e.jsx(xn, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
1001
1001
|
/* @__PURE__ */ e.jsx(
|
|
1002
|
-
|
|
1002
|
+
Es,
|
|
1003
1003
|
{
|
|
1004
1004
|
align: "center",
|
|
1005
1005
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
@@ -1008,60 +1008,60 @@ function Pn({ column: s }) {
|
|
|
1008
1008
|
)
|
|
1009
1009
|
] });
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1013
|
-
/* @__PURE__ */ e.jsx(
|
|
1011
|
+
function Ia({ column: s }) {
|
|
1012
|
+
return /* @__PURE__ */ e.jsxs(Ds, { children: [
|
|
1013
|
+
/* @__PURE__ */ e.jsx(tt, { asChild: !0, children: nt.includes(s.data_type.toLowerCase()) ? (
|
|
1014
1014
|
// <span className=" font-thin">T</span>
|
|
1015
|
-
/* @__PURE__ */ e.jsx(
|
|
1016
|
-
) :
|
|
1015
|
+
/* @__PURE__ */ e.jsx(Hs, { className: "size-3" })
|
|
1016
|
+
) : ra.includes(s.data_type.toLowerCase()) ? (
|
|
1017
1017
|
//
|
|
1018
1018
|
/* @__PURE__ */ e.jsx(yn, { className: "size-3" })
|
|
1019
|
-
) :
|
|
1020
|
-
/* @__PURE__ */ e.jsx(
|
|
1019
|
+
) : lt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(it, { className: "size-3" }) : rt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(An, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Dn, { className: "size-3" }) }),
|
|
1020
|
+
/* @__PURE__ */ e.jsx(Is, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
1021
1021
|
] });
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function Gn({
|
|
1024
1024
|
schemaName: s,
|
|
1025
1025
|
tableName: n,
|
|
1026
1026
|
columns: a,
|
|
1027
1027
|
status: t
|
|
1028
1028
|
}) {
|
|
1029
|
-
const i =
|
|
1029
|
+
const i = c((v) => v.sqlGen), o = c(
|
|
1030
1030
|
(v) => v.selectedConnectionId
|
|
1031
|
-
), l =
|
|
1031
|
+
), l = c(
|
|
1032
1032
|
(v) => v.selectedDatabaseName
|
|
1033
|
-
), r =
|
|
1033
|
+
), r = c(
|
|
1034
1034
|
(v) => v.selectedSchemaName
|
|
1035
|
-
), d =
|
|
1035
|
+
), d = c((v) => v.selectedTableName), p = c(
|
|
1036
1036
|
(v) => v.selectedDatamodelId
|
|
1037
|
-
),
|
|
1037
|
+
), h = z(
|
|
1038
1038
|
(v) => v.dashboard.aiScopeTables
|
|
1039
|
-
), { setAIScopeTables: y } = z((v) => v.actions), x =
|
|
1039
|
+
), { setAIScopeTables: y } = z((v) => v.actions), x = c((v) => v.actions.setRunSql), m = c((v) => v.actions.setSqlGen), f = c(
|
|
1040
1040
|
(v) => v.actions.setIsShowingVisual
|
|
1041
|
-
),
|
|
1041
|
+
), u = c((v) => v.actions.setCardSql), { connectionType: k, modelItems: D } = Me();
|
|
1042
1042
|
function I(v) {
|
|
1043
1043
|
var R;
|
|
1044
|
-
const b =
|
|
1045
|
-
|
|
1046
|
-
const q = (R =
|
|
1044
|
+
const b = la(v, i);
|
|
1045
|
+
m(b);
|
|
1046
|
+
const q = (R = D == null ? void 0 : D.find(
|
|
1047
1047
|
(B) => B.id === p
|
|
1048
|
-
)) == null ? void 0 : R.name, $ =
|
|
1049
|
-
$ && (
|
|
1048
|
+
)) == null ? void 0 : R.name, $ = ia(b, ue(s), ue(n), q);
|
|
1049
|
+
$ && (u($), x(!0));
|
|
1050
1050
|
}
|
|
1051
1051
|
function N() {
|
|
1052
|
-
return (
|
|
1053
|
-
(v) => v.connectinonId ===
|
|
1052
|
+
return (h == null ? void 0 : h.find(
|
|
1053
|
+
(v) => v.connectinonId === o && v.tableName === d
|
|
1054
1054
|
)) !== void 0;
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1057
|
-
if (v === !0 && d &&
|
|
1056
|
+
function M(v) {
|
|
1057
|
+
if (v === !0 && d && o) {
|
|
1058
1058
|
const b = {
|
|
1059
|
-
connectinonId:
|
|
1059
|
+
connectinonId: o,
|
|
1060
1060
|
connectionType: k,
|
|
1061
1061
|
databaseName: l,
|
|
1062
1062
|
schemaName: r,
|
|
1063
1063
|
tableName: d
|
|
1064
|
-
}, $ = [...
|
|
1064
|
+
}, $ = [...h || [], b].filter(
|
|
1065
1065
|
(R, B, ee) => ee.findIndex(
|
|
1066
1066
|
(W) => W.connectinonId === R.connectinonId && W.tableName === R.tableName
|
|
1067
1067
|
) === B
|
|
@@ -1072,8 +1072,8 @@ function Un({
|
|
|
1072
1072
|
richColors: !0
|
|
1073
1073
|
});
|
|
1074
1074
|
} else {
|
|
1075
|
-
const b = (
|
|
1076
|
-
(q) => q.connectinonId !==
|
|
1075
|
+
const b = (h || []).filter(
|
|
1076
|
+
(q) => q.connectinonId !== o && q.tableName !== d
|
|
1077
1077
|
);
|
|
1078
1078
|
y(b), ts(`Removed '${d}' from AI Scope`, {
|
|
1079
1079
|
position: "top-right",
|
|
@@ -1082,38 +1082,38 @@ function Un({
|
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function A() {
|
|
1086
1086
|
var R;
|
|
1087
|
-
let v =
|
|
1088
|
-
const b = (R =
|
|
1087
|
+
let v = ca(s, n);
|
|
1088
|
+
const b = (R = D == null ? void 0 : D.find(
|
|
1089
1089
|
(B) => B.id === p
|
|
1090
1090
|
)) == null ? void 0 : R.name;
|
|
1091
|
-
console.log("modelName", b), p && p !== "none" && (v = `${
|
|
1091
|
+
console.log("modelName", b), p && p !== "none" && (v = `${fs}.${b}`);
|
|
1092
1092
|
let q = v;
|
|
1093
1093
|
return ((B) => /[A-Z]/.test(B))(n) && (q = q.split(".").map((ee) => `"${ee}"`).join(".")), q;
|
|
1094
1094
|
}
|
|
1095
1095
|
function j() {
|
|
1096
|
-
const v =
|
|
1097
|
-
|
|
1096
|
+
const v = A();
|
|
1097
|
+
f(!1);
|
|
1098
1098
|
const b = k === "MSSQL" ? `SELECT top 10 * FROM ${v}` : `SELECT * FROM ${v} LIMIT 10`;
|
|
1099
|
-
|
|
1099
|
+
u(b), x(!0);
|
|
1100
1100
|
}
|
|
1101
1101
|
function S() {
|
|
1102
|
-
const v =
|
|
1103
|
-
|
|
1102
|
+
const v = A();
|
|
1103
|
+
u(`SELECT COUNT(*) as count FROM ${v}`), x(!0);
|
|
1104
1104
|
}
|
|
1105
1105
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
1106
1106
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
1107
1107
|
/* @__PURE__ */ e.jsx(
|
|
1108
|
-
|
|
1108
|
+
oa,
|
|
1109
1109
|
{
|
|
1110
1110
|
title: `${N() ? "Remove from" : "Add to"} AI Scope`,
|
|
1111
1111
|
pressed: N(),
|
|
1112
|
-
onPressedChange:
|
|
1112
|
+
onPressedChange: M,
|
|
1113
1113
|
variant: "outline",
|
|
1114
1114
|
className: "h-9 px-2",
|
|
1115
1115
|
children: /* @__PURE__ */ e.jsx(
|
|
1116
|
-
|
|
1116
|
+
ot,
|
|
1117
1117
|
{
|
|
1118
1118
|
className: J("size-4", {
|
|
1119
1119
|
"text-primary": N(),
|
|
@@ -1153,7 +1153,7 @@ function Un({
|
|
|
1153
1153
|
)
|
|
1154
1154
|
] }),
|
|
1155
1155
|
/* @__PURE__ */ e.jsxs(
|
|
1156
|
-
|
|
1156
|
+
Vs,
|
|
1157
1157
|
{
|
|
1158
1158
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
1159
1159
|
children: [
|
|
@@ -1164,12 +1164,12 @@ function Un({
|
|
|
1164
1164
|
className: J(
|
|
1165
1165
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1166
1166
|
{
|
|
1167
|
-
"bg-muted":
|
|
1167
|
+
"bg-muted": ct(v, i)
|
|
1168
1168
|
}
|
|
1169
1169
|
),
|
|
1170
1170
|
children: [
|
|
1171
1171
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1172
|
-
/* @__PURE__ */ e.jsx(
|
|
1172
|
+
/* @__PURE__ */ e.jsx(Ia, { column: v }),
|
|
1173
1173
|
/* @__PURE__ */ e.jsx("span", { children: v.column_name })
|
|
1174
1174
|
] }),
|
|
1175
1175
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1177,15 +1177,15 @@ function Un({
|
|
|
1177
1177
|
{
|
|
1178
1178
|
onClick: (b) => b.stopPropagation(),
|
|
1179
1179
|
className: "flex items-center justify-end",
|
|
1180
|
-
children:
|
|
1180
|
+
children: ra.includes(v.data_type) && /* @__PURE__ */ e.jsx(Un, { column: v })
|
|
1181
1181
|
}
|
|
1182
1182
|
)
|
|
1183
1183
|
]
|
|
1184
1184
|
},
|
|
1185
1185
|
v.column_name
|
|
1186
1186
|
)),
|
|
1187
|
-
/* @__PURE__ */ e.jsx(
|
|
1188
|
-
/* @__PURE__ */ e.jsx(
|
|
1187
|
+
/* @__PURE__ */ e.jsx(Ks, { orientation: "vertical" }),
|
|
1188
|
+
/* @__PURE__ */ e.jsx(Ks, { orientation: "horizontal" })
|
|
1189
1189
|
]
|
|
1190
1190
|
}
|
|
1191
1191
|
)
|
|
@@ -1193,42 +1193,42 @@ function Un({
|
|
|
1193
1193
|
}
|
|
1194
1194
|
function Me(s, n) {
|
|
1195
1195
|
var Qe, Ee, Je, Ye, g;
|
|
1196
|
-
let a =
|
|
1197
|
-
const t =
|
|
1196
|
+
let a = vs(() => [], []);
|
|
1197
|
+
const t = je().authToken || s, i = c(
|
|
1198
1198
|
(C) => C.selectedConnectionId
|
|
1199
|
-
),
|
|
1199
|
+
), o = c(
|
|
1200
1200
|
(C) => C.selectedDatamodelId
|
|
1201
|
-
), l =
|
|
1201
|
+
), l = c(
|
|
1202
1202
|
(C) => C.selectedDatabaseName
|
|
1203
|
-
), r =
|
|
1203
|
+
), r = c(
|
|
1204
1204
|
(C) => C.selectedSchemaName
|
|
1205
|
-
), d =
|
|
1205
|
+
), d = c((C) => C.selectedTableName), p = c(
|
|
1206
1206
|
(C) => C.actions.setCurrentColumns
|
|
1207
|
-
),
|
|
1207
|
+
), h = c(
|
|
1208
1208
|
(C) => C.actions.setSelectedConnectionId
|
|
1209
|
-
), y =
|
|
1209
|
+
), y = c(
|
|
1210
1210
|
(C) => C.actions.setSelectedDatamodelId
|
|
1211
|
-
), x =
|
|
1211
|
+
), x = c(
|
|
1212
1212
|
(C) => C.actions.setSelectedDatabaseName
|
|
1213
|
-
),
|
|
1213
|
+
), m = c(
|
|
1214
1214
|
(C) => C.actions.setSelectedSchemaName
|
|
1215
|
-
),
|
|
1215
|
+
), f = c(
|
|
1216
1216
|
(C) => C.actions.setSelectedTableName
|
|
1217
|
-
),
|
|
1217
|
+
), u = c((C) => C.actions.setCardSql);
|
|
1218
1218
|
function k(C) {
|
|
1219
1219
|
return i && l && r && l !== "NA" ? !0 : i && C === "API" ? !1 : !!(i && C === "S3");
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1222
|
-
return !!(i && l && l !== "NA" && r && d || i && (C === "S3" || C === "API") ||
|
|
1221
|
+
function D(C) {
|
|
1222
|
+
return !!(i && l && l !== "NA" && r && d || i && (C === "S3" || C === "API") || o && o);
|
|
1223
1223
|
}
|
|
1224
1224
|
function I(C) {
|
|
1225
1225
|
return i && C ? !(C === "API" || C === "S3") : !1;
|
|
1226
1226
|
}
|
|
1227
1227
|
const {
|
|
1228
1228
|
data: N,
|
|
1229
|
-
isLoading:
|
|
1230
|
-
isError:
|
|
1231
|
-
} =
|
|
1229
|
+
isLoading: M,
|
|
1230
|
+
isError: A
|
|
1231
|
+
} = re({
|
|
1232
1232
|
queryKey: ["connections"],
|
|
1233
1233
|
queryFn: () => Ne(
|
|
1234
1234
|
"https://semaphor.cloud/api/v1/connections",
|
|
@@ -1240,7 +1240,7 @@ function Me(s, n) {
|
|
|
1240
1240
|
data: j,
|
|
1241
1241
|
isLoading: S,
|
|
1242
1242
|
isError: v
|
|
1243
|
-
} =
|
|
1243
|
+
} = re({
|
|
1244
1244
|
queryKey: ["models", i],
|
|
1245
1245
|
queryFn: () => Ne(
|
|
1246
1246
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
@@ -1259,7 +1259,7 @@ function Me(s, n) {
|
|
|
1259
1259
|
isFetching: ee,
|
|
1260
1260
|
isError: W,
|
|
1261
1261
|
refetch: le
|
|
1262
|
-
} =
|
|
1262
|
+
} = re({
|
|
1263
1263
|
queryKey: ["databases", i],
|
|
1264
1264
|
queryFn: () => Ne(
|
|
1265
1265
|
"https://semaphor.cloud/api/v1/databases",
|
|
@@ -1271,12 +1271,12 @@ function Me(s, n) {
|
|
|
1271
1271
|
enabled: I(q)
|
|
1272
1272
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1273
1273
|
}), {
|
|
1274
|
-
data:
|
|
1274
|
+
data: P,
|
|
1275
1275
|
isLoading: ie,
|
|
1276
1276
|
isFetching: w,
|
|
1277
1277
|
isError: E,
|
|
1278
1278
|
refetch: X
|
|
1279
|
-
} =
|
|
1279
|
+
} = re({
|
|
1280
1280
|
queryKey: ["schemas", i, l],
|
|
1281
1281
|
queryFn: () => Ne(
|
|
1282
1282
|
"https://semaphor.cloud/api/v1/schemas",
|
|
@@ -1289,12 +1289,12 @@ function Me(s, n) {
|
|
|
1289
1289
|
enabled: !!i && !!l && !$ && l !== "NA"
|
|
1290
1290
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1291
1291
|
}), {
|
|
1292
|
-
data:
|
|
1292
|
+
data: T,
|
|
1293
1293
|
isLoading: L,
|
|
1294
1294
|
isFetching: se,
|
|
1295
1295
|
isError: _,
|
|
1296
1296
|
refetch: ae
|
|
1297
|
-
} =
|
|
1297
|
+
} = re({
|
|
1298
1298
|
queryKey: [
|
|
1299
1299
|
"tables",
|
|
1300
1300
|
i,
|
|
@@ -1316,12 +1316,12 @@ function Me(s, n) {
|
|
|
1316
1316
|
isLoading: we,
|
|
1317
1317
|
isFetching: ye,
|
|
1318
1318
|
isError: Y
|
|
1319
|
-
} =
|
|
1319
|
+
} = re({
|
|
1320
1320
|
queryKey: [
|
|
1321
1321
|
"columns",
|
|
1322
1322
|
i,
|
|
1323
1323
|
l,
|
|
1324
|
-
|
|
1324
|
+
o,
|
|
1325
1325
|
r,
|
|
1326
1326
|
d
|
|
1327
1327
|
],
|
|
@@ -1330,14 +1330,14 @@ function Me(s, n) {
|
|
|
1330
1330
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1331
1331
|
{
|
|
1332
1332
|
connection_id: i,
|
|
1333
|
-
datamodel_id:
|
|
1333
|
+
datamodel_id: o || "",
|
|
1334
1334
|
// don't pass undefined. Pass empty string
|
|
1335
1335
|
database_name: l,
|
|
1336
1336
|
schema_name: r,
|
|
1337
1337
|
table_name: d
|
|
1338
1338
|
}
|
|
1339
1339
|
),
|
|
1340
|
-
enabled:
|
|
1340
|
+
enabled: D(q)
|
|
1341
1341
|
// (!!selectedConnectionId &&
|
|
1342
1342
|
// !!selectedDatabaseName &&
|
|
1343
1343
|
// !!selectedSchemaName &&
|
|
@@ -1351,29 +1351,29 @@ function Me(s, n) {
|
|
|
1351
1351
|
}, [te, p, a]), Z(() => {
|
|
1352
1352
|
}, [
|
|
1353
1353
|
$,
|
|
1354
|
-
f,
|
|
1355
1354
|
u,
|
|
1356
|
-
|
|
1355
|
+
f,
|
|
1356
|
+
m,
|
|
1357
1357
|
x,
|
|
1358
1358
|
b
|
|
1359
1359
|
]);
|
|
1360
|
-
const
|
|
1360
|
+
const oe = (b == null ? void 0 : b.type) === "API" ? (Qe = b == null ? void 0 : b.type) == null ? void 0 : Qe.toLowerCase() : d || "", ce = $ ? "" : r || "";
|
|
1361
1361
|
function ke(C) {
|
|
1362
|
-
|
|
1362
|
+
m(C), f("");
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1365
|
-
x(C === "none" ? "" : C),
|
|
1364
|
+
function de(C) {
|
|
1365
|
+
x(C === "none" ? "" : C), m(""), f(""), C !== "none" && C !== "" && y("");
|
|
1366
1366
|
}
|
|
1367
1367
|
function ve(C) {
|
|
1368
|
-
|
|
1368
|
+
h(C);
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1370
|
+
function Bs(C) {
|
|
1371
1371
|
y(C === "none" ? "" : C), C !== "none" && C !== "" && x("");
|
|
1372
1372
|
}
|
|
1373
|
-
R && ((Ee = R == null ? void 0 : R.databases) == null ? void 0 : Ee.length) > 0,
|
|
1373
|
+
R && ((Ee = R == null ? void 0 : R.databases) == null ? void 0 : Ee.length) > 0, P && ((Je = P == null ? void 0 : P.schemas) == null ? void 0 : Je.length) > 0, te && ((Ye = te == null ? void 0 : te.columns) == null ? void 0 : Ye.length) > 0 && (a = te.columns.map((C) => ({
|
|
1374
1374
|
...C,
|
|
1375
1375
|
data_type: C.data_type.toLowerCase()
|
|
1376
|
-
}))), W && (a = []), (Y ||
|
|
1376
|
+
}))), W && (a = []), (Y || A) && (a = []);
|
|
1377
1377
|
const Te = N == null ? void 0 : N.connections.map(
|
|
1378
1378
|
(C) => ({
|
|
1379
1379
|
id: C.id,
|
|
@@ -1386,17 +1386,17 @@ function Me(s, n) {
|
|
|
1386
1386
|
})), We = R == null ? void 0 : R.databases.map((C) => ({
|
|
1387
1387
|
id: C.database_name,
|
|
1388
1388
|
name: C.database_name
|
|
1389
|
-
})), us =
|
|
1389
|
+
})), us = P == null ? void 0 : P.schemas.map((C) => ({
|
|
1390
1390
|
id: C.schema_name,
|
|
1391
1391
|
name: C.schema_name
|
|
1392
|
-
})), hs =
|
|
1392
|
+
})), hs = T == null ? void 0 : T.tables.map((C) => ({
|
|
1393
1393
|
id: C.table_name,
|
|
1394
1394
|
name: C.table_name
|
|
1395
1395
|
}));
|
|
1396
1396
|
return {
|
|
1397
1397
|
connectionItems: Te,
|
|
1398
|
-
isConnectionsLoading:
|
|
1399
|
-
isConnectionsError:
|
|
1398
|
+
isConnectionsLoading: M,
|
|
1399
|
+
isConnectionsError: A,
|
|
1400
1400
|
modelItems: ds,
|
|
1401
1401
|
isModelsLoading: S,
|
|
1402
1402
|
isModelsError: v,
|
|
@@ -1414,44 +1414,44 @@ function Me(s, n) {
|
|
|
1414
1414
|
isColumnsError: Y,
|
|
1415
1415
|
isNonDbConnection: $,
|
|
1416
1416
|
connectionType: q,
|
|
1417
|
-
tableName:
|
|
1418
|
-
schemaName:
|
|
1417
|
+
tableName: oe,
|
|
1418
|
+
schemaName: ce,
|
|
1419
1419
|
handleConnectionChange: ve,
|
|
1420
|
-
handleDatamodelChange:
|
|
1421
|
-
handleDatabaseChange:
|
|
1420
|
+
handleDatamodelChange: Bs,
|
|
1421
|
+
handleDatabaseChange: de,
|
|
1422
1422
|
handleSchemaChange: ke
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function Ma({
|
|
1426
1426
|
ColumnsComponent: s
|
|
1427
1427
|
}) {
|
|
1428
1428
|
var se;
|
|
1429
|
-
const n =
|
|
1429
|
+
const n = c(
|
|
1430
1430
|
(_) => _.selectedConnectionId
|
|
1431
|
-
), a =
|
|
1431
|
+
), a = c(
|
|
1432
1432
|
(_) => _.selectedDatamodelId
|
|
1433
|
-
), t =
|
|
1433
|
+
), t = c(
|
|
1434
1434
|
(_) => _.selectedDatabaseName
|
|
1435
|
-
), i =
|
|
1435
|
+
), i = c(
|
|
1436
1436
|
(_) => _.selectedSchemaName
|
|
1437
|
-
),
|
|
1437
|
+
), o = c((_) => _.selectedTableName), l = c(
|
|
1438
1438
|
(_) => _.actions.setSelectedTableName
|
|
1439
1439
|
), {
|
|
1440
1440
|
connectionItems: r,
|
|
1441
1441
|
modelItems: d,
|
|
1442
1442
|
schemaItems: p,
|
|
1443
|
-
databaseItems:
|
|
1443
|
+
databaseItems: h,
|
|
1444
1444
|
tableItems: y,
|
|
1445
1445
|
columns: x,
|
|
1446
|
-
isConnectionsLoading:
|
|
1447
|
-
isModelsLoading:
|
|
1448
|
-
isConnectionsError:
|
|
1446
|
+
isConnectionsLoading: m,
|
|
1447
|
+
isModelsLoading: f,
|
|
1448
|
+
isConnectionsError: u,
|
|
1449
1449
|
isModelsError: k,
|
|
1450
|
-
isDatabasesLoadingOrFetching:
|
|
1450
|
+
isDatabasesLoadingOrFetching: D,
|
|
1451
1451
|
isDatabaseError: I,
|
|
1452
1452
|
isSchemaLoadingOrFetching: N,
|
|
1453
|
-
isSchemaError:
|
|
1454
|
-
isColumnsError:
|
|
1453
|
+
isSchemaError: M,
|
|
1454
|
+
isColumnsError: A,
|
|
1455
1455
|
isColumnsLoadingOrFetching: j,
|
|
1456
1456
|
isTableLoadingOrFetching: S,
|
|
1457
1457
|
isTableError: v,
|
|
@@ -1464,14 +1464,14 @@ function Aa({
|
|
|
1464
1464
|
tableName: W,
|
|
1465
1465
|
schemaName: le
|
|
1466
1466
|
} = Me();
|
|
1467
|
-
function
|
|
1467
|
+
function P() {
|
|
1468
1468
|
return s ? s(le, W, x) : /* @__PURE__ */ e.jsx(
|
|
1469
|
-
|
|
1469
|
+
Gn,
|
|
1470
1470
|
{
|
|
1471
1471
|
schemaName: le,
|
|
1472
1472
|
tableName: W,
|
|
1473
1473
|
columns: x,
|
|
1474
|
-
status: j ? "Loading..." :
|
|
1474
|
+
status: j ? "Loading..." : A ? "Error" : "Success"
|
|
1475
1475
|
}
|
|
1476
1476
|
);
|
|
1477
1477
|
}
|
|
@@ -1488,8 +1488,8 @@ function Aa({
|
|
|
1488
1488
|
showNone: !0,
|
|
1489
1489
|
onChange: R,
|
|
1490
1490
|
isError: I,
|
|
1491
|
-
isLoading:
|
|
1492
|
-
items:
|
|
1491
|
+
isLoading: D,
|
|
1492
|
+
items: h,
|
|
1493
1493
|
value: t || "",
|
|
1494
1494
|
title: "Database"
|
|
1495
1495
|
}
|
|
@@ -1513,19 +1513,19 @@ function Aa({
|
|
|
1513
1513
|
showNone: !0,
|
|
1514
1514
|
onChange: ee,
|
|
1515
1515
|
isError: k,
|
|
1516
|
-
isLoading:
|
|
1516
|
+
isLoading: f,
|
|
1517
1517
|
items: d,
|
|
1518
1518
|
value: a || "",
|
|
1519
1519
|
title: "Model"
|
|
1520
1520
|
}
|
|
1521
1521
|
);
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function T() {
|
|
1524
1524
|
return !n || b === "S3" || b === "API" || !t || t === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1525
1525
|
Ve,
|
|
1526
1526
|
{
|
|
1527
1527
|
onChange: B,
|
|
1528
|
-
isError:
|
|
1528
|
+
isError: M,
|
|
1529
1529
|
isLoading: N,
|
|
1530
1530
|
items: p,
|
|
1531
1531
|
value: i || "",
|
|
@@ -1545,7 +1545,7 @@ function Aa({
|
|
|
1545
1545
|
isError: v,
|
|
1546
1546
|
items: y,
|
|
1547
1547
|
isLoading: S,
|
|
1548
|
-
value:
|
|
1548
|
+
value: o || "",
|
|
1549
1549
|
title: "Table"
|
|
1550
1550
|
}
|
|
1551
1551
|
) : null;
|
|
@@ -1559,8 +1559,8 @@ function Aa({
|
|
|
1559
1559
|
title: "Connection",
|
|
1560
1560
|
value: n || "",
|
|
1561
1561
|
onChange: $,
|
|
1562
|
-
isLoading:
|
|
1563
|
-
isError:
|
|
1562
|
+
isLoading: m,
|
|
1563
|
+
isError: u,
|
|
1564
1564
|
connectionTooltip: ((se = r == null ? void 0 : r.find(
|
|
1565
1565
|
(_) => _.id === n
|
|
1566
1566
|
)) == null ? void 0 : se.type) || ""
|
|
@@ -1569,10 +1569,10 @@ function Aa({
|
|
|
1569
1569
|
X(),
|
|
1570
1570
|
E(),
|
|
1571
1571
|
w(),
|
|
1572
|
-
|
|
1572
|
+
T(),
|
|
1573
1573
|
L()
|
|
1574
1574
|
] }),
|
|
1575
|
-
|
|
1575
|
+
P(),
|
|
1576
1576
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1577
1577
|
F,
|
|
1578
1578
|
{
|
|
@@ -1588,10 +1588,10 @@ function Aa({
|
|
|
1588
1588
|
) })
|
|
1589
1589
|
] });
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function Kn(s) {
|
|
1592
1592
|
const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
|
|
1593
|
-
let
|
|
1594
|
-
if (i !== -1 && (
|
|
1593
|
+
let o = s.length;
|
|
1594
|
+
if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
|
|
1595
1595
|
const l = s.substring(0, n), r = s.substring(n);
|
|
1596
1596
|
return `${l} {{ filters | where }} AND ${r.substring(
|
|
1597
1597
|
6
|
|
@@ -1600,20 +1600,20 @@ function Gn(s) {
|
|
|
1600
1600
|
const l = s.substring(0, a), r = s.substring(a);
|
|
1601
1601
|
return `${l} {{ filters | where }} ${r}`;
|
|
1602
1602
|
} else {
|
|
1603
|
-
const l = s.substring(0,
|
|
1603
|
+
const l = s.substring(0, o), r = s.substring(o);
|
|
1604
1604
|
return `${l} {{ filters | where }} ${r}`;
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
|
-
function
|
|
1607
|
+
function Pn({
|
|
1608
1608
|
error: s,
|
|
1609
1609
|
setShowAIDialog: n,
|
|
1610
1610
|
setUserInputforAI: a,
|
|
1611
1611
|
setTriggerAIRun: t
|
|
1612
1612
|
}) {
|
|
1613
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1614
|
-
/* @__PURE__ */ e.jsx(
|
|
1615
|
-
/* @__PURE__ */ e.jsx(
|
|
1616
|
-
/* @__PURE__ */ e.jsx(
|
|
1613
|
+
return /* @__PURE__ */ e.jsxs(Os, { openDelay: 0, children: [
|
|
1614
|
+
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(un, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1615
|
+
/* @__PURE__ */ e.jsx(Es, { align: "start", className: "min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1616
|
+
/* @__PURE__ */ e.jsx(Vs, { 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 }) }),
|
|
1617
1617
|
/* @__PURE__ */ e.jsxs(
|
|
1618
1618
|
F,
|
|
1619
1619
|
{
|
|
@@ -1642,9 +1642,9 @@ function Wn({
|
|
|
1642
1642
|
] });
|
|
1643
1643
|
}
|
|
1644
1644
|
function Qn() {
|
|
1645
|
-
const { authToken: s } =
|
|
1646
|
-
(
|
|
1647
|
-
), { data: a } =
|
|
1645
|
+
const { authToken: s } = je(), n = c(
|
|
1646
|
+
(o) => o.selectedConnectionId
|
|
1647
|
+
), { data: a } = re({
|
|
1648
1648
|
queryKey: ["connections"],
|
|
1649
1649
|
queryFn: () => Ne(
|
|
1650
1650
|
"https://semaphor.cloud/api/v1/connections",
|
|
@@ -1653,46 +1653,46 @@ function Qn() {
|
|
|
1653
1653
|
enabled: !!(s != null && s.accessToken)
|
|
1654
1654
|
// Only fetch if authToken is present
|
|
1655
1655
|
}), t = a == null ? void 0 : a.connections.find(
|
|
1656
|
-
(
|
|
1656
|
+
(o) => o.id === n
|
|
1657
1657
|
);
|
|
1658
1658
|
return t == null ? void 0 : t.type;
|
|
1659
1659
|
}
|
|
1660
1660
|
function Jn() {
|
|
1661
|
-
const { authToken: s } =
|
|
1661
|
+
const { authToken: s } = je(), n = $e(null), a = c((d) => d.applyFilters), [t, i] = V(""), o = c((d) => d.filterValues), l = c((d) => d.card.sql), r = Qn();
|
|
1662
1662
|
return /* @__PURE__ */ e.jsxs(
|
|
1663
|
-
|
|
1663
|
+
Os,
|
|
1664
1664
|
{
|
|
1665
1665
|
openDelay: 0,
|
|
1666
1666
|
onOpenChange: async (d) => {
|
|
1667
1667
|
if (!d)
|
|
1668
1668
|
return;
|
|
1669
1669
|
console.log("onOpenChange");
|
|
1670
|
-
const p = await
|
|
1670
|
+
const p = await Ue(
|
|
1671
1671
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1672
1672
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1673
1673
|
{
|
|
1674
1674
|
sql: l,
|
|
1675
|
-
active_filters:
|
|
1675
|
+
active_filters: o,
|
|
1676
1676
|
connection_type: r
|
|
1677
1677
|
}
|
|
1678
1678
|
);
|
|
1679
1679
|
console.log(p), p.sql ? (console.log(p.records), i(p.sql)) : i("Error");
|
|
1680
1680
|
},
|
|
1681
1681
|
children: [
|
|
1682
|
-
/* @__PURE__ */ e.jsx(
|
|
1683
|
-
/* @__PURE__ */ e.jsxs(
|
|
1682
|
+
/* @__PURE__ */ e.jsx(As, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
1683
|
+
/* @__PURE__ */ e.jsxs(Es, { align: "end", className: "w-[600px]", children: [
|
|
1684
1684
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
|
|
1685
1685
|
t,
|
|
1686
1686
|
/* @__PURE__ */ e.jsx(
|
|
1687
|
-
|
|
1687
|
+
da,
|
|
1688
1688
|
{
|
|
1689
|
-
onClick: () =>
|
|
1689
|
+
onClick: () => dt(n),
|
|
1690
1690
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1691
1691
|
}
|
|
1692
1692
|
)
|
|
1693
1693
|
] }) }) }),
|
|
1694
1694
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
1695
|
-
/* @__PURE__ */ e.jsx(
|
|
1695
|
+
/* @__PURE__ */ e.jsx(ut, { className: "h-4 w-4 opacity-70" }),
|
|
1696
1696
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
|
|
1697
1697
|
] })
|
|
1698
1698
|
] })
|
|
@@ -1753,23 +1753,23 @@ function Xn({
|
|
|
1753
1753
|
userInput: a,
|
|
1754
1754
|
setUserInput: t,
|
|
1755
1755
|
triggerAIRun: i,
|
|
1756
|
-
setTriggerAIRun:
|
|
1756
|
+
setTriggerAIRun: o
|
|
1757
1757
|
}) {
|
|
1758
|
-
const l = $e(null), r = $e(null), { authToken: d } =
|
|
1758
|
+
const l = $e(null), r = $e(null), { authToken: d } = je(), [p, h] = V(!1), y = c((w) => w.actions.setCardSql), x = z((w) => w.dashboard.baseQueries), m = c((w) => w.actions.setRunSql), f = c((w) => w.actions.setCardType), [u, k] = V([]), D = c((w) => w.currentColumns), I = c((w) => w.card.sql), N = c((w) => w.selectedTableName), M = `
|
|
1759
1759
|
${a}
|
|
1760
1760
|
|
|
1761
1761
|
Database Query Dialect: ${N === "api" || N === "s3" ? "DuckDb" : ""}
|
|
1762
1762
|
Table Name: ${N}
|
|
1763
|
-
Table Columns: ${
|
|
1763
|
+
Table Columns: ${D == null ? void 0 : D.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
|
|
1764
1764
|
User SQL: ${I}
|
|
1765
|
-
${x && `Base Queries: ${JSON.stringify(x)} `}`,
|
|
1766
|
-
Visual Query Syntax: ${Yn}`, { data: j, isLoading: S, isFetching: v, isError: b, refetch: q } =
|
|
1765
|
+
${x && `Base Queries: ${JSON.stringify(x)} `}`, A = ` 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.
|
|
1766
|
+
Visual Query Syntax: ${Yn}`, { data: j, isLoading: S, isFetching: v, isError: b, refetch: q } = re({
|
|
1767
1767
|
queryKey: ["ai-query"],
|
|
1768
1768
|
queryFn: () => Ne(
|
|
1769
1769
|
"https://semaphor.cloud/api/v1/ai",
|
|
1770
1770
|
(d == null ? void 0 : d.accessToken) || "",
|
|
1771
1771
|
{
|
|
1772
|
-
user_content: `userContent: ${
|
|
1772
|
+
user_content: `userContent: ${M} ${p ? A : ""}`
|
|
1773
1773
|
}
|
|
1774
1774
|
),
|
|
1775
1775
|
enabled: !1
|
|
@@ -1777,23 +1777,23 @@ function Xn({
|
|
|
1777
1777
|
});
|
|
1778
1778
|
function $(w) {
|
|
1779
1779
|
if (w.toLowerCase().includes("bar"))
|
|
1780
|
-
|
|
1780
|
+
f("bar");
|
|
1781
1781
|
else if (w.toLowerCase().includes("line"))
|
|
1782
|
-
|
|
1782
|
+
f("line");
|
|
1783
1783
|
else if (w.toLowerCase().includes("bubble"))
|
|
1784
|
-
|
|
1784
|
+
f("bubble");
|
|
1785
1785
|
else if (w.toLowerCase().includes("scatter"))
|
|
1786
|
-
|
|
1786
|
+
f("scatter");
|
|
1787
1787
|
else if (w.toLowerCase().includes("stacked"))
|
|
1788
|
-
|
|
1788
|
+
f("stackedBar");
|
|
1789
1789
|
else if (w.toLowerCase().includes("pie"))
|
|
1790
|
-
|
|
1790
|
+
f("pie");
|
|
1791
1791
|
else if (w.toLowerCase().includes("donut") || w.toLowerCase().includes("doughnut"))
|
|
1792
|
-
|
|
1792
|
+
f("doughnut");
|
|
1793
1793
|
else if (w.toLowerCase().includes("radar"))
|
|
1794
|
-
|
|
1794
|
+
f("radar");
|
|
1795
1795
|
else
|
|
1796
|
-
return
|
|
1796
|
+
return f("bar"), !1;
|
|
1797
1797
|
return !0;
|
|
1798
1798
|
}
|
|
1799
1799
|
Z(() => {
|
|
@@ -1807,13 +1807,13 @@ function Xn({
|
|
|
1807
1807
|
}), (E = l.current) == null || E.focus());
|
|
1808
1808
|
}, 100);
|
|
1809
1809
|
return () => clearTimeout(w);
|
|
1810
|
-
}, [
|
|
1810
|
+
}, [u]);
|
|
1811
1811
|
function R() {
|
|
1812
|
-
a && (k((w) => [...w, { role: "user", content: a }]), $(a) &&
|
|
1812
|
+
a && (k((w) => [...w, { role: "user", content: a }]), $(a) && h(!0), t(""), q());
|
|
1813
1813
|
}
|
|
1814
1814
|
Z(() => {
|
|
1815
|
-
i && (R(),
|
|
1816
|
-
}, [i,
|
|
1815
|
+
i && (R(), o(!1));
|
|
1816
|
+
}, [i, o]);
|
|
1817
1817
|
const B = {
|
|
1818
1818
|
//seleect a darker color
|
|
1819
1819
|
// color: '#000',
|
|
@@ -1846,17 +1846,17 @@ function Xn({
|
|
|
1846
1846
|
pre: ({ node: w, ...E }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: ee, children: [
|
|
1847
1847
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: E.children }),
|
|
1848
1848
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1849
|
-
/* @__PURE__ */ e.jsx(F, { onClick:
|
|
1849
|
+
/* @__PURE__ */ e.jsx(F, { onClick: P, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(da, {}) }),
|
|
1850
1850
|
/* @__PURE__ */ e.jsx(
|
|
1851
1851
|
F,
|
|
1852
1852
|
{
|
|
1853
1853
|
onClick: (X) => {
|
|
1854
|
-
const
|
|
1855
|
-
|
|
1854
|
+
const T = P(X);
|
|
1855
|
+
T && (n(!1), y(T), m(!0));
|
|
1856
1856
|
},
|
|
1857
1857
|
size: "sm",
|
|
1858
1858
|
variant: "outline",
|
|
1859
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1859
|
+
children: /* @__PURE__ */ e.jsx(xt, {})
|
|
1860
1860
|
}
|
|
1861
1861
|
)
|
|
1862
1862
|
] })
|
|
@@ -1864,15 +1864,15 @@ function Xn({
|
|
|
1864
1864
|
li: ({ node: w, ...E }) => /* @__PURE__ */ e.jsx("li", { style: W, ...E })
|
|
1865
1865
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1866
1866
|
};
|
|
1867
|
-
function
|
|
1867
|
+
function P(w) {
|
|
1868
1868
|
const E = w.currentTarget.closest("pre");
|
|
1869
1869
|
if (!E)
|
|
1870
1870
|
return;
|
|
1871
1871
|
const X = E.textContent || E.innerText;
|
|
1872
|
-
return navigator.clipboard.writeText(X).then(() => console.log("Text copied to clipboard")).catch((
|
|
1872
|
+
return navigator.clipboard.writeText(X).then(() => console.log("Text copied to clipboard")).catch((T) => console.error("Error in copying text: ", T)), X;
|
|
1873
1873
|
}
|
|
1874
1874
|
function ie() {
|
|
1875
|
-
return
|
|
1875
|
+
return u == null ? void 0 : u.map((w, E) => w.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1876
1876
|
"div",
|
|
1877
1877
|
{
|
|
1878
1878
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
@@ -1883,7 +1883,7 @@ function Xn({
|
|
|
1883
1883
|
},
|
|
1884
1884
|
E
|
|
1885
1885
|
) : w.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1886
|
-
|
|
1886
|
+
mt,
|
|
1887
1887
|
{
|
|
1888
1888
|
className: "w-full overflow-auto py-1",
|
|
1889
1889
|
components: le,
|
|
@@ -1892,8 +1892,8 @@ function Xn({
|
|
|
1892
1892
|
E
|
|
1893
1893
|
) : /* @__PURE__ */ e.jsx("div", {}, E));
|
|
1894
1894
|
}
|
|
1895
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1896
|
-
/* @__PURE__ */ e.jsx(
|
|
1895
|
+
return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange: n, children: [
|
|
1896
|
+
/* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1897
1897
|
F,
|
|
1898
1898
|
{
|
|
1899
1899
|
size: "sm",
|
|
@@ -1903,13 +1903,13 @@ function Xn({
|
|
|
1903
1903
|
}
|
|
1904
1904
|
) }),
|
|
1905
1905
|
/* @__PURE__ */ e.jsxs(
|
|
1906
|
-
|
|
1906
|
+
zs,
|
|
1907
1907
|
{
|
|
1908
1908
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1909
1909
|
children: [
|
|
1910
|
-
/* @__PURE__ */ e.jsxs(
|
|
1911
|
-
/* @__PURE__ */ e.jsx(
|
|
1912
|
-
/* @__PURE__ */ e.jsx(
|
|
1910
|
+
/* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
1911
|
+
/* @__PURE__ */ e.jsx(Ls, { children: "Assistant" }),
|
|
1912
|
+
/* @__PURE__ */ e.jsx(Ts, { children: "What can I help you with?" })
|
|
1913
1913
|
] }),
|
|
1914
1914
|
/* @__PURE__ */ e.jsx(
|
|
1915
1915
|
"div",
|
|
@@ -1924,7 +1924,7 @@ function Xn({
|
|
|
1924
1924
|
{
|
|
1925
1925
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
|
|
1926
1926
|
/* @__PURE__ */ e.jsx(
|
|
1927
|
-
|
|
1927
|
+
ua,
|
|
1928
1928
|
{
|
|
1929
1929
|
autoFocus: !0,
|
|
1930
1930
|
ref: l,
|
|
@@ -1952,7 +1952,7 @@ function Xn({
|
|
|
1952
1952
|
size: "sm",
|
|
1953
1953
|
variant: "ghost",
|
|
1954
1954
|
onClick: R,
|
|
1955
|
-
children: !S && !v ? /* @__PURE__ */ e.jsx(
|
|
1955
|
+
children: !S && !v ? /* @__PURE__ */ e.jsx(ht, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1956
1956
|
}
|
|
1957
1957
|
)
|
|
1958
1958
|
] })
|
|
@@ -1963,30 +1963,30 @@ function Xn({
|
|
|
1963
1963
|
)
|
|
1964
1964
|
] });
|
|
1965
1965
|
}
|
|
1966
|
-
var
|
|
1966
|
+
var Oa = {
|
|
1967
1967
|
color: void 0,
|
|
1968
1968
|
size: void 0,
|
|
1969
1969
|
className: void 0,
|
|
1970
1970
|
style: void 0,
|
|
1971
1971
|
attr: void 0
|
|
1972
|
-
}, Xs =
|
|
1972
|
+
}, Xs = ge.createContext && /* @__PURE__ */ ge.createContext(Oa), Zn = ["attr", "size", "title"];
|
|
1973
1973
|
function el(s, n) {
|
|
1974
1974
|
if (s == null)
|
|
1975
1975
|
return {};
|
|
1976
1976
|
var a = sl(s, n), t, i;
|
|
1977
1977
|
if (Object.getOwnPropertySymbols) {
|
|
1978
|
-
var
|
|
1979
|
-
for (i = 0; i <
|
|
1980
|
-
t =
|
|
1978
|
+
var o = Object.getOwnPropertySymbols(s);
|
|
1979
|
+
for (i = 0; i < o.length; i++)
|
|
1980
|
+
t = o[i], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
|
|
1981
1981
|
}
|
|
1982
1982
|
return a;
|
|
1983
1983
|
}
|
|
1984
1984
|
function sl(s, n) {
|
|
1985
1985
|
if (s == null)
|
|
1986
1986
|
return {};
|
|
1987
|
-
var a = {}, t = Object.keys(s), i,
|
|
1988
|
-
for (
|
|
1989
|
-
i = t[
|
|
1987
|
+
var a = {}, t = Object.keys(s), i, o;
|
|
1988
|
+
for (o = 0; o < t.length; o++)
|
|
1989
|
+
i = t[o], !(n.indexOf(i) >= 0) && (a[i] = s[i]);
|
|
1990
1990
|
return a;
|
|
1991
1991
|
}
|
|
1992
1992
|
function ls() {
|
|
@@ -2039,24 +2039,24 @@ function nl(s, n) {
|
|
|
2039
2039
|
}
|
|
2040
2040
|
return (n === "string" ? String : Number)(s);
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2043
|
-
return s && s.map((n, a) => /* @__PURE__ */
|
|
2042
|
+
function Aa(s) {
|
|
2043
|
+
return s && s.map((n, a) => /* @__PURE__ */ ge.createElement(n.tag, is({
|
|
2044
2044
|
key: a
|
|
2045
|
-
}, n.attr),
|
|
2045
|
+
}, n.attr), Aa(n.child)));
|
|
2046
2046
|
}
|
|
2047
2047
|
function be(s) {
|
|
2048
|
-
return (n) => /* @__PURE__ */
|
|
2048
|
+
return (n) => /* @__PURE__ */ ge.createElement(ll, ls({
|
|
2049
2049
|
attr: is({}, s.attr)
|
|
2050
|
-
}, n),
|
|
2050
|
+
}, n), Aa(s.child));
|
|
2051
2051
|
}
|
|
2052
2052
|
function ll(s) {
|
|
2053
2053
|
var n = (a) => {
|
|
2054
2054
|
var {
|
|
2055
2055
|
attr: t,
|
|
2056
2056
|
size: i,
|
|
2057
|
-
title:
|
|
2057
|
+
title: o
|
|
2058
2058
|
} = s, l = el(s, Zn), r = i || a.size || "1em", d;
|
|
2059
|
-
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */
|
|
2059
|
+
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ ge.createElement("svg", ls({
|
|
2060
2060
|
stroke: "currentColor",
|
|
2061
2061
|
fill: "currentColor",
|
|
2062
2062
|
strokeWidth: "0"
|
|
@@ -2068,61 +2068,61 @@ function ll(s) {
|
|
|
2068
2068
|
height: r,
|
|
2069
2069
|
width: r,
|
|
2070
2070
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2071
|
-
}),
|
|
2071
|
+
}), o && /* @__PURE__ */ ge.createElement("title", null, o), s.children);
|
|
2072
2072
|
};
|
|
2073
|
-
return Xs !== void 0 ? /* @__PURE__ */
|
|
2073
|
+
return Xs !== void 0 ? /* @__PURE__ */ ge.createElement(Xs.Consumer, null, (a) => n(a)) : n(Oa);
|
|
2074
2074
|
}
|
|
2075
2075
|
function il(s) {
|
|
2076
2076
|
return be({ 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);
|
|
2077
2077
|
}
|
|
2078
2078
|
function rl() {
|
|
2079
|
-
const { theme: s } =
|
|
2079
|
+
const { theme: s } = pt(), n = $e(), a = $e(), [t, i] = V(!1), [o, l] = V(!1), [r, d] = V(!1), [p, h] = V(""), [y, x] = V(!1), { authToken: m } = je();
|
|
2080
2080
|
z((g) => g.selectedSheetId);
|
|
2081
|
-
const
|
|
2081
|
+
const f = z((g) => g.dashboard.baseQueries), u = c((g) => g.card), k = z((g) => g.theme), D = c((g) => g.isShowingVisual);
|
|
2082
2082
|
z((g) => g.onAcceptChanges);
|
|
2083
|
-
const I =
|
|
2083
|
+
const I = c(
|
|
2084
2084
|
(g) => g.selectedConnectionId
|
|
2085
|
-
), N =
|
|
2085
|
+
), N = c(
|
|
2086
2086
|
(g) => g.selectedDatabaseName
|
|
2087
|
-
),
|
|
2087
|
+
), M = c(
|
|
2088
2088
|
(g) => g.selectedDatamodelId
|
|
2089
|
-
),
|
|
2089
|
+
), A = c(
|
|
2090
2090
|
(g) => g.selectedSchemaName
|
|
2091
2091
|
);
|
|
2092
2092
|
z(
|
|
2093
2093
|
(g) => g.actions.updateFrameCard
|
|
2094
2094
|
);
|
|
2095
|
-
const j =
|
|
2095
|
+
const j = c((g) => g.selectedTableName), S = c((g) => g.card.sql), v = c((g) => g.card.python), b = ft(S, f), q = c((g) => g.selectedConnectionId), $ = c((g) => g.frame), R = z((g) => g.filterValues), B = c((g) => g.applyFilters), {
|
|
2096
2096
|
setCardCustomCfg: ee,
|
|
2097
2097
|
setQueryResultColumns: W,
|
|
2098
2098
|
setFilterValues: le,
|
|
2099
|
-
setCardSql:
|
|
2099
|
+
setCardSql: P,
|
|
2100
2100
|
setCardPython: ie,
|
|
2101
2101
|
setQueryError: w,
|
|
2102
2102
|
setPythonStdOut: E,
|
|
2103
2103
|
setCardPreferences: X
|
|
2104
|
-
} =
|
|
2104
|
+
} = c((g) => g.actions), T = c((g) => g.onSave), L = c(
|
|
2105
2105
|
(g) => g.actions.setApplyFilters
|
|
2106
|
-
), se =
|
|
2106
|
+
), se = c((g) => g.onClose), _ = c((g) => g.actions.setCardData), ae = c((g) => g.actions.setSqlGen), te = c((g) => g.runSql), we = c((g) => g.actions.setRunSql), ye = c(
|
|
2107
2107
|
(g) => g.actions.setIsSqlRunning
|
|
2108
2108
|
), {
|
|
2109
2109
|
data: Y,
|
|
2110
|
-
isLoading:
|
|
2111
|
-
isFetching:
|
|
2110
|
+
isLoading: oe,
|
|
2111
|
+
isFetching: ce,
|
|
2112
2112
|
isSuccess: ke,
|
|
2113
|
-
isError:
|
|
2113
|
+
isError: de,
|
|
2114
2114
|
error: ve,
|
|
2115
|
-
status:
|
|
2115
|
+
status: Bs,
|
|
2116
2116
|
refetch: Te
|
|
2117
|
-
} =
|
|
2117
|
+
} = re({
|
|
2118
2118
|
queryKey: [b, v],
|
|
2119
|
-
queryFn: () =>
|
|
2119
|
+
queryFn: () => Ue(
|
|
2120
2120
|
"https://semaphor.cloud/api/v1/query",
|
|
2121
|
-
(
|
|
2121
|
+
(m == null ? void 0 : m.accessToken) || "",
|
|
2122
2122
|
{
|
|
2123
2123
|
connection_id: q,
|
|
2124
2124
|
sql: b,
|
|
2125
|
-
python: v ===
|
|
2125
|
+
python: v === Ps ? "" : v,
|
|
2126
2126
|
active_filters: B ? R : []
|
|
2127
2127
|
}
|
|
2128
2128
|
),
|
|
@@ -2134,19 +2134,19 @@ function rl() {
|
|
|
2134
2134
|
position: "top-center",
|
|
2135
2135
|
richColors: !0
|
|
2136
2136
|
}), E((Y == null ? void 0 : Y.output) || ""), Y.records.length > 0)) {
|
|
2137
|
-
const { dimensionKeys: g } =
|
|
2137
|
+
const { dimensionKeys: g } = gs(Y.records);
|
|
2138
2138
|
W(g);
|
|
2139
2139
|
}
|
|
2140
2140
|
}, [Y, _, W, E]), Z(() => {
|
|
2141
2141
|
te && (Te(), we(!1));
|
|
2142
2142
|
}, [te, Te, we]), Z(() => {
|
|
2143
|
-
(
|
|
2143
|
+
(oe || ce) && ye(!0), (de || ke) && ye(!1), de ? (w(ve.message), _([]), W([]), E("")) : w("");
|
|
2144
2144
|
}, [
|
|
2145
|
-
re,
|
|
2146
2145
|
oe,
|
|
2146
|
+
ce,
|
|
2147
2147
|
Y,
|
|
2148
2148
|
E,
|
|
2149
|
-
|
|
2149
|
+
de,
|
|
2150
2150
|
ke,
|
|
2151
2151
|
ye,
|
|
2152
2152
|
_,
|
|
@@ -2155,7 +2155,7 @@ function rl() {
|
|
|
2155
2155
|
ve
|
|
2156
2156
|
]);
|
|
2157
2157
|
function ds() {
|
|
2158
|
-
|
|
2158
|
+
P(""), _([]), ae({}), ee(""), X({});
|
|
2159
2159
|
}
|
|
2160
2160
|
const We = (g) => {
|
|
2161
2161
|
a.current = g;
|
|
@@ -2170,10 +2170,10 @@ function rl() {
|
|
|
2170
2170
|
if (ne == "All__Header")
|
|
2171
2171
|
return g[0].id;
|
|
2172
2172
|
if (ne && ne.endsWith("__Header")) {
|
|
2173
|
-
const
|
|
2174
|
-
(
|
|
2173
|
+
const Wa = ne.split("__")[0], Us = g.find(
|
|
2174
|
+
(Qa) => Qa.tabTitle === Wa
|
|
2175
2175
|
);
|
|
2176
|
-
return
|
|
2176
|
+
return Us ? Us.id : g[0].id;
|
|
2177
2177
|
}
|
|
2178
2178
|
return C;
|
|
2179
2179
|
}
|
|
@@ -2182,25 +2182,25 @@ function rl() {
|
|
|
2182
2182
|
}
|
|
2183
2183
|
function hs() {
|
|
2184
2184
|
let g = S;
|
|
2185
|
-
S && !S.includes("{{") && (g =
|
|
2185
|
+
S && !S.includes("{{") && (g = Kn(S), P(g));
|
|
2186
2186
|
const C = {
|
|
2187
|
-
...
|
|
2188
|
-
lastSelectedSchema:
|
|
2189
|
-
lastSelectedDatamodelId:
|
|
2187
|
+
...u,
|
|
2188
|
+
lastSelectedSchema: A,
|
|
2189
|
+
lastSelectedDatamodelId: M,
|
|
2190
2190
|
lastSelectedDatabase: N,
|
|
2191
2191
|
lastSelectedTable: j,
|
|
2192
2192
|
connectionId: I,
|
|
2193
|
-
type:
|
|
2193
|
+
type: D ? u.type : "table",
|
|
2194
2194
|
sql: g,
|
|
2195
|
-
customCfg:
|
|
2195
|
+
customCfg: D ? u.customCfg : null
|
|
2196
2196
|
}, ze = $.cards.map(
|
|
2197
|
-
(ms) => ms.id ===
|
|
2197
|
+
(ms) => ms.id === u.id ? C : ms
|
|
2198
2198
|
), ne = {
|
|
2199
2199
|
...$,
|
|
2200
2200
|
cards: ze,
|
|
2201
2201
|
activeCardId: us(ze, $.activeCardId)
|
|
2202
2202
|
};
|
|
2203
|
-
|
|
2203
|
+
T == null || T(ne);
|
|
2204
2204
|
}
|
|
2205
2205
|
function Qe() {
|
|
2206
2206
|
se == null || se();
|
|
@@ -2216,7 +2216,7 @@ function rl() {
|
|
|
2216
2216
|
rules: [],
|
|
2217
2217
|
colors: {
|
|
2218
2218
|
// 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
|
|
2219
|
-
"editor.background": ne === "light" ? "#ffffff" :
|
|
2219
|
+
"editor.background": ne === "light" ? "#ffffff" : gt("--semaphor-background")
|
|
2220
2220
|
}
|
|
2221
2221
|
}), g.editor.setTheme("default");
|
|
2222
2222
|
}
|
|
@@ -2233,7 +2233,7 @@ function rl() {
|
|
|
2233
2233
|
}
|
|
2234
2234
|
function Je() {
|
|
2235
2235
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2236
|
-
|
|
2236
|
+
o && /* @__PURE__ */ e.jsx(
|
|
2237
2237
|
"div",
|
|
2238
2238
|
{
|
|
2239
2239
|
className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
|
|
@@ -2249,7 +2249,7 @@ function rl() {
|
|
|
2249
2249
|
}
|
|
2250
2250
|
),
|
|
2251
2251
|
/* @__PURE__ */ e.jsx(Jn, {}),
|
|
2252
|
-
R &&
|
|
2252
|
+
R && o && /* @__PURE__ */ e.jsx(
|
|
2253
2253
|
Re,
|
|
2254
2254
|
{
|
|
2255
2255
|
onClick: () => l(!1),
|
|
@@ -2291,8 +2291,8 @@ function rl() {
|
|
|
2291
2291
|
] })
|
|
2292
2292
|
}
|
|
2293
2293
|
),
|
|
2294
|
-
R && !
|
|
2295
|
-
|
|
2294
|
+
R && !o && /* @__PURE__ */ e.jsx(
|
|
2295
|
+
ta,
|
|
2296
2296
|
{
|
|
2297
2297
|
onClick: () => l(!0),
|
|
2298
2298
|
className: J(
|
|
@@ -2307,7 +2307,7 @@ function rl() {
|
|
|
2307
2307
|
}
|
|
2308
2308
|
function Ye() {
|
|
2309
2309
|
return /* @__PURE__ */ e.jsxs(
|
|
2310
|
-
|
|
2310
|
+
js,
|
|
2311
2311
|
{
|
|
2312
2312
|
className: "flex grow pb-1",
|
|
2313
2313
|
direction: "vertical",
|
|
@@ -2332,7 +2332,7 @@ function rl() {
|
|
|
2332
2332
|
theme: "default",
|
|
2333
2333
|
className: "pt-3",
|
|
2334
2334
|
onChange: (g) => {
|
|
2335
|
-
|
|
2335
|
+
P(g);
|
|
2336
2336
|
},
|
|
2337
2337
|
value: S,
|
|
2338
2338
|
options: {
|
|
@@ -2359,7 +2359,7 @@ function rl() {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
),
|
|
2361
2361
|
t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2362
|
-
/* @__PURE__ */ e.jsx(
|
|
2362
|
+
/* @__PURE__ */ e.jsx(bs, { withHandle: !0, className: "border" }),
|
|
2363
2363
|
/* @__PURE__ */ e.jsxs(
|
|
2364
2364
|
De,
|
|
2365
2365
|
{
|
|
@@ -2381,7 +2381,7 @@ function rl() {
|
|
|
2381
2381
|
onChange: (g) => {
|
|
2382
2382
|
ie(g && g.trim() || "");
|
|
2383
2383
|
},
|
|
2384
|
-
value: v ||
|
|
2384
|
+
value: v || Ps,
|
|
2385
2385
|
options: {
|
|
2386
2386
|
minimap: {
|
|
2387
2387
|
enabled: !1
|
|
@@ -2440,7 +2440,7 @@ function rl() {
|
|
|
2440
2440
|
F,
|
|
2441
2441
|
{
|
|
2442
2442
|
title: "Shift + Enter",
|
|
2443
|
-
disabled:
|
|
2443
|
+
disabled: oe || ce,
|
|
2444
2444
|
onClick: () => {
|
|
2445
2445
|
Te();
|
|
2446
2446
|
},
|
|
@@ -2448,18 +2448,18 @@ function rl() {
|
|
|
2448
2448
|
size: "sm",
|
|
2449
2449
|
variant: "outline",
|
|
2450
2450
|
children: [
|
|
2451
|
-
|
|
2451
|
+
oe || ce ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Fn, { className: "mr-2 h-4 w-4" }),
|
|
2452
2452
|
"Run"
|
|
2453
2453
|
]
|
|
2454
2454
|
}
|
|
2455
2455
|
),
|
|
2456
|
-
|
|
2457
|
-
|
|
2456
|
+
de && /* @__PURE__ */ e.jsx(
|
|
2457
|
+
Pn,
|
|
2458
2458
|
{
|
|
2459
2459
|
error: ve.message,
|
|
2460
2460
|
setShowAIDialog: d,
|
|
2461
2461
|
setTriggerAIRun: x,
|
|
2462
|
-
setUserInputforAI:
|
|
2462
|
+
setUserInputforAI: h
|
|
2463
2463
|
}
|
|
2464
2464
|
),
|
|
2465
2465
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2476,7 +2476,7 @@ function rl() {
|
|
|
2476
2476
|
}
|
|
2477
2477
|
),
|
|
2478
2478
|
/* @__PURE__ */ e.jsx(
|
|
2479
|
-
|
|
2479
|
+
oa,
|
|
2480
2480
|
{
|
|
2481
2481
|
pressed: t,
|
|
2482
2482
|
onPressedChange: (g) => i(g),
|
|
@@ -2494,7 +2494,7 @@ function rl() {
|
|
|
2494
2494
|
userInput: p,
|
|
2495
2495
|
triggerAIRun: y,
|
|
2496
2496
|
setTriggerAIRun: x,
|
|
2497
|
-
setUserInput: (g) =>
|
|
2497
|
+
setUserInput: (g) => h(g)
|
|
2498
2498
|
}
|
|
2499
2499
|
)
|
|
2500
2500
|
] }),
|
|
@@ -2506,7 +2506,7 @@ function rl() {
|
|
|
2506
2506
|
size: "sm",
|
|
2507
2507
|
variant: "outline",
|
|
2508
2508
|
children: [
|
|
2509
|
-
/* @__PURE__ */ e.jsx(
|
|
2509
|
+
/* @__PURE__ */ e.jsx(ha, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2510
2510
|
"Accept"
|
|
2511
2511
|
]
|
|
2512
2512
|
}
|
|
@@ -2535,7 +2535,7 @@ function rl() {
|
|
|
2535
2535
|
}
|
|
2536
2536
|
function ol({ data: s }) {
|
|
2537
2537
|
var l;
|
|
2538
|
-
const [n, a] =
|
|
2538
|
+
const [n, a] = ge.useState([]), i = Object.keys(s[0]).map((r) => ({
|
|
2539
2539
|
// header: key,
|
|
2540
2540
|
accessorKey: r,
|
|
2541
2541
|
header: ({ column: d }) => {
|
|
@@ -2547,55 +2547,55 @@ function ol({ data: s }) {
|
|
|
2547
2547
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2548
2548
|
children: [
|
|
2549
2549
|
r,
|
|
2550
|
-
p === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2550
|
+
p === "asc" ? /* @__PURE__ */ e.jsx(jt, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(bt, { className: "ml-2 h-5 w-5" }) : null
|
|
2551
2551
|
]
|
|
2552
2552
|
}
|
|
2553
2553
|
) });
|
|
2554
2554
|
}
|
|
2555
|
-
})),
|
|
2555
|
+
})), o = yt({
|
|
2556
2556
|
data: s,
|
|
2557
2557
|
columns: i,
|
|
2558
|
-
getCoreRowModel:
|
|
2559
|
-
getPaginationRowModel:
|
|
2558
|
+
getCoreRowModel: wt(),
|
|
2559
|
+
getPaginationRowModel: kt(),
|
|
2560
2560
|
onSortingChange: a,
|
|
2561
|
-
getSortedRowModel:
|
|
2561
|
+
getSortedRowModel: zt(),
|
|
2562
2562
|
manualPagination: !0,
|
|
2563
2563
|
state: {
|
|
2564
2564
|
sorting: n
|
|
2565
2565
|
}
|
|
2566
2566
|
});
|
|
2567
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2568
|
-
/* @__PURE__ */ e.jsx(
|
|
2567
|
+
return /* @__PURE__ */ e.jsxs(vt, { children: [
|
|
2568
|
+
/* @__PURE__ */ e.jsx(Nt, { children: o.getHeaderGroups().map((r) => /* @__PURE__ */ e.jsx(xs, { children: r.headers.map((d) => /* @__PURE__ */ e.jsx(Ct, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ws(
|
|
2569
2569
|
d.column.columnDef.header,
|
|
2570
2570
|
d.getContext()
|
|
2571
2571
|
) }, d.id)) }, r.id)) }),
|
|
2572
|
-
/* @__PURE__ */ e.jsx(
|
|
2572
|
+
/* @__PURE__ */ e.jsx(St, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((r) => /* @__PURE__ */ e.jsx(
|
|
2573
2573
|
xs,
|
|
2574
2574
|
{
|
|
2575
2575
|
className: "whitespace-nowrap py-2",
|
|
2576
2576
|
"data-state": r.getIsSelected() && "selected",
|
|
2577
|
-
children: r.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(
|
|
2577
|
+
children: r.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Qs, { children: Ws(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2578
2578
|
},
|
|
2579
2579
|
r.id
|
|
2580
|
-
)) : /* @__PURE__ */ e.jsx(xs, { children: /* @__PURE__ */ e.jsx(
|
|
2580
|
+
)) : /* @__PURE__ */ e.jsx(xs, { children: /* @__PURE__ */ e.jsx(Qs, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2581
2581
|
] });
|
|
2582
2582
|
}
|
|
2583
2583
|
function cl({ card: s }) {
|
|
2584
|
-
var r, d, p,
|
|
2584
|
+
var r, d, p, h, y, x, m, f;
|
|
2585
2585
|
(r = s.customCardPreferences) != null && r.inputData;
|
|
2586
|
-
const { getCard: n } =
|
|
2587
|
-
if (Ie(), !((
|
|
2586
|
+
const { getCard: n } = ma(((d = s.customCardPreferences) == null ? void 0 : d.url) || ""), a = ((p = s.customCardPreferences) == null ? void 0 : p.visualType) || "single", t = c((u) => u.frame);
|
|
2587
|
+
if (Ie(), !((h = s.customCardPreferences) != null && h.componentName))
|
|
2588
2588
|
return null;
|
|
2589
2589
|
const i = n(
|
|
2590
2590
|
(y = s.customCardPreferences) == null ? void 0 : y.componentName
|
|
2591
|
-
),
|
|
2592
|
-
console.log("data",
|
|
2591
|
+
), o = (u) => {
|
|
2592
|
+
console.log("data", u), s.customCardPreferences;
|
|
2593
2593
|
}, l = Object.keys(
|
|
2594
2594
|
((x = s.customCardPreferences) == null ? void 0 : x.dataInputCardIds) || {}
|
|
2595
|
-
).map((
|
|
2596
|
-
var I, N,
|
|
2597
|
-
const k = (N = (I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) == null ? void 0 : N[
|
|
2598
|
-
return
|
|
2595
|
+
).map((u) => {
|
|
2596
|
+
var I, N, M;
|
|
2597
|
+
const k = (N = (I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) == null ? void 0 : N[u].cardId, D = (M = t == null ? void 0 : t.cards) == null ? void 0 : M.find((A) => A.id === k);
|
|
2598
|
+
return D || null;
|
|
2599
2599
|
});
|
|
2600
2600
|
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(
|
|
2601
2601
|
rn,
|
|
@@ -2605,40 +2605,40 @@ function cl({ card: s }) {
|
|
|
2605
2605
|
i && a === "single" && /* @__PURE__ */ e.jsx(
|
|
2606
2606
|
i,
|
|
2607
2607
|
{
|
|
2608
|
-
settings: (
|
|
2609
|
-
onDataChange:
|
|
2608
|
+
settings: (m = s.customCardPreferences) == null ? void 0 : m.settings,
|
|
2609
|
+
onDataChange: o,
|
|
2610
2610
|
data: s.data
|
|
2611
2611
|
}
|
|
2612
2612
|
),
|
|
2613
2613
|
i && a === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2614
2614
|
i,
|
|
2615
2615
|
{
|
|
2616
|
-
onDataChange:
|
|
2616
|
+
onDataChange: o,
|
|
2617
2617
|
settings: l.map(
|
|
2618
|
-
(
|
|
2618
|
+
(u) => {
|
|
2619
2619
|
var k;
|
|
2620
|
-
return (k =
|
|
2620
|
+
return (k = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : k.settings;
|
|
2621
2621
|
}
|
|
2622
2622
|
),
|
|
2623
|
-
data: l.map((
|
|
2623
|
+
data: l.map((u) => (u == null ? void 0 : u.data) || [])
|
|
2624
2624
|
}
|
|
2625
2625
|
) })
|
|
2626
2626
|
]
|
|
2627
2627
|
},
|
|
2628
|
-
(
|
|
2628
|
+
(f = s.customCardPreferences) == null ? void 0 : f.componentName
|
|
2629
2629
|
) });
|
|
2630
2630
|
}
|
|
2631
|
-
function
|
|
2631
|
+
function Ea({
|
|
2632
2632
|
// card,
|
|
2633
2633
|
// showCard,
|
|
2634
2634
|
className: s,
|
|
2635
2635
|
...n
|
|
2636
2636
|
}) {
|
|
2637
2637
|
var y;
|
|
2638
|
-
|
|
2639
|
-
const a = z((x) => x.themeStyle), t =
|
|
2640
|
-
z((x) => x.filterValues),
|
|
2641
|
-
const { updateFilter: l } =
|
|
2638
|
+
ge.useState(0);
|
|
2639
|
+
const a = z((x) => x.themeStyle), t = c((x) => x.card), i = c((x) => x.frame), o = z((x) => x.dashboard.filters);
|
|
2640
|
+
z((x) => x.filterValues), c((x) => x.actions.setRunSql);
|
|
2641
|
+
const { updateFilter: l } = Cs(), r = o == null ? void 0 : o.find((x) => x.id === i.filterId), d = c((x) => x.actions.setCard);
|
|
2642
2642
|
if (Z(() => {
|
|
2643
2643
|
}, [
|
|
2644
2644
|
t.data,
|
|
@@ -2650,31 +2650,31 @@ function qa({
|
|
|
2650
2650
|
]), !t.id)
|
|
2651
2651
|
return null;
|
|
2652
2652
|
let p;
|
|
2653
|
-
t.data && t.data.length > 0 && (p =
|
|
2653
|
+
t.data && t.data.length > 0 && (p = xa({
|
|
2654
2654
|
data: t.data,
|
|
2655
2655
|
cardType: t.type,
|
|
2656
2656
|
cfg: t.cfg,
|
|
2657
2657
|
customCfg: t.customCfg,
|
|
2658
2658
|
preferences: t.preferences
|
|
2659
2659
|
}));
|
|
2660
|
-
function
|
|
2660
|
+
function h(x) {
|
|
2661
2661
|
return /* @__PURE__ */ e.jsx(cl, { card: x });
|
|
2662
2662
|
}
|
|
2663
2663
|
return /* @__PURE__ */ e.jsxs(
|
|
2664
|
-
|
|
2664
|
+
Ft,
|
|
2665
2665
|
{
|
|
2666
2666
|
role: "editor-visual-card",
|
|
2667
2667
|
className: J("relative flex h-full flex-col rounded-none", s),
|
|
2668
2668
|
...n,
|
|
2669
2669
|
children: [
|
|
2670
|
-
/* @__PURE__ */ e.jsxs(
|
|
2670
|
+
/* @__PURE__ */ e.jsxs(Lt, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2671
2671
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2672
2672
|
/* @__PURE__ */ e.jsx(
|
|
2673
2673
|
es,
|
|
2674
2674
|
{
|
|
2675
2675
|
text: t.title,
|
|
2676
2676
|
onSave: (x) => d({ ...t, title: x }),
|
|
2677
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2677
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Tt, { className: "text-base", children: t.title }) })
|
|
2678
2678
|
},
|
|
2679
2679
|
t.title
|
|
2680
2680
|
),
|
|
@@ -2683,7 +2683,7 @@ function qa({
|
|
|
2683
2683
|
{
|
|
2684
2684
|
text: t.description || "",
|
|
2685
2685
|
onSave: (x) => d({ ...t, description: x }),
|
|
2686
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2686
|
+
children: /* @__PURE__ */ e.jsxs(Dt, { children: [
|
|
2687
2687
|
" ",
|
|
2688
2688
|
t.description
|
|
2689
2689
|
] })
|
|
@@ -2701,33 +2701,33 @@ function qa({
|
|
|
2701
2701
|
children: /* @__PURE__ */ e.jsx(H, { children: r.title })
|
|
2702
2702
|
}
|
|
2703
2703
|
),
|
|
2704
|
-
|
|
2704
|
+
It(r)
|
|
2705
2705
|
] })
|
|
2706
2706
|
] }),
|
|
2707
|
-
/* @__PURE__ */ e.jsxs(
|
|
2708
|
-
t.type === "custom" &&
|
|
2707
|
+
/* @__PURE__ */ e.jsxs(Mt, { className: "flex grow flex-col", children: [
|
|
2708
|
+
t.type === "custom" && h(t),
|
|
2709
2709
|
!["table", "custom"].includes(t.type) && p && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2710
2710
|
/* @__PURE__ */ e.jsx(
|
|
2711
|
-
|
|
2711
|
+
Ot,
|
|
2712
2712
|
{
|
|
2713
2713
|
cfg: p
|
|
2714
2714
|
},
|
|
2715
2715
|
JSON.stringify(p) + JSON.stringify(t.preferences) + ((y = t == null ? void 0 : t.preferences) == null ? void 0 : y.customVisualCode)
|
|
2716
2716
|
),
|
|
2717
2717
|
t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2718
|
-
/* @__PURE__ */ e.jsx(
|
|
2718
|
+
/* @__PURE__ */ e.jsx(At, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Et, { card: t, data: t == null ? void 0 : t.data }) })
|
|
2719
2719
|
] })
|
|
2720
2720
|
]
|
|
2721
2721
|
}
|
|
2722
2722
|
);
|
|
2723
2723
|
}
|
|
2724
2724
|
function dl() {
|
|
2725
|
-
const [s, n] = V(!1), [a, t] = V(""), [i,
|
|
2725
|
+
const [s, n] = V(!1), [a, t] = V(""), [i, o] = V(""), [l, r] = V(""), [d, p] = V(""), h = c((N) => N.card), y = c(
|
|
2726
2726
|
(N) => N.card.customCfg
|
|
2727
|
-
), { setCardCustomCfg: x, setCustomVisualCode:
|
|
2728
|
-
function
|
|
2727
|
+
), { setCardCustomCfg: x, setCustomVisualCode: m } = Ie();
|
|
2728
|
+
function f(N) {
|
|
2729
2729
|
var j, S;
|
|
2730
|
-
const
|
|
2730
|
+
const M = {
|
|
2731
2731
|
...N,
|
|
2732
2732
|
data: {
|
|
2733
2733
|
...N == null ? void 0 : N.data,
|
|
@@ -2737,73 +2737,73 @@ function dl() {
|
|
|
2737
2737
|
}))
|
|
2738
2738
|
}
|
|
2739
2739
|
};
|
|
2740
|
-
return JSON.stringify(
|
|
2740
|
+
return JSON.stringify(M, null, 1);
|
|
2741
2741
|
}
|
|
2742
|
-
function
|
|
2743
|
-
var
|
|
2744
|
-
if (!
|
|
2742
|
+
function u() {
|
|
2743
|
+
var M, A;
|
|
2744
|
+
if (!h.data || h.data.length === 0)
|
|
2745
2745
|
return;
|
|
2746
|
-
const N =
|
|
2747
|
-
data:
|
|
2748
|
-
cardType:
|
|
2749
|
-
cfg:
|
|
2750
|
-
preferences:
|
|
2746
|
+
const N = xa({
|
|
2747
|
+
data: h.data,
|
|
2748
|
+
cardType: h.type,
|
|
2749
|
+
cfg: h.cfg,
|
|
2750
|
+
preferences: h.preferences
|
|
2751
2751
|
});
|
|
2752
|
-
N && (t(JSON.stringify(N, null, 1)), (
|
|
2752
|
+
N && (t(JSON.stringify(N, null, 1)), (M = h == null ? void 0 : h.preferences) != null && M.customVisualCode && r((A = h == null ? void 0 : h.preferences) == null ? void 0 : A.customVisualCode), y && o(JSON.stringify(y, null, 1)));
|
|
2753
2753
|
}
|
|
2754
2754
|
function k() {
|
|
2755
|
-
if (l &&
|
|
2755
|
+
if (l && m(l), !!i)
|
|
2756
2756
|
try {
|
|
2757
2757
|
const N = JSON.parse(i);
|
|
2758
|
-
return N ? (x(N), p(""),
|
|
2758
|
+
return N ? (x(N), p(""), o(""), N) : void 0;
|
|
2759
2759
|
} catch (N) {
|
|
2760
2760
|
console.log(N), p("Invalid JSON");
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
|
-
function
|
|
2764
|
-
|
|
2763
|
+
function D() {
|
|
2764
|
+
o(""), x(null);
|
|
2765
2765
|
}
|
|
2766
2766
|
function I() {
|
|
2767
2767
|
let N;
|
|
2768
2768
|
if (y) {
|
|
2769
|
-
const
|
|
2770
|
-
return N =
|
|
2769
|
+
const M = Js.cloneDeep(h.cfg), A = Js.merge(M, y);
|
|
2770
|
+
return N = f(A), N;
|
|
2771
2771
|
}
|
|
2772
|
-
return a ? (N =
|
|
2772
|
+
return a ? (N = f(JSON.parse(a)), N) : "";
|
|
2773
2773
|
}
|
|
2774
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2775
|
-
/* @__PURE__ */ e.jsx(
|
|
2774
|
+
return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange: n, children: [
|
|
2775
|
+
/* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2776
2776
|
F,
|
|
2777
2777
|
{
|
|
2778
|
-
onClick:
|
|
2778
|
+
onClick: u,
|
|
2779
2779
|
className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2780
2780
|
size: "sm",
|
|
2781
2781
|
variant: "outline",
|
|
2782
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2782
|
+
children: /* @__PURE__ */ e.jsx(Vt, { className: "h-4 w-4" })
|
|
2783
2783
|
}
|
|
2784
2784
|
) }),
|
|
2785
2785
|
/* @__PURE__ */ e.jsxs(
|
|
2786
|
-
|
|
2786
|
+
zs,
|
|
2787
2787
|
{
|
|
2788
2788
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2789
2789
|
children: [
|
|
2790
|
-
/* @__PURE__ */ e.jsxs(
|
|
2790
|
+
/* @__PURE__ */ e.jsxs(Fs, { className: "", children: [
|
|
2791
2791
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2792
|
-
/* @__PURE__ */ e.jsx(
|
|
2793
|
-
/* @__PURE__ */ e.jsxs(
|
|
2794
|
-
/* @__PURE__ */ e.jsx(
|
|
2792
|
+
/* @__PURE__ */ e.jsx(Ls, { children: "Customize Card" }),
|
|
2793
|
+
/* @__PURE__ */ e.jsxs(Ds, { children: [
|
|
2794
|
+
/* @__PURE__ */ e.jsx(na, { children: /* @__PURE__ */ e.jsx(
|
|
2795
2795
|
Nn,
|
|
2796
2796
|
{
|
|
2797
2797
|
onClick: () => {
|
|
2798
|
-
navigator.clipboard.writeText(
|
|
2798
|
+
navigator.clipboard.writeText(h.id);
|
|
2799
2799
|
},
|
|
2800
2800
|
className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
|
|
2801
2801
|
}
|
|
2802
2802
|
) }),
|
|
2803
|
-
/* @__PURE__ */ e.jsx(
|
|
2803
|
+
/* @__PURE__ */ e.jsx(Is, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
|
|
2804
2804
|
] })
|
|
2805
2805
|
] }),
|
|
2806
|
-
/* @__PURE__ */ e.jsxs(
|
|
2806
|
+
/* @__PURE__ */ e.jsxs(Ts, { children: [
|
|
2807
2807
|
"See the configuration options and documentation",
|
|
2808
2808
|
/* @__PURE__ */ e.jsx(
|
|
2809
2809
|
"a",
|
|
@@ -2817,11 +2817,11 @@ function dl() {
|
|
|
2817
2817
|
] })
|
|
2818
2818
|
] }),
|
|
2819
2819
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2820
|
-
/* @__PURE__ */ e.jsx(
|
|
2821
|
-
/* @__PURE__ */ e.jsxs(
|
|
2822
|
-
/* @__PURE__ */ e.jsxs(
|
|
2820
|
+
/* @__PURE__ */ e.jsx(Ea, { className: "w-1/2 rounded shadow-none" }),
|
|
2821
|
+
/* @__PURE__ */ e.jsxs(pa, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2822
|
+
/* @__PURE__ */ e.jsxs(fa, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2823
2823
|
/* @__PURE__ */ e.jsxs(ss, { value: "custom-config", children: [
|
|
2824
|
-
y && /* @__PURE__ */ e.jsx(
|
|
2824
|
+
y && /* @__PURE__ */ e.jsx(ga, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2825
2825
|
y ? "Custom Config" : "Default Config"
|
|
2826
2826
|
] }),
|
|
2827
2827
|
/* @__PURE__ */ e.jsx(ss, { className: "", value: "output", children: "Output" }),
|
|
@@ -2833,7 +2833,7 @@ function dl() {
|
|
|
2833
2833
|
className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
|
|
2834
2834
|
value: "output",
|
|
2835
2835
|
children: /* @__PURE__ */ e.jsx(
|
|
2836
|
-
|
|
2836
|
+
ua,
|
|
2837
2837
|
{
|
|
2838
2838
|
disabled: !0,
|
|
2839
2839
|
value: a,
|
|
@@ -2866,7 +2866,7 @@ function dl() {
|
|
|
2866
2866
|
},
|
|
2867
2867
|
defaultLanguage: "json",
|
|
2868
2868
|
value: I(),
|
|
2869
|
-
onChange: (N) =>
|
|
2869
|
+
onChange: (N) => o(N)
|
|
2870
2870
|
}
|
|
2871
2871
|
)
|
|
2872
2872
|
}
|
|
@@ -2902,13 +2902,13 @@ function dl() {
|
|
|
2902
2902
|
)
|
|
2903
2903
|
] })
|
|
2904
2904
|
] }),
|
|
2905
|
-
/* @__PURE__ */ e.jsxs(
|
|
2905
|
+
/* @__PURE__ */ e.jsxs(aa, { className: "flex items-center", children: [
|
|
2906
2906
|
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: d }),
|
|
2907
2907
|
/* @__PURE__ */ e.jsx(
|
|
2908
2908
|
F,
|
|
2909
2909
|
{
|
|
2910
2910
|
disabled: !y,
|
|
2911
|
-
onClick:
|
|
2911
|
+
onClick: D,
|
|
2912
2912
|
variant: "outline",
|
|
2913
2913
|
children: "Reset"
|
|
2914
2914
|
}
|
|
@@ -2921,47 +2921,47 @@ function dl() {
|
|
|
2921
2921
|
)
|
|
2922
2922
|
] });
|
|
2923
2923
|
}
|
|
2924
|
-
function
|
|
2924
|
+
function Va(s) {
|
|
2925
2925
|
return be({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2926
2926
|
}
|
|
2927
|
-
function
|
|
2927
|
+
function qa(s) {
|
|
2928
2928
|
return be({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
|
|
2929
2929
|
}
|
|
2930
|
-
function
|
|
2930
|
+
function Ra(s) {
|
|
2931
2931
|
return be({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2932
2932
|
}
|
|
2933
|
-
function
|
|
2933
|
+
function _a(s) {
|
|
2934
2934
|
return be({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2935
2935
|
}
|
|
2936
|
-
function
|
|
2936
|
+
function Ha(s) {
|
|
2937
2937
|
return be({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
2938
2938
|
}
|
|
2939
|
-
function
|
|
2939
|
+
function $a(s) {
|
|
2940
2940
|
return be({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
|
|
2941
2941
|
}
|
|
2942
|
-
function
|
|
2942
|
+
function Ba(s) {
|
|
2943
2943
|
return be({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
|
|
2944
2944
|
}
|
|
2945
|
-
function
|
|
2945
|
+
function Ua(s) {
|
|
2946
2946
|
return be({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
|
|
2947
2947
|
}
|
|
2948
2948
|
function ul() {
|
|
2949
|
-
const [s, n] = V(!1), a =
|
|
2949
|
+
const [s, n] = V(!1), a = c((d) => d.card.type), { setCardType: t, setCardPreferences: i, setChartOrientation: o } = c((d) => d.actions), l = c(
|
|
2950
2950
|
(d) => d.actions.setCardCustomCfg
|
|
2951
2951
|
);
|
|
2952
2952
|
function r(d) {
|
|
2953
2953
|
l(null), i({}), t(d), n(!1);
|
|
2954
2954
|
}
|
|
2955
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2956
|
-
/* @__PURE__ */ e.jsx(
|
|
2957
|
-
/* @__PURE__ */ e.jsx(
|
|
2955
|
+
return /* @__PURE__ */ e.jsxs(Ge, { open: s, onOpenChange: n, children: [
|
|
2956
|
+
/* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(hl, { className: "h-4 w-4", chartType: a }) }) }),
|
|
2957
|
+
/* @__PURE__ */ e.jsx(Pe, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2958
2958
|
/* @__PURE__ */ e.jsx(
|
|
2959
2959
|
F,
|
|
2960
2960
|
{
|
|
2961
2961
|
onClick: () => r("bar"),
|
|
2962
2962
|
className: "font-normal",
|
|
2963
2963
|
variant: "ghost",
|
|
2964
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2964
|
+
children: /* @__PURE__ */ e.jsx(Rs, { className: "size-5" })
|
|
2965
2965
|
}
|
|
2966
2966
|
),
|
|
2967
2967
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2969,7 +2969,7 @@ function ul() {
|
|
|
2969
2969
|
{
|
|
2970
2970
|
onClick: () => r("line"),
|
|
2971
2971
|
variant: "ghost",
|
|
2972
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2972
|
+
children: /* @__PURE__ */ e.jsx(_s, { className: "size-5" })
|
|
2973
2973
|
}
|
|
2974
2974
|
),
|
|
2975
2975
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2977,7 +2977,7 @@ function ul() {
|
|
|
2977
2977
|
{
|
|
2978
2978
|
onClick: () => r("stackedBar"),
|
|
2979
2979
|
variant: "ghost",
|
|
2980
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2980
|
+
children: /* @__PURE__ */ e.jsx($a, { className: "size-5", strokeWidth: 0 })
|
|
2981
2981
|
}
|
|
2982
2982
|
),
|
|
2983
2983
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2985,7 +2985,7 @@ function ul() {
|
|
|
2985
2985
|
{
|
|
2986
2986
|
onClick: () => r("stackedLine"),
|
|
2987
2987
|
variant: "ghost",
|
|
2988
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2988
|
+
children: /* @__PURE__ */ e.jsx(Ha, { className: "size-5", strokeWidth: 0 })
|
|
2989
2989
|
}
|
|
2990
2990
|
),
|
|
2991
2991
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2993,7 +2993,7 @@ function ul() {
|
|
|
2993
2993
|
{
|
|
2994
2994
|
onClick: () => r("scatter"),
|
|
2995
2995
|
variant: "ghost",
|
|
2996
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2996
|
+
children: /* @__PURE__ */ e.jsx(Fa, { className: "size-5" })
|
|
2997
2997
|
}
|
|
2998
2998
|
),
|
|
2999
2999
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3001,7 +3001,7 @@ function ul() {
|
|
|
3001
3001
|
{
|
|
3002
3002
|
onClick: () => r("bubble"),
|
|
3003
3003
|
variant: "ghost",
|
|
3004
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3004
|
+
children: /* @__PURE__ */ e.jsx(_a, { className: "size-4" })
|
|
3005
3005
|
}
|
|
3006
3006
|
),
|
|
3007
3007
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3009,7 +3009,7 @@ function ul() {
|
|
|
3009
3009
|
{
|
|
3010
3010
|
onClick: () => r("pie"),
|
|
3011
3011
|
variant: "ghost",
|
|
3012
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3012
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "size-5" })
|
|
3013
3013
|
}
|
|
3014
3014
|
),
|
|
3015
3015
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3017,7 +3017,7 @@ function ul() {
|
|
|
3017
3017
|
{
|
|
3018
3018
|
onClick: () => r("doughnut"),
|
|
3019
3019
|
variant: "ghost",
|
|
3020
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3020
|
+
children: /* @__PURE__ */ e.jsx(qa, { className: "size-5", strokeWidth: 1 })
|
|
3021
3021
|
}
|
|
3022
3022
|
),
|
|
3023
3023
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3026,7 +3026,7 @@ function ul() {
|
|
|
3026
3026
|
onClick: () => r("radar"),
|
|
3027
3027
|
variant: "ghost",
|
|
3028
3028
|
children: /* @__PURE__ */ e.jsx(
|
|
3029
|
-
|
|
3029
|
+
Va,
|
|
3030
3030
|
{
|
|
3031
3031
|
className: "size-5 font-extralight",
|
|
3032
3032
|
strokeWidth: 0.5
|
|
@@ -3039,7 +3039,7 @@ function ul() {
|
|
|
3039
3039
|
{
|
|
3040
3040
|
onClick: () => r("polarArea"),
|
|
3041
3041
|
variant: "ghost",
|
|
3042
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3042
|
+
children: /* @__PURE__ */ e.jsx(Ra, { className: "size-5" })
|
|
3043
3043
|
}
|
|
3044
3044
|
),
|
|
3045
3045
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3047,7 +3047,7 @@ function ul() {
|
|
|
3047
3047
|
{
|
|
3048
3048
|
onClick: () => r("pyramid"),
|
|
3049
3049
|
variant: "ghost",
|
|
3050
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3050
|
+
children: /* @__PURE__ */ e.jsx(Ua, { className: "size-5" })
|
|
3051
3051
|
}
|
|
3052
3052
|
),
|
|
3053
3053
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3055,7 +3055,7 @@ function ul() {
|
|
|
3055
3055
|
{
|
|
3056
3056
|
onClick: () => r("range"),
|
|
3057
3057
|
variant: "ghost",
|
|
3058
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3058
|
+
children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
|
|
3059
3059
|
}
|
|
3060
3060
|
),
|
|
3061
3061
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3063,7 +3063,7 @@ function ul() {
|
|
|
3063
3063
|
{
|
|
3064
3064
|
onClick: () => r("table"),
|
|
3065
3065
|
variant: "ghost",
|
|
3066
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3066
|
+
children: /* @__PURE__ */ e.jsx(Ms, { className: "size-5" })
|
|
3067
3067
|
}
|
|
3068
3068
|
),
|
|
3069
3069
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3071,7 +3071,7 @@ function ul() {
|
|
|
3071
3071
|
{
|
|
3072
3072
|
onClick: () => r("kpi"),
|
|
3073
3073
|
variant: "ghost",
|
|
3074
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3074
|
+
children: /* @__PURE__ */ e.jsx(Ba, { className: "size-6" })
|
|
3075
3075
|
}
|
|
3076
3076
|
),
|
|
3077
3077
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3079,7 +3079,7 @@ function ul() {
|
|
|
3079
3079
|
{
|
|
3080
3080
|
onClick: () => r("text"),
|
|
3081
3081
|
variant: "ghost",
|
|
3082
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3082
|
+
children: /* @__PURE__ */ e.jsx(Hs, { className: "size-4" })
|
|
3083
3083
|
}
|
|
3084
3084
|
),
|
|
3085
3085
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3087,7 +3087,7 @@ function ul() {
|
|
|
3087
3087
|
{
|
|
3088
3088
|
onClick: () => r("custom"),
|
|
3089
3089
|
variant: "ghost",
|
|
3090
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3090
|
+
children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
|
|
3091
3091
|
}
|
|
3092
3092
|
)
|
|
3093
3093
|
] }) })
|
|
@@ -3096,43 +3096,43 @@ function ul() {
|
|
|
3096
3096
|
function hl({ chartType: s, className: n }) {
|
|
3097
3097
|
switch (s) {
|
|
3098
3098
|
case "bar":
|
|
3099
|
-
return /* @__PURE__ */ e.jsx(qs, { className: n });
|
|
3100
|
-
case "line":
|
|
3101
3099
|
return /* @__PURE__ */ e.jsx(Rs, { className: n });
|
|
3100
|
+
case "line":
|
|
3101
|
+
return /* @__PURE__ */ e.jsx(_s, { className: n });
|
|
3102
3102
|
case "pie":
|
|
3103
|
-
return /* @__PURE__ */ e.jsx(
|
|
3103
|
+
return /* @__PURE__ */ e.jsx(za, { className: n });
|
|
3104
3104
|
case "radar":
|
|
3105
|
-
return /* @__PURE__ */ e.jsx(
|
|
3105
|
+
return /* @__PURE__ */ e.jsx(Va, { className: n });
|
|
3106
3106
|
case "scatter":
|
|
3107
|
-
return /* @__PURE__ */ e.jsx(
|
|
3107
|
+
return /* @__PURE__ */ e.jsx(Fa, { className: n });
|
|
3108
3108
|
case "bubble":
|
|
3109
|
-
return /* @__PURE__ */ e.jsx($a, { className: n });
|
|
3110
|
-
case "doughnut":
|
|
3111
3109
|
return /* @__PURE__ */ e.jsx(_a, { className: n });
|
|
3110
|
+
case "doughnut":
|
|
3111
|
+
return /* @__PURE__ */ e.jsx(qa, { className: n });
|
|
3112
3112
|
case "stackedBar":
|
|
3113
|
-
return /* @__PURE__ */ e.jsx(
|
|
3113
|
+
return /* @__PURE__ */ e.jsx($a, { className: "size-4 text-foreground/70" });
|
|
3114
3114
|
case "stackedLine":
|
|
3115
|
-
return /* @__PURE__ */ e.jsx(
|
|
3115
|
+
return /* @__PURE__ */ e.jsx(Ha, { className: "size-4 text-foreground/70" });
|
|
3116
3116
|
case "polarArea":
|
|
3117
|
-
return /* @__PURE__ */ e.jsx(
|
|
3117
|
+
return /* @__PURE__ */ e.jsx(Ra, { className: n });
|
|
3118
3118
|
case "pyramid":
|
|
3119
|
-
return /* @__PURE__ */ e.jsx(
|
|
3119
|
+
return /* @__PURE__ */ e.jsx(Ua, { className: n });
|
|
3120
3120
|
case "range":
|
|
3121
|
-
return /* @__PURE__ */ e.jsx(
|
|
3121
|
+
return /* @__PURE__ */ e.jsx(ka, { className: n });
|
|
3122
3122
|
case "kpi":
|
|
3123
|
-
return /* @__PURE__ */ e.jsx(
|
|
3123
|
+
return /* @__PURE__ */ e.jsx(Ba, { className: n });
|
|
3124
3124
|
case "text":
|
|
3125
|
-
return /* @__PURE__ */ e.jsx(
|
|
3125
|
+
return /* @__PURE__ */ e.jsx(Hs, { className: n });
|
|
3126
3126
|
case "custom":
|
|
3127
|
-
return /* @__PURE__ */ e.jsx(
|
|
3127
|
+
return /* @__PURE__ */ e.jsx(Ta, { className: n });
|
|
3128
3128
|
default:
|
|
3129
|
-
return /* @__PURE__ */ e.jsx(
|
|
3129
|
+
return /* @__PURE__ */ e.jsx(Ms, { className: n });
|
|
3130
3130
|
}
|
|
3131
3131
|
}
|
|
3132
3132
|
function ea() {
|
|
3133
|
-
const s =
|
|
3134
|
-
|
|
3135
|
-
const { setFrame: d, setCard: p, updateCardInFrame:
|
|
3133
|
+
const s = c((j) => j.frame), n = c((j) => j.card), a = c((j) => j.card.data), t = c((j) => j.isShowingVisual), i = c((j) => j.isSqlRunning), o = c((j) => j.queryError), l = c((j) => j.pythonStdOut), r = c((j) => j.actions.setRunSql);
|
|
3134
|
+
c((j) => j.onSave), c((j) => j.onClose), c((j) => j.actions.setCardSql), c((j) => j.actions.setCardType), c((j) => j.actions.setSqlGen);
|
|
3135
|
+
const { setFrame: d, setCard: p, updateCardInFrame: h } = Ie();
|
|
3136
3136
|
if (!n)
|
|
3137
3137
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3138
3138
|
function y() {
|
|
@@ -3162,7 +3162,7 @@ function ea() {
|
|
|
3162
3162
|
};
|
|
3163
3163
|
d(S), p(j);
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function m() {
|
|
3166
3166
|
const j = {
|
|
3167
3167
|
...n,
|
|
3168
3168
|
id: _e(),
|
|
@@ -3171,7 +3171,7 @@ function ea() {
|
|
|
3171
3171
|
};
|
|
3172
3172
|
x(j);
|
|
3173
3173
|
}
|
|
3174
|
-
function
|
|
3174
|
+
function f(j) {
|
|
3175
3175
|
const S = s.cards.filter((q) => q.id !== j), v = S[0], b = {
|
|
3176
3176
|
...s,
|
|
3177
3177
|
cards: S,
|
|
@@ -3180,7 +3180,7 @@ function ea() {
|
|
|
3180
3180
|
};
|
|
3181
3181
|
d(b), p(v);
|
|
3182
3182
|
}
|
|
3183
|
-
function
|
|
3183
|
+
function u(j) {
|
|
3184
3184
|
const S = {
|
|
3185
3185
|
...s,
|
|
3186
3186
|
cards: s.cards.map((b) => b.id === n.id ? n : b),
|
|
@@ -3192,7 +3192,7 @@ function ea() {
|
|
|
3192
3192
|
}
|
|
3193
3193
|
const k = (j, S) => {
|
|
3194
3194
|
console.log("handleDragStart", S), j.dataTransfer.setData("tabIndex", S.toString());
|
|
3195
|
-
},
|
|
3195
|
+
}, D = (j) => {
|
|
3196
3196
|
j.preventDefault();
|
|
3197
3197
|
}, I = (j, S) => {
|
|
3198
3198
|
const v = j.dataTransfer.getData("tabIndex");
|
|
@@ -3207,7 +3207,7 @@ function ea() {
|
|
|
3207
3207
|
{
|
|
3208
3208
|
onClick: () => {
|
|
3209
3209
|
const v = S.displayTab === void 0 ? !1 : !S.displayTab;
|
|
3210
|
-
p({ ...S, displayTab: v }),
|
|
3210
|
+
p({ ...S, displayTab: v }), h({
|
|
3211
3211
|
...S,
|
|
3212
3212
|
displayTab: v
|
|
3213
3213
|
});
|
|
@@ -3216,29 +3216,29 @@ function ea() {
|
|
|
3216
3216
|
}
|
|
3217
3217
|
);
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3219
|
+
function M() {
|
|
3220
3220
|
return /* @__PURE__ */ e.jsxs(
|
|
3221
|
-
|
|
3221
|
+
pa,
|
|
3222
3222
|
{
|
|
3223
|
-
onValueChange:
|
|
3223
|
+
onValueChange: u,
|
|
3224
3224
|
value: s.activeCardId,
|
|
3225
3225
|
className: "flex grow flex-col",
|
|
3226
3226
|
children: [
|
|
3227
|
-
s.cards.map((j) => /* @__PURE__ */ e.jsx(as, { className: "mt-0 grow", value: j.id, children:
|
|
3228
|
-
/* @__PURE__ */ e.jsx(
|
|
3227
|
+
s.cards.map((j) => /* @__PURE__ */ e.jsx(as, { className: "mt-0 grow", value: j.id, children: A() }, j.id)),
|
|
3228
|
+
/* @__PURE__ */ e.jsx(fa, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
3229
3229
|
s.cards.map((j, S) => /* @__PURE__ */ e.jsx(
|
|
3230
3230
|
es,
|
|
3231
3231
|
{
|
|
3232
3232
|
text: j.tabTitle || j.title,
|
|
3233
3233
|
onSave: (v) => {
|
|
3234
|
-
p({ ...n, tabTitle: v }),
|
|
3234
|
+
p({ ...n, tabTitle: v }), h({ ...n, tabTitle: v });
|
|
3235
3235
|
},
|
|
3236
3236
|
children: /* @__PURE__ */ e.jsxs(
|
|
3237
3237
|
ss,
|
|
3238
3238
|
{
|
|
3239
3239
|
draggable: !0,
|
|
3240
3240
|
onDragStart: (v) => k(v, S),
|
|
3241
|
-
onDragOver:
|
|
3241
|
+
onDragOver: D,
|
|
3242
3242
|
onDrop: (v) => I(v, S),
|
|
3243
3243
|
className: "",
|
|
3244
3244
|
value: j.id,
|
|
@@ -3246,10 +3246,10 @@ function ea() {
|
|
|
3246
3246
|
N(s, j),
|
|
3247
3247
|
j.tabTitle || j.title,
|
|
3248
3248
|
s.activeCardId === j.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
|
|
3249
|
-
|
|
3249
|
+
ja,
|
|
3250
3250
|
{
|
|
3251
3251
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3252
|
-
onClick: () =>
|
|
3252
|
+
onClick: () => f(j.id)
|
|
3253
3253
|
}
|
|
3254
3254
|
)
|
|
3255
3255
|
]
|
|
@@ -3264,7 +3264,7 @@ function ea() {
|
|
|
3264
3264
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3265
3265
|
variant: "outline",
|
|
3266
3266
|
onClick: y,
|
|
3267
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3267
|
+
children: /* @__PURE__ */ e.jsx(ks, { className: "h-4 w-4" })
|
|
3268
3268
|
}
|
|
3269
3269
|
),
|
|
3270
3270
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3272,7 +3272,7 @@ function ea() {
|
|
|
3272
3272
|
{
|
|
3273
3273
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3274
3274
|
variant: "outline",
|
|
3275
|
-
onClick:
|
|
3275
|
+
onClick: m,
|
|
3276
3276
|
children: /* @__PURE__ */ e.jsx(hn, { className: "h-4 w-4" })
|
|
3277
3277
|
}
|
|
3278
3278
|
)
|
|
@@ -3281,8 +3281,8 @@ function ea() {
|
|
|
3281
3281
|
}
|
|
3282
3282
|
);
|
|
3283
3283
|
}
|
|
3284
|
-
function
|
|
3285
|
-
return n.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(
|
|
3284
|
+
function A() {
|
|
3285
|
+
return n.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(qt, { isLoading: i, card: n }) }) }) : n.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(Rt, { isLoading: i, card: n }) }) }) : /* @__PURE__ */ e.jsx(Ea, { className: "grow border-none shadow-none" });
|
|
3286
3286
|
}
|
|
3287
3287
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3288
3288
|
i && /* @__PURE__ */ e.jsx(Be, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
@@ -3293,15 +3293,15 @@ function ea() {
|
|
|
3293
3293
|
] }),
|
|
3294
3294
|
/* @__PURE__ */ e.jsx(xl, {})
|
|
3295
3295
|
] }),
|
|
3296
|
-
t ?
|
|
3296
|
+
t ? M() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
3297
3297
|
l && /* @__PURE__ */ e.jsx(ml, {}),
|
|
3298
3298
|
n.data && n.data.length > 0 && /* @__PURE__ */ e.jsx(ol, { data: a || [] }),
|
|
3299
|
-
|
|
3299
|
+
o && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: o })
|
|
3300
3300
|
] })
|
|
3301
3301
|
] });
|
|
3302
3302
|
}
|
|
3303
3303
|
function ml() {
|
|
3304
|
-
const s =
|
|
3304
|
+
const s = c((a) => a.pythonStdOut);
|
|
3305
3305
|
if (!s)
|
|
3306
3306
|
return null;
|
|
3307
3307
|
const n = s.replace(/\n/g, "<br>");
|
|
@@ -3318,13 +3318,13 @@ function ml() {
|
|
|
3318
3318
|
] });
|
|
3319
3319
|
}
|
|
3320
3320
|
function xl() {
|
|
3321
|
-
const s =
|
|
3321
|
+
const s = c((a) => a.isShowingVisual), n = c(
|
|
3322
3322
|
(a) => a.actions.setIsShowingVisual
|
|
3323
3323
|
);
|
|
3324
3324
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3325
3325
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
|
|
3326
3326
|
/* @__PURE__ */ e.jsx(
|
|
3327
|
-
|
|
3327
|
+
_t,
|
|
3328
3328
|
{
|
|
3329
3329
|
checked: s,
|
|
3330
3330
|
onCheckedChange: () => n(!s),
|
|
@@ -3339,10 +3339,10 @@ function pl({
|
|
|
3339
3339
|
onValueChange: n,
|
|
3340
3340
|
components: a
|
|
3341
3341
|
}) {
|
|
3342
|
-
var
|
|
3343
|
-
const [t, i] =
|
|
3344
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3345
|
-
/* @__PURE__ */ e.jsx(
|
|
3342
|
+
var o;
|
|
3343
|
+
const [t, i] = ys.useState(!1);
|
|
3344
|
+
return /* @__PURE__ */ e.jsxs(Ge, { open: t, onOpenChange: i, children: [
|
|
3345
|
+
/* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3346
3346
|
F,
|
|
3347
3347
|
{
|
|
3348
3348
|
variant: "outline",
|
|
@@ -3350,17 +3350,17 @@ function pl({
|
|
|
3350
3350
|
"aria-expanded": t,
|
|
3351
3351
|
className: "h-8 w-full justify-between",
|
|
3352
3352
|
children: [
|
|
3353
|
-
s ? (
|
|
3353
|
+
s ? (o = a.find((l) => l.value === s)) == null ? void 0 : o.label : "Select Component...",
|
|
3354
3354
|
/* @__PURE__ */ e.jsx(dn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
3355
3355
|
]
|
|
3356
3356
|
}
|
|
3357
3357
|
) }),
|
|
3358
|
-
/* @__PURE__ */ e.jsx(
|
|
3359
|
-
/* @__PURE__ */ e.jsx(
|
|
3360
|
-
/* @__PURE__ */ e.jsxs(
|
|
3361
|
-
/* @__PURE__ */ e.jsx(
|
|
3362
|
-
/* @__PURE__ */ e.jsx(
|
|
3363
|
-
|
|
3358
|
+
/* @__PURE__ */ e.jsx(Pe, { className: "w-full p-2.5", children: /* @__PURE__ */ e.jsxs(ba, { className: "w-full", children: [
|
|
3359
|
+
/* @__PURE__ */ e.jsx(ya, { placeholder: "Search component..." }),
|
|
3360
|
+
/* @__PURE__ */ e.jsxs(va, { children: [
|
|
3361
|
+
/* @__PURE__ */ e.jsx(Na, { children: "No component found." }),
|
|
3362
|
+
/* @__PURE__ */ e.jsx(Ca, { children: a.map((l) => /* @__PURE__ */ e.jsxs(
|
|
3363
|
+
Sa,
|
|
3364
3364
|
{
|
|
3365
3365
|
value: l.value,
|
|
3366
3366
|
onSelect: (r) => {
|
|
@@ -3370,7 +3370,7 @@ function pl({
|
|
|
3370
3370
|
},
|
|
3371
3371
|
children: [
|
|
3372
3372
|
/* @__PURE__ */ e.jsx(
|
|
3373
|
-
|
|
3373
|
+
ha,
|
|
3374
3374
|
{
|
|
3375
3375
|
className: J(
|
|
3376
3376
|
"mr-2 h-4 w-4",
|
|
@@ -3387,7 +3387,7 @@ function pl({
|
|
|
3387
3387
|
] }) })
|
|
3388
3388
|
] });
|
|
3389
3389
|
}
|
|
3390
|
-
function
|
|
3390
|
+
function fl({
|
|
3391
3391
|
options: s,
|
|
3392
3392
|
value: n,
|
|
3393
3393
|
onValueChange: a
|
|
@@ -3406,280 +3406,270 @@ function sa({
|
|
|
3406
3406
|
}
|
|
3407
3407
|
);
|
|
3408
3408
|
}
|
|
3409
|
-
function
|
|
3409
|
+
function ps({
|
|
3410
3410
|
label: s,
|
|
3411
3411
|
options: n,
|
|
3412
3412
|
value: a,
|
|
3413
3413
|
onValueChange: t,
|
|
3414
3414
|
className: i
|
|
3415
3415
|
}) {
|
|
3416
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3416
|
+
return /* @__PURE__ */ e.jsxs(he, { value: a, onValueChange: t, children: [
|
|
3417
3417
|
/* @__PURE__ */ e.jsx(
|
|
3418
|
-
|
|
3418
|
+
me,
|
|
3419
3419
|
{
|
|
3420
3420
|
className: J("w-full focus:ring-0 focus:ring-offset-0", i),
|
|
3421
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3421
|
+
children: /* @__PURE__ */ e.jsx(xe, { placeholder: s })
|
|
3422
3422
|
}
|
|
3423
3423
|
),
|
|
3424
|
-
/* @__PURE__ */ e.jsx(
|
|
3425
|
-
/* @__PURE__ */ e.jsx(
|
|
3426
|
-
n.map((
|
|
3424
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3425
|
+
/* @__PURE__ */ e.jsx(fe, { children: s }),
|
|
3426
|
+
n.map((o) => /* @__PURE__ */ e.jsx(Q, { value: o.value, children: o.label }, o.value))
|
|
3427
3427
|
] }) })
|
|
3428
3428
|
] });
|
|
3429
3429
|
}
|
|
3430
|
-
function
|
|
3431
|
-
|
|
3432
|
-
|
|
3430
|
+
function gl() {
|
|
3431
|
+
const { authToken: s } = je(), { data: n, isLoading: a, isFetching: t, isError: i } = re({
|
|
3432
|
+
queryKey: ["plugins", s == null ? void 0 : s.accessToken],
|
|
3433
|
+
queryFn: () => Ht(s == null ? void 0 : s.accessToken)
|
|
3434
|
+
// staleTime: Infinity,
|
|
3435
|
+
});
|
|
3436
|
+
return { data: n, isLoading: a, isFetching: t, isError: i };
|
|
3437
|
+
}
|
|
3438
|
+
function jl() {
|
|
3439
|
+
var f;
|
|
3440
|
+
const s = c(
|
|
3433
3441
|
(u) => u.card.customCardPreferences
|
|
3434
|
-
);
|
|
3435
|
-
|
|
3436
|
-
const
|
|
3442
|
+
), { data: n } = gl(), a = (n == null ? void 0 : n.plugins) || [];
|
|
3443
|
+
c((u) => u.card);
|
|
3444
|
+
const t = c((u) => u.frame), i = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: o } = Ie(), { components: l, manifest: r } = ma(
|
|
3437
3445
|
(s == null ? void 0 : s.url) || ""
|
|
3438
|
-
),
|
|
3446
|
+
), d = (f = r == null ? void 0 : r.visuals) == null ? void 0 : f.find(
|
|
3439
3447
|
(u) => u.name === (s == null ? void 0 : s.componentName)
|
|
3440
3448
|
);
|
|
3441
|
-
function
|
|
3449
|
+
function p(u, k) {
|
|
3442
3450
|
if (!s)
|
|
3443
3451
|
return;
|
|
3444
|
-
const
|
|
3452
|
+
const I = {
|
|
3445
3453
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3446
3454
|
[u]: {
|
|
3447
|
-
cardId:
|
|
3455
|
+
cardId: k,
|
|
3448
3456
|
hookRef: null
|
|
3449
3457
|
}
|
|
3450
3458
|
};
|
|
3451
|
-
|
|
3459
|
+
o({
|
|
3452
3460
|
...s,
|
|
3453
|
-
dataInputCardIds:
|
|
3461
|
+
dataInputCardIds: I
|
|
3454
3462
|
});
|
|
3455
3463
|
}
|
|
3456
|
-
function
|
|
3457
|
-
var
|
|
3458
|
-
const
|
|
3459
|
-
var
|
|
3460
|
-
return ((
|
|
3461
|
-
}).map((
|
|
3462
|
-
value:
|
|
3463
|
-
label:
|
|
3464
|
+
function h(u) {
|
|
3465
|
+
var D, I;
|
|
3466
|
+
const k = (D = t == null ? void 0 : t.cards) == null ? void 0 : D.filter((N) => {
|
|
3467
|
+
var M;
|
|
3468
|
+
return ((M = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : M.visualType) !== "multiple";
|
|
3469
|
+
}).map((N) => ({
|
|
3470
|
+
value: N.id,
|
|
3471
|
+
label: N.tabTitle || N.title
|
|
3464
3472
|
}));
|
|
3465
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (
|
|
3466
|
-
var A,
|
|
3473
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (I = u == null ? void 0 : u.dataInputs) == null ? void 0 : I.map((N, M) => {
|
|
3474
|
+
var A, j;
|
|
3467
3475
|
return /* @__PURE__ */ e.jsxs(
|
|
3468
3476
|
"div",
|
|
3469
3477
|
{
|
|
3470
3478
|
className: "grid grid-cols-10 gap-2",
|
|
3471
3479
|
children: [
|
|
3472
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children:
|
|
3480
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: N }),
|
|
3473
3481
|
/* @__PURE__ */ e.jsx(
|
|
3474
|
-
|
|
3482
|
+
ps,
|
|
3475
3483
|
{
|
|
3476
3484
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3477
3485
|
label: "",
|
|
3478
|
-
options:
|
|
3479
|
-
value: ((
|
|
3480
|
-
onValueChange: (
|
|
3486
|
+
options: k || [],
|
|
3487
|
+
value: ((j = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[M]) == null ? void 0 : j.cardId) || "",
|
|
3488
|
+
onValueChange: (S) => p(M, S)
|
|
3481
3489
|
}
|
|
3482
3490
|
)
|
|
3483
3491
|
]
|
|
3484
3492
|
},
|
|
3485
|
-
|
|
3493
|
+
M + Math.random()
|
|
3486
3494
|
);
|
|
3487
3495
|
}) });
|
|
3488
3496
|
}
|
|
3489
|
-
function
|
|
3490
|
-
var
|
|
3497
|
+
function y(u, k, D = []) {
|
|
3498
|
+
var I, N;
|
|
3491
3499
|
return s ? u === "input" ? /* @__PURE__ */ e.jsx(
|
|
3492
|
-
|
|
3500
|
+
Ce,
|
|
3493
3501
|
{
|
|
3494
|
-
className: `h-8 w-full ${
|
|
3495
|
-
value: (
|
|
3496
|
-
onChange: (
|
|
3497
|
-
|
|
3502
|
+
className: `h-8 w-full ${$t}`,
|
|
3503
|
+
value: ((I = s == null ? void 0 : s.settings) == null ? void 0 : I[k]) || "",
|
|
3504
|
+
onChange: (M) => {
|
|
3505
|
+
o({
|
|
3498
3506
|
...s,
|
|
3499
3507
|
settings: {
|
|
3500
3508
|
...s == null ? void 0 : s.settings,
|
|
3501
|
-
[
|
|
3509
|
+
[k]: M.target.value
|
|
3502
3510
|
}
|
|
3503
3511
|
});
|
|
3504
3512
|
}
|
|
3505
3513
|
},
|
|
3506
|
-
|
|
3514
|
+
k
|
|
3507
3515
|
) : u === "select" ? /* @__PURE__ */ e.jsx(
|
|
3508
|
-
|
|
3516
|
+
ps,
|
|
3509
3517
|
{
|
|
3510
3518
|
className: "h-8 w-full",
|
|
3511
3519
|
label: "",
|
|
3512
|
-
options:
|
|
3513
|
-
value: (
|
|
3514
|
-
onValueChange: (
|
|
3515
|
-
|
|
3520
|
+
options: D,
|
|
3521
|
+
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[k]) || "",
|
|
3522
|
+
onValueChange: (M) => {
|
|
3523
|
+
o({
|
|
3516
3524
|
...s,
|
|
3517
|
-
settings: { ...s == null ? void 0 : s.settings, [
|
|
3525
|
+
settings: { ...s == null ? void 0 : s.settings, [k]: M }
|
|
3518
3526
|
});
|
|
3519
3527
|
}
|
|
3520
3528
|
}
|
|
3521
3529
|
) : null : null;
|
|
3522
3530
|
}
|
|
3523
|
-
function
|
|
3524
|
-
const
|
|
3525
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children:
|
|
3526
|
-
/* @__PURE__ */ e.jsx(H, { children:
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
+
function x(u) {
|
|
3532
|
+
const k = Object.entries((u == null ? void 0 : u.settings) || {});
|
|
3533
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: k.map(([D, I]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3534
|
+
/* @__PURE__ */ e.jsx(H, { children: I.title }),
|
|
3535
|
+
y(
|
|
3536
|
+
I.ui,
|
|
3537
|
+
D,
|
|
3538
|
+
I.options
|
|
3531
3539
|
)
|
|
3532
|
-
] },
|
|
3540
|
+
] }, D)) });
|
|
3533
3541
|
}
|
|
3534
|
-
function
|
|
3535
|
-
|
|
3536
|
-
...s || {
|
|
3537
|
-
url: "",
|
|
3538
|
-
componentName: ""
|
|
3539
|
-
},
|
|
3540
|
-
type: u
|
|
3541
|
-
});
|
|
3542
|
-
}
|
|
3543
|
-
function x(u) {
|
|
3544
|
-
s && t({
|
|
3542
|
+
function m(u) {
|
|
3543
|
+
s && o({
|
|
3545
3544
|
...s,
|
|
3546
3545
|
visualType: u,
|
|
3547
3546
|
componentName: ""
|
|
3548
3547
|
});
|
|
3549
3548
|
}
|
|
3550
3549
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-6 text-sm", children: [
|
|
3551
|
-
/* @__PURE__ */ e.jsx(
|
|
3552
|
-
sa,
|
|
3553
|
-
{
|
|
3554
|
-
options: [
|
|
3555
|
-
{ value: "component", label: "Component" },
|
|
3556
|
-
{ value: "iframe", label: "Iframe" }
|
|
3557
|
-
],
|
|
3558
|
-
value: (s == null ? void 0 : s.type) || "component",
|
|
3559
|
-
onValueChange: y
|
|
3560
|
-
}
|
|
3561
|
-
),
|
|
3562
3550
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3563
|
-
/* @__PURE__ */ e.jsx(H, { children: `${(s == null ? void 0 : s.type) === "component" ? "Plugin ID" : "Website URL"}` }),
|
|
3551
|
+
/* @__PURE__ */ e.jsx(H, { children: `${(s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0 ? "Plugin ID" : "Website URL"}` }),
|
|
3564
3552
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3565
|
-
|
|
3553
|
+
ps,
|
|
3566
3554
|
{
|
|
3567
|
-
|
|
3568
|
-
|
|
3555
|
+
className: "h-8 w-full",
|
|
3556
|
+
label: "",
|
|
3557
|
+
options: a,
|
|
3558
|
+
value: (s == null ? void 0 : s.url) || "",
|
|
3559
|
+
onValueChange: (u) => o({
|
|
3569
3560
|
...s || {
|
|
3570
3561
|
url: "",
|
|
3571
3562
|
componentName: ""
|
|
3572
3563
|
},
|
|
3573
|
-
url: u
|
|
3574
|
-
})
|
|
3575
|
-
className: `h-8 w-full ${Js}`
|
|
3564
|
+
url: u
|
|
3565
|
+
})
|
|
3576
3566
|
}
|
|
3577
3567
|
) })
|
|
3578
3568
|
] }),
|
|
3579
|
-
/* @__PURE__ */ e.jsx(
|
|
3580
|
-
|
|
3569
|
+
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
|
|
3570
|
+
fl,
|
|
3581
3571
|
{
|
|
3582
3572
|
options: [
|
|
3583
3573
|
{ value: "single", label: "Single Visual" },
|
|
3584
3574
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3585
3575
|
],
|
|
3586
|
-
value:
|
|
3587
|
-
onValueChange:
|
|
3576
|
+
value: i,
|
|
3577
|
+
onValueChange: m
|
|
3588
3578
|
}
|
|
3589
3579
|
),
|
|
3590
|
-
(s == null ? void 0 : s.type) === "component" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3580
|
+
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3591
3581
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3592
3582
|
/* @__PURE__ */ e.jsx(H, { children: "Component" }),
|
|
3593
3583
|
/* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: /* @__PURE__ */ e.jsx(
|
|
3594
3584
|
pl,
|
|
3595
3585
|
{
|
|
3596
|
-
components: (
|
|
3586
|
+
components: (l == null ? void 0 : l.filter((u) => u.type === i).map((u) => ({
|
|
3597
3587
|
value: u.name,
|
|
3598
3588
|
label: u.name
|
|
3599
3589
|
}))) || [],
|
|
3600
3590
|
value: s == null ? void 0 : s.componentName,
|
|
3601
|
-
onValueChange: (u) =>
|
|
3591
|
+
onValueChange: (u) => o({
|
|
3602
3592
|
...s,
|
|
3603
3593
|
componentName: u
|
|
3604
3594
|
})
|
|
3605
3595
|
}
|
|
3606
3596
|
) })
|
|
3607
3597
|
] }),
|
|
3608
|
-
|
|
3598
|
+
d && d.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3609
3599
|
/* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
|
|
3610
|
-
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: d
|
|
3600
|
+
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: h(d) })
|
|
3611
3601
|
] }),
|
|
3612
|
-
|
|
3602
|
+
d && d.settings && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3613
3603
|
/* @__PURE__ */ e.jsx(H, { children: "Settings" }),
|
|
3614
|
-
/* @__PURE__ */ e.jsx("div", { className: "px-2", children:
|
|
3604
|
+
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: x(d) })
|
|
3615
3605
|
] })
|
|
3616
3606
|
] })
|
|
3617
3607
|
] });
|
|
3618
3608
|
}
|
|
3619
3609
|
function Oe() {
|
|
3620
3610
|
const [s, n] = V([]);
|
|
3621
|
-
|
|
3622
|
-
(
|
|
3611
|
+
c(
|
|
3612
|
+
(h) => h.card.cfg
|
|
3623
3613
|
);
|
|
3624
|
-
const a =
|
|
3625
|
-
(
|
|
3614
|
+
const a = c((h) => h.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = c((h) => h.actions), l = c(
|
|
3615
|
+
(h) => h.queryResultColumns
|
|
3626
3616
|
);
|
|
3627
|
-
|
|
3628
|
-
(
|
|
3617
|
+
c(
|
|
3618
|
+
(h) => {
|
|
3629
3619
|
var y;
|
|
3630
|
-
return (y =
|
|
3620
|
+
return (y = h.card.preferences) == null ? void 0 : y.filterOnClickColumnIndex;
|
|
3631
3621
|
}
|
|
3632
3622
|
), Z(() => {
|
|
3633
3623
|
l && n(new Array(l.length).fill(!1));
|
|
3634
3624
|
}, [l]);
|
|
3635
|
-
function r(
|
|
3636
|
-
var x,
|
|
3637
|
-
y ? a != null && a.onClickFilter && ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.length) > 0 ?
|
|
3625
|
+
function r(h, y) {
|
|
3626
|
+
var x, m;
|
|
3627
|
+
y ? a != null && a.onClickFilter && ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.length) > 0 ? o({
|
|
3638
3628
|
...a,
|
|
3639
3629
|
onClickFilter: [
|
|
3640
3630
|
...a.onClickFilter,
|
|
3641
3631
|
{
|
|
3642
|
-
columnIndex:
|
|
3632
|
+
columnIndex: h,
|
|
3643
3633
|
expression: ""
|
|
3644
3634
|
}
|
|
3645
3635
|
]
|
|
3646
|
-
}) :
|
|
3636
|
+
}) : o({
|
|
3647
3637
|
...a,
|
|
3648
3638
|
onClickFilter: [
|
|
3649
3639
|
{
|
|
3650
|
-
columnIndex:
|
|
3640
|
+
columnIndex: h,
|
|
3651
3641
|
expression: ""
|
|
3652
3642
|
}
|
|
3653
3643
|
]
|
|
3654
|
-
}) : (
|
|
3644
|
+
}) : (o({
|
|
3655
3645
|
...a,
|
|
3656
|
-
onClickFilter: (
|
|
3657
|
-
(
|
|
3646
|
+
onClickFilter: (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.filter(
|
|
3647
|
+
(f) => f.columnIndex !== h
|
|
3658
3648
|
)
|
|
3659
|
-
}), n((
|
|
3660
|
-
const
|
|
3661
|
-
return
|
|
3649
|
+
}), n((f) => {
|
|
3650
|
+
const u = [...f];
|
|
3651
|
+
return u[h] = !1, u;
|
|
3662
3652
|
}));
|
|
3663
3653
|
}
|
|
3664
|
-
function d(
|
|
3665
|
-
var
|
|
3666
|
-
const x = (
|
|
3667
|
-
...
|
|
3654
|
+
function d(h, y) {
|
|
3655
|
+
var m;
|
|
3656
|
+
const x = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((f) => f.columnIndex === h ? {
|
|
3657
|
+
...f,
|
|
3668
3658
|
expression: y.target.value
|
|
3669
|
-
} :
|
|
3670
|
-
|
|
3659
|
+
} : f);
|
|
3660
|
+
o({
|
|
3671
3661
|
...a,
|
|
3672
3662
|
onClickFilter: x
|
|
3673
3663
|
});
|
|
3674
3664
|
}
|
|
3675
|
-
function p(
|
|
3676
|
-
var y, x,
|
|
3677
|
-
if (s != null && s[
|
|
3665
|
+
function p(h) {
|
|
3666
|
+
var y, x, m, f;
|
|
3667
|
+
if (s != null && s[h] || (x = (y = a == null ? void 0 : a.onClickFilter) == null ? void 0 : y.find((u) => u.columnIndex === h)) != null && x.expression)
|
|
3678
3668
|
return /* @__PURE__ */ e.jsx(
|
|
3679
|
-
|
|
3669
|
+
Ce,
|
|
3680
3670
|
{
|
|
3681
|
-
value: (
|
|
3682
|
-
onChange: (
|
|
3671
|
+
value: (f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((u) => u.columnIndex === h)) == null ? void 0 : f.expression,
|
|
3672
|
+
onChange: (u) => d(h, u),
|
|
3683
3673
|
type: "text",
|
|
3684
3674
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3685
3675
|
placeholder: "Expression"
|
|
@@ -3688,8 +3678,8 @@ function Oe() {
|
|
|
3688
3678
|
}
|
|
3689
3679
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3690
3680
|
/* @__PURE__ */ e.jsx(H, { children: "On Click" }),
|
|
3691
|
-
l == null ? void 0 : l.map((
|
|
3692
|
-
var x,
|
|
3681
|
+
l == null ? void 0 : l.map((h, y) => {
|
|
3682
|
+
var x, m;
|
|
3693
3683
|
return /* @__PURE__ */ e.jsx(
|
|
3694
3684
|
"div",
|
|
3695
3685
|
{
|
|
@@ -3700,27 +3690,27 @@ function Oe() {
|
|
|
3700
3690
|
rs,
|
|
3701
3691
|
{
|
|
3702
3692
|
checked: !!((x = a == null ? void 0 : a.onClickFilter) != null && x.find(
|
|
3703
|
-
(
|
|
3693
|
+
(f) => f.columnIndex === y
|
|
3704
3694
|
)),
|
|
3705
|
-
onCheckedChange: (
|
|
3695
|
+
onCheckedChange: (f) => r(y, f)
|
|
3706
3696
|
}
|
|
3707
3697
|
),
|
|
3708
3698
|
/* @__PURE__ */ e.jsx(
|
|
3709
3699
|
"label",
|
|
3710
3700
|
{
|
|
3711
3701
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
3712
|
-
children:
|
|
3702
|
+
children: h
|
|
3713
3703
|
}
|
|
3714
3704
|
),
|
|
3715
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((
|
|
3716
|
-
(
|
|
3705
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find(
|
|
3706
|
+
(f) => f.columnIndex === y
|
|
3717
3707
|
)) && /* @__PURE__ */ e.jsx(
|
|
3718
|
-
|
|
3708
|
+
La,
|
|
3719
3709
|
{
|
|
3720
3710
|
onClick: () => {
|
|
3721
|
-
n((
|
|
3722
|
-
const
|
|
3723
|
-
return
|
|
3711
|
+
n((f) => {
|
|
3712
|
+
const u = [...f];
|
|
3713
|
+
return u[y] = !f[y], u;
|
|
3724
3714
|
});
|
|
3725
3715
|
},
|
|
3726
3716
|
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
@@ -3730,25 +3720,25 @@ function Oe() {
|
|
|
3730
3720
|
p(y)
|
|
3731
3721
|
] })
|
|
3732
3722
|
},
|
|
3733
|
-
|
|
3723
|
+
h
|
|
3734
3724
|
);
|
|
3735
3725
|
})
|
|
3736
3726
|
] });
|
|
3737
3727
|
}
|
|
3738
3728
|
function cs() {
|
|
3739
3729
|
var l, r, d;
|
|
3740
|
-
const s =
|
|
3730
|
+
const s = c((p) => p.card.preferences), n = c(
|
|
3741
3731
|
(p) => p.card.cfg
|
|
3742
|
-
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: i } =
|
|
3732
|
+
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: i } = c((p) => p.actions);
|
|
3743
3733
|
(l = n == null ? void 0 : n.options) != null && l.indexAxis;
|
|
3744
|
-
function
|
|
3734
|
+
function o(p) {
|
|
3745
3735
|
i(p);
|
|
3746
3736
|
}
|
|
3747
3737
|
return /* @__PURE__ */ e.jsxs(
|
|
3748
3738
|
os,
|
|
3749
3739
|
{
|
|
3750
3740
|
value: ((r = s == null ? void 0 : s.chartOptions) == null ? void 0 : r.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
|
|
3751
|
-
onValueChange:
|
|
3741
|
+
onValueChange: o,
|
|
3752
3742
|
className: "flex gap-3",
|
|
3753
3743
|
defaultValue: "x",
|
|
3754
3744
|
children: [
|
|
@@ -3765,44 +3755,44 @@ function cs() {
|
|
|
3765
3755
|
);
|
|
3766
3756
|
}
|
|
3767
3757
|
const Xe = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3768
|
-
function
|
|
3769
|
-
var t, i,
|
|
3770
|
-
const a =
|
|
3771
|
-
return ((
|
|
3758
|
+
function sa(s, n) {
|
|
3759
|
+
var t, i, o;
|
|
3760
|
+
const a = wa(s, n);
|
|
3761
|
+
return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
|
|
3772
3762
|
}
|
|
3773
|
-
function
|
|
3774
|
-
var le,
|
|
3775
|
-
const [s, n] = V(!1), a =
|
|
3763
|
+
function Ga() {
|
|
3764
|
+
var le, P, ie, w, E, X;
|
|
3765
|
+
const [s, n] = V(!1), a = c((T) => {
|
|
3776
3766
|
var L;
|
|
3777
|
-
return (L =
|
|
3778
|
-
}), t =
|
|
3767
|
+
return (L = T.card) == null ? void 0 : L.preferences;
|
|
3768
|
+
}), t = c((T) => {
|
|
3779
3769
|
var L;
|
|
3780
|
-
return (L =
|
|
3781
|
-
}), i =
|
|
3782
|
-
|
|
3770
|
+
return (L = T.card) == null ? void 0 : L.cfg;
|
|
3771
|
+
}), i = wa(a, t), [o, l] = V(
|
|
3772
|
+
sa(a)
|
|
3783
3773
|
), [r, d] = V(
|
|
3784
|
-
((ie = (
|
|
3785
|
-
), [p,
|
|
3774
|
+
((ie = (P = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : P[i]) == null ? void 0 : ie.min) || ""
|
|
3775
|
+
), [p, h] = V(
|
|
3786
3776
|
((X = (E = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : E[i]) == null ? void 0 : X.max) || ""
|
|
3787
|
-
), [y, x] = V(r || p ? "custom" : "auto"), [
|
|
3788
|
-
(
|
|
3789
|
-
), { updateCardInFrame: v } = Ie(), b =
|
|
3777
|
+
), [y, x] = V(r || p ? "custom" : "auto"), [m, f] = V(""), [u, k] = V(0), [D, I] = V(""), [N, M] = V(""), [A, j] = V(""), S = c(
|
|
3778
|
+
(T) => T.actions.setCardPreferences
|
|
3779
|
+
), { updateCardInFrame: v } = Ie(), b = c((T) => T.card), q = c((T) => {
|
|
3790
3780
|
var L;
|
|
3791
|
-
return (L =
|
|
3781
|
+
return (L = T.card) == null ? void 0 : L.type;
|
|
3792
3782
|
}), $ = ["pie", "doughnut", "polarArea"].includes(q);
|
|
3793
3783
|
Z(() => {
|
|
3794
|
-
var
|
|
3795
|
-
l(
|
|
3796
|
-
((se = (L = (
|
|
3797
|
-
),
|
|
3798
|
-
((
|
|
3799
|
-
), k(((
|
|
3784
|
+
var T, L, se, _, ae, te, we, ye, Y, oe, ce, ke, de, ve;
|
|
3785
|
+
l(sa(a)), d(
|
|
3786
|
+
((se = (L = (T = a == null ? void 0 : a.chartOptions) == null ? void 0 : T.scales) == null ? void 0 : L[i]) == null ? void 0 : se.min) === 0 ? 0 : ""
|
|
3787
|
+
), h(((te = (ae = (_ = a == null ? void 0 : a.chartOptions) == null ? void 0 : _.scales) == null ? void 0 : ae[i]) == null ? void 0 : te.max) || ""), f(
|
|
3788
|
+
((oe = (Y = (ye = (we = a == null ? void 0 : a.chartOptions) == null ? void 0 : we.scales) == null ? void 0 : ye[i]) == null ? void 0 : Y.ticks) == null ? void 0 : oe.stepSize) || ""
|
|
3789
|
+
), k(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.decimalPlaces) || 0), I(((ke = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ke.suffix) || ""), M(((de = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : de.currency) || ""), j(((ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ve.locale) || "");
|
|
3800
3790
|
}, [s, a, i]);
|
|
3801
|
-
function R(
|
|
3802
|
-
return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(
|
|
3791
|
+
function R(T, L) {
|
|
3792
|
+
return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(T);
|
|
3803
3793
|
}
|
|
3804
3794
|
function B() {
|
|
3805
|
-
const
|
|
3795
|
+
const T = [
|
|
3806
3796
|
...new Set(ns.map((L) => L.currency))
|
|
3807
3797
|
];
|
|
3808
3798
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -3823,30 +3813,30 @@ function Ka() {
|
|
|
3823
3813
|
}
|
|
3824
3814
|
),
|
|
3825
3815
|
/* @__PURE__ */ e.jsxs(
|
|
3826
|
-
|
|
3816
|
+
he,
|
|
3827
3817
|
{
|
|
3828
3818
|
value: N || "none",
|
|
3829
|
-
onValueChange: (L) =>
|
|
3819
|
+
onValueChange: (L) => M(L === "none" ? "" : L),
|
|
3830
3820
|
children: [
|
|
3831
|
-
/* @__PURE__ */ e.jsx(
|
|
3832
|
-
/* @__PURE__ */ e.jsx(
|
|
3833
|
-
/* @__PURE__ */ e.jsx(
|
|
3821
|
+
/* @__PURE__ */ e.jsx(me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
3822
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3823
|
+
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
3834
3824
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
|
|
3835
|
-
|
|
3825
|
+
T.map((L) => /* @__PURE__ */ e.jsx(Q, { value: L, children: L }, L))
|
|
3836
3826
|
] }) })
|
|
3837
3827
|
]
|
|
3838
3828
|
}
|
|
3839
3829
|
),
|
|
3840
|
-
/* @__PURE__ */ e.jsxs(
|
|
3830
|
+
/* @__PURE__ */ e.jsxs(he, { value: A, onValueChange: (L) => j(L), children: [
|
|
3841
3831
|
/* @__PURE__ */ e.jsx(
|
|
3842
|
-
|
|
3832
|
+
me,
|
|
3843
3833
|
{
|
|
3844
3834
|
className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",
|
|
3845
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3835
|
+
children: /* @__PURE__ */ e.jsx(xe, {})
|
|
3846
3836
|
}
|
|
3847
3837
|
),
|
|
3848
|
-
/* @__PURE__ */ e.jsx(
|
|
3849
|
-
/* @__PURE__ */ e.jsx(
|
|
3838
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3839
|
+
/* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
|
|
3850
3840
|
ns.map((L) => /* @__PURE__ */ e.jsx(Q, { value: L.locale, children: L.locale }, L.locale))
|
|
3851
3841
|
] }) })
|
|
3852
3842
|
] })
|
|
@@ -3854,9 +3844,9 @@ function Ka() {
|
|
|
3854
3844
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
|
|
3855
3845
|
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
|
|
3856
3846
|
/* @__PURE__ */ e.jsx(
|
|
3857
|
-
|
|
3847
|
+
Ce,
|
|
3858
3848
|
{
|
|
3859
|
-
value:
|
|
3849
|
+
value: u,
|
|
3860
3850
|
onChange: (L) => k(Number(L.target.value)),
|
|
3861
3851
|
id: "format",
|
|
3862
3852
|
className: `col-span-6 h-8 w-full tracking-wide ${Xe}`
|
|
@@ -3870,19 +3860,19 @@ function Ka() {
|
|
|
3870
3860
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3871
3861
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
|
|
3872
3862
|
/* @__PURE__ */ e.jsx(
|
|
3873
|
-
|
|
3863
|
+
Ce,
|
|
3874
3864
|
{
|
|
3875
3865
|
id: "min",
|
|
3876
3866
|
value: r,
|
|
3877
|
-
onChange: (
|
|
3867
|
+
onChange: (T) => d((L) => R(L, T.target.value)),
|
|
3878
3868
|
className: `col-span-1 h-8 w-full ${Xe}`
|
|
3879
3869
|
}
|
|
3880
3870
|
),
|
|
3881
3871
|
/* @__PURE__ */ e.jsx(
|
|
3882
|
-
|
|
3872
|
+
Ce,
|
|
3883
3873
|
{
|
|
3884
3874
|
value: p,
|
|
3885
|
-
onChange: (
|
|
3875
|
+
onChange: (T) => h((L) => R(L, T.target.value)),
|
|
3886
3876
|
id: "max",
|
|
3887
3877
|
className: `col-span-1 h-8 w-full ${Xe}`
|
|
3888
3878
|
}
|
|
@@ -3891,10 +3881,10 @@ function Ka() {
|
|
|
3891
3881
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3892
3882
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
|
|
3893
3883
|
/* @__PURE__ */ e.jsx(
|
|
3894
|
-
|
|
3884
|
+
Ce,
|
|
3895
3885
|
{
|
|
3896
|
-
value:
|
|
3897
|
-
onChange: (
|
|
3886
|
+
value: m,
|
|
3887
|
+
onChange: (T) => f((L) => R(L, T.target.value)),
|
|
3898
3888
|
id: "step-size",
|
|
3899
3889
|
className: `col-span-1 h-8 w-full ${Xe}`
|
|
3900
3890
|
}
|
|
@@ -3904,12 +3894,12 @@ function Ka() {
|
|
|
3904
3894
|
}
|
|
3905
3895
|
function W() {
|
|
3906
3896
|
var _;
|
|
3907
|
-
let
|
|
3908
|
-
y === "custom" && (
|
|
3897
|
+
let T = {};
|
|
3898
|
+
y === "custom" && (T = {
|
|
3909
3899
|
min: r,
|
|
3910
3900
|
max: p,
|
|
3911
3901
|
ticks: {
|
|
3912
|
-
stepSize:
|
|
3902
|
+
stepSize: m
|
|
3913
3903
|
}
|
|
3914
3904
|
});
|
|
3915
3905
|
const L = {
|
|
@@ -3920,16 +3910,16 @@ function Ka() {
|
|
|
3920
3910
|
...(_ = a == null ? void 0 : a.chartOptions) == null ? void 0 : _.scales,
|
|
3921
3911
|
[i]: {
|
|
3922
3912
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3923
|
-
type:
|
|
3924
|
-
...
|
|
3913
|
+
type: o,
|
|
3914
|
+
...o === "linear" ? T : {}
|
|
3925
3915
|
}
|
|
3926
3916
|
}
|
|
3927
3917
|
},
|
|
3928
3918
|
numberAxisFormat: {
|
|
3929
|
-
decimalPlaces:
|
|
3930
|
-
suffix:
|
|
3919
|
+
decimalPlaces: u,
|
|
3920
|
+
suffix: D,
|
|
3931
3921
|
currency: N,
|
|
3932
|
-
locale:
|
|
3922
|
+
locale: A
|
|
3933
3923
|
}
|
|
3934
3924
|
};
|
|
3935
3925
|
console.log(L), S(L);
|
|
@@ -3939,9 +3929,9 @@ function Ka() {
|
|
|
3939
3929
|
};
|
|
3940
3930
|
v(se);
|
|
3941
3931
|
}
|
|
3942
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3943
|
-
/* @__PURE__ */ e.jsx(
|
|
3944
|
-
/* @__PURE__ */ e.jsx(
|
|
3932
|
+
return /* @__PURE__ */ e.jsxs(Ge, { onOpenChange: (T) => n(T), children: [
|
|
3933
|
+
/* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsx(Bt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3934
|
+
/* @__PURE__ */ e.jsx(Pe, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3945
3935
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3946
3936
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3947
3937
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -3950,15 +3940,15 @@ function Ka() {
|
|
|
3950
3940
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3951
3941
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
|
|
3952
3942
|
/* @__PURE__ */ e.jsxs(
|
|
3953
|
-
|
|
3943
|
+
he,
|
|
3954
3944
|
{
|
|
3955
3945
|
disabled: $,
|
|
3956
|
-
value:
|
|
3957
|
-
onValueChange: (
|
|
3946
|
+
value: o,
|
|
3947
|
+
onValueChange: (T) => l(T),
|
|
3958
3948
|
children: [
|
|
3959
|
-
/* @__PURE__ */ e.jsx(
|
|
3960
|
-
/* @__PURE__ */ e.jsx(
|
|
3961
|
-
/* @__PURE__ */ e.jsx(
|
|
3949
|
+
/* @__PURE__ */ e.jsx(me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
3950
|
+
/* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
3951
|
+
/* @__PURE__ */ e.jsx(fe, { children: "Option" }),
|
|
3962
3952
|
/* @__PURE__ */ e.jsx(Q, { value: "linear", children: "Linear" }),
|
|
3963
3953
|
/* @__PURE__ */ e.jsx(Q, { value: "logarithmic", children: "Logarithmic" })
|
|
3964
3954
|
] }) })
|
|
@@ -3966,7 +3956,7 @@ function Ka() {
|
|
|
3966
3956
|
}
|
|
3967
3957
|
)
|
|
3968
3958
|
] }),
|
|
3969
|
-
|
|
3959
|
+
o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3970
3960
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
|
|
3971
3961
|
/* @__PURE__ */ e.jsxs(
|
|
3972
3962
|
os,
|
|
@@ -3974,7 +3964,7 @@ function Ka() {
|
|
|
3974
3964
|
disabled: $,
|
|
3975
3965
|
id: "scale-option",
|
|
3976
3966
|
value: y,
|
|
3977
|
-
onValueChange: (
|
|
3967
|
+
onValueChange: (T) => x(T),
|
|
3978
3968
|
className: "col-span-2 flex gap-3",
|
|
3979
3969
|
defaultValue: "x",
|
|
3980
3970
|
children: [
|
|
@@ -3990,9 +3980,9 @@ function Ka() {
|
|
|
3990
3980
|
}
|
|
3991
3981
|
)
|
|
3992
3982
|
] }),
|
|
3993
|
-
y === "custom" &&
|
|
3983
|
+
y === "custom" && o == "linear" && ee(),
|
|
3994
3984
|
B(),
|
|
3995
|
-
/* @__PURE__ */ e.jsx(
|
|
3985
|
+
/* @__PURE__ */ e.jsx(Ut, {}),
|
|
3996
3986
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3997
3987
|
F,
|
|
3998
3988
|
{
|
|
@@ -4006,43 +3996,43 @@ function Ka() {
|
|
|
4006
3996
|
] }) })
|
|
4007
3997
|
] });
|
|
4008
3998
|
}
|
|
4009
|
-
function
|
|
3999
|
+
function bl({ idx: s }) {
|
|
4010
4000
|
var r;
|
|
4011
|
-
const n =
|
|
4001
|
+
const n = c((d) => {
|
|
4012
4002
|
var p;
|
|
4013
4003
|
return (p = d.card) == null ? void 0 : p.preferences;
|
|
4014
|
-
}), a =
|
|
4004
|
+
}), a = c(
|
|
4015
4005
|
(d) => {
|
|
4016
4006
|
var p;
|
|
4017
4007
|
return (p = d.card.preferences) == null ? void 0 : p.datasetOptions;
|
|
4018
4008
|
}
|
|
4019
|
-
), t =
|
|
4009
|
+
), t = c(
|
|
4020
4010
|
(d) => d.actions.setCardPreferences
|
|
4021
|
-
), i = (r = n == null ? void 0 : n.chartOptions) == null ? void 0 : r.indexAxis,
|
|
4011
|
+
), i = (r = n == null ? void 0 : n.chartOptions) == null ? void 0 : r.indexAxis, o = a == null ? void 0 : a.find((d) => d.idx === s);
|
|
4022
4012
|
function l(d, p) {
|
|
4023
|
-
(d === "end" || d === "start") &&
|
|
4024
|
-
const
|
|
4013
|
+
(d === "end" || d === "start") && Gt(Kt());
|
|
4014
|
+
const h = {
|
|
4025
4015
|
display: d !== "none",
|
|
4026
4016
|
align: d,
|
|
4027
4017
|
anchor: d,
|
|
4028
4018
|
clamp: !0
|
|
4029
4019
|
};
|
|
4030
|
-
if (!
|
|
4020
|
+
if (!o)
|
|
4031
4021
|
t({
|
|
4032
4022
|
...n,
|
|
4033
4023
|
datasetOptions: [
|
|
4034
4024
|
...a || [],
|
|
4035
4025
|
{
|
|
4036
4026
|
idx: p,
|
|
4037
|
-
datalabels:
|
|
4027
|
+
datalabels: h
|
|
4038
4028
|
}
|
|
4039
4029
|
]
|
|
4040
4030
|
});
|
|
4041
4031
|
else {
|
|
4042
|
-
const y = { ...
|
|
4043
|
-
y.datalabels =
|
|
4032
|
+
const y = { ...o };
|
|
4033
|
+
y.datalabels = h;
|
|
4044
4034
|
const x = a == null ? void 0 : a.map(
|
|
4045
|
-
(
|
|
4035
|
+
(m) => m.idx === p ? y : m
|
|
4046
4036
|
);
|
|
4047
4037
|
t({
|
|
4048
4038
|
...n,
|
|
@@ -4050,9 +4040,9 @@ function gl({ idx: s }) {
|
|
|
4050
4040
|
});
|
|
4051
4041
|
}
|
|
4052
4042
|
}
|
|
4053
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4054
|
-
/* @__PURE__ */ e.jsx(
|
|
4055
|
-
/* @__PURE__ */ e.jsx(
|
|
4043
|
+
return /* @__PURE__ */ e.jsxs(Ge, { children: [
|
|
4044
|
+
/* @__PURE__ */ e.jsx(Ke, { children: /* @__PURE__ */ e.jsx(On, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4045
|
+
/* @__PURE__ */ e.jsx(Pe, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4056
4046
|
/* @__PURE__ */ e.jsx(
|
|
4057
4047
|
F,
|
|
4058
4048
|
{
|
|
@@ -4060,7 +4050,7 @@ function gl({ idx: s }) {
|
|
|
4060
4050
|
size: "sm",
|
|
4061
4051
|
variant: "secondary",
|
|
4062
4052
|
className: "h-7 p-1 text-xs font-normal",
|
|
4063
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4053
|
+
children: /* @__PURE__ */ e.jsx(ja, { className: "size-4" })
|
|
4064
4054
|
}
|
|
4065
4055
|
),
|
|
4066
4056
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4117,25 +4107,25 @@ function gl({ idx: s }) {
|
|
|
4117
4107
|
] }) })
|
|
4118
4108
|
] });
|
|
4119
4109
|
}
|
|
4120
|
-
function
|
|
4121
|
-
const s =
|
|
4110
|
+
function Ka() {
|
|
4111
|
+
const s = c((d) => d.card), n = c(
|
|
4122
4112
|
(d) => {
|
|
4123
|
-
var p,
|
|
4124
|
-
return (y = (
|
|
4113
|
+
var p, h, y;
|
|
4114
|
+
return (y = (h = (p = d == null ? void 0 : d.card) == null ? void 0 : p.preferences) == null ? void 0 : h.chartOptions) == null ? void 0 : y.indexAxis;
|
|
4125
4115
|
}
|
|
4126
4116
|
), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
|
|
4127
4117
|
keys: i,
|
|
4128
|
-
metricKeys:
|
|
4118
|
+
metricKeys: o,
|
|
4129
4119
|
dimensionKeys: l
|
|
4130
|
-
} =
|
|
4131
|
-
let r =
|
|
4120
|
+
} = gs(s.data || []);
|
|
4121
|
+
let r = o;
|
|
4132
4122
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4133
|
-
const d =
|
|
4123
|
+
const d = Pt({
|
|
4134
4124
|
dataArray: s.data || [],
|
|
4135
4125
|
groupKey: l[0],
|
|
4136
4126
|
pivotKey: l[1],
|
|
4137
4127
|
valueKey: r[0]
|
|
4138
|
-
}), { metricKeys: p } =
|
|
4128
|
+
}), { metricKeys: p } = gs(d);
|
|
4139
4129
|
r = p;
|
|
4140
4130
|
}
|
|
4141
4131
|
return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
@@ -4146,25 +4136,25 @@ function Wa() {
|
|
|
4146
4136
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4147
4137
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
4148
4138
|
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
4149
|
-
/* @__PURE__ */ e.jsx(
|
|
4139
|
+
/* @__PURE__ */ e.jsx(Ga, {})
|
|
4150
4140
|
] }),
|
|
4151
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: r.map((d, p) => /* @__PURE__ */ e.jsx(
|
|
4141
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: r.map((d, p) => /* @__PURE__ */ e.jsx(yl, { col: d, idx: p }, d)) })
|
|
4152
4142
|
] })
|
|
4153
4143
|
] });
|
|
4154
4144
|
}
|
|
4155
|
-
function
|
|
4156
|
-
const a =
|
|
4145
|
+
function yl({ col: s, idx: n }) {
|
|
4146
|
+
const a = c((r) => {
|
|
4157
4147
|
var d;
|
|
4158
4148
|
return (d = r.card) == null ? void 0 : d.preferences;
|
|
4159
|
-
}), t =
|
|
4149
|
+
}), t = c(
|
|
4160
4150
|
(r) => {
|
|
4161
4151
|
var d;
|
|
4162
4152
|
return (d = r.card.preferences) == null ? void 0 : d.datasetOptions;
|
|
4163
4153
|
}
|
|
4164
|
-
), i = t == null ? void 0 : t.find((r) => r.idx === n), { setCardPreferences:
|
|
4154
|
+
), i = t == null ? void 0 : t.find((r) => r.idx === n), { setCardPreferences: o } = c((r) => r.actions);
|
|
4165
4155
|
function l(r) {
|
|
4166
4156
|
if (!i)
|
|
4167
|
-
|
|
4157
|
+
o({
|
|
4168
4158
|
...a,
|
|
4169
4159
|
datasetOptions: [
|
|
4170
4160
|
...t || [],
|
|
@@ -4179,9 +4169,9 @@ function jl({ col: s, idx: n }) {
|
|
|
4179
4169
|
const d = { ...i };
|
|
4180
4170
|
d.type = r === "area" ? "line" : r, d.fill = r === "area" ? "origin" : "";
|
|
4181
4171
|
const p = t == null ? void 0 : t.map(
|
|
4182
|
-
(
|
|
4172
|
+
(h) => h.idx === n ? d : h
|
|
4183
4173
|
);
|
|
4184
|
-
|
|
4174
|
+
o({
|
|
4185
4175
|
...a,
|
|
4186
4176
|
datasetOptions: p
|
|
4187
4177
|
});
|
|
@@ -4191,14 +4181,14 @@ function jl({ col: s, idx: n }) {
|
|
|
4191
4181
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
4192
4182
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
4193
4183
|
/* @__PURE__ */ e.jsx(
|
|
4194
|
-
|
|
4184
|
+
Rs,
|
|
4195
4185
|
{
|
|
4196
4186
|
onClick: () => l("bar"),
|
|
4197
4187
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4198
4188
|
}
|
|
4199
4189
|
),
|
|
4200
4190
|
/* @__PURE__ */ e.jsx(
|
|
4201
|
-
|
|
4191
|
+
_s,
|
|
4202
4192
|
{
|
|
4203
4193
|
onClick: () => l("line"),
|
|
4204
4194
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -4218,34 +4208,34 @@ function jl({ col: s, idx: n }) {
|
|
|
4218
4208
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4219
4209
|
}
|
|
4220
4210
|
),
|
|
4221
|
-
/* @__PURE__ */ e.jsx(
|
|
4211
|
+
/* @__PURE__ */ e.jsx(bl, { idx: n })
|
|
4222
4212
|
] })
|
|
4223
4213
|
] });
|
|
4224
4214
|
}
|
|
4225
|
-
function
|
|
4226
|
-
const s =
|
|
4215
|
+
function Pa() {
|
|
4216
|
+
const s = c((x) => x.selectedConnectionId), n = c((x) => x.selectedDatamodelId), a = c((x) => x.selectedDatabaseName), t = c((x) => x.selectedSchemaName), i = c((x) => x.selectedTableName), o = z((x) => x.dashboard.filters) || [], l = z((x) => x.actions.addFilter), r = z((x) => x.actions.removeFilter), d = z(
|
|
4227
4217
|
(x) => x.actions.removeFilterValue
|
|
4228
|
-
), { modelItems: p, tableName:
|
|
4229
|
-
function y(x,
|
|
4218
|
+
), { modelItems: p, tableName: h } = Me();
|
|
4219
|
+
function y(x, m = "dashboard") {
|
|
4230
4220
|
var j;
|
|
4231
|
-
const
|
|
4232
|
-
let I =
|
|
4221
|
+
const f = ue(x.column_name), u = ue(a || ""), k = ue(t || ""), D = ue(h);
|
|
4222
|
+
let I = ca(
|
|
4233
4223
|
k,
|
|
4234
|
-
|
|
4235
|
-
), N = `${I}.${
|
|
4236
|
-
const
|
|
4224
|
+
D
|
|
4225
|
+
), N = `${I}.${f}`;
|
|
4226
|
+
const M = (j = p == null ? void 0 : p.find(
|
|
4237
4227
|
(S) => S.id === n
|
|
4238
4228
|
)) == null ? void 0 : j.name;
|
|
4239
|
-
n && n !== "none" && (N = `${
|
|
4240
|
-
const
|
|
4241
|
-
(S) => S.column === N && S.table ===
|
|
4229
|
+
n && n !== "none" && (N = `${fs}.${M}.${f}`, I = `${fs}.${M}`);
|
|
4230
|
+
const A = o == null ? void 0 : o.find(
|
|
4231
|
+
(S) => S.column === N && S.table === D && (S.database === u || S.database === a)
|
|
4242
4232
|
);
|
|
4243
|
-
if (
|
|
4244
|
-
d(
|
|
4233
|
+
if (A)
|
|
4234
|
+
d(A.id), r(A.id);
|
|
4245
4235
|
else {
|
|
4246
4236
|
const S = _e();
|
|
4247
|
-
return
|
|
4248
|
-
location:
|
|
4237
|
+
return h === "api" && s ? (l({
|
|
4238
|
+
location: m,
|
|
4249
4239
|
id: S,
|
|
4250
4240
|
//uuidv4(),
|
|
4251
4241
|
column: N,
|
|
@@ -4259,13 +4249,13 @@ function Qa() {
|
|
|
4259
4249
|
sql: Ys(
|
|
4260
4250
|
x.data_type,
|
|
4261
4251
|
I,
|
|
4262
|
-
|
|
4252
|
+
f
|
|
4263
4253
|
)
|
|
4264
4254
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4265
4255
|
}), S) : (l({
|
|
4266
4256
|
id: S,
|
|
4267
4257
|
//uuidv4(),
|
|
4268
|
-
location:
|
|
4258
|
+
location: m,
|
|
4269
4259
|
column: N,
|
|
4270
4260
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4271
4261
|
title: x.column_name,
|
|
@@ -4277,7 +4267,7 @@ function Qa() {
|
|
|
4277
4267
|
sql: Ys(
|
|
4278
4268
|
x.data_type,
|
|
4279
4269
|
I,
|
|
4280
|
-
|
|
4270
|
+
f
|
|
4281
4271
|
)
|
|
4282
4272
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4283
4273
|
}), S);
|
|
@@ -4288,26 +4278,26 @@ function Qa() {
|
|
|
4288
4278
|
function Ae() {
|
|
4289
4279
|
const s = z(
|
|
4290
4280
|
(r) => r.dashboard.filters
|
|
4291
|
-
), n =
|
|
4292
|
-
function
|
|
4281
|
+
), n = c((r) => r.frame), { setFrame: a } = Ie(), { columns: t } = Me(), { assignFilter: i } = Pa();
|
|
4282
|
+
function o(r) {
|
|
4293
4283
|
const d = i(r, "frame");
|
|
4294
4284
|
a({ ...n, filterId: d });
|
|
4295
4285
|
}
|
|
4296
4286
|
const l = s == null ? void 0 : s.find((r) => r.id === n.filterId);
|
|
4297
4287
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4298
4288
|
/* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
|
|
4299
|
-
/* @__PURE__ */ e.jsx(
|
|
4289
|
+
/* @__PURE__ */ e.jsx(vl, { onSelect: o, columns: t }),
|
|
4300
4290
|
l && /* @__PURE__ */ e.jsx(Wt, { filter: l })
|
|
4301
4291
|
] });
|
|
4302
4292
|
}
|
|
4303
|
-
function
|
|
4293
|
+
function vl({
|
|
4304
4294
|
columns: s,
|
|
4305
4295
|
onSelect: n
|
|
4306
4296
|
}) {
|
|
4307
4297
|
var l;
|
|
4308
|
-
const [a, t] =
|
|
4309
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4310
|
-
/* @__PURE__ */ e.jsx(
|
|
4298
|
+
const [a, t] = ys.useState(!1), [i, o] = ys.useState("");
|
|
4299
|
+
return /* @__PURE__ */ e.jsxs(Ge, { open: a, onOpenChange: t, children: [
|
|
4300
|
+
/* @__PURE__ */ e.jsx(Ke, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4311
4301
|
F,
|
|
4312
4302
|
{
|
|
4313
4303
|
size: "sm",
|
|
@@ -4321,22 +4311,22 @@ function bl({
|
|
|
4321
4311
|
]
|
|
4322
4312
|
}
|
|
4323
4313
|
) }),
|
|
4324
|
-
/* @__PURE__ */ e.jsx(
|
|
4325
|
-
/* @__PURE__ */ e.jsx(
|
|
4326
|
-
/* @__PURE__ */ e.jsxs(
|
|
4327
|
-
/* @__PURE__ */ e.jsx(
|
|
4328
|
-
/* @__PURE__ */ e.jsx(
|
|
4329
|
-
|
|
4314
|
+
/* @__PURE__ */ e.jsx(Pe, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ba, { children: [
|
|
4315
|
+
/* @__PURE__ */ e.jsx(ya, { placeholder: "Search column", className: "h-9" }),
|
|
4316
|
+
/* @__PURE__ */ e.jsxs(va, { children: [
|
|
4317
|
+
/* @__PURE__ */ e.jsx(Na, { children: "No framework found." }),
|
|
4318
|
+
/* @__PURE__ */ e.jsx(Ca, { children: s.map((r) => /* @__PURE__ */ e.jsxs(
|
|
4319
|
+
Sa,
|
|
4330
4320
|
{
|
|
4331
4321
|
value: r.column_name,
|
|
4332
4322
|
onSelect: (d) => {
|
|
4333
4323
|
const p = d === i ? "" : d;
|
|
4334
|
-
|
|
4324
|
+
o(p), t(!1), p && n(r);
|
|
4335
4325
|
},
|
|
4336
4326
|
children: [
|
|
4337
4327
|
r.column_name,
|
|
4338
4328
|
/* @__PURE__ */ e.jsx(
|
|
4339
|
-
|
|
4329
|
+
ga,
|
|
4340
4330
|
{
|
|
4341
4331
|
className: J(
|
|
4342
4332
|
"ml-auto h-4 w-4",
|
|
@@ -4352,13 +4342,13 @@ function bl({
|
|
|
4352
4342
|
] }) })
|
|
4353
4343
|
] });
|
|
4354
4344
|
}
|
|
4355
|
-
function
|
|
4345
|
+
function Nl({
|
|
4356
4346
|
cardType: s
|
|
4357
4347
|
}) {
|
|
4358
4348
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4359
|
-
/* @__PURE__ */ e.jsxs(
|
|
4360
|
-
/* @__PURE__ */ e.jsx(
|
|
4361
|
-
/* @__PURE__ */ e.jsxs(
|
|
4349
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4350
|
+
/* @__PURE__ */ e.jsx(G, { children: `${qs(s)} Chart` }),
|
|
4351
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 font-mono text-xs", children: [
|
|
4362
4352
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
4363
4353
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4364
4354
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -4381,29 +4371,29 @@ function yl({
|
|
|
4381
4371
|
] })
|
|
4382
4372
|
] })
|
|
4383
4373
|
] }),
|
|
4384
|
-
/* @__PURE__ */ e.jsxs(
|
|
4385
|
-
/* @__PURE__ */ e.jsx(
|
|
4386
|
-
/* @__PURE__ */ e.jsxs(
|
|
4374
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
4375
|
+
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
4376
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4387
4377
|
/* @__PURE__ */ e.jsx(cs, {}),
|
|
4388
|
-
/* @__PURE__ */ e.jsx(
|
|
4378
|
+
/* @__PURE__ */ e.jsx(Ka, {})
|
|
4389
4379
|
] })
|
|
4390
4380
|
] }),
|
|
4391
|
-
/* @__PURE__ */ e.jsxs(
|
|
4392
|
-
/* @__PURE__ */ e.jsx(
|
|
4393
|
-
/* @__PURE__ */ e.jsxs(
|
|
4381
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
4382
|
+
/* @__PURE__ */ e.jsx(G, { children: "Filters" }),
|
|
4383
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4394
4384
|
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
4395
4385
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
4396
4386
|
] })
|
|
4397
4387
|
] })
|
|
4398
4388
|
] }) });
|
|
4399
4389
|
}
|
|
4400
|
-
function
|
|
4401
|
-
var i,
|
|
4402
|
-
const s =
|
|
4390
|
+
function $s() {
|
|
4391
|
+
var i, o, l;
|
|
4392
|
+
const s = c(
|
|
4403
4393
|
(r) => r.card.cfg
|
|
4404
|
-
), n =
|
|
4394
|
+
), n = c((r) => r.actions.setCardCfg), a = c((r) => r.card.type);
|
|
4405
4395
|
function t(r) {
|
|
4406
|
-
var
|
|
4396
|
+
var h;
|
|
4407
4397
|
const d = {
|
|
4408
4398
|
datalabels: {
|
|
4409
4399
|
display: r !== "none",
|
|
@@ -4416,7 +4406,7 @@ function Hs() {
|
|
|
4416
4406
|
options: {
|
|
4417
4407
|
...s == null ? void 0 : s.options,
|
|
4418
4408
|
plugins: {
|
|
4419
|
-
...(
|
|
4409
|
+
...(h = s == null ? void 0 : s.options) == null ? void 0 : h.plugins,
|
|
4420
4410
|
...d
|
|
4421
4411
|
}
|
|
4422
4412
|
}
|
|
@@ -4426,18 +4416,18 @@ function Hs() {
|
|
|
4426
4416
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4427
4417
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4428
4418
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
4429
|
-
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(
|
|
4419
|
+
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Ga, {})
|
|
4430
4420
|
] }),
|
|
4431
4421
|
/* @__PURE__ */ e.jsxs(
|
|
4432
|
-
|
|
4422
|
+
he,
|
|
4433
4423
|
{
|
|
4434
|
-
value: (l = (
|
|
4424
|
+
value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
|
|
4435
4425
|
onValueChange: t,
|
|
4436
4426
|
defaultValue: "none",
|
|
4437
4427
|
children: [
|
|
4438
|
-
/* @__PURE__ */ e.jsx(
|
|
4439
|
-
/* @__PURE__ */ e.jsx(
|
|
4440
|
-
/* @__PURE__ */ e.jsx(
|
|
4428
|
+
/* @__PURE__ */ e.jsx(me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, { placeholder: "Select position" }) }),
|
|
4429
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4430
|
+
/* @__PURE__ */ e.jsx(fe, { children: "Data Labels" }),
|
|
4441
4431
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
|
|
4442
4432
|
a !== "pyramid" && /* @__PURE__ */ e.jsx(Q, { value: "start", children: "Start" }),
|
|
4443
4433
|
/* @__PURE__ */ e.jsx(Q, { value: "center", children: "Center" }),
|
|
@@ -4448,7 +4438,7 @@ function Hs() {
|
|
|
4448
4438
|
)
|
|
4449
4439
|
] });
|
|
4450
4440
|
}
|
|
4451
|
-
function
|
|
4441
|
+
function Cl({
|
|
4452
4442
|
cardType: s
|
|
4453
4443
|
}) {
|
|
4454
4444
|
function n(a) {
|
|
@@ -4468,7 +4458,7 @@ function vl({
|
|
|
4468
4458
|
"a",
|
|
4469
4459
|
{
|
|
4470
4460
|
target: "_blank",
|
|
4471
|
-
onClick: (
|
|
4461
|
+
onClick: (o) => o.stopPropagation(),
|
|
4472
4462
|
className: "text-blue-700",
|
|
4473
4463
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4474
4464
|
children: "example"
|
|
@@ -4479,24 +4469,24 @@ function vl({
|
|
|
4479
4469
|
] });
|
|
4480
4470
|
}
|
|
4481
4471
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4482
|
-
/* @__PURE__ */ e.jsxs(
|
|
4483
|
-
/* @__PURE__ */ e.jsx(
|
|
4484
|
-
/* @__PURE__ */ e.jsx(
|
|
4472
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4473
|
+
/* @__PURE__ */ e.jsx(G, { children: `${qs(s)} Chart` }),
|
|
4474
|
+
/* @__PURE__ */ e.jsx(K, { className: "space-y-4 font-mono text-xs", children: n(s) })
|
|
4485
4475
|
] }),
|
|
4486
|
-
/* @__PURE__ */ e.jsxs(
|
|
4487
|
-
/* @__PURE__ */ e.jsx(
|
|
4488
|
-
/* @__PURE__ */ e.jsx(
|
|
4476
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
4477
|
+
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
4478
|
+
/* @__PURE__ */ e.jsx(K, { className: "px-2", children: /* @__PURE__ */ e.jsx($s, {}) })
|
|
4489
4479
|
] }),
|
|
4490
|
-
/* @__PURE__ */ e.jsxs(
|
|
4491
|
-
/* @__PURE__ */ e.jsx(
|
|
4492
|
-
/* @__PURE__ */ e.jsxs(
|
|
4480
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
4481
|
+
/* @__PURE__ */ e.jsx(G, { children: "Filters" }),
|
|
4482
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4493
4483
|
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
4494
4484
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
4495
4485
|
] })
|
|
4496
4486
|
] })
|
|
4497
4487
|
] }) });
|
|
4498
4488
|
}
|
|
4499
|
-
const
|
|
4489
|
+
const Sl = {
|
|
4500
4490
|
datasets: [
|
|
4501
4491
|
{
|
|
4502
4492
|
type: "line",
|
|
@@ -4509,7 +4499,7 @@ const Nl = {
|
|
|
4509
4499
|
data: []
|
|
4510
4500
|
}
|
|
4511
4501
|
]
|
|
4512
|
-
},
|
|
4502
|
+
}, wl = {
|
|
4513
4503
|
datasets: [
|
|
4514
4504
|
{
|
|
4515
4505
|
fill: "origin",
|
|
@@ -4519,8 +4509,8 @@ const Nl = {
|
|
|
4519
4509
|
}
|
|
4520
4510
|
]
|
|
4521
4511
|
};
|
|
4522
|
-
function
|
|
4523
|
-
const s =
|
|
4512
|
+
function kl() {
|
|
4513
|
+
const s = c((n) => n.card.type);
|
|
4524
4514
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4525
4515
|
/* @__PURE__ */ e.jsx(
|
|
4526
4516
|
Le,
|
|
@@ -4528,23 +4518,23 @@ function Sl() {
|
|
|
4528
4518
|
className: " ",
|
|
4529
4519
|
type: "single",
|
|
4530
4520
|
collapsible: !0,
|
|
4531
|
-
children:
|
|
4521
|
+
children: zl(s)
|
|
4532
4522
|
}
|
|
4533
4523
|
),
|
|
4534
4524
|
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(cs, {}) }),
|
|
4535
4525
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4536
|
-
/* @__PURE__ */ e.jsx(
|
|
4526
|
+
/* @__PURE__ */ e.jsx($s, {}),
|
|
4537
4527
|
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
4538
4528
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
4539
4529
|
] })
|
|
4540
4530
|
] });
|
|
4541
4531
|
}
|
|
4542
|
-
function
|
|
4532
|
+
function zl(s) {
|
|
4543
4533
|
if (["line", "bar"].includes(s))
|
|
4544
4534
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4545
|
-
/* @__PURE__ */ e.jsxs(
|
|
4546
|
-
/* @__PURE__ */ e.jsx(
|
|
4547
|
-
/* @__PURE__ */ e.jsxs(
|
|
4535
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4536
|
+
/* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
4537
|
+
/* @__PURE__ */ e.jsxs(K, { className: " ", children: [
|
|
4548
4538
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
|
|
4549
4539
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
4550
4540
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
|
|
@@ -4552,20 +4542,20 @@ function wl(s) {
|
|
|
4552
4542
|
] })
|
|
4553
4543
|
] })
|
|
4554
4544
|
] }),
|
|
4555
|
-
/* @__PURE__ */ e.jsxs(
|
|
4556
|
-
/* @__PURE__ */ e.jsx(
|
|
4557
|
-
/* @__PURE__ */ e.jsxs(
|
|
4545
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
4546
|
+
/* @__PURE__ */ e.jsx(G, { className: "font-normal", children: "Mixed Chart" }),
|
|
4547
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-2 text-xs", children: [
|
|
4558
4548
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
4559
4549
|
"Click ",
|
|
4560
4550
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
4561
4551
|
" and change the `type` property in the dataset."
|
|
4562
4552
|
] }),
|
|
4563
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4553
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Sl, null, 2) })
|
|
4564
4554
|
] })
|
|
4565
4555
|
] }),
|
|
4566
|
-
/* @__PURE__ */ e.jsxs(
|
|
4567
|
-
/* @__PURE__ */ e.jsx(
|
|
4568
|
-
/* @__PURE__ */ e.jsxs(
|
|
4556
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
4557
|
+
/* @__PURE__ */ e.jsx(G, { className: "font-normal", children: "Area Chart" }),
|
|
4558
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-2 text-xs", children: [
|
|
4569
4559
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
4570
4560
|
"Click ",
|
|
4571
4561
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -4581,18 +4571,18 @@ function wl(s) {
|
|
|
4581
4571
|
),
|
|
4582
4572
|
"for more options."
|
|
4583
4573
|
] }),
|
|
4584
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4574
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(wl, null, 2) })
|
|
4585
4575
|
] })
|
|
4586
4576
|
] })
|
|
4587
4577
|
] });
|
|
4588
4578
|
if (s === "bubble")
|
|
4589
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
4590
|
-
/* @__PURE__ */ e.jsx(
|
|
4579
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4580
|
+
/* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
4591
4581
|
"How to create a ",
|
|
4592
4582
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
4593
4583
|
" chart query?"
|
|
4594
4584
|
] }) }),
|
|
4595
|
-
/* @__PURE__ */ e.jsxs(
|
|
4585
|
+
/* @__PURE__ */ e.jsxs(K, { className: " ", children: [
|
|
4596
4586
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
|
|
4597
4587
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
4598
4588
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -4604,13 +4594,13 @@ function wl(s) {
|
|
|
4604
4594
|
] })
|
|
4605
4595
|
] }) });
|
|
4606
4596
|
if (s === "scatter")
|
|
4607
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
4608
|
-
/* @__PURE__ */ e.jsx(
|
|
4597
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4598
|
+
/* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
4609
4599
|
"How to create a ",
|
|
4610
4600
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
4611
4601
|
" chart query?"
|
|
4612
4602
|
] }) }),
|
|
4613
|
-
/* @__PURE__ */ e.jsxs(
|
|
4603
|
+
/* @__PURE__ */ e.jsxs(K, { className: " ", children: [
|
|
4614
4604
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
|
|
4615
4605
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
4616
4606
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -4621,13 +4611,13 @@ function wl(s) {
|
|
|
4621
4611
|
] })
|
|
4622
4612
|
] }) });
|
|
4623
4613
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
4624
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
4625
|
-
/* @__PURE__ */ e.jsx(
|
|
4614
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4615
|
+
/* @__PURE__ */ e.jsx(G, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
4626
4616
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
4627
4617
|
" ",
|
|
4628
4618
|
"chart query"
|
|
4629
4619
|
] }) }),
|
|
4630
|
-
/* @__PURE__ */ e.jsxs(
|
|
4620
|
+
/* @__PURE__ */ e.jsxs(K, { className: " ", children: [
|
|
4631
4621
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
|
|
4632
4622
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
4633
4623
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -4636,53 +4626,53 @@ function wl(s) {
|
|
|
4636
4626
|
] })
|
|
4637
4627
|
] }) });
|
|
4638
4628
|
}
|
|
4639
|
-
function
|
|
4640
|
-
var d, p,
|
|
4641
|
-
const s =
|
|
4642
|
-
(
|
|
4643
|
-
), a =
|
|
4644
|
-
(
|
|
4629
|
+
function Fl() {
|
|
4630
|
+
var d, p, h, y, x;
|
|
4631
|
+
const s = c((m) => m.card.preferences), n = c(
|
|
4632
|
+
(m) => m.actions.setCardPreferences
|
|
4633
|
+
), a = c(
|
|
4634
|
+
(m) => m.actions.setNumberFormat
|
|
4645
4635
|
);
|
|
4646
|
-
|
|
4647
|
-
(
|
|
4648
|
-
var
|
|
4649
|
-
return (
|
|
4636
|
+
c(
|
|
4637
|
+
(m) => {
|
|
4638
|
+
var f, u;
|
|
4639
|
+
return (u = (f = m.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : u.decimalPlaces;
|
|
4650
4640
|
}
|
|
4651
4641
|
);
|
|
4652
|
-
const t =
|
|
4653
|
-
(
|
|
4654
|
-
var
|
|
4655
|
-
return (
|
|
4642
|
+
const t = c(
|
|
4643
|
+
(m) => {
|
|
4644
|
+
var f, u;
|
|
4645
|
+
return (u = (f = m.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : u.locale;
|
|
4656
4646
|
}
|
|
4657
|
-
), i =
|
|
4658
|
-
(
|
|
4659
|
-
var
|
|
4660
|
-
return (
|
|
4647
|
+
), i = c(
|
|
4648
|
+
(m) => {
|
|
4649
|
+
var f, u;
|
|
4650
|
+
return (u = (f = m.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : u.currency;
|
|
4661
4651
|
}
|
|
4662
4652
|
);
|
|
4663
|
-
|
|
4664
|
-
(
|
|
4653
|
+
c(
|
|
4654
|
+
(m) => m.actions.setFilterOnClickField
|
|
4665
4655
|
);
|
|
4666
|
-
const
|
|
4667
|
-
(
|
|
4668
|
-
var
|
|
4669
|
-
return (
|
|
4656
|
+
const o = c(
|
|
4657
|
+
(m) => {
|
|
4658
|
+
var f, u;
|
|
4659
|
+
return (u = (f = m.card.preferences) == null ? void 0 : f.formatNumber) == null ? void 0 : u.colorRanges;
|
|
4670
4660
|
}
|
|
4671
|
-
) || [], l =
|
|
4672
|
-
(
|
|
4673
|
-
), r = [...new Set(ns.map((
|
|
4661
|
+
) || [], l = c(
|
|
4662
|
+
(m) => m.actions.setColorRanges
|
|
4663
|
+
), r = [...new Set(ns.map((m) => m.currency))];
|
|
4674
4664
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4675
4665
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4676
4666
|
/* @__PURE__ */ e.jsx(
|
|
4677
4667
|
rs,
|
|
4678
4668
|
{
|
|
4679
4669
|
checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
|
|
4680
|
-
onCheckedChange: (
|
|
4670
|
+
onCheckedChange: (m) => {
|
|
4681
4671
|
n({
|
|
4682
4672
|
...s,
|
|
4683
4673
|
formatNumber: {
|
|
4684
4674
|
...s == null ? void 0 : s.formatNumber,
|
|
4685
|
-
enabled:
|
|
4675
|
+
enabled: m
|
|
4686
4676
|
}
|
|
4687
4677
|
});
|
|
4688
4678
|
}
|
|
@@ -4696,23 +4686,23 @@ function kl() {
|
|
|
4696
4686
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4697
4687
|
/* @__PURE__ */ e.jsx(H, { children: "Locale" }),
|
|
4698
4688
|
/* @__PURE__ */ e.jsxs(
|
|
4699
|
-
|
|
4689
|
+
he,
|
|
4700
4690
|
{
|
|
4701
4691
|
value: t || "en-US",
|
|
4702
|
-
onValueChange: (
|
|
4703
|
-
var
|
|
4692
|
+
onValueChange: (m) => {
|
|
4693
|
+
var f, u, k;
|
|
4704
4694
|
return a(
|
|
4705
|
-
((
|
|
4706
|
-
((
|
|
4707
|
-
|
|
4695
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
|
|
4696
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
4697
|
+
m || "en-US",
|
|
4708
4698
|
((k = s == null ? void 0 : s.formatNumber) == null ? void 0 : k.suffix) || ""
|
|
4709
4699
|
);
|
|
4710
4700
|
},
|
|
4711
4701
|
children: [
|
|
4712
|
-
/* @__PURE__ */ e.jsx(
|
|
4713
|
-
/* @__PURE__ */ e.jsx(
|
|
4714
|
-
/* @__PURE__ */ e.jsx(
|
|
4715
|
-
ns.map((
|
|
4702
|
+
/* @__PURE__ */ e.jsx(me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4703
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4704
|
+
/* @__PURE__ */ e.jsx(fe, { children: "Format" }),
|
|
4705
|
+
ns.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m.locale, children: m.locale }, m.locale))
|
|
4716
4706
|
] }) })
|
|
4717
4707
|
]
|
|
4718
4708
|
}
|
|
@@ -4721,24 +4711,24 @@ function kl() {
|
|
|
4721
4711
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4722
4712
|
/* @__PURE__ */ e.jsx(H, { children: "Currency" }),
|
|
4723
4713
|
/* @__PURE__ */ e.jsxs(
|
|
4724
|
-
|
|
4714
|
+
he,
|
|
4725
4715
|
{
|
|
4726
4716
|
value: i || "none",
|
|
4727
|
-
onValueChange: (
|
|
4728
|
-
var
|
|
4717
|
+
onValueChange: (m) => {
|
|
4718
|
+
var f, u, k;
|
|
4729
4719
|
return a(
|
|
4730
|
-
((
|
|
4731
|
-
|
|
4732
|
-
((
|
|
4720
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
|
|
4721
|
+
m === "none" ? "" : m,
|
|
4722
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
|
|
4733
4723
|
((k = s == null ? void 0 : s.formatNumber) == null ? void 0 : k.suffix) || ""
|
|
4734
4724
|
);
|
|
4735
4725
|
},
|
|
4736
4726
|
children: [
|
|
4737
|
-
/* @__PURE__ */ e.jsx(
|
|
4738
|
-
/* @__PURE__ */ e.jsx(
|
|
4739
|
-
/* @__PURE__ */ e.jsx(
|
|
4727
|
+
/* @__PURE__ */ e.jsx(me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4728
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
4729
|
+
/* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
|
|
4740
4730
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
4741
|
-
r.map((
|
|
4731
|
+
r.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m))
|
|
4742
4732
|
] }) })
|
|
4743
4733
|
]
|
|
4744
4734
|
}
|
|
@@ -4749,21 +4739,21 @@ function kl() {
|
|
|
4749
4739
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4750
4740
|
/* @__PURE__ */ e.jsx(H, { children: "Decimals" }),
|
|
4751
4741
|
/* @__PURE__ */ e.jsxs(
|
|
4752
|
-
|
|
4742
|
+
he,
|
|
4753
4743
|
{
|
|
4754
|
-
value: ((y = (
|
|
4755
|
-
onValueChange: (
|
|
4756
|
-
var
|
|
4744
|
+
value: ((y = (h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.decimalPlaces) == null ? void 0 : y.toString()) || "0",
|
|
4745
|
+
onValueChange: (m) => {
|
|
4746
|
+
var f, u, k;
|
|
4757
4747
|
return a(
|
|
4758
|
-
Number(
|
|
4759
|
-
((
|
|
4760
|
-
((
|
|
4748
|
+
Number(m),
|
|
4749
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
|
|
4750
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
|
|
4761
4751
|
((k = s == null ? void 0 : s.formatNumber) == null ? void 0 : k.suffix) || ""
|
|
4762
4752
|
);
|
|
4763
4753
|
},
|
|
4764
4754
|
children: [
|
|
4765
|
-
/* @__PURE__ */ e.jsx(
|
|
4766
|
-
/* @__PURE__ */ e.jsx(
|
|
4755
|
+
/* @__PURE__ */ e.jsx(me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
|
|
4756
|
+
/* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m)) })
|
|
4767
4757
|
]
|
|
4768
4758
|
}
|
|
4769
4759
|
)
|
|
@@ -4771,18 +4761,18 @@ function kl() {
|
|
|
4771
4761
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
4772
4762
|
/* @__PURE__ */ e.jsx(H, { children: "Suffix" }),
|
|
4773
4763
|
/* @__PURE__ */ e.jsx(
|
|
4774
|
-
|
|
4764
|
+
Ce,
|
|
4775
4765
|
{
|
|
4776
4766
|
value: ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.suffix) || "",
|
|
4777
4767
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
4778
4768
|
placeholder: "K, M, B, %",
|
|
4779
|
-
onChange: (
|
|
4780
|
-
var
|
|
4769
|
+
onChange: (m) => {
|
|
4770
|
+
var f, u, k;
|
|
4781
4771
|
return a(
|
|
4782
|
-
((
|
|
4783
|
-
((
|
|
4772
|
+
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.decimalPlaces) || 0,
|
|
4773
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
4784
4774
|
((k = s == null ? void 0 : s.formatNumber) == null ? void 0 : k.locale) || "",
|
|
4785
|
-
|
|
4775
|
+
m.target.value
|
|
4786
4776
|
);
|
|
4787
4777
|
}
|
|
4788
4778
|
}
|
|
@@ -4794,18 +4784,18 @@ function kl() {
|
|
|
4794
4784
|
/* @__PURE__ */ e.jsx(
|
|
4795
4785
|
Jt,
|
|
4796
4786
|
{
|
|
4797
|
-
colorRanges:
|
|
4787
|
+
colorRanges: o,
|
|
4798
4788
|
setColorRanges: l
|
|
4799
4789
|
}
|
|
4800
4790
|
)
|
|
4801
4791
|
] })
|
|
4802
4792
|
] });
|
|
4803
4793
|
}
|
|
4804
|
-
function
|
|
4794
|
+
function Ll() {
|
|
4805
4795
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4806
|
-
/* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4807
|
-
/* @__PURE__ */ e.jsx(
|
|
4808
|
-
/* @__PURE__ */ e.jsxs(
|
|
4796
|
+
/* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4797
|
+
/* @__PURE__ */ e.jsx(G, { className: "", children: "KPI Query" }),
|
|
4798
|
+
/* @__PURE__ */ e.jsxs(K, { className: "font-mono", children: [
|
|
4809
4799
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
4810
4800
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4811
4801
|
/* @__PURE__ */ e.jsx("li", { children: "current - number" }),
|
|
@@ -4827,14 +4817,14 @@ function zl() {
|
|
|
4827
4817
|
] })
|
|
4828
4818
|
] })
|
|
4829
4819
|
] }) }),
|
|
4830
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
4820
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Fl, {}) }),
|
|
4831
4821
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
4832
4822
|
/* @__PURE__ */ e.jsx("div", {})
|
|
4833
4823
|
] });
|
|
4834
4824
|
}
|
|
4835
|
-
function
|
|
4825
|
+
function Tl() {
|
|
4836
4826
|
var t;
|
|
4837
|
-
const s =
|
|
4827
|
+
const s = c((i) => i.card.preferences), { setCardPreferences: n } = c((i) => i.actions);
|
|
4838
4828
|
function a(i) {
|
|
4839
4829
|
n({
|
|
4840
4830
|
...s,
|
|
@@ -4870,9 +4860,9 @@ function Ze({
|
|
|
4870
4860
|
suffix: a = "Chart"
|
|
4871
4861
|
}) {
|
|
4872
4862
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4873
|
-
/* @__PURE__ */ e.jsxs(
|
|
4874
|
-
/* @__PURE__ */ e.jsx(
|
|
4875
|
-
/* @__PURE__ */ e.jsx(
|
|
4863
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4864
|
+
/* @__PURE__ */ e.jsx(G, { children: `${qs(s)} ${a}` }),
|
|
4865
|
+
/* @__PURE__ */ e.jsx(K, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4876
4866
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
4877
4867
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4878
4868
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
@@ -4894,28 +4884,28 @@ function Ze({
|
|
|
4894
4884
|
] })
|
|
4895
4885
|
] }) })
|
|
4896
4886
|
] }),
|
|
4897
|
-
/* @__PURE__ */ e.jsxs(
|
|
4898
|
-
/* @__PURE__ */ e.jsx(
|
|
4899
|
-
/* @__PURE__ */ e.jsxs(
|
|
4887
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
4888
|
+
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
4889
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4900
4890
|
s === "range" && /* @__PURE__ */ e.jsx(cs, {}),
|
|
4901
|
-
s !== "text" && /* @__PURE__ */ e.jsx(
|
|
4902
|
-
s === "text" && /* @__PURE__ */ e.jsx(
|
|
4891
|
+
s !== "text" && /* @__PURE__ */ e.jsx($s, {}),
|
|
4892
|
+
s === "text" && /* @__PURE__ */ e.jsx(Tl, {})
|
|
4903
4893
|
] })
|
|
4904
4894
|
] }),
|
|
4905
|
-
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(
|
|
4906
|
-
/* @__PURE__ */ e.jsx(
|
|
4907
|
-
/* @__PURE__ */ e.jsxs(
|
|
4895
|
+
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
4896
|
+
/* @__PURE__ */ e.jsx(G, { children: "Filters" }),
|
|
4897
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4908
4898
|
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
4909
4899
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
4910
4900
|
] })
|
|
4911
4901
|
] })
|
|
4912
4902
|
] }) });
|
|
4913
4903
|
}
|
|
4914
|
-
function
|
|
4904
|
+
function Dl() {
|
|
4915
4905
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4916
|
-
/* @__PURE__ */ e.jsxs(
|
|
4917
|
-
/* @__PURE__ */ e.jsx(
|
|
4918
|
-
/* @__PURE__ */ e.jsxs(
|
|
4906
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4907
|
+
/* @__PURE__ */ e.jsx(G, { children: "Stacked Chart" }),
|
|
4908
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 font-mono text-xs", children: [
|
|
4919
4909
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
4920
4910
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4921
4911
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -4938,27 +4928,27 @@ function Ll() {
|
|
|
4938
4928
|
] })
|
|
4939
4929
|
] })
|
|
4940
4930
|
] }),
|
|
4941
|
-
/* @__PURE__ */ e.jsxs(
|
|
4942
|
-
/* @__PURE__ */ e.jsx(
|
|
4943
|
-
/* @__PURE__ */ e.jsxs(
|
|
4931
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
4932
|
+
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
4933
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4944
4934
|
/* @__PURE__ */ e.jsx(cs, {}),
|
|
4945
|
-
/* @__PURE__ */ e.jsx(
|
|
4935
|
+
/* @__PURE__ */ e.jsx(Ka, {})
|
|
4946
4936
|
] })
|
|
4947
4937
|
] }),
|
|
4948
|
-
/* @__PURE__ */ e.jsxs(
|
|
4949
|
-
/* @__PURE__ */ e.jsx(
|
|
4950
|
-
/* @__PURE__ */ e.jsxs(
|
|
4938
|
+
/* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
4939
|
+
/* @__PURE__ */ e.jsx(G, { children: "Filters" }),
|
|
4940
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4951
4941
|
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
4952
4942
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
4953
4943
|
] })
|
|
4954
4944
|
] })
|
|
4955
4945
|
] }) });
|
|
4956
4946
|
}
|
|
4957
|
-
function
|
|
4958
|
-
const s =
|
|
4947
|
+
function Il({}) {
|
|
4948
|
+
const s = c((t) => {
|
|
4959
4949
|
var i;
|
|
4960
4950
|
return (i = t.card) == null ? void 0 : i.preferences;
|
|
4961
|
-
}), n =
|
|
4951
|
+
}), n = c(
|
|
4962
4952
|
(t) => t.actions.setCardPreferences
|
|
4963
4953
|
), a = (t) => {
|
|
4964
4954
|
n({
|
|
@@ -4967,9 +4957,9 @@ function Tl({}) {
|
|
|
4967
4957
|
});
|
|
4968
4958
|
};
|
|
4969
4959
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4970
|
-
/* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(
|
|
4971
|
-
/* @__PURE__ */ e.jsx(
|
|
4972
|
-
/* @__PURE__ */ e.jsxs(
|
|
4960
|
+
/* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
4961
|
+
/* @__PURE__ */ e.jsx(G, { children: "Filters" }),
|
|
4962
|
+
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4973
4963
|
/* @__PURE__ */ e.jsx(Oe, {}),
|
|
4974
4964
|
/* @__PURE__ */ e.jsx(Ae, {})
|
|
4975
4965
|
] })
|
|
@@ -4987,7 +4977,7 @@ function Tl({}) {
|
|
|
4987
4977
|
] })
|
|
4988
4978
|
] });
|
|
4989
4979
|
}
|
|
4990
|
-
const
|
|
4980
|
+
const Ml = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4991
4981
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
4992
4982
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4993
4983
|
"See ",
|
|
@@ -5003,7 +4993,7 @@ const Dl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5003
4993
|
),
|
|
5004
4994
|
" in the docs."
|
|
5005
4995
|
] })
|
|
5006
|
-
] }),
|
|
4996
|
+
] }), Ol = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5007
4997
|
/* @__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" }),
|
|
5008
4998
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5009
4999
|
"See ",
|
|
@@ -5019,7 +5009,7 @@ const Dl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5019
5009
|
),
|
|
5020
5010
|
" in the docs."
|
|
5021
5011
|
] })
|
|
5022
|
-
] }),
|
|
5012
|
+
] }), Al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5023
5013
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
|
|
5024
5014
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5025
5015
|
"See ",
|
|
@@ -5036,22 +5026,22 @@ const Dl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5036
5026
|
" in the docs."
|
|
5037
5027
|
] })
|
|
5038
5028
|
] });
|
|
5039
|
-
function
|
|
5040
|
-
const s =
|
|
5029
|
+
function El() {
|
|
5030
|
+
const s = c((a) => a.card.type);
|
|
5041
5031
|
function n(a) {
|
|
5042
5032
|
switch (a) {
|
|
5043
5033
|
case "stackedBar":
|
|
5044
5034
|
case "stackedLine":
|
|
5045
|
-
return /* @__PURE__ */ e.jsx(
|
|
5035
|
+
return /* @__PURE__ */ e.jsx(Dl, {});
|
|
5046
5036
|
case "pyramid":
|
|
5047
|
-
return /* @__PURE__ */ e.jsx(Ze, { docContent:
|
|
5037
|
+
return /* @__PURE__ */ e.jsx(Ze, { docContent: Ml, cardType: a });
|
|
5048
5038
|
case "kpi":
|
|
5049
|
-
return /* @__PURE__ */ e.jsx(
|
|
5039
|
+
return /* @__PURE__ */ e.jsx(Ll, {});
|
|
5050
5040
|
case "line":
|
|
5051
5041
|
case "bar":
|
|
5052
|
-
return /* @__PURE__ */ e.jsx(
|
|
5042
|
+
return /* @__PURE__ */ e.jsx(Nl, { cardType: a });
|
|
5053
5043
|
case "range":
|
|
5054
|
-
return /* @__PURE__ */ e.jsx(Ze, { docContent:
|
|
5044
|
+
return /* @__PURE__ */ e.jsx(Ze, { docContent: Ol, cardType: a });
|
|
5055
5045
|
case "pie":
|
|
5056
5046
|
case "doughnut":
|
|
5057
5047
|
case "polarArea":
|
|
@@ -5059,30 +5049,30 @@ function Ol() {
|
|
|
5059
5049
|
return /* @__PURE__ */ e.jsx(Ze, { cardType: a });
|
|
5060
5050
|
case "bubble":
|
|
5061
5051
|
case "scatter":
|
|
5062
|
-
return /* @__PURE__ */ e.jsx(
|
|
5052
|
+
return /* @__PURE__ */ e.jsx(Cl, { cardType: a });
|
|
5063
5053
|
case "table":
|
|
5064
|
-
return /* @__PURE__ */ e.jsx(
|
|
5054
|
+
return /* @__PURE__ */ e.jsx(Il, { cardType: a });
|
|
5065
5055
|
case "text":
|
|
5066
5056
|
return /* @__PURE__ */ e.jsx(
|
|
5067
5057
|
Ze,
|
|
5068
5058
|
{
|
|
5069
|
-
docContent:
|
|
5059
|
+
docContent: Al,
|
|
5070
5060
|
cardType: a,
|
|
5071
5061
|
suffix: "Visual"
|
|
5072
5062
|
}
|
|
5073
5063
|
);
|
|
5074
5064
|
case "custom":
|
|
5075
|
-
return /* @__PURE__ */ e.jsx(
|
|
5065
|
+
return /* @__PURE__ */ e.jsx(jl, {});
|
|
5076
5066
|
default:
|
|
5077
|
-
return /* @__PURE__ */ e.jsx(
|
|
5067
|
+
return /* @__PURE__ */ e.jsx(kl, {});
|
|
5078
5068
|
}
|
|
5079
5069
|
}
|
|
5080
|
-
return /* @__PURE__ */ e.jsx(
|
|
5070
|
+
return /* @__PURE__ */ e.jsx(Vs, { className: "h-full w-full text-sm", children: n(s) });
|
|
5081
5071
|
}
|
|
5082
|
-
function
|
|
5083
|
-
const s =
|
|
5072
|
+
function Vl() {
|
|
5073
|
+
const s = c((n) => n.isShowingVisual);
|
|
5084
5074
|
return /* @__PURE__ */ e.jsxs(
|
|
5085
|
-
|
|
5075
|
+
js,
|
|
5086
5076
|
{
|
|
5087
5077
|
direction: "vertical",
|
|
5088
5078
|
className: "min-h-[250px] min-w-full max-w-lg",
|
|
@@ -5097,7 +5087,7 @@ function Al() {
|
|
|
5097
5087
|
children: /* @__PURE__ */ e.jsx(rl, {})
|
|
5098
5088
|
}
|
|
5099
5089
|
),
|
|
5100
|
-
/* @__PURE__ */ e.jsx(
|
|
5090
|
+
/* @__PURE__ */ e.jsx(bs, { withHandle: !0, className: "border" }),
|
|
5101
5091
|
/* @__PURE__ */ e.jsx(
|
|
5102
5092
|
De,
|
|
5103
5093
|
{
|
|
@@ -5105,7 +5095,7 @@ function Al() {
|
|
|
5105
5095
|
role: "visual-section",
|
|
5106
5096
|
minSize: 0,
|
|
5107
5097
|
defaultSize: 60,
|
|
5108
|
-
children: s ? /* @__PURE__ */ e.jsxs(
|
|
5098
|
+
children: s ? /* @__PURE__ */ e.jsxs(js, { direction: "horizontal", children: [
|
|
5109
5099
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
5110
5100
|
De,
|
|
5111
5101
|
{
|
|
@@ -5113,10 +5103,10 @@ function Al() {
|
|
|
5113
5103
|
minSize: 20,
|
|
5114
5104
|
defaultSize: 25,
|
|
5115
5105
|
maxSize: 30,
|
|
5116
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5106
|
+
children: /* @__PURE__ */ e.jsx(El, {})
|
|
5117
5107
|
}
|
|
5118
5108
|
) }),
|
|
5119
|
-
/* @__PURE__ */ e.jsx(
|
|
5109
|
+
/* @__PURE__ */ e.jsx(bs, { className: "border" }),
|
|
5120
5110
|
/* @__PURE__ */ e.jsx(De, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(ea, {}) })
|
|
5121
5111
|
] }) : /* @__PURE__ */ e.jsx(ea, {})
|
|
5122
5112
|
}
|
|
@@ -5125,24 +5115,24 @@ function Al() {
|
|
|
5125
5115
|
}
|
|
5126
5116
|
);
|
|
5127
5117
|
}
|
|
5128
|
-
function
|
|
5129
|
-
const t =
|
|
5118
|
+
function ql({ authToken: s, onSave: n, onClose: a }) {
|
|
5119
|
+
const t = c((l) => l.actions.setOnSave), i = c((l) => l.actions.setOnClose), o = z((l) => l.actions.setAuthToken);
|
|
5130
5120
|
return Z(() => {
|
|
5131
5121
|
n && t(n), a && i(a);
|
|
5132
5122
|
}, [n, t, a, i]), Z(() => {
|
|
5133
|
-
s && s.accessToken &&
|
|
5134
|
-
}, [s,
|
|
5135
|
-
/* @__PURE__ */ e.jsx(Xt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(
|
|
5136
|
-
/* @__PURE__ */ e.jsx(Zt, { children: /* @__PURE__ */ e.jsx(
|
|
5123
|
+
s && s.accessToken && o(s);
|
|
5124
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(Yt, { className: "rounded-none", role: "editor-panel", children: [
|
|
5125
|
+
/* @__PURE__ */ e.jsx(Xt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ma, {}) }),
|
|
5126
|
+
/* @__PURE__ */ e.jsx(Zt, { children: /* @__PURE__ */ e.jsx(Vl, {}) })
|
|
5137
5127
|
] });
|
|
5138
5128
|
}
|
|
5139
|
-
function
|
|
5129
|
+
function Rl() {
|
|
5140
5130
|
z((l) => l.selectedCardId);
|
|
5141
5131
|
const s = z((l) => l.selectedSheetId), { setIsVisualEditing: n } = z((l) => l.actions), a = z((l) => l.isVisualEditing), t = z((l) => l.actions.updateFrame);
|
|
5142
5132
|
function i(l) {
|
|
5143
5133
|
s && (t(s, l), n(!1));
|
|
5144
5134
|
}
|
|
5145
|
-
function
|
|
5135
|
+
function o() {
|
|
5146
5136
|
n(!1);
|
|
5147
5137
|
}
|
|
5148
5138
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -5153,27 +5143,27 @@ function Vl() {
|
|
|
5153
5143
|
block: a,
|
|
5154
5144
|
hidden: !a
|
|
5155
5145
|
}),
|
|
5156
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5146
|
+
children: /* @__PURE__ */ e.jsx(ql, { onSave: i, onClose: o })
|
|
5157
5147
|
}
|
|
5158
5148
|
);
|
|
5159
5149
|
}
|
|
5160
|
-
function
|
|
5161
|
-
|
|
5162
|
-
const s =
|
|
5163
|
-
|
|
5164
|
-
const n =
|
|
5150
|
+
function _l() {
|
|
5151
|
+
c((l) => l.selectedConnectionId), c((l) => l.selectedDatamodelId);
|
|
5152
|
+
const s = c((l) => l.selectedDatabaseName);
|
|
5153
|
+
c((l) => l.selectedSchemaName);
|
|
5154
|
+
const n = c((l) => l.selectedTableName), a = z((l) => l.dashboard.filters) || [];
|
|
5165
5155
|
z((l) => l.actions.addFilter), z((l) => l.actions.removeFilter), z(
|
|
5166
5156
|
(l) => l.actions.removeFilterValue
|
|
5167
5157
|
);
|
|
5168
|
-
const { modelItems: t, columns: i } = Me(), { assignFilter:
|
|
5158
|
+
const { modelItems: t, columns: i } = Me(), { assignFilter: o } = Pa();
|
|
5169
5159
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: i == null ? void 0 : i.map((l) => {
|
|
5170
5160
|
const r = a == null ? void 0 : a.find(
|
|
5171
|
-
(d) => d.column ===
|
|
5161
|
+
(d) => d.column === ue(l.column_name) && d.table === n && d.database === s
|
|
5172
5162
|
);
|
|
5173
5163
|
return /* @__PURE__ */ e.jsx(
|
|
5174
5164
|
"div",
|
|
5175
5165
|
{
|
|
5176
|
-
onClick: () =>
|
|
5166
|
+
onClick: () => o(l),
|
|
5177
5167
|
className: J(
|
|
5178
5168
|
"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",
|
|
5179
5169
|
{
|
|
@@ -5181,7 +5171,7 @@ function ql() {
|
|
|
5181
5171
|
}
|
|
5182
5172
|
),
|
|
5183
5173
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5184
|
-
/* @__PURE__ */ e.jsx(
|
|
5174
|
+
/* @__PURE__ */ e.jsx(Ia, { column: l }),
|
|
5185
5175
|
/* @__PURE__ */ e.jsx("span", { children: l.column_name })
|
|
5186
5176
|
] })
|
|
5187
5177
|
},
|
|
@@ -5189,7 +5179,7 @@ function ql() {
|
|
|
5189
5179
|
);
|
|
5190
5180
|
}) });
|
|
5191
5181
|
}
|
|
5192
|
-
function
|
|
5182
|
+
function Hl() {
|
|
5193
5183
|
z((n) => n.showFilters);
|
|
5194
5184
|
const s = z(
|
|
5195
5185
|
(n) => n.actions.setShowFilters
|
|
@@ -5208,12 +5198,12 @@ function Rl() {
|
|
|
5208
5198
|
)
|
|
5209
5199
|
] }),
|
|
5210
5200
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
5211
|
-
|
|
5201
|
+
Ma,
|
|
5212
5202
|
{
|
|
5213
5203
|
ColumnsComponent: () => (
|
|
5214
5204
|
// schemaName, tableName, columns
|
|
5215
5205
|
/* @__PURE__ */ e.jsx(
|
|
5216
|
-
|
|
5206
|
+
_l,
|
|
5217
5207
|
{}
|
|
5218
5208
|
)
|
|
5219
5209
|
)
|
|
@@ -5221,7 +5211,7 @@ function Rl() {
|
|
|
5221
5211
|
) })
|
|
5222
5212
|
] });
|
|
5223
5213
|
}
|
|
5224
|
-
function
|
|
5214
|
+
function $l() {
|
|
5225
5215
|
const s = z((a) => a.showFilters), n = z((a) => a.isVisualEditing);
|
|
5226
5216
|
return /* @__PURE__ */ e.jsxs(
|
|
5227
5217
|
"div",
|
|
@@ -5233,12 +5223,12 @@ function _l() {
|
|
|
5233
5223
|
}),
|
|
5234
5224
|
children: [
|
|
5235
5225
|
/* @__PURE__ */ e.jsx(en, {}),
|
|
5236
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
5226
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(Hl, {}) })
|
|
5237
5227
|
]
|
|
5238
5228
|
}
|
|
5239
5229
|
);
|
|
5240
5230
|
}
|
|
5241
|
-
function
|
|
5231
|
+
function Bl() {
|
|
5242
5232
|
const s = z((t) => t.dashboard), n = z((t) => t.actions.setDashboard), a = z(
|
|
5243
5233
|
(t) => t.showDashboardJSON
|
|
5244
5234
|
);
|
|
@@ -5282,7 +5272,7 @@ function Hl() {
|
|
|
5282
5272
|
}
|
|
5283
5273
|
);
|
|
5284
5274
|
}
|
|
5285
|
-
function
|
|
5275
|
+
function Kl({
|
|
5286
5276
|
showControls: s = !1,
|
|
5287
5277
|
showFooter: n = !0,
|
|
5288
5278
|
...a
|
|
@@ -5290,20 +5280,20 @@ function Pl({
|
|
|
5290
5280
|
return /* @__PURE__ */ e.jsxs(an, { dashboardProps: a, children: [
|
|
5291
5281
|
/* @__PURE__ */ e.jsx(tn, {}),
|
|
5292
5282
|
/* @__PURE__ */ e.jsxs(nn, { children: [
|
|
5293
|
-
/* @__PURE__ */ e.jsx(
|
|
5283
|
+
/* @__PURE__ */ e.jsx(Bl, {}),
|
|
5294
5284
|
/* @__PURE__ */ e.jsxs(ln, { ...a, children: [
|
|
5295
5285
|
s && /* @__PURE__ */ e.jsx(Bn, {}),
|
|
5296
|
-
/* @__PURE__ */ e.jsx(
|
|
5297
|
-
/* @__PURE__ */ e.jsx(
|
|
5286
|
+
/* @__PURE__ */ e.jsx(Rl, {}),
|
|
5287
|
+
/* @__PURE__ */ e.jsx($l, {})
|
|
5298
5288
|
] })
|
|
5299
5289
|
] })
|
|
5300
5290
|
] });
|
|
5301
5291
|
}
|
|
5302
5292
|
export {
|
|
5303
|
-
|
|
5293
|
+
Kl as D,
|
|
5304
5294
|
Be as L,
|
|
5305
5295
|
Ve as S,
|
|
5306
5296
|
Vn as c,
|
|
5307
|
-
|
|
5297
|
+
Da as g,
|
|
5308
5298
|
Me as u
|
|
5309
5299
|
};
|