semaphor 0.0.51 → 0.0.52
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-SiSP2uLb.js → dashboard-plus-wP98d1VM.js} +1028 -928
- package/dist/chunks/dashboard-plus-z6ljHA5H.js +210 -0
- package/dist/chunks/index-FKRPJKTT.js +435 -0
- package/dist/chunks/{index-MYxGboTj.js → index-tjnD7EOn.js} +17634 -15623
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +7 -1
- package/dist/types/main.d.ts +39 -2
- package/dist/types/surfboard.d.ts +8 -2
- package/dist/types/types.d.ts +7 -1
- package/package.json +5 -2
- package/dist/chunks/dashboard-plus-DYba5z_c.js +0 -210
- package/dist/chunks/index-1S-69oTo.js +0 -421
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import me, { useState as T, useEffect as P, useMemo as
|
|
1
|
+
import { P as A, b as w, j as e, Q as ps, R as fs, U as k, V as Gs, W as gs, X as js, Y as bs, Z as ys, _ as B, $ as ae, a0 as Js, J as Qs, O as Ae, a1 as Ra, a2 as _a, a3 as Ha, a4 as Ba, a5 as $a, a6 as Pa, a7 as Es, a8 as He, a9 as Ke, aa as Xe, T as vs, e as Ws, g as Ns, ab as Oe, ac as Me, f as Y, ad as Te, ae as Le, af as Be, ag as Ee, ah as X, ai as Cs, G as i, aj as Ue, ak as Ge, al as Ka, am as Je, w as Ys, v as Xs, t as he, an as Ua, r as Ga, N as Zs, s as Ja, ao as Qa, B as Wa, ap as ea, aq as Ya, L as $e, S as Ss, z as Xa, n as Ds, ar as ds, A as hs, u as ss, as as Ce, at as ze, au as sa, av as aa, aw as ta, ax as na, ay as ra, az as Za, aA as et, aB as la, aC as st, aD as at, aE as tt, aF as nt, aG as rt, aH as ms, aI as lt, aJ as _e, aK as us, aL as Fe, aM as xs, aN as Is, aO as it, aP as ot, aQ as ct, aR as dt, aS as ht, aT as is, aU as mt, aV as Vs, aW as ut, aX as qs, aY as xt, aZ as pt, a_ as ft, a$ as ia, l as gt, C as jt, E as Rs, d as bt, h as yt, i as vt, o as Nt, b0 as Ct, m as St, H as kt, b1 as wt, b2 as zt, b3 as Ft, b4 as os, b5 as Ot, b6 as cs, b7 as _s, K as Mt, b8 as Tt, b9 as ks, ba as Lt, bb as ws, bc as De, bd as oa, be as At, bf as Et, bg as Dt, bh as It, bi as Vt, bj as qt, bk as Se, bl as q, bm as R, bn as zs, bo as _, bp as Hs, bq as Rt, br as _t, bs as Ht, bt as Bt, bu as Bs, bv as $t, bw as Pt, bx as Kt, by as Ut, bz as Gt, bA as Jt } from "./index-tjnD7EOn.js";
|
|
2
|
+
import me, { useState as T, useEffect as P, useMemo as Qt, useRef as Pe } 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 Wt = A("Activity", [
|
|
10
10
|
[
|
|
11
11
|
"path",
|
|
12
12
|
{
|
|
@@ -21,7 +21,7 @@ const Gt = E("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 Yt = A("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 Jt = E("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 Fs = A("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 zs = E("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 Xt = A("CircleX", [
|
|
47
47
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
48
48
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
49
49
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -54,7 +54,7 @@ const Qt = E("CircleX", [
|
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
56
|
*/
|
|
57
|
-
const
|
|
57
|
+
const Zt = A("Database", [
|
|
58
58
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
59
59
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
60
60
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -65,7 +65,7 @@ const Wt = E("Database", [
|
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
67
|
*/
|
|
68
|
-
const
|
|
68
|
+
const en = A("Eraser", [
|
|
69
69
|
[
|
|
70
70
|
"path",
|
|
71
71
|
{
|
|
@@ -82,7 +82,7 @@ const Yt = E("Eraser", [
|
|
|
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 ca = A("Filter", [
|
|
86
86
|
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
87
87
|
]);
|
|
88
88
|
/**
|
|
@@ -91,7 +91,7 @@ const oa = E("Filter", [
|
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
93
|
*/
|
|
94
|
-
const
|
|
94
|
+
const da = A("GanttChart", [
|
|
95
95
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
96
96
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
97
97
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -102,7 +102,7 @@ const ca = E("GanttChart", [
|
|
|
102
102
|
* This source code is licensed under the ISC license.
|
|
103
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
104
|
*/
|
|
105
|
-
const
|
|
105
|
+
const sn = A("Glasses", [
|
|
106
106
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
107
107
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
108
108
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -115,7 +115,7 @@ const Xt = E("Glasses", [
|
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const an = A("Hammer", [
|
|
119
119
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
120
120
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
121
121
|
[
|
|
@@ -132,7 +132,7 @@ const Zt = E("Hammer", [
|
|
|
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
|
|
135
|
+
const tn = A("Hash", [
|
|
136
136
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
137
137
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
138
138
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -144,7 +144,7 @@ const en = E("Hash", [
|
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
146
|
*/
|
|
147
|
-
const
|
|
147
|
+
const nn = A("Key", [
|
|
148
148
|
["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" }],
|
|
149
149
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
150
150
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -155,7 +155,7 @@ const sn = E("Key", [
|
|
|
155
155
|
* This source code is licensed under the ISC license.
|
|
156
156
|
* See the LICENSE file in the root directory of this source tree.
|
|
157
157
|
*/
|
|
158
|
-
const
|
|
158
|
+
const Os = A("LineChart", [
|
|
159
159
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
160
160
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
161
161
|
]);
|
|
@@ -165,7 +165,7 @@ const Fs = E("LineChart", [
|
|
|
165
165
|
* This source code is licensed under the ISC license.
|
|
166
166
|
* See the LICENSE file in the root directory of this source tree.
|
|
167
167
|
*/
|
|
168
|
-
const
|
|
168
|
+
const rn = A("ListEnd", [
|
|
169
169
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
170
170
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
171
171
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -178,7 +178,7 @@ const an = E("ListEnd", [
|
|
|
178
178
|
* This source code is licensed under the ISC license.
|
|
179
179
|
* See the LICENSE file in the root directory of this source tree.
|
|
180
180
|
*/
|
|
181
|
-
const
|
|
181
|
+
const ln = A("ListStart", [
|
|
182
182
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
183
183
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
184
184
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -191,7 +191,7 @@ const tn = E("ListStart", [
|
|
|
191
191
|
* This source code is licensed under the ISC license.
|
|
192
192
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
193
|
*/
|
|
194
|
-
const
|
|
194
|
+
const on = A("ListX", [
|
|
195
195
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
196
196
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
197
197
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -204,7 +204,7 @@ const nn = E("ListX", [
|
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
206
|
*/
|
|
207
|
-
const
|
|
207
|
+
const cn = A("MessageSquareMore", [
|
|
208
208
|
["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" }],
|
|
209
209
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
210
210
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -216,7 +216,7 @@ const rn = E("MessageSquareMore", [
|
|
|
216
216
|
* This source code is licensed under the ISC license.
|
|
217
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
218
|
*/
|
|
219
|
-
const
|
|
219
|
+
const dn = A("Network", [
|
|
220
220
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
221
221
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
222
222
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -229,7 +229,7 @@ const ln = E("Network", [
|
|
|
229
229
|
* This source code is licensed under the ISC license.
|
|
230
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
231
231
|
*/
|
|
232
|
-
const
|
|
232
|
+
const ha = A("Pencil", [
|
|
233
233
|
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
|
|
234
234
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
235
235
|
]);
|
|
@@ -239,7 +239,7 @@ const da = E("Pencil", [
|
|
|
239
239
|
* This source code is licensed under the ISC license.
|
|
240
240
|
* See the LICENSE file in the root directory of this source tree.
|
|
241
241
|
*/
|
|
242
|
-
const
|
|
242
|
+
const ma = A("PieChart", [
|
|
243
243
|
["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
|
|
244
244
|
["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
|
|
245
245
|
]);
|
|
@@ -249,7 +249,7 @@ const ha = E("PieChart", [
|
|
|
249
249
|
* This source code is licensed under the ISC license.
|
|
250
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
251
251
|
*/
|
|
252
|
-
const
|
|
252
|
+
const hn = A("Play", [
|
|
253
253
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
254
254
|
]);
|
|
255
255
|
/**
|
|
@@ -258,7 +258,7 @@ const on = E("Play", [
|
|
|
258
258
|
* This source code is licensed under the ISC license.
|
|
259
259
|
* See the LICENSE file in the root directory of this source tree.
|
|
260
260
|
*/
|
|
261
|
-
const
|
|
261
|
+
const mn = A("Plug2", [
|
|
262
262
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
263
263
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
264
264
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -271,7 +271,7 @@ const cn = E("Plug2", [
|
|
|
271
271
|
* This source code is licensed under the ISC license.
|
|
272
272
|
* See the LICENSE file in the root directory of this source tree.
|
|
273
273
|
*/
|
|
274
|
-
const
|
|
274
|
+
const un = A("Save", [
|
|
275
275
|
[
|
|
276
276
|
"path",
|
|
277
277
|
{
|
|
@@ -288,7 +288,7 @@ const dn = E("Save", [
|
|
|
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
|
|
291
|
+
const ua = A("ScatterChart", [
|
|
292
292
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
293
293
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
294
294
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -302,7 +302,7 @@ const ma = E("ScatterChart", [
|
|
|
302
302
|
* This source code is licensed under the ISC license.
|
|
303
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
304
304
|
*/
|
|
305
|
-
const
|
|
305
|
+
const xn = A("ShieldQuestion", [
|
|
306
306
|
[
|
|
307
307
|
"path",
|
|
308
308
|
{
|
|
@@ -319,7 +319,7 @@ const hn = E("ShieldQuestion", [
|
|
|
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
|
|
322
|
+
const pn = A("Sigma", [
|
|
323
323
|
["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
|
|
324
324
|
]);
|
|
325
325
|
/**
|
|
@@ -328,7 +328,7 @@ const mn = E("Sigma", [
|
|
|
328
328
|
* This source code is licensed under the ISC license.
|
|
329
329
|
* See the LICENSE file in the root directory of this source tree.
|
|
330
330
|
*/
|
|
331
|
-
const
|
|
331
|
+
const fn = A("SwatchBook", [
|
|
332
332
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
333
333
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
334
334
|
["path", { d: "M 7 17h0.01", key: "10821z" }],
|
|
@@ -346,7 +346,7 @@ const un = E("SwatchBook", [
|
|
|
346
346
|
* This source code is licensed under the ISC license.
|
|
347
347
|
* See the LICENSE file in the root directory of this source tree.
|
|
348
348
|
*/
|
|
349
|
-
const
|
|
349
|
+
const gn = A("Tag", [
|
|
350
350
|
[
|
|
351
351
|
"path",
|
|
352
352
|
{
|
|
@@ -362,7 +362,7 @@ const xn = E("Tag", [
|
|
|
362
362
|
* This source code is licensed under the ISC license.
|
|
363
363
|
* See the LICENSE file in the root directory of this source tree.
|
|
364
364
|
*/
|
|
365
|
-
const
|
|
365
|
+
const jn = A("ToggleLeft", [
|
|
366
366
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
367
367
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
368
368
|
]);
|
|
@@ -372,7 +372,7 @@ const pn = E("ToggleLeft", [
|
|
|
372
372
|
* This source code is licensed under the ISC license.
|
|
373
373
|
* See the LICENSE file in the root directory of this source tree.
|
|
374
374
|
*/
|
|
375
|
-
const
|
|
375
|
+
const Ms = A("Type", [
|
|
376
376
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
377
377
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
378
378
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -383,14 +383,14 @@ const fn = E("Type", [
|
|
|
383
383
|
* This source code is licensed under the ISC license.
|
|
384
384
|
* See the LICENSE file in the root directory of this source tree.
|
|
385
385
|
*/
|
|
386
|
-
const
|
|
386
|
+
const bn = A("User", [
|
|
387
387
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
388
388
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
389
389
|
]);
|
|
390
|
-
function
|
|
391
|
-
const [s, n] = T(""), [a, t] = T(!1), [
|
|
392
|
-
function
|
|
393
|
-
const
|
|
390
|
+
function yn() {
|
|
391
|
+
const [s, n] = T(""), [a, t] = T(!1), [l, o] = T(!1), d = w((c) => c.dashboard);
|
|
392
|
+
function r() {
|
|
393
|
+
const c = Qs(d), f = Ae(d.id), m = JSON.parse(localStorage.getItem(f) || "[]");
|
|
394
394
|
if (m.some(
|
|
395
395
|
(S) => S.name === s
|
|
396
396
|
)) {
|
|
@@ -399,18 +399,18 @@ function jn() {
|
|
|
399
399
|
}
|
|
400
400
|
m.push({
|
|
401
401
|
name: s,
|
|
402
|
-
template:
|
|
403
|
-
}), localStorage.setItem(f, JSON.stringify(m)),
|
|
402
|
+
template: c
|
|
403
|
+
}), localStorage.setItem(f, JSON.stringify(m)), o(!1);
|
|
404
404
|
}
|
|
405
|
-
return /* @__PURE__ */ e.jsxs(ps, { open:
|
|
405
|
+
return /* @__PURE__ */ e.jsxs(ps, { open: l, onOpenChange: o, children: [
|
|
406
406
|
/* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
407
|
-
|
|
407
|
+
k,
|
|
408
408
|
{
|
|
409
409
|
variant: "outline",
|
|
410
410
|
className: "h-7 p-2",
|
|
411
411
|
size: "sm",
|
|
412
412
|
children: [
|
|
413
|
-
/* @__PURE__ */ e.jsx(
|
|
413
|
+
/* @__PURE__ */ e.jsx(Gs, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
414
414
|
"Add Lens"
|
|
415
415
|
]
|
|
416
416
|
}
|
|
@@ -426,8 +426,8 @@ function jn() {
|
|
|
426
426
|
ae,
|
|
427
427
|
{
|
|
428
428
|
value: s,
|
|
429
|
-
onChange: (
|
|
430
|
-
a && t(!1), n(
|
|
429
|
+
onChange: (c) => {
|
|
430
|
+
a && t(!1), n(c.target.value);
|
|
431
431
|
},
|
|
432
432
|
id: "name",
|
|
433
433
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -435,67 +435,67 @@ function jn() {
|
|
|
435
435
|
)
|
|
436
436
|
] }) }),
|
|
437
437
|
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
|
|
438
|
-
/* @__PURE__ */ e.jsx(
|
|
439
|
-
|
|
438
|
+
/* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
|
|
439
|
+
k,
|
|
440
440
|
{
|
|
441
441
|
variant: "outline",
|
|
442
442
|
type: "submit",
|
|
443
443
|
disabled: !s,
|
|
444
|
-
onClick:
|
|
444
|
+
onClick: r,
|
|
445
445
|
children: "Save"
|
|
446
446
|
}
|
|
447
447
|
) })
|
|
448
448
|
] })
|
|
449
449
|
] });
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
const [s, n] = T(!1), [a, t] = T(""),
|
|
451
|
+
function vn() {
|
|
452
|
+
const [s, n] = T(!1), [a, t] = T(""), l = w((h) => h.dashboard), o = w((h) => h.bookmarkKey), [d, r] = T([]), c = w((h) => h.actions.setDashboard), f = w(
|
|
453
453
|
(h) => h.actions.setFilterValues
|
|
454
|
-
), m =
|
|
454
|
+
), m = w(
|
|
455
455
|
(h) => h.actions.setBookmarkKey
|
|
456
456
|
);
|
|
457
457
|
P(() => {
|
|
458
|
-
const h =
|
|
459
|
-
|
|
458
|
+
const h = Ae(l.id), x = JSON.parse(localStorage.getItem(h) || "[]");
|
|
459
|
+
r(x);
|
|
460
460
|
const g = x.find(
|
|
461
461
|
(z) => z.default
|
|
462
462
|
);
|
|
463
|
-
g && g.name ===
|
|
464
|
-
}, [s,
|
|
463
|
+
g && g.name === o && t(g.name);
|
|
464
|
+
}, [s, l, o]);
|
|
465
465
|
function u(h) {
|
|
466
466
|
if (h === a)
|
|
467
467
|
return;
|
|
468
|
-
const x =
|
|
469
|
-
g && (
|
|
468
|
+
const x = d.find((z) => z.name === h), g = x == null ? void 0 : x.template;
|
|
469
|
+
g && (c(g), f(x.filterValues || []), m(h === "Original" ? "" : h)), t(h);
|
|
470
470
|
}
|
|
471
471
|
function S(h) {
|
|
472
|
-
const x =
|
|
472
|
+
const x = Ae(l.id), z = JSON.parse(localStorage.getItem(x) || "[]").filter(
|
|
473
473
|
(b) => b.name !== h
|
|
474
474
|
);
|
|
475
|
-
localStorage.setItem(x, JSON.stringify(z)),
|
|
475
|
+
localStorage.setItem(x, JSON.stringify(z)), r(z);
|
|
476
476
|
}
|
|
477
|
-
return /* @__PURE__ */ e.jsxs(
|
|
478
|
-
/* @__PURE__ */ e.jsx(
|
|
479
|
-
/* @__PURE__ */ e.jsxs(
|
|
480
|
-
/* @__PURE__ */ e.jsx(
|
|
481
|
-
/* @__PURE__ */ e.jsx(
|
|
477
|
+
return /* @__PURE__ */ e.jsxs(Ra, { open: s, onOpenChange: n, children: [
|
|
478
|
+
/* @__PURE__ */ e.jsx(_a, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(sn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
479
|
+
/* @__PURE__ */ e.jsxs(Ha, { className: "w-56", children: [
|
|
480
|
+
/* @__PURE__ */ e.jsx(Ba, { children: "Lenses" }),
|
|
481
|
+
/* @__PURE__ */ e.jsx($a, {}),
|
|
482
482
|
/* @__PURE__ */ e.jsxs(
|
|
483
|
-
|
|
483
|
+
Pa,
|
|
484
484
|
{
|
|
485
485
|
value: a,
|
|
486
486
|
onValueChange: u,
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */ e.jsx(
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
/* @__PURE__ */ e.jsx(Es, { value: "Original", children: "Original" }),
|
|
489
|
+
d.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
|
|
490
|
+
Es,
|
|
491
491
|
{
|
|
492
492
|
className: "xbg-red-100 flex justify-between",
|
|
493
493
|
value: h.name,
|
|
494
|
-
defaultChecked: h.name ===
|
|
494
|
+
defaultChecked: h.name === o,
|
|
495
495
|
children: [
|
|
496
496
|
/* @__PURE__ */ e.jsx("p", { children: h.name }),
|
|
497
497
|
/* @__PURE__ */ e.jsx(
|
|
498
|
-
|
|
498
|
+
He,
|
|
499
499
|
{
|
|
500
500
|
onClick: (g) => {
|
|
501
501
|
g.preventDefault(), S(h.name);
|
|
@@ -514,34 +514,34 @@ function bn() {
|
|
|
514
514
|
] })
|
|
515
515
|
] });
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const [s, n] = T(!1), a =
|
|
517
|
+
function Nn() {
|
|
518
|
+
const [s, n] = T(!1), a = w((o) => o.dashboard), t = w((o) => o.bookmarkKey);
|
|
519
519
|
P(() => {
|
|
520
520
|
if (!t) {
|
|
521
521
|
n(!1);
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
|
-
const
|
|
525
|
-
localStorage.getItem(
|
|
524
|
+
const o = Ae(a.id), r = JSON.parse(
|
|
525
|
+
localStorage.getItem(o) || "[]"
|
|
526
526
|
).find(
|
|
527
|
-
(
|
|
527
|
+
(c) => c.name === t
|
|
528
528
|
);
|
|
529
|
-
n(
|
|
529
|
+
n(r ? r.default : !1);
|
|
530
530
|
}, [t, a.id]);
|
|
531
|
-
function o
|
|
532
|
-
if (n(
|
|
531
|
+
function l(o) {
|
|
532
|
+
if (n(o), !t)
|
|
533
533
|
return;
|
|
534
|
-
const
|
|
535
|
-
localStorage.getItem(
|
|
536
|
-
).map((f) => (f.name === t ? f.default =
|
|
537
|
-
console.log(
|
|
534
|
+
const d = Ae(a.id), c = JSON.parse(
|
|
535
|
+
localStorage.getItem(d) || "[]"
|
|
536
|
+
).map((f) => (f.name === t ? f.default = o : f.default = !1, f));
|
|
537
|
+
console.log(c), localStorage.setItem(d, JSON.stringify(c));
|
|
538
538
|
}
|
|
539
539
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
540
540
|
/* @__PURE__ */ e.jsx(
|
|
541
|
-
|
|
541
|
+
Ke,
|
|
542
542
|
{
|
|
543
543
|
checked: s,
|
|
544
|
-
onCheckedChange:
|
|
544
|
+
onCheckedChange: l,
|
|
545
545
|
id: "terms"
|
|
546
546
|
}
|
|
547
547
|
),
|
|
@@ -555,24 +555,24 @@ function yn() {
|
|
|
555
555
|
)
|
|
556
556
|
] });
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
const s =
|
|
560
|
-
|
|
561
|
-
const a =
|
|
558
|
+
function Cn() {
|
|
559
|
+
const s = w((b) => b.bookmarkKey), n = w((b) => b.dashboard);
|
|
560
|
+
w((b) => b.selectedSheetId);
|
|
561
|
+
const a = w(
|
|
562
562
|
(b) => b.isDashboardEditing
|
|
563
|
-
), t =
|
|
564
|
-
|
|
563
|
+
), t = w((b) => b.filterValues), l = w((b) => b.isVisualEditing), o = w((b) => b.showFilters);
|
|
564
|
+
w(
|
|
565
565
|
(b) => b.showDashboardJSON
|
|
566
566
|
);
|
|
567
|
-
const
|
|
567
|
+
const d = w((b) => b.onSaveFunction), r = w(
|
|
568
568
|
(b) => b.actions.setShowFilters
|
|
569
|
-
), { addFrame:
|
|
569
|
+
), { addFrame: c, setSelectedFrameId: f } = w(
|
|
570
570
|
(b) => b.actions
|
|
571
|
-
), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: S } =
|
|
571
|
+
), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: S } = w((b) => b.actions), h = m(), x = () => {
|
|
572
572
|
if (!a || !h)
|
|
573
573
|
return;
|
|
574
574
|
const b = {
|
|
575
|
-
id:
|
|
575
|
+
id: Xe(),
|
|
576
576
|
title: "Title",
|
|
577
577
|
description: "Description",
|
|
578
578
|
preferences: {
|
|
@@ -586,19 +586,19 @@ function vn() {
|
|
|
586
586
|
type: "bar",
|
|
587
587
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
588
588
|
data: []
|
|
589
|
-
},
|
|
590
|
-
id:
|
|
589
|
+
}, E = {
|
|
590
|
+
id: Xe(),
|
|
591
591
|
cards: [b],
|
|
592
592
|
activeCardId: b.id
|
|
593
593
|
};
|
|
594
|
-
|
|
594
|
+
c(h.id, E), f(E.id);
|
|
595
595
|
}, g = () => {
|
|
596
596
|
u(!0);
|
|
597
597
|
};
|
|
598
598
|
function z() {
|
|
599
599
|
if (!s || s === "")
|
|
600
600
|
return;
|
|
601
|
-
const b =
|
|
601
|
+
const b = Qs(n), E = Ae(n.id), N = JSON.parse(localStorage.getItem(E) || "[]"), O = N.findIndex(
|
|
602
602
|
(j) => j.name === s
|
|
603
603
|
);
|
|
604
604
|
O !== -1 ? N[O] = {
|
|
@@ -610,26 +610,26 @@ function vn() {
|
|
|
610
610
|
name: s,
|
|
611
611
|
template: b,
|
|
612
612
|
filterValues: t
|
|
613
|
-
}), localStorage.setItem(
|
|
613
|
+
}), localStorage.setItem(E, JSON.stringify(N)), d == null || d(b);
|
|
614
614
|
}
|
|
615
|
-
return
|
|
615
|
+
return l ? null : /* @__PURE__ */ e.jsxs(
|
|
616
616
|
"div",
|
|
617
617
|
{
|
|
618
618
|
className: "flex items-center justify-between gap-2 border-b bg-muted/50 px-2 py-2",
|
|
619
619
|
role: "dashboard-controls",
|
|
620
620
|
children: [
|
|
621
|
-
!
|
|
621
|
+
!l && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
622
622
|
/* @__PURE__ */ e.jsx(B, { children: s }),
|
|
623
623
|
!!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
624
624
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
|
|
625
|
-
/* @__PURE__ */ e.jsx(
|
|
625
|
+
/* @__PURE__ */ e.jsx(Nn, {})
|
|
626
626
|
] })
|
|
627
627
|
] }),
|
|
628
628
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
629
|
-
a && !
|
|
630
|
-
!
|
|
631
|
-
a && !
|
|
632
|
-
|
|
629
|
+
a && !l && /* @__PURE__ */ e.jsx(yn, {}),
|
|
630
|
+
!l && /* @__PURE__ */ e.jsx(vn, {}),
|
|
631
|
+
a && !l && /* @__PURE__ */ e.jsxs(
|
|
632
|
+
k,
|
|
633
633
|
{
|
|
634
634
|
variant: "outline",
|
|
635
635
|
className: "h-7 p-2",
|
|
@@ -637,23 +637,23 @@ function vn() {
|
|
|
637
637
|
disabled: !a,
|
|
638
638
|
onClick: x,
|
|
639
639
|
children: [
|
|
640
|
-
/* @__PURE__ */ e.jsx(
|
|
640
|
+
/* @__PURE__ */ e.jsx(Gs, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
641
641
|
"Add Frame"
|
|
642
642
|
]
|
|
643
643
|
}
|
|
644
644
|
),
|
|
645
645
|
!a && /* @__PURE__ */ e.jsx(
|
|
646
|
-
|
|
646
|
+
k,
|
|
647
647
|
{
|
|
648
648
|
variant: "outline",
|
|
649
649
|
className: "h-7 p-2",
|
|
650
650
|
onClick: g,
|
|
651
651
|
size: "sm",
|
|
652
|
-
children: /* @__PURE__ */ e.jsx(
|
|
652
|
+
children: /* @__PURE__ */ e.jsx(ha, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
653
653
|
}
|
|
654
654
|
),
|
|
655
|
-
a && !
|
|
656
|
-
|
|
655
|
+
a && !l && /* @__PURE__ */ e.jsx(
|
|
656
|
+
k,
|
|
657
657
|
{
|
|
658
658
|
variant: "outline",
|
|
659
659
|
role: "close",
|
|
@@ -662,106 +662,106 @@ function vn() {
|
|
|
662
662
|
u(!1), S(!1);
|
|
663
663
|
},
|
|
664
664
|
size: "sm",
|
|
665
|
-
children: /* @__PURE__ */ e.jsx(
|
|
665
|
+
children: /* @__PURE__ */ e.jsx(He, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
666
666
|
}
|
|
667
667
|
),
|
|
668
|
-
a && !
|
|
669
|
-
|
|
668
|
+
a && !l && /* @__PURE__ */ e.jsx(
|
|
669
|
+
k,
|
|
670
670
|
{
|
|
671
671
|
className: "h-7 p-2",
|
|
672
672
|
variant: "outline",
|
|
673
673
|
onClick: z,
|
|
674
674
|
size: "sm",
|
|
675
|
-
children: /* @__PURE__ */ e.jsx(
|
|
675
|
+
children: /* @__PURE__ */ e.jsx(un, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
676
676
|
}
|
|
677
677
|
),
|
|
678
|
-
!
|
|
679
|
-
|
|
678
|
+
!o && !l && a && /* @__PURE__ */ e.jsx(
|
|
679
|
+
k,
|
|
680
680
|
{
|
|
681
681
|
className: "h-7 p-2",
|
|
682
682
|
variant: "outline",
|
|
683
|
-
onClick: () =>
|
|
683
|
+
onClick: () => r(!0),
|
|
684
684
|
size: "sm",
|
|
685
|
-
children: /* @__PURE__ */ e.jsx(
|
|
685
|
+
children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
686
686
|
}
|
|
687
687
|
),
|
|
688
|
-
!
|
|
689
|
-
!
|
|
688
|
+
!l && a && !1,
|
|
689
|
+
!l && !1
|
|
690
690
|
] })
|
|
691
691
|
]
|
|
692
692
|
}
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function We({
|
|
696
696
|
title: s,
|
|
697
697
|
items: n,
|
|
698
698
|
value: a,
|
|
699
699
|
isLoading: t,
|
|
700
|
-
isError:
|
|
701
|
-
connectionTooltip:
|
|
702
|
-
onChange:
|
|
703
|
-
className:
|
|
704
|
-
showIcon:
|
|
700
|
+
isError: l,
|
|
701
|
+
connectionTooltip: o,
|
|
702
|
+
onChange: d,
|
|
703
|
+
className: r,
|
|
704
|
+
showIcon: c = !0,
|
|
705
705
|
disabled: f = !1
|
|
706
706
|
}) {
|
|
707
|
-
const m = t ? "Loading..." :
|
|
707
|
+
const m = t ? "Loading..." : l ? "Error" : a;
|
|
708
708
|
function u() {
|
|
709
709
|
if (s === "Connection")
|
|
710
|
-
return /* @__PURE__ */ e.jsx(
|
|
710
|
+
return /* @__PURE__ */ e.jsx(mn, { className: "size-4 rotate-90" });
|
|
711
711
|
if (s === "Database")
|
|
712
|
-
return /* @__PURE__ */ e.jsx(
|
|
712
|
+
return /* @__PURE__ */ e.jsx(Zt, { className: "size-4" });
|
|
713
713
|
if (s === "Schema")
|
|
714
|
-
return /* @__PURE__ */ e.jsx(
|
|
714
|
+
return /* @__PURE__ */ e.jsx(dn, { className: "size-4" });
|
|
715
715
|
if (s === "Table")
|
|
716
716
|
return /* @__PURE__ */ e.jsx(Cs, { className: "size-4" });
|
|
717
717
|
}
|
|
718
718
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
719
|
-
|
|
720
|
-
/* @__PURE__ */ e.jsx(
|
|
721
|
-
/* @__PURE__ */ e.jsx(Ns, { className: "text-xs", align: "start", children:
|
|
719
|
+
c && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(vs, { children: [
|
|
720
|
+
/* @__PURE__ */ e.jsx(Ws, { children: u() }),
|
|
721
|
+
/* @__PURE__ */ e.jsx(Ns, { className: "text-xs", align: "start", children: o })
|
|
722
722
|
] }) : u() }),
|
|
723
|
-
/* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange:
|
|
723
|
+
/* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: d, children: [
|
|
724
724
|
/* @__PURE__ */ e.jsx(
|
|
725
725
|
Me,
|
|
726
726
|
{
|
|
727
727
|
className: Y(
|
|
728
728
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
729
|
-
|
|
729
|
+
r
|
|
730
730
|
),
|
|
731
731
|
children: /* @__PURE__ */ e.jsx(
|
|
732
732
|
Te,
|
|
733
733
|
{
|
|
734
|
-
placeholder: t ? "Loading..." :
|
|
734
|
+
placeholder: t ? "Loading..." : l ? "Error" : `Select ${s}`
|
|
735
735
|
}
|
|
736
736
|
)
|
|
737
737
|
}
|
|
738
738
|
),
|
|
739
|
-
/* @__PURE__ */ e.jsx(
|
|
740
|
-
t ? /* @__PURE__ */ e.jsx(
|
|
739
|
+
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
740
|
+
t ? /* @__PURE__ */ e.jsx(Ee, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ee, { children: s }),
|
|
741
741
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((S, h) => /* @__PURE__ */ e.jsx(X, { value: S.id, children: S.name }, h)) }),
|
|
742
|
-
(t ||
|
|
742
|
+
(t || l) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
|
|
743
743
|
] }) })
|
|
744
744
|
] })
|
|
745
745
|
] });
|
|
746
746
|
}
|
|
747
|
-
function
|
|
748
|
-
const [n, a] = T(!1), t = i((m) => m.selectedTableName),
|
|
747
|
+
function Sn({ column: s }) {
|
|
748
|
+
const [n, a] = T(!1), t = i((m) => m.selectedTableName), l = i(
|
|
749
749
|
(m) => m.selectedSchemaName
|
|
750
|
-
),
|
|
750
|
+
), o = i((m) => m.sqlGen), d = i((m) => m.actions.setSqlGen), r = i((m) => m.actions.setCardSql), c = i((m) => m.actions.setRunSql);
|
|
751
751
|
function f(m, u) {
|
|
752
|
-
const S =
|
|
753
|
-
|
|
754
|
-
const h =
|
|
752
|
+
const S = Ys(m, o, u);
|
|
753
|
+
d(S);
|
|
754
|
+
const h = Xs(
|
|
755
755
|
S,
|
|
756
|
-
he(
|
|
756
|
+
he(l || ""),
|
|
757
757
|
he(t)
|
|
758
758
|
);
|
|
759
|
-
h && (
|
|
759
|
+
h && (r(h), c(!0)), a(!1);
|
|
760
760
|
}
|
|
761
|
-
return /* @__PURE__ */ e.jsxs(
|
|
762
|
-
/* @__PURE__ */ e.jsx(
|
|
761
|
+
return /* @__PURE__ */ e.jsxs(Ue, { open: n, onOpenChange: a, children: [
|
|
762
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ka, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
|
|
763
763
|
/* @__PURE__ */ e.jsx(
|
|
764
|
-
|
|
764
|
+
Je,
|
|
765
765
|
{
|
|
766
766
|
align: "center",
|
|
767
767
|
className: "w-18 rounded-md p-0 shadow-none",
|
|
@@ -811,69 +811,69 @@ function Nn({ column: s }) {
|
|
|
811
811
|
)
|
|
812
812
|
] });
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function xa({ column: s }) {
|
|
815
815
|
return /* @__PURE__ */ e.jsxs(vs, { children: [
|
|
816
|
-
/* @__PURE__ */ e.jsx(
|
|
816
|
+
/* @__PURE__ */ e.jsx(Ua, { asChild: !0, children: Ga.includes(s.data_type.toLowerCase()) ? (
|
|
817
817
|
// <span className=" font-thin">T</span>
|
|
818
|
-
/* @__PURE__ */ e.jsx(
|
|
819
|
-
) :
|
|
818
|
+
/* @__PURE__ */ e.jsx(Ms, { className: "size-3" })
|
|
819
|
+
) : Zs.includes(s.data_type.toLowerCase()) ? (
|
|
820
820
|
//
|
|
821
|
-
/* @__PURE__ */ e.jsx(
|
|
822
|
-
) :
|
|
821
|
+
/* @__PURE__ */ e.jsx(tn, { className: "size-3" })
|
|
822
|
+
) : Ja.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Qa, { className: "size-3" }) : Wa.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(jn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(xn, { className: "size-3" }) }),
|
|
823
823
|
/* @__PURE__ */ e.jsx(Ns, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
824
824
|
] });
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function kn({
|
|
827
827
|
schemaName: s,
|
|
828
828
|
tableName: n,
|
|
829
829
|
columns: a,
|
|
830
830
|
status: t
|
|
831
831
|
}) {
|
|
832
|
-
const
|
|
832
|
+
const l = i((j) => j.sqlGen), o = i(
|
|
833
833
|
(j) => j.selectedConnectionId
|
|
834
|
-
),
|
|
834
|
+
), d = i(
|
|
835
835
|
(j) => j.selectedDatabaseName
|
|
836
|
-
),
|
|
836
|
+
), r = i(
|
|
837
837
|
(j) => j.selectedSchemaName
|
|
838
|
-
),
|
|
838
|
+
), c = i((j) => j.selectedTableName), f = w(
|
|
839
839
|
(j) => j.dashboard.aiScopeTables
|
|
840
|
-
), { setAIScopeTables: m } =
|
|
840
|
+
), { setAIScopeTables: m } = w((j) => j.actions), u = i((j) => j.actions.setRunSql), S = i((j) => j.actions.setSqlGen), h = i(
|
|
841
841
|
(j) => j.actions.setIsShowingVisual
|
|
842
|
-
), x = i((j) => j.actions.setCardSql), { connectionType: g } =
|
|
842
|
+
), x = i((j) => j.actions.setCardSql), { connectionType: g } = pa();
|
|
843
843
|
function z(j) {
|
|
844
|
-
const F =
|
|
844
|
+
const F = Ys(j, l);
|
|
845
845
|
S(F);
|
|
846
|
-
const
|
|
847
|
-
|
|
846
|
+
const L = Xs(F, he(s), he(n));
|
|
847
|
+
L && (x(L), u(!0));
|
|
848
848
|
}
|
|
849
849
|
function b() {
|
|
850
850
|
return (f == null ? void 0 : f.find(
|
|
851
|
-
(j) => j.connectinonId ===
|
|
851
|
+
(j) => j.connectinonId === o && j.tableName === c
|
|
852
852
|
)) !== void 0;
|
|
853
853
|
}
|
|
854
|
-
function
|
|
855
|
-
if (j === !0 &&
|
|
854
|
+
function E(j) {
|
|
855
|
+
if (j === !0 && c && o) {
|
|
856
856
|
const F = {
|
|
857
|
-
connectinonId:
|
|
857
|
+
connectinonId: o,
|
|
858
858
|
connectionType: g,
|
|
859
|
-
databaseName:
|
|
860
|
-
schemaName:
|
|
861
|
-
tableName:
|
|
862
|
-
},
|
|
859
|
+
databaseName: d,
|
|
860
|
+
schemaName: r,
|
|
861
|
+
tableName: c
|
|
862
|
+
}, V = [...f || [], F].filter(
|
|
863
863
|
(K, $, G) => G.findIndex(
|
|
864
864
|
(D) => D.connectinonId === K.connectinonId && D.tableName === K.tableName
|
|
865
865
|
) === $
|
|
866
866
|
);
|
|
867
|
-
m(
|
|
867
|
+
m(V), ds.success(`Added '${c}' to AI Scope`, {
|
|
868
868
|
position: "top-right",
|
|
869
869
|
duration: 2500,
|
|
870
870
|
richColors: !0
|
|
871
871
|
});
|
|
872
872
|
} else {
|
|
873
873
|
const F = (f || []).filter(
|
|
874
|
-
(
|
|
874
|
+
(L) => L.connectinonId !== o && L.tableName !== c
|
|
875
875
|
);
|
|
876
|
-
m(F), ds(`Removed '${
|
|
876
|
+
m(F), ds(`Removed '${c}' from AI Scope`, {
|
|
877
877
|
position: "top-right",
|
|
878
878
|
duration: 2e3,
|
|
879
879
|
richColors: !0
|
|
@@ -883,25 +883,25 @@ function Cn({
|
|
|
883
883
|
function N() {
|
|
884
884
|
let F = hs(s, n);
|
|
885
885
|
((K) => K.charAt(0) === K.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1);
|
|
886
|
-
const
|
|
887
|
-
x(
|
|
886
|
+
const V = g === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
|
|
887
|
+
x(V), u(!0);
|
|
888
888
|
}
|
|
889
889
|
function O() {
|
|
890
890
|
let F = hs(s, n);
|
|
891
|
-
((
|
|
891
|
+
((V) => V.charAt(0) === V.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
|
|
892
892
|
}
|
|
893
893
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
894
894
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
895
895
|
/* @__PURE__ */ e.jsx(
|
|
896
|
-
|
|
896
|
+
ea,
|
|
897
897
|
{
|
|
898
898
|
title: `${b() ? "Remove from" : "Add to"} AI Scope`,
|
|
899
899
|
pressed: b(),
|
|
900
|
-
onPressedChange:
|
|
900
|
+
onPressedChange: E,
|
|
901
901
|
variant: "outline",
|
|
902
902
|
className: "h-9 px-2",
|
|
903
903
|
children: /* @__PURE__ */ e.jsx(
|
|
904
|
-
|
|
904
|
+
Ya,
|
|
905
905
|
{
|
|
906
906
|
className: Y("size-4", {
|
|
907
907
|
"text-primary": b(),
|
|
@@ -912,7 +912,7 @@ function Cn({
|
|
|
912
912
|
}
|
|
913
913
|
),
|
|
914
914
|
/* @__PURE__ */ e.jsxs(
|
|
915
|
-
|
|
915
|
+
k,
|
|
916
916
|
{
|
|
917
917
|
disabled: t !== "Success",
|
|
918
918
|
onClick: N,
|
|
@@ -920,13 +920,13 @@ function Cn({
|
|
|
920
920
|
variant: "secondary",
|
|
921
921
|
className: "flex",
|
|
922
922
|
children: [
|
|
923
|
-
t !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
923
|
+
t !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(fn, { className: "mr-2 size-4" }),
|
|
924
924
|
"Top 10"
|
|
925
925
|
]
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
/* @__PURE__ */ e.jsxs(
|
|
929
|
-
|
|
929
|
+
k,
|
|
930
930
|
{
|
|
931
931
|
disabled: t !== "Success",
|
|
932
932
|
onClick: O,
|
|
@@ -934,7 +934,7 @@ function Cn({
|
|
|
934
934
|
variant: "secondary",
|
|
935
935
|
className: "flex",
|
|
936
936
|
children: [
|
|
937
|
-
t !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
937
|
+
t !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(pn, { className: "mr-2 size-4" }),
|
|
938
938
|
"Count"
|
|
939
939
|
]
|
|
940
940
|
}
|
|
@@ -952,43 +952,43 @@ function Cn({
|
|
|
952
952
|
className: Y(
|
|
953
953
|
"mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
954
954
|
{
|
|
955
|
-
"bg-muted":
|
|
955
|
+
"bg-muted": Xa(j, l)
|
|
956
956
|
}
|
|
957
957
|
),
|
|
958
958
|
children: [
|
|
959
959
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
960
|
-
/* @__PURE__ */ e.jsx(
|
|
960
|
+
/* @__PURE__ */ e.jsx(xa, { column: j }),
|
|
961
961
|
/* @__PURE__ */ e.jsx("span", { children: j.column_name })
|
|
962
962
|
] }),
|
|
963
|
-
|
|
963
|
+
Zs.includes(j.data_type) && /* @__PURE__ */ e.jsx(
|
|
964
964
|
"div",
|
|
965
965
|
{
|
|
966
966
|
onClick: (F) => F.stopPropagation(),
|
|
967
967
|
className: "flex items-center justify-end",
|
|
968
|
-
children: /* @__PURE__ */ e.jsx(
|
|
968
|
+
children: /* @__PURE__ */ e.jsx(Sn, { column: j })
|
|
969
969
|
}
|
|
970
970
|
)
|
|
971
971
|
]
|
|
972
972
|
},
|
|
973
973
|
j.column_name
|
|
974
974
|
)),
|
|
975
|
-
/* @__PURE__ */ e.jsx(
|
|
976
|
-
/* @__PURE__ */ e.jsx(
|
|
975
|
+
/* @__PURE__ */ e.jsx(Ds, { orientation: "vertical" }),
|
|
976
|
+
/* @__PURE__ */ e.jsx(Ds, { orientation: "horizontal" })
|
|
977
977
|
]
|
|
978
978
|
}
|
|
979
979
|
)
|
|
980
980
|
] });
|
|
981
981
|
}
|
|
982
|
-
function
|
|
983
|
-
var
|
|
984
|
-
let a =
|
|
985
|
-
const t =
|
|
982
|
+
function pa(s, n) {
|
|
983
|
+
var ts, ve, Qe, qe;
|
|
984
|
+
let a = Qt(() => [], []);
|
|
985
|
+
const t = ss().authToken || s, l = i(
|
|
986
986
|
(C) => C.selectedConnectionId
|
|
987
|
-
),
|
|
987
|
+
), o = i(
|
|
988
988
|
(C) => C.selectedDatabaseName
|
|
989
|
-
),
|
|
989
|
+
), d = i(
|
|
990
990
|
(C) => C.selectedSchemaName
|
|
991
|
-
),
|
|
991
|
+
), r = i((C) => C.selectedTableName), c = i(
|
|
992
992
|
(C) => C.actions.setCurrentColumns
|
|
993
993
|
), f = i(
|
|
994
994
|
(C) => C.actions.setSelectedConnectionId
|
|
@@ -1000,17 +1000,17 @@ function xa(s, n) {
|
|
|
1000
1000
|
(C) => C.actions.setSelectedTableName
|
|
1001
1001
|
), h = i((C) => C.actions.setCardSql);
|
|
1002
1002
|
function x(C) {
|
|
1003
|
-
return
|
|
1003
|
+
return l && o && d && o !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
|
|
1004
1004
|
}
|
|
1005
1005
|
function g(C) {
|
|
1006
|
-
return !!(
|
|
1006
|
+
return !!(l && o && o !== "NA" && d && r || l && (C === "S3" || C === "API"));
|
|
1007
1007
|
}
|
|
1008
1008
|
function z(C) {
|
|
1009
|
-
return
|
|
1009
|
+
return l && C ? !(C === "API" || C === "S3") : !1;
|
|
1010
1010
|
}
|
|
1011
1011
|
const {
|
|
1012
1012
|
data: b,
|
|
1013
|
-
isLoading:
|
|
1013
|
+
isLoading: E,
|
|
1014
1014
|
isError: N
|
|
1015
1015
|
} = Ce({
|
|
1016
1016
|
queryKey: ["connections"],
|
|
@@ -1021,20 +1021,20 @@ function xa(s, n) {
|
|
|
1021
1021
|
enabled: !!(t != null && t.accessToken)
|
|
1022
1022
|
// Only fetch if authToken is present
|
|
1023
1023
|
}), O = b == null ? void 0 : b.connections.find(
|
|
1024
|
-
(C) => C.id ===
|
|
1024
|
+
(C) => C.id === l
|
|
1025
1025
|
), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
|
|
1026
|
-
data:
|
|
1027
|
-
isLoading:
|
|
1026
|
+
data: L,
|
|
1027
|
+
isLoading: V,
|
|
1028
1028
|
isFetching: K,
|
|
1029
1029
|
isError: $,
|
|
1030
1030
|
refetch: G
|
|
1031
1031
|
} = Ce({
|
|
1032
|
-
queryKey: ["databases",
|
|
1032
|
+
queryKey: ["databases", l],
|
|
1033
1033
|
queryFn: () => ze(
|
|
1034
1034
|
"https://semaphor.cloud/api/v1/databases",
|
|
1035
1035
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1036
1036
|
{
|
|
1037
|
-
connection_id:
|
|
1037
|
+
connection_id: l
|
|
1038
1038
|
}
|
|
1039
1039
|
),
|
|
1040
1040
|
enabled: z(j)
|
|
@@ -1046,16 +1046,16 @@ function xa(s, n) {
|
|
|
1046
1046
|
isError: ee,
|
|
1047
1047
|
refetch: Z
|
|
1048
1048
|
} = Ce({
|
|
1049
|
-
queryKey: ["schemas",
|
|
1049
|
+
queryKey: ["schemas", l, o],
|
|
1050
1050
|
queryFn: () => ze(
|
|
1051
1051
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1052
1052
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1053
1053
|
{
|
|
1054
|
-
connection_id:
|
|
1055
|
-
database_name:
|
|
1054
|
+
connection_id: l,
|
|
1055
|
+
database_name: o
|
|
1056
1056
|
}
|
|
1057
1057
|
),
|
|
1058
|
-
enabled: !!
|
|
1058
|
+
enabled: !!l && !!o && !F && o !== "NA"
|
|
1059
1059
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1060
1060
|
}), {
|
|
1061
1061
|
data: J,
|
|
@@ -1066,41 +1066,41 @@ function xa(s, n) {
|
|
|
1066
1066
|
} = Ce({
|
|
1067
1067
|
queryKey: [
|
|
1068
1068
|
"tables",
|
|
1069
|
+
l,
|
|
1069
1070
|
o,
|
|
1070
|
-
|
|
1071
|
-
r
|
|
1071
|
+
d
|
|
1072
1072
|
],
|
|
1073
1073
|
queryFn: () => ze(
|
|
1074
1074
|
"https://semaphor.cloud/api/v1/tables",
|
|
1075
1075
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1076
1076
|
{
|
|
1077
|
-
connection_id:
|
|
1078
|
-
database_name:
|
|
1079
|
-
schema_name:
|
|
1077
|
+
connection_id: l,
|
|
1078
|
+
database_name: o,
|
|
1079
|
+
schema_name: d
|
|
1080
1080
|
}
|
|
1081
1081
|
),
|
|
1082
1082
|
enabled: x(j)
|
|
1083
1083
|
}), {
|
|
1084
1084
|
data: H,
|
|
1085
|
-
isLoading:
|
|
1085
|
+
isLoading: xe,
|
|
1086
1086
|
isFetching: se,
|
|
1087
1087
|
isError: ge
|
|
1088
1088
|
} = Ce({
|
|
1089
1089
|
queryKey: [
|
|
1090
1090
|
"columns",
|
|
1091
|
+
l,
|
|
1091
1092
|
o,
|
|
1092
|
-
|
|
1093
|
-
r
|
|
1094
|
-
l
|
|
1093
|
+
d,
|
|
1094
|
+
r
|
|
1095
1095
|
],
|
|
1096
1096
|
queryFn: () => ze(
|
|
1097
1097
|
"https://semaphor.cloud/api/v1/columns",
|
|
1098
1098
|
(t == null ? void 0 : t.accessToken) || "",
|
|
1099
1099
|
{
|
|
1100
|
-
connection_id:
|
|
1101
|
-
database_name:
|
|
1102
|
-
schema_name:
|
|
1103
|
-
table_name:
|
|
1100
|
+
connection_id: l,
|
|
1101
|
+
database_name: o,
|
|
1102
|
+
schema_name: d,
|
|
1103
|
+
table_name: r
|
|
1104
1104
|
}
|
|
1105
1105
|
),
|
|
1106
1106
|
enabled: g(j)
|
|
@@ -1113,8 +1113,8 @@ function xa(s, n) {
|
|
|
1113
1113
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1114
1114
|
});
|
|
1115
1115
|
P(() => {
|
|
1116
|
-
|
|
1117
|
-
}, [H,
|
|
1116
|
+
c(a);
|
|
1117
|
+
}, [H, c, a]), P(() => {
|
|
1118
1118
|
}, [
|
|
1119
1119
|
F,
|
|
1120
1120
|
h,
|
|
@@ -1123,8 +1123,8 @@ function xa(s, n) {
|
|
|
1123
1123
|
m,
|
|
1124
1124
|
O
|
|
1125
1125
|
]);
|
|
1126
|
-
const je = (O == null ? void 0 : O.type) === "API" ? (
|
|
1127
|
-
function
|
|
1126
|
+
const je = (O == null ? void 0 : O.type) === "API" ? (ts = O == null ? void 0 : O.type) == null ? void 0 : ts.toLowerCase() : r || "", be = F ? "" : d || "";
|
|
1127
|
+
function pe(C) {
|
|
1128
1128
|
u(C), S("");
|
|
1129
1129
|
}
|
|
1130
1130
|
function U(C) {
|
|
@@ -1133,7 +1133,7 @@ function xa(s, n) {
|
|
|
1133
1133
|
function ne(C) {
|
|
1134
1134
|
f(C);
|
|
1135
1135
|
}
|
|
1136
|
-
|
|
1136
|
+
L && ((ve = L == null ? void 0 : L.databases) == null ? void 0 : ve.length) > 0, D && ((Qe = D == null ? void 0 : D.schemas) == null ? void 0 : Qe.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((C) => ({
|
|
1137
1137
|
...C,
|
|
1138
1138
|
data_type: C.data_type.toLowerCase()
|
|
1139
1139
|
}))), $ && (a = []), (ge || N) && (a = []);
|
|
@@ -1143,31 +1143,31 @@ function xa(s, n) {
|
|
|
1143
1143
|
name: C.name,
|
|
1144
1144
|
type: C.type
|
|
1145
1145
|
})
|
|
1146
|
-
), ye =
|
|
1146
|
+
), ye = L == null ? void 0 : L.databases.map((C) => ({
|
|
1147
1147
|
id: C.database_name,
|
|
1148
1148
|
name: C.database_name
|
|
1149
1149
|
})), le = D == null ? void 0 : D.schemas.map((C) => ({
|
|
1150
1150
|
id: C.schema_name,
|
|
1151
1151
|
name: C.schema_name
|
|
1152
|
-
})),
|
|
1152
|
+
})), Ve = J == null ? void 0 : J.tables.map((C) => ({
|
|
1153
1153
|
id: C.table_name,
|
|
1154
1154
|
name: C.table_name
|
|
1155
1155
|
}));
|
|
1156
1156
|
return {
|
|
1157
1157
|
connectionItems: re,
|
|
1158
|
-
isConnectionsLoading:
|
|
1158
|
+
isConnectionsLoading: E,
|
|
1159
1159
|
isConnectionsError: N,
|
|
1160
1160
|
databaseItems: ye,
|
|
1161
|
-
isDatabasesLoadingOrFetching:
|
|
1161
|
+
isDatabasesLoadingOrFetching: V || K,
|
|
1162
1162
|
isDatabaseError: $,
|
|
1163
1163
|
schemaItems: le,
|
|
1164
1164
|
isSchemaLoadingOrFetching: te || Q,
|
|
1165
1165
|
isSchemaError: ee,
|
|
1166
|
-
tableItems:
|
|
1166
|
+
tableItems: Ve,
|
|
1167
1167
|
isTableLoadingOrFetching: I || y,
|
|
1168
1168
|
isTableError: v,
|
|
1169
1169
|
columns: a,
|
|
1170
|
-
isColumnsLoadingOrFetching:
|
|
1170
|
+
isColumnsLoadingOrFetching: xe || se,
|
|
1171
1171
|
isColumnsError: ge,
|
|
1172
1172
|
isNonDbConnection: F,
|
|
1173
1173
|
connectionType: j,
|
|
@@ -1175,10 +1175,10 @@ function xa(s, n) {
|
|
|
1175
1175
|
schemaName: be,
|
|
1176
1176
|
handleConnectionChange: ne,
|
|
1177
1177
|
handleDatabaseChange: U,
|
|
1178
|
-
handleSchemaChange:
|
|
1178
|
+
handleSchemaChange: pe
|
|
1179
1179
|
};
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function fa({
|
|
1182
1182
|
ColumnsComponent: s
|
|
1183
1183
|
}) {
|
|
1184
1184
|
var J;
|
|
@@ -1188,12 +1188,12 @@ function pa({
|
|
|
1188
1188
|
(I) => I.selectedDatabaseName
|
|
1189
1189
|
), t = i(
|
|
1190
1190
|
(I) => I.selectedSchemaName
|
|
1191
|
-
),
|
|
1191
|
+
), l = i((I) => I.selectedTableName), o = i(
|
|
1192
1192
|
(I) => I.actions.setSelectedTableName
|
|
1193
1193
|
), {
|
|
1194
|
-
connectionItems:
|
|
1195
|
-
schemaItems:
|
|
1196
|
-
databaseItems:
|
|
1194
|
+
connectionItems: d,
|
|
1195
|
+
schemaItems: r,
|
|
1196
|
+
databaseItems: c,
|
|
1197
1197
|
tableItems: f,
|
|
1198
1198
|
columns: m,
|
|
1199
1199
|
isConnectionsLoading: u,
|
|
@@ -1203,25 +1203,25 @@ function pa({
|
|
|
1203
1203
|
isSchemaLoadingOrFetching: g,
|
|
1204
1204
|
isSchemaError: z,
|
|
1205
1205
|
isColumnsError: b,
|
|
1206
|
-
isColumnsLoadingOrFetching:
|
|
1206
|
+
isColumnsLoadingOrFetching: E,
|
|
1207
1207
|
isTableLoadingOrFetching: N,
|
|
1208
1208
|
isTableError: O,
|
|
1209
1209
|
connectionType: j,
|
|
1210
1210
|
isNonDbConnection: F,
|
|
1211
|
-
handleConnectionChange:
|
|
1212
|
-
handleDatabaseChange:
|
|
1211
|
+
handleConnectionChange: L,
|
|
1212
|
+
handleDatabaseChange: V,
|
|
1213
1213
|
handleSchemaChange: K,
|
|
1214
1214
|
tableName: $,
|
|
1215
1215
|
schemaName: G
|
|
1216
|
-
} =
|
|
1216
|
+
} = pa();
|
|
1217
1217
|
function D() {
|
|
1218
1218
|
return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
|
|
1219
|
-
|
|
1219
|
+
kn,
|
|
1220
1220
|
{
|
|
1221
1221
|
schemaName: G,
|
|
1222
1222
|
tableName: $,
|
|
1223
1223
|
columns: m,
|
|
1224
|
-
status:
|
|
1224
|
+
status: E ? "Loading..." : b ? "Error" : "Success"
|
|
1225
1225
|
}
|
|
1226
1226
|
);
|
|
1227
1227
|
}
|
|
@@ -1230,12 +1230,12 @@ function pa({
|
|
|
1230
1230
|
}
|
|
1231
1231
|
function Q() {
|
|
1232
1232
|
return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1233
|
-
|
|
1233
|
+
We,
|
|
1234
1234
|
{
|
|
1235
|
-
onChange:
|
|
1235
|
+
onChange: V,
|
|
1236
1236
|
isError: x,
|
|
1237
1237
|
isLoading: h,
|
|
1238
|
-
items:
|
|
1238
|
+
items: c,
|
|
1239
1239
|
value: a || "",
|
|
1240
1240
|
title: "Database"
|
|
1241
1241
|
}
|
|
@@ -1243,12 +1243,12 @@ function pa({
|
|
|
1243
1243
|
}
|
|
1244
1244
|
function ee() {
|
|
1245
1245
|
return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1246
|
-
|
|
1246
|
+
We,
|
|
1247
1247
|
{
|
|
1248
1248
|
onChange: K,
|
|
1249
1249
|
isError: z,
|
|
1250
1250
|
isLoading: g,
|
|
1251
|
-
items:
|
|
1251
|
+
items: r,
|
|
1252
1252
|
value: t || "",
|
|
1253
1253
|
title: "Schema"
|
|
1254
1254
|
}
|
|
@@ -1256,13 +1256,13 @@ function pa({
|
|
|
1256
1256
|
}
|
|
1257
1257
|
function Z() {
|
|
1258
1258
|
return j === "API" ? null : /* @__PURE__ */ e.jsx(
|
|
1259
|
-
|
|
1259
|
+
We,
|
|
1260
1260
|
{
|
|
1261
|
-
onChange:
|
|
1261
|
+
onChange: o,
|
|
1262
1262
|
isError: O,
|
|
1263
1263
|
items: f,
|
|
1264
1264
|
isLoading: N,
|
|
1265
|
-
value:
|
|
1265
|
+
value: l || "",
|
|
1266
1266
|
title: "Table"
|
|
1267
1267
|
}
|
|
1268
1268
|
);
|
|
@@ -1270,15 +1270,15 @@ function pa({
|
|
|
1270
1270
|
return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
|
|
1271
1271
|
/* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
|
|
1272
1272
|
/* @__PURE__ */ e.jsx(
|
|
1273
|
-
|
|
1273
|
+
We,
|
|
1274
1274
|
{
|
|
1275
|
-
items:
|
|
1275
|
+
items: d,
|
|
1276
1276
|
title: "Connection",
|
|
1277
1277
|
value: n || "",
|
|
1278
|
-
onChange:
|
|
1278
|
+
onChange: L,
|
|
1279
1279
|
isLoading: u,
|
|
1280
1280
|
isError: S,
|
|
1281
|
-
connectionTooltip: ((J =
|
|
1281
|
+
connectionTooltip: ((J = d == null ? void 0 : d.find(
|
|
1282
1282
|
(I) => I.id === n
|
|
1283
1283
|
)) == null ? void 0 : J.type) || ""
|
|
1284
1284
|
}
|
|
@@ -1289,47 +1289,47 @@ function pa({
|
|
|
1289
1289
|
] }),
|
|
1290
1290
|
D(),
|
|
1291
1291
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
1292
|
-
|
|
1292
|
+
k,
|
|
1293
1293
|
{
|
|
1294
1294
|
onClick: te,
|
|
1295
1295
|
size: "sm",
|
|
1296
1296
|
variant: "secondary",
|
|
1297
1297
|
className: "w-full",
|
|
1298
1298
|
children: [
|
|
1299
|
-
/* @__PURE__ */ e.jsx(
|
|
1299
|
+
/* @__PURE__ */ e.jsx(cn, { className: "mr-2 size-4" }),
|
|
1300
1300
|
"Help"
|
|
1301
1301
|
]
|
|
1302
1302
|
}
|
|
1303
1303
|
) })
|
|
1304
1304
|
] });
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1307
|
-
const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"),
|
|
1308
|
-
let
|
|
1309
|
-
if (
|
|
1310
|
-
const
|
|
1311
|
-
return `${
|
|
1306
|
+
function wn(s) {
|
|
1307
|
+
const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1308
|
+
let o = s.length;
|
|
1309
|
+
if (l !== -1 && (o = l), t !== -1 && t < o && (o = t), n !== -1) {
|
|
1310
|
+
const d = s.substring(0, n), r = s.substring(n);
|
|
1311
|
+
return `${d} {{ filters | where }} AND ${r.substring(
|
|
1312
1312
|
6
|
|
1313
1313
|
)}`;
|
|
1314
1314
|
} else if (a !== -1) {
|
|
1315
|
-
const
|
|
1316
|
-
return `${
|
|
1315
|
+
const d = s.substring(0, a), r = s.substring(a);
|
|
1316
|
+
return `${d} {{ filters | where }} ${r}`;
|
|
1317
1317
|
} else {
|
|
1318
|
-
const
|
|
1319
|
-
return `${
|
|
1318
|
+
const d = s.substring(0, o), r = s.substring(o);
|
|
1319
|
+
return `${d} {{ filters | where }} ${r}`;
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function zn({
|
|
1323
1323
|
error: s,
|
|
1324
1324
|
setShowAIDialog: n,
|
|
1325
1325
|
setUserInputforAI: a,
|
|
1326
1326
|
setTriggerAIRun: t
|
|
1327
1327
|
}) {
|
|
1328
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1329
|
-
/* @__PURE__ */ e.jsx(
|
|
1330
|
-
/* @__PURE__ */ e.jsx(
|
|
1328
|
+
return /* @__PURE__ */ e.jsxs(sa, { openDelay: 0, children: [
|
|
1329
|
+
/* @__PURE__ */ e.jsx(aa, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1330
|
+
/* @__PURE__ */ e.jsx(ta, { 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: [
|
|
1331
1331
|
/* @__PURE__ */ e.jsxs(
|
|
1332
|
-
|
|
1332
|
+
k,
|
|
1333
1333
|
{
|
|
1334
1334
|
onClick: () => {
|
|
1335
1335
|
n(!0), a(s), t(!0);
|
|
@@ -1337,7 +1337,7 @@ function kn({
|
|
|
1337
1337
|
size: "sm",
|
|
1338
1338
|
variant: "outline",
|
|
1339
1339
|
children: [
|
|
1340
|
-
/* @__PURE__ */ e.jsx(
|
|
1340
|
+
/* @__PURE__ */ e.jsx(an, { className: "h-4 w-4 mr-2" }),
|
|
1341
1341
|
"Fix It"
|
|
1342
1342
|
]
|
|
1343
1343
|
}
|
|
@@ -1346,51 +1346,51 @@ function kn({
|
|
|
1346
1346
|
] }) }) })
|
|
1347
1347
|
] });
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function Fn({
|
|
1350
1350
|
text: s,
|
|
1351
1351
|
onCheckedChange: n,
|
|
1352
1352
|
checked: a
|
|
1353
1353
|
}) {
|
|
1354
1354
|
return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
|
|
1355
|
-
/* @__PURE__ */ e.jsx(
|
|
1355
|
+
/* @__PURE__ */ e.jsx(Ke, { checked: a, onCheckedChange: n }),
|
|
1356
1356
|
/* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
|
|
1357
1357
|
] });
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1360
|
-
const { authToken: s } =
|
|
1359
|
+
function On() {
|
|
1360
|
+
const { authToken: s } = ss(), n = Pe(null), a = i((r) => r.applyFilters), [t, l] = T(""), o = i((r) => r.filterValues), d = i((r) => r.card.sql);
|
|
1361
1361
|
return /* @__PURE__ */ e.jsxs(
|
|
1362
|
-
|
|
1362
|
+
sa,
|
|
1363
1363
|
{
|
|
1364
1364
|
openDelay: 0,
|
|
1365
|
-
onOpenChange: async (
|
|
1366
|
-
if (!
|
|
1365
|
+
onOpenChange: async (r) => {
|
|
1366
|
+
if (!r)
|
|
1367
1367
|
return;
|
|
1368
1368
|
console.log("onOpenChange");
|
|
1369
|
-
const
|
|
1369
|
+
const c = await na(
|
|
1370
1370
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1371
1371
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1372
1372
|
{
|
|
1373
|
-
sql:
|
|
1374
|
-
active_filters:
|
|
1373
|
+
sql: d,
|
|
1374
|
+
active_filters: o
|
|
1375
1375
|
}
|
|
1376
1376
|
);
|
|
1377
|
-
console.log(
|
|
1377
|
+
console.log(c), c.sql ? (console.log(c.records), l(c.sql)) : l("Error");
|
|
1378
1378
|
},
|
|
1379
1379
|
children: [
|
|
1380
|
-
/* @__PURE__ */ e.jsx(
|
|
1381
|
-
/* @__PURE__ */ e.jsxs(
|
|
1380
|
+
/* @__PURE__ */ e.jsx(aa, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
1381
|
+
/* @__PURE__ */ e.jsxs(ta, { align: "end", className: "w-[600px]", children: [
|
|
1382
1382
|
/* @__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: [
|
|
1383
1383
|
t,
|
|
1384
1384
|
/* @__PURE__ */ e.jsx(
|
|
1385
|
-
|
|
1385
|
+
ra,
|
|
1386
1386
|
{
|
|
1387
|
-
onClick: () =>
|
|
1387
|
+
onClick: () => Za(n),
|
|
1388
1388
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1389
1389
|
}
|
|
1390
1390
|
)
|
|
1391
1391
|
] }) }) }),
|
|
1392
1392
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
1393
|
-
/* @__PURE__ */ e.jsx(
|
|
1393
|
+
/* @__PURE__ */ e.jsx(et, { className: "h-4 w-4 opacity-70" }),
|
|
1394
1394
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
|
|
1395
1395
|
] })
|
|
1396
1396
|
] })
|
|
@@ -1398,7 +1398,7 @@ function zn() {
|
|
|
1398
1398
|
}
|
|
1399
1399
|
);
|
|
1400
1400
|
}
|
|
1401
|
-
const
|
|
1401
|
+
const Mn = `
|
|
1402
1402
|
|
|
1403
1403
|
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.
|
|
1404
1404
|
|
|
@@ -1445,27 +1445,27 @@ SELECT label, measure FROM table
|
|
|
1445
1445
|
- Label - Category
|
|
1446
1446
|
- Measure - Number
|
|
1447
1447
|
`;
|
|
1448
|
-
function
|
|
1448
|
+
function Tn({
|
|
1449
1449
|
open: s,
|
|
1450
1450
|
setOpen: n,
|
|
1451
1451
|
userInput: a,
|
|
1452
1452
|
setUserInput: t,
|
|
1453
|
-
triggerAIRun:
|
|
1454
|
-
setTriggerAIRun:
|
|
1453
|
+
triggerAIRun: l,
|
|
1454
|
+
setTriggerAIRun: o
|
|
1455
1455
|
}) {
|
|
1456
|
-
const
|
|
1456
|
+
const d = Pe(null), r = Pe(null), { authToken: c } = ss(), [f, m] = T(!1), u = i((y) => y.actions.setCardSql), S = w((y) => y.dashboard.baseQueries), h = i((y) => y.actions.setRunSql), x = i((y) => y.actions.setCardType), [g, z] = T([]), b = i((y) => y.currentColumns), E = i((y) => y.card.sql), N = i((y) => y.selectedTableName), O = `
|
|
1457
1457
|
${a}
|
|
1458
1458
|
|
|
1459
1459
|
Database Query Dialect: ${N === "api" || N === "s3" ? "DuckDb" : ""}
|
|
1460
1460
|
Table Name: ${N}
|
|
1461
1461
|
Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
|
|
1462
|
-
User SQL: ${
|
|
1462
|
+
User SQL: ${E}
|
|
1463
1463
|
${S && `Base Queries: ${JSON.stringify(S)} `}`, j = ` 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.
|
|
1464
|
-
Visual Query Syntax: ${
|
|
1464
|
+
Visual Query Syntax: ${Mn}`, { data: F, isLoading: L, isFetching: V, isError: K, refetch: $ } = Ce({
|
|
1465
1465
|
queryKey: ["ai-query"],
|
|
1466
1466
|
queryFn: () => ze(
|
|
1467
1467
|
"https://semaphor.cloud/api/v1/ai",
|
|
1468
|
-
(
|
|
1468
|
+
(c == null ? void 0 : c.accessToken) || "",
|
|
1469
1469
|
{
|
|
1470
1470
|
user_content: `userContent: ${O} ${f ? j : ""}`
|
|
1471
1471
|
}
|
|
@@ -1499,10 +1499,10 @@ function On({
|
|
|
1499
1499
|
}, [F]), P(() => {
|
|
1500
1500
|
const y = setTimeout(() => {
|
|
1501
1501
|
var v;
|
|
1502
|
-
|
|
1503
|
-
top:
|
|
1502
|
+
r.current && (r.current.scroll({
|
|
1503
|
+
top: r.current.scrollHeight,
|
|
1504
1504
|
behavior: "smooth"
|
|
1505
|
-
}), (v =
|
|
1505
|
+
}), (v = d.current) == null || v.focus());
|
|
1506
1506
|
}, 100);
|
|
1507
1507
|
return () => clearTimeout(y);
|
|
1508
1508
|
}, [g]);
|
|
@@ -1510,8 +1510,8 @@ function On({
|
|
|
1510
1510
|
a && (z((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
|
|
1511
1511
|
}
|
|
1512
1512
|
P(() => {
|
|
1513
|
-
|
|
1514
|
-
}, [
|
|
1513
|
+
l && (D(), o(!1));
|
|
1514
|
+
}, [l, o]);
|
|
1515
1515
|
const te = {
|
|
1516
1516
|
//seleect a darker color
|
|
1517
1517
|
// color: '#000',
|
|
@@ -1544,9 +1544,9 @@ function On({
|
|
|
1544
1544
|
pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
|
|
1545
1545
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
|
|
1546
1546
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1547
|
-
/* @__PURE__ */ e.jsx(
|
|
1547
|
+
/* @__PURE__ */ e.jsx(k, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ra, {}) }),
|
|
1548
1548
|
/* @__PURE__ */ e.jsx(
|
|
1549
|
-
|
|
1549
|
+
k,
|
|
1550
1550
|
{
|
|
1551
1551
|
onClick: (M) => {
|
|
1552
1552
|
const H = J(M);
|
|
@@ -1554,7 +1554,7 @@ function On({
|
|
|
1554
1554
|
},
|
|
1555
1555
|
size: "sm",
|
|
1556
1556
|
variant: "outline",
|
|
1557
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1557
|
+
children: /* @__PURE__ */ e.jsx(tt, {})
|
|
1558
1558
|
}
|
|
1559
1559
|
)
|
|
1560
1560
|
] })
|
|
@@ -1575,13 +1575,13 @@ function On({
|
|
|
1575
1575
|
{
|
|
1576
1576
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1577
1577
|
children: [
|
|
1578
|
-
/* @__PURE__ */ e.jsx(
|
|
1578
|
+
/* @__PURE__ */ e.jsx(bn, { className: "mr-2 h-5 w-5" }),
|
|
1579
1579
|
/* @__PURE__ */ e.jsx("div", { children: y.content })
|
|
1580
1580
|
]
|
|
1581
1581
|
},
|
|
1582
1582
|
v
|
|
1583
1583
|
) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1584
|
-
|
|
1584
|
+
at,
|
|
1585
1585
|
{
|
|
1586
1586
|
className: "w-full overflow-auto py-1",
|
|
1587
1587
|
components: Z,
|
|
@@ -1592,7 +1592,7 @@ function On({
|
|
|
1592
1592
|
}
|
|
1593
1593
|
return /* @__PURE__ */ e.jsxs(ps, { open: s, onOpenChange: n, children: [
|
|
1594
1594
|
/* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1595
|
-
|
|
1595
|
+
k,
|
|
1596
1596
|
{
|
|
1597
1597
|
size: "sm",
|
|
1598
1598
|
className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
@@ -1612,7 +1612,7 @@ function On({
|
|
|
1612
1612
|
/* @__PURE__ */ e.jsx(
|
|
1613
1613
|
"div",
|
|
1614
1614
|
{
|
|
1615
|
-
ref:
|
|
1615
|
+
ref: r,
|
|
1616
1616
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
1617
1617
|
children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: I() })
|
|
1618
1618
|
}
|
|
@@ -1622,10 +1622,10 @@ function On({
|
|
|
1622
1622
|
{
|
|
1623
1623
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
|
|
1624
1624
|
/* @__PURE__ */ e.jsx(
|
|
1625
|
-
|
|
1625
|
+
la,
|
|
1626
1626
|
{
|
|
1627
1627
|
autoFocus: !0,
|
|
1628
|
-
ref:
|
|
1628
|
+
ref: d,
|
|
1629
1629
|
onKeyDown: (y) => {
|
|
1630
1630
|
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), t(""), D());
|
|
1631
1631
|
},
|
|
@@ -1637,20 +1637,20 @@ function On({
|
|
|
1637
1637
|
className: Y(
|
|
1638
1638
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1639
1639
|
),
|
|
1640
|
-
disabled:
|
|
1640
|
+
disabled: L || V,
|
|
1641
1641
|
value: a,
|
|
1642
1642
|
onChange: (y) => t(y.target.value)
|
|
1643
1643
|
}
|
|
1644
1644
|
),
|
|
1645
1645
|
" ",
|
|
1646
1646
|
/* @__PURE__ */ e.jsx(
|
|
1647
|
-
|
|
1647
|
+
k,
|
|
1648
1648
|
{
|
|
1649
1649
|
className: "h-8",
|
|
1650
1650
|
size: "sm",
|
|
1651
1651
|
variant: "ghost",
|
|
1652
1652
|
onClick: D,
|
|
1653
|
-
children: !
|
|
1653
|
+
children: !L && !V ? /* @__PURE__ */ e.jsx(st, {}) : /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1654
1654
|
}
|
|
1655
1655
|
)
|
|
1656
1656
|
] })
|
|
@@ -1661,71 +1661,71 @@ function On({
|
|
|
1661
1661
|
)
|
|
1662
1662
|
] });
|
|
1663
1663
|
}
|
|
1664
|
-
var
|
|
1664
|
+
var ga = {
|
|
1665
1665
|
color: void 0,
|
|
1666
1666
|
size: void 0,
|
|
1667
1667
|
className: void 0,
|
|
1668
1668
|
style: void 0,
|
|
1669
1669
|
attr: void 0
|
|
1670
|
-
},
|
|
1671
|
-
function
|
|
1670
|
+
}, $s = me.createContext && /* @__PURE__ */ me.createContext(ga), Ln = ["attr", "size", "title"];
|
|
1671
|
+
function An(s, n) {
|
|
1672
1672
|
if (s == null)
|
|
1673
1673
|
return {};
|
|
1674
|
-
var a =
|
|
1674
|
+
var a = En(s, n), t, l;
|
|
1675
1675
|
if (Object.getOwnPropertySymbols) {
|
|
1676
|
-
var
|
|
1677
|
-
for (
|
|
1678
|
-
t =
|
|
1676
|
+
var o = Object.getOwnPropertySymbols(s);
|
|
1677
|
+
for (l = 0; l < o.length; l++)
|
|
1678
|
+
t = o[l], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
|
|
1679
1679
|
}
|
|
1680
1680
|
return a;
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function En(s, n) {
|
|
1683
1683
|
if (s == null)
|
|
1684
1684
|
return {};
|
|
1685
|
-
var a = {}, t = Object.keys(s),
|
|
1686
|
-
for (
|
|
1687
|
-
|
|
1685
|
+
var a = {}, t = Object.keys(s), l, o;
|
|
1686
|
+
for (o = 0; o < t.length; o++)
|
|
1687
|
+
l = t[o], !(n.indexOf(l) >= 0) && (a[l] = s[l]);
|
|
1688
1688
|
return a;
|
|
1689
1689
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return
|
|
1690
|
+
function Ze() {
|
|
1691
|
+
return Ze = Object.assign ? Object.assign.bind() : function(s) {
|
|
1692
1692
|
for (var n = 1; n < arguments.length; n++) {
|
|
1693
1693
|
var a = arguments[n];
|
|
1694
1694
|
for (var t in a)
|
|
1695
1695
|
Object.prototype.hasOwnProperty.call(a, t) && (s[t] = a[t]);
|
|
1696
1696
|
}
|
|
1697
1697
|
return s;
|
|
1698
|
-
},
|
|
1698
|
+
}, Ze.apply(this, arguments);
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1700
|
+
function Ps(s, n) {
|
|
1701
1701
|
var a = Object.keys(s);
|
|
1702
1702
|
if (Object.getOwnPropertySymbols) {
|
|
1703
1703
|
var t = Object.getOwnPropertySymbols(s);
|
|
1704
|
-
n && (t = t.filter(function(
|
|
1705
|
-
return Object.getOwnPropertyDescriptor(s,
|
|
1704
|
+
n && (t = t.filter(function(l) {
|
|
1705
|
+
return Object.getOwnPropertyDescriptor(s, l).enumerable;
|
|
1706
1706
|
})), a.push.apply(a, t);
|
|
1707
1707
|
}
|
|
1708
1708
|
return a;
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1710
|
+
function es(s) {
|
|
1711
1711
|
for (var n = 1; n < arguments.length; n++) {
|
|
1712
1712
|
var a = arguments[n] != null ? arguments[n] : {};
|
|
1713
|
-
n % 2 ?
|
|
1714
|
-
|
|
1715
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) :
|
|
1713
|
+
n % 2 ? Ps(Object(a), !0).forEach(function(t) {
|
|
1714
|
+
Dn(s, t, a[t]);
|
|
1715
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Ps(Object(a)).forEach(function(t) {
|
|
1716
1716
|
Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
|
|
1717
1717
|
});
|
|
1718
1718
|
}
|
|
1719
1719
|
return s;
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1722
|
-
return n =
|
|
1721
|
+
function Dn(s, n, a) {
|
|
1722
|
+
return n = In(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1725
|
-
var n =
|
|
1724
|
+
function In(s) {
|
|
1725
|
+
var n = Vn(s, "string");
|
|
1726
1726
|
return typeof n == "symbol" ? n : String(n);
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function Vn(s, n) {
|
|
1729
1729
|
if (typeof s != "object" || s === null)
|
|
1730
1730
|
return s;
|
|
1731
1731
|
var a = s[Symbol.toPrimitive];
|
|
@@ -1737,56 +1737,56 @@ function Dn(s, n) {
|
|
|
1737
1737
|
}
|
|
1738
1738
|
return (n === "string" ? String : Number)(s);
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1741
|
-
return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag,
|
|
1740
|
+
function ja(s) {
|
|
1741
|
+
return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, es({
|
|
1742
1742
|
key: a
|
|
1743
|
-
}, n.attr),
|
|
1743
|
+
}, n.attr), ja(n.child)));
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return (n) => /* @__PURE__ */ me.createElement(
|
|
1747
|
-
attr:
|
|
1748
|
-
}, n),
|
|
1745
|
+
function ue(s) {
|
|
1746
|
+
return (n) => /* @__PURE__ */ me.createElement(qn, Ze({
|
|
1747
|
+
attr: es({}, s.attr)
|
|
1748
|
+
}, n), ja(s.child));
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function qn(s) {
|
|
1751
1751
|
var n = (a) => {
|
|
1752
1752
|
var {
|
|
1753
1753
|
attr: t,
|
|
1754
|
-
size:
|
|
1755
|
-
title:
|
|
1756
|
-
} = s,
|
|
1757
|
-
return a.className && (
|
|
1754
|
+
size: l,
|
|
1755
|
+
title: o
|
|
1756
|
+
} = s, d = An(s, Ln), r = l || a.size || "1em", c;
|
|
1757
|
+
return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Ze({
|
|
1758
1758
|
stroke: "currentColor",
|
|
1759
1759
|
fill: "currentColor",
|
|
1760
1760
|
strokeWidth: "0"
|
|
1761
|
-
}, a.attr, t,
|
|
1762
|
-
className:
|
|
1763
|
-
style:
|
|
1761
|
+
}, a.attr, t, d, {
|
|
1762
|
+
className: c,
|
|
1763
|
+
style: es(es({
|
|
1764
1764
|
color: s.color || a.color
|
|
1765
1765
|
}, a.style), s.style),
|
|
1766
|
-
height:
|
|
1767
|
-
width:
|
|
1766
|
+
height: r,
|
|
1767
|
+
width: r,
|
|
1768
1768
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1769
|
-
}),
|
|
1769
|
+
}), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
|
|
1770
1770
|
};
|
|
1771
|
-
return
|
|
1771
|
+
return $s !== void 0 ? /* @__PURE__ */ me.createElement($s.Consumer, null, (a) => n(a)) : n(ga);
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1774
|
-
return
|
|
1773
|
+
function Rn(s) {
|
|
1774
|
+
return ue({ 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);
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1777
|
-
const { theme: s } =
|
|
1778
|
-
|
|
1779
|
-
const x =
|
|
1776
|
+
function _n() {
|
|
1777
|
+
const { theme: s } = nt(), n = Pe(), a = Pe(), [t, l] = T(!1), [o, d] = T(!1), [r, c] = T(!1), [f, m] = T(""), [u, S] = T(!1), { authToken: h } = ss();
|
|
1778
|
+
w((p) => p.selectedSheetId);
|
|
1779
|
+
const x = w((p) => p.dashboard.baseQueries), g = i((p) => p.card), z = w((p) => p.theme), b = i((p) => p.isShowingVisual), E = i(
|
|
1780
1780
|
(p) => p.selectedConnectionId
|
|
1781
1781
|
), N = i(
|
|
1782
1782
|
(p) => p.selectedDatabaseName
|
|
1783
1783
|
), O = i(
|
|
1784
1784
|
(p) => p.selectedSchemaName
|
|
1785
1785
|
);
|
|
1786
|
-
|
|
1786
|
+
w(
|
|
1787
1787
|
(p) => p.actions.updateFrameCard
|
|
1788
1788
|
);
|
|
1789
|
-
const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql),
|
|
1789
|
+
const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql), L = i((p) => p.card.python), V = rt(F, x), K = i((p) => p.selectedConnectionId), $ = i((p) => p.frame), G = i((p) => p.filterValues), D = i((p) => p.applyFilters), {
|
|
1790
1790
|
setCardCustomCfg: te,
|
|
1791
1791
|
setQueryResultColumns: Q,
|
|
1792
1792
|
setFilterValues: ee,
|
|
@@ -1797,7 +1797,7 @@ function Vn() {
|
|
|
1797
1797
|
setCardPreferences: v
|
|
1798
1798
|
} = i((p) => p.actions), M = i((p) => p.onSave), H = i(
|
|
1799
1799
|
(p) => p.actions.setApplyFilters
|
|
1800
|
-
),
|
|
1800
|
+
), xe = i((p) => p.onClose), se = i((p) => p.actions.setCardData), ge = i((p) => p.actions.setSqlGen), je = i((p) => p.runSql), be = i((p) => p.actions.setRunSql), pe = i(
|
|
1801
1801
|
(p) => p.actions.setIsSqlRunning
|
|
1802
1802
|
), {
|
|
1803
1803
|
data: U,
|
|
@@ -1805,18 +1805,18 @@ function Vn() {
|
|
|
1805
1805
|
isFetching: re,
|
|
1806
1806
|
isSuccess: ye,
|
|
1807
1807
|
isError: le,
|
|
1808
|
-
error:
|
|
1809
|
-
status:
|
|
1808
|
+
error: Ve,
|
|
1809
|
+
status: ts,
|
|
1810
1810
|
refetch: ve
|
|
1811
1811
|
} = Ce({
|
|
1812
|
-
queryKey: [
|
|
1813
|
-
queryFn: () =>
|
|
1812
|
+
queryKey: [V, L],
|
|
1813
|
+
queryFn: () => na(
|
|
1814
1814
|
"https://semaphor.cloud/api/v1/query",
|
|
1815
1815
|
(h == null ? void 0 : h.accessToken) || "",
|
|
1816
1816
|
{
|
|
1817
1817
|
connection_id: K,
|
|
1818
|
-
sql:
|
|
1819
|
-
python:
|
|
1818
|
+
sql: V,
|
|
1819
|
+
python: L === Is ? "" : L,
|
|
1820
1820
|
active_filters: D ? G : []
|
|
1821
1821
|
}
|
|
1822
1822
|
),
|
|
@@ -1834,7 +1834,7 @@ function Vn() {
|
|
|
1834
1834
|
}, [U, se, Q, y]), P(() => {
|
|
1835
1835
|
je && (ve(), be(!1));
|
|
1836
1836
|
}, [je, ve, be]), P(() => {
|
|
1837
|
-
(ne || re) &&
|
|
1837
|
+
(ne || re) && pe(!0), (le || ye) && pe(!1), le ? (I(Ve.message), se([]), Q([]), y("")) : I("");
|
|
1838
1838
|
}, [
|
|
1839
1839
|
ne,
|
|
1840
1840
|
re,
|
|
@@ -1842,13 +1842,13 @@ function Vn() {
|
|
|
1842
1842
|
y,
|
|
1843
1843
|
le,
|
|
1844
1844
|
ye,
|
|
1845
|
-
|
|
1845
|
+
pe,
|
|
1846
1846
|
se,
|
|
1847
1847
|
Q,
|
|
1848
1848
|
I,
|
|
1849
|
-
|
|
1849
|
+
Ve
|
|
1850
1850
|
]);
|
|
1851
|
-
function
|
|
1851
|
+
function Qe() {
|
|
1852
1852
|
Z(""), se([]), ge({}), te(""), v({});
|
|
1853
1853
|
}
|
|
1854
1854
|
const qe = (p) => {
|
|
@@ -1856,47 +1856,47 @@ function Vn() {
|
|
|
1856
1856
|
};
|
|
1857
1857
|
function C() {
|
|
1858
1858
|
let p = F;
|
|
1859
|
-
F && !F.includes("{{") && (p =
|
|
1859
|
+
F && !F.includes("{{") && (p = wn(F), Z(p));
|
|
1860
1860
|
const ie = {
|
|
1861
1861
|
...g,
|
|
1862
1862
|
lastSelectedSchema: O,
|
|
1863
1863
|
lastSelectedDatabase: N,
|
|
1864
1864
|
lastSelectedTable: j,
|
|
1865
|
-
connectionId:
|
|
1865
|
+
connectionId: E,
|
|
1866
1866
|
type: b ? g.type : "table",
|
|
1867
1867
|
sql: p,
|
|
1868
1868
|
customCfg: b ? g.customCfg : null
|
|
1869
|
-
},
|
|
1869
|
+
}, Re = $.cards.map(
|
|
1870
1870
|
(Ne) => Ne.id === g.id ? ie : Ne
|
|
1871
1871
|
);
|
|
1872
1872
|
M == null || M({
|
|
1873
1873
|
...$,
|
|
1874
|
-
cards:
|
|
1874
|
+
cards: Re
|
|
1875
1875
|
});
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1878
|
-
|
|
1877
|
+
function Ma() {
|
|
1878
|
+
xe == null || xe();
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1880
|
+
function Ta(p) {
|
|
1881
1881
|
const ie = getComputedStyle(
|
|
1882
1882
|
document.documentElement
|
|
1883
1883
|
).getPropertyValue(p);
|
|
1884
|
-
return
|
|
1884
|
+
return La(ie);
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1887
|
-
const [ie,
|
|
1886
|
+
function La(p) {
|
|
1887
|
+
const [ie, Re, Ne] = p.split(" "), W = parseFloat(ie), Da = parseFloat(Re), Ia = parseFloat(Ne), Va = Da / 100, As = Ia / 100, fe = (1 - Math.abs(2 * As - 1)) * Va, ke = fe * (1 - Math.abs(W / 60 % 2 - 1)), ns = As - fe / 2;
|
|
1888
1888
|
let oe = 0, ce = 0, de = 0;
|
|
1889
|
-
0 <= W && W < 60 ? (oe =
|
|
1890
|
-
const
|
|
1891
|
-
const
|
|
1892
|
-
return
|
|
1889
|
+
0 <= W && W < 60 ? (oe = fe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = fe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = fe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = fe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = fe) : 300 <= W && W < 360 && (oe = fe, ce = 0, de = ke), oe = Math.round((oe + ns) * 255), ce = Math.round((ce + ns) * 255), de = Math.round((de + ns) * 255);
|
|
1890
|
+
const rs = (qa) => {
|
|
1891
|
+
const ls = qa.toString(16);
|
|
1892
|
+
return ls.length == 1 ? "0" + ls : ls;
|
|
1893
1893
|
};
|
|
1894
|
-
return `#${
|
|
1894
|
+
return `#${rs(oe)}${rs(ce)}${rs(de)}`;
|
|
1895
1895
|
}
|
|
1896
1896
|
P(() => {
|
|
1897
1897
|
const p = n.current, ie = a.current;
|
|
1898
1898
|
if (p) {
|
|
1899
|
-
const
|
|
1899
|
+
const Re = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = z === "system" ? Re : z;
|
|
1900
1900
|
p.editor.defineTheme("default", {
|
|
1901
1901
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
1902
1902
|
base: Ne === "light" ? "vs" : "vs-dark",
|
|
@@ -1904,7 +1904,7 @@ function Vn() {
|
|
|
1904
1904
|
rules: [],
|
|
1905
1905
|
colors: {
|
|
1906
1906
|
// 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
|
|
1907
|
-
"editor.background": Ne === "light" ? "#ffffff" :
|
|
1907
|
+
"editor.background": Ne === "light" ? "#ffffff" : Ta("--semaphor-background")
|
|
1908
1908
|
}
|
|
1909
1909
|
}), p.editor.setTheme("default");
|
|
1910
1910
|
}
|
|
@@ -1916,12 +1916,12 @@ function Vn() {
|
|
|
1916
1916
|
), () => {
|
|
1917
1917
|
};
|
|
1918
1918
|
}, [s, z, n.current]);
|
|
1919
|
-
function
|
|
1919
|
+
function Ls(p) {
|
|
1920
1920
|
n.current = p;
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function Aa() {
|
|
1923
1923
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1924
|
-
|
|
1924
|
+
o && /* @__PURE__ */ e.jsx(
|
|
1925
1925
|
"div",
|
|
1926
1926
|
{
|
|
1927
1927
|
className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
|
|
@@ -1929,24 +1929,24 @@ function Vn() {
|
|
|
1929
1929
|
children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
|
|
1930
1930
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
1931
1931
|
/* @__PURE__ */ e.jsx(
|
|
1932
|
-
|
|
1932
|
+
Fn,
|
|
1933
1933
|
{
|
|
1934
1934
|
checked: D,
|
|
1935
1935
|
onCheckedChange: () => H(!D),
|
|
1936
1936
|
text: "Apply Filters"
|
|
1937
1937
|
}
|
|
1938
1938
|
),
|
|
1939
|
-
/* @__PURE__ */ e.jsx(
|
|
1940
|
-
G &&
|
|
1941
|
-
|
|
1939
|
+
/* @__PURE__ */ e.jsx(On, {}),
|
|
1940
|
+
G && o && /* @__PURE__ */ e.jsx(
|
|
1941
|
+
He,
|
|
1942
1942
|
{
|
|
1943
|
-
onClick: () =>
|
|
1943
|
+
onClick: () => d(!1),
|
|
1944
1944
|
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
1945
1945
|
}
|
|
1946
1946
|
)
|
|
1947
1947
|
] }),
|
|
1948
1948
|
/* @__PURE__ */ e.jsx(
|
|
1949
|
-
|
|
1949
|
+
_e,
|
|
1950
1950
|
{
|
|
1951
1951
|
theme: "default",
|
|
1952
1952
|
onChange: (p) => {
|
|
@@ -1979,10 +1979,10 @@ function Vn() {
|
|
|
1979
1979
|
] })
|
|
1980
1980
|
}
|
|
1981
1981
|
),
|
|
1982
|
-
G && !
|
|
1983
|
-
|
|
1982
|
+
G && !o && /* @__PURE__ */ e.jsx(
|
|
1983
|
+
ca,
|
|
1984
1984
|
{
|
|
1985
|
-
onClick: () =>
|
|
1985
|
+
onClick: () => d(!0),
|
|
1986
1986
|
className: Y(
|
|
1987
1987
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
1988
1988
|
{
|
|
@@ -1993,7 +1993,7 @@ function Vn() {
|
|
|
1993
1993
|
)
|
|
1994
1994
|
] });
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1996
|
+
function Ea() {
|
|
1997
1997
|
return /* @__PURE__ */ e.jsxs(
|
|
1998
1998
|
us,
|
|
1999
1999
|
{
|
|
@@ -2015,7 +2015,7 @@ function Vn() {
|
|
|
2015
2015
|
role: "sql-container",
|
|
2016
2016
|
className: "relative flex w-[99%]",
|
|
2017
2017
|
children: /* @__PURE__ */ e.jsx(
|
|
2018
|
-
|
|
2018
|
+
_e,
|
|
2019
2019
|
{
|
|
2020
2020
|
theme: "default",
|
|
2021
2021
|
className: "pt-3",
|
|
@@ -2037,7 +2037,7 @@ function Vn() {
|
|
|
2037
2037
|
},
|
|
2038
2038
|
defaultLanguage: "sql",
|
|
2039
2039
|
defaultValue: "SELECT * FROM table",
|
|
2040
|
-
beforeMount:
|
|
2040
|
+
beforeMount: Ls,
|
|
2041
2041
|
onMount: qe
|
|
2042
2042
|
}
|
|
2043
2043
|
)
|
|
@@ -2063,14 +2063,14 @@ function Vn() {
|
|
|
2063
2063
|
role: "python-container",
|
|
2064
2064
|
className: "relative flex w-[99%] pt-0",
|
|
2065
2065
|
children: /* @__PURE__ */ e.jsx(
|
|
2066
|
-
|
|
2066
|
+
_e,
|
|
2067
2067
|
{
|
|
2068
2068
|
className: "pt-3",
|
|
2069
2069
|
theme: "default",
|
|
2070
2070
|
onChange: (p) => {
|
|
2071
2071
|
J(p && p.trim() || "");
|
|
2072
2072
|
},
|
|
2073
|
-
value:
|
|
2073
|
+
value: L || Is,
|
|
2074
2074
|
options: {
|
|
2075
2075
|
minimap: {
|
|
2076
2076
|
enabled: !1
|
|
@@ -2084,7 +2084,7 @@ function Vn() {
|
|
|
2084
2084
|
renderLineHighlight: "none"
|
|
2085
2085
|
},
|
|
2086
2086
|
defaultLanguage: "python",
|
|
2087
|
-
beforeMount:
|
|
2087
|
+
beforeMount: Ls,
|
|
2088
2088
|
onMount: qe
|
|
2089
2089
|
}
|
|
2090
2090
|
)
|
|
@@ -2113,8 +2113,8 @@ function Vn() {
|
|
|
2113
2113
|
role: "sql-editor",
|
|
2114
2114
|
className: "relative flex grow justify-between overflow-y-scroll",
|
|
2115
2115
|
children: [
|
|
2116
|
-
|
|
2117
|
-
|
|
2116
|
+
Ea(),
|
|
2117
|
+
Aa()
|
|
2118
2118
|
]
|
|
2119
2119
|
}
|
|
2120
2120
|
),
|
|
@@ -2126,7 +2126,7 @@ function Vn() {
|
|
|
2126
2126
|
children: [
|
|
2127
2127
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2128
2128
|
/* @__PURE__ */ e.jsxs(
|
|
2129
|
-
|
|
2129
|
+
k,
|
|
2130
2130
|
{
|
|
2131
2131
|
title: "Shift + Enter",
|
|
2132
2132
|
disabled: ne || re,
|
|
@@ -2137,49 +2137,49 @@ function Vn() {
|
|
|
2137
2137
|
size: "sm",
|
|
2138
2138
|
variant: "outline",
|
|
2139
2139
|
children: [
|
|
2140
|
-
ne || re ? /* @__PURE__ */ e.jsx(
|
|
2140
|
+
ne || re ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(hn, { className: "mr-2 h-4 w-4" }),
|
|
2141
2141
|
"Run"
|
|
2142
2142
|
]
|
|
2143
2143
|
}
|
|
2144
2144
|
),
|
|
2145
2145
|
le && /* @__PURE__ */ e.jsx(
|
|
2146
|
-
|
|
2146
|
+
zn,
|
|
2147
2147
|
{
|
|
2148
|
-
error:
|
|
2149
|
-
setShowAIDialog:
|
|
2148
|
+
error: Ve.message,
|
|
2149
|
+
setShowAIDialog: c,
|
|
2150
2150
|
setTriggerAIRun: S,
|
|
2151
2151
|
setUserInputforAI: m
|
|
2152
2152
|
}
|
|
2153
2153
|
),
|
|
2154
2154
|
/* @__PURE__ */ e.jsxs(
|
|
2155
|
-
|
|
2155
|
+
k,
|
|
2156
2156
|
{
|
|
2157
|
-
onClick:
|
|
2157
|
+
onClick: Qe,
|
|
2158
2158
|
className: "",
|
|
2159
2159
|
size: "sm",
|
|
2160
2160
|
variant: "outline",
|
|
2161
2161
|
children: [
|
|
2162
|
-
/* @__PURE__ */ e.jsx(
|
|
2162
|
+
/* @__PURE__ */ e.jsx(en, { className: "mr-2 size-4" }),
|
|
2163
2163
|
"Clear"
|
|
2164
2164
|
]
|
|
2165
2165
|
}
|
|
2166
2166
|
),
|
|
2167
2167
|
/* @__PURE__ */ e.jsx(
|
|
2168
|
-
|
|
2168
|
+
ea,
|
|
2169
2169
|
{
|
|
2170
2170
|
pressed: t,
|
|
2171
|
-
onPressedChange: (p) =>
|
|
2171
|
+
onPressedChange: (p) => l(p),
|
|
2172
2172
|
className: "",
|
|
2173
2173
|
size: "sm",
|
|
2174
2174
|
variant: "outline",
|
|
2175
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2175
|
+
children: /* @__PURE__ */ e.jsx(Rn, { className: "size-4 text-foreground/70" })
|
|
2176
2176
|
}
|
|
2177
2177
|
),
|
|
2178
2178
|
/* @__PURE__ */ e.jsx(
|
|
2179
|
-
|
|
2179
|
+
Tn,
|
|
2180
2180
|
{
|
|
2181
|
-
open:
|
|
2182
|
-
setOpen:
|
|
2181
|
+
open: r,
|
|
2182
|
+
setOpen: c,
|
|
2183
2183
|
userInput: f,
|
|
2184
2184
|
triggerAIRun: u,
|
|
2185
2185
|
setTriggerAIRun: S,
|
|
@@ -2189,26 +2189,26 @@ function Vn() {
|
|
|
2189
2189
|
] }),
|
|
2190
2190
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2191
2191
|
/* @__PURE__ */ e.jsxs(
|
|
2192
|
-
|
|
2192
|
+
k,
|
|
2193
2193
|
{
|
|
2194
2194
|
onClick: C,
|
|
2195
2195
|
size: "sm",
|
|
2196
2196
|
variant: "outline",
|
|
2197
2197
|
children: [
|
|
2198
|
-
/* @__PURE__ */ e.jsx(
|
|
2198
|
+
/* @__PURE__ */ e.jsx(lt, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2199
2199
|
"Accept"
|
|
2200
2200
|
]
|
|
2201
2201
|
}
|
|
2202
2202
|
),
|
|
2203
2203
|
/* @__PURE__ */ e.jsxs(
|
|
2204
|
-
|
|
2204
|
+
k,
|
|
2205
2205
|
{
|
|
2206
|
-
onClick:
|
|
2206
|
+
onClick: Ma,
|
|
2207
2207
|
className: "w-full",
|
|
2208
2208
|
size: "sm",
|
|
2209
2209
|
variant: "outline",
|
|
2210
2210
|
children: [
|
|
2211
|
-
/* @__PURE__ */ e.jsx(
|
|
2211
|
+
/* @__PURE__ */ e.jsx(He, { className: "mr-2 size-4" }),
|
|
2212
2212
|
"Close"
|
|
2213
2213
|
]
|
|
2214
2214
|
}
|
|
@@ -2222,61 +2222,61 @@ function Vn() {
|
|
|
2222
2222
|
)
|
|
2223
2223
|
);
|
|
2224
2224
|
}
|
|
2225
|
-
function
|
|
2226
|
-
var
|
|
2227
|
-
const [n, a] = me.useState([]),
|
|
2225
|
+
function Hn({ data: s }) {
|
|
2226
|
+
var d;
|
|
2227
|
+
const [n, a] = me.useState([]), l = Object.keys(s[0]).map((r) => ({
|
|
2228
2228
|
// header: key,
|
|
2229
|
-
accessorKey:
|
|
2230
|
-
header: ({ column:
|
|
2231
|
-
const f =
|
|
2229
|
+
accessorKey: r,
|
|
2230
|
+
header: ({ column: c }) => {
|
|
2231
|
+
const f = c.getIsSorted();
|
|
2232
2232
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2233
2233
|
"div",
|
|
2234
2234
|
{
|
|
2235
2235
|
className: "flex cursor-pointer items-center",
|
|
2236
|
-
onClick: () =>
|
|
2236
|
+
onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
|
|
2237
2237
|
children: [
|
|
2238
|
-
|
|
2239
|
-
f === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2238
|
+
r,
|
|
2239
|
+
f === "asc" ? /* @__PURE__ */ e.jsx(it, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(ot, { className: "ml-2 h-5 w-5" }) : null
|
|
2240
2240
|
]
|
|
2241
2241
|
}
|
|
2242
2242
|
) });
|
|
2243
2243
|
}
|
|
2244
|
-
})),
|
|
2244
|
+
})), o = ct({
|
|
2245
2245
|
data: s,
|
|
2246
|
-
columns:
|
|
2247
|
-
getCoreRowModel:
|
|
2248
|
-
getPaginationRowModel:
|
|
2246
|
+
columns: l,
|
|
2247
|
+
getCoreRowModel: xt(),
|
|
2248
|
+
getPaginationRowModel: pt(),
|
|
2249
2249
|
onSortingChange: a,
|
|
2250
|
-
getSortedRowModel:
|
|
2250
|
+
getSortedRowModel: ft(),
|
|
2251
2251
|
manualPagination: !0,
|
|
2252
2252
|
state: {
|
|
2253
2253
|
sorting: n
|
|
2254
2254
|
}
|
|
2255
2255
|
});
|
|
2256
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2257
|
-
/* @__PURE__ */ e.jsx(
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
) },
|
|
2261
|
-
/* @__PURE__ */ e.jsx(
|
|
2262
|
-
|
|
2256
|
+
return /* @__PURE__ */ e.jsxs(dt, { children: [
|
|
2257
|
+
/* @__PURE__ */ e.jsx(ht, { children: o.getHeaderGroups().map((r) => /* @__PURE__ */ e.jsx(is, { children: r.headers.map((c) => /* @__PURE__ */ e.jsx(mt, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Vs(
|
|
2258
|
+
c.column.columnDef.header,
|
|
2259
|
+
c.getContext()
|
|
2260
|
+
) }, c.id)) }, r.id)) }),
|
|
2261
|
+
/* @__PURE__ */ e.jsx(ut, { children: (d = o.getRowModel().rows) != null && d.length ? o.getRowModel().rows.map((r) => /* @__PURE__ */ e.jsx(
|
|
2262
|
+
is,
|
|
2263
2263
|
{
|
|
2264
2264
|
className: "whitespace-nowrap py-2",
|
|
2265
|
-
"data-state":
|
|
2266
|
-
children:
|
|
2265
|
+
"data-state": r.getIsSelected() && "selected",
|
|
2266
|
+
children: r.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(qs, { children: Vs(c.column.columnDef.cell, c.getContext()) }, c.id))
|
|
2267
2267
|
},
|
|
2268
|
-
|
|
2269
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
2268
|
+
r.id
|
|
2269
|
+
)) : /* @__PURE__ */ e.jsx(is, { children: /* @__PURE__ */ e.jsx(qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2270
2270
|
] });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function ba({
|
|
2273
2273
|
// card,
|
|
2274
2274
|
className: s,
|
|
2275
2275
|
...n
|
|
2276
2276
|
}) {
|
|
2277
|
-
var
|
|
2277
|
+
var d;
|
|
2278
2278
|
me.useState(0);
|
|
2279
|
-
const a =
|
|
2279
|
+
const a = w((r) => r.themeStyle), t = i((r) => r.card), l = i((r) => r.actions.setCard);
|
|
2280
2280
|
if (P(() => {
|
|
2281
2281
|
}, [
|
|
2282
2282
|
t.data,
|
|
@@ -2287,36 +2287,36 @@ function ja({
|
|
|
2287
2287
|
t.preferences
|
|
2288
2288
|
]), !t.id)
|
|
2289
2289
|
return null;
|
|
2290
|
-
let
|
|
2291
|
-
return t.data && t.data.length > 0 && (
|
|
2290
|
+
let o;
|
|
2291
|
+
return t.data && t.data.length > 0 && (o = ia({
|
|
2292
2292
|
data: t.data,
|
|
2293
2293
|
cardType: t.type,
|
|
2294
2294
|
cfg: t.cfg,
|
|
2295
2295
|
customCfg: t.customCfg,
|
|
2296
2296
|
preferences: t.preferences
|
|
2297
2297
|
})), /* @__PURE__ */ e.jsxs(
|
|
2298
|
-
|
|
2298
|
+
gt,
|
|
2299
2299
|
{
|
|
2300
2300
|
role: "editor-visual-card",
|
|
2301
2301
|
className: Y("relative flex h-full flex-col rounded-none", s),
|
|
2302
2302
|
...n,
|
|
2303
2303
|
children: [
|
|
2304
|
-
/* @__PURE__ */ e.jsxs(
|
|
2304
|
+
/* @__PURE__ */ e.jsxs(jt, { className: "py-4", children: [
|
|
2305
2305
|
/* @__PURE__ */ e.jsx(
|
|
2306
|
-
|
|
2306
|
+
Rs,
|
|
2307
2307
|
{
|
|
2308
2308
|
text: t.title,
|
|
2309
|
-
onSave: (
|
|
2310
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2309
|
+
onSave: (r) => l({ ...t, title: r }),
|
|
2310
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(bt, { className: "text-base", children: t.title }) })
|
|
2311
2311
|
},
|
|
2312
2312
|
t.title
|
|
2313
2313
|
),
|
|
2314
2314
|
/* @__PURE__ */ e.jsx(
|
|
2315
|
-
|
|
2315
|
+
Rs,
|
|
2316
2316
|
{
|
|
2317
2317
|
text: t.description || "",
|
|
2318
|
-
onSave: (
|
|
2319
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2318
|
+
onSave: (r) => l({ ...t, description: r }),
|
|
2319
|
+
children: /* @__PURE__ */ e.jsxs(yt, { children: [
|
|
2320
2320
|
" ",
|
|
2321
2321
|
t.description
|
|
2322
2322
|
] })
|
|
@@ -2324,34 +2324,34 @@ function ja({
|
|
|
2324
2324
|
t.description
|
|
2325
2325
|
)
|
|
2326
2326
|
] }),
|
|
2327
|
-
/* @__PURE__ */ e.jsxs(
|
|
2328
|
-
t.type !== "table" &&
|
|
2327
|
+
/* @__PURE__ */ e.jsxs(vt, { className: "flex grow flex-col pb-3", children: [
|
|
2328
|
+
t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2329
2329
|
/* @__PURE__ */ e.jsx(
|
|
2330
|
-
|
|
2330
|
+
Nt,
|
|
2331
2331
|
{
|
|
2332
|
-
cfg:
|
|
2332
|
+
cfg: o
|
|
2333
2333
|
},
|
|
2334
|
-
JSON.stringify(
|
|
2334
|
+
JSON.stringify(o) + JSON.stringify(t.preferences) + ((d = t == null ? void 0 : t.preferences) == null ? void 0 : d.customVisualCode)
|
|
2335
2335
|
),
|
|
2336
2336
|
t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2337
|
-
/* @__PURE__ */ e.jsx(
|
|
2337
|
+
/* @__PURE__ */ e.jsx(Ct, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(St, { card: t, data: t == null ? void 0 : t.data }) })
|
|
2338
2338
|
] })
|
|
2339
2339
|
]
|
|
2340
2340
|
}
|
|
2341
2341
|
);
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const [s, n] = T(!1), [a, t] = T(""), [
|
|
2343
|
+
function Bn() {
|
|
2344
|
+
const [s, n] = T(!1), [a, t] = T(""), [l, o] = T(""), [d, r] = T(""), [c, f] = T(""), m = i((N) => N.card), u = i(
|
|
2345
2345
|
(N) => N.card.customCfg
|
|
2346
|
-
), { setCardCustomCfg: S, setCustomVisualCode: h } =
|
|
2346
|
+
), { setCardCustomCfg: S, setCustomVisualCode: h } = kt();
|
|
2347
2347
|
function x(N) {
|
|
2348
|
-
var F,
|
|
2348
|
+
var F, L;
|
|
2349
2349
|
const O = {
|
|
2350
2350
|
...N,
|
|
2351
2351
|
data: {
|
|
2352
2352
|
...N == null ? void 0 : N.data,
|
|
2353
|
-
datasets: (
|
|
2354
|
-
...
|
|
2353
|
+
datasets: (L = (F = N == null ? void 0 : N.data) == null ? void 0 : F.datasets) == null ? void 0 : L.map((V) => ({
|
|
2354
|
+
...V,
|
|
2355
2355
|
data: []
|
|
2356
2356
|
}))
|
|
2357
2357
|
}
|
|
@@ -2362,43 +2362,43 @@ function _n() {
|
|
|
2362
2362
|
var O, j;
|
|
2363
2363
|
if (!m.data || m.data.length === 0)
|
|
2364
2364
|
return;
|
|
2365
|
-
const N =
|
|
2365
|
+
const N = ia({
|
|
2366
2366
|
data: m.data,
|
|
2367
2367
|
cardType: m.type,
|
|
2368
2368
|
cfg: m.cfg,
|
|
2369
2369
|
preferences: m.preferences
|
|
2370
2370
|
});
|
|
2371
|
-
N && (t(JSON.stringify(N, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode &&
|
|
2371
|
+
N && (t(JSON.stringify(N, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && r((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && o(JSON.stringify(u, null, 1)));
|
|
2372
2372
|
}
|
|
2373
2373
|
function z() {
|
|
2374
|
-
if (
|
|
2374
|
+
if (d && h(d), !!l)
|
|
2375
2375
|
try {
|
|
2376
|
-
const N = JSON.parse(
|
|
2377
|
-
return N ? (S(N), f(""),
|
|
2376
|
+
const N = JSON.parse(l);
|
|
2377
|
+
return N ? (S(N), f(""), o(""), N) : void 0;
|
|
2378
2378
|
} catch (N) {
|
|
2379
2379
|
console.log(N), f("Invalid JSON");
|
|
2380
2380
|
}
|
|
2381
2381
|
}
|
|
2382
2382
|
function b() {
|
|
2383
|
-
|
|
2383
|
+
o(""), S(null);
|
|
2384
2384
|
}
|
|
2385
|
-
function
|
|
2385
|
+
function E() {
|
|
2386
2386
|
let N;
|
|
2387
2387
|
if (u) {
|
|
2388
|
-
const O =
|
|
2388
|
+
const O = _s.cloneDeep(m.cfg), j = _s.merge(O, u);
|
|
2389
2389
|
return N = x(j), N;
|
|
2390
2390
|
}
|
|
2391
2391
|
return a ? (N = x(JSON.parse(a)), N) : "";
|
|
2392
2392
|
}
|
|
2393
2393
|
return /* @__PURE__ */ e.jsxs(ps, { open: s, onOpenChange: n, children: [
|
|
2394
2394
|
/* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2395
|
-
|
|
2395
|
+
k,
|
|
2396
2396
|
{
|
|
2397
2397
|
onClick: g,
|
|
2398
2398
|
className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2399
2399
|
size: "sm",
|
|
2400
2400
|
variant: "outline",
|
|
2401
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2401
|
+
children: /* @__PURE__ */ e.jsx(wt, { className: "h-4 w-4" })
|
|
2402
2402
|
}
|
|
2403
2403
|
) }),
|
|
2404
2404
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2410,8 +2410,8 @@ function _n() {
|
|
|
2410
2410
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2411
2411
|
/* @__PURE__ */ e.jsx(bs, { children: "Customize Card" }),
|
|
2412
2412
|
/* @__PURE__ */ e.jsxs(vs, { children: [
|
|
2413
|
-
/* @__PURE__ */ e.jsx(
|
|
2414
|
-
|
|
2413
|
+
/* @__PURE__ */ e.jsx(Ws, { children: /* @__PURE__ */ e.jsx(
|
|
2414
|
+
nn,
|
|
2415
2415
|
{
|
|
2416
2416
|
onClick: () => {
|
|
2417
2417
|
navigator.clipboard.writeText(m.id);
|
|
@@ -2436,23 +2436,23 @@ function _n() {
|
|
|
2436
2436
|
] })
|
|
2437
2437
|
] }),
|
|
2438
2438
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2439
|
-
/* @__PURE__ */ e.jsx(
|
|
2440
|
-
/* @__PURE__ */ e.jsxs(
|
|
2441
|
-
/* @__PURE__ */ e.jsxs(
|
|
2442
|
-
/* @__PURE__ */ e.jsxs(
|
|
2443
|
-
u && /* @__PURE__ */ e.jsx(
|
|
2439
|
+
/* @__PURE__ */ e.jsx(ba, { className: "w-1/2 rounded shadow-none" }),
|
|
2440
|
+
/* @__PURE__ */ e.jsxs(zt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2441
|
+
/* @__PURE__ */ e.jsxs(Ft, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2442
|
+
/* @__PURE__ */ e.jsxs(os, { value: "custom-config", children: [
|
|
2443
|
+
u && /* @__PURE__ */ e.jsx(Ot, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2444
2444
|
u ? "Custom Config" : "Default Config"
|
|
2445
2445
|
] }),
|
|
2446
|
-
/* @__PURE__ */ e.jsx(
|
|
2447
|
-
/* @__PURE__ */ e.jsx(
|
|
2446
|
+
/* @__PURE__ */ e.jsx(os, { className: "", value: "output", children: "Output" }),
|
|
2447
|
+
/* @__PURE__ */ e.jsx(os, { className: "", value: "custom-code", children: "Custom Code" })
|
|
2448
2448
|
] }),
|
|
2449
2449
|
/* @__PURE__ */ e.jsx(
|
|
2450
|
-
|
|
2450
|
+
cs,
|
|
2451
2451
|
{
|
|
2452
2452
|
className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
|
|
2453
2453
|
value: "output",
|
|
2454
2454
|
children: /* @__PURE__ */ e.jsx(
|
|
2455
|
-
|
|
2455
|
+
la,
|
|
2456
2456
|
{
|
|
2457
2457
|
disabled: !0,
|
|
2458
2458
|
value: a,
|
|
@@ -2462,12 +2462,12 @@ function _n() {
|
|
|
2462
2462
|
}
|
|
2463
2463
|
),
|
|
2464
2464
|
/* @__PURE__ */ e.jsx(
|
|
2465
|
-
|
|
2465
|
+
cs,
|
|
2466
2466
|
{
|
|
2467
2467
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2468
2468
|
value: "custom-config",
|
|
2469
2469
|
children: /* @__PURE__ */ e.jsx(
|
|
2470
|
-
|
|
2470
|
+
_e,
|
|
2471
2471
|
{
|
|
2472
2472
|
className: "h-full w-full overflow-hidden",
|
|
2473
2473
|
theme: "default",
|
|
@@ -2484,19 +2484,19 @@ function _n() {
|
|
|
2484
2484
|
renderLineHighlight: "none"
|
|
2485
2485
|
},
|
|
2486
2486
|
defaultLanguage: "json",
|
|
2487
|
-
value:
|
|
2488
|
-
onChange: (N) =>
|
|
2487
|
+
value: E(),
|
|
2488
|
+
onChange: (N) => o(N)
|
|
2489
2489
|
}
|
|
2490
2490
|
)
|
|
2491
2491
|
}
|
|
2492
2492
|
),
|
|
2493
2493
|
/* @__PURE__ */ e.jsx(
|
|
2494
|
-
|
|
2494
|
+
cs,
|
|
2495
2495
|
{
|
|
2496
2496
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
2497
2497
|
value: "custom-code",
|
|
2498
2498
|
children: /* @__PURE__ */ e.jsx(
|
|
2499
|
-
|
|
2499
|
+
_e,
|
|
2500
2500
|
{
|
|
2501
2501
|
className: "h-full w-full overflow-hidden",
|
|
2502
2502
|
theme: "default",
|
|
@@ -2513,18 +2513,18 @@ function _n() {
|
|
|
2513
2513
|
renderLineHighlight: "none"
|
|
2514
2514
|
},
|
|
2515
2515
|
defaultLanguage: "javascript",
|
|
2516
|
-
value:
|
|
2517
|
-
onChange: (N) =>
|
|
2516
|
+
value: d,
|
|
2517
|
+
onChange: (N) => r(N || "")
|
|
2518
2518
|
}
|
|
2519
2519
|
)
|
|
2520
2520
|
}
|
|
2521
2521
|
)
|
|
2522
2522
|
] })
|
|
2523
2523
|
] }),
|
|
2524
|
-
/* @__PURE__ */ e.jsxs(
|
|
2525
|
-
/* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children:
|
|
2524
|
+
/* @__PURE__ */ e.jsxs(Js, { className: "flex items-center", children: [
|
|
2525
|
+
/* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: c }),
|
|
2526
2526
|
/* @__PURE__ */ e.jsx(
|
|
2527
|
-
|
|
2527
|
+
k,
|
|
2528
2528
|
{
|
|
2529
2529
|
disabled: !u,
|
|
2530
2530
|
onClick: b,
|
|
@@ -2532,109 +2532,120 @@ function _n() {
|
|
|
2532
2532
|
children: "Reset"
|
|
2533
2533
|
}
|
|
2534
2534
|
),
|
|
2535
|
-
/* @__PURE__ */ e.jsx(
|
|
2536
|
-
/* @__PURE__ */ e.jsx(
|
|
2535
|
+
/* @__PURE__ */ e.jsx(k, { onClick: z, variant: "outline", children: "Apply" }),
|
|
2536
|
+
/* @__PURE__ */ e.jsx(k, { onClick: () => n(!1), variant: "outline", children: "Close" })
|
|
2537
2537
|
] })
|
|
2538
2538
|
]
|
|
2539
2539
|
}
|
|
2540
2540
|
)
|
|
2541
2541
|
] });
|
|
2542
2542
|
}
|
|
2543
|
-
function ba(s) {
|
|
2544
|
-
return fe({ 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);
|
|
2545
|
-
}
|
|
2546
2543
|
function ya(s) {
|
|
2547
|
-
return
|
|
2544
|
+
return ue({ 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);
|
|
2548
2545
|
}
|
|
2549
2546
|
function va(s) {
|
|
2550
|
-
return
|
|
2547
|
+
return ue({ 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);
|
|
2551
2548
|
}
|
|
2552
2549
|
function Na(s) {
|
|
2553
|
-
return
|
|
2550
|
+
return ue({ 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);
|
|
2554
2551
|
}
|
|
2555
2552
|
function Ca(s) {
|
|
2556
|
-
return
|
|
2553
|
+
return ue({ 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);
|
|
2557
2554
|
}
|
|
2558
2555
|
function Sa(s) {
|
|
2559
|
-
return
|
|
2556
|
+
return ue({ 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);
|
|
2560
2557
|
}
|
|
2561
2558
|
function ka(s) {
|
|
2562
|
-
return
|
|
2559
|
+
return ue({ 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);
|
|
2560
|
+
}
|
|
2561
|
+
function wa(s) {
|
|
2562
|
+
return ue({ 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);
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2565
|
-
|
|
2566
|
-
|
|
2564
|
+
function za(s) {
|
|
2565
|
+
return ue({ 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);
|
|
2566
|
+
}
|
|
2567
|
+
function $n() {
|
|
2568
|
+
const [s, n] = T(!1), a = i((c) => c.card.type), { setCardType: t, setCardPreferences: l, setChartOrientation: o } = i((c) => c.actions), d = i(
|
|
2569
|
+
(c) => c.actions.setCardCustomCfg
|
|
2567
2570
|
);
|
|
2568
|
-
function
|
|
2569
|
-
|
|
2571
|
+
function r(c) {
|
|
2572
|
+
d(null), l({}), t(c), n(!1);
|
|
2570
2573
|
}
|
|
2571
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2572
|
-
/* @__PURE__ */ e.jsx(
|
|
2573
|
-
/* @__PURE__ */ e.jsx(
|
|
2574
|
+
return /* @__PURE__ */ e.jsxs(Ue, { open: s, onOpenChange: n, children: [
|
|
2575
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Pn, { className: "h-4 w-4", chartType: a }) }) }),
|
|
2576
|
+
/* @__PURE__ */ e.jsx(Je, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2574
2577
|
/* @__PURE__ */ e.jsx(
|
|
2575
|
-
|
|
2578
|
+
k,
|
|
2576
2579
|
{
|
|
2577
|
-
onClick: () =>
|
|
2580
|
+
onClick: () => r("bar"),
|
|
2578
2581
|
className: "font-normal",
|
|
2579
2582
|
variant: "ghost",
|
|
2580
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2583
|
+
children: /* @__PURE__ */ e.jsx(Fs, { className: "size-5" })
|
|
2581
2584
|
}
|
|
2582
2585
|
),
|
|
2583
2586
|
/* @__PURE__ */ e.jsx(
|
|
2584
|
-
|
|
2587
|
+
k,
|
|
2585
2588
|
{
|
|
2586
|
-
onClick: () =>
|
|
2589
|
+
onClick: () => r("line"),
|
|
2587
2590
|
variant: "ghost",
|
|
2588
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2591
|
+
children: /* @__PURE__ */ e.jsx(Os, { className: "size-5" })
|
|
2589
2592
|
}
|
|
2590
2593
|
),
|
|
2591
2594
|
/* @__PURE__ */ e.jsx(
|
|
2592
|
-
|
|
2595
|
+
k,
|
|
2593
2596
|
{
|
|
2594
|
-
onClick: () =>
|
|
2597
|
+
onClick: () => r("stackedBar"),
|
|
2595
2598
|
variant: "ghost",
|
|
2596
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2599
|
+
children: /* @__PURE__ */ e.jsx(ka, { className: "size-5", strokeWidth: 0 })
|
|
2597
2600
|
}
|
|
2598
2601
|
),
|
|
2599
2602
|
/* @__PURE__ */ e.jsx(
|
|
2600
|
-
|
|
2603
|
+
k,
|
|
2601
2604
|
{
|
|
2602
|
-
onClick: () =>
|
|
2605
|
+
onClick: () => r("stackedLine"),
|
|
2603
2606
|
variant: "ghost",
|
|
2604
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2607
|
+
children: /* @__PURE__ */ e.jsx(Sa, { className: "size-5", strokeWidth: 0 })
|
|
2605
2608
|
}
|
|
2606
2609
|
),
|
|
2607
2610
|
/* @__PURE__ */ e.jsx(
|
|
2608
|
-
|
|
2611
|
+
k,
|
|
2609
2612
|
{
|
|
2610
|
-
onClick: () =>
|
|
2613
|
+
onClick: () => r("scatter"),
|
|
2611
2614
|
variant: "ghost",
|
|
2612
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2615
|
+
children: /* @__PURE__ */ e.jsx(ua, { className: "size-5" })
|
|
2613
2616
|
}
|
|
2614
2617
|
),
|
|
2615
2618
|
/* @__PURE__ */ e.jsx(
|
|
2616
|
-
|
|
2619
|
+
k,
|
|
2617
2620
|
{
|
|
2618
|
-
onClick: () =>
|
|
2621
|
+
onClick: () => r("bubble"),
|
|
2619
2622
|
variant: "ghost",
|
|
2620
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2623
|
+
children: /* @__PURE__ */ e.jsx(Ca, { className: "size-4" })
|
|
2621
2624
|
}
|
|
2622
2625
|
),
|
|
2623
2626
|
/* @__PURE__ */ e.jsx(
|
|
2624
|
-
|
|
2627
|
+
k,
|
|
2625
2628
|
{
|
|
2626
|
-
onClick: () =>
|
|
2629
|
+
onClick: () => r("pie"),
|
|
2627
2630
|
variant: "ghost",
|
|
2628
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2631
|
+
children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
|
|
2629
2632
|
}
|
|
2630
2633
|
),
|
|
2631
2634
|
/* @__PURE__ */ e.jsx(
|
|
2632
|
-
|
|
2635
|
+
k,
|
|
2633
2636
|
{
|
|
2634
|
-
onClick: () =>
|
|
2637
|
+
onClick: () => r("doughnut"),
|
|
2638
|
+
variant: "ghost",
|
|
2639
|
+
children: /* @__PURE__ */ e.jsx(va, { className: "size-5", strokeWidth: 1 })
|
|
2640
|
+
}
|
|
2641
|
+
),
|
|
2642
|
+
/* @__PURE__ */ e.jsx(
|
|
2643
|
+
k,
|
|
2644
|
+
{
|
|
2645
|
+
onClick: () => r("radar"),
|
|
2635
2646
|
variant: "ghost",
|
|
2636
2647
|
children: /* @__PURE__ */ e.jsx(
|
|
2637
|
-
|
|
2648
|
+
ya,
|
|
2638
2649
|
{
|
|
2639
2650
|
className: "size-5 font-extralight",
|
|
2640
2651
|
strokeWidth: 0.5
|
|
@@ -2643,87 +2654,99 @@ function Hn() {
|
|
|
2643
2654
|
}
|
|
2644
2655
|
),
|
|
2645
2656
|
/* @__PURE__ */ e.jsx(
|
|
2646
|
-
|
|
2657
|
+
k,
|
|
2647
2658
|
{
|
|
2648
|
-
onClick: () =>
|
|
2659
|
+
onClick: () => r("polarArea"),
|
|
2649
2660
|
variant: "ghost",
|
|
2650
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2661
|
+
children: /* @__PURE__ */ e.jsx(Na, { className: "size-5" })
|
|
2651
2662
|
}
|
|
2652
2663
|
),
|
|
2653
2664
|
/* @__PURE__ */ e.jsx(
|
|
2654
|
-
|
|
2665
|
+
k,
|
|
2655
2666
|
{
|
|
2656
|
-
onClick: () =>
|
|
2667
|
+
onClick: () => r("pyramid"),
|
|
2657
2668
|
variant: "ghost",
|
|
2658
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2669
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "size-5" })
|
|
2659
2670
|
}
|
|
2660
2671
|
),
|
|
2661
2672
|
/* @__PURE__ */ e.jsx(
|
|
2662
|
-
|
|
2673
|
+
k,
|
|
2663
2674
|
{
|
|
2664
|
-
onClick: () =>
|
|
2675
|
+
onClick: () => r("range"),
|
|
2665
2676
|
variant: "ghost",
|
|
2666
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2677
|
+
children: /* @__PURE__ */ e.jsx(da, { className: "size-5" })
|
|
2667
2678
|
}
|
|
2668
2679
|
),
|
|
2669
2680
|
/* @__PURE__ */ e.jsx(
|
|
2670
|
-
|
|
2681
|
+
k,
|
|
2671
2682
|
{
|
|
2672
|
-
onClick: () =>
|
|
2683
|
+
onClick: () => r("table"),
|
|
2673
2684
|
variant: "ghost",
|
|
2674
2685
|
children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
|
|
2675
2686
|
}
|
|
2676
2687
|
),
|
|
2677
2688
|
/* @__PURE__ */ e.jsx(
|
|
2678
|
-
|
|
2689
|
+
k,
|
|
2690
|
+
{
|
|
2691
|
+
onClick: () => r("kpi"),
|
|
2692
|
+
variant: "ghost",
|
|
2693
|
+
children: /* @__PURE__ */ e.jsx(wa, { className: "size-6" })
|
|
2694
|
+
}
|
|
2695
|
+
),
|
|
2696
|
+
/* @__PURE__ */ e.jsx(
|
|
2697
|
+
k,
|
|
2679
2698
|
{
|
|
2680
|
-
onClick: () =>
|
|
2699
|
+
onClick: () => r("text"),
|
|
2681
2700
|
variant: "ghost",
|
|
2682
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2701
|
+
children: /* @__PURE__ */ e.jsx(Ms, { className: "size-4" })
|
|
2683
2702
|
}
|
|
2684
2703
|
)
|
|
2685
2704
|
] }) })
|
|
2686
2705
|
] });
|
|
2687
2706
|
}
|
|
2688
|
-
function
|
|
2707
|
+
function Pn({ chartType: s, className: n }) {
|
|
2689
2708
|
switch (s) {
|
|
2690
2709
|
case "bar":
|
|
2691
|
-
return /* @__PURE__ */ e.jsx(zs, { className: n });
|
|
2692
|
-
case "line":
|
|
2693
2710
|
return /* @__PURE__ */ e.jsx(Fs, { className: n });
|
|
2711
|
+
case "line":
|
|
2712
|
+
return /* @__PURE__ */ e.jsx(Os, { className: n });
|
|
2694
2713
|
case "pie":
|
|
2695
|
-
return /* @__PURE__ */ e.jsx(
|
|
2714
|
+
return /* @__PURE__ */ e.jsx(ma, { className: n });
|
|
2696
2715
|
case "radar":
|
|
2697
|
-
return /* @__PURE__ */ e.jsx(
|
|
2716
|
+
return /* @__PURE__ */ e.jsx(ya, { className: n });
|
|
2698
2717
|
case "scatter":
|
|
2699
|
-
return /* @__PURE__ */ e.jsx(
|
|
2718
|
+
return /* @__PURE__ */ e.jsx(ua, { className: n });
|
|
2700
2719
|
case "bubble":
|
|
2701
|
-
return /* @__PURE__ */ e.jsx(
|
|
2720
|
+
return /* @__PURE__ */ e.jsx(Ca, { className: n });
|
|
2702
2721
|
case "doughnut":
|
|
2703
|
-
return /* @__PURE__ */ e.jsx(
|
|
2722
|
+
return /* @__PURE__ */ e.jsx(va, { className: n });
|
|
2704
2723
|
case "stackedBar":
|
|
2705
|
-
return /* @__PURE__ */ e.jsx(
|
|
2724
|
+
return /* @__PURE__ */ e.jsx(ka, { className: "size-4 text-foreground/70" });
|
|
2725
|
+
case "stackedLine":
|
|
2726
|
+
return /* @__PURE__ */ e.jsx(Sa, { className: "size-4 text-foreground/70" });
|
|
2706
2727
|
case "polarArea":
|
|
2707
|
-
return /* @__PURE__ */ e.jsx(
|
|
2728
|
+
return /* @__PURE__ */ e.jsx(Na, { className: n });
|
|
2708
2729
|
case "pyramid":
|
|
2709
|
-
return /* @__PURE__ */ e.jsx(
|
|
2730
|
+
return /* @__PURE__ */ e.jsx(za, { className: n });
|
|
2710
2731
|
case "range":
|
|
2711
|
-
return /* @__PURE__ */ e.jsx(
|
|
2732
|
+
return /* @__PURE__ */ e.jsx(da, { className: n });
|
|
2712
2733
|
case "kpi":
|
|
2713
|
-
return /* @__PURE__ */ e.jsx(
|
|
2734
|
+
return /* @__PURE__ */ e.jsx(wa, { className: n });
|
|
2735
|
+
case "text":
|
|
2736
|
+
return /* @__PURE__ */ e.jsx(Ms, { className: n });
|
|
2714
2737
|
default:
|
|
2715
2738
|
return /* @__PURE__ */ e.jsx(Cs, { className: n });
|
|
2716
2739
|
}
|
|
2717
2740
|
}
|
|
2718
|
-
function
|
|
2741
|
+
function Kn() {
|
|
2719
2742
|
const s = i(
|
|
2720
2743
|
(a) => a.card.refreshInterval
|
|
2721
2744
|
), n = i(
|
|
2722
2745
|
(a) => a.actions.setCardRefreshInterval
|
|
2723
2746
|
);
|
|
2724
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2725
|
-
/* @__PURE__ */ e.jsx(
|
|
2726
|
-
/* @__PURE__ */ e.jsx(
|
|
2747
|
+
return /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
2748
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Wt, { className: "w-4 h-4" }) }) }),
|
|
2749
|
+
/* @__PURE__ */ e.jsx(Je, { 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: [
|
|
2727
2750
|
/* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
|
|
2728
2751
|
/* @__PURE__ */ e.jsx(
|
|
2729
2752
|
ae,
|
|
@@ -2738,27 +2761,43 @@ function $n() {
|
|
|
2738
2761
|
] }) }) }) })
|
|
2739
2762
|
] });
|
|
2740
2763
|
}
|
|
2741
|
-
function
|
|
2764
|
+
function Ks() {
|
|
2742
2765
|
i((r) => r.frame);
|
|
2743
|
-
const s = i((r) => r.card), n = i((r) => r.card.data), a = i((r) => r.isShowingVisual), t = i((r) => r.isSqlRunning),
|
|
2744
|
-
|
|
2745
|
-
|
|
2766
|
+
const s = i((r) => r.card), n = i((r) => r.card.data), a = i((r) => r.isShowingVisual), t = i((r) => r.isSqlRunning), l = i((r) => r.queryError), o = i((r) => r.pythonStdOut);
|
|
2767
|
+
if (i((r) => r.onSave), i((r) => r.onClose), i((r) => r.actions.setCardSql), i((r) => r.actions.setCardType), i((r) => r.actions.setSqlGen), !s)
|
|
2768
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2769
|
+
function d() {
|
|
2770
|
+
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(Mt, { isLoading: t, 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(Tt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ba, { className: "grow border-none shadow-none" });
|
|
2771
|
+
}
|
|
2772
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
|
|
2773
|
+
t && /* @__PURE__ */ e.jsx($e, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
2746
2774
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
2747
2775
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
2748
|
-
/* @__PURE__ */ e.jsx(
|
|
2749
|
-
s.type !== "table" && /* @__PURE__ */ e.jsx(
|
|
2750
|
-
/* @__PURE__ */ e.jsx(
|
|
2776
|
+
/* @__PURE__ */ e.jsx($n, {}),
|
|
2777
|
+
s.type !== "table" && /* @__PURE__ */ e.jsx(Bn, {}),
|
|
2778
|
+
/* @__PURE__ */ e.jsx(Kn, {})
|
|
2751
2779
|
] }),
|
|
2752
|
-
/* @__PURE__ */ e.jsx(
|
|
2780
|
+
/* @__PURE__ */ e.jsx(Gn, {})
|
|
2753
2781
|
] }),
|
|
2754
|
-
a ?
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2782
|
+
a ? d() : (
|
|
2783
|
+
// card.type === 'kpi' ? (
|
|
2784
|
+
// <div className="flex grow items-center justify-center">
|
|
2785
|
+
// <div className="w-1/2 rounded-md border">
|
|
2786
|
+
// <KPICard isLoading={isSqlRunning} card={card} />
|
|
2787
|
+
// </div>
|
|
2788
|
+
// </div>
|
|
2789
|
+
// ) : (
|
|
2790
|
+
// <EditorCard className="grow border-none shadow-none" />
|
|
2791
|
+
// )
|
|
2792
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
2793
|
+
o && /* @__PURE__ */ e.jsx(Un, {}),
|
|
2794
|
+
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Hn, { data: n || [] }),
|
|
2795
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
|
|
2796
|
+
] })
|
|
2797
|
+
)
|
|
2798
|
+
] });
|
|
2760
2799
|
}
|
|
2761
|
-
function
|
|
2800
|
+
function Un() {
|
|
2762
2801
|
const s = i((a) => a.pythonStdOut);
|
|
2763
2802
|
if (!s)
|
|
2764
2803
|
return null;
|
|
@@ -2775,14 +2814,14 @@ function Pn() {
|
|
|
2775
2814
|
/* @__PURE__ */ e.jsx(ks, { className: "mb-2" })
|
|
2776
2815
|
] });
|
|
2777
2816
|
}
|
|
2778
|
-
function
|
|
2817
|
+
function Gn() {
|
|
2779
2818
|
const s = i((a) => a.isShowingVisual), n = i(
|
|
2780
2819
|
(a) => a.actions.setIsShowingVisual
|
|
2781
2820
|
);
|
|
2782
2821
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2783
2822
|
/* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
|
|
2784
2823
|
/* @__PURE__ */ e.jsx(
|
|
2785
|
-
|
|
2824
|
+
Lt,
|
|
2786
2825
|
{
|
|
2787
2826
|
checked: s,
|
|
2788
2827
|
onCheckedChange: () => n(!s),
|
|
@@ -2792,12 +2831,12 @@ function Kn() {
|
|
|
2792
2831
|
)
|
|
2793
2832
|
] });
|
|
2794
2833
|
}
|
|
2795
|
-
function
|
|
2834
|
+
function Ie() {
|
|
2796
2835
|
const [s, n] = T([]);
|
|
2797
2836
|
i(
|
|
2798
2837
|
(m) => m.card.cfg
|
|
2799
2838
|
);
|
|
2800
|
-
const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex:
|
|
2839
|
+
const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: o } = i((m) => m.actions), d = i(
|
|
2801
2840
|
(m) => m.queryResultColumns
|
|
2802
2841
|
);
|
|
2803
2842
|
i(
|
|
@@ -2806,11 +2845,11 @@ function De() {
|
|
|
2806
2845
|
return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
|
|
2807
2846
|
}
|
|
2808
2847
|
), P(() => {
|
|
2809
|
-
|
|
2810
|
-
}, [
|
|
2811
|
-
function
|
|
2848
|
+
d && n(new Array(d.length).fill(!1));
|
|
2849
|
+
}, [d]);
|
|
2850
|
+
function r(m, u) {
|
|
2812
2851
|
var S, h;
|
|
2813
|
-
u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ?
|
|
2852
|
+
u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ? o({
|
|
2814
2853
|
...a,
|
|
2815
2854
|
onClickFilter: [
|
|
2816
2855
|
...a.onClickFilter,
|
|
@@ -2819,7 +2858,7 @@ function De() {
|
|
|
2819
2858
|
expression: ""
|
|
2820
2859
|
}
|
|
2821
2860
|
]
|
|
2822
|
-
}) :
|
|
2861
|
+
}) : o({
|
|
2823
2862
|
...a,
|
|
2824
2863
|
onClickFilter: [
|
|
2825
2864
|
{
|
|
@@ -2827,7 +2866,7 @@ function De() {
|
|
|
2827
2866
|
expression: ""
|
|
2828
2867
|
}
|
|
2829
2868
|
]
|
|
2830
|
-
}) : (
|
|
2869
|
+
}) : (o({
|
|
2831
2870
|
...a,
|
|
2832
2871
|
onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
|
|
2833
2872
|
(x) => x.columnIndex !== m
|
|
@@ -2837,13 +2876,13 @@ function De() {
|
|
|
2837
2876
|
return g[m] = !1, g;
|
|
2838
2877
|
}));
|
|
2839
2878
|
}
|
|
2840
|
-
function
|
|
2879
|
+
function c(m, u) {
|
|
2841
2880
|
var h;
|
|
2842
2881
|
const S = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
|
|
2843
2882
|
...x,
|
|
2844
2883
|
expression: u.target.value
|
|
2845
2884
|
} : x);
|
|
2846
|
-
|
|
2885
|
+
o({
|
|
2847
2886
|
...a,
|
|
2848
2887
|
onClickFilter: S
|
|
2849
2888
|
});
|
|
@@ -2855,14 +2894,14 @@ function De() {
|
|
|
2855
2894
|
ae,
|
|
2856
2895
|
{
|
|
2857
2896
|
value: (x = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((g) => g.columnIndex === m)) == null ? void 0 : x.expression,
|
|
2858
|
-
onChange: (g) =>
|
|
2897
|
+
onChange: (g) => c(m, g),
|
|
2859
2898
|
type: "text",
|
|
2860
2899
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
2861
2900
|
placeholder: "Expression"
|
|
2862
2901
|
}
|
|
2863
2902
|
);
|
|
2864
2903
|
}
|
|
2865
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
2904
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: d == null ? void 0 : d.map((m, u) => {
|
|
2866
2905
|
var S, h;
|
|
2867
2906
|
return /* @__PURE__ */ e.jsx(
|
|
2868
2907
|
"div",
|
|
@@ -2871,12 +2910,12 @@ function De() {
|
|
|
2871
2910
|
children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
|
|
2872
2911
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
|
|
2873
2912
|
/* @__PURE__ */ e.jsx(
|
|
2874
|
-
|
|
2913
|
+
Ke,
|
|
2875
2914
|
{
|
|
2876
2915
|
checked: !!((S = a == null ? void 0 : a.onClickFilter) != null && S.find(
|
|
2877
2916
|
(x) => x.columnIndex === u
|
|
2878
2917
|
)),
|
|
2879
|
-
onCheckedChange: (x) =>
|
|
2918
|
+
onCheckedChange: (x) => r(u, x)
|
|
2880
2919
|
}
|
|
2881
2920
|
),
|
|
2882
2921
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2889,7 +2928,7 @@ function De() {
|
|
|
2889
2928
|
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
|
|
2890
2929
|
(x) => x.columnIndex === u
|
|
2891
2930
|
)) && /* @__PURE__ */ e.jsx(
|
|
2892
|
-
|
|
2931
|
+
ha,
|
|
2893
2932
|
{
|
|
2894
2933
|
onClick: () => {
|
|
2895
2934
|
n((x) => {
|
|
@@ -2908,29 +2947,29 @@ function De() {
|
|
|
2908
2947
|
);
|
|
2909
2948
|
}) });
|
|
2910
2949
|
}
|
|
2911
|
-
function
|
|
2912
|
-
var
|
|
2950
|
+
function as() {
|
|
2951
|
+
var d, r, c;
|
|
2913
2952
|
const s = i((f) => f.card.preferences), n = i(
|
|
2914
2953
|
(f) => f.card.cfg
|
|
2915
|
-
), { setCardCfg: a, setCardPreferences: t, setChartOrientation:
|
|
2916
|
-
(
|
|
2917
|
-
function
|
|
2918
|
-
|
|
2954
|
+
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = i((f) => f.actions);
|
|
2955
|
+
(d = n == null ? void 0 : n.options) != null && d.indexAxis;
|
|
2956
|
+
function o(f) {
|
|
2957
|
+
l(f);
|
|
2919
2958
|
}
|
|
2920
2959
|
return /* @__PURE__ */ e.jsxs(
|
|
2921
|
-
|
|
2960
|
+
ws,
|
|
2922
2961
|
{
|
|
2923
|
-
value: ((
|
|
2924
|
-
onValueChange:
|
|
2962
|
+
value: ((r = s == null ? void 0 : s.chartOptions) == null ? void 0 : r.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
|
|
2963
|
+
onValueChange: o,
|
|
2925
2964
|
className: "flex gap-3",
|
|
2926
2965
|
defaultValue: "x",
|
|
2927
2966
|
children: [
|
|
2928
2967
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2929
|
-
/* @__PURE__ */ e.jsx(
|
|
2968
|
+
/* @__PURE__ */ e.jsx(De, { value: "x", id: "r1" }),
|
|
2930
2969
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
|
|
2931
2970
|
] }),
|
|
2932
2971
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2933
|
-
/* @__PURE__ */ e.jsx(
|
|
2972
|
+
/* @__PURE__ */ e.jsx(De, { value: "y", id: "r2" }),
|
|
2934
2973
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
|
|
2935
2974
|
] })
|
|
2936
2975
|
]
|
|
@@ -2938,12 +2977,12 @@ function ss() {
|
|
|
2938
2977
|
);
|
|
2939
2978
|
}
|
|
2940
2979
|
const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
2941
|
-
function
|
|
2942
|
-
var t,
|
|
2943
|
-
const a =
|
|
2944
|
-
return ((
|
|
2980
|
+
function Us(s, n) {
|
|
2981
|
+
var t, l, o;
|
|
2982
|
+
const a = oa(s, n);
|
|
2983
|
+
return ((o = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : o.type) || "linear";
|
|
2945
2984
|
}
|
|
2946
|
-
function
|
|
2985
|
+
function Fa() {
|
|
2947
2986
|
var Q, ee, Z, J, I, y;
|
|
2948
2987
|
const [s, n] = T(!1), a = i((v) => {
|
|
2949
2988
|
var M;
|
|
@@ -2951,26 +2990,26 @@ function wa() {
|
|
|
2951
2990
|
}), t = i((v) => {
|
|
2952
2991
|
var M;
|
|
2953
2992
|
return (M = v.card) == null ? void 0 : M.cfg;
|
|
2954
|
-
}),
|
|
2955
|
-
|
|
2956
|
-
), [
|
|
2957
|
-
((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[
|
|
2993
|
+
}), l = oa(a, t), [o, d] = T(
|
|
2994
|
+
Us(a)
|
|
2995
|
+
), [r, c] = T(
|
|
2996
|
+
((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[l]) == null ? void 0 : Z.min) || ""
|
|
2958
2997
|
), [f, m] = T(
|
|
2959
|
-
((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[
|
|
2960
|
-
), [u, S] = T(
|
|
2998
|
+
((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[l]) == null ? void 0 : y.max) || ""
|
|
2999
|
+
), [u, S] = T(r || f ? "custom" : "auto"), [h, x] = T(""), [g, z] = T(0), [b, E] = T(""), [N, O] = T(""), [j, F] = T(""), L = i(
|
|
2961
3000
|
(v) => v.actions.setCardPreferences
|
|
2962
|
-
),
|
|
3001
|
+
), V = i((v) => {
|
|
2963
3002
|
var M;
|
|
2964
3003
|
return (M = v.card) == null ? void 0 : M.type;
|
|
2965
|
-
}), K = ["pie", "doughnut", "polarArea"].includes(
|
|
3004
|
+
}), K = ["pie", "doughnut", "polarArea"].includes(V);
|
|
2966
3005
|
P(() => {
|
|
2967
|
-
var v, M, H,
|
|
2968
|
-
|
|
2969
|
-
((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[
|
|
2970
|
-
), m(((ge = (se = (
|
|
2971
|
-
((U = (
|
|
2972
|
-
), z(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0),
|
|
2973
|
-
}, [s, a,
|
|
3006
|
+
var v, M, H, xe, se, ge, je, be, pe, U, ne, re, ye, le;
|
|
3007
|
+
d(Us(a)), c(
|
|
3008
|
+
((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[l]) == null ? void 0 : H.min) === 0 ? 0 : ""
|
|
3009
|
+
), m(((ge = (se = (xe = a == null ? void 0 : a.chartOptions) == null ? void 0 : xe.scales) == null ? void 0 : se[l]) == null ? void 0 : ge.max) || ""), x(
|
|
3010
|
+
((U = (pe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[l]) == null ? void 0 : pe.ticks) == null ? void 0 : U.stepSize) || ""
|
|
3011
|
+
), z(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), E(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.locale) || "");
|
|
3012
|
+
}, [s, a, l]);
|
|
2974
3013
|
function $(v, M) {
|
|
2975
3014
|
return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
|
|
2976
3015
|
}
|
|
@@ -3035,8 +3074,8 @@ function wa() {
|
|
|
3035
3074
|
ae,
|
|
3036
3075
|
{
|
|
3037
3076
|
id: "min",
|
|
3038
|
-
value:
|
|
3039
|
-
onChange: (v) =>
|
|
3077
|
+
value: r,
|
|
3078
|
+
onChange: (v) => c((M) => $(M, v.target.value)),
|
|
3040
3079
|
className: `col-span-1 h-8 w-full ${we}`
|
|
3041
3080
|
}
|
|
3042
3081
|
),
|
|
@@ -3068,7 +3107,7 @@ function wa() {
|
|
|
3068
3107
|
var H;
|
|
3069
3108
|
let v = {};
|
|
3070
3109
|
u === "custom" && (v = {
|
|
3071
|
-
min:
|
|
3110
|
+
min: r,
|
|
3072
3111
|
max: f,
|
|
3073
3112
|
ticks: {
|
|
3074
3113
|
stepSize: h
|
|
@@ -3080,10 +3119,10 @@ function wa() {
|
|
|
3080
3119
|
...a == null ? void 0 : a.chartOptions,
|
|
3081
3120
|
scales: {
|
|
3082
3121
|
...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
|
|
3083
|
-
[
|
|
3122
|
+
[l]: {
|
|
3084
3123
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3085
|
-
type:
|
|
3086
|
-
...
|
|
3124
|
+
type: o,
|
|
3125
|
+
...o === "linear" ? v : {}
|
|
3087
3126
|
}
|
|
3088
3127
|
}
|
|
3089
3128
|
},
|
|
@@ -3094,11 +3133,11 @@ function wa() {
|
|
|
3094
3133
|
locale: j
|
|
3095
3134
|
}
|
|
3096
3135
|
};
|
|
3097
|
-
console.log(M),
|
|
3136
|
+
console.log(M), L(M);
|
|
3098
3137
|
}
|
|
3099
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3100
|
-
/* @__PURE__ */ e.jsx(
|
|
3101
|
-
/* @__PURE__ */ e.jsx(
|
|
3138
|
+
return /* @__PURE__ */ e.jsxs(Ue, { onOpenChange: (v) => n(v), children: [
|
|
3139
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(At, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3140
|
+
/* @__PURE__ */ e.jsx(Je, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3102
3141
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3103
3142
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3104
3143
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -3110,12 +3149,12 @@ function wa() {
|
|
|
3110
3149
|
Oe,
|
|
3111
3150
|
{
|
|
3112
3151
|
disabled: K,
|
|
3113
|
-
value:
|
|
3114
|
-
onValueChange: (v) =>
|
|
3152
|
+
value: o,
|
|
3153
|
+
onValueChange: (v) => d(v),
|
|
3115
3154
|
children: [
|
|
3116
3155
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3117
|
-
/* @__PURE__ */ e.jsx(
|
|
3118
|
-
/* @__PURE__ */ e.jsx(
|
|
3156
|
+
/* @__PURE__ */ e.jsx(Le, { id: "type", children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3157
|
+
/* @__PURE__ */ e.jsx(Ee, { children: "Option" }),
|
|
3119
3158
|
/* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
|
|
3120
3159
|
/* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
|
|
3121
3160
|
] }) })
|
|
@@ -3123,10 +3162,10 @@ function wa() {
|
|
|
3123
3162
|
}
|
|
3124
3163
|
)
|
|
3125
3164
|
] }),
|
|
3126
|
-
|
|
3165
|
+
o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3127
3166
|
/* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
|
|
3128
3167
|
/* @__PURE__ */ e.jsxs(
|
|
3129
|
-
|
|
3168
|
+
ws,
|
|
3130
3169
|
{
|
|
3131
3170
|
disabled: K,
|
|
3132
3171
|
id: "scale-option",
|
|
@@ -3136,22 +3175,22 @@ function wa() {
|
|
|
3136
3175
|
defaultValue: "x",
|
|
3137
3176
|
children: [
|
|
3138
3177
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3139
|
-
/* @__PURE__ */ e.jsx(
|
|
3178
|
+
/* @__PURE__ */ e.jsx(De, { value: "auto", id: "r1" }),
|
|
3140
3179
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
|
|
3141
3180
|
] }),
|
|
3142
3181
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3143
|
-
/* @__PURE__ */ e.jsx(
|
|
3182
|
+
/* @__PURE__ */ e.jsx(De, { value: "custom", id: "r2" }),
|
|
3144
3183
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
|
|
3145
3184
|
] })
|
|
3146
3185
|
]
|
|
3147
3186
|
}
|
|
3148
3187
|
)
|
|
3149
3188
|
] }),
|
|
3150
|
-
u === "custom" &&
|
|
3189
|
+
u === "custom" && o == "linear" && D(),
|
|
3151
3190
|
G(),
|
|
3152
|
-
/* @__PURE__ */ e.jsx(
|
|
3191
|
+
/* @__PURE__ */ e.jsx(Et, {}),
|
|
3153
3192
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3154
|
-
|
|
3193
|
+
k,
|
|
3155
3194
|
{
|
|
3156
3195
|
onClick: te,
|
|
3157
3196
|
variant: "secondary",
|
|
@@ -3163,28 +3202,28 @@ function wa() {
|
|
|
3163
3202
|
] }) })
|
|
3164
3203
|
] });
|
|
3165
3204
|
}
|
|
3166
|
-
function
|
|
3167
|
-
var
|
|
3168
|
-
const n = i((
|
|
3205
|
+
function Jn({ idx: s }) {
|
|
3206
|
+
var r;
|
|
3207
|
+
const n = i((c) => {
|
|
3169
3208
|
var f;
|
|
3170
|
-
return (f =
|
|
3209
|
+
return (f = c.card) == null ? void 0 : f.preferences;
|
|
3171
3210
|
}), a = i(
|
|
3172
|
-
(
|
|
3211
|
+
(c) => {
|
|
3173
3212
|
var f;
|
|
3174
|
-
return (f =
|
|
3213
|
+
return (f = c.card.preferences) == null ? void 0 : f.datasetOptions;
|
|
3175
3214
|
}
|
|
3176
3215
|
), t = i(
|
|
3177
|
-
(
|
|
3178
|
-
),
|
|
3179
|
-
function
|
|
3180
|
-
(
|
|
3216
|
+
(c) => c.actions.setCardPreferences
|
|
3217
|
+
), l = (r = n == null ? void 0 : n.chartOptions) == null ? void 0 : r.indexAxis, o = a == null ? void 0 : a.find((c) => c.idx === s);
|
|
3218
|
+
function d(c, f) {
|
|
3219
|
+
(c === "end" || c === "start") && It(Vt());
|
|
3181
3220
|
const m = {
|
|
3182
|
-
display:
|
|
3183
|
-
align:
|
|
3184
|
-
anchor:
|
|
3221
|
+
display: c !== "none",
|
|
3222
|
+
align: c,
|
|
3223
|
+
anchor: c,
|
|
3185
3224
|
clamp: !0
|
|
3186
3225
|
};
|
|
3187
|
-
if (!
|
|
3226
|
+
if (!o)
|
|
3188
3227
|
t({
|
|
3189
3228
|
...n,
|
|
3190
3229
|
datasetOptions: [
|
|
@@ -3196,7 +3235,7 @@ function Un({ idx: s }) {
|
|
|
3196
3235
|
]
|
|
3197
3236
|
});
|
|
3198
3237
|
else {
|
|
3199
|
-
const u = { ...
|
|
3238
|
+
const u = { ...o };
|
|
3200
3239
|
u.datalabels = m;
|
|
3201
3240
|
const S = a == null ? void 0 : a.map(
|
|
3202
3241
|
(h) => h.idx === f ? u : h
|
|
@@ -3207,65 +3246,65 @@ function Un({ idx: s }) {
|
|
|
3207
3246
|
});
|
|
3208
3247
|
}
|
|
3209
3248
|
}
|
|
3210
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3211
|
-
/* @__PURE__ */ e.jsx(
|
|
3212
|
-
/* @__PURE__ */ e.jsx(
|
|
3249
|
+
return /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
3250
|
+
/* @__PURE__ */ e.jsx(Ge, { children: /* @__PURE__ */ e.jsx(gn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
3251
|
+
/* @__PURE__ */ e.jsx(Je, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3213
3252
|
/* @__PURE__ */ e.jsx(
|
|
3214
|
-
|
|
3253
|
+
k,
|
|
3215
3254
|
{
|
|
3216
|
-
onClick: () =>
|
|
3255
|
+
onClick: () => d("none", s),
|
|
3217
3256
|
size: "sm",
|
|
3218
3257
|
variant: "secondary",
|
|
3219
3258
|
className: "h-7 p-1 text-xs font-normal",
|
|
3220
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3259
|
+
children: /* @__PURE__ */ e.jsx(Dt, { className: "size-4" })
|
|
3221
3260
|
}
|
|
3222
3261
|
),
|
|
3223
3262
|
/* @__PURE__ */ e.jsx(
|
|
3224
|
-
|
|
3263
|
+
k,
|
|
3225
3264
|
{
|
|
3226
|
-
onClick: () =>
|
|
3265
|
+
onClick: () => d("start", s),
|
|
3227
3266
|
size: "sm",
|
|
3228
3267
|
variant: "secondary",
|
|
3229
3268
|
className: "h-7 p-1 text-xs font-normal",
|
|
3230
3269
|
children: /* @__PURE__ */ e.jsx(
|
|
3231
|
-
|
|
3270
|
+
rn,
|
|
3232
3271
|
{
|
|
3233
3272
|
className: Y("h-4 w-4", {
|
|
3234
|
-
"rotate-90":
|
|
3273
|
+
"rotate-90": l === "y"
|
|
3235
3274
|
})
|
|
3236
3275
|
}
|
|
3237
3276
|
)
|
|
3238
3277
|
}
|
|
3239
3278
|
),
|
|
3240
3279
|
/* @__PURE__ */ e.jsx(
|
|
3241
|
-
|
|
3280
|
+
k,
|
|
3242
3281
|
{
|
|
3243
|
-
onClick: () =>
|
|
3282
|
+
onClick: () => d("center", s),
|
|
3244
3283
|
size: "sm",
|
|
3245
3284
|
variant: "secondary",
|
|
3246
3285
|
className: "h-7 p-1 text-xs font-normal",
|
|
3247
3286
|
children: /* @__PURE__ */ e.jsx(
|
|
3248
|
-
|
|
3287
|
+
on,
|
|
3249
3288
|
{
|
|
3250
3289
|
className: Y("h-4 w-4", {
|
|
3251
|
-
"rotate-90":
|
|
3290
|
+
"rotate-90": l === "y"
|
|
3252
3291
|
})
|
|
3253
3292
|
}
|
|
3254
3293
|
)
|
|
3255
3294
|
}
|
|
3256
3295
|
),
|
|
3257
3296
|
/* @__PURE__ */ e.jsx(
|
|
3258
|
-
|
|
3297
|
+
k,
|
|
3259
3298
|
{
|
|
3260
|
-
onClick: () =>
|
|
3299
|
+
onClick: () => d("end", s),
|
|
3261
3300
|
size: "sm",
|
|
3262
3301
|
variant: "secondary",
|
|
3263
3302
|
className: "h-7 p-1 text-xs font-normal",
|
|
3264
3303
|
children: /* @__PURE__ */ e.jsx(
|
|
3265
|
-
|
|
3304
|
+
ln,
|
|
3266
3305
|
{
|
|
3267
3306
|
className: Y("h-4 w-4", {
|
|
3268
|
-
"rotate-90":
|
|
3307
|
+
"rotate-90": l === "y"
|
|
3269
3308
|
})
|
|
3270
3309
|
}
|
|
3271
3310
|
)
|
|
@@ -3274,71 +3313,71 @@ function Un({ idx: s }) {
|
|
|
3274
3313
|
] }) })
|
|
3275
3314
|
] });
|
|
3276
3315
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const s = i((
|
|
3279
|
-
(
|
|
3316
|
+
function Oa() {
|
|
3317
|
+
const s = i((c) => c.card), n = i(
|
|
3318
|
+
(c) => {
|
|
3280
3319
|
var f, m, u;
|
|
3281
|
-
return (u = (m = (f =
|
|
3320
|
+
return (u = (m = (f = c == null ? void 0 : c.card) == null ? void 0 : f.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
|
|
3282
3321
|
}
|
|
3283
3322
|
), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
|
|
3284
|
-
keys:
|
|
3285
|
-
metricKeys:
|
|
3286
|
-
dimensionKeys:
|
|
3323
|
+
keys: l,
|
|
3324
|
+
metricKeys: o,
|
|
3325
|
+
dimensionKeys: d
|
|
3287
3326
|
} = ms(s.data || []);
|
|
3288
|
-
let
|
|
3289
|
-
if (s.type
|
|
3290
|
-
const
|
|
3327
|
+
let r = o;
|
|
3328
|
+
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
3329
|
+
const c = qt({
|
|
3291
3330
|
dataArray: s.data || [],
|
|
3292
|
-
groupKey:
|
|
3293
|
-
pivotKey:
|
|
3294
|
-
valueKey:
|
|
3295
|
-
}), { metricKeys: f } = ms(
|
|
3296
|
-
|
|
3331
|
+
groupKey: d[0],
|
|
3332
|
+
pivotKey: d[1],
|
|
3333
|
+
valueKey: r[0]
|
|
3334
|
+
}), { metricKeys: f } = ms(c);
|
|
3335
|
+
r = f;
|
|
3297
3336
|
}
|
|
3298
|
-
return
|
|
3337
|
+
return l.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3299
3338
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3300
3339
|
/* @__PURE__ */ e.jsx(B, { children: a }),
|
|
3301
|
-
/* @__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:
|
|
3340
|
+
/* @__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: d[0] }) }) })
|
|
3302
3341
|
] }),
|
|
3303
3342
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3304
3343
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3305
3344
|
/* @__PURE__ */ e.jsx(B, { children: t }),
|
|
3306
|
-
/* @__PURE__ */ e.jsx(
|
|
3345
|
+
/* @__PURE__ */ e.jsx(Fa, {})
|
|
3307
3346
|
] }),
|
|
3308
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
3347
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: r.map((c, f) => /* @__PURE__ */ e.jsx(Qn, { col: c, idx: f }, c)) })
|
|
3309
3348
|
] })
|
|
3310
3349
|
] });
|
|
3311
3350
|
}
|
|
3312
|
-
function
|
|
3313
|
-
const a = i((
|
|
3314
|
-
var
|
|
3315
|
-
return (
|
|
3351
|
+
function Qn({ col: s, idx: n }) {
|
|
3352
|
+
const a = i((r) => {
|
|
3353
|
+
var c;
|
|
3354
|
+
return (c = r.card) == null ? void 0 : c.preferences;
|
|
3316
3355
|
}), t = i(
|
|
3317
|
-
(
|
|
3318
|
-
var
|
|
3319
|
-
return (
|
|
3356
|
+
(r) => {
|
|
3357
|
+
var c;
|
|
3358
|
+
return (c = r.card.preferences) == null ? void 0 : c.datasetOptions;
|
|
3320
3359
|
}
|
|
3321
|
-
),
|
|
3322
|
-
function r
|
|
3323
|
-
if (!
|
|
3324
|
-
|
|
3360
|
+
), l = t == null ? void 0 : t.find((r) => r.idx === n), { setCardPreferences: o } = i((r) => r.actions);
|
|
3361
|
+
function d(r) {
|
|
3362
|
+
if (!l)
|
|
3363
|
+
o({
|
|
3325
3364
|
...a,
|
|
3326
3365
|
datasetOptions: [
|
|
3327
3366
|
...t || [],
|
|
3328
3367
|
{
|
|
3329
3368
|
idx: n,
|
|
3330
|
-
type:
|
|
3331
|
-
fill:
|
|
3369
|
+
type: r === "area" ? "line" : r,
|
|
3370
|
+
fill: r === "area" ? "origin" : ""
|
|
3332
3371
|
}
|
|
3333
3372
|
]
|
|
3334
3373
|
});
|
|
3335
3374
|
else {
|
|
3336
|
-
const
|
|
3337
|
-
|
|
3375
|
+
const c = { ...l };
|
|
3376
|
+
c.type = r === "area" ? "line" : r, c.fill = r === "area" ? "origin" : "";
|
|
3338
3377
|
const f = t == null ? void 0 : t.map(
|
|
3339
|
-
(m) => m.idx === n ?
|
|
3378
|
+
(m) => m.idx === n ? c : m
|
|
3340
3379
|
);
|
|
3341
|
-
|
|
3380
|
+
o({
|
|
3342
3381
|
...a,
|
|
3343
3382
|
datasetOptions: f
|
|
3344
3383
|
});
|
|
@@ -3348,23 +3387,23 @@ function Gn({ col: s, idx: n }) {
|
|
|
3348
3387
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
3349
3388
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3350
3389
|
/* @__PURE__ */ e.jsx(
|
|
3351
|
-
|
|
3390
|
+
Fs,
|
|
3352
3391
|
{
|
|
3353
|
-
onClick: () =>
|
|
3392
|
+
onClick: () => d("bar"),
|
|
3354
3393
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3355
3394
|
}
|
|
3356
3395
|
),
|
|
3357
3396
|
/* @__PURE__ */ e.jsx(
|
|
3358
|
-
|
|
3397
|
+
Os,
|
|
3359
3398
|
{
|
|
3360
|
-
onClick: () =>
|
|
3399
|
+
onClick: () => d("line"),
|
|
3361
3400
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3362
3401
|
}
|
|
3363
3402
|
),
|
|
3364
3403
|
/* @__PURE__ */ e.jsx(
|
|
3365
|
-
|
|
3404
|
+
Yt,
|
|
3366
3405
|
{
|
|
3367
|
-
onClick: () =>
|
|
3406
|
+
onClick: () => d("area"),
|
|
3368
3407
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3369
3408
|
}
|
|
3370
3409
|
),
|
|
@@ -3375,16 +3414,16 @@ function Gn({ col: s, idx: n }) {
|
|
|
3375
3414
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3376
3415
|
}
|
|
3377
3416
|
),
|
|
3378
|
-
/* @__PURE__ */ e.jsx(
|
|
3417
|
+
/* @__PURE__ */ e.jsx(Jn, { idx: n })
|
|
3379
3418
|
] })
|
|
3380
3419
|
] });
|
|
3381
3420
|
}
|
|
3382
|
-
function
|
|
3421
|
+
function Wn({
|
|
3383
3422
|
cardType: s
|
|
3384
3423
|
}) {
|
|
3385
3424
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3386
|
-
/* @__PURE__ */ e.jsxs(
|
|
3387
|
-
/* @__PURE__ */ e.jsx(R, { children: `${
|
|
3425
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3426
|
+
/* @__PURE__ */ e.jsx(R, { children: `${zs(s)} Chart` }),
|
|
3388
3427
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3389
3428
|
/* @__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" }),
|
|
3390
3429
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -3408,31 +3447,31 @@ function Jn({
|
|
|
3408
3447
|
] })
|
|
3409
3448
|
] })
|
|
3410
3449
|
] }),
|
|
3411
|
-
/* @__PURE__ */ e.jsxs(
|
|
3450
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3412
3451
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3413
3452
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3414
|
-
/* @__PURE__ */ e.jsx(
|
|
3415
|
-
/* @__PURE__ */ e.jsx(
|
|
3453
|
+
/* @__PURE__ */ e.jsx(as, {}),
|
|
3454
|
+
/* @__PURE__ */ e.jsx(Oa, {})
|
|
3416
3455
|
] })
|
|
3417
3456
|
] }),
|
|
3418
|
-
/* @__PURE__ */ e.jsxs(
|
|
3457
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3419
3458
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3420
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3459
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3421
3460
|
] })
|
|
3422
3461
|
] }) });
|
|
3423
3462
|
}
|
|
3424
|
-
function
|
|
3425
|
-
var
|
|
3463
|
+
function Ts() {
|
|
3464
|
+
var l, o, d;
|
|
3426
3465
|
const s = i(
|
|
3427
|
-
(
|
|
3428
|
-
), n = i((
|
|
3429
|
-
function t(
|
|
3466
|
+
(r) => r.card.cfg
|
|
3467
|
+
), n = i((r) => r.actions.setCardCfg), a = i((r) => r.card.type);
|
|
3468
|
+
function t(r) {
|
|
3430
3469
|
var m;
|
|
3431
|
-
const
|
|
3470
|
+
const c = {
|
|
3432
3471
|
datalabels: {
|
|
3433
|
-
display:
|
|
3434
|
-
align:
|
|
3435
|
-
anchor:
|
|
3472
|
+
display: r !== "none",
|
|
3473
|
+
align: r,
|
|
3474
|
+
anchor: r,
|
|
3436
3475
|
clamp: !0
|
|
3437
3476
|
}
|
|
3438
3477
|
}, f = {
|
|
@@ -3441,27 +3480,27 @@ function Os() {
|
|
|
3441
3480
|
...s == null ? void 0 : s.options,
|
|
3442
3481
|
plugins: {
|
|
3443
3482
|
...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
|
|
3444
|
-
...
|
|
3483
|
+
...c
|
|
3445
3484
|
}
|
|
3446
3485
|
}
|
|
3447
3486
|
};
|
|
3448
|
-
n(f), console.log(
|
|
3487
|
+
n(f), console.log(r);
|
|
3449
3488
|
}
|
|
3450
3489
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3451
3490
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3452
3491
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
3453
|
-
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(
|
|
3492
|
+
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Fa, {})
|
|
3454
3493
|
] }),
|
|
3455
3494
|
/* @__PURE__ */ e.jsxs(
|
|
3456
3495
|
Oe,
|
|
3457
3496
|
{
|
|
3458
|
-
value: (
|
|
3497
|
+
value: (d = (o = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : d.anchor,
|
|
3459
3498
|
onValueChange: t,
|
|
3460
3499
|
defaultValue: "none",
|
|
3461
3500
|
children: [
|
|
3462
3501
|
/* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
|
|
3463
|
-
/* @__PURE__ */ e.jsx(
|
|
3464
|
-
/* @__PURE__ */ e.jsx(
|
|
3502
|
+
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3503
|
+
/* @__PURE__ */ e.jsx(Ee, { children: "Data Labels" }),
|
|
3465
3504
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
|
|
3466
3505
|
a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
|
|
3467
3506
|
/* @__PURE__ */ e.jsx(X, { value: "center", children: "Center" }),
|
|
@@ -3472,13 +3511,13 @@ function Os() {
|
|
|
3472
3511
|
)
|
|
3473
3512
|
] });
|
|
3474
3513
|
}
|
|
3475
|
-
function
|
|
3514
|
+
function Yn({
|
|
3476
3515
|
cardType: s
|
|
3477
3516
|
}) {
|
|
3478
3517
|
function n(a) {
|
|
3479
|
-
const t = "SELECT label, [group], x-axis, y-axis, radius FROM table",
|
|
3518
|
+
const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", l = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
3480
3519
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3481
|
-
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t :
|
|
3520
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : l }),
|
|
3482
3521
|
/* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
|
|
3483
3522
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
3484
3523
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
@@ -3492,7 +3531,7 @@ function Qn({
|
|
|
3492
3531
|
"a",
|
|
3493
3532
|
{
|
|
3494
3533
|
target: "_blank",
|
|
3495
|
-
onClick: (
|
|
3534
|
+
onClick: (o) => o.stopPropagation(),
|
|
3496
3535
|
className: "text-blue-700",
|
|
3497
3536
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
3498
3537
|
children: "example"
|
|
@@ -3503,21 +3542,21 @@ function Qn({
|
|
|
3503
3542
|
] });
|
|
3504
3543
|
}
|
|
3505
3544
|
return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3506
|
-
/* @__PURE__ */ e.jsxs(
|
|
3507
|
-
/* @__PURE__ */ e.jsx(R, { children: `${
|
|
3545
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3546
|
+
/* @__PURE__ */ e.jsx(R, { children: `${zs(s)} Chart` }),
|
|
3508
3547
|
/* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3509
3548
|
] }),
|
|
3510
|
-
/* @__PURE__ */ e.jsxs(
|
|
3549
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3511
3550
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3512
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3551
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ts, {}) })
|
|
3513
3552
|
] }),
|
|
3514
|
-
/* @__PURE__ */ e.jsxs(
|
|
3553
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3515
3554
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3516
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3555
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3517
3556
|
] })
|
|
3518
3557
|
] }) });
|
|
3519
3558
|
}
|
|
3520
|
-
const
|
|
3559
|
+
const Xn = {
|
|
3521
3560
|
datasets: [
|
|
3522
3561
|
{
|
|
3523
3562
|
type: "line",
|
|
@@ -3530,7 +3569,7 @@ const Wn = {
|
|
|
3530
3569
|
data: []
|
|
3531
3570
|
}
|
|
3532
3571
|
]
|
|
3533
|
-
},
|
|
3572
|
+
}, Zn = {
|
|
3534
3573
|
datasets: [
|
|
3535
3574
|
{
|
|
3536
3575
|
fill: "origin",
|
|
@@ -3540,7 +3579,7 @@ const Wn = {
|
|
|
3540
3579
|
}
|
|
3541
3580
|
]
|
|
3542
3581
|
};
|
|
3543
|
-
function
|
|
3582
|
+
function er() {
|
|
3544
3583
|
const s = i((n) => n.card.type);
|
|
3545
3584
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
3546
3585
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3549,18 +3588,18 @@ function Xn() {
|
|
|
3549
3588
|
className: " ",
|
|
3550
3589
|
type: "single",
|
|
3551
3590
|
collapsible: !0,
|
|
3552
|
-
children:
|
|
3591
|
+
children: sr(s)
|
|
3553
3592
|
}
|
|
3554
3593
|
),
|
|
3555
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3556
|
-
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3557
|
-
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
3594
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(as, {}) }),
|
|
3595
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ts, {}) }),
|
|
3596
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3558
3597
|
] });
|
|
3559
3598
|
}
|
|
3560
|
-
function
|
|
3599
|
+
function sr(s) {
|
|
3561
3600
|
if (["line", "bar"].includes(s))
|
|
3562
3601
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3563
|
-
/* @__PURE__ */ e.jsxs(
|
|
3602
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3564
3603
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3565
3604
|
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3566
3605
|
/* @__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" }),
|
|
@@ -3570,7 +3609,7 @@ function Zn(s) {
|
|
|
3570
3609
|
] })
|
|
3571
3610
|
] })
|
|
3572
3611
|
] }),
|
|
3573
|
-
/* @__PURE__ */ e.jsxs(
|
|
3612
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3574
3613
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
|
|
3575
3614
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3576
3615
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
@@ -3578,10 +3617,10 @@ function Zn(s) {
|
|
|
3578
3617
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
3579
3618
|
" and change the `type` property in the dataset."
|
|
3580
3619
|
] }),
|
|
3581
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3620
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Xn, null, 2) })
|
|
3582
3621
|
] })
|
|
3583
3622
|
] }),
|
|
3584
|
-
/* @__PURE__ */ e.jsxs(
|
|
3623
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3585
3624
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
|
|
3586
3625
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3587
3626
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
@@ -3599,12 +3638,12 @@ function Zn(s) {
|
|
|
3599
3638
|
),
|
|
3600
3639
|
"for more options."
|
|
3601
3640
|
] }),
|
|
3602
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3641
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Zn, null, 2) })
|
|
3603
3642
|
] })
|
|
3604
3643
|
] })
|
|
3605
3644
|
] });
|
|
3606
3645
|
if (s === "bubble")
|
|
3607
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3646
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3608
3647
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3609
3648
|
"How to create a ",
|
|
3610
3649
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
@@ -3622,7 +3661,7 @@ function Zn(s) {
|
|
|
3622
3661
|
] })
|
|
3623
3662
|
] }) });
|
|
3624
3663
|
if (s === "scatter")
|
|
3625
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3664
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3626
3665
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3627
3666
|
"How to create a ",
|
|
3628
3667
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
@@ -3639,7 +3678,7 @@ function Zn(s) {
|
|
|
3639
3678
|
] })
|
|
3640
3679
|
] }) });
|
|
3641
3680
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3642
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3681
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3643
3682
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3644
3683
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3645
3684
|
" ",
|
|
@@ -3654,8 +3693,8 @@ function Zn(s) {
|
|
|
3654
3693
|
] })
|
|
3655
3694
|
] }) });
|
|
3656
3695
|
}
|
|
3657
|
-
function
|
|
3658
|
-
var
|
|
3696
|
+
function ar() {
|
|
3697
|
+
var c, f, m, u, S;
|
|
3659
3698
|
const s = i((h) => h.card.preferences), n = i(
|
|
3660
3699
|
(h) => h.actions.setCardPreferences
|
|
3661
3700
|
), a = i(
|
|
@@ -3672,7 +3711,7 @@ function er() {
|
|
|
3672
3711
|
var x, g;
|
|
3673
3712
|
return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
|
|
3674
3713
|
}
|
|
3675
|
-
),
|
|
3714
|
+
), l = i(
|
|
3676
3715
|
(h) => {
|
|
3677
3716
|
var x, g;
|
|
3678
3717
|
return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
|
|
@@ -3681,20 +3720,20 @@ function er() {
|
|
|
3681
3720
|
i(
|
|
3682
3721
|
(h) => h.actions.setFilterOnClickField
|
|
3683
3722
|
);
|
|
3684
|
-
const
|
|
3723
|
+
const o = i(
|
|
3685
3724
|
(h) => {
|
|
3686
3725
|
var x, g;
|
|
3687
3726
|
return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
|
|
3688
3727
|
}
|
|
3689
|
-
) || [],
|
|
3728
|
+
) || [], d = i(
|
|
3690
3729
|
(h) => h.actions.setColorRanges
|
|
3691
|
-
),
|
|
3730
|
+
), r = [...new Set(Hs.map((h) => h.currency))];
|
|
3692
3731
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
3693
3732
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3694
3733
|
/* @__PURE__ */ e.jsx(
|
|
3695
|
-
|
|
3734
|
+
Ke,
|
|
3696
3735
|
{
|
|
3697
|
-
checked: !!((
|
|
3736
|
+
checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
|
|
3698
3737
|
onCheckedChange: (h) => {
|
|
3699
3738
|
n({
|
|
3700
3739
|
...s,
|
|
@@ -3728,9 +3767,9 @@ function er() {
|
|
|
3728
3767
|
},
|
|
3729
3768
|
children: [
|
|
3730
3769
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3731
|
-
/* @__PURE__ */ e.jsx(
|
|
3732
|
-
/* @__PURE__ */ e.jsx(
|
|
3733
|
-
|
|
3770
|
+
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3771
|
+
/* @__PURE__ */ e.jsx(Ee, { children: "Format" }),
|
|
3772
|
+
Hs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
|
|
3734
3773
|
] }) })
|
|
3735
3774
|
]
|
|
3736
3775
|
}
|
|
@@ -3741,7 +3780,7 @@ function er() {
|
|
|
3741
3780
|
/* @__PURE__ */ e.jsxs(
|
|
3742
3781
|
Oe,
|
|
3743
3782
|
{
|
|
3744
|
-
value:
|
|
3783
|
+
value: l || "none",
|
|
3745
3784
|
onValueChange: (h) => {
|
|
3746
3785
|
var x, g, z;
|
|
3747
3786
|
return a(
|
|
@@ -3753,10 +3792,10 @@ function er() {
|
|
|
3753
3792
|
},
|
|
3754
3793
|
children: [
|
|
3755
3794
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3756
|
-
/* @__PURE__ */ e.jsx(
|
|
3757
|
-
/* @__PURE__ */ e.jsx(
|
|
3795
|
+
/* @__PURE__ */ e.jsx(Le, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3796
|
+
/* @__PURE__ */ e.jsx(Ee, { children: "Currency" }),
|
|
3758
3797
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
3759
|
-
|
|
3798
|
+
r.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
|
|
3760
3799
|
] }) })
|
|
3761
3800
|
]
|
|
3762
3801
|
}
|
|
@@ -3781,7 +3820,7 @@ function er() {
|
|
|
3781
3820
|
},
|
|
3782
3821
|
children: [
|
|
3783
3822
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
3784
|
-
/* @__PURE__ */ e.jsx(
|
|
3823
|
+
/* @__PURE__ */ e.jsx(Le, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h)) })
|
|
3785
3824
|
]
|
|
3786
3825
|
}
|
|
3787
3826
|
)
|
|
@@ -3810,18 +3849,18 @@ function er() {
|
|
|
3810
3849
|
] }) }),
|
|
3811
3850
|
/* @__PURE__ */ e.jsx(ks, { className: "my-3" }),
|
|
3812
3851
|
/* @__PURE__ */ e.jsx(
|
|
3813
|
-
|
|
3852
|
+
Rt,
|
|
3814
3853
|
{
|
|
3815
|
-
colorRanges:
|
|
3816
|
-
setColorRanges:
|
|
3854
|
+
colorRanges: o,
|
|
3855
|
+
setColorRanges: d
|
|
3817
3856
|
}
|
|
3818
3857
|
)
|
|
3819
3858
|
] })
|
|
3820
3859
|
] });
|
|
3821
3860
|
}
|
|
3822
|
-
function
|
|
3861
|
+
function tr() {
|
|
3823
3862
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3824
|
-
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3863
|
+
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3825
3864
|
/* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
|
|
3826
3865
|
/* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
|
|
3827
3866
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -3845,18 +3884,51 @@ function sr() {
|
|
|
3845
3884
|
] })
|
|
3846
3885
|
] })
|
|
3847
3886
|
] }) }),
|
|
3848
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
3887
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(ar, {}) }),
|
|
3849
3888
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
3850
3889
|
/* @__PURE__ */ e.jsx("div", {})
|
|
3851
3890
|
] });
|
|
3852
3891
|
}
|
|
3853
|
-
function
|
|
3892
|
+
function nr() {
|
|
3893
|
+
var t;
|
|
3894
|
+
const s = i((l) => l.card.preferences), { setCardPreferences: n } = i((l) => l.actions);
|
|
3895
|
+
function a(l) {
|
|
3896
|
+
n({
|
|
3897
|
+
...s,
|
|
3898
|
+
textVisualOptions: {
|
|
3899
|
+
...s == null ? void 0 : s.textVisualOptions,
|
|
3900
|
+
isDynamicText: l === "dynamic"
|
|
3901
|
+
}
|
|
3902
|
+
});
|
|
3903
|
+
}
|
|
3904
|
+
return /* @__PURE__ */ e.jsxs(
|
|
3905
|
+
ws,
|
|
3906
|
+
{
|
|
3907
|
+
value: (t = s == null ? void 0 : s.textVisualOptions) != null && t.isDynamicText ? "dynamic" : "static",
|
|
3908
|
+
onValueChange: a,
|
|
3909
|
+
className: "flex gap-3",
|
|
3910
|
+
defaultValue: "x",
|
|
3911
|
+
children: [
|
|
3912
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3913
|
+
/* @__PURE__ */ e.jsx(De, { value: "static", id: "r1" }),
|
|
3914
|
+
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
|
|
3915
|
+
] }),
|
|
3916
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3917
|
+
/* @__PURE__ */ e.jsx(De, { value: "dynamic", id: "r2" }),
|
|
3918
|
+
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
|
|
3919
|
+
] })
|
|
3920
|
+
]
|
|
3921
|
+
}
|
|
3922
|
+
);
|
|
3923
|
+
}
|
|
3924
|
+
function Ye({
|
|
3854
3925
|
cardType: s,
|
|
3855
|
-
docContent: n
|
|
3926
|
+
docContent: n,
|
|
3927
|
+
suffix: a = "Chart"
|
|
3856
3928
|
}) {
|
|
3857
3929
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3858
|
-
/* @__PURE__ */ e.jsxs(
|
|
3859
|
-
/* @__PURE__ */ e.jsx(R, { children: `${
|
|
3930
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3931
|
+
/* @__PURE__ */ e.jsx(R, { children: `${zs(s)} ${a}` }),
|
|
3860
3932
|
/* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3861
3933
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
3862
3934
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -3869,7 +3941,7 @@ function cs({
|
|
|
3869
3941
|
"a",
|
|
3870
3942
|
{
|
|
3871
3943
|
target: "_blank",
|
|
3872
|
-
onClick: (
|
|
3944
|
+
onClick: (t) => t.stopPropagation(),
|
|
3873
3945
|
className: "text-blue-700",
|
|
3874
3946
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
3875
3947
|
children: "example"
|
|
@@ -3879,22 +3951,23 @@ function cs({
|
|
|
3879
3951
|
] })
|
|
3880
3952
|
] }) })
|
|
3881
3953
|
] }),
|
|
3882
|
-
/* @__PURE__ */ e.jsxs(
|
|
3954
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3883
3955
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3884
3956
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3885
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
3886
|
-
/* @__PURE__ */ e.jsx(
|
|
3957
|
+
s === "range" && /* @__PURE__ */ e.jsx(as, {}),
|
|
3958
|
+
s !== "text" && /* @__PURE__ */ e.jsx(Ts, {}),
|
|
3959
|
+
s === "text" && /* @__PURE__ */ e.jsx(nr, {})
|
|
3887
3960
|
] })
|
|
3888
3961
|
] }),
|
|
3889
|
-
|
|
3962
|
+
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3890
3963
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3891
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3964
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3892
3965
|
] })
|
|
3893
3966
|
] }) });
|
|
3894
3967
|
}
|
|
3895
|
-
function
|
|
3968
|
+
function rr() {
|
|
3896
3969
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3897
|
-
/* @__PURE__ */ e.jsxs(
|
|
3970
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3898
3971
|
/* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
|
|
3899
3972
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3900
3973
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
|
|
@@ -3919,23 +3992,23 @@ function ar() {
|
|
|
3919
3992
|
] })
|
|
3920
3993
|
] })
|
|
3921
3994
|
] }),
|
|
3922
|
-
/* @__PURE__ */ e.jsxs(
|
|
3995
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3923
3996
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3924
3997
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3925
|
-
/* @__PURE__ */ e.jsx(
|
|
3926
|
-
/* @__PURE__ */ e.jsx(
|
|
3998
|
+
/* @__PURE__ */ e.jsx(as, {}),
|
|
3999
|
+
/* @__PURE__ */ e.jsx(Oa, {})
|
|
3927
4000
|
] })
|
|
3928
4001
|
] }),
|
|
3929
|
-
/* @__PURE__ */ e.jsxs(
|
|
4002
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3930
4003
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3931
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
4004
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3932
4005
|
] })
|
|
3933
4006
|
] }) });
|
|
3934
4007
|
}
|
|
3935
|
-
function
|
|
4008
|
+
function lr({}) {
|
|
3936
4009
|
const s = i((t) => {
|
|
3937
|
-
var
|
|
3938
|
-
return (
|
|
4010
|
+
var l;
|
|
4011
|
+
return (l = t.card) == null ? void 0 : l.preferences;
|
|
3939
4012
|
}), n = i(
|
|
3940
4013
|
(t) => t.actions.setCardPreferences
|
|
3941
4014
|
), a = (t) => {
|
|
@@ -3945,12 +4018,12 @@ function tr({}) {
|
|
|
3945
4018
|
});
|
|
3946
4019
|
};
|
|
3947
4020
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
3948
|
-
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(
|
|
4021
|
+
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3949
4022
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3950
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
4023
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3951
4024
|
] }) }),
|
|
3952
4025
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3953
|
-
/* @__PURE__ */ e.jsx(
|
|
4026
|
+
/* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
|
|
3954
4027
|
/* @__PURE__ */ e.jsx(
|
|
3955
4028
|
"label",
|
|
3956
4029
|
{
|
|
@@ -3962,7 +4035,7 @@ function tr({}) {
|
|
|
3962
4035
|
] })
|
|
3963
4036
|
] });
|
|
3964
4037
|
}
|
|
3965
|
-
const
|
|
4038
|
+
const ir = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3966
4039
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
3967
4040
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3968
4041
|
"See ",
|
|
@@ -3978,7 +4051,7 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
3978
4051
|
),
|
|
3979
4052
|
" in the docs."
|
|
3980
4053
|
] })
|
|
3981
|
-
] }),
|
|
4054
|
+
] }), or = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3982
4055
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
|
|
3983
4056
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3984
4057
|
"See ",
|
|
@@ -3994,39 +4067,65 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
3994
4067
|
),
|
|
3995
4068
|
" in the docs."
|
|
3996
4069
|
] })
|
|
4070
|
+
] }), cr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4071
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
|
|
4072
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4073
|
+
"See ",
|
|
4074
|
+
/* @__PURE__ */ e.jsx(
|
|
4075
|
+
"a",
|
|
4076
|
+
{
|
|
4077
|
+
target: "_blank",
|
|
4078
|
+
onClick: (s) => s.stopPropagation(),
|
|
4079
|
+
className: "text-blue-700",
|
|
4080
|
+
href: "https://docs.semaphor.cloud/concepts/visuals#text-visual",
|
|
4081
|
+
children: "example"
|
|
4082
|
+
}
|
|
4083
|
+
),
|
|
4084
|
+
" in the docs."
|
|
4085
|
+
] })
|
|
3997
4086
|
] });
|
|
3998
|
-
function
|
|
4087
|
+
function dr() {
|
|
3999
4088
|
const s = i((a) => a.card.type);
|
|
4000
4089
|
function n(a) {
|
|
4001
4090
|
switch (a) {
|
|
4002
4091
|
case "stackedBar":
|
|
4003
|
-
|
|
4092
|
+
case "stackedLine":
|
|
4093
|
+
return /* @__PURE__ */ e.jsx(rr, {});
|
|
4004
4094
|
case "pyramid":
|
|
4005
|
-
return /* @__PURE__ */ e.jsx(
|
|
4095
|
+
return /* @__PURE__ */ e.jsx(Ye, { docContent: ir, cardType: a });
|
|
4006
4096
|
case "kpi":
|
|
4007
|
-
return /* @__PURE__ */ e.jsx(
|
|
4097
|
+
return /* @__PURE__ */ e.jsx(tr, {});
|
|
4008
4098
|
case "line":
|
|
4009
4099
|
case "bar":
|
|
4010
|
-
return /* @__PURE__ */ e.jsx(
|
|
4100
|
+
return /* @__PURE__ */ e.jsx(Wn, { cardType: a });
|
|
4011
4101
|
case "range":
|
|
4012
|
-
return /* @__PURE__ */ e.jsx(
|
|
4102
|
+
return /* @__PURE__ */ e.jsx(Ye, { docContent: or, cardType: a });
|
|
4013
4103
|
case "pie":
|
|
4014
4104
|
case "doughnut":
|
|
4015
4105
|
case "polarArea":
|
|
4016
4106
|
case "radar":
|
|
4017
|
-
return /* @__PURE__ */ e.jsx(
|
|
4107
|
+
return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
|
|
4018
4108
|
case "bubble":
|
|
4019
4109
|
case "scatter":
|
|
4020
|
-
return /* @__PURE__ */ e.jsx(
|
|
4110
|
+
return /* @__PURE__ */ e.jsx(Yn, { cardType: a });
|
|
4021
4111
|
case "table":
|
|
4022
|
-
return /* @__PURE__ */ e.jsx(
|
|
4112
|
+
return /* @__PURE__ */ e.jsx(lr, { cardType: a });
|
|
4113
|
+
case "text":
|
|
4114
|
+
return /* @__PURE__ */ e.jsx(
|
|
4115
|
+
Ye,
|
|
4116
|
+
{
|
|
4117
|
+
docContent: cr,
|
|
4118
|
+
cardType: a,
|
|
4119
|
+
suffix: "Visual"
|
|
4120
|
+
}
|
|
4121
|
+
);
|
|
4023
4122
|
default:
|
|
4024
|
-
return /* @__PURE__ */ e.jsx(
|
|
4123
|
+
return /* @__PURE__ */ e.jsx(er, {});
|
|
4025
4124
|
}
|
|
4026
4125
|
}
|
|
4027
4126
|
return /* @__PURE__ */ e.jsx(Ss, { className: "h-full w-full text-sm", children: n(s) });
|
|
4028
4127
|
}
|
|
4029
|
-
function
|
|
4128
|
+
function hr() {
|
|
4030
4129
|
const s = i((n) => n.isShowingVisual);
|
|
4031
4130
|
return /* @__PURE__ */ e.jsxs(
|
|
4032
4131
|
us,
|
|
@@ -4041,7 +4140,7 @@ function ir() {
|
|
|
4041
4140
|
className: "flex",
|
|
4042
4141
|
minSize: 20,
|
|
4043
4142
|
defaultSize: 40,
|
|
4044
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4143
|
+
children: /* @__PURE__ */ e.jsx(_n, {})
|
|
4045
4144
|
}
|
|
4046
4145
|
),
|
|
4047
4146
|
/* @__PURE__ */ e.jsx(xs, { withHandle: !0, className: "border" }),
|
|
@@ -4060,36 +4159,36 @@ function ir() {
|
|
|
4060
4159
|
minSize: 20,
|
|
4061
4160
|
defaultSize: 25,
|
|
4062
4161
|
maxSize: 30,
|
|
4063
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4162
|
+
children: /* @__PURE__ */ e.jsx(dr, {})
|
|
4064
4163
|
}
|
|
4065
4164
|
) }),
|
|
4066
4165
|
/* @__PURE__ */ e.jsx(xs, { className: "border" }),
|
|
4067
|
-
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(
|
|
4068
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
4166
|
+
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Ks, {}) })
|
|
4167
|
+
] }) : /* @__PURE__ */ e.jsx(Ks, {})
|
|
4069
4168
|
}
|
|
4070
4169
|
)
|
|
4071
4170
|
]
|
|
4072
4171
|
}
|
|
4073
4172
|
);
|
|
4074
4173
|
}
|
|
4075
|
-
function
|
|
4076
|
-
const t = i((
|
|
4174
|
+
function mr({ authToken: s, onSave: n, onClose: a }) {
|
|
4175
|
+
const t = i((d) => d.actions.setOnSave), l = i((d) => d.actions.setOnClose), o = w((d) => d.actions.setAuthToken);
|
|
4077
4176
|
return P(() => {
|
|
4078
|
-
n && t(n), a &&
|
|
4079
|
-
}, [n, t, a,
|
|
4080
|
-
s && s.accessToken &&
|
|
4081
|
-
}, [s,
|
|
4082
|
-
/* @__PURE__ */ e.jsx(
|
|
4083
|
-
/* @__PURE__ */ e.jsx(
|
|
4177
|
+
n && t(n), a && l(a);
|
|
4178
|
+
}, [n, t, a, l]), P(() => {
|
|
4179
|
+
s && s.accessToken && o(s);
|
|
4180
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(_t, { className: "rounded-none", role: "editor-panel", children: [
|
|
4181
|
+
/* @__PURE__ */ e.jsx(Ht, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(fa, {}) }),
|
|
4182
|
+
/* @__PURE__ */ e.jsx(Bt, { children: /* @__PURE__ */ e.jsx(hr, {}) })
|
|
4084
4183
|
] });
|
|
4085
4184
|
}
|
|
4086
|
-
function
|
|
4087
|
-
|
|
4088
|
-
const s =
|
|
4089
|
-
function
|
|
4090
|
-
s && (t(s,
|
|
4185
|
+
function ur() {
|
|
4186
|
+
w((d) => d.selectedCardId);
|
|
4187
|
+
const s = w((d) => d.selectedSheetId), { setIsVisualEditing: n } = w((d) => d.actions), a = w((d) => d.isVisualEditing), t = w((d) => d.actions.updateFrame);
|
|
4188
|
+
function l(d) {
|
|
4189
|
+
s && (t(s, d), n(!1));
|
|
4091
4190
|
}
|
|
4092
|
-
function
|
|
4191
|
+
function o() {
|
|
4093
4192
|
n(!1);
|
|
4094
4193
|
}
|
|
4095
4194
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -4100,19 +4199,19 @@ function cr() {
|
|
|
4100
4199
|
block: a,
|
|
4101
4200
|
hidden: !a
|
|
4102
4201
|
}),
|
|
4103
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4202
|
+
children: /* @__PURE__ */ e.jsx(mr, { onSave: l, onClose: o })
|
|
4104
4203
|
}
|
|
4105
4204
|
);
|
|
4106
4205
|
}
|
|
4107
|
-
function
|
|
4206
|
+
function xr({
|
|
4108
4207
|
columns: s,
|
|
4109
4208
|
tableName: n
|
|
4110
4209
|
}) {
|
|
4111
|
-
const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName),
|
|
4210
|
+
const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName), l = i((u) => u.selectedSchemaName), o = i((u) => u.selectedTableName), d = w((u) => u.dashboard.filters) || [], r = w((u) => u.actions.addFilter), c = w((u) => u.actions.removeFilter), f = w(
|
|
4112
4211
|
(u) => u.actions.removeFilterValue
|
|
4113
4212
|
);
|
|
4114
4213
|
function m(u) {
|
|
4115
|
-
const S = he(u.column_name), h = he(t || ""), x = he(
|
|
4214
|
+
const S = he(u.column_name), h = he(t || ""), x = he(l || ""), g = he(n), z = hs(
|
|
4116
4215
|
x,
|
|
4117
4216
|
g
|
|
4118
4217
|
), b = `${z}.${S}`;
|
|
@@ -4122,15 +4221,15 @@ function dr({
|
|
|
4122
4221
|
g,
|
|
4123
4222
|
h
|
|
4124
4223
|
);
|
|
4125
|
-
const
|
|
4224
|
+
const E = d == null ? void 0 : d.find(
|
|
4126
4225
|
(N) => N.column === b && N.table === g && (N.database === h || N.database === t)
|
|
4127
4226
|
);
|
|
4128
|
-
if (
|
|
4129
|
-
f(
|
|
4227
|
+
if (E)
|
|
4228
|
+
f(E.id), c(E.id);
|
|
4130
4229
|
else {
|
|
4131
4230
|
if (n === "api" && a) {
|
|
4132
|
-
|
|
4133
|
-
id:
|
|
4231
|
+
r({
|
|
4232
|
+
id: Xe(),
|
|
4134
4233
|
column: b,
|
|
4135
4234
|
title: u.column_name,
|
|
4136
4235
|
dataType: u.data_type,
|
|
@@ -4139,7 +4238,7 @@ function dr({
|
|
|
4139
4238
|
// database: 'NA',
|
|
4140
4239
|
connectionId: a,
|
|
4141
4240
|
operation: "in",
|
|
4142
|
-
sql:
|
|
4241
|
+
sql: Bs(
|
|
4143
4242
|
u.data_type,
|
|
4144
4243
|
z,
|
|
4145
4244
|
S
|
|
@@ -4148,16 +4247,16 @@ function dr({
|
|
|
4148
4247
|
});
|
|
4149
4248
|
return;
|
|
4150
4249
|
}
|
|
4151
|
-
|
|
4152
|
-
id:
|
|
4250
|
+
r({
|
|
4251
|
+
id: Xe(),
|
|
4153
4252
|
column: `${z}.${S}`,
|
|
4154
4253
|
title: u.column_name,
|
|
4155
4254
|
dataType: u.data_type,
|
|
4156
|
-
table:
|
|
4255
|
+
table: o || "",
|
|
4157
4256
|
database: t || "",
|
|
4158
4257
|
connectionId: a || "",
|
|
4159
4258
|
operation: "in",
|
|
4160
|
-
sql:
|
|
4259
|
+
sql: Bs(
|
|
4161
4260
|
u.data_type,
|
|
4162
4261
|
z,
|
|
4163
4262
|
S
|
|
@@ -4167,8 +4266,8 @@ function dr({
|
|
|
4167
4266
|
}
|
|
4168
4267
|
}
|
|
4169
4268
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
|
|
4170
|
-
const S =
|
|
4171
|
-
(h) => h.column === he(u.column_name) && h.table ===
|
|
4269
|
+
const S = d == null ? void 0 : d.find(
|
|
4270
|
+
(h) => h.column === he(u.column_name) && h.table === o && h.database === t
|
|
4172
4271
|
);
|
|
4173
4272
|
return /* @__PURE__ */ e.jsx(
|
|
4174
4273
|
"div",
|
|
@@ -4181,7 +4280,7 @@ function dr({
|
|
|
4181
4280
|
}
|
|
4182
4281
|
),
|
|
4183
4282
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4184
|
-
/* @__PURE__ */ e.jsx(
|
|
4283
|
+
/* @__PURE__ */ e.jsx(xa, { column: u }),
|
|
4185
4284
|
/* @__PURE__ */ e.jsx("span", { children: u.column_name })
|
|
4186
4285
|
] })
|
|
4187
4286
|
},
|
|
@@ -4189,29 +4288,29 @@ function dr({
|
|
|
4189
4288
|
);
|
|
4190
4289
|
}) });
|
|
4191
4290
|
}
|
|
4192
|
-
function
|
|
4193
|
-
|
|
4194
|
-
const s =
|
|
4291
|
+
function pr() {
|
|
4292
|
+
w((n) => n.showFilters);
|
|
4293
|
+
const s = w(
|
|
4195
4294
|
(n) => n.actions.setShowFilters
|
|
4196
4295
|
);
|
|
4197
4296
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
4198
4297
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
4199
4298
|
/* @__PURE__ */ e.jsx(B, { className: "text-lg", children: "Filters" }),
|
|
4200
4299
|
/* @__PURE__ */ e.jsx(
|
|
4201
|
-
|
|
4300
|
+
k,
|
|
4202
4301
|
{
|
|
4203
4302
|
onClick: () => s(!1),
|
|
4204
4303
|
className: "h-7 w-7 p-0",
|
|
4205
4304
|
variant: "ghost",
|
|
4206
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4305
|
+
children: /* @__PURE__ */ e.jsx(He, {})
|
|
4207
4306
|
}
|
|
4208
4307
|
)
|
|
4209
4308
|
] }),
|
|
4210
4309
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
4211
|
-
|
|
4310
|
+
fa,
|
|
4212
4311
|
{
|
|
4213
4312
|
ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
|
|
4214
|
-
|
|
4313
|
+
xr,
|
|
4215
4314
|
{
|
|
4216
4315
|
schemaName: n,
|
|
4217
4316
|
tableName: a,
|
|
@@ -4222,10 +4321,10 @@ function hr() {
|
|
|
4222
4321
|
) })
|
|
4223
4322
|
] });
|
|
4224
4323
|
}
|
|
4225
|
-
function
|
|
4226
|
-
|
|
4227
|
-
const s =
|
|
4228
|
-
return
|
|
4324
|
+
function fr() {
|
|
4325
|
+
w((a) => a.dashboard);
|
|
4326
|
+
const s = w((a) => a.showFilters), n = w((a) => a.isVisualEditing);
|
|
4327
|
+
return w((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
|
|
4229
4328
|
"div",
|
|
4230
4329
|
{
|
|
4231
4330
|
role: "dashboard-plus-main",
|
|
@@ -4234,17 +4333,17 @@ function mr() {
|
|
|
4234
4333
|
flex: !n
|
|
4235
4334
|
}),
|
|
4236
4335
|
children: [
|
|
4237
|
-
/* @__PURE__ */ e.jsx(
|
|
4238
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
4336
|
+
/* @__PURE__ */ e.jsx($t, {}),
|
|
4337
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(pr, {}) })
|
|
4239
4338
|
]
|
|
4240
4339
|
}
|
|
4241
4340
|
);
|
|
4242
4341
|
}
|
|
4243
|
-
function
|
|
4244
|
-
const s =
|
|
4342
|
+
function gr() {
|
|
4343
|
+
const s = w((t) => t.dashboard), n = w((t) => t.actions.setDashboard), a = w(
|
|
4245
4344
|
(t) => t.showDashboardJSON
|
|
4246
4345
|
);
|
|
4247
|
-
return
|
|
4346
|
+
return w(
|
|
4248
4347
|
(t) => t.actions.setShowDashboardJSON
|
|
4249
4348
|
), /* @__PURE__ */ e.jsx(
|
|
4250
4349
|
"div",
|
|
@@ -4253,7 +4352,7 @@ function ur() {
|
|
|
4253
4352
|
hidden: !a
|
|
4254
4353
|
}),
|
|
4255
4354
|
children: /* @__PURE__ */ e.jsx(
|
|
4256
|
-
|
|
4355
|
+
Pt,
|
|
4257
4356
|
{
|
|
4258
4357
|
onChange: (t) => {
|
|
4259
4358
|
if (t)
|
|
@@ -4284,25 +4383,26 @@ function ur() {
|
|
|
4284
4383
|
}
|
|
4285
4384
|
);
|
|
4286
4385
|
}
|
|
4287
|
-
function
|
|
4386
|
+
function yr({
|
|
4288
4387
|
showControls: s = !1,
|
|
4289
4388
|
showFooter: n = !0,
|
|
4290
|
-
|
|
4389
|
+
showAssistant: a = !1,
|
|
4390
|
+
...t
|
|
4291
4391
|
}) {
|
|
4292
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4293
|
-
/* @__PURE__ */ e.jsx(
|
|
4294
|
-
/* @__PURE__ */ e.jsxs(
|
|
4295
|
-
/* @__PURE__ */ e.jsx(
|
|
4296
|
-
/* @__PURE__ */ e.jsxs(
|
|
4297
|
-
s && /* @__PURE__ */ e.jsx(
|
|
4298
|
-
/* @__PURE__ */ e.jsx(
|
|
4299
|
-
/* @__PURE__ */ e.jsx(
|
|
4392
|
+
return /* @__PURE__ */ e.jsxs(Kt, { dashboardProps: t, children: [
|
|
4393
|
+
/* @__PURE__ */ e.jsx(Ut, {}),
|
|
4394
|
+
/* @__PURE__ */ e.jsxs(Gt, { children: [
|
|
4395
|
+
/* @__PURE__ */ e.jsx(gr, {}),
|
|
4396
|
+
/* @__PURE__ */ e.jsxs(Jt, { ...t, children: [
|
|
4397
|
+
s && /* @__PURE__ */ e.jsx(Cn, {}),
|
|
4398
|
+
/* @__PURE__ */ e.jsx(ur, {}),
|
|
4399
|
+
/* @__PURE__ */ e.jsx(fr, {})
|
|
4300
4400
|
] })
|
|
4301
4401
|
] })
|
|
4302
4402
|
] });
|
|
4303
4403
|
}
|
|
4304
4404
|
export {
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4405
|
+
yr as D,
|
|
4406
|
+
We as S,
|
|
4407
|
+
pa as u
|
|
4308
4408
|
};
|