react-semaphor 0.0.219 → 0.0.221
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--e-e-oPV.js → dashboard-plus-ITycN_eH.js} +1165 -1144
- package/dist/chunks/{dashboard-plus-CEShCre6.js → dashboard-plus-thSVk9nq.js} +35 -35
- package/dist/chunks/{index-s35YyUnE.js → index-eAsFa2Wk.js} +12 -12
- package/dist/chunks/{index-uA5XMQEz.js → index-m8W9EJEj.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import xe, { useState as
|
|
1
|
+
import { P as M, b as k, j as e, Q as Ns, R as Cs, U as S, V as Xs, W as Ss, X as ks, Y as ws, Z as zs, _ as H, $ as le, a0 as et, J as st, O as De, a1 as _t, a2 as Ht, a3 as Bt, a4 as $t, a5 as Pt, a6 as Kt, a7 as _s, a8 as Be, a9 as Je, aa as ns, T as Fs, e as tt, g as Os, ab as Oe, ac as Me, f as ee, ad as Te, ae as Le, af as $e, ag as Ae, ah as X, ai as Ms, G as c, aj as Ue, ak as Qe, al as Gt, am as We, w as at, v as nt, t as ue, an as Jt, r as Ut, N as lt, s as Qt, ao as Wt, B as Yt, ap as rt, aq as Zt, L as Pe, S as Ts, z as Xt, n as Hs, ar as js, A as it, u as Ye, as as me, at as be, au as Ke, av as ot, aw as ct, ax as dt, ay as ht, az as mt, aA as ea, aB as sa, aC as ut, aD as ta, aE as aa, aF as na, aG as la, aH as ra, aI as bs, aJ as ia, aK as He, aL as ys, aM as Fe, aN as vs, aO as Bs, aP as oa, aQ as ca, aR as da, aS as ha, aT as ma, aU as ps, aV as ua, aW as $s, aX as xa, aY as Ps, aZ as pa, a_ as fa, a$ as ga, b0 as xt, l as ja, C as ba, E as Ks, d as ya, h as va, i as Na, o as Ca, b1 as Sa, m as ka, H as wa, b2 as za, b3 as Fa, b4 as Oa, b5 as fs, b6 as Ma, b7 as gs, b8 as Gs, K as Ta, b9 as La, ba as Da, bb as Ls, bc as Ee, bd as pt, be as Aa, bf as Ea, bg as Ia, bh as Va, bi as qa, bj as Ra, bk as Ce, bl as B, bm as $, bn as Ds, bo as P, bp as Js, bq as _a, br as Ha, bs as Ba, bt as $a, bu as Us, bv as Pa, bw as Ka, bx as Ga, by as Ja, bz as Ua, bA as Qa } from "./index-eAsFa2Wk.js";
|
|
2
|
+
import xe, { useState as O, useEffect as Q, useMemo as Wa, useRef as Ge } 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 Ya = M("Activity", [
|
|
10
10
|
[
|
|
11
11
|
"path",
|
|
12
12
|
{
|
|
@@ -21,7 +21,7 @@ const Yt = L("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 Za = 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 Xt = L("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 As = 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,7 +43,7 @@ const Ds = L("BarChart4", [
|
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
const
|
|
46
|
+
const Xa = M("Box", [
|
|
47
47
|
[
|
|
48
48
|
"path",
|
|
49
49
|
{
|
|
@@ -60,7 +60,7 @@ const Zt = L("Box", [
|
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
62
|
*/
|
|
63
|
-
const en =
|
|
63
|
+
const en = M("CircleX", [
|
|
64
64
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
65
65
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
66
66
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -71,7 +71,7 @@ const en = L("CircleX", [
|
|
|
71
71
|
* This source code is licensed under the ISC license.
|
|
72
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
73
73
|
*/
|
|
74
|
-
const sn =
|
|
74
|
+
const sn = M("Database", [
|
|
75
75
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
76
76
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
77
77
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -82,7 +82,7 @@ const sn = L("Database", [
|
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
84
|
*/
|
|
85
|
-
const
|
|
85
|
+
const tn = M("Eraser", [
|
|
86
86
|
[
|
|
87
87
|
"path",
|
|
88
88
|
{
|
|
@@ -99,7 +99,7 @@ const an = L("Eraser", [
|
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
101
|
*/
|
|
102
|
-
const
|
|
102
|
+
const ft = M("Filter", [
|
|
103
103
|
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
104
104
|
]);
|
|
105
105
|
/**
|
|
@@ -108,7 +108,7 @@ const fa = L("Filter", [
|
|
|
108
108
|
* This source code is licensed under the ISC license.
|
|
109
109
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
110
|
*/
|
|
111
|
-
const
|
|
111
|
+
const gt = M("GanttChart", [
|
|
112
112
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
113
113
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
114
114
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -119,7 +119,7 @@ const ga = L("GanttChart", [
|
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
121
|
*/
|
|
122
|
-
const
|
|
122
|
+
const an = M("Glasses", [
|
|
123
123
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
124
124
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
125
125
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -132,7 +132,7 @@ const tn = L("Glasses", [
|
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
133
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
134
134
|
*/
|
|
135
|
-
const nn =
|
|
135
|
+
const nn = M("Hammer", [
|
|
136
136
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
137
137
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
138
138
|
[
|
|
@@ -149,7 +149,7 @@ const nn = L("Hammer", [
|
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
151
|
*/
|
|
152
|
-
const ln =
|
|
152
|
+
const ln = M("Hash", [
|
|
153
153
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
154
154
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
155
155
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -161,7 +161,7 @@ const ln = L("Hash", [
|
|
|
161
161
|
* This source code is licensed under the ISC license.
|
|
162
162
|
* See the LICENSE file in the root directory of this source tree.
|
|
163
163
|
*/
|
|
164
|
-
const rn =
|
|
164
|
+
const rn = M("Key", [
|
|
165
165
|
["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" }],
|
|
166
166
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
167
167
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -172,7 +172,7 @@ const rn = L("Key", [
|
|
|
172
172
|
* This source code is licensed under the ISC license.
|
|
173
173
|
* See the LICENSE file in the root directory of this source tree.
|
|
174
174
|
*/
|
|
175
|
-
const Es =
|
|
175
|
+
const Es = M("LineChart", [
|
|
176
176
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
177
177
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
178
178
|
]);
|
|
@@ -182,7 +182,7 @@ const Es = L("LineChart", [
|
|
|
182
182
|
* This source code is licensed under the ISC license.
|
|
183
183
|
* See the LICENSE file in the root directory of this source tree.
|
|
184
184
|
*/
|
|
185
|
-
const on =
|
|
185
|
+
const on = M("ListEnd", [
|
|
186
186
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
187
187
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
188
188
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -195,7 +195,7 @@ const on = L("ListEnd", [
|
|
|
195
195
|
* This source code is licensed under the ISC license.
|
|
196
196
|
* See the LICENSE file in the root directory of this source tree.
|
|
197
197
|
*/
|
|
198
|
-
const cn =
|
|
198
|
+
const cn = M("ListStart", [
|
|
199
199
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
200
200
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
201
201
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -208,7 +208,7 @@ const cn = L("ListStart", [
|
|
|
208
208
|
* This source code is licensed under the ISC license.
|
|
209
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
210
|
*/
|
|
211
|
-
const dn =
|
|
211
|
+
const dn = M("ListX", [
|
|
212
212
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
213
213
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
214
214
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -221,7 +221,7 @@ const dn = L("ListX", [
|
|
|
221
221
|
* This source code is licensed under the ISC license.
|
|
222
222
|
* See the LICENSE file in the root directory of this source tree.
|
|
223
223
|
*/
|
|
224
|
-
const hn =
|
|
224
|
+
const hn = M("MessageSquareMore", [
|
|
225
225
|
["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" }],
|
|
226
226
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
227
227
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -233,7 +233,7 @@ const hn = L("MessageSquareMore", [
|
|
|
233
233
|
* This source code is licensed under the ISC license.
|
|
234
234
|
* See the LICENSE file in the root directory of this source tree.
|
|
235
235
|
*/
|
|
236
|
-
const mn =
|
|
236
|
+
const mn = M("Network", [
|
|
237
237
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
238
238
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
239
239
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -246,7 +246,7 @@ const mn = L("Network", [
|
|
|
246
246
|
* This source code is licensed under the ISC license.
|
|
247
247
|
* See the LICENSE file in the root directory of this source tree.
|
|
248
248
|
*/
|
|
249
|
-
const
|
|
249
|
+
const jt = M("Pencil", [
|
|
250
250
|
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
|
|
251
251
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
252
252
|
]);
|
|
@@ -256,7 +256,7 @@ const ja = L("Pencil", [
|
|
|
256
256
|
* This source code is licensed under the ISC license.
|
|
257
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
258
258
|
*/
|
|
259
|
-
const
|
|
259
|
+
const bt = M("PieChart", [
|
|
260
260
|
["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
|
|
261
261
|
["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
|
|
262
262
|
]);
|
|
@@ -266,7 +266,7 @@ const ba = L("PieChart", [
|
|
|
266
266
|
* This source code is licensed under the ISC license.
|
|
267
267
|
* See the LICENSE file in the root directory of this source tree.
|
|
268
268
|
*/
|
|
269
|
-
const un =
|
|
269
|
+
const un = M("Play", [
|
|
270
270
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
271
271
|
]);
|
|
272
272
|
/**
|
|
@@ -275,7 +275,7 @@ const un = L("Play", [
|
|
|
275
275
|
* This source code is licensed under the ISC license.
|
|
276
276
|
* See the LICENSE file in the root directory of this source tree.
|
|
277
277
|
*/
|
|
278
|
-
const xn =
|
|
278
|
+
const xn = M("Plug2", [
|
|
279
279
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
280
280
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
281
281
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -288,7 +288,7 @@ const xn = L("Plug2", [
|
|
|
288
288
|
* This source code is licensed under the ISC license.
|
|
289
289
|
* See the LICENSE file in the root directory of this source tree.
|
|
290
290
|
*/
|
|
291
|
-
const pn =
|
|
291
|
+
const pn = M("Save", [
|
|
292
292
|
[
|
|
293
293
|
"path",
|
|
294
294
|
{
|
|
@@ -305,7 +305,7 @@ const pn = L("Save", [
|
|
|
305
305
|
* This source code is licensed under the ISC license.
|
|
306
306
|
* See the LICENSE file in the root directory of this source tree.
|
|
307
307
|
*/
|
|
308
|
-
const
|
|
308
|
+
const yt = M("ScatterChart", [
|
|
309
309
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
310
310
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
311
311
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -319,7 +319,7 @@ const ya = L("ScatterChart", [
|
|
|
319
319
|
* This source code is licensed under the ISC license.
|
|
320
320
|
* See the LICENSE file in the root directory of this source tree.
|
|
321
321
|
*/
|
|
322
|
-
const fn =
|
|
322
|
+
const fn = M("ShieldQuestion", [
|
|
323
323
|
[
|
|
324
324
|
"path",
|
|
325
325
|
{
|
|
@@ -336,7 +336,7 @@ const fn = L("ShieldQuestion", [
|
|
|
336
336
|
* This source code is licensed under the ISC license.
|
|
337
337
|
* See the LICENSE file in the root directory of this source tree.
|
|
338
338
|
*/
|
|
339
|
-
const gn =
|
|
339
|
+
const gn = M("Sigma", [
|
|
340
340
|
["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
|
|
341
341
|
]);
|
|
342
342
|
/**
|
|
@@ -345,7 +345,7 @@ const gn = L("Sigma", [
|
|
|
345
345
|
* This source code is licensed under the ISC license.
|
|
346
346
|
* See the LICENSE file in the root directory of this source tree.
|
|
347
347
|
*/
|
|
348
|
-
const jn =
|
|
348
|
+
const jn = M("SwatchBook", [
|
|
349
349
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
350
350
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
351
351
|
["path", { d: "M 7 17h0.01", key: "10821z" }],
|
|
@@ -363,7 +363,7 @@ const jn = L("SwatchBook", [
|
|
|
363
363
|
* This source code is licensed under the ISC license.
|
|
364
364
|
* See the LICENSE file in the root directory of this source tree.
|
|
365
365
|
*/
|
|
366
|
-
const bn =
|
|
366
|
+
const bn = M("Tag", [
|
|
367
367
|
[
|
|
368
368
|
"path",
|
|
369
369
|
{
|
|
@@ -379,7 +379,7 @@ const bn = L("Tag", [
|
|
|
379
379
|
* This source code is licensed under the ISC license.
|
|
380
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
381
|
*/
|
|
382
|
-
const yn =
|
|
382
|
+
const yn = M("ToggleLeft", [
|
|
383
383
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
384
384
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
385
385
|
]);
|
|
@@ -389,7 +389,7 @@ const yn = L("ToggleLeft", [
|
|
|
389
389
|
* This source code is licensed under the ISC license.
|
|
390
390
|
* See the LICENSE file in the root directory of this source tree.
|
|
391
391
|
*/
|
|
392
|
-
const Is =
|
|
392
|
+
const Is = M("Type", [
|
|
393
393
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
394
394
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
395
395
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -400,24 +400,24 @@ const Is = L("Type", [
|
|
|
400
400
|
* This source code is licensed under the ISC license.
|
|
401
401
|
* See the LICENSE file in the root directory of this source tree.
|
|
402
402
|
*/
|
|
403
|
-
const vn =
|
|
403
|
+
const vn = M("User", [
|
|
404
404
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
405
405
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
406
406
|
]);
|
|
407
407
|
function Nn() {
|
|
408
|
-
const [s, n] =
|
|
408
|
+
const [s, n] = O(""), [t, a] = O(!1), [o, h] = O(!1), m = k((d) => d.dashboard);
|
|
409
409
|
function l() {
|
|
410
|
-
const d =
|
|
411
|
-
if (
|
|
412
|
-
(
|
|
410
|
+
const d = st(m), p = De(m.id), x = JSON.parse(localStorage.getItem(p) || "[]");
|
|
411
|
+
if (x.some(
|
|
412
|
+
(j) => j.name === s
|
|
413
413
|
)) {
|
|
414
|
-
|
|
414
|
+
a(!0);
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
x.push({
|
|
418
418
|
name: s,
|
|
419
419
|
template: d
|
|
420
|
-
}), localStorage.setItem(p, JSON.stringify(
|
|
420
|
+
}), localStorage.setItem(p, JSON.stringify(x)), h(!1);
|
|
421
421
|
}
|
|
422
422
|
return /* @__PURE__ */ e.jsxs(Ns, { open: o, onOpenChange: h, children: [
|
|
423
423
|
/* @__PURE__ */ e.jsx(Cs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -427,7 +427,7 @@ function Nn() {
|
|
|
427
427
|
className: "h-7 p-2",
|
|
428
428
|
size: "sm",
|
|
429
429
|
children: [
|
|
430
|
-
/* @__PURE__ */ e.jsx(
|
|
430
|
+
/* @__PURE__ */ e.jsx(Xs, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
431
431
|
"Add Lens"
|
|
432
432
|
]
|
|
433
433
|
}
|
|
@@ -438,21 +438,21 @@ function Nn() {
|
|
|
438
438
|
/* @__PURE__ */ e.jsx(zs, { children: "Lenses are private by default and are only visible to you." })
|
|
439
439
|
] }),
|
|
440
440
|
/* @__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: [
|
|
441
|
-
/* @__PURE__ */ e.jsx(
|
|
441
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
|
|
442
442
|
/* @__PURE__ */ e.jsx(
|
|
443
443
|
le,
|
|
444
444
|
{
|
|
445
445
|
value: s,
|
|
446
446
|
onChange: (d) => {
|
|
447
|
-
|
|
447
|
+
t && a(!1), n(d.target.value);
|
|
448
448
|
},
|
|
449
449
|
id: "name",
|
|
450
450
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
451
451
|
}
|
|
452
452
|
)
|
|
453
453
|
] }) }),
|
|
454
|
-
|
|
455
|
-
/* @__PURE__ */ e.jsx(
|
|
454
|
+
t && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
|
|
455
|
+
/* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsx(
|
|
456
456
|
S,
|
|
457
457
|
{
|
|
458
458
|
variant: "outline",
|
|
@@ -466,45 +466,45 @@ function Nn() {
|
|
|
466
466
|
] });
|
|
467
467
|
}
|
|
468
468
|
function Cn() {
|
|
469
|
-
const [s, n] =
|
|
469
|
+
const [s, n] = O(!1), [t, a] = O(""), o = k((i) => i.dashboard), h = k((i) => i.bookmarkKey), [m, l] = O([]), d = k((i) => i.actions.setDashboard), p = k(
|
|
470
470
|
(i) => i.actions.setFilterValues
|
|
471
|
-
),
|
|
471
|
+
), x = k(
|
|
472
472
|
(i) => i.actions.setBookmarkKey
|
|
473
473
|
);
|
|
474
|
-
|
|
475
|
-
const i =
|
|
476
|
-
l(
|
|
477
|
-
const f =
|
|
478
|
-
(
|
|
474
|
+
Q(() => {
|
|
475
|
+
const i = De(o.id), u = JSON.parse(localStorage.getItem(i) || "[]");
|
|
476
|
+
l(u);
|
|
477
|
+
const f = u.find(
|
|
478
|
+
(z) => z.default
|
|
479
479
|
);
|
|
480
|
-
f && f.name === h &&
|
|
480
|
+
f && f.name === h && a(f.name);
|
|
481
481
|
}, [s, o, h]);
|
|
482
482
|
function g(i) {
|
|
483
|
-
if (i ===
|
|
483
|
+
if (i === t)
|
|
484
484
|
return;
|
|
485
|
-
const
|
|
486
|
-
f && (d(f), p(
|
|
485
|
+
const u = m.find((z) => z.name === i), f = u == null ? void 0 : u.template;
|
|
486
|
+
f && (d(f), p(u.filterValues || []), x(i === "Original" ? "" : i)), a(i);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
const
|
|
488
|
+
function j(i) {
|
|
489
|
+
const u = De(o.id), z = JSON.parse(localStorage.getItem(u) || "[]").filter(
|
|
490
490
|
(N) => N.name !== i
|
|
491
491
|
);
|
|
492
|
-
localStorage.setItem(
|
|
492
|
+
localStorage.setItem(u, JSON.stringify(z)), l(z);
|
|
493
493
|
}
|
|
494
|
-
return /* @__PURE__ */ e.jsxs(
|
|
495
|
-
/* @__PURE__ */ e.jsx(
|
|
496
|
-
/* @__PURE__ */ e.jsxs(
|
|
497
|
-
/* @__PURE__ */ e.jsx($
|
|
498
|
-
/* @__PURE__ */ e.jsx(
|
|
494
|
+
return /* @__PURE__ */ e.jsxs(_t, { open: s, onOpenChange: n, children: [
|
|
495
|
+
/* @__PURE__ */ e.jsx(Ht, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(an, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
496
|
+
/* @__PURE__ */ e.jsxs(Bt, { className: "w-56", children: [
|
|
497
|
+
/* @__PURE__ */ e.jsx($t, { children: "Lenses" }),
|
|
498
|
+
/* @__PURE__ */ e.jsx(Pt, {}),
|
|
499
499
|
/* @__PURE__ */ e.jsxs(
|
|
500
|
-
|
|
500
|
+
Kt,
|
|
501
501
|
{
|
|
502
|
-
value:
|
|
502
|
+
value: t,
|
|
503
503
|
onValueChange: g,
|
|
504
504
|
children: [
|
|
505
|
-
/* @__PURE__ */ e.jsx(
|
|
506
|
-
m.filter((i) => i.name != "Original").map((i,
|
|
507
|
-
|
|
505
|
+
/* @__PURE__ */ e.jsx(_s, { value: "Original", children: "Original" }),
|
|
506
|
+
m.filter((i) => i.name != "Original").map((i, u) => /* @__PURE__ */ e.jsxs(
|
|
507
|
+
_s,
|
|
508
508
|
{
|
|
509
509
|
className: "xbg-red-100 flex justify-between",
|
|
510
510
|
value: i.name,
|
|
@@ -515,7 +515,7 @@ function Cn() {
|
|
|
515
515
|
Be,
|
|
516
516
|
{
|
|
517
517
|
onClick: (f) => {
|
|
518
|
-
f.preventDefault(),
|
|
518
|
+
f.preventDefault(), j(i.name);
|
|
519
519
|
},
|
|
520
520
|
className: "h-3 w-3 hover:cursor-pointer",
|
|
521
521
|
strokeWidth: 1.5
|
|
@@ -523,7 +523,7 @@ function Cn() {
|
|
|
523
523
|
)
|
|
524
524
|
]
|
|
525
525
|
},
|
|
526
|
-
|
|
526
|
+
u
|
|
527
527
|
))
|
|
528
528
|
]
|
|
529
529
|
}
|
|
@@ -532,30 +532,30 @@ function Cn() {
|
|
|
532
532
|
] });
|
|
533
533
|
}
|
|
534
534
|
function Sn() {
|
|
535
|
-
const [s, n] =
|
|
536
|
-
|
|
537
|
-
if (!
|
|
535
|
+
const [s, n] = O(!1), t = k((h) => h.dashboard), a = k((h) => h.bookmarkKey);
|
|
536
|
+
Q(() => {
|
|
537
|
+
if (!a) {
|
|
538
538
|
n(!1);
|
|
539
539
|
return;
|
|
540
540
|
}
|
|
541
|
-
const h =
|
|
541
|
+
const h = De(t.id), l = JSON.parse(
|
|
542
542
|
localStorage.getItem(h) || "[]"
|
|
543
543
|
).find(
|
|
544
|
-
(d) => d.name ===
|
|
544
|
+
(d) => d.name === a
|
|
545
545
|
);
|
|
546
546
|
n(l ? l.default : !1);
|
|
547
|
-
}, [
|
|
547
|
+
}, [a, t.id]);
|
|
548
548
|
function o(h) {
|
|
549
|
-
if (n(h), !
|
|
549
|
+
if (n(h), !a)
|
|
550
550
|
return;
|
|
551
|
-
const m =
|
|
551
|
+
const m = De(t.id), d = JSON.parse(
|
|
552
552
|
localStorage.getItem(m) || "[]"
|
|
553
|
-
).map((p) => (p.name ===
|
|
553
|
+
).map((p) => (p.name === a ? p.default = h : p.default = !1, p));
|
|
554
554
|
console.log(d), localStorage.setItem(m, JSON.stringify(d));
|
|
555
555
|
}
|
|
556
556
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
557
557
|
/* @__PURE__ */ e.jsx(
|
|
558
|
-
|
|
558
|
+
Je,
|
|
559
559
|
{
|
|
560
560
|
checked: s,
|
|
561
561
|
onCheckedChange: o,
|
|
@@ -575,9 +575,9 @@ function Sn() {
|
|
|
575
575
|
function kn() {
|
|
576
576
|
const s = k((N) => N.bookmarkKey), n = k((N) => N.dashboard);
|
|
577
577
|
k((N) => N.selectedSheetId);
|
|
578
|
-
const
|
|
578
|
+
const t = k(
|
|
579
579
|
(N) => N.isDashboardEditing
|
|
580
|
-
),
|
|
580
|
+
), a = k((N) => N.filterValues), o = k((N) => N.isVisualEditing), h = k((N) => N.showFilters);
|
|
581
581
|
k(
|
|
582
582
|
(N) => N.showDashboardJSON
|
|
583
583
|
);
|
|
@@ -585,8 +585,8 @@ function kn() {
|
|
|
585
585
|
(N) => N.actions.setShowFilters
|
|
586
586
|
), { addFrame: d, setSelectedFrameId: p } = k(
|
|
587
587
|
(N) => N.actions
|
|
588
|
-
), { getSelectedSheet:
|
|
589
|
-
if (!
|
|
588
|
+
), { getSelectedSheet: x, setIsDashboardEditing: g, setShowDashboardJSON: j } = k((N) => N.actions), i = x(), u = () => {
|
|
589
|
+
if (!t || !i)
|
|
590
590
|
return;
|
|
591
591
|
const N = {
|
|
592
592
|
id: ns(),
|
|
@@ -603,31 +603,31 @@ function kn() {
|
|
|
603
603
|
type: "bar",
|
|
604
604
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
605
605
|
data: []
|
|
606
|
-
},
|
|
606
|
+
}, D = {
|
|
607
607
|
id: ns(),
|
|
608
608
|
cards: [N],
|
|
609
609
|
activeCardId: N.id
|
|
610
610
|
};
|
|
611
|
-
d(i.id,
|
|
611
|
+
d(i.id, D), p(D.id);
|
|
612
612
|
}, f = () => {
|
|
613
613
|
g(!0);
|
|
614
614
|
};
|
|
615
|
-
function
|
|
615
|
+
function z() {
|
|
616
616
|
if (!s || s === "")
|
|
617
617
|
return;
|
|
618
|
-
const N =
|
|
619
|
-
(
|
|
618
|
+
const N = st(n), D = De(n.id), b = JSON.parse(localStorage.getItem(D) || "[]"), A = b.findIndex(
|
|
619
|
+
(E) => E.name === s
|
|
620
620
|
);
|
|
621
|
-
A !== -1 ?
|
|
621
|
+
A !== -1 ? b[A] = {
|
|
622
622
|
name: s,
|
|
623
623
|
template: N,
|
|
624
|
-
default:
|
|
625
|
-
filterValues:
|
|
626
|
-
} :
|
|
624
|
+
default: b[A].default,
|
|
625
|
+
filterValues: a
|
|
626
|
+
} : b.push({
|
|
627
627
|
name: s,
|
|
628
628
|
template: N,
|
|
629
|
-
filterValues:
|
|
630
|
-
}), localStorage.setItem(
|
|
629
|
+
filterValues: a
|
|
630
|
+
}), localStorage.setItem(D, JSON.stringify(b)), m == null || m(N);
|
|
631
631
|
}
|
|
632
632
|
return o ? null : /* @__PURE__ */ e.jsxs(
|
|
633
633
|
"div",
|
|
@@ -636,73 +636,73 @@ function kn() {
|
|
|
636
636
|
role: "dashboard-controls",
|
|
637
637
|
children: [
|
|
638
638
|
!o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
639
|
-
/* @__PURE__ */ e.jsx(
|
|
639
|
+
/* @__PURE__ */ e.jsx(H, { children: s }),
|
|
640
640
|
!!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
641
641
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
|
|
642
642
|
/* @__PURE__ */ e.jsx(Sn, {})
|
|
643
643
|
] })
|
|
644
644
|
] }),
|
|
645
645
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
646
|
-
|
|
646
|
+
t && !o && /* @__PURE__ */ e.jsx(Nn, {}),
|
|
647
647
|
!o && /* @__PURE__ */ e.jsx(Cn, {}),
|
|
648
|
-
|
|
648
|
+
t && !o && /* @__PURE__ */ e.jsxs(
|
|
649
649
|
S,
|
|
650
650
|
{
|
|
651
651
|
variant: "outline",
|
|
652
652
|
className: "h-7 p-2",
|
|
653
653
|
size: "sm",
|
|
654
|
-
disabled: !
|
|
655
|
-
onClick:
|
|
654
|
+
disabled: !t,
|
|
655
|
+
onClick: u,
|
|
656
656
|
children: [
|
|
657
|
-
/* @__PURE__ */ e.jsx(
|
|
657
|
+
/* @__PURE__ */ e.jsx(Xs, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
658
658
|
"Add Frame"
|
|
659
659
|
]
|
|
660
660
|
}
|
|
661
661
|
),
|
|
662
|
-
!
|
|
662
|
+
!t && /* @__PURE__ */ e.jsx(
|
|
663
663
|
S,
|
|
664
664
|
{
|
|
665
665
|
variant: "outline",
|
|
666
666
|
className: "h-7 p-2",
|
|
667
667
|
onClick: f,
|
|
668
668
|
size: "sm",
|
|
669
|
-
children: /* @__PURE__ */ e.jsx(
|
|
669
|
+
children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
670
670
|
}
|
|
671
671
|
),
|
|
672
|
-
|
|
672
|
+
t && !o && /* @__PURE__ */ e.jsx(
|
|
673
673
|
S,
|
|
674
674
|
{
|
|
675
675
|
variant: "outline",
|
|
676
676
|
role: "close",
|
|
677
677
|
className: "h-7 p-2",
|
|
678
678
|
onClick: () => {
|
|
679
|
-
g(!1),
|
|
679
|
+
g(!1), j(!1);
|
|
680
680
|
},
|
|
681
681
|
size: "sm",
|
|
682
682
|
children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
683
683
|
}
|
|
684
684
|
),
|
|
685
|
-
|
|
685
|
+
t && !o && /* @__PURE__ */ e.jsx(
|
|
686
686
|
S,
|
|
687
687
|
{
|
|
688
688
|
className: "h-7 p-2",
|
|
689
689
|
variant: "outline",
|
|
690
|
-
onClick:
|
|
690
|
+
onClick: z,
|
|
691
691
|
size: "sm",
|
|
692
692
|
children: /* @__PURE__ */ e.jsx(pn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
|
-
!h && !o &&
|
|
695
|
+
!h && !o && t && /* @__PURE__ */ e.jsx(
|
|
696
696
|
S,
|
|
697
697
|
{
|
|
698
698
|
className: "h-7 p-2",
|
|
699
699
|
variant: "outline",
|
|
700
700
|
onClick: () => l(!0),
|
|
701
701
|
size: "sm",
|
|
702
|
-
children: /* @__PURE__ */ e.jsx(
|
|
702
|
+
children: /* @__PURE__ */ e.jsx(ft, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
703
703
|
}
|
|
704
704
|
),
|
|
705
|
-
!o &&
|
|
705
|
+
!o && t && !1,
|
|
706
706
|
!o && !1
|
|
707
707
|
] })
|
|
708
708
|
]
|
|
@@ -712,18 +712,18 @@ function kn() {
|
|
|
712
712
|
function _e({
|
|
713
713
|
title: s,
|
|
714
714
|
items: n,
|
|
715
|
-
value:
|
|
716
|
-
isLoading:
|
|
715
|
+
value: t,
|
|
716
|
+
isLoading: a,
|
|
717
717
|
isError: o,
|
|
718
718
|
connectionTooltip: h,
|
|
719
719
|
onChange: m,
|
|
720
720
|
showNone: l = !1,
|
|
721
721
|
className: d,
|
|
722
722
|
showIcon: p = !0,
|
|
723
|
-
disabled:
|
|
723
|
+
disabled: x = !1
|
|
724
724
|
}) {
|
|
725
|
-
const g =
|
|
726
|
-
function
|
|
725
|
+
const g = a ? "Loading..." : o ? "Error" : t;
|
|
726
|
+
function j() {
|
|
727
727
|
if (s === "Connection")
|
|
728
728
|
return /* @__PURE__ */ e.jsx(xn, { className: "size-4 rotate-90" });
|
|
729
729
|
if (s === "Database")
|
|
@@ -733,56 +733,62 @@ function _e({
|
|
|
733
733
|
if (s === "Table")
|
|
734
734
|
return /* @__PURE__ */ e.jsx(Ms, { className: "size-4" });
|
|
735
735
|
if (s === "Dataset")
|
|
736
|
-
return /* @__PURE__ */ e.jsx(
|
|
736
|
+
return /* @__PURE__ */ e.jsx(Xa, { className: "size-4" });
|
|
737
737
|
}
|
|
738
738
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
739
739
|
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: h ? /* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
740
|
-
/* @__PURE__ */ e.jsx(
|
|
740
|
+
/* @__PURE__ */ e.jsx(tt, { children: j() }),
|
|
741
741
|
/* @__PURE__ */ e.jsx(Os, { className: "text-xs", align: "start", children: h })
|
|
742
|
-
] }) :
|
|
743
|
-
/* @__PURE__ */ e.jsxs(Oe, { disabled:
|
|
742
|
+
] }) : j() }),
|
|
743
|
+
/* @__PURE__ */ e.jsxs(Oe, { disabled: x, value: g, onValueChange: m, children: [
|
|
744
744
|
/* @__PURE__ */ e.jsx(
|
|
745
745
|
Me,
|
|
746
746
|
{
|
|
747
|
-
className:
|
|
747
|
+
className: ee(
|
|
748
748
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
749
749
|
d
|
|
750
750
|
),
|
|
751
751
|
children: /* @__PURE__ */ e.jsx(
|
|
752
752
|
Te,
|
|
753
753
|
{
|
|
754
|
-
placeholder:
|
|
754
|
+
placeholder: a ? "Loading..." : o ? "Error" : `Select ${s}`
|
|
755
755
|
}
|
|
756
756
|
)
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
759
|
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs($e, { children: [
|
|
760
|
-
|
|
760
|
+
a ? /* @__PURE__ */ e.jsx(Ae, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ae, { children: s }),
|
|
761
761
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
762
|
-
l && /* @__PURE__ */ e.jsx(
|
|
763
|
-
n && n.map((i,
|
|
762
|
+
l && /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
763
|
+
n && n.map((i, u) => /* @__PURE__ */ e.jsx(X, { value: i.id, children: i.name }, u))
|
|
764
764
|
] }),
|
|
765
|
-
(
|
|
765
|
+
(a || o) && /* @__PURE__ */ e.jsx(X, { value: g, children: g })
|
|
766
766
|
] }) })
|
|
767
767
|
] })
|
|
768
768
|
] });
|
|
769
769
|
}
|
|
770
770
|
function wn({ column: s }) {
|
|
771
|
-
const [n,
|
|
772
|
-
(
|
|
773
|
-
), h = c(
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
771
|
+
const [n, t] = O(!1), a = c((j) => j.selectedTableName), o = c(
|
|
772
|
+
(j) => j.selectedSchemaName
|
|
773
|
+
), h = c(
|
|
774
|
+
(j) => j.selectedDatamodelId
|
|
775
|
+
), m = c((j) => j.sqlGen), { modelItems: l } = is(), d = c((j) => j.actions.setSqlGen), p = c((j) => j.actions.setCardSql), x = c((j) => j.actions.setRunSql);
|
|
776
|
+
function g(j, i) {
|
|
777
|
+
var N;
|
|
778
|
+
const u = at(j, m, i), f = (N = l == null ? void 0 : l.find(
|
|
779
|
+
(D) => D.id === h
|
|
780
|
+
)) == null ? void 0 : N.name;
|
|
781
|
+
d(u);
|
|
782
|
+
const z = nt(
|
|
783
|
+
u,
|
|
779
784
|
ue(o || ""),
|
|
780
|
-
ue(
|
|
785
|
+
ue(a),
|
|
786
|
+
f
|
|
781
787
|
);
|
|
782
|
-
|
|
788
|
+
z && (p(z), x(!0)), t(!1);
|
|
783
789
|
}
|
|
784
|
-
return /* @__PURE__ */ e.jsxs(
|
|
785
|
-
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
790
|
+
return /* @__PURE__ */ e.jsxs(Ue, { open: n, onOpenChange: t, children: [
|
|
791
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(Gt, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
|
|
786
792
|
/* @__PURE__ */ e.jsx(
|
|
787
793
|
We,
|
|
788
794
|
{
|
|
@@ -792,7 +798,7 @@ function wn({ column: s }) {
|
|
|
792
798
|
/* @__PURE__ */ e.jsx(
|
|
793
799
|
"li",
|
|
794
800
|
{
|
|
795
|
-
onClick: () =>
|
|
801
|
+
onClick: () => g(s, "COUNT"),
|
|
796
802
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
797
803
|
children: "Count"
|
|
798
804
|
}
|
|
@@ -800,7 +806,7 @@ function wn({ column: s }) {
|
|
|
800
806
|
/* @__PURE__ */ e.jsx(
|
|
801
807
|
"li",
|
|
802
808
|
{
|
|
803
|
-
onClick: () =>
|
|
809
|
+
onClick: () => g(s, "AVG"),
|
|
804
810
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
805
811
|
children: "Avg"
|
|
806
812
|
}
|
|
@@ -808,7 +814,7 @@ function wn({ column: s }) {
|
|
|
808
814
|
/* @__PURE__ */ e.jsx(
|
|
809
815
|
"li",
|
|
810
816
|
{
|
|
811
|
-
onClick: () =>
|
|
817
|
+
onClick: () => g(s, "SUM"),
|
|
812
818
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
813
819
|
children: "Sum"
|
|
814
820
|
}
|
|
@@ -816,7 +822,7 @@ function wn({ column: s }) {
|
|
|
816
822
|
/* @__PURE__ */ e.jsx(
|
|
817
823
|
"li",
|
|
818
824
|
{
|
|
819
|
-
onClick: () =>
|
|
825
|
+
onClick: () => g(s, "MAX"),
|
|
820
826
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
821
827
|
children: "Max"
|
|
822
828
|
}
|
|
@@ -824,7 +830,7 @@ function wn({ column: s }) {
|
|
|
824
830
|
/* @__PURE__ */ e.jsx(
|
|
825
831
|
"li",
|
|
826
832
|
{
|
|
827
|
-
onClick: () =>
|
|
833
|
+
onClick: () => g(s, "MIN"),
|
|
828
834
|
className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
|
|
829
835
|
children: "Min"
|
|
830
836
|
}
|
|
@@ -834,101 +840,116 @@ function wn({ column: s }) {
|
|
|
834
840
|
)
|
|
835
841
|
] });
|
|
836
842
|
}
|
|
837
|
-
function
|
|
843
|
+
function vt({ column: s }) {
|
|
838
844
|
return /* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
839
|
-
/* @__PURE__ */ e.jsx(
|
|
845
|
+
/* @__PURE__ */ e.jsx(Jt, { asChild: !0, children: Ut.includes(s.data_type.toLowerCase()) ? (
|
|
840
846
|
// <span className=" font-thin">T</span>
|
|
841
847
|
/* @__PURE__ */ e.jsx(Is, { className: "size-3" })
|
|
842
|
-
) :
|
|
848
|
+
) : lt.includes(s.data_type.toLowerCase()) ? (
|
|
843
849
|
//
|
|
844
850
|
/* @__PURE__ */ e.jsx(ln, { className: "size-3" })
|
|
845
|
-
) :
|
|
851
|
+
) : Qt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Wt, { className: "size-3" }) : Yt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(yn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(fn, { className: "size-3" }) }),
|
|
846
852
|
/* @__PURE__ */ e.jsx(Os, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
847
853
|
] });
|
|
848
854
|
}
|
|
849
855
|
function zn({
|
|
850
856
|
schemaName: s,
|
|
851
857
|
tableName: n,
|
|
852
|
-
columns:
|
|
853
|
-
status:
|
|
858
|
+
columns: t,
|
|
859
|
+
status: a
|
|
854
860
|
}) {
|
|
855
|
-
const o = c((
|
|
856
|
-
(
|
|
861
|
+
const o = c((v) => v.sqlGen), h = c(
|
|
862
|
+
(v) => v.selectedConnectionId
|
|
857
863
|
), m = c(
|
|
858
|
-
(
|
|
864
|
+
(v) => v.selectedDatabaseName
|
|
859
865
|
), l = c(
|
|
860
|
-
(
|
|
861
|
-
), d = c((
|
|
862
|
-
(
|
|
863
|
-
),
|
|
864
|
-
(
|
|
865
|
-
),
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
866
|
+
(v) => v.selectedSchemaName
|
|
867
|
+
), d = c((v) => v.selectedTableName), p = c(
|
|
868
|
+
(v) => v.selectedDatamodelId
|
|
869
|
+
), x = k(
|
|
870
|
+
(v) => v.dashboard.aiScopeTables
|
|
871
|
+
), { setAIScopeTables: g } = k((v) => v.actions), j = c((v) => v.actions.setRunSql), i = c((v) => v.actions.setSqlGen), u = c(
|
|
872
|
+
(v) => v.actions.setIsShowingVisual
|
|
873
|
+
), f = c((v) => v.actions.setCardSql), { connectionType: z, modelItems: N } = is();
|
|
874
|
+
function D(v) {
|
|
875
|
+
var T;
|
|
876
|
+
const w = at(v, o);
|
|
877
|
+
i(w);
|
|
878
|
+
const q = (T = N == null ? void 0 : N.find(
|
|
879
|
+
(R) => R.id === p
|
|
880
|
+
)) == null ? void 0 : T.name, K = nt(w, ue(s), ue(n), q);
|
|
881
|
+
K && (f(K), j(!0));
|
|
871
882
|
}
|
|
872
|
-
function
|
|
873
|
-
return (
|
|
874
|
-
(
|
|
883
|
+
function b() {
|
|
884
|
+
return (x == null ? void 0 : x.find(
|
|
885
|
+
(v) => v.connectinonId === h && v.tableName === d
|
|
875
886
|
)) !== void 0;
|
|
876
887
|
}
|
|
877
|
-
function
|
|
878
|
-
if (
|
|
879
|
-
const
|
|
888
|
+
function A(v) {
|
|
889
|
+
if (v === !0 && d && h) {
|
|
890
|
+
const w = {
|
|
880
891
|
connectinonId: h,
|
|
881
|
-
connectionType:
|
|
892
|
+
connectionType: z,
|
|
882
893
|
databaseName: m,
|
|
883
894
|
schemaName: l,
|
|
884
895
|
tableName: d
|
|
885
|
-
},
|
|
886
|
-
(
|
|
887
|
-
(
|
|
888
|
-
) ===
|
|
896
|
+
}, K = [...x || [], w].filter(
|
|
897
|
+
(T, R, W) => W.findIndex(
|
|
898
|
+
(J) => J.connectinonId === T.connectinonId && J.tableName === T.tableName
|
|
899
|
+
) === R
|
|
889
900
|
);
|
|
890
|
-
|
|
901
|
+
g(K), js.success(`Added '${d}' to AI Scope`, {
|
|
891
902
|
position: "top-right",
|
|
892
903
|
duration: 2500,
|
|
893
904
|
richColors: !0
|
|
894
905
|
});
|
|
895
906
|
} else {
|
|
896
|
-
const
|
|
897
|
-
(
|
|
907
|
+
const w = (x || []).filter(
|
|
908
|
+
(q) => q.connectinonId !== h && q.tableName !== d
|
|
898
909
|
);
|
|
899
|
-
|
|
910
|
+
g(w), js(`Removed '${d}' from AI Scope`, {
|
|
900
911
|
position: "top-right",
|
|
901
912
|
duration: 2e3,
|
|
902
913
|
richColors: !0
|
|
903
914
|
});
|
|
904
915
|
}
|
|
905
916
|
}
|
|
906
|
-
function
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
const
|
|
910
|
-
|
|
917
|
+
function E() {
|
|
918
|
+
var T;
|
|
919
|
+
let v = it(s, n);
|
|
920
|
+
const w = (T = N == null ? void 0 : N.find(
|
|
921
|
+
(R) => R.id === p
|
|
922
|
+
)) == null ? void 0 : T.name;
|
|
923
|
+
console.log("modelName", w), p && p !== "none" && (v = `d.${w}`);
|
|
924
|
+
let q = v;
|
|
925
|
+
return ((R) => /[A-Z]/.test(R))(n) && (q = q.split(".").map((W) => `"${W}"`).join(".")), q;
|
|
911
926
|
}
|
|
912
|
-
function
|
|
913
|
-
|
|
914
|
-
(
|
|
927
|
+
function V() {
|
|
928
|
+
const v = E();
|
|
929
|
+
u(!1);
|
|
930
|
+
const w = z === "MSSQL" ? `SELECT top 10 * FROM ${v}` : `SELECT * FROM ${v} LIMIT 10`;
|
|
931
|
+
f(w), j(!0);
|
|
932
|
+
}
|
|
933
|
+
function L() {
|
|
934
|
+
const v = E();
|
|
935
|
+
u(!1), f(`SELECT COUNT(*) as count FROM ${v}`), j(!0);
|
|
915
936
|
}
|
|
916
937
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
917
938
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
918
939
|
/* @__PURE__ */ e.jsx(
|
|
919
|
-
|
|
940
|
+
rt,
|
|
920
941
|
{
|
|
921
|
-
title: `${
|
|
922
|
-
pressed:
|
|
923
|
-
onPressedChange:
|
|
942
|
+
title: `${b() ? "Remove from" : "Add to"} AI Scope`,
|
|
943
|
+
pressed: b(),
|
|
944
|
+
onPressedChange: A,
|
|
924
945
|
variant: "outline",
|
|
925
946
|
className: "h-9 px-2",
|
|
926
947
|
children: /* @__PURE__ */ e.jsx(
|
|
927
|
-
|
|
948
|
+
Zt,
|
|
928
949
|
{
|
|
929
|
-
className:
|
|
930
|
-
"text-primary":
|
|
931
|
-
"text-muted-foreground": !
|
|
950
|
+
className: ee("size-4", {
|
|
951
|
+
"text-primary": b(),
|
|
952
|
+
"text-muted-foreground": !b()
|
|
932
953
|
})
|
|
933
954
|
}
|
|
934
955
|
)
|
|
@@ -937,13 +958,13 @@ function zn({
|
|
|
937
958
|
/* @__PURE__ */ e.jsxs(
|
|
938
959
|
S,
|
|
939
960
|
{
|
|
940
|
-
disabled:
|
|
941
|
-
onClick:
|
|
961
|
+
disabled: a !== "Success",
|
|
962
|
+
onClick: V,
|
|
942
963
|
size: "sm",
|
|
943
964
|
variant: "secondary",
|
|
944
965
|
className: "flex",
|
|
945
966
|
children: [
|
|
946
|
-
|
|
967
|
+
a !== "Success" ? /* @__PURE__ */ e.jsx(Pe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(jn, { className: "mr-2 size-4" }),
|
|
947
968
|
"Top 10"
|
|
948
969
|
]
|
|
949
970
|
}
|
|
@@ -951,13 +972,13 @@ function zn({
|
|
|
951
972
|
/* @__PURE__ */ e.jsxs(
|
|
952
973
|
S,
|
|
953
974
|
{
|
|
954
|
-
disabled:
|
|
955
|
-
onClick:
|
|
975
|
+
disabled: a !== "Success",
|
|
976
|
+
onClick: L,
|
|
956
977
|
size: "sm",
|
|
957
978
|
variant: "secondary",
|
|
958
979
|
className: "flex",
|
|
959
980
|
children: [
|
|
960
|
-
|
|
981
|
+
a !== "Success" ? /* @__PURE__ */ e.jsx(Pe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(gn, { className: "mr-2 size-4" }),
|
|
961
982
|
"Count"
|
|
962
983
|
]
|
|
963
984
|
}
|
|
@@ -968,44 +989,44 @@ function zn({
|
|
|
968
989
|
{
|
|
969
990
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
970
991
|
children: [
|
|
971
|
-
|
|
992
|
+
t == null ? void 0 : t.map((v) => /* @__PURE__ */ e.jsxs(
|
|
972
993
|
"div",
|
|
973
994
|
{
|
|
974
|
-
onClick: () =>
|
|
975
|
-
className:
|
|
995
|
+
onClick: () => D(v),
|
|
996
|
+
className: ee(
|
|
976
997
|
"mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
977
998
|
{
|
|
978
|
-
"bg-muted":
|
|
999
|
+
"bg-muted": Xt(v, o)
|
|
979
1000
|
}
|
|
980
1001
|
),
|
|
981
1002
|
children: [
|
|
982
1003
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
983
|
-
/* @__PURE__ */ e.jsx(
|
|
984
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1004
|
+
/* @__PURE__ */ e.jsx(vt, { column: v }),
|
|
1005
|
+
/* @__PURE__ */ e.jsx("span", { children: v.column_name })
|
|
985
1006
|
] }),
|
|
986
|
-
|
|
1007
|
+
lt.includes(v.data_type) && /* @__PURE__ */ e.jsx(
|
|
987
1008
|
"div",
|
|
988
1009
|
{
|
|
989
|
-
onClick: (
|
|
1010
|
+
onClick: (w) => w.stopPropagation(),
|
|
990
1011
|
className: "flex items-center justify-end",
|
|
991
|
-
children: /* @__PURE__ */ e.jsx(wn, { column:
|
|
1012
|
+
children: /* @__PURE__ */ e.jsx(wn, { column: v })
|
|
992
1013
|
}
|
|
993
1014
|
)
|
|
994
1015
|
]
|
|
995
1016
|
},
|
|
996
|
-
|
|
1017
|
+
v.column_name
|
|
997
1018
|
)),
|
|
998
|
-
/* @__PURE__ */ e.jsx(
|
|
999
|
-
/* @__PURE__ */ e.jsx(
|
|
1019
|
+
/* @__PURE__ */ e.jsx(Hs, { orientation: "vertical" }),
|
|
1020
|
+
/* @__PURE__ */ e.jsx(Hs, { orientation: "horizontal" })
|
|
1000
1021
|
]
|
|
1001
1022
|
}
|
|
1002
1023
|
)
|
|
1003
1024
|
] });
|
|
1004
1025
|
}
|
|
1005
|
-
function
|
|
1006
|
-
var
|
|
1007
|
-
let
|
|
1008
|
-
const
|
|
1026
|
+
function is(s, n) {
|
|
1027
|
+
var Xe, es, qe, ss, ts;
|
|
1028
|
+
let t = Wa(() => [], []);
|
|
1029
|
+
const a = Ye().authToken || s, o = c(
|
|
1009
1030
|
(r) => r.selectedConnectionId
|
|
1010
1031
|
), h = c(
|
|
1011
1032
|
(r) => r.selectedDatamodelId
|
|
@@ -1015,96 +1036,96 @@ function Vs(s, n) {
|
|
|
1015
1036
|
(r) => r.selectedSchemaName
|
|
1016
1037
|
), d = c((r) => r.selectedTableName), p = c(
|
|
1017
1038
|
(r) => r.actions.setCurrentColumns
|
|
1018
|
-
),
|
|
1039
|
+
), x = c(
|
|
1019
1040
|
(r) => r.actions.setSelectedConnectionId
|
|
1020
1041
|
), g = c(
|
|
1021
1042
|
(r) => r.actions.setSelectedDatamodelId
|
|
1022
|
-
),
|
|
1043
|
+
), j = c(
|
|
1023
1044
|
(r) => r.actions.setSelectedDatabaseName
|
|
1024
1045
|
), i = c(
|
|
1025
1046
|
(r) => r.actions.setSelectedSchemaName
|
|
1026
|
-
),
|
|
1047
|
+
), u = c(
|
|
1027
1048
|
(r) => r.actions.setSelectedTableName
|
|
1028
1049
|
), f = c((r) => r.actions.setCardSql);
|
|
1029
|
-
function
|
|
1050
|
+
function z(r) {
|
|
1030
1051
|
return o && m && l && m !== "NA" ? !0 : o && r === "API" ? !1 : !!(o && r === "S3");
|
|
1031
1052
|
}
|
|
1032
1053
|
function N(r) {
|
|
1033
1054
|
return !!(o && m && m !== "NA" && l && d || o && (r === "S3" || r === "API") || h && h);
|
|
1034
1055
|
}
|
|
1035
|
-
function
|
|
1056
|
+
function D(r) {
|
|
1036
1057
|
return o && r ? !(r === "API" || r === "S3") : !1;
|
|
1037
1058
|
}
|
|
1038
1059
|
const {
|
|
1039
|
-
data:
|
|
1060
|
+
data: b,
|
|
1040
1061
|
isLoading: A,
|
|
1041
|
-
isError:
|
|
1062
|
+
isError: E
|
|
1042
1063
|
} = me({
|
|
1043
1064
|
queryKey: ["connections"],
|
|
1044
1065
|
queryFn: () => be(
|
|
1045
1066
|
"https://semaphor.cloud/api/v1/connections",
|
|
1046
|
-
(
|
|
1067
|
+
(a == null ? void 0 : a.accessToken) || ""
|
|
1047
1068
|
),
|
|
1048
|
-
enabled: !!(
|
|
1069
|
+
enabled: !!(a != null && a.accessToken)
|
|
1049
1070
|
// Only fetch if authToken is present
|
|
1050
1071
|
}), {
|
|
1051
|
-
data:
|
|
1052
|
-
isLoading:
|
|
1053
|
-
isError:
|
|
1072
|
+
data: V,
|
|
1073
|
+
isLoading: L,
|
|
1074
|
+
isError: v
|
|
1054
1075
|
} = me({
|
|
1055
1076
|
queryKey: ["models", o],
|
|
1056
1077
|
queryFn: () => be(
|
|
1057
1078
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
1058
|
-
(
|
|
1079
|
+
(a == null ? void 0 : a.accessToken) || "",
|
|
1059
1080
|
{
|
|
1060
1081
|
connection_id: o
|
|
1061
1082
|
}
|
|
1062
1083
|
),
|
|
1063
|
-
enabled: !!(
|
|
1084
|
+
enabled: !!(a != null && a.accessToken) && !!o
|
|
1064
1085
|
// Only fetch if authToken is present
|
|
1065
|
-
}),
|
|
1086
|
+
}), w = b == null ? void 0 : b.connections.find(
|
|
1066
1087
|
(r) => r.id === o
|
|
1067
|
-
),
|
|
1068
|
-
data:
|
|
1069
|
-
isLoading:
|
|
1070
|
-
isFetching:
|
|
1088
|
+
), q = w == null ? void 0 : w.type, K = (w == null ? void 0 : w.type) === "API" || (w == null ? void 0 : w.type) === "S3", {
|
|
1089
|
+
data: T,
|
|
1090
|
+
isLoading: R,
|
|
1091
|
+
isFetching: W,
|
|
1071
1092
|
isError: J,
|
|
1072
|
-
refetch:
|
|
1093
|
+
refetch: ae
|
|
1073
1094
|
} = me({
|
|
1074
1095
|
queryKey: ["databases", o],
|
|
1075
1096
|
queryFn: () => be(
|
|
1076
1097
|
"https://semaphor.cloud/api/v1/databases",
|
|
1077
|
-
(
|
|
1098
|
+
(a == null ? void 0 : a.accessToken) || "",
|
|
1078
1099
|
{
|
|
1079
1100
|
connection_id: o
|
|
1080
1101
|
}
|
|
1081
1102
|
),
|
|
1082
|
-
enabled:
|
|
1103
|
+
enabled: D(q)
|
|
1083
1104
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1084
1105
|
}), {
|
|
1085
|
-
data:
|
|
1106
|
+
data: G,
|
|
1086
1107
|
isLoading: ne,
|
|
1087
|
-
isFetching:
|
|
1088
|
-
isError:
|
|
1089
|
-
refetch:
|
|
1108
|
+
isFetching: C,
|
|
1109
|
+
isError: y,
|
|
1110
|
+
refetch: F
|
|
1090
1111
|
} = me({
|
|
1091
1112
|
queryKey: ["schemas", o, m],
|
|
1092
1113
|
queryFn: () => be(
|
|
1093
1114
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1094
|
-
(
|
|
1115
|
+
(a == null ? void 0 : a.accessToken) || "",
|
|
1095
1116
|
{
|
|
1096
1117
|
connection_id: o,
|
|
1097
1118
|
database_name: m
|
|
1098
1119
|
}
|
|
1099
1120
|
),
|
|
1100
|
-
enabled: !!o && !!m && !
|
|
1121
|
+
enabled: !!o && !!m && !K && m !== "NA"
|
|
1101
1122
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1102
1123
|
}), {
|
|
1103
|
-
data:
|
|
1124
|
+
data: _,
|
|
1104
1125
|
isLoading: fe,
|
|
1105
|
-
isFetching:
|
|
1106
|
-
isError:
|
|
1107
|
-
refetch:
|
|
1126
|
+
isFetching: te,
|
|
1127
|
+
isError: I,
|
|
1128
|
+
refetch: Y
|
|
1108
1129
|
} = me({
|
|
1109
1130
|
queryKey: [
|
|
1110
1131
|
"tables",
|
|
@@ -1114,19 +1135,19 @@ function Vs(s, n) {
|
|
|
1114
1135
|
],
|
|
1115
1136
|
queryFn: () => be(
|
|
1116
1137
|
"https://semaphor.cloud/api/v1/tables",
|
|
1117
|
-
(
|
|
1138
|
+
(a == null ? void 0 : a.accessToken) || "",
|
|
1118
1139
|
{
|
|
1119
1140
|
connection_id: o,
|
|
1120
1141
|
database_name: m,
|
|
1121
1142
|
schema_name: l
|
|
1122
1143
|
}
|
|
1123
1144
|
),
|
|
1124
|
-
enabled:
|
|
1145
|
+
enabled: z(q)
|
|
1125
1146
|
}), {
|
|
1126
|
-
data:
|
|
1147
|
+
data: se,
|
|
1127
1148
|
isLoading: ye,
|
|
1128
1149
|
isFetching: ge,
|
|
1129
|
-
isError:
|
|
1150
|
+
isError: U
|
|
1130
1151
|
} = me({
|
|
1131
1152
|
queryKey: [
|
|
1132
1153
|
"columns",
|
|
@@ -1138,7 +1159,7 @@ function Vs(s, n) {
|
|
|
1138
1159
|
],
|
|
1139
1160
|
queryFn: () => be(
|
|
1140
1161
|
"https://semaphor.cloud/api/v1/columns",
|
|
1141
|
-
(
|
|
1162
|
+
(a == null ? void 0 : a.accessToken) || "",
|
|
1142
1163
|
{
|
|
1143
1164
|
connection_id: o,
|
|
1144
1165
|
datamodel_id: h || "",
|
|
@@ -1148,7 +1169,7 @@ function Vs(s, n) {
|
|
|
1148
1169
|
table_name: d
|
|
1149
1170
|
}
|
|
1150
1171
|
),
|
|
1151
|
-
enabled: N(
|
|
1172
|
+
enabled: N(q)
|
|
1152
1173
|
// (!!selectedConnectionId &&
|
|
1153
1174
|
// !!selectedDatabaseName &&
|
|
1154
1175
|
// !!selectedSchemaName &&
|
|
@@ -1157,187 +1178,187 @@ function Vs(s, n) {
|
|
|
1157
1178
|
//currentConnection?.type === 'API',
|
|
1158
1179
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1159
1180
|
});
|
|
1160
|
-
|
|
1161
|
-
p(
|
|
1162
|
-
}, [
|
|
1181
|
+
Q(() => {
|
|
1182
|
+
p(t);
|
|
1183
|
+
}, [se, p, t]), Q(() => {
|
|
1163
1184
|
}, [
|
|
1164
|
-
|
|
1185
|
+
K,
|
|
1165
1186
|
f,
|
|
1166
|
-
|
|
1187
|
+
u,
|
|
1167
1188
|
i,
|
|
1168
|
-
|
|
1169
|
-
|
|
1189
|
+
j,
|
|
1190
|
+
w
|
|
1170
1191
|
]);
|
|
1171
|
-
const re = (
|
|
1192
|
+
const re = (w == null ? void 0 : w.type) === "API" ? (Xe = w == null ? void 0 : w.type) == null ? void 0 : Xe.toLowerCase() : d || "", ie = K ? "" : l || "";
|
|
1172
1193
|
function ve(r) {
|
|
1173
|
-
i(r),
|
|
1194
|
+
i(r), u("");
|
|
1174
1195
|
}
|
|
1175
1196
|
function Se(r) {
|
|
1176
|
-
|
|
1197
|
+
j(r === "none" ? "" : r), i(""), u(""), r !== "none" && r !== "" && g("");
|
|
1177
1198
|
}
|
|
1178
1199
|
function Ve(r) {
|
|
1179
|
-
|
|
1200
|
+
x(r);
|
|
1180
1201
|
}
|
|
1181
|
-
function
|
|
1182
|
-
g(r === "none" ? "" : r), r !== "none" && r !== "" &&
|
|
1202
|
+
function qs(r) {
|
|
1203
|
+
g(r === "none" ? "" : r), r !== "none" && r !== "" && j("");
|
|
1183
1204
|
}
|
|
1184
|
-
|
|
1205
|
+
T && ((es = T == null ? void 0 : T.databases) == null ? void 0 : es.length) > 0, G && ((qe = G == null ? void 0 : G.schemas) == null ? void 0 : qe.length) > 0, se && ((ss = se == null ? void 0 : se.columns) == null ? void 0 : ss.length) > 0 && (t = se.columns.map((r) => ({
|
|
1185
1206
|
...r,
|
|
1186
1207
|
data_type: r.data_type.toLowerCase()
|
|
1187
|
-
}))), J && (
|
|
1188
|
-
const ke =
|
|
1208
|
+
}))), J && (t = []), (U || E) && (t = []);
|
|
1209
|
+
const ke = b == null ? void 0 : b.connections.map(
|
|
1189
1210
|
(r) => ({
|
|
1190
1211
|
id: r.id,
|
|
1191
1212
|
name: r.name,
|
|
1192
1213
|
type: r.type
|
|
1193
1214
|
})
|
|
1194
|
-
),
|
|
1215
|
+
), cs = (ts = V == null ? void 0 : V.datamodels) == null ? void 0 : ts.map((r) => ({
|
|
1195
1216
|
id: r.id,
|
|
1196
1217
|
name: r.name
|
|
1197
|
-
})),
|
|
1218
|
+
})), Ze = T == null ? void 0 : T.databases.map((r) => ({
|
|
1198
1219
|
id: r.database_name,
|
|
1199
1220
|
name: r.database_name
|
|
1200
|
-
})),
|
|
1221
|
+
})), ds = G == null ? void 0 : G.schemas.map((r) => ({
|
|
1201
1222
|
id: r.schema_name,
|
|
1202
1223
|
name: r.schema_name
|
|
1203
|
-
})),
|
|
1224
|
+
})), hs = _ == null ? void 0 : _.tables.map((r) => ({
|
|
1204
1225
|
id: r.table_name,
|
|
1205
1226
|
name: r.table_name
|
|
1206
1227
|
}));
|
|
1207
1228
|
return {
|
|
1208
1229
|
connectionItems: ke,
|
|
1209
1230
|
isConnectionsLoading: A,
|
|
1210
|
-
isConnectionsError:
|
|
1211
|
-
modelItems:
|
|
1212
|
-
isModelsLoading:
|
|
1213
|
-
isModelsError:
|
|
1214
|
-
databaseItems:
|
|
1215
|
-
isDatabasesLoadingOrFetching:
|
|
1231
|
+
isConnectionsError: E,
|
|
1232
|
+
modelItems: cs,
|
|
1233
|
+
isModelsLoading: L,
|
|
1234
|
+
isModelsError: v,
|
|
1235
|
+
databaseItems: Ze,
|
|
1236
|
+
isDatabasesLoadingOrFetching: R || W,
|
|
1216
1237
|
isDatabaseError: J,
|
|
1217
|
-
schemaItems:
|
|
1218
|
-
isSchemaLoadingOrFetching: ne ||
|
|
1219
|
-
isSchemaError:
|
|
1220
|
-
tableItems:
|
|
1221
|
-
isTableLoadingOrFetching: fe ||
|
|
1222
|
-
isTableError:
|
|
1223
|
-
columns:
|
|
1238
|
+
schemaItems: ds,
|
|
1239
|
+
isSchemaLoadingOrFetching: ne || C,
|
|
1240
|
+
isSchemaError: y,
|
|
1241
|
+
tableItems: hs,
|
|
1242
|
+
isTableLoadingOrFetching: fe || te,
|
|
1243
|
+
isTableError: I,
|
|
1244
|
+
columns: t,
|
|
1224
1245
|
isColumnsLoadingOrFetching: ye || ge,
|
|
1225
|
-
isColumnsError:
|
|
1226
|
-
isNonDbConnection:
|
|
1227
|
-
connectionType:
|
|
1246
|
+
isColumnsError: U,
|
|
1247
|
+
isNonDbConnection: K,
|
|
1248
|
+
connectionType: q,
|
|
1228
1249
|
tableName: re,
|
|
1229
1250
|
schemaName: ie,
|
|
1230
1251
|
handleConnectionChange: Ve,
|
|
1231
|
-
handleDatamodelChange:
|
|
1252
|
+
handleDatamodelChange: qs,
|
|
1232
1253
|
handleDatabaseChange: Se,
|
|
1233
1254
|
handleSchemaChange: ve
|
|
1234
1255
|
};
|
|
1235
1256
|
}
|
|
1236
|
-
function
|
|
1257
|
+
function Nt({
|
|
1237
1258
|
ColumnsComponent: s
|
|
1238
1259
|
}) {
|
|
1239
|
-
var
|
|
1260
|
+
var te;
|
|
1240
1261
|
const n = c(
|
|
1241
|
-
(
|
|
1242
|
-
), a = c(
|
|
1243
|
-
(D) => D.selectedDatamodelId
|
|
1262
|
+
(I) => I.selectedConnectionId
|
|
1244
1263
|
), t = c(
|
|
1245
|
-
(
|
|
1264
|
+
(I) => I.selectedDatamodelId
|
|
1265
|
+
), a = c(
|
|
1266
|
+
(I) => I.selectedDatabaseName
|
|
1246
1267
|
), o = c(
|
|
1247
|
-
(
|
|
1248
|
-
), h = c((
|
|
1249
|
-
(
|
|
1268
|
+
(I) => I.selectedSchemaName
|
|
1269
|
+
), h = c((I) => I.selectedTableName), m = c(
|
|
1270
|
+
(I) => I.actions.setSelectedTableName
|
|
1250
1271
|
), {
|
|
1251
1272
|
connectionItems: l,
|
|
1252
1273
|
modelItems: d,
|
|
1253
1274
|
schemaItems: p,
|
|
1254
|
-
databaseItems:
|
|
1275
|
+
databaseItems: x,
|
|
1255
1276
|
tableItems: g,
|
|
1256
|
-
columns:
|
|
1277
|
+
columns: j,
|
|
1257
1278
|
isConnectionsLoading: i,
|
|
1258
|
-
isModelsLoading:
|
|
1279
|
+
isModelsLoading: u,
|
|
1259
1280
|
isConnectionsError: f,
|
|
1260
|
-
isModelsError:
|
|
1281
|
+
isModelsError: z,
|
|
1261
1282
|
isDatabasesLoadingOrFetching: N,
|
|
1262
|
-
isDatabaseError:
|
|
1263
|
-
isSchemaLoadingOrFetching:
|
|
1283
|
+
isDatabaseError: D,
|
|
1284
|
+
isSchemaLoadingOrFetching: b,
|
|
1264
1285
|
isSchemaError: A,
|
|
1265
|
-
isColumnsError:
|
|
1266
|
-
isColumnsLoadingOrFetching:
|
|
1267
|
-
isTableLoadingOrFetching:
|
|
1268
|
-
isTableError:
|
|
1269
|
-
connectionType:
|
|
1270
|
-
isNonDbConnection:
|
|
1271
|
-
handleConnectionChange:
|
|
1272
|
-
handleDatabaseChange:
|
|
1273
|
-
handleSchemaChange:
|
|
1274
|
-
handleDatamodelChange:
|
|
1286
|
+
isColumnsError: E,
|
|
1287
|
+
isColumnsLoadingOrFetching: V,
|
|
1288
|
+
isTableLoadingOrFetching: L,
|
|
1289
|
+
isTableError: v,
|
|
1290
|
+
connectionType: w,
|
|
1291
|
+
isNonDbConnection: q,
|
|
1292
|
+
handleConnectionChange: K,
|
|
1293
|
+
handleDatabaseChange: T,
|
|
1294
|
+
handleSchemaChange: R,
|
|
1295
|
+
handleDatamodelChange: W,
|
|
1275
1296
|
tableName: J,
|
|
1276
|
-
schemaName:
|
|
1277
|
-
} =
|
|
1278
|
-
function
|
|
1279
|
-
return s ? s(
|
|
1297
|
+
schemaName: ae
|
|
1298
|
+
} = is();
|
|
1299
|
+
function G() {
|
|
1300
|
+
return s ? s(ae, J, j) : /* @__PURE__ */ e.jsx(
|
|
1280
1301
|
zn,
|
|
1281
1302
|
{
|
|
1282
|
-
schemaName:
|
|
1303
|
+
schemaName: ae,
|
|
1283
1304
|
tableName: J,
|
|
1284
|
-
columns:
|
|
1285
|
-
status:
|
|
1305
|
+
columns: j,
|
|
1306
|
+
status: V ? "Loading..." : E ? "Error" : "Success"
|
|
1286
1307
|
}
|
|
1287
1308
|
);
|
|
1288
1309
|
}
|
|
1289
1310
|
function ne() {
|
|
1290
1311
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1291
1312
|
}
|
|
1292
|
-
function
|
|
1293
|
-
if (!n ||
|
|
1313
|
+
function C() {
|
|
1314
|
+
if (!n || w === "S3" || w === "API")
|
|
1294
1315
|
return null;
|
|
1295
|
-
if (!
|
|
1316
|
+
if (!t || t === "none")
|
|
1296
1317
|
return /* @__PURE__ */ e.jsx(
|
|
1297
1318
|
_e,
|
|
1298
1319
|
{
|
|
1299
1320
|
showNone: !0,
|
|
1300
|
-
onChange:
|
|
1301
|
-
isError:
|
|
1321
|
+
onChange: T,
|
|
1322
|
+
isError: D,
|
|
1302
1323
|
isLoading: N,
|
|
1303
|
-
items:
|
|
1304
|
-
value:
|
|
1324
|
+
items: x,
|
|
1325
|
+
value: a || "",
|
|
1305
1326
|
title: "Database"
|
|
1306
1327
|
}
|
|
1307
1328
|
);
|
|
1308
1329
|
}
|
|
1309
|
-
function
|
|
1310
|
-
if (n && !
|
|
1330
|
+
function y() {
|
|
1331
|
+
if (n && !q && (!a || a === "none") && (!t || t === "none"))
|
|
1311
1332
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1312
1333
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ke, {}) }),
|
|
1313
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
1334
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(H, { children: "OR" }) }),
|
|
1314
1335
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ke, {}) })
|
|
1315
1336
|
] });
|
|
1316
1337
|
}
|
|
1317
|
-
function
|
|
1318
|
-
if (!n ||
|
|
1338
|
+
function F() {
|
|
1339
|
+
if (!n || w === "S3" || w === "API")
|
|
1319
1340
|
return null;
|
|
1320
|
-
if (!
|
|
1341
|
+
if (!a || a === "none")
|
|
1321
1342
|
return /* @__PURE__ */ e.jsx(
|
|
1322
1343
|
_e,
|
|
1323
1344
|
{
|
|
1324
1345
|
showNone: !0,
|
|
1325
|
-
onChange:
|
|
1326
|
-
isError:
|
|
1327
|
-
isLoading:
|
|
1346
|
+
onChange: W,
|
|
1347
|
+
isError: z,
|
|
1348
|
+
isLoading: u,
|
|
1328
1349
|
items: d,
|
|
1329
|
-
value:
|
|
1350
|
+
value: t || "",
|
|
1330
1351
|
title: "Dataset"
|
|
1331
1352
|
}
|
|
1332
1353
|
);
|
|
1333
1354
|
}
|
|
1334
|
-
function
|
|
1335
|
-
return !n ||
|
|
1355
|
+
function _() {
|
|
1356
|
+
return !n || w === "S3" || w === "API" || !a || a === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1336
1357
|
_e,
|
|
1337
1358
|
{
|
|
1338
|
-
onChange:
|
|
1359
|
+
onChange: R,
|
|
1339
1360
|
isError: A,
|
|
1340
|
-
isLoading:
|
|
1361
|
+
isLoading: b,
|
|
1341
1362
|
items: p,
|
|
1342
1363
|
value: o || "",
|
|
1343
1364
|
title: "Schema"
|
|
@@ -1345,17 +1366,17 @@ function Na({
|
|
|
1345
1366
|
);
|
|
1346
1367
|
}
|
|
1347
1368
|
function fe() {
|
|
1348
|
-
function
|
|
1349
|
-
let
|
|
1350
|
-
return
|
|
1369
|
+
function I() {
|
|
1370
|
+
let Y = !1;
|
|
1371
|
+
return w === "API" ? (Y = !1, Y) : ((w === "S3" || n && a && a !== "none" && o) && (Y = !0), Y);
|
|
1351
1372
|
}
|
|
1352
|
-
return
|
|
1373
|
+
return I() ? /* @__PURE__ */ e.jsx(
|
|
1353
1374
|
_e,
|
|
1354
1375
|
{
|
|
1355
1376
|
onChange: m,
|
|
1356
|
-
isError:
|
|
1377
|
+
isError: v,
|
|
1357
1378
|
items: g,
|
|
1358
|
-
isLoading:
|
|
1379
|
+
isLoading: L,
|
|
1359
1380
|
value: h || "",
|
|
1360
1381
|
title: "Table"
|
|
1361
1382
|
}
|
|
@@ -1369,21 +1390,21 @@ function Na({
|
|
|
1369
1390
|
items: l,
|
|
1370
1391
|
title: "Connection",
|
|
1371
1392
|
value: n || "",
|
|
1372
|
-
onChange:
|
|
1393
|
+
onChange: K,
|
|
1373
1394
|
isLoading: i,
|
|
1374
1395
|
isError: f,
|
|
1375
|
-
connectionTooltip: ((
|
|
1376
|
-
(
|
|
1377
|
-
)) == null ? void 0 :
|
|
1396
|
+
connectionTooltip: ((te = l == null ? void 0 : l.find(
|
|
1397
|
+
(I) => I.id === n
|
|
1398
|
+
)) == null ? void 0 : te.type) || ""
|
|
1378
1399
|
}
|
|
1379
1400
|
),
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1401
|
+
F(),
|
|
1402
|
+
y(),
|
|
1403
|
+
C(),
|
|
1404
|
+
_(),
|
|
1384
1405
|
fe()
|
|
1385
1406
|
] }),
|
|
1386
|
-
|
|
1407
|
+
G(),
|
|
1387
1408
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1388
1409
|
S,
|
|
1389
1410
|
{
|
|
@@ -1400,15 +1421,15 @@ function Na({
|
|
|
1400
1421
|
] });
|
|
1401
1422
|
}
|
|
1402
1423
|
function Fn(s) {
|
|
1403
|
-
const n = s.toUpperCase().indexOf("WHERE"),
|
|
1424
|
+
const n = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), a = s.toUpperCase().indexOf("LIMIT"), o = s.toUpperCase().indexOf("ORDER BY");
|
|
1404
1425
|
let h = s.length;
|
|
1405
|
-
if (o !== -1 && (h = o),
|
|
1426
|
+
if (o !== -1 && (h = o), a !== -1 && a < h && (h = a), n !== -1) {
|
|
1406
1427
|
const m = s.substring(0, n), l = s.substring(n);
|
|
1407
1428
|
return `${m} {{ filters | where }} AND ${l.substring(
|
|
1408
1429
|
6
|
|
1409
1430
|
)}`;
|
|
1410
|
-
} else if (
|
|
1411
|
-
const m = s.substring(0,
|
|
1431
|
+
} else if (t !== -1) {
|
|
1432
|
+
const m = s.substring(0, t), l = s.substring(t);
|
|
1412
1433
|
return `${m} {{ filters | where }} ${l}`;
|
|
1413
1434
|
} else {
|
|
1414
1435
|
const m = s.substring(0, h), l = s.substring(h);
|
|
@@ -1418,17 +1439,17 @@ function Fn(s) {
|
|
|
1418
1439
|
function On({
|
|
1419
1440
|
error: s,
|
|
1420
1441
|
setShowAIDialog: n,
|
|
1421
|
-
setUserInputforAI:
|
|
1422
|
-
setTriggerAIRun:
|
|
1442
|
+
setUserInputforAI: t,
|
|
1443
|
+
setTriggerAIRun: a
|
|
1423
1444
|
}) {
|
|
1424
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1425
|
-
/* @__PURE__ */ e.jsx(
|
|
1426
|
-
/* @__PURE__ */ e.jsx(
|
|
1445
|
+
return /* @__PURE__ */ e.jsxs(ot, { openDelay: 0, children: [
|
|
1446
|
+
/* @__PURE__ */ e.jsx(ct, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(en, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1447
|
+
/* @__PURE__ */ e.jsx(dt, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
|
|
1427
1448
|
/* @__PURE__ */ e.jsxs(
|
|
1428
1449
|
S,
|
|
1429
1450
|
{
|
|
1430
1451
|
onClick: () => {
|
|
1431
|
-
n(!0),
|
|
1452
|
+
n(!0), t(s), a(!0);
|
|
1432
1453
|
},
|
|
1433
1454
|
size: "sm",
|
|
1434
1455
|
variant: "outline",
|
|
@@ -1445,17 +1466,17 @@ function On({
|
|
|
1445
1466
|
function Mn({
|
|
1446
1467
|
text: s,
|
|
1447
1468
|
onCheckedChange: n,
|
|
1448
|
-
checked:
|
|
1469
|
+
checked: t
|
|
1449
1470
|
}) {
|
|
1450
1471
|
return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
|
|
1451
|
-
/* @__PURE__ */ e.jsx(
|
|
1472
|
+
/* @__PURE__ */ e.jsx(Je, { checked: t, onCheckedChange: n }),
|
|
1452
1473
|
/* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
|
|
1453
1474
|
] });
|
|
1454
1475
|
}
|
|
1455
1476
|
function Tn() {
|
|
1456
1477
|
const { authToken: s } = Ye(), n = c(
|
|
1457
1478
|
(h) => h.selectedConnectionId
|
|
1458
|
-
), { data:
|
|
1479
|
+
), { data: t } = me({
|
|
1459
1480
|
queryKey: ["connections"],
|
|
1460
1481
|
queryFn: () => be(
|
|
1461
1482
|
"https://semaphor.cloud/api/v1/connections",
|
|
@@ -1463,22 +1484,22 @@ function Tn() {
|
|
|
1463
1484
|
),
|
|
1464
1485
|
enabled: !!(s != null && s.accessToken)
|
|
1465
1486
|
// Only fetch if authToken is present
|
|
1466
|
-
}),
|
|
1487
|
+
}), a = t == null ? void 0 : t.connections.find(
|
|
1467
1488
|
(h) => h.id === n
|
|
1468
1489
|
);
|
|
1469
|
-
return
|
|
1490
|
+
return a == null ? void 0 : a.type;
|
|
1470
1491
|
}
|
|
1471
1492
|
function Ln() {
|
|
1472
|
-
const { authToken: s } = Ye(), n =
|
|
1493
|
+
const { authToken: s } = Ye(), n = Ge(null), t = c((d) => d.applyFilters), [a, o] = O(""), h = c((d) => d.filterValues), m = c((d) => d.card.sql), l = Tn();
|
|
1473
1494
|
return /* @__PURE__ */ e.jsxs(
|
|
1474
|
-
|
|
1495
|
+
ot,
|
|
1475
1496
|
{
|
|
1476
1497
|
openDelay: 0,
|
|
1477
1498
|
onOpenChange: async (d) => {
|
|
1478
1499
|
if (!d)
|
|
1479
1500
|
return;
|
|
1480
1501
|
console.log("onOpenChange");
|
|
1481
|
-
const p = await
|
|
1502
|
+
const p = await ht(
|
|
1482
1503
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1483
1504
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1484
1505
|
{
|
|
@@ -1490,20 +1511,20 @@ function Ln() {
|
|
|
1490
1511
|
console.log(p), p.sql ? (console.log(p.records), o(p.sql)) : o("Error");
|
|
1491
1512
|
},
|
|
1492
1513
|
children: [
|
|
1493
|
-
/* @__PURE__ */ e.jsx(
|
|
1494
|
-
/* @__PURE__ */ e.jsxs(
|
|
1514
|
+
/* @__PURE__ */ e.jsx(ct, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
1515
|
+
/* @__PURE__ */ e.jsxs(dt, { align: "end", className: "w-[600px]", children: [
|
|
1495
1516
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
|
|
1496
|
-
|
|
1517
|
+
a,
|
|
1497
1518
|
/* @__PURE__ */ e.jsx(
|
|
1498
|
-
|
|
1519
|
+
mt,
|
|
1499
1520
|
{
|
|
1500
|
-
onClick: () =>
|
|
1521
|
+
onClick: () => ea(n),
|
|
1501
1522
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1502
1523
|
}
|
|
1503
1524
|
)
|
|
1504
1525
|
] }) }) }),
|
|
1505
1526
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
1506
|
-
/* @__PURE__ */ e.jsx(
|
|
1527
|
+
/* @__PURE__ */ e.jsx(sa, { className: "h-4 w-4 opacity-70" }),
|
|
1507
1528
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
|
|
1508
1529
|
] })
|
|
1509
1530
|
] })
|
|
@@ -1511,7 +1532,7 @@ function Ln() {
|
|
|
1511
1532
|
}
|
|
1512
1533
|
);
|
|
1513
1534
|
}
|
|
1514
|
-
const
|
|
1535
|
+
const Dn = `
|
|
1515
1536
|
|
|
1516
1537
|
Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
|
|
1517
1538
|
|
|
@@ -1558,74 +1579,74 @@ SELECT label, measure FROM table
|
|
|
1558
1579
|
- Label - Category
|
|
1559
1580
|
- Measure - Number
|
|
1560
1581
|
`;
|
|
1561
|
-
function
|
|
1582
|
+
function An({
|
|
1562
1583
|
open: s,
|
|
1563
1584
|
setOpen: n,
|
|
1564
|
-
userInput:
|
|
1565
|
-
setUserInput:
|
|
1585
|
+
userInput: t,
|
|
1586
|
+
setUserInput: a,
|
|
1566
1587
|
triggerAIRun: o,
|
|
1567
1588
|
setTriggerAIRun: h
|
|
1568
1589
|
}) {
|
|
1569
|
-
const m =
|
|
1570
|
-
${
|
|
1590
|
+
const m = Ge(null), l = Ge(null), { authToken: d } = Ye(), [p, x] = O(!1), g = c((C) => C.actions.setCardSql), j = k((C) => C.dashboard.baseQueries), i = c((C) => C.actions.setRunSql), u = c((C) => C.actions.setCardType), [f, z] = O([]), N = c((C) => C.currentColumns), D = c((C) => C.card.sql), b = c((C) => C.selectedTableName), A = `
|
|
1591
|
+
${t}
|
|
1571
1592
|
|
|
1572
|
-
Database Query Dialect: ${
|
|
1573
|
-
Table Name: ${
|
|
1574
|
-
Table Columns: ${N == null ? void 0 : N.map((
|
|
1575
|
-
User SQL: ${
|
|
1576
|
-
${
|
|
1577
|
-
Visual Query Syntax: ${
|
|
1593
|
+
Database Query Dialect: ${b === "api" || b === "s3" ? "DuckDb" : ""}
|
|
1594
|
+
Table Name: ${b}
|
|
1595
|
+
Table Columns: ${N == null ? void 0 : N.map((C) => `${C.column_name} | ${C.data_type}`).join(", ")}
|
|
1596
|
+
User SQL: ${D}
|
|
1597
|
+
${j && `Base Queries: ${JSON.stringify(j)} `}`, E = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1598
|
+
Visual Query Syntax: ${Dn}`, { data: V, isLoading: L, isFetching: v, isError: w, refetch: q } = me({
|
|
1578
1599
|
queryKey: ["ai-query"],
|
|
1579
1600
|
queryFn: () => be(
|
|
1580
1601
|
"https://semaphor.cloud/api/v1/ai",
|
|
1581
1602
|
(d == null ? void 0 : d.accessToken) || "",
|
|
1582
1603
|
{
|
|
1583
|
-
user_content: `userContent: ${A} ${p ?
|
|
1604
|
+
user_content: `userContent: ${A} ${p ? E : ""}`
|
|
1584
1605
|
}
|
|
1585
1606
|
),
|
|
1586
1607
|
enabled: !1
|
|
1587
1608
|
// Do not run by default.
|
|
1588
1609
|
});
|
|
1589
|
-
function
|
|
1590
|
-
if (
|
|
1591
|
-
|
|
1592
|
-
else if (
|
|
1593
|
-
|
|
1594
|
-
else if (
|
|
1595
|
-
|
|
1596
|
-
else if (
|
|
1597
|
-
|
|
1598
|
-
else if (
|
|
1599
|
-
|
|
1600
|
-
else if (
|
|
1601
|
-
|
|
1602
|
-
else if (
|
|
1603
|
-
|
|
1604
|
-
else if (
|
|
1605
|
-
|
|
1610
|
+
function K(C) {
|
|
1611
|
+
if (C.toLowerCase().includes("bar"))
|
|
1612
|
+
u("bar");
|
|
1613
|
+
else if (C.toLowerCase().includes("line"))
|
|
1614
|
+
u("line");
|
|
1615
|
+
else if (C.toLowerCase().includes("bubble"))
|
|
1616
|
+
u("bubble");
|
|
1617
|
+
else if (C.toLowerCase().includes("scatter"))
|
|
1618
|
+
u("scatter");
|
|
1619
|
+
else if (C.toLowerCase().includes("stacked"))
|
|
1620
|
+
u("stackedBar");
|
|
1621
|
+
else if (C.toLowerCase().includes("pie"))
|
|
1622
|
+
u("pie");
|
|
1623
|
+
else if (C.toLowerCase().includes("donut") || C.toLowerCase().includes("doughnut"))
|
|
1624
|
+
u("doughnut");
|
|
1625
|
+
else if (C.toLowerCase().includes("radar"))
|
|
1626
|
+
u("radar");
|
|
1606
1627
|
else
|
|
1607
|
-
return
|
|
1628
|
+
return u("bar"), !1;
|
|
1608
1629
|
return !0;
|
|
1609
1630
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
}, [
|
|
1613
|
-
const
|
|
1614
|
-
var
|
|
1631
|
+
Q(() => {
|
|
1632
|
+
V && z((C) => [...C, { role: "ai", content: V.response }]);
|
|
1633
|
+
}, [V]), Q(() => {
|
|
1634
|
+
const C = setTimeout(() => {
|
|
1635
|
+
var y;
|
|
1615
1636
|
l.current && (l.current.scroll({
|
|
1616
1637
|
top: l.current.scrollHeight,
|
|
1617
1638
|
behavior: "smooth"
|
|
1618
|
-
}), (
|
|
1639
|
+
}), (y = m.current) == null || y.focus());
|
|
1619
1640
|
}, 100);
|
|
1620
|
-
return () => clearTimeout(
|
|
1641
|
+
return () => clearTimeout(C);
|
|
1621
1642
|
}, [f]);
|
|
1622
|
-
function
|
|
1623
|
-
|
|
1643
|
+
function T() {
|
|
1644
|
+
t && (z((C) => [...C, { role: "user", content: t }]), K(t) && x(!0), a(""), q());
|
|
1624
1645
|
}
|
|
1625
|
-
|
|
1626
|
-
o && (
|
|
1646
|
+
Q(() => {
|
|
1647
|
+
o && (T(), h(!1));
|
|
1627
1648
|
}, [o, h]);
|
|
1628
|
-
const
|
|
1649
|
+
const R = {
|
|
1629
1650
|
//seleect a darker color
|
|
1630
1651
|
// color: '#000',
|
|
1631
1652
|
fontFamily: "Arial, sans-serif",
|
|
@@ -1633,7 +1654,7 @@ function Dn({
|
|
|
1633
1654
|
fontSize: 15,
|
|
1634
1655
|
// padding: '5px',
|
|
1635
1656
|
width: "100%"
|
|
1636
|
-
},
|
|
1657
|
+
}, W = {
|
|
1637
1658
|
// background: '#f6f8fa',
|
|
1638
1659
|
// color: '#000',
|
|
1639
1660
|
fontFamily: "monospace",
|
|
@@ -1650,58 +1671,58 @@ function Dn({
|
|
|
1650
1671
|
marginLeft: 20,
|
|
1651
1672
|
// add bullet points for unordered lists
|
|
1652
1673
|
listStyleType: "disc"
|
|
1653
|
-
},
|
|
1674
|
+
}, ae = {
|
|
1654
1675
|
// Override how paragraphs are rendered
|
|
1655
|
-
p: ({ node:
|
|
1656
|
-
code: ({ node:
|
|
1657
|
-
pre: ({ node:
|
|
1658
|
-
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children:
|
|
1676
|
+
p: ({ node: C, ...y }) => /* @__PURE__ */ e.jsx("p", { style: R, ...y }),
|
|
1677
|
+
code: ({ node: C, ...y }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...y }),
|
|
1678
|
+
pre: ({ node: C, ...y }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: W, children: [
|
|
1679
|
+
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: y.children }),
|
|
1659
1680
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1660
|
-
/* @__PURE__ */ e.jsx(S, { onClick:
|
|
1681
|
+
/* @__PURE__ */ e.jsx(S, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(mt, {}) }),
|
|
1661
1682
|
/* @__PURE__ */ e.jsx(
|
|
1662
1683
|
S,
|
|
1663
1684
|
{
|
|
1664
|
-
onClick: (
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1685
|
+
onClick: (F) => {
|
|
1686
|
+
const _ = G(F);
|
|
1687
|
+
_ && (n(!1), g(_), i(!0));
|
|
1667
1688
|
},
|
|
1668
1689
|
size: "sm",
|
|
1669
1690
|
variant: "outline",
|
|
1670
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1691
|
+
children: /* @__PURE__ */ e.jsx(na, {})
|
|
1671
1692
|
}
|
|
1672
1693
|
)
|
|
1673
1694
|
] })
|
|
1674
1695
|
] }),
|
|
1675
|
-
li: ({ node:
|
|
1696
|
+
li: ({ node: C, ...y }) => /* @__PURE__ */ e.jsx("li", { style: J, ...y })
|
|
1676
1697
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1677
1698
|
};
|
|
1678
|
-
function
|
|
1679
|
-
const
|
|
1680
|
-
if (!
|
|
1699
|
+
function G(C) {
|
|
1700
|
+
const y = C.currentTarget.closest("pre");
|
|
1701
|
+
if (!y)
|
|
1681
1702
|
return;
|
|
1682
|
-
const
|
|
1683
|
-
return navigator.clipboard.writeText(
|
|
1703
|
+
const F = y.textContent || y.innerText;
|
|
1704
|
+
return navigator.clipboard.writeText(F).then(() => console.log("Text copied to clipboard")).catch((_) => console.error("Error in copying text: ", _)), F;
|
|
1684
1705
|
}
|
|
1685
1706
|
function ne() {
|
|
1686
|
-
return f == null ? void 0 : f.map((
|
|
1707
|
+
return f == null ? void 0 : f.map((C, y) => C.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1687
1708
|
"div",
|
|
1688
1709
|
{
|
|
1689
1710
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1690
1711
|
children: [
|
|
1691
1712
|
/* @__PURE__ */ e.jsx(vn, { className: "mr-2 h-5 w-5" }),
|
|
1692
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1713
|
+
/* @__PURE__ */ e.jsx("div", { children: C.content })
|
|
1693
1714
|
]
|
|
1694
1715
|
},
|
|
1695
|
-
|
|
1696
|
-
) :
|
|
1697
|
-
|
|
1716
|
+
y
|
|
1717
|
+
) : C.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1718
|
+
aa,
|
|
1698
1719
|
{
|
|
1699
1720
|
className: "w-full overflow-auto py-1",
|
|
1700
|
-
components:
|
|
1701
|
-
children:
|
|
1721
|
+
components: ae,
|
|
1722
|
+
children: V == null ? void 0 : V.response.replace(/DuckDB/gi, "Semaphor")
|
|
1702
1723
|
},
|
|
1703
|
-
|
|
1704
|
-
) : /* @__PURE__ */ e.jsx("div", {},
|
|
1724
|
+
y
|
|
1725
|
+
) : /* @__PURE__ */ e.jsx("div", {}, y));
|
|
1705
1726
|
}
|
|
1706
1727
|
return /* @__PURE__ */ e.jsxs(Ns, { open: s, onOpenChange: n, children: [
|
|
1707
1728
|
/* @__PURE__ */ e.jsx(Cs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
@@ -1735,24 +1756,24 @@ function Dn({
|
|
|
1735
1756
|
{
|
|
1736
1757
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
|
|
1737
1758
|
/* @__PURE__ */ e.jsx(
|
|
1738
|
-
|
|
1759
|
+
ut,
|
|
1739
1760
|
{
|
|
1740
1761
|
autoFocus: !0,
|
|
1741
1762
|
ref: m,
|
|
1742
|
-
onKeyDown: (
|
|
1743
|
-
|
|
1763
|
+
onKeyDown: (C) => {
|
|
1764
|
+
C.key === "Enter" && !C.shiftKey && (C.preventDefault(), a(""), T());
|
|
1744
1765
|
},
|
|
1745
1766
|
placeholder: "Type your question here...",
|
|
1746
|
-
onFocus: (
|
|
1747
|
-
const
|
|
1748
|
-
|
|
1767
|
+
onFocus: (C) => {
|
|
1768
|
+
const y = C.target, F = y.value.length;
|
|
1769
|
+
y.setSelectionRange(F, F);
|
|
1749
1770
|
},
|
|
1750
|
-
className:
|
|
1771
|
+
className: ee(
|
|
1751
1772
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1752
1773
|
),
|
|
1753
|
-
disabled:
|
|
1754
|
-
value:
|
|
1755
|
-
onChange: (
|
|
1774
|
+
disabled: L || v,
|
|
1775
|
+
value: t,
|
|
1776
|
+
onChange: (C) => a(C.target.value)
|
|
1756
1777
|
}
|
|
1757
1778
|
),
|
|
1758
1779
|
" ",
|
|
@@ -1762,8 +1783,8 @@ function Dn({
|
|
|
1762
1783
|
className: "h-8",
|
|
1763
1784
|
size: "sm",
|
|
1764
1785
|
variant: "ghost",
|
|
1765
|
-
onClick:
|
|
1766
|
-
children: !
|
|
1786
|
+
onClick: T,
|
|
1787
|
+
children: !L && !v ? /* @__PURE__ */ e.jsx(ta, {}) : /* @__PURE__ */ e.jsx(Pe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1767
1788
|
}
|
|
1768
1789
|
)
|
|
1769
1790
|
] })
|
|
@@ -1774,65 +1795,65 @@ function Dn({
|
|
|
1774
1795
|
)
|
|
1775
1796
|
] });
|
|
1776
1797
|
}
|
|
1777
|
-
var
|
|
1798
|
+
var Ct = {
|
|
1778
1799
|
color: void 0,
|
|
1779
1800
|
size: void 0,
|
|
1780
1801
|
className: void 0,
|
|
1781
1802
|
style: void 0,
|
|
1782
1803
|
attr: void 0
|
|
1783
|
-
},
|
|
1804
|
+
}, Qs = xe.createContext && /* @__PURE__ */ xe.createContext(Ct), En = ["attr", "size", "title"];
|
|
1784
1805
|
function In(s, n) {
|
|
1785
1806
|
if (s == null)
|
|
1786
1807
|
return {};
|
|
1787
|
-
var
|
|
1808
|
+
var t = Vn(s, n), a, o;
|
|
1788
1809
|
if (Object.getOwnPropertySymbols) {
|
|
1789
1810
|
var h = Object.getOwnPropertySymbols(s);
|
|
1790
1811
|
for (o = 0; o < h.length; o++)
|
|
1791
|
-
|
|
1812
|
+
a = h[o], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(s, a) && (t[a] = s[a]);
|
|
1792
1813
|
}
|
|
1793
|
-
return
|
|
1814
|
+
return t;
|
|
1794
1815
|
}
|
|
1795
1816
|
function Vn(s, n) {
|
|
1796
1817
|
if (s == null)
|
|
1797
1818
|
return {};
|
|
1798
|
-
var
|
|
1799
|
-
for (h = 0; h <
|
|
1800
|
-
o =
|
|
1801
|
-
return
|
|
1819
|
+
var t = {}, a = Object.keys(s), o, h;
|
|
1820
|
+
for (h = 0; h < a.length; h++)
|
|
1821
|
+
o = a[h], !(n.indexOf(o) >= 0) && (t[o] = s[o]);
|
|
1822
|
+
return t;
|
|
1802
1823
|
}
|
|
1803
1824
|
function ls() {
|
|
1804
1825
|
return ls = Object.assign ? Object.assign.bind() : function(s) {
|
|
1805
1826
|
for (var n = 1; n < arguments.length; n++) {
|
|
1806
|
-
var
|
|
1807
|
-
for (var
|
|
1808
|
-
Object.prototype.hasOwnProperty.call(
|
|
1827
|
+
var t = arguments[n];
|
|
1828
|
+
for (var a in t)
|
|
1829
|
+
Object.prototype.hasOwnProperty.call(t, a) && (s[a] = t[a]);
|
|
1809
1830
|
}
|
|
1810
1831
|
return s;
|
|
1811
1832
|
}, ls.apply(this, arguments);
|
|
1812
1833
|
}
|
|
1813
|
-
function
|
|
1814
|
-
var
|
|
1834
|
+
function Ws(s, n) {
|
|
1835
|
+
var t = Object.keys(s);
|
|
1815
1836
|
if (Object.getOwnPropertySymbols) {
|
|
1816
|
-
var
|
|
1817
|
-
n && (
|
|
1837
|
+
var a = Object.getOwnPropertySymbols(s);
|
|
1838
|
+
n && (a = a.filter(function(o) {
|
|
1818
1839
|
return Object.getOwnPropertyDescriptor(s, o).enumerable;
|
|
1819
|
-
})),
|
|
1840
|
+
})), t.push.apply(t, a);
|
|
1820
1841
|
}
|
|
1821
|
-
return
|
|
1842
|
+
return t;
|
|
1822
1843
|
}
|
|
1823
1844
|
function rs(s) {
|
|
1824
1845
|
for (var n = 1; n < arguments.length; n++) {
|
|
1825
|
-
var
|
|
1826
|
-
n % 2 ?
|
|
1827
|
-
qn(s,
|
|
1828
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(
|
|
1829
|
-
Object.defineProperty(s,
|
|
1846
|
+
var t = arguments[n] != null ? arguments[n] : {};
|
|
1847
|
+
n % 2 ? Ws(Object(t), !0).forEach(function(a) {
|
|
1848
|
+
qn(s, a, t[a]);
|
|
1849
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : Ws(Object(t)).forEach(function(a) {
|
|
1850
|
+
Object.defineProperty(s, a, Object.getOwnPropertyDescriptor(t, a));
|
|
1830
1851
|
});
|
|
1831
1852
|
}
|
|
1832
1853
|
return s;
|
|
1833
1854
|
}
|
|
1834
|
-
function qn(s, n,
|
|
1835
|
-
return n = Rn(n), n in s ? Object.defineProperty(s, n, { value:
|
|
1855
|
+
function qn(s, n, t) {
|
|
1856
|
+
return n = Rn(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = t, s;
|
|
1836
1857
|
}
|
|
1837
1858
|
function Rn(s) {
|
|
1838
1859
|
var n = _n(s, "string");
|
|
@@ -1841,178 +1862,178 @@ function Rn(s) {
|
|
|
1841
1862
|
function _n(s, n) {
|
|
1842
1863
|
if (typeof s != "object" || s === null)
|
|
1843
1864
|
return s;
|
|
1844
|
-
var
|
|
1845
|
-
if (
|
|
1846
|
-
var
|
|
1847
|
-
if (typeof
|
|
1848
|
-
return
|
|
1865
|
+
var t = s[Symbol.toPrimitive];
|
|
1866
|
+
if (t !== void 0) {
|
|
1867
|
+
var a = t.call(s, n || "default");
|
|
1868
|
+
if (typeof a != "object")
|
|
1869
|
+
return a;
|
|
1849
1870
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1850
1871
|
}
|
|
1851
1872
|
return (n === "string" ? String : Number)(s);
|
|
1852
1873
|
}
|
|
1853
|
-
function
|
|
1854
|
-
return s && s.map((n,
|
|
1855
|
-
key:
|
|
1856
|
-
}, n.attr),
|
|
1874
|
+
function St(s) {
|
|
1875
|
+
return s && s.map((n, t) => /* @__PURE__ */ xe.createElement(n.tag, rs({
|
|
1876
|
+
key: t
|
|
1877
|
+
}, n.attr), St(n.child)));
|
|
1857
1878
|
}
|
|
1858
1879
|
function pe(s) {
|
|
1859
1880
|
return (n) => /* @__PURE__ */ xe.createElement(Hn, ls({
|
|
1860
1881
|
attr: rs({}, s.attr)
|
|
1861
|
-
}, n),
|
|
1882
|
+
}, n), St(s.child));
|
|
1862
1883
|
}
|
|
1863
1884
|
function Hn(s) {
|
|
1864
|
-
var n = (
|
|
1885
|
+
var n = (t) => {
|
|
1865
1886
|
var {
|
|
1866
|
-
attr:
|
|
1887
|
+
attr: a,
|
|
1867
1888
|
size: o,
|
|
1868
1889
|
title: h
|
|
1869
|
-
} = s, m = In(s, En), l = o ||
|
|
1870
|
-
return
|
|
1890
|
+
} = s, m = In(s, En), l = o || t.size || "1em", d;
|
|
1891
|
+
return t.className && (d = t.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ xe.createElement("svg", ls({
|
|
1871
1892
|
stroke: "currentColor",
|
|
1872
1893
|
fill: "currentColor",
|
|
1873
1894
|
strokeWidth: "0"
|
|
1874
|
-
},
|
|
1895
|
+
}, t.attr, a, m, {
|
|
1875
1896
|
className: d,
|
|
1876
1897
|
style: rs(rs({
|
|
1877
|
-
color: s.color ||
|
|
1878
|
-
},
|
|
1898
|
+
color: s.color || t.color
|
|
1899
|
+
}, t.style), s.style),
|
|
1879
1900
|
height: l,
|
|
1880
1901
|
width: l,
|
|
1881
1902
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1882
1903
|
}), h && /* @__PURE__ */ xe.createElement("title", null, h), s.children);
|
|
1883
1904
|
};
|
|
1884
|
-
return
|
|
1905
|
+
return Qs !== void 0 ? /* @__PURE__ */ xe.createElement(Qs.Consumer, null, (t) => n(t)) : n(Ct);
|
|
1885
1906
|
}
|
|
1886
1907
|
function Bn(s) {
|
|
1887
1908
|
return pe({ 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);
|
|
1888
1909
|
}
|
|
1889
1910
|
function $n() {
|
|
1890
|
-
const { theme: s } =
|
|
1911
|
+
const { theme: s } = la(), n = Ge(), t = Ge(), [a, o] = O(!1), [h, m] = O(!1), [l, d] = O(!1), [p, x] = O(""), [g, j] = O(!1), { authToken: i } = Ye();
|
|
1891
1912
|
k((r) => r.selectedSheetId);
|
|
1892
|
-
const
|
|
1913
|
+
const u = k((r) => r.dashboard.baseQueries), f = c((r) => r.card), z = k((r) => r.theme), N = c((r) => r.isShowingVisual), D = c(
|
|
1893
1914
|
(r) => r.selectedConnectionId
|
|
1894
|
-
),
|
|
1915
|
+
), b = c(
|
|
1895
1916
|
(r) => r.selectedDatabaseName
|
|
1896
1917
|
), A = c(
|
|
1897
1918
|
(r) => r.selectedDatamodelId
|
|
1898
|
-
),
|
|
1919
|
+
), E = c(
|
|
1899
1920
|
(r) => r.selectedSchemaName
|
|
1900
1921
|
);
|
|
1901
1922
|
k(
|
|
1902
1923
|
(r) => r.actions.updateFrameCard
|
|
1903
1924
|
);
|
|
1904
|
-
const
|
|
1905
|
-
setCardCustomCfg:
|
|
1925
|
+
const V = c((r) => r.selectedTableName), L = c((r) => r.card.sql), v = c((r) => r.card.python), w = ra(L, u), q = c((r) => r.selectedConnectionId), K = c((r) => r.frame), T = c((r) => r.filterValues), R = c((r) => r.applyFilters), {
|
|
1926
|
+
setCardCustomCfg: W,
|
|
1906
1927
|
setQueryResultColumns: J,
|
|
1907
|
-
setFilterValues:
|
|
1908
|
-
setCardSql:
|
|
1928
|
+
setFilterValues: ae,
|
|
1929
|
+
setCardSql: G,
|
|
1909
1930
|
setCardPython: ne,
|
|
1910
|
-
setQueryError:
|
|
1911
|
-
setPythonStdOut:
|
|
1912
|
-
setCardPreferences:
|
|
1913
|
-
} = c((r) => r.actions),
|
|
1931
|
+
setQueryError: C,
|
|
1932
|
+
setPythonStdOut: y,
|
|
1933
|
+
setCardPreferences: F
|
|
1934
|
+
} = c((r) => r.actions), _ = c((r) => r.onSave), fe = c(
|
|
1914
1935
|
(r) => r.actions.setApplyFilters
|
|
1915
|
-
),
|
|
1936
|
+
), te = c((r) => r.onClose), I = c((r) => r.actions.setCardData), Y = c((r) => r.actions.setSqlGen), se = c((r) => r.runSql), ye = c((r) => r.actions.setRunSql), ge = c(
|
|
1916
1937
|
(r) => r.actions.setIsSqlRunning
|
|
1917
1938
|
), {
|
|
1918
|
-
data:
|
|
1939
|
+
data: U,
|
|
1919
1940
|
isLoading: re,
|
|
1920
1941
|
isFetching: ie,
|
|
1921
1942
|
isSuccess: ve,
|
|
1922
1943
|
isError: Se,
|
|
1923
1944
|
error: Ve,
|
|
1924
|
-
status:
|
|
1945
|
+
status: qs,
|
|
1925
1946
|
refetch: ke
|
|
1926
1947
|
} = me({
|
|
1927
|
-
queryKey: [
|
|
1928
|
-
queryFn: () =>
|
|
1948
|
+
queryKey: [w, v],
|
|
1949
|
+
queryFn: () => ht(
|
|
1929
1950
|
"https://semaphor.cloud/api/v1/query",
|
|
1930
1951
|
(i == null ? void 0 : i.accessToken) || "",
|
|
1931
1952
|
{
|
|
1932
|
-
connection_id:
|
|
1933
|
-
sql:
|
|
1934
|
-
python:
|
|
1935
|
-
active_filters:
|
|
1953
|
+
connection_id: q,
|
|
1954
|
+
sql: w,
|
|
1955
|
+
python: v === Bs ? "" : v,
|
|
1956
|
+
active_filters: R ? T : []
|
|
1936
1957
|
}
|
|
1937
1958
|
),
|
|
1938
1959
|
enabled: !1,
|
|
1939
1960
|
retry: !1
|
|
1940
1961
|
});
|
|
1941
|
-
|
|
1942
|
-
if (
|
|
1962
|
+
Q(() => {
|
|
1963
|
+
if (U && (I(U.records), U.rowLimitExceeded && js.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
1943
1964
|
position: "top-center",
|
|
1944
1965
|
richColors: !0
|
|
1945
|
-
}),
|
|
1946
|
-
const { dimensionKeys: r } = bs(
|
|
1966
|
+
}), y((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
|
|
1967
|
+
const { dimensionKeys: r } = bs(U.records);
|
|
1947
1968
|
J(r);
|
|
1948
1969
|
}
|
|
1949
|
-
}, [
|
|
1950
|
-
|
|
1951
|
-
}, [
|
|
1952
|
-
(re || ie) && ge(!0), (Se || ve) && ge(!1), Se ? (
|
|
1970
|
+
}, [U, I, J, y]), Q(() => {
|
|
1971
|
+
se && (ke(), ye(!1));
|
|
1972
|
+
}, [se, ke, ye]), Q(() => {
|
|
1973
|
+
(re || ie) && ge(!0), (Se || ve) && ge(!1), Se ? (C(Ve.message), I([]), J([]), y("")) : C("");
|
|
1953
1974
|
}, [
|
|
1954
1975
|
re,
|
|
1955
1976
|
ie,
|
|
1956
|
-
|
|
1957
|
-
|
|
1977
|
+
U,
|
|
1978
|
+
y,
|
|
1958
1979
|
Se,
|
|
1959
1980
|
ve,
|
|
1960
1981
|
ge,
|
|
1961
|
-
|
|
1982
|
+
I,
|
|
1962
1983
|
J,
|
|
1963
|
-
|
|
1984
|
+
C,
|
|
1964
1985
|
Ve
|
|
1965
1986
|
]);
|
|
1966
|
-
function
|
|
1967
|
-
|
|
1987
|
+
function cs() {
|
|
1988
|
+
G(""), I([]), Y({}), W(""), F({});
|
|
1968
1989
|
}
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1990
|
+
const Ze = (r) => {
|
|
1991
|
+
t.current = r;
|
|
1971
1992
|
};
|
|
1972
|
-
function
|
|
1973
|
-
let r =
|
|
1974
|
-
|
|
1993
|
+
function ds() {
|
|
1994
|
+
let r = L;
|
|
1995
|
+
L && !L.includes("{{") && (r = Fn(L), G(r));
|
|
1975
1996
|
const oe = {
|
|
1976
1997
|
...f,
|
|
1977
|
-
lastSelectedSchema:
|
|
1998
|
+
lastSelectedSchema: E,
|
|
1978
1999
|
lastSelectedDatamodelId: A,
|
|
1979
|
-
lastSelectedDatabase:
|
|
1980
|
-
lastSelectedTable:
|
|
1981
|
-
connectionId:
|
|
2000
|
+
lastSelectedDatabase: b,
|
|
2001
|
+
lastSelectedTable: V,
|
|
2002
|
+
connectionId: D,
|
|
1982
2003
|
type: N ? f.type : "table",
|
|
1983
2004
|
sql: r,
|
|
1984
2005
|
customCfg: N ? f.customCfg : null
|
|
1985
|
-
}, Re =
|
|
2006
|
+
}, Re = K.cards.map(
|
|
1986
2007
|
(Ne) => Ne.id === f.id ? oe : Ne
|
|
1987
2008
|
);
|
|
1988
|
-
|
|
1989
|
-
...
|
|
2009
|
+
_ == null || _({
|
|
2010
|
+
...K,
|
|
1990
2011
|
cards: Re
|
|
1991
2012
|
});
|
|
1992
2013
|
}
|
|
1993
|
-
function
|
|
1994
|
-
|
|
2014
|
+
function hs() {
|
|
2015
|
+
te == null || te();
|
|
1995
2016
|
}
|
|
1996
|
-
function
|
|
2017
|
+
function Xe(r) {
|
|
1997
2018
|
const oe = getComputedStyle(
|
|
1998
2019
|
document.documentElement
|
|
1999
2020
|
).getPropertyValue(r);
|
|
2000
2021
|
return es(oe);
|
|
2001
2022
|
}
|
|
2002
2023
|
function es(r) {
|
|
2003
|
-
const [oe, Re, Ne] = r.split(" "),
|
|
2024
|
+
const [oe, Re, Ne] = r.split(" "), Z = parseFloat(oe), It = parseFloat(Re), Vt = parseFloat(Ne), qt = It / 100, Rs = Vt / 100, je = (1 - Math.abs(2 * Rs - 1)) * qt, we = je * (1 - Math.abs(Z / 60 % 2 - 1)), ms = Rs - je / 2;
|
|
2004
2025
|
let ce = 0, de = 0, he = 0;
|
|
2005
|
-
0 <=
|
|
2006
|
-
const
|
|
2007
|
-
const
|
|
2008
|
-
return
|
|
2026
|
+
0 <= Z && Z < 60 ? (ce = je, de = we, he = 0) : 60 <= Z && Z < 120 ? (ce = we, de = je, he = 0) : 120 <= Z && Z < 180 ? (ce = 0, de = je, he = we) : 180 <= Z && Z < 240 ? (ce = 0, de = we, he = je) : 240 <= Z && Z < 300 ? (ce = we, de = 0, he = je) : 300 <= Z && Z < 360 && (ce = je, de = 0, he = we), ce = Math.round((ce + ms) * 255), de = Math.round((de + ms) * 255), he = Math.round((he + ms) * 255);
|
|
2027
|
+
const us = (Rt) => {
|
|
2028
|
+
const xs = Rt.toString(16);
|
|
2029
|
+
return xs.length == 1 ? "0" + xs : xs;
|
|
2009
2030
|
};
|
|
2010
|
-
return `#${
|
|
2031
|
+
return `#${us(ce)}${us(de)}${us(he)}`;
|
|
2011
2032
|
}
|
|
2012
|
-
|
|
2013
|
-
const r = n.current, oe =
|
|
2033
|
+
Q(() => {
|
|
2034
|
+
const r = n.current, oe = t.current;
|
|
2014
2035
|
if (r) {
|
|
2015
|
-
const Re = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne =
|
|
2036
|
+
const Re = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = z === "system" ? Re : z;
|
|
2016
2037
|
r.editor.defineTheme("default", {
|
|
2017
2038
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2018
2039
|
base: Ne === "light" ? "vs" : "vs-dark",
|
|
@@ -2020,7 +2041,7 @@ function $n() {
|
|
|
2020
2041
|
rules: [],
|
|
2021
2042
|
colors: {
|
|
2022
2043
|
// 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
|
|
2023
|
-
"editor.background": Ne === "light" ? "#ffffff" :
|
|
2044
|
+
"editor.background": Ne === "light" ? "#ffffff" : Xe("--semaphor-background")
|
|
2024
2045
|
}
|
|
2025
2046
|
}), r.editor.setTheme("default");
|
|
2026
2047
|
}
|
|
@@ -2031,7 +2052,7 @@ function $n() {
|
|
|
2031
2052
|
}
|
|
2032
2053
|
), () => {
|
|
2033
2054
|
};
|
|
2034
|
-
}, [s,
|
|
2055
|
+
}, [s, z, n.current]);
|
|
2035
2056
|
function qe(r) {
|
|
2036
2057
|
n.current = r;
|
|
2037
2058
|
}
|
|
@@ -2047,13 +2068,13 @@ function $n() {
|
|
|
2047
2068
|
/* @__PURE__ */ e.jsx(
|
|
2048
2069
|
Mn,
|
|
2049
2070
|
{
|
|
2050
|
-
checked:
|
|
2051
|
-
onCheckedChange: () => fe(!
|
|
2071
|
+
checked: R,
|
|
2072
|
+
onCheckedChange: () => fe(!R),
|
|
2052
2073
|
text: "Apply Filters"
|
|
2053
2074
|
}
|
|
2054
2075
|
),
|
|
2055
2076
|
/* @__PURE__ */ e.jsx(Ln, {}),
|
|
2056
|
-
|
|
2077
|
+
T && h && /* @__PURE__ */ e.jsx(
|
|
2057
2078
|
Be,
|
|
2058
2079
|
{
|
|
2059
2080
|
onClick: () => m(!1),
|
|
@@ -2068,13 +2089,13 @@ function $n() {
|
|
|
2068
2089
|
onChange: (r) => {
|
|
2069
2090
|
if (r)
|
|
2070
2091
|
try {
|
|
2071
|
-
JSON.parse(r),
|
|
2092
|
+
JSON.parse(r), ae(JSON.parse(r));
|
|
2072
2093
|
} catch {
|
|
2073
2094
|
}
|
|
2074
2095
|
},
|
|
2075
2096
|
defaultLanguage: "json",
|
|
2076
2097
|
className: "mt-1 min-h-[220px]",
|
|
2077
|
-
value: JSON.stringify(
|
|
2098
|
+
value: JSON.stringify(T, null, 2),
|
|
2078
2099
|
options: {
|
|
2079
2100
|
readOnly: !0,
|
|
2080
2101
|
minimap: {
|
|
@@ -2095,21 +2116,21 @@ function $n() {
|
|
|
2095
2116
|
] })
|
|
2096
2117
|
}
|
|
2097
2118
|
),
|
|
2098
|
-
|
|
2099
|
-
|
|
2119
|
+
T && !h && /* @__PURE__ */ e.jsx(
|
|
2120
|
+
ft,
|
|
2100
2121
|
{
|
|
2101
2122
|
onClick: () => m(!0),
|
|
2102
|
-
className:
|
|
2123
|
+
className: ee(
|
|
2103
2124
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
2104
2125
|
{
|
|
2105
|
-
"font-bold text-red-800":
|
|
2126
|
+
"font-bold text-red-800": R
|
|
2106
2127
|
}
|
|
2107
2128
|
)
|
|
2108
2129
|
}
|
|
2109
2130
|
)
|
|
2110
2131
|
] });
|
|
2111
2132
|
}
|
|
2112
|
-
function
|
|
2133
|
+
function ts() {
|
|
2113
2134
|
return /* @__PURE__ */ e.jsxs(
|
|
2114
2135
|
ys,
|
|
2115
2136
|
{
|
|
@@ -2122,7 +2143,7 @@ function $n() {
|
|
|
2122
2143
|
{
|
|
2123
2144
|
id: "1",
|
|
2124
2145
|
order: 1,
|
|
2125
|
-
defaultSize:
|
|
2146
|
+
defaultSize: a ? 20 : 100,
|
|
2126
2147
|
className: "relative flex grow",
|
|
2127
2148
|
children: [
|
|
2128
2149
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2136,9 +2157,9 @@ function $n() {
|
|
|
2136
2157
|
theme: "default",
|
|
2137
2158
|
className: "pt-3",
|
|
2138
2159
|
onChange: (r) => {
|
|
2139
|
-
|
|
2160
|
+
G(r);
|
|
2140
2161
|
},
|
|
2141
|
-
value:
|
|
2162
|
+
value: L,
|
|
2142
2163
|
options: {
|
|
2143
2164
|
minimap: {
|
|
2144
2165
|
enabled: !1
|
|
@@ -2154,16 +2175,16 @@ function $n() {
|
|
|
2154
2175
|
defaultLanguage: "sql",
|
|
2155
2176
|
defaultValue: "SELECT * FROM table",
|
|
2156
2177
|
beforeMount: qe,
|
|
2157
|
-
onMount:
|
|
2178
|
+
onMount: Ze
|
|
2158
2179
|
}
|
|
2159
2180
|
)
|
|
2160
2181
|
}
|
|
2161
2182
|
),
|
|
2162
|
-
|
|
2183
|
+
a && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
|
|
2163
2184
|
]
|
|
2164
2185
|
}
|
|
2165
2186
|
),
|
|
2166
|
-
|
|
2187
|
+
a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2167
2188
|
/* @__PURE__ */ e.jsx(vs, { withHandle: !0, className: "border" }),
|
|
2168
2189
|
/* @__PURE__ */ e.jsxs(
|
|
2169
2190
|
Fe,
|
|
@@ -2186,7 +2207,7 @@ function $n() {
|
|
|
2186
2207
|
onChange: (r) => {
|
|
2187
2208
|
ne(r && r.trim() || "");
|
|
2188
2209
|
},
|
|
2189
|
-
value:
|
|
2210
|
+
value: v || Bs,
|
|
2190
2211
|
options: {
|
|
2191
2212
|
minimap: {
|
|
2192
2213
|
enabled: !1
|
|
@@ -2201,7 +2222,7 @@ function $n() {
|
|
|
2201
2222
|
},
|
|
2202
2223
|
defaultLanguage: "python",
|
|
2203
2224
|
beforeMount: qe,
|
|
2204
|
-
onMount:
|
|
2225
|
+
onMount: Ze
|
|
2205
2226
|
}
|
|
2206
2227
|
)
|
|
2207
2228
|
}
|
|
@@ -2229,7 +2250,7 @@ function $n() {
|
|
|
2229
2250
|
role: "sql-editor",
|
|
2230
2251
|
className: "relative flex grow justify-between overflow-y-scroll",
|
|
2231
2252
|
children: [
|
|
2232
|
-
|
|
2253
|
+
ts(),
|
|
2233
2254
|
ss()
|
|
2234
2255
|
]
|
|
2235
2256
|
}
|
|
@@ -2263,27 +2284,27 @@ function $n() {
|
|
|
2263
2284
|
{
|
|
2264
2285
|
error: Ve.message,
|
|
2265
2286
|
setShowAIDialog: d,
|
|
2266
|
-
setTriggerAIRun:
|
|
2267
|
-
setUserInputforAI:
|
|
2287
|
+
setTriggerAIRun: j,
|
|
2288
|
+
setUserInputforAI: x
|
|
2268
2289
|
}
|
|
2269
2290
|
),
|
|
2270
2291
|
/* @__PURE__ */ e.jsxs(
|
|
2271
2292
|
S,
|
|
2272
2293
|
{
|
|
2273
|
-
onClick:
|
|
2294
|
+
onClick: cs,
|
|
2274
2295
|
className: "",
|
|
2275
2296
|
size: "sm",
|
|
2276
2297
|
variant: "outline",
|
|
2277
2298
|
children: [
|
|
2278
|
-
/* @__PURE__ */ e.jsx(
|
|
2299
|
+
/* @__PURE__ */ e.jsx(tn, { className: "mr-2 size-4" }),
|
|
2279
2300
|
"Clear"
|
|
2280
2301
|
]
|
|
2281
2302
|
}
|
|
2282
2303
|
),
|
|
2283
2304
|
/* @__PURE__ */ e.jsx(
|
|
2284
|
-
|
|
2305
|
+
rt,
|
|
2285
2306
|
{
|
|
2286
|
-
pressed:
|
|
2307
|
+
pressed: a,
|
|
2287
2308
|
onPressedChange: (r) => o(r),
|
|
2288
2309
|
className: "",
|
|
2289
2310
|
size: "sm",
|
|
@@ -2292,14 +2313,14 @@ function $n() {
|
|
|
2292
2313
|
}
|
|
2293
2314
|
),
|
|
2294
2315
|
/* @__PURE__ */ e.jsx(
|
|
2295
|
-
|
|
2316
|
+
An,
|
|
2296
2317
|
{
|
|
2297
2318
|
open: l,
|
|
2298
2319
|
setOpen: d,
|
|
2299
2320
|
userInput: p,
|
|
2300
2321
|
triggerAIRun: g,
|
|
2301
|
-
setTriggerAIRun:
|
|
2302
|
-
setUserInput: (r) =>
|
|
2322
|
+
setTriggerAIRun: j,
|
|
2323
|
+
setUserInput: (r) => x(r)
|
|
2303
2324
|
}
|
|
2304
2325
|
)
|
|
2305
2326
|
] }),
|
|
@@ -2307,11 +2328,11 @@ function $n() {
|
|
|
2307
2328
|
/* @__PURE__ */ e.jsxs(
|
|
2308
2329
|
S,
|
|
2309
2330
|
{
|
|
2310
|
-
onClick:
|
|
2331
|
+
onClick: ds,
|
|
2311
2332
|
size: "sm",
|
|
2312
2333
|
variant: "outline",
|
|
2313
2334
|
children: [
|
|
2314
|
-
/* @__PURE__ */ e.jsx(
|
|
2335
|
+
/* @__PURE__ */ e.jsx(ia, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2315
2336
|
"Accept"
|
|
2316
2337
|
]
|
|
2317
2338
|
}
|
|
@@ -2319,7 +2340,7 @@ function $n() {
|
|
|
2319
2340
|
/* @__PURE__ */ e.jsxs(
|
|
2320
2341
|
S,
|
|
2321
2342
|
{
|
|
2322
|
-
onClick:
|
|
2343
|
+
onClick: hs,
|
|
2323
2344
|
className: "w-full",
|
|
2324
2345
|
size: "sm",
|
|
2325
2346
|
variant: "outline",
|
|
@@ -2340,7 +2361,7 @@ function $n() {
|
|
|
2340
2361
|
}
|
|
2341
2362
|
function Pn({ data: s }) {
|
|
2342
2363
|
var m;
|
|
2343
|
-
const [n,
|
|
2364
|
+
const [n, t] = xe.useState([]), o = Object.keys(s[0]).map((l) => ({
|
|
2344
2365
|
// header: key,
|
|
2345
2366
|
accessorKey: l,
|
|
2346
2367
|
header: ({ column: d }) => {
|
|
@@ -2352,122 +2373,122 @@ function Pn({ data: s }) {
|
|
|
2352
2373
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2353
2374
|
children: [
|
|
2354
2375
|
l,
|
|
2355
|
-
p === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2376
|
+
p === "asc" ? /* @__PURE__ */ e.jsx(oa, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(ca, { className: "ml-2 h-5 w-5" }) : null
|
|
2356
2377
|
]
|
|
2357
2378
|
}
|
|
2358
2379
|
) });
|
|
2359
2380
|
}
|
|
2360
|
-
})), h =
|
|
2381
|
+
})), h = da({
|
|
2361
2382
|
data: s,
|
|
2362
2383
|
columns: o,
|
|
2363
|
-
getCoreRowModel:
|
|
2364
|
-
getPaginationRowModel:
|
|
2365
|
-
onSortingChange:
|
|
2366
|
-
getSortedRowModel:
|
|
2384
|
+
getCoreRowModel: pa(),
|
|
2385
|
+
getPaginationRowModel: fa(),
|
|
2386
|
+
onSortingChange: t,
|
|
2387
|
+
getSortedRowModel: ga(),
|
|
2367
2388
|
manualPagination: !0,
|
|
2368
2389
|
state: {
|
|
2369
2390
|
sorting: n
|
|
2370
2391
|
}
|
|
2371
2392
|
});
|
|
2372
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2373
|
-
/* @__PURE__ */ e.jsx(
|
|
2393
|
+
return /* @__PURE__ */ e.jsxs(ha, { children: [
|
|
2394
|
+
/* @__PURE__ */ e.jsx(ma, { children: h.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(ps, { children: l.headers.map((d) => /* @__PURE__ */ e.jsx(ua, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : $s(
|
|
2374
2395
|
d.column.columnDef.header,
|
|
2375
2396
|
d.getContext()
|
|
2376
2397
|
) }, d.id)) }, l.id)) }),
|
|
2377
|
-
/* @__PURE__ */ e.jsx(
|
|
2378
|
-
|
|
2398
|
+
/* @__PURE__ */ e.jsx(xa, { children: (m = h.getRowModel().rows) != null && m.length ? h.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
|
|
2399
|
+
ps,
|
|
2379
2400
|
{
|
|
2380
2401
|
className: "whitespace-nowrap py-2",
|
|
2381
2402
|
"data-state": l.getIsSelected() && "selected",
|
|
2382
|
-
children: l.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(
|
|
2403
|
+
children: l.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Ps, { children: $s(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2383
2404
|
},
|
|
2384
2405
|
l.id
|
|
2385
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
2406
|
+
)) : /* @__PURE__ */ e.jsx(ps, { children: /* @__PURE__ */ e.jsx(Ps, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2386
2407
|
] });
|
|
2387
2408
|
}
|
|
2388
|
-
function
|
|
2409
|
+
function kt({
|
|
2389
2410
|
// card,
|
|
2390
2411
|
className: s,
|
|
2391
2412
|
...n
|
|
2392
2413
|
}) {
|
|
2393
2414
|
var m;
|
|
2394
2415
|
xe.useState(0);
|
|
2395
|
-
const
|
|
2396
|
-
if (
|
|
2416
|
+
const t = k((l) => l.themeStyle), a = c((l) => l.card), o = c((l) => l.actions.setCard);
|
|
2417
|
+
if (Q(() => {
|
|
2397
2418
|
}, [
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
]), !
|
|
2419
|
+
a.data,
|
|
2420
|
+
a.type,
|
|
2421
|
+
a.cfg,
|
|
2422
|
+
a.customCfg,
|
|
2423
|
+
t,
|
|
2424
|
+
a.preferences
|
|
2425
|
+
]), !a.id)
|
|
2405
2426
|
return null;
|
|
2406
2427
|
let h;
|
|
2407
|
-
return
|
|
2408
|
-
data:
|
|
2409
|
-
cardType:
|
|
2410
|
-
cfg:
|
|
2411
|
-
customCfg:
|
|
2412
|
-
preferences:
|
|
2428
|
+
return a.data && a.data.length > 0 && (h = xt({
|
|
2429
|
+
data: a.data,
|
|
2430
|
+
cardType: a.type,
|
|
2431
|
+
cfg: a.cfg,
|
|
2432
|
+
customCfg: a.customCfg,
|
|
2433
|
+
preferences: a.preferences
|
|
2413
2434
|
})), /* @__PURE__ */ e.jsxs(
|
|
2414
|
-
|
|
2435
|
+
ja,
|
|
2415
2436
|
{
|
|
2416
2437
|
role: "editor-visual-card",
|
|
2417
|
-
className:
|
|
2438
|
+
className: ee("relative flex h-full flex-col rounded-none", s),
|
|
2418
2439
|
...n,
|
|
2419
2440
|
children: [
|
|
2420
|
-
/* @__PURE__ */ e.jsxs(
|
|
2441
|
+
/* @__PURE__ */ e.jsxs(ba, { className: "py-4", children: [
|
|
2421
2442
|
/* @__PURE__ */ e.jsx(
|
|
2422
|
-
|
|
2443
|
+
Ks,
|
|
2423
2444
|
{
|
|
2424
|
-
text:
|
|
2425
|
-
onSave: (l) => o({ ...
|
|
2426
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2445
|
+
text: a.title,
|
|
2446
|
+
onSave: (l) => o({ ...a, title: l }),
|
|
2447
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ya, { className: "text-base", children: a.title }) })
|
|
2427
2448
|
},
|
|
2428
|
-
|
|
2449
|
+
a.title
|
|
2429
2450
|
),
|
|
2430
2451
|
/* @__PURE__ */ e.jsx(
|
|
2431
|
-
|
|
2452
|
+
Ks,
|
|
2432
2453
|
{
|
|
2433
|
-
text:
|
|
2434
|
-
onSave: (l) => o({ ...
|
|
2435
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2454
|
+
text: a.description || "",
|
|
2455
|
+
onSave: (l) => o({ ...a, description: l }),
|
|
2456
|
+
children: /* @__PURE__ */ e.jsxs(va, { children: [
|
|
2436
2457
|
" ",
|
|
2437
|
-
|
|
2458
|
+
a.description
|
|
2438
2459
|
] })
|
|
2439
2460
|
},
|
|
2440
|
-
|
|
2461
|
+
a.description
|
|
2441
2462
|
)
|
|
2442
2463
|
] }),
|
|
2443
|
-
/* @__PURE__ */ e.jsxs(
|
|
2444
|
-
|
|
2464
|
+
/* @__PURE__ */ e.jsxs(Na, { className: "flex grow flex-col pb-3", children: [
|
|
2465
|
+
a.type !== "table" && h && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2445
2466
|
/* @__PURE__ */ e.jsx(
|
|
2446
|
-
|
|
2467
|
+
Ca,
|
|
2447
2468
|
{
|
|
2448
2469
|
cfg: h
|
|
2449
2470
|
},
|
|
2450
|
-
JSON.stringify(h) + JSON.stringify(
|
|
2471
|
+
JSON.stringify(h) + JSON.stringify(a.preferences) + ((m = a == null ? void 0 : a.preferences) == null ? void 0 : m.customVisualCode)
|
|
2451
2472
|
),
|
|
2452
|
-
|
|
2453
|
-
/* @__PURE__ */ e.jsx(
|
|
2473
|
+
a.type === "table" && a.data && a.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2474
|
+
/* @__PURE__ */ e.jsx(Sa, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(ka, { card: a, data: a == null ? void 0 : a.data }) })
|
|
2454
2475
|
] })
|
|
2455
2476
|
]
|
|
2456
2477
|
}
|
|
2457
2478
|
);
|
|
2458
2479
|
}
|
|
2459
2480
|
function Kn() {
|
|
2460
|
-
const [s, n] =
|
|
2461
|
-
(
|
|
2462
|
-
), { setCardCustomCfg:
|
|
2463
|
-
function
|
|
2464
|
-
var
|
|
2481
|
+
const [s, n] = O(!1), [t, a] = O(""), [o, h] = O(""), [m, l] = O(""), [d, p] = O(""), x = c((b) => b.card), g = c(
|
|
2482
|
+
(b) => b.card.customCfg
|
|
2483
|
+
), { setCardCustomCfg: j, setCustomVisualCode: i } = wa();
|
|
2484
|
+
function u(b) {
|
|
2485
|
+
var V, L;
|
|
2465
2486
|
const A = {
|
|
2466
|
-
...
|
|
2487
|
+
...b,
|
|
2467
2488
|
data: {
|
|
2468
|
-
...
|
|
2469
|
-
datasets: (
|
|
2470
|
-
...
|
|
2489
|
+
...b == null ? void 0 : b.data,
|
|
2490
|
+
datasets: (L = (V = b == null ? void 0 : b.data) == null ? void 0 : V.datasets) == null ? void 0 : L.map((v) => ({
|
|
2491
|
+
...v,
|
|
2471
2492
|
data: []
|
|
2472
2493
|
}))
|
|
2473
2494
|
}
|
|
@@ -2475,36 +2496,36 @@ function Kn() {
|
|
|
2475
2496
|
return JSON.stringify(A, null, 1);
|
|
2476
2497
|
}
|
|
2477
2498
|
function f() {
|
|
2478
|
-
var A,
|
|
2479
|
-
if (!
|
|
2499
|
+
var A, E;
|
|
2500
|
+
if (!x.data || x.data.length === 0)
|
|
2480
2501
|
return;
|
|
2481
|
-
const
|
|
2482
|
-
data:
|
|
2483
|
-
cardType:
|
|
2484
|
-
cfg:
|
|
2485
|
-
preferences:
|
|
2502
|
+
const b = xt({
|
|
2503
|
+
data: x.data,
|
|
2504
|
+
cardType: x.type,
|
|
2505
|
+
cfg: x.cfg,
|
|
2506
|
+
preferences: x.preferences
|
|
2486
2507
|
});
|
|
2487
|
-
|
|
2508
|
+
b && (a(JSON.stringify(b, null, 1)), (A = x == null ? void 0 : x.preferences) != null && A.customVisualCode && l((E = x == null ? void 0 : x.preferences) == null ? void 0 : E.customVisualCode), g && h(JSON.stringify(g, null, 1)));
|
|
2488
2509
|
}
|
|
2489
|
-
function
|
|
2510
|
+
function z() {
|
|
2490
2511
|
if (m && i(m), !!o)
|
|
2491
2512
|
try {
|
|
2492
|
-
const
|
|
2493
|
-
return
|
|
2494
|
-
} catch (
|
|
2495
|
-
console.log(
|
|
2513
|
+
const b = JSON.parse(o);
|
|
2514
|
+
return b ? (j(b), p(""), h(""), b) : void 0;
|
|
2515
|
+
} catch (b) {
|
|
2516
|
+
console.log(b), p("Invalid JSON");
|
|
2496
2517
|
}
|
|
2497
2518
|
}
|
|
2498
2519
|
function N() {
|
|
2499
|
-
h(""),
|
|
2520
|
+
h(""), j(null);
|
|
2500
2521
|
}
|
|
2501
|
-
function
|
|
2502
|
-
let
|
|
2522
|
+
function D() {
|
|
2523
|
+
let b;
|
|
2503
2524
|
if (g) {
|
|
2504
|
-
const A = Gs.cloneDeep(
|
|
2505
|
-
return
|
|
2525
|
+
const A = Gs.cloneDeep(x.cfg), E = Gs.merge(A, g);
|
|
2526
|
+
return b = u(E), b;
|
|
2506
2527
|
}
|
|
2507
|
-
return
|
|
2528
|
+
return t ? (b = u(JSON.parse(t)), b) : "";
|
|
2508
2529
|
}
|
|
2509
2530
|
return /* @__PURE__ */ e.jsxs(Ns, { open: s, onOpenChange: n, children: [
|
|
2510
2531
|
/* @__PURE__ */ e.jsx(Cs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
@@ -2514,7 +2535,7 @@ function Kn() {
|
|
|
2514
2535
|
className: ` ${g && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2515
2536
|
size: "sm",
|
|
2516
2537
|
variant: "outline",
|
|
2517
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2538
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "h-4 w-4" })
|
|
2518
2539
|
}
|
|
2519
2540
|
) }),
|
|
2520
2541
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2526,11 +2547,11 @@ function Kn() {
|
|
|
2526
2547
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2527
2548
|
/* @__PURE__ */ e.jsx(ws, { children: "Customize Card" }),
|
|
2528
2549
|
/* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
2529
|
-
/* @__PURE__ */ e.jsx(
|
|
2550
|
+
/* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsx(
|
|
2530
2551
|
rn,
|
|
2531
2552
|
{
|
|
2532
2553
|
onClick: () => {
|
|
2533
|
-
navigator.clipboard.writeText(
|
|
2554
|
+
navigator.clipboard.writeText(x.id);
|
|
2534
2555
|
},
|
|
2535
2556
|
className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
|
|
2536
2557
|
}
|
|
@@ -2552,33 +2573,33 @@ function Kn() {
|
|
|
2552
2573
|
] })
|
|
2553
2574
|
] }),
|
|
2554
2575
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2555
|
-
/* @__PURE__ */ e.jsx(
|
|
2556
|
-
/* @__PURE__ */ e.jsxs(
|
|
2557
|
-
/* @__PURE__ */ e.jsxs(
|
|
2558
|
-
/* @__PURE__ */ e.jsxs(
|
|
2559
|
-
g && /* @__PURE__ */ e.jsx(
|
|
2576
|
+
/* @__PURE__ */ e.jsx(kt, { className: "w-1/2 rounded shadow-none" }),
|
|
2577
|
+
/* @__PURE__ */ e.jsxs(Fa, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2578
|
+
/* @__PURE__ */ e.jsxs(Oa, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2579
|
+
/* @__PURE__ */ e.jsxs(fs, { value: "custom-config", children: [
|
|
2580
|
+
g && /* @__PURE__ */ e.jsx(Ma, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2560
2581
|
g ? "Custom Config" : "Default Config"
|
|
2561
2582
|
] }),
|
|
2562
|
-
/* @__PURE__ */ e.jsx(
|
|
2563
|
-
/* @__PURE__ */ e.jsx(
|
|
2583
|
+
/* @__PURE__ */ e.jsx(fs, { className: "", value: "output", children: "Output" }),
|
|
2584
|
+
/* @__PURE__ */ e.jsx(fs, { className: "", value: "custom-code", children: "Custom Code" })
|
|
2564
2585
|
] }),
|
|
2565
2586
|
/* @__PURE__ */ e.jsx(
|
|
2566
|
-
|
|
2587
|
+
gs,
|
|
2567
2588
|
{
|
|
2568
2589
|
className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
|
|
2569
2590
|
value: "output",
|
|
2570
2591
|
children: /* @__PURE__ */ e.jsx(
|
|
2571
|
-
|
|
2592
|
+
ut,
|
|
2572
2593
|
{
|
|
2573
2594
|
disabled: !0,
|
|
2574
|
-
value:
|
|
2595
|
+
value: t,
|
|
2575
2596
|
className: "h-full resize-none border-none font-mono focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
2576
2597
|
}
|
|
2577
2598
|
)
|
|
2578
2599
|
}
|
|
2579
2600
|
),
|
|
2580
2601
|
/* @__PURE__ */ e.jsx(
|
|
2581
|
-
|
|
2602
|
+
gs,
|
|
2582
2603
|
{
|
|
2583
2604
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2584
2605
|
value: "custom-config",
|
|
@@ -2600,14 +2621,14 @@ function Kn() {
|
|
|
2600
2621
|
renderLineHighlight: "none"
|
|
2601
2622
|
},
|
|
2602
2623
|
defaultLanguage: "json",
|
|
2603
|
-
value:
|
|
2604
|
-
onChange: (
|
|
2624
|
+
value: D(),
|
|
2625
|
+
onChange: (b) => h(b)
|
|
2605
2626
|
}
|
|
2606
2627
|
)
|
|
2607
2628
|
}
|
|
2608
2629
|
),
|
|
2609
2630
|
/* @__PURE__ */ e.jsx(
|
|
2610
|
-
|
|
2631
|
+
gs,
|
|
2611
2632
|
{
|
|
2612
2633
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2613
2634
|
value: "custom-code",
|
|
@@ -2630,15 +2651,15 @@ function Kn() {
|
|
|
2630
2651
|
},
|
|
2631
2652
|
defaultLanguage: "javascript",
|
|
2632
2653
|
value: m,
|
|
2633
|
-
onChange: (
|
|
2654
|
+
onChange: (b) => l(b || "")
|
|
2634
2655
|
}
|
|
2635
2656
|
)
|
|
2636
2657
|
}
|
|
2637
2658
|
)
|
|
2638
2659
|
] })
|
|
2639
2660
|
] }),
|
|
2640
|
-
/* @__PURE__ */ e.jsxs(
|
|
2641
|
-
/* @__PURE__ */ e.jsx(
|
|
2661
|
+
/* @__PURE__ */ e.jsxs(et, { className: "flex items-center", children: [
|
|
2662
|
+
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: d }),
|
|
2642
2663
|
/* @__PURE__ */ e.jsx(
|
|
2643
2664
|
S,
|
|
2644
2665
|
{
|
|
@@ -2648,7 +2669,7 @@ function Kn() {
|
|
|
2648
2669
|
children: "Reset"
|
|
2649
2670
|
}
|
|
2650
2671
|
),
|
|
2651
|
-
/* @__PURE__ */ e.jsx(S, { onClick:
|
|
2672
|
+
/* @__PURE__ */ e.jsx(S, { onClick: z, variant: "outline", children: "Apply" }),
|
|
2652
2673
|
/* @__PURE__ */ e.jsx(S, { onClick: () => n(!1), variant: "outline", children: "Close" })
|
|
2653
2674
|
] })
|
|
2654
2675
|
]
|
|
@@ -2656,39 +2677,39 @@ function Kn() {
|
|
|
2656
2677
|
)
|
|
2657
2678
|
] });
|
|
2658
2679
|
}
|
|
2659
|
-
function
|
|
2680
|
+
function wt(s) {
|
|
2660
2681
|
return pe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2661
2682
|
}
|
|
2662
|
-
function
|
|
2683
|
+
function zt(s) {
|
|
2663
2684
|
return pe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
|
|
2664
2685
|
}
|
|
2665
|
-
function
|
|
2686
|
+
function Ft(s) {
|
|
2666
2687
|
return pe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2667
2688
|
}
|
|
2668
|
-
function
|
|
2689
|
+
function Ot(s) {
|
|
2669
2690
|
return pe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2670
2691
|
}
|
|
2671
|
-
function
|
|
2692
|
+
function Mt(s) {
|
|
2672
2693
|
return pe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
2673
2694
|
}
|
|
2674
|
-
function
|
|
2695
|
+
function Tt(s) {
|
|
2675
2696
|
return pe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
|
|
2676
2697
|
}
|
|
2677
|
-
function
|
|
2698
|
+
function Lt(s) {
|
|
2678
2699
|
return pe({ 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);
|
|
2679
2700
|
}
|
|
2680
|
-
function
|
|
2701
|
+
function Dt(s) {
|
|
2681
2702
|
return pe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
|
|
2682
2703
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const [s, n] =
|
|
2704
|
+
function Gn() {
|
|
2705
|
+
const [s, n] = O(!1), t = c((d) => d.card.type), { setCardType: a, setCardPreferences: o, setChartOrientation: h } = c((d) => d.actions), m = c(
|
|
2685
2706
|
(d) => d.actions.setCardCustomCfg
|
|
2686
2707
|
);
|
|
2687
2708
|
function l(d) {
|
|
2688
|
-
m(null), o({}),
|
|
2709
|
+
m(null), o({}), a(d), n(!1);
|
|
2689
2710
|
}
|
|
2690
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2691
|
-
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
2711
|
+
return /* @__PURE__ */ e.jsxs(Ue, { open: s, onOpenChange: n, children: [
|
|
2712
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Jn, { className: "h-4 w-4", chartType: t }) }) }),
|
|
2692
2713
|
/* @__PURE__ */ e.jsx(We, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2693
2714
|
/* @__PURE__ */ e.jsx(
|
|
2694
2715
|
S,
|
|
@@ -2696,7 +2717,7 @@ function Un() {
|
|
|
2696
2717
|
onClick: () => l("bar"),
|
|
2697
2718
|
className: "font-normal",
|
|
2698
2719
|
variant: "ghost",
|
|
2699
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2720
|
+
children: /* @__PURE__ */ e.jsx(As, { className: "size-5" })
|
|
2700
2721
|
}
|
|
2701
2722
|
),
|
|
2702
2723
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2712,7 +2733,7 @@ function Un() {
|
|
|
2712
2733
|
{
|
|
2713
2734
|
onClick: () => l("stackedBar"),
|
|
2714
2735
|
variant: "ghost",
|
|
2715
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2736
|
+
children: /* @__PURE__ */ e.jsx(Tt, { className: "size-5", strokeWidth: 0 })
|
|
2716
2737
|
}
|
|
2717
2738
|
),
|
|
2718
2739
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2720,7 +2741,7 @@ function Un() {
|
|
|
2720
2741
|
{
|
|
2721
2742
|
onClick: () => l("stackedLine"),
|
|
2722
2743
|
variant: "ghost",
|
|
2723
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2744
|
+
children: /* @__PURE__ */ e.jsx(Mt, { className: "size-5", strokeWidth: 0 })
|
|
2724
2745
|
}
|
|
2725
2746
|
),
|
|
2726
2747
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2728,7 +2749,7 @@ function Un() {
|
|
|
2728
2749
|
{
|
|
2729
2750
|
onClick: () => l("scatter"),
|
|
2730
2751
|
variant: "ghost",
|
|
2731
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2752
|
+
children: /* @__PURE__ */ e.jsx(yt, { className: "size-5" })
|
|
2732
2753
|
}
|
|
2733
2754
|
),
|
|
2734
2755
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2736,7 +2757,7 @@ function Un() {
|
|
|
2736
2757
|
{
|
|
2737
2758
|
onClick: () => l("bubble"),
|
|
2738
2759
|
variant: "ghost",
|
|
2739
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2760
|
+
children: /* @__PURE__ */ e.jsx(Ot, { className: "size-4" })
|
|
2740
2761
|
}
|
|
2741
2762
|
),
|
|
2742
2763
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2744,7 +2765,7 @@ function Un() {
|
|
|
2744
2765
|
{
|
|
2745
2766
|
onClick: () => l("pie"),
|
|
2746
2767
|
variant: "ghost",
|
|
2747
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2768
|
+
children: /* @__PURE__ */ e.jsx(bt, { className: "size-5" })
|
|
2748
2769
|
}
|
|
2749
2770
|
),
|
|
2750
2771
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2752,7 +2773,7 @@ function Un() {
|
|
|
2752
2773
|
{
|
|
2753
2774
|
onClick: () => l("doughnut"),
|
|
2754
2775
|
variant: "ghost",
|
|
2755
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2776
|
+
children: /* @__PURE__ */ e.jsx(zt, { className: "size-5", strokeWidth: 1 })
|
|
2756
2777
|
}
|
|
2757
2778
|
),
|
|
2758
2779
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2761,7 +2782,7 @@ function Un() {
|
|
|
2761
2782
|
onClick: () => l("radar"),
|
|
2762
2783
|
variant: "ghost",
|
|
2763
2784
|
children: /* @__PURE__ */ e.jsx(
|
|
2764
|
-
|
|
2785
|
+
wt,
|
|
2765
2786
|
{
|
|
2766
2787
|
className: "size-5 font-extralight",
|
|
2767
2788
|
strokeWidth: 0.5
|
|
@@ -2774,7 +2795,7 @@ function Un() {
|
|
|
2774
2795
|
{
|
|
2775
2796
|
onClick: () => l("polarArea"),
|
|
2776
2797
|
variant: "ghost",
|
|
2777
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2798
|
+
children: /* @__PURE__ */ e.jsx(Ft, { className: "size-5" })
|
|
2778
2799
|
}
|
|
2779
2800
|
),
|
|
2780
2801
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2782,7 +2803,7 @@ function Un() {
|
|
|
2782
2803
|
{
|
|
2783
2804
|
onClick: () => l("pyramid"),
|
|
2784
2805
|
variant: "ghost",
|
|
2785
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2806
|
+
children: /* @__PURE__ */ e.jsx(Dt, { className: "size-5" })
|
|
2786
2807
|
}
|
|
2787
2808
|
),
|
|
2788
2809
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2790,7 +2811,7 @@ function Un() {
|
|
|
2790
2811
|
{
|
|
2791
2812
|
onClick: () => l("range"),
|
|
2792
2813
|
variant: "ghost",
|
|
2793
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2814
|
+
children: /* @__PURE__ */ e.jsx(gt, { className: "size-5" })
|
|
2794
2815
|
}
|
|
2795
2816
|
),
|
|
2796
2817
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2806,7 +2827,7 @@ function Un() {
|
|
|
2806
2827
|
{
|
|
2807
2828
|
onClick: () => l("kpi"),
|
|
2808
2829
|
variant: "ghost",
|
|
2809
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2830
|
+
children: /* @__PURE__ */ e.jsx(Lt, { className: "size-6" })
|
|
2810
2831
|
}
|
|
2811
2832
|
),
|
|
2812
2833
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2820,55 +2841,55 @@ function Un() {
|
|
|
2820
2841
|
] }) })
|
|
2821
2842
|
] });
|
|
2822
2843
|
}
|
|
2823
|
-
function
|
|
2844
|
+
function Jn({ chartType: s, className: n }) {
|
|
2824
2845
|
switch (s) {
|
|
2825
2846
|
case "bar":
|
|
2826
|
-
return /* @__PURE__ */ e.jsx(
|
|
2847
|
+
return /* @__PURE__ */ e.jsx(As, { className: n });
|
|
2827
2848
|
case "line":
|
|
2828
2849
|
return /* @__PURE__ */ e.jsx(Es, { className: n });
|
|
2829
2850
|
case "pie":
|
|
2830
|
-
return /* @__PURE__ */ e.jsx(
|
|
2851
|
+
return /* @__PURE__ */ e.jsx(bt, { className: n });
|
|
2831
2852
|
case "radar":
|
|
2832
|
-
return /* @__PURE__ */ e.jsx(
|
|
2853
|
+
return /* @__PURE__ */ e.jsx(wt, { className: n });
|
|
2833
2854
|
case "scatter":
|
|
2834
|
-
return /* @__PURE__ */ e.jsx(
|
|
2855
|
+
return /* @__PURE__ */ e.jsx(yt, { className: n });
|
|
2835
2856
|
case "bubble":
|
|
2836
|
-
return /* @__PURE__ */ e.jsx(
|
|
2857
|
+
return /* @__PURE__ */ e.jsx(Ot, { className: n });
|
|
2837
2858
|
case "doughnut":
|
|
2838
|
-
return /* @__PURE__ */ e.jsx(
|
|
2859
|
+
return /* @__PURE__ */ e.jsx(zt, { className: n });
|
|
2839
2860
|
case "stackedBar":
|
|
2840
|
-
return /* @__PURE__ */ e.jsx(
|
|
2861
|
+
return /* @__PURE__ */ e.jsx(Tt, { className: "size-4 text-foreground/70" });
|
|
2841
2862
|
case "stackedLine":
|
|
2842
|
-
return /* @__PURE__ */ e.jsx(
|
|
2863
|
+
return /* @__PURE__ */ e.jsx(Mt, { className: "size-4 text-foreground/70" });
|
|
2843
2864
|
case "polarArea":
|
|
2844
|
-
return /* @__PURE__ */ e.jsx(
|
|
2865
|
+
return /* @__PURE__ */ e.jsx(Ft, { className: n });
|
|
2845
2866
|
case "pyramid":
|
|
2846
|
-
return /* @__PURE__ */ e.jsx(
|
|
2867
|
+
return /* @__PURE__ */ e.jsx(Dt, { className: n });
|
|
2847
2868
|
case "range":
|
|
2848
|
-
return /* @__PURE__ */ e.jsx(
|
|
2869
|
+
return /* @__PURE__ */ e.jsx(gt, { className: n });
|
|
2849
2870
|
case "kpi":
|
|
2850
|
-
return /* @__PURE__ */ e.jsx(
|
|
2871
|
+
return /* @__PURE__ */ e.jsx(Lt, { className: n });
|
|
2851
2872
|
case "text":
|
|
2852
2873
|
return /* @__PURE__ */ e.jsx(Is, { className: n });
|
|
2853
2874
|
default:
|
|
2854
2875
|
return /* @__PURE__ */ e.jsx(Ms, { className: n });
|
|
2855
2876
|
}
|
|
2856
2877
|
}
|
|
2857
|
-
function
|
|
2878
|
+
function Un() {
|
|
2858
2879
|
const s = c(
|
|
2859
|
-
(
|
|
2880
|
+
(t) => t.card.refreshInterval
|
|
2860
2881
|
), n = c(
|
|
2861
|
-
(
|
|
2882
|
+
(t) => t.actions.setCardRefreshInterval
|
|
2862
2883
|
);
|
|
2863
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2864
|
-
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
2884
|
+
return /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
2885
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ya, { className: "w-4 h-4" }) }) }),
|
|
2865
2886
|
/* @__PURE__ */ e.jsx(We, { 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: [
|
|
2866
|
-
/* @__PURE__ */ e.jsx(
|
|
2887
|
+
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
|
|
2867
2888
|
/* @__PURE__ */ e.jsx(
|
|
2868
2889
|
le,
|
|
2869
2890
|
{
|
|
2870
2891
|
value: s || "",
|
|
2871
|
-
onChange: (
|
|
2892
|
+
onChange: (t) => n(t.target.value),
|
|
2872
2893
|
id: "width",
|
|
2873
2894
|
placeholder: "30s",
|
|
2874
2895
|
className: "col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -2877,25 +2898,25 @@ function Jn() {
|
|
|
2877
2898
|
] }) }) }) })
|
|
2878
2899
|
] });
|
|
2879
2900
|
}
|
|
2880
|
-
function
|
|
2901
|
+
function Ys() {
|
|
2881
2902
|
c((l) => l.frame);
|
|
2882
|
-
const s = c((l) => l.card), n = c((l) => l.card.data),
|
|
2903
|
+
const s = c((l) => l.card), n = c((l) => l.card.data), t = c((l) => l.isShowingVisual), a = c((l) => l.isSqlRunning), o = c((l) => l.queryError), h = c((l) => l.pythonStdOut);
|
|
2883
2904
|
if (c((l) => l.onSave), c((l) => l.onClose), c((l) => l.actions.setCardSql), c((l) => l.actions.setCardType), c((l) => l.actions.setSqlGen), !s)
|
|
2884
2905
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2885
2906
|
function m() {
|
|
2886
|
-
return 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(
|
|
2907
|
+
return 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(Ta, { isLoading: a, card: s }) }) }) : s.type === "text" ? /* @__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(La, { isLoading: a, card: s }) }) }) : /* @__PURE__ */ e.jsx(kt, { className: "grow border-none shadow-none" });
|
|
2887
2908
|
}
|
|
2888
2909
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
|
|
2889
|
-
|
|
2910
|
+
a && /* @__PURE__ */ e.jsx(Pe, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
2890
2911
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
2891
|
-
|
|
2892
|
-
/* @__PURE__ */ e.jsx(
|
|
2912
|
+
t && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2913
|
+
/* @__PURE__ */ e.jsx(Gn, {}),
|
|
2893
2914
|
s.type !== "table" && /* @__PURE__ */ e.jsx(Kn, {}),
|
|
2894
|
-
/* @__PURE__ */ e.jsx(
|
|
2915
|
+
/* @__PURE__ */ e.jsx(Un, {})
|
|
2895
2916
|
] }),
|
|
2896
2917
|
/* @__PURE__ */ e.jsx(Wn, {})
|
|
2897
2918
|
] }),
|
|
2898
|
-
|
|
2919
|
+
t ? m() : (
|
|
2899
2920
|
// card.type === 'kpi' ? (
|
|
2900
2921
|
// <div className="flex grow items-center justify-center">
|
|
2901
2922
|
// <div className="w-1/2 rounded-md border">
|
|
@@ -2914,7 +2935,7 @@ function Xs() {
|
|
|
2914
2935
|
] });
|
|
2915
2936
|
}
|
|
2916
2937
|
function Qn() {
|
|
2917
|
-
const s = c((
|
|
2938
|
+
const s = c((t) => t.pythonStdOut);
|
|
2918
2939
|
if (!s)
|
|
2919
2940
|
return null;
|
|
2920
2941
|
const n = s.replace(/\n/g, "<br>");
|
|
@@ -2931,13 +2952,13 @@ function Qn() {
|
|
|
2931
2952
|
] });
|
|
2932
2953
|
}
|
|
2933
2954
|
function Wn() {
|
|
2934
|
-
const s = c((
|
|
2935
|
-
(
|
|
2955
|
+
const s = c((t) => t.isShowingVisual), n = c(
|
|
2956
|
+
(t) => t.actions.setIsShowingVisual
|
|
2936
2957
|
);
|
|
2937
2958
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2938
|
-
/* @__PURE__ */ e.jsx(
|
|
2959
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
|
|
2939
2960
|
/* @__PURE__ */ e.jsx(
|
|
2940
|
-
|
|
2961
|
+
Da,
|
|
2941
2962
|
{
|
|
2942
2963
|
checked: s,
|
|
2943
2964
|
onCheckedChange: () => n(!s),
|
|
@@ -2948,77 +2969,77 @@ function Wn() {
|
|
|
2948
2969
|
] });
|
|
2949
2970
|
}
|
|
2950
2971
|
function Ie() {
|
|
2951
|
-
const [s, n] =
|
|
2972
|
+
const [s, n] = O([]);
|
|
2952
2973
|
c(
|
|
2953
|
-
(
|
|
2974
|
+
(x) => x.card.cfg
|
|
2954
2975
|
);
|
|
2955
|
-
const
|
|
2956
|
-
(
|
|
2976
|
+
const t = c((x) => x.card.preferences), { setCardCfg: a, setFilterOnClickColumnIndex: o, setCardPreferences: h } = c((x) => x.actions), m = c(
|
|
2977
|
+
(x) => x.queryResultColumns
|
|
2957
2978
|
);
|
|
2958
2979
|
c(
|
|
2959
|
-
(
|
|
2980
|
+
(x) => {
|
|
2960
2981
|
var g;
|
|
2961
|
-
return (g =
|
|
2982
|
+
return (g = x.card.preferences) == null ? void 0 : g.filterOnClickColumnIndex;
|
|
2962
2983
|
}
|
|
2963
|
-
),
|
|
2984
|
+
), Q(() => {
|
|
2964
2985
|
m && n(new Array(m.length).fill(!1));
|
|
2965
2986
|
}, [m]);
|
|
2966
|
-
function l(
|
|
2967
|
-
var
|
|
2968
|
-
g ?
|
|
2969
|
-
...
|
|
2987
|
+
function l(x, g) {
|
|
2988
|
+
var j, i;
|
|
2989
|
+
g ? t != null && t.onClickFilter && ((j = t == null ? void 0 : t.onClickFilter) == null ? void 0 : j.length) > 0 ? h({
|
|
2990
|
+
...t,
|
|
2970
2991
|
onClickFilter: [
|
|
2971
|
-
...
|
|
2992
|
+
...t.onClickFilter,
|
|
2972
2993
|
{
|
|
2973
|
-
columnIndex:
|
|
2994
|
+
columnIndex: x,
|
|
2974
2995
|
expression: ""
|
|
2975
2996
|
}
|
|
2976
2997
|
]
|
|
2977
2998
|
}) : h({
|
|
2978
|
-
...
|
|
2999
|
+
...t,
|
|
2979
3000
|
onClickFilter: [
|
|
2980
3001
|
{
|
|
2981
|
-
columnIndex:
|
|
3002
|
+
columnIndex: x,
|
|
2982
3003
|
expression: ""
|
|
2983
3004
|
}
|
|
2984
3005
|
]
|
|
2985
3006
|
}) : (h({
|
|
2986
|
-
...
|
|
2987
|
-
onClickFilter: (i =
|
|
2988
|
-
(
|
|
3007
|
+
...t,
|
|
3008
|
+
onClickFilter: (i = t == null ? void 0 : t.onClickFilter) == null ? void 0 : i.filter(
|
|
3009
|
+
(u) => u.columnIndex !== x
|
|
2989
3010
|
)
|
|
2990
|
-
}), n((
|
|
2991
|
-
const f = [...
|
|
2992
|
-
return f[
|
|
3011
|
+
}), n((u) => {
|
|
3012
|
+
const f = [...u];
|
|
3013
|
+
return f[x] = !1, f;
|
|
2993
3014
|
}));
|
|
2994
3015
|
}
|
|
2995
|
-
function d(
|
|
3016
|
+
function d(x, g) {
|
|
2996
3017
|
var i;
|
|
2997
|
-
const
|
|
2998
|
-
...
|
|
3018
|
+
const j = (i = t == null ? void 0 : t.onClickFilter) == null ? void 0 : i.map((u) => u.columnIndex === x ? {
|
|
3019
|
+
...u,
|
|
2999
3020
|
expression: g.target.value
|
|
3000
|
-
} :
|
|
3021
|
+
} : u);
|
|
3001
3022
|
h({
|
|
3002
|
-
...
|
|
3003
|
-
onClickFilter:
|
|
3023
|
+
...t,
|
|
3024
|
+
onClickFilter: j
|
|
3004
3025
|
});
|
|
3005
3026
|
}
|
|
3006
|
-
function p(
|
|
3007
|
-
var g,
|
|
3008
|
-
if (s != null && s[
|
|
3027
|
+
function p(x) {
|
|
3028
|
+
var g, j, i, u;
|
|
3029
|
+
if (s != null && s[x] || (j = (g = t == null ? void 0 : t.onClickFilter) == null ? void 0 : g.find((f) => f.columnIndex === x)) != null && j.expression)
|
|
3009
3030
|
return /* @__PURE__ */ e.jsx(
|
|
3010
3031
|
le,
|
|
3011
3032
|
{
|
|
3012
|
-
value: (
|
|
3013
|
-
onChange: (f) => d(
|
|
3033
|
+
value: (u = (i = t == null ? void 0 : t.onClickFilter) == null ? void 0 : i.find((f) => f.columnIndex === x)) == null ? void 0 : u.expression,
|
|
3034
|
+
onChange: (f) => d(x, f),
|
|
3014
3035
|
type: "text",
|
|
3015
3036
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
3016
3037
|
placeholder: "Expression"
|
|
3017
3038
|
}
|
|
3018
3039
|
);
|
|
3019
3040
|
}
|
|
3020
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: m == null ? void 0 : m.map((
|
|
3021
|
-
var
|
|
3041
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: m == null ? void 0 : m.map((x, g) => {
|
|
3042
|
+
var j, i;
|
|
3022
3043
|
return /* @__PURE__ */ e.jsx(
|
|
3023
3044
|
"div",
|
|
3024
3045
|
{
|
|
@@ -3026,30 +3047,30 @@ function Ie() {
|
|
|
3026
3047
|
children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
|
|
3027
3048
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
|
|
3028
3049
|
/* @__PURE__ */ e.jsx(
|
|
3029
|
-
|
|
3050
|
+
Je,
|
|
3030
3051
|
{
|
|
3031
|
-
checked: !!((
|
|
3032
|
-
(
|
|
3052
|
+
checked: !!((j = t == null ? void 0 : t.onClickFilter) != null && j.find(
|
|
3053
|
+
(u) => u.columnIndex === g
|
|
3033
3054
|
)),
|
|
3034
|
-
onCheckedChange: (
|
|
3055
|
+
onCheckedChange: (u) => l(g, u)
|
|
3035
3056
|
}
|
|
3036
3057
|
),
|
|
3037
3058
|
/* @__PURE__ */ e.jsx(
|
|
3038
3059
|
"label",
|
|
3039
3060
|
{
|
|
3040
3061
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
3041
|
-
children:
|
|
3062
|
+
children: x
|
|
3042
3063
|
}
|
|
3043
3064
|
),
|
|
3044
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((i =
|
|
3045
|
-
(
|
|
3065
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((i = t == null ? void 0 : t.onClickFilter) == null ? void 0 : i.find(
|
|
3066
|
+
(u) => u.columnIndex === g
|
|
3046
3067
|
)) && /* @__PURE__ */ e.jsx(
|
|
3047
|
-
|
|
3068
|
+
jt,
|
|
3048
3069
|
{
|
|
3049
3070
|
onClick: () => {
|
|
3050
|
-
n((
|
|
3051
|
-
const f = [...
|
|
3052
|
-
return f[g] = !
|
|
3071
|
+
n((u) => {
|
|
3072
|
+
const f = [...u];
|
|
3073
|
+
return f[g] = !u[g], f;
|
|
3053
3074
|
});
|
|
3054
3075
|
},
|
|
3055
3076
|
className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
|
|
@@ -3059,15 +3080,15 @@ function Ie() {
|
|
|
3059
3080
|
p(g)
|
|
3060
3081
|
] })
|
|
3061
3082
|
},
|
|
3062
|
-
|
|
3083
|
+
x
|
|
3063
3084
|
);
|
|
3064
3085
|
}) });
|
|
3065
3086
|
}
|
|
3066
|
-
function
|
|
3087
|
+
function os() {
|
|
3067
3088
|
var m, l, d;
|
|
3068
3089
|
const s = c((p) => p.card.preferences), n = c(
|
|
3069
3090
|
(p) => p.card.cfg
|
|
3070
|
-
), { setCardCfg:
|
|
3091
|
+
), { setCardCfg: t, setCardPreferences: a, setChartOrientation: o } = c((p) => p.actions);
|
|
3071
3092
|
(m = n == null ? void 0 : n.options) != null && m.indexAxis;
|
|
3072
3093
|
function h(p) {
|
|
3073
3094
|
o(p);
|
|
@@ -3094,46 +3115,46 @@ function is() {
|
|
|
3094
3115
|
}
|
|
3095
3116
|
const ze = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3096
3117
|
function Zs(s, n) {
|
|
3097
|
-
var
|
|
3098
|
-
const
|
|
3099
|
-
return ((h = (o = (
|
|
3118
|
+
var a, o, h;
|
|
3119
|
+
const t = pt(s, n);
|
|
3120
|
+
return ((h = (o = (a = s == null ? void 0 : s.chartOptions) == null ? void 0 : a.scales) == null ? void 0 : o[t]) == null ? void 0 : h.type) || "linear";
|
|
3100
3121
|
}
|
|
3101
|
-
function
|
|
3102
|
-
var
|
|
3103
|
-
const [s, n] =
|
|
3104
|
-
var
|
|
3105
|
-
return (
|
|
3106
|
-
}),
|
|
3107
|
-
var
|
|
3108
|
-
return (
|
|
3109
|
-
}), o =
|
|
3110
|
-
Zs(
|
|
3111
|
-
), [l, d] =
|
|
3112
|
-
((
|
|
3113
|
-
), [p,
|
|
3114
|
-
((
|
|
3115
|
-
), [g,
|
|
3116
|
-
(
|
|
3117
|
-
),
|
|
3118
|
-
var
|
|
3119
|
-
return (
|
|
3120
|
-
}),
|
|
3121
|
-
|
|
3122
|
-
var
|
|
3123
|
-
m(Zs(
|
|
3124
|
-
((
|
|
3125
|
-
),
|
|
3126
|
-
((ge = (ye = (
|
|
3127
|
-
),
|
|
3128
|
-
}, [s,
|
|
3129
|
-
function
|
|
3130
|
-
return
|
|
3122
|
+
function At() {
|
|
3123
|
+
var W, J, ae, G, ne, C;
|
|
3124
|
+
const [s, n] = O(!1), t = c((y) => {
|
|
3125
|
+
var F;
|
|
3126
|
+
return (F = y.card) == null ? void 0 : F.preferences;
|
|
3127
|
+
}), a = c((y) => {
|
|
3128
|
+
var F;
|
|
3129
|
+
return (F = y.card) == null ? void 0 : F.cfg;
|
|
3130
|
+
}), o = pt(t, a), [h, m] = O(
|
|
3131
|
+
Zs(t)
|
|
3132
|
+
), [l, d] = O(
|
|
3133
|
+
((ae = (J = (W = t == null ? void 0 : t.chartOptions) == null ? void 0 : W.scales) == null ? void 0 : J[o]) == null ? void 0 : ae.min) || ""
|
|
3134
|
+
), [p, x] = O(
|
|
3135
|
+
((C = (ne = (G = t == null ? void 0 : t.chartOptions) == null ? void 0 : G.scales) == null ? void 0 : ne[o]) == null ? void 0 : C.max) || ""
|
|
3136
|
+
), [g, j] = O(l || p ? "custom" : "auto"), [i, u] = O(""), [f, z] = O(0), [N, D] = O(""), [b, A] = O(""), [E, V] = O(""), L = c(
|
|
3137
|
+
(y) => y.actions.setCardPreferences
|
|
3138
|
+
), v = c((y) => {
|
|
3139
|
+
var F;
|
|
3140
|
+
return (F = y.card) == null ? void 0 : F.type;
|
|
3141
|
+
}), w = ["pie", "doughnut", "polarArea"].includes(v);
|
|
3142
|
+
Q(() => {
|
|
3143
|
+
var y, F, _, fe, te, I, Y, se, ye, ge, U, re, ie, ve;
|
|
3144
|
+
m(Zs(t)), d(
|
|
3145
|
+
((_ = (F = (y = t == null ? void 0 : t.chartOptions) == null ? void 0 : y.scales) == null ? void 0 : F[o]) == null ? void 0 : _.min) === 0 ? 0 : ""
|
|
3146
|
+
), x(((I = (te = (fe = t == null ? void 0 : t.chartOptions) == null ? void 0 : fe.scales) == null ? void 0 : te[o]) == null ? void 0 : I.max) || ""), u(
|
|
3147
|
+
((ge = (ye = (se = (Y = t == null ? void 0 : t.chartOptions) == null ? void 0 : Y.scales) == null ? void 0 : se[o]) == null ? void 0 : ye.ticks) == null ? void 0 : ge.stepSize) || ""
|
|
3148
|
+
), z(((U = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : U.decimalPlaces) || 0), D(((re = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : re.suffix) || ""), A(((ie = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ie.currency) || ""), V(((ve = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ve.locale) || "");
|
|
3149
|
+
}, [s, t, o]);
|
|
3150
|
+
function q(y, F) {
|
|
3151
|
+
return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(y);
|
|
3131
3152
|
}
|
|
3132
|
-
function
|
|
3153
|
+
function K() {
|
|
3133
3154
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3134
3155
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
3135
3156
|
/* @__PURE__ */ e.jsx(
|
|
3136
|
-
|
|
3157
|
+
H,
|
|
3137
3158
|
{
|
|
3138
3159
|
className: "col-span-2 hover:cursor-pointer hover:underline",
|
|
3139
3160
|
htmlFor: "currency",
|
|
@@ -3150,9 +3171,9 @@ function Da() {
|
|
|
3150
3171
|
/* @__PURE__ */ e.jsx(
|
|
3151
3172
|
le,
|
|
3152
3173
|
{
|
|
3153
|
-
value:
|
|
3174
|
+
value: b,
|
|
3154
3175
|
placeholder: "USD",
|
|
3155
|
-
onChange: (
|
|
3176
|
+
onChange: (y) => A(y.target.value),
|
|
3156
3177
|
id: "currency",
|
|
3157
3178
|
className: `col-span-2 h-8 w-full ${ze}`
|
|
3158
3179
|
}
|
|
@@ -3160,21 +3181,21 @@ function Da() {
|
|
|
3160
3181
|
/* @__PURE__ */ e.jsx(
|
|
3161
3182
|
le,
|
|
3162
3183
|
{
|
|
3163
|
-
value:
|
|
3184
|
+
value: E,
|
|
3164
3185
|
placeholder: "en-US",
|
|
3165
|
-
onChange: (
|
|
3186
|
+
onChange: (y) => V(y.target.value),
|
|
3166
3187
|
id: "locale",
|
|
3167
3188
|
className: `col-span-2 h-8 w-full ${ze}`
|
|
3168
3189
|
}
|
|
3169
3190
|
)
|
|
3170
3191
|
] }),
|
|
3171
3192
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
|
|
3172
|
-
/* @__PURE__ */ e.jsx(
|
|
3193
|
+
/* @__PURE__ */ e.jsx(H, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
|
|
3173
3194
|
/* @__PURE__ */ e.jsx(
|
|
3174
3195
|
le,
|
|
3175
3196
|
{
|
|
3176
3197
|
value: f,
|
|
3177
|
-
onChange: (
|
|
3198
|
+
onChange: (y) => z(Number(y.target.value)),
|
|
3178
3199
|
id: "format",
|
|
3179
3200
|
className: `col-span-6 h-8 w-full tracking-wide ${ze}`
|
|
3180
3201
|
}
|
|
@@ -3182,16 +3203,16 @@ function Da() {
|
|
|
3182
3203
|
] })
|
|
3183
3204
|
] });
|
|
3184
3205
|
}
|
|
3185
|
-
function
|
|
3206
|
+
function T() {
|
|
3186
3207
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3187
3208
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3188
|
-
/* @__PURE__ */ e.jsx(
|
|
3209
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
|
|
3189
3210
|
/* @__PURE__ */ e.jsx(
|
|
3190
3211
|
le,
|
|
3191
3212
|
{
|
|
3192
3213
|
id: "min",
|
|
3193
3214
|
value: l,
|
|
3194
|
-
onChange: (
|
|
3215
|
+
onChange: (y) => d((F) => q(F, y.target.value)),
|
|
3195
3216
|
className: `col-span-1 h-8 w-full ${ze}`
|
|
3196
3217
|
}
|
|
3197
3218
|
),
|
|
@@ -3199,19 +3220,19 @@ function Da() {
|
|
|
3199
3220
|
le,
|
|
3200
3221
|
{
|
|
3201
3222
|
value: p,
|
|
3202
|
-
onChange: (
|
|
3223
|
+
onChange: (y) => x((F) => q(F, y.target.value)),
|
|
3203
3224
|
id: "max",
|
|
3204
3225
|
className: `col-span-1 h-8 w-full ${ze}`
|
|
3205
3226
|
}
|
|
3206
3227
|
)
|
|
3207
3228
|
] }),
|
|
3208
3229
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3209
|
-
/* @__PURE__ */ e.jsx(
|
|
3230
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "step-size", children: "Step Size" }),
|
|
3210
3231
|
/* @__PURE__ */ e.jsx(
|
|
3211
3232
|
le,
|
|
3212
3233
|
{
|
|
3213
3234
|
value: i,
|
|
3214
|
-
onChange: (
|
|
3235
|
+
onChange: (y) => u((F) => q(F, y.target.value)),
|
|
3215
3236
|
id: "step-size",
|
|
3216
3237
|
className: `col-span-1 h-8 w-full ${ze}`
|
|
3217
3238
|
}
|
|
@@ -3219,40 +3240,40 @@ function Da() {
|
|
|
3219
3240
|
] })
|
|
3220
3241
|
] });
|
|
3221
3242
|
}
|
|
3222
|
-
function
|
|
3223
|
-
var
|
|
3224
|
-
let
|
|
3225
|
-
g === "custom" && (
|
|
3243
|
+
function R() {
|
|
3244
|
+
var _;
|
|
3245
|
+
let y = {};
|
|
3246
|
+
g === "custom" && (y = {
|
|
3226
3247
|
min: l,
|
|
3227
3248
|
max: p,
|
|
3228
3249
|
ticks: {
|
|
3229
3250
|
stepSize: i
|
|
3230
3251
|
}
|
|
3231
3252
|
});
|
|
3232
|
-
const
|
|
3233
|
-
...
|
|
3253
|
+
const F = {
|
|
3254
|
+
...t || {},
|
|
3234
3255
|
chartOptions: {
|
|
3235
|
-
...
|
|
3256
|
+
...t == null ? void 0 : t.chartOptions,
|
|
3236
3257
|
scales: {
|
|
3237
|
-
...(
|
|
3258
|
+
...(_ = t == null ? void 0 : t.chartOptions) == null ? void 0 : _.scales,
|
|
3238
3259
|
[o]: {
|
|
3239
3260
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3240
3261
|
type: h,
|
|
3241
|
-
...h === "linear" ?
|
|
3262
|
+
...h === "linear" ? y : {}
|
|
3242
3263
|
}
|
|
3243
3264
|
}
|
|
3244
3265
|
},
|
|
3245
3266
|
numberAxisFormat: {
|
|
3246
3267
|
decimalPlaces: f,
|
|
3247
3268
|
suffix: N,
|
|
3248
|
-
currency:
|
|
3249
|
-
locale:
|
|
3269
|
+
currency: b,
|
|
3270
|
+
locale: E
|
|
3250
3271
|
}
|
|
3251
3272
|
};
|
|
3252
|
-
console.log(
|
|
3273
|
+
console.log(F), L(F);
|
|
3253
3274
|
}
|
|
3254
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3255
|
-
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3275
|
+
return /* @__PURE__ */ e.jsxs(Ue, { onOpenChange: (y) => n(y), children: [
|
|
3276
|
+
/* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: /* @__PURE__ */ e.jsx(Aa, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3256
3277
|
/* @__PURE__ */ e.jsx(We, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3257
3278
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3258
3279
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
@@ -3260,33 +3281,33 @@ function Da() {
|
|
|
3260
3281
|
] }),
|
|
3261
3282
|
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
|
|
3262
3283
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
3263
|
-
/* @__PURE__ */ e.jsx(
|
|
3284
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale", children: "Type" }),
|
|
3264
3285
|
/* @__PURE__ */ e.jsxs(
|
|
3265
3286
|
Oe,
|
|
3266
3287
|
{
|
|
3267
|
-
disabled:
|
|
3288
|
+
disabled: w,
|
|
3268
3289
|
value: h,
|
|
3269
|
-
onValueChange: (
|
|
3290
|
+
onValueChange: (y) => m(y),
|
|
3270
3291
|
children: [
|
|
3271
3292
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3272
3293
|
/* @__PURE__ */ e.jsx(Le, { id: "type", children: /* @__PURE__ */ e.jsxs($e, { children: [
|
|
3273
|
-
/* @__PURE__ */ e.jsx(
|
|
3274
|
-
/* @__PURE__ */ e.jsx(
|
|
3275
|
-
/* @__PURE__ */ e.jsx(
|
|
3294
|
+
/* @__PURE__ */ e.jsx(Ae, { children: "Option" }),
|
|
3295
|
+
/* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
|
|
3296
|
+
/* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
|
|
3276
3297
|
] }) })
|
|
3277
3298
|
]
|
|
3278
3299
|
}
|
|
3279
3300
|
)
|
|
3280
3301
|
] }),
|
|
3281
3302
|
h == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3282
|
-
/* @__PURE__ */ e.jsx(
|
|
3303
|
+
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
|
|
3283
3304
|
/* @__PURE__ */ e.jsxs(
|
|
3284
3305
|
Ls,
|
|
3285
3306
|
{
|
|
3286
|
-
disabled:
|
|
3307
|
+
disabled: w,
|
|
3287
3308
|
id: "scale-option",
|
|
3288
3309
|
value: g,
|
|
3289
|
-
onValueChange: (
|
|
3310
|
+
onValueChange: (y) => j(y),
|
|
3290
3311
|
className: "col-span-2 flex gap-3",
|
|
3291
3312
|
defaultValue: "x",
|
|
3292
3313
|
children: [
|
|
@@ -3302,13 +3323,13 @@ function Da() {
|
|
|
3302
3323
|
}
|
|
3303
3324
|
)
|
|
3304
3325
|
] }),
|
|
3305
|
-
g === "custom" && h == "linear" &&
|
|
3306
|
-
|
|
3307
|
-
/* @__PURE__ */ e.jsx(
|
|
3326
|
+
g === "custom" && h == "linear" && T(),
|
|
3327
|
+
K(),
|
|
3328
|
+
/* @__PURE__ */ e.jsx(Ea, {}),
|
|
3308
3329
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3309
3330
|
S,
|
|
3310
3331
|
{
|
|
3311
|
-
onClick:
|
|
3332
|
+
onClick: R,
|
|
3312
3333
|
variant: "secondary",
|
|
3313
3334
|
className: "col-span-1 col-start-3 h-8 w-full",
|
|
3314
3335
|
children: "Apply"
|
|
@@ -3323,46 +3344,46 @@ function Yn({ idx: s }) {
|
|
|
3323
3344
|
const n = c((d) => {
|
|
3324
3345
|
var p;
|
|
3325
3346
|
return (p = d.card) == null ? void 0 : p.preferences;
|
|
3326
|
-
}),
|
|
3347
|
+
}), t = c(
|
|
3327
3348
|
(d) => {
|
|
3328
3349
|
var p;
|
|
3329
3350
|
return (p = d.card.preferences) == null ? void 0 : p.datasetOptions;
|
|
3330
3351
|
}
|
|
3331
|
-
),
|
|
3352
|
+
), a = c(
|
|
3332
3353
|
(d) => d.actions.setCardPreferences
|
|
3333
|
-
), o = (l = n == null ? void 0 : n.chartOptions) == null ? void 0 : l.indexAxis, h =
|
|
3354
|
+
), o = (l = n == null ? void 0 : n.chartOptions) == null ? void 0 : l.indexAxis, h = t == null ? void 0 : t.find((d) => d.idx === s);
|
|
3334
3355
|
function m(d, p) {
|
|
3335
|
-
(d === "end" || d === "start") &&
|
|
3336
|
-
const
|
|
3356
|
+
(d === "end" || d === "start") && Va(qa());
|
|
3357
|
+
const x = {
|
|
3337
3358
|
display: d !== "none",
|
|
3338
3359
|
align: d,
|
|
3339
3360
|
anchor: d,
|
|
3340
3361
|
clamp: !0
|
|
3341
3362
|
};
|
|
3342
3363
|
if (!h)
|
|
3343
|
-
|
|
3364
|
+
a({
|
|
3344
3365
|
...n,
|
|
3345
3366
|
datasetOptions: [
|
|
3346
|
-
...
|
|
3367
|
+
...t || [],
|
|
3347
3368
|
{
|
|
3348
3369
|
idx: p,
|
|
3349
|
-
datalabels:
|
|
3370
|
+
datalabels: x
|
|
3350
3371
|
}
|
|
3351
3372
|
]
|
|
3352
3373
|
});
|
|
3353
3374
|
else {
|
|
3354
3375
|
const g = { ...h };
|
|
3355
|
-
g.datalabels =
|
|
3356
|
-
const
|
|
3376
|
+
g.datalabels = x;
|
|
3377
|
+
const j = t == null ? void 0 : t.map(
|
|
3357
3378
|
(i) => i.idx === p ? g : i
|
|
3358
3379
|
);
|
|
3359
|
-
|
|
3380
|
+
a({
|
|
3360
3381
|
...n,
|
|
3361
|
-
datasetOptions:
|
|
3382
|
+
datasetOptions: j
|
|
3362
3383
|
});
|
|
3363
3384
|
}
|
|
3364
3385
|
}
|
|
3365
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3386
|
+
return /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
3366
3387
|
/* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsx(bn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
3367
3388
|
/* @__PURE__ */ e.jsx(We, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3368
3389
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3372,7 +3393,7 @@ function Yn({ idx: s }) {
|
|
|
3372
3393
|
size: "sm",
|
|
3373
3394
|
variant: "secondary",
|
|
3374
3395
|
className: "h-7 p-1 text-xs font-normal",
|
|
3375
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3396
|
+
children: /* @__PURE__ */ e.jsx(Ia, { className: "size-4" })
|
|
3376
3397
|
}
|
|
3377
3398
|
),
|
|
3378
3399
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3385,7 +3406,7 @@ function Yn({ idx: s }) {
|
|
|
3385
3406
|
children: /* @__PURE__ */ e.jsx(
|
|
3386
3407
|
on,
|
|
3387
3408
|
{
|
|
3388
|
-
className:
|
|
3409
|
+
className: ee("h-4 w-4", {
|
|
3389
3410
|
"rotate-90": o === "y"
|
|
3390
3411
|
})
|
|
3391
3412
|
}
|
|
@@ -3402,7 +3423,7 @@ function Yn({ idx: s }) {
|
|
|
3402
3423
|
children: /* @__PURE__ */ e.jsx(
|
|
3403
3424
|
dn,
|
|
3404
3425
|
{
|
|
3405
|
-
className:
|
|
3426
|
+
className: ee("h-4 w-4", {
|
|
3406
3427
|
"rotate-90": o === "y"
|
|
3407
3428
|
})
|
|
3408
3429
|
}
|
|
@@ -3419,7 +3440,7 @@ function Yn({ idx: s }) {
|
|
|
3419
3440
|
children: /* @__PURE__ */ e.jsx(
|
|
3420
3441
|
cn,
|
|
3421
3442
|
{
|
|
3422
|
-
className:
|
|
3443
|
+
className: ee("h-4 w-4", {
|
|
3423
3444
|
"rotate-90": o === "y"
|
|
3424
3445
|
})
|
|
3425
3446
|
}
|
|
@@ -3429,20 +3450,20 @@ function Yn({ idx: s }) {
|
|
|
3429
3450
|
] }) })
|
|
3430
3451
|
] });
|
|
3431
3452
|
}
|
|
3432
|
-
function
|
|
3453
|
+
function Et() {
|
|
3433
3454
|
const s = c((d) => d.card), n = c(
|
|
3434
3455
|
(d) => {
|
|
3435
|
-
var p,
|
|
3436
|
-
return (g = (
|
|
3456
|
+
var p, x, g;
|
|
3457
|
+
return (g = (x = (p = d == null ? void 0 : d.card) == null ? void 0 : p.preferences) == null ? void 0 : x.chartOptions) == null ? void 0 : g.indexAxis;
|
|
3437
3458
|
}
|
|
3438
|
-
),
|
|
3459
|
+
), t = n === "y" ? "Y axis" : "X axis", a = n === "y" ? "X axis" : "Y axis", {
|
|
3439
3460
|
keys: o,
|
|
3440
3461
|
metricKeys: h,
|
|
3441
3462
|
dimensionKeys: m
|
|
3442
3463
|
} = bs(s.data || []);
|
|
3443
3464
|
let l = h;
|
|
3444
3465
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
3445
|
-
const d =
|
|
3466
|
+
const d = Ra({
|
|
3446
3467
|
dataArray: s.data || [],
|
|
3447
3468
|
groupKey: m[0],
|
|
3448
3469
|
pivotKey: m[1],
|
|
@@ -3452,34 +3473,34 @@ function Ea() {
|
|
|
3452
3473
|
}
|
|
3453
3474
|
return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3454
3475
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3455
|
-
/* @__PURE__ */ e.jsx(
|
|
3476
|
+
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
3456
3477
|
/* @__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: m[0] }) }) })
|
|
3457
3478
|
] }),
|
|
3458
3479
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3459
3480
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3460
|
-
/* @__PURE__ */ e.jsx(
|
|
3461
|
-
/* @__PURE__ */ e.jsx(
|
|
3481
|
+
/* @__PURE__ */ e.jsx(H, { children: a }),
|
|
3482
|
+
/* @__PURE__ */ e.jsx(At, {})
|
|
3462
3483
|
] }),
|
|
3463
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: l.map((d, p) => /* @__PURE__ */ e.jsx(
|
|
3484
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: l.map((d, p) => /* @__PURE__ */ e.jsx(Zn, { col: d, idx: p }, d)) })
|
|
3464
3485
|
] })
|
|
3465
3486
|
] });
|
|
3466
3487
|
}
|
|
3467
|
-
function
|
|
3468
|
-
const
|
|
3488
|
+
function Zn({ col: s, idx: n }) {
|
|
3489
|
+
const t = c((l) => {
|
|
3469
3490
|
var d;
|
|
3470
3491
|
return (d = l.card) == null ? void 0 : d.preferences;
|
|
3471
|
-
}),
|
|
3492
|
+
}), a = c(
|
|
3472
3493
|
(l) => {
|
|
3473
3494
|
var d;
|
|
3474
3495
|
return (d = l.card.preferences) == null ? void 0 : d.datasetOptions;
|
|
3475
3496
|
}
|
|
3476
|
-
), o =
|
|
3497
|
+
), o = a == null ? void 0 : a.find((l) => l.idx === n), { setCardPreferences: h } = c((l) => l.actions);
|
|
3477
3498
|
function m(l) {
|
|
3478
3499
|
if (!o)
|
|
3479
3500
|
h({
|
|
3480
|
-
...
|
|
3501
|
+
...t,
|
|
3481
3502
|
datasetOptions: [
|
|
3482
|
-
...
|
|
3503
|
+
...a || [],
|
|
3483
3504
|
{
|
|
3484
3505
|
idx: n,
|
|
3485
3506
|
type: l === "area" ? "line" : l,
|
|
@@ -3490,11 +3511,11 @@ function Xn({ col: s, idx: n }) {
|
|
|
3490
3511
|
else {
|
|
3491
3512
|
const d = { ...o };
|
|
3492
3513
|
d.type = l === "area" ? "line" : l, d.fill = l === "area" ? "origin" : "";
|
|
3493
|
-
const p =
|
|
3494
|
-
(
|
|
3514
|
+
const p = a == null ? void 0 : a.map(
|
|
3515
|
+
(x) => x.idx === n ? d : x
|
|
3495
3516
|
);
|
|
3496
3517
|
h({
|
|
3497
|
-
...
|
|
3518
|
+
...t,
|
|
3498
3519
|
datasetOptions: p
|
|
3499
3520
|
});
|
|
3500
3521
|
}
|
|
@@ -3503,7 +3524,7 @@ function Xn({ col: s, idx: n }) {
|
|
|
3503
3524
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
3504
3525
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3505
3526
|
/* @__PURE__ */ e.jsx(
|
|
3506
|
-
|
|
3527
|
+
As,
|
|
3507
3528
|
{
|
|
3508
3529
|
onClick: () => m("bar"),
|
|
3509
3530
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3517,7 +3538,7 @@ function Xn({ col: s, idx: n }) {
|
|
|
3517
3538
|
}
|
|
3518
3539
|
),
|
|
3519
3540
|
/* @__PURE__ */ e.jsx(
|
|
3520
|
-
|
|
3541
|
+
Za,
|
|
3521
3542
|
{
|
|
3522
3543
|
onClick: () => m("area"),
|
|
3523
3544
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -3534,13 +3555,13 @@ function Xn({ col: s, idx: n }) {
|
|
|
3534
3555
|
] })
|
|
3535
3556
|
] });
|
|
3536
3557
|
}
|
|
3537
|
-
function
|
|
3558
|
+
function Xn({
|
|
3538
3559
|
cardType: s
|
|
3539
3560
|
}) {
|
|
3540
3561
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3541
|
-
/* @__PURE__ */ e.jsxs(
|
|
3542
|
-
/* @__PURE__ */ e.jsx(
|
|
3543
|
-
/* @__PURE__ */ e.jsxs(
|
|
3562
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3563
|
+
/* @__PURE__ */ e.jsx($, { children: `${Ds(s)} Chart` }),
|
|
3564
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 font-mono text-xs", children: [
|
|
3544
3565
|
/* @__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" }),
|
|
3545
3566
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3546
3567
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -3563,26 +3584,26 @@ function Zn({
|
|
|
3563
3584
|
] })
|
|
3564
3585
|
] })
|
|
3565
3586
|
] }),
|
|
3566
|
-
/* @__PURE__ */ e.jsxs(
|
|
3567
|
-
/* @__PURE__ */ e.jsx(
|
|
3568
|
-
/* @__PURE__ */ e.jsxs(
|
|
3569
|
-
/* @__PURE__ */ e.jsx(
|
|
3570
|
-
/* @__PURE__ */ e.jsx(
|
|
3587
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
3588
|
+
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
3589
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 px-2", children: [
|
|
3590
|
+
/* @__PURE__ */ e.jsx(os, {}),
|
|
3591
|
+
/* @__PURE__ */ e.jsx(Et, {})
|
|
3571
3592
|
] })
|
|
3572
3593
|
] }),
|
|
3573
|
-
/* @__PURE__ */ e.jsxs(
|
|
3574
|
-
/* @__PURE__ */ e.jsx(
|
|
3575
|
-
/* @__PURE__ */ e.jsx(
|
|
3594
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
3595
|
+
/* @__PURE__ */ e.jsx($, { children: "Filter on click" }),
|
|
3596
|
+
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3576
3597
|
] })
|
|
3577
3598
|
] }) });
|
|
3578
3599
|
}
|
|
3579
|
-
function
|
|
3600
|
+
function Vs() {
|
|
3580
3601
|
var o, h, m;
|
|
3581
3602
|
const s = c(
|
|
3582
3603
|
(l) => l.card.cfg
|
|
3583
|
-
), n = c((l) => l.actions.setCardCfg),
|
|
3584
|
-
function
|
|
3585
|
-
var
|
|
3604
|
+
), n = c((l) => l.actions.setCardCfg), t = c((l) => l.card.type);
|
|
3605
|
+
function a(l) {
|
|
3606
|
+
var x;
|
|
3586
3607
|
const d = {
|
|
3587
3608
|
datalabels: {
|
|
3588
3609
|
display: l !== "none",
|
|
@@ -3595,7 +3616,7 @@ function qs() {
|
|
|
3595
3616
|
options: {
|
|
3596
3617
|
...s == null ? void 0 : s.options,
|
|
3597
3618
|
plugins: {
|
|
3598
|
-
...(
|
|
3619
|
+
...(x = s == null ? void 0 : s.options) == null ? void 0 : x.plugins,
|
|
3599
3620
|
...d
|
|
3600
3621
|
}
|
|
3601
3622
|
}
|
|
@@ -3605,22 +3626,22 @@ function qs() {
|
|
|
3605
3626
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3606
3627
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3607
3628
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
3608
|
-
!["pyramid"].includes(
|
|
3629
|
+
!["pyramid"].includes(t) && /* @__PURE__ */ e.jsx(At, {})
|
|
3609
3630
|
] }),
|
|
3610
3631
|
/* @__PURE__ */ e.jsxs(
|
|
3611
3632
|
Oe,
|
|
3612
3633
|
{
|
|
3613
3634
|
value: (m = (h = (o = s == null ? void 0 : s.options) == null ? void 0 : o.plugins) == null ? void 0 : h.datalabels) == null ? void 0 : m.anchor,
|
|
3614
|
-
onValueChange:
|
|
3635
|
+
onValueChange: a,
|
|
3615
3636
|
defaultValue: "none",
|
|
3616
3637
|
children: [
|
|
3617
3638
|
/* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
|
|
3618
3639
|
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs($e, { children: [
|
|
3619
|
-
/* @__PURE__ */ e.jsx(
|
|
3620
|
-
/* @__PURE__ */ e.jsx(
|
|
3621
|
-
|
|
3622
|
-
/* @__PURE__ */ e.jsx(
|
|
3623
|
-
|
|
3640
|
+
/* @__PURE__ */ e.jsx(Ae, { children: "Data Labels" }),
|
|
3641
|
+
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
|
|
3642
|
+
t !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
|
|
3643
|
+
/* @__PURE__ */ e.jsx(X, { value: "center", children: "Center" }),
|
|
3644
|
+
t !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "end", children: "End" })
|
|
3624
3645
|
] }) })
|
|
3625
3646
|
]
|
|
3626
3647
|
}
|
|
@@ -3630,16 +3651,16 @@ function qs() {
|
|
|
3630
3651
|
function el({
|
|
3631
3652
|
cardType: s
|
|
3632
3653
|
}) {
|
|
3633
|
-
function n(
|
|
3634
|
-
const
|
|
3654
|
+
function n(t) {
|
|
3655
|
+
const a = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
3635
3656
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3636
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children:
|
|
3657
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? a : o }),
|
|
3637
3658
|
/* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
|
|
3638
3659
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
3639
3660
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
3640
3661
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
3641
3662
|
/* @__PURE__ */ e.jsx("li", { children: "y-axis - category" }),
|
|
3642
|
-
|
|
3663
|
+
t === "bubble" && /* @__PURE__ */ e.jsx("li", { children: "radius - number" })
|
|
3643
3664
|
] }),
|
|
3644
3665
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3645
3666
|
"See ",
|
|
@@ -3658,17 +3679,17 @@ function el({
|
|
|
3658
3679
|
] });
|
|
3659
3680
|
}
|
|
3660
3681
|
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3661
|
-
/* @__PURE__ */ e.jsxs(
|
|
3662
|
-
/* @__PURE__ */ e.jsx(
|
|
3663
|
-
/* @__PURE__ */ e.jsx(
|
|
3682
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3683
|
+
/* @__PURE__ */ e.jsx($, { children: `${Ds(s)} Chart` }),
|
|
3684
|
+
/* @__PURE__ */ e.jsx(P, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3664
3685
|
] }),
|
|
3665
|
-
/* @__PURE__ */ e.jsxs(
|
|
3666
|
-
/* @__PURE__ */ e.jsx(
|
|
3667
|
-
/* @__PURE__ */ e.jsx(
|
|
3686
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
3687
|
+
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
3688
|
+
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Vs, {}) })
|
|
3668
3689
|
] }),
|
|
3669
|
-
/* @__PURE__ */ e.jsxs(
|
|
3670
|
-
/* @__PURE__ */ e.jsx(
|
|
3671
|
-
/* @__PURE__ */ e.jsx(
|
|
3690
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
3691
|
+
/* @__PURE__ */ e.jsx($, { children: "Filter on click" }),
|
|
3692
|
+
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3672
3693
|
] })
|
|
3673
3694
|
] }) });
|
|
3674
3695
|
}
|
|
@@ -3685,7 +3706,7 @@ const sl = {
|
|
|
3685
3706
|
data: []
|
|
3686
3707
|
}
|
|
3687
3708
|
]
|
|
3688
|
-
},
|
|
3709
|
+
}, tl = {
|
|
3689
3710
|
datasets: [
|
|
3690
3711
|
{
|
|
3691
3712
|
fill: "origin",
|
|
@@ -3695,7 +3716,7 @@ const sl = {
|
|
|
3695
3716
|
}
|
|
3696
3717
|
]
|
|
3697
3718
|
};
|
|
3698
|
-
function
|
|
3719
|
+
function al() {
|
|
3699
3720
|
const s = c((n) => n.card.type);
|
|
3700
3721
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
3701
3722
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3707,17 +3728,17 @@ function tl() {
|
|
|
3707
3728
|
children: nl(s)
|
|
3708
3729
|
}
|
|
3709
3730
|
),
|
|
3710
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3711
|
-
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3731
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(os, {}) }),
|
|
3732
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Vs, {}) }),
|
|
3712
3733
|
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3713
3734
|
] });
|
|
3714
3735
|
}
|
|
3715
3736
|
function nl(s) {
|
|
3716
3737
|
if (["line", "bar"].includes(s))
|
|
3717
3738
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3718
|
-
/* @__PURE__ */ e.jsxs(
|
|
3719
|
-
/* @__PURE__ */ e.jsx(
|
|
3720
|
-
/* @__PURE__ */ e.jsxs(
|
|
3739
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3740
|
+
/* @__PURE__ */ e.jsx($, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3741
|
+
/* @__PURE__ */ e.jsxs(P, { className: " ", children: [
|
|
3721
3742
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
|
|
3722
3743
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3723
3744
|
/* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
|
|
@@ -3725,9 +3746,9 @@ function nl(s) {
|
|
|
3725
3746
|
] })
|
|
3726
3747
|
] })
|
|
3727
3748
|
] }),
|
|
3728
|
-
/* @__PURE__ */ e.jsxs(
|
|
3729
|
-
/* @__PURE__ */ e.jsx(
|
|
3730
|
-
/* @__PURE__ */ e.jsxs(
|
|
3749
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
3750
|
+
/* @__PURE__ */ e.jsx($, { className: "font-normal", children: "Mixed Chart" }),
|
|
3751
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-2 text-xs", children: [
|
|
3731
3752
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3732
3753
|
"Click ",
|
|
3733
3754
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3736,9 +3757,9 @@ function nl(s) {
|
|
|
3736
3757
|
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(sl, null, 2) })
|
|
3737
3758
|
] })
|
|
3738
3759
|
] }),
|
|
3739
|
-
/* @__PURE__ */ e.jsxs(
|
|
3740
|
-
/* @__PURE__ */ e.jsx(
|
|
3741
|
-
/* @__PURE__ */ e.jsxs(
|
|
3760
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
3761
|
+
/* @__PURE__ */ e.jsx($, { className: "font-normal", children: "Area Chart" }),
|
|
3762
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-2 text-xs", children: [
|
|
3742
3763
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
3743
3764
|
"Click ",
|
|
3744
3765
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
@@ -3754,18 +3775,18 @@ function nl(s) {
|
|
|
3754
3775
|
),
|
|
3755
3776
|
"for more options."
|
|
3756
3777
|
] }),
|
|
3757
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3778
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(tl, null, 2) })
|
|
3758
3779
|
] })
|
|
3759
3780
|
] })
|
|
3760
3781
|
] });
|
|
3761
3782
|
if (s === "bubble")
|
|
3762
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3763
|
-
/* @__PURE__ */ e.jsx(
|
|
3783
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3784
|
+
/* @__PURE__ */ e.jsx($, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3764
3785
|
"How to create a ",
|
|
3765
3786
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3766
3787
|
" chart query?"
|
|
3767
3788
|
] }) }),
|
|
3768
|
-
/* @__PURE__ */ e.jsxs(
|
|
3789
|
+
/* @__PURE__ */ e.jsxs(P, { className: " ", children: [
|
|
3769
3790
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
|
|
3770
3791
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3771
3792
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3777,13 +3798,13 @@ function nl(s) {
|
|
|
3777
3798
|
] })
|
|
3778
3799
|
] }) });
|
|
3779
3800
|
if (s === "scatter")
|
|
3780
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3781
|
-
/* @__PURE__ */ e.jsx(
|
|
3801
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3802
|
+
/* @__PURE__ */ e.jsx($, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3782
3803
|
"How to create a ",
|
|
3783
3804
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
3784
3805
|
" chart query?"
|
|
3785
3806
|
] }) }),
|
|
3786
|
-
/* @__PURE__ */ e.jsxs(
|
|
3807
|
+
/* @__PURE__ */ e.jsxs(P, { className: " ", children: [
|
|
3787
3808
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
|
|
3788
3809
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3789
3810
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3794,13 +3815,13 @@ function nl(s) {
|
|
|
3794
3815
|
] })
|
|
3795
3816
|
] }) });
|
|
3796
3817
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3797
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3798
|
-
/* @__PURE__ */ e.jsx(
|
|
3818
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3819
|
+
/* @__PURE__ */ e.jsx($, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3799
3820
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3800
3821
|
" ",
|
|
3801
3822
|
"chart query"
|
|
3802
3823
|
] }) }),
|
|
3803
|
-
/* @__PURE__ */ e.jsxs(
|
|
3824
|
+
/* @__PURE__ */ e.jsxs(P, { className: " ", children: [
|
|
3804
3825
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
|
|
3805
3826
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
3806
3827
|
/* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
|
|
@@ -3810,27 +3831,27 @@ function nl(s) {
|
|
|
3810
3831
|
] }) });
|
|
3811
3832
|
}
|
|
3812
3833
|
function ll() {
|
|
3813
|
-
var d, p,
|
|
3834
|
+
var d, p, x, g, j;
|
|
3814
3835
|
const s = c((i) => i.card.preferences), n = c(
|
|
3815
3836
|
(i) => i.actions.setCardPreferences
|
|
3816
|
-
),
|
|
3837
|
+
), t = c(
|
|
3817
3838
|
(i) => i.actions.setNumberFormat
|
|
3818
3839
|
);
|
|
3819
3840
|
c(
|
|
3820
3841
|
(i) => {
|
|
3821
|
-
var
|
|
3822
|
-
return (f = (
|
|
3842
|
+
var u, f;
|
|
3843
|
+
return (f = (u = i.card.preferences) == null ? void 0 : u.formatNumber) == null ? void 0 : f.decimalPlaces;
|
|
3823
3844
|
}
|
|
3824
3845
|
);
|
|
3825
|
-
const
|
|
3846
|
+
const a = c(
|
|
3826
3847
|
(i) => {
|
|
3827
|
-
var
|
|
3828
|
-
return (f = (
|
|
3848
|
+
var u, f;
|
|
3849
|
+
return (f = (u = i.card.preferences) == null ? void 0 : u.formatNumber) == null ? void 0 : f.locale;
|
|
3829
3850
|
}
|
|
3830
3851
|
), o = c(
|
|
3831
3852
|
(i) => {
|
|
3832
|
-
var
|
|
3833
|
-
return (f = (
|
|
3853
|
+
var u, f;
|
|
3854
|
+
return (f = (u = i.card.preferences) == null ? void 0 : u.formatNumber) == null ? void 0 : f.currency;
|
|
3834
3855
|
}
|
|
3835
3856
|
);
|
|
3836
3857
|
c(
|
|
@@ -3838,8 +3859,8 @@ function ll() {
|
|
|
3838
3859
|
);
|
|
3839
3860
|
const h = c(
|
|
3840
3861
|
(i) => {
|
|
3841
|
-
var
|
|
3842
|
-
return (f = (
|
|
3862
|
+
var u, f;
|
|
3863
|
+
return (f = (u = i.card.preferences) == null ? void 0 : u.formatNumber) == null ? void 0 : f.colorRanges;
|
|
3843
3864
|
}
|
|
3844
3865
|
) || [], m = c(
|
|
3845
3866
|
(i) => i.actions.setColorRanges
|
|
@@ -3847,7 +3868,7 @@ function ll() {
|
|
|
3847
3868
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
3848
3869
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3849
3870
|
/* @__PURE__ */ e.jsx(
|
|
3850
|
-
|
|
3871
|
+
Je,
|
|
3851
3872
|
{
|
|
3852
3873
|
checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
|
|
3853
3874
|
onCheckedChange: (i) => {
|
|
@@ -3861,57 +3882,57 @@ function ll() {
|
|
|
3861
3882
|
}
|
|
3862
3883
|
}
|
|
3863
3884
|
),
|
|
3864
|
-
/* @__PURE__ */ e.jsx(
|
|
3885
|
+
/* @__PURE__ */ e.jsx(H, { children: "Format Number" })
|
|
3865
3886
|
] }),
|
|
3866
3887
|
((p = s == null ? void 0 : s.formatNumber) == null ? void 0 : p.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3867
3888
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
|
|
3868
3889
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3869
3890
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
3870
|
-
/* @__PURE__ */ e.jsx(
|
|
3891
|
+
/* @__PURE__ */ e.jsx(H, { children: "Locale" }),
|
|
3871
3892
|
/* @__PURE__ */ e.jsxs(
|
|
3872
3893
|
Oe,
|
|
3873
3894
|
{
|
|
3874
|
-
value:
|
|
3895
|
+
value: a || "en-US",
|
|
3875
3896
|
onValueChange: (i) => {
|
|
3876
|
-
var
|
|
3877
|
-
return
|
|
3878
|
-
((
|
|
3897
|
+
var u, f, z;
|
|
3898
|
+
return t(
|
|
3899
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) || 0,
|
|
3879
3900
|
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
|
|
3880
3901
|
i || "en-US",
|
|
3881
|
-
((
|
|
3902
|
+
((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
|
|
3882
3903
|
);
|
|
3883
3904
|
},
|
|
3884
3905
|
children: [
|
|
3885
3906
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3886
3907
|
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs($e, { children: [
|
|
3887
|
-
/* @__PURE__ */ e.jsx(
|
|
3888
|
-
Js.map((i) => /* @__PURE__ */ e.jsx(
|
|
3908
|
+
/* @__PURE__ */ e.jsx(Ae, { children: "Format" }),
|
|
3909
|
+
Js.map((i) => /* @__PURE__ */ e.jsx(X, { value: i.locale, children: i.locale }, i.locale))
|
|
3889
3910
|
] }) })
|
|
3890
3911
|
]
|
|
3891
3912
|
}
|
|
3892
3913
|
)
|
|
3893
3914
|
] }),
|
|
3894
3915
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
3895
|
-
/* @__PURE__ */ e.jsx(
|
|
3916
|
+
/* @__PURE__ */ e.jsx(H, { children: "Currency" }),
|
|
3896
3917
|
/* @__PURE__ */ e.jsxs(
|
|
3897
3918
|
Oe,
|
|
3898
3919
|
{
|
|
3899
3920
|
value: o || "none",
|
|
3900
3921
|
onValueChange: (i) => {
|
|
3901
|
-
var
|
|
3902
|
-
return
|
|
3903
|
-
((
|
|
3922
|
+
var u, f, z;
|
|
3923
|
+
return t(
|
|
3924
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) || 0,
|
|
3904
3925
|
i === "none" ? "" : i,
|
|
3905
3926
|
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
|
|
3906
|
-
((
|
|
3927
|
+
((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
|
|
3907
3928
|
);
|
|
3908
3929
|
},
|
|
3909
3930
|
children: [
|
|
3910
3931
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3911
3932
|
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs($e, { children: [
|
|
3912
|
-
/* @__PURE__ */ e.jsx(
|
|
3913
|
-
/* @__PURE__ */ e.jsx(
|
|
3914
|
-
l.map((i) => /* @__PURE__ */ e.jsx(
|
|
3933
|
+
/* @__PURE__ */ e.jsx(Ae, { children: "Currency" }),
|
|
3934
|
+
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
3935
|
+
l.map((i) => /* @__PURE__ */ e.jsx(X, { value: i, children: i }, i))
|
|
3915
3936
|
] }) })
|
|
3916
3937
|
]
|
|
3917
3938
|
}
|
|
@@ -3920,41 +3941,41 @@ function ll() {
|
|
|
3920
3941
|
] }),
|
|
3921
3942
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3922
3943
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
3923
|
-
/* @__PURE__ */ e.jsx(
|
|
3944
|
+
/* @__PURE__ */ e.jsx(H, { children: "Decimals" }),
|
|
3924
3945
|
/* @__PURE__ */ e.jsxs(
|
|
3925
3946
|
Oe,
|
|
3926
3947
|
{
|
|
3927
|
-
value: ((g = (
|
|
3948
|
+
value: ((g = (x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) == null ? void 0 : g.toString()) || "0",
|
|
3928
3949
|
onValueChange: (i) => {
|
|
3929
|
-
var
|
|
3930
|
-
return
|
|
3950
|
+
var u, f, z;
|
|
3951
|
+
return t(
|
|
3931
3952
|
Number(i),
|
|
3932
|
-
((
|
|
3953
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
3933
3954
|
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
|
|
3934
|
-
((
|
|
3955
|
+
((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
|
|
3935
3956
|
);
|
|
3936
3957
|
},
|
|
3937
3958
|
children: [
|
|
3938
3959
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3939
|
-
/* @__PURE__ */ e.jsx(Le, { children: ["0", "1", "2", "3", "4"].map((i) => /* @__PURE__ */ e.jsx(
|
|
3960
|
+
/* @__PURE__ */ e.jsx(Le, { children: ["0", "1", "2", "3", "4"].map((i) => /* @__PURE__ */ e.jsx(X, { value: i, children: i }, i)) })
|
|
3940
3961
|
]
|
|
3941
3962
|
}
|
|
3942
3963
|
)
|
|
3943
3964
|
] }),
|
|
3944
3965
|
/* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
|
|
3945
|
-
/* @__PURE__ */ e.jsx(
|
|
3966
|
+
/* @__PURE__ */ e.jsx(H, { children: "Suffix" }),
|
|
3946
3967
|
/* @__PURE__ */ e.jsx(
|
|
3947
3968
|
le,
|
|
3948
3969
|
{
|
|
3949
|
-
value: ((
|
|
3970
|
+
value: ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || "",
|
|
3950
3971
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3951
3972
|
placeholder: "K, M, B, %",
|
|
3952
3973
|
onChange: (i) => {
|
|
3953
|
-
var
|
|
3954
|
-
return
|
|
3955
|
-
((
|
|
3974
|
+
var u, f, z;
|
|
3975
|
+
return t(
|
|
3976
|
+
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) || 0,
|
|
3956
3977
|
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
|
|
3957
|
-
((
|
|
3978
|
+
((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.locale) || "",
|
|
3958
3979
|
i.target.value
|
|
3959
3980
|
);
|
|
3960
3981
|
}
|
|
@@ -3965,7 +3986,7 @@ function ll() {
|
|
|
3965
3986
|
] }) }),
|
|
3966
3987
|
/* @__PURE__ */ e.jsx(Ke, { className: "my-3" }),
|
|
3967
3988
|
/* @__PURE__ */ e.jsx(
|
|
3968
|
-
|
|
3989
|
+
_a,
|
|
3969
3990
|
{
|
|
3970
3991
|
colorRanges: h,
|
|
3971
3992
|
setColorRanges: m
|
|
@@ -3976,9 +3997,9 @@ function ll() {
|
|
|
3976
3997
|
}
|
|
3977
3998
|
function rl() {
|
|
3978
3999
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3979
|
-
/* @__PURE__ */ e.jsx(Ce, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3980
|
-
/* @__PURE__ */ e.jsx(
|
|
3981
|
-
/* @__PURE__ */ e.jsxs(
|
|
4000
|
+
/* @__PURE__ */ e.jsx(Ce, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4001
|
+
/* @__PURE__ */ e.jsx($, { className: "", children: "KPI Query" }),
|
|
4002
|
+
/* @__PURE__ */ e.jsxs(P, { className: "font-mono", children: [
|
|
3982
4003
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
3983
4004
|
/* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3984
4005
|
/* @__PURE__ */ e.jsx("li", { children: "current - number" }),
|
|
@@ -4006,9 +4027,9 @@ function rl() {
|
|
|
4006
4027
|
] });
|
|
4007
4028
|
}
|
|
4008
4029
|
function il() {
|
|
4009
|
-
var
|
|
4030
|
+
var a;
|
|
4010
4031
|
const s = c((o) => o.card.preferences), { setCardPreferences: n } = c((o) => o.actions);
|
|
4011
|
-
function
|
|
4032
|
+
function t(o) {
|
|
4012
4033
|
n({
|
|
4013
4034
|
...s,
|
|
4014
4035
|
textVisualOptions: {
|
|
@@ -4020,8 +4041,8 @@ function il() {
|
|
|
4020
4041
|
return /* @__PURE__ */ e.jsxs(
|
|
4021
4042
|
Ls,
|
|
4022
4043
|
{
|
|
4023
|
-
value: (
|
|
4024
|
-
onValueChange:
|
|
4044
|
+
value: (a = s == null ? void 0 : s.textVisualOptions) != null && a.isDynamicText ? "dynamic" : "static",
|
|
4045
|
+
onValueChange: t,
|
|
4025
4046
|
className: "flex gap-3",
|
|
4026
4047
|
defaultValue: "x",
|
|
4027
4048
|
children: [
|
|
@@ -4037,15 +4058,15 @@ function il() {
|
|
|
4037
4058
|
}
|
|
4038
4059
|
);
|
|
4039
4060
|
}
|
|
4040
|
-
function
|
|
4061
|
+
function as({
|
|
4041
4062
|
cardType: s,
|
|
4042
4063
|
docContent: n,
|
|
4043
|
-
suffix:
|
|
4064
|
+
suffix: t = "Chart"
|
|
4044
4065
|
}) {
|
|
4045
4066
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4046
|
-
/* @__PURE__ */ e.jsxs(
|
|
4047
|
-
/* @__PURE__ */ e.jsx(
|
|
4048
|
-
/* @__PURE__ */ e.jsx(
|
|
4067
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4068
|
+
/* @__PURE__ */ e.jsx($, { children: `${Ds(s)} ${t}` }),
|
|
4069
|
+
/* @__PURE__ */ e.jsx(P, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4049
4070
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
4050
4071
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4051
4072
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
@@ -4057,7 +4078,7 @@ function ts({
|
|
|
4057
4078
|
"a",
|
|
4058
4079
|
{
|
|
4059
4080
|
target: "_blank",
|
|
4060
|
-
onClick: (
|
|
4081
|
+
onClick: (a) => a.stopPropagation(),
|
|
4061
4082
|
className: "text-blue-700",
|
|
4062
4083
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4063
4084
|
children: "example"
|
|
@@ -4067,25 +4088,25 @@ function ts({
|
|
|
4067
4088
|
] })
|
|
4068
4089
|
] }) })
|
|
4069
4090
|
] }),
|
|
4070
|
-
/* @__PURE__ */ e.jsxs(
|
|
4071
|
-
/* @__PURE__ */ e.jsx(
|
|
4072
|
-
/* @__PURE__ */ e.jsxs(
|
|
4073
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
4074
|
-
s !== "text" && /* @__PURE__ */ e.jsx(
|
|
4091
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
4092
|
+
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
4093
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 px-2", children: [
|
|
4094
|
+
s === "range" && /* @__PURE__ */ e.jsx(os, {}),
|
|
4095
|
+
s !== "text" && /* @__PURE__ */ e.jsx(Vs, {}),
|
|
4075
4096
|
s === "text" && /* @__PURE__ */ e.jsx(il, {})
|
|
4076
4097
|
] })
|
|
4077
4098
|
] }),
|
|
4078
|
-
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(
|
|
4079
|
-
/* @__PURE__ */ e.jsx(
|
|
4080
|
-
/* @__PURE__ */ e.jsx(
|
|
4099
|
+
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4100
|
+
/* @__PURE__ */ e.jsx($, { children: "Filter on click" }),
|
|
4101
|
+
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
4081
4102
|
] })
|
|
4082
4103
|
] }) });
|
|
4083
4104
|
}
|
|
4084
4105
|
function ol() {
|
|
4085
4106
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4086
|
-
/* @__PURE__ */ e.jsxs(
|
|
4087
|
-
/* @__PURE__ */ e.jsx(
|
|
4088
|
-
/* @__PURE__ */ e.jsxs(
|
|
4107
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4108
|
+
/* @__PURE__ */ e.jsx($, { children: "Stacked Chart" }),
|
|
4109
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 font-mono text-xs", children: [
|
|
4089
4110
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
4090
4111
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4091
4112
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
@@ -4108,38 +4129,38 @@ function ol() {
|
|
|
4108
4129
|
] })
|
|
4109
4130
|
] })
|
|
4110
4131
|
] }),
|
|
4111
|
-
/* @__PURE__ */ e.jsxs(
|
|
4112
|
-
/* @__PURE__ */ e.jsx(
|
|
4113
|
-
/* @__PURE__ */ e.jsxs(
|
|
4114
|
-
/* @__PURE__ */ e.jsx(
|
|
4115
|
-
/* @__PURE__ */ e.jsx(
|
|
4132
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
4133
|
+
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
4134
|
+
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 px-2", children: [
|
|
4135
|
+
/* @__PURE__ */ e.jsx(os, {}),
|
|
4136
|
+
/* @__PURE__ */ e.jsx(Et, {})
|
|
4116
4137
|
] })
|
|
4117
4138
|
] }),
|
|
4118
|
-
/* @__PURE__ */ e.jsxs(
|
|
4119
|
-
/* @__PURE__ */ e.jsx(
|
|
4120
|
-
/* @__PURE__ */ e.jsx(
|
|
4139
|
+
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4140
|
+
/* @__PURE__ */ e.jsx($, { children: "Filter on click" }),
|
|
4141
|
+
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
4121
4142
|
] })
|
|
4122
4143
|
] }) });
|
|
4123
4144
|
}
|
|
4124
4145
|
function cl({}) {
|
|
4125
|
-
const s = c((
|
|
4146
|
+
const s = c((a) => {
|
|
4126
4147
|
var o;
|
|
4127
|
-
return (o =
|
|
4148
|
+
return (o = a.card) == null ? void 0 : o.preferences;
|
|
4128
4149
|
}), n = c(
|
|
4129
|
-
(
|
|
4130
|
-
),
|
|
4150
|
+
(a) => a.actions.setCardPreferences
|
|
4151
|
+
), t = (a) => {
|
|
4131
4152
|
n({
|
|
4132
4153
|
...s,
|
|
4133
|
-
allowDownload:
|
|
4154
|
+
allowDownload: a
|
|
4134
4155
|
});
|
|
4135
4156
|
};
|
|
4136
4157
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4137
|
-
/* @__PURE__ */ e.jsx(Ce, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(
|
|
4138
|
-
/* @__PURE__ */ e.jsx(
|
|
4139
|
-
/* @__PURE__ */ e.jsx(
|
|
4158
|
+
/* @__PURE__ */ e.jsx(Ce, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
4159
|
+
/* @__PURE__ */ e.jsx($, { children: "Filter on click" }),
|
|
4160
|
+
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
4140
4161
|
] }) }),
|
|
4141
4162
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4142
|
-
/* @__PURE__ */ e.jsx(
|
|
4163
|
+
/* @__PURE__ */ e.jsx(Je, { onCheckedChange: t, id: "allow-download" }),
|
|
4143
4164
|
/* @__PURE__ */ e.jsx(
|
|
4144
4165
|
"label",
|
|
4145
4166
|
{
|
|
@@ -4201,42 +4222,42 @@ const dl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
4201
4222
|
] })
|
|
4202
4223
|
] });
|
|
4203
4224
|
function ul() {
|
|
4204
|
-
const s = c((
|
|
4205
|
-
function n(
|
|
4206
|
-
switch (
|
|
4225
|
+
const s = c((t) => t.card.type);
|
|
4226
|
+
function n(t) {
|
|
4227
|
+
switch (t) {
|
|
4207
4228
|
case "stackedBar":
|
|
4208
4229
|
case "stackedLine":
|
|
4209
4230
|
return /* @__PURE__ */ e.jsx(ol, {});
|
|
4210
4231
|
case "pyramid":
|
|
4211
|
-
return /* @__PURE__ */ e.jsx(
|
|
4232
|
+
return /* @__PURE__ */ e.jsx(as, { docContent: dl, cardType: t });
|
|
4212
4233
|
case "kpi":
|
|
4213
4234
|
return /* @__PURE__ */ e.jsx(rl, {});
|
|
4214
4235
|
case "line":
|
|
4215
4236
|
case "bar":
|
|
4216
|
-
return /* @__PURE__ */ e.jsx(
|
|
4237
|
+
return /* @__PURE__ */ e.jsx(Xn, { cardType: t });
|
|
4217
4238
|
case "range":
|
|
4218
|
-
return /* @__PURE__ */ e.jsx(
|
|
4239
|
+
return /* @__PURE__ */ e.jsx(as, { docContent: hl, cardType: t });
|
|
4219
4240
|
case "pie":
|
|
4220
4241
|
case "doughnut":
|
|
4221
4242
|
case "polarArea":
|
|
4222
4243
|
case "radar":
|
|
4223
|
-
return /* @__PURE__ */ e.jsx(
|
|
4244
|
+
return /* @__PURE__ */ e.jsx(as, { cardType: t });
|
|
4224
4245
|
case "bubble":
|
|
4225
4246
|
case "scatter":
|
|
4226
|
-
return /* @__PURE__ */ e.jsx(el, { cardType:
|
|
4247
|
+
return /* @__PURE__ */ e.jsx(el, { cardType: t });
|
|
4227
4248
|
case "table":
|
|
4228
|
-
return /* @__PURE__ */ e.jsx(cl, { cardType:
|
|
4249
|
+
return /* @__PURE__ */ e.jsx(cl, { cardType: t });
|
|
4229
4250
|
case "text":
|
|
4230
4251
|
return /* @__PURE__ */ e.jsx(
|
|
4231
|
-
|
|
4252
|
+
as,
|
|
4232
4253
|
{
|
|
4233
4254
|
docContent: ml,
|
|
4234
|
-
cardType:
|
|
4255
|
+
cardType: t,
|
|
4235
4256
|
suffix: "Visual"
|
|
4236
4257
|
}
|
|
4237
4258
|
);
|
|
4238
4259
|
default:
|
|
4239
|
-
return /* @__PURE__ */ e.jsx(
|
|
4260
|
+
return /* @__PURE__ */ e.jsx(al, {});
|
|
4240
4261
|
}
|
|
4241
4262
|
}
|
|
4242
4263
|
return /* @__PURE__ */ e.jsx(Ts, { className: "h-full w-full text-sm", children: n(s) });
|
|
@@ -4279,30 +4300,30 @@ function xl() {
|
|
|
4279
4300
|
}
|
|
4280
4301
|
) }),
|
|
4281
4302
|
/* @__PURE__ */ e.jsx(vs, { className: "border" }),
|
|
4282
|
-
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(
|
|
4283
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
4303
|
+
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Ys, {}) })
|
|
4304
|
+
] }) : /* @__PURE__ */ e.jsx(Ys, {})
|
|
4284
4305
|
}
|
|
4285
4306
|
)
|
|
4286
4307
|
]
|
|
4287
4308
|
}
|
|
4288
4309
|
);
|
|
4289
4310
|
}
|
|
4290
|
-
function pl({ authToken: s, onSave: n, onClose:
|
|
4291
|
-
const
|
|
4292
|
-
return
|
|
4293
|
-
n &&
|
|
4294
|
-
}, [n,
|
|
4311
|
+
function pl({ authToken: s, onSave: n, onClose: t }) {
|
|
4312
|
+
const a = c((m) => m.actions.setOnSave), o = c((m) => m.actions.setOnClose), h = k((m) => m.actions.setAuthToken);
|
|
4313
|
+
return Q(() => {
|
|
4314
|
+
n && a(n), t && o(t);
|
|
4315
|
+
}, [n, a, t, o]), Q(() => {
|
|
4295
4316
|
s && s.accessToken && h(s);
|
|
4296
|
-
}, [s, h]), /* @__PURE__ */ e.jsxs(
|
|
4297
|
-
/* @__PURE__ */ e.jsx(
|
|
4298
|
-
/* @__PURE__ */ e.jsx($
|
|
4317
|
+
}, [s, h]), /* @__PURE__ */ e.jsxs(Ha, { className: "rounded-none", role: "editor-panel", children: [
|
|
4318
|
+
/* @__PURE__ */ e.jsx(Ba, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Nt, {}) }),
|
|
4319
|
+
/* @__PURE__ */ e.jsx($a, { children: /* @__PURE__ */ e.jsx(xl, {}) })
|
|
4299
4320
|
] });
|
|
4300
4321
|
}
|
|
4301
4322
|
function fl() {
|
|
4302
4323
|
k((m) => m.selectedCardId);
|
|
4303
|
-
const s = k((m) => m.selectedSheetId), { setIsVisualEditing: n } = k((m) => m.actions),
|
|
4324
|
+
const s = k((m) => m.selectedSheetId), { setIsVisualEditing: n } = k((m) => m.actions), t = k((m) => m.isVisualEditing), a = k((m) => m.actions.updateFrame);
|
|
4304
4325
|
function o(m) {
|
|
4305
|
-
s && (
|
|
4326
|
+
s && (a(s, m), n(!1));
|
|
4306
4327
|
}
|
|
4307
4328
|
function h() {
|
|
4308
4329
|
n(!1);
|
|
@@ -4311,9 +4332,9 @@ function fl() {
|
|
|
4311
4332
|
"div",
|
|
4312
4333
|
{
|
|
4313
4334
|
role: "editor-container",
|
|
4314
|
-
className:
|
|
4315
|
-
block:
|
|
4316
|
-
hidden: !
|
|
4335
|
+
className: ee("flex grow", {
|
|
4336
|
+
block: t,
|
|
4337
|
+
hidden: !t
|
|
4317
4338
|
}),
|
|
4318
4339
|
children: /* @__PURE__ */ e.jsx(pl, { onSave: o, onClose: h })
|
|
4319
4340
|
}
|
|
@@ -4323,46 +4344,46 @@ function gl({
|
|
|
4323
4344
|
columns: s,
|
|
4324
4345
|
tableName: n
|
|
4325
4346
|
}) {
|
|
4326
|
-
const
|
|
4347
|
+
const t = c((i) => i.selectedConnectionId), a = c((i) => i.selectedDatamodelId), o = c((i) => i.selectedDatabaseName), h = c((i) => i.selectedSchemaName), m = c((i) => i.selectedTableName), l = k((i) => i.dashboard.filters) || [], d = k((i) => i.actions.addFilter), p = k((i) => i.actions.removeFilter), x = k(
|
|
4327
4348
|
(i) => i.actions.removeFilterValue
|
|
4328
|
-
), { modelItems: g } =
|
|
4329
|
-
function
|
|
4330
|
-
var
|
|
4331
|
-
const
|
|
4332
|
-
let
|
|
4333
|
-
|
|
4349
|
+
), { modelItems: g } = is();
|
|
4350
|
+
function j(i) {
|
|
4351
|
+
var V;
|
|
4352
|
+
const u = ue(i.column_name), f = ue(o || ""), z = ue(h || ""), N = ue(n);
|
|
4353
|
+
let D = it(
|
|
4354
|
+
z,
|
|
4334
4355
|
N
|
|
4335
|
-
),
|
|
4336
|
-
const A = (
|
|
4337
|
-
(
|
|
4338
|
-
)) == null ? void 0 :
|
|
4339
|
-
|
|
4356
|
+
), b = `${D}.${u}`;
|
|
4357
|
+
const A = (V = g == null ? void 0 : g.find(
|
|
4358
|
+
(L) => L.id === a
|
|
4359
|
+
)) == null ? void 0 : V.name;
|
|
4360
|
+
a && a !== "none" && (b = `d.${A}.${u}`, D = `d.${A}`), console.log(
|
|
4340
4361
|
"find",
|
|
4341
|
-
|
|
4362
|
+
b,
|
|
4342
4363
|
N,
|
|
4343
4364
|
f
|
|
4344
4365
|
);
|
|
4345
|
-
const
|
|
4346
|
-
(
|
|
4366
|
+
const E = l == null ? void 0 : l.find(
|
|
4367
|
+
(L) => L.column === b && L.table === N && (L.database === f || L.database === o)
|
|
4347
4368
|
);
|
|
4348
|
-
if (
|
|
4349
|
-
|
|
4369
|
+
if (E)
|
|
4370
|
+
x(E.id), p(E.id);
|
|
4350
4371
|
else {
|
|
4351
|
-
if (n === "api" &&
|
|
4372
|
+
if (n === "api" && t) {
|
|
4352
4373
|
d({
|
|
4353
4374
|
id: ns(),
|
|
4354
|
-
column:
|
|
4375
|
+
column: b,
|
|
4355
4376
|
title: i.column_name,
|
|
4356
4377
|
dataType: i.data_type,
|
|
4357
4378
|
table: "api",
|
|
4358
4379
|
database: "",
|
|
4359
4380
|
// database: 'NA',
|
|
4360
|
-
connectionId:
|
|
4381
|
+
connectionId: t,
|
|
4361
4382
|
operation: "in",
|
|
4362
|
-
sql:
|
|
4383
|
+
sql: Us(
|
|
4363
4384
|
i.data_type,
|
|
4364
|
-
|
|
4365
|
-
|
|
4385
|
+
D,
|
|
4386
|
+
u
|
|
4366
4387
|
)
|
|
4367
4388
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4368
4389
|
});
|
|
@@ -4370,39 +4391,39 @@ function gl({
|
|
|
4370
4391
|
}
|
|
4371
4392
|
d({
|
|
4372
4393
|
id: ns(),
|
|
4373
|
-
column:
|
|
4394
|
+
column: b,
|
|
4374
4395
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4375
4396
|
title: i.column_name,
|
|
4376
4397
|
dataType: i.data_type,
|
|
4377
4398
|
table: m || "",
|
|
4378
4399
|
database: o || "",
|
|
4379
|
-
connectionId:
|
|
4400
|
+
connectionId: t || "",
|
|
4380
4401
|
operation: "in",
|
|
4381
|
-
sql:
|
|
4402
|
+
sql: Us(
|
|
4382
4403
|
i.data_type,
|
|
4383
|
-
|
|
4384
|
-
|
|
4404
|
+
D,
|
|
4405
|
+
u
|
|
4385
4406
|
)
|
|
4386
4407
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4387
4408
|
});
|
|
4388
4409
|
}
|
|
4389
4410
|
}
|
|
4390
4411
|
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((i) => {
|
|
4391
|
-
const
|
|
4412
|
+
const u = l == null ? void 0 : l.find(
|
|
4392
4413
|
(f) => f.column === ue(i.column_name) && f.table === m && f.database === o
|
|
4393
4414
|
);
|
|
4394
4415
|
return /* @__PURE__ */ e.jsx(
|
|
4395
4416
|
"div",
|
|
4396
4417
|
{
|
|
4397
|
-
onClick: () =>
|
|
4398
|
-
className:
|
|
4418
|
+
onClick: () => j(i),
|
|
4419
|
+
className: ee(
|
|
4399
4420
|
"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",
|
|
4400
4421
|
{
|
|
4401
|
-
"bg-muted":
|
|
4422
|
+
"bg-muted": u
|
|
4402
4423
|
}
|
|
4403
4424
|
),
|
|
4404
4425
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4405
|
-
/* @__PURE__ */ e.jsx(
|
|
4426
|
+
/* @__PURE__ */ e.jsx(vt, { column: i }),
|
|
4406
4427
|
/* @__PURE__ */ e.jsx("span", { children: i.column_name })
|
|
4407
4428
|
] })
|
|
4408
4429
|
},
|
|
@@ -4417,7 +4438,7 @@ function jl() {
|
|
|
4417
4438
|
);
|
|
4418
4439
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
4419
4440
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
4420
|
-
/* @__PURE__ */ e.jsx(
|
|
4441
|
+
/* @__PURE__ */ e.jsx(H, { className: "text-lg", children: "Filters" }),
|
|
4421
4442
|
/* @__PURE__ */ e.jsx(
|
|
4422
4443
|
S,
|
|
4423
4444
|
{
|
|
@@ -4429,14 +4450,14 @@ function jl() {
|
|
|
4429
4450
|
)
|
|
4430
4451
|
] }),
|
|
4431
4452
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
4432
|
-
|
|
4453
|
+
Nt,
|
|
4433
4454
|
{
|
|
4434
|
-
ColumnsComponent: (n,
|
|
4455
|
+
ColumnsComponent: (n, t, a) => /* @__PURE__ */ e.jsx(
|
|
4435
4456
|
gl,
|
|
4436
4457
|
{
|
|
4437
4458
|
schemaName: n,
|
|
4438
|
-
tableName:
|
|
4439
|
-
columns:
|
|
4459
|
+
tableName: t,
|
|
4460
|
+
columns: a
|
|
4440
4461
|
}
|
|
4441
4462
|
)
|
|
4442
4463
|
}
|
|
@@ -4444,42 +4465,42 @@ function jl() {
|
|
|
4444
4465
|
] });
|
|
4445
4466
|
}
|
|
4446
4467
|
function bl() {
|
|
4447
|
-
k((
|
|
4448
|
-
const s = k((
|
|
4449
|
-
return k((
|
|
4468
|
+
k((t) => t.dashboard);
|
|
4469
|
+
const s = k((t) => t.showFilters), n = k((t) => t.isVisualEditing);
|
|
4470
|
+
return k((t) => t.bookmarkKey), /* @__PURE__ */ e.jsxs(
|
|
4450
4471
|
"div",
|
|
4451
4472
|
{
|
|
4452
4473
|
role: "dashboard-plus-main",
|
|
4453
|
-
className:
|
|
4474
|
+
className: ee("grow", {
|
|
4454
4475
|
hidden: n,
|
|
4455
4476
|
flex: !n
|
|
4456
4477
|
}),
|
|
4457
4478
|
children: [
|
|
4458
|
-
/* @__PURE__ */ e.jsx(
|
|
4479
|
+
/* @__PURE__ */ e.jsx(Pa, {}),
|
|
4459
4480
|
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(jl, {}) })
|
|
4460
4481
|
]
|
|
4461
4482
|
}
|
|
4462
4483
|
);
|
|
4463
4484
|
}
|
|
4464
4485
|
function yl() {
|
|
4465
|
-
const s = k((
|
|
4466
|
-
(
|
|
4486
|
+
const s = k((a) => a.dashboard), n = k((a) => a.actions.setDashboard), t = k(
|
|
4487
|
+
(a) => a.showDashboardJSON
|
|
4467
4488
|
);
|
|
4468
4489
|
return k(
|
|
4469
|
-
(
|
|
4490
|
+
(a) => a.actions.setShowDashboardJSON
|
|
4470
4491
|
), /* @__PURE__ */ e.jsx(
|
|
4471
4492
|
"div",
|
|
4472
4493
|
{
|
|
4473
|
-
className:
|
|
4474
|
-
hidden: !
|
|
4494
|
+
className: ee(" p-2", {
|
|
4495
|
+
hidden: !t
|
|
4475
4496
|
}),
|
|
4476
4497
|
children: /* @__PURE__ */ e.jsx(
|
|
4477
|
-
|
|
4498
|
+
Ka,
|
|
4478
4499
|
{
|
|
4479
|
-
onChange: (
|
|
4480
|
-
if (
|
|
4500
|
+
onChange: (a) => {
|
|
4501
|
+
if (a)
|
|
4481
4502
|
try {
|
|
4482
|
-
JSON.parse(
|
|
4503
|
+
JSON.parse(a), n(JSON.parse(a));
|
|
4483
4504
|
} catch {
|
|
4484
4505
|
}
|
|
4485
4506
|
},
|
|
@@ -4508,13 +4529,13 @@ function yl() {
|
|
|
4508
4529
|
function Cl({
|
|
4509
4530
|
showControls: s = !1,
|
|
4510
4531
|
showFooter: n = !0,
|
|
4511
|
-
...
|
|
4532
|
+
...t
|
|
4512
4533
|
}) {
|
|
4513
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4514
|
-
/* @__PURE__ */ e.jsx(
|
|
4515
|
-
/* @__PURE__ */ e.jsxs(
|
|
4534
|
+
return /* @__PURE__ */ e.jsxs(Ga, { dashboardProps: t, children: [
|
|
4535
|
+
/* @__PURE__ */ e.jsx(Ja, {}),
|
|
4536
|
+
/* @__PURE__ */ e.jsxs(Ua, { children: [
|
|
4516
4537
|
/* @__PURE__ */ e.jsx(yl, {}),
|
|
4517
|
-
/* @__PURE__ */ e.jsxs(
|
|
4538
|
+
/* @__PURE__ */ e.jsxs(Qa, { ...t, children: [
|
|
4518
4539
|
s && /* @__PURE__ */ e.jsx(kn, {}),
|
|
4519
4540
|
/* @__PURE__ */ e.jsx(fl, {}),
|
|
4520
4541
|
/* @__PURE__ */ e.jsx(bl, {})
|
|
@@ -4525,5 +4546,5 @@ function Cl({
|
|
|
4525
4546
|
export {
|
|
4526
4547
|
Cl as D,
|
|
4527
4548
|
_e as S,
|
|
4528
|
-
|
|
4549
|
+
is as u
|
|
4529
4550
|
};
|