react-semaphor 0.0.171 → 0.0.172
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-d-vEzLOy.js → dashboard-plus--7LpBCrZ.js} +959 -951
- package/dist/chunks/dashboard-plus-lvg4fidr.js +215 -0
- package/dist/chunks/index-QbRtnHXN.js +384 -0
- package/dist/chunks/{index-I8_5WKph.js → index-eANGYKf6.js} +5435 -5370
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +2 -2
- package/dist/chunks/dashboard-plus-itQfUsL8.js +0 -215
- package/dist/chunks/index-d4Wt3XC_.js +0 -384
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import
|
|
1
|
+
import { P as z, b as S, j as e, Q as is, R as os, U as w, V as cs, W as ds, X as hs, Y as us, Z as _, _ as Q, $ as Bs, J as $s, O as ze, a0 as Et, a1 as Lt, a2 as Dt, a3 as It, a4 as qt, a5 as Vt, a6 as Os, a7 as Le, a8 as Qe, a9 as $e, T as We, e as ms, g as Pe, aa as xs, ab as ps, f as W, ac as fs, ad as gs, ae as js, af as Ke, ag as xe, G as l, ah as qe, ai as Ve, aj as Rt, ak as Re, w as Ks, v as Us, t as ce, al as _t, r as Ht, N as Gs, s as Bt, am as $t, B as Kt, an as Js, L as De, S as bs, z as Ut, n as zs, A as as, u as Ye, ao as Ne, ap as Fe, aq as Gt, ar as Jt, as as Qt, at as Qs, au as Ws, av as Ps, aw as Ys, ax as Xs, ay as Wt, az as Zs, aA as et, aB as Pt, aC as Yt, aD as Xt, aE as Zt, aF as ea, aG as ns, aH as sa, aI as Be, aJ as Ms, aK as ta, aL as aa, aM as na, aN as ra, aO as la, aP as ts, aQ as ia, aR as Ts, aS as oa, aT as As, aU as ca, aV as da, aW as ha, aX as st, l as ua, C as ma, E as Es, d as xa, h as pa, i as fa, o as ga, aY as ja, m as ba, aZ as ya, a_ as va, a$ as Na, b0 as Ls, b1 as Ca, b2 as Ds, b3 as Is, K as Sa, b4 as tt, b5 as ka, b6 as at, b7 as Ue, b8 as nt, b9 as wa, ba as Fa, bb as Oa, bc as za, bd as Ma, be as Ta, bf as Ce, bg as I, bh as q, bi as ys, bj as V, bk as Aa, bl as Ea, bm as La, bn as qs, bo as Da, bp as Ia, bq as qa, br as Va, bs as Ra } from "./index-eANGYKf6.js";
|
|
2
|
+
import de, { useState as O, useEffect as B, useMemo as _a, useRef as Ie } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.379.0 - ISC
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the ISC license.
|
|
7
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const Ha = z("Activity", [
|
|
10
10
|
[
|
|
11
11
|
"path",
|
|
12
12
|
{
|
|
@@ -21,7 +21,7 @@ const _a = M("Activity", [
|
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const Ba = z("AreaChart", [
|
|
25
25
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
26
26
|
["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
|
|
27
27
|
]);
|
|
@@ -31,7 +31,7 @@ const Ha = M("AreaChart", [
|
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/
|
|
34
|
-
const vs =
|
|
34
|
+
const vs = z("BarChart4", [
|
|
35
35
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
36
36
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
37
37
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
@@ -43,7 +43,7 @@ const vs = M("BarChart4", [
|
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
const
|
|
46
|
+
const $a = z("Bookmark", [
|
|
47
47
|
["path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z", key: "1fy3hk" }]
|
|
48
48
|
]);
|
|
49
49
|
/**
|
|
@@ -52,7 +52,7 @@ const Ba = M("Bookmark", [
|
|
|
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 Ka = z("CircleX", [
|
|
56
56
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
57
57
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
58
58
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -63,7 +63,7 @@ const $a = M("CircleX", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const
|
|
66
|
+
const Ua = z("Database", [
|
|
67
67
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
68
68
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
69
69
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -74,7 +74,7 @@ const Ka = M("Database", [
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
77
|
+
const Ga = z("Eraser", [
|
|
78
78
|
[
|
|
79
79
|
"path",
|
|
80
80
|
{
|
|
@@ -91,7 +91,7 @@ const Ua = M("Eraser", [
|
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
93
|
*/
|
|
94
|
-
const rt =
|
|
94
|
+
const rt = z("Filter", [
|
|
95
95
|
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
96
96
|
]);
|
|
97
97
|
/**
|
|
@@ -100,7 +100,7 @@ const rt = M("Filter", [
|
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
102
|
*/
|
|
103
|
-
const
|
|
103
|
+
const Ja = z("Glasses", [
|
|
104
104
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
105
105
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
106
106
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -113,7 +113,7 @@ const Ga = M("Glasses", [
|
|
|
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
|
|
116
|
+
const Qa = z("GripVertical", [
|
|
117
117
|
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
118
118
|
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
119
119
|
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
@@ -127,7 +127,7 @@ const Ja = M("GripVertical", [
|
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
129
|
*/
|
|
130
|
-
const
|
|
130
|
+
const Wa = z("Hammer", [
|
|
131
131
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
132
132
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
133
133
|
[
|
|
@@ -144,7 +144,7 @@ const Qa = M("Hammer", [
|
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
146
|
*/
|
|
147
|
-
const
|
|
147
|
+
const Pa = z("Hash", [
|
|
148
148
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
149
149
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
150
150
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -156,7 +156,7 @@ const Wa = M("Hash", [
|
|
|
156
156
|
* This source code is licensed under the ISC license.
|
|
157
157
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
158
|
*/
|
|
159
|
-
const
|
|
159
|
+
const Ya = z("Key", [
|
|
160
160
|
["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" }],
|
|
161
161
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
162
162
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -167,7 +167,7 @@ const Pa = M("Key", [
|
|
|
167
167
|
* This source code is licensed under the ISC license.
|
|
168
168
|
* See the LICENSE file in the root directory of this source tree.
|
|
169
169
|
*/
|
|
170
|
-
const Ns =
|
|
170
|
+
const Ns = z("LineChart", [
|
|
171
171
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
172
172
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
173
173
|
]);
|
|
@@ -177,7 +177,7 @@ const Ns = M("LineChart", [
|
|
|
177
177
|
* This source code is licensed under the ISC license.
|
|
178
178
|
* See the LICENSE file in the root directory of this source tree.
|
|
179
179
|
*/
|
|
180
|
-
const
|
|
180
|
+
const Xa = z("ListEnd", [
|
|
181
181
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
182
182
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
183
183
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -190,7 +190,7 @@ const Ya = M("ListEnd", [
|
|
|
190
190
|
* This source code is licensed under the ISC license.
|
|
191
191
|
* See the LICENSE file in the root directory of this source tree.
|
|
192
192
|
*/
|
|
193
|
-
const
|
|
193
|
+
const Za = z("ListStart", [
|
|
194
194
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
195
195
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
196
196
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -203,7 +203,7 @@ const Xa = M("ListStart", [
|
|
|
203
203
|
* This source code is licensed under the ISC license.
|
|
204
204
|
* See the LICENSE file in the root directory of this source tree.
|
|
205
205
|
*/
|
|
206
|
-
const
|
|
206
|
+
const en = z("ListX", [
|
|
207
207
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
208
208
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
209
209
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -216,7 +216,7 @@ const Za = M("ListX", [
|
|
|
216
216
|
* This source code is licensed under the ISC license.
|
|
217
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
218
|
*/
|
|
219
|
-
const
|
|
219
|
+
const sn = z("MessageSquareMore", [
|
|
220
220
|
["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" }],
|
|
221
221
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
222
222
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -228,7 +228,7 @@ const en = M("MessageSquareMore", [
|
|
|
228
228
|
* This source code is licensed under the ISC license.
|
|
229
229
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
230
|
*/
|
|
231
|
-
const
|
|
231
|
+
const tn = z("Network", [
|
|
232
232
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
233
233
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
234
234
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -241,7 +241,7 @@ const sn = M("Network", [
|
|
|
241
241
|
* This source code is licensed under the ISC license.
|
|
242
242
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
243
|
*/
|
|
244
|
-
const lt =
|
|
244
|
+
const lt = z("Pencil", [
|
|
245
245
|
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
|
|
246
246
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
247
247
|
]);
|
|
@@ -251,7 +251,7 @@ const lt = M("Pencil", [
|
|
|
251
251
|
* This source code is licensed under the ISC license.
|
|
252
252
|
* See the LICENSE file in the root directory of this source tree.
|
|
253
253
|
*/
|
|
254
|
-
const it =
|
|
254
|
+
const it = z("PieChart", [
|
|
255
255
|
["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
|
|
256
256
|
["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
|
|
257
257
|
]);
|
|
@@ -261,7 +261,7 @@ const it = M("PieChart", [
|
|
|
261
261
|
* This source code is licensed under the ISC license.
|
|
262
262
|
* See the LICENSE file in the root directory of this source tree.
|
|
263
263
|
*/
|
|
264
|
-
const
|
|
264
|
+
const an = z("Play", [
|
|
265
265
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
266
266
|
]);
|
|
267
267
|
/**
|
|
@@ -270,7 +270,7 @@ const tn = M("Play", [
|
|
|
270
270
|
* This source code is licensed under the ISC license.
|
|
271
271
|
* See the LICENSE file in the root directory of this source tree.
|
|
272
272
|
*/
|
|
273
|
-
const
|
|
273
|
+
const nn = z("Plug2", [
|
|
274
274
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
275
275
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
276
276
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -283,7 +283,7 @@ const an = M("Plug2", [
|
|
|
283
283
|
* This source code is licensed under the ISC license.
|
|
284
284
|
* See the LICENSE file in the root directory of this source tree.
|
|
285
285
|
*/
|
|
286
|
-
const ot =
|
|
286
|
+
const ot = z("Plus", [
|
|
287
287
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
288
288
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
289
289
|
]);
|
|
@@ -293,7 +293,7 @@ const ot = M("Plus", [
|
|
|
293
293
|
* This source code is licensed under the ISC license.
|
|
294
294
|
* See the LICENSE file in the root directory of this source tree.
|
|
295
295
|
*/
|
|
296
|
-
const
|
|
296
|
+
const rn = z("Save", [
|
|
297
297
|
[
|
|
298
298
|
"path",
|
|
299
299
|
{
|
|
@@ -310,7 +310,7 @@ const nn = M("Save", [
|
|
|
310
310
|
* This source code is licensed under the ISC license.
|
|
311
311
|
* See the LICENSE file in the root directory of this source tree.
|
|
312
312
|
*/
|
|
313
|
-
const ct =
|
|
313
|
+
const ct = z("ScatterChart", [
|
|
314
314
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
315
315
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
316
316
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -324,7 +324,7 @@ const ct = M("ScatterChart", [
|
|
|
324
324
|
* This source code is licensed under the ISC license.
|
|
325
325
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
326
|
*/
|
|
327
|
-
const
|
|
327
|
+
const ln = z("ShieldQuestion", [
|
|
328
328
|
[
|
|
329
329
|
"path",
|
|
330
330
|
{
|
|
@@ -341,7 +341,7 @@ const rn = M("ShieldQuestion", [
|
|
|
341
341
|
* This source code is licensed under the ISC license.
|
|
342
342
|
* See the LICENSE file in the root directory of this source tree.
|
|
343
343
|
*/
|
|
344
|
-
const Cs =
|
|
344
|
+
const Cs = z("Table", [
|
|
345
345
|
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
346
346
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
347
347
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
@@ -353,7 +353,7 @@ const Cs = M("Table", [
|
|
|
353
353
|
* This source code is licensed under the ISC license.
|
|
354
354
|
* See the LICENSE file in the root directory of this source tree.
|
|
355
355
|
*/
|
|
356
|
-
const
|
|
356
|
+
const on = z("Tag", [
|
|
357
357
|
[
|
|
358
358
|
"path",
|
|
359
359
|
{
|
|
@@ -369,7 +369,7 @@ const ln = M("Tag", [
|
|
|
369
369
|
* This source code is licensed under the ISC license.
|
|
370
370
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
371
|
*/
|
|
372
|
-
const
|
|
372
|
+
const cn = z("ToggleLeft", [
|
|
373
373
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
374
374
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
375
375
|
]);
|
|
@@ -379,7 +379,7 @@ const on = M("ToggleLeft", [
|
|
|
379
379
|
* This source code is licensed under the ISC license.
|
|
380
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
381
|
*/
|
|
382
|
-
const
|
|
382
|
+
const dn = z("Type", [
|
|
383
383
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
384
384
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
385
385
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -390,16 +390,16 @@ const cn = M("Type", [
|
|
|
390
390
|
* This source code is licensed under the ISC license.
|
|
391
391
|
* See the LICENSE file in the root directory of this source tree.
|
|
392
392
|
*/
|
|
393
|
-
const
|
|
393
|
+
const hn = z("User", [
|
|
394
394
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
395
395
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
396
396
|
]);
|
|
397
|
-
function
|
|
398
|
-
const [s, n] =
|
|
397
|
+
function un() {
|
|
398
|
+
const [s, n] = O(""), [t, a] = O(!1), [i, o] = O(!1), r = S((c) => c.dashboard);
|
|
399
399
|
function d() {
|
|
400
|
-
const c = $s(r), m =
|
|
400
|
+
const c = $s(r), m = ze(r.id), h = JSON.parse(localStorage.getItem(m) || "[]");
|
|
401
401
|
if (h.some(
|
|
402
|
-
(
|
|
402
|
+
(j) => j.name === s
|
|
403
403
|
)) {
|
|
404
404
|
a(!0);
|
|
405
405
|
return;
|
|
@@ -409,9 +409,9 @@ function hn() {
|
|
|
409
409
|
template: c
|
|
410
410
|
}), localStorage.setItem(m, JSON.stringify(h)), o(!1);
|
|
411
411
|
}
|
|
412
|
-
return /* @__PURE__ */ e.jsxs(is, { open:
|
|
412
|
+
return /* @__PURE__ */ e.jsxs(is, { open: i, onOpenChange: o, children: [
|
|
413
413
|
/* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
414
|
-
|
|
414
|
+
w,
|
|
415
415
|
{
|
|
416
416
|
variant: "outline",
|
|
417
417
|
className: "h-7 p-2",
|
|
@@ -443,7 +443,7 @@ function hn() {
|
|
|
443
443
|
] }) }),
|
|
444
444
|
t && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
|
|
445
445
|
/* @__PURE__ */ e.jsx(Bs, { children: /* @__PURE__ */ e.jsx(
|
|
446
|
-
|
|
446
|
+
w,
|
|
447
447
|
{
|
|
448
448
|
variant: "outline",
|
|
449
449
|
type: "submit",
|
|
@@ -455,57 +455,57 @@ function hn() {
|
|
|
455
455
|
] })
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
const [s, n] =
|
|
460
|
-
(
|
|
458
|
+
function mn() {
|
|
459
|
+
const [s, n] = O(!1), [t, a] = O(""), i = S((f) => f.dashboard), o = S((f) => f.bookmarkKey), [r, d] = O([]), c = S((f) => f.actions.setDashboard), m = S(
|
|
460
|
+
(f) => f.actions.setFilterValues
|
|
461
461
|
), h = S(
|
|
462
|
-
(
|
|
462
|
+
(f) => f.actions.setBookmarkKey
|
|
463
463
|
);
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
d(
|
|
467
|
-
const C =
|
|
464
|
+
B(() => {
|
|
465
|
+
const f = ze(i.id), b = JSON.parse(localStorage.getItem(f) || "[]");
|
|
466
|
+
d(b);
|
|
467
|
+
const C = b.find(
|
|
468
468
|
(v) => v.default
|
|
469
469
|
);
|
|
470
470
|
C && C.name === o && a(C.name);
|
|
471
|
-
}, [s,
|
|
472
|
-
function u(
|
|
473
|
-
if (
|
|
471
|
+
}, [s, i, o]);
|
|
472
|
+
function u(f) {
|
|
473
|
+
if (f === t)
|
|
474
474
|
return;
|
|
475
|
-
const
|
|
476
|
-
C && (c(C), m(
|
|
475
|
+
const b = r.find((v) => v.name === f), C = b == null ? void 0 : b.template;
|
|
476
|
+
C && (c(C), m(b.filterValues || []), h(f === "Original" ? "" : f)), a(f);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
479
|
-
const
|
|
480
|
-
(y) => y.name !==
|
|
478
|
+
function j(f) {
|
|
479
|
+
const b = ze(i.id), v = JSON.parse(localStorage.getItem(b) || "[]").filter(
|
|
480
|
+
(y) => y.name !== f
|
|
481
481
|
);
|
|
482
|
-
localStorage.setItem(
|
|
482
|
+
localStorage.setItem(b, JSON.stringify(v)), d(v);
|
|
483
483
|
}
|
|
484
|
-
return /* @__PURE__ */ e.jsxs(
|
|
485
|
-
/* @__PURE__ */ e.jsx(
|
|
486
|
-
/* @__PURE__ */ e.jsxs(
|
|
487
|
-
/* @__PURE__ */ e.jsx(
|
|
488
|
-
/* @__PURE__ */ e.jsx(
|
|
484
|
+
return /* @__PURE__ */ e.jsxs(Et, { open: s, onOpenChange: n, children: [
|
|
485
|
+
/* @__PURE__ */ e.jsx(Lt, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Ja, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
486
|
+
/* @__PURE__ */ e.jsxs(Dt, { className: "w-56", children: [
|
|
487
|
+
/* @__PURE__ */ e.jsx(It, { children: "Lenses" }),
|
|
488
|
+
/* @__PURE__ */ e.jsx(qt, {}),
|
|
489
489
|
/* @__PURE__ */ e.jsxs(
|
|
490
|
-
|
|
490
|
+
Vt,
|
|
491
491
|
{
|
|
492
492
|
value: t,
|
|
493
493
|
onValueChange: u,
|
|
494
494
|
children: [
|
|
495
495
|
/* @__PURE__ */ e.jsx(Os, { value: "Original", children: "Original" }),
|
|
496
|
-
r.filter((
|
|
496
|
+
r.filter((f) => f.name != "Original").map((f, b) => /* @__PURE__ */ e.jsxs(
|
|
497
497
|
Os,
|
|
498
498
|
{
|
|
499
499
|
className: "xbg-red-100 flex justify-between",
|
|
500
|
-
value:
|
|
501
|
-
defaultChecked:
|
|
500
|
+
value: f.name,
|
|
501
|
+
defaultChecked: f.name === o,
|
|
502
502
|
children: [
|
|
503
|
-
/* @__PURE__ */ e.jsx("p", { children:
|
|
503
|
+
/* @__PURE__ */ e.jsx("p", { children: f.name }),
|
|
504
504
|
/* @__PURE__ */ e.jsx(
|
|
505
|
-
|
|
505
|
+
Le,
|
|
506
506
|
{
|
|
507
507
|
onClick: (C) => {
|
|
508
|
-
C.preventDefault(),
|
|
508
|
+
C.preventDefault(), j(f.name);
|
|
509
509
|
},
|
|
510
510
|
className: "h-3 w-3 hover:cursor-pointer",
|
|
511
511
|
strokeWidth: 1.5
|
|
@@ -513,7 +513,7 @@ function un() {
|
|
|
513
513
|
)
|
|
514
514
|
]
|
|
515
515
|
},
|
|
516
|
-
|
|
516
|
+
b
|
|
517
517
|
))
|
|
518
518
|
]
|
|
519
519
|
}
|
|
@@ -521,24 +521,24 @@ function un() {
|
|
|
521
521
|
] })
|
|
522
522
|
] });
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
const [s, n] =
|
|
526
|
-
|
|
524
|
+
function xn() {
|
|
525
|
+
const [s, n] = O(!1), t = S((o) => o.dashboard), a = S((o) => o.bookmarkKey);
|
|
526
|
+
B(() => {
|
|
527
527
|
if (!a) {
|
|
528
528
|
n(!1);
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const o =
|
|
531
|
+
const o = ze(t.id), d = JSON.parse(
|
|
532
532
|
localStorage.getItem(o) || "[]"
|
|
533
533
|
).find(
|
|
534
534
|
(c) => c.name === a
|
|
535
535
|
);
|
|
536
536
|
n(d ? d.default : !1);
|
|
537
537
|
}, [a, t.id]);
|
|
538
|
-
function
|
|
538
|
+
function i(o) {
|
|
539
539
|
if (n(o), !a)
|
|
540
540
|
return;
|
|
541
|
-
const r =
|
|
541
|
+
const r = ze(t.id), c = JSON.parse(
|
|
542
542
|
localStorage.getItem(r) || "[]"
|
|
543
543
|
).map((m) => (m.name === a ? m.default = o : m.default = !1, m));
|
|
544
544
|
console.log(c), localStorage.setItem(r, JSON.stringify(c));
|
|
@@ -548,7 +548,7 @@ function mn() {
|
|
|
548
548
|
Qe,
|
|
549
549
|
{
|
|
550
550
|
checked: s,
|
|
551
|
-
onCheckedChange:
|
|
551
|
+
onCheckedChange: i,
|
|
552
552
|
id: "terms"
|
|
553
553
|
}
|
|
554
554
|
),
|
|
@@ -562,12 +562,12 @@ function mn() {
|
|
|
562
562
|
)
|
|
563
563
|
] });
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function pn() {
|
|
566
566
|
const s = S((y) => y.bookmarkKey), n = S((y) => y.dashboard);
|
|
567
567
|
S((y) => y.selectedSheetId);
|
|
568
568
|
const t = S(
|
|
569
569
|
(y) => y.isDashboardEditing
|
|
570
|
-
), a = S((y) => y.filterValues),
|
|
570
|
+
), a = S((y) => y.filterValues), i = S((y) => y.isVisualEditing), o = S((y) => y.showFilters);
|
|
571
571
|
S(
|
|
572
572
|
(y) => y.showDashboardJSON
|
|
573
573
|
);
|
|
@@ -575,8 +575,8 @@ function xn() {
|
|
|
575
575
|
(y) => y.actions.setShowFilters
|
|
576
576
|
), { addFrame: c, setSelectedFrameId: m } = S(
|
|
577
577
|
(y) => y.actions
|
|
578
|
-
), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON:
|
|
579
|
-
if (!t || !
|
|
578
|
+
), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON: j } = S((y) => y.actions), f = h(), b = () => {
|
|
579
|
+
if (!t || !f)
|
|
580
580
|
return;
|
|
581
581
|
const y = {
|
|
582
582
|
id: $e(),
|
|
@@ -593,56 +593,56 @@ function xn() {
|
|
|
593
593
|
type: "bar",
|
|
594
594
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
595
595
|
data: []
|
|
596
|
-
},
|
|
596
|
+
}, E = {
|
|
597
597
|
id: $e(),
|
|
598
598
|
cards: [y],
|
|
599
599
|
activeCardId: y.id
|
|
600
600
|
};
|
|
601
|
-
c(
|
|
601
|
+
c(f.id, E), m(E.id);
|
|
602
602
|
}, C = () => {
|
|
603
603
|
u(!0);
|
|
604
604
|
};
|
|
605
605
|
function v() {
|
|
606
606
|
if (!s || s === "")
|
|
607
607
|
return;
|
|
608
|
-
const y = $s(n),
|
|
609
|
-
(
|
|
608
|
+
const y = $s(n), E = ze(n.id), T = JSON.parse(localStorage.getItem(E) || "[]"), g = T.findIndex(
|
|
609
|
+
(F) => F.name === s
|
|
610
610
|
);
|
|
611
|
-
|
|
611
|
+
g !== -1 ? T[g] = {
|
|
612
612
|
name: s,
|
|
613
613
|
template: y,
|
|
614
|
-
default:
|
|
614
|
+
default: T[g].default,
|
|
615
615
|
filterValues: a
|
|
616
|
-
} :
|
|
616
|
+
} : T.push({
|
|
617
617
|
name: s,
|
|
618
618
|
template: y,
|
|
619
619
|
filterValues: a
|
|
620
|
-
}), localStorage.setItem(
|
|
620
|
+
}), localStorage.setItem(E, JSON.stringify(T)), r == null || r(y);
|
|
621
621
|
}
|
|
622
|
-
return
|
|
622
|
+
return i ? null : /* @__PURE__ */ e.jsxs(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
className: "flex items-center justify-between gap-2 px-2 pt-2",
|
|
626
626
|
role: "dashboard-controls",
|
|
627
627
|
children: [
|
|
628
|
-
!
|
|
628
|
+
!i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
629
629
|
/* @__PURE__ */ e.jsx(_, { children: s }),
|
|
630
630
|
!!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
631
631
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
|
|
632
|
-
/* @__PURE__ */ e.jsx(
|
|
632
|
+
/* @__PURE__ */ e.jsx(xn, {})
|
|
633
633
|
] })
|
|
634
634
|
] }),
|
|
635
635
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
636
|
-
t && !
|
|
637
|
-
!
|
|
638
|
-
t && !
|
|
639
|
-
|
|
636
|
+
t && !i && /* @__PURE__ */ e.jsx(un, {}),
|
|
637
|
+
!i && /* @__PURE__ */ e.jsx(mn, {}),
|
|
638
|
+
t && !i && /* @__PURE__ */ e.jsxs(
|
|
639
|
+
w,
|
|
640
640
|
{
|
|
641
641
|
variant: "outline",
|
|
642
642
|
className: "h-7 p-2",
|
|
643
643
|
size: "sm",
|
|
644
644
|
disabled: !t,
|
|
645
|
-
onClick:
|
|
645
|
+
onClick: b,
|
|
646
646
|
children: [
|
|
647
647
|
/* @__PURE__ */ e.jsx(ot, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
648
648
|
"Add Frame"
|
|
@@ -650,7 +650,7 @@ function xn() {
|
|
|
650
650
|
}
|
|
651
651
|
),
|
|
652
652
|
!t && /* @__PURE__ */ e.jsx(
|
|
653
|
-
|
|
653
|
+
w,
|
|
654
654
|
{
|
|
655
655
|
variant: "outline",
|
|
656
656
|
className: "h-7 p-2",
|
|
@@ -659,31 +659,31 @@ function xn() {
|
|
|
659
659
|
children: /* @__PURE__ */ e.jsx(lt, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
660
660
|
}
|
|
661
661
|
),
|
|
662
|
-
t && !
|
|
663
|
-
|
|
662
|
+
t && !i && /* @__PURE__ */ e.jsx(
|
|
663
|
+
w,
|
|
664
664
|
{
|
|
665
665
|
variant: "outline",
|
|
666
666
|
role: "close",
|
|
667
667
|
className: "h-7 p-2",
|
|
668
668
|
onClick: () => {
|
|
669
|
-
u(!1),
|
|
669
|
+
u(!1), j(!1);
|
|
670
670
|
},
|
|
671
671
|
size: "sm",
|
|
672
|
-
children: /* @__PURE__ */ e.jsx(
|
|
672
|
+
children: /* @__PURE__ */ e.jsx(Le, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
673
673
|
}
|
|
674
674
|
),
|
|
675
|
-
t && !
|
|
676
|
-
|
|
675
|
+
t && !i && /* @__PURE__ */ e.jsx(
|
|
676
|
+
w,
|
|
677
677
|
{
|
|
678
678
|
className: "h-7 p-2",
|
|
679
679
|
variant: "outline",
|
|
680
680
|
onClick: v,
|
|
681
681
|
size: "sm",
|
|
682
|
-
children: /* @__PURE__ */ e.jsx(
|
|
682
|
+
children: /* @__PURE__ */ e.jsx(rn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
|
-
!o && !
|
|
686
|
-
|
|
685
|
+
!o && !i && t && /* @__PURE__ */ e.jsx(
|
|
686
|
+
w,
|
|
687
687
|
{
|
|
688
688
|
className: "h-7 p-2",
|
|
689
689
|
variant: "outline",
|
|
@@ -692,8 +692,8 @@ function xn() {
|
|
|
692
692
|
children: /* @__PURE__ */ e.jsx(rt, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
|
-
!
|
|
696
|
-
!
|
|
695
|
+
!i && t && !1,
|
|
696
|
+
!i && !1
|
|
697
697
|
] })
|
|
698
698
|
]
|
|
699
699
|
}
|
|
@@ -704,21 +704,21 @@ function He({
|
|
|
704
704
|
items: n,
|
|
705
705
|
value: t,
|
|
706
706
|
isLoading: a,
|
|
707
|
-
isError:
|
|
707
|
+
isError: i,
|
|
708
708
|
connectionTooltip: o,
|
|
709
709
|
onChange: r,
|
|
710
710
|
className: d,
|
|
711
711
|
showIcon: c = !0,
|
|
712
712
|
disabled: m = !1
|
|
713
713
|
}) {
|
|
714
|
-
const h = a ? "Loading..." :
|
|
714
|
+
const h = a ? "Loading..." : i ? "Error" : t;
|
|
715
715
|
function u() {
|
|
716
716
|
if (s === "Connection")
|
|
717
|
-
return /* @__PURE__ */ e.jsx(
|
|
717
|
+
return /* @__PURE__ */ e.jsx(nn, { className: "size-4 rotate-90" });
|
|
718
718
|
if (s === "Database")
|
|
719
|
-
return /* @__PURE__ */ e.jsx(
|
|
719
|
+
return /* @__PURE__ */ e.jsx(Ua, { className: "size-4" });
|
|
720
720
|
if (s === "Schema")
|
|
721
|
-
return /* @__PURE__ */ e.jsx(
|
|
721
|
+
return /* @__PURE__ */ e.jsx(tn, { className: "size-4" });
|
|
722
722
|
if (s === "Table")
|
|
723
723
|
return /* @__PURE__ */ e.jsx(Cs, { className: "size-4" });
|
|
724
724
|
}
|
|
@@ -738,37 +738,37 @@ function He({
|
|
|
738
738
|
children: /* @__PURE__ */ e.jsx(
|
|
739
739
|
fs,
|
|
740
740
|
{
|
|
741
|
-
placeholder: a ? "Loading..." :
|
|
741
|
+
placeholder: a ? "Loading..." : i ? "Error" : `Select ${s}`
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
}
|
|
745
745
|
),
|
|
746
746
|
/* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsxs(js, { children: [
|
|
747
747
|
a ? /* @__PURE__ */ e.jsx(Ke, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ke, { children: s }),
|
|
748
|
-
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((
|
|
749
|
-
(a ||
|
|
748
|
+
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((j, f) => /* @__PURE__ */ e.jsx(xe, { value: j.id, children: j.name }, f)) }),
|
|
749
|
+
(a || i) && /* @__PURE__ */ e.jsx(xe, { value: h, children: h })
|
|
750
750
|
] }) })
|
|
751
751
|
] })
|
|
752
752
|
] });
|
|
753
753
|
}
|
|
754
|
-
function
|
|
755
|
-
const [n, t] =
|
|
754
|
+
function fn({ column: s }) {
|
|
755
|
+
const [n, t] = O(!1), a = l((h) => h.selectedTableName), i = l(
|
|
756
756
|
(h) => h.selectedSchemaName
|
|
757
|
-
), o =
|
|
757
|
+
), o = l((h) => h.sqlGen), r = l((h) => h.actions.setSqlGen), d = l((h) => h.actions.setCardSql), c = l((h) => h.actions.setRunSql);
|
|
758
758
|
function m(h, u) {
|
|
759
|
-
const
|
|
760
|
-
r(
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
759
|
+
const j = Ks(h, o, u);
|
|
760
|
+
r(j);
|
|
761
|
+
const f = Us(
|
|
762
|
+
j,
|
|
763
|
+
ce(i || ""),
|
|
764
|
+
ce(a)
|
|
765
765
|
);
|
|
766
|
-
|
|
766
|
+
f && (d(f), c(!0)), t(!1);
|
|
767
767
|
}
|
|
768
|
-
return /* @__PURE__ */ e.jsxs(
|
|
769
|
-
/* @__PURE__ */ e.jsx(
|
|
768
|
+
return /* @__PURE__ */ e.jsxs(qe, { open: n, onOpenChange: t, children: [
|
|
769
|
+
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Rt, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
|
|
770
770
|
/* @__PURE__ */ e.jsx(
|
|
771
|
-
|
|
771
|
+
Re,
|
|
772
772
|
{
|
|
773
773
|
align: "center",
|
|
774
774
|
className: "w-18 rounded-md p-0 shadow-none",
|
|
@@ -820,67 +820,67 @@ function pn({ column: s }) {
|
|
|
820
820
|
}
|
|
821
821
|
function dt({ column: s }) {
|
|
822
822
|
return /* @__PURE__ */ e.jsxs(We, { children: [
|
|
823
|
-
/* @__PURE__ */ e.jsx(
|
|
823
|
+
/* @__PURE__ */ e.jsx(_t, { asChild: !0, children: Ht.includes(s.data_type.toLowerCase()) ? (
|
|
824
824
|
// <span className=" font-thin">T</span>
|
|
825
|
-
/* @__PURE__ */ e.jsx(
|
|
825
|
+
/* @__PURE__ */ e.jsx(dn, { className: "size-3" })
|
|
826
826
|
) : Gs.includes(s.data_type.toLowerCase()) ? (
|
|
827
827
|
//
|
|
828
|
-
/* @__PURE__ */ e.jsx(
|
|
829
|
-
) :
|
|
828
|
+
/* @__PURE__ */ e.jsx(Pa, { className: "size-3" })
|
|
829
|
+
) : Bt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx($t, { className: "size-3" }) : Kt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(ln, { className: "size-3" }) }),
|
|
830
830
|
/* @__PURE__ */ e.jsx(Pe, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
831
831
|
] });
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function gn({
|
|
834
834
|
schemaName: s,
|
|
835
835
|
tableName: n,
|
|
836
836
|
columns: t,
|
|
837
837
|
status: a
|
|
838
838
|
}) {
|
|
839
|
-
const
|
|
840
|
-
(
|
|
841
|
-
), r =
|
|
842
|
-
(
|
|
843
|
-
), d =
|
|
844
|
-
(
|
|
845
|
-
), c =
|
|
846
|
-
(
|
|
847
|
-
), { setAIScopeTables: h } = S((
|
|
848
|
-
(
|
|
849
|
-
),
|
|
850
|
-
function v(
|
|
851
|
-
const
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
|
|
839
|
+
const i = l((g) => g.sqlGen), o = l(
|
|
840
|
+
(g) => g.selectedConnectionId
|
|
841
|
+
), r = l(
|
|
842
|
+
(g) => g.selectedDatabaseName
|
|
843
|
+
), d = l(
|
|
844
|
+
(g) => g.selectedSchemaName
|
|
845
|
+
), c = l((g) => g.selectedTableName), m = S(
|
|
846
|
+
(g) => g.dashboard.aiScopeTables
|
|
847
|
+
), { setAIScopeTables: h } = S((g) => g.actions), u = l((g) => g.actions.setRunSql), j = l((g) => g.actions.setSqlGen), f = l(
|
|
848
|
+
(g) => g.actions.setIsShowingVisual
|
|
849
|
+
), b = l((g) => g.actions.setCardSql), { connectionType: C } = ht();
|
|
850
|
+
function v(g) {
|
|
851
|
+
const F = Ks(g, i);
|
|
852
|
+
j(F);
|
|
853
|
+
const M = Us(F, ce(s), ce(n));
|
|
854
|
+
M && (b(M), u(!0));
|
|
855
855
|
}
|
|
856
|
-
function y(
|
|
857
|
-
if (
|
|
858
|
-
const
|
|
856
|
+
function y(g) {
|
|
857
|
+
if (g === !0 && c && o) {
|
|
858
|
+
const F = {
|
|
859
859
|
connectinonId: o,
|
|
860
860
|
connectionType: C,
|
|
861
861
|
databaseName: r,
|
|
862
862
|
schemaName: d,
|
|
863
863
|
tableName: c
|
|
864
|
-
},
|
|
865
|
-
(
|
|
866
|
-
(
|
|
867
|
-
) ===
|
|
864
|
+
}, A = [...m || [], F].filter(
|
|
865
|
+
($, X, U) => U.findIndex(
|
|
866
|
+
(K) => K.connectinonId === $.connectinonId && K.tableName === $.tableName
|
|
867
|
+
) === X
|
|
868
868
|
);
|
|
869
|
-
h(
|
|
869
|
+
h(A);
|
|
870
870
|
} else {
|
|
871
|
-
const
|
|
872
|
-
(
|
|
871
|
+
const F = (m || []).filter(
|
|
872
|
+
(M) => M.connectinonId !== o && M.tableName !== c
|
|
873
873
|
);
|
|
874
|
-
h(
|
|
874
|
+
h(F);
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
function
|
|
878
|
-
let
|
|
879
|
-
((
|
|
877
|
+
function E() {
|
|
878
|
+
let F = as(s, n);
|
|
879
|
+
((A) => A.charAt(0) === A.charAt(0).toUpperCase())(n) && (F = `"${n}"`), f(!1), b(`SELECT * FROM ${F} LIMIT 10`), u(!0);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
let
|
|
883
|
-
((
|
|
881
|
+
function T() {
|
|
882
|
+
let F = as(s, n);
|
|
883
|
+
((A) => A.charAt(0) === A.charAt(0).toUpperCase())(n) && (F = `"${n}"`), f(!1), b(`SELECT COUNT(*) FROM ${F}`), u(!0);
|
|
884
884
|
}
|
|
885
885
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-6", children: [
|
|
886
886
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -891,33 +891,33 @@ function fn({
|
|
|
891
891
|
onPressedChange: y,
|
|
892
892
|
variant: "outline",
|
|
893
893
|
className: "h-9 px-2",
|
|
894
|
-
children: /* @__PURE__ */ e.jsx(
|
|
894
|
+
children: /* @__PURE__ */ e.jsx($a, { className: "size-4" })
|
|
895
895
|
}
|
|
896
896
|
),
|
|
897
897
|
/* @__PURE__ */ e.jsxs(
|
|
898
|
-
|
|
898
|
+
w,
|
|
899
899
|
{
|
|
900
900
|
disabled: a !== "Success",
|
|
901
|
-
onClick:
|
|
901
|
+
onClick: E,
|
|
902
902
|
size: "sm",
|
|
903
903
|
variant: "secondary",
|
|
904
904
|
className: "flex w-full",
|
|
905
905
|
children: [
|
|
906
|
-
a !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
906
|
+
a !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
|
|
907
907
|
"Top 10"
|
|
908
908
|
]
|
|
909
909
|
}
|
|
910
910
|
),
|
|
911
911
|
/* @__PURE__ */ e.jsxs(
|
|
912
|
-
|
|
912
|
+
w,
|
|
913
913
|
{
|
|
914
914
|
disabled: a !== "Success",
|
|
915
|
-
onClick:
|
|
915
|
+
onClick: T,
|
|
916
916
|
size: "sm",
|
|
917
917
|
variant: "secondary",
|
|
918
918
|
className: "flex w-full",
|
|
919
919
|
children: [
|
|
920
|
-
a !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
920
|
+
a !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
|
|
921
921
|
"Count"
|
|
922
922
|
]
|
|
923
923
|
}
|
|
@@ -928,32 +928,32 @@ function fn({
|
|
|
928
928
|
{
|
|
929
929
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
930
930
|
children: [
|
|
931
|
-
t == null ? void 0 : t.map((
|
|
931
|
+
t == null ? void 0 : t.map((g) => /* @__PURE__ */ e.jsxs(
|
|
932
932
|
"div",
|
|
933
933
|
{
|
|
934
|
-
onClick: () => v(
|
|
934
|
+
onClick: () => v(g),
|
|
935
935
|
className: W(
|
|
936
936
|
"mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
937
937
|
{
|
|
938
|
-
"bg-muted":
|
|
938
|
+
"bg-muted": Ut(g, i)
|
|
939
939
|
}
|
|
940
940
|
),
|
|
941
941
|
children: [
|
|
942
942
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
943
|
-
/* @__PURE__ */ e.jsx(dt, { column:
|
|
944
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
943
|
+
/* @__PURE__ */ e.jsx(dt, { column: g }),
|
|
944
|
+
/* @__PURE__ */ e.jsx("span", { children: g.column_name })
|
|
945
945
|
] }),
|
|
946
|
-
Gs.includes(
|
|
946
|
+
Gs.includes(g.data_type) && /* @__PURE__ */ e.jsx(
|
|
947
947
|
"div",
|
|
948
948
|
{
|
|
949
|
-
onClick: (
|
|
949
|
+
onClick: (F) => F.stopPropagation(),
|
|
950
950
|
className: "flex items-center justify-end",
|
|
951
|
-
children: /* @__PURE__ */ e.jsx(
|
|
951
|
+
children: /* @__PURE__ */ e.jsx(fn, { column: g })
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
]
|
|
955
955
|
},
|
|
956
|
-
|
|
956
|
+
g.column_name
|
|
957
957
|
)),
|
|
958
958
|
/* @__PURE__ */ e.jsx(zs, { orientation: "vertical" }),
|
|
959
959
|
/* @__PURE__ */ e.jsx(zs, { orientation: "horizontal" })
|
|
@@ -963,130 +963,130 @@ function fn({
|
|
|
963
963
|
] });
|
|
964
964
|
}
|
|
965
965
|
function ht(s, n) {
|
|
966
|
-
var Xe,
|
|
967
|
-
let t =
|
|
968
|
-
const a = Ye().authToken || s,
|
|
966
|
+
var Xe, be, _e, Ae;
|
|
967
|
+
let t = _a(() => [], []);
|
|
968
|
+
const a = Ye().authToken || s, i = l(
|
|
969
969
|
(N) => N.selectedConnectionId
|
|
970
|
-
), o =
|
|
970
|
+
), o = l(
|
|
971
971
|
(N) => N.selectedDatabaseName
|
|
972
|
-
), r =
|
|
972
|
+
), r = l(
|
|
973
973
|
(N) => N.selectedSchemaName
|
|
974
|
-
), d =
|
|
974
|
+
), d = l((N) => N.selectedTableName), c = l(
|
|
975
975
|
(N) => N.actions.setCurrentColumns
|
|
976
|
-
), m =
|
|
976
|
+
), m = l(
|
|
977
977
|
(N) => N.actions.setSelectedConnectionId
|
|
978
|
-
), h =
|
|
978
|
+
), h = l(
|
|
979
979
|
(N) => N.actions.setSelectedDatabaseName
|
|
980
|
-
), u =
|
|
980
|
+
), u = l(
|
|
981
981
|
(N) => N.actions.setSelectedSchemaName
|
|
982
|
-
),
|
|
982
|
+
), j = l(
|
|
983
983
|
(N) => N.actions.setSelectedTableName
|
|
984
|
-
),
|
|
985
|
-
function
|
|
986
|
-
return
|
|
984
|
+
), f = l((N) => N.actions.setCardSql);
|
|
985
|
+
function b(N) {
|
|
986
|
+
return i && o && r && o !== "NA" ? !0 : i && N === "API" ? !1 : !!(i && N === "S3");
|
|
987
987
|
}
|
|
988
988
|
function C(N) {
|
|
989
|
-
return !!(
|
|
989
|
+
return !!(i && o && o !== "NA" && r && d || i && (N === "S3" || N === "API"));
|
|
990
990
|
}
|
|
991
991
|
function v(N) {
|
|
992
|
-
return
|
|
992
|
+
return i && N ? !(N === "API" || N === "S3") : !1;
|
|
993
993
|
}
|
|
994
994
|
const {
|
|
995
995
|
data: y,
|
|
996
|
-
isLoading:
|
|
997
|
-
isError:
|
|
998
|
-
} =
|
|
996
|
+
isLoading: E,
|
|
997
|
+
isError: T
|
|
998
|
+
} = Ne({
|
|
999
999
|
queryKey: ["connections"],
|
|
1000
|
-
queryFn: () =>
|
|
1000
|
+
queryFn: () => Fe(
|
|
1001
1001
|
"https://semaphor.cloud/api/v1/connections",
|
|
1002
1002
|
(a == null ? void 0 : a.accessToken) || ""
|
|
1003
1003
|
),
|
|
1004
1004
|
enabled: !!(a != null && a.accessToken)
|
|
1005
1005
|
// Only fetch if authToken is present
|
|
1006
|
-
}),
|
|
1007
|
-
(N) => N.id ===
|
|
1008
|
-
),
|
|
1009
|
-
data:
|
|
1010
|
-
isLoading:
|
|
1011
|
-
isFetching:
|
|
1012
|
-
isError:
|
|
1013
|
-
refetch:
|
|
1014
|
-
} =
|
|
1015
|
-
queryKey: ["databases",
|
|
1016
|
-
queryFn: () =>
|
|
1006
|
+
}), g = y == null ? void 0 : y.connections.find(
|
|
1007
|
+
(N) => N.id === i
|
|
1008
|
+
), F = g == null ? void 0 : g.type, M = (g == null ? void 0 : g.type) === "API" || (g == null ? void 0 : g.type) === "S3", {
|
|
1009
|
+
data: A,
|
|
1010
|
+
isLoading: $,
|
|
1011
|
+
isFetching: X,
|
|
1012
|
+
isError: U,
|
|
1013
|
+
refetch: K
|
|
1014
|
+
} = Ne({
|
|
1015
|
+
queryKey: ["databases", i],
|
|
1016
|
+
queryFn: () => Fe(
|
|
1017
1017
|
"https://semaphor.cloud/api/v1/databases",
|
|
1018
1018
|
(a == null ? void 0 : a.accessToken) || "",
|
|
1019
1019
|
{
|
|
1020
|
-
connection_id:
|
|
1020
|
+
connection_id: i
|
|
1021
1021
|
}
|
|
1022
1022
|
),
|
|
1023
|
-
enabled: v(
|
|
1023
|
+
enabled: v(F)
|
|
1024
1024
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1025
1025
|
}), {
|
|
1026
|
-
data:
|
|
1026
|
+
data: D,
|
|
1027
1027
|
isLoading: ee,
|
|
1028
1028
|
isFetching: P,
|
|
1029
1029
|
isError: se,
|
|
1030
|
-
refetch:
|
|
1031
|
-
} =
|
|
1032
|
-
queryKey: ["schemas",
|
|
1033
|
-
queryFn: () =>
|
|
1030
|
+
refetch: Z
|
|
1031
|
+
} = Ne({
|
|
1032
|
+
queryKey: ["schemas", i, o],
|
|
1033
|
+
queryFn: () => Fe(
|
|
1034
1034
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1035
1035
|
(a == null ? void 0 : a.accessToken) || "",
|
|
1036
1036
|
{
|
|
1037
|
-
connection_id:
|
|
1037
|
+
connection_id: i,
|
|
1038
1038
|
database_name: o
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
|
-
enabled: !!
|
|
1041
|
+
enabled: !!i && !!o && !M && o !== "NA"
|
|
1042
1042
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1043
1043
|
}), {
|
|
1044
|
-
data:
|
|
1045
|
-
isLoading:
|
|
1046
|
-
isFetching:
|
|
1047
|
-
isError:
|
|
1048
|
-
refetch:
|
|
1049
|
-
} =
|
|
1044
|
+
data: G,
|
|
1045
|
+
isLoading: L,
|
|
1046
|
+
isFetching: x,
|
|
1047
|
+
isError: k,
|
|
1048
|
+
refetch: R
|
|
1049
|
+
} = Ne({
|
|
1050
1050
|
queryKey: [
|
|
1051
1051
|
"tables",
|
|
1052
|
-
|
|
1052
|
+
i,
|
|
1053
1053
|
o,
|
|
1054
1054
|
r
|
|
1055
1055
|
],
|
|
1056
|
-
queryFn: () =>
|
|
1056
|
+
queryFn: () => Fe(
|
|
1057
1057
|
"https://semaphor.cloud/api/v1/tables",
|
|
1058
1058
|
(a == null ? void 0 : a.accessToken) || "",
|
|
1059
1059
|
{
|
|
1060
|
-
connection_id:
|
|
1060
|
+
connection_id: i,
|
|
1061
1061
|
database_name: o,
|
|
1062
1062
|
schema_name: r
|
|
1063
1063
|
}
|
|
1064
1064
|
),
|
|
1065
|
-
enabled:
|
|
1065
|
+
enabled: b(F)
|
|
1066
1066
|
}), {
|
|
1067
|
-
data:
|
|
1068
|
-
isLoading:
|
|
1067
|
+
data: H,
|
|
1068
|
+
isLoading: he,
|
|
1069
1069
|
isFetching: te,
|
|
1070
|
-
isError:
|
|
1071
|
-
} =
|
|
1070
|
+
isError: pe
|
|
1071
|
+
} = Ne({
|
|
1072
1072
|
queryKey: [
|
|
1073
1073
|
"columns",
|
|
1074
|
-
|
|
1074
|
+
i,
|
|
1075
1075
|
o,
|
|
1076
1076
|
r,
|
|
1077
1077
|
d
|
|
1078
1078
|
],
|
|
1079
|
-
queryFn: () =>
|
|
1079
|
+
queryFn: () => Fe(
|
|
1080
1080
|
"https://semaphor.cloud/api/v1/columns",
|
|
1081
1081
|
(a == null ? void 0 : a.accessToken) || "",
|
|
1082
1082
|
{
|
|
1083
|
-
connection_id:
|
|
1083
|
+
connection_id: i,
|
|
1084
1084
|
database_name: o,
|
|
1085
1085
|
schema_name: r,
|
|
1086
1086
|
table_name: d
|
|
1087
1087
|
}
|
|
1088
1088
|
),
|
|
1089
|
-
enabled: C(
|
|
1089
|
+
enabled: C(F)
|
|
1090
1090
|
// (!!selectedConnectionId &&
|
|
1091
1091
|
// !!selectedDatabaseName &&
|
|
1092
1092
|
// !!selectedSchemaName &&
|
|
@@ -1095,84 +1095,84 @@ function ht(s, n) {
|
|
|
1095
1095
|
//currentConnection?.type === 'API',
|
|
1096
1096
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1097
1097
|
});
|
|
1098
|
-
|
|
1098
|
+
B(() => {
|
|
1099
1099
|
c(t);
|
|
1100
|
-
}, [
|
|
1100
|
+
}, [H, c, t]), B(() => {
|
|
1101
1101
|
}, [
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1102
|
+
M,
|
|
1103
|
+
f,
|
|
1104
|
+
j,
|
|
1105
1105
|
u,
|
|
1106
1106
|
h,
|
|
1107
|
-
|
|
1107
|
+
g
|
|
1108
1108
|
]);
|
|
1109
|
-
const
|
|
1110
|
-
function
|
|
1111
|
-
u(N),
|
|
1109
|
+
const fe = (g == null ? void 0 : g.type) === "API" ? (Xe = g == null ? void 0 : g.type) == null ? void 0 : Xe.toLowerCase() : d || "", ge = M ? "" : r || "";
|
|
1110
|
+
function ue(N) {
|
|
1111
|
+
u(N), j("");
|
|
1112
1112
|
}
|
|
1113
1113
|
function J(N) {
|
|
1114
|
-
h(N), u(""),
|
|
1114
|
+
h(N), u(""), j("");
|
|
1115
1115
|
}
|
|
1116
1116
|
function ae(N) {
|
|
1117
1117
|
m(N);
|
|
1118
1118
|
}
|
|
1119
|
-
|
|
1119
|
+
A && ((be = A == null ? void 0 : A.databases) == null ? void 0 : be.length) > 0, D && ((_e = D == null ? void 0 : D.schemas) == null ? void 0 : _e.length) > 0, H && ((Ae = H == null ? void 0 : H.columns) == null ? void 0 : Ae.length) > 0 && (t = H.columns.map((N) => ({
|
|
1120
1120
|
...N,
|
|
1121
1121
|
data_type: N.data_type.toLowerCase()
|
|
1122
|
-
}))),
|
|
1123
|
-
const
|
|
1122
|
+
}))), U && (t = []), (pe || T) && (t = []);
|
|
1123
|
+
const ne = y == null ? void 0 : y.connections.map(
|
|
1124
1124
|
(N) => ({
|
|
1125
1125
|
id: N.id,
|
|
1126
1126
|
name: N.name,
|
|
1127
1127
|
type: N.type
|
|
1128
1128
|
})
|
|
1129
|
-
),
|
|
1129
|
+
), je = A == null ? void 0 : A.databases.map((N) => ({
|
|
1130
1130
|
id: N.database_name,
|
|
1131
1131
|
name: N.database_name
|
|
1132
|
-
})),
|
|
1132
|
+
})), ke = D == null ? void 0 : D.schemas.map((N) => ({
|
|
1133
1133
|
id: N.schema_name,
|
|
1134
1134
|
name: N.schema_name
|
|
1135
|
-
})),
|
|
1135
|
+
})), Te = G == null ? void 0 : G.tables.map((N) => ({
|
|
1136
1136
|
id: N.table_name,
|
|
1137
1137
|
name: N.table_name
|
|
1138
1138
|
}));
|
|
1139
1139
|
return {
|
|
1140
|
-
connectionItems:
|
|
1141
|
-
isConnectionsLoading:
|
|
1142
|
-
isConnectionsError:
|
|
1143
|
-
databaseItems:
|
|
1144
|
-
isDatabasesLoadingOrFetching:
|
|
1145
|
-
isDatabaseError:
|
|
1146
|
-
schemaItems:
|
|
1140
|
+
connectionItems: ne,
|
|
1141
|
+
isConnectionsLoading: E,
|
|
1142
|
+
isConnectionsError: T,
|
|
1143
|
+
databaseItems: je,
|
|
1144
|
+
isDatabasesLoadingOrFetching: $ || X,
|
|
1145
|
+
isDatabaseError: U,
|
|
1146
|
+
schemaItems: ke,
|
|
1147
1147
|
isSchemaLoadingOrFetching: ee || P,
|
|
1148
1148
|
isSchemaError: se,
|
|
1149
|
-
tableItems:
|
|
1150
|
-
isTableLoadingOrFetching:
|
|
1151
|
-
isTableError:
|
|
1149
|
+
tableItems: Te,
|
|
1150
|
+
isTableLoadingOrFetching: L || x,
|
|
1151
|
+
isTableError: k,
|
|
1152
1152
|
columns: t,
|
|
1153
|
-
isColumnsLoadingOrFetching:
|
|
1154
|
-
isColumnsError:
|
|
1155
|
-
isNonDbConnection:
|
|
1156
|
-
connectionType:
|
|
1157
|
-
tableName:
|
|
1158
|
-
schemaName:
|
|
1153
|
+
isColumnsLoadingOrFetching: he || te,
|
|
1154
|
+
isColumnsError: pe,
|
|
1155
|
+
isNonDbConnection: M,
|
|
1156
|
+
connectionType: F,
|
|
1157
|
+
tableName: fe,
|
|
1158
|
+
schemaName: ge,
|
|
1159
1159
|
handleConnectionChange: ae,
|
|
1160
1160
|
handleDatabaseChange: J,
|
|
1161
|
-
handleSchemaChange:
|
|
1161
|
+
handleSchemaChange: ue
|
|
1162
1162
|
};
|
|
1163
1163
|
}
|
|
1164
1164
|
function ut({
|
|
1165
1165
|
ColumnsComponent: s
|
|
1166
1166
|
}) {
|
|
1167
|
-
var
|
|
1168
|
-
const n =
|
|
1169
|
-
(
|
|
1170
|
-
), t =
|
|
1171
|
-
(
|
|
1172
|
-
), a =
|
|
1173
|
-
(
|
|
1174
|
-
),
|
|
1175
|
-
(
|
|
1167
|
+
var G;
|
|
1168
|
+
const n = l(
|
|
1169
|
+
(L) => L.selectedConnectionId
|
|
1170
|
+
), t = l(
|
|
1171
|
+
(L) => L.selectedDatabaseName
|
|
1172
|
+
), a = l(
|
|
1173
|
+
(L) => L.selectedSchemaName
|
|
1174
|
+
), i = l((L) => L.selectedTableName), o = l(
|
|
1175
|
+
(L) => L.actions.setSelectedTableName
|
|
1176
1176
|
), {
|
|
1177
1177
|
connectionItems: r,
|
|
1178
1178
|
schemaItems: d,
|
|
@@ -1180,31 +1180,31 @@ function ut({
|
|
|
1180
1180
|
tableItems: m,
|
|
1181
1181
|
columns: h,
|
|
1182
1182
|
isConnectionsLoading: u,
|
|
1183
|
-
isConnectionsError:
|
|
1184
|
-
isDatabasesLoadingOrFetching:
|
|
1185
|
-
isDatabaseError:
|
|
1183
|
+
isConnectionsError: j,
|
|
1184
|
+
isDatabasesLoadingOrFetching: f,
|
|
1185
|
+
isDatabaseError: b,
|
|
1186
1186
|
isSchemaLoadingOrFetching: C,
|
|
1187
1187
|
isSchemaError: v,
|
|
1188
1188
|
isColumnsError: y,
|
|
1189
|
-
isColumnsLoadingOrFetching:
|
|
1190
|
-
isTableLoadingOrFetching:
|
|
1191
|
-
isTableError:
|
|
1192
|
-
connectionType:
|
|
1193
|
-
isNonDbConnection:
|
|
1194
|
-
handleConnectionChange:
|
|
1195
|
-
handleDatabaseChange:
|
|
1196
|
-
handleSchemaChange:
|
|
1197
|
-
tableName:
|
|
1198
|
-
schemaName:
|
|
1189
|
+
isColumnsLoadingOrFetching: E,
|
|
1190
|
+
isTableLoadingOrFetching: T,
|
|
1191
|
+
isTableError: g,
|
|
1192
|
+
connectionType: F,
|
|
1193
|
+
isNonDbConnection: M,
|
|
1194
|
+
handleConnectionChange: A,
|
|
1195
|
+
handleDatabaseChange: $,
|
|
1196
|
+
handleSchemaChange: X,
|
|
1197
|
+
tableName: U,
|
|
1198
|
+
schemaName: K
|
|
1199
1199
|
} = ht();
|
|
1200
|
-
function
|
|
1201
|
-
return s ? s(
|
|
1202
|
-
|
|
1200
|
+
function D() {
|
|
1201
|
+
return s ? s(K, U, h) : /* @__PURE__ */ e.jsx(
|
|
1202
|
+
gn,
|
|
1203
1203
|
{
|
|
1204
|
-
schemaName:
|
|
1205
|
-
tableName:
|
|
1204
|
+
schemaName: K,
|
|
1205
|
+
tableName: U,
|
|
1206
1206
|
columns: h,
|
|
1207
|
-
status:
|
|
1207
|
+
status: E ? "Loading..." : y ? "Error" : "Success"
|
|
1208
1208
|
}
|
|
1209
1209
|
);
|
|
1210
1210
|
}
|
|
@@ -1212,12 +1212,12 @@ function ut({
|
|
|
1212
1212
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1213
1213
|
}
|
|
1214
1214
|
function P() {
|
|
1215
|
-
return
|
|
1215
|
+
return F === "S3" || F === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1216
1216
|
He,
|
|
1217
1217
|
{
|
|
1218
|
-
onChange:
|
|
1219
|
-
isError:
|
|
1220
|
-
isLoading:
|
|
1218
|
+
onChange: $,
|
|
1219
|
+
isError: b,
|
|
1220
|
+
isLoading: f,
|
|
1221
1221
|
items: c,
|
|
1222
1222
|
value: t || "",
|
|
1223
1223
|
title: "Database"
|
|
@@ -1225,10 +1225,10 @@ function ut({
|
|
|
1225
1225
|
);
|
|
1226
1226
|
}
|
|
1227
1227
|
function se() {
|
|
1228
|
-
return
|
|
1228
|
+
return F === "S3" || F === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1229
1229
|
He,
|
|
1230
1230
|
{
|
|
1231
|
-
onChange:
|
|
1231
|
+
onChange: X,
|
|
1232
1232
|
isError: v,
|
|
1233
1233
|
isLoading: C,
|
|
1234
1234
|
items: d,
|
|
@@ -1237,15 +1237,15 @@ function ut({
|
|
|
1237
1237
|
}
|
|
1238
1238
|
);
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
return
|
|
1240
|
+
function Z() {
|
|
1241
|
+
return F === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1242
1242
|
He,
|
|
1243
1243
|
{
|
|
1244
1244
|
onChange: o,
|
|
1245
|
-
isError:
|
|
1245
|
+
isError: g,
|
|
1246
1246
|
items: m,
|
|
1247
|
-
isLoading:
|
|
1248
|
-
value:
|
|
1247
|
+
isLoading: T,
|
|
1248
|
+
value: i || "",
|
|
1249
1249
|
title: "Table"
|
|
1250
1250
|
}
|
|
1251
1251
|
);
|
|
@@ -1258,28 +1258,28 @@ function ut({
|
|
|
1258
1258
|
items: r,
|
|
1259
1259
|
title: "Connection",
|
|
1260
1260
|
value: n || "",
|
|
1261
|
-
onChange:
|
|
1261
|
+
onChange: A,
|
|
1262
1262
|
isLoading: u,
|
|
1263
|
-
isError:
|
|
1264
|
-
connectionTooltip: ((
|
|
1265
|
-
(
|
|
1266
|
-
)) == null ? void 0 :
|
|
1263
|
+
isError: j,
|
|
1264
|
+
connectionTooltip: ((G = r == null ? void 0 : r.find(
|
|
1265
|
+
(L) => L.id === n
|
|
1266
|
+
)) == null ? void 0 : G.type) || ""
|
|
1267
1267
|
}
|
|
1268
1268
|
),
|
|
1269
1269
|
P(),
|
|
1270
1270
|
se(),
|
|
1271
|
-
|
|
1271
|
+
Z()
|
|
1272
1272
|
] }),
|
|
1273
|
-
|
|
1273
|
+
D(),
|
|
1274
1274
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1275
|
-
|
|
1275
|
+
w,
|
|
1276
1276
|
{
|
|
1277
1277
|
onClick: ee,
|
|
1278
1278
|
size: "sm",
|
|
1279
1279
|
variant: "secondary",
|
|
1280
1280
|
className: "w-full",
|
|
1281
1281
|
children: [
|
|
1282
|
-
/* @__PURE__ */ e.jsx(
|
|
1282
|
+
/* @__PURE__ */ e.jsx(sn, { className: "mr-2 size-4" }),
|
|
1283
1283
|
"Help"
|
|
1284
1284
|
]
|
|
1285
1285
|
}
|
|
@@ -1290,7 +1290,7 @@ const rs = ({
|
|
|
1290
1290
|
className: s,
|
|
1291
1291
|
...n
|
|
1292
1292
|
}) => /* @__PURE__ */ e.jsx(
|
|
1293
|
-
|
|
1293
|
+
Gt,
|
|
1294
1294
|
{
|
|
1295
1295
|
className: W(
|
|
1296
1296
|
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
@@ -1298,25 +1298,25 @@ const rs = ({
|
|
|
1298
1298
|
),
|
|
1299
1299
|
...n
|
|
1300
1300
|
}
|
|
1301
|
-
),
|
|
1301
|
+
), Oe = Jt, ls = ({
|
|
1302
1302
|
withHandle: s,
|
|
1303
1303
|
className: n,
|
|
1304
1304
|
...t
|
|
1305
1305
|
}) => /* @__PURE__ */ e.jsx(
|
|
1306
|
-
|
|
1306
|
+
Qt,
|
|
1307
1307
|
{
|
|
1308
1308
|
className: W(
|
|
1309
1309
|
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
1310
1310
|
n
|
|
1311
1311
|
),
|
|
1312
1312
|
...t,
|
|
1313
|
-
children: s && /* @__PURE__ */ e.jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ e.jsx(
|
|
1313
|
+
children: s && /* @__PURE__ */ e.jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ e.jsx(Qa, { className: "h-2.5 w-2.5" }) })
|
|
1314
1314
|
}
|
|
1315
1315
|
);
|
|
1316
|
-
function
|
|
1317
|
-
const n = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), a = s.toUpperCase().indexOf("LIMIT"),
|
|
1316
|
+
function jn(s) {
|
|
1317
|
+
const n = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), a = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
|
|
1318
1318
|
let o = s.length;
|
|
1319
|
-
if (
|
|
1319
|
+
if (i !== -1 && (o = i), a !== -1 && a < o && (o = a), n !== -1) {
|
|
1320
1320
|
const r = s.substring(0, n), d = s.substring(n);
|
|
1321
1321
|
return `${r} {{ filters | where }} AND ${d.substring(
|
|
1322
1322
|
6
|
|
@@ -1329,17 +1329,17 @@ function gn(s) {
|
|
|
1329
1329
|
return `${r} {{ filters | where }} ${d}`;
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1332
|
+
function bn({
|
|
1333
1333
|
error: s,
|
|
1334
1334
|
setShowAIDialog: n,
|
|
1335
1335
|
setUserInputforAI: t,
|
|
1336
1336
|
setTriggerAIRun: a
|
|
1337
1337
|
}) {
|
|
1338
1338
|
return /* @__PURE__ */ e.jsxs(Qs, { openDelay: 0, children: [
|
|
1339
|
-
/* @__PURE__ */ e.jsx(Ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1339
|
+
/* @__PURE__ */ e.jsx(Ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Ka, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1340
1340
|
/* @__PURE__ */ e.jsx(Ps, { 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: "grow space-y-1 flex flex-col ", children: [
|
|
1341
1341
|
/* @__PURE__ */ e.jsxs(
|
|
1342
|
-
|
|
1342
|
+
w,
|
|
1343
1343
|
{
|
|
1344
1344
|
onClick: () => {
|
|
1345
1345
|
n(!0), t(s), a(!0);
|
|
@@ -1347,7 +1347,7 @@ function jn({
|
|
|
1347
1347
|
size: "sm",
|
|
1348
1348
|
variant: "outline",
|
|
1349
1349
|
children: [
|
|
1350
|
-
/* @__PURE__ */ e.jsx(
|
|
1350
|
+
/* @__PURE__ */ e.jsx(Wa, { className: "h-4 w-4 mr-2" }),
|
|
1351
1351
|
"Fix It"
|
|
1352
1352
|
]
|
|
1353
1353
|
}
|
|
@@ -1356,7 +1356,7 @@ function jn({
|
|
|
1356
1356
|
] }) }) })
|
|
1357
1357
|
] });
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1359
|
+
function yn({
|
|
1360
1360
|
text: s,
|
|
1361
1361
|
onCheckedChange: n,
|
|
1362
1362
|
checked: t
|
|
@@ -1366,8 +1366,8 @@ function bn({
|
|
|
1366
1366
|
/* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
|
|
1367
1367
|
] });
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1370
|
-
const { authToken: s } = Ye(), n =
|
|
1369
|
+
function vn() {
|
|
1370
|
+
const { authToken: s } = Ye(), n = Ie(null), t = l((d) => d.applyFilters), [a, i] = O(""), o = l((d) => d.filterValues), r = l((d) => d.card.sql);
|
|
1371
1371
|
return /* @__PURE__ */ e.jsxs(
|
|
1372
1372
|
Qs,
|
|
1373
1373
|
{
|
|
@@ -1384,7 +1384,7 @@ function yn() {
|
|
|
1384
1384
|
active_filters: o
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
|
-
console.log(c), c.sql ? (console.log(c.records),
|
|
1387
|
+
console.log(c), c.sql ? (console.log(c.records), i(c.sql)) : i("Error");
|
|
1388
1388
|
},
|
|
1389
1389
|
children: [
|
|
1390
1390
|
/* @__PURE__ */ e.jsx(Ws, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
@@ -1394,7 +1394,7 @@ function yn() {
|
|
|
1394
1394
|
/* @__PURE__ */ e.jsx(
|
|
1395
1395
|
Xs,
|
|
1396
1396
|
{
|
|
1397
|
-
onClick: () =>
|
|
1397
|
+
onClick: () => Wt(n),
|
|
1398
1398
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1399
1399
|
}
|
|
1400
1400
|
)
|
|
@@ -1408,7 +1408,7 @@ function yn() {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
);
|
|
1410
1410
|
}
|
|
1411
|
-
const
|
|
1411
|
+
const Nn = `
|
|
1412
1412
|
|
|
1413
1413
|
Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
|
|
1414
1414
|
|
|
@@ -1455,73 +1455,73 @@ SELECT label, measure FROM table
|
|
|
1455
1455
|
- Label - Category
|
|
1456
1456
|
- Measure - Number
|
|
1457
1457
|
`;
|
|
1458
|
-
function
|
|
1458
|
+
function Cn({
|
|
1459
1459
|
open: s,
|
|
1460
1460
|
setOpen: n,
|
|
1461
1461
|
userInput: t,
|
|
1462
1462
|
setUserInput: a,
|
|
1463
|
-
triggerAIRun:
|
|
1463
|
+
triggerAIRun: i,
|
|
1464
1464
|
setTriggerAIRun: o
|
|
1465
1465
|
}) {
|
|
1466
|
-
const r =
|
|
1466
|
+
const r = Ie(null), d = Ie(null), { authToken: c } = Ye(), [m, h] = O(!1), u = l((x) => x.actions.setCardSql), j = S((x) => x.dashboard.baseQueries), f = l((x) => x.actions.setRunSql), b = l((x) => x.actions.setCardType), [C, v] = O([]), y = l((x) => x.currentColumns), E = l((x) => x.card.sql), T = l((x) => x.selectedTableName), g = `
|
|
1467
1467
|
${t}
|
|
1468
1468
|
|
|
1469
|
-
Database Query Dialect: ${
|
|
1470
|
-
Table Name: ${
|
|
1471
|
-
Table Columns: ${y == null ? void 0 : y.map((
|
|
1472
|
-
User SQL: ${
|
|
1473
|
-
${
|
|
1474
|
-
Visual Query Syntax: ${
|
|
1469
|
+
Database Query Dialect: ${T === "api" || T === "s3" ? "DuckDb" : ""}
|
|
1470
|
+
Table Name: ${T}
|
|
1471
|
+
Table Columns: ${y == null ? void 0 : y.map((x) => `${x.column_name} | ${x.data_type}`).join(", ")}
|
|
1472
|
+
User SQL: ${E}
|
|
1473
|
+
${j && `Base Queries: ${JSON.stringify(j)} `}`, F = ` 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.
|
|
1474
|
+
Visual Query Syntax: ${Nn}`, { data: M, isLoading: A, isFetching: $, isError: X, refetch: U } = Ne({
|
|
1475
1475
|
queryKey: ["ai-query"],
|
|
1476
|
-
queryFn: () =>
|
|
1476
|
+
queryFn: () => Fe(
|
|
1477
1477
|
"https://semaphor.cloud/api/v1/ai",
|
|
1478
1478
|
(c == null ? void 0 : c.accessToken) || "",
|
|
1479
1479
|
{
|
|
1480
|
-
user_content: `userContent: ${
|
|
1480
|
+
user_content: `userContent: ${g} ${m ? F : ""}`
|
|
1481
1481
|
}
|
|
1482
1482
|
),
|
|
1483
1483
|
enabled: !1
|
|
1484
1484
|
// Do not run by default.
|
|
1485
1485
|
});
|
|
1486
|
-
function
|
|
1487
|
-
if (
|
|
1488
|
-
|
|
1489
|
-
else if (
|
|
1490
|
-
|
|
1491
|
-
else if (
|
|
1492
|
-
|
|
1493
|
-
else if (
|
|
1494
|
-
|
|
1495
|
-
else if (
|
|
1496
|
-
|
|
1497
|
-
else if (
|
|
1498
|
-
|
|
1499
|
-
else if (
|
|
1500
|
-
|
|
1501
|
-
else if (
|
|
1502
|
-
|
|
1486
|
+
function K(x) {
|
|
1487
|
+
if (x.toLowerCase().includes("bar"))
|
|
1488
|
+
b("bar");
|
|
1489
|
+
else if (x.toLowerCase().includes("line"))
|
|
1490
|
+
b("line");
|
|
1491
|
+
else if (x.toLowerCase().includes("bubble"))
|
|
1492
|
+
b("bubble");
|
|
1493
|
+
else if (x.toLowerCase().includes("scatter"))
|
|
1494
|
+
b("scatter");
|
|
1495
|
+
else if (x.toLowerCase().includes("stacked"))
|
|
1496
|
+
b("stackedBar");
|
|
1497
|
+
else if (x.toLowerCase().includes("pie"))
|
|
1498
|
+
b("pie");
|
|
1499
|
+
else if (x.toLowerCase().includes("donut") || x.toLowerCase().includes("doughnut"))
|
|
1500
|
+
b("doughnut");
|
|
1501
|
+
else if (x.toLowerCase().includes("radar"))
|
|
1502
|
+
b("radar");
|
|
1503
1503
|
else
|
|
1504
|
-
return
|
|
1504
|
+
return b("bar"), !1;
|
|
1505
1505
|
return !0;
|
|
1506
1506
|
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
}, [
|
|
1510
|
-
const
|
|
1511
|
-
var
|
|
1507
|
+
B(() => {
|
|
1508
|
+
M && v((x) => [...x, { role: "ai", content: M.response }]);
|
|
1509
|
+
}, [M]), B(() => {
|
|
1510
|
+
const x = setTimeout(() => {
|
|
1511
|
+
var k;
|
|
1512
1512
|
d.current && (d.current.scroll({
|
|
1513
1513
|
top: d.current.scrollHeight,
|
|
1514
1514
|
behavior: "smooth"
|
|
1515
|
-
}), (
|
|
1515
|
+
}), (k = r.current) == null || k.focus());
|
|
1516
1516
|
}, 100);
|
|
1517
|
-
return () => clearTimeout(
|
|
1517
|
+
return () => clearTimeout(x);
|
|
1518
1518
|
}, [C]);
|
|
1519
|
-
function
|
|
1520
|
-
t && (v((
|
|
1519
|
+
function D() {
|
|
1520
|
+
t && (v((x) => [...x, { role: "user", content: t }]), K(t) && h(!0), a(""), U());
|
|
1521
1521
|
}
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
}, [
|
|
1522
|
+
B(() => {
|
|
1523
|
+
i && (D(), o(!1));
|
|
1524
|
+
}, [i, o]);
|
|
1525
1525
|
const ee = {
|
|
1526
1526
|
//seleect a darker color
|
|
1527
1527
|
// color: '#000',
|
|
@@ -1547,62 +1547,62 @@ function Nn({
|
|
|
1547
1547
|
marginLeft: 20,
|
|
1548
1548
|
// add bullet points for unordered lists
|
|
1549
1549
|
listStyleType: "disc"
|
|
1550
|
-
},
|
|
1550
|
+
}, Z = {
|
|
1551
1551
|
// Override how paragraphs are rendered
|
|
1552
|
-
p: ({ node:
|
|
1553
|
-
code: ({ node:
|
|
1554
|
-
pre: ({ node:
|
|
1555
|
-
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children:
|
|
1552
|
+
p: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("p", { style: ee, ...k }),
|
|
1553
|
+
code: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...k }),
|
|
1554
|
+
pre: ({ node: x, ...k }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
|
|
1555
|
+
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: k.children }),
|
|
1556
1556
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1557
|
-
/* @__PURE__ */ e.jsx(
|
|
1557
|
+
/* @__PURE__ */ e.jsx(w, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Xs, {}) }),
|
|
1558
1558
|
/* @__PURE__ */ e.jsx(
|
|
1559
|
-
|
|
1559
|
+
w,
|
|
1560
1560
|
{
|
|
1561
|
-
onClick: (
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1561
|
+
onClick: (R) => {
|
|
1562
|
+
const H = G(R);
|
|
1563
|
+
H && (n(!1), u(H), f(!0));
|
|
1564
1564
|
},
|
|
1565
1565
|
size: "sm",
|
|
1566
1566
|
variant: "outline",
|
|
1567
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1567
|
+
children: /* @__PURE__ */ e.jsx(Xt, {})
|
|
1568
1568
|
}
|
|
1569
1569
|
)
|
|
1570
1570
|
] })
|
|
1571
1571
|
] }),
|
|
1572
|
-
li: ({ node:
|
|
1572
|
+
li: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("li", { style: se, ...k })
|
|
1573
1573
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1574
1574
|
};
|
|
1575
|
-
function
|
|
1576
|
-
const
|
|
1577
|
-
if (!
|
|
1575
|
+
function G(x) {
|
|
1576
|
+
const k = x.currentTarget.closest("pre");
|
|
1577
|
+
if (!k)
|
|
1578
1578
|
return;
|
|
1579
|
-
const
|
|
1580
|
-
return navigator.clipboard.writeText(
|
|
1579
|
+
const R = k.textContent || k.innerText;
|
|
1580
|
+
return navigator.clipboard.writeText(R).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), R;
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1583
|
-
return C == null ? void 0 : C.map((
|
|
1582
|
+
function L() {
|
|
1583
|
+
return C == null ? void 0 : C.map((x, k) => x.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1584
1584
|
"div",
|
|
1585
1585
|
{
|
|
1586
1586
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1587
1587
|
children: [
|
|
1588
|
-
/* @__PURE__ */ e.jsx(
|
|
1589
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1588
|
+
/* @__PURE__ */ e.jsx(hn, { className: "mr-2 h-5 w-5" }),
|
|
1589
|
+
/* @__PURE__ */ e.jsx("div", { children: x.content })
|
|
1590
1590
|
]
|
|
1591
1591
|
},
|
|
1592
|
-
|
|
1593
|
-
) :
|
|
1594
|
-
|
|
1592
|
+
k
|
|
1593
|
+
) : x.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1594
|
+
Yt,
|
|
1595
1595
|
{
|
|
1596
1596
|
className: "w-full overflow-auto py-1",
|
|
1597
|
-
components:
|
|
1598
|
-
children:
|
|
1597
|
+
components: Z,
|
|
1598
|
+
children: M == null ? void 0 : M.response.replace(/DuckDB/gi, "Semaphor")
|
|
1599
1599
|
},
|
|
1600
|
-
|
|
1601
|
-
) : /* @__PURE__ */ e.jsx("div", {},
|
|
1600
|
+
k
|
|
1601
|
+
) : /* @__PURE__ */ e.jsx("div", {}, k));
|
|
1602
1602
|
}
|
|
1603
1603
|
return /* @__PURE__ */ e.jsxs(is, { open: s, onOpenChange: n, children: [
|
|
1604
1604
|
/* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1605
|
-
|
|
1605
|
+
w,
|
|
1606
1606
|
{
|
|
1607
1607
|
size: "sm",
|
|
1608
1608
|
className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
@@ -1624,7 +1624,7 @@ function Nn({
|
|
|
1624
1624
|
{
|
|
1625
1625
|
ref: d,
|
|
1626
1626
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
1627
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children:
|
|
1627
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: L() })
|
|
1628
1628
|
}
|
|
1629
1629
|
),
|
|
1630
1630
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1636,31 +1636,31 @@ function Nn({
|
|
|
1636
1636
|
{
|
|
1637
1637
|
autoFocus: !0,
|
|
1638
1638
|
ref: r,
|
|
1639
|
-
onKeyDown: (
|
|
1640
|
-
|
|
1639
|
+
onKeyDown: (x) => {
|
|
1640
|
+
x.key === "Enter" && !x.shiftKey && (x.preventDefault(), a(""), D());
|
|
1641
1641
|
},
|
|
1642
1642
|
placeholder: "Type your question here...",
|
|
1643
|
-
onFocus: (
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1643
|
+
onFocus: (x) => {
|
|
1644
|
+
const k = x.target, R = k.value.length;
|
|
1645
|
+
k.setSelectionRange(R, R);
|
|
1646
1646
|
},
|
|
1647
1647
|
className: W(
|
|
1648
1648
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1649
1649
|
),
|
|
1650
|
-
disabled:
|
|
1650
|
+
disabled: A || $,
|
|
1651
1651
|
value: t,
|
|
1652
|
-
onChange: (
|
|
1652
|
+
onChange: (x) => a(x.target.value)
|
|
1653
1653
|
}
|
|
1654
1654
|
),
|
|
1655
1655
|
" ",
|
|
1656
1656
|
/* @__PURE__ */ e.jsx(
|
|
1657
|
-
|
|
1657
|
+
w,
|
|
1658
1658
|
{
|
|
1659
1659
|
className: "h-8",
|
|
1660
1660
|
size: "sm",
|
|
1661
1661
|
variant: "ghost",
|
|
1662
|
-
onClick:
|
|
1663
|
-
children: !
|
|
1662
|
+
onClick: D,
|
|
1663
|
+
children: !A && !$ ? /* @__PURE__ */ e.jsx(Pt, {}) : /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1664
1664
|
}
|
|
1665
1665
|
)
|
|
1666
1666
|
] })
|
|
@@ -1677,24 +1677,24 @@ var mt = {
|
|
|
1677
1677
|
className: void 0,
|
|
1678
1678
|
style: void 0,
|
|
1679
1679
|
attr: void 0
|
|
1680
|
-
}, Vs =
|
|
1681
|
-
function
|
|
1680
|
+
}, Vs = de.createContext && /* @__PURE__ */ de.createContext(mt), Sn = ["attr", "size", "title"];
|
|
1681
|
+
function kn(s, n) {
|
|
1682
1682
|
if (s == null)
|
|
1683
1683
|
return {};
|
|
1684
|
-
var t =
|
|
1684
|
+
var t = wn(s, n), a, i;
|
|
1685
1685
|
if (Object.getOwnPropertySymbols) {
|
|
1686
1686
|
var o = Object.getOwnPropertySymbols(s);
|
|
1687
|
-
for (
|
|
1688
|
-
a = o[
|
|
1687
|
+
for (i = 0; i < o.length; i++)
|
|
1688
|
+
a = o[i], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(s, a) && (t[a] = s[a]);
|
|
1689
1689
|
}
|
|
1690
1690
|
return t;
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function wn(s, n) {
|
|
1693
1693
|
if (s == null)
|
|
1694
1694
|
return {};
|
|
1695
|
-
var t = {}, a = Object.keys(s),
|
|
1695
|
+
var t = {}, a = Object.keys(s), i, o;
|
|
1696
1696
|
for (o = 0; o < a.length; o++)
|
|
1697
|
-
|
|
1697
|
+
i = a[o], !(n.indexOf(i) >= 0) && (t[i] = s[i]);
|
|
1698
1698
|
return t;
|
|
1699
1699
|
}
|
|
1700
1700
|
function Ge() {
|
|
@@ -1711,8 +1711,8 @@ function Rs(s, n) {
|
|
|
1711
1711
|
var t = Object.keys(s);
|
|
1712
1712
|
if (Object.getOwnPropertySymbols) {
|
|
1713
1713
|
var a = Object.getOwnPropertySymbols(s);
|
|
1714
|
-
n && (a = a.filter(function(
|
|
1715
|
-
return Object.getOwnPropertyDescriptor(s,
|
|
1714
|
+
n && (a = a.filter(function(i) {
|
|
1715
|
+
return Object.getOwnPropertyDescriptor(s, i).enumerable;
|
|
1716
1716
|
})), t.push.apply(t, a);
|
|
1717
1717
|
}
|
|
1718
1718
|
return t;
|
|
@@ -1721,21 +1721,21 @@ function Je(s) {
|
|
|
1721
1721
|
for (var n = 1; n < arguments.length; n++) {
|
|
1722
1722
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
1723
1723
|
n % 2 ? Rs(Object(t), !0).forEach(function(a) {
|
|
1724
|
-
|
|
1724
|
+
Fn(s, a, t[a]);
|
|
1725
1725
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : Rs(Object(t)).forEach(function(a) {
|
|
1726
1726
|
Object.defineProperty(s, a, Object.getOwnPropertyDescriptor(t, a));
|
|
1727
1727
|
});
|
|
1728
1728
|
}
|
|
1729
1729
|
return s;
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1732
|
-
return n =
|
|
1731
|
+
function Fn(s, n, t) {
|
|
1732
|
+
return n = On(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = t, s;
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1735
|
-
var n =
|
|
1734
|
+
function On(s) {
|
|
1735
|
+
var n = zn(s, "string");
|
|
1736
1736
|
return typeof n == "symbol" ? n : String(n);
|
|
1737
1737
|
}
|
|
1738
|
-
function
|
|
1738
|
+
function zn(s, n) {
|
|
1739
1739
|
if (typeof s != "object" || s === null)
|
|
1740
1740
|
return s;
|
|
1741
1741
|
var t = s[Symbol.toPrimitive];
|
|
@@ -1748,23 +1748,23 @@ function On(s, n) {
|
|
|
1748
1748
|
return (n === "string" ? String : Number)(s);
|
|
1749
1749
|
}
|
|
1750
1750
|
function xt(s) {
|
|
1751
|
-
return s && s.map((n, t) => /* @__PURE__ */
|
|
1751
|
+
return s && s.map((n, t) => /* @__PURE__ */ de.createElement(n.tag, Je({
|
|
1752
1752
|
key: t
|
|
1753
1753
|
}, n.attr), xt(n.child)));
|
|
1754
1754
|
}
|
|
1755
|
-
function
|
|
1756
|
-
return (n) => /* @__PURE__ */
|
|
1755
|
+
function Se(s) {
|
|
1756
|
+
return (n) => /* @__PURE__ */ de.createElement(Mn, Ge({
|
|
1757
1757
|
attr: Je({}, s.attr)
|
|
1758
1758
|
}, n), xt(s.child));
|
|
1759
1759
|
}
|
|
1760
|
-
function
|
|
1760
|
+
function Mn(s) {
|
|
1761
1761
|
var n = (t) => {
|
|
1762
1762
|
var {
|
|
1763
1763
|
attr: a,
|
|
1764
|
-
size:
|
|
1764
|
+
size: i,
|
|
1765
1765
|
title: o
|
|
1766
|
-
} = s, r =
|
|
1767
|
-
return t.className && (c = t.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */
|
|
1766
|
+
} = s, r = kn(s, Sn), d = i || t.size || "1em", c;
|
|
1767
|
+
return t.className && (c = t.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ de.createElement("svg", Ge({
|
|
1768
1768
|
stroke: "currentColor",
|
|
1769
1769
|
fill: "currentColor",
|
|
1770
1770
|
strokeWidth: "0"
|
|
@@ -1776,157 +1776,157 @@ function zn(s) {
|
|
|
1776
1776
|
height: d,
|
|
1777
1777
|
width: d,
|
|
1778
1778
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1779
|
-
}), o && /* @__PURE__ */
|
|
1779
|
+
}), o && /* @__PURE__ */ de.createElement("title", null, o), s.children);
|
|
1780
1780
|
};
|
|
1781
|
-
return Vs !== void 0 ? /* @__PURE__ */
|
|
1781
|
+
return Vs !== void 0 ? /* @__PURE__ */ de.createElement(Vs.Consumer, null, (t) => n(t)) : n(mt);
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1784
|
-
return
|
|
1783
|
+
function Tn(s) {
|
|
1784
|
+
return Se({ 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);
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1787
|
-
const { theme: s } =
|
|
1788
|
-
S((
|
|
1789
|
-
const
|
|
1790
|
-
(
|
|
1791
|
-
),
|
|
1792
|
-
(
|
|
1793
|
-
),
|
|
1794
|
-
(
|
|
1786
|
+
function An() {
|
|
1787
|
+
const { theme: s } = Zt(), n = Ie(), t = Ie(), [a, i] = O(!1), [o, r] = O(!1), [d, c] = O(!1), [m, h] = O(""), [u, j] = O(!1), { authToken: f } = Ye();
|
|
1788
|
+
S((p) => p.selectedSheetId);
|
|
1789
|
+
const b = S((p) => p.dashboard.baseQueries), C = l((p) => p.card), v = S((p) => p.theme), y = l((p) => p.isShowingVisual), E = l(
|
|
1790
|
+
(p) => p.selectedConnectionId
|
|
1791
|
+
), T = l(
|
|
1792
|
+
(p) => p.selectedDatabaseName
|
|
1793
|
+
), g = l(
|
|
1794
|
+
(p) => p.selectedSchemaName
|
|
1795
1795
|
);
|
|
1796
1796
|
S(
|
|
1797
|
-
(
|
|
1797
|
+
(p) => p.actions.updateFrameCard
|
|
1798
1798
|
);
|
|
1799
|
-
const
|
|
1799
|
+
const F = l((p) => p.selectedTableName), M = l((p) => p.card.sql), A = l((p) => p.card.python), $ = ea(M, b), X = l((p) => p.selectedConnectionId), U = l((p) => p.frame), K = l((p) => p.filterValues), D = l((p) => p.applyFilters), {
|
|
1800
1800
|
setCardCustomCfg: ee,
|
|
1801
1801
|
setQueryResultColumns: P,
|
|
1802
1802
|
setFilterValues: se,
|
|
1803
|
-
setCardSql:
|
|
1804
|
-
setCardPython:
|
|
1805
|
-
setQueryError:
|
|
1806
|
-
setPythonStdOut:
|
|
1807
|
-
setCardPreferences:
|
|
1808
|
-
} =
|
|
1809
|
-
(
|
|
1810
|
-
),
|
|
1811
|
-
(
|
|
1803
|
+
setCardSql: Z,
|
|
1804
|
+
setCardPython: G,
|
|
1805
|
+
setQueryError: L,
|
|
1806
|
+
setPythonStdOut: x,
|
|
1807
|
+
setCardPreferences: k
|
|
1808
|
+
} = l((p) => p.actions), R = l((p) => p.onSave), H = l(
|
|
1809
|
+
(p) => p.actions.setApplyFilters
|
|
1810
|
+
), he = l((p) => p.onClose), te = l((p) => p.actions.setCardData), pe = l((p) => p.actions.setSqlGen), fe = l((p) => p.runSql), ge = l((p) => p.actions.setRunSql), ue = l(
|
|
1811
|
+
(p) => p.actions.setIsSqlRunning
|
|
1812
1812
|
), {
|
|
1813
1813
|
data: J,
|
|
1814
1814
|
isLoading: ae,
|
|
1815
|
-
isFetching:
|
|
1816
|
-
isSuccess:
|
|
1817
|
-
isError:
|
|
1818
|
-
error:
|
|
1815
|
+
isFetching: ne,
|
|
1816
|
+
isSuccess: je,
|
|
1817
|
+
isError: ke,
|
|
1818
|
+
error: Te,
|
|
1819
1819
|
status: Xe,
|
|
1820
|
-
refetch:
|
|
1821
|
-
} =
|
|
1822
|
-
queryKey: [
|
|
1820
|
+
refetch: be
|
|
1821
|
+
} = Ne({
|
|
1822
|
+
queryKey: [$, A],
|
|
1823
1823
|
queryFn: () => Ys(
|
|
1824
1824
|
"https://semaphor.cloud/api/v1/query",
|
|
1825
|
-
(
|
|
1825
|
+
(f == null ? void 0 : f.accessToken) || "",
|
|
1826
1826
|
{
|
|
1827
|
-
connection_id:
|
|
1828
|
-
sql:
|
|
1829
|
-
python:
|
|
1830
|
-
active_filters:
|
|
1827
|
+
connection_id: X,
|
|
1828
|
+
sql: $,
|
|
1829
|
+
python: A === Ms ? "" : A,
|
|
1830
|
+
active_filters: D ? K : []
|
|
1831
1831
|
}
|
|
1832
1832
|
),
|
|
1833
1833
|
enabled: !1,
|
|
1834
1834
|
retry: !1
|
|
1835
1835
|
});
|
|
1836
|
-
|
|
1837
|
-
if (J && (te(J.records),
|
|
1838
|
-
const { dimensionKeys:
|
|
1839
|
-
P(
|
|
1836
|
+
B(() => {
|
|
1837
|
+
if (J && (te(J.records), x((J == null ? void 0 : J.output) || ""), J.records.length > 0)) {
|
|
1838
|
+
const { dimensionKeys: p } = ns(J.records);
|
|
1839
|
+
P(p);
|
|
1840
1840
|
}
|
|
1841
|
-
}, [J, te, P,
|
|
1842
|
-
|
|
1843
|
-
}, [
|
|
1844
|
-
(ae ||
|
|
1841
|
+
}, [J, te, P, x]), B(() => {
|
|
1842
|
+
fe && (be(), ge(!1));
|
|
1843
|
+
}, [fe, be, ge]), B(() => {
|
|
1844
|
+
(ae || ne) && ue(!0), (ke || je) && ue(!1), ke ? (L(Te.message), te([]), P([]), x("")) : L("");
|
|
1845
1845
|
}, [
|
|
1846
1846
|
ae,
|
|
1847
|
-
|
|
1847
|
+
ne,
|
|
1848
1848
|
J,
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1849
|
+
x,
|
|
1850
|
+
ke,
|
|
1851
|
+
je,
|
|
1852
|
+
ue,
|
|
1853
1853
|
te,
|
|
1854
1854
|
P,
|
|
1855
|
-
|
|
1856
|
-
|
|
1855
|
+
L,
|
|
1856
|
+
Te
|
|
1857
1857
|
]);
|
|
1858
1858
|
function _e() {
|
|
1859
|
-
|
|
1859
|
+
Z(""), te([]), pe({}), ee(""), k({});
|
|
1860
1860
|
}
|
|
1861
|
-
const
|
|
1862
|
-
t.current =
|
|
1861
|
+
const Ae = (p) => {
|
|
1862
|
+
t.current = p;
|
|
1863
1863
|
};
|
|
1864
1864
|
function N() {
|
|
1865
|
-
let
|
|
1866
|
-
|
|
1867
|
-
const
|
|
1865
|
+
let p = M;
|
|
1866
|
+
M && !M.includes("{{") && (p = jn(M), Z(p));
|
|
1867
|
+
const re = {
|
|
1868
1868
|
...C,
|
|
1869
|
-
lastSelectedSchema:
|
|
1870
|
-
lastSelectedDatabase:
|
|
1871
|
-
lastSelectedTable:
|
|
1872
|
-
connectionId:
|
|
1869
|
+
lastSelectedSchema: g,
|
|
1870
|
+
lastSelectedDatabase: T,
|
|
1871
|
+
lastSelectedTable: F,
|
|
1872
|
+
connectionId: E,
|
|
1873
1873
|
type: y ? C.type : "table",
|
|
1874
|
-
sql:
|
|
1874
|
+
sql: p,
|
|
1875
1875
|
customCfg: y ? C.customCfg : null
|
|
1876
|
-
},
|
|
1877
|
-
(
|
|
1876
|
+
}, Ee = U.cards.map(
|
|
1877
|
+
(ye) => ye.id === C.id ? re : ye
|
|
1878
1878
|
);
|
|
1879
|
-
|
|
1880
|
-
...
|
|
1881
|
-
cards:
|
|
1879
|
+
R == null || R({
|
|
1880
|
+
...U,
|
|
1881
|
+
cards: Ee
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1885
|
-
|
|
1884
|
+
function St() {
|
|
1885
|
+
he == null || he();
|
|
1886
1886
|
}
|
|
1887
|
-
function
|
|
1888
|
-
const
|
|
1887
|
+
function kt(p) {
|
|
1888
|
+
const re = getComputedStyle(
|
|
1889
1889
|
document.documentElement
|
|
1890
|
-
).getPropertyValue(
|
|
1891
|
-
return
|
|
1890
|
+
).getPropertyValue(p);
|
|
1891
|
+
return wt(re);
|
|
1892
1892
|
}
|
|
1893
|
-
function
|
|
1894
|
-
const [
|
|
1895
|
-
let
|
|
1896
|
-
0 <= Y && Y < 60 ? (
|
|
1897
|
-
const es = (
|
|
1898
|
-
const ss =
|
|
1893
|
+
function wt(p) {
|
|
1894
|
+
const [re, Ee, ye] = p.split(" "), Y = parseFloat(re), zt = parseFloat(Ee), Mt = parseFloat(ye), Tt = zt / 100, Fs = Mt / 100, me = (1 - Math.abs(2 * Fs - 1)) * Tt, we = me * (1 - Math.abs(Y / 60 % 2 - 1)), Ze = Fs - me / 2;
|
|
1895
|
+
let le = 0, ie = 0, oe = 0;
|
|
1896
|
+
0 <= Y && Y < 60 ? (le = me, ie = we, oe = 0) : 60 <= Y && Y < 120 ? (le = we, ie = me, oe = 0) : 120 <= Y && Y < 180 ? (le = 0, ie = me, oe = we) : 180 <= Y && Y < 240 ? (le = 0, ie = we, oe = me) : 240 <= Y && Y < 300 ? (le = we, ie = 0, oe = me) : 300 <= Y && Y < 360 && (le = me, ie = 0, oe = we), le = Math.round((le + Ze) * 255), ie = Math.round((ie + Ze) * 255), oe = Math.round((oe + Ze) * 255);
|
|
1897
|
+
const es = (At) => {
|
|
1898
|
+
const ss = At.toString(16);
|
|
1899
1899
|
return ss.length == 1 ? "0" + ss : ss;
|
|
1900
1900
|
};
|
|
1901
|
-
return `#${es(
|
|
1901
|
+
return `#${es(le)}${es(ie)}${es(oe)}`;
|
|
1902
1902
|
}
|
|
1903
|
-
|
|
1904
|
-
const
|
|
1905
|
-
if (
|
|
1906
|
-
const
|
|
1907
|
-
|
|
1903
|
+
B(() => {
|
|
1904
|
+
const p = n.current, re = t.current;
|
|
1905
|
+
if (p) {
|
|
1906
|
+
const Ee = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = v === "system" ? Ee : v;
|
|
1907
|
+
p.editor.defineTheme("default", {
|
|
1908
1908
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
1909
|
-
base:
|
|
1909
|
+
base: ye === "light" ? "vs" : "vs-dark",
|
|
1910
1910
|
inherit: !0,
|
|
1911
1911
|
rules: [],
|
|
1912
1912
|
colors: {
|
|
1913
1913
|
// 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
|
|
1914
|
-
"editor.background":
|
|
1914
|
+
"editor.background": ye === "light" ? "#ffffff" : kt("--background")
|
|
1915
1915
|
}
|
|
1916
|
-
}),
|
|
1916
|
+
}), p.editor.setTheme("default");
|
|
1917
1917
|
}
|
|
1918
|
-
return
|
|
1919
|
-
|
|
1918
|
+
return re && p && re.addCommand(
|
|
1919
|
+
p.KeyMod.Shift | p.KeyCode.Enter,
|
|
1920
1920
|
function() {
|
|
1921
|
-
return console.log("Executing query..."),
|
|
1921
|
+
return console.log("Executing query..."), be(), !1;
|
|
1922
1922
|
}
|
|
1923
1923
|
), () => {
|
|
1924
1924
|
};
|
|
1925
1925
|
}, [s, v, n.current]);
|
|
1926
|
-
function ws(
|
|
1927
|
-
n.current =
|
|
1926
|
+
function ws(p) {
|
|
1927
|
+
n.current = p;
|
|
1928
1928
|
}
|
|
1929
|
-
function
|
|
1929
|
+
function Ft() {
|
|
1930
1930
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1931
1931
|
o && /* @__PURE__ */ e.jsx(
|
|
1932
1932
|
"div",
|
|
@@ -1936,16 +1936,16 @@ function Tn() {
|
|
|
1936
1936
|
children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
|
|
1937
1937
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
1938
1938
|
/* @__PURE__ */ e.jsx(
|
|
1939
|
-
|
|
1939
|
+
yn,
|
|
1940
1940
|
{
|
|
1941
|
-
checked:
|
|
1942
|
-
onCheckedChange: () =>
|
|
1941
|
+
checked: D,
|
|
1942
|
+
onCheckedChange: () => H(!D),
|
|
1943
1943
|
text: "Apply Filters"
|
|
1944
1944
|
}
|
|
1945
1945
|
),
|
|
1946
|
-
/* @__PURE__ */ e.jsx(
|
|
1947
|
-
|
|
1948
|
-
|
|
1946
|
+
/* @__PURE__ */ e.jsx(vn, {}),
|
|
1947
|
+
K && o && /* @__PURE__ */ e.jsx(
|
|
1948
|
+
Le,
|
|
1949
1949
|
{
|
|
1950
1950
|
onClick: () => r(!1),
|
|
1951
1951
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
@@ -1956,16 +1956,16 @@ function Tn() {
|
|
|
1956
1956
|
Be,
|
|
1957
1957
|
{
|
|
1958
1958
|
theme: "default",
|
|
1959
|
-
onChange: (
|
|
1960
|
-
if (
|
|
1959
|
+
onChange: (p) => {
|
|
1960
|
+
if (p)
|
|
1961
1961
|
try {
|
|
1962
|
-
JSON.parse(
|
|
1962
|
+
JSON.parse(p), se(JSON.parse(p));
|
|
1963
1963
|
} catch {
|
|
1964
1964
|
}
|
|
1965
1965
|
},
|
|
1966
1966
|
defaultLanguage: "json",
|
|
1967
1967
|
className: "mt-1 min-h-[220px]",
|
|
1968
|
-
value: JSON.stringify(
|
|
1968
|
+
value: JSON.stringify(K, null, 2),
|
|
1969
1969
|
options: {
|
|
1970
1970
|
readOnly: !0,
|
|
1971
1971
|
minimap: {
|
|
@@ -1986,21 +1986,21 @@ function Tn() {
|
|
|
1986
1986
|
] })
|
|
1987
1987
|
}
|
|
1988
1988
|
),
|
|
1989
|
-
|
|
1989
|
+
K && !o && /* @__PURE__ */ e.jsx(
|
|
1990
1990
|
rt,
|
|
1991
1991
|
{
|
|
1992
1992
|
onClick: () => r(!0),
|
|
1993
1993
|
className: W(
|
|
1994
1994
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
1995
1995
|
{
|
|
1996
|
-
"font-bold text-red-800":
|
|
1996
|
+
"font-bold text-red-800": D
|
|
1997
1997
|
}
|
|
1998
1998
|
)
|
|
1999
1999
|
}
|
|
2000
2000
|
)
|
|
2001
2001
|
] });
|
|
2002
2002
|
}
|
|
2003
|
-
function
|
|
2003
|
+
function Ot() {
|
|
2004
2004
|
return /* @__PURE__ */ e.jsxs(
|
|
2005
2005
|
rs,
|
|
2006
2006
|
{
|
|
@@ -2009,7 +2009,7 @@ function Tn() {
|
|
|
2009
2009
|
role: "editor-resizable-group",
|
|
2010
2010
|
children: [
|
|
2011
2011
|
/* @__PURE__ */ e.jsxs(
|
|
2012
|
-
|
|
2012
|
+
Oe,
|
|
2013
2013
|
{
|
|
2014
2014
|
id: "1",
|
|
2015
2015
|
order: 1,
|
|
@@ -2026,10 +2026,10 @@ function Tn() {
|
|
|
2026
2026
|
{
|
|
2027
2027
|
theme: "default",
|
|
2028
2028
|
className: "pt-3",
|
|
2029
|
-
onChange: (
|
|
2030
|
-
|
|
2029
|
+
onChange: (p) => {
|
|
2030
|
+
Z(p);
|
|
2031
2031
|
},
|
|
2032
|
-
value:
|
|
2032
|
+
value: M,
|
|
2033
2033
|
options: {
|
|
2034
2034
|
minimap: {
|
|
2035
2035
|
enabled: !1
|
|
@@ -2045,7 +2045,7 @@ function Tn() {
|
|
|
2045
2045
|
defaultLanguage: "sql",
|
|
2046
2046
|
defaultValue: "SELECT * FROM table",
|
|
2047
2047
|
beforeMount: ws,
|
|
2048
|
-
onMount:
|
|
2048
|
+
onMount: Ae
|
|
2049
2049
|
}
|
|
2050
2050
|
)
|
|
2051
2051
|
}
|
|
@@ -2057,7 +2057,7 @@ function Tn() {
|
|
|
2057
2057
|
a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2058
2058
|
/* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border" }),
|
|
2059
2059
|
/* @__PURE__ */ e.jsxs(
|
|
2060
|
-
|
|
2060
|
+
Oe,
|
|
2061
2061
|
{
|
|
2062
2062
|
id: "2",
|
|
2063
2063
|
order: 2,
|
|
@@ -2074,10 +2074,10 @@ function Tn() {
|
|
|
2074
2074
|
{
|
|
2075
2075
|
className: "pt-3",
|
|
2076
2076
|
theme: "default",
|
|
2077
|
-
onChange: (
|
|
2078
|
-
|
|
2077
|
+
onChange: (p) => {
|
|
2078
|
+
G(p && p.trim() || "");
|
|
2079
2079
|
},
|
|
2080
|
-
value:
|
|
2080
|
+
value: A || Ms,
|
|
2081
2081
|
options: {
|
|
2082
2082
|
minimap: {
|
|
2083
2083
|
enabled: !1
|
|
@@ -2092,7 +2092,7 @@ function Tn() {
|
|
|
2092
2092
|
},
|
|
2093
2093
|
defaultLanguage: "python",
|
|
2094
2094
|
beforeMount: ws,
|
|
2095
|
-
onMount:
|
|
2095
|
+
onMount: Ae
|
|
2096
2096
|
}
|
|
2097
2097
|
)
|
|
2098
2098
|
}
|
|
@@ -2120,8 +2120,8 @@ function Tn() {
|
|
|
2120
2120
|
role: "sql-editor",
|
|
2121
2121
|
className: "relative flex grow justify-between overflow-y-scroll",
|
|
2122
2122
|
children: [
|
|
2123
|
-
|
|
2124
|
-
|
|
2123
|
+
Ot(),
|
|
2124
|
+
Ft()
|
|
2125
2125
|
]
|
|
2126
2126
|
}
|
|
2127
2127
|
),
|
|
@@ -2133,40 +2133,40 @@ function Tn() {
|
|
|
2133
2133
|
children: [
|
|
2134
2134
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2135
2135
|
/* @__PURE__ */ e.jsxs(
|
|
2136
|
-
|
|
2136
|
+
w,
|
|
2137
2137
|
{
|
|
2138
2138
|
title: "Shift + Enter",
|
|
2139
|
-
disabled: ae ||
|
|
2139
|
+
disabled: ae || ne,
|
|
2140
2140
|
onClick: () => {
|
|
2141
|
-
|
|
2141
|
+
be();
|
|
2142
2142
|
},
|
|
2143
2143
|
className: "shrink-0",
|
|
2144
2144
|
size: "sm",
|
|
2145
2145
|
variant: "outline",
|
|
2146
2146
|
children: [
|
|
2147
|
-
ae ||
|
|
2147
|
+
ae || ne ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(an, { className: "mr-2 h-4 w-4" }),
|
|
2148
2148
|
"Run"
|
|
2149
2149
|
]
|
|
2150
2150
|
}
|
|
2151
2151
|
),
|
|
2152
|
-
|
|
2153
|
-
|
|
2152
|
+
ke && /* @__PURE__ */ e.jsx(
|
|
2153
|
+
bn,
|
|
2154
2154
|
{
|
|
2155
|
-
error:
|
|
2155
|
+
error: Te.message,
|
|
2156
2156
|
setShowAIDialog: c,
|
|
2157
|
-
setTriggerAIRun:
|
|
2157
|
+
setTriggerAIRun: j,
|
|
2158
2158
|
setUserInputforAI: h
|
|
2159
2159
|
}
|
|
2160
2160
|
),
|
|
2161
2161
|
/* @__PURE__ */ e.jsxs(
|
|
2162
|
-
|
|
2162
|
+
w,
|
|
2163
2163
|
{
|
|
2164
2164
|
onClick: _e,
|
|
2165
2165
|
className: "",
|
|
2166
2166
|
size: "sm",
|
|
2167
2167
|
variant: "outline",
|
|
2168
2168
|
children: [
|
|
2169
|
-
/* @__PURE__ */ e.jsx(
|
|
2169
|
+
/* @__PURE__ */ e.jsx(Ga, { className: "mr-2 size-4" }),
|
|
2170
2170
|
"Clear"
|
|
2171
2171
|
]
|
|
2172
2172
|
}
|
|
@@ -2175,47 +2175,47 @@ function Tn() {
|
|
|
2175
2175
|
Js,
|
|
2176
2176
|
{
|
|
2177
2177
|
pressed: a,
|
|
2178
|
-
onPressedChange: (
|
|
2178
|
+
onPressedChange: (p) => i(p),
|
|
2179
2179
|
className: "",
|
|
2180
2180
|
size: "sm",
|
|
2181
2181
|
variant: "outline",
|
|
2182
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2182
|
+
children: /* @__PURE__ */ e.jsx(Tn, { className: "size-4 text-foreground/70" })
|
|
2183
2183
|
}
|
|
2184
2184
|
),
|
|
2185
2185
|
/* @__PURE__ */ e.jsx(
|
|
2186
|
-
|
|
2186
|
+
Cn,
|
|
2187
2187
|
{
|
|
2188
2188
|
open: d,
|
|
2189
2189
|
setOpen: c,
|
|
2190
2190
|
userInput: m,
|
|
2191
2191
|
triggerAIRun: u,
|
|
2192
|
-
setTriggerAIRun:
|
|
2193
|
-
setUserInput: (
|
|
2192
|
+
setTriggerAIRun: j,
|
|
2193
|
+
setUserInput: (p) => h(p)
|
|
2194
2194
|
}
|
|
2195
2195
|
)
|
|
2196
2196
|
] }),
|
|
2197
2197
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2198
2198
|
/* @__PURE__ */ e.jsxs(
|
|
2199
|
-
|
|
2199
|
+
w,
|
|
2200
2200
|
{
|
|
2201
2201
|
onClick: N,
|
|
2202
2202
|
size: "sm",
|
|
2203
2203
|
variant: "outline",
|
|
2204
2204
|
children: [
|
|
2205
|
-
/* @__PURE__ */ e.jsx(
|
|
2205
|
+
/* @__PURE__ */ e.jsx(sa, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2206
2206
|
"Accept"
|
|
2207
2207
|
]
|
|
2208
2208
|
}
|
|
2209
2209
|
),
|
|
2210
2210
|
/* @__PURE__ */ e.jsxs(
|
|
2211
|
-
|
|
2211
|
+
w,
|
|
2212
2212
|
{
|
|
2213
|
-
onClick:
|
|
2213
|
+
onClick: St,
|
|
2214
2214
|
className: "w-full",
|
|
2215
2215
|
size: "sm",
|
|
2216
2216
|
variant: "outline",
|
|
2217
2217
|
children: [
|
|
2218
|
-
/* @__PURE__ */ e.jsx(
|
|
2218
|
+
/* @__PURE__ */ e.jsx(Le, { className: "mr-2 size-4" }),
|
|
2219
2219
|
"Close"
|
|
2220
2220
|
]
|
|
2221
2221
|
}
|
|
@@ -2229,9 +2229,9 @@ function Tn() {
|
|
|
2229
2229
|
)
|
|
2230
2230
|
);
|
|
2231
2231
|
}
|
|
2232
|
-
function
|
|
2232
|
+
function En({ data: s }) {
|
|
2233
2233
|
var r;
|
|
2234
|
-
const [n, t] =
|
|
2234
|
+
const [n, t] = de.useState([]), i = Object.keys(s[0]).map((d) => ({
|
|
2235
2235
|
// header: key,
|
|
2236
2236
|
accessorKey: d,
|
|
2237
2237
|
header: ({ column: c }) => {
|
|
@@ -2243,29 +2243,29 @@ function An({ data: s }) {
|
|
|
2243
2243
|
onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
|
|
2244
2244
|
children: [
|
|
2245
2245
|
d,
|
|
2246
|
-
m === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2246
|
+
m === "asc" ? /* @__PURE__ */ e.jsx(ta, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(aa, { className: "ml-2 h-5 w-5" }) : null
|
|
2247
2247
|
]
|
|
2248
2248
|
}
|
|
2249
2249
|
) });
|
|
2250
2250
|
}
|
|
2251
|
-
})), o =
|
|
2251
|
+
})), o = na({
|
|
2252
2252
|
data: s,
|
|
2253
|
-
columns:
|
|
2254
|
-
getCoreRowModel:
|
|
2255
|
-
getPaginationRowModel:
|
|
2253
|
+
columns: i,
|
|
2254
|
+
getCoreRowModel: ca(),
|
|
2255
|
+
getPaginationRowModel: da(),
|
|
2256
2256
|
onSortingChange: t,
|
|
2257
|
-
getSortedRowModel:
|
|
2257
|
+
getSortedRowModel: ha(),
|
|
2258
2258
|
manualPagination: !0,
|
|
2259
2259
|
state: {
|
|
2260
2260
|
sorting: n
|
|
2261
2261
|
}
|
|
2262
2262
|
});
|
|
2263
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2264
|
-
/* @__PURE__ */ e.jsx(
|
|
2263
|
+
return /* @__PURE__ */ e.jsxs(ra, { children: [
|
|
2264
|
+
/* @__PURE__ */ e.jsx(la, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e.jsx(ts, { children: d.headers.map((c) => /* @__PURE__ */ e.jsx(ia, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Ts(
|
|
2265
2265
|
c.column.columnDef.header,
|
|
2266
2266
|
c.getContext()
|
|
2267
2267
|
) }, c.id)) }, d.id)) }),
|
|
2268
|
-
/* @__PURE__ */ e.jsx(
|
|
2268
|
+
/* @__PURE__ */ e.jsx(oa, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e.jsx(
|
|
2269
2269
|
ts,
|
|
2270
2270
|
{
|
|
2271
2271
|
className: "whitespace-nowrap py-2",
|
|
@@ -2273,7 +2273,7 @@ function An({ data: s }) {
|
|
|
2273
2273
|
children: d.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(As, { children: Ts(c.column.columnDef.cell, c.getContext()) }, c.id))
|
|
2274
2274
|
},
|
|
2275
2275
|
d.id
|
|
2276
|
-
)) : /* @__PURE__ */ e.jsx(ts, { children: /* @__PURE__ */ e.jsx(As, { colSpan:
|
|
2276
|
+
)) : /* @__PURE__ */ e.jsx(ts, { children: /* @__PURE__ */ e.jsx(As, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2277
2277
|
] });
|
|
2278
2278
|
}
|
|
2279
2279
|
function pt({
|
|
@@ -2281,9 +2281,9 @@ function pt({
|
|
|
2281
2281
|
className: s,
|
|
2282
2282
|
...n
|
|
2283
2283
|
}) {
|
|
2284
|
-
|
|
2285
|
-
const t = S((r) => r.themeStyle), a =
|
|
2286
|
-
if (
|
|
2284
|
+
de.useState(0);
|
|
2285
|
+
const t = S((r) => r.themeStyle), a = l((r) => r.card), i = l((r) => r.actions.setCard);
|
|
2286
|
+
if (B(() => {
|
|
2287
2287
|
}, [
|
|
2288
2288
|
a.data,
|
|
2289
2289
|
a.type,
|
|
@@ -2301,19 +2301,19 @@ function pt({
|
|
|
2301
2301
|
customCfg: a.customCfg,
|
|
2302
2302
|
preferences: a.preferences
|
|
2303
2303
|
})), /* @__PURE__ */ e.jsxs(
|
|
2304
|
-
|
|
2304
|
+
ua,
|
|
2305
2305
|
{
|
|
2306
2306
|
role: "editor-visual-card",
|
|
2307
2307
|
className: W("relative flex h-full flex-col rounded-none", s),
|
|
2308
2308
|
...n,
|
|
2309
2309
|
children: [
|
|
2310
|
-
/* @__PURE__ */ e.jsxs(
|
|
2310
|
+
/* @__PURE__ */ e.jsxs(ma, { className: "py-4", children: [
|
|
2311
2311
|
/* @__PURE__ */ e.jsx(
|
|
2312
2312
|
Es,
|
|
2313
2313
|
{
|
|
2314
2314
|
text: a.title,
|
|
2315
|
-
onSave: (r) =>
|
|
2316
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2315
|
+
onSave: (r) => i({ ...a, title: r }),
|
|
2316
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(xa, { className: "text-base", children: a.title }) })
|
|
2317
2317
|
},
|
|
2318
2318
|
a.title
|
|
2319
2319
|
),
|
|
@@ -2321,8 +2321,8 @@ function pt({
|
|
|
2321
2321
|
Es,
|
|
2322
2322
|
{
|
|
2323
2323
|
text: a.description || "",
|
|
2324
|
-
onSave: (r) =>
|
|
2325
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2324
|
+
onSave: (r) => i({ ...a, description: r }),
|
|
2325
|
+
children: /* @__PURE__ */ e.jsxs(pa, { children: [
|
|
2326
2326
|
" ",
|
|
2327
2327
|
a.description
|
|
2328
2328
|
] })
|
|
@@ -2330,43 +2330,43 @@ function pt({
|
|
|
2330
2330
|
a.description
|
|
2331
2331
|
)
|
|
2332
2332
|
] }),
|
|
2333
|
-
/* @__PURE__ */ e.jsxs(
|
|
2333
|
+
/* @__PURE__ */ e.jsxs(fa, { className: "flex grow flex-col pb-3", children: [
|
|
2334
2334
|
a.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2335
2335
|
/* @__PURE__ */ e.jsx(
|
|
2336
|
-
|
|
2336
|
+
ga,
|
|
2337
2337
|
{
|
|
2338
2338
|
cfg: o
|
|
2339
2339
|
},
|
|
2340
2340
|
JSON.stringify(o) + JSON.stringify(a.preferences)
|
|
2341
2341
|
),
|
|
2342
2342
|
a.type === "table" && a.data && a.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2343
|
-
/* @__PURE__ */ e.jsx(
|
|
2343
|
+
/* @__PURE__ */ e.jsx(ja, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(ba, { card: a, data: a == null ? void 0 : a.data }) })
|
|
2344
2344
|
] })
|
|
2345
2345
|
]
|
|
2346
2346
|
}
|
|
2347
2347
|
);
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2350
|
-
const [s, n] =
|
|
2349
|
+
function Ln() {
|
|
2350
|
+
const [s, n] = O(!1), [t, a] = O(""), [i, o] = O(""), [r, d] = O(""), c = l((v) => v.card), m = l(
|
|
2351
2351
|
(v) => v.card.customCfg
|
|
2352
|
-
), h =
|
|
2352
|
+
), h = l(
|
|
2353
2353
|
(v) => v.actions.setCardCustomCfg
|
|
2354
2354
|
);
|
|
2355
2355
|
function u(v) {
|
|
2356
|
-
var
|
|
2356
|
+
var T, g;
|
|
2357
2357
|
const y = {
|
|
2358
2358
|
...v,
|
|
2359
2359
|
data: {
|
|
2360
2360
|
...v == null ? void 0 : v.data,
|
|
2361
|
-
datasets: (
|
|
2362
|
-
...
|
|
2361
|
+
datasets: (g = (T = v == null ? void 0 : v.data) == null ? void 0 : T.datasets) == null ? void 0 : g.map((F) => ({
|
|
2362
|
+
...F,
|
|
2363
2363
|
data: []
|
|
2364
2364
|
}))
|
|
2365
2365
|
}
|
|
2366
2366
|
};
|
|
2367
2367
|
return JSON.stringify(y, null, 1);
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function j() {
|
|
2370
2370
|
if (!c.data || c.data.length === 0)
|
|
2371
2371
|
return;
|
|
2372
2372
|
const v = st({
|
|
@@ -2377,35 +2377,35 @@ function En() {
|
|
|
2377
2377
|
});
|
|
2378
2378
|
v && (a(JSON.stringify(v, null, 1)), m && o(JSON.stringify(m, null, 1)));
|
|
2379
2379
|
}
|
|
2380
|
-
function
|
|
2381
|
-
if (
|
|
2380
|
+
function f() {
|
|
2381
|
+
if (i)
|
|
2382
2382
|
try {
|
|
2383
|
-
const v = JSON.parse(
|
|
2383
|
+
const v = JSON.parse(i);
|
|
2384
2384
|
return v ? (h(v), d(""), o(""), v) : void 0;
|
|
2385
2385
|
} catch (v) {
|
|
2386
2386
|
console.log(v), d("Invalid JSON");
|
|
2387
2387
|
}
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2389
|
+
function b() {
|
|
2390
2390
|
o(""), h(null);
|
|
2391
2391
|
}
|
|
2392
2392
|
function C() {
|
|
2393
2393
|
let v;
|
|
2394
2394
|
if (m) {
|
|
2395
|
-
const y = Is.cloneDeep(c.cfg),
|
|
2396
|
-
return v = u(
|
|
2395
|
+
const y = Is.cloneDeep(c.cfg), E = Is.merge(y, m);
|
|
2396
|
+
return v = u(E), v;
|
|
2397
2397
|
}
|
|
2398
2398
|
return t ? (v = u(JSON.parse(t)), v) : "";
|
|
2399
2399
|
}
|
|
2400
2400
|
return /* @__PURE__ */ e.jsxs(is, { open: s, onOpenChange: n, children: [
|
|
2401
2401
|
/* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2402
|
-
|
|
2402
|
+
w,
|
|
2403
2403
|
{
|
|
2404
|
-
onClick:
|
|
2404
|
+
onClick: j,
|
|
2405
2405
|
className: ` ${m && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2406
2406
|
size: "sm",
|
|
2407
2407
|
variant: "outline",
|
|
2408
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2408
|
+
children: /* @__PURE__ */ e.jsx(ya, { className: "h-4 w-4" })
|
|
2409
2409
|
}
|
|
2410
2410
|
) }),
|
|
2411
2411
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2418,7 +2418,7 @@ function En() {
|
|
|
2418
2418
|
/* @__PURE__ */ e.jsx(hs, { children: "Customize Card" }),
|
|
2419
2419
|
/* @__PURE__ */ e.jsxs(We, { children: [
|
|
2420
2420
|
/* @__PURE__ */ e.jsx(ms, { children: /* @__PURE__ */ e.jsx(
|
|
2421
|
-
|
|
2421
|
+
Ya,
|
|
2422
2422
|
{
|
|
2423
2423
|
onClick: () => {
|
|
2424
2424
|
navigator.clipboard.writeText(c.id);
|
|
@@ -2444,10 +2444,10 @@ function En() {
|
|
|
2444
2444
|
] }),
|
|
2445
2445
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2446
2446
|
/* @__PURE__ */ e.jsx(pt, { className: "w-1/2 rounded shadow-none" }),
|
|
2447
|
-
/* @__PURE__ */ e.jsxs(
|
|
2448
|
-
/* @__PURE__ */ e.jsxs(
|
|
2447
|
+
/* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2448
|
+
/* @__PURE__ */ e.jsxs(Na, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2449
2449
|
/* @__PURE__ */ e.jsxs(Ls, { value: "custom-config", children: [
|
|
2450
|
-
m && /* @__PURE__ */ e.jsx(
|
|
2450
|
+
m && /* @__PURE__ */ e.jsx(Ca, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2451
2451
|
m ? "Custom Config" : "Default Config"
|
|
2452
2452
|
] }),
|
|
2453
2453
|
/* @__PURE__ */ e.jsx(Ls, { className: "", value: "output", children: "Output" })
|
|
@@ -2501,16 +2501,16 @@ function En() {
|
|
|
2501
2501
|
/* @__PURE__ */ e.jsxs(Bs, { className: "flex items-center", children: [
|
|
2502
2502
|
/* @__PURE__ */ e.jsx(_, { className: "mr-2 text-red-500", children: r }),
|
|
2503
2503
|
/* @__PURE__ */ e.jsx(
|
|
2504
|
-
|
|
2504
|
+
w,
|
|
2505
2505
|
{
|
|
2506
2506
|
disabled: !m,
|
|
2507
|
-
onClick:
|
|
2507
|
+
onClick: b,
|
|
2508
2508
|
variant: "outline",
|
|
2509
2509
|
children: "Reset"
|
|
2510
2510
|
}
|
|
2511
2511
|
),
|
|
2512
|
-
/* @__PURE__ */ e.jsx(
|
|
2513
|
-
/* @__PURE__ */ e.jsx(
|
|
2512
|
+
/* @__PURE__ */ e.jsx(w, { onClick: f, variant: "outline", children: "Apply" }),
|
|
2513
|
+
/* @__PURE__ */ e.jsx(w, { onClick: () => n(!1), variant: "outline", children: "Close" })
|
|
2514
2514
|
] })
|
|
2515
2515
|
]
|
|
2516
2516
|
}
|
|
@@ -2518,37 +2518,37 @@ function En() {
|
|
|
2518
2518
|
] });
|
|
2519
2519
|
}
|
|
2520
2520
|
function ft(s) {
|
|
2521
|
-
return
|
|
2521
|
+
return Se({ 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);
|
|
2522
2522
|
}
|
|
2523
2523
|
function gt(s) {
|
|
2524
|
-
return
|
|
2524
|
+
return Se({ 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);
|
|
2525
2525
|
}
|
|
2526
2526
|
function jt(s) {
|
|
2527
|
-
return
|
|
2527
|
+
return Se({ 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);
|
|
2528
2528
|
}
|
|
2529
2529
|
function bt(s) {
|
|
2530
|
-
return
|
|
2530
|
+
return Se({ 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);
|
|
2531
2531
|
}
|
|
2532
2532
|
function yt(s) {
|
|
2533
|
-
return
|
|
2533
|
+
return Se({ 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);
|
|
2534
2534
|
}
|
|
2535
2535
|
function vt(s) {
|
|
2536
|
-
return
|
|
2536
|
+
return Se({ 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);
|
|
2537
2537
|
}
|
|
2538
|
-
function
|
|
2539
|
-
const [s, n] =
|
|
2538
|
+
function Dn() {
|
|
2539
|
+
const [s, n] = O(!1), t = l((d) => d.card.type), { setCardType: a, setCardPreferences: i } = l(
|
|
2540
2540
|
(d) => d.actions
|
|
2541
|
-
), o =
|
|
2541
|
+
), o = l(
|
|
2542
2542
|
(d) => d.actions.setCardCustomCfg
|
|
2543
2543
|
);
|
|
2544
2544
|
function r(d) {
|
|
2545
|
-
a(d), o(null),
|
|
2545
|
+
a(d), o(null), i({}), n(!1);
|
|
2546
2546
|
}
|
|
2547
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2548
|
-
/* @__PURE__ */ e.jsx(
|
|
2549
|
-
/* @__PURE__ */ e.jsx(
|
|
2547
|
+
return /* @__PURE__ */ e.jsxs(qe, { open: s, onOpenChange: n, children: [
|
|
2548
|
+
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(In, { className: "h-4 w-4", chartType: t }) }) }),
|
|
2549
|
+
/* @__PURE__ */ e.jsx(Re, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2550
2550
|
/* @__PURE__ */ e.jsx(
|
|
2551
|
-
|
|
2551
|
+
w,
|
|
2552
2552
|
{
|
|
2553
2553
|
onClick: () => r("bar"),
|
|
2554
2554
|
className: "font-normal",
|
|
@@ -2557,7 +2557,7 @@ function Ln() {
|
|
|
2557
2557
|
}
|
|
2558
2558
|
),
|
|
2559
2559
|
/* @__PURE__ */ e.jsx(
|
|
2560
|
-
|
|
2560
|
+
w,
|
|
2561
2561
|
{
|
|
2562
2562
|
onClick: () => r("line"),
|
|
2563
2563
|
variant: "ghost",
|
|
@@ -2565,7 +2565,7 @@ function Ln() {
|
|
|
2565
2565
|
}
|
|
2566
2566
|
),
|
|
2567
2567
|
/* @__PURE__ */ e.jsx(
|
|
2568
|
-
|
|
2568
|
+
w,
|
|
2569
2569
|
{
|
|
2570
2570
|
onClick: () => r("stackedBar"),
|
|
2571
2571
|
variant: "ghost",
|
|
@@ -2573,7 +2573,7 @@ function Ln() {
|
|
|
2573
2573
|
}
|
|
2574
2574
|
),
|
|
2575
2575
|
/* @__PURE__ */ e.jsx(
|
|
2576
|
-
|
|
2576
|
+
w,
|
|
2577
2577
|
{
|
|
2578
2578
|
onClick: () => r("scatter"),
|
|
2579
2579
|
variant: "ghost",
|
|
@@ -2581,7 +2581,7 @@ function Ln() {
|
|
|
2581
2581
|
}
|
|
2582
2582
|
),
|
|
2583
2583
|
/* @__PURE__ */ e.jsx(
|
|
2584
|
-
|
|
2584
|
+
w,
|
|
2585
2585
|
{
|
|
2586
2586
|
onClick: () => r("bubble"),
|
|
2587
2587
|
variant: "ghost",
|
|
@@ -2589,7 +2589,7 @@ function Ln() {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
),
|
|
2591
2591
|
/* @__PURE__ */ e.jsx(
|
|
2592
|
-
|
|
2592
|
+
w,
|
|
2593
2593
|
{
|
|
2594
2594
|
onClick: () => r("pie"),
|
|
2595
2595
|
variant: "ghost",
|
|
@@ -2597,7 +2597,7 @@ function Ln() {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
),
|
|
2599
2599
|
/* @__PURE__ */ e.jsx(
|
|
2600
|
-
|
|
2600
|
+
w,
|
|
2601
2601
|
{
|
|
2602
2602
|
onClick: () => r("doughnut"),
|
|
2603
2603
|
variant: "ghost",
|
|
@@ -2605,7 +2605,7 @@ function Ln() {
|
|
|
2605
2605
|
}
|
|
2606
2606
|
),
|
|
2607
2607
|
/* @__PURE__ */ e.jsx(
|
|
2608
|
-
|
|
2608
|
+
w,
|
|
2609
2609
|
{
|
|
2610
2610
|
onClick: () => r("radar"),
|
|
2611
2611
|
variant: "ghost",
|
|
@@ -2619,7 +2619,7 @@ function Ln() {
|
|
|
2619
2619
|
}
|
|
2620
2620
|
),
|
|
2621
2621
|
/* @__PURE__ */ e.jsx(
|
|
2622
|
-
|
|
2622
|
+
w,
|
|
2623
2623
|
{
|
|
2624
2624
|
onClick: () => r("polarArea"),
|
|
2625
2625
|
variant: "ghost",
|
|
@@ -2627,7 +2627,7 @@ function Ln() {
|
|
|
2627
2627
|
}
|
|
2628
2628
|
),
|
|
2629
2629
|
/* @__PURE__ */ e.jsx(
|
|
2630
|
-
|
|
2630
|
+
w,
|
|
2631
2631
|
{
|
|
2632
2632
|
onClick: () => r("table"),
|
|
2633
2633
|
variant: "ghost",
|
|
@@ -2635,7 +2635,7 @@ function Ln() {
|
|
|
2635
2635
|
}
|
|
2636
2636
|
),
|
|
2637
2637
|
/* @__PURE__ */ e.jsx(
|
|
2638
|
-
|
|
2638
|
+
w,
|
|
2639
2639
|
{
|
|
2640
2640
|
onClick: () => r("kpi"),
|
|
2641
2641
|
variant: "ghost",
|
|
@@ -2645,7 +2645,7 @@ function Ln() {
|
|
|
2645
2645
|
] }) })
|
|
2646
2646
|
] });
|
|
2647
2647
|
}
|
|
2648
|
-
function
|
|
2648
|
+
function In({ chartType: s, className: n }) {
|
|
2649
2649
|
switch (s) {
|
|
2650
2650
|
case "bar":
|
|
2651
2651
|
return /* @__PURE__ */ e.jsx(vs, { className: n });
|
|
@@ -2671,15 +2671,15 @@ function Dn({ chartType: s, className: n }) {
|
|
|
2671
2671
|
return /* @__PURE__ */ e.jsx(Cs, { className: n });
|
|
2672
2672
|
}
|
|
2673
2673
|
}
|
|
2674
|
-
function
|
|
2675
|
-
const s =
|
|
2674
|
+
function qn() {
|
|
2675
|
+
const s = l(
|
|
2676
2676
|
(t) => t.card.refreshInterval
|
|
2677
|
-
), n =
|
|
2677
|
+
), n = l(
|
|
2678
2678
|
(t) => t.actions.setCardRefreshInterval
|
|
2679
2679
|
);
|
|
2680
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2681
|
-
/* @__PURE__ */ e.jsx(
|
|
2682
|
-
/* @__PURE__ */ e.jsx(
|
|
2680
|
+
return /* @__PURE__ */ e.jsxs(qe, { children: [
|
|
2681
|
+
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ha, { className: "w-4 h-4" }) }) }),
|
|
2682
|
+
/* @__PURE__ */ e.jsx(Re, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
|
|
2683
2683
|
/* @__PURE__ */ e.jsx(_, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
|
|
2684
2684
|
/* @__PURE__ */ e.jsx(
|
|
2685
2685
|
Q,
|
|
@@ -2695,27 +2695,27 @@ function In() {
|
|
|
2695
2695
|
] });
|
|
2696
2696
|
}
|
|
2697
2697
|
function _s() {
|
|
2698
|
-
|
|
2699
|
-
const s =
|
|
2700
|
-
return
|
|
2701
|
-
a && /* @__PURE__ */ e.jsx(
|
|
2698
|
+
l((r) => r.frame);
|
|
2699
|
+
const s = l((r) => r.card), n = l((r) => r.card.data), t = l((r) => r.isShowingVisual), a = l((r) => r.isSqlRunning), i = l((r) => r.queryError), o = l((r) => r.pythonStdOut);
|
|
2700
|
+
return l((r) => r.onSave), l((r) => r.onClose), l((r) => r.actions.setCardSql), l((r) => r.actions.setCardType), l((r) => r.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
|
|
2701
|
+
a && /* @__PURE__ */ e.jsx(De, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
2702
2702
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
2703
2703
|
t && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2704
|
+
/* @__PURE__ */ e.jsx(Dn, {}),
|
|
2704
2705
|
/* @__PURE__ */ e.jsx(Ln, {}),
|
|
2705
|
-
/* @__PURE__ */ e.jsx(
|
|
2706
|
-
/* @__PURE__ */ e.jsx(In, {})
|
|
2706
|
+
/* @__PURE__ */ e.jsx(qn, {})
|
|
2707
2707
|
] }),
|
|
2708
|
-
/* @__PURE__ */ e.jsx(
|
|
2708
|
+
/* @__PURE__ */ e.jsx(Rn, {})
|
|
2709
2709
|
] }),
|
|
2710
|
-
t ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(
|
|
2711
|
-
o && /* @__PURE__ */ e.jsx(
|
|
2712
|
-
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(
|
|
2713
|
-
|
|
2710
|
+
t ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Sa, { isLoading: a, card: s }) }) }) : /* @__PURE__ */ e.jsx(pt, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
2711
|
+
o && /* @__PURE__ */ e.jsx(Vn, {}),
|
|
2712
|
+
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(En, { data: n || [] }),
|
|
2713
|
+
i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
|
|
2714
2714
|
] })
|
|
2715
2715
|
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2716
2716
|
}
|
|
2717
|
-
function
|
|
2718
|
-
const s =
|
|
2717
|
+
function Vn() {
|
|
2718
|
+
const s = l((t) => t.pythonStdOut);
|
|
2719
2719
|
if (!s)
|
|
2720
2720
|
return null;
|
|
2721
2721
|
const n = s.replace(/\n/g, "<br>");
|
|
@@ -2731,14 +2731,14 @@ function qn() {
|
|
|
2731
2731
|
/* @__PURE__ */ e.jsx(tt, { className: "mb-2" })
|
|
2732
2732
|
] });
|
|
2733
2733
|
}
|
|
2734
|
-
function
|
|
2735
|
-
const s =
|
|
2734
|
+
function Rn() {
|
|
2735
|
+
const s = l((t) => t.isShowingVisual), n = l(
|
|
2736
2736
|
(t) => t.actions.setIsShowingVisual
|
|
2737
2737
|
);
|
|
2738
2738
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2739
2739
|
/* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
|
|
2740
2740
|
/* @__PURE__ */ e.jsx(
|
|
2741
|
-
|
|
2741
|
+
ka,
|
|
2742
2742
|
{
|
|
2743
2743
|
checked: s,
|
|
2744
2744
|
onCheckedChange: () => n(!s),
|
|
@@ -2748,25 +2748,25 @@ function Vn() {
|
|
|
2748
2748
|
)
|
|
2749
2749
|
] });
|
|
2750
2750
|
}
|
|
2751
|
-
function
|
|
2752
|
-
const [s, n] =
|
|
2753
|
-
|
|
2751
|
+
function Me() {
|
|
2752
|
+
const [s, n] = O([]);
|
|
2753
|
+
l(
|
|
2754
2754
|
(h) => h.card.cfg
|
|
2755
2755
|
);
|
|
2756
|
-
const t =
|
|
2756
|
+
const t = l((h) => h.card.preferences), { setCardCfg: a, setFilterOnClickColumnIndex: i, setCardPreferences: o } = l((h) => h.actions), r = l(
|
|
2757
2757
|
(h) => h.queryResultColumns
|
|
2758
2758
|
);
|
|
2759
|
-
|
|
2759
|
+
l(
|
|
2760
2760
|
(h) => {
|
|
2761
2761
|
var u;
|
|
2762
2762
|
return (u = h.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
|
|
2763
2763
|
}
|
|
2764
|
-
),
|
|
2764
|
+
), B(() => {
|
|
2765
2765
|
r && n(new Array(r.length).fill(!1));
|
|
2766
2766
|
}, [r]);
|
|
2767
2767
|
function d(h, u) {
|
|
2768
|
-
var
|
|
2769
|
-
u ? t != null && t.onClickFilter && ((
|
|
2768
|
+
var j, f;
|
|
2769
|
+
u ? t != null && t.onClickFilter && ((j = t == null ? void 0 : t.onClickFilter) == null ? void 0 : j.length) > 0 ? o({
|
|
2770
2770
|
...t,
|
|
2771
2771
|
onClickFilter: [
|
|
2772
2772
|
...t.onClickFilter,
|
|
@@ -2785,32 +2785,32 @@ function ze() {
|
|
|
2785
2785
|
]
|
|
2786
2786
|
}) : (o({
|
|
2787
2787
|
...t,
|
|
2788
|
-
onClickFilter: (
|
|
2789
|
-
(
|
|
2788
|
+
onClickFilter: (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.filter(
|
|
2789
|
+
(b) => b.columnIndex !== h
|
|
2790
2790
|
)
|
|
2791
|
-
}), n((
|
|
2792
|
-
const C = [...
|
|
2791
|
+
}), n((b) => {
|
|
2792
|
+
const C = [...b];
|
|
2793
2793
|
return C[h] = !1, C;
|
|
2794
2794
|
}));
|
|
2795
2795
|
}
|
|
2796
2796
|
function c(h, u) {
|
|
2797
|
-
var
|
|
2798
|
-
const
|
|
2799
|
-
...
|
|
2797
|
+
var f;
|
|
2798
|
+
const j = (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.map((b) => b.columnIndex === h ? {
|
|
2799
|
+
...b,
|
|
2800
2800
|
expression: u.target.value
|
|
2801
|
-
} :
|
|
2801
|
+
} : b);
|
|
2802
2802
|
o({
|
|
2803
2803
|
...t,
|
|
2804
|
-
onClickFilter:
|
|
2804
|
+
onClickFilter: j
|
|
2805
2805
|
});
|
|
2806
2806
|
}
|
|
2807
2807
|
function m(h) {
|
|
2808
|
-
var u,
|
|
2809
|
-
if (s != null && s[h] || (
|
|
2808
|
+
var u, j, f, b;
|
|
2809
|
+
if (s != null && s[h] || (j = (u = t == null ? void 0 : t.onClickFilter) == null ? void 0 : u.find((C) => C.columnIndex === h)) != null && j.expression)
|
|
2810
2810
|
return /* @__PURE__ */ e.jsx(
|
|
2811
2811
|
Q,
|
|
2812
2812
|
{
|
|
2813
|
-
value: (
|
|
2813
|
+
value: (b = (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.find((C) => C.columnIndex === h)) == null ? void 0 : b.expression,
|
|
2814
2814
|
onChange: (C) => c(h, C),
|
|
2815
2815
|
type: "text",
|
|
2816
2816
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
@@ -2819,7 +2819,7 @@ function ze() {
|
|
|
2819
2819
|
);
|
|
2820
2820
|
}
|
|
2821
2821
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((h, u) => {
|
|
2822
|
-
var
|
|
2822
|
+
var j, f;
|
|
2823
2823
|
return /* @__PURE__ */ e.jsx(
|
|
2824
2824
|
"div",
|
|
2825
2825
|
{
|
|
@@ -2829,10 +2829,10 @@ function ze() {
|
|
|
2829
2829
|
/* @__PURE__ */ e.jsx(
|
|
2830
2830
|
Qe,
|
|
2831
2831
|
{
|
|
2832
|
-
checked: !!((
|
|
2833
|
-
(
|
|
2832
|
+
checked: !!((j = t == null ? void 0 : t.onClickFilter) != null && j.find(
|
|
2833
|
+
(b) => b.columnIndex === u
|
|
2834
2834
|
)),
|
|
2835
|
-
onCheckedChange: (
|
|
2835
|
+
onCheckedChange: (b) => d(u, b)
|
|
2836
2836
|
}
|
|
2837
2837
|
),
|
|
2838
2838
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2842,15 +2842,15 @@ function ze() {
|
|
|
2842
2842
|
children: h
|
|
2843
2843
|
}
|
|
2844
2844
|
),
|
|
2845
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((
|
|
2846
|
-
(
|
|
2845
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.find(
|
|
2846
|
+
(b) => b.columnIndex === u
|
|
2847
2847
|
)) && /* @__PURE__ */ e.jsx(
|
|
2848
2848
|
lt,
|
|
2849
2849
|
{
|
|
2850
2850
|
onClick: () => {
|
|
2851
|
-
n((
|
|
2852
|
-
const C = [...
|
|
2853
|
-
return C[u] = !
|
|
2851
|
+
n((b) => {
|
|
2852
|
+
const C = [...b];
|
|
2853
|
+
return C[u] = !b[u], C;
|
|
2854
2854
|
});
|
|
2855
2855
|
},
|
|
2856
2856
|
className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
|
|
@@ -2866,18 +2866,18 @@ function ze() {
|
|
|
2866
2866
|
}
|
|
2867
2867
|
function Ss() {
|
|
2868
2868
|
var o, r;
|
|
2869
|
-
const s =
|
|
2869
|
+
const s = l((d) => d.card.preferences), n = l(
|
|
2870
2870
|
(d) => d.card.cfg
|
|
2871
|
-
), { setCardCfg: t, setCardPreferences: a } =
|
|
2871
|
+
), { setCardCfg: t, setCardPreferences: a } = l(
|
|
2872
2872
|
(d) => d.actions
|
|
2873
2873
|
);
|
|
2874
2874
|
(o = n == null ? void 0 : n.options) != null && o.indexAxis;
|
|
2875
|
-
function
|
|
2876
|
-
var h, u,
|
|
2875
|
+
function i(d) {
|
|
2876
|
+
var h, u, j, f, b, C;
|
|
2877
2877
|
let c = {};
|
|
2878
2878
|
(h = s == null ? void 0 : s.chartOptions) != null && h.scales && (c = {
|
|
2879
|
-
x: (
|
|
2880
|
-
y: (
|
|
2879
|
+
x: (j = (u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.scales) == null ? void 0 : j.y,
|
|
2880
|
+
y: (b = (f = s == null ? void 0 : s.chartOptions) == null ? void 0 : f.scales) == null ? void 0 : b.x
|
|
2881
2881
|
});
|
|
2882
2882
|
const m = {
|
|
2883
2883
|
...s,
|
|
@@ -2896,7 +2896,7 @@ function Ss() {
|
|
|
2896
2896
|
at,
|
|
2897
2897
|
{
|
|
2898
2898
|
value: ((r = s == null ? void 0 : s.chartOptions) == null ? void 0 : r.indexAxis) || "x",
|
|
2899
|
-
onValueChange:
|
|
2899
|
+
onValueChange: i,
|
|
2900
2900
|
className: "flex gap-3",
|
|
2901
2901
|
defaultValue: "x",
|
|
2902
2902
|
children: [
|
|
@@ -2912,36 +2912,39 @@ function Ss() {
|
|
|
2912
2912
|
}
|
|
2913
2913
|
);
|
|
2914
2914
|
}
|
|
2915
|
-
const
|
|
2915
|
+
const ve = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
2916
2916
|
function Hs(s) {
|
|
2917
|
-
var t, a,
|
|
2917
|
+
var t, a, i;
|
|
2918
2918
|
const n = nt(s);
|
|
2919
|
-
return ((
|
|
2919
|
+
return ((i = (a = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : a[n]) == null ? void 0 : i.type) || "linear";
|
|
2920
2920
|
}
|
|
2921
|
-
function
|
|
2922
|
-
var
|
|
2923
|
-
const [s, n] =
|
|
2924
|
-
var
|
|
2925
|
-
return (
|
|
2926
|
-
}), a = nt(t), [
|
|
2921
|
+
function Nt() {
|
|
2922
|
+
var ee, P, se, Z, G, L;
|
|
2923
|
+
const [s, n] = O(!1), t = l((x) => {
|
|
2924
|
+
var k;
|
|
2925
|
+
return (k = x.card) == null ? void 0 : k.preferences;
|
|
2926
|
+
}), a = nt(t), [i, o] = O(
|
|
2927
2927
|
Hs(t)
|
|
2928
|
-
), [r, d] =
|
|
2929
|
-
((
|
|
2930
|
-
), [c, m] =
|
|
2931
|
-
((
|
|
2932
|
-
), [h, u] =
|
|
2933
|
-
(
|
|
2934
|
-
)
|
|
2935
|
-
|
|
2936
|
-
|
|
2928
|
+
), [r, d] = O(
|
|
2929
|
+
((se = (P = (ee = t == null ? void 0 : t.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : P[a]) == null ? void 0 : se.min) || ""
|
|
2930
|
+
), [c, m] = O(
|
|
2931
|
+
((L = (G = (Z = t == null ? void 0 : t.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : G[a]) == null ? void 0 : L.max) || ""
|
|
2932
|
+
), [h, u] = O(r || c ? "custom" : "auto"), [j, f] = O(""), [b, C] = O(""), [v, y] = O(""), [E, T] = O(""), [g, F] = O(""), M = l(
|
|
2933
|
+
(x) => x.actions.setCardPreferences
|
|
2934
|
+
), A = l((x) => {
|
|
2935
|
+
var k;
|
|
2936
|
+
return (k = x.card) == null ? void 0 : k.type;
|
|
2937
|
+
}), $ = ["pie", "doughnut", "polarArea"].includes(A);
|
|
2938
|
+
B(() => {
|
|
2939
|
+
var x, k, R, H, he, te, pe, fe, ge, ue, J, ae, ne, je;
|
|
2937
2940
|
o(Hs(t)), d(
|
|
2938
|
-
((
|
|
2939
|
-
), m(((
|
|
2940
|
-
((
|
|
2941
|
-
), C(((
|
|
2941
|
+
((R = (k = (x = t == null ? void 0 : t.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : k[a]) == null ? void 0 : R.min) === 0 ? 0 : ""
|
|
2942
|
+
), m(((te = (he = (H = t == null ? void 0 : t.chartOptions) == null ? void 0 : H.scales) == null ? void 0 : he[a]) == null ? void 0 : te.max) || ""), f(
|
|
2943
|
+
((ue = (ge = (fe = (pe = t == null ? void 0 : t.chartOptions) == null ? void 0 : pe.scales) == null ? void 0 : fe[a]) == null ? void 0 : ge.ticks) == null ? void 0 : ue.stepSize) || ""
|
|
2944
|
+
), C(((J = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : J.format) || ""), y(((ae = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), T(((ne = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ne.currency) || ""), F(((je = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : je.locale) || "");
|
|
2942
2945
|
}, [s, t, a]);
|
|
2943
|
-
function
|
|
2944
|
-
return
|
|
2946
|
+
function X(x, k) {
|
|
2947
|
+
return k === "" || /^[0-9\b]+$/.test(k) ? Number(k) : Number(x);
|
|
2945
2948
|
}
|
|
2946
2949
|
function U() {
|
|
2947
2950
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -2950,11 +2953,11 @@ function Rn() {
|
|
|
2950
2953
|
/* @__PURE__ */ e.jsx(
|
|
2951
2954
|
Q,
|
|
2952
2955
|
{
|
|
2953
|
-
value:
|
|
2956
|
+
value: b,
|
|
2954
2957
|
placeholder: "000,0.00",
|
|
2955
|
-
onChange: (
|
|
2958
|
+
onChange: (x) => C(x.target.value),
|
|
2956
2959
|
id: "format",
|
|
2957
|
-
className: `col-span-4 h-8 w-full tracking-wide ${
|
|
2960
|
+
className: `col-span-4 h-8 w-full tracking-wide ${ve}`
|
|
2958
2961
|
}
|
|
2959
2962
|
),
|
|
2960
2963
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2962,9 +2965,9 @@ function Rn() {
|
|
|
2962
2965
|
{
|
|
2963
2966
|
value: v,
|
|
2964
2967
|
placeholder: "M",
|
|
2965
|
-
onChange: (
|
|
2968
|
+
onChange: (x) => y(x.target.value),
|
|
2966
2969
|
id: "unit",
|
|
2967
|
-
className: `col-span-2 h-8 w-full ${
|
|
2970
|
+
className: `col-span-2 h-8 w-full ${ve}`
|
|
2968
2971
|
}
|
|
2969
2972
|
)
|
|
2970
2973
|
] }),
|
|
@@ -2987,27 +2990,27 @@ function Rn() {
|
|
|
2987
2990
|
/* @__PURE__ */ e.jsx(
|
|
2988
2991
|
Q,
|
|
2989
2992
|
{
|
|
2990
|
-
value:
|
|
2993
|
+
value: E,
|
|
2991
2994
|
placeholder: "USD",
|
|
2992
|
-
onChange: (
|
|
2995
|
+
onChange: (x) => T(x.target.value),
|
|
2993
2996
|
id: "currency",
|
|
2994
|
-
className: `col-span-2 h-8 w-full ${
|
|
2997
|
+
className: `col-span-2 h-8 w-full ${ve}`
|
|
2995
2998
|
}
|
|
2996
2999
|
),
|
|
2997
3000
|
/* @__PURE__ */ e.jsx(
|
|
2998
3001
|
Q,
|
|
2999
3002
|
{
|
|
3000
|
-
value:
|
|
3003
|
+
value: g,
|
|
3001
3004
|
placeholder: "en-US",
|
|
3002
|
-
onChange: (
|
|
3005
|
+
onChange: (x) => F(x.target.value),
|
|
3003
3006
|
id: "locale",
|
|
3004
|
-
className: `col-span-2 h-8 w-full ${
|
|
3007
|
+
className: `col-span-2 h-8 w-full ${ve}`
|
|
3005
3008
|
}
|
|
3006
3009
|
)
|
|
3007
3010
|
] })
|
|
3008
3011
|
] });
|
|
3009
3012
|
}
|
|
3010
|
-
function
|
|
3013
|
+
function K() {
|
|
3011
3014
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3012
3015
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3013
3016
|
/* @__PURE__ */ e.jsx(_, { htmlFor: "range", children: "Range" }),
|
|
@@ -3016,17 +3019,17 @@ function Rn() {
|
|
|
3016
3019
|
{
|
|
3017
3020
|
id: "min",
|
|
3018
3021
|
value: r,
|
|
3019
|
-
onChange: (
|
|
3020
|
-
className: `col-span-1 h-8 w-full ${
|
|
3022
|
+
onChange: (x) => d((k) => X(k, x.target.value)),
|
|
3023
|
+
className: `col-span-1 h-8 w-full ${ve}`
|
|
3021
3024
|
}
|
|
3022
3025
|
),
|
|
3023
3026
|
/* @__PURE__ */ e.jsx(
|
|
3024
3027
|
Q,
|
|
3025
3028
|
{
|
|
3026
3029
|
value: c,
|
|
3027
|
-
onChange: (
|
|
3030
|
+
onChange: (x) => m((k) => X(k, x.target.value)),
|
|
3028
3031
|
id: "max",
|
|
3029
|
-
className: `col-span-1 h-8 w-full ${
|
|
3032
|
+
className: `col-span-1 h-8 w-full ${ve}`
|
|
3030
3033
|
}
|
|
3031
3034
|
)
|
|
3032
3035
|
] }),
|
|
@@ -3035,50 +3038,50 @@ function Rn() {
|
|
|
3035
3038
|
/* @__PURE__ */ e.jsx(
|
|
3036
3039
|
Q,
|
|
3037
3040
|
{
|
|
3038
|
-
value:
|
|
3039
|
-
onChange: (
|
|
3041
|
+
value: j,
|
|
3042
|
+
onChange: (x) => f((k) => X(k, x.target.value)),
|
|
3040
3043
|
id: "step-size",
|
|
3041
|
-
className: `col-span-1 h-8 w-full ${
|
|
3044
|
+
className: `col-span-1 h-8 w-full ${ve}`
|
|
3042
3045
|
}
|
|
3043
3046
|
)
|
|
3044
3047
|
] })
|
|
3045
3048
|
] });
|
|
3046
3049
|
}
|
|
3047
|
-
function
|
|
3048
|
-
var
|
|
3049
|
-
let
|
|
3050
|
-
h === "custom" && (
|
|
3050
|
+
function D() {
|
|
3051
|
+
var R;
|
|
3052
|
+
let x = {};
|
|
3053
|
+
h === "custom" && (x = {
|
|
3051
3054
|
min: r,
|
|
3052
3055
|
max: c,
|
|
3053
3056
|
ticks: {
|
|
3054
|
-
stepSize:
|
|
3057
|
+
stepSize: j
|
|
3055
3058
|
}
|
|
3056
3059
|
});
|
|
3057
|
-
const
|
|
3060
|
+
const k = {
|
|
3058
3061
|
...t || {},
|
|
3059
3062
|
chartOptions: {
|
|
3060
3063
|
...t == null ? void 0 : t.chartOptions,
|
|
3061
3064
|
scales: {
|
|
3062
|
-
...(
|
|
3065
|
+
...(R = t == null ? void 0 : t.chartOptions) == null ? void 0 : R.scales,
|
|
3063
3066
|
[a]: {
|
|
3064
3067
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3065
|
-
type:
|
|
3066
|
-
...
|
|
3068
|
+
type: i,
|
|
3069
|
+
...i === "linear" ? x : {}
|
|
3067
3070
|
}
|
|
3068
3071
|
}
|
|
3069
3072
|
},
|
|
3070
3073
|
numberAxisFormat: {
|
|
3071
|
-
format:
|
|
3074
|
+
format: b,
|
|
3072
3075
|
suffix: v,
|
|
3073
|
-
currency:
|
|
3074
|
-
locale:
|
|
3076
|
+
currency: E,
|
|
3077
|
+
locale: g
|
|
3075
3078
|
}
|
|
3076
3079
|
};
|
|
3077
|
-
|
|
3080
|
+
M(k);
|
|
3078
3081
|
}
|
|
3079
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3080
|
-
/* @__PURE__ */ e.jsx(
|
|
3081
|
-
/* @__PURE__ */ e.jsx(
|
|
3082
|
+
return /* @__PURE__ */ e.jsxs(qe, { onOpenChange: (x) => n(x), children: [
|
|
3083
|
+
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(wa, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3084
|
+
/* @__PURE__ */ e.jsx(Re, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3082
3085
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3083
3086
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3084
3087
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -3089,27 +3092,29 @@ function Rn() {
|
|
|
3089
3092
|
/* @__PURE__ */ e.jsxs(
|
|
3090
3093
|
xs,
|
|
3091
3094
|
{
|
|
3092
|
-
|
|
3093
|
-
|
|
3095
|
+
disabled: $,
|
|
3096
|
+
value: i,
|
|
3097
|
+
onValueChange: (x) => o(x),
|
|
3094
3098
|
children: [
|
|
3095
3099
|
/* @__PURE__ */ e.jsx(ps, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, {}) }),
|
|
3096
3100
|
/* @__PURE__ */ e.jsx(gs, { id: "type", children: /* @__PURE__ */ e.jsxs(js, { children: [
|
|
3097
3101
|
/* @__PURE__ */ e.jsx(Ke, { children: "Option" }),
|
|
3098
|
-
/* @__PURE__ */ e.jsx(
|
|
3099
|
-
/* @__PURE__ */ e.jsx(
|
|
3102
|
+
/* @__PURE__ */ e.jsx(xe, { value: "linear", children: "Linear" }),
|
|
3103
|
+
/* @__PURE__ */ e.jsx(xe, { value: "logarithmic", children: "Logarithmic" })
|
|
3100
3104
|
] }) })
|
|
3101
3105
|
]
|
|
3102
3106
|
}
|
|
3103
3107
|
)
|
|
3104
3108
|
] }),
|
|
3105
|
-
|
|
3109
|
+
i == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3106
3110
|
/* @__PURE__ */ e.jsx(_, { htmlFor: "scale-option", children: "Setup" }),
|
|
3107
3111
|
/* @__PURE__ */ e.jsxs(
|
|
3108
3112
|
at,
|
|
3109
3113
|
{
|
|
3114
|
+
disabled: $,
|
|
3110
3115
|
id: "scale-option",
|
|
3111
3116
|
value: h,
|
|
3112
|
-
onValueChange: (
|
|
3117
|
+
onValueChange: (x) => u(x),
|
|
3113
3118
|
className: "col-span-2 flex gap-3",
|
|
3114
3119
|
defaultValue: "x",
|
|
3115
3120
|
children: [
|
|
@@ -3125,13 +3130,13 @@ function Rn() {
|
|
|
3125
3130
|
}
|
|
3126
3131
|
)
|
|
3127
3132
|
] }),
|
|
3128
|
-
h === "custom" &&
|
|
3133
|
+
h === "custom" && i == "linear" && K(),
|
|
3129
3134
|
U(),
|
|
3130
|
-
/* @__PURE__ */ e.jsx(
|
|
3135
|
+
/* @__PURE__ */ e.jsx(Fa, {}),
|
|
3131
3136
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3132
|
-
|
|
3137
|
+
w,
|
|
3133
3138
|
{
|
|
3134
|
-
onClick:
|
|
3139
|
+
onClick: D,
|
|
3135
3140
|
variant: "secondary",
|
|
3136
3141
|
className: "col-span-1 col-start-3 h-8 w-full",
|
|
3137
3142
|
children: "Apply"
|
|
@@ -3143,19 +3148,19 @@ function Rn() {
|
|
|
3143
3148
|
}
|
|
3144
3149
|
function _n({ idx: s }) {
|
|
3145
3150
|
var d;
|
|
3146
|
-
const n =
|
|
3151
|
+
const n = l((c) => {
|
|
3147
3152
|
var m;
|
|
3148
3153
|
return (m = c.card) == null ? void 0 : m.preferences;
|
|
3149
|
-
}), t =
|
|
3154
|
+
}), t = l(
|
|
3150
3155
|
(c) => {
|
|
3151
3156
|
var m;
|
|
3152
3157
|
return (m = c.card.preferences) == null ? void 0 : m.datasetOptions;
|
|
3153
3158
|
}
|
|
3154
|
-
), a =
|
|
3159
|
+
), a = l(
|
|
3155
3160
|
(c) => c.actions.setCardPreferences
|
|
3156
|
-
),
|
|
3161
|
+
), i = (d = n == null ? void 0 : n.chartOptions) == null ? void 0 : d.indexAxis, o = t == null ? void 0 : t.find((c) => c.idx === s);
|
|
3157
3162
|
function r(c, m) {
|
|
3158
|
-
(c === "end" || c === "start") &&
|
|
3163
|
+
(c === "end" || c === "start") && za(Ma());
|
|
3159
3164
|
const h = {
|
|
3160
3165
|
display: c !== "none",
|
|
3161
3166
|
align: c,
|
|
@@ -3176,74 +3181,74 @@ function _n({ idx: s }) {
|
|
|
3176
3181
|
else {
|
|
3177
3182
|
const u = { ...o };
|
|
3178
3183
|
u.datalabels = h;
|
|
3179
|
-
const
|
|
3180
|
-
(
|
|
3184
|
+
const j = t == null ? void 0 : t.map(
|
|
3185
|
+
(f) => f.idx === m ? u : f
|
|
3181
3186
|
);
|
|
3182
3187
|
a({
|
|
3183
3188
|
...n,
|
|
3184
|
-
datasetOptions:
|
|
3189
|
+
datasetOptions: j
|
|
3185
3190
|
});
|
|
3186
3191
|
}
|
|
3187
3192
|
}
|
|
3188
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3189
|
-
/* @__PURE__ */ e.jsx(
|
|
3190
|
-
/* @__PURE__ */ e.jsx(
|
|
3193
|
+
return /* @__PURE__ */ e.jsxs(qe, { children: [
|
|
3194
|
+
/* @__PURE__ */ e.jsx(Ve, { children: /* @__PURE__ */ e.jsx(on, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
3195
|
+
/* @__PURE__ */ e.jsx(Re, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3191
3196
|
/* @__PURE__ */ e.jsx(
|
|
3192
|
-
|
|
3197
|
+
w,
|
|
3193
3198
|
{
|
|
3194
3199
|
onClick: () => r("none", s),
|
|
3195
3200
|
size: "sm",
|
|
3196
3201
|
variant: "secondary",
|
|
3197
3202
|
className: "h-7 p-1 text-xs font-normal",
|
|
3198
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3203
|
+
children: /* @__PURE__ */ e.jsx(Oa, { className: "size-4" })
|
|
3199
3204
|
}
|
|
3200
3205
|
),
|
|
3201
3206
|
/* @__PURE__ */ e.jsx(
|
|
3202
|
-
|
|
3207
|
+
w,
|
|
3203
3208
|
{
|
|
3204
3209
|
onClick: () => r("start", s),
|
|
3205
3210
|
size: "sm",
|
|
3206
3211
|
variant: "secondary",
|
|
3207
3212
|
className: "h-7 p-1 text-xs font-normal",
|
|
3208
3213
|
children: /* @__PURE__ */ e.jsx(
|
|
3209
|
-
|
|
3214
|
+
Xa,
|
|
3210
3215
|
{
|
|
3211
3216
|
className: W("h-4 w-4", {
|
|
3212
|
-
"rotate-90":
|
|
3217
|
+
"rotate-90": i === "y"
|
|
3213
3218
|
})
|
|
3214
3219
|
}
|
|
3215
3220
|
)
|
|
3216
3221
|
}
|
|
3217
3222
|
),
|
|
3218
3223
|
/* @__PURE__ */ e.jsx(
|
|
3219
|
-
|
|
3224
|
+
w,
|
|
3220
3225
|
{
|
|
3221
3226
|
onClick: () => r("center", s),
|
|
3222
3227
|
size: "sm",
|
|
3223
3228
|
variant: "secondary",
|
|
3224
3229
|
className: "h-7 p-1 text-xs font-normal",
|
|
3225
3230
|
children: /* @__PURE__ */ e.jsx(
|
|
3226
|
-
|
|
3231
|
+
en,
|
|
3227
3232
|
{
|
|
3228
3233
|
className: W("h-4 w-4", {
|
|
3229
|
-
"rotate-90":
|
|
3234
|
+
"rotate-90": i === "y"
|
|
3230
3235
|
})
|
|
3231
3236
|
}
|
|
3232
3237
|
)
|
|
3233
3238
|
}
|
|
3234
3239
|
),
|
|
3235
3240
|
/* @__PURE__ */ e.jsx(
|
|
3236
|
-
|
|
3241
|
+
w,
|
|
3237
3242
|
{
|
|
3238
3243
|
onClick: () => r("end", s),
|
|
3239
3244
|
size: "sm",
|
|
3240
3245
|
variant: "secondary",
|
|
3241
3246
|
className: "h-7 p-1 text-xs font-normal",
|
|
3242
3247
|
children: /* @__PURE__ */ e.jsx(
|
|
3243
|
-
|
|
3248
|
+
Za,
|
|
3244
3249
|
{
|
|
3245
3250
|
className: W("h-4 w-4", {
|
|
3246
|
-
"rotate-90":
|
|
3251
|
+
"rotate-90": i === "y"
|
|
3247
3252
|
})
|
|
3248
3253
|
}
|
|
3249
3254
|
)
|
|
@@ -3252,20 +3257,20 @@ function _n({ idx: s }) {
|
|
|
3252
3257
|
] }) })
|
|
3253
3258
|
] });
|
|
3254
3259
|
}
|
|
3255
|
-
function
|
|
3256
|
-
const s =
|
|
3260
|
+
function Ct() {
|
|
3261
|
+
const s = l((c) => c.card), n = l(
|
|
3257
3262
|
(c) => {
|
|
3258
3263
|
var m, h, u;
|
|
3259
3264
|
return (u = (h = (m = c == null ? void 0 : c.card) == null ? void 0 : m.preferences) == null ? void 0 : h.chartOptions) == null ? void 0 : u.indexAxis;
|
|
3260
3265
|
}
|
|
3261
3266
|
), t = n === "y" ? "Y axis" : "X axis", a = n === "y" ? "X axis" : "Y axis", {
|
|
3262
|
-
keys:
|
|
3267
|
+
keys: i,
|
|
3263
3268
|
metricKeys: o,
|
|
3264
3269
|
dimensionKeys: r
|
|
3265
3270
|
} = ns(s.data || []);
|
|
3266
3271
|
let d = o;
|
|
3267
3272
|
if (s.type === "stackedBar") {
|
|
3268
|
-
const c =
|
|
3273
|
+
const c = Ta({
|
|
3269
3274
|
dataArray: s.data || [],
|
|
3270
3275
|
groupKey: r[0],
|
|
3271
3276
|
pivotKey: r[1],
|
|
@@ -3273,7 +3278,7 @@ function Nt() {
|
|
|
3273
3278
|
}), { metricKeys: m } = ns(c);
|
|
3274
3279
|
d = m;
|
|
3275
3280
|
}
|
|
3276
|
-
return
|
|
3281
|
+
return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3277
3282
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3278
3283
|
/* @__PURE__ */ e.jsx(_, { children: t }),
|
|
3279
3284
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: r[0] }) }) })
|
|
@@ -3281,24 +3286,24 @@ function Nt() {
|
|
|
3281
3286
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3282
3287
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3283
3288
|
/* @__PURE__ */ e.jsx(_, { children: a }),
|
|
3284
|
-
/* @__PURE__ */ e.jsx(
|
|
3289
|
+
/* @__PURE__ */ e.jsx(Nt, {})
|
|
3285
3290
|
] }),
|
|
3286
3291
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((c, m) => /* @__PURE__ */ e.jsx(Hn, { col: c, idx: m }, c)) })
|
|
3287
3292
|
] })
|
|
3288
3293
|
] });
|
|
3289
3294
|
}
|
|
3290
3295
|
function Hn({ col: s, idx: n }) {
|
|
3291
|
-
const t =
|
|
3296
|
+
const t = l((d) => {
|
|
3292
3297
|
var c;
|
|
3293
3298
|
return (c = d.card) == null ? void 0 : c.preferences;
|
|
3294
|
-
}), a =
|
|
3299
|
+
}), a = l(
|
|
3295
3300
|
(d) => {
|
|
3296
3301
|
var c;
|
|
3297
3302
|
return (c = d.card.preferences) == null ? void 0 : c.datasetOptions;
|
|
3298
3303
|
}
|
|
3299
|
-
),
|
|
3304
|
+
), i = a == null ? void 0 : a.find((d) => d.idx === n), { setCardPreferences: o } = l((d) => d.actions);
|
|
3300
3305
|
function r(d) {
|
|
3301
|
-
if (!
|
|
3306
|
+
if (!i)
|
|
3302
3307
|
o({
|
|
3303
3308
|
...t,
|
|
3304
3309
|
datasetOptions: [
|
|
@@ -3311,7 +3316,7 @@ function Hn({ col: s, idx: n }) {
|
|
|
3311
3316
|
]
|
|
3312
3317
|
});
|
|
3313
3318
|
else {
|
|
3314
|
-
const c = { ...
|
|
3319
|
+
const c = { ...i };
|
|
3315
3320
|
c.type = d === "area" ? "line" : d, c.fill = d === "area" ? "origin" : "";
|
|
3316
3321
|
const m = a == null ? void 0 : a.map(
|
|
3317
3322
|
(h) => h.idx === n ? c : h
|
|
@@ -3340,7 +3345,7 @@ function Hn({ col: s, idx: n }) {
|
|
|
3340
3345
|
}
|
|
3341
3346
|
),
|
|
3342
3347
|
/* @__PURE__ */ e.jsx(
|
|
3343
|
-
|
|
3348
|
+
Ba,
|
|
3344
3349
|
{
|
|
3345
3350
|
onClick: () => r("area"),
|
|
3346
3351
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3360,10 +3365,10 @@ function Hn({ col: s, idx: n }) {
|
|
|
3360
3365
|
function Bn({
|
|
3361
3366
|
cardType: s
|
|
3362
3367
|
}) {
|
|
3363
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
3364
|
-
/* @__PURE__ */ e.jsxs(
|
|
3365
|
-
/* @__PURE__ */ e.jsx(
|
|
3366
|
-
/* @__PURE__ */ e.jsxs(
|
|
3368
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3369
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3370
|
+
/* @__PURE__ */ e.jsx(q, { children: `${ys(s)} Chart` }),
|
|
3371
|
+
/* @__PURE__ */ e.jsxs(V, { className: "space-y-4 font-mono text-xs", children: [
|
|
3367
3372
|
/* @__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" }),
|
|
3368
3373
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3369
3374
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3386,24 +3391,24 @@ function Bn({
|
|
|
3386
3391
|
] })
|
|
3387
3392
|
] })
|
|
3388
3393
|
] }),
|
|
3389
|
-
/* @__PURE__ */ e.jsxs(
|
|
3390
|
-
/* @__PURE__ */ e.jsx(
|
|
3391
|
-
/* @__PURE__ */ e.jsxs(
|
|
3394
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-2", children: [
|
|
3395
|
+
/* @__PURE__ */ e.jsx(q, { children: "Settings" }),
|
|
3396
|
+
/* @__PURE__ */ e.jsxs(V, { className: "space-y-4 px-2", children: [
|
|
3392
3397
|
/* @__PURE__ */ e.jsx(Ss, {}),
|
|
3393
|
-
/* @__PURE__ */ e.jsx(
|
|
3398
|
+
/* @__PURE__ */ e.jsx(Ct, {})
|
|
3394
3399
|
] })
|
|
3395
3400
|
] }),
|
|
3396
|
-
/* @__PURE__ */ e.jsxs(
|
|
3397
|
-
/* @__PURE__ */ e.jsx(
|
|
3398
|
-
/* @__PURE__ */ e.jsx(
|
|
3401
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-3", children: [
|
|
3402
|
+
/* @__PURE__ */ e.jsx(q, { children: "Filter on click" }),
|
|
3403
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3399
3404
|
] })
|
|
3400
3405
|
] }) });
|
|
3401
3406
|
}
|
|
3402
3407
|
function ks() {
|
|
3403
|
-
var a,
|
|
3404
|
-
const s =
|
|
3408
|
+
var a, i, o;
|
|
3409
|
+
const s = l(
|
|
3405
3410
|
(r) => r.card.cfg
|
|
3406
|
-
), n =
|
|
3411
|
+
), n = l((r) => r.actions.setCardCfg);
|
|
3407
3412
|
function t(r) {
|
|
3408
3413
|
var m;
|
|
3409
3414
|
const d = {
|
|
@@ -3426,21 +3431,24 @@ function ks() {
|
|
|
3426
3431
|
n(c), console.log(r);
|
|
3427
3432
|
}
|
|
3428
3433
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3429
|
-
/* @__PURE__ */ e.
|
|
3434
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3435
|
+
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
3436
|
+
/* @__PURE__ */ e.jsx(Nt, {})
|
|
3437
|
+
] }),
|
|
3430
3438
|
/* @__PURE__ */ e.jsxs(
|
|
3431
3439
|
xs,
|
|
3432
3440
|
{
|
|
3433
|
-
value: (o = (
|
|
3441
|
+
value: (o = (i = (a = s == null ? void 0 : s.options) == null ? void 0 : a.plugins) == null ? void 0 : i.datalabels) == null ? void 0 : o.anchor,
|
|
3434
3442
|
onValueChange: t,
|
|
3435
3443
|
defaultValue: "none",
|
|
3436
3444
|
children: [
|
|
3437
|
-
/* @__PURE__ */ e.jsx(ps, { className: "h-8 w-
|
|
3445
|
+
/* @__PURE__ */ e.jsx(ps, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, { placeholder: "Select position" }) }),
|
|
3438
3446
|
/* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsxs(js, { children: [
|
|
3439
3447
|
/* @__PURE__ */ e.jsx(Ke, { children: "Data Labels" }),
|
|
3440
|
-
/* @__PURE__ */ e.jsx(
|
|
3441
|
-
/* @__PURE__ */ e.jsx(
|
|
3442
|
-
/* @__PURE__ */ e.jsx(
|
|
3443
|
-
/* @__PURE__ */ e.jsx(
|
|
3448
|
+
/* @__PURE__ */ e.jsx(xe, { value: "none", children: "None" }),
|
|
3449
|
+
/* @__PURE__ */ e.jsx(xe, { value: "start", children: "Start" }),
|
|
3450
|
+
/* @__PURE__ */ e.jsx(xe, { value: "center", children: "Center" }),
|
|
3451
|
+
/* @__PURE__ */ e.jsx(xe, { value: "end", children: "End" })
|
|
3444
3452
|
] }) })
|
|
3445
3453
|
]
|
|
3446
3454
|
}
|
|
@@ -3451,9 +3459,9 @@ function $n({
|
|
|
3451
3459
|
cardType: s
|
|
3452
3460
|
}) {
|
|
3453
3461
|
function n(t) {
|
|
3454
|
-
const a = "SELECT label, [group], x-axis, y-axis, radius FROM table",
|
|
3462
|
+
const a = "SELECT label, [group], x-axis, y-axis, radius FROM table", i = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
3455
3463
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3456
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? a :
|
|
3464
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? a : i }),
|
|
3457
3465
|
/* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
|
|
3458
3466
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
3459
3467
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
@@ -3477,18 +3485,18 @@ function $n({
|
|
|
3477
3485
|
] })
|
|
3478
3486
|
] });
|
|
3479
3487
|
}
|
|
3480
|
-
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(
|
|
3481
|
-
/* @__PURE__ */ e.jsxs(
|
|
3482
|
-
/* @__PURE__ */ e.jsx(
|
|
3483
|
-
/* @__PURE__ */ e.jsx(
|
|
3488
|
+
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3489
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3490
|
+
/* @__PURE__ */ e.jsx(q, { children: `${ys(s)} Chart` }),
|
|
3491
|
+
/* @__PURE__ */ e.jsx(V, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3484
3492
|
] }),
|
|
3485
|
-
/* @__PURE__ */ e.jsxs(
|
|
3486
|
-
/* @__PURE__ */ e.jsx(
|
|
3487
|
-
/* @__PURE__ */ e.jsx(
|
|
3493
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-2", children: [
|
|
3494
|
+
/* @__PURE__ */ e.jsx(q, { children: "Settings" }),
|
|
3495
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
|
|
3488
3496
|
] }),
|
|
3489
|
-
/* @__PURE__ */ e.jsxs(
|
|
3490
|
-
/* @__PURE__ */ e.jsx(
|
|
3491
|
-
/* @__PURE__ */ e.jsx(
|
|
3497
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-3", children: [
|
|
3498
|
+
/* @__PURE__ */ e.jsx(q, { children: "Filter on click" }),
|
|
3499
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3492
3500
|
] })
|
|
3493
3501
|
] }) });
|
|
3494
3502
|
}
|
|
@@ -3516,10 +3524,10 @@ const Kn = {
|
|
|
3516
3524
|
]
|
|
3517
3525
|
};
|
|
3518
3526
|
function Gn() {
|
|
3519
|
-
const s =
|
|
3527
|
+
const s = l((n) => n.card.type);
|
|
3520
3528
|
return /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
|
|
3521
3529
|
/* @__PURE__ */ e.jsx(
|
|
3522
|
-
|
|
3530
|
+
Ce,
|
|
3523
3531
|
{
|
|
3524
3532
|
className: " ",
|
|
3525
3533
|
type: "single",
|
|
@@ -3529,15 +3537,15 @@ function Gn() {
|
|
|
3529
3537
|
),
|
|
3530
3538
|
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Ss, {}) }),
|
|
3531
3539
|
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ks, {}) }),
|
|
3532
|
-
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3540
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3533
3541
|
] });
|
|
3534
3542
|
}
|
|
3535
3543
|
function Jn(s) {
|
|
3536
3544
|
if (["line", "bar"].includes(s))
|
|
3537
3545
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3538
|
-
/* @__PURE__ */ e.jsxs(
|
|
3539
|
-
/* @__PURE__ */ e.jsx(
|
|
3540
|
-
/* @__PURE__ */ e.jsxs(
|
|
3546
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3547
|
+
/* @__PURE__ */ e.jsx(q, { className: " font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3548
|
+
/* @__PURE__ */ e.jsxs(V, { className: " ", children: [
|
|
3541
3549
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
|
|
3542
3550
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3543
3551
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
|
|
@@ -3545,9 +3553,9 @@ function Jn(s) {
|
|
|
3545
3553
|
] })
|
|
3546
3554
|
] })
|
|
3547
3555
|
] }),
|
|
3548
|
-
/* @__PURE__ */ e.jsxs(
|
|
3549
|
-
/* @__PURE__ */ e.jsx(
|
|
3550
|
-
/* @__PURE__ */ e.jsxs(
|
|
3556
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-2", children: [
|
|
3557
|
+
/* @__PURE__ */ e.jsx(q, { className: " font-normal", children: "Mixed Chart" }),
|
|
3558
|
+
/* @__PURE__ */ e.jsxs(V, { className: " text-xs space-y-2", children: [
|
|
3551
3559
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3552
3560
|
"Click ",
|
|
3553
3561
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3556,9 +3564,9 @@ function Jn(s) {
|
|
|
3556
3564
|
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Kn, null, 2) })
|
|
3557
3565
|
] })
|
|
3558
3566
|
] }),
|
|
3559
|
-
/* @__PURE__ */ e.jsxs(
|
|
3560
|
-
/* @__PURE__ */ e.jsx(
|
|
3561
|
-
/* @__PURE__ */ e.jsxs(
|
|
3567
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-3", children: [
|
|
3568
|
+
/* @__PURE__ */ e.jsx(q, { className: " font-normal", children: "Area Chart" }),
|
|
3569
|
+
/* @__PURE__ */ e.jsxs(V, { className: " text-xs space-y-2", children: [
|
|
3562
3570
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3563
3571
|
"Click ",
|
|
3564
3572
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3579,13 +3587,13 @@ function Jn(s) {
|
|
|
3579
3587
|
] })
|
|
3580
3588
|
] });
|
|
3581
3589
|
if (s === "bubble")
|
|
3582
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3583
|
-
/* @__PURE__ */ e.jsx(
|
|
3590
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3591
|
+
/* @__PURE__ */ e.jsx(q, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3584
3592
|
"How to create a ",
|
|
3585
3593
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3586
3594
|
" chart query?"
|
|
3587
3595
|
] }) }),
|
|
3588
|
-
/* @__PURE__ */ e.jsxs(
|
|
3596
|
+
/* @__PURE__ */ e.jsxs(V, { className: " ", children: [
|
|
3589
3597
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
|
|
3590
3598
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3591
3599
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3597,13 +3605,13 @@ function Jn(s) {
|
|
|
3597
3605
|
] })
|
|
3598
3606
|
] }) });
|
|
3599
3607
|
if (s === "scatter")
|
|
3600
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3601
|
-
/* @__PURE__ */ e.jsx(
|
|
3608
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3609
|
+
/* @__PURE__ */ e.jsx(q, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3602
3610
|
"How to create a ",
|
|
3603
3611
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3604
3612
|
" chart query?"
|
|
3605
3613
|
] }) }),
|
|
3606
|
-
/* @__PURE__ */ e.jsxs(
|
|
3614
|
+
/* @__PURE__ */ e.jsxs(V, { className: " ", children: [
|
|
3607
3615
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, x-axis, y-axis FROM table" }),
|
|
3608
3616
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3609
3617
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3614,13 +3622,13 @@ function Jn(s) {
|
|
|
3614
3622
|
] })
|
|
3615
3623
|
] }) });
|
|
3616
3624
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3617
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3618
|
-
/* @__PURE__ */ e.jsx(
|
|
3625
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3626
|
+
/* @__PURE__ */ e.jsx(q, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3619
3627
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3620
3628
|
" ",
|
|
3621
3629
|
"chart query"
|
|
3622
3630
|
] }) }),
|
|
3623
|
-
/* @__PURE__ */ e.jsxs(
|
|
3631
|
+
/* @__PURE__ */ e.jsxs(V, { className: " ", children: [
|
|
3624
3632
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, measure FROM table" }),
|
|
3625
3633
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3626
3634
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3631,27 +3639,27 @@ function Jn(s) {
|
|
|
3631
3639
|
}
|
|
3632
3640
|
function Qn() {
|
|
3633
3641
|
var r, d, c;
|
|
3634
|
-
const s =
|
|
3642
|
+
const s = l((m) => m.card.preferences), n = l(
|
|
3635
3643
|
(m) => m.actions.setCardPreferences
|
|
3636
|
-
), t =
|
|
3644
|
+
), t = l(
|
|
3637
3645
|
(m) => m.actions.setNumberFormat
|
|
3638
|
-
), a =
|
|
3646
|
+
), a = l(
|
|
3639
3647
|
(m) => {
|
|
3640
3648
|
var h, u;
|
|
3641
3649
|
return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.format;
|
|
3642
3650
|
}
|
|
3643
|
-
),
|
|
3651
|
+
), i = l(
|
|
3644
3652
|
(m) => {
|
|
3645
3653
|
var h, u;
|
|
3646
3654
|
return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.locale;
|
|
3647
3655
|
}
|
|
3648
|
-
), o =
|
|
3656
|
+
), o = l(
|
|
3649
3657
|
(m) => {
|
|
3650
3658
|
var h, u;
|
|
3651
3659
|
return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.currency;
|
|
3652
3660
|
}
|
|
3653
3661
|
);
|
|
3654
|
-
return
|
|
3662
|
+
return l(
|
|
3655
3663
|
(m) => m.actions.setFilterOnClickField
|
|
3656
3664
|
), /* @__PURE__ */ e.jsxs("div", { children: [
|
|
3657
3665
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
@@ -3683,12 +3691,12 @@ function Qn() {
|
|
|
3683
3691
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3684
3692
|
placeholder: "USD",
|
|
3685
3693
|
onChange: (m) => {
|
|
3686
|
-
var h, u,
|
|
3694
|
+
var h, u, j;
|
|
3687
3695
|
return t(
|
|
3688
3696
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
|
|
3689
3697
|
m.target.value,
|
|
3690
3698
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
|
|
3691
|
-
((
|
|
3699
|
+
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
|
|
3692
3700
|
);
|
|
3693
3701
|
}
|
|
3694
3702
|
}
|
|
@@ -3696,16 +3704,16 @@ function Qn() {
|
|
|
3696
3704
|
/* @__PURE__ */ e.jsx(
|
|
3697
3705
|
Q,
|
|
3698
3706
|
{
|
|
3699
|
-
value:
|
|
3707
|
+
value: i || "",
|
|
3700
3708
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3701
3709
|
placeholder: "en-US",
|
|
3702
3710
|
onChange: (m) => {
|
|
3703
|
-
var h, u,
|
|
3711
|
+
var h, u, j;
|
|
3704
3712
|
return t(
|
|
3705
3713
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
|
|
3706
3714
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
3707
3715
|
m.target.value,
|
|
3708
|
-
((
|
|
3716
|
+
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
|
|
3709
3717
|
);
|
|
3710
3718
|
}
|
|
3711
3719
|
}
|
|
@@ -3736,12 +3744,12 @@ function Qn() {
|
|
|
3736
3744
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3737
3745
|
placeholder: "###,###.##",
|
|
3738
3746
|
onChange: (m) => {
|
|
3739
|
-
var h, u,
|
|
3747
|
+
var h, u, j;
|
|
3740
3748
|
return t(
|
|
3741
3749
|
m.target.value,
|
|
3742
3750
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.currency) || "",
|
|
3743
3751
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
|
|
3744
|
-
((
|
|
3752
|
+
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
|
|
3745
3753
|
);
|
|
3746
3754
|
}
|
|
3747
3755
|
}
|
|
@@ -3756,11 +3764,11 @@ function Qn() {
|
|
|
3756
3764
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3757
3765
|
placeholder: "K, M, B",
|
|
3758
3766
|
onChange: (m) => {
|
|
3759
|
-
var h, u,
|
|
3767
|
+
var h, u, j;
|
|
3760
3768
|
return t(
|
|
3761
3769
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
|
|
3762
3770
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
3763
|
-
((
|
|
3771
|
+
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
|
|
3764
3772
|
m.target.value
|
|
3765
3773
|
);
|
|
3766
3774
|
}
|
|
@@ -3772,9 +3780,9 @@ function Qn() {
|
|
|
3772
3780
|
}
|
|
3773
3781
|
function Wn() {
|
|
3774
3782
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3775
|
-
/* @__PURE__ */ e.jsx(
|
|
3776
|
-
/* @__PURE__ */ e.jsx(
|
|
3777
|
-
/* @__PURE__ */ e.jsxs(
|
|
3783
|
+
/* @__PURE__ */ e.jsx(Ce, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3784
|
+
/* @__PURE__ */ e.jsx(q, { className: "", children: "KPI Query" }),
|
|
3785
|
+
/* @__PURE__ */ e.jsxs(V, { className: "font-mono", children: [
|
|
3778
3786
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
3779
3787
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3780
3788
|
/* @__PURE__ */ e.jsx("li", { children: "current - number" }),
|
|
@@ -3804,10 +3812,10 @@ function Wn() {
|
|
|
3804
3812
|
function Pn({
|
|
3805
3813
|
cardType: s
|
|
3806
3814
|
}) {
|
|
3807
|
-
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(
|
|
3808
|
-
/* @__PURE__ */ e.jsxs(
|
|
3809
|
-
/* @__PURE__ */ e.jsx(
|
|
3810
|
-
/* @__PURE__ */ e.jsxs(
|
|
3815
|
+
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3816
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3817
|
+
/* @__PURE__ */ e.jsx(q, { children: `${ys(s)} Chart` }),
|
|
3818
|
+
/* @__PURE__ */ e.jsxs(V, { className: " space-y-4 font-mono text-xs ", children: [
|
|
3811
3819
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: "SELECT label, measure FROM table" }),
|
|
3812
3820
|
/* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
|
|
3813
3821
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
@@ -3829,21 +3837,21 @@ function Pn({
|
|
|
3829
3837
|
] })
|
|
3830
3838
|
] })
|
|
3831
3839
|
] }),
|
|
3832
|
-
/* @__PURE__ */ e.jsxs(
|
|
3833
|
-
/* @__PURE__ */ e.jsx(
|
|
3834
|
-
/* @__PURE__ */ e.jsx(
|
|
3840
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-2", children: [
|
|
3841
|
+
/* @__PURE__ */ e.jsx(q, { children: "Settings" }),
|
|
3842
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
|
|
3835
3843
|
] }),
|
|
3836
|
-
/* @__PURE__ */ e.jsxs(
|
|
3837
|
-
/* @__PURE__ */ e.jsx(
|
|
3838
|
-
/* @__PURE__ */ e.jsx(
|
|
3844
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-3", children: [
|
|
3845
|
+
/* @__PURE__ */ e.jsx(q, { children: "Filter on click" }),
|
|
3846
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3839
3847
|
] })
|
|
3840
3848
|
] }) });
|
|
3841
3849
|
}
|
|
3842
3850
|
function Yn() {
|
|
3843
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(
|
|
3844
|
-
/* @__PURE__ */ e.jsxs(
|
|
3845
|
-
/* @__PURE__ */ e.jsx(
|
|
3846
|
-
/* @__PURE__ */ e.jsxs(
|
|
3851
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3852
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-1", children: [
|
|
3853
|
+
/* @__PURE__ */ e.jsx(q, { children: "Stacked Chart" }),
|
|
3854
|
+
/* @__PURE__ */ e.jsxs(V, { className: "space-y-4 font-mono text-xs", children: [
|
|
3847
3855
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
3848
3856
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3849
3857
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3866,29 +3874,29 @@ function Yn() {
|
|
|
3866
3874
|
] })
|
|
3867
3875
|
] })
|
|
3868
3876
|
] }),
|
|
3869
|
-
/* @__PURE__ */ e.jsxs(
|
|
3870
|
-
/* @__PURE__ */ e.jsx(
|
|
3871
|
-
/* @__PURE__ */ e.jsxs(
|
|
3877
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-2", children: [
|
|
3878
|
+
/* @__PURE__ */ e.jsx(q, { children: "Settings" }),
|
|
3879
|
+
/* @__PURE__ */ e.jsxs(V, { className: "space-y-4 px-2", children: [
|
|
3872
3880
|
/* @__PURE__ */ e.jsx(Ss, {}),
|
|
3873
|
-
/* @__PURE__ */ e.jsx(
|
|
3881
|
+
/* @__PURE__ */ e.jsx(Ct, {})
|
|
3874
3882
|
] })
|
|
3875
3883
|
] }),
|
|
3876
|
-
/* @__PURE__ */ e.jsxs(
|
|
3877
|
-
/* @__PURE__ */ e.jsx(
|
|
3878
|
-
/* @__PURE__ */ e.jsx(
|
|
3884
|
+
/* @__PURE__ */ e.jsxs(I, { value: "item-3", children: [
|
|
3885
|
+
/* @__PURE__ */ e.jsx(q, { children: "Filter on click" }),
|
|
3886
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3879
3887
|
] })
|
|
3880
3888
|
] }) });
|
|
3881
3889
|
}
|
|
3882
3890
|
function Xn({
|
|
3883
3891
|
cardType: s
|
|
3884
3892
|
}) {
|
|
3885
|
-
return console.log("TableVisualSettings", s), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(
|
|
3886
|
-
/* @__PURE__ */ e.jsx(
|
|
3887
|
-
/* @__PURE__ */ e.jsx(
|
|
3893
|
+
return console.log("TableVisualSettings", s), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(Ce, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(I, { value: "item-3", children: [
|
|
3894
|
+
/* @__PURE__ */ e.jsx(q, { children: "Filter on click" }),
|
|
3895
|
+
/* @__PURE__ */ e.jsx(V, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3888
3896
|
] }) }) });
|
|
3889
3897
|
}
|
|
3890
3898
|
function Zn() {
|
|
3891
|
-
const s =
|
|
3899
|
+
const s = l((t) => t.card.type);
|
|
3892
3900
|
function n(t) {
|
|
3893
3901
|
switch (t) {
|
|
3894
3902
|
case "stackedBar":
|
|
@@ -3915,7 +3923,7 @@ function Zn() {
|
|
|
3915
3923
|
return /* @__PURE__ */ e.jsx(bs, { className: "h-full w-full text-sm", children: n(s) });
|
|
3916
3924
|
}
|
|
3917
3925
|
function er() {
|
|
3918
|
-
const s =
|
|
3926
|
+
const s = l((n) => n.isShowingVisual);
|
|
3919
3927
|
return /* @__PURE__ */ e.jsxs(
|
|
3920
3928
|
rs,
|
|
3921
3929
|
{
|
|
@@ -3923,18 +3931,18 @@ function er() {
|
|
|
3923
3931
|
className: "min-w-full max-w-lg min-h-[250px]",
|
|
3924
3932
|
children: [
|
|
3925
3933
|
/* @__PURE__ */ e.jsx(
|
|
3926
|
-
|
|
3934
|
+
Oe,
|
|
3927
3935
|
{
|
|
3928
3936
|
role: "query-section",
|
|
3929
3937
|
className: "flex",
|
|
3930
3938
|
minSize: 20,
|
|
3931
3939
|
defaultSize: 40,
|
|
3932
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3940
|
+
children: /* @__PURE__ */ e.jsx(An, {})
|
|
3933
3941
|
}
|
|
3934
3942
|
),
|
|
3935
3943
|
/* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border " }),
|
|
3936
3944
|
/* @__PURE__ */ e.jsx(
|
|
3937
|
-
|
|
3945
|
+
Oe,
|
|
3938
3946
|
{
|
|
3939
3947
|
className: "pb-1",
|
|
3940
3948
|
role: "visual-section",
|
|
@@ -3942,7 +3950,7 @@ function er() {
|
|
|
3942
3950
|
defaultSize: 60,
|
|
3943
3951
|
children: s ? /* @__PURE__ */ e.jsxs(rs, { direction: "horizontal", children: [
|
|
3944
3952
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
3945
|
-
|
|
3953
|
+
Oe,
|
|
3946
3954
|
{
|
|
3947
3955
|
className: "flex min-w-[275px]",
|
|
3948
3956
|
minSize: 20,
|
|
@@ -3952,7 +3960,7 @@ function er() {
|
|
|
3952
3960
|
}
|
|
3953
3961
|
) }),
|
|
3954
3962
|
/* @__PURE__ */ e.jsx(ls, { className: "border " }),
|
|
3955
|
-
/* @__PURE__ */ e.jsx(
|
|
3963
|
+
/* @__PURE__ */ e.jsx(Oe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(_s, {}) })
|
|
3956
3964
|
] }) : /* @__PURE__ */ e.jsx(_s, {})
|
|
3957
3965
|
}
|
|
3958
3966
|
)
|
|
@@ -3961,20 +3969,20 @@ function er() {
|
|
|
3961
3969
|
);
|
|
3962
3970
|
}
|
|
3963
3971
|
function sr({ authToken: s, onSave: n, onClose: t }) {
|
|
3964
|
-
const a =
|
|
3965
|
-
return
|
|
3966
|
-
n && a(n), t &&
|
|
3967
|
-
}, [n, a, t,
|
|
3972
|
+
const a = l((r) => r.actions.setOnSave), i = l((r) => r.actions.setOnClose), o = S((r) => r.actions.setAuthToken);
|
|
3973
|
+
return B(() => {
|
|
3974
|
+
n && a(n), t && i(t);
|
|
3975
|
+
}, [n, a, t, i]), B(() => {
|
|
3968
3976
|
s && s.accessToken && o(s);
|
|
3969
|
-
}, [s, o]), /* @__PURE__ */ e.jsxs(
|
|
3970
|
-
/* @__PURE__ */ e.jsx(
|
|
3971
|
-
/* @__PURE__ */ e.jsx(
|
|
3977
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(Aa, { className: "rounded-none", role: "editor-panel", children: [
|
|
3978
|
+
/* @__PURE__ */ e.jsx(Ea, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(ut, {}) }),
|
|
3979
|
+
/* @__PURE__ */ e.jsx(La, { children: /* @__PURE__ */ e.jsx(er, {}) })
|
|
3972
3980
|
] });
|
|
3973
3981
|
}
|
|
3974
3982
|
function tr() {
|
|
3975
3983
|
S((r) => r.selectedCardId);
|
|
3976
3984
|
const s = S((r) => r.selectedSheetId), { setIsVisualEditing: n } = S((r) => r.actions), t = S((r) => r.isVisualEditing), a = S((r) => r.actions.updateFrame);
|
|
3977
|
-
function
|
|
3985
|
+
function i(r) {
|
|
3978
3986
|
s && (a(s, r), n(!1));
|
|
3979
3987
|
}
|
|
3980
3988
|
function o() {
|
|
@@ -3988,7 +3996,7 @@ function tr() {
|
|
|
3988
3996
|
block: t,
|
|
3989
3997
|
hidden: !t
|
|
3990
3998
|
}),
|
|
3991
|
-
children: /* @__PURE__ */ e.jsx(sr, { onSave:
|
|
3999
|
+
children: /* @__PURE__ */ e.jsx(sr, { onSave: i, onClose: o })
|
|
3992
4000
|
}
|
|
3993
4001
|
);
|
|
3994
4002
|
}
|
|
@@ -3996,25 +4004,25 @@ function ar({
|
|
|
3996
4004
|
columns: s,
|
|
3997
4005
|
tableName: n
|
|
3998
4006
|
}) {
|
|
3999
|
-
const t =
|
|
4007
|
+
const t = l((u) => u.selectedConnectionId), a = l((u) => u.selectedDatabaseName), i = l((u) => u.selectedSchemaName), o = l((u) => u.selectedTableName), r = S((u) => u.dashboard.filters) || [], d = S((u) => u.actions.addFilter), c = S((u) => u.actions.removeFilter), m = S(
|
|
4000
4008
|
(u) => u.actions.removeFilterValue
|
|
4001
4009
|
);
|
|
4002
4010
|
function h(u) {
|
|
4003
|
-
const
|
|
4004
|
-
|
|
4011
|
+
const j = ce(u.column_name), f = ce(a || ""), b = ce(i || ""), C = ce(n), v = as(
|
|
4012
|
+
b,
|
|
4005
4013
|
C
|
|
4006
|
-
), y = `${v}.${
|
|
4014
|
+
), y = `${v}.${j}`;
|
|
4007
4015
|
console.log(
|
|
4008
4016
|
"find",
|
|
4009
4017
|
y,
|
|
4010
4018
|
C,
|
|
4011
|
-
|
|
4019
|
+
f
|
|
4012
4020
|
);
|
|
4013
|
-
const
|
|
4014
|
-
(
|
|
4021
|
+
const E = r == null ? void 0 : r.find(
|
|
4022
|
+
(T) => T.column === y && T.table === C && (T.database === f || T.database === a)
|
|
4015
4023
|
);
|
|
4016
|
-
if (
|
|
4017
|
-
m(
|
|
4024
|
+
if (E)
|
|
4025
|
+
m(E.id), c(E.id);
|
|
4018
4026
|
else {
|
|
4019
4027
|
if (n === "api" && t) {
|
|
4020
4028
|
d({
|
|
@@ -4030,7 +4038,7 @@ function ar({
|
|
|
4030
4038
|
sql: qs(
|
|
4031
4039
|
u.data_type,
|
|
4032
4040
|
v,
|
|
4033
|
-
|
|
4041
|
+
j
|
|
4034
4042
|
)
|
|
4035
4043
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4036
4044
|
});
|
|
@@ -4038,7 +4046,7 @@ function ar({
|
|
|
4038
4046
|
}
|
|
4039
4047
|
d({
|
|
4040
4048
|
id: $e(),
|
|
4041
|
-
column: `${v}.${
|
|
4049
|
+
column: `${v}.${j}`,
|
|
4042
4050
|
title: u.column_name,
|
|
4043
4051
|
dataType: u.data_type,
|
|
4044
4052
|
table: o || "",
|
|
@@ -4048,15 +4056,15 @@ function ar({
|
|
|
4048
4056
|
sql: qs(
|
|
4049
4057
|
u.data_type,
|
|
4050
4058
|
v,
|
|
4051
|
-
|
|
4059
|
+
j
|
|
4052
4060
|
)
|
|
4053
4061
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4054
4062
|
});
|
|
4055
4063
|
}
|
|
4056
4064
|
}
|
|
4057
4065
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
|
|
4058
|
-
const
|
|
4059
|
-
(
|
|
4066
|
+
const j = r == null ? void 0 : r.find(
|
|
4067
|
+
(f) => f.column === ce(u.column_name) && f.table === o && f.database === a
|
|
4060
4068
|
);
|
|
4061
4069
|
return /* @__PURE__ */ e.jsx(
|
|
4062
4070
|
"div",
|
|
@@ -4065,7 +4073,7 @@ function ar({
|
|
|
4065
4073
|
className: W(
|
|
4066
4074
|
"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",
|
|
4067
4075
|
{
|
|
4068
|
-
"bg-muted":
|
|
4076
|
+
"bg-muted": j
|
|
4069
4077
|
}
|
|
4070
4078
|
),
|
|
4071
4079
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -4086,12 +4094,12 @@ function nr() {
|
|
|
4086
4094
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
4087
4095
|
/* @__PURE__ */ e.jsx(_, { className: "text-lg", children: "Filters" }),
|
|
4088
4096
|
/* @__PURE__ */ e.jsx(
|
|
4089
|
-
|
|
4097
|
+
w,
|
|
4090
4098
|
{
|
|
4091
4099
|
onClick: () => s(!1),
|
|
4092
4100
|
className: "h-7 w-7 p-0",
|
|
4093
4101
|
variant: "ghost",
|
|
4094
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4102
|
+
children: /* @__PURE__ */ e.jsx(Le, {})
|
|
4095
4103
|
}
|
|
4096
4104
|
)
|
|
4097
4105
|
] }),
|
|
@@ -4122,7 +4130,7 @@ function rr() {
|
|
|
4122
4130
|
flex: !n
|
|
4123
4131
|
}),
|
|
4124
4132
|
children: [
|
|
4125
|
-
/* @__PURE__ */ e.jsx(
|
|
4133
|
+
/* @__PURE__ */ e.jsx(Da, {}),
|
|
4126
4134
|
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(nr, {}) })
|
|
4127
4135
|
]
|
|
4128
4136
|
}
|
|
@@ -4141,7 +4149,7 @@ function lr() {
|
|
|
4141
4149
|
hidden: !t
|
|
4142
4150
|
}),
|
|
4143
4151
|
children: /* @__PURE__ */ e.jsx(
|
|
4144
|
-
|
|
4152
|
+
Ia,
|
|
4145
4153
|
{
|
|
4146
4154
|
onChange: (a) => {
|
|
4147
4155
|
if (a)
|
|
@@ -4177,10 +4185,10 @@ function cr({
|
|
|
4177
4185
|
showFooter: n = !0,
|
|
4178
4186
|
...t
|
|
4179
4187
|
}) {
|
|
4180
|
-
return /* @__PURE__ */ e.jsx(
|
|
4188
|
+
return /* @__PURE__ */ e.jsx(qa, { dashboardProps: t, children: /* @__PURE__ */ e.jsxs(Va, { children: [
|
|
4181
4189
|
/* @__PURE__ */ e.jsx(lr, {}),
|
|
4182
|
-
/* @__PURE__ */ e.jsxs(
|
|
4183
|
-
s && /* @__PURE__ */ e.jsx(
|
|
4190
|
+
/* @__PURE__ */ e.jsxs(Ra, { ...t, children: [
|
|
4191
|
+
s && /* @__PURE__ */ e.jsx(pn, {}),
|
|
4184
4192
|
/* @__PURE__ */ e.jsx(tr, {}),
|
|
4185
4193
|
/* @__PURE__ */ e.jsx(rr, {})
|
|
4186
4194
|
] })
|