react-semaphor 0.0.197 → 0.0.198
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-a3l7M8uu.js → dashboard-plus-gibgO8pQ.js} +914 -828
- package/dist/chunks/dashboard-plus-it5xuE8z.js +210 -0
- package/dist/chunks/index-CQrzHhoZ.js +422 -0
- package/dist/chunks/{index-K0c-JSZa.js → index-ZPzRMi0w.js} +14727 -14161
- 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 +4 -1
- package/dist/types/main.d.ts +23 -2
- package/dist/types/surfboard.d.ts +5 -2
- package/dist/types/types.d.ts +4 -1
- package/package.json +3 -1
- package/dist/chunks/dashboard-plus-t_eiSgg5.js +0 -210
- package/dist/chunks/index-A7hq_8iZ.js +0 -421
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { P as E, b as k, j as e, Q as ps, R as fs, U as w, V as
|
|
2
|
-
import me, { useState as T, useEffect as P, useMemo as
|
|
1
|
+
import { P as E, b as k, j as e, Q as ps, R as fs, U as w, 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 Ee, a1 as qa, a2 as Ra, a3 as _a, a4 as Ha, a5 as Ba, a6 as $a, a7 as Ls, 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 Ae, af as Be, ag as Le, ah as X, ai as Cs, G as i, aj as Ue, ak as Ge, al as Pa, am as Je, w as Ys, v as Xs, t as he, an as Ka, r as Ua, N as Zs, s as Ga, ao as Ja, B as Qa, ap as ea, aq as Wa, L as $e, S as Ss, z as Ya, 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 Xa, aA as Za, aB as la, aC as et, aD as st, aE as at, aF as tt, aG as nt, aH as ms, aI as rt, aJ as _e, aK as us, aL as Fe, aM as xs, aN as Is, aO as lt, aP as it, aQ as ot, aR as ct, aS as dt, aT as is, aU as ht, aV as Vs, aW as mt, aX as qs, aY as ut, aZ as xt, a_ as pt, a$ as ia, l as ft, C as gt, E as Rs, d as jt, h as bt, i as yt, o as vt, b0 as Nt, m as Ct, H as St, b1 as kt, b2 as wt, b3 as zt, b4 as os, b5 as Ft, b6 as cs, b7 as _s, K as Ot, b8 as Mt, b9 as ks, ba as Tt, bb as ws, bc as De, bd as oa, be as At, bf as Et, bg as Lt, bh as Dt, bi as It, bj as Vt, bk as Se, bl as q, bm as R, bn as zs, bo as _, bp as Hs, bq as qt, br as Rt, bs as _t, bt as Ht, bu as Bs, bv as Bt, bw as $t, bx as Pt, by as Kt, bz as Ut, bA as Gt } from "./index-ZPzRMi0w.js";
|
|
2
|
+
import me, { useState as T, useEffect as P, useMemo as Jt, 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 Qt = E("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 Wt = E("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 = E("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 Yt = E("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 Xt = E("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 Zt = E("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 = E("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 = E("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 en = E("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 sn = E("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 an = E("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 tn = E("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 = E("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 nn = E("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 rn = E("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 ln = E("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 on = E("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 cn = E("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 = E("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 = E("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 dn = E("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 hn = E("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 mn = E("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 = E("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 un = E("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 xn = E("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 pn = E("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 fn = E("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 gn = E("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 = E("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 jn = E("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 bn() {
|
|
391
|
+
const [s, n] = T(""), [a, t] = T(!1), [l, o] = T(!1), d = k((c) => c.dashboard);
|
|
392
|
+
function r() {
|
|
393
|
+
const c = Qs(d), f = Ee(d.id), m = JSON.parse(localStorage.getItem(f) || "[]");
|
|
394
394
|
if (m.some(
|
|
395
395
|
(S) => S.name === s
|
|
396
396
|
)) {
|
|
@@ -399,10 +399,10 @@ 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
|
w,
|
|
408
408
|
{
|
|
@@ -410,7 +410,7 @@ function jn() {
|
|
|
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(
|
|
438
|
+
/* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
|
|
439
439
|
w,
|
|
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 yn() {
|
|
452
|
+
const [s, n] = T(!1), [a, t] = T(""), l = k((h) => h.dashboard), o = k((h) => h.bookmarkKey), [d, r] = T([]), c = k((h) => h.actions.setDashboard), f = k(
|
|
453
453
|
(h) => h.actions.setFilterValues
|
|
454
454
|
), m = k(
|
|
455
455
|
(h) => h.actions.setBookmarkKey
|
|
456
456
|
);
|
|
457
457
|
P(() => {
|
|
458
|
-
const h = Ee(
|
|
459
|
-
|
|
458
|
+
const h = Ee(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 = Ee(
|
|
472
|
+
const x = Ee(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
477
|
return /* @__PURE__ */ e.jsxs(qa, { open: s, onOpenChange: n, children: [
|
|
478
|
-
/* @__PURE__ */ e.jsx(
|
|
479
|
-
/* @__PURE__ */ e.jsxs(
|
|
480
|
-
/* @__PURE__ */ e.jsx(
|
|
481
|
-
/* @__PURE__ */ e.jsx(
|
|
478
|
+
/* @__PURE__ */ e.jsx(Ra, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(en, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
479
|
+
/* @__PURE__ */ e.jsxs(_a, { className: "w-56", children: [
|
|
480
|
+
/* @__PURE__ */ e.jsx(Ha, { children: "Lenses" }),
|
|
481
|
+
/* @__PURE__ */ e.jsx(Ba, {}),
|
|
482
482
|
/* @__PURE__ */ e.jsxs(
|
|
483
|
-
|
|
483
|
+
$a,
|
|
484
484
|
{
|
|
485
485
|
value: a,
|
|
486
486
|
onValueChange: u,
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */ e.jsx(
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
/* @__PURE__ */ e.jsx(Ls, { value: "Original", children: "Original" }),
|
|
489
|
+
d.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
|
|
490
|
+
Ls,
|
|
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 = k((
|
|
517
|
+
function vn() {
|
|
518
|
+
const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((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 = Ee(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 = Ee(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
|
|
558
|
+
function Nn() {
|
|
559
559
|
const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
|
|
560
560
|
k((b) => b.selectedSheetId);
|
|
561
561
|
const a = k(
|
|
562
562
|
(b) => b.isDashboardEditing
|
|
563
|
-
), t = k((b) => b.filterValues),
|
|
563
|
+
), t = k((b) => b.filterValues), l = k((b) => b.isVisualEditing), o = k((b) => b.showFilters);
|
|
564
564
|
k(
|
|
565
565
|
(b) => b.showDashboardJSON
|
|
566
566
|
);
|
|
567
|
-
const
|
|
567
|
+
const d = k((b) => b.onSaveFunction), r = k(
|
|
568
568
|
(b) => b.actions.setShowFilters
|
|
569
|
-
), { addFrame:
|
|
569
|
+
), { addFrame: c, setSelectedFrameId: f } = k(
|
|
570
570
|
(b) => b.actions
|
|
571
571
|
), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: S } = k((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: {
|
|
@@ -587,18 +587,18 @@ function vn() {
|
|
|
587
587
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
588
588
|
data: []
|
|
589
589
|
}, L = {
|
|
590
|
-
id:
|
|
590
|
+
id: Xe(),
|
|
591
591
|
cards: [b],
|
|
592
592
|
activeCardId: b.id
|
|
593
593
|
};
|
|
594
|
-
|
|
594
|
+
c(h.id, L), f(L.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), L = Ee(n.id), N = JSON.parse(localStorage.getItem(L) || "[]"), O = N.findIndex(
|
|
602
602
|
(j) => j.name === s
|
|
603
603
|
);
|
|
604
604
|
O !== -1 ? N[O] = {
|
|
@@ -610,25 +610,25 @@ function vn() {
|
|
|
610
610
|
name: s,
|
|
611
611
|
template: b,
|
|
612
612
|
filterValues: t
|
|
613
|
-
}), localStorage.setItem(L, JSON.stringify(N)),
|
|
613
|
+
}), localStorage.setItem(L, 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(vn, {})
|
|
626
626
|
] })
|
|
627
627
|
] }),
|
|
628
628
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
629
|
-
a && !
|
|
630
|
-
!
|
|
631
|
-
a && !
|
|
629
|
+
a && !l && /* @__PURE__ */ e.jsx(bn, {}),
|
|
630
|
+
!l && /* @__PURE__ */ e.jsx(yn, {}),
|
|
631
|
+
a && !l && /* @__PURE__ */ e.jsxs(
|
|
632
632
|
w,
|
|
633
633
|
{
|
|
634
634
|
variant: "outline",
|
|
@@ -637,7 +637,7 @@ 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
|
}
|
|
@@ -649,10 +649,10 @@ function vn() {
|
|
|
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 && !
|
|
655
|
+
a && !l && /* @__PURE__ */ e.jsx(
|
|
656
656
|
w,
|
|
657
657
|
{
|
|
658
658
|
variant: "outline",
|
|
@@ -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 && !
|
|
668
|
+
a && !l && /* @__PURE__ */ e.jsx(
|
|
669
669
|
w,
|
|
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(mn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
676
676
|
}
|
|
677
677
|
),
|
|
678
|
-
!
|
|
678
|
+
!o && !l && a && /* @__PURE__ */ e.jsx(
|
|
679
679
|
w,
|
|
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(hn, { className: "size-4 rotate-90" });
|
|
711
711
|
if (s === "Database")
|
|
712
|
-
return /* @__PURE__ */ e.jsx(
|
|
712
|
+
return /* @__PURE__ */ e.jsx(Xt, { className: "size-4" });
|
|
713
713
|
if (s === "Schema")
|
|
714
|
-
return /* @__PURE__ */ e.jsx(
|
|
714
|
+
return /* @__PURE__ */ e.jsx(cn, { 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(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
739
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
740
740
|
t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { 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 Cn({ 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(Pa, { 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(Ka, { asChild: !0, children: Ua.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(an, { className: "size-3" })
|
|
822
|
+
) : Ga.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Qa.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(gn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(un, { 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 Sn({
|
|
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 = k(
|
|
839
839
|
(j) => j.dashboard.aiScopeTables
|
|
840
840
|
), { setAIScopeTables: m } = k((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 A =
|
|
846
|
+
const A = Xs(F, he(s), he(n));
|
|
847
847
|
A && (x(A), 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
854
|
function L(j) {
|
|
855
|
-
if (j === !0 &&
|
|
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
|
-
(A) => A.connectinonId !==
|
|
874
|
+
(A) => A.connectinonId !== o && A.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,17 +883,17 @@ 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(),
|
|
@@ -901,7 +901,7 @@ function Cn({
|
|
|
901
901
|
variant: "outline",
|
|
902
902
|
className: "h-9 px-2",
|
|
903
903
|
children: /* @__PURE__ */ e.jsx(
|
|
904
|
-
|
|
904
|
+
Wa,
|
|
905
905
|
{
|
|
906
906
|
className: Y("size-4", {
|
|
907
907
|
"text-primary": b(),
|
|
@@ -920,7 +920,7 @@ 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(pn, { className: "mr-2 size-4" }),
|
|
924
924
|
"Top 10"
|
|
925
925
|
]
|
|
926
926
|
}
|
|
@@ -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(xn, { 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": Ya(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(Cn, { 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 = Jt(() => [], []);
|
|
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,13 +1000,13 @@ 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,
|
|
@@ -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
1026
|
data: A,
|
|
1027
|
-
isLoading:
|
|
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,17 +1066,17 @@ 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)
|
|
@@ -1088,19 +1088,19 @@ function xa(s, n) {
|
|
|
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,7 +1123,7 @@ function xa(s, n) {
|
|
|
1123
1123
|
m,
|
|
1124
1124
|
O
|
|
1125
1125
|
]);
|
|
1126
|
-
const je = (O == null ? void 0 : O.type) === "API" ? (
|
|
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
1127
|
function xe(C) {
|
|
1128
1128
|
u(C), S("");
|
|
1129
1129
|
}
|
|
@@ -1133,7 +1133,7 @@ function xa(s, n) {
|
|
|
1133
1133
|
function ne(C) {
|
|
1134
1134
|
f(C);
|
|
1135
1135
|
}
|
|
1136
|
-
A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((
|
|
1136
|
+
A && ((ve = A == null ? void 0 : A.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 = []);
|
|
@@ -1149,7 +1149,7 @@ function xa(s, n) {
|
|
|
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
|
}));
|
|
@@ -1158,12 +1158,12 @@ function xa(s, n) {
|
|
|
1158
1158
|
isConnectionsLoading: L,
|
|
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,
|
|
@@ -1178,7 +1178,7 @@ function xa(s, n) {
|
|
|
1178
1178
|
handleSchemaChange: xe
|
|
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,
|
|
@@ -1209,14 +1209,14 @@ function pa({
|
|
|
1209
1209
|
connectionType: j,
|
|
1210
1210
|
isNonDbConnection: F,
|
|
1211
1211
|
handleConnectionChange: A,
|
|
1212
|
-
handleDatabaseChange:
|
|
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
|
+
Sn,
|
|
1220
1220
|
{
|
|
1221
1221
|
schemaName: G,
|
|
1222
1222
|
tableName: $,
|
|
@@ -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
1278
|
onChange: A,
|
|
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
|
}
|
|
@@ -1296,38 +1296,38 @@ function pa({
|
|
|
1296
1296
|
variant: "secondary",
|
|
1297
1297
|
className: "w-full",
|
|
1298
1298
|
children: [
|
|
1299
|
-
/* @__PURE__ */ e.jsx(
|
|
1299
|
+
/* @__PURE__ */ e.jsx(on, { 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 kn(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 wn({
|
|
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(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Yt, { 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
|
w,
|
|
1333
1333
|
{
|
|
@@ -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(sn, { 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 zn({
|
|
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 Fn() {
|
|
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: () => Xa(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(Za, { 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 On = `
|
|
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,15 +1445,15 @@ SELECT label, measure FROM table
|
|
|
1445
1445
|
- Label - Category
|
|
1446
1446
|
- Measure - Number
|
|
1447
1447
|
`;
|
|
1448
|
-
function
|
|
1448
|
+
function Mn({
|
|
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 = k((y) => y.dashboard.baseQueries), h = i((y) => y.actions.setRunSql), x = i((y) => y.actions.setCardType), [g, z] = T([]), b = i((y) => y.currentColumns), L = 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" : ""}
|
|
@@ -1461,11 +1461,11 @@ function On({
|
|
|
1461
1461
|
Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
|
|
1462
1462
|
User SQL: ${L}
|
|
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: ${On}`, { data: F, isLoading: A, 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,7 +1544,7 @@ 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(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
1547
|
+
/* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ra, {}) }),
|
|
1548
1548
|
/* @__PURE__ */ e.jsx(
|
|
1549
1549
|
w,
|
|
1550
1550
|
{
|
|
@@ -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(at, {})
|
|
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(jn, { 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
|
+
st,
|
|
1585
1585
|
{
|
|
1586
1586
|
className: "w-full overflow-auto py-1",
|
|
1587
1587
|
components: Z,
|
|
@@ -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,7 +1637,7 @@ 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: A ||
|
|
1640
|
+
disabled: A || V,
|
|
1641
1641
|
value: a,
|
|
1642
1642
|
onChange: (y) => t(y.target.value)
|
|
1643
1643
|
}
|
|
@@ -1650,7 +1650,7 @@ function On({
|
|
|
1650
1650
|
size: "sm",
|
|
1651
1651
|
variant: "ghost",
|
|
1652
1652
|
onClick: D,
|
|
1653
|
-
children: !A && !
|
|
1653
|
+
children: !A && !V ? /* @__PURE__ */ e.jsx(et, {}) : /* @__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), Tn = ["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
|
+
Ln(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 Ln(s, n, a) {
|
|
1722
|
+
return n = Dn(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 Dn(s) {
|
|
1725
|
+
var n = In(s, "string");
|
|
1726
1726
|
return typeof n == "symbol" ? n : String(n);
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function In(s, n) {
|
|
1729
1729
|
if (typeof s != "object" || s === null)
|
|
1730
1730
|
return s;
|
|
1731
1731
|
var a = s[Symbol.toPrimitive];
|
|
@@ -1737,44 +1737,44 @@ 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
1745
|
function fe(s) {
|
|
1746
|
-
return (n) => /* @__PURE__ */ me.createElement(
|
|
1747
|
-
attr:
|
|
1748
|
-
}, n),
|
|
1746
|
+
return (n) => /* @__PURE__ */ me.createElement(Vn, Ze({
|
|
1747
|
+
attr: es({}, s.attr)
|
|
1748
|
+
}, n), ja(s.child));
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function Vn(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, Tn), 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
1773
|
function qn(s) {
|
|
1774
1774
|
return fe({ 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 } =
|
|
1776
|
+
function Rn() {
|
|
1777
|
+
const { theme: s } = tt(), 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
1778
|
k((p) => p.selectedSheetId);
|
|
1779
1779
|
const x = k((p) => p.dashboard.baseQueries), g = i((p) => p.card), z = k((p) => p.theme), b = i((p) => p.isShowingVisual), L = i(
|
|
1780
1780
|
(p) => p.selectedConnectionId
|
|
@@ -1786,7 +1786,7 @@ function Vn() {
|
|
|
1786
1786
|
k(
|
|
1787
1787
|
(p) => p.actions.updateFrameCard
|
|
1788
1788
|
);
|
|
1789
|
-
const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql), A = i((p) => p.card.python),
|
|
1789
|
+
const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql), A = i((p) => p.card.python), V = nt(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,
|
|
@@ -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, A],
|
|
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: A ===
|
|
1818
|
+
sql: V,
|
|
1819
|
+
python: A === Is ? "" : A,
|
|
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) && xe(!0), (le || ye) && xe(!1), le ? (I(
|
|
1837
|
+
(ne || re) && xe(!0), (le || ye) && xe(!1), le ? (I(Ve.message), se([]), Q([]), y("")) : I("");
|
|
1838
1838
|
}, [
|
|
1839
1839
|
ne,
|
|
1840
1840
|
re,
|
|
@@ -1846,9 +1846,9 @@ function Vn() {
|
|
|
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,7 +1856,7 @@ function Vn() {
|
|
|
1856
1856
|
};
|
|
1857
1857
|
function C() {
|
|
1858
1858
|
let p = F;
|
|
1859
|
-
F && !F.includes("{{") && (p =
|
|
1859
|
+
F && !F.includes("{{") && (p = kn(F), Z(p));
|
|
1860
1860
|
const ie = {
|
|
1861
1861
|
...g,
|
|
1862
1862
|
lastSelectedSchema: O,
|
|
@@ -1866,37 +1866,37 @@ function Vn() {
|
|
|
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
|
|
1877
|
+
function Oa() {
|
|
1878
1878
|
ue == null || ue();
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1880
|
+
function Ma(p) {
|
|
1881
1881
|
const ie = getComputedStyle(
|
|
1882
1882
|
document.documentElement
|
|
1883
1883
|
).getPropertyValue(p);
|
|
1884
|
-
return
|
|
1884
|
+
return Ta(ie);
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1887
|
-
const [ie,
|
|
1886
|
+
function Ta(p) {
|
|
1887
|
+
const [ie, Re, Ne] = p.split(" "), W = parseFloat(ie), La = parseFloat(Re), Da = parseFloat(Ne), Ia = La / 100, Es = Da / 100, pe = (1 - Math.abs(2 * Es - 1)) * Ia, ke = pe * (1 - Math.abs(W / 60 % 2 - 1)), ns = Es - pe / 2;
|
|
1888
1888
|
let oe = 0, ce = 0, de = 0;
|
|
1889
|
-
0 <= W && W < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= W && W < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe +
|
|
1890
|
-
const
|
|
1891
|
-
const
|
|
1892
|
-
return
|
|
1889
|
+
0 <= W && W < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= W && W < 360 && (oe = pe, 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 = (Va) => {
|
|
1891
|
+
const ls = Va.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" : Ma("--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 As(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
|
+
zn,
|
|
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(Fn, {}),
|
|
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: As,
|
|
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: A ||
|
|
2073
|
+
value: A || 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: As,
|
|
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
|
),
|
|
@@ -2137,16 +2137,16 @@ 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(dn, { className: "mr-2 h-4 w-4" }),
|
|
2141
2141
|
"Run"
|
|
2142
2142
|
]
|
|
2143
2143
|
}
|
|
2144
2144
|
),
|
|
2145
2145
|
le && /* @__PURE__ */ e.jsx(
|
|
2146
|
-
|
|
2146
|
+
wn,
|
|
2147
2147
|
{
|
|
2148
|
-
error:
|
|
2149
|
-
setShowAIDialog:
|
|
2148
|
+
error: Ve.message,
|
|
2149
|
+
setShowAIDialog: c,
|
|
2150
2150
|
setTriggerAIRun: S,
|
|
2151
2151
|
setUserInputforAI: m
|
|
2152
2152
|
}
|
|
@@ -2154,21 +2154,21 @@ function Vn() {
|
|
|
2154
2154
|
/* @__PURE__ */ e.jsxs(
|
|
2155
2155
|
w,
|
|
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(Zt, { 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",
|
|
@@ -2176,10 +2176,10 @@ function Vn() {
|
|
|
2176
2176
|
}
|
|
2177
2177
|
),
|
|
2178
2178
|
/* @__PURE__ */ e.jsx(
|
|
2179
|
-
|
|
2179
|
+
Mn,
|
|
2180
2180
|
{
|
|
2181
|
-
open:
|
|
2182
|
-
setOpen:
|
|
2181
|
+
open: r,
|
|
2182
|
+
setOpen: c,
|
|
2183
2183
|
userInput: f,
|
|
2184
2184
|
triggerAIRun: u,
|
|
2185
2185
|
setTriggerAIRun: S,
|
|
@@ -2195,7 +2195,7 @@ function Vn() {
|
|
|
2195
2195
|
size: "sm",
|
|
2196
2196
|
variant: "outline",
|
|
2197
2197
|
children: [
|
|
2198
|
-
/* @__PURE__ */ e.jsx(
|
|
2198
|
+
/* @__PURE__ */ e.jsx(rt, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2199
2199
|
"Accept"
|
|
2200
2200
|
]
|
|
2201
2201
|
}
|
|
@@ -2203,12 +2203,12 @@ function Vn() {
|
|
|
2203
2203
|
/* @__PURE__ */ e.jsxs(
|
|
2204
2204
|
w,
|
|
2205
2205
|
{
|
|
2206
|
-
onClick:
|
|
2206
|
+
onClick: Oa,
|
|
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 _n({ 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(lt, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(it, { className: "ml-2 h-5 w-5" }) : null
|
|
2240
2240
|
]
|
|
2241
2241
|
}
|
|
2242
2242
|
) });
|
|
2243
2243
|
}
|
|
2244
|
-
})),
|
|
2244
|
+
})), o = ot({
|
|
2245
2245
|
data: s,
|
|
2246
|
-
columns:
|
|
2247
|
-
getCoreRowModel:
|
|
2248
|
-
getPaginationRowModel:
|
|
2246
|
+
columns: l,
|
|
2247
|
+
getCoreRowModel: ut(),
|
|
2248
|
+
getPaginationRowModel: xt(),
|
|
2249
2249
|
onSortingChange: a,
|
|
2250
|
-
getSortedRowModel:
|
|
2250
|
+
getSortedRowModel: pt(),
|
|
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(ct, { children: [
|
|
2257
|
+
/* @__PURE__ */ e.jsx(dt, { children: o.getHeaderGroups().map((r) => /* @__PURE__ */ e.jsx(is, { children: r.headers.map((c) => /* @__PURE__ */ e.jsx(ht, { 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(mt, { 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 = k((
|
|
2279
|
+
const a = k((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
|
+
ft,
|
|
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(gt, { 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(jt, { 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(bt, { 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(yt, { 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
|
+
vt,
|
|
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(Nt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Ct, { 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 Hn() {
|
|
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 } = St();
|
|
2347
2347
|
function x(N) {
|
|
2348
2348
|
var F, A;
|
|
2349
2349
|
const O = {
|
|
2350
2350
|
...N,
|
|
2351
2351
|
data: {
|
|
2352
2352
|
...N == null ? void 0 : N.data,
|
|
2353
|
-
datasets: (A = (F = N == null ? void 0 : N.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((
|
|
2354
|
-
...
|
|
2353
|
+
datasets: (A = (F = N == null ? void 0 : N.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((V) => ({
|
|
2354
|
+
...V,
|
|
2355
2355
|
data: []
|
|
2356
2356
|
}))
|
|
2357
2357
|
}
|
|
@@ -2362,30 +2362,30 @@ 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
2385
|
function L() {
|
|
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) : "";
|
|
@@ -2398,7 +2398,7 @@ function _n() {
|
|
|
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(kt, { 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
|
+
tn,
|
|
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(wt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2441
|
+
/* @__PURE__ */ e.jsxs(zt, { 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(Ft, { 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",
|
|
@@ -2485,18 +2485,18 @@ function _n() {
|
|
|
2485
2485
|
},
|
|
2486
2486
|
defaultLanguage: "json",
|
|
2487
2487
|
value: L(),
|
|
2488
|
-
onChange: (N) =>
|
|
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,16 +2513,16 @@ 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
|
w,
|
|
2528
2528
|
{
|
|
@@ -2540,101 +2540,101 @@ function _n() {
|
|
|
2540
2540
|
)
|
|
2541
2541
|
] });
|
|
2542
2542
|
}
|
|
2543
|
-
function
|
|
2543
|
+
function ya(s) {
|
|
2544
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
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function va(s) {
|
|
2547
2547
|
return fe({ 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);
|
|
2548
2548
|
}
|
|
2549
|
-
function
|
|
2549
|
+
function Na(s) {
|
|
2550
2550
|
return fe({ 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);
|
|
2551
2551
|
}
|
|
2552
|
-
function
|
|
2552
|
+
function Ca(s) {
|
|
2553
2553
|
return fe({ 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);
|
|
2554
2554
|
}
|
|
2555
|
-
function
|
|
2555
|
+
function Sa(s) {
|
|
2556
2556
|
return fe({ 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);
|
|
2557
2557
|
}
|
|
2558
|
-
function
|
|
2558
|
+
function ka(s) {
|
|
2559
2559
|
return fe({ 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);
|
|
2560
2560
|
}
|
|
2561
|
-
function
|
|
2561
|
+
function wa(s) {
|
|
2562
2562
|
return fe({ 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);
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2565
|
-
const [s, n] = T(!1), a = i((
|
|
2566
|
-
(
|
|
2564
|
+
function Bn() {
|
|
2565
|
+
const [s, n] = T(!1), a = i((c) => c.card.type), { setCardType: t, setCardPreferences: l, setChartOrientation: o } = i((c) => c.actions), d = i(
|
|
2566
|
+
(c) => c.actions.setCardCustomCfg
|
|
2567
2567
|
);
|
|
2568
|
-
function
|
|
2569
|
-
|
|
2568
|
+
function r(c) {
|
|
2569
|
+
d(null), l({}), t(c), n(!1);
|
|
2570
2570
|
}
|
|
2571
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2572
|
-
/* @__PURE__ */ e.jsx(
|
|
2573
|
-
/* @__PURE__ */ e.jsx(
|
|
2571
|
+
return /* @__PURE__ */ e.jsxs(Ue, { open: s, onOpenChange: n, children: [
|
|
2572
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx($n, { className: "h-4 w-4", chartType: a }) }) }),
|
|
2573
|
+
/* @__PURE__ */ e.jsx(Je, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2574
2574
|
/* @__PURE__ */ e.jsx(
|
|
2575
2575
|
w,
|
|
2576
2576
|
{
|
|
2577
|
-
onClick: () =>
|
|
2577
|
+
onClick: () => r("bar"),
|
|
2578
2578
|
className: "font-normal",
|
|
2579
2579
|
variant: "ghost",
|
|
2580
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2580
|
+
children: /* @__PURE__ */ e.jsx(Fs, { className: "size-5" })
|
|
2581
2581
|
}
|
|
2582
2582
|
),
|
|
2583
2583
|
/* @__PURE__ */ e.jsx(
|
|
2584
2584
|
w,
|
|
2585
2585
|
{
|
|
2586
|
-
onClick: () =>
|
|
2586
|
+
onClick: () => r("line"),
|
|
2587
2587
|
variant: "ghost",
|
|
2588
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2588
|
+
children: /* @__PURE__ */ e.jsx(Os, { className: "size-5" })
|
|
2589
2589
|
}
|
|
2590
2590
|
),
|
|
2591
2591
|
/* @__PURE__ */ e.jsx(
|
|
2592
2592
|
w,
|
|
2593
2593
|
{
|
|
2594
|
-
onClick: () =>
|
|
2594
|
+
onClick: () => r("stackedBar"),
|
|
2595
2595
|
variant: "ghost",
|
|
2596
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2596
|
+
children: /* @__PURE__ */ e.jsx(Sa, { className: "size-5", strokeWidth: 0 })
|
|
2597
2597
|
}
|
|
2598
2598
|
),
|
|
2599
2599
|
/* @__PURE__ */ e.jsx(
|
|
2600
2600
|
w,
|
|
2601
2601
|
{
|
|
2602
|
-
onClick: () =>
|
|
2602
|
+
onClick: () => r("scatter"),
|
|
2603
2603
|
variant: "ghost",
|
|
2604
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2604
|
+
children: /* @__PURE__ */ e.jsx(ua, { className: "size-5" })
|
|
2605
2605
|
}
|
|
2606
2606
|
),
|
|
2607
2607
|
/* @__PURE__ */ e.jsx(
|
|
2608
2608
|
w,
|
|
2609
2609
|
{
|
|
2610
|
-
onClick: () =>
|
|
2610
|
+
onClick: () => r("bubble"),
|
|
2611
2611
|
variant: "ghost",
|
|
2612
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2612
|
+
children: /* @__PURE__ */ e.jsx(Ca, { className: "size-4" })
|
|
2613
2613
|
}
|
|
2614
2614
|
),
|
|
2615
2615
|
/* @__PURE__ */ e.jsx(
|
|
2616
2616
|
w,
|
|
2617
2617
|
{
|
|
2618
|
-
onClick: () =>
|
|
2618
|
+
onClick: () => r("pie"),
|
|
2619
2619
|
variant: "ghost",
|
|
2620
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2620
|
+
children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
|
|
2621
2621
|
}
|
|
2622
2622
|
),
|
|
2623
2623
|
/* @__PURE__ */ e.jsx(
|
|
2624
2624
|
w,
|
|
2625
2625
|
{
|
|
2626
|
-
onClick: () =>
|
|
2626
|
+
onClick: () => r("doughnut"),
|
|
2627
2627
|
variant: "ghost",
|
|
2628
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2628
|
+
children: /* @__PURE__ */ e.jsx(va, { className: "size-5", strokeWidth: 1 })
|
|
2629
2629
|
}
|
|
2630
2630
|
),
|
|
2631
2631
|
/* @__PURE__ */ e.jsx(
|
|
2632
2632
|
w,
|
|
2633
2633
|
{
|
|
2634
|
-
onClick: () =>
|
|
2634
|
+
onClick: () => r("radar"),
|
|
2635
2635
|
variant: "ghost",
|
|
2636
2636
|
children: /* @__PURE__ */ e.jsx(
|
|
2637
|
-
|
|
2637
|
+
ya,
|
|
2638
2638
|
{
|
|
2639
2639
|
className: "size-5 font-extralight",
|
|
2640
2640
|
strokeWidth: 0.5
|
|
@@ -2645,31 +2645,31 @@ function Hn() {
|
|
|
2645
2645
|
/* @__PURE__ */ e.jsx(
|
|
2646
2646
|
w,
|
|
2647
2647
|
{
|
|
2648
|
-
onClick: () =>
|
|
2648
|
+
onClick: () => r("polarArea"),
|
|
2649
2649
|
variant: "ghost",
|
|
2650
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2650
|
+
children: /* @__PURE__ */ e.jsx(Na, { className: "size-5" })
|
|
2651
2651
|
}
|
|
2652
2652
|
),
|
|
2653
2653
|
/* @__PURE__ */ e.jsx(
|
|
2654
2654
|
w,
|
|
2655
2655
|
{
|
|
2656
|
-
onClick: () =>
|
|
2656
|
+
onClick: () => r("pyramid"),
|
|
2657
2657
|
variant: "ghost",
|
|
2658
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2658
|
+
children: /* @__PURE__ */ e.jsx(wa, { className: "size-5" })
|
|
2659
2659
|
}
|
|
2660
2660
|
),
|
|
2661
2661
|
/* @__PURE__ */ e.jsx(
|
|
2662
2662
|
w,
|
|
2663
2663
|
{
|
|
2664
|
-
onClick: () =>
|
|
2664
|
+
onClick: () => r("range"),
|
|
2665
2665
|
variant: "ghost",
|
|
2666
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2666
|
+
children: /* @__PURE__ */ e.jsx(da, { className: "size-5" })
|
|
2667
2667
|
}
|
|
2668
2668
|
),
|
|
2669
2669
|
/* @__PURE__ */ e.jsx(
|
|
2670
2670
|
w,
|
|
2671
2671
|
{
|
|
2672
|
-
onClick: () =>
|
|
2672
|
+
onClick: () => r("table"),
|
|
2673
2673
|
variant: "ghost",
|
|
2674
2674
|
children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
|
|
2675
2675
|
}
|
|
@@ -2677,53 +2677,63 @@ function Hn() {
|
|
|
2677
2677
|
/* @__PURE__ */ e.jsx(
|
|
2678
2678
|
w,
|
|
2679
2679
|
{
|
|
2680
|
-
onClick: () =>
|
|
2680
|
+
onClick: () => r("kpi"),
|
|
2681
|
+
variant: "ghost",
|
|
2682
|
+
children: /* @__PURE__ */ e.jsx(ka, { className: "size-6" })
|
|
2683
|
+
}
|
|
2684
|
+
),
|
|
2685
|
+
/* @__PURE__ */ e.jsx(
|
|
2686
|
+
w,
|
|
2687
|
+
{
|
|
2688
|
+
onClick: () => r("text"),
|
|
2681
2689
|
variant: "ghost",
|
|
2682
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2690
|
+
children: /* @__PURE__ */ e.jsx(Ms, { className: "size-4" })
|
|
2683
2691
|
}
|
|
2684
2692
|
)
|
|
2685
2693
|
] }) })
|
|
2686
2694
|
] });
|
|
2687
2695
|
}
|
|
2688
|
-
function
|
|
2696
|
+
function $n({ chartType: s, className: n }) {
|
|
2689
2697
|
switch (s) {
|
|
2690
2698
|
case "bar":
|
|
2691
|
-
return /* @__PURE__ */ e.jsx(zs, { className: n });
|
|
2692
|
-
case "line":
|
|
2693
2699
|
return /* @__PURE__ */ e.jsx(Fs, { className: n });
|
|
2700
|
+
case "line":
|
|
2701
|
+
return /* @__PURE__ */ e.jsx(Os, { className: n });
|
|
2694
2702
|
case "pie":
|
|
2695
|
-
return /* @__PURE__ */ e.jsx(
|
|
2703
|
+
return /* @__PURE__ */ e.jsx(ma, { className: n });
|
|
2696
2704
|
case "radar":
|
|
2697
|
-
return /* @__PURE__ */ e.jsx(
|
|
2705
|
+
return /* @__PURE__ */ e.jsx(ya, { className: n });
|
|
2698
2706
|
case "scatter":
|
|
2699
|
-
return /* @__PURE__ */ e.jsx(
|
|
2707
|
+
return /* @__PURE__ */ e.jsx(ua, { className: n });
|
|
2700
2708
|
case "bubble":
|
|
2701
|
-
return /* @__PURE__ */ e.jsx(
|
|
2709
|
+
return /* @__PURE__ */ e.jsx(Ca, { className: n });
|
|
2702
2710
|
case "doughnut":
|
|
2703
|
-
return /* @__PURE__ */ e.jsx(
|
|
2711
|
+
return /* @__PURE__ */ e.jsx(va, { className: n });
|
|
2704
2712
|
case "stackedBar":
|
|
2705
|
-
return /* @__PURE__ */ e.jsx(
|
|
2713
|
+
return /* @__PURE__ */ e.jsx(Sa, { className: "size-4 text-foreground/70" });
|
|
2706
2714
|
case "polarArea":
|
|
2707
|
-
return /* @__PURE__ */ e.jsx(
|
|
2715
|
+
return /* @__PURE__ */ e.jsx(Na, { className: n });
|
|
2708
2716
|
case "pyramid":
|
|
2709
|
-
return /* @__PURE__ */ e.jsx(
|
|
2717
|
+
return /* @__PURE__ */ e.jsx(wa, { className: n });
|
|
2710
2718
|
case "range":
|
|
2711
|
-
return /* @__PURE__ */ e.jsx(
|
|
2719
|
+
return /* @__PURE__ */ e.jsx(da, { className: n });
|
|
2712
2720
|
case "kpi":
|
|
2713
|
-
return /* @__PURE__ */ e.jsx(
|
|
2721
|
+
return /* @__PURE__ */ e.jsx(ka, { className: n });
|
|
2722
|
+
case "text":
|
|
2723
|
+
return /* @__PURE__ */ e.jsx(Ms, { className: n });
|
|
2714
2724
|
default:
|
|
2715
2725
|
return /* @__PURE__ */ e.jsx(Cs, { className: n });
|
|
2716
2726
|
}
|
|
2717
2727
|
}
|
|
2718
|
-
function
|
|
2728
|
+
function Pn() {
|
|
2719
2729
|
const s = i(
|
|
2720
2730
|
(a) => a.card.refreshInterval
|
|
2721
2731
|
), n = i(
|
|
2722
2732
|
(a) => a.actions.setCardRefreshInterval
|
|
2723
2733
|
);
|
|
2724
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2725
|
-
/* @__PURE__ */ e.jsx(
|
|
2726
|
-
/* @__PURE__ */ e.jsx(
|
|
2734
|
+
return /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
2735
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Qt, { className: "w-4 h-4" }) }) }),
|
|
2736
|
+
/* @__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
2737
|
/* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
|
|
2728
2738
|
/* @__PURE__ */ e.jsx(
|
|
2729
2739
|
ae,
|
|
@@ -2738,27 +2748,43 @@ function $n() {
|
|
|
2738
2748
|
] }) }) }) })
|
|
2739
2749
|
] });
|
|
2740
2750
|
}
|
|
2741
|
-
function
|
|
2751
|
+
function Ks() {
|
|
2742
2752
|
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
|
-
|
|
2753
|
+
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);
|
|
2754
|
+
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)
|
|
2755
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2756
|
+
function d() {
|
|
2757
|
+
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(Ot, { 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(Mt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ba, { className: "grow border-none shadow-none" });
|
|
2758
|
+
}
|
|
2759
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
|
|
2760
|
+
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
2761
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
2747
2762
|
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(
|
|
2763
|
+
/* @__PURE__ */ e.jsx(Bn, {}),
|
|
2764
|
+
s.type !== "table" && /* @__PURE__ */ e.jsx(Hn, {}),
|
|
2765
|
+
/* @__PURE__ */ e.jsx(Pn, {})
|
|
2751
2766
|
] }),
|
|
2752
|
-
/* @__PURE__ */ e.jsx(
|
|
2767
|
+
/* @__PURE__ */ e.jsx(Un, {})
|
|
2753
2768
|
] }),
|
|
2754
|
-
a ?
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2769
|
+
a ? d() : (
|
|
2770
|
+
// card.type === 'kpi' ? (
|
|
2771
|
+
// <div className="flex grow items-center justify-center">
|
|
2772
|
+
// <div className="w-1/2 rounded-md border">
|
|
2773
|
+
// <KPICard isLoading={isSqlRunning} card={card} />
|
|
2774
|
+
// </div>
|
|
2775
|
+
// </div>
|
|
2776
|
+
// ) : (
|
|
2777
|
+
// <EditorCard className="grow border-none shadow-none" />
|
|
2778
|
+
// )
|
|
2779
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
2780
|
+
o && /* @__PURE__ */ e.jsx(Kn, {}),
|
|
2781
|
+
s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(_n, { data: n || [] }),
|
|
2782
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
|
|
2783
|
+
] })
|
|
2784
|
+
)
|
|
2785
|
+
] });
|
|
2760
2786
|
}
|
|
2761
|
-
function
|
|
2787
|
+
function Kn() {
|
|
2762
2788
|
const s = i((a) => a.pythonStdOut);
|
|
2763
2789
|
if (!s)
|
|
2764
2790
|
return null;
|
|
@@ -2775,14 +2801,14 @@ function Pn() {
|
|
|
2775
2801
|
/* @__PURE__ */ e.jsx(ks, { className: "mb-2" })
|
|
2776
2802
|
] });
|
|
2777
2803
|
}
|
|
2778
|
-
function
|
|
2804
|
+
function Un() {
|
|
2779
2805
|
const s = i((a) => a.isShowingVisual), n = i(
|
|
2780
2806
|
(a) => a.actions.setIsShowingVisual
|
|
2781
2807
|
);
|
|
2782
2808
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2783
2809
|
/* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
|
|
2784
2810
|
/* @__PURE__ */ e.jsx(
|
|
2785
|
-
|
|
2811
|
+
Tt,
|
|
2786
2812
|
{
|
|
2787
2813
|
checked: s,
|
|
2788
2814
|
onCheckedChange: () => n(!s),
|
|
@@ -2792,12 +2818,12 @@ function Kn() {
|
|
|
2792
2818
|
)
|
|
2793
2819
|
] });
|
|
2794
2820
|
}
|
|
2795
|
-
function
|
|
2821
|
+
function Ie() {
|
|
2796
2822
|
const [s, n] = T([]);
|
|
2797
2823
|
i(
|
|
2798
2824
|
(m) => m.card.cfg
|
|
2799
2825
|
);
|
|
2800
|
-
const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex:
|
|
2826
|
+
const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: o } = i((m) => m.actions), d = i(
|
|
2801
2827
|
(m) => m.queryResultColumns
|
|
2802
2828
|
);
|
|
2803
2829
|
i(
|
|
@@ -2806,11 +2832,11 @@ function De() {
|
|
|
2806
2832
|
return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
|
|
2807
2833
|
}
|
|
2808
2834
|
), P(() => {
|
|
2809
|
-
|
|
2810
|
-
}, [
|
|
2811
|
-
function
|
|
2835
|
+
d && n(new Array(d.length).fill(!1));
|
|
2836
|
+
}, [d]);
|
|
2837
|
+
function r(m, u) {
|
|
2812
2838
|
var S, h;
|
|
2813
|
-
u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ?
|
|
2839
|
+
u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ? o({
|
|
2814
2840
|
...a,
|
|
2815
2841
|
onClickFilter: [
|
|
2816
2842
|
...a.onClickFilter,
|
|
@@ -2819,7 +2845,7 @@ function De() {
|
|
|
2819
2845
|
expression: ""
|
|
2820
2846
|
}
|
|
2821
2847
|
]
|
|
2822
|
-
}) :
|
|
2848
|
+
}) : o({
|
|
2823
2849
|
...a,
|
|
2824
2850
|
onClickFilter: [
|
|
2825
2851
|
{
|
|
@@ -2827,7 +2853,7 @@ function De() {
|
|
|
2827
2853
|
expression: ""
|
|
2828
2854
|
}
|
|
2829
2855
|
]
|
|
2830
|
-
}) : (
|
|
2856
|
+
}) : (o({
|
|
2831
2857
|
...a,
|
|
2832
2858
|
onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
|
|
2833
2859
|
(x) => x.columnIndex !== m
|
|
@@ -2837,13 +2863,13 @@ function De() {
|
|
|
2837
2863
|
return g[m] = !1, g;
|
|
2838
2864
|
}));
|
|
2839
2865
|
}
|
|
2840
|
-
function
|
|
2866
|
+
function c(m, u) {
|
|
2841
2867
|
var h;
|
|
2842
2868
|
const S = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
|
|
2843
2869
|
...x,
|
|
2844
2870
|
expression: u.target.value
|
|
2845
2871
|
} : x);
|
|
2846
|
-
|
|
2872
|
+
o({
|
|
2847
2873
|
...a,
|
|
2848
2874
|
onClickFilter: S
|
|
2849
2875
|
});
|
|
@@ -2855,14 +2881,14 @@ function De() {
|
|
|
2855
2881
|
ae,
|
|
2856
2882
|
{
|
|
2857
2883
|
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) =>
|
|
2884
|
+
onChange: (g) => c(m, g),
|
|
2859
2885
|
type: "text",
|
|
2860
2886
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
2861
2887
|
placeholder: "Expression"
|
|
2862
2888
|
}
|
|
2863
2889
|
);
|
|
2864
2890
|
}
|
|
2865
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
2891
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: d == null ? void 0 : d.map((m, u) => {
|
|
2866
2892
|
var S, h;
|
|
2867
2893
|
return /* @__PURE__ */ e.jsx(
|
|
2868
2894
|
"div",
|
|
@@ -2871,12 +2897,12 @@ function De() {
|
|
|
2871
2897
|
children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
|
|
2872
2898
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
|
|
2873
2899
|
/* @__PURE__ */ e.jsx(
|
|
2874
|
-
|
|
2900
|
+
Ke,
|
|
2875
2901
|
{
|
|
2876
2902
|
checked: !!((S = a == null ? void 0 : a.onClickFilter) != null && S.find(
|
|
2877
2903
|
(x) => x.columnIndex === u
|
|
2878
2904
|
)),
|
|
2879
|
-
onCheckedChange: (x) =>
|
|
2905
|
+
onCheckedChange: (x) => r(u, x)
|
|
2880
2906
|
}
|
|
2881
2907
|
),
|
|
2882
2908
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2889,7 +2915,7 @@ function De() {
|
|
|
2889
2915
|
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
|
|
2890
2916
|
(x) => x.columnIndex === u
|
|
2891
2917
|
)) && /* @__PURE__ */ e.jsx(
|
|
2892
|
-
|
|
2918
|
+
ha,
|
|
2893
2919
|
{
|
|
2894
2920
|
onClick: () => {
|
|
2895
2921
|
n((x) => {
|
|
@@ -2908,29 +2934,29 @@ function De() {
|
|
|
2908
2934
|
);
|
|
2909
2935
|
}) });
|
|
2910
2936
|
}
|
|
2911
|
-
function
|
|
2912
|
-
var
|
|
2937
|
+
function as() {
|
|
2938
|
+
var d, r, c;
|
|
2913
2939
|
const s = i((f) => f.card.preferences), n = i(
|
|
2914
2940
|
(f) => f.card.cfg
|
|
2915
|
-
), { setCardCfg: a, setCardPreferences: t, setChartOrientation:
|
|
2916
|
-
(
|
|
2917
|
-
function
|
|
2918
|
-
|
|
2941
|
+
), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = i((f) => f.actions);
|
|
2942
|
+
(d = n == null ? void 0 : n.options) != null && d.indexAxis;
|
|
2943
|
+
function o(f) {
|
|
2944
|
+
l(f);
|
|
2919
2945
|
}
|
|
2920
2946
|
return /* @__PURE__ */ e.jsxs(
|
|
2921
|
-
|
|
2947
|
+
ws,
|
|
2922
2948
|
{
|
|
2923
|
-
value: ((
|
|
2924
|
-
onValueChange:
|
|
2949
|
+
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",
|
|
2950
|
+
onValueChange: o,
|
|
2925
2951
|
className: "flex gap-3",
|
|
2926
2952
|
defaultValue: "x",
|
|
2927
2953
|
children: [
|
|
2928
2954
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2929
|
-
/* @__PURE__ */ e.jsx(
|
|
2955
|
+
/* @__PURE__ */ e.jsx(De, { value: "x", id: "r1" }),
|
|
2930
2956
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
|
|
2931
2957
|
] }),
|
|
2932
2958
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2933
|
-
/* @__PURE__ */ e.jsx(
|
|
2959
|
+
/* @__PURE__ */ e.jsx(De, { value: "y", id: "r2" }),
|
|
2934
2960
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
|
|
2935
2961
|
] })
|
|
2936
2962
|
]
|
|
@@ -2938,12 +2964,12 @@ function ss() {
|
|
|
2938
2964
|
);
|
|
2939
2965
|
}
|
|
2940
2966
|
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 ((
|
|
2967
|
+
function Us(s, n) {
|
|
2968
|
+
var t, l, o;
|
|
2969
|
+
const a = oa(s, n);
|
|
2970
|
+
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
2971
|
}
|
|
2946
|
-
function
|
|
2972
|
+
function za() {
|
|
2947
2973
|
var Q, ee, Z, J, I, y;
|
|
2948
2974
|
const [s, n] = T(!1), a = i((v) => {
|
|
2949
2975
|
var M;
|
|
@@ -2951,26 +2977,26 @@ function wa() {
|
|
|
2951
2977
|
}), t = i((v) => {
|
|
2952
2978
|
var M;
|
|
2953
2979
|
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[
|
|
2980
|
+
}), l = oa(a, t), [o, d] = T(
|
|
2981
|
+
Us(a)
|
|
2982
|
+
), [r, c] = T(
|
|
2983
|
+
((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
2984
|
), [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(
|
|
2985
|
+
((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[l]) == null ? void 0 : y.max) || ""
|
|
2986
|
+
), [u, S] = T(r || f ? "custom" : "auto"), [h, x] = T(""), [g, z] = T(0), [b, L] = T(""), [N, O] = T(""), [j, F] = T(""), A = i(
|
|
2961
2987
|
(v) => v.actions.setCardPreferences
|
|
2962
|
-
),
|
|
2988
|
+
), V = i((v) => {
|
|
2963
2989
|
var M;
|
|
2964
2990
|
return (M = v.card) == null ? void 0 : M.type;
|
|
2965
|
-
}), K = ["pie", "doughnut", "polarArea"].includes(
|
|
2991
|
+
}), K = ["pie", "doughnut", "polarArea"].includes(V);
|
|
2966
2992
|
P(() => {
|
|
2967
2993
|
var v, M, H, ue, se, ge, je, be, xe, U, ne, re, ye, le;
|
|
2968
|
-
|
|
2969
|
-
((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[
|
|
2970
|
-
), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[
|
|
2971
|
-
((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[
|
|
2994
|
+
d(Us(a)), c(
|
|
2995
|
+
((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 : ""
|
|
2996
|
+
), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[l]) == null ? void 0 : ge.max) || ""), x(
|
|
2997
|
+
((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[l]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
|
|
2972
2998
|
), z(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((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) || "");
|
|
2973
|
-
}, [s, a,
|
|
2999
|
+
}, [s, a, l]);
|
|
2974
3000
|
function $(v, M) {
|
|
2975
3001
|
return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
|
|
2976
3002
|
}
|
|
@@ -3035,8 +3061,8 @@ function wa() {
|
|
|
3035
3061
|
ae,
|
|
3036
3062
|
{
|
|
3037
3063
|
id: "min",
|
|
3038
|
-
value:
|
|
3039
|
-
onChange: (v) =>
|
|
3064
|
+
value: r,
|
|
3065
|
+
onChange: (v) => c((M) => $(M, v.target.value)),
|
|
3040
3066
|
className: `col-span-1 h-8 w-full ${we}`
|
|
3041
3067
|
}
|
|
3042
3068
|
),
|
|
@@ -3068,7 +3094,7 @@ function wa() {
|
|
|
3068
3094
|
var H;
|
|
3069
3095
|
let v = {};
|
|
3070
3096
|
u === "custom" && (v = {
|
|
3071
|
-
min:
|
|
3097
|
+
min: r,
|
|
3072
3098
|
max: f,
|
|
3073
3099
|
ticks: {
|
|
3074
3100
|
stepSize: h
|
|
@@ -3080,10 +3106,10 @@ function wa() {
|
|
|
3080
3106
|
...a == null ? void 0 : a.chartOptions,
|
|
3081
3107
|
scales: {
|
|
3082
3108
|
...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
|
|
3083
|
-
[
|
|
3109
|
+
[l]: {
|
|
3084
3110
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3085
|
-
type:
|
|
3086
|
-
...
|
|
3111
|
+
type: o,
|
|
3112
|
+
...o === "linear" ? v : {}
|
|
3087
3113
|
}
|
|
3088
3114
|
}
|
|
3089
3115
|
},
|
|
@@ -3096,9 +3122,9 @@ function wa() {
|
|
|
3096
3122
|
};
|
|
3097
3123
|
console.log(M), A(M);
|
|
3098
3124
|
}
|
|
3099
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3100
|
-
/* @__PURE__ */ e.jsx(
|
|
3101
|
-
/* @__PURE__ */ e.jsx(
|
|
3125
|
+
return /* @__PURE__ */ e.jsxs(Ue, { onOpenChange: (v) => n(v), children: [
|
|
3126
|
+
/* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(At, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3127
|
+
/* @__PURE__ */ e.jsx(Je, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3102
3128
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3103
3129
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
3104
3130
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -3110,11 +3136,11 @@ function wa() {
|
|
|
3110
3136
|
Oe,
|
|
3111
3137
|
{
|
|
3112
3138
|
disabled: K,
|
|
3113
|
-
value:
|
|
3114
|
-
onValueChange: (v) =>
|
|
3139
|
+
value: o,
|
|
3140
|
+
onValueChange: (v) => d(v),
|
|
3115
3141
|
children: [
|
|
3116
3142
|
/* @__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(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(
|
|
3143
|
+
/* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3118
3144
|
/* @__PURE__ */ e.jsx(Le, { children: "Option" }),
|
|
3119
3145
|
/* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
|
|
3120
3146
|
/* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
|
|
@@ -3123,10 +3149,10 @@ function wa() {
|
|
|
3123
3149
|
}
|
|
3124
3150
|
)
|
|
3125
3151
|
] }),
|
|
3126
|
-
|
|
3152
|
+
o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
3127
3153
|
/* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
|
|
3128
3154
|
/* @__PURE__ */ e.jsxs(
|
|
3129
|
-
|
|
3155
|
+
ws,
|
|
3130
3156
|
{
|
|
3131
3157
|
disabled: K,
|
|
3132
3158
|
id: "scale-option",
|
|
@@ -3136,20 +3162,20 @@ function wa() {
|
|
|
3136
3162
|
defaultValue: "x",
|
|
3137
3163
|
children: [
|
|
3138
3164
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3139
|
-
/* @__PURE__ */ e.jsx(
|
|
3165
|
+
/* @__PURE__ */ e.jsx(De, { value: "auto", id: "r1" }),
|
|
3140
3166
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
|
|
3141
3167
|
] }),
|
|
3142
3168
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3143
|
-
/* @__PURE__ */ e.jsx(
|
|
3169
|
+
/* @__PURE__ */ e.jsx(De, { value: "custom", id: "r2" }),
|
|
3144
3170
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
|
|
3145
3171
|
] })
|
|
3146
3172
|
]
|
|
3147
3173
|
}
|
|
3148
3174
|
)
|
|
3149
3175
|
] }),
|
|
3150
|
-
u === "custom" &&
|
|
3176
|
+
u === "custom" && o == "linear" && D(),
|
|
3151
3177
|
G(),
|
|
3152
|
-
/* @__PURE__ */ e.jsx(
|
|
3178
|
+
/* @__PURE__ */ e.jsx(Et, {}),
|
|
3153
3179
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3154
3180
|
w,
|
|
3155
3181
|
{
|
|
@@ -3163,28 +3189,28 @@ function wa() {
|
|
|
3163
3189
|
] }) })
|
|
3164
3190
|
] });
|
|
3165
3191
|
}
|
|
3166
|
-
function
|
|
3167
|
-
var
|
|
3168
|
-
const n = i((
|
|
3192
|
+
function Gn({ idx: s }) {
|
|
3193
|
+
var r;
|
|
3194
|
+
const n = i((c) => {
|
|
3169
3195
|
var f;
|
|
3170
|
-
return (f =
|
|
3196
|
+
return (f = c.card) == null ? void 0 : f.preferences;
|
|
3171
3197
|
}), a = i(
|
|
3172
|
-
(
|
|
3198
|
+
(c) => {
|
|
3173
3199
|
var f;
|
|
3174
|
-
return (f =
|
|
3200
|
+
return (f = c.card.preferences) == null ? void 0 : f.datasetOptions;
|
|
3175
3201
|
}
|
|
3176
3202
|
), t = i(
|
|
3177
|
-
(
|
|
3178
|
-
),
|
|
3179
|
-
function
|
|
3180
|
-
(
|
|
3203
|
+
(c) => c.actions.setCardPreferences
|
|
3204
|
+
), l = (r = n == null ? void 0 : n.chartOptions) == null ? void 0 : r.indexAxis, o = a == null ? void 0 : a.find((c) => c.idx === s);
|
|
3205
|
+
function d(c, f) {
|
|
3206
|
+
(c === "end" || c === "start") && Dt(It());
|
|
3181
3207
|
const m = {
|
|
3182
|
-
display:
|
|
3183
|
-
align:
|
|
3184
|
-
anchor:
|
|
3208
|
+
display: c !== "none",
|
|
3209
|
+
align: c,
|
|
3210
|
+
anchor: c,
|
|
3185
3211
|
clamp: !0
|
|
3186
3212
|
};
|
|
3187
|
-
if (!
|
|
3213
|
+
if (!o)
|
|
3188
3214
|
t({
|
|
3189
3215
|
...n,
|
|
3190
3216
|
datasetOptions: [
|
|
@@ -3196,7 +3222,7 @@ function Un({ idx: s }) {
|
|
|
3196
3222
|
]
|
|
3197
3223
|
});
|
|
3198
3224
|
else {
|
|
3199
|
-
const u = { ...
|
|
3225
|
+
const u = { ...o };
|
|
3200
3226
|
u.datalabels = m;
|
|
3201
3227
|
const S = a == null ? void 0 : a.map(
|
|
3202
3228
|
(h) => h.idx === f ? u : h
|
|
@@ -3207,31 +3233,31 @@ function Un({ idx: s }) {
|
|
|
3207
3233
|
});
|
|
3208
3234
|
}
|
|
3209
3235
|
}
|
|
3210
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3211
|
-
/* @__PURE__ */ e.jsx(
|
|
3212
|
-
/* @__PURE__ */ e.jsx(
|
|
3236
|
+
return /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
3237
|
+
/* @__PURE__ */ e.jsx(Ge, { children: /* @__PURE__ */ e.jsx(fn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
3238
|
+
/* @__PURE__ */ e.jsx(Je, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
3213
3239
|
/* @__PURE__ */ e.jsx(
|
|
3214
3240
|
w,
|
|
3215
3241
|
{
|
|
3216
|
-
onClick: () =>
|
|
3242
|
+
onClick: () => d("none", s),
|
|
3217
3243
|
size: "sm",
|
|
3218
3244
|
variant: "secondary",
|
|
3219
3245
|
className: "h-7 p-1 text-xs font-normal",
|
|
3220
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3246
|
+
children: /* @__PURE__ */ e.jsx(Lt, { className: "size-4" })
|
|
3221
3247
|
}
|
|
3222
3248
|
),
|
|
3223
3249
|
/* @__PURE__ */ e.jsx(
|
|
3224
3250
|
w,
|
|
3225
3251
|
{
|
|
3226
|
-
onClick: () =>
|
|
3252
|
+
onClick: () => d("start", s),
|
|
3227
3253
|
size: "sm",
|
|
3228
3254
|
variant: "secondary",
|
|
3229
3255
|
className: "h-7 p-1 text-xs font-normal",
|
|
3230
3256
|
children: /* @__PURE__ */ e.jsx(
|
|
3231
|
-
|
|
3257
|
+
nn,
|
|
3232
3258
|
{
|
|
3233
3259
|
className: Y("h-4 w-4", {
|
|
3234
|
-
"rotate-90":
|
|
3260
|
+
"rotate-90": l === "y"
|
|
3235
3261
|
})
|
|
3236
3262
|
}
|
|
3237
3263
|
)
|
|
@@ -3240,15 +3266,15 @@ function Un({ idx: s }) {
|
|
|
3240
3266
|
/* @__PURE__ */ e.jsx(
|
|
3241
3267
|
w,
|
|
3242
3268
|
{
|
|
3243
|
-
onClick: () =>
|
|
3269
|
+
onClick: () => d("center", s),
|
|
3244
3270
|
size: "sm",
|
|
3245
3271
|
variant: "secondary",
|
|
3246
3272
|
className: "h-7 p-1 text-xs font-normal",
|
|
3247
3273
|
children: /* @__PURE__ */ e.jsx(
|
|
3248
|
-
|
|
3274
|
+
ln,
|
|
3249
3275
|
{
|
|
3250
3276
|
className: Y("h-4 w-4", {
|
|
3251
|
-
"rotate-90":
|
|
3277
|
+
"rotate-90": l === "y"
|
|
3252
3278
|
})
|
|
3253
3279
|
}
|
|
3254
3280
|
)
|
|
@@ -3257,15 +3283,15 @@ function Un({ idx: s }) {
|
|
|
3257
3283
|
/* @__PURE__ */ e.jsx(
|
|
3258
3284
|
w,
|
|
3259
3285
|
{
|
|
3260
|
-
onClick: () =>
|
|
3286
|
+
onClick: () => d("end", s),
|
|
3261
3287
|
size: "sm",
|
|
3262
3288
|
variant: "secondary",
|
|
3263
3289
|
className: "h-7 p-1 text-xs font-normal",
|
|
3264
3290
|
children: /* @__PURE__ */ e.jsx(
|
|
3265
|
-
|
|
3291
|
+
rn,
|
|
3266
3292
|
{
|
|
3267
3293
|
className: Y("h-4 w-4", {
|
|
3268
|
-
"rotate-90":
|
|
3294
|
+
"rotate-90": l === "y"
|
|
3269
3295
|
})
|
|
3270
3296
|
}
|
|
3271
3297
|
)
|
|
@@ -3274,71 +3300,71 @@ function Un({ idx: s }) {
|
|
|
3274
3300
|
] }) })
|
|
3275
3301
|
] });
|
|
3276
3302
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const s = i((
|
|
3279
|
-
(
|
|
3303
|
+
function Fa() {
|
|
3304
|
+
const s = i((c) => c.card), n = i(
|
|
3305
|
+
(c) => {
|
|
3280
3306
|
var f, m, u;
|
|
3281
|
-
return (u = (m = (f =
|
|
3307
|
+
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
3308
|
}
|
|
3283
3309
|
), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
|
|
3284
|
-
keys:
|
|
3285
|
-
metricKeys:
|
|
3286
|
-
dimensionKeys:
|
|
3310
|
+
keys: l,
|
|
3311
|
+
metricKeys: o,
|
|
3312
|
+
dimensionKeys: d
|
|
3287
3313
|
} = ms(s.data || []);
|
|
3288
|
-
let
|
|
3314
|
+
let r = o;
|
|
3289
3315
|
if (s.type === "stackedBar") {
|
|
3290
|
-
const
|
|
3316
|
+
const c = Vt({
|
|
3291
3317
|
dataArray: s.data || [],
|
|
3292
|
-
groupKey:
|
|
3293
|
-
pivotKey:
|
|
3294
|
-
valueKey:
|
|
3295
|
-
}), { metricKeys: f } = ms(
|
|
3296
|
-
|
|
3318
|
+
groupKey: d[0],
|
|
3319
|
+
pivotKey: d[1],
|
|
3320
|
+
valueKey: r[0]
|
|
3321
|
+
}), { metricKeys: f } = ms(c);
|
|
3322
|
+
r = f;
|
|
3297
3323
|
}
|
|
3298
|
-
return
|
|
3324
|
+
return l.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3299
3325
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3300
3326
|
/* @__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:
|
|
3327
|
+
/* @__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
3328
|
] }),
|
|
3303
3329
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3304
3330
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3305
3331
|
/* @__PURE__ */ e.jsx(B, { children: t }),
|
|
3306
|
-
/* @__PURE__ */ e.jsx(
|
|
3332
|
+
/* @__PURE__ */ e.jsx(za, {})
|
|
3307
3333
|
] }),
|
|
3308
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
3334
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: r.map((c, f) => /* @__PURE__ */ e.jsx(Jn, { col: c, idx: f }, c)) })
|
|
3309
3335
|
] })
|
|
3310
3336
|
] });
|
|
3311
3337
|
}
|
|
3312
|
-
function
|
|
3313
|
-
const a = i((
|
|
3314
|
-
var
|
|
3315
|
-
return (
|
|
3338
|
+
function Jn({ col: s, idx: n }) {
|
|
3339
|
+
const a = i((r) => {
|
|
3340
|
+
var c;
|
|
3341
|
+
return (c = r.card) == null ? void 0 : c.preferences;
|
|
3316
3342
|
}), t = i(
|
|
3317
|
-
(
|
|
3318
|
-
var
|
|
3319
|
-
return (
|
|
3343
|
+
(r) => {
|
|
3344
|
+
var c;
|
|
3345
|
+
return (c = r.card.preferences) == null ? void 0 : c.datasetOptions;
|
|
3320
3346
|
}
|
|
3321
|
-
),
|
|
3322
|
-
function r
|
|
3323
|
-
if (!
|
|
3324
|
-
|
|
3347
|
+
), l = t == null ? void 0 : t.find((r) => r.idx === n), { setCardPreferences: o } = i((r) => r.actions);
|
|
3348
|
+
function d(r) {
|
|
3349
|
+
if (!l)
|
|
3350
|
+
o({
|
|
3325
3351
|
...a,
|
|
3326
3352
|
datasetOptions: [
|
|
3327
3353
|
...t || [],
|
|
3328
3354
|
{
|
|
3329
3355
|
idx: n,
|
|
3330
|
-
type:
|
|
3331
|
-
fill:
|
|
3356
|
+
type: r === "area" ? "line" : r,
|
|
3357
|
+
fill: r === "area" ? "origin" : ""
|
|
3332
3358
|
}
|
|
3333
3359
|
]
|
|
3334
3360
|
});
|
|
3335
3361
|
else {
|
|
3336
|
-
const
|
|
3337
|
-
|
|
3362
|
+
const c = { ...l };
|
|
3363
|
+
c.type = r === "area" ? "line" : r, c.fill = r === "area" ? "origin" : "";
|
|
3338
3364
|
const f = t == null ? void 0 : t.map(
|
|
3339
|
-
(m) => m.idx === n ?
|
|
3365
|
+
(m) => m.idx === n ? c : m
|
|
3340
3366
|
);
|
|
3341
|
-
|
|
3367
|
+
o({
|
|
3342
3368
|
...a,
|
|
3343
3369
|
datasetOptions: f
|
|
3344
3370
|
});
|
|
@@ -3348,23 +3374,23 @@ function Gn({ col: s, idx: n }) {
|
|
|
3348
3374
|
/* @__PURE__ */ e.jsx("p", { children: s }),
|
|
3349
3375
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
3350
3376
|
/* @__PURE__ */ e.jsx(
|
|
3351
|
-
|
|
3377
|
+
Fs,
|
|
3352
3378
|
{
|
|
3353
|
-
onClick: () =>
|
|
3379
|
+
onClick: () => d("bar"),
|
|
3354
3380
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3355
3381
|
}
|
|
3356
3382
|
),
|
|
3357
3383
|
/* @__PURE__ */ e.jsx(
|
|
3358
|
-
|
|
3384
|
+
Os,
|
|
3359
3385
|
{
|
|
3360
|
-
onClick: () =>
|
|
3386
|
+
onClick: () => d("line"),
|
|
3361
3387
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3362
3388
|
}
|
|
3363
3389
|
),
|
|
3364
3390
|
/* @__PURE__ */ e.jsx(
|
|
3365
|
-
|
|
3391
|
+
Wt,
|
|
3366
3392
|
{
|
|
3367
|
-
onClick: () =>
|
|
3393
|
+
onClick: () => d("area"),
|
|
3368
3394
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3369
3395
|
}
|
|
3370
3396
|
),
|
|
@@ -3375,16 +3401,16 @@ function Gn({ col: s, idx: n }) {
|
|
|
3375
3401
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3376
3402
|
}
|
|
3377
3403
|
),
|
|
3378
|
-
/* @__PURE__ */ e.jsx(
|
|
3404
|
+
/* @__PURE__ */ e.jsx(Gn, { idx: n })
|
|
3379
3405
|
] })
|
|
3380
3406
|
] });
|
|
3381
3407
|
}
|
|
3382
|
-
function
|
|
3408
|
+
function Qn({
|
|
3383
3409
|
cardType: s
|
|
3384
3410
|
}) {
|
|
3385
3411
|
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: `${
|
|
3412
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3413
|
+
/* @__PURE__ */ e.jsx(R, { children: `${zs(s)} Chart` }),
|
|
3388
3414
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3389
3415
|
/* @__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
3416
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -3408,31 +3434,31 @@ function Jn({
|
|
|
3408
3434
|
] })
|
|
3409
3435
|
] })
|
|
3410
3436
|
] }),
|
|
3411
|
-
/* @__PURE__ */ e.jsxs(
|
|
3437
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3412
3438
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3413
3439
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3414
|
-
/* @__PURE__ */ e.jsx(
|
|
3415
|
-
/* @__PURE__ */ e.jsx(
|
|
3440
|
+
/* @__PURE__ */ e.jsx(as, {}),
|
|
3441
|
+
/* @__PURE__ */ e.jsx(Fa, {})
|
|
3416
3442
|
] })
|
|
3417
3443
|
] }),
|
|
3418
|
-
/* @__PURE__ */ e.jsxs(
|
|
3444
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3419
3445
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3420
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3446
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3421
3447
|
] })
|
|
3422
3448
|
] }) });
|
|
3423
3449
|
}
|
|
3424
|
-
function
|
|
3425
|
-
var
|
|
3450
|
+
function Ts() {
|
|
3451
|
+
var l, o, d;
|
|
3426
3452
|
const s = i(
|
|
3427
|
-
(
|
|
3428
|
-
), n = i((
|
|
3429
|
-
function t(
|
|
3453
|
+
(r) => r.card.cfg
|
|
3454
|
+
), n = i((r) => r.actions.setCardCfg), a = i((r) => r.card.type);
|
|
3455
|
+
function t(r) {
|
|
3430
3456
|
var m;
|
|
3431
|
-
const
|
|
3457
|
+
const c = {
|
|
3432
3458
|
datalabels: {
|
|
3433
|
-
display:
|
|
3434
|
-
align:
|
|
3435
|
-
anchor:
|
|
3459
|
+
display: r !== "none",
|
|
3460
|
+
align: r,
|
|
3461
|
+
anchor: r,
|
|
3436
3462
|
clamp: !0
|
|
3437
3463
|
}
|
|
3438
3464
|
}, f = {
|
|
@@ -3441,26 +3467,26 @@ function Os() {
|
|
|
3441
3467
|
...s == null ? void 0 : s.options,
|
|
3442
3468
|
plugins: {
|
|
3443
3469
|
...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
|
|
3444
|
-
...
|
|
3470
|
+
...c
|
|
3445
3471
|
}
|
|
3446
3472
|
}
|
|
3447
3473
|
};
|
|
3448
|
-
n(f), console.log(
|
|
3474
|
+
n(f), console.log(r);
|
|
3449
3475
|
}
|
|
3450
3476
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3451
3477
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3452
3478
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
3453
|
-
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(
|
|
3479
|
+
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(za, {})
|
|
3454
3480
|
] }),
|
|
3455
3481
|
/* @__PURE__ */ e.jsxs(
|
|
3456
3482
|
Oe,
|
|
3457
3483
|
{
|
|
3458
|
-
value: (
|
|
3484
|
+
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
3485
|
onValueChange: t,
|
|
3460
3486
|
defaultValue: "none",
|
|
3461
3487
|
children: [
|
|
3462
3488
|
/* @__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(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
3489
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3464
3490
|
/* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
|
|
3465
3491
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
|
|
3466
3492
|
a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
|
|
@@ -3472,13 +3498,13 @@ function Os() {
|
|
|
3472
3498
|
)
|
|
3473
3499
|
] });
|
|
3474
3500
|
}
|
|
3475
|
-
function
|
|
3501
|
+
function Wn({
|
|
3476
3502
|
cardType: s
|
|
3477
3503
|
}) {
|
|
3478
3504
|
function n(a) {
|
|
3479
|
-
const t = "SELECT label, [group], x-axis, y-axis, radius FROM table",
|
|
3505
|
+
const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", l = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
3480
3506
|
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 :
|
|
3507
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : l }),
|
|
3482
3508
|
/* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
|
|
3483
3509
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
3484
3510
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
@@ -3492,7 +3518,7 @@ function Qn({
|
|
|
3492
3518
|
"a",
|
|
3493
3519
|
{
|
|
3494
3520
|
target: "_blank",
|
|
3495
|
-
onClick: (
|
|
3521
|
+
onClick: (o) => o.stopPropagation(),
|
|
3496
3522
|
className: "text-blue-700",
|
|
3497
3523
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
3498
3524
|
children: "example"
|
|
@@ -3503,21 +3529,21 @@ function Qn({
|
|
|
3503
3529
|
] });
|
|
3504
3530
|
}
|
|
3505
3531
|
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: `${
|
|
3532
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3533
|
+
/* @__PURE__ */ e.jsx(R, { children: `${zs(s)} Chart` }),
|
|
3508
3534
|
/* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
|
|
3509
3535
|
] }),
|
|
3510
|
-
/* @__PURE__ */ e.jsxs(
|
|
3536
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3511
3537
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3512
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3538
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ts, {}) })
|
|
3513
3539
|
] }),
|
|
3514
|
-
/* @__PURE__ */ e.jsxs(
|
|
3540
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3515
3541
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3516
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3542
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3517
3543
|
] })
|
|
3518
3544
|
] }) });
|
|
3519
3545
|
}
|
|
3520
|
-
const
|
|
3546
|
+
const Yn = {
|
|
3521
3547
|
datasets: [
|
|
3522
3548
|
{
|
|
3523
3549
|
type: "line",
|
|
@@ -3530,7 +3556,7 @@ const Wn = {
|
|
|
3530
3556
|
data: []
|
|
3531
3557
|
}
|
|
3532
3558
|
]
|
|
3533
|
-
},
|
|
3559
|
+
}, Xn = {
|
|
3534
3560
|
datasets: [
|
|
3535
3561
|
{
|
|
3536
3562
|
fill: "origin",
|
|
@@ -3540,7 +3566,7 @@ const Wn = {
|
|
|
3540
3566
|
}
|
|
3541
3567
|
]
|
|
3542
3568
|
};
|
|
3543
|
-
function
|
|
3569
|
+
function Zn() {
|
|
3544
3570
|
const s = i((n) => n.card.type);
|
|
3545
3571
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
3546
3572
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3549,18 +3575,18 @@ function Xn() {
|
|
|
3549
3575
|
className: " ",
|
|
3550
3576
|
type: "single",
|
|
3551
3577
|
collapsible: !0,
|
|
3552
|
-
children:
|
|
3578
|
+
children: er(s)
|
|
3553
3579
|
}
|
|
3554
3580
|
),
|
|
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(
|
|
3581
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(as, {}) }),
|
|
3582
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ts, {}) }),
|
|
3583
|
+
/* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3558
3584
|
] });
|
|
3559
3585
|
}
|
|
3560
|
-
function
|
|
3586
|
+
function er(s) {
|
|
3561
3587
|
if (["line", "bar"].includes(s))
|
|
3562
3588
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3563
|
-
/* @__PURE__ */ e.jsxs(
|
|
3589
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3564
3590
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
|
|
3565
3591
|
/* @__PURE__ */ e.jsxs(_, { className: " ", children: [
|
|
3566
3592
|
/* @__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 +3596,7 @@ function Zn(s) {
|
|
|
3570
3596
|
] })
|
|
3571
3597
|
] })
|
|
3572
3598
|
] }),
|
|
3573
|
-
/* @__PURE__ */ e.jsxs(
|
|
3599
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3574
3600
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
|
|
3575
3601
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3576
3602
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
@@ -3578,10 +3604,10 @@ function Zn(s) {
|
|
|
3578
3604
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
3579
3605
|
" and change the `type` property in the dataset."
|
|
3580
3606
|
] }),
|
|
3581
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3607
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
|
|
3582
3608
|
] })
|
|
3583
3609
|
] }),
|
|
3584
|
-
/* @__PURE__ */ e.jsxs(
|
|
3610
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3585
3611
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
|
|
3586
3612
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
|
|
3587
3613
|
/* @__PURE__ */ e.jsxs("p", { children: [
|
|
@@ -3599,12 +3625,12 @@ function Zn(s) {
|
|
|
3599
3625
|
),
|
|
3600
3626
|
"for more options."
|
|
3601
3627
|
] }),
|
|
3602
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
3628
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Xn, null, 2) })
|
|
3603
3629
|
] })
|
|
3604
3630
|
] })
|
|
3605
3631
|
] });
|
|
3606
3632
|
if (s === "bubble")
|
|
3607
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3633
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3608
3634
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3609
3635
|
"How to create a ",
|
|
3610
3636
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
@@ -3622,7 +3648,7 @@ function Zn(s) {
|
|
|
3622
3648
|
] })
|
|
3623
3649
|
] }) });
|
|
3624
3650
|
if (s === "scatter")
|
|
3625
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3651
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3626
3652
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3627
3653
|
"How to create a ",
|
|
3628
3654
|
/* @__PURE__ */ e.jsx("span", { children: s }),
|
|
@@ -3639,7 +3665,7 @@ function Zn(s) {
|
|
|
3639
3665
|
] })
|
|
3640
3666
|
] }) });
|
|
3641
3667
|
if (["pie", "doughnut", "polarArea"].includes(s))
|
|
3642
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
3668
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3643
3669
|
/* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
|
|
3644
3670
|
/* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
|
|
3645
3671
|
" ",
|
|
@@ -3654,8 +3680,8 @@ function Zn(s) {
|
|
|
3654
3680
|
] })
|
|
3655
3681
|
] }) });
|
|
3656
3682
|
}
|
|
3657
|
-
function
|
|
3658
|
-
var
|
|
3683
|
+
function sr() {
|
|
3684
|
+
var c, f, m, u, S;
|
|
3659
3685
|
const s = i((h) => h.card.preferences), n = i(
|
|
3660
3686
|
(h) => h.actions.setCardPreferences
|
|
3661
3687
|
), a = i(
|
|
@@ -3672,7 +3698,7 @@ function er() {
|
|
|
3672
3698
|
var x, g;
|
|
3673
3699
|
return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
|
|
3674
3700
|
}
|
|
3675
|
-
),
|
|
3701
|
+
), l = i(
|
|
3676
3702
|
(h) => {
|
|
3677
3703
|
var x, g;
|
|
3678
3704
|
return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
|
|
@@ -3681,20 +3707,20 @@ function er() {
|
|
|
3681
3707
|
i(
|
|
3682
3708
|
(h) => h.actions.setFilterOnClickField
|
|
3683
3709
|
);
|
|
3684
|
-
const
|
|
3710
|
+
const o = i(
|
|
3685
3711
|
(h) => {
|
|
3686
3712
|
var x, g;
|
|
3687
3713
|
return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
|
|
3688
3714
|
}
|
|
3689
|
-
) || [],
|
|
3715
|
+
) || [], d = i(
|
|
3690
3716
|
(h) => h.actions.setColorRanges
|
|
3691
|
-
),
|
|
3717
|
+
), r = [...new Set(Hs.map((h) => h.currency))];
|
|
3692
3718
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
3693
3719
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3694
3720
|
/* @__PURE__ */ e.jsx(
|
|
3695
|
-
|
|
3721
|
+
Ke,
|
|
3696
3722
|
{
|
|
3697
|
-
checked: !!((
|
|
3723
|
+
checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
|
|
3698
3724
|
onCheckedChange: (h) => {
|
|
3699
3725
|
n({
|
|
3700
3726
|
...s,
|
|
@@ -3728,9 +3754,9 @@ function er() {
|
|
|
3728
3754
|
},
|
|
3729
3755
|
children: [
|
|
3730
3756
|
/* @__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(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
3757
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3732
3758
|
/* @__PURE__ */ e.jsx(Le, { children: "Format" }),
|
|
3733
|
-
|
|
3759
|
+
Hs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
|
|
3734
3760
|
] }) })
|
|
3735
3761
|
]
|
|
3736
3762
|
}
|
|
@@ -3741,7 +3767,7 @@ function er() {
|
|
|
3741
3767
|
/* @__PURE__ */ e.jsxs(
|
|
3742
3768
|
Oe,
|
|
3743
3769
|
{
|
|
3744
|
-
value:
|
|
3770
|
+
value: l || "none",
|
|
3745
3771
|
onValueChange: (h) => {
|
|
3746
3772
|
var x, g, z;
|
|
3747
3773
|
return a(
|
|
@@ -3753,10 +3779,10 @@ function er() {
|
|
|
3753
3779
|
},
|
|
3754
3780
|
children: [
|
|
3755
3781
|
/* @__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(Ae, { children: /* @__PURE__ */ e.jsxs(
|
|
3782
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
|
|
3757
3783
|
/* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
|
|
3758
3784
|
/* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
|
|
3759
|
-
|
|
3785
|
+
r.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
|
|
3760
3786
|
] }) })
|
|
3761
3787
|
]
|
|
3762
3788
|
}
|
|
@@ -3810,18 +3836,18 @@ function er() {
|
|
|
3810
3836
|
] }) }),
|
|
3811
3837
|
/* @__PURE__ */ e.jsx(ks, { className: "my-3" }),
|
|
3812
3838
|
/* @__PURE__ */ e.jsx(
|
|
3813
|
-
|
|
3839
|
+
qt,
|
|
3814
3840
|
{
|
|
3815
|
-
colorRanges:
|
|
3816
|
-
setColorRanges:
|
|
3841
|
+
colorRanges: o,
|
|
3842
|
+
setColorRanges: d
|
|
3817
3843
|
}
|
|
3818
3844
|
)
|
|
3819
3845
|
] })
|
|
3820
3846
|
] });
|
|
3821
3847
|
}
|
|
3822
|
-
function
|
|
3848
|
+
function ar() {
|
|
3823
3849
|
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(
|
|
3850
|
+
/* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3825
3851
|
/* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
|
|
3826
3852
|
/* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
|
|
3827
3853
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
|
|
@@ -3845,18 +3871,51 @@ function sr() {
|
|
|
3845
3871
|
] })
|
|
3846
3872
|
] })
|
|
3847
3873
|
] }) }),
|
|
3848
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
3874
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(sr, {}) }),
|
|
3849
3875
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
3850
3876
|
/* @__PURE__ */ e.jsx("div", {})
|
|
3851
3877
|
] });
|
|
3852
3878
|
}
|
|
3853
|
-
function
|
|
3879
|
+
function tr() {
|
|
3880
|
+
var t;
|
|
3881
|
+
const s = i((l) => l.card.preferences), { setCardPreferences: n } = i((l) => l.actions);
|
|
3882
|
+
function a(l) {
|
|
3883
|
+
n({
|
|
3884
|
+
...s,
|
|
3885
|
+
textVisualOptions: {
|
|
3886
|
+
...s == null ? void 0 : s.textVisualOptions,
|
|
3887
|
+
isDynamicText: l === "dynamic"
|
|
3888
|
+
}
|
|
3889
|
+
});
|
|
3890
|
+
}
|
|
3891
|
+
return /* @__PURE__ */ e.jsxs(
|
|
3892
|
+
ws,
|
|
3893
|
+
{
|
|
3894
|
+
value: (t = s == null ? void 0 : s.textVisualOptions) != null && t.isDynamicText ? "dynamic" : "static",
|
|
3895
|
+
onValueChange: a,
|
|
3896
|
+
className: "flex gap-3",
|
|
3897
|
+
defaultValue: "x",
|
|
3898
|
+
children: [
|
|
3899
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3900
|
+
/* @__PURE__ */ e.jsx(De, { value: "static", id: "r1" }),
|
|
3901
|
+
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
|
|
3902
|
+
] }),
|
|
3903
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3904
|
+
/* @__PURE__ */ e.jsx(De, { value: "dynamic", id: "r2" }),
|
|
3905
|
+
/* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
|
|
3906
|
+
] })
|
|
3907
|
+
]
|
|
3908
|
+
}
|
|
3909
|
+
);
|
|
3910
|
+
}
|
|
3911
|
+
function Ye({
|
|
3854
3912
|
cardType: s,
|
|
3855
|
-
docContent: n
|
|
3913
|
+
docContent: n,
|
|
3914
|
+
suffix: a = "Chart"
|
|
3856
3915
|
}) {
|
|
3857
3916
|
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: `${
|
|
3917
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3918
|
+
/* @__PURE__ */ e.jsx(R, { children: `${zs(s)} ${a}` }),
|
|
3860
3919
|
/* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3861
3920
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
3862
3921
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -3869,7 +3928,7 @@ function cs({
|
|
|
3869
3928
|
"a",
|
|
3870
3929
|
{
|
|
3871
3930
|
target: "_blank",
|
|
3872
|
-
onClick: (
|
|
3931
|
+
onClick: (t) => t.stopPropagation(),
|
|
3873
3932
|
className: "text-blue-700",
|
|
3874
3933
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
3875
3934
|
children: "example"
|
|
@@ -3879,22 +3938,23 @@ function cs({
|
|
|
3879
3938
|
] })
|
|
3880
3939
|
] }) })
|
|
3881
3940
|
] }),
|
|
3882
|
-
/* @__PURE__ */ e.jsxs(
|
|
3941
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3883
3942
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3884
3943
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3885
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
3886
|
-
/* @__PURE__ */ e.jsx(
|
|
3944
|
+
s === "range" && /* @__PURE__ */ e.jsx(as, {}),
|
|
3945
|
+
s !== "text" && /* @__PURE__ */ e.jsx(Ts, {}),
|
|
3946
|
+
s === "text" && /* @__PURE__ */ e.jsx(tr, {})
|
|
3887
3947
|
] })
|
|
3888
3948
|
] }),
|
|
3889
|
-
|
|
3949
|
+
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3890
3950
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3891
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3951
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3892
3952
|
] })
|
|
3893
3953
|
] }) });
|
|
3894
3954
|
}
|
|
3895
|
-
function
|
|
3955
|
+
function nr() {
|
|
3896
3956
|
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(
|
|
3957
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
|
|
3898
3958
|
/* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
|
|
3899
3959
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
|
|
3900
3960
|
/* @__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 +3979,23 @@ function ar() {
|
|
|
3919
3979
|
] })
|
|
3920
3980
|
] })
|
|
3921
3981
|
] }),
|
|
3922
|
-
/* @__PURE__ */ e.jsxs(
|
|
3982
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
|
|
3923
3983
|
/* @__PURE__ */ e.jsx(R, { children: "Settings" }),
|
|
3924
3984
|
/* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
|
|
3925
|
-
/* @__PURE__ */ e.jsx(
|
|
3926
|
-
/* @__PURE__ */ e.jsx(
|
|
3985
|
+
/* @__PURE__ */ e.jsx(as, {}),
|
|
3986
|
+
/* @__PURE__ */ e.jsx(Fa, {})
|
|
3927
3987
|
] })
|
|
3928
3988
|
] }),
|
|
3929
|
-
/* @__PURE__ */ e.jsxs(
|
|
3989
|
+
/* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3930
3990
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3931
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3991
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3932
3992
|
] })
|
|
3933
3993
|
] }) });
|
|
3934
3994
|
}
|
|
3935
|
-
function
|
|
3995
|
+
function rr({}) {
|
|
3936
3996
|
const s = i((t) => {
|
|
3937
|
-
var
|
|
3938
|
-
return (
|
|
3997
|
+
var l;
|
|
3998
|
+
return (l = t.card) == null ? void 0 : l.preferences;
|
|
3939
3999
|
}), n = i(
|
|
3940
4000
|
(t) => t.actions.setCardPreferences
|
|
3941
4001
|
), a = (t) => {
|
|
@@ -3945,12 +4005,12 @@ function tr({}) {
|
|
|
3945
4005
|
});
|
|
3946
4006
|
};
|
|
3947
4007
|
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(
|
|
4008
|
+
/* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
|
|
3949
4009
|
/* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
|
|
3950
|
-
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
4010
|
+
/* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
|
|
3951
4011
|
] }) }),
|
|
3952
4012
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3953
|
-
/* @__PURE__ */ e.jsx(
|
|
4013
|
+
/* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
|
|
3954
4014
|
/* @__PURE__ */ e.jsx(
|
|
3955
4015
|
"label",
|
|
3956
4016
|
{
|
|
@@ -3962,7 +4022,7 @@ function tr({}) {
|
|
|
3962
4022
|
] })
|
|
3963
4023
|
] });
|
|
3964
4024
|
}
|
|
3965
|
-
const
|
|
4025
|
+
const lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3966
4026
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
3967
4027
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3968
4028
|
"See ",
|
|
@@ -3978,7 +4038,7 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
3978
4038
|
),
|
|
3979
4039
|
" in the docs."
|
|
3980
4040
|
] })
|
|
3981
|
-
] }),
|
|
4041
|
+
] }), ir = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
3982
4042
|
/* @__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
4043
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3984
4044
|
"See ",
|
|
@@ -3994,39 +4054,64 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
3994
4054
|
),
|
|
3995
4055
|
" in the docs."
|
|
3996
4056
|
] })
|
|
4057
|
+
] }), or = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4058
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
|
|
4059
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
4060
|
+
"See ",
|
|
4061
|
+
/* @__PURE__ */ e.jsx(
|
|
4062
|
+
"a",
|
|
4063
|
+
{
|
|
4064
|
+
target: "_blank",
|
|
4065
|
+
onClick: (s) => s.stopPropagation(),
|
|
4066
|
+
className: "text-blue-700",
|
|
4067
|
+
href: "https://docs.semaphor.cloud/concepts/visuals#text-visual",
|
|
4068
|
+
children: "example"
|
|
4069
|
+
}
|
|
4070
|
+
),
|
|
4071
|
+
" in the docs."
|
|
4072
|
+
] })
|
|
3997
4073
|
] });
|
|
3998
|
-
function
|
|
4074
|
+
function cr() {
|
|
3999
4075
|
const s = i((a) => a.card.type);
|
|
4000
4076
|
function n(a) {
|
|
4001
4077
|
switch (a) {
|
|
4002
4078
|
case "stackedBar":
|
|
4003
|
-
return /* @__PURE__ */ e.jsx(
|
|
4079
|
+
return /* @__PURE__ */ e.jsx(nr, {});
|
|
4004
4080
|
case "pyramid":
|
|
4005
|
-
return /* @__PURE__ */ e.jsx(
|
|
4081
|
+
return /* @__PURE__ */ e.jsx(Ye, { docContent: lr, cardType: a });
|
|
4006
4082
|
case "kpi":
|
|
4007
|
-
return /* @__PURE__ */ e.jsx(
|
|
4083
|
+
return /* @__PURE__ */ e.jsx(ar, {});
|
|
4008
4084
|
case "line":
|
|
4009
4085
|
case "bar":
|
|
4010
|
-
return /* @__PURE__ */ e.jsx(
|
|
4086
|
+
return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
|
|
4011
4087
|
case "range":
|
|
4012
|
-
return /* @__PURE__ */ e.jsx(
|
|
4088
|
+
return /* @__PURE__ */ e.jsx(Ye, { docContent: ir, cardType: a });
|
|
4013
4089
|
case "pie":
|
|
4014
4090
|
case "doughnut":
|
|
4015
4091
|
case "polarArea":
|
|
4016
4092
|
case "radar":
|
|
4017
|
-
return /* @__PURE__ */ e.jsx(
|
|
4093
|
+
return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
|
|
4018
4094
|
case "bubble":
|
|
4019
4095
|
case "scatter":
|
|
4020
|
-
return /* @__PURE__ */ e.jsx(
|
|
4096
|
+
return /* @__PURE__ */ e.jsx(Wn, { cardType: a });
|
|
4021
4097
|
case "table":
|
|
4022
|
-
return /* @__PURE__ */ e.jsx(
|
|
4098
|
+
return /* @__PURE__ */ e.jsx(rr, { cardType: a });
|
|
4099
|
+
case "text":
|
|
4100
|
+
return /* @__PURE__ */ e.jsx(
|
|
4101
|
+
Ye,
|
|
4102
|
+
{
|
|
4103
|
+
docContent: or,
|
|
4104
|
+
cardType: a,
|
|
4105
|
+
suffix: "Visual"
|
|
4106
|
+
}
|
|
4107
|
+
);
|
|
4023
4108
|
default:
|
|
4024
|
-
return /* @__PURE__ */ e.jsx(
|
|
4109
|
+
return /* @__PURE__ */ e.jsx(Zn, {});
|
|
4025
4110
|
}
|
|
4026
4111
|
}
|
|
4027
4112
|
return /* @__PURE__ */ e.jsx(Ss, { className: "h-full w-full text-sm", children: n(s) });
|
|
4028
4113
|
}
|
|
4029
|
-
function
|
|
4114
|
+
function dr() {
|
|
4030
4115
|
const s = i((n) => n.isShowingVisual);
|
|
4031
4116
|
return /* @__PURE__ */ e.jsxs(
|
|
4032
4117
|
us,
|
|
@@ -4041,7 +4126,7 @@ function ir() {
|
|
|
4041
4126
|
className: "flex",
|
|
4042
4127
|
minSize: 20,
|
|
4043
4128
|
defaultSize: 40,
|
|
4044
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4129
|
+
children: /* @__PURE__ */ e.jsx(Rn, {})
|
|
4045
4130
|
}
|
|
4046
4131
|
),
|
|
4047
4132
|
/* @__PURE__ */ e.jsx(xs, { withHandle: !0, className: "border" }),
|
|
@@ -4060,36 +4145,36 @@ function ir() {
|
|
|
4060
4145
|
minSize: 20,
|
|
4061
4146
|
defaultSize: 25,
|
|
4062
4147
|
maxSize: 30,
|
|
4063
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4148
|
+
children: /* @__PURE__ */ e.jsx(cr, {})
|
|
4064
4149
|
}
|
|
4065
4150
|
) }),
|
|
4066
4151
|
/* @__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(
|
|
4152
|
+
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Ks, {}) })
|
|
4153
|
+
] }) : /* @__PURE__ */ e.jsx(Ks, {})
|
|
4069
4154
|
}
|
|
4070
4155
|
)
|
|
4071
4156
|
]
|
|
4072
4157
|
}
|
|
4073
4158
|
);
|
|
4074
4159
|
}
|
|
4075
|
-
function
|
|
4076
|
-
const t = i((
|
|
4160
|
+
function hr({ authToken: s, onSave: n, onClose: a }) {
|
|
4161
|
+
const t = i((d) => d.actions.setOnSave), l = i((d) => d.actions.setOnClose), o = k((d) => d.actions.setAuthToken);
|
|
4077
4162
|
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(
|
|
4163
|
+
n && t(n), a && l(a);
|
|
4164
|
+
}, [n, t, a, l]), P(() => {
|
|
4165
|
+
s && s.accessToken && o(s);
|
|
4166
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs(Rt, { className: "rounded-none", role: "editor-panel", children: [
|
|
4167
|
+
/* @__PURE__ */ e.jsx(_t, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(fa, {}) }),
|
|
4168
|
+
/* @__PURE__ */ e.jsx(Ht, { children: /* @__PURE__ */ e.jsx(dr, {}) })
|
|
4084
4169
|
] });
|
|
4085
4170
|
}
|
|
4086
|
-
function
|
|
4087
|
-
k((
|
|
4088
|
-
const s = k((
|
|
4089
|
-
function
|
|
4090
|
-
s && (t(s,
|
|
4171
|
+
function mr() {
|
|
4172
|
+
k((d) => d.selectedCardId);
|
|
4173
|
+
const s = k((d) => d.selectedSheetId), { setIsVisualEditing: n } = k((d) => d.actions), a = k((d) => d.isVisualEditing), t = k((d) => d.actions.updateFrame);
|
|
4174
|
+
function l(d) {
|
|
4175
|
+
s && (t(s, d), n(!1));
|
|
4091
4176
|
}
|
|
4092
|
-
function
|
|
4177
|
+
function o() {
|
|
4093
4178
|
n(!1);
|
|
4094
4179
|
}
|
|
4095
4180
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -4100,19 +4185,19 @@ function cr() {
|
|
|
4100
4185
|
block: a,
|
|
4101
4186
|
hidden: !a
|
|
4102
4187
|
}),
|
|
4103
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4188
|
+
children: /* @__PURE__ */ e.jsx(hr, { onSave: l, onClose: o })
|
|
4104
4189
|
}
|
|
4105
4190
|
);
|
|
4106
4191
|
}
|
|
4107
|
-
function
|
|
4192
|
+
function ur({
|
|
4108
4193
|
columns: s,
|
|
4109
4194
|
tableName: n
|
|
4110
4195
|
}) {
|
|
4111
|
-
const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName),
|
|
4196
|
+
const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName), l = i((u) => u.selectedSchemaName), o = i((u) => u.selectedTableName), d = k((u) => u.dashboard.filters) || [], r = k((u) => u.actions.addFilter), c = k((u) => u.actions.removeFilter), f = k(
|
|
4112
4197
|
(u) => u.actions.removeFilterValue
|
|
4113
4198
|
);
|
|
4114
4199
|
function m(u) {
|
|
4115
|
-
const S = he(u.column_name), h = he(t || ""), x = he(
|
|
4200
|
+
const S = he(u.column_name), h = he(t || ""), x = he(l || ""), g = he(n), z = hs(
|
|
4116
4201
|
x,
|
|
4117
4202
|
g
|
|
4118
4203
|
), b = `${z}.${S}`;
|
|
@@ -4122,15 +4207,15 @@ function dr({
|
|
|
4122
4207
|
g,
|
|
4123
4208
|
h
|
|
4124
4209
|
);
|
|
4125
|
-
const L =
|
|
4210
|
+
const L = d == null ? void 0 : d.find(
|
|
4126
4211
|
(N) => N.column === b && N.table === g && (N.database === h || N.database === t)
|
|
4127
4212
|
);
|
|
4128
4213
|
if (L)
|
|
4129
|
-
f(L.id),
|
|
4214
|
+
f(L.id), c(L.id);
|
|
4130
4215
|
else {
|
|
4131
4216
|
if (n === "api" && a) {
|
|
4132
|
-
|
|
4133
|
-
id:
|
|
4217
|
+
r({
|
|
4218
|
+
id: Xe(),
|
|
4134
4219
|
column: b,
|
|
4135
4220
|
title: u.column_name,
|
|
4136
4221
|
dataType: u.data_type,
|
|
@@ -4139,7 +4224,7 @@ function dr({
|
|
|
4139
4224
|
// database: 'NA',
|
|
4140
4225
|
connectionId: a,
|
|
4141
4226
|
operation: "in",
|
|
4142
|
-
sql:
|
|
4227
|
+
sql: Bs(
|
|
4143
4228
|
u.data_type,
|
|
4144
4229
|
z,
|
|
4145
4230
|
S
|
|
@@ -4148,16 +4233,16 @@ function dr({
|
|
|
4148
4233
|
});
|
|
4149
4234
|
return;
|
|
4150
4235
|
}
|
|
4151
|
-
|
|
4152
|
-
id:
|
|
4236
|
+
r({
|
|
4237
|
+
id: Xe(),
|
|
4153
4238
|
column: `${z}.${S}`,
|
|
4154
4239
|
title: u.column_name,
|
|
4155
4240
|
dataType: u.data_type,
|
|
4156
|
-
table:
|
|
4241
|
+
table: o || "",
|
|
4157
4242
|
database: t || "",
|
|
4158
4243
|
connectionId: a || "",
|
|
4159
4244
|
operation: "in",
|
|
4160
|
-
sql:
|
|
4245
|
+
sql: Bs(
|
|
4161
4246
|
u.data_type,
|
|
4162
4247
|
z,
|
|
4163
4248
|
S
|
|
@@ -4167,8 +4252,8 @@ function dr({
|
|
|
4167
4252
|
}
|
|
4168
4253
|
}
|
|
4169
4254
|
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 ===
|
|
4255
|
+
const S = d == null ? void 0 : d.find(
|
|
4256
|
+
(h) => h.column === he(u.column_name) && h.table === o && h.database === t
|
|
4172
4257
|
);
|
|
4173
4258
|
return /* @__PURE__ */ e.jsx(
|
|
4174
4259
|
"div",
|
|
@@ -4181,7 +4266,7 @@ function dr({
|
|
|
4181
4266
|
}
|
|
4182
4267
|
),
|
|
4183
4268
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4184
|
-
/* @__PURE__ */ e.jsx(
|
|
4269
|
+
/* @__PURE__ */ e.jsx(xa, { column: u }),
|
|
4185
4270
|
/* @__PURE__ */ e.jsx("span", { children: u.column_name })
|
|
4186
4271
|
] })
|
|
4187
4272
|
},
|
|
@@ -4189,7 +4274,7 @@ function dr({
|
|
|
4189
4274
|
);
|
|
4190
4275
|
}) });
|
|
4191
4276
|
}
|
|
4192
|
-
function
|
|
4277
|
+
function xr() {
|
|
4193
4278
|
k((n) => n.showFilters);
|
|
4194
4279
|
const s = k(
|
|
4195
4280
|
(n) => n.actions.setShowFilters
|
|
@@ -4203,15 +4288,15 @@ function hr() {
|
|
|
4203
4288
|
onClick: () => s(!1),
|
|
4204
4289
|
className: "h-7 w-7 p-0",
|
|
4205
4290
|
variant: "ghost",
|
|
4206
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4291
|
+
children: /* @__PURE__ */ e.jsx(He, {})
|
|
4207
4292
|
}
|
|
4208
4293
|
)
|
|
4209
4294
|
] }),
|
|
4210
4295
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
4211
|
-
|
|
4296
|
+
fa,
|
|
4212
4297
|
{
|
|
4213
4298
|
ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
|
|
4214
|
-
|
|
4299
|
+
ur,
|
|
4215
4300
|
{
|
|
4216
4301
|
schemaName: n,
|
|
4217
4302
|
tableName: a,
|
|
@@ -4222,7 +4307,7 @@ function hr() {
|
|
|
4222
4307
|
) })
|
|
4223
4308
|
] });
|
|
4224
4309
|
}
|
|
4225
|
-
function
|
|
4310
|
+
function pr() {
|
|
4226
4311
|
k((a) => a.dashboard);
|
|
4227
4312
|
const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
|
|
4228
4313
|
return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
|
|
@@ -4234,13 +4319,13 @@ function mr() {
|
|
|
4234
4319
|
flex: !n
|
|
4235
4320
|
}),
|
|
4236
4321
|
children: [
|
|
4237
|
-
/* @__PURE__ */ e.jsx(
|
|
4238
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
4322
|
+
/* @__PURE__ */ e.jsx(Bt, {}),
|
|
4323
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(xr, {}) })
|
|
4239
4324
|
]
|
|
4240
4325
|
}
|
|
4241
4326
|
);
|
|
4242
4327
|
}
|
|
4243
|
-
function
|
|
4328
|
+
function fr() {
|
|
4244
4329
|
const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
|
|
4245
4330
|
(t) => t.showDashboardJSON
|
|
4246
4331
|
);
|
|
@@ -4253,7 +4338,7 @@ function ur() {
|
|
|
4253
4338
|
hidden: !a
|
|
4254
4339
|
}),
|
|
4255
4340
|
children: /* @__PURE__ */ e.jsx(
|
|
4256
|
-
|
|
4341
|
+
$t,
|
|
4257
4342
|
{
|
|
4258
4343
|
onChange: (t) => {
|
|
4259
4344
|
if (t)
|
|
@@ -4284,25 +4369,26 @@ function ur() {
|
|
|
4284
4369
|
}
|
|
4285
4370
|
);
|
|
4286
4371
|
}
|
|
4287
|
-
function
|
|
4372
|
+
function br({
|
|
4288
4373
|
showControls: s = !1,
|
|
4289
4374
|
showFooter: n = !0,
|
|
4290
|
-
|
|
4375
|
+
showAssistant: a = !1,
|
|
4376
|
+
...t
|
|
4291
4377
|
}) {
|
|
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(
|
|
4378
|
+
return /* @__PURE__ */ e.jsxs(Pt, { dashboardProps: t, children: [
|
|
4379
|
+
/* @__PURE__ */ e.jsx(Kt, {}),
|
|
4380
|
+
/* @__PURE__ */ e.jsxs(Ut, { children: [
|
|
4381
|
+
/* @__PURE__ */ e.jsx(fr, {}),
|
|
4382
|
+
/* @__PURE__ */ e.jsxs(Gt, { ...t, children: [
|
|
4383
|
+
s && /* @__PURE__ */ e.jsx(Nn, {}),
|
|
4384
|
+
/* @__PURE__ */ e.jsx(mr, {}),
|
|
4385
|
+
/* @__PURE__ */ e.jsx(pr, {})
|
|
4300
4386
|
] })
|
|
4301
4387
|
] })
|
|
4302
4388
|
] });
|
|
4303
4389
|
}
|
|
4304
4390
|
export {
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4391
|
+
br as D,
|
|
4392
|
+
We as S,
|
|
4393
|
+
pa as u
|
|
4308
4394
|
};
|