react-semaphor 0.0.172 → 0.0.173
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--7LpBCrZ.js → dashboard-plus-0J3J9ZJQ.js} +540 -547
- package/dist/chunks/dashboard-plus-LqLuP6V4.js +205 -0
- package/dist/chunks/{index-QbRtnHXN.js → index-NP8yP9EE.js} +81 -71
- package/dist/chunks/{index-eANGYKf6.js → index-YLj7M7ho.js} +7824 -7762
- 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/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunks/dashboard-plus-lvg4fidr.js +0 -215
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import de, { useState as
|
|
1
|
+
import { P as M, 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 H, _ as W, $ 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 K, ac as fs, ad as gs, ae as js, af as Ke, ag as xe, ah as bs, G as l, ai as qe, aj as Ve, ak as Rt, al as Re, w as Ks, v as Us, t as ce, am as _t, r as Ht, N as Gs, s as Bt, an as $t, B as Kt, ao as Js, ap as Ut, L as De, S as ys, z as Gt, n as zs, A as as, u as Ye, aq as Ne, ar as Fe, as as Jt, at as Qt, au as Wt, av as Qs, aw as Ws, ax as Ps, ay as Ys, az as Xs, aA as Pt, aB as Zs, aC as et, aD as Yt, aE as Xt, aF as Zt, aG as ea, aH as sa, aI as ns, aJ as ta, aK as Be, aL as Ms, aM as aa, aN as na, aO as ra, aP as la, aQ as ia, aR as ts, aS as oa, aT as Ts, aU as ca, aV as As, aW as da, aX as ha, aY as ua, aZ as st, l as ma, C as xa, E as Es, d as pa, h as fa, i as ga, o as ja, a_ as ba, m as ya, a$ as va, b0 as Na, b1 as Ca, b2 as Ls, b3 as Sa, b4 as Ds, b5 as Is, K as ka, b6 as tt, b7 as wa, b8 as at, b9 as Ue, ba as nt, bb as Fa, bc as Oa, bd as za, be as Ma, bf as Ta, bg as Aa, bh as Ce, bi as q, bj as V, bk as vs, bl as R, bm as Ea, bn as La, bo as Da, bp as qs, bq as Ia, br as qa, bs as Va, bt as Ra, bu as _a } from "./index-YLj7M7ho.js";
|
|
2
|
+
import de, { useState as z, useEffect as $, useMemo as Ha, 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 Ba = M("Activity", [
|
|
10
10
|
[
|
|
11
11
|
"path",
|
|
12
12
|
{
|
|
@@ -21,7 +21,7 @@ const Ha = z("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 $a = M("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 Ba = z("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
|
|
34
|
+
const Ns = M("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,16 +43,7 @@ const vs = z("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
|
|
47
|
-
["path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z", key: "1fy3hk" }]
|
|
48
|
-
]);
|
|
49
|
-
/**
|
|
50
|
-
* @license lucide-react v0.379.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/
|
|
55
|
-
const Ka = z("CircleX", [
|
|
46
|
+
const Ka = M("CircleX", [
|
|
56
47
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
57
48
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
58
49
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -63,7 +54,7 @@ const Ka = z("CircleX", [
|
|
|
63
54
|
* This source code is licensed under the ISC license.
|
|
64
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
56
|
*/
|
|
66
|
-
const Ua =
|
|
57
|
+
const Ua = M("Database", [
|
|
67
58
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
68
59
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
69
60
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -74,7 +65,7 @@ const Ua = z("Database", [
|
|
|
74
65
|
* This source code is licensed under the ISC license.
|
|
75
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
67
|
*/
|
|
77
|
-
const Ga =
|
|
68
|
+
const Ga = M("Eraser", [
|
|
78
69
|
[
|
|
79
70
|
"path",
|
|
80
71
|
{
|
|
@@ -91,7 +82,7 @@ const Ga = z("Eraser", [
|
|
|
91
82
|
* This source code is licensed under the ISC license.
|
|
92
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
84
|
*/
|
|
94
|
-
const rt =
|
|
85
|
+
const rt = M("Filter", [
|
|
95
86
|
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
96
87
|
]);
|
|
97
88
|
/**
|
|
@@ -100,7 +91,7 @@ const rt = z("Filter", [
|
|
|
100
91
|
* This source code is licensed under the ISC license.
|
|
101
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
93
|
*/
|
|
103
|
-
const Ja =
|
|
94
|
+
const Ja = M("Glasses", [
|
|
104
95
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
105
96
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
106
97
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -113,7 +104,7 @@ const Ja = z("Glasses", [
|
|
|
113
104
|
* This source code is licensed under the ISC license.
|
|
114
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
115
106
|
*/
|
|
116
|
-
const Qa =
|
|
107
|
+
const Qa = M("GripVertical", [
|
|
117
108
|
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
118
109
|
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
119
110
|
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
@@ -127,7 +118,7 @@ const Qa = z("GripVertical", [
|
|
|
127
118
|
* This source code is licensed under the ISC license.
|
|
128
119
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
120
|
*/
|
|
130
|
-
const Wa =
|
|
121
|
+
const Wa = M("Hammer", [
|
|
131
122
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
132
123
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
133
124
|
[
|
|
@@ -144,7 +135,7 @@ const Wa = z("Hammer", [
|
|
|
144
135
|
* This source code is licensed under the ISC license.
|
|
145
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
137
|
*/
|
|
147
|
-
const Pa =
|
|
138
|
+
const Pa = M("Hash", [
|
|
148
139
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
149
140
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
150
141
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -156,7 +147,7 @@ const Pa = z("Hash", [
|
|
|
156
147
|
* This source code is licensed under the ISC license.
|
|
157
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
149
|
*/
|
|
159
|
-
const Ya =
|
|
150
|
+
const Ya = M("Key", [
|
|
160
151
|
["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
152
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
162
153
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -167,7 +158,7 @@ const Ya = z("Key", [
|
|
|
167
158
|
* This source code is licensed under the ISC license.
|
|
168
159
|
* See the LICENSE file in the root directory of this source tree.
|
|
169
160
|
*/
|
|
170
|
-
const
|
|
161
|
+
const Cs = M("LineChart", [
|
|
171
162
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
172
163
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
173
164
|
]);
|
|
@@ -177,7 +168,7 @@ const Ns = z("LineChart", [
|
|
|
177
168
|
* This source code is licensed under the ISC license.
|
|
178
169
|
* See the LICENSE file in the root directory of this source tree.
|
|
179
170
|
*/
|
|
180
|
-
const Xa =
|
|
171
|
+
const Xa = M("ListEnd", [
|
|
181
172
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
182
173
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
183
174
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -190,7 +181,7 @@ const Xa = z("ListEnd", [
|
|
|
190
181
|
* This source code is licensed under the ISC license.
|
|
191
182
|
* See the LICENSE file in the root directory of this source tree.
|
|
192
183
|
*/
|
|
193
|
-
const Za =
|
|
184
|
+
const Za = M("ListStart", [
|
|
194
185
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
195
186
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
196
187
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -203,7 +194,7 @@ const Za = z("ListStart", [
|
|
|
203
194
|
* This source code is licensed under the ISC license.
|
|
204
195
|
* See the LICENSE file in the root directory of this source tree.
|
|
205
196
|
*/
|
|
206
|
-
const en =
|
|
197
|
+
const en = M("ListX", [
|
|
207
198
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
208
199
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
209
200
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -216,7 +207,7 @@ const en = z("ListX", [
|
|
|
216
207
|
* This source code is licensed under the ISC license.
|
|
217
208
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
209
|
*/
|
|
219
|
-
const sn =
|
|
210
|
+
const sn = M("MessageSquareMore", [
|
|
220
211
|
["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
212
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
222
213
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -228,7 +219,7 @@ const sn = z("MessageSquareMore", [
|
|
|
228
219
|
* This source code is licensed under the ISC license.
|
|
229
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
221
|
*/
|
|
231
|
-
const tn =
|
|
222
|
+
const tn = M("Network", [
|
|
232
223
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
233
224
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
234
225
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -241,7 +232,7 @@ const tn = z("Network", [
|
|
|
241
232
|
* This source code is licensed under the ISC license.
|
|
242
233
|
* See the LICENSE file in the root directory of this source tree.
|
|
243
234
|
*/
|
|
244
|
-
const lt =
|
|
235
|
+
const lt = M("Pencil", [
|
|
245
236
|
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
|
|
246
237
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
247
238
|
]);
|
|
@@ -251,7 +242,7 @@ const lt = z("Pencil", [
|
|
|
251
242
|
* This source code is licensed under the ISC license.
|
|
252
243
|
* See the LICENSE file in the root directory of this source tree.
|
|
253
244
|
*/
|
|
254
|
-
const it =
|
|
245
|
+
const it = M("PieChart", [
|
|
255
246
|
["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
|
|
256
247
|
["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
|
|
257
248
|
]);
|
|
@@ -261,7 +252,7 @@ const it = z("PieChart", [
|
|
|
261
252
|
* This source code is licensed under the ISC license.
|
|
262
253
|
* See the LICENSE file in the root directory of this source tree.
|
|
263
254
|
*/
|
|
264
|
-
const an =
|
|
255
|
+
const an = M("Play", [
|
|
265
256
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
266
257
|
]);
|
|
267
258
|
/**
|
|
@@ -270,7 +261,7 @@ const an = z("Play", [
|
|
|
270
261
|
* This source code is licensed under the ISC license.
|
|
271
262
|
* See the LICENSE file in the root directory of this source tree.
|
|
272
263
|
*/
|
|
273
|
-
const nn =
|
|
264
|
+
const nn = M("Plug2", [
|
|
274
265
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
275
266
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
276
267
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -283,7 +274,7 @@ const nn = z("Plug2", [
|
|
|
283
274
|
* This source code is licensed under the ISC license.
|
|
284
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
285
276
|
*/
|
|
286
|
-
const ot =
|
|
277
|
+
const ot = M("Plus", [
|
|
287
278
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
288
279
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
289
280
|
]);
|
|
@@ -293,7 +284,7 @@ const ot = z("Plus", [
|
|
|
293
284
|
* This source code is licensed under the ISC license.
|
|
294
285
|
* See the LICENSE file in the root directory of this source tree.
|
|
295
286
|
*/
|
|
296
|
-
const rn =
|
|
287
|
+
const rn = M("Save", [
|
|
297
288
|
[
|
|
298
289
|
"path",
|
|
299
290
|
{
|
|
@@ -310,7 +301,7 @@ const rn = z("Save", [
|
|
|
310
301
|
* This source code is licensed under the ISC license.
|
|
311
302
|
* See the LICENSE file in the root directory of this source tree.
|
|
312
303
|
*/
|
|
313
|
-
const ct =
|
|
304
|
+
const ct = M("ScatterChart", [
|
|
314
305
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
315
306
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
316
307
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -324,7 +315,7 @@ const ct = z("ScatterChart", [
|
|
|
324
315
|
* This source code is licensed under the ISC license.
|
|
325
316
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
317
|
*/
|
|
327
|
-
const ln =
|
|
318
|
+
const ln = M("ShieldQuestion", [
|
|
328
319
|
[
|
|
329
320
|
"path",
|
|
330
321
|
{
|
|
@@ -341,19 +332,7 @@ const ln = z("ShieldQuestion", [
|
|
|
341
332
|
* This source code is licensed under the ISC license.
|
|
342
333
|
* See the LICENSE file in the root directory of this source tree.
|
|
343
334
|
*/
|
|
344
|
-
const
|
|
345
|
-
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
346
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
347
|
-
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
348
|
-
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
349
|
-
]);
|
|
350
|
-
/**
|
|
351
|
-
* @license lucide-react v0.379.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/
|
|
356
|
-
const on = z("Tag", [
|
|
335
|
+
const on = M("Tag", [
|
|
357
336
|
[
|
|
358
337
|
"path",
|
|
359
338
|
{
|
|
@@ -369,7 +348,7 @@ const on = z("Tag", [
|
|
|
369
348
|
* This source code is licensed under the ISC license.
|
|
370
349
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
350
|
*/
|
|
372
|
-
const cn =
|
|
351
|
+
const cn = M("ToggleLeft", [
|
|
373
352
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
374
353
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
375
354
|
]);
|
|
@@ -379,7 +358,7 @@ const cn = z("ToggleLeft", [
|
|
|
379
358
|
* This source code is licensed under the ISC license.
|
|
380
359
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
360
|
*/
|
|
382
|
-
const dn =
|
|
361
|
+
const dn = M("Type", [
|
|
383
362
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
384
363
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
385
364
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -390,16 +369,16 @@ const dn = z("Type", [
|
|
|
390
369
|
* This source code is licensed under the ISC license.
|
|
391
370
|
* See the LICENSE file in the root directory of this source tree.
|
|
392
371
|
*/
|
|
393
|
-
const hn =
|
|
372
|
+
const hn = M("User", [
|
|
394
373
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
395
374
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
396
375
|
]);
|
|
397
376
|
function un() {
|
|
398
|
-
const [s, n] =
|
|
377
|
+
const [s, n] = z(""), [t, a] = z(!1), [i, o] = z(!1), r = S((c) => c.dashboard);
|
|
399
378
|
function d() {
|
|
400
379
|
const c = $s(r), m = ze(r.id), h = JSON.parse(localStorage.getItem(m) || "[]");
|
|
401
380
|
if (h.some(
|
|
402
|
-
(
|
|
381
|
+
(g) => g.name === s
|
|
403
382
|
)) {
|
|
404
383
|
a(!0);
|
|
405
384
|
return;
|
|
@@ -428,9 +407,9 @@ function un() {
|
|
|
428
407
|
/* @__PURE__ */ e.jsx(us, { children: "Lenses are private by default and are only visible to you." })
|
|
429
408
|
] }),
|
|
430
409
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
431
|
-
/* @__PURE__ */ e.jsx(
|
|
410
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
|
|
432
411
|
/* @__PURE__ */ e.jsx(
|
|
433
|
-
|
|
412
|
+
W,
|
|
434
413
|
{
|
|
435
414
|
value: s,
|
|
436
415
|
onChange: (c) => {
|
|
@@ -456,15 +435,15 @@ function un() {
|
|
|
456
435
|
] });
|
|
457
436
|
}
|
|
458
437
|
function mn() {
|
|
459
|
-
const [s, n] =
|
|
438
|
+
const [s, n] = z(!1), [t, a] = z(""), i = S((f) => f.dashboard), o = S((f) => f.bookmarkKey), [r, d] = z([]), c = S((f) => f.actions.setDashboard), m = S(
|
|
460
439
|
(f) => f.actions.setFilterValues
|
|
461
440
|
), h = S(
|
|
462
441
|
(f) => f.actions.setBookmarkKey
|
|
463
442
|
);
|
|
464
|
-
|
|
465
|
-
const f = ze(i.id),
|
|
466
|
-
d(
|
|
467
|
-
const C =
|
|
443
|
+
$(() => {
|
|
444
|
+
const f = ze(i.id), j = JSON.parse(localStorage.getItem(f) || "[]");
|
|
445
|
+
d(j);
|
|
446
|
+
const C = j.find(
|
|
468
447
|
(v) => v.default
|
|
469
448
|
);
|
|
470
449
|
C && C.name === o && a(C.name);
|
|
@@ -472,14 +451,14 @@ function mn() {
|
|
|
472
451
|
function u(f) {
|
|
473
452
|
if (f === t)
|
|
474
453
|
return;
|
|
475
|
-
const
|
|
476
|
-
C && (c(C), m(
|
|
454
|
+
const j = r.find((v) => v.name === f), C = j == null ? void 0 : j.template;
|
|
455
|
+
C && (c(C), m(j.filterValues || []), h(f === "Original" ? "" : f)), a(f);
|
|
477
456
|
}
|
|
478
|
-
function
|
|
479
|
-
const
|
|
480
|
-
(
|
|
457
|
+
function g(f) {
|
|
458
|
+
const j = ze(i.id), v = JSON.parse(localStorage.getItem(j) || "[]").filter(
|
|
459
|
+
(b) => b.name !== f
|
|
481
460
|
);
|
|
482
|
-
localStorage.setItem(
|
|
461
|
+
localStorage.setItem(j, JSON.stringify(v)), d(v);
|
|
483
462
|
}
|
|
484
463
|
return /* @__PURE__ */ e.jsxs(Et, { open: s, onOpenChange: n, children: [
|
|
485
464
|
/* @__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 }) }) }),
|
|
@@ -493,7 +472,7 @@ function mn() {
|
|
|
493
472
|
onValueChange: u,
|
|
494
473
|
children: [
|
|
495
474
|
/* @__PURE__ */ e.jsx(Os, { value: "Original", children: "Original" }),
|
|
496
|
-
r.filter((f) => f.name != "Original").map((f,
|
|
475
|
+
r.filter((f) => f.name != "Original").map((f, j) => /* @__PURE__ */ e.jsxs(
|
|
497
476
|
Os,
|
|
498
477
|
{
|
|
499
478
|
className: "xbg-red-100 flex justify-between",
|
|
@@ -505,7 +484,7 @@ function mn() {
|
|
|
505
484
|
Le,
|
|
506
485
|
{
|
|
507
486
|
onClick: (C) => {
|
|
508
|
-
C.preventDefault(),
|
|
487
|
+
C.preventDefault(), g(f.name);
|
|
509
488
|
},
|
|
510
489
|
className: "h-3 w-3 hover:cursor-pointer",
|
|
511
490
|
strokeWidth: 1.5
|
|
@@ -513,7 +492,7 @@ function mn() {
|
|
|
513
492
|
)
|
|
514
493
|
]
|
|
515
494
|
},
|
|
516
|
-
|
|
495
|
+
j
|
|
517
496
|
))
|
|
518
497
|
]
|
|
519
498
|
}
|
|
@@ -522,8 +501,8 @@ function mn() {
|
|
|
522
501
|
] });
|
|
523
502
|
}
|
|
524
503
|
function xn() {
|
|
525
|
-
const [s, n] =
|
|
526
|
-
|
|
504
|
+
const [s, n] = z(!1), t = S((o) => o.dashboard), a = S((o) => o.bookmarkKey);
|
|
505
|
+
$(() => {
|
|
527
506
|
if (!a) {
|
|
528
507
|
n(!1);
|
|
529
508
|
return;
|
|
@@ -563,22 +542,22 @@ function xn() {
|
|
|
563
542
|
] });
|
|
564
543
|
}
|
|
565
544
|
function pn() {
|
|
566
|
-
const s = S((
|
|
567
|
-
S((
|
|
545
|
+
const s = S((b) => b.bookmarkKey), n = S((b) => b.dashboard);
|
|
546
|
+
S((b) => b.selectedSheetId);
|
|
568
547
|
const t = S(
|
|
569
|
-
(
|
|
570
|
-
), a = S((
|
|
548
|
+
(b) => b.isDashboardEditing
|
|
549
|
+
), a = S((b) => b.filterValues), i = S((b) => b.isVisualEditing), o = S((b) => b.showFilters);
|
|
571
550
|
S(
|
|
572
|
-
(
|
|
551
|
+
(b) => b.showDashboardJSON
|
|
573
552
|
);
|
|
574
|
-
const r = S((
|
|
575
|
-
(
|
|
553
|
+
const r = S((b) => b.onSaveFunction), d = S(
|
|
554
|
+
(b) => b.actions.setShowFilters
|
|
576
555
|
), { addFrame: c, setSelectedFrameId: m } = S(
|
|
577
|
-
(
|
|
578
|
-
), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON:
|
|
556
|
+
(b) => b.actions
|
|
557
|
+
), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON: g } = S((b) => b.actions), f = h(), j = () => {
|
|
579
558
|
if (!t || !f)
|
|
580
559
|
return;
|
|
581
|
-
const
|
|
560
|
+
const b = {
|
|
582
561
|
id: $e(),
|
|
583
562
|
title: "Title",
|
|
584
563
|
description: "Description",
|
|
@@ -595,8 +574,8 @@ function pn() {
|
|
|
595
574
|
data: []
|
|
596
575
|
}, E = {
|
|
597
576
|
id: $e(),
|
|
598
|
-
cards: [
|
|
599
|
-
activeCardId:
|
|
577
|
+
cards: [b],
|
|
578
|
+
activeCardId: b.id
|
|
600
579
|
};
|
|
601
580
|
c(f.id, E), m(E.id);
|
|
602
581
|
}, C = () => {
|
|
@@ -605,19 +584,19 @@ function pn() {
|
|
|
605
584
|
function v() {
|
|
606
585
|
if (!s || s === "")
|
|
607
586
|
return;
|
|
608
|
-
const
|
|
609
|
-
(
|
|
587
|
+
const b = $s(n), E = ze(n.id), T = JSON.parse(localStorage.getItem(E) || "[]"), O = T.findIndex(
|
|
588
|
+
(y) => y.name === s
|
|
610
589
|
);
|
|
611
|
-
|
|
590
|
+
O !== -1 ? T[O] = {
|
|
612
591
|
name: s,
|
|
613
|
-
template:
|
|
614
|
-
default: T[
|
|
592
|
+
template: b,
|
|
593
|
+
default: T[O].default,
|
|
615
594
|
filterValues: a
|
|
616
595
|
} : T.push({
|
|
617
596
|
name: s,
|
|
618
|
-
template:
|
|
597
|
+
template: b,
|
|
619
598
|
filterValues: a
|
|
620
|
-
}), localStorage.setItem(E, JSON.stringify(T)), r == null || r(
|
|
599
|
+
}), localStorage.setItem(E, JSON.stringify(T)), r == null || r(b);
|
|
621
600
|
}
|
|
622
601
|
return i ? null : /* @__PURE__ */ e.jsxs(
|
|
623
602
|
"div",
|
|
@@ -626,7 +605,7 @@ function pn() {
|
|
|
626
605
|
role: "dashboard-controls",
|
|
627
606
|
children: [
|
|
628
607
|
!i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
629
|
-
/* @__PURE__ */ e.jsx(
|
|
608
|
+
/* @__PURE__ */ e.jsx(H, { children: s }),
|
|
630
609
|
!!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
631
610
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
|
|
632
611
|
/* @__PURE__ */ e.jsx(xn, {})
|
|
@@ -642,7 +621,7 @@ function pn() {
|
|
|
642
621
|
className: "h-7 p-2",
|
|
643
622
|
size: "sm",
|
|
644
623
|
disabled: !t,
|
|
645
|
-
onClick:
|
|
624
|
+
onClick: j,
|
|
646
625
|
children: [
|
|
647
626
|
/* @__PURE__ */ e.jsx(ot, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
648
627
|
"Add Frame"
|
|
@@ -666,7 +645,7 @@ function pn() {
|
|
|
666
645
|
role: "close",
|
|
667
646
|
className: "h-7 p-2",
|
|
668
647
|
onClick: () => {
|
|
669
|
-
u(!1),
|
|
648
|
+
u(!1), g(!1);
|
|
670
649
|
},
|
|
671
650
|
size: "sm",
|
|
672
651
|
children: /* @__PURE__ */ e.jsx(Le, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
@@ -720,7 +699,7 @@ function He({
|
|
|
720
699
|
if (s === "Schema")
|
|
721
700
|
return /* @__PURE__ */ e.jsx(tn, { className: "size-4" });
|
|
722
701
|
if (s === "Table")
|
|
723
|
-
return /* @__PURE__ */ e.jsx(
|
|
702
|
+
return /* @__PURE__ */ e.jsx(bs, { className: "size-4" });
|
|
724
703
|
}
|
|
725
704
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
726
705
|
c && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(We, { children: [
|
|
@@ -731,7 +710,7 @@ function He({
|
|
|
731
710
|
/* @__PURE__ */ e.jsx(
|
|
732
711
|
ps,
|
|
733
712
|
{
|
|
734
|
-
className:
|
|
713
|
+
className: K(
|
|
735
714
|
"h-9 w-[190px] focus:ring-1 focus:ring-offset-0",
|
|
736
715
|
d
|
|
737
716
|
),
|
|
@@ -745,21 +724,21 @@ function He({
|
|
|
745
724
|
),
|
|
746
725
|
/* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsxs(js, { children: [
|
|
747
726
|
a ? /* @__PURE__ */ e.jsx(Ke, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ke, { children: s }),
|
|
748
|
-
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((
|
|
727
|
+
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((g, f) => /* @__PURE__ */ e.jsx(xe, { value: g.id, children: g.name }, f)) }),
|
|
749
728
|
(a || i) && /* @__PURE__ */ e.jsx(xe, { value: h, children: h })
|
|
750
729
|
] }) })
|
|
751
730
|
] })
|
|
752
731
|
] });
|
|
753
732
|
}
|
|
754
733
|
function fn({ column: s }) {
|
|
755
|
-
const [n, t] =
|
|
734
|
+
const [n, t] = z(!1), a = l((h) => h.selectedTableName), i = l(
|
|
756
735
|
(h) => h.selectedSchemaName
|
|
757
736
|
), o = l((h) => h.sqlGen), r = l((h) => h.actions.setSqlGen), d = l((h) => h.actions.setCardSql), c = l((h) => h.actions.setRunSql);
|
|
758
737
|
function m(h, u) {
|
|
759
|
-
const
|
|
760
|
-
r(
|
|
738
|
+
const g = Ks(h, o, u);
|
|
739
|
+
r(g);
|
|
761
740
|
const f = Us(
|
|
762
|
-
|
|
741
|
+
g,
|
|
763
742
|
ce(i || ""),
|
|
764
743
|
ce(a)
|
|
765
744
|
);
|
|
@@ -836,69 +815,83 @@ function gn({
|
|
|
836
815
|
columns: t,
|
|
837
816
|
status: a
|
|
838
817
|
}) {
|
|
839
|
-
const i = l((
|
|
840
|
-
(
|
|
818
|
+
const i = l((y) => y.sqlGen), o = l(
|
|
819
|
+
(y) => y.selectedConnectionId
|
|
841
820
|
), r = l(
|
|
842
|
-
(
|
|
821
|
+
(y) => y.selectedDatabaseName
|
|
843
822
|
), d = l(
|
|
844
|
-
(
|
|
845
|
-
), c = l((
|
|
846
|
-
(
|
|
847
|
-
), { setAIScopeTables: h } = S((
|
|
848
|
-
(
|
|
849
|
-
),
|
|
850
|
-
function v(
|
|
851
|
-
const F = Ks(
|
|
852
|
-
|
|
853
|
-
const
|
|
854
|
-
|
|
823
|
+
(y) => y.selectedSchemaName
|
|
824
|
+
), c = l((y) => y.selectedTableName), m = S(
|
|
825
|
+
(y) => y.dashboard.aiScopeTables
|
|
826
|
+
), { setAIScopeTables: h } = S((y) => y.actions), u = l((y) => y.actions.setRunSql), g = l((y) => y.actions.setSqlGen), f = l(
|
|
827
|
+
(y) => y.actions.setIsShowingVisual
|
|
828
|
+
), j = l((y) => y.actions.setCardSql), { connectionType: C } = ht();
|
|
829
|
+
function v(y) {
|
|
830
|
+
const F = Ks(y, i);
|
|
831
|
+
g(F);
|
|
832
|
+
const A = Us(F, ce(s), ce(n));
|
|
833
|
+
A && (j(A), u(!0));
|
|
834
|
+
}
|
|
835
|
+
function b() {
|
|
836
|
+
return (m == null ? void 0 : m.find(
|
|
837
|
+
(y) => y.connectinonId === o && y.tableName === c
|
|
838
|
+
)) !== void 0;
|
|
855
839
|
}
|
|
856
|
-
function y
|
|
857
|
-
if (
|
|
840
|
+
function E(y) {
|
|
841
|
+
if (y === !0 && c && o) {
|
|
858
842
|
const F = {
|
|
859
843
|
connectinonId: o,
|
|
860
844
|
connectionType: C,
|
|
861
845
|
databaseName: r,
|
|
862
846
|
schemaName: d,
|
|
863
847
|
tableName: c
|
|
864
|
-
},
|
|
865
|
-
(
|
|
866
|
-
(
|
|
867
|
-
) ===
|
|
848
|
+
}, I = [...m || [], F].filter(
|
|
849
|
+
(P, U, G) => G.findIndex(
|
|
850
|
+
(L) => L.connectinonId === P.connectinonId && L.tableName === P.tableName
|
|
851
|
+
) === U
|
|
868
852
|
);
|
|
869
|
-
h(
|
|
853
|
+
h(I);
|
|
870
854
|
} else {
|
|
871
855
|
const F = (m || []).filter(
|
|
872
|
-
(
|
|
856
|
+
(A) => A.connectinonId !== o && A.tableName !== c
|
|
873
857
|
);
|
|
874
858
|
h(F);
|
|
875
859
|
}
|
|
876
860
|
}
|
|
877
|
-
function
|
|
861
|
+
function T() {
|
|
878
862
|
let F = as(s, n);
|
|
879
|
-
((
|
|
863
|
+
((I) => I.charAt(0) === I.charAt(0).toUpperCase())(n) && (F = `"${n}"`), f(!1), j(`SELECT * FROM ${F} LIMIT 10`), u(!0);
|
|
880
864
|
}
|
|
881
|
-
function
|
|
865
|
+
function O() {
|
|
882
866
|
let F = as(s, n);
|
|
883
|
-
((
|
|
867
|
+
((I) => I.charAt(0) === I.charAt(0).toUpperCase())(n) && (F = `"${n}"`), f(!1), j(`SELECT COUNT(*) FROM ${F}`), u(!0);
|
|
884
868
|
}
|
|
885
869
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-6", children: [
|
|
886
870
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
887
871
|
/* @__PURE__ */ e.jsx(
|
|
888
872
|
Js,
|
|
889
873
|
{
|
|
890
|
-
title: "Add to AI Scope
|
|
891
|
-
|
|
874
|
+
title: `${b() ? "Remove from" : "Add to"} AI Scope`,
|
|
875
|
+
pressed: b(),
|
|
876
|
+
onPressedChange: E,
|
|
892
877
|
variant: "outline",
|
|
893
878
|
className: "h-9 px-2",
|
|
894
|
-
children: /* @__PURE__ */ e.jsx(
|
|
879
|
+
children: /* @__PURE__ */ e.jsx(
|
|
880
|
+
Ut,
|
|
881
|
+
{
|
|
882
|
+
className: K("size-4", {
|
|
883
|
+
"text-primary": b(),
|
|
884
|
+
"text-muted-foreground": !b()
|
|
885
|
+
})
|
|
886
|
+
}
|
|
887
|
+
)
|
|
895
888
|
}
|
|
896
889
|
),
|
|
897
890
|
/* @__PURE__ */ e.jsxs(
|
|
898
891
|
w,
|
|
899
892
|
{
|
|
900
893
|
disabled: a !== "Success",
|
|
901
|
-
onClick:
|
|
894
|
+
onClick: T,
|
|
902
895
|
size: "sm",
|
|
903
896
|
variant: "secondary",
|
|
904
897
|
className: "flex w-full",
|
|
@@ -912,7 +905,7 @@ function gn({
|
|
|
912
905
|
w,
|
|
913
906
|
{
|
|
914
907
|
disabled: a !== "Success",
|
|
915
|
-
onClick:
|
|
908
|
+
onClick: O,
|
|
916
909
|
size: "sm",
|
|
917
910
|
variant: "secondary",
|
|
918
911
|
className: "flex w-full",
|
|
@@ -924,36 +917,36 @@ function gn({
|
|
|
924
917
|
)
|
|
925
918
|
] }),
|
|
926
919
|
/* @__PURE__ */ e.jsxs(
|
|
927
|
-
|
|
920
|
+
ys,
|
|
928
921
|
{
|
|
929
922
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
930
923
|
children: [
|
|
931
|
-
t == null ? void 0 : t.map((
|
|
924
|
+
t == null ? void 0 : t.map((y) => /* @__PURE__ */ e.jsxs(
|
|
932
925
|
"div",
|
|
933
926
|
{
|
|
934
|
-
onClick: () => v(
|
|
935
|
-
className:
|
|
927
|
+
onClick: () => v(y),
|
|
928
|
+
className: K(
|
|
936
929
|
"mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
937
930
|
{
|
|
938
|
-
"bg-muted":
|
|
931
|
+
"bg-muted": Gt(y, i)
|
|
939
932
|
}
|
|
940
933
|
),
|
|
941
934
|
children: [
|
|
942
935
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
943
|
-
/* @__PURE__ */ e.jsx(dt, { column:
|
|
944
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
936
|
+
/* @__PURE__ */ e.jsx(dt, { column: y }),
|
|
937
|
+
/* @__PURE__ */ e.jsx("span", { children: y.column_name })
|
|
945
938
|
] }),
|
|
946
|
-
Gs.includes(
|
|
939
|
+
Gs.includes(y.data_type) && /* @__PURE__ */ e.jsx(
|
|
947
940
|
"div",
|
|
948
941
|
{
|
|
949
942
|
onClick: (F) => F.stopPropagation(),
|
|
950
943
|
className: "flex items-center justify-end",
|
|
951
|
-
children: /* @__PURE__ */ e.jsx(fn, { column:
|
|
944
|
+
children: /* @__PURE__ */ e.jsx(fn, { column: y })
|
|
952
945
|
}
|
|
953
946
|
)
|
|
954
947
|
]
|
|
955
948
|
},
|
|
956
|
-
|
|
949
|
+
y.column_name
|
|
957
950
|
)),
|
|
958
951
|
/* @__PURE__ */ e.jsx(zs, { orientation: "vertical" }),
|
|
959
952
|
/* @__PURE__ */ e.jsx(zs, { orientation: "horizontal" })
|
|
@@ -964,7 +957,7 @@ function gn({
|
|
|
964
957
|
}
|
|
965
958
|
function ht(s, n) {
|
|
966
959
|
var Xe, be, _e, Ae;
|
|
967
|
-
let t =
|
|
960
|
+
let t = Ha(() => [], []);
|
|
968
961
|
const a = Ye().authToken || s, i = l(
|
|
969
962
|
(N) => N.selectedConnectionId
|
|
970
963
|
), o = l(
|
|
@@ -979,10 +972,10 @@ function ht(s, n) {
|
|
|
979
972
|
(N) => N.actions.setSelectedDatabaseName
|
|
980
973
|
), u = l(
|
|
981
974
|
(N) => N.actions.setSelectedSchemaName
|
|
982
|
-
),
|
|
975
|
+
), g = l(
|
|
983
976
|
(N) => N.actions.setSelectedTableName
|
|
984
977
|
), f = l((N) => N.actions.setCardSql);
|
|
985
|
-
function
|
|
978
|
+
function j(N) {
|
|
986
979
|
return i && o && r && o !== "NA" ? !0 : i && N === "API" ? !1 : !!(i && N === "S3");
|
|
987
980
|
}
|
|
988
981
|
function C(N) {
|
|
@@ -992,7 +985,7 @@ function ht(s, n) {
|
|
|
992
985
|
return i && N ? !(N === "API" || N === "S3") : !1;
|
|
993
986
|
}
|
|
994
987
|
const {
|
|
995
|
-
data:
|
|
988
|
+
data: b,
|
|
996
989
|
isLoading: E,
|
|
997
990
|
isError: T
|
|
998
991
|
} = Ne({
|
|
@@ -1003,14 +996,14 @@ function ht(s, n) {
|
|
|
1003
996
|
),
|
|
1004
997
|
enabled: !!(a != null && a.accessToken)
|
|
1005
998
|
// Only fetch if authToken is present
|
|
1006
|
-
}),
|
|
999
|
+
}), O = b == null ? void 0 : b.connections.find(
|
|
1007
1000
|
(N) => N.id === i
|
|
1008
|
-
),
|
|
1001
|
+
), y = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
|
|
1009
1002
|
data: A,
|
|
1010
|
-
isLoading:
|
|
1011
|
-
isFetching:
|
|
1003
|
+
isLoading: I,
|
|
1004
|
+
isFetching: P,
|
|
1012
1005
|
isError: U,
|
|
1013
|
-
refetch:
|
|
1006
|
+
refetch: G
|
|
1014
1007
|
} = Ne({
|
|
1015
1008
|
queryKey: ["databases", i],
|
|
1016
1009
|
queryFn: () => Fe(
|
|
@@ -1020,12 +1013,12 @@ function ht(s, n) {
|
|
|
1020
1013
|
connection_id: i
|
|
1021
1014
|
}
|
|
1022
1015
|
),
|
|
1023
|
-
enabled: v(
|
|
1016
|
+
enabled: v(y)
|
|
1024
1017
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1025
1018
|
}), {
|
|
1026
|
-
data:
|
|
1019
|
+
data: L,
|
|
1027
1020
|
isLoading: ee,
|
|
1028
|
-
isFetching:
|
|
1021
|
+
isFetching: Y,
|
|
1029
1022
|
isError: se,
|
|
1030
1023
|
refetch: Z
|
|
1031
1024
|
} = Ne({
|
|
@@ -1038,14 +1031,14 @@ function ht(s, n) {
|
|
|
1038
1031
|
database_name: o
|
|
1039
1032
|
}
|
|
1040
1033
|
),
|
|
1041
|
-
enabled: !!i && !!o && !
|
|
1034
|
+
enabled: !!i && !!o && !F && o !== "NA"
|
|
1042
1035
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1043
1036
|
}), {
|
|
1044
|
-
data:
|
|
1045
|
-
isLoading:
|
|
1037
|
+
data: J,
|
|
1038
|
+
isLoading: D,
|
|
1046
1039
|
isFetching: x,
|
|
1047
1040
|
isError: k,
|
|
1048
|
-
refetch:
|
|
1041
|
+
refetch: _
|
|
1049
1042
|
} = Ne({
|
|
1050
1043
|
queryKey: [
|
|
1051
1044
|
"tables",
|
|
@@ -1062,9 +1055,9 @@ function ht(s, n) {
|
|
|
1062
1055
|
schema_name: r
|
|
1063
1056
|
}
|
|
1064
1057
|
),
|
|
1065
|
-
enabled:
|
|
1058
|
+
enabled: j(y)
|
|
1066
1059
|
}), {
|
|
1067
|
-
data:
|
|
1060
|
+
data: B,
|
|
1068
1061
|
isLoading: he,
|
|
1069
1062
|
isFetching: te,
|
|
1070
1063
|
isError: pe
|
|
@@ -1086,7 +1079,7 @@ function ht(s, n) {
|
|
|
1086
1079
|
table_name: d
|
|
1087
1080
|
}
|
|
1088
1081
|
),
|
|
1089
|
-
enabled: C(
|
|
1082
|
+
enabled: C(y)
|
|
1090
1083
|
// (!!selectedConnectionId &&
|
|
1091
1084
|
// !!selectedDatabaseName &&
|
|
1092
1085
|
// !!selectedSchemaName &&
|
|
@@ -1095,32 +1088,32 @@ function ht(s, n) {
|
|
|
1095
1088
|
//currentConnection?.type === 'API',
|
|
1096
1089
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1097
1090
|
});
|
|
1098
|
-
|
|
1091
|
+
$(() => {
|
|
1099
1092
|
c(t);
|
|
1100
|
-
}, [
|
|
1093
|
+
}, [B, c, t]), $(() => {
|
|
1101
1094
|
}, [
|
|
1102
|
-
|
|
1095
|
+
F,
|
|
1103
1096
|
f,
|
|
1104
|
-
|
|
1097
|
+
g,
|
|
1105
1098
|
u,
|
|
1106
1099
|
h,
|
|
1107
|
-
|
|
1100
|
+
O
|
|
1108
1101
|
]);
|
|
1109
|
-
const fe = (
|
|
1102
|
+
const fe = (O == null ? void 0 : O.type) === "API" ? (Xe = O == null ? void 0 : O.type) == null ? void 0 : Xe.toLowerCase() : d || "", ge = F ? "" : r || "";
|
|
1110
1103
|
function ue(N) {
|
|
1111
|
-
u(N),
|
|
1104
|
+
u(N), g("");
|
|
1112
1105
|
}
|
|
1113
|
-
function
|
|
1114
|
-
h(N), u(""),
|
|
1106
|
+
function Q(N) {
|
|
1107
|
+
h(N), u(""), g("");
|
|
1115
1108
|
}
|
|
1116
1109
|
function ae(N) {
|
|
1117
1110
|
m(N);
|
|
1118
1111
|
}
|
|
1119
|
-
A && ((be = A == null ? void 0 : A.databases) == null ? void 0 : be.length) > 0,
|
|
1112
|
+
A && ((be = A == null ? void 0 : A.databases) == null ? void 0 : be.length) > 0, L && ((_e = L == null ? void 0 : L.schemas) == null ? void 0 : _e.length) > 0, B && ((Ae = B == null ? void 0 : B.columns) == null ? void 0 : Ae.length) > 0 && (t = B.columns.map((N) => ({
|
|
1120
1113
|
...N,
|
|
1121
1114
|
data_type: N.data_type.toLowerCase()
|
|
1122
1115
|
}))), U && (t = []), (pe || T) && (t = []);
|
|
1123
|
-
const ne =
|
|
1116
|
+
const ne = b == null ? void 0 : b.connections.map(
|
|
1124
1117
|
(N) => ({
|
|
1125
1118
|
id: N.id,
|
|
1126
1119
|
name: N.name,
|
|
@@ -1129,10 +1122,10 @@ function ht(s, n) {
|
|
|
1129
1122
|
), je = A == null ? void 0 : A.databases.map((N) => ({
|
|
1130
1123
|
id: N.database_name,
|
|
1131
1124
|
name: N.database_name
|
|
1132
|
-
})), ke =
|
|
1125
|
+
})), ke = L == null ? void 0 : L.schemas.map((N) => ({
|
|
1133
1126
|
id: N.schema_name,
|
|
1134
1127
|
name: N.schema_name
|
|
1135
|
-
})), Te =
|
|
1128
|
+
})), Te = J == null ? void 0 : J.tables.map((N) => ({
|
|
1136
1129
|
id: N.table_name,
|
|
1137
1130
|
name: N.table_name
|
|
1138
1131
|
}));
|
|
@@ -1141,38 +1134,38 @@ function ht(s, n) {
|
|
|
1141
1134
|
isConnectionsLoading: E,
|
|
1142
1135
|
isConnectionsError: T,
|
|
1143
1136
|
databaseItems: je,
|
|
1144
|
-
isDatabasesLoadingOrFetching:
|
|
1137
|
+
isDatabasesLoadingOrFetching: I || P,
|
|
1145
1138
|
isDatabaseError: U,
|
|
1146
1139
|
schemaItems: ke,
|
|
1147
|
-
isSchemaLoadingOrFetching: ee ||
|
|
1140
|
+
isSchemaLoadingOrFetching: ee || Y,
|
|
1148
1141
|
isSchemaError: se,
|
|
1149
1142
|
tableItems: Te,
|
|
1150
|
-
isTableLoadingOrFetching:
|
|
1143
|
+
isTableLoadingOrFetching: D || x,
|
|
1151
1144
|
isTableError: k,
|
|
1152
1145
|
columns: t,
|
|
1153
1146
|
isColumnsLoadingOrFetching: he || te,
|
|
1154
1147
|
isColumnsError: pe,
|
|
1155
|
-
isNonDbConnection:
|
|
1156
|
-
connectionType:
|
|
1148
|
+
isNonDbConnection: F,
|
|
1149
|
+
connectionType: y,
|
|
1157
1150
|
tableName: fe,
|
|
1158
1151
|
schemaName: ge,
|
|
1159
1152
|
handleConnectionChange: ae,
|
|
1160
|
-
handleDatabaseChange:
|
|
1153
|
+
handleDatabaseChange: Q,
|
|
1161
1154
|
handleSchemaChange: ue
|
|
1162
1155
|
};
|
|
1163
1156
|
}
|
|
1164
1157
|
function ut({
|
|
1165
1158
|
ColumnsComponent: s
|
|
1166
1159
|
}) {
|
|
1167
|
-
var
|
|
1160
|
+
var J;
|
|
1168
1161
|
const n = l(
|
|
1169
|
-
(
|
|
1162
|
+
(D) => D.selectedConnectionId
|
|
1170
1163
|
), t = l(
|
|
1171
|
-
(
|
|
1164
|
+
(D) => D.selectedDatabaseName
|
|
1172
1165
|
), a = l(
|
|
1173
|
-
(
|
|
1174
|
-
), i = l((
|
|
1175
|
-
(
|
|
1166
|
+
(D) => D.selectedSchemaName
|
|
1167
|
+
), i = l((D) => D.selectedTableName), o = l(
|
|
1168
|
+
(D) => D.actions.setSelectedTableName
|
|
1176
1169
|
), {
|
|
1177
1170
|
connectionItems: r,
|
|
1178
1171
|
schemaItems: d,
|
|
@@ -1180,43 +1173,43 @@ function ut({
|
|
|
1180
1173
|
tableItems: m,
|
|
1181
1174
|
columns: h,
|
|
1182
1175
|
isConnectionsLoading: u,
|
|
1183
|
-
isConnectionsError:
|
|
1176
|
+
isConnectionsError: g,
|
|
1184
1177
|
isDatabasesLoadingOrFetching: f,
|
|
1185
|
-
isDatabaseError:
|
|
1178
|
+
isDatabaseError: j,
|
|
1186
1179
|
isSchemaLoadingOrFetching: C,
|
|
1187
1180
|
isSchemaError: v,
|
|
1188
|
-
isColumnsError:
|
|
1181
|
+
isColumnsError: b,
|
|
1189
1182
|
isColumnsLoadingOrFetching: E,
|
|
1190
1183
|
isTableLoadingOrFetching: T,
|
|
1191
|
-
isTableError:
|
|
1192
|
-
connectionType:
|
|
1193
|
-
isNonDbConnection:
|
|
1184
|
+
isTableError: O,
|
|
1185
|
+
connectionType: y,
|
|
1186
|
+
isNonDbConnection: F,
|
|
1194
1187
|
handleConnectionChange: A,
|
|
1195
|
-
handleDatabaseChange:
|
|
1196
|
-
handleSchemaChange:
|
|
1188
|
+
handleDatabaseChange: I,
|
|
1189
|
+
handleSchemaChange: P,
|
|
1197
1190
|
tableName: U,
|
|
1198
|
-
schemaName:
|
|
1191
|
+
schemaName: G
|
|
1199
1192
|
} = ht();
|
|
1200
|
-
function
|
|
1201
|
-
return s ? s(
|
|
1193
|
+
function L() {
|
|
1194
|
+
return s ? s(G, U, h) : /* @__PURE__ */ e.jsx(
|
|
1202
1195
|
gn,
|
|
1203
1196
|
{
|
|
1204
|
-
schemaName:
|
|
1197
|
+
schemaName: G,
|
|
1205
1198
|
tableName: U,
|
|
1206
1199
|
columns: h,
|
|
1207
|
-
status: E ? "Loading..." :
|
|
1200
|
+
status: E ? "Loading..." : b ? "Error" : "Success"
|
|
1208
1201
|
}
|
|
1209
1202
|
);
|
|
1210
1203
|
}
|
|
1211
1204
|
function ee() {
|
|
1212
1205
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1213
1206
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return
|
|
1207
|
+
function Y() {
|
|
1208
|
+
return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1216
1209
|
He,
|
|
1217
1210
|
{
|
|
1218
|
-
onChange:
|
|
1219
|
-
isError:
|
|
1211
|
+
onChange: I,
|
|
1212
|
+
isError: j,
|
|
1220
1213
|
isLoading: f,
|
|
1221
1214
|
items: c,
|
|
1222
1215
|
value: t || "",
|
|
@@ -1225,10 +1218,10 @@ function ut({
|
|
|
1225
1218
|
);
|
|
1226
1219
|
}
|
|
1227
1220
|
function se() {
|
|
1228
|
-
return
|
|
1221
|
+
return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1229
1222
|
He,
|
|
1230
1223
|
{
|
|
1231
|
-
onChange:
|
|
1224
|
+
onChange: P,
|
|
1232
1225
|
isError: v,
|
|
1233
1226
|
isLoading: C,
|
|
1234
1227
|
items: d,
|
|
@@ -1238,11 +1231,11 @@ function ut({
|
|
|
1238
1231
|
);
|
|
1239
1232
|
}
|
|
1240
1233
|
function Z() {
|
|
1241
|
-
return
|
|
1234
|
+
return y === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1242
1235
|
He,
|
|
1243
1236
|
{
|
|
1244
1237
|
onChange: o,
|
|
1245
|
-
isError:
|
|
1238
|
+
isError: O,
|
|
1246
1239
|
items: m,
|
|
1247
1240
|
isLoading: T,
|
|
1248
1241
|
value: i || "",
|
|
@@ -1260,17 +1253,17 @@ function ut({
|
|
|
1260
1253
|
value: n || "",
|
|
1261
1254
|
onChange: A,
|
|
1262
1255
|
isLoading: u,
|
|
1263
|
-
isError:
|
|
1264
|
-
connectionTooltip: ((
|
|
1265
|
-
(
|
|
1266
|
-
)) == null ? void 0 :
|
|
1256
|
+
isError: g,
|
|
1257
|
+
connectionTooltip: ((J = r == null ? void 0 : r.find(
|
|
1258
|
+
(D) => D.id === n
|
|
1259
|
+
)) == null ? void 0 : J.type) || ""
|
|
1267
1260
|
}
|
|
1268
1261
|
),
|
|
1269
|
-
|
|
1262
|
+
Y(),
|
|
1270
1263
|
se(),
|
|
1271
1264
|
Z()
|
|
1272
1265
|
] }),
|
|
1273
|
-
|
|
1266
|
+
L(),
|
|
1274
1267
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1275
1268
|
w,
|
|
1276
1269
|
{
|
|
@@ -1290,22 +1283,22 @@ const rs = ({
|
|
|
1290
1283
|
className: s,
|
|
1291
1284
|
...n
|
|
1292
1285
|
}) => /* @__PURE__ */ e.jsx(
|
|
1293
|
-
|
|
1286
|
+
Jt,
|
|
1294
1287
|
{
|
|
1295
|
-
className:
|
|
1288
|
+
className: K(
|
|
1296
1289
|
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
1297
1290
|
s
|
|
1298
1291
|
),
|
|
1299
1292
|
...n
|
|
1300
1293
|
}
|
|
1301
|
-
), Oe =
|
|
1294
|
+
), Oe = Qt, ls = ({
|
|
1302
1295
|
withHandle: s,
|
|
1303
1296
|
className: n,
|
|
1304
1297
|
...t
|
|
1305
1298
|
}) => /* @__PURE__ */ e.jsx(
|
|
1306
|
-
|
|
1299
|
+
Wt,
|
|
1307
1300
|
{
|
|
1308
|
-
className:
|
|
1301
|
+
className: K(
|
|
1309
1302
|
"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
1303
|
n
|
|
1311
1304
|
),
|
|
@@ -1352,7 +1345,7 @@ function bn({
|
|
|
1352
1345
|
]
|
|
1353
1346
|
}
|
|
1354
1347
|
),
|
|
1355
|
-
/* @__PURE__ */ e.jsx(
|
|
1348
|
+
/* @__PURE__ */ e.jsx(ys, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
|
|
1356
1349
|
] }) }) })
|
|
1357
1350
|
] });
|
|
1358
1351
|
}
|
|
@@ -1367,7 +1360,7 @@ function yn({
|
|
|
1367
1360
|
] });
|
|
1368
1361
|
}
|
|
1369
1362
|
function vn() {
|
|
1370
|
-
const { authToken: s } = Ye(), n = Ie(null), t = l((d) => d.applyFilters), [a, i] =
|
|
1363
|
+
const { authToken: s } = Ye(), n = Ie(null), t = l((d) => d.applyFilters), [a, i] = z(""), o = l((d) => d.filterValues), r = l((d) => d.card.sql);
|
|
1371
1364
|
return /* @__PURE__ */ e.jsxs(
|
|
1372
1365
|
Qs,
|
|
1373
1366
|
{
|
|
@@ -1394,7 +1387,7 @@ function vn() {
|
|
|
1394
1387
|
/* @__PURE__ */ e.jsx(
|
|
1395
1388
|
Xs,
|
|
1396
1389
|
{
|
|
1397
|
-
onClick: () =>
|
|
1390
|
+
onClick: () => Pt(n),
|
|
1398
1391
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1399
1392
|
}
|
|
1400
1393
|
)
|
|
@@ -1463,50 +1456,50 @@ function Cn({
|
|
|
1463
1456
|
triggerAIRun: i,
|
|
1464
1457
|
setTriggerAIRun: o
|
|
1465
1458
|
}) {
|
|
1466
|
-
const r = Ie(null), d = Ie(null), { authToken: c } = Ye(), [m, h] =
|
|
1459
|
+
const r = Ie(null), d = Ie(null), { authToken: c } = Ye(), [m, h] = z(!1), u = l((x) => x.actions.setCardSql), g = S((x) => x.dashboard.baseQueries), f = l((x) => x.actions.setRunSql), j = l((x) => x.actions.setCardType), [C, v] = z([]), b = l((x) => x.currentColumns), E = l((x) => x.card.sql), T = l((x) => x.selectedTableName), O = `
|
|
1467
1460
|
${t}
|
|
1468
1461
|
|
|
1469
1462
|
Database Query Dialect: ${T === "api" || T === "s3" ? "DuckDb" : ""}
|
|
1470
1463
|
Table Name: ${T}
|
|
1471
|
-
Table Columns: ${
|
|
1464
|
+
Table Columns: ${b == null ? void 0 : b.map((x) => `${x.column_name} | ${x.data_type}`).join(", ")}
|
|
1472
1465
|
User SQL: ${E}
|
|
1473
|
-
${
|
|
1474
|
-
Visual Query Syntax: ${Nn}`, { data:
|
|
1466
|
+
${g && `Base Queries: ${JSON.stringify(g)} `}`, y = ` 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.
|
|
1467
|
+
Visual Query Syntax: ${Nn}`, { data: F, isLoading: A, isFetching: I, isError: P, refetch: U } = Ne({
|
|
1475
1468
|
queryKey: ["ai-query"],
|
|
1476
1469
|
queryFn: () => Fe(
|
|
1477
1470
|
"https://semaphor.cloud/api/v1/ai",
|
|
1478
1471
|
(c == null ? void 0 : c.accessToken) || "",
|
|
1479
1472
|
{
|
|
1480
|
-
user_content: `userContent: ${
|
|
1473
|
+
user_content: `userContent: ${O} ${m ? y : ""}`
|
|
1481
1474
|
}
|
|
1482
1475
|
),
|
|
1483
1476
|
enabled: !1
|
|
1484
1477
|
// Do not run by default.
|
|
1485
1478
|
});
|
|
1486
|
-
function
|
|
1479
|
+
function G(x) {
|
|
1487
1480
|
if (x.toLowerCase().includes("bar"))
|
|
1488
|
-
|
|
1481
|
+
j("bar");
|
|
1489
1482
|
else if (x.toLowerCase().includes("line"))
|
|
1490
|
-
|
|
1483
|
+
j("line");
|
|
1491
1484
|
else if (x.toLowerCase().includes("bubble"))
|
|
1492
|
-
|
|
1485
|
+
j("bubble");
|
|
1493
1486
|
else if (x.toLowerCase().includes("scatter"))
|
|
1494
|
-
|
|
1487
|
+
j("scatter");
|
|
1495
1488
|
else if (x.toLowerCase().includes("stacked"))
|
|
1496
|
-
|
|
1489
|
+
j("stackedBar");
|
|
1497
1490
|
else if (x.toLowerCase().includes("pie"))
|
|
1498
|
-
|
|
1491
|
+
j("pie");
|
|
1499
1492
|
else if (x.toLowerCase().includes("donut") || x.toLowerCase().includes("doughnut"))
|
|
1500
|
-
|
|
1493
|
+
j("doughnut");
|
|
1501
1494
|
else if (x.toLowerCase().includes("radar"))
|
|
1502
|
-
|
|
1495
|
+
j("radar");
|
|
1503
1496
|
else
|
|
1504
|
-
return
|
|
1497
|
+
return j("bar"), !1;
|
|
1505
1498
|
return !0;
|
|
1506
1499
|
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
}, [
|
|
1500
|
+
$(() => {
|
|
1501
|
+
F && v((x) => [...x, { role: "ai", content: F.response }]);
|
|
1502
|
+
}, [F]), $(() => {
|
|
1510
1503
|
const x = setTimeout(() => {
|
|
1511
1504
|
var k;
|
|
1512
1505
|
d.current && (d.current.scroll({
|
|
@@ -1516,11 +1509,11 @@ function Cn({
|
|
|
1516
1509
|
}, 100);
|
|
1517
1510
|
return () => clearTimeout(x);
|
|
1518
1511
|
}, [C]);
|
|
1519
|
-
function
|
|
1520
|
-
t && (v((x) => [...x, { role: "user", content: t }]),
|
|
1512
|
+
function L() {
|
|
1513
|
+
t && (v((x) => [...x, { role: "user", content: t }]), G(t) && h(!0), a(""), U());
|
|
1521
1514
|
}
|
|
1522
|
-
|
|
1523
|
-
i && (
|
|
1515
|
+
$(() => {
|
|
1516
|
+
i && (L(), o(!1));
|
|
1524
1517
|
}, [i, o]);
|
|
1525
1518
|
const ee = {
|
|
1526
1519
|
//seleect a darker color
|
|
@@ -1530,7 +1523,7 @@ function Cn({
|
|
|
1530
1523
|
fontSize: 15,
|
|
1531
1524
|
// padding: '5px',
|
|
1532
1525
|
width: "100%"
|
|
1533
|
-
},
|
|
1526
|
+
}, Y = {
|
|
1534
1527
|
// background: '#f6f8fa',
|
|
1535
1528
|
// color: '#000',
|
|
1536
1529
|
fontFamily: "monospace",
|
|
@@ -1551,20 +1544,20 @@ function Cn({
|
|
|
1551
1544
|
// Override how paragraphs are rendered
|
|
1552
1545
|
p: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("p", { style: ee, ...k }),
|
|
1553
1546
|
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:
|
|
1547
|
+
pre: ({ node: x, ...k }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Y, children: [
|
|
1555
1548
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: k.children }),
|
|
1556
1549
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1557
|
-
/* @__PURE__ */ e.jsx(w, { onClick:
|
|
1550
|
+
/* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Xs, {}) }),
|
|
1558
1551
|
/* @__PURE__ */ e.jsx(
|
|
1559
1552
|
w,
|
|
1560
1553
|
{
|
|
1561
|
-
onClick: (
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1554
|
+
onClick: (_) => {
|
|
1555
|
+
const B = J(_);
|
|
1556
|
+
B && (n(!1), u(B), f(!0));
|
|
1564
1557
|
},
|
|
1565
1558
|
size: "sm",
|
|
1566
1559
|
variant: "outline",
|
|
1567
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1560
|
+
children: /* @__PURE__ */ e.jsx(Zt, {})
|
|
1568
1561
|
}
|
|
1569
1562
|
)
|
|
1570
1563
|
] })
|
|
@@ -1572,14 +1565,14 @@ function Cn({
|
|
|
1572
1565
|
li: ({ node: x, ...k }) => /* @__PURE__ */ e.jsx("li", { style: se, ...k })
|
|
1573
1566
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1574
1567
|
};
|
|
1575
|
-
function
|
|
1568
|
+
function J(x) {
|
|
1576
1569
|
const k = x.currentTarget.closest("pre");
|
|
1577
1570
|
if (!k)
|
|
1578
1571
|
return;
|
|
1579
|
-
const
|
|
1580
|
-
return navigator.clipboard.writeText(
|
|
1572
|
+
const _ = k.textContent || k.innerText;
|
|
1573
|
+
return navigator.clipboard.writeText(_).then(() => console.log("Text copied to clipboard")).catch((B) => console.error("Error in copying text: ", B)), _;
|
|
1581
1574
|
}
|
|
1582
|
-
function
|
|
1575
|
+
function D() {
|
|
1583
1576
|
return C == null ? void 0 : C.map((x, k) => x.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1584
1577
|
"div",
|
|
1585
1578
|
{
|
|
@@ -1591,11 +1584,11 @@ function Cn({
|
|
|
1591
1584
|
},
|
|
1592
1585
|
k
|
|
1593
1586
|
) : x.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1594
|
-
|
|
1587
|
+
Xt,
|
|
1595
1588
|
{
|
|
1596
1589
|
className: "w-full overflow-auto py-1",
|
|
1597
1590
|
components: Z,
|
|
1598
|
-
children:
|
|
1591
|
+
children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
|
|
1599
1592
|
},
|
|
1600
1593
|
k
|
|
1601
1594
|
) : /* @__PURE__ */ e.jsx("div", {}, k));
|
|
@@ -1624,7 +1617,7 @@ function Cn({
|
|
|
1624
1617
|
{
|
|
1625
1618
|
ref: d,
|
|
1626
1619
|
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:
|
|
1620
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: D() })
|
|
1628
1621
|
}
|
|
1629
1622
|
),
|
|
1630
1623
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1637,17 +1630,17 @@ function Cn({
|
|
|
1637
1630
|
autoFocus: !0,
|
|
1638
1631
|
ref: r,
|
|
1639
1632
|
onKeyDown: (x) => {
|
|
1640
|
-
x.key === "Enter" && !x.shiftKey && (x.preventDefault(), a(""),
|
|
1633
|
+
x.key === "Enter" && !x.shiftKey && (x.preventDefault(), a(""), L());
|
|
1641
1634
|
},
|
|
1642
1635
|
placeholder: "Type your question here...",
|
|
1643
1636
|
onFocus: (x) => {
|
|
1644
|
-
const k = x.target,
|
|
1645
|
-
k.setSelectionRange(
|
|
1637
|
+
const k = x.target, _ = k.value.length;
|
|
1638
|
+
k.setSelectionRange(_, _);
|
|
1646
1639
|
},
|
|
1647
|
-
className:
|
|
1640
|
+
className: K(
|
|
1648
1641
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1649
1642
|
),
|
|
1650
|
-
disabled: A ||
|
|
1643
|
+
disabled: A || I,
|
|
1651
1644
|
value: t,
|
|
1652
1645
|
onChange: (x) => a(x.target.value)
|
|
1653
1646
|
}
|
|
@@ -1659,8 +1652,8 @@ function Cn({
|
|
|
1659
1652
|
className: "h-8",
|
|
1660
1653
|
size: "sm",
|
|
1661
1654
|
variant: "ghost",
|
|
1662
|
-
onClick:
|
|
1663
|
-
children: !A &&
|
|
1655
|
+
onClick: L,
|
|
1656
|
+
children: !A && !I ? /* @__PURE__ */ e.jsx(Yt, {}) : /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1664
1657
|
}
|
|
1665
1658
|
)
|
|
1666
1659
|
] })
|
|
@@ -1784,33 +1777,33 @@ function Tn(s) {
|
|
|
1784
1777
|
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
1778
|
}
|
|
1786
1779
|
function An() {
|
|
1787
|
-
const { theme: s } =
|
|
1780
|
+
const { theme: s } = ea(), n = Ie(), t = Ie(), [a, i] = z(!1), [o, r] = z(!1), [d, c] = z(!1), [m, h] = z(""), [u, g] = z(!1), { authToken: f } = Ye();
|
|
1788
1781
|
S((p) => p.selectedSheetId);
|
|
1789
|
-
const
|
|
1782
|
+
const j = S((p) => p.dashboard.baseQueries), C = l((p) => p.card), v = S((p) => p.theme), b = l((p) => p.isShowingVisual), E = l(
|
|
1790
1783
|
(p) => p.selectedConnectionId
|
|
1791
1784
|
), T = l(
|
|
1792
1785
|
(p) => p.selectedDatabaseName
|
|
1793
|
-
),
|
|
1786
|
+
), O = l(
|
|
1794
1787
|
(p) => p.selectedSchemaName
|
|
1795
1788
|
);
|
|
1796
1789
|
S(
|
|
1797
1790
|
(p) => p.actions.updateFrameCard
|
|
1798
1791
|
);
|
|
1799
|
-
const
|
|
1792
|
+
const y = l((p) => p.selectedTableName), F = l((p) => p.card.sql), A = l((p) => p.card.python), I = sa(F, j), P = l((p) => p.selectedConnectionId), U = l((p) => p.frame), G = l((p) => p.filterValues), L = l((p) => p.applyFilters), {
|
|
1800
1793
|
setCardCustomCfg: ee,
|
|
1801
|
-
setQueryResultColumns:
|
|
1794
|
+
setQueryResultColumns: Y,
|
|
1802
1795
|
setFilterValues: se,
|
|
1803
1796
|
setCardSql: Z,
|
|
1804
|
-
setCardPython:
|
|
1805
|
-
setQueryError:
|
|
1797
|
+
setCardPython: J,
|
|
1798
|
+
setQueryError: D,
|
|
1806
1799
|
setPythonStdOut: x,
|
|
1807
1800
|
setCardPreferences: k
|
|
1808
|
-
} = l((p) => p.actions),
|
|
1801
|
+
} = l((p) => p.actions), _ = l((p) => p.onSave), B = l(
|
|
1809
1802
|
(p) => p.actions.setApplyFilters
|
|
1810
1803
|
), 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
1804
|
(p) => p.actions.setIsSqlRunning
|
|
1812
1805
|
), {
|
|
1813
|
-
data:
|
|
1806
|
+
data: Q,
|
|
1814
1807
|
isLoading: ae,
|
|
1815
1808
|
isFetching: ne,
|
|
1816
1809
|
isSuccess: je,
|
|
@@ -1819,40 +1812,40 @@ function An() {
|
|
|
1819
1812
|
status: Xe,
|
|
1820
1813
|
refetch: be
|
|
1821
1814
|
} = Ne({
|
|
1822
|
-
queryKey: [
|
|
1815
|
+
queryKey: [I, A],
|
|
1823
1816
|
queryFn: () => Ys(
|
|
1824
1817
|
"https://semaphor.cloud/api/v1/query",
|
|
1825
1818
|
(f == null ? void 0 : f.accessToken) || "",
|
|
1826
1819
|
{
|
|
1827
|
-
connection_id:
|
|
1828
|
-
sql:
|
|
1820
|
+
connection_id: P,
|
|
1821
|
+
sql: I,
|
|
1829
1822
|
python: A === Ms ? "" : A,
|
|
1830
|
-
active_filters:
|
|
1823
|
+
active_filters: L ? G : []
|
|
1831
1824
|
}
|
|
1832
1825
|
),
|
|
1833
1826
|
enabled: !1,
|
|
1834
1827
|
retry: !1
|
|
1835
1828
|
});
|
|
1836
|
-
|
|
1837
|
-
if (
|
|
1838
|
-
const { dimensionKeys: p } = ns(
|
|
1839
|
-
|
|
1829
|
+
$(() => {
|
|
1830
|
+
if (Q && (te(Q.records), x((Q == null ? void 0 : Q.output) || ""), Q.records.length > 0)) {
|
|
1831
|
+
const { dimensionKeys: p } = ns(Q.records);
|
|
1832
|
+
Y(p);
|
|
1840
1833
|
}
|
|
1841
|
-
}, [
|
|
1834
|
+
}, [Q, te, Y, x]), $(() => {
|
|
1842
1835
|
fe && (be(), ge(!1));
|
|
1843
|
-
}, [fe, be, ge]),
|
|
1844
|
-
(ae || ne) && ue(!0), (ke || je) && ue(!1), ke ? (
|
|
1836
|
+
}, [fe, be, ge]), $(() => {
|
|
1837
|
+
(ae || ne) && ue(!0), (ke || je) && ue(!1), ke ? (D(Te.message), te([]), Y([]), x("")) : D("");
|
|
1845
1838
|
}, [
|
|
1846
1839
|
ae,
|
|
1847
1840
|
ne,
|
|
1848
|
-
|
|
1841
|
+
Q,
|
|
1849
1842
|
x,
|
|
1850
1843
|
ke,
|
|
1851
1844
|
je,
|
|
1852
1845
|
ue,
|
|
1853
1846
|
te,
|
|
1854
|
-
|
|
1855
|
-
|
|
1847
|
+
Y,
|
|
1848
|
+
D,
|
|
1856
1849
|
Te
|
|
1857
1850
|
]);
|
|
1858
1851
|
function _e() {
|
|
@@ -1862,21 +1855,21 @@ function An() {
|
|
|
1862
1855
|
t.current = p;
|
|
1863
1856
|
};
|
|
1864
1857
|
function N() {
|
|
1865
|
-
let p =
|
|
1866
|
-
|
|
1858
|
+
let p = F;
|
|
1859
|
+
F && !F.includes("{{") && (p = jn(F), Z(p));
|
|
1867
1860
|
const re = {
|
|
1868
1861
|
...C,
|
|
1869
|
-
lastSelectedSchema:
|
|
1862
|
+
lastSelectedSchema: O,
|
|
1870
1863
|
lastSelectedDatabase: T,
|
|
1871
|
-
lastSelectedTable:
|
|
1864
|
+
lastSelectedTable: y,
|
|
1872
1865
|
connectionId: E,
|
|
1873
|
-
type:
|
|
1866
|
+
type: b ? C.type : "table",
|
|
1874
1867
|
sql: p,
|
|
1875
|
-
customCfg:
|
|
1868
|
+
customCfg: b ? C.customCfg : null
|
|
1876
1869
|
}, Ee = U.cards.map(
|
|
1877
1870
|
(ye) => ye.id === C.id ? re : ye
|
|
1878
1871
|
);
|
|
1879
|
-
|
|
1872
|
+
_ == null || _({
|
|
1880
1873
|
...U,
|
|
1881
1874
|
cards: Ee
|
|
1882
1875
|
});
|
|
@@ -1891,16 +1884,16 @@ function An() {
|
|
|
1891
1884
|
return wt(re);
|
|
1892
1885
|
}
|
|
1893
1886
|
function wt(p) {
|
|
1894
|
-
const [re, Ee, ye] = p.split(" "),
|
|
1887
|
+
const [re, Ee, ye] = p.split(" "), X = 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(X / 60 % 2 - 1)), Ze = Fs - me / 2;
|
|
1895
1888
|
let le = 0, ie = 0, oe = 0;
|
|
1896
|
-
0 <=
|
|
1889
|
+
0 <= X && X < 60 ? (le = me, ie = we, oe = 0) : 60 <= X && X < 120 ? (le = we, ie = me, oe = 0) : 120 <= X && X < 180 ? (le = 0, ie = me, oe = we) : 180 <= X && X < 240 ? (le = 0, ie = we, oe = me) : 240 <= X && X < 300 ? (le = we, ie = 0, oe = me) : 300 <= X && X < 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
1890
|
const es = (At) => {
|
|
1898
1891
|
const ss = At.toString(16);
|
|
1899
1892
|
return ss.length == 1 ? "0" + ss : ss;
|
|
1900
1893
|
};
|
|
1901
1894
|
return `#${es(le)}${es(ie)}${es(oe)}`;
|
|
1902
1895
|
}
|
|
1903
|
-
|
|
1896
|
+
$(() => {
|
|
1904
1897
|
const p = n.current, re = t.current;
|
|
1905
1898
|
if (p) {
|
|
1906
1899
|
const Ee = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ye = v === "system" ? Ee : v;
|
|
@@ -1938,13 +1931,13 @@ function An() {
|
|
|
1938
1931
|
/* @__PURE__ */ e.jsx(
|
|
1939
1932
|
yn,
|
|
1940
1933
|
{
|
|
1941
|
-
checked:
|
|
1942
|
-
onCheckedChange: () =>
|
|
1934
|
+
checked: L,
|
|
1935
|
+
onCheckedChange: () => B(!L),
|
|
1943
1936
|
text: "Apply Filters"
|
|
1944
1937
|
}
|
|
1945
1938
|
),
|
|
1946
1939
|
/* @__PURE__ */ e.jsx(vn, {}),
|
|
1947
|
-
|
|
1940
|
+
G && o && /* @__PURE__ */ e.jsx(
|
|
1948
1941
|
Le,
|
|
1949
1942
|
{
|
|
1950
1943
|
onClick: () => r(!1),
|
|
@@ -1965,7 +1958,7 @@ function An() {
|
|
|
1965
1958
|
},
|
|
1966
1959
|
defaultLanguage: "json",
|
|
1967
1960
|
className: "mt-1 min-h-[220px]",
|
|
1968
|
-
value: JSON.stringify(
|
|
1961
|
+
value: JSON.stringify(G, null, 2),
|
|
1969
1962
|
options: {
|
|
1970
1963
|
readOnly: !0,
|
|
1971
1964
|
minimap: {
|
|
@@ -1986,14 +1979,14 @@ function An() {
|
|
|
1986
1979
|
] })
|
|
1987
1980
|
}
|
|
1988
1981
|
),
|
|
1989
|
-
|
|
1982
|
+
G && !o && /* @__PURE__ */ e.jsx(
|
|
1990
1983
|
rt,
|
|
1991
1984
|
{
|
|
1992
1985
|
onClick: () => r(!0),
|
|
1993
|
-
className:
|
|
1986
|
+
className: K(
|
|
1994
1987
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
1995
1988
|
{
|
|
1996
|
-
"font-bold text-red-800":
|
|
1989
|
+
"font-bold text-red-800": L
|
|
1997
1990
|
}
|
|
1998
1991
|
)
|
|
1999
1992
|
}
|
|
@@ -2029,7 +2022,7 @@ function An() {
|
|
|
2029
2022
|
onChange: (p) => {
|
|
2030
2023
|
Z(p);
|
|
2031
2024
|
},
|
|
2032
|
-
value:
|
|
2025
|
+
value: F,
|
|
2033
2026
|
options: {
|
|
2034
2027
|
minimap: {
|
|
2035
2028
|
enabled: !1
|
|
@@ -2075,7 +2068,7 @@ function An() {
|
|
|
2075
2068
|
className: "pt-3",
|
|
2076
2069
|
theme: "default",
|
|
2077
2070
|
onChange: (p) => {
|
|
2078
|
-
|
|
2071
|
+
J(p && p.trim() || "");
|
|
2079
2072
|
},
|
|
2080
2073
|
value: A || Ms,
|
|
2081
2074
|
options: {
|
|
@@ -2154,7 +2147,7 @@ function An() {
|
|
|
2154
2147
|
{
|
|
2155
2148
|
error: Te.message,
|
|
2156
2149
|
setShowAIDialog: c,
|
|
2157
|
-
setTriggerAIRun:
|
|
2150
|
+
setTriggerAIRun: g,
|
|
2158
2151
|
setUserInputforAI: h
|
|
2159
2152
|
}
|
|
2160
2153
|
),
|
|
@@ -2189,7 +2182,7 @@ function An() {
|
|
|
2189
2182
|
setOpen: c,
|
|
2190
2183
|
userInput: m,
|
|
2191
2184
|
triggerAIRun: u,
|
|
2192
|
-
setTriggerAIRun:
|
|
2185
|
+
setTriggerAIRun: g,
|
|
2193
2186
|
setUserInput: (p) => h(p)
|
|
2194
2187
|
}
|
|
2195
2188
|
)
|
|
@@ -2202,7 +2195,7 @@ function An() {
|
|
|
2202
2195
|
size: "sm",
|
|
2203
2196
|
variant: "outline",
|
|
2204
2197
|
children: [
|
|
2205
|
-
/* @__PURE__ */ e.jsx(
|
|
2198
|
+
/* @__PURE__ */ e.jsx(ta, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2206
2199
|
"Accept"
|
|
2207
2200
|
]
|
|
2208
2201
|
}
|
|
@@ -2243,29 +2236,29 @@ function En({ data: s }) {
|
|
|
2243
2236
|
onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
|
|
2244
2237
|
children: [
|
|
2245
2238
|
d,
|
|
2246
|
-
m === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2239
|
+
m === "asc" ? /* @__PURE__ */ e.jsx(aa, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(na, { className: "ml-2 h-5 w-5" }) : null
|
|
2247
2240
|
]
|
|
2248
2241
|
}
|
|
2249
2242
|
) });
|
|
2250
2243
|
}
|
|
2251
|
-
})), o =
|
|
2244
|
+
})), o = ra({
|
|
2252
2245
|
data: s,
|
|
2253
2246
|
columns: i,
|
|
2254
|
-
getCoreRowModel:
|
|
2255
|
-
getPaginationRowModel:
|
|
2247
|
+
getCoreRowModel: da(),
|
|
2248
|
+
getPaginationRowModel: ha(),
|
|
2256
2249
|
onSortingChange: t,
|
|
2257
|
-
getSortedRowModel:
|
|
2250
|
+
getSortedRowModel: ua(),
|
|
2258
2251
|
manualPagination: !0,
|
|
2259
2252
|
state: {
|
|
2260
2253
|
sorting: n
|
|
2261
2254
|
}
|
|
2262
2255
|
});
|
|
2263
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2264
|
-
/* @__PURE__ */ e.jsx(
|
|
2256
|
+
return /* @__PURE__ */ e.jsxs(la, { children: [
|
|
2257
|
+
/* @__PURE__ */ e.jsx(ia, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e.jsx(ts, { children: d.headers.map((c) => /* @__PURE__ */ e.jsx(oa, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Ts(
|
|
2265
2258
|
c.column.columnDef.header,
|
|
2266
2259
|
c.getContext()
|
|
2267
2260
|
) }, c.id)) }, d.id)) }),
|
|
2268
|
-
/* @__PURE__ */ e.jsx(
|
|
2261
|
+
/* @__PURE__ */ e.jsx(ca, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e.jsx(
|
|
2269
2262
|
ts,
|
|
2270
2263
|
{
|
|
2271
2264
|
className: "whitespace-nowrap py-2",
|
|
@@ -2283,7 +2276,7 @@ function pt({
|
|
|
2283
2276
|
}) {
|
|
2284
2277
|
de.useState(0);
|
|
2285
2278
|
const t = S((r) => r.themeStyle), a = l((r) => r.card), i = l((r) => r.actions.setCard);
|
|
2286
|
-
if (
|
|
2279
|
+
if ($(() => {
|
|
2287
2280
|
}, [
|
|
2288
2281
|
a.data,
|
|
2289
2282
|
a.type,
|
|
@@ -2301,19 +2294,19 @@ function pt({
|
|
|
2301
2294
|
customCfg: a.customCfg,
|
|
2302
2295
|
preferences: a.preferences
|
|
2303
2296
|
})), /* @__PURE__ */ e.jsxs(
|
|
2304
|
-
|
|
2297
|
+
ma,
|
|
2305
2298
|
{
|
|
2306
2299
|
role: "editor-visual-card",
|
|
2307
|
-
className:
|
|
2300
|
+
className: K("relative flex h-full flex-col rounded-none", s),
|
|
2308
2301
|
...n,
|
|
2309
2302
|
children: [
|
|
2310
|
-
/* @__PURE__ */ e.jsxs(
|
|
2303
|
+
/* @__PURE__ */ e.jsxs(xa, { className: "py-4", children: [
|
|
2311
2304
|
/* @__PURE__ */ e.jsx(
|
|
2312
2305
|
Es,
|
|
2313
2306
|
{
|
|
2314
2307
|
text: a.title,
|
|
2315
2308
|
onSave: (r) => i({ ...a, title: r }),
|
|
2316
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2309
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(pa, { className: "text-base", children: a.title }) })
|
|
2317
2310
|
},
|
|
2318
2311
|
a.title
|
|
2319
2312
|
),
|
|
@@ -2322,7 +2315,7 @@ function pt({
|
|
|
2322
2315
|
{
|
|
2323
2316
|
text: a.description || "",
|
|
2324
2317
|
onSave: (r) => i({ ...a, description: r }),
|
|
2325
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2318
|
+
children: /* @__PURE__ */ e.jsxs(fa, { children: [
|
|
2326
2319
|
" ",
|
|
2327
2320
|
a.description
|
|
2328
2321
|
] })
|
|
@@ -2330,43 +2323,43 @@ function pt({
|
|
|
2330
2323
|
a.description
|
|
2331
2324
|
)
|
|
2332
2325
|
] }),
|
|
2333
|
-
/* @__PURE__ */ e.jsxs(
|
|
2326
|
+
/* @__PURE__ */ e.jsxs(ga, { className: "flex grow flex-col pb-3", children: [
|
|
2334
2327
|
a.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2335
2328
|
/* @__PURE__ */ e.jsx(
|
|
2336
|
-
|
|
2329
|
+
ja,
|
|
2337
2330
|
{
|
|
2338
2331
|
cfg: o
|
|
2339
2332
|
},
|
|
2340
2333
|
JSON.stringify(o) + JSON.stringify(a.preferences)
|
|
2341
2334
|
),
|
|
2342
2335
|
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(
|
|
2336
|
+
/* @__PURE__ */ e.jsx(ba, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(ya, { card: a, data: a == null ? void 0 : a.data }) })
|
|
2344
2337
|
] })
|
|
2345
2338
|
]
|
|
2346
2339
|
}
|
|
2347
2340
|
);
|
|
2348
2341
|
}
|
|
2349
2342
|
function Ln() {
|
|
2350
|
-
const [s, n] =
|
|
2343
|
+
const [s, n] = z(!1), [t, a] = z(""), [i, o] = z(""), [r, d] = z(""), c = l((v) => v.card), m = l(
|
|
2351
2344
|
(v) => v.card.customCfg
|
|
2352
2345
|
), h = l(
|
|
2353
2346
|
(v) => v.actions.setCardCustomCfg
|
|
2354
2347
|
);
|
|
2355
2348
|
function u(v) {
|
|
2356
|
-
var T,
|
|
2357
|
-
const
|
|
2349
|
+
var T, O;
|
|
2350
|
+
const b = {
|
|
2358
2351
|
...v,
|
|
2359
2352
|
data: {
|
|
2360
2353
|
...v == null ? void 0 : v.data,
|
|
2361
|
-
datasets: (
|
|
2362
|
-
...
|
|
2354
|
+
datasets: (O = (T = v == null ? void 0 : v.data) == null ? void 0 : T.datasets) == null ? void 0 : O.map((y) => ({
|
|
2355
|
+
...y,
|
|
2363
2356
|
data: []
|
|
2364
2357
|
}))
|
|
2365
2358
|
}
|
|
2366
2359
|
};
|
|
2367
|
-
return JSON.stringify(
|
|
2360
|
+
return JSON.stringify(b, null, 1);
|
|
2368
2361
|
}
|
|
2369
|
-
function
|
|
2362
|
+
function g() {
|
|
2370
2363
|
if (!c.data || c.data.length === 0)
|
|
2371
2364
|
return;
|
|
2372
2365
|
const v = st({
|
|
@@ -2386,13 +2379,13 @@ function Ln() {
|
|
|
2386
2379
|
console.log(v), d("Invalid JSON");
|
|
2387
2380
|
}
|
|
2388
2381
|
}
|
|
2389
|
-
function
|
|
2382
|
+
function j() {
|
|
2390
2383
|
o(""), h(null);
|
|
2391
2384
|
}
|
|
2392
2385
|
function C() {
|
|
2393
2386
|
let v;
|
|
2394
2387
|
if (m) {
|
|
2395
|
-
const
|
|
2388
|
+
const b = Is.cloneDeep(c.cfg), E = Is.merge(b, m);
|
|
2396
2389
|
return v = u(E), v;
|
|
2397
2390
|
}
|
|
2398
2391
|
return t ? (v = u(JSON.parse(t)), v) : "";
|
|
@@ -2401,11 +2394,11 @@ function Ln() {
|
|
|
2401
2394
|
/* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2402
2395
|
w,
|
|
2403
2396
|
{
|
|
2404
|
-
onClick:
|
|
2397
|
+
onClick: g,
|
|
2405
2398
|
className: ` ${m && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2406
2399
|
size: "sm",
|
|
2407
2400
|
variant: "outline",
|
|
2408
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2401
|
+
children: /* @__PURE__ */ e.jsx(va, { className: "h-4 w-4" })
|
|
2409
2402
|
}
|
|
2410
2403
|
) }),
|
|
2411
2404
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2444,10 +2437,10 @@ function Ln() {
|
|
|
2444
2437
|
] }),
|
|
2445
2438
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2446
2439
|
/* @__PURE__ */ e.jsx(pt, { className: "w-1/2 rounded shadow-none" }),
|
|
2447
|
-
/* @__PURE__ */ e.jsxs(
|
|
2448
|
-
/* @__PURE__ */ e.jsxs(
|
|
2440
|
+
/* @__PURE__ */ e.jsxs(Na, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2441
|
+
/* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2449
2442
|
/* @__PURE__ */ e.jsxs(Ls, { value: "custom-config", children: [
|
|
2450
|
-
m && /* @__PURE__ */ e.jsx(
|
|
2443
|
+
m && /* @__PURE__ */ e.jsx(Sa, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2451
2444
|
m ? "Custom Config" : "Default Config"
|
|
2452
2445
|
] }),
|
|
2453
2446
|
/* @__PURE__ */ e.jsx(Ls, { className: "", value: "output", children: "Output" })
|
|
@@ -2499,12 +2492,12 @@ function Ln() {
|
|
|
2499
2492
|
] })
|
|
2500
2493
|
] }),
|
|
2501
2494
|
/* @__PURE__ */ e.jsxs(Bs, { className: "flex items-center", children: [
|
|
2502
|
-
/* @__PURE__ */ e.jsx(
|
|
2495
|
+
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: r }),
|
|
2503
2496
|
/* @__PURE__ */ e.jsx(
|
|
2504
2497
|
w,
|
|
2505
2498
|
{
|
|
2506
2499
|
disabled: !m,
|
|
2507
|
-
onClick:
|
|
2500
|
+
onClick: j,
|
|
2508
2501
|
variant: "outline",
|
|
2509
2502
|
children: "Reset"
|
|
2510
2503
|
}
|
|
@@ -2536,7 +2529,7 @@ function vt(s) {
|
|
|
2536
2529
|
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
2530
|
}
|
|
2538
2531
|
function Dn() {
|
|
2539
|
-
const [s, n] =
|
|
2532
|
+
const [s, n] = z(!1), t = l((d) => d.card.type), { setCardType: a, setCardPreferences: i } = l(
|
|
2540
2533
|
(d) => d.actions
|
|
2541
2534
|
), o = l(
|
|
2542
2535
|
(d) => d.actions.setCardCustomCfg
|
|
@@ -2553,7 +2546,7 @@ function Dn() {
|
|
|
2553
2546
|
onClick: () => r("bar"),
|
|
2554
2547
|
className: "font-normal",
|
|
2555
2548
|
variant: "ghost",
|
|
2556
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2549
|
+
children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
|
|
2557
2550
|
}
|
|
2558
2551
|
),
|
|
2559
2552
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2561,7 +2554,7 @@ function Dn() {
|
|
|
2561
2554
|
{
|
|
2562
2555
|
onClick: () => r("line"),
|
|
2563
2556
|
variant: "ghost",
|
|
2564
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2557
|
+
children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
|
|
2565
2558
|
}
|
|
2566
2559
|
),
|
|
2567
2560
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2631,7 +2624,7 @@ function Dn() {
|
|
|
2631
2624
|
{
|
|
2632
2625
|
onClick: () => r("table"),
|
|
2633
2626
|
variant: "ghost",
|
|
2634
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2627
|
+
children: /* @__PURE__ */ e.jsx(bs, { className: "size-5" })
|
|
2635
2628
|
}
|
|
2636
2629
|
),
|
|
2637
2630
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2648,9 +2641,9 @@ function Dn() {
|
|
|
2648
2641
|
function In({ chartType: s, className: n }) {
|
|
2649
2642
|
switch (s) {
|
|
2650
2643
|
case "bar":
|
|
2651
|
-
return /* @__PURE__ */ e.jsx(vs, { className: n });
|
|
2652
|
-
case "line":
|
|
2653
2644
|
return /* @__PURE__ */ e.jsx(Ns, { className: n });
|
|
2645
|
+
case "line":
|
|
2646
|
+
return /* @__PURE__ */ e.jsx(Cs, { className: n });
|
|
2654
2647
|
case "pie":
|
|
2655
2648
|
return /* @__PURE__ */ e.jsx(it, { className: n });
|
|
2656
2649
|
case "radar":
|
|
@@ -2668,7 +2661,7 @@ function In({ chartType: s, className: n }) {
|
|
|
2668
2661
|
case "kpi":
|
|
2669
2662
|
return /* @__PURE__ */ e.jsx(vt, { className: n });
|
|
2670
2663
|
default:
|
|
2671
|
-
return /* @__PURE__ */ e.jsx(
|
|
2664
|
+
return /* @__PURE__ */ e.jsx(bs, { className: n });
|
|
2672
2665
|
}
|
|
2673
2666
|
}
|
|
2674
2667
|
function qn() {
|
|
@@ -2678,11 +2671,11 @@ function qn() {
|
|
|
2678
2671
|
(t) => t.actions.setCardRefreshInterval
|
|
2679
2672
|
);
|
|
2680
2673
|
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(
|
|
2674
|
+
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ba, { className: "w-4 h-4" }) }) }),
|
|
2682
2675
|
/* @__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
|
-
/* @__PURE__ */ e.jsx(
|
|
2676
|
+
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
|
|
2684
2677
|
/* @__PURE__ */ e.jsx(
|
|
2685
|
-
|
|
2678
|
+
W,
|
|
2686
2679
|
{
|
|
2687
2680
|
value: s || "",
|
|
2688
2681
|
onChange: (t) => n(t.target.value),
|
|
@@ -2707,7 +2700,7 @@ function _s() {
|
|
|
2707
2700
|
] }),
|
|
2708
2701
|
/* @__PURE__ */ e.jsx(Rn, {})
|
|
2709
2702
|
] }),
|
|
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(
|
|
2703
|
+
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(ka, { 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
2704
|
o && /* @__PURE__ */ e.jsx(Vn, {}),
|
|
2712
2705
|
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(En, { data: n || [] }),
|
|
2713
2706
|
i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
|
|
@@ -2736,9 +2729,9 @@ function Rn() {
|
|
|
2736
2729
|
(t) => t.actions.setIsShowingVisual
|
|
2737
2730
|
);
|
|
2738
2731
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2739
|
-
/* @__PURE__ */ e.jsx(
|
|
2732
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
|
|
2740
2733
|
/* @__PURE__ */ e.jsx(
|
|
2741
|
-
|
|
2734
|
+
wa,
|
|
2742
2735
|
{
|
|
2743
2736
|
checked: s,
|
|
2744
2737
|
onCheckedChange: () => n(!s),
|
|
@@ -2749,7 +2742,7 @@ function Rn() {
|
|
|
2749
2742
|
] });
|
|
2750
2743
|
}
|
|
2751
2744
|
function Me() {
|
|
2752
|
-
const [s, n] =
|
|
2745
|
+
const [s, n] = z([]);
|
|
2753
2746
|
l(
|
|
2754
2747
|
(h) => h.card.cfg
|
|
2755
2748
|
);
|
|
@@ -2761,12 +2754,12 @@ function Me() {
|
|
|
2761
2754
|
var u;
|
|
2762
2755
|
return (u = h.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
|
|
2763
2756
|
}
|
|
2764
|
-
),
|
|
2757
|
+
), $(() => {
|
|
2765
2758
|
r && n(new Array(r.length).fill(!1));
|
|
2766
2759
|
}, [r]);
|
|
2767
2760
|
function d(h, u) {
|
|
2768
|
-
var
|
|
2769
|
-
u ? t != null && t.onClickFilter && ((
|
|
2761
|
+
var g, f;
|
|
2762
|
+
u ? t != null && t.onClickFilter && ((g = t == null ? void 0 : t.onClickFilter) == null ? void 0 : g.length) > 0 ? o({
|
|
2770
2763
|
...t,
|
|
2771
2764
|
onClickFilter: [
|
|
2772
2765
|
...t.onClickFilter,
|
|
@@ -2786,31 +2779,31 @@ function Me() {
|
|
|
2786
2779
|
}) : (o({
|
|
2787
2780
|
...t,
|
|
2788
2781
|
onClickFilter: (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.filter(
|
|
2789
|
-
(
|
|
2782
|
+
(j) => j.columnIndex !== h
|
|
2790
2783
|
)
|
|
2791
|
-
}), n((
|
|
2792
|
-
const C = [...
|
|
2784
|
+
}), n((j) => {
|
|
2785
|
+
const C = [...j];
|
|
2793
2786
|
return C[h] = !1, C;
|
|
2794
2787
|
}));
|
|
2795
2788
|
}
|
|
2796
2789
|
function c(h, u) {
|
|
2797
2790
|
var f;
|
|
2798
|
-
const
|
|
2799
|
-
...
|
|
2791
|
+
const g = (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.map((j) => j.columnIndex === h ? {
|
|
2792
|
+
...j,
|
|
2800
2793
|
expression: u.target.value
|
|
2801
|
-
} :
|
|
2794
|
+
} : j);
|
|
2802
2795
|
o({
|
|
2803
2796
|
...t,
|
|
2804
|
-
onClickFilter:
|
|
2797
|
+
onClickFilter: g
|
|
2805
2798
|
});
|
|
2806
2799
|
}
|
|
2807
2800
|
function m(h) {
|
|
2808
|
-
var u,
|
|
2809
|
-
if (s != null && s[h] || (
|
|
2801
|
+
var u, g, f, j;
|
|
2802
|
+
if (s != null && s[h] || (g = (u = t == null ? void 0 : t.onClickFilter) == null ? void 0 : u.find((C) => C.columnIndex === h)) != null && g.expression)
|
|
2810
2803
|
return /* @__PURE__ */ e.jsx(
|
|
2811
|
-
|
|
2804
|
+
W,
|
|
2812
2805
|
{
|
|
2813
|
-
value: (
|
|
2806
|
+
value: (j = (f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.find((C) => C.columnIndex === h)) == null ? void 0 : j.expression,
|
|
2814
2807
|
onChange: (C) => c(h, C),
|
|
2815
2808
|
type: "text",
|
|
2816
2809
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
@@ -2819,7 +2812,7 @@ function Me() {
|
|
|
2819
2812
|
);
|
|
2820
2813
|
}
|
|
2821
2814
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((h, u) => {
|
|
2822
|
-
var
|
|
2815
|
+
var g, f;
|
|
2823
2816
|
return /* @__PURE__ */ e.jsx(
|
|
2824
2817
|
"div",
|
|
2825
2818
|
{
|
|
@@ -2829,10 +2822,10 @@ function Me() {
|
|
|
2829
2822
|
/* @__PURE__ */ e.jsx(
|
|
2830
2823
|
Qe,
|
|
2831
2824
|
{
|
|
2832
|
-
checked: !!((
|
|
2833
|
-
(
|
|
2825
|
+
checked: !!((g = t == null ? void 0 : t.onClickFilter) != null && g.find(
|
|
2826
|
+
(j) => j.columnIndex === u
|
|
2834
2827
|
)),
|
|
2835
|
-
onCheckedChange: (
|
|
2828
|
+
onCheckedChange: (j) => d(u, j)
|
|
2836
2829
|
}
|
|
2837
2830
|
),
|
|
2838
2831
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2843,14 +2836,14 @@ function Me() {
|
|
|
2843
2836
|
}
|
|
2844
2837
|
),
|
|
2845
2838
|
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.find(
|
|
2846
|
-
(
|
|
2839
|
+
(j) => j.columnIndex === u
|
|
2847
2840
|
)) && /* @__PURE__ */ e.jsx(
|
|
2848
2841
|
lt,
|
|
2849
2842
|
{
|
|
2850
2843
|
onClick: () => {
|
|
2851
|
-
n((
|
|
2852
|
-
const C = [...
|
|
2853
|
-
return C[u] = !
|
|
2844
|
+
n((j) => {
|
|
2845
|
+
const C = [...j];
|
|
2846
|
+
return C[u] = !j[u], C;
|
|
2854
2847
|
});
|
|
2855
2848
|
},
|
|
2856
2849
|
className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
|
|
@@ -2873,11 +2866,11 @@ function Ss() {
|
|
|
2873
2866
|
);
|
|
2874
2867
|
(o = n == null ? void 0 : n.options) != null && o.indexAxis;
|
|
2875
2868
|
function i(d) {
|
|
2876
|
-
var h, u,
|
|
2869
|
+
var h, u, g, f, j, C;
|
|
2877
2870
|
let c = {};
|
|
2878
2871
|
(h = s == null ? void 0 : s.chartOptions) != null && h.scales && (c = {
|
|
2879
|
-
x: (
|
|
2880
|
-
y: (
|
|
2872
|
+
x: (g = (u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.scales) == null ? void 0 : g.y,
|
|
2873
|
+
y: (j = (f = s == null ? void 0 : s.chartOptions) == null ? void 0 : f.scales) == null ? void 0 : j.x
|
|
2881
2874
|
});
|
|
2882
2875
|
const m = {
|
|
2883
2876
|
...s,
|
|
@@ -2919,41 +2912,41 @@ function Hs(s) {
|
|
|
2919
2912
|
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
2913
|
}
|
|
2921
2914
|
function Nt() {
|
|
2922
|
-
var ee,
|
|
2923
|
-
const [s, n] =
|
|
2915
|
+
var ee, Y, se, Z, J, D;
|
|
2916
|
+
const [s, n] = z(!1), t = l((x) => {
|
|
2924
2917
|
var k;
|
|
2925
2918
|
return (k = x.card) == null ? void 0 : k.preferences;
|
|
2926
|
-
}), a = nt(t), [i, o] =
|
|
2919
|
+
}), a = nt(t), [i, o] = z(
|
|
2927
2920
|
Hs(t)
|
|
2928
|
-
), [r, d] =
|
|
2929
|
-
((se = (
|
|
2930
|
-
), [c, m] =
|
|
2931
|
-
((
|
|
2932
|
-
), [h, u] =
|
|
2921
|
+
), [r, d] = z(
|
|
2922
|
+
((se = (Y = (ee = t == null ? void 0 : t.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : Y[a]) == null ? void 0 : se.min) || ""
|
|
2923
|
+
), [c, m] = z(
|
|
2924
|
+
((D = (J = (Z = t == null ? void 0 : t.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : J[a]) == null ? void 0 : D.max) || ""
|
|
2925
|
+
), [h, u] = z(r || c ? "custom" : "auto"), [g, f] = z(""), [j, C] = z(""), [v, b] = z(""), [E, T] = z(""), [O, y] = z(""), F = l(
|
|
2933
2926
|
(x) => x.actions.setCardPreferences
|
|
2934
2927
|
), A = l((x) => {
|
|
2935
2928
|
var k;
|
|
2936
2929
|
return (k = x.card) == null ? void 0 : k.type;
|
|
2937
|
-
}),
|
|
2938
|
-
|
|
2939
|
-
var x, k,
|
|
2930
|
+
}), I = ["pie", "doughnut", "polarArea"].includes(A);
|
|
2931
|
+
$(() => {
|
|
2932
|
+
var x, k, _, B, he, te, pe, fe, ge, ue, Q, ae, ne, je;
|
|
2940
2933
|
o(Hs(t)), d(
|
|
2941
|
-
((
|
|
2942
|
-
), m(((te = (he = (
|
|
2934
|
+
((_ = (k = (x = t == null ? void 0 : t.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : k[a]) == null ? void 0 : _.min) === 0 ? 0 : ""
|
|
2935
|
+
), m(((te = (he = (B = t == null ? void 0 : t.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : he[a]) == null ? void 0 : te.max) || ""), f(
|
|
2943
2936
|
((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(((
|
|
2937
|
+
), C(((Q = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : Q.format) || ""), b(((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) || ""), y(((je = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : je.locale) || "");
|
|
2945
2938
|
}, [s, t, a]);
|
|
2946
|
-
function
|
|
2939
|
+
function P(x, k) {
|
|
2947
2940
|
return k === "" || /^[0-9\b]+$/.test(k) ? Number(k) : Number(x);
|
|
2948
2941
|
}
|
|
2949
2942
|
function U() {
|
|
2950
2943
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2951
2944
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
|
|
2952
|
-
/* @__PURE__ */ e.jsx(
|
|
2945
|
+
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Format" }),
|
|
2953
2946
|
/* @__PURE__ */ e.jsx(
|
|
2954
|
-
|
|
2947
|
+
W,
|
|
2955
2948
|
{
|
|
2956
|
-
value:
|
|
2949
|
+
value: j,
|
|
2957
2950
|
placeholder: "000,0.00",
|
|
2958
2951
|
onChange: (x) => C(x.target.value),
|
|
2959
2952
|
id: "format",
|
|
@@ -2961,11 +2954,11 @@ function Nt() {
|
|
|
2961
2954
|
}
|
|
2962
2955
|
),
|
|
2963
2956
|
/* @__PURE__ */ e.jsx(
|
|
2964
|
-
|
|
2957
|
+
W,
|
|
2965
2958
|
{
|
|
2966
2959
|
value: v,
|
|
2967
2960
|
placeholder: "M",
|
|
2968
|
-
onChange: (x) =>
|
|
2961
|
+
onChange: (x) => b(x.target.value),
|
|
2969
2962
|
id: "unit",
|
|
2970
2963
|
className: `col-span-2 h-8 w-full ${ve}`
|
|
2971
2964
|
}
|
|
@@ -2973,7 +2966,7 @@ function Nt() {
|
|
|
2973
2966
|
] }),
|
|
2974
2967
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
2975
2968
|
/* @__PURE__ */ e.jsx(
|
|
2976
|
-
|
|
2969
|
+
H,
|
|
2977
2970
|
{
|
|
2978
2971
|
className: "col-span-2 hover:cursor-pointer hover:underline",
|
|
2979
2972
|
htmlFor: "currency",
|
|
@@ -2988,7 +2981,7 @@ function Nt() {
|
|
|
2988
2981
|
}
|
|
2989
2982
|
),
|
|
2990
2983
|
/* @__PURE__ */ e.jsx(
|
|
2991
|
-
|
|
2984
|
+
W,
|
|
2992
2985
|
{
|
|
2993
2986
|
value: E,
|
|
2994
2987
|
placeholder: "USD",
|
|
@@ -2998,11 +2991,11 @@ function Nt() {
|
|
|
2998
2991
|
}
|
|
2999
2992
|
),
|
|
3000
2993
|
/* @__PURE__ */ e.jsx(
|
|
3001
|
-
|
|
2994
|
+
W,
|
|
3002
2995
|
{
|
|
3003
|
-
value:
|
|
2996
|
+
value: O,
|
|
3004
2997
|
placeholder: "en-US",
|
|
3005
|
-
onChange: (x) =>
|
|
2998
|
+
onChange: (x) => y(x.target.value),
|
|
3006
2999
|
id: "locale",
|
|
3007
3000
|
className: `col-span-2 h-8 w-full ${ve}`
|
|
3008
3001
|
}
|
|
@@ -3010,36 +3003,36 @@ function Nt() {
|
|
|
3010
3003
|
] })
|
|
3011
3004
|
] });
|
|
3012
3005
|
}
|
|
3013
|
-
function
|
|
3006
|
+
function G() {
|
|
3014
3007
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3015
3008
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3016
|
-
/* @__PURE__ */ e.jsx(
|
|
3009
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
|
|
3017
3010
|
/* @__PURE__ */ e.jsx(
|
|
3018
|
-
|
|
3011
|
+
W,
|
|
3019
3012
|
{
|
|
3020
3013
|
id: "min",
|
|
3021
3014
|
value: r,
|
|
3022
|
-
onChange: (x) => d((k) =>
|
|
3015
|
+
onChange: (x) => d((k) => P(k, x.target.value)),
|
|
3023
3016
|
className: `col-span-1 h-8 w-full ${ve}`
|
|
3024
3017
|
}
|
|
3025
3018
|
),
|
|
3026
3019
|
/* @__PURE__ */ e.jsx(
|
|
3027
|
-
|
|
3020
|
+
W,
|
|
3028
3021
|
{
|
|
3029
3022
|
value: c,
|
|
3030
|
-
onChange: (x) => m((k) =>
|
|
3023
|
+
onChange: (x) => m((k) => P(k, x.target.value)),
|
|
3031
3024
|
id: "max",
|
|
3032
3025
|
className: `col-span-1 h-8 w-full ${ve}`
|
|
3033
3026
|
}
|
|
3034
3027
|
)
|
|
3035
3028
|
] }),
|
|
3036
3029
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3037
|
-
/* @__PURE__ */ e.jsx(
|
|
3030
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
|
|
3038
3031
|
/* @__PURE__ */ e.jsx(
|
|
3039
|
-
|
|
3032
|
+
W,
|
|
3040
3033
|
{
|
|
3041
|
-
value:
|
|
3042
|
-
onChange: (x) => f((k) =>
|
|
3034
|
+
value: g,
|
|
3035
|
+
onChange: (x) => f((k) => P(k, x.target.value)),
|
|
3043
3036
|
id: "step-size",
|
|
3044
3037
|
className: `col-span-1 h-8 w-full ${ve}`
|
|
3045
3038
|
}
|
|
@@ -3047,14 +3040,14 @@ function Nt() {
|
|
|
3047
3040
|
] })
|
|
3048
3041
|
] });
|
|
3049
3042
|
}
|
|
3050
|
-
function
|
|
3051
|
-
var
|
|
3043
|
+
function L() {
|
|
3044
|
+
var _;
|
|
3052
3045
|
let x = {};
|
|
3053
3046
|
h === "custom" && (x = {
|
|
3054
3047
|
min: r,
|
|
3055
3048
|
max: c,
|
|
3056
3049
|
ticks: {
|
|
3057
|
-
stepSize:
|
|
3050
|
+
stepSize: g
|
|
3058
3051
|
}
|
|
3059
3052
|
});
|
|
3060
3053
|
const k = {
|
|
@@ -3062,7 +3055,7 @@ function Nt() {
|
|
|
3062
3055
|
chartOptions: {
|
|
3063
3056
|
...t == null ? void 0 : t.chartOptions,
|
|
3064
3057
|
scales: {
|
|
3065
|
-
...(
|
|
3058
|
+
...(_ = t == null ? void 0 : t.chartOptions) == null ? void 0 : _.scales,
|
|
3066
3059
|
[a]: {
|
|
3067
3060
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3068
3061
|
type: i,
|
|
@@ -3071,16 +3064,16 @@ function Nt() {
|
|
|
3071
3064
|
}
|
|
3072
3065
|
},
|
|
3073
3066
|
numberAxisFormat: {
|
|
3074
|
-
format:
|
|
3067
|
+
format: j,
|
|
3075
3068
|
suffix: v,
|
|
3076
3069
|
currency: E,
|
|
3077
|
-
locale:
|
|
3070
|
+
locale: O
|
|
3078
3071
|
}
|
|
3079
3072
|
};
|
|
3080
|
-
|
|
3073
|
+
F(k);
|
|
3081
3074
|
}
|
|
3082
3075
|
return /* @__PURE__ */ e.jsxs(qe, { onOpenChange: (x) => n(x), children: [
|
|
3083
|
-
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3076
|
+
/* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3084
3077
|
/* @__PURE__ */ e.jsx(Re, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3085
3078
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3086
3079
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
@@ -3088,11 +3081,11 @@ function Nt() {
|
|
|
3088
3081
|
] }),
|
|
3089
3082
|
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
|
|
3090
3083
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3091
|
-
/* @__PURE__ */ e.jsx(
|
|
3084
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
|
|
3092
3085
|
/* @__PURE__ */ e.jsxs(
|
|
3093
3086
|
xs,
|
|
3094
3087
|
{
|
|
3095
|
-
disabled:
|
|
3088
|
+
disabled: I,
|
|
3096
3089
|
value: i,
|
|
3097
3090
|
onValueChange: (x) => o(x),
|
|
3098
3091
|
children: [
|
|
@@ -3107,11 +3100,11 @@ function Nt() {
|
|
|
3107
3100
|
)
|
|
3108
3101
|
] }),
|
|
3109
3102
|
i == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3110
|
-
/* @__PURE__ */ e.jsx(
|
|
3103
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
|
|
3111
3104
|
/* @__PURE__ */ e.jsxs(
|
|
3112
3105
|
at,
|
|
3113
3106
|
{
|
|
3114
|
-
disabled:
|
|
3107
|
+
disabled: I,
|
|
3115
3108
|
id: "scale-option",
|
|
3116
3109
|
value: h,
|
|
3117
3110
|
onValueChange: (x) => u(x),
|
|
@@ -3130,13 +3123,13 @@ function Nt() {
|
|
|
3130
3123
|
}
|
|
3131
3124
|
)
|
|
3132
3125
|
] }),
|
|
3133
|
-
h === "custom" && i == "linear" &&
|
|
3126
|
+
h === "custom" && i == "linear" && G(),
|
|
3134
3127
|
U(),
|
|
3135
|
-
/* @__PURE__ */ e.jsx(
|
|
3128
|
+
/* @__PURE__ */ e.jsx(Oa, {}),
|
|
3136
3129
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3137
3130
|
w,
|
|
3138
3131
|
{
|
|
3139
|
-
onClick:
|
|
3132
|
+
onClick: L,
|
|
3140
3133
|
variant: "secondary",
|
|
3141
3134
|
className: "col-span-1 col-start-3 h-8 w-full",
|
|
3142
3135
|
children: "Apply"
|
|
@@ -3160,7 +3153,7 @@ function _n({ idx: s }) {
|
|
|
3160
3153
|
(c) => c.actions.setCardPreferences
|
|
3161
3154
|
), i = (d = n == null ? void 0 : n.chartOptions) == null ? void 0 : d.indexAxis, o = t == null ? void 0 : t.find((c) => c.idx === s);
|
|
3162
3155
|
function r(c, m) {
|
|
3163
|
-
(c === "end" || c === "start") &&
|
|
3156
|
+
(c === "end" || c === "start") && Ma(Ta());
|
|
3164
3157
|
const h = {
|
|
3165
3158
|
display: c !== "none",
|
|
3166
3159
|
align: c,
|
|
@@ -3181,12 +3174,12 @@ function _n({ idx: s }) {
|
|
|
3181
3174
|
else {
|
|
3182
3175
|
const u = { ...o };
|
|
3183
3176
|
u.datalabels = h;
|
|
3184
|
-
const
|
|
3177
|
+
const g = t == null ? void 0 : t.map(
|
|
3185
3178
|
(f) => f.idx === m ? u : f
|
|
3186
3179
|
);
|
|
3187
3180
|
a({
|
|
3188
3181
|
...n,
|
|
3189
|
-
datasetOptions:
|
|
3182
|
+
datasetOptions: g
|
|
3190
3183
|
});
|
|
3191
3184
|
}
|
|
3192
3185
|
}
|
|
@@ -3200,7 +3193,7 @@ function _n({ idx: s }) {
|
|
|
3200
3193
|
size: "sm",
|
|
3201
3194
|
variant: "secondary",
|
|
3202
3195
|
className: "h-7 p-1 text-xs font-normal",
|
|
3203
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3196
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "size-4" })
|
|
3204
3197
|
}
|
|
3205
3198
|
),
|
|
3206
3199
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3213,7 +3206,7 @@ function _n({ idx: s }) {
|
|
|
3213
3206
|
children: /* @__PURE__ */ e.jsx(
|
|
3214
3207
|
Xa,
|
|
3215
3208
|
{
|
|
3216
|
-
className:
|
|
3209
|
+
className: K("h-4 w-4", {
|
|
3217
3210
|
"rotate-90": i === "y"
|
|
3218
3211
|
})
|
|
3219
3212
|
}
|
|
@@ -3230,7 +3223,7 @@ function _n({ idx: s }) {
|
|
|
3230
3223
|
children: /* @__PURE__ */ e.jsx(
|
|
3231
3224
|
en,
|
|
3232
3225
|
{
|
|
3233
|
-
className:
|
|
3226
|
+
className: K("h-4 w-4", {
|
|
3234
3227
|
"rotate-90": i === "y"
|
|
3235
3228
|
})
|
|
3236
3229
|
}
|
|
@@ -3247,7 +3240,7 @@ function _n({ idx: s }) {
|
|
|
3247
3240
|
children: /* @__PURE__ */ e.jsx(
|
|
3248
3241
|
Za,
|
|
3249
3242
|
{
|
|
3250
|
-
className:
|
|
3243
|
+
className: K("h-4 w-4", {
|
|
3251
3244
|
"rotate-90": i === "y"
|
|
3252
3245
|
})
|
|
3253
3246
|
}
|
|
@@ -3270,7 +3263,7 @@ function Ct() {
|
|
|
3270
3263
|
} = ns(s.data || []);
|
|
3271
3264
|
let d = o;
|
|
3272
3265
|
if (s.type === "stackedBar") {
|
|
3273
|
-
const c =
|
|
3266
|
+
const c = Aa({
|
|
3274
3267
|
dataArray: s.data || [],
|
|
3275
3268
|
groupKey: r[0],
|
|
3276
3269
|
pivotKey: r[1],
|
|
@@ -3280,12 +3273,12 @@ function Ct() {
|
|
|
3280
3273
|
}
|
|
3281
3274
|
return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3282
3275
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3283
|
-
/* @__PURE__ */ e.jsx(
|
|
3276
|
+
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
3284
3277
|
/* @__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] }) }) })
|
|
3285
3278
|
] }),
|
|
3286
3279
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3287
3280
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3288
|
-
/* @__PURE__ */ e.jsx(
|
|
3281
|
+
/* @__PURE__ */ e.jsx(H, { children: a }),
|
|
3289
3282
|
/* @__PURE__ */ e.jsx(Nt, {})
|
|
3290
3283
|
] }),
|
|
3291
3284
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((c, m) => /* @__PURE__ */ e.jsx(Hn, { col: c, idx: m }, c)) })
|
|
@@ -3331,21 +3324,21 @@ function Hn({ col: s, idx: n }) {
|
|
|
3331
3324
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
3332
3325
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3333
3326
|
/* @__PURE__ */ e.jsx(
|
|
3334
|
-
|
|
3327
|
+
Ns,
|
|
3335
3328
|
{
|
|
3336
3329
|
onClick: () => r("bar"),
|
|
3337
3330
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3338
3331
|
}
|
|
3339
3332
|
),
|
|
3340
3333
|
/* @__PURE__ */ e.jsx(
|
|
3341
|
-
|
|
3334
|
+
Cs,
|
|
3342
3335
|
{
|
|
3343
3336
|
onClick: () => r("line"),
|
|
3344
3337
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3345
3338
|
}
|
|
3346
3339
|
),
|
|
3347
3340
|
/* @__PURE__ */ e.jsx(
|
|
3348
|
-
|
|
3341
|
+
$a,
|
|
3349
3342
|
{
|
|
3350
3343
|
onClick: () => r("area"),
|
|
3351
3344
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3366,9 +3359,9 @@ function Bn({
|
|
|
3366
3359
|
cardType: s
|
|
3367
3360
|
}) {
|
|
3368
3361
|
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(
|
|
3370
|
-
/* @__PURE__ */ e.jsx(
|
|
3371
|
-
/* @__PURE__ */ e.jsxs(
|
|
3362
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3363
|
+
/* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
|
|
3364
|
+
/* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
|
|
3372
3365
|
/* @__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" }),
|
|
3373
3366
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3374
3367
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3391,16 +3384,16 @@ function Bn({
|
|
|
3391
3384
|
] })
|
|
3392
3385
|
] })
|
|
3393
3386
|
] }),
|
|
3394
|
-
/* @__PURE__ */ e.jsxs(
|
|
3395
|
-
/* @__PURE__ */ e.jsx(
|
|
3396
|
-
/* @__PURE__ */ e.jsxs(
|
|
3387
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3388
|
+
/* @__PURE__ */ e.jsx(V, { children: "Settings" }),
|
|
3389
|
+
/* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
|
|
3397
3390
|
/* @__PURE__ */ e.jsx(Ss, {}),
|
|
3398
3391
|
/* @__PURE__ */ e.jsx(Ct, {})
|
|
3399
3392
|
] })
|
|
3400
3393
|
] }),
|
|
3401
|
-
/* @__PURE__ */ e.jsxs(
|
|
3402
|
-
/* @__PURE__ */ e.jsx(
|
|
3403
|
-
/* @__PURE__ */ e.jsx(
|
|
3394
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3395
|
+
/* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
|
|
3396
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3404
3397
|
] })
|
|
3405
3398
|
] }) });
|
|
3406
3399
|
}
|
|
@@ -3486,17 +3479,17 @@ function $n({
|
|
|
3486
3479
|
] });
|
|
3487
3480
|
}
|
|
3488
3481
|
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(
|
|
3490
|
-
/* @__PURE__ */ e.jsx(
|
|
3491
|
-
/* @__PURE__ */ e.jsx(
|
|
3482
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3483
|
+
/* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
|
|
3484
|
+
/* @__PURE__ */ e.jsx(R, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3492
3485
|
] }),
|
|
3493
|
-
/* @__PURE__ */ e.jsxs(
|
|
3494
|
-
/* @__PURE__ */ e.jsx(
|
|
3495
|
-
/* @__PURE__ */ e.jsx(
|
|
3486
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3487
|
+
/* @__PURE__ */ e.jsx(V, { children: "Settings" }),
|
|
3488
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
|
|
3496
3489
|
] }),
|
|
3497
|
-
/* @__PURE__ */ e.jsxs(
|
|
3498
|
-
/* @__PURE__ */ e.jsx(
|
|
3499
|
-
/* @__PURE__ */ e.jsx(
|
|
3490
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3491
|
+
/* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
|
|
3492
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3500
3493
|
] })
|
|
3501
3494
|
] }) });
|
|
3502
3495
|
}
|
|
@@ -3543,9 +3536,9 @@ function Gn() {
|
|
|
3543
3536
|
function Jn(s) {
|
|
3544
3537
|
if (["line", "bar"].includes(s))
|
|
3545
3538
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3546
|
-
/* @__PURE__ */ e.jsxs(
|
|
3547
|
-
/* @__PURE__ */ e.jsx(
|
|
3548
|
-
/* @__PURE__ */ e.jsxs(
|
|
3539
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3540
|
+
/* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3541
|
+
/* @__PURE__ */ e.jsxs(R, { className: " ", children: [
|
|
3549
3542
|
/* @__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" }),
|
|
3550
3543
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3551
3544
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
|
|
@@ -3553,9 +3546,9 @@ function Jn(s) {
|
|
|
3553
3546
|
] })
|
|
3554
3547
|
] })
|
|
3555
3548
|
] }),
|
|
3556
|
-
/* @__PURE__ */ e.jsxs(
|
|
3557
|
-
/* @__PURE__ */ e.jsx(
|
|
3558
|
-
/* @__PURE__ */ e.jsxs(
|
|
3549
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3550
|
+
/* @__PURE__ */ e.jsx(V, { className: " font-normal", children: "Mixed Chart" }),
|
|
3551
|
+
/* @__PURE__ */ e.jsxs(R, { className: " text-xs space-y-2", children: [
|
|
3559
3552
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3560
3553
|
"Click ",
|
|
3561
3554
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3564,9 +3557,9 @@ function Jn(s) {
|
|
|
3564
3557
|
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Kn, null, 2) })
|
|
3565
3558
|
] })
|
|
3566
3559
|
] }),
|
|
3567
|
-
/* @__PURE__ */ e.jsxs(
|
|
3568
|
-
/* @__PURE__ */ e.jsx(
|
|
3569
|
-
/* @__PURE__ */ e.jsxs(
|
|
3560
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3561
|
+
/* @__PURE__ */ e.jsx(V, { className: " font-normal", children: "Area Chart" }),
|
|
3562
|
+
/* @__PURE__ */ e.jsxs(R, { className: " text-xs space-y-2", children: [
|
|
3570
3563
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3571
3564
|
"Click ",
|
|
3572
3565
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3587,13 +3580,13 @@ function Jn(s) {
|
|
|
3587
3580
|
] })
|
|
3588
3581
|
] });
|
|
3589
3582
|
if (s === "bubble")
|
|
3590
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3591
|
-
/* @__PURE__ */ e.jsx(
|
|
3583
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3584
|
+
/* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3592
3585
|
"How to create a ",
|
|
3593
3586
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3594
3587
|
" chart query?"
|
|
3595
3588
|
] }) }),
|
|
3596
|
-
/* @__PURE__ */ e.jsxs(
|
|
3589
|
+
/* @__PURE__ */ e.jsxs(R, { className: " ", children: [
|
|
3597
3590
|
/* @__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" }),
|
|
3598
3591
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3599
3592
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3605,13 +3598,13 @@ function Jn(s) {
|
|
|
3605
3598
|
] })
|
|
3606
3599
|
] }) });
|
|
3607
3600
|
if (s === "scatter")
|
|
3608
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3609
|
-
/* @__PURE__ */ e.jsx(
|
|
3601
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3602
|
+
/* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3610
3603
|
"How to create a ",
|
|
3611
3604
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3612
3605
|
" chart query?"
|
|
3613
3606
|
] }) }),
|
|
3614
|
-
/* @__PURE__ */ e.jsxs(
|
|
3607
|
+
/* @__PURE__ */ e.jsxs(R, { className: " ", children: [
|
|
3615
3608
|
/* @__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" }),
|
|
3616
3609
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3617
3610
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3622,13 +3615,13 @@ function Jn(s) {
|
|
|
3622
3615
|
] })
|
|
3623
3616
|
] }) });
|
|
3624
3617
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3625
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3626
|
-
/* @__PURE__ */ e.jsx(
|
|
3618
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3619
|
+
/* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3627
3620
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3628
3621
|
" ",
|
|
3629
3622
|
"chart query"
|
|
3630
3623
|
] }) }),
|
|
3631
|
-
/* @__PURE__ */ e.jsxs(
|
|
3624
|
+
/* @__PURE__ */ e.jsxs(R, { className: " ", children: [
|
|
3632
3625
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, measure FROM table" }),
|
|
3633
3626
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
|
|
3634
3627
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3678,42 +3671,42 @@ function Qn() {
|
|
|
3678
3671
|
}
|
|
3679
3672
|
}
|
|
3680
3673
|
),
|
|
3681
|
-
/* @__PURE__ */ e.jsx(
|
|
3674
|
+
/* @__PURE__ */ e.jsx(H, { children: "Format Number" })
|
|
3682
3675
|
] }),
|
|
3683
3676
|
((d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3684
3677
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3685
|
-
/* @__PURE__ */ e.jsx(
|
|
3678
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-xs", children: "Currency" }),
|
|
3686
3679
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3687
3680
|
/* @__PURE__ */ e.jsx(
|
|
3688
|
-
|
|
3681
|
+
W,
|
|
3689
3682
|
{
|
|
3690
3683
|
value: o || "",
|
|
3691
3684
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3692
3685
|
placeholder: "USD",
|
|
3693
3686
|
onChange: (m) => {
|
|
3694
|
-
var h, u,
|
|
3687
|
+
var h, u, g;
|
|
3695
3688
|
return t(
|
|
3696
3689
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
|
|
3697
3690
|
m.target.value,
|
|
3698
3691
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
|
|
3699
|
-
((
|
|
3692
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || ""
|
|
3700
3693
|
);
|
|
3701
3694
|
}
|
|
3702
3695
|
}
|
|
3703
3696
|
),
|
|
3704
3697
|
/* @__PURE__ */ e.jsx(
|
|
3705
|
-
|
|
3698
|
+
W,
|
|
3706
3699
|
{
|
|
3707
3700
|
value: i || "",
|
|
3708
3701
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3709
3702
|
placeholder: "en-US",
|
|
3710
3703
|
onChange: (m) => {
|
|
3711
|
-
var h, u,
|
|
3704
|
+
var h, u, g;
|
|
3712
3705
|
return t(
|
|
3713
3706
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
|
|
3714
3707
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
3715
3708
|
m.target.value,
|
|
3716
|
-
((
|
|
3709
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || ""
|
|
3717
3710
|
);
|
|
3718
3711
|
}
|
|
3719
3712
|
}
|
|
@@ -3722,7 +3715,7 @@ function Qn() {
|
|
|
3722
3715
|
] }),
|
|
3723
3716
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3724
3717
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3725
|
-
/* @__PURE__ */ e.jsx(
|
|
3718
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-xs", children: "Format" }),
|
|
3726
3719
|
/* @__PURE__ */ e.jsxs(We, { children: [
|
|
3727
3720
|
/* @__PURE__ */ e.jsx(ms, { children: /* @__PURE__ */ e.jsx(
|
|
3728
3721
|
Zs,
|
|
@@ -3738,37 +3731,37 @@ function Qn() {
|
|
|
3738
3731
|
] })
|
|
3739
3732
|
] }),
|
|
3740
3733
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
3741
|
-
|
|
3734
|
+
W,
|
|
3742
3735
|
{
|
|
3743
3736
|
value: a || "",
|
|
3744
3737
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3745
3738
|
placeholder: "###,###.##",
|
|
3746
3739
|
onChange: (m) => {
|
|
3747
|
-
var h, u,
|
|
3740
|
+
var h, u, g;
|
|
3748
3741
|
return t(
|
|
3749
3742
|
m.target.value,
|
|
3750
3743
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.currency) || "",
|
|
3751
3744
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
|
|
3752
|
-
((
|
|
3745
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.suffix) || ""
|
|
3753
3746
|
);
|
|
3754
3747
|
}
|
|
3755
3748
|
}
|
|
3756
3749
|
) })
|
|
3757
3750
|
] }),
|
|
3758
3751
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3759
|
-
/* @__PURE__ */ e.jsx(
|
|
3752
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-xs", children: "Suffix" }),
|
|
3760
3753
|
/* @__PURE__ */ e.jsx(
|
|
3761
|
-
|
|
3754
|
+
W,
|
|
3762
3755
|
{
|
|
3763
3756
|
value: ((c = s == null ? void 0 : s.formatNumber) == null ? void 0 : c.suffix) || "",
|
|
3764
3757
|
className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3765
3758
|
placeholder: "K, M, B",
|
|
3766
3759
|
onChange: (m) => {
|
|
3767
|
-
var h, u,
|
|
3760
|
+
var h, u, g;
|
|
3768
3761
|
return t(
|
|
3769
3762
|
((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
|
|
3770
3763
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
3771
|
-
((
|
|
3764
|
+
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
|
|
3772
3765
|
m.target.value
|
|
3773
3766
|
);
|
|
3774
3767
|
}
|
|
@@ -3780,9 +3773,9 @@ function Qn() {
|
|
|
3780
3773
|
}
|
|
3781
3774
|
function Wn() {
|
|
3782
3775
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3783
|
-
/* @__PURE__ */ e.jsx(Ce, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3784
|
-
/* @__PURE__ */ e.jsx(
|
|
3785
|
-
/* @__PURE__ */ e.jsxs(
|
|
3776
|
+
/* @__PURE__ */ e.jsx(Ce, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3777
|
+
/* @__PURE__ */ e.jsx(V, { className: "", children: "KPI Query" }),
|
|
3778
|
+
/* @__PURE__ */ e.jsxs(R, { className: "font-mono", children: [
|
|
3786
3779
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
3787
3780
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3788
3781
|
/* @__PURE__ */ e.jsx("li", { children: "current - number" }),
|
|
@@ -3813,9 +3806,9 @@ function Pn({
|
|
|
3813
3806
|
cardType: s
|
|
3814
3807
|
}) {
|
|
3815
3808
|
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(
|
|
3817
|
-
/* @__PURE__ */ e.jsx(
|
|
3818
|
-
/* @__PURE__ */ e.jsxs(
|
|
3809
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3810
|
+
/* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
|
|
3811
|
+
/* @__PURE__ */ e.jsxs(R, { className: " space-y-4 font-mono text-xs ", children: [
|
|
3819
3812
|
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: "SELECT label, measure FROM table" }),
|
|
3820
3813
|
/* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
|
|
3821
3814
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
@@ -3837,21 +3830,21 @@ function Pn({
|
|
|
3837
3830
|
] })
|
|
3838
3831
|
] })
|
|
3839
3832
|
] }),
|
|
3840
|
-
/* @__PURE__ */ e.jsxs(
|
|
3841
|
-
/* @__PURE__ */ e.jsx(
|
|
3842
|
-
/* @__PURE__ */ e.jsx(
|
|
3833
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3834
|
+
/* @__PURE__ */ e.jsx(V, { children: "Settings" }),
|
|
3835
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
|
|
3843
3836
|
] }),
|
|
3844
|
-
/* @__PURE__ */ e.jsxs(
|
|
3845
|
-
/* @__PURE__ */ e.jsx(
|
|
3846
|
-
/* @__PURE__ */ e.jsx(
|
|
3837
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3838
|
+
/* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
|
|
3839
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3847
3840
|
] })
|
|
3848
3841
|
] }) });
|
|
3849
3842
|
}
|
|
3850
3843
|
function Yn() {
|
|
3851
3844
|
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(
|
|
3853
|
-
/* @__PURE__ */ e.jsx(
|
|
3854
|
-
/* @__PURE__ */ e.jsxs(
|
|
3845
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3846
|
+
/* @__PURE__ */ e.jsx(V, { children: "Stacked Chart" }),
|
|
3847
|
+
/* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
|
|
3855
3848
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
3856
3849
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3857
3850
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3874,25 +3867,25 @@ function Yn() {
|
|
|
3874
3867
|
] })
|
|
3875
3868
|
] })
|
|
3876
3869
|
] }),
|
|
3877
|
-
/* @__PURE__ */ e.jsxs(
|
|
3878
|
-
/* @__PURE__ */ e.jsx(
|
|
3879
|
-
/* @__PURE__ */ e.jsxs(
|
|
3870
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3871
|
+
/* @__PURE__ */ e.jsx(V, { children: "Settings" }),
|
|
3872
|
+
/* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
|
|
3880
3873
|
/* @__PURE__ */ e.jsx(Ss, {}),
|
|
3881
3874
|
/* @__PURE__ */ e.jsx(Ct, {})
|
|
3882
3875
|
] })
|
|
3883
3876
|
] }),
|
|
3884
|
-
/* @__PURE__ */ e.jsxs(
|
|
3885
|
-
/* @__PURE__ */ e.jsx(
|
|
3886
|
-
/* @__PURE__ */ e.jsx(
|
|
3877
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3878
|
+
/* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
|
|
3879
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3887
3880
|
] })
|
|
3888
3881
|
] }) });
|
|
3889
3882
|
}
|
|
3890
3883
|
function Xn({
|
|
3891
3884
|
cardType: s
|
|
3892
3885
|
}) {
|
|
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(
|
|
3894
|
-
/* @__PURE__ */ e.jsx(
|
|
3895
|
-
/* @__PURE__ */ e.jsx(
|
|
3886
|
+
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(q, { value: "item-3", children: [
|
|
3887
|
+
/* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
|
|
3888
|
+
/* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
|
|
3896
3889
|
] }) }) });
|
|
3897
3890
|
}
|
|
3898
3891
|
function Zn() {
|
|
@@ -3920,7 +3913,7 @@ function Zn() {
|
|
|
3920
3913
|
return /* @__PURE__ */ e.jsx(Gn, {});
|
|
3921
3914
|
}
|
|
3922
3915
|
}
|
|
3923
|
-
return /* @__PURE__ */ e.jsx(
|
|
3916
|
+
return /* @__PURE__ */ e.jsx(ys, { className: "h-full w-full text-sm", children: n(s) });
|
|
3924
3917
|
}
|
|
3925
3918
|
function er() {
|
|
3926
3919
|
const s = l((n) => n.isShowingVisual);
|
|
@@ -3970,13 +3963,13 @@ function er() {
|
|
|
3970
3963
|
}
|
|
3971
3964
|
function sr({ authToken: s, onSave: n, onClose: t }) {
|
|
3972
3965
|
const a = l((r) => r.actions.setOnSave), i = l((r) => r.actions.setOnClose), o = S((r) => r.actions.setAuthToken);
|
|
3973
|
-
return
|
|
3966
|
+
return $(() => {
|
|
3974
3967
|
n && a(n), t && i(t);
|
|
3975
|
-
}, [n, a, t, i]),
|
|
3968
|
+
}, [n, a, t, i]), $(() => {
|
|
3976
3969
|
s && s.accessToken && o(s);
|
|
3977
|
-
}, [s, o]), /* @__PURE__ */ e.jsxs(
|
|
3978
|
-
/* @__PURE__ */ e.jsx(
|
|
3979
|
-
/* @__PURE__ */ e.jsx(
|
|
3970
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(Ea, { className: "rounded-none", role: "editor-panel", children: [
|
|
3971
|
+
/* @__PURE__ */ e.jsx(La, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(ut, {}) }),
|
|
3972
|
+
/* @__PURE__ */ e.jsx(Da, { children: /* @__PURE__ */ e.jsx(er, {}) })
|
|
3980
3973
|
] });
|
|
3981
3974
|
}
|
|
3982
3975
|
function tr() {
|
|
@@ -3992,7 +3985,7 @@ function tr() {
|
|
|
3992
3985
|
"div",
|
|
3993
3986
|
{
|
|
3994
3987
|
role: "editor-container",
|
|
3995
|
-
className:
|
|
3988
|
+
className: K("flex grow", {
|
|
3996
3989
|
block: t,
|
|
3997
3990
|
hidden: !t
|
|
3998
3991
|
}),
|
|
@@ -4008,18 +4001,18 @@ function ar({
|
|
|
4008
4001
|
(u) => u.actions.removeFilterValue
|
|
4009
4002
|
);
|
|
4010
4003
|
function h(u) {
|
|
4011
|
-
const
|
|
4012
|
-
|
|
4004
|
+
const g = ce(u.column_name), f = ce(a || ""), j = ce(i || ""), C = ce(n), v = as(
|
|
4005
|
+
j,
|
|
4013
4006
|
C
|
|
4014
|
-
),
|
|
4007
|
+
), b = `${v}.${g}`;
|
|
4015
4008
|
console.log(
|
|
4016
4009
|
"find",
|
|
4017
|
-
|
|
4010
|
+
b,
|
|
4018
4011
|
C,
|
|
4019
4012
|
f
|
|
4020
4013
|
);
|
|
4021
4014
|
const E = r == null ? void 0 : r.find(
|
|
4022
|
-
(T) => T.column ===
|
|
4015
|
+
(T) => T.column === b && T.table === C && (T.database === f || T.database === a)
|
|
4023
4016
|
);
|
|
4024
4017
|
if (E)
|
|
4025
4018
|
m(E.id), c(E.id);
|
|
@@ -4027,7 +4020,7 @@ function ar({
|
|
|
4027
4020
|
if (n === "api" && t) {
|
|
4028
4021
|
d({
|
|
4029
4022
|
id: $e(),
|
|
4030
|
-
column:
|
|
4023
|
+
column: b,
|
|
4031
4024
|
title: u.column_name,
|
|
4032
4025
|
dataType: u.data_type,
|
|
4033
4026
|
table: "api",
|
|
@@ -4038,7 +4031,7 @@ function ar({
|
|
|
4038
4031
|
sql: qs(
|
|
4039
4032
|
u.data_type,
|
|
4040
4033
|
v,
|
|
4041
|
-
|
|
4034
|
+
g
|
|
4042
4035
|
)
|
|
4043
4036
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4044
4037
|
});
|
|
@@ -4046,7 +4039,7 @@ function ar({
|
|
|
4046
4039
|
}
|
|
4047
4040
|
d({
|
|
4048
4041
|
id: $e(),
|
|
4049
|
-
column: `${v}.${
|
|
4042
|
+
column: `${v}.${g}`,
|
|
4050
4043
|
title: u.column_name,
|
|
4051
4044
|
dataType: u.data_type,
|
|
4052
4045
|
table: o || "",
|
|
@@ -4056,24 +4049,24 @@ function ar({
|
|
|
4056
4049
|
sql: qs(
|
|
4057
4050
|
u.data_type,
|
|
4058
4051
|
v,
|
|
4059
|
-
|
|
4052
|
+
g
|
|
4060
4053
|
)
|
|
4061
4054
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4062
4055
|
});
|
|
4063
4056
|
}
|
|
4064
4057
|
}
|
|
4065
4058
|
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) => {
|
|
4066
|
-
const
|
|
4059
|
+
const g = r == null ? void 0 : r.find(
|
|
4067
4060
|
(f) => f.column === ce(u.column_name) && f.table === o && f.database === a
|
|
4068
4061
|
);
|
|
4069
4062
|
return /* @__PURE__ */ e.jsx(
|
|
4070
4063
|
"div",
|
|
4071
4064
|
{
|
|
4072
4065
|
onClick: () => h(u),
|
|
4073
|
-
className:
|
|
4066
|
+
className: K(
|
|
4074
4067
|
"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",
|
|
4075
4068
|
{
|
|
4076
|
-
"bg-muted":
|
|
4069
|
+
"bg-muted": g
|
|
4077
4070
|
}
|
|
4078
4071
|
),
|
|
4079
4072
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -4092,7 +4085,7 @@ function nr() {
|
|
|
4092
4085
|
);
|
|
4093
4086
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
4094
4087
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
4095
|
-
/* @__PURE__ */ e.jsx(
|
|
4088
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
|
|
4096
4089
|
/* @__PURE__ */ e.jsx(
|
|
4097
4090
|
w,
|
|
4098
4091
|
{
|
|
@@ -4125,12 +4118,12 @@ function rr() {
|
|
|
4125
4118
|
"div",
|
|
4126
4119
|
{
|
|
4127
4120
|
role: "dashboard-plus-main",
|
|
4128
|
-
className:
|
|
4121
|
+
className: K("grow", {
|
|
4129
4122
|
hidden: n,
|
|
4130
4123
|
flex: !n
|
|
4131
4124
|
}),
|
|
4132
4125
|
children: [
|
|
4133
|
-
/* @__PURE__ */ e.jsx(
|
|
4126
|
+
/* @__PURE__ */ e.jsx(Ia, {}),
|
|
4134
4127
|
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(nr, {}) })
|
|
4135
4128
|
]
|
|
4136
4129
|
}
|
|
@@ -4145,11 +4138,11 @@ function lr() {
|
|
|
4145
4138
|
), /* @__PURE__ */ e.jsx(
|
|
4146
4139
|
"div",
|
|
4147
4140
|
{
|
|
4148
|
-
className:
|
|
4141
|
+
className: K(" p-2", {
|
|
4149
4142
|
hidden: !t
|
|
4150
4143
|
}),
|
|
4151
4144
|
children: /* @__PURE__ */ e.jsx(
|
|
4152
|
-
|
|
4145
|
+
qa,
|
|
4153
4146
|
{
|
|
4154
4147
|
onChange: (a) => {
|
|
4155
4148
|
if (a)
|
|
@@ -4185,9 +4178,9 @@ function cr({
|
|
|
4185
4178
|
showFooter: n = !0,
|
|
4186
4179
|
...t
|
|
4187
4180
|
}) {
|
|
4188
|
-
return /* @__PURE__ */ e.jsx(
|
|
4181
|
+
return /* @__PURE__ */ e.jsx(Va, { dashboardProps: t, children: /* @__PURE__ */ e.jsxs(Ra, { children: [
|
|
4189
4182
|
/* @__PURE__ */ e.jsx(lr, {}),
|
|
4190
|
-
/* @__PURE__ */ e.jsxs(
|
|
4183
|
+
/* @__PURE__ */ e.jsxs(_a, { ...t, children: [
|
|
4191
4184
|
s && /* @__PURE__ */ e.jsx(pn, {}),
|
|
4192
4185
|
/* @__PURE__ */ e.jsx(tr, {}),
|
|
4193
4186
|
/* @__PURE__ */ e.jsx(rr, {})
|