react-semaphor 0.0.232 → 0.0.234
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-B20VN3pn.js → dashboard-plus-0Wc18x9Q.js} +526 -535
- package/dist/chunks/dashboard-plus-apJaIXwW.js +215 -0
- package/dist/chunks/index-J7GWM1f-.js +448 -0
- package/dist/chunks/{index-DUw3t3sl.js → index-x2wG2JFp.js} +10297 -10181
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-SLRbyBnR.js +0 -220
- package/dist/chunks/index-o98c3gXS.js +0 -443
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as
|
|
2
|
-
import * as
|
|
1
|
+
import { O as D, b as k, j as e, P as Ss, Q as ks, R as w, U as ws, V as zs, W as Fs, X as Os, Y as Ms, Z as _, _ as he, $ as la, J as ia, M as Ae, a0 as Qa, a1 as Wa, a2 as Ya, a3 as Za, a4 as Xa, a5 as et, a6 as Js, a7 as $e, a8 as Ue, a9 as oa, aa as rs, T as Ts, e as ca, g as Ds, ab as Oe, ac as Me, f as Y, ad as Te, ae as De, af as Pe, ag as Le, ah as ee, ai as As, G as c, aj as Ls, ak as Es, al as Is, w as da, v as ha, t as ue, am as st, r as at, N as ma, s as tt, an as nt, B as rt, ao as ua, ap as lt, S as Vs, z as it, n as Us, aq as bs, A as xa, ar as ys, u as Qe, as as me, at as be, au as Ke, av as pa, aw as fa, ax as ot, ay as ct, az as ga, aA as dt, aB as ht, aC as mt, aD as ut, aE as xt, aF as vs, aG as pt, aH as Be, aI as Ns, aJ as Fe, aK as Cs, aL as Qs, aM as ft, aN as gt, aO as jt, aP as bt, aQ as yt, aR as js, aS as vt, aT as Ws, aU as Nt, aV as Ys, aW as Ct, aX as St, aY as kt, c as wt, aZ as ja, l as zt, C as Ft, E as as, d as Ot, h as Mt, a_ as Tt, i as Dt, o as At, a$ as Lt, m as Et, H as qs, b0 as It, b1 as ba, b2 as ya, b3 as ts, b4 as va, b5 as ns, b6 as Zs, b7 as os, b8 as cs, b9 as ds, K as Vt, ba as qt, bb as Rt, bc as Na, bd as Rs, be as Ee, bf as Ca, bg as _t, bh as Ht, bi as Bt, bj as $t, bk as Pt, bl as Xs, bm as Kt, bn as Gt, bo as Jt, bp as Ut, bq as Qt, br as Wt, bs as Yt, bt as Zt, bu as Ce, bv as B, bw as $, bx as _s, by as P, bz as ea, bA as Xt, bB as en, bC as sn, bD as an, bE as tn, bF as nn, bG as rn, bH as ln, bI as on, bJ as cn } from "./index-x2wG2JFp.js";
|
|
2
|
+
import * as sa from "react";
|
|
3
3
|
import xe, { useState as M, useEffect as U, useMemo as dn, useRef as Ge } from "react";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-react v0.379.0 - ISC
|
|
@@ -7,7 +7,7 @@ import xe, { useState as M, useEffect as U, useMemo as dn, useRef as Ge } from "
|
|
|
7
7
|
* This source code is licensed under the ISC license.
|
|
8
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
const hn =
|
|
10
|
+
const hn = D("AreaChart", [
|
|
11
11
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
12
12
|
["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
|
|
13
13
|
]);
|
|
@@ -17,7 +17,7 @@ const hn = T("AreaChart", [
|
|
|
17
17
|
* This source code is licensed under the ISC license.
|
|
18
18
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
19
|
*/
|
|
20
|
-
const Hs =
|
|
20
|
+
const Hs = D("BarChart4", [
|
|
21
21
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
22
22
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
23
23
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
@@ -29,7 +29,7 @@ const Hs = T("BarChart4", [
|
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
31
|
*/
|
|
32
|
-
const mn =
|
|
32
|
+
const mn = D("Box", [
|
|
33
33
|
[
|
|
34
34
|
"path",
|
|
35
35
|
{
|
|
@@ -46,7 +46,7 @@ const mn = T("Box", [
|
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
const un =
|
|
49
|
+
const un = D("CircleX", [
|
|
50
50
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
51
51
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
52
52
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -57,7 +57,7 @@ const un = T("CircleX", [
|
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
59
|
*/
|
|
60
|
-
const xn =
|
|
60
|
+
const xn = D("Database", [
|
|
61
61
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
62
62
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
63
63
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -68,7 +68,7 @@ const xn = T("Database", [
|
|
|
68
68
|
* This source code is licensed under the ISC license.
|
|
69
69
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
70
|
*/
|
|
71
|
-
const
|
|
71
|
+
const Sa = D("EllipsisVertical", [
|
|
72
72
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
73
73
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
74
74
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
@@ -79,7 +79,7 @@ const Ct = T("EllipsisVertical", [
|
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
81
|
*/
|
|
82
|
-
const pn =
|
|
82
|
+
const pn = D("Eraser", [
|
|
83
83
|
[
|
|
84
84
|
"path",
|
|
85
85
|
{
|
|
@@ -96,16 +96,7 @@ const pn = T("Eraser", [
|
|
|
96
96
|
* This source code is licensed under the ISC license.
|
|
97
97
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
98
|
*/
|
|
99
|
-
const
|
|
100
|
-
["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
|
|
101
|
-
]);
|
|
102
|
-
/**
|
|
103
|
-
* @license lucide-react v0.379.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/
|
|
108
|
-
const kt = T("GanttChart", [
|
|
99
|
+
const ka = D("GanttChart", [
|
|
109
100
|
["path", { d: "M8 6h10", key: "9lnwnk" }],
|
|
110
101
|
["path", { d: "M6 12h9", key: "1g9pqf" }],
|
|
111
102
|
["path", { d: "M11 18h7", key: "c8dzvl" }]
|
|
@@ -116,7 +107,7 @@ const kt = T("GanttChart", [
|
|
|
116
107
|
* This source code is licensed under the ISC license.
|
|
117
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
118
109
|
*/
|
|
119
|
-
const fn =
|
|
110
|
+
const fn = D("Glasses", [
|
|
120
111
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
121
112
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
122
113
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -129,7 +120,7 @@ const fn = T("Glasses", [
|
|
|
129
120
|
* This source code is licensed under the ISC license.
|
|
130
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
122
|
*/
|
|
132
|
-
const gn =
|
|
123
|
+
const gn = D("Hammer", [
|
|
133
124
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
134
125
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
135
126
|
[
|
|
@@ -146,7 +137,7 @@ const gn = T("Hammer", [
|
|
|
146
137
|
* This source code is licensed under the ISC license.
|
|
147
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
139
|
*/
|
|
149
|
-
const jn =
|
|
140
|
+
const jn = D("Hash", [
|
|
150
141
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
151
142
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
152
143
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -158,7 +149,7 @@ const jn = T("Hash", [
|
|
|
158
149
|
* This source code is licensed under the ISC license.
|
|
159
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
160
151
|
*/
|
|
161
|
-
const bn =
|
|
152
|
+
const bn = D("Key", [
|
|
162
153
|
["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" }],
|
|
163
154
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
164
155
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
@@ -169,7 +160,7 @@ const bn = T("Key", [
|
|
|
169
160
|
* This source code is licensed under the ISC license.
|
|
170
161
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
162
|
*/
|
|
172
|
-
const Bs =
|
|
163
|
+
const Bs = D("LineChart", [
|
|
173
164
|
["path", { d: "M3 3v18h18", key: "1s2lah" }],
|
|
174
165
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
175
166
|
]);
|
|
@@ -179,7 +170,7 @@ const Bs = T("LineChart", [
|
|
|
179
170
|
* This source code is licensed under the ISC license.
|
|
180
171
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
172
|
*/
|
|
182
|
-
const yn =
|
|
173
|
+
const yn = D("ListEnd", [
|
|
183
174
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
184
175
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
185
176
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -192,7 +183,7 @@ const yn = T("ListEnd", [
|
|
|
192
183
|
* This source code is licensed under the ISC license.
|
|
193
184
|
* See the LICENSE file in the root directory of this source tree.
|
|
194
185
|
*/
|
|
195
|
-
const vn =
|
|
186
|
+
const vn = D("ListStart", [
|
|
196
187
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
197
188
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
198
189
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -205,7 +196,7 @@ const vn = T("ListStart", [
|
|
|
205
196
|
* This source code is licensed under the ISC license.
|
|
206
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
207
198
|
*/
|
|
208
|
-
const Nn =
|
|
199
|
+
const Nn = D("ListX", [
|
|
209
200
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
210
201
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
211
202
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -218,7 +209,7 @@ const Nn = T("ListX", [
|
|
|
218
209
|
* This source code is licensed under the ISC license.
|
|
219
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
211
|
*/
|
|
221
|
-
const Je =
|
|
212
|
+
const Je = D("LoaderCircle", [
|
|
222
213
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
223
214
|
]);
|
|
224
215
|
/**
|
|
@@ -227,7 +218,7 @@ const Je = T("LoaderCircle", [
|
|
|
227
218
|
* This source code is licensed under the ISC license.
|
|
228
219
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
220
|
*/
|
|
230
|
-
const Cn =
|
|
221
|
+
const Cn = D("MessageSquareMore", [
|
|
231
222
|
["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" }],
|
|
232
223
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
233
224
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -239,7 +230,7 @@ const Cn = T("MessageSquareMore", [
|
|
|
239
230
|
* This source code is licensed under the ISC license.
|
|
240
231
|
* See the LICENSE file in the root directory of this source tree.
|
|
241
232
|
*/
|
|
242
|
-
const Sn =
|
|
233
|
+
const Sn = D("Network", [
|
|
243
234
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
244
235
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
245
236
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -252,7 +243,7 @@ const Sn = T("Network", [
|
|
|
252
243
|
* This source code is licensed under the ISC license.
|
|
253
244
|
* See the LICENSE file in the root directory of this source tree.
|
|
254
245
|
*/
|
|
255
|
-
const
|
|
246
|
+
const wa = D("Pencil", [
|
|
256
247
|
["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
|
|
257
248
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
258
249
|
]);
|
|
@@ -262,7 +253,7 @@ const wt = T("Pencil", [
|
|
|
262
253
|
* This source code is licensed under the ISC license.
|
|
263
254
|
* See the LICENSE file in the root directory of this source tree.
|
|
264
255
|
*/
|
|
265
|
-
const
|
|
256
|
+
const za = D("PieChart", [
|
|
266
257
|
["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
|
|
267
258
|
["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
|
|
268
259
|
]);
|
|
@@ -272,7 +263,7 @@ const zt = T("PieChart", [
|
|
|
272
263
|
* This source code is licensed under the ISC license.
|
|
273
264
|
* See the LICENSE file in the root directory of this source tree.
|
|
274
265
|
*/
|
|
275
|
-
const kn =
|
|
266
|
+
const kn = D("Play", [
|
|
276
267
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
277
268
|
]);
|
|
278
269
|
/**
|
|
@@ -281,7 +272,7 @@ const kn = T("Play", [
|
|
|
281
272
|
* This source code is licensed under the ISC license.
|
|
282
273
|
* See the LICENSE file in the root directory of this source tree.
|
|
283
274
|
*/
|
|
284
|
-
const wn =
|
|
275
|
+
const wn = D("Plug2", [
|
|
285
276
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
286
277
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
287
278
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -294,7 +285,7 @@ const wn = T("Plug2", [
|
|
|
294
285
|
* This source code is licensed under the ISC license.
|
|
295
286
|
* See the LICENSE file in the root directory of this source tree.
|
|
296
287
|
*/
|
|
297
|
-
const zn =
|
|
288
|
+
const zn = D("Save", [
|
|
298
289
|
[
|
|
299
290
|
"path",
|
|
300
291
|
{
|
|
@@ -311,7 +302,7 @@ const zn = T("Save", [
|
|
|
311
302
|
* This source code is licensed under the ISC license.
|
|
312
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
313
304
|
*/
|
|
314
|
-
const
|
|
305
|
+
const Fa = D("ScatterChart", [
|
|
315
306
|
["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
|
|
316
307
|
["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
|
|
317
308
|
["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
|
|
@@ -325,7 +316,7 @@ const Ft = T("ScatterChart", [
|
|
|
325
316
|
* This source code is licensed under the ISC license.
|
|
326
317
|
* See the LICENSE file in the root directory of this source tree.
|
|
327
318
|
*/
|
|
328
|
-
const Fn =
|
|
319
|
+
const Fn = D("ShieldQuestion", [
|
|
329
320
|
[
|
|
330
321
|
"path",
|
|
331
322
|
{
|
|
@@ -342,7 +333,7 @@ const Fn = T("ShieldQuestion", [
|
|
|
342
333
|
* This source code is licensed under the ISC license.
|
|
343
334
|
* See the LICENSE file in the root directory of this source tree.
|
|
344
335
|
*/
|
|
345
|
-
const On =
|
|
336
|
+
const On = D("Sigma", [
|
|
346
337
|
["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
|
|
347
338
|
]);
|
|
348
339
|
/**
|
|
@@ -351,7 +342,7 @@ const On = T("Sigma", [
|
|
|
351
342
|
* This source code is licensed under the ISC license.
|
|
352
343
|
* See the LICENSE file in the root directory of this source tree.
|
|
353
344
|
*/
|
|
354
|
-
const Mn =
|
|
345
|
+
const Mn = D("SwatchBook", [
|
|
355
346
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
356
347
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
357
348
|
["path", { d: "M 7 17h0.01", key: "10821z" }],
|
|
@@ -369,7 +360,7 @@ const Mn = T("SwatchBook", [
|
|
|
369
360
|
* This source code is licensed under the ISC license.
|
|
370
361
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
362
|
*/
|
|
372
|
-
const Tn =
|
|
363
|
+
const Tn = D("Tag", [
|
|
373
364
|
[
|
|
374
365
|
"path",
|
|
375
366
|
{
|
|
@@ -385,7 +376,7 @@ const Tn = T("Tag", [
|
|
|
385
376
|
* This source code is licensed under the ISC license.
|
|
386
377
|
* See the LICENSE file in the root directory of this source tree.
|
|
387
378
|
*/
|
|
388
|
-
const Dn =
|
|
379
|
+
const Dn = D("ToggleLeft", [
|
|
389
380
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
390
381
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
391
382
|
]);
|
|
@@ -395,7 +386,7 @@ const Dn = T("ToggleLeft", [
|
|
|
395
386
|
* This source code is licensed under the ISC license.
|
|
396
387
|
* See the LICENSE file in the root directory of this source tree.
|
|
397
388
|
*/
|
|
398
|
-
const $s =
|
|
389
|
+
const $s = D("Type", [
|
|
399
390
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
400
391
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
401
392
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -406,14 +397,14 @@ const $s = T("Type", [
|
|
|
406
397
|
* This source code is licensed under the ISC license.
|
|
407
398
|
* See the LICENSE file in the root directory of this source tree.
|
|
408
399
|
*/
|
|
409
|
-
const An =
|
|
400
|
+
const An = D("User", [
|
|
410
401
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
411
402
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
412
403
|
]);
|
|
413
404
|
function Ln() {
|
|
414
|
-
const [s,
|
|
405
|
+
const [s, t] = M(""), [a, n] = M(!1), [r, m] = M(!1), i = k((d) => d.dashboard);
|
|
415
406
|
function o() {
|
|
416
|
-
const d =
|
|
407
|
+
const d = ia(i), p = Ae(i.id), x = JSON.parse(localStorage.getItem(p) || "[]");
|
|
417
408
|
if (x.some(
|
|
418
409
|
(g) => g.name === s
|
|
419
410
|
)) {
|
|
@@ -450,15 +441,15 @@ function Ln() {
|
|
|
450
441
|
{
|
|
451
442
|
value: s,
|
|
452
443
|
onChange: (d) => {
|
|
453
|
-
|
|
444
|
+
a && n(!1), t(d.target.value);
|
|
454
445
|
},
|
|
455
446
|
id: "name",
|
|
456
447
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
457
448
|
}
|
|
458
449
|
)
|
|
459
450
|
] }) }),
|
|
460
|
-
|
|
461
|
-
/* @__PURE__ */ e.jsx(
|
|
451
|
+
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
|
|
452
|
+
/* @__PURE__ */ e.jsx(la, { children: /* @__PURE__ */ e.jsx(
|
|
462
453
|
w,
|
|
463
454
|
{
|
|
464
455
|
variant: "outline",
|
|
@@ -472,7 +463,7 @@ function Ln() {
|
|
|
472
463
|
] });
|
|
473
464
|
}
|
|
474
465
|
function En() {
|
|
475
|
-
const [s,
|
|
466
|
+
const [s, t] = M(!1), [a, n] = M(""), r = k((h) => h.dashboard), m = k((h) => h.bookmarkKey), [i, o] = M([]), d = k((h) => h.actions.setDashboard), p = k(
|
|
476
467
|
(h) => h.actions.setFilterValues
|
|
477
468
|
), x = k(
|
|
478
469
|
(h) => h.actions.setBookmarkKey
|
|
@@ -486,7 +477,7 @@ function En() {
|
|
|
486
477
|
j && j.name === m && n(j.name);
|
|
487
478
|
}, [s, r, m]);
|
|
488
479
|
function b(h) {
|
|
489
|
-
if (h ===
|
|
480
|
+
if (h === a)
|
|
490
481
|
return;
|
|
491
482
|
const u = i.find((f) => f.name === h), j = u == null ? void 0 : u.template;
|
|
492
483
|
j && (d(j), p(u.filterValues || []), x(h === "Original" ? "" : h)), n(h);
|
|
@@ -497,15 +488,15 @@ function En() {
|
|
|
497
488
|
);
|
|
498
489
|
localStorage.setItem(u, JSON.stringify(f)), o(f);
|
|
499
490
|
}
|
|
500
|
-
return /* @__PURE__ */ e.jsxs(
|
|
501
|
-
/* @__PURE__ */ e.jsx(
|
|
502
|
-
/* @__PURE__ */ e.jsxs(
|
|
503
|
-
/* @__PURE__ */ e.jsx(
|
|
504
|
-
/* @__PURE__ */ e.jsx(
|
|
491
|
+
return /* @__PURE__ */ e.jsxs(Qa, { open: s, onOpenChange: t, children: [
|
|
492
|
+
/* @__PURE__ */ e.jsx(Wa, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(fn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
493
|
+
/* @__PURE__ */ e.jsxs(Ya, { className: "w-56", children: [
|
|
494
|
+
/* @__PURE__ */ e.jsx(Za, { children: "Lenses" }),
|
|
495
|
+
/* @__PURE__ */ e.jsx(Xa, {}),
|
|
505
496
|
/* @__PURE__ */ e.jsxs(
|
|
506
|
-
|
|
497
|
+
et,
|
|
507
498
|
{
|
|
508
|
-
value:
|
|
499
|
+
value: a,
|
|
509
500
|
onValueChange: b,
|
|
510
501
|
children: [
|
|
511
502
|
/* @__PURE__ */ e.jsx(Js, { value: "Original", children: "Original" }),
|
|
@@ -538,23 +529,23 @@ function En() {
|
|
|
538
529
|
] });
|
|
539
530
|
}
|
|
540
531
|
function In() {
|
|
541
|
-
const [s,
|
|
532
|
+
const [s, t] = M(!1), a = k((m) => m.dashboard), n = k((m) => m.bookmarkKey);
|
|
542
533
|
U(() => {
|
|
543
534
|
if (!n) {
|
|
544
|
-
|
|
535
|
+
t(!1);
|
|
545
536
|
return;
|
|
546
537
|
}
|
|
547
|
-
const m = Ae(
|
|
538
|
+
const m = Ae(a.id), o = JSON.parse(
|
|
548
539
|
localStorage.getItem(m) || "[]"
|
|
549
540
|
).find(
|
|
550
541
|
(d) => d.name === n
|
|
551
542
|
);
|
|
552
|
-
|
|
553
|
-
}, [n,
|
|
543
|
+
t(o ? o.default : !1);
|
|
544
|
+
}, [n, a.id]);
|
|
554
545
|
function r(m) {
|
|
555
|
-
if (
|
|
546
|
+
if (t(m), !n)
|
|
556
547
|
return;
|
|
557
|
-
const i = Ae(
|
|
548
|
+
const i = Ae(a.id), d = JSON.parse(
|
|
558
549
|
localStorage.getItem(i) || "[]"
|
|
559
550
|
).map((p) => (p.name === n ? p.default = m : p.default = !1, p));
|
|
560
551
|
console.log(d), localStorage.setItem(i, JSON.stringify(d));
|
|
@@ -579,9 +570,9 @@ function In() {
|
|
|
579
570
|
] });
|
|
580
571
|
}
|
|
581
572
|
function Vn() {
|
|
582
|
-
const s = k((v) => v.bookmarkKey),
|
|
573
|
+
const s = k((v) => v.bookmarkKey), t = k((v) => v.dashboard);
|
|
583
574
|
k((v) => v.selectedSheetId);
|
|
584
|
-
const
|
|
575
|
+
const a = k(
|
|
585
576
|
(v) => v.isDashboardEditing
|
|
586
577
|
), n = k((v) => v.filterValues), r = k((v) => v.isVisualEditing), m = k((v) => v.showFilters);
|
|
587
578
|
k(
|
|
@@ -592,7 +583,7 @@ function Vn() {
|
|
|
592
583
|
), { addFrame: d, setSelectedFrameId: p } = k(
|
|
593
584
|
(v) => v.actions
|
|
594
585
|
), { getSelectedSheet: x, setIsDashboardEditing: b, setShowDashboardJSON: g } = k((v) => v.actions), h = x(), u = () => {
|
|
595
|
-
if (!
|
|
586
|
+
if (!a || !h)
|
|
596
587
|
return;
|
|
597
588
|
const v = {
|
|
598
589
|
id: rs(),
|
|
@@ -621,7 +612,7 @@ function Vn() {
|
|
|
621
612
|
function f() {
|
|
622
613
|
if (!s || s === "")
|
|
623
614
|
return;
|
|
624
|
-
const v =
|
|
615
|
+
const v = ia(t), O = Ae(t.id), y = JSON.parse(localStorage.getItem(O) || "[]"), L = y.findIndex(
|
|
625
616
|
(E) => E.name === s
|
|
626
617
|
);
|
|
627
618
|
L !== -1 ? y[L] = {
|
|
@@ -649,15 +640,15 @@ function Vn() {
|
|
|
649
640
|
] })
|
|
650
641
|
] }),
|
|
651
642
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
652
|
-
|
|
643
|
+
a && !r && /* @__PURE__ */ e.jsx(Ln, {}),
|
|
653
644
|
!r && /* @__PURE__ */ e.jsx(En, {}),
|
|
654
|
-
|
|
645
|
+
a && !r && /* @__PURE__ */ e.jsxs(
|
|
655
646
|
w,
|
|
656
647
|
{
|
|
657
648
|
variant: "outline",
|
|
658
649
|
className: "h-7 p-2",
|
|
659
650
|
size: "sm",
|
|
660
|
-
disabled: !
|
|
651
|
+
disabled: !a,
|
|
661
652
|
onClick: u,
|
|
662
653
|
children: [
|
|
663
654
|
/* @__PURE__ */ e.jsx(ws, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
@@ -665,17 +656,17 @@ function Vn() {
|
|
|
665
656
|
]
|
|
666
657
|
}
|
|
667
658
|
),
|
|
668
|
-
!
|
|
659
|
+
!a && /* @__PURE__ */ e.jsx(
|
|
669
660
|
w,
|
|
670
661
|
{
|
|
671
662
|
variant: "outline",
|
|
672
663
|
className: "h-7 p-2",
|
|
673
664
|
onClick: j,
|
|
674
665
|
size: "sm",
|
|
675
|
-
children: /* @__PURE__ */ e.jsx(
|
|
666
|
+
children: /* @__PURE__ */ e.jsx(wa, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
676
667
|
}
|
|
677
668
|
),
|
|
678
|
-
|
|
669
|
+
a && !r && /* @__PURE__ */ e.jsx(
|
|
679
670
|
w,
|
|
680
671
|
{
|
|
681
672
|
variant: "outline",
|
|
@@ -688,7 +679,7 @@ function Vn() {
|
|
|
688
679
|
children: /* @__PURE__ */ e.jsx($e, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
689
680
|
}
|
|
690
681
|
),
|
|
691
|
-
|
|
682
|
+
a && !r && /* @__PURE__ */ e.jsx(
|
|
692
683
|
w,
|
|
693
684
|
{
|
|
694
685
|
className: "h-7 p-2",
|
|
@@ -698,17 +689,17 @@ function Vn() {
|
|
|
698
689
|
children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
699
690
|
}
|
|
700
691
|
),
|
|
701
|
-
!m && !r &&
|
|
692
|
+
!m && !r && a && /* @__PURE__ */ e.jsx(
|
|
702
693
|
w,
|
|
703
694
|
{
|
|
704
695
|
className: "h-7 p-2",
|
|
705
696
|
variant: "outline",
|
|
706
697
|
onClick: () => o(!0),
|
|
707
698
|
size: "sm",
|
|
708
|
-
children: /* @__PURE__ */ e.jsx(
|
|
699
|
+
children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
709
700
|
}
|
|
710
701
|
),
|
|
711
|
-
!r &&
|
|
702
|
+
!r && a && !1,
|
|
712
703
|
!r && !1
|
|
713
704
|
] })
|
|
714
705
|
]
|
|
@@ -717,8 +708,8 @@ function Vn() {
|
|
|
717
708
|
}
|
|
718
709
|
function He({
|
|
719
710
|
title: s,
|
|
720
|
-
items:
|
|
721
|
-
value:
|
|
711
|
+
items: t,
|
|
712
|
+
value: a,
|
|
722
713
|
isLoading: n,
|
|
723
714
|
isError: r,
|
|
724
715
|
connectionTooltip: m,
|
|
@@ -728,7 +719,7 @@ function He({
|
|
|
728
719
|
showIcon: p = !0,
|
|
729
720
|
disabled: x = !1
|
|
730
721
|
}) {
|
|
731
|
-
const b = n ? "Loading..." : r ? "Error" :
|
|
722
|
+
const b = n ? "Loading..." : r ? "Error" : a;
|
|
732
723
|
function g() {
|
|
733
724
|
if (s === "Connection")
|
|
734
725
|
return /* @__PURE__ */ e.jsx(wn, { className: "size-4 rotate-90" });
|
|
@@ -743,7 +734,7 @@ function He({
|
|
|
743
734
|
}
|
|
744
735
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
745
736
|
p && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: m ? /* @__PURE__ */ e.jsxs(Ts, { children: [
|
|
746
|
-
/* @__PURE__ */ e.jsx(
|
|
737
|
+
/* @__PURE__ */ e.jsx(ca, { children: g() }),
|
|
747
738
|
/* @__PURE__ */ e.jsx(Ds, { className: "text-xs", align: "start", children: m })
|
|
748
739
|
] }) : g() }),
|
|
749
740
|
/* @__PURE__ */ e.jsxs(Oe, { disabled: x, value: b, onValueChange: i, children: [
|
|
@@ -766,7 +757,7 @@ function He({
|
|
|
766
757
|
n ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
|
|
767
758
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
768
759
|
o && /* @__PURE__ */ e.jsx(ee, { value: "none", children: "None" }, "none"),
|
|
769
|
-
|
|
760
|
+
t && t.map((h, u) => /* @__PURE__ */ e.jsx(ee, { value: h.id, children: h.name }, u))
|
|
770
761
|
] }),
|
|
771
762
|
(n || r) && /* @__PURE__ */ e.jsx(ee, { value: b, children: b })
|
|
772
763
|
] }) })
|
|
@@ -774,24 +765,24 @@ function He({
|
|
|
774
765
|
] });
|
|
775
766
|
}
|
|
776
767
|
function qn({ column: s }) {
|
|
777
|
-
const [
|
|
768
|
+
const [t, a] = M(!1), n = c((h) => h.selectedTableName), r = c(
|
|
778
769
|
(h) => h.selectedSchemaName
|
|
779
770
|
), m = c(
|
|
780
771
|
(h) => h.selectedDatamodelId
|
|
781
772
|
), i = c((h) => h.sqlGen), { modelItems: o } = Ie(), d = c((h) => h.actions.setSqlGen), p = c((h) => h.actions.setCardSql), x = c((h) => h.actions.setRunSql);
|
|
782
773
|
function b(h, u) {
|
|
783
774
|
var O;
|
|
784
|
-
const j =
|
|
775
|
+
const j = da(h, i, u), f = (O = o == null ? void 0 : o.find(
|
|
785
776
|
(y) => y.id === m
|
|
786
777
|
)) == null ? void 0 : O.name;
|
|
787
778
|
d(j);
|
|
788
|
-
const v =
|
|
779
|
+
const v = ha(
|
|
789
780
|
j,
|
|
790
781
|
ue(r || ""),
|
|
791
782
|
ue(n),
|
|
792
783
|
f
|
|
793
784
|
);
|
|
794
|
-
v && (p(v), x(!0)),
|
|
785
|
+
v && (p(v), x(!0)), a(!1);
|
|
795
786
|
}
|
|
796
787
|
function g() {
|
|
797
788
|
return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
|
|
@@ -837,8 +828,8 @@ function qn({ column: s }) {
|
|
|
837
828
|
)
|
|
838
829
|
] });
|
|
839
830
|
}
|
|
840
|
-
return /* @__PURE__ */ e.jsxs(Ls, { openDelay: 0, open:
|
|
841
|
-
/* @__PURE__ */ e.jsx(Es, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
831
|
+
return /* @__PURE__ */ e.jsxs(Ls, { openDelay: 0, open: t, onOpenChange: a, children: [
|
|
832
|
+
/* @__PURE__ */ e.jsx(Es, { asChild: !0, children: /* @__PURE__ */ e.jsx(Sa, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
842
833
|
/* @__PURE__ */ e.jsx(
|
|
843
834
|
Is,
|
|
844
835
|
{
|
|
@@ -849,22 +840,22 @@ function qn({ column: s }) {
|
|
|
849
840
|
)
|
|
850
841
|
] });
|
|
851
842
|
}
|
|
852
|
-
function
|
|
843
|
+
function Oa({ column: s }) {
|
|
853
844
|
return /* @__PURE__ */ e.jsxs(Ts, { children: [
|
|
854
|
-
/* @__PURE__ */ e.jsx(
|
|
845
|
+
/* @__PURE__ */ e.jsx(st, { asChild: !0, children: at.includes(s.data_type.toLowerCase()) ? (
|
|
855
846
|
// <span className=" font-thin">T</span>
|
|
856
847
|
/* @__PURE__ */ e.jsx($s, { className: "size-3" })
|
|
857
|
-
) :
|
|
848
|
+
) : ma.includes(s.data_type.toLowerCase()) ? (
|
|
858
849
|
//
|
|
859
850
|
/* @__PURE__ */ e.jsx(jn, { className: "size-3" })
|
|
860
|
-
) :
|
|
851
|
+
) : tt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(nt, { className: "size-3" }) : rt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Dn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Fn, { className: "size-3" }) }),
|
|
861
852
|
/* @__PURE__ */ e.jsx(Ds, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
862
853
|
] });
|
|
863
854
|
}
|
|
864
855
|
function Rn({
|
|
865
856
|
schemaName: s,
|
|
866
|
-
tableName:
|
|
867
|
-
columns:
|
|
857
|
+
tableName: t,
|
|
858
|
+
columns: a,
|
|
868
859
|
status: n
|
|
869
860
|
}) {
|
|
870
861
|
const r = c((C) => C.sqlGen), m = c(
|
|
@@ -882,11 +873,11 @@ function Rn({
|
|
|
882
873
|
), j = c((C) => C.actions.setCardSql), { connectionType: f, modelItems: v } = Ie();
|
|
883
874
|
function O(C) {
|
|
884
875
|
var A;
|
|
885
|
-
const z =
|
|
876
|
+
const z = da(C, r);
|
|
886
877
|
h(z);
|
|
887
878
|
const q = (A = v == null ? void 0 : v.find(
|
|
888
879
|
(R) => R.id === p
|
|
889
|
-
)) == null ? void 0 : A.name, K =
|
|
880
|
+
)) == null ? void 0 : A.name, K = ha(z, ue(s), ue(t), q);
|
|
890
881
|
K && (j(K), g(!0));
|
|
891
882
|
}
|
|
892
883
|
function y() {
|
|
@@ -925,13 +916,13 @@ function Rn({
|
|
|
925
916
|
}
|
|
926
917
|
function E() {
|
|
927
918
|
var A;
|
|
928
|
-
let C =
|
|
919
|
+
let C = xa(s, t);
|
|
929
920
|
const z = (A = v == null ? void 0 : v.find(
|
|
930
921
|
(R) => R.id === p
|
|
931
922
|
)) == null ? void 0 : A.name;
|
|
932
923
|
console.log("modelName", z), p && p !== "none" && (C = `${ys}.${z}`);
|
|
933
924
|
let q = C;
|
|
934
|
-
return ((R) => /[A-Z]/.test(R))(
|
|
925
|
+
return ((R) => /[A-Z]/.test(R))(t) && (q = q.split(".").map((W) => `"${W}"`).join(".")), q;
|
|
935
926
|
}
|
|
936
927
|
function V() {
|
|
937
928
|
const C = E();
|
|
@@ -939,14 +930,14 @@ function Rn({
|
|
|
939
930
|
const z = f === "MSSQL" ? `SELECT top 10 * FROM ${C}` : `SELECT * FROM ${C} LIMIT 10`;
|
|
940
931
|
j(z), g(!0);
|
|
941
932
|
}
|
|
942
|
-
function
|
|
933
|
+
function T() {
|
|
943
934
|
const C = E();
|
|
944
935
|
u(!1), j(`SELECT COUNT(*) as count FROM ${C}`), g(!0);
|
|
945
936
|
}
|
|
946
937
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
947
938
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
|
|
948
939
|
/* @__PURE__ */ e.jsx(
|
|
949
|
-
|
|
940
|
+
ua,
|
|
950
941
|
{
|
|
951
942
|
title: `${y() ? "Remove from" : "Add to"} AI Scope`,
|
|
952
943
|
pressed: y(),
|
|
@@ -954,7 +945,7 @@ function Rn({
|
|
|
954
945
|
variant: "outline",
|
|
955
946
|
className: "h-9 px-2",
|
|
956
947
|
children: /* @__PURE__ */ e.jsx(
|
|
957
|
-
|
|
948
|
+
lt,
|
|
958
949
|
{
|
|
959
950
|
className: Y("size-4", {
|
|
960
951
|
"text-primary": y(),
|
|
@@ -982,7 +973,7 @@ function Rn({
|
|
|
982
973
|
w,
|
|
983
974
|
{
|
|
984
975
|
disabled: n !== "Success",
|
|
985
|
-
onClick:
|
|
976
|
+
onClick: T,
|
|
986
977
|
size: "sm",
|
|
987
978
|
variant: "secondary",
|
|
988
979
|
className: "flex",
|
|
@@ -998,19 +989,19 @@ function Rn({
|
|
|
998
989
|
{
|
|
999
990
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
1000
991
|
children: [
|
|
1001
|
-
|
|
992
|
+
a == null ? void 0 : a.map((C) => /* @__PURE__ */ e.jsxs(
|
|
1002
993
|
"div",
|
|
1003
994
|
{
|
|
1004
995
|
onClick: () => O(C),
|
|
1005
996
|
className: Y(
|
|
1006
997
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1007
998
|
{
|
|
1008
|
-
"bg-muted":
|
|
999
|
+
"bg-muted": it(C, r)
|
|
1009
1000
|
}
|
|
1010
1001
|
),
|
|
1011
1002
|
children: [
|
|
1012
1003
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1013
|
-
/* @__PURE__ */ e.jsx(
|
|
1004
|
+
/* @__PURE__ */ e.jsx(Oa, { column: C }),
|
|
1014
1005
|
/* @__PURE__ */ e.jsx("span", { children: C.column_name })
|
|
1015
1006
|
] }),
|
|
1016
1007
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1018,7 +1009,7 @@ function Rn({
|
|
|
1018
1009
|
{
|
|
1019
1010
|
onClick: (z) => z.stopPropagation(),
|
|
1020
1011
|
className: "flex items-center justify-end",
|
|
1021
|
-
children:
|
|
1012
|
+
children: ma.includes(C.data_type) && /* @__PURE__ */ e.jsx(qn, { column: C })
|
|
1022
1013
|
}
|
|
1023
1014
|
)
|
|
1024
1015
|
]
|
|
@@ -1032,9 +1023,9 @@ function Rn({
|
|
|
1032
1023
|
)
|
|
1033
1024
|
] });
|
|
1034
1025
|
}
|
|
1035
|
-
function Ie(s,
|
|
1026
|
+
function Ie(s, t) {
|
|
1036
1027
|
var Ye, Ze, Re, Xe, es;
|
|
1037
|
-
let
|
|
1028
|
+
let a = dn(() => [], []);
|
|
1038
1029
|
const n = Qe().authToken || s, r = c(
|
|
1039
1030
|
(l) => l.selectedConnectionId
|
|
1040
1031
|
), m = c(
|
|
@@ -1079,7 +1070,7 @@ function Ie(s, a) {
|
|
|
1079
1070
|
// Only fetch if authToken is present
|
|
1080
1071
|
}), {
|
|
1081
1072
|
data: V,
|
|
1082
|
-
isLoading:
|
|
1073
|
+
isLoading: T,
|
|
1083
1074
|
isError: C
|
|
1084
1075
|
} = me({
|
|
1085
1076
|
queryKey: ["models", r],
|
|
@@ -1099,7 +1090,7 @@ function Ie(s, a) {
|
|
|
1099
1090
|
isLoading: R,
|
|
1100
1091
|
isFetching: W,
|
|
1101
1092
|
isError: J,
|
|
1102
|
-
refetch:
|
|
1093
|
+
refetch: te
|
|
1103
1094
|
} = me({
|
|
1104
1095
|
queryKey: ["databases", r],
|
|
1105
1096
|
queryFn: () => be(
|
|
@@ -1132,7 +1123,7 @@ function Ie(s, a) {
|
|
|
1132
1123
|
}), {
|
|
1133
1124
|
data: H,
|
|
1134
1125
|
isLoading: fe,
|
|
1135
|
-
isFetching:
|
|
1126
|
+
isFetching: ae,
|
|
1136
1127
|
isError: I,
|
|
1137
1128
|
refetch: Z
|
|
1138
1129
|
} = me({
|
|
@@ -1188,8 +1179,8 @@ function Ie(s, a) {
|
|
|
1188
1179
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1189
1180
|
});
|
|
1190
1181
|
U(() => {
|
|
1191
|
-
p(
|
|
1192
|
-
}, [se, p,
|
|
1182
|
+
p(a);
|
|
1183
|
+
}, [se, p, a]), U(() => {
|
|
1193
1184
|
}, [
|
|
1194
1185
|
K,
|
|
1195
1186
|
j,
|
|
@@ -1211,10 +1202,10 @@ function Ie(s, a) {
|
|
|
1211
1202
|
function Ks(l) {
|
|
1212
1203
|
b(l === "none" ? "" : l), l !== "none" && l !== "" && g("");
|
|
1213
1204
|
}
|
|
1214
|
-
A && ((Ze = A == null ? void 0 : A.databases) == null ? void 0 : Ze.length) > 0, G && ((Re = G == null ? void 0 : G.schemas) == null ? void 0 : Re.length) > 0, se && ((Xe = se == null ? void 0 : se.columns) == null ? void 0 : Xe.length) > 0 && (
|
|
1205
|
+
A && ((Ze = A == null ? void 0 : A.databases) == null ? void 0 : Ze.length) > 0, G && ((Re = G == null ? void 0 : G.schemas) == null ? void 0 : Re.length) > 0, se && ((Xe = se == null ? void 0 : se.columns) == null ? void 0 : Xe.length) > 0 && (a = se.columns.map((l) => ({
|
|
1215
1206
|
...l,
|
|
1216
1207
|
data_type: l.data_type.toLowerCase()
|
|
1217
|
-
}))), J && (
|
|
1208
|
+
}))), J && (a = []), (Q || E) && (a = []);
|
|
1218
1209
|
const ke = y == null ? void 0 : y.connections.map(
|
|
1219
1210
|
(l) => ({
|
|
1220
1211
|
id: l.id,
|
|
@@ -1239,7 +1230,7 @@ function Ie(s, a) {
|
|
|
1239
1230
|
isConnectionsLoading: L,
|
|
1240
1231
|
isConnectionsError: E,
|
|
1241
1232
|
modelItems: ms,
|
|
1242
|
-
isModelsLoading:
|
|
1233
|
+
isModelsLoading: T,
|
|
1243
1234
|
isModelsError: C,
|
|
1244
1235
|
databaseItems: We,
|
|
1245
1236
|
isDatabasesLoadingOrFetching: R || W,
|
|
@@ -1248,9 +1239,9 @@ function Ie(s, a) {
|
|
|
1248
1239
|
isSchemaLoadingOrFetching: ne || S,
|
|
1249
1240
|
isSchemaError: N,
|
|
1250
1241
|
tableItems: xs,
|
|
1251
|
-
isTableLoadingOrFetching: fe ||
|
|
1242
|
+
isTableLoadingOrFetching: fe || ae,
|
|
1252
1243
|
isTableError: I,
|
|
1253
|
-
columns:
|
|
1244
|
+
columns: a,
|
|
1254
1245
|
isColumnsLoadingOrFetching: ye || ge,
|
|
1255
1246
|
isColumnsError: Q,
|
|
1256
1247
|
isNonDbConnection: K,
|
|
@@ -1263,13 +1254,13 @@ function Ie(s, a) {
|
|
|
1263
1254
|
handleSchemaChange: ve
|
|
1264
1255
|
};
|
|
1265
1256
|
}
|
|
1266
|
-
function
|
|
1257
|
+
function Ma({
|
|
1267
1258
|
ColumnsComponent: s
|
|
1268
1259
|
}) {
|
|
1269
|
-
var
|
|
1270
|
-
const
|
|
1260
|
+
var ae;
|
|
1261
|
+
const t = c(
|
|
1271
1262
|
(I) => I.selectedConnectionId
|
|
1272
|
-
),
|
|
1263
|
+
), a = c(
|
|
1273
1264
|
(I) => I.selectedDatamodelId
|
|
1274
1265
|
), n = c(
|
|
1275
1266
|
(I) => I.selectedDatabaseName
|
|
@@ -1294,7 +1285,7 @@ function Mt({
|
|
|
1294
1285
|
isSchemaError: L,
|
|
1295
1286
|
isColumnsError: E,
|
|
1296
1287
|
isColumnsLoadingOrFetching: V,
|
|
1297
|
-
isTableLoadingOrFetching:
|
|
1288
|
+
isTableLoadingOrFetching: T,
|
|
1298
1289
|
isTableError: C,
|
|
1299
1290
|
connectionType: z,
|
|
1300
1291
|
isNonDbConnection: q,
|
|
@@ -1303,13 +1294,13 @@ function Mt({
|
|
|
1303
1294
|
handleSchemaChange: R,
|
|
1304
1295
|
handleDatamodelChange: W,
|
|
1305
1296
|
tableName: J,
|
|
1306
|
-
schemaName:
|
|
1297
|
+
schemaName: te
|
|
1307
1298
|
} = Ie();
|
|
1308
1299
|
function G() {
|
|
1309
|
-
return s ? s(
|
|
1300
|
+
return s ? s(te, J, g) : /* @__PURE__ */ e.jsx(
|
|
1310
1301
|
Rn,
|
|
1311
1302
|
{
|
|
1312
|
-
schemaName:
|
|
1303
|
+
schemaName: te,
|
|
1313
1304
|
tableName: J,
|
|
1314
1305
|
columns: g,
|
|
1315
1306
|
status: V ? "Loading..." : E ? "Error" : "Success"
|
|
@@ -1320,9 +1311,9 @@ function Mt({
|
|
|
1320
1311
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1321
1312
|
}
|
|
1322
1313
|
function S() {
|
|
1323
|
-
if (!
|
|
1314
|
+
if (!t || z === "S3" || z === "API")
|
|
1324
1315
|
return null;
|
|
1325
|
-
if (!
|
|
1316
|
+
if (!a || a === "none")
|
|
1326
1317
|
return /* @__PURE__ */ e.jsx(
|
|
1327
1318
|
He,
|
|
1328
1319
|
{
|
|
@@ -1337,7 +1328,7 @@ function Mt({
|
|
|
1337
1328
|
);
|
|
1338
1329
|
}
|
|
1339
1330
|
function N() {
|
|
1340
|
-
if (
|
|
1331
|
+
if (t && !q && (!n || n === "none") && (!a || a === "none"))
|
|
1341
1332
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1342
1333
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ke, {}) }),
|
|
1343
1334
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(_, { children: "OR" }) }),
|
|
@@ -1345,7 +1336,7 @@ function Mt({
|
|
|
1345
1336
|
] });
|
|
1346
1337
|
}
|
|
1347
1338
|
function F() {
|
|
1348
|
-
if (!
|
|
1339
|
+
if (!t || z === "S3" || z === "API")
|
|
1349
1340
|
return null;
|
|
1350
1341
|
if (!n || n === "none")
|
|
1351
1342
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -1356,13 +1347,13 @@ function Mt({
|
|
|
1356
1347
|
isError: f,
|
|
1357
1348
|
isLoading: u,
|
|
1358
1349
|
items: d,
|
|
1359
|
-
value:
|
|
1350
|
+
value: a || "",
|
|
1360
1351
|
title: "Model"
|
|
1361
1352
|
}
|
|
1362
1353
|
);
|
|
1363
1354
|
}
|
|
1364
1355
|
function H() {
|
|
1365
|
-
return !
|
|
1356
|
+
return !t || z === "S3" || z === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1366
1357
|
He,
|
|
1367
1358
|
{
|
|
1368
1359
|
onChange: R,
|
|
@@ -1377,7 +1368,7 @@ function Mt({
|
|
|
1377
1368
|
function fe() {
|
|
1378
1369
|
function I() {
|
|
1379
1370
|
let Z = !1;
|
|
1380
|
-
return z === "API" ? (Z = !1, Z) : ((z === "S3" ||
|
|
1371
|
+
return z === "API" ? (Z = !1, Z) : ((z === "S3" || t && n && n !== "none" && r) && (Z = !0), Z);
|
|
1381
1372
|
}
|
|
1382
1373
|
return I() ? /* @__PURE__ */ e.jsx(
|
|
1383
1374
|
He,
|
|
@@ -1385,7 +1376,7 @@ function Mt({
|
|
|
1385
1376
|
onChange: i,
|
|
1386
1377
|
isError: C,
|
|
1387
1378
|
items: b,
|
|
1388
|
-
isLoading:
|
|
1379
|
+
isLoading: T,
|
|
1389
1380
|
value: m || "",
|
|
1390
1381
|
title: "Table"
|
|
1391
1382
|
}
|
|
@@ -1398,13 +1389,13 @@ function Mt({
|
|
|
1398
1389
|
{
|
|
1399
1390
|
items: o,
|
|
1400
1391
|
title: "Connection",
|
|
1401
|
-
value:
|
|
1392
|
+
value: t || "",
|
|
1402
1393
|
onChange: K,
|
|
1403
1394
|
isLoading: h,
|
|
1404
1395
|
isError: j,
|
|
1405
|
-
connectionTooltip: ((
|
|
1406
|
-
(I) => I.id ===
|
|
1407
|
-
)) == null ? void 0 :
|
|
1396
|
+
connectionTooltip: ((ae = o == null ? void 0 : o.find(
|
|
1397
|
+
(I) => I.id === t
|
|
1398
|
+
)) == null ? void 0 : ae.type) || ""
|
|
1408
1399
|
}
|
|
1409
1400
|
),
|
|
1410
1401
|
F(),
|
|
@@ -1430,15 +1421,15 @@ function Mt({
|
|
|
1430
1421
|
] });
|
|
1431
1422
|
}
|
|
1432
1423
|
function _n(s) {
|
|
1433
|
-
const
|
|
1424
|
+
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), r = s.toUpperCase().indexOf("ORDER BY");
|
|
1434
1425
|
let m = s.length;
|
|
1435
|
-
if (r !== -1 && (m = r), n !== -1 && n < m && (m = n),
|
|
1436
|
-
const i = s.substring(0,
|
|
1426
|
+
if (r !== -1 && (m = r), n !== -1 && n < m && (m = n), t !== -1) {
|
|
1427
|
+
const i = s.substring(0, t), o = s.substring(t);
|
|
1437
1428
|
return `${i} {{ filters | where }} AND ${o.substring(
|
|
1438
1429
|
6
|
|
1439
1430
|
)}`;
|
|
1440
|
-
} else if (
|
|
1441
|
-
const i = s.substring(0,
|
|
1431
|
+
} else if (a !== -1) {
|
|
1432
|
+
const i = s.substring(0, a), o = s.substring(a);
|
|
1442
1433
|
return `${i} {{ filters | where }} ${o}`;
|
|
1443
1434
|
} else {
|
|
1444
1435
|
const i = s.substring(0, m), o = s.substring(m);
|
|
@@ -1447,8 +1438,8 @@ function _n(s) {
|
|
|
1447
1438
|
}
|
|
1448
1439
|
function Hn({
|
|
1449
1440
|
error: s,
|
|
1450
|
-
setShowAIDialog:
|
|
1451
|
-
setUserInputforAI:
|
|
1441
|
+
setShowAIDialog: t,
|
|
1442
|
+
setUserInputforAI: a,
|
|
1452
1443
|
setTriggerAIRun: n
|
|
1453
1444
|
}) {
|
|
1454
1445
|
return /* @__PURE__ */ e.jsxs(Ls, { openDelay: 0, children: [
|
|
@@ -1459,7 +1450,7 @@ function Hn({
|
|
|
1459
1450
|
w,
|
|
1460
1451
|
{
|
|
1461
1452
|
onClick: () => {
|
|
1462
|
-
|
|
1453
|
+
t(!0), a(s), n(!0);
|
|
1463
1454
|
},
|
|
1464
1455
|
size: "sm",
|
|
1465
1456
|
variant: "outline",
|
|
@@ -1474,18 +1465,18 @@ function Hn({
|
|
|
1474
1465
|
}
|
|
1475
1466
|
function Bn({
|
|
1476
1467
|
text: s,
|
|
1477
|
-
onCheckedChange:
|
|
1478
|
-
checked:
|
|
1468
|
+
onCheckedChange: t,
|
|
1469
|
+
checked: a
|
|
1479
1470
|
}) {
|
|
1480
1471
|
return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
|
|
1481
|
-
/* @__PURE__ */ e.jsx(Ue, { checked:
|
|
1472
|
+
/* @__PURE__ */ e.jsx(Ue, { checked: a, onCheckedChange: t }),
|
|
1482
1473
|
/* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
|
|
1483
1474
|
] });
|
|
1484
1475
|
}
|
|
1485
1476
|
function $n() {
|
|
1486
|
-
const { authToken: s } = Qe(),
|
|
1477
|
+
const { authToken: s } = Qe(), t = c(
|
|
1487
1478
|
(m) => m.selectedConnectionId
|
|
1488
|
-
), { data:
|
|
1479
|
+
), { data: a } = me({
|
|
1489
1480
|
queryKey: ["connections"],
|
|
1490
1481
|
queryFn: () => be(
|
|
1491
1482
|
"https://semaphor.cloud/api/v1/connections",
|
|
@@ -1493,13 +1484,13 @@ function $n() {
|
|
|
1493
1484
|
),
|
|
1494
1485
|
enabled: !!(s != null && s.accessToken)
|
|
1495
1486
|
// Only fetch if authToken is present
|
|
1496
|
-
}), n =
|
|
1497
|
-
(m) => m.id ===
|
|
1487
|
+
}), n = a == null ? void 0 : a.connections.find(
|
|
1488
|
+
(m) => m.id === t
|
|
1498
1489
|
);
|
|
1499
1490
|
return n == null ? void 0 : n.type;
|
|
1500
1491
|
}
|
|
1501
1492
|
function Pn() {
|
|
1502
|
-
const { authToken: s } = Qe(),
|
|
1493
|
+
const { authToken: s } = Qe(), t = Ge(null), a = c((d) => d.applyFilters), [n, r] = M(""), m = c((d) => d.filterValues), i = c((d) => d.card.sql), o = $n();
|
|
1503
1494
|
return /* @__PURE__ */ e.jsxs(
|
|
1504
1495
|
Ls,
|
|
1505
1496
|
{
|
|
@@ -1508,7 +1499,7 @@ function Pn() {
|
|
|
1508
1499
|
if (!d)
|
|
1509
1500
|
return;
|
|
1510
1501
|
console.log("onOpenChange");
|
|
1511
|
-
const p = await
|
|
1502
|
+
const p = await pa(
|
|
1512
1503
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1513
1504
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1514
1505
|
{
|
|
@@ -1520,20 +1511,20 @@ function Pn() {
|
|
|
1520
1511
|
console.log(p), p.sql ? (console.log(p.records), r(p.sql)) : r("Error");
|
|
1521
1512
|
},
|
|
1522
1513
|
children: [
|
|
1523
|
-
/* @__PURE__ */ e.jsx(Es, { asChild: !0, children:
|
|
1514
|
+
/* @__PURE__ */ e.jsx(Es, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
1524
1515
|
/* @__PURE__ */ e.jsxs(Is, { align: "end", className: "w-[600px]", children: [
|
|
1525
|
-
/* @__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:
|
|
1516
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: t, className: "font-mono text-sm", children: [
|
|
1526
1517
|
n,
|
|
1527
1518
|
/* @__PURE__ */ e.jsx(
|
|
1528
|
-
|
|
1519
|
+
fa,
|
|
1529
1520
|
{
|
|
1530
|
-
onClick: () =>
|
|
1521
|
+
onClick: () => ot(t),
|
|
1531
1522
|
className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
|
|
1532
1523
|
}
|
|
1533
1524
|
)
|
|
1534
1525
|
] }) }) }),
|
|
1535
1526
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
1536
|
-
/* @__PURE__ */ e.jsx(
|
|
1527
|
+
/* @__PURE__ */ e.jsx(ct, { className: "h-4 w-4 opacity-70" }),
|
|
1537
1528
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
|
|
1538
1529
|
] })
|
|
1539
1530
|
] })
|
|
@@ -1590,21 +1581,21 @@ SELECT label, measure FROM table
|
|
|
1590
1581
|
`;
|
|
1591
1582
|
function Gn({
|
|
1592
1583
|
open: s,
|
|
1593
|
-
setOpen:
|
|
1594
|
-
userInput:
|
|
1584
|
+
setOpen: t,
|
|
1585
|
+
userInput: a,
|
|
1595
1586
|
setUserInput: n,
|
|
1596
1587
|
triggerAIRun: r,
|
|
1597
1588
|
setTriggerAIRun: m
|
|
1598
1589
|
}) {
|
|
1599
1590
|
const i = Ge(null), o = Ge(null), { authToken: d } = Qe(), [p, x] = M(!1), b = c((S) => S.actions.setCardSql), g = k((S) => S.dashboard.baseQueries), h = c((S) => S.actions.setRunSql), u = c((S) => S.actions.setCardType), [j, f] = M([]), v = c((S) => S.currentColumns), O = c((S) => S.card.sql), y = c((S) => S.selectedTableName), L = `
|
|
1600
|
-
${
|
|
1591
|
+
${a}
|
|
1601
1592
|
|
|
1602
1593
|
Database Query Dialect: ${y === "api" || y === "s3" ? "DuckDb" : ""}
|
|
1603
1594
|
Table Name: ${y}
|
|
1604
1595
|
Table Columns: ${v == null ? void 0 : v.map((S) => `${S.column_name} | ${S.data_type}`).join(", ")}
|
|
1605
1596
|
User SQL: ${O}
|
|
1606
1597
|
${g && `Base Queries: ${JSON.stringify(g)} `}`, E = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1607
|
-
Visual Query Syntax: ${Kn}`, { data: V, isLoading:
|
|
1598
|
+
Visual Query Syntax: ${Kn}`, { data: V, isLoading: T, isFetching: C, isError: z, refetch: q } = me({
|
|
1608
1599
|
queryKey: ["ai-query"],
|
|
1609
1600
|
queryFn: () => be(
|
|
1610
1601
|
"https://semaphor.cloud/api/v1/ai",
|
|
@@ -1650,7 +1641,7 @@ function Gn({
|
|
|
1650
1641
|
return () => clearTimeout(S);
|
|
1651
1642
|
}, [j]);
|
|
1652
1643
|
function A() {
|
|
1653
|
-
|
|
1644
|
+
a && (f((S) => [...S, { role: "user", content: a }]), K(a) && x(!0), n(""), q());
|
|
1654
1645
|
}
|
|
1655
1646
|
U(() => {
|
|
1656
1647
|
r && (A(), m(!1));
|
|
@@ -1680,24 +1671,24 @@ function Gn({
|
|
|
1680
1671
|
marginLeft: 20,
|
|
1681
1672
|
// add bullet points for unordered lists
|
|
1682
1673
|
listStyleType: "disc"
|
|
1683
|
-
},
|
|
1674
|
+
}, te = {
|
|
1684
1675
|
// Override how paragraphs are rendered
|
|
1685
1676
|
p: ({ node: S, ...N }) => /* @__PURE__ */ e.jsx("p", { style: R, ...N }),
|
|
1686
1677
|
code: ({ node: S, ...N }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...N }),
|
|
1687
1678
|
pre: ({ node: S, ...N }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: W, children: [
|
|
1688
1679
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: N.children }),
|
|
1689
1680
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1690
|
-
/* @__PURE__ */ e.jsx(w, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
1681
|
+
/* @__PURE__ */ e.jsx(w, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(fa, {}) }),
|
|
1691
1682
|
/* @__PURE__ */ e.jsx(
|
|
1692
1683
|
w,
|
|
1693
1684
|
{
|
|
1694
1685
|
onClick: (F) => {
|
|
1695
1686
|
const H = G(F);
|
|
1696
|
-
H && (
|
|
1687
|
+
H && (t(!1), b(H), h(!0));
|
|
1697
1688
|
},
|
|
1698
1689
|
size: "sm",
|
|
1699
1690
|
variant: "outline",
|
|
1700
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1691
|
+
children: /* @__PURE__ */ e.jsx(mt, {})
|
|
1701
1692
|
}
|
|
1702
1693
|
)
|
|
1703
1694
|
] })
|
|
@@ -1724,16 +1715,16 @@ function Gn({
|
|
|
1724
1715
|
},
|
|
1725
1716
|
N
|
|
1726
1717
|
) : S.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1727
|
-
|
|
1718
|
+
ht,
|
|
1728
1719
|
{
|
|
1729
1720
|
className: "w-full overflow-auto py-1",
|
|
1730
|
-
components:
|
|
1721
|
+
components: te,
|
|
1731
1722
|
children: V == null ? void 0 : V.response.replace(/DuckDB/gi, "Semaphor")
|
|
1732
1723
|
},
|
|
1733
1724
|
N
|
|
1734
1725
|
) : /* @__PURE__ */ e.jsx("div", {}, N));
|
|
1735
1726
|
}
|
|
1736
|
-
return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange:
|
|
1727
|
+
return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange: t, children: [
|
|
1737
1728
|
/* @__PURE__ */ e.jsx(ks, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1738
1729
|
w,
|
|
1739
1730
|
{
|
|
@@ -1765,7 +1756,7 @@ function Gn({
|
|
|
1765
1756
|
{
|
|
1766
1757
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
|
|
1767
1758
|
/* @__PURE__ */ e.jsx(
|
|
1768
|
-
|
|
1759
|
+
ga,
|
|
1769
1760
|
{
|
|
1770
1761
|
autoFocus: !0,
|
|
1771
1762
|
ref: i,
|
|
@@ -1780,8 +1771,8 @@ function Gn({
|
|
|
1780
1771
|
className: Y(
|
|
1781
1772
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1782
1773
|
),
|
|
1783
|
-
disabled:
|
|
1784
|
-
value:
|
|
1774
|
+
disabled: T || C,
|
|
1775
|
+
value: a,
|
|
1785
1776
|
onChange: (S) => n(S.target.value)
|
|
1786
1777
|
}
|
|
1787
1778
|
),
|
|
@@ -1793,7 +1784,7 @@ function Gn({
|
|
|
1793
1784
|
size: "sm",
|
|
1794
1785
|
variant: "ghost",
|
|
1795
1786
|
onClick: A,
|
|
1796
|
-
children: !
|
|
1787
|
+
children: !T && !C ? /* @__PURE__ */ e.jsx(dt, {}) : /* @__PURE__ */ e.jsx(Je, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1797
1788
|
}
|
|
1798
1789
|
)
|
|
1799
1790
|
] })
|
|
@@ -1804,120 +1795,120 @@ function Gn({
|
|
|
1804
1795
|
)
|
|
1805
1796
|
] });
|
|
1806
1797
|
}
|
|
1807
|
-
var
|
|
1798
|
+
var Ta = {
|
|
1808
1799
|
color: void 0,
|
|
1809
1800
|
size: void 0,
|
|
1810
1801
|
className: void 0,
|
|
1811
1802
|
style: void 0,
|
|
1812
1803
|
attr: void 0
|
|
1813
|
-
},
|
|
1814
|
-
function Un(s,
|
|
1804
|
+
}, aa = xe.createContext && /* @__PURE__ */ xe.createContext(Ta), Jn = ["attr", "size", "title"];
|
|
1805
|
+
function Un(s, t) {
|
|
1815
1806
|
if (s == null)
|
|
1816
1807
|
return {};
|
|
1817
|
-
var
|
|
1808
|
+
var a = Qn(s, t), n, r;
|
|
1818
1809
|
if (Object.getOwnPropertySymbols) {
|
|
1819
1810
|
var m = Object.getOwnPropertySymbols(s);
|
|
1820
1811
|
for (r = 0; r < m.length; r++)
|
|
1821
|
-
n = m[r], !(
|
|
1812
|
+
n = m[r], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1822
1813
|
}
|
|
1823
|
-
return
|
|
1814
|
+
return a;
|
|
1824
1815
|
}
|
|
1825
|
-
function Qn(s,
|
|
1816
|
+
function Qn(s, t) {
|
|
1826
1817
|
if (s == null)
|
|
1827
1818
|
return {};
|
|
1828
|
-
var
|
|
1819
|
+
var a = {}, n = Object.keys(s), r, m;
|
|
1829
1820
|
for (m = 0; m < n.length; m++)
|
|
1830
|
-
r = n[m], !(
|
|
1831
|
-
return
|
|
1821
|
+
r = n[m], !(t.indexOf(r) >= 0) && (a[r] = s[r]);
|
|
1822
|
+
return a;
|
|
1832
1823
|
}
|
|
1833
1824
|
function ls() {
|
|
1834
1825
|
return ls = Object.assign ? Object.assign.bind() : function(s) {
|
|
1835
|
-
for (var
|
|
1836
|
-
var
|
|
1837
|
-
for (var n in
|
|
1838
|
-
Object.prototype.hasOwnProperty.call(
|
|
1826
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1827
|
+
var a = arguments[t];
|
|
1828
|
+
for (var n in a)
|
|
1829
|
+
Object.prototype.hasOwnProperty.call(a, n) && (s[n] = a[n]);
|
|
1839
1830
|
}
|
|
1840
1831
|
return s;
|
|
1841
1832
|
}, ls.apply(this, arguments);
|
|
1842
1833
|
}
|
|
1843
|
-
function
|
|
1844
|
-
var
|
|
1834
|
+
function ta(s, t) {
|
|
1835
|
+
var a = Object.keys(s);
|
|
1845
1836
|
if (Object.getOwnPropertySymbols) {
|
|
1846
1837
|
var n = Object.getOwnPropertySymbols(s);
|
|
1847
|
-
|
|
1838
|
+
t && (n = n.filter(function(r) {
|
|
1848
1839
|
return Object.getOwnPropertyDescriptor(s, r).enumerable;
|
|
1849
|
-
})),
|
|
1840
|
+
})), a.push.apply(a, n);
|
|
1850
1841
|
}
|
|
1851
|
-
return
|
|
1842
|
+
return a;
|
|
1852
1843
|
}
|
|
1853
1844
|
function is(s) {
|
|
1854
|
-
for (var
|
|
1855
|
-
var
|
|
1856
|
-
|
|
1857
|
-
Wn(s, n,
|
|
1858
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(
|
|
1859
|
-
Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(
|
|
1845
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1846
|
+
var a = arguments[t] != null ? arguments[t] : {};
|
|
1847
|
+
t % 2 ? ta(Object(a), !0).forEach(function(n) {
|
|
1848
|
+
Wn(s, n, a[n]);
|
|
1849
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : ta(Object(a)).forEach(function(n) {
|
|
1850
|
+
Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(a, n));
|
|
1860
1851
|
});
|
|
1861
1852
|
}
|
|
1862
1853
|
return s;
|
|
1863
1854
|
}
|
|
1864
|
-
function Wn(s,
|
|
1865
|
-
return
|
|
1855
|
+
function Wn(s, t, a) {
|
|
1856
|
+
return t = Yn(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
|
|
1866
1857
|
}
|
|
1867
1858
|
function Yn(s) {
|
|
1868
|
-
var
|
|
1869
|
-
return typeof
|
|
1859
|
+
var t = Zn(s, "string");
|
|
1860
|
+
return typeof t == "symbol" ? t : String(t);
|
|
1870
1861
|
}
|
|
1871
|
-
function Zn(s,
|
|
1862
|
+
function Zn(s, t) {
|
|
1872
1863
|
if (typeof s != "object" || s === null)
|
|
1873
1864
|
return s;
|
|
1874
|
-
var
|
|
1875
|
-
if (
|
|
1876
|
-
var n =
|
|
1865
|
+
var a = s[Symbol.toPrimitive];
|
|
1866
|
+
if (a !== void 0) {
|
|
1867
|
+
var n = a.call(s, t || "default");
|
|
1877
1868
|
if (typeof n != "object")
|
|
1878
1869
|
return n;
|
|
1879
1870
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1880
1871
|
}
|
|
1881
|
-
return (
|
|
1872
|
+
return (t === "string" ? String : Number)(s);
|
|
1882
1873
|
}
|
|
1883
|
-
function
|
|
1884
|
-
return s && s.map((
|
|
1885
|
-
key:
|
|
1886
|
-
},
|
|
1874
|
+
function Da(s) {
|
|
1875
|
+
return s && s.map((t, a) => /* @__PURE__ */ xe.createElement(t.tag, is({
|
|
1876
|
+
key: a
|
|
1877
|
+
}, t.attr), Da(t.child)));
|
|
1887
1878
|
}
|
|
1888
1879
|
function pe(s) {
|
|
1889
|
-
return (
|
|
1880
|
+
return (t) => /* @__PURE__ */ xe.createElement(Xn, ls({
|
|
1890
1881
|
attr: is({}, s.attr)
|
|
1891
|
-
},
|
|
1882
|
+
}, t), Da(s.child));
|
|
1892
1883
|
}
|
|
1893
1884
|
function Xn(s) {
|
|
1894
|
-
var
|
|
1885
|
+
var t = (a) => {
|
|
1895
1886
|
var {
|
|
1896
1887
|
attr: n,
|
|
1897
1888
|
size: r,
|
|
1898
1889
|
title: m
|
|
1899
|
-
} = s, i = Un(s, Jn), o = r ||
|
|
1900
|
-
return
|
|
1890
|
+
} = s, i = Un(s, Jn), o = r || a.size || "1em", d;
|
|
1891
|
+
return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ xe.createElement("svg", ls({
|
|
1901
1892
|
stroke: "currentColor",
|
|
1902
1893
|
fill: "currentColor",
|
|
1903
1894
|
strokeWidth: "0"
|
|
1904
|
-
},
|
|
1895
|
+
}, a.attr, n, i, {
|
|
1905
1896
|
className: d,
|
|
1906
1897
|
style: is(is({
|
|
1907
|
-
color: s.color ||
|
|
1908
|
-
},
|
|
1898
|
+
color: s.color || a.color
|
|
1899
|
+
}, a.style), s.style),
|
|
1909
1900
|
height: o,
|
|
1910
1901
|
width: o,
|
|
1911
1902
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1912
1903
|
}), m && /* @__PURE__ */ xe.createElement("title", null, m), s.children);
|
|
1913
1904
|
};
|
|
1914
|
-
return
|
|
1905
|
+
return aa !== void 0 ? /* @__PURE__ */ xe.createElement(aa.Consumer, null, (a) => t(a)) : t(Ta);
|
|
1915
1906
|
}
|
|
1916
1907
|
function er(s) {
|
|
1917
1908
|
return pe({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
1918
1909
|
}
|
|
1919
1910
|
function sr() {
|
|
1920
|
-
const { theme: s } =
|
|
1911
|
+
const { theme: s } = ut(), t = Ge(), a = Ge(), [n, r] = M(!1), [m, i] = M(!1), [o, d] = M(!1), [p, x] = M(""), [b, g] = M(!1), { authToken: h } = Qe();
|
|
1921
1912
|
k((l) => l.selectedSheetId);
|
|
1922
1913
|
const u = k((l) => l.dashboard.baseQueries), j = c((l) => l.card), f = k((l) => l.theme), v = c((l) => l.isShowingVisual), O = c(
|
|
1923
1914
|
(l) => l.selectedConnectionId
|
|
@@ -1931,10 +1922,10 @@ function sr() {
|
|
|
1931
1922
|
k(
|
|
1932
1923
|
(l) => l.actions.updateFrameCard
|
|
1933
1924
|
);
|
|
1934
|
-
const V = c((l) => l.selectedTableName),
|
|
1925
|
+
const V = c((l) => l.selectedTableName), T = c((l) => l.card.sql), C = c((l) => l.card.python), z = xt(T, u), q = c((l) => l.selectedConnectionId), K = c((l) => l.frame), A = k((l) => l.filterValues), R = c((l) => l.applyFilters), {
|
|
1935
1926
|
setCardCustomCfg: W,
|
|
1936
1927
|
setQueryResultColumns: J,
|
|
1937
|
-
setFilterValues:
|
|
1928
|
+
setFilterValues: te,
|
|
1938
1929
|
setCardSql: G,
|
|
1939
1930
|
setCardPython: ne,
|
|
1940
1931
|
setQueryError: S,
|
|
@@ -1942,7 +1933,7 @@ function sr() {
|
|
|
1942
1933
|
setCardPreferences: F
|
|
1943
1934
|
} = c((l) => l.actions), H = c((l) => l.onSave), fe = c(
|
|
1944
1935
|
(l) => l.actions.setApplyFilters
|
|
1945
|
-
),
|
|
1936
|
+
), ae = c((l) => l.onClose), I = c((l) => l.actions.setCardData), Z = c((l) => l.actions.setSqlGen), se = c((l) => l.runSql), ye = c((l) => l.actions.setRunSql), ge = c(
|
|
1946
1937
|
(l) => l.actions.setIsSqlRunning
|
|
1947
1938
|
), {
|
|
1948
1939
|
data: Q,
|
|
@@ -1955,7 +1946,7 @@ function sr() {
|
|
|
1955
1946
|
refetch: ke
|
|
1956
1947
|
} = me({
|
|
1957
1948
|
queryKey: [z, C],
|
|
1958
|
-
queryFn: () =>
|
|
1949
|
+
queryFn: () => pa(
|
|
1959
1950
|
"https://semaphor.cloud/api/v1/query",
|
|
1960
1951
|
(h == null ? void 0 : h.accessToken) || "",
|
|
1961
1952
|
{
|
|
@@ -1997,11 +1988,11 @@ function sr() {
|
|
|
1997
1988
|
G(""), I([]), Z({}), W(""), F({});
|
|
1998
1989
|
}
|
|
1999
1990
|
const We = (l) => {
|
|
2000
|
-
|
|
1991
|
+
a.current = l;
|
|
2001
1992
|
};
|
|
2002
1993
|
function us() {
|
|
2003
|
-
let l =
|
|
2004
|
-
|
|
1994
|
+
let l = T;
|
|
1995
|
+
T && !T.includes("{{") && (l = _n(T), G(l));
|
|
2005
1996
|
const ie = {
|
|
2006
1997
|
...j,
|
|
2007
1998
|
lastSelectedSchema: E,
|
|
@@ -2021,7 +2012,7 @@ function sr() {
|
|
|
2021
2012
|
});
|
|
2022
2013
|
}
|
|
2023
2014
|
function xs() {
|
|
2024
|
-
|
|
2015
|
+
ae == null || ae();
|
|
2025
2016
|
}
|
|
2026
2017
|
function Ye(l) {
|
|
2027
2018
|
const ie = getComputedStyle(
|
|
@@ -2030,17 +2021,17 @@ function sr() {
|
|
|
2030
2021
|
return Ze(ie);
|
|
2031
2022
|
}
|
|
2032
2023
|
function Ze(l) {
|
|
2033
|
-
const [ie, _e, Ne] = l.split(" "), X = parseFloat(ie),
|
|
2024
|
+
const [ie, _e, Ne] = l.split(" "), X = parseFloat(ie), Ka = parseFloat(_e), Ga = parseFloat(Ne), Ja = Ka / 100, Gs = Ga / 100, je = (1 - Math.abs(2 * Gs - 1)) * Ja, we = je * (1 - Math.abs(X / 60 % 2 - 1)), ps = Gs - je / 2;
|
|
2034
2025
|
let oe = 0, ce = 0, de = 0;
|
|
2035
2026
|
0 <= X && X < 60 ? (oe = je, ce = we, de = 0) : 60 <= X && X < 120 ? (oe = we, ce = je, de = 0) : 120 <= X && X < 180 ? (oe = 0, ce = je, de = we) : 180 <= X && X < 240 ? (oe = 0, ce = we, de = je) : 240 <= X && X < 300 ? (oe = we, ce = 0, de = je) : 300 <= X && X < 360 && (oe = je, ce = 0, de = we), oe = Math.round((oe + ps) * 255), ce = Math.round((ce + ps) * 255), de = Math.round((de + ps) * 255);
|
|
2036
|
-
const fs = (
|
|
2037
|
-
const gs =
|
|
2027
|
+
const fs = (Ua) => {
|
|
2028
|
+
const gs = Ua.toString(16);
|
|
2038
2029
|
return gs.length == 1 ? "0" + gs : gs;
|
|
2039
2030
|
};
|
|
2040
2031
|
return `#${fs(oe)}${fs(ce)}${fs(de)}`;
|
|
2041
2032
|
}
|
|
2042
2033
|
U(() => {
|
|
2043
|
-
const l =
|
|
2034
|
+
const l = t.current, ie = a.current;
|
|
2044
2035
|
if (l) {
|
|
2045
2036
|
const _e = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = f === "system" ? _e : f;
|
|
2046
2037
|
l.editor.defineTheme("default", {
|
|
@@ -2061,9 +2052,9 @@ function sr() {
|
|
|
2061
2052
|
}
|
|
2062
2053
|
), () => {
|
|
2063
2054
|
};
|
|
2064
|
-
}, [s, f,
|
|
2055
|
+
}, [s, f, t.current]);
|
|
2065
2056
|
function Re(l) {
|
|
2066
|
-
|
|
2057
|
+
t.current = l;
|
|
2067
2058
|
}
|
|
2068
2059
|
function Xe() {
|
|
2069
2060
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -2098,7 +2089,7 @@ function sr() {
|
|
|
2098
2089
|
onChange: (l) => {
|
|
2099
2090
|
if (l)
|
|
2100
2091
|
try {
|
|
2101
|
-
JSON.parse(l),
|
|
2092
|
+
JSON.parse(l), te(JSON.parse(l));
|
|
2102
2093
|
} catch {
|
|
2103
2094
|
}
|
|
2104
2095
|
},
|
|
@@ -2126,7 +2117,7 @@ function sr() {
|
|
|
2126
2117
|
}
|
|
2127
2118
|
),
|
|
2128
2119
|
A && !m && /* @__PURE__ */ e.jsx(
|
|
2129
|
-
|
|
2120
|
+
oa,
|
|
2130
2121
|
{
|
|
2131
2122
|
onClick: () => i(!0),
|
|
2132
2123
|
className: Y(
|
|
@@ -2168,7 +2159,7 @@ function sr() {
|
|
|
2168
2159
|
onChange: (l) => {
|
|
2169
2160
|
G(l);
|
|
2170
2161
|
},
|
|
2171
|
-
value:
|
|
2162
|
+
value: T,
|
|
2172
2163
|
options: {
|
|
2173
2164
|
minimap: {
|
|
2174
2165
|
enabled: !1
|
|
@@ -2310,7 +2301,7 @@ function sr() {
|
|
|
2310
2301
|
}
|
|
2311
2302
|
),
|
|
2312
2303
|
/* @__PURE__ */ e.jsx(
|
|
2313
|
-
|
|
2304
|
+
ua,
|
|
2314
2305
|
{
|
|
2315
2306
|
pressed: n,
|
|
2316
2307
|
onPressedChange: (l) => r(l),
|
|
@@ -2340,7 +2331,7 @@ function sr() {
|
|
|
2340
2331
|
size: "sm",
|
|
2341
2332
|
variant: "outline",
|
|
2342
2333
|
children: [
|
|
2343
|
-
/* @__PURE__ */ e.jsx(
|
|
2334
|
+
/* @__PURE__ */ e.jsx(pt, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2344
2335
|
"Accept"
|
|
2345
2336
|
]
|
|
2346
2337
|
}
|
|
@@ -2367,9 +2358,9 @@ function sr() {
|
|
|
2367
2358
|
)
|
|
2368
2359
|
);
|
|
2369
2360
|
}
|
|
2370
|
-
function
|
|
2361
|
+
function ar({ data: s }) {
|
|
2371
2362
|
var i;
|
|
2372
|
-
const [
|
|
2363
|
+
const [t, a] = xe.useState([]), r = Object.keys(s[0]).map((o) => ({
|
|
2373
2364
|
// header: key,
|
|
2374
2365
|
accessorKey: o,
|
|
2375
2366
|
header: ({ column: d }) => {
|
|
@@ -2381,29 +2372,29 @@ function tr({ data: s }) {
|
|
|
2381
2372
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2382
2373
|
children: [
|
|
2383
2374
|
o,
|
|
2384
|
-
p === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2375
|
+
p === "asc" ? /* @__PURE__ */ e.jsx(ft, { className: "ml-2 h-5 w-5" }) : p === "desc" ? /* @__PURE__ */ e.jsx(gt, { className: "ml-2 h-5 w-5" }) : null
|
|
2385
2376
|
]
|
|
2386
2377
|
}
|
|
2387
2378
|
) });
|
|
2388
2379
|
}
|
|
2389
|
-
})), m =
|
|
2380
|
+
})), m = jt({
|
|
2390
2381
|
data: s,
|
|
2391
2382
|
columns: r,
|
|
2392
|
-
getCoreRowModel:
|
|
2393
|
-
getPaginationRowModel:
|
|
2394
|
-
onSortingChange:
|
|
2395
|
-
getSortedRowModel:
|
|
2383
|
+
getCoreRowModel: Ct(),
|
|
2384
|
+
getPaginationRowModel: St(),
|
|
2385
|
+
onSortingChange: a,
|
|
2386
|
+
getSortedRowModel: kt(),
|
|
2396
2387
|
manualPagination: !0,
|
|
2397
2388
|
state: {
|
|
2398
|
-
sorting:
|
|
2389
|
+
sorting: t
|
|
2399
2390
|
}
|
|
2400
2391
|
});
|
|
2401
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2402
|
-
/* @__PURE__ */ e.jsx(
|
|
2392
|
+
return /* @__PURE__ */ e.jsxs(bt, { children: [
|
|
2393
|
+
/* @__PURE__ */ e.jsx(yt, { children: m.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(js, { children: o.headers.map((d) => /* @__PURE__ */ e.jsx(vt, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ws(
|
|
2403
2394
|
d.column.columnDef.header,
|
|
2404
2395
|
d.getContext()
|
|
2405
2396
|
) }, d.id)) }, o.id)) }),
|
|
2406
|
-
/* @__PURE__ */ e.jsx(
|
|
2397
|
+
/* @__PURE__ */ e.jsx(Nt, { children: (i = m.getRowModel().rows) != null && i.length ? m.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
|
|
2407
2398
|
js,
|
|
2408
2399
|
{
|
|
2409
2400
|
className: "whitespace-nowrap py-2",
|
|
@@ -2414,15 +2405,15 @@ function tr({ data: s }) {
|
|
|
2414
2405
|
)) : /* @__PURE__ */ e.jsx(js, { children: /* @__PURE__ */ e.jsx(Ys, { colSpan: r.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2415
2406
|
] });
|
|
2416
2407
|
}
|
|
2417
|
-
function
|
|
2408
|
+
function Aa({
|
|
2418
2409
|
// card,
|
|
2419
2410
|
showCard: s,
|
|
2420
|
-
className:
|
|
2421
|
-
...
|
|
2411
|
+
className: t,
|
|
2412
|
+
...a
|
|
2422
2413
|
}) {
|
|
2423
2414
|
var h;
|
|
2424
2415
|
xe.useState(0);
|
|
2425
|
-
const n = k((u) => u.themeStyle), r = c((u) => u.card), m = c((u) => u.frame), i = k((u) => u.dashboard.filters), o = k((u) => u.filterValues), d = c((u) => u.actions.setRunSql), { updateFilter: p } =
|
|
2416
|
+
const n = k((u) => u.themeStyle), r = c((u) => u.card), m = c((u) => u.frame), i = k((u) => u.dashboard.filters), o = k((u) => u.filterValues), d = c((u) => u.actions.setRunSql), { updateFilter: p } = wt(), x = i == null ? void 0 : i.find((u) => u.id === m.filterId), b = c((u) => u.actions.setCard);
|
|
2426
2417
|
if (U(() => {
|
|
2427
2418
|
d(!0);
|
|
2428
2419
|
}, [o]), U(() => {
|
|
@@ -2436,36 +2427,36 @@ function At({
|
|
|
2436
2427
|
]), !r.id)
|
|
2437
2428
|
return null;
|
|
2438
2429
|
let g;
|
|
2439
|
-
return r.data && r.data.length > 0 && (g =
|
|
2430
|
+
return r.data && r.data.length > 0 && (g = ja({
|
|
2440
2431
|
data: r.data,
|
|
2441
2432
|
cardType: r.type,
|
|
2442
2433
|
cfg: r.cfg,
|
|
2443
2434
|
customCfg: r.customCfg,
|
|
2444
2435
|
preferences: r.preferences
|
|
2445
2436
|
})), /* @__PURE__ */ e.jsxs(
|
|
2446
|
-
|
|
2437
|
+
zt,
|
|
2447
2438
|
{
|
|
2448
2439
|
role: "editor-visual-card",
|
|
2449
|
-
className: Y("relative flex h-full flex-col rounded-none",
|
|
2450
|
-
...
|
|
2440
|
+
className: Y("relative flex h-full flex-col rounded-none", t),
|
|
2441
|
+
...a,
|
|
2451
2442
|
children: [
|
|
2452
|
-
/* @__PURE__ */ e.jsxs(
|
|
2443
|
+
/* @__PURE__ */ e.jsxs(Ft, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2453
2444
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2454
2445
|
/* @__PURE__ */ e.jsx(
|
|
2455
|
-
|
|
2446
|
+
as,
|
|
2456
2447
|
{
|
|
2457
2448
|
text: r.title,
|
|
2458
2449
|
onSave: (u) => b({ ...r, title: u }),
|
|
2459
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2450
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Ot, { className: "text-base", children: r.title }) })
|
|
2460
2451
|
},
|
|
2461
2452
|
r.title
|
|
2462
2453
|
),
|
|
2463
2454
|
/* @__PURE__ */ e.jsx(
|
|
2464
|
-
|
|
2455
|
+
as,
|
|
2465
2456
|
{
|
|
2466
2457
|
text: r.description || "",
|
|
2467
2458
|
onSave: (u) => b({ ...r, description: u }),
|
|
2468
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2459
|
+
children: /* @__PURE__ */ e.jsxs(Mt, { children: [
|
|
2469
2460
|
" ",
|
|
2470
2461
|
r.description
|
|
2471
2462
|
] })
|
|
@@ -2475,7 +2466,7 @@ function At({
|
|
|
2475
2466
|
] }),
|
|
2476
2467
|
x && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2477
2468
|
/* @__PURE__ */ e.jsx(
|
|
2478
|
-
|
|
2469
|
+
as,
|
|
2479
2470
|
{
|
|
2480
2471
|
className: "my-1",
|
|
2481
2472
|
text: x.title || x.column,
|
|
@@ -2483,36 +2474,36 @@ function At({
|
|
|
2483
2474
|
children: /* @__PURE__ */ e.jsx(_, { children: x.title })
|
|
2484
2475
|
}
|
|
2485
2476
|
),
|
|
2486
|
-
|
|
2477
|
+
Tt(x)
|
|
2487
2478
|
] })
|
|
2488
2479
|
] }),
|
|
2489
|
-
/* @__PURE__ */ e.jsxs(
|
|
2480
|
+
/* @__PURE__ */ e.jsxs(Dt, { className: "flex grow flex-col pb-3", children: [
|
|
2490
2481
|
r.type !== "table" && g && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2491
2482
|
/* @__PURE__ */ e.jsx(
|
|
2492
|
-
|
|
2483
|
+
At,
|
|
2493
2484
|
{
|
|
2494
2485
|
cfg: g
|
|
2495
2486
|
},
|
|
2496
2487
|
JSON.stringify(g) + JSON.stringify(r.preferences) + ((h = r == null ? void 0 : r.preferences) == null ? void 0 : h.customVisualCode)
|
|
2497
2488
|
),
|
|
2498
2489
|
r.type === "table" && r.data && r.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2499
|
-
/* @__PURE__ */ e.jsx(
|
|
2490
|
+
/* @__PURE__ */ e.jsx(Lt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Et, { card: r, data: r == null ? void 0 : r.data }) })
|
|
2500
2491
|
] })
|
|
2501
2492
|
]
|
|
2502
2493
|
}
|
|
2503
2494
|
);
|
|
2504
2495
|
}
|
|
2505
|
-
function
|
|
2506
|
-
const [s,
|
|
2496
|
+
function tr() {
|
|
2497
|
+
const [s, t] = M(!1), [a, n] = M(""), [r, m] = M(""), [i, o] = M(""), [d, p] = M(""), x = c((y) => y.card), b = c(
|
|
2507
2498
|
(y) => y.card.customCfg
|
|
2508
2499
|
), { setCardCustomCfg: g, setCustomVisualCode: h } = qs();
|
|
2509
2500
|
function u(y) {
|
|
2510
|
-
var V,
|
|
2501
|
+
var V, T;
|
|
2511
2502
|
const L = {
|
|
2512
2503
|
...y,
|
|
2513
2504
|
data: {
|
|
2514
2505
|
...y == null ? void 0 : y.data,
|
|
2515
|
-
datasets: (
|
|
2506
|
+
datasets: (T = (V = y == null ? void 0 : y.data) == null ? void 0 : V.datasets) == null ? void 0 : T.map((C) => ({
|
|
2516
2507
|
...C,
|
|
2517
2508
|
data: []
|
|
2518
2509
|
}))
|
|
@@ -2524,7 +2515,7 @@ function ar() {
|
|
|
2524
2515
|
var L, E;
|
|
2525
2516
|
if (!x.data || x.data.length === 0)
|
|
2526
2517
|
return;
|
|
2527
|
-
const y =
|
|
2518
|
+
const y = ja({
|
|
2528
2519
|
data: x.data,
|
|
2529
2520
|
cardType: x.type,
|
|
2530
2521
|
cfg: x.cfg,
|
|
@@ -2550,9 +2541,9 @@ function ar() {
|
|
|
2550
2541
|
const L = Zs.cloneDeep(x.cfg), E = Zs.merge(L, b);
|
|
2551
2542
|
return y = u(E), y;
|
|
2552
2543
|
}
|
|
2553
|
-
return
|
|
2544
|
+
return a ? (y = u(JSON.parse(a)), y) : "";
|
|
2554
2545
|
}
|
|
2555
|
-
return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange:
|
|
2546
|
+
return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange: t, children: [
|
|
2556
2547
|
/* @__PURE__ */ e.jsx(ks, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2557
2548
|
w,
|
|
2558
2549
|
{
|
|
@@ -2560,7 +2551,7 @@ function ar() {
|
|
|
2560
2551
|
className: ` ${b && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2561
2552
|
size: "sm",
|
|
2562
2553
|
variant: "outline",
|
|
2563
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2554
|
+
children: /* @__PURE__ */ e.jsx(It, { className: "h-4 w-4" })
|
|
2564
2555
|
}
|
|
2565
2556
|
) }),
|
|
2566
2557
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2572,7 +2563,7 @@ function ar() {
|
|
|
2572
2563
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2573
2564
|
/* @__PURE__ */ e.jsx(Os, { children: "Customize Card" }),
|
|
2574
2565
|
/* @__PURE__ */ e.jsxs(Ts, { children: [
|
|
2575
|
-
/* @__PURE__ */ e.jsx(
|
|
2566
|
+
/* @__PURE__ */ e.jsx(ca, { children: /* @__PURE__ */ e.jsx(
|
|
2576
2567
|
bn,
|
|
2577
2568
|
{
|
|
2578
2569
|
onClick: () => {
|
|
@@ -2598,15 +2589,15 @@ function ar() {
|
|
|
2598
2589
|
] })
|
|
2599
2590
|
] }),
|
|
2600
2591
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2601
|
-
/* @__PURE__ */ e.jsx(
|
|
2602
|
-
/* @__PURE__ */ e.jsxs(
|
|
2603
|
-
/* @__PURE__ */ e.jsxs(
|
|
2604
|
-
/* @__PURE__ */ e.jsxs(
|
|
2605
|
-
b && /* @__PURE__ */ e.jsx(
|
|
2592
|
+
/* @__PURE__ */ e.jsx(Aa, { className: "w-1/2 rounded shadow-none" }),
|
|
2593
|
+
/* @__PURE__ */ e.jsxs(ba, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2594
|
+
/* @__PURE__ */ e.jsxs(ya, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2595
|
+
/* @__PURE__ */ e.jsxs(ts, { value: "custom-config", children: [
|
|
2596
|
+
b && /* @__PURE__ */ e.jsx(va, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2606
2597
|
b ? "Custom Config" : "Default Config"
|
|
2607
2598
|
] }),
|
|
2608
|
-
/* @__PURE__ */ e.jsx(
|
|
2609
|
-
/* @__PURE__ */ e.jsx(
|
|
2599
|
+
/* @__PURE__ */ e.jsx(ts, { className: "", value: "output", children: "Output" }),
|
|
2600
|
+
/* @__PURE__ */ e.jsx(ts, { className: "", value: "custom-code", children: "Custom Code" })
|
|
2610
2601
|
] }),
|
|
2611
2602
|
/* @__PURE__ */ e.jsx(
|
|
2612
2603
|
ns,
|
|
@@ -2614,10 +2605,10 @@ function ar() {
|
|
|
2614
2605
|
className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
|
|
2615
2606
|
value: "output",
|
|
2616
2607
|
children: /* @__PURE__ */ e.jsx(
|
|
2617
|
-
|
|
2608
|
+
ga,
|
|
2618
2609
|
{
|
|
2619
2610
|
disabled: !0,
|
|
2620
|
-
value:
|
|
2611
|
+
value: a,
|
|
2621
2612
|
className: "h-full resize-none border-none font-mono focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
2622
2613
|
}
|
|
2623
2614
|
)
|
|
@@ -2683,7 +2674,7 @@ function ar() {
|
|
|
2683
2674
|
)
|
|
2684
2675
|
] })
|
|
2685
2676
|
] }),
|
|
2686
|
-
/* @__PURE__ */ e.jsxs(
|
|
2677
|
+
/* @__PURE__ */ e.jsxs(la, { className: "flex items-center", children: [
|
|
2687
2678
|
/* @__PURE__ */ e.jsx(_, { className: "mr-2 text-red-500", children: d }),
|
|
2688
2679
|
/* @__PURE__ */ e.jsx(
|
|
2689
2680
|
w,
|
|
@@ -2695,46 +2686,46 @@ function ar() {
|
|
|
2695
2686
|
}
|
|
2696
2687
|
),
|
|
2697
2688
|
/* @__PURE__ */ e.jsx(w, { onClick: f, variant: "outline", children: "Apply" }),
|
|
2698
|
-
/* @__PURE__ */ e.jsx(w, { onClick: () =>
|
|
2689
|
+
/* @__PURE__ */ e.jsx(w, { onClick: () => t(!1), variant: "outline", children: "Close" })
|
|
2699
2690
|
] })
|
|
2700
2691
|
]
|
|
2701
2692
|
}
|
|
2702
2693
|
)
|
|
2703
2694
|
] });
|
|
2704
2695
|
}
|
|
2705
|
-
function
|
|
2696
|
+
function La(s) {
|
|
2706
2697
|
return pe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2707
2698
|
}
|
|
2708
|
-
function
|
|
2699
|
+
function Ea(s) {
|
|
2709
2700
|
return pe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
|
|
2710
2701
|
}
|
|
2711
|
-
function
|
|
2702
|
+
function Ia(s) {
|
|
2712
2703
|
return pe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2713
2704
|
}
|
|
2714
|
-
function
|
|
2705
|
+
function Va(s) {
|
|
2715
2706
|
return pe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2716
2707
|
}
|
|
2717
|
-
function
|
|
2708
|
+
function qa(s) {
|
|
2718
2709
|
return pe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
2719
2710
|
}
|
|
2720
|
-
function
|
|
2711
|
+
function Ra(s) {
|
|
2721
2712
|
return pe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
|
|
2722
2713
|
}
|
|
2723
|
-
function
|
|
2714
|
+
function _a(s) {
|
|
2724
2715
|
return pe({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
|
|
2725
2716
|
}
|
|
2726
|
-
function
|
|
2717
|
+
function Ha(s) {
|
|
2727
2718
|
return pe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
|
|
2728
2719
|
}
|
|
2729
2720
|
function nr() {
|
|
2730
|
-
const [s,
|
|
2721
|
+
const [s, t] = M(!1), a = c((d) => d.card.type), { setCardType: n, setCardPreferences: r, setChartOrientation: m } = c((d) => d.actions), i = c(
|
|
2731
2722
|
(d) => d.actions.setCardCustomCfg
|
|
2732
2723
|
);
|
|
2733
2724
|
function o(d) {
|
|
2734
|
-
i(null), r({}), n(d),
|
|
2725
|
+
i(null), r({}), n(d), t(!1);
|
|
2735
2726
|
}
|
|
2736
|
-
return /* @__PURE__ */ e.jsxs(os, { open: s, onOpenChange:
|
|
2737
|
-
/* @__PURE__ */ e.jsx(cs, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(rr, { className: "h-4 w-4", chartType:
|
|
2727
|
+
return /* @__PURE__ */ e.jsxs(os, { open: s, onOpenChange: t, children: [
|
|
2728
|
+
/* @__PURE__ */ e.jsx(cs, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(rr, { className: "h-4 w-4", chartType: a }) }) }),
|
|
2738
2729
|
/* @__PURE__ */ e.jsx(ds, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
|
|
2739
2730
|
/* @__PURE__ */ e.jsx(
|
|
2740
2731
|
w,
|
|
@@ -2758,7 +2749,7 @@ function nr() {
|
|
|
2758
2749
|
{
|
|
2759
2750
|
onClick: () => o("stackedBar"),
|
|
2760
2751
|
variant: "ghost",
|
|
2761
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2752
|
+
children: /* @__PURE__ */ e.jsx(Ra, { className: "size-5", strokeWidth: 0 })
|
|
2762
2753
|
}
|
|
2763
2754
|
),
|
|
2764
2755
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2766,7 +2757,7 @@ function nr() {
|
|
|
2766
2757
|
{
|
|
2767
2758
|
onClick: () => o("stackedLine"),
|
|
2768
2759
|
variant: "ghost",
|
|
2769
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2760
|
+
children: /* @__PURE__ */ e.jsx(qa, { className: "size-5", strokeWidth: 0 })
|
|
2770
2761
|
}
|
|
2771
2762
|
),
|
|
2772
2763
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2774,7 +2765,7 @@ function nr() {
|
|
|
2774
2765
|
{
|
|
2775
2766
|
onClick: () => o("scatter"),
|
|
2776
2767
|
variant: "ghost",
|
|
2777
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2768
|
+
children: /* @__PURE__ */ e.jsx(Fa, { className: "size-5" })
|
|
2778
2769
|
}
|
|
2779
2770
|
),
|
|
2780
2771
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2782,7 +2773,7 @@ function nr() {
|
|
|
2782
2773
|
{
|
|
2783
2774
|
onClick: () => o("bubble"),
|
|
2784
2775
|
variant: "ghost",
|
|
2785
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2776
|
+
children: /* @__PURE__ */ e.jsx(Va, { className: "size-4" })
|
|
2786
2777
|
}
|
|
2787
2778
|
),
|
|
2788
2779
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2790,7 +2781,7 @@ function nr() {
|
|
|
2790
2781
|
{
|
|
2791
2782
|
onClick: () => o("pie"),
|
|
2792
2783
|
variant: "ghost",
|
|
2793
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2784
|
+
children: /* @__PURE__ */ e.jsx(za, { className: "size-5" })
|
|
2794
2785
|
}
|
|
2795
2786
|
),
|
|
2796
2787
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2798,7 +2789,7 @@ function nr() {
|
|
|
2798
2789
|
{
|
|
2799
2790
|
onClick: () => o("doughnut"),
|
|
2800
2791
|
variant: "ghost",
|
|
2801
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2792
|
+
children: /* @__PURE__ */ e.jsx(Ea, { className: "size-5", strokeWidth: 1 })
|
|
2802
2793
|
}
|
|
2803
2794
|
),
|
|
2804
2795
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2807,7 +2798,7 @@ function nr() {
|
|
|
2807
2798
|
onClick: () => o("radar"),
|
|
2808
2799
|
variant: "ghost",
|
|
2809
2800
|
children: /* @__PURE__ */ e.jsx(
|
|
2810
|
-
|
|
2801
|
+
La,
|
|
2811
2802
|
{
|
|
2812
2803
|
className: "size-5 font-extralight",
|
|
2813
2804
|
strokeWidth: 0.5
|
|
@@ -2820,7 +2811,7 @@ function nr() {
|
|
|
2820
2811
|
{
|
|
2821
2812
|
onClick: () => o("polarArea"),
|
|
2822
2813
|
variant: "ghost",
|
|
2823
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2814
|
+
children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
|
|
2824
2815
|
}
|
|
2825
2816
|
),
|
|
2826
2817
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2828,7 +2819,7 @@ function nr() {
|
|
|
2828
2819
|
{
|
|
2829
2820
|
onClick: () => o("pyramid"),
|
|
2830
2821
|
variant: "ghost",
|
|
2831
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2822
|
+
children: /* @__PURE__ */ e.jsx(Ha, { className: "size-5" })
|
|
2832
2823
|
}
|
|
2833
2824
|
),
|
|
2834
2825
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2836,7 +2827,7 @@ function nr() {
|
|
|
2836
2827
|
{
|
|
2837
2828
|
onClick: () => o("range"),
|
|
2838
2829
|
variant: "ghost",
|
|
2839
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2830
|
+
children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
|
|
2840
2831
|
}
|
|
2841
2832
|
),
|
|
2842
2833
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2852,7 +2843,7 @@ function nr() {
|
|
|
2852
2843
|
{
|
|
2853
2844
|
onClick: () => o("kpi"),
|
|
2854
2845
|
variant: "ghost",
|
|
2855
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2846
|
+
children: /* @__PURE__ */ e.jsx(_a, { className: "size-6" })
|
|
2856
2847
|
}
|
|
2857
2848
|
),
|
|
2858
2849
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2866,45 +2857,45 @@ function nr() {
|
|
|
2866
2857
|
] }) })
|
|
2867
2858
|
] });
|
|
2868
2859
|
}
|
|
2869
|
-
function rr({ chartType: s, className:
|
|
2860
|
+
function rr({ chartType: s, className: t }) {
|
|
2870
2861
|
switch (s) {
|
|
2871
2862
|
case "bar":
|
|
2872
|
-
return /* @__PURE__ */ e.jsx(Hs, { className:
|
|
2863
|
+
return /* @__PURE__ */ e.jsx(Hs, { className: t });
|
|
2873
2864
|
case "line":
|
|
2874
|
-
return /* @__PURE__ */ e.jsx(Bs, { className:
|
|
2865
|
+
return /* @__PURE__ */ e.jsx(Bs, { className: t });
|
|
2875
2866
|
case "pie":
|
|
2876
|
-
return /* @__PURE__ */ e.jsx(
|
|
2867
|
+
return /* @__PURE__ */ e.jsx(za, { className: t });
|
|
2877
2868
|
case "radar":
|
|
2878
|
-
return /* @__PURE__ */ e.jsx(
|
|
2869
|
+
return /* @__PURE__ */ e.jsx(La, { className: t });
|
|
2879
2870
|
case "scatter":
|
|
2880
|
-
return /* @__PURE__ */ e.jsx(
|
|
2871
|
+
return /* @__PURE__ */ e.jsx(Fa, { className: t });
|
|
2881
2872
|
case "bubble":
|
|
2882
|
-
return /* @__PURE__ */ e.jsx(
|
|
2873
|
+
return /* @__PURE__ */ e.jsx(Va, { className: t });
|
|
2883
2874
|
case "doughnut":
|
|
2884
|
-
return /* @__PURE__ */ e.jsx(
|
|
2875
|
+
return /* @__PURE__ */ e.jsx(Ea, { className: t });
|
|
2885
2876
|
case "stackedBar":
|
|
2886
|
-
return /* @__PURE__ */ e.jsx(
|
|
2877
|
+
return /* @__PURE__ */ e.jsx(Ra, { className: "size-4 text-foreground/70" });
|
|
2887
2878
|
case "stackedLine":
|
|
2888
|
-
return /* @__PURE__ */ e.jsx(
|
|
2879
|
+
return /* @__PURE__ */ e.jsx(qa, { className: "size-4 text-foreground/70" });
|
|
2889
2880
|
case "polarArea":
|
|
2890
|
-
return /* @__PURE__ */ e.jsx(
|
|
2881
|
+
return /* @__PURE__ */ e.jsx(Ia, { className: t });
|
|
2891
2882
|
case "pyramid":
|
|
2892
|
-
return /* @__PURE__ */ e.jsx(
|
|
2883
|
+
return /* @__PURE__ */ e.jsx(Ha, { className: t });
|
|
2893
2884
|
case "range":
|
|
2894
|
-
return /* @__PURE__ */ e.jsx(
|
|
2885
|
+
return /* @__PURE__ */ e.jsx(ka, { className: t });
|
|
2895
2886
|
case "kpi":
|
|
2896
|
-
return /* @__PURE__ */ e.jsx(
|
|
2887
|
+
return /* @__PURE__ */ e.jsx(_a, { className: t });
|
|
2897
2888
|
case "text":
|
|
2898
|
-
return /* @__PURE__ */ e.jsx($s, { className:
|
|
2889
|
+
return /* @__PURE__ */ e.jsx($s, { className: t });
|
|
2899
2890
|
default:
|
|
2900
|
-
return /* @__PURE__ */ e.jsx(As, { className:
|
|
2891
|
+
return /* @__PURE__ */ e.jsx(As, { className: t });
|
|
2901
2892
|
}
|
|
2902
2893
|
}
|
|
2903
|
-
function
|
|
2904
|
-
const s = c((f) => f.frame),
|
|
2894
|
+
function na() {
|
|
2895
|
+
const s = c((f) => f.frame), t = c((f) => f.card), a = c((f) => f.card.data), n = c((f) => f.isShowingVisual), r = c((f) => f.isSqlRunning), m = c((f) => f.queryError), i = c((f) => f.pythonStdOut), o = c((f) => f.actions.setRunSql);
|
|
2905
2896
|
c((f) => f.onSave), c((f) => f.onClose), c((f) => f.actions.setCardSql), c((f) => f.actions.setCardType), c((f) => f.actions.setSqlGen);
|
|
2906
2897
|
const { setFrame: d, setCard: p, updateCardInFrame: x } = qs();
|
|
2907
|
-
if (!
|
|
2898
|
+
if (!t)
|
|
2908
2899
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
2909
2900
|
function b() {
|
|
2910
2901
|
const f = {
|
|
@@ -2941,7 +2932,7 @@ function nt() {
|
|
|
2941
2932
|
function h(f) {
|
|
2942
2933
|
const v = {
|
|
2943
2934
|
...s,
|
|
2944
|
-
cards: s.cards.map((y) => y.id ===
|
|
2935
|
+
cards: s.cards.map((y) => y.id === t.id ? t : y),
|
|
2945
2936
|
activeCardId: f
|
|
2946
2937
|
};
|
|
2947
2938
|
d(v);
|
|
@@ -2950,26 +2941,26 @@ function nt() {
|
|
|
2950
2941
|
}
|
|
2951
2942
|
function u() {
|
|
2952
2943
|
return /* @__PURE__ */ e.jsxs(
|
|
2953
|
-
|
|
2944
|
+
ba,
|
|
2954
2945
|
{
|
|
2955
2946
|
onValueChange: h,
|
|
2956
2947
|
value: s.activeCardId,
|
|
2957
2948
|
className: "flex grow flex-col pb-3",
|
|
2958
2949
|
children: [
|
|
2959
|
-
s.cards.map((f) => /* @__PURE__ */ e.jsx(ns, { className: "mt-0 grow", value: f.id, children: /* @__PURE__ */ e.jsx(
|
|
2960
|
-
/* @__PURE__ */ e.jsxs(
|
|
2950
|
+
s.cards.map((f) => /* @__PURE__ */ e.jsx(ns, { className: "mt-0 grow", value: f.id, children: /* @__PURE__ */ e.jsx(Aa, { showCard: f, className: "grow border-none shadow-none" }) }, f.id)),
|
|
2951
|
+
/* @__PURE__ */ e.jsxs(ya, { className: "mx-6 justify-between", children: [
|
|
2961
2952
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
2962
2953
|
s.cards.map((f) => /* @__PURE__ */ e.jsx(
|
|
2963
|
-
|
|
2954
|
+
as,
|
|
2964
2955
|
{
|
|
2965
2956
|
text: f.tabTitle || f.title,
|
|
2966
2957
|
onSave: (v) => {
|
|
2967
|
-
p({ ...
|
|
2958
|
+
p({ ...t, tabTitle: v }), x({ ...t, tabTitle: v });
|
|
2968
2959
|
},
|
|
2969
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2960
|
+
children: /* @__PURE__ */ e.jsxs(ts, { className: "", value: f.id, children: [
|
|
2970
2961
|
f.tabTitle || f.title,
|
|
2971
2962
|
s.activeCardId === f.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
|
|
2972
|
-
|
|
2963
|
+
Na,
|
|
2973
2964
|
{
|
|
2974
2965
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
2975
2966
|
onClick: () => g(f.id)
|
|
@@ -2989,21 +2980,21 @@ function nt() {
|
|
|
2989
2980
|
}
|
|
2990
2981
|
)
|
|
2991
2982
|
] }),
|
|
2992
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(w, { className: "p-1", variant: "ghost", children: /* @__PURE__ */ e.jsx(
|
|
2983
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(w, { className: "p-1", variant: "ghost", children: /* @__PURE__ */ e.jsx(Sa, { className: "size-4" }) }) })
|
|
2993
2984
|
] })
|
|
2994
2985
|
]
|
|
2995
2986
|
}
|
|
2996
2987
|
);
|
|
2997
2988
|
}
|
|
2998
2989
|
function j() {
|
|
2999
|
-
return
|
|
2990
|
+
return t.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(Vt, { isLoading: r, card: t }) }) }) : t.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(qt, { isLoading: r, card: t }) }) }) : u();
|
|
3000
2991
|
}
|
|
3001
2992
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
|
|
3002
2993
|
r && /* @__PURE__ */ e.jsx(Je, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3003
2994
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3004
2995
|
n && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3005
2996
|
/* @__PURE__ */ e.jsx(nr, {}),
|
|
3006
|
-
|
|
2997
|
+
t.type !== "table" && /* @__PURE__ */ e.jsx(tr, {})
|
|
3007
2998
|
] }),
|
|
3008
2999
|
/* @__PURE__ */ e.jsx(ir, {})
|
|
3009
3000
|
] }),
|
|
@@ -3019,23 +3010,23 @@ function nt() {
|
|
|
3019
3010
|
// )
|
|
3020
3011
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
3021
3012
|
i && /* @__PURE__ */ e.jsx(lr, {}),
|
|
3022
|
-
|
|
3013
|
+
t.data && t.data.length > 0 && /* @__PURE__ */ e.jsx(ar, { data: a || [] }),
|
|
3023
3014
|
m && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: m })
|
|
3024
3015
|
] })
|
|
3025
3016
|
)
|
|
3026
3017
|
] });
|
|
3027
3018
|
}
|
|
3028
3019
|
function lr() {
|
|
3029
|
-
const s = c((
|
|
3020
|
+
const s = c((a) => a.pythonStdOut);
|
|
3030
3021
|
if (!s)
|
|
3031
3022
|
return null;
|
|
3032
|
-
const
|
|
3023
|
+
const t = s.replace(/\n/g, "<br>");
|
|
3033
3024
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3034
3025
|
/* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: "Output:" }),
|
|
3035
3026
|
/* @__PURE__ */ e.jsx(
|
|
3036
3027
|
"div",
|
|
3037
3028
|
{
|
|
3038
|
-
dangerouslySetInnerHTML: { __html:
|
|
3029
|
+
dangerouslySetInnerHTML: { __html: t },
|
|
3039
3030
|
className: "bg-muted p-2 font-mono text-sm"
|
|
3040
3031
|
}
|
|
3041
3032
|
),
|
|
@@ -3043,16 +3034,16 @@ function lr() {
|
|
|
3043
3034
|
] });
|
|
3044
3035
|
}
|
|
3045
3036
|
function ir() {
|
|
3046
|
-
const s = c((
|
|
3047
|
-
(
|
|
3037
|
+
const s = c((a) => a.isShowingVisual), t = c(
|
|
3038
|
+
(a) => a.actions.setIsShowingVisual
|
|
3048
3039
|
);
|
|
3049
3040
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3050
3041
|
/* @__PURE__ */ e.jsx(_, { htmlFor: "visualize", children: "Chart" }),
|
|
3051
3042
|
/* @__PURE__ */ e.jsx(
|
|
3052
|
-
|
|
3043
|
+
Rt,
|
|
3053
3044
|
{
|
|
3054
3045
|
checked: s,
|
|
3055
|
-
onCheckedChange: () =>
|
|
3046
|
+
onCheckedChange: () => t(!s),
|
|
3056
3047
|
id: "visualize",
|
|
3057
3048
|
className: "data-[state=checked]:bg-foreground/50"
|
|
3058
3049
|
}
|
|
@@ -3060,11 +3051,11 @@ function ir() {
|
|
|
3060
3051
|
] });
|
|
3061
3052
|
}
|
|
3062
3053
|
function Ve() {
|
|
3063
|
-
const [s,
|
|
3054
|
+
const [s, t] = M([]);
|
|
3064
3055
|
c(
|
|
3065
3056
|
(x) => x.card.cfg
|
|
3066
3057
|
);
|
|
3067
|
-
const
|
|
3058
|
+
const a = c((x) => x.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: r, setCardPreferences: m } = c((x) => x.actions), i = c(
|
|
3068
3059
|
(x) => x.queryResultColumns
|
|
3069
3060
|
);
|
|
3070
3061
|
c(
|
|
@@ -3073,21 +3064,21 @@ function Ve() {
|
|
|
3073
3064
|
return (b = x.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
3074
3065
|
}
|
|
3075
3066
|
), U(() => {
|
|
3076
|
-
i &&
|
|
3067
|
+
i && t(new Array(i.length).fill(!1));
|
|
3077
3068
|
}, [i]);
|
|
3078
3069
|
function o(x, b) {
|
|
3079
3070
|
var g, h;
|
|
3080
|
-
b ?
|
|
3081
|
-
...
|
|
3071
|
+
b ? a != null && a.onClickFilter && ((g = a == null ? void 0 : a.onClickFilter) == null ? void 0 : g.length) > 0 ? m({
|
|
3072
|
+
...a,
|
|
3082
3073
|
onClickFilter: [
|
|
3083
|
-
...
|
|
3074
|
+
...a.onClickFilter,
|
|
3084
3075
|
{
|
|
3085
3076
|
columnIndex: x,
|
|
3086
3077
|
expression: ""
|
|
3087
3078
|
}
|
|
3088
3079
|
]
|
|
3089
3080
|
}) : m({
|
|
3090
|
-
...
|
|
3081
|
+
...a,
|
|
3091
3082
|
onClickFilter: [
|
|
3092
3083
|
{
|
|
3093
3084
|
columnIndex: x,
|
|
@@ -3095,33 +3086,33 @@ function Ve() {
|
|
|
3095
3086
|
}
|
|
3096
3087
|
]
|
|
3097
3088
|
}) : (m({
|
|
3098
|
-
...
|
|
3099
|
-
onClickFilter: (h =
|
|
3089
|
+
...a,
|
|
3090
|
+
onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
|
|
3100
3091
|
(u) => u.columnIndex !== x
|
|
3101
3092
|
)
|
|
3102
|
-
}),
|
|
3093
|
+
}), t((u) => {
|
|
3103
3094
|
const j = [...u];
|
|
3104
3095
|
return j[x] = !1, j;
|
|
3105
3096
|
}));
|
|
3106
3097
|
}
|
|
3107
3098
|
function d(x, b) {
|
|
3108
3099
|
var h;
|
|
3109
|
-
const g = (h =
|
|
3100
|
+
const g = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((u) => u.columnIndex === x ? {
|
|
3110
3101
|
...u,
|
|
3111
3102
|
expression: b.target.value
|
|
3112
3103
|
} : u);
|
|
3113
3104
|
m({
|
|
3114
|
-
...
|
|
3105
|
+
...a,
|
|
3115
3106
|
onClickFilter: g
|
|
3116
3107
|
});
|
|
3117
3108
|
}
|
|
3118
3109
|
function p(x) {
|
|
3119
3110
|
var b, g, h, u;
|
|
3120
|
-
if (s != null && s[x] || (g = (b =
|
|
3111
|
+
if (s != null && s[x] || (g = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((j) => j.columnIndex === x)) != null && g.expression)
|
|
3121
3112
|
return /* @__PURE__ */ e.jsx(
|
|
3122
3113
|
he,
|
|
3123
3114
|
{
|
|
3124
|
-
value: (u = (h =
|
|
3115
|
+
value: (u = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((j) => j.columnIndex === x)) == null ? void 0 : u.expression,
|
|
3125
3116
|
onChange: (j) => d(x, j),
|
|
3126
3117
|
type: "text",
|
|
3127
3118
|
className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
|
|
@@ -3140,7 +3131,7 @@ function Ve() {
|
|
|
3140
3131
|
/* @__PURE__ */ e.jsx(
|
|
3141
3132
|
Ue,
|
|
3142
3133
|
{
|
|
3143
|
-
checked: !!((g =
|
|
3134
|
+
checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
|
|
3144
3135
|
(u) => u.columnIndex === b
|
|
3145
3136
|
)),
|
|
3146
3137
|
onCheckedChange: (u) => o(b, u)
|
|
@@ -3153,13 +3144,13 @@ function Ve() {
|
|
|
3153
3144
|
children: x
|
|
3154
3145
|
}
|
|
3155
3146
|
),
|
|
3156
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h =
|
|
3147
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
|
|
3157
3148
|
(u) => u.columnIndex === b
|
|
3158
3149
|
)) && /* @__PURE__ */ e.jsx(
|
|
3159
|
-
|
|
3150
|
+
wa,
|
|
3160
3151
|
{
|
|
3161
3152
|
onClick: () => {
|
|
3162
|
-
|
|
3153
|
+
t((u) => {
|
|
3163
3154
|
const j = [...u];
|
|
3164
3155
|
return j[b] = !u[b], j;
|
|
3165
3156
|
});
|
|
@@ -3177,17 +3168,17 @@ function Ve() {
|
|
|
3177
3168
|
}
|
|
3178
3169
|
function hs() {
|
|
3179
3170
|
var i, o, d;
|
|
3180
|
-
const s = c((p) => p.card.preferences),
|
|
3171
|
+
const s = c((p) => p.card.preferences), t = c(
|
|
3181
3172
|
(p) => p.card.cfg
|
|
3182
|
-
), { setCardCfg:
|
|
3183
|
-
(i =
|
|
3173
|
+
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: r } = c((p) => p.actions);
|
|
3174
|
+
(i = t == null ? void 0 : t.options) != null && i.indexAxis;
|
|
3184
3175
|
function m(p) {
|
|
3185
3176
|
r(p);
|
|
3186
3177
|
}
|
|
3187
3178
|
return /* @__PURE__ */ e.jsxs(
|
|
3188
3179
|
Rs,
|
|
3189
3180
|
{
|
|
3190
|
-
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d =
|
|
3181
|
+
value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((d = t == null ? void 0 : t.options) == null ? void 0 : d.indexAxis) || "x",
|
|
3191
3182
|
onValueChange: m,
|
|
3192
3183
|
className: "flex gap-3",
|
|
3193
3184
|
defaultValue: "x",
|
|
@@ -3205,39 +3196,39 @@ function hs() {
|
|
|
3205
3196
|
);
|
|
3206
3197
|
}
|
|
3207
3198
|
const ze = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3208
|
-
function
|
|
3199
|
+
function ra(s, t) {
|
|
3209
3200
|
var n, r, m;
|
|
3210
|
-
const
|
|
3211
|
-
return ((m = (r = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : r[
|
|
3201
|
+
const a = Ca(s, t);
|
|
3202
|
+
return ((m = (r = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : r[a]) == null ? void 0 : m.type) || "linear";
|
|
3212
3203
|
}
|
|
3213
|
-
function
|
|
3214
|
-
var W, J,
|
|
3215
|
-
const [s,
|
|
3204
|
+
function Ba() {
|
|
3205
|
+
var W, J, te, G, ne, S;
|
|
3206
|
+
const [s, t] = M(!1), a = c((N) => {
|
|
3216
3207
|
var F;
|
|
3217
3208
|
return (F = N.card) == null ? void 0 : F.preferences;
|
|
3218
3209
|
}), n = c((N) => {
|
|
3219
3210
|
var F;
|
|
3220
3211
|
return (F = N.card) == null ? void 0 : F.cfg;
|
|
3221
|
-
}), r =
|
|
3222
|
-
|
|
3212
|
+
}), r = Ca(a, n), [m, i] = M(
|
|
3213
|
+
ra(a)
|
|
3223
3214
|
), [o, d] = M(
|
|
3224
|
-
((
|
|
3215
|
+
((te = (J = (W = a == null ? void 0 : a.chartOptions) == null ? void 0 : W.scales) == null ? void 0 : J[r]) == null ? void 0 : te.min) || ""
|
|
3225
3216
|
), [p, x] = M(
|
|
3226
|
-
((S = (ne = (G =
|
|
3227
|
-
), [b, g] = M(o || p ? "custom" : "auto"), [h, u] = M(""), [j, f] = M(0), [v, O] = M(""), [y, L] = M(""), [E, V] = M(""),
|
|
3217
|
+
((S = (ne = (G = a == null ? void 0 : a.chartOptions) == null ? void 0 : G.scales) == null ? void 0 : ne[r]) == null ? void 0 : S.max) || ""
|
|
3218
|
+
), [b, g] = M(o || p ? "custom" : "auto"), [h, u] = M(""), [j, f] = M(0), [v, O] = M(""), [y, L] = M(""), [E, V] = M(""), T = c(
|
|
3228
3219
|
(N) => N.actions.setCardPreferences
|
|
3229
3220
|
), C = c((N) => {
|
|
3230
3221
|
var F;
|
|
3231
3222
|
return (F = N.card) == null ? void 0 : F.type;
|
|
3232
3223
|
}), z = ["pie", "doughnut", "polarArea"].includes(C);
|
|
3233
3224
|
U(() => {
|
|
3234
|
-
var N, F, H, fe,
|
|
3235
|
-
i(
|
|
3236
|
-
((H = (F = (N =
|
|
3237
|
-
), x(((I = (
|
|
3238
|
-
((ge = (ye = (se = (Z =
|
|
3239
|
-
), f(((Q =
|
|
3240
|
-
}, [s,
|
|
3225
|
+
var N, F, H, fe, ae, I, Z, se, ye, ge, Q, re, le, ve;
|
|
3226
|
+
i(ra(a)), d(
|
|
3227
|
+
((H = (F = (N = a == null ? void 0 : a.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : F[r]) == null ? void 0 : H.min) === 0 ? 0 : ""
|
|
3228
|
+
), x(((I = (ae = (fe = a == null ? void 0 : a.chartOptions) == null ? void 0 : fe.scales) == null ? void 0 : ae[r]) == null ? void 0 : I.max) || ""), u(
|
|
3229
|
+
((ge = (ye = (se = (Z = a == null ? void 0 : a.chartOptions) == null ? void 0 : Z.scales) == null ? void 0 : se[r]) == null ? void 0 : ye.ticks) == null ? void 0 : ge.stepSize) || ""
|
|
3230
|
+
), f(((Q = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Q.decimalPlaces) || 0), O(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.suffix) || ""), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.currency) || ""), V(((ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ve.locale) || "");
|
|
3231
|
+
}, [s, a, r]);
|
|
3241
3232
|
function q(N, F) {
|
|
3242
3233
|
return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(N);
|
|
3243
3234
|
}
|
|
@@ -3342,11 +3333,11 @@ function Bt() {
|
|
|
3342
3333
|
}
|
|
3343
3334
|
});
|
|
3344
3335
|
const F = {
|
|
3345
|
-
...
|
|
3336
|
+
...a || {},
|
|
3346
3337
|
chartOptions: {
|
|
3347
|
-
...
|
|
3338
|
+
...a == null ? void 0 : a.chartOptions,
|
|
3348
3339
|
scales: {
|
|
3349
|
-
...(H =
|
|
3340
|
+
...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
|
|
3350
3341
|
[r]: {
|
|
3351
3342
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
3352
3343
|
type: m,
|
|
@@ -3361,10 +3352,10 @@ function Bt() {
|
|
|
3361
3352
|
locale: E
|
|
3362
3353
|
}
|
|
3363
3354
|
};
|
|
3364
|
-
console.log(F),
|
|
3355
|
+
console.log(F), T(F);
|
|
3365
3356
|
}
|
|
3366
|
-
return /* @__PURE__ */ e.jsxs(os, { onOpenChange: (N) =>
|
|
3367
|
-
/* @__PURE__ */ e.jsx(cs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3357
|
+
return /* @__PURE__ */ e.jsxs(os, { onOpenChange: (N) => t(N), children: [
|
|
3358
|
+
/* @__PURE__ */ e.jsx(cs, { asChild: !0, children: /* @__PURE__ */ e.jsx(_t, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
3368
3359
|
/* @__PURE__ */ e.jsx(ds, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
3369
3360
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3370
3361
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
@@ -3416,7 +3407,7 @@ function Bt() {
|
|
|
3416
3407
|
] }),
|
|
3417
3408
|
b === "custom" && m == "linear" && A(),
|
|
3418
3409
|
K(),
|
|
3419
|
-
/* @__PURE__ */ e.jsx(
|
|
3410
|
+
/* @__PURE__ */ e.jsx(Ht, {}),
|
|
3420
3411
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
3421
3412
|
w,
|
|
3422
3413
|
{
|
|
@@ -3432,19 +3423,19 @@ function Bt() {
|
|
|
3432
3423
|
}
|
|
3433
3424
|
function or({ idx: s }) {
|
|
3434
3425
|
var o;
|
|
3435
|
-
const
|
|
3426
|
+
const t = c((d) => {
|
|
3436
3427
|
var p;
|
|
3437
3428
|
return (p = d.card) == null ? void 0 : p.preferences;
|
|
3438
|
-
}),
|
|
3429
|
+
}), a = c(
|
|
3439
3430
|
(d) => {
|
|
3440
3431
|
var p;
|
|
3441
3432
|
return (p = d.card.preferences) == null ? void 0 : p.datasetOptions;
|
|
3442
3433
|
}
|
|
3443
3434
|
), n = c(
|
|
3444
3435
|
(d) => d.actions.setCardPreferences
|
|
3445
|
-
), r = (o =
|
|
3436
|
+
), r = (o = t == null ? void 0 : t.chartOptions) == null ? void 0 : o.indexAxis, m = a == null ? void 0 : a.find((d) => d.idx === s);
|
|
3446
3437
|
function i(d, p) {
|
|
3447
|
-
(d === "end" || d === "start") &&
|
|
3438
|
+
(d === "end" || d === "start") && Bt($t());
|
|
3448
3439
|
const x = {
|
|
3449
3440
|
display: d !== "none",
|
|
3450
3441
|
align: d,
|
|
@@ -3453,9 +3444,9 @@ function or({ idx: s }) {
|
|
|
3453
3444
|
};
|
|
3454
3445
|
if (!m)
|
|
3455
3446
|
n({
|
|
3456
|
-
...
|
|
3447
|
+
...t,
|
|
3457
3448
|
datasetOptions: [
|
|
3458
|
-
...
|
|
3449
|
+
...a || [],
|
|
3459
3450
|
{
|
|
3460
3451
|
idx: p,
|
|
3461
3452
|
datalabels: x
|
|
@@ -3465,11 +3456,11 @@ function or({ idx: s }) {
|
|
|
3465
3456
|
else {
|
|
3466
3457
|
const b = { ...m };
|
|
3467
3458
|
b.datalabels = x;
|
|
3468
|
-
const g =
|
|
3459
|
+
const g = a == null ? void 0 : a.map(
|
|
3469
3460
|
(h) => h.idx === p ? b : h
|
|
3470
3461
|
);
|
|
3471
3462
|
n({
|
|
3472
|
-
...
|
|
3463
|
+
...t,
|
|
3473
3464
|
datasetOptions: g
|
|
3474
3465
|
});
|
|
3475
3466
|
}
|
|
@@ -3484,7 +3475,7 @@ function or({ idx: s }) {
|
|
|
3484
3475
|
size: "sm",
|
|
3485
3476
|
variant: "secondary",
|
|
3486
3477
|
className: "h-7 p-1 text-xs font-normal",
|
|
3487
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3478
|
+
children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
|
|
3488
3479
|
}
|
|
3489
3480
|
),
|
|
3490
3481
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3541,20 +3532,20 @@ function or({ idx: s }) {
|
|
|
3541
3532
|
] }) })
|
|
3542
3533
|
] });
|
|
3543
3534
|
}
|
|
3544
|
-
function $
|
|
3545
|
-
const s = c((d) => d.card),
|
|
3535
|
+
function $a() {
|
|
3536
|
+
const s = c((d) => d.card), t = c(
|
|
3546
3537
|
(d) => {
|
|
3547
3538
|
var p, x, b;
|
|
3548
3539
|
return (b = (x = (p = d == null ? void 0 : d.card) == null ? void 0 : p.preferences) == null ? void 0 : x.chartOptions) == null ? void 0 : b.indexAxis;
|
|
3549
3540
|
}
|
|
3550
|
-
),
|
|
3541
|
+
), a = t === "y" ? "Y axis" : "X axis", n = t === "y" ? "X axis" : "Y axis", {
|
|
3551
3542
|
keys: r,
|
|
3552
3543
|
metricKeys: m,
|
|
3553
3544
|
dimensionKeys: i
|
|
3554
3545
|
} = vs(s.data || []);
|
|
3555
3546
|
let o = m;
|
|
3556
3547
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
3557
|
-
const d =
|
|
3548
|
+
const d = Pt({
|
|
3558
3549
|
dataArray: s.data || [],
|
|
3559
3550
|
groupKey: i[0],
|
|
3560
3551
|
pivotKey: i[1],
|
|
@@ -3564,20 +3555,20 @@ function $t() {
|
|
|
3564
3555
|
}
|
|
3565
3556
|
return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3566
3557
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3567
|
-
/* @__PURE__ */ e.jsx(_, { children:
|
|
3558
|
+
/* @__PURE__ */ e.jsx(_, { children: a }),
|
|
3568
3559
|
/* @__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: i[0] }) }) })
|
|
3569
3560
|
] }),
|
|
3570
3561
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3571
3562
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
3572
3563
|
/* @__PURE__ */ e.jsx(_, { children: n }),
|
|
3573
|
-
/* @__PURE__ */ e.jsx(
|
|
3564
|
+
/* @__PURE__ */ e.jsx(Ba, {})
|
|
3574
3565
|
] }),
|
|
3575
3566
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: o.map((d, p) => /* @__PURE__ */ e.jsx(cr, { col: d, idx: p }, d)) })
|
|
3576
3567
|
] })
|
|
3577
3568
|
] });
|
|
3578
3569
|
}
|
|
3579
|
-
function cr({ col: s, idx:
|
|
3580
|
-
const
|
|
3570
|
+
function cr({ col: s, idx: t }) {
|
|
3571
|
+
const a = c((o) => {
|
|
3581
3572
|
var d;
|
|
3582
3573
|
return (d = o.card) == null ? void 0 : d.preferences;
|
|
3583
3574
|
}), n = c(
|
|
@@ -3585,15 +3576,15 @@ function cr({ col: s, idx: a }) {
|
|
|
3585
3576
|
var d;
|
|
3586
3577
|
return (d = o.card.preferences) == null ? void 0 : d.datasetOptions;
|
|
3587
3578
|
}
|
|
3588
|
-
), r = n == null ? void 0 : n.find((o) => o.idx ===
|
|
3579
|
+
), r = n == null ? void 0 : n.find((o) => o.idx === t), { setCardPreferences: m } = c((o) => o.actions);
|
|
3589
3580
|
function i(o) {
|
|
3590
3581
|
if (!r)
|
|
3591
3582
|
m({
|
|
3592
|
-
...
|
|
3583
|
+
...a,
|
|
3593
3584
|
datasetOptions: [
|
|
3594
3585
|
...n || [],
|
|
3595
3586
|
{
|
|
3596
|
-
idx:
|
|
3587
|
+
idx: t,
|
|
3597
3588
|
type: o === "area" ? "line" : o,
|
|
3598
3589
|
fill: o === "area" ? "origin" : ""
|
|
3599
3590
|
}
|
|
@@ -3603,10 +3594,10 @@ function cr({ col: s, idx: a }) {
|
|
|
3603
3594
|
const d = { ...r };
|
|
3604
3595
|
d.type = o === "area" ? "line" : o, d.fill = o === "area" ? "origin" : "";
|
|
3605
3596
|
const p = n == null ? void 0 : n.map(
|
|
3606
|
-
(x) => x.idx ===
|
|
3597
|
+
(x) => x.idx === t ? d : x
|
|
3607
3598
|
);
|
|
3608
3599
|
m({
|
|
3609
|
-
...
|
|
3600
|
+
...a,
|
|
3610
3601
|
datasetOptions: p
|
|
3611
3602
|
});
|
|
3612
3603
|
}
|
|
@@ -3642,35 +3633,35 @@ function cr({ col: s, idx: a }) {
|
|
|
3642
3633
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
3643
3634
|
}
|
|
3644
3635
|
),
|
|
3645
|
-
/* @__PURE__ */ e.jsx(or, { idx:
|
|
3636
|
+
/* @__PURE__ */ e.jsx(or, { idx: t })
|
|
3646
3637
|
] })
|
|
3647
3638
|
] });
|
|
3648
3639
|
}
|
|
3649
|
-
function
|
|
3650
|
-
const s = c((g) => g.selectedConnectionId),
|
|
3640
|
+
function Pa() {
|
|
3641
|
+
const s = c((g) => g.selectedConnectionId), t = c((g) => g.selectedDatamodelId), a = c((g) => g.selectedDatabaseName), n = c((g) => g.selectedSchemaName), r = c((g) => g.selectedTableName), m = k((g) => g.dashboard.filters) || [], i = k((g) => g.actions.addFilter), o = k((g) => g.actions.removeFilter), d = k(
|
|
3651
3642
|
(g) => g.actions.removeFilterValue
|
|
3652
3643
|
), { modelItems: p, tableName: x } = Ie();
|
|
3653
3644
|
function b(g, h = "dashboard") {
|
|
3654
3645
|
var V;
|
|
3655
|
-
const u = ue(g.column_name), j = ue(
|
|
3656
|
-
let O =
|
|
3646
|
+
const u = ue(g.column_name), j = ue(a || ""), f = ue(n || ""), v = ue(x);
|
|
3647
|
+
let O = xa(
|
|
3657
3648
|
f,
|
|
3658
3649
|
v
|
|
3659
3650
|
), y = `${O}.${u}`;
|
|
3660
3651
|
const L = (V = p == null ? void 0 : p.find(
|
|
3661
|
-
(
|
|
3652
|
+
(T) => T.id === t
|
|
3662
3653
|
)) == null ? void 0 : V.name;
|
|
3663
|
-
|
|
3654
|
+
t && t !== "none" && (y = `${ys}.${L}.${u}`, O = `${ys}.${L}`);
|
|
3664
3655
|
const E = m == null ? void 0 : m.find(
|
|
3665
|
-
(
|
|
3656
|
+
(T) => T.column === y && T.table === v && (T.database === j || T.database === a)
|
|
3666
3657
|
);
|
|
3667
3658
|
if (E)
|
|
3668
3659
|
d(E.id), o(E.id);
|
|
3669
3660
|
else {
|
|
3670
|
-
const
|
|
3661
|
+
const T = rs();
|
|
3671
3662
|
return x === "api" && s ? (i({
|
|
3672
3663
|
location: h,
|
|
3673
|
-
id:
|
|
3664
|
+
id: T,
|
|
3674
3665
|
//uuidv4(),
|
|
3675
3666
|
column: y,
|
|
3676
3667
|
title: g.column_name,
|
|
@@ -3686,8 +3677,8 @@ function Pt() {
|
|
|
3686
3677
|
u
|
|
3687
3678
|
)
|
|
3688
3679
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
3689
|
-
}),
|
|
3690
|
-
id:
|
|
3680
|
+
}), T) : (i({
|
|
3681
|
+
id: T,
|
|
3691
3682
|
//uuidv4(),
|
|
3692
3683
|
location: h,
|
|
3693
3684
|
column: y,
|
|
@@ -3695,7 +3686,7 @@ function Pt() {
|
|
|
3695
3686
|
title: g.column_name,
|
|
3696
3687
|
dataType: g.data_type,
|
|
3697
3688
|
table: r || "",
|
|
3698
|
-
database:
|
|
3689
|
+
database: a || "",
|
|
3699
3690
|
connectionId: s || "",
|
|
3700
3691
|
operation: "in",
|
|
3701
3692
|
sql: Xs(
|
|
@@ -3704,7 +3695,7 @@ function Pt() {
|
|
|
3704
3695
|
u
|
|
3705
3696
|
)
|
|
3706
3697
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
3707
|
-
}),
|
|
3698
|
+
}), T);
|
|
3708
3699
|
}
|
|
3709
3700
|
}
|
|
3710
3701
|
return { assignFilter: b };
|
|
@@ -3712,55 +3703,55 @@ function Pt() {
|
|
|
3712
3703
|
function dr() {
|
|
3713
3704
|
const s = k(
|
|
3714
3705
|
(o) => o.dashboard.filters
|
|
3715
|
-
),
|
|
3706
|
+
), t = c((o) => o.frame), { setFrame: a } = qs(), { columns: n } = Ie(), { assignFilter: r } = Pa();
|
|
3716
3707
|
function m(o) {
|
|
3717
3708
|
const d = r(o, "frame");
|
|
3718
|
-
|
|
3709
|
+
a({ ...t, filterId: d });
|
|
3719
3710
|
}
|
|
3720
|
-
const i = s == null ? void 0 : s.find((o) => o.id ===
|
|
3711
|
+
const i = s == null ? void 0 : s.find((o) => o.id === t.filterId);
|
|
3721
3712
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3722
3713
|
/* @__PURE__ */ e.jsx(_, { children: "Card Filter" }),
|
|
3723
3714
|
/* @__PURE__ */ e.jsx(hr, { onSelect: m, columns: n }),
|
|
3724
|
-
i && /* @__PURE__ */ e.jsx(
|
|
3715
|
+
i && /* @__PURE__ */ e.jsx(Kt, { filter: i })
|
|
3725
3716
|
] });
|
|
3726
3717
|
}
|
|
3727
3718
|
function hr({
|
|
3728
3719
|
columns: s,
|
|
3729
|
-
onSelect:
|
|
3720
|
+
onSelect: t
|
|
3730
3721
|
}) {
|
|
3731
3722
|
var i;
|
|
3732
|
-
const [
|
|
3733
|
-
return /* @__PURE__ */ e.jsxs(os, { open:
|
|
3723
|
+
const [a, n] = sa.useState(!1), [r, m] = sa.useState("");
|
|
3724
|
+
return /* @__PURE__ */ e.jsxs(os, { open: a, onOpenChange: n, children: [
|
|
3734
3725
|
/* @__PURE__ */ e.jsx(cs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
3735
3726
|
w,
|
|
3736
3727
|
{
|
|
3737
3728
|
size: "sm",
|
|
3738
3729
|
variant: "outline",
|
|
3739
3730
|
role: "combobox",
|
|
3740
|
-
"aria-expanded":
|
|
3731
|
+
"aria-expanded": a,
|
|
3741
3732
|
className: "w-full justify-between font-normal",
|
|
3742
3733
|
children: [
|
|
3743
3734
|
r ? (i = s.find((o) => o.column_name === r)) == null ? void 0 : i.column_name : "Select Column...",
|
|
3744
|
-
/* @__PURE__ */ e.jsx(
|
|
3735
|
+
/* @__PURE__ */ e.jsx(Gt, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
3745
3736
|
]
|
|
3746
3737
|
}
|
|
3747
3738
|
) }),
|
|
3748
|
-
/* @__PURE__ */ e.jsx(ds, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(
|
|
3749
|
-
/* @__PURE__ */ e.jsx(
|
|
3750
|
-
/* @__PURE__ */ e.jsxs(
|
|
3751
|
-
/* @__PURE__ */ e.jsx(
|
|
3752
|
-
/* @__PURE__ */ e.jsx(
|
|
3753
|
-
|
|
3739
|
+
/* @__PURE__ */ e.jsx(ds, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(Jt, { children: [
|
|
3740
|
+
/* @__PURE__ */ e.jsx(Ut, { placeholder: "Search column", className: "h-9" }),
|
|
3741
|
+
/* @__PURE__ */ e.jsxs(Qt, { children: [
|
|
3742
|
+
/* @__PURE__ */ e.jsx(Wt, { children: "No framework found." }),
|
|
3743
|
+
/* @__PURE__ */ e.jsx(Yt, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
|
|
3744
|
+
Zt,
|
|
3754
3745
|
{
|
|
3755
3746
|
value: o.column_name,
|
|
3756
3747
|
onSelect: (d) => {
|
|
3757
3748
|
const p = d === r ? "" : d;
|
|
3758
|
-
m(p), n(!1), p &&
|
|
3749
|
+
m(p), n(!1), p && t(o);
|
|
3759
3750
|
},
|
|
3760
3751
|
children: [
|
|
3761
3752
|
o.column_name,
|
|
3762
3753
|
/* @__PURE__ */ e.jsx(
|
|
3763
|
-
|
|
3754
|
+
va,
|
|
3764
3755
|
{
|
|
3765
3756
|
className: Y(
|
|
3766
3757
|
"ml-auto h-4 w-4",
|
|
@@ -3795,7 +3786,7 @@ function mr({
|
|
|
3795
3786
|
"a",
|
|
3796
3787
|
{
|
|
3797
3788
|
target: "_blank",
|
|
3798
|
-
onClick: (
|
|
3789
|
+
onClick: (t) => t.stopPropagation(),
|
|
3799
3790
|
className: "text-blue-700",
|
|
3800
3791
|
href: "https://docs.semaphor.cloud/concepts/visuals#line-chart",
|
|
3801
3792
|
children: "example"
|
|
@@ -3809,7 +3800,7 @@ function mr({
|
|
|
3809
3800
|
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
3810
3801
|
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 px-2", children: [
|
|
3811
3802
|
/* @__PURE__ */ e.jsx(hs, {}),
|
|
3812
|
-
/* @__PURE__ */ e.jsx($
|
|
3803
|
+
/* @__PURE__ */ e.jsx($a, {})
|
|
3813
3804
|
] })
|
|
3814
3805
|
] }),
|
|
3815
3806
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
@@ -3825,7 +3816,7 @@ function Ps() {
|
|
|
3825
3816
|
var r, m, i;
|
|
3826
3817
|
const s = c(
|
|
3827
3818
|
(o) => o.card.cfg
|
|
3828
|
-
),
|
|
3819
|
+
), t = c((o) => o.actions.setCardCfg), a = c((o) => o.card.type);
|
|
3829
3820
|
function n(o) {
|
|
3830
3821
|
var x;
|
|
3831
3822
|
const d = {
|
|
@@ -3845,12 +3836,12 @@ function Ps() {
|
|
|
3845
3836
|
}
|
|
3846
3837
|
}
|
|
3847
3838
|
};
|
|
3848
|
-
|
|
3839
|
+
t(p), console.log(o);
|
|
3849
3840
|
}
|
|
3850
3841
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3851
3842
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
3852
3843
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
3853
|
-
!["pyramid"].includes(
|
|
3844
|
+
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Ba, {})
|
|
3854
3845
|
] }),
|
|
3855
3846
|
/* @__PURE__ */ e.jsxs(
|
|
3856
3847
|
Oe,
|
|
@@ -3863,9 +3854,9 @@ function Ps() {
|
|
|
3863
3854
|
/* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
3864
3855
|
/* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
|
|
3865
3856
|
/* @__PURE__ */ e.jsx(ee, { value: "none", children: "None" }),
|
|
3866
|
-
|
|
3857
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(ee, { value: "start", children: "Start" }),
|
|
3867
3858
|
/* @__PURE__ */ e.jsx(ee, { value: "center", children: "Center" }),
|
|
3868
|
-
|
|
3859
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(ee, { value: "end", children: "End" })
|
|
3869
3860
|
] }) })
|
|
3870
3861
|
]
|
|
3871
3862
|
}
|
|
@@ -3875,16 +3866,16 @@ function Ps() {
|
|
|
3875
3866
|
function ur({
|
|
3876
3867
|
cardType: s
|
|
3877
3868
|
}) {
|
|
3878
|
-
function a
|
|
3869
|
+
function t(a) {
|
|
3879
3870
|
const n = "SELECT label, [group], x-axis, y-axis, radius FROM table", r = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
3880
3871
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3881
|
-
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children:
|
|
3872
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: a === "bubble" ? n : r }),
|
|
3882
3873
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
3883
3874
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
3884
3875
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
3885
3876
|
/* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
|
|
3886
3877
|
/* @__PURE__ */ e.jsx("li", { children: "y-axis - category" }),
|
|
3887
|
-
|
|
3878
|
+
a === "bubble" && /* @__PURE__ */ e.jsx("li", { children: "radius - number" })
|
|
3888
3879
|
] }),
|
|
3889
3880
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
3890
3881
|
"See ",
|
|
@@ -3905,7 +3896,7 @@ function ur({
|
|
|
3905
3896
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
3906
3897
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
3907
3898
|
/* @__PURE__ */ e.jsx($, { children: `${_s(s)} Chart` }),
|
|
3908
|
-
/* @__PURE__ */ e.jsx(P, { className: "space-y-4 font-mono text-xs", children:
|
|
3899
|
+
/* @__PURE__ */ e.jsx(P, { className: "space-y-4 font-mono text-xs", children: t(s) })
|
|
3909
3900
|
] }),
|
|
3910
3901
|
/* @__PURE__ */ e.jsxs(B, { value: "item-2", children: [
|
|
3911
3902
|
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
@@ -3941,7 +3932,7 @@ const xr = {
|
|
|
3941
3932
|
]
|
|
3942
3933
|
};
|
|
3943
3934
|
function fr() {
|
|
3944
|
-
const s = c((
|
|
3935
|
+
const s = c((t) => t.card.type);
|
|
3945
3936
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
3946
3937
|
/* @__PURE__ */ e.jsx(
|
|
3947
3938
|
Ce,
|
|
@@ -4056,9 +4047,9 @@ function gr(s) {
|
|
|
4056
4047
|
}
|
|
4057
4048
|
function jr() {
|
|
4058
4049
|
var d, p, x, b, g;
|
|
4059
|
-
const s = c((h) => h.card.preferences),
|
|
4050
|
+
const s = c((h) => h.card.preferences), t = c(
|
|
4060
4051
|
(h) => h.actions.setCardPreferences
|
|
4061
|
-
),
|
|
4052
|
+
), a = c(
|
|
4062
4053
|
(h) => h.actions.setNumberFormat
|
|
4063
4054
|
);
|
|
4064
4055
|
c(
|
|
@@ -4088,7 +4079,7 @@ function jr() {
|
|
|
4088
4079
|
}
|
|
4089
4080
|
) || [], i = c(
|
|
4090
4081
|
(h) => h.actions.setColorRanges
|
|
4091
|
-
), o = [...new Set(
|
|
4082
|
+
), o = [...new Set(ea.map((h) => h.currency))];
|
|
4092
4083
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4093
4084
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4094
4085
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4096,7 +4087,7 @@ function jr() {
|
|
|
4096
4087
|
{
|
|
4097
4088
|
checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
|
|
4098
4089
|
onCheckedChange: (h) => {
|
|
4099
|
-
|
|
4090
|
+
t({
|
|
4100
4091
|
...s,
|
|
4101
4092
|
formatNumber: {
|
|
4102
4093
|
...s == null ? void 0 : s.formatNumber,
|
|
@@ -4119,7 +4110,7 @@ function jr() {
|
|
|
4119
4110
|
value: n || "en-US",
|
|
4120
4111
|
onValueChange: (h) => {
|
|
4121
4112
|
var u, j, f;
|
|
4122
|
-
return
|
|
4113
|
+
return a(
|
|
4123
4114
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) || 0,
|
|
4124
4115
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
|
|
4125
4116
|
h || "en-US",
|
|
@@ -4130,7 +4121,7 @@ function jr() {
|
|
|
4130
4121
|
/* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
|
|
4131
4122
|
/* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsxs(Pe, { children: [
|
|
4132
4123
|
/* @__PURE__ */ e.jsx(Le, { children: "Format" }),
|
|
4133
|
-
|
|
4124
|
+
ea.map((h) => /* @__PURE__ */ e.jsx(ee, { value: h.locale, children: h.locale }, h.locale))
|
|
4134
4125
|
] }) })
|
|
4135
4126
|
]
|
|
4136
4127
|
}
|
|
@@ -4144,7 +4135,7 @@ function jr() {
|
|
|
4144
4135
|
value: r || "none",
|
|
4145
4136
|
onValueChange: (h) => {
|
|
4146
4137
|
var u, j, f;
|
|
4147
|
-
return
|
|
4138
|
+
return a(
|
|
4148
4139
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) || 0,
|
|
4149
4140
|
h === "none" ? "" : h,
|
|
4150
4141
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
|
|
@@ -4172,7 +4163,7 @@ function jr() {
|
|
|
4172
4163
|
value: ((b = (x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) == null ? void 0 : b.toString()) || "0",
|
|
4173
4164
|
onValueChange: (h) => {
|
|
4174
4165
|
var u, j, f;
|
|
4175
|
-
return
|
|
4166
|
+
return a(
|
|
4176
4167
|
Number(h),
|
|
4177
4168
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
|
|
4178
4169
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
|
|
@@ -4196,7 +4187,7 @@ function jr() {
|
|
|
4196
4187
|
placeholder: "K, M, B, %",
|
|
4197
4188
|
onChange: (h) => {
|
|
4198
4189
|
var u, j, f;
|
|
4199
|
-
return
|
|
4190
|
+
return a(
|
|
4200
4191
|
((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) || 0,
|
|
4201
4192
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
|
|
4202
4193
|
((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
|
|
@@ -4210,7 +4201,7 @@ function jr() {
|
|
|
4210
4201
|
] }) }),
|
|
4211
4202
|
/* @__PURE__ */ e.jsx(Ke, { className: "my-3" }),
|
|
4212
4203
|
/* @__PURE__ */ e.jsx(
|
|
4213
|
-
|
|
4204
|
+
Xt,
|
|
4214
4205
|
{
|
|
4215
4206
|
colorRanges: m,
|
|
4216
4207
|
setColorRanges: i
|
|
@@ -4252,9 +4243,9 @@ function br() {
|
|
|
4252
4243
|
}
|
|
4253
4244
|
function yr() {
|
|
4254
4245
|
var n;
|
|
4255
|
-
const s = c((r) => r.card.preferences), { setCardPreferences:
|
|
4256
|
-
function
|
|
4257
|
-
|
|
4246
|
+
const s = c((r) => r.card.preferences), { setCardPreferences: t } = c((r) => r.actions);
|
|
4247
|
+
function a(r) {
|
|
4248
|
+
t({
|
|
4258
4249
|
...s,
|
|
4259
4250
|
textVisualOptions: {
|
|
4260
4251
|
...s == null ? void 0 : s.textVisualOptions,
|
|
@@ -4266,7 +4257,7 @@ function yr() {
|
|
|
4266
4257
|
Rs,
|
|
4267
4258
|
{
|
|
4268
4259
|
value: (n = s == null ? void 0 : s.textVisualOptions) != null && n.isDynamicText ? "dynamic" : "static",
|
|
4269
|
-
onValueChange:
|
|
4260
|
+
onValueChange: a,
|
|
4270
4261
|
className: "flex gap-3",
|
|
4271
4262
|
defaultValue: "x",
|
|
4272
4263
|
children: [
|
|
@@ -4284,13 +4275,13 @@ function yr() {
|
|
|
4284
4275
|
}
|
|
4285
4276
|
function ss({
|
|
4286
4277
|
cardType: s,
|
|
4287
|
-
docContent:
|
|
4288
|
-
suffix:
|
|
4278
|
+
docContent: t,
|
|
4279
|
+
suffix: a = "Chart"
|
|
4289
4280
|
}) {
|
|
4290
4281
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ce, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4291
4282
|
/* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
|
|
4292
|
-
/* @__PURE__ */ e.jsx($, { children: `${_s(s)} ${
|
|
4293
|
-
/* @__PURE__ */ e.jsx(P, { children:
|
|
4283
|
+
/* @__PURE__ */ e.jsx($, { children: `${_s(s)} ${a}` }),
|
|
4284
|
+
/* @__PURE__ */ e.jsx(P, { children: t || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
4294
4285
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
4295
4286
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4296
4287
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
@@ -4357,7 +4348,7 @@ function vr() {
|
|
|
4357
4348
|
/* @__PURE__ */ e.jsx($, { children: "Settings" }),
|
|
4358
4349
|
/* @__PURE__ */ e.jsxs(P, { className: "space-y-4 px-2", children: [
|
|
4359
4350
|
/* @__PURE__ */ e.jsx(hs, {}),
|
|
4360
|
-
/* @__PURE__ */ e.jsx($
|
|
4351
|
+
/* @__PURE__ */ e.jsx($a, {})
|
|
4361
4352
|
] })
|
|
4362
4353
|
] }),
|
|
4363
4354
|
/* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
|
|
@@ -4370,10 +4361,10 @@ function Nr({}) {
|
|
|
4370
4361
|
const s = c((n) => {
|
|
4371
4362
|
var r;
|
|
4372
4363
|
return (r = n.card) == null ? void 0 : r.preferences;
|
|
4373
|
-
}),
|
|
4364
|
+
}), t = c(
|
|
4374
4365
|
(n) => n.actions.setCardPreferences
|
|
4375
|
-
),
|
|
4376
|
-
|
|
4366
|
+
), a = (n) => {
|
|
4367
|
+
t({
|
|
4377
4368
|
...s,
|
|
4378
4369
|
allowDownload: n
|
|
4379
4370
|
});
|
|
@@ -4384,7 +4375,7 @@ function Nr({}) {
|
|
|
4384
4375
|
/* @__PURE__ */ e.jsx(P, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ve, {}) })
|
|
4385
4376
|
] }) }),
|
|
4386
4377
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
4387
|
-
/* @__PURE__ */ e.jsx(Ue, { onCheckedChange:
|
|
4378
|
+
/* @__PURE__ */ e.jsx(Ue, { onCheckedChange: a, id: "allow-download" }),
|
|
4388
4379
|
/* @__PURE__ */ e.jsx(
|
|
4389
4380
|
"label",
|
|
4390
4381
|
{
|
|
@@ -4446,37 +4437,37 @@ const Cr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
4446
4437
|
] })
|
|
4447
4438
|
] });
|
|
4448
4439
|
function wr() {
|
|
4449
|
-
const s = c((
|
|
4450
|
-
function a
|
|
4451
|
-
switch (
|
|
4440
|
+
const s = c((a) => a.card.type);
|
|
4441
|
+
function t(a) {
|
|
4442
|
+
switch (a) {
|
|
4452
4443
|
case "stackedBar":
|
|
4453
4444
|
case "stackedLine":
|
|
4454
4445
|
return /* @__PURE__ */ e.jsx(vr, {});
|
|
4455
4446
|
case "pyramid":
|
|
4456
|
-
return /* @__PURE__ */ e.jsx(ss, { docContent: Cr, cardType:
|
|
4447
|
+
return /* @__PURE__ */ e.jsx(ss, { docContent: Cr, cardType: a });
|
|
4457
4448
|
case "kpi":
|
|
4458
4449
|
return /* @__PURE__ */ e.jsx(br, {});
|
|
4459
4450
|
case "line":
|
|
4460
4451
|
case "bar":
|
|
4461
|
-
return /* @__PURE__ */ e.jsx(mr, { cardType:
|
|
4452
|
+
return /* @__PURE__ */ e.jsx(mr, { cardType: a });
|
|
4462
4453
|
case "range":
|
|
4463
|
-
return /* @__PURE__ */ e.jsx(ss, { docContent: Sr, cardType:
|
|
4454
|
+
return /* @__PURE__ */ e.jsx(ss, { docContent: Sr, cardType: a });
|
|
4464
4455
|
case "pie":
|
|
4465
4456
|
case "doughnut":
|
|
4466
4457
|
case "polarArea":
|
|
4467
4458
|
case "radar":
|
|
4468
|
-
return /* @__PURE__ */ e.jsx(ss, { cardType:
|
|
4459
|
+
return /* @__PURE__ */ e.jsx(ss, { cardType: a });
|
|
4469
4460
|
case "bubble":
|
|
4470
4461
|
case "scatter":
|
|
4471
|
-
return /* @__PURE__ */ e.jsx(ur, { cardType:
|
|
4462
|
+
return /* @__PURE__ */ e.jsx(ur, { cardType: a });
|
|
4472
4463
|
case "table":
|
|
4473
|
-
return /* @__PURE__ */ e.jsx(Nr, { cardType:
|
|
4464
|
+
return /* @__PURE__ */ e.jsx(Nr, { cardType: a });
|
|
4474
4465
|
case "text":
|
|
4475
4466
|
return /* @__PURE__ */ e.jsx(
|
|
4476
4467
|
ss,
|
|
4477
4468
|
{
|
|
4478
4469
|
docContent: kr,
|
|
4479
|
-
cardType:
|
|
4470
|
+
cardType: a,
|
|
4480
4471
|
suffix: "Visual"
|
|
4481
4472
|
}
|
|
4482
4473
|
);
|
|
@@ -4484,10 +4475,10 @@ function wr() {
|
|
|
4484
4475
|
return /* @__PURE__ */ e.jsx(fr, {});
|
|
4485
4476
|
}
|
|
4486
4477
|
}
|
|
4487
|
-
return /* @__PURE__ */ e.jsx(Vs, { className: "h-full w-full text-sm", children:
|
|
4478
|
+
return /* @__PURE__ */ e.jsx(Vs, { className: "h-full w-full text-sm", children: t(s) });
|
|
4488
4479
|
}
|
|
4489
4480
|
function zr() {
|
|
4490
|
-
const s = c((
|
|
4481
|
+
const s = c((t) => t.isShowingVisual);
|
|
4491
4482
|
return /* @__PURE__ */ e.jsxs(
|
|
4492
4483
|
Ns,
|
|
4493
4484
|
{
|
|
@@ -4524,41 +4515,41 @@ function zr() {
|
|
|
4524
4515
|
}
|
|
4525
4516
|
) }),
|
|
4526
4517
|
/* @__PURE__ */ e.jsx(Cs, { className: "border" }),
|
|
4527
|
-
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(
|
|
4528
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
4518
|
+
/* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(na, {}) })
|
|
4519
|
+
] }) : /* @__PURE__ */ e.jsx(na, {})
|
|
4529
4520
|
}
|
|
4530
4521
|
)
|
|
4531
4522
|
]
|
|
4532
4523
|
}
|
|
4533
4524
|
);
|
|
4534
4525
|
}
|
|
4535
|
-
function Fr({ authToken: s, onSave:
|
|
4526
|
+
function Fr({ authToken: s, onSave: t, onClose: a }) {
|
|
4536
4527
|
const n = c((i) => i.actions.setOnSave), r = c((i) => i.actions.setOnClose), m = k((i) => i.actions.setAuthToken);
|
|
4537
4528
|
return U(() => {
|
|
4538
|
-
|
|
4539
|
-
}, [
|
|
4529
|
+
t && n(t), a && r(a);
|
|
4530
|
+
}, [t, n, a, r]), U(() => {
|
|
4540
4531
|
s && s.accessToken && m(s);
|
|
4541
4532
|
}, [s, m]), /* @__PURE__ */ e.jsxs(en, { className: "rounded-none", role: "editor-panel", children: [
|
|
4542
|
-
/* @__PURE__ */ e.jsx(sn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(
|
|
4543
|
-
/* @__PURE__ */ e.jsx(
|
|
4533
|
+
/* @__PURE__ */ e.jsx(sn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ma, {}) }),
|
|
4534
|
+
/* @__PURE__ */ e.jsx(an, { children: /* @__PURE__ */ e.jsx(zr, {}) })
|
|
4544
4535
|
] });
|
|
4545
4536
|
}
|
|
4546
4537
|
function Or() {
|
|
4547
4538
|
k((i) => i.selectedCardId);
|
|
4548
|
-
const s = k((i) => i.selectedSheetId), { setIsVisualEditing:
|
|
4539
|
+
const s = k((i) => i.selectedSheetId), { setIsVisualEditing: t } = k((i) => i.actions), a = k((i) => i.isVisualEditing), n = k((i) => i.actions.updateFrame);
|
|
4549
4540
|
function r(i) {
|
|
4550
|
-
s && (n(s, i),
|
|
4541
|
+
s && (n(s, i), t(!1));
|
|
4551
4542
|
}
|
|
4552
4543
|
function m() {
|
|
4553
|
-
|
|
4544
|
+
t(!1);
|
|
4554
4545
|
}
|
|
4555
4546
|
return /* @__PURE__ */ e.jsx(
|
|
4556
4547
|
"div",
|
|
4557
4548
|
{
|
|
4558
4549
|
role: "editor-container",
|
|
4559
4550
|
className: Y("flex grow", {
|
|
4560
|
-
block:
|
|
4561
|
-
hidden: !
|
|
4551
|
+
block: a,
|
|
4552
|
+
hidden: !a
|
|
4562
4553
|
}),
|
|
4563
4554
|
children: /* @__PURE__ */ e.jsx(Fr, { onSave: r, onClose: m })
|
|
4564
4555
|
}
|
|
@@ -4568,14 +4559,14 @@ function Mr() {
|
|
|
4568
4559
|
c((i) => i.selectedConnectionId), c((i) => i.selectedDatamodelId);
|
|
4569
4560
|
const s = c((i) => i.selectedDatabaseName);
|
|
4570
4561
|
c((i) => i.selectedSchemaName);
|
|
4571
|
-
const
|
|
4562
|
+
const t = c((i) => i.selectedTableName), a = k((i) => i.dashboard.filters) || [];
|
|
4572
4563
|
k((i) => i.actions.addFilter), k((i) => i.actions.removeFilter), k(
|
|
4573
4564
|
(i) => i.actions.removeFilterValue
|
|
4574
4565
|
);
|
|
4575
|
-
const { modelItems: n, columns: r } = Ie(), { assignFilter: m } =
|
|
4566
|
+
const { modelItems: n, columns: r } = Ie(), { assignFilter: m } = Pa();
|
|
4576
4567
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: r == null ? void 0 : r.map((i) => {
|
|
4577
|
-
const o =
|
|
4578
|
-
(d) => d.column === ue(i.column_name) && d.table ===
|
|
4568
|
+
const o = a == null ? void 0 : a.find(
|
|
4569
|
+
(d) => d.column === ue(i.column_name) && d.table === t && d.database === s
|
|
4579
4570
|
);
|
|
4580
4571
|
return /* @__PURE__ */ e.jsx(
|
|
4581
4572
|
"div",
|
|
@@ -4588,7 +4579,7 @@ function Mr() {
|
|
|
4588
4579
|
}
|
|
4589
4580
|
),
|
|
4590
4581
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4591
|
-
/* @__PURE__ */ e.jsx(
|
|
4582
|
+
/* @__PURE__ */ e.jsx(Oa, { column: i }),
|
|
4592
4583
|
/* @__PURE__ */ e.jsx("span", { children: i.column_name })
|
|
4593
4584
|
] })
|
|
4594
4585
|
},
|
|
@@ -4597,9 +4588,9 @@ function Mr() {
|
|
|
4597
4588
|
}) });
|
|
4598
4589
|
}
|
|
4599
4590
|
function Tr() {
|
|
4600
|
-
k((
|
|
4591
|
+
k((t) => t.showFilters);
|
|
4601
4592
|
const s = k(
|
|
4602
|
-
(
|
|
4593
|
+
(t) => t.actions.setShowFilters
|
|
4603
4594
|
);
|
|
4604
4595
|
return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
|
|
4605
4596
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
@@ -4615,7 +4606,7 @@ function Tr() {
|
|
|
4615
4606
|
)
|
|
4616
4607
|
] }),
|
|
4617
4608
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
4618
|
-
|
|
4609
|
+
Ma,
|
|
4619
4610
|
{
|
|
4620
4611
|
ColumnsComponent: () => (
|
|
4621
4612
|
// schemaName, tableName, columns
|
|
@@ -4629,25 +4620,25 @@ function Tr() {
|
|
|
4629
4620
|
] });
|
|
4630
4621
|
}
|
|
4631
4622
|
function Dr() {
|
|
4632
|
-
k((
|
|
4633
|
-
const s = k((
|
|
4634
|
-
return k((
|
|
4623
|
+
k((a) => a.dashboard);
|
|
4624
|
+
const s = k((a) => a.showFilters), t = k((a) => a.isVisualEditing);
|
|
4625
|
+
return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
|
|
4635
4626
|
"div",
|
|
4636
4627
|
{
|
|
4637
4628
|
role: "dashboard-plus-main",
|
|
4638
4629
|
className: Y("grow", {
|
|
4639
|
-
hidden:
|
|
4640
|
-
flex: !
|
|
4630
|
+
hidden: t,
|
|
4631
|
+
flex: !t
|
|
4641
4632
|
}),
|
|
4642
4633
|
children: [
|
|
4643
|
-
/* @__PURE__ */ e.jsx(
|
|
4634
|
+
/* @__PURE__ */ e.jsx(tn, {}),
|
|
4644
4635
|
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(Tr, {}) })
|
|
4645
4636
|
]
|
|
4646
4637
|
}
|
|
4647
4638
|
);
|
|
4648
4639
|
}
|
|
4649
4640
|
function Ar() {
|
|
4650
|
-
const s = k((n) => n.dashboard),
|
|
4641
|
+
const s = k((n) => n.dashboard), t = k((n) => n.actions.setDashboard), a = k(
|
|
4651
4642
|
(n) => n.showDashboardJSON
|
|
4652
4643
|
);
|
|
4653
4644
|
return k(
|
|
@@ -4656,7 +4647,7 @@ function Ar() {
|
|
|
4656
4647
|
"div",
|
|
4657
4648
|
{
|
|
4658
4649
|
className: Y(" p-2", {
|
|
4659
|
-
hidden: !
|
|
4650
|
+
hidden: !a
|
|
4660
4651
|
}),
|
|
4661
4652
|
children: /* @__PURE__ */ e.jsx(
|
|
4662
4653
|
nn,
|
|
@@ -4664,7 +4655,7 @@ function Ar() {
|
|
|
4664
4655
|
onChange: (n) => {
|
|
4665
4656
|
if (n)
|
|
4666
4657
|
try {
|
|
4667
|
-
JSON.parse(n),
|
|
4658
|
+
JSON.parse(n), t(JSON.parse(n));
|
|
4668
4659
|
} catch {
|
|
4669
4660
|
}
|
|
4670
4661
|
},
|
|
@@ -4692,14 +4683,14 @@ function Ar() {
|
|
|
4692
4683
|
}
|
|
4693
4684
|
function Ir({
|
|
4694
4685
|
showControls: s = !1,
|
|
4695
|
-
showFooter:
|
|
4696
|
-
...
|
|
4686
|
+
showFooter: t = !0,
|
|
4687
|
+
...a
|
|
4697
4688
|
}) {
|
|
4698
|
-
return /* @__PURE__ */ e.jsxs(rn, { dashboardProps:
|
|
4689
|
+
return /* @__PURE__ */ e.jsxs(rn, { dashboardProps: a, children: [
|
|
4699
4690
|
/* @__PURE__ */ e.jsx(ln, {}),
|
|
4700
4691
|
/* @__PURE__ */ e.jsxs(on, { children: [
|
|
4701
4692
|
/* @__PURE__ */ e.jsx(Ar, {}),
|
|
4702
|
-
/* @__PURE__ */ e.jsxs(cn, { ...
|
|
4693
|
+
/* @__PURE__ */ e.jsxs(cn, { ...a, children: [
|
|
4703
4694
|
s && /* @__PURE__ */ e.jsx(Vn, {}),
|
|
4704
4695
|
/* @__PURE__ */ e.jsx(Or, {}),
|
|
4705
4696
|
/* @__PURE__ */ e.jsx(Dr, {})
|