drizzle-cube 0.2.0 → 0.2.1
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/client/charts.js +11 -11
- package/dist/client/chunks/{chart-activitygridchart-BRk9BNnp.js → chart-activitygridchart-B5OqLgbD.js} +7 -7
- package/dist/client/chunks/{chart-activitygridchart-BRk9BNnp.js.map → chart-activitygridchart-B5OqLgbD.js.map} +1 -1
- package/dist/client/chunks/{chart-areachart-Beu8sO9v.js → chart-areachart-CTzUpR0_.js} +3 -3
- package/dist/client/chunks/{chart-areachart-Beu8sO9v.js.map → chart-areachart-CTzUpR0_.js.map} +1 -1
- package/dist/client/chunks/{chart-barchart-BzoejYkT.js → chart-barchart-CKF8FnMs.js} +4 -4
- package/dist/client/chunks/{chart-barchart-BzoejYkT.js.map → chart-barchart-CKF8FnMs.js.map} +1 -1
- package/dist/client/chunks/{chart-bubblechart-Dg7sT_Mm.js → chart-bubblechart-5Z0hPYwn.js} +2 -2
- package/dist/client/chunks/{chart-bubblechart-Dg7sT_Mm.js.map → chart-bubblechart-5Z0hPYwn.js.map} +1 -1
- package/dist/client/chunks/{chart-charttooltip-NrFVM1cJ.js → chart-charttooltip-CqtjUW2V.js} +2 -2
- package/dist/client/chunks/{chart-charttooltip-NrFVM1cJ.js.map → chart-charttooltip-CqtjUW2V.js.map} +1 -1
- package/dist/client/chunks/{chart-datatable-BvV7gLPZ.js → chart-datatable-uFzkh18f.js} +2 -2
- package/dist/client/chunks/{chart-datatable-BvV7gLPZ.js.map → chart-datatable-uFzkh18f.js.map} +1 -1
- package/dist/client/chunks/{chart-kpidelta-p1lVVG5v.js → chart-kpidelta-B1zg2dTx.js} +2 -2
- package/dist/client/chunks/{chart-kpidelta-p1lVVG5v.js.map → chart-kpidelta-B1zg2dTx.js.map} +1 -1
- package/dist/client/chunks/{chart-kpinumber-BFtxFeqq.js → chart-kpinumber-CHcSqthc.js} +4 -4
- package/dist/client/chunks/{chart-kpinumber-BFtxFeqq.js.map → chart-kpinumber-CHcSqthc.js.map} +1 -1
- package/dist/client/chunks/{chart-kpitext-CX1s1u8B.js → chart-kpitext-BrapZkRe.js} +3 -3
- package/dist/client/chunks/{chart-kpitext-CX1s1u8B.js.map → chart-kpitext-BrapZkRe.js.map} +1 -1
- package/dist/client/chunks/{chart-linechart-Dgb10zbj.js → chart-linechart-DqZU4vH8.js} +4 -4
- package/dist/client/chunks/{chart-linechart-Dgb10zbj.js.map → chart-linechart-DqZU4vH8.js.map} +1 -1
- package/dist/client/chunks/{chart-piechart-B-0BQh-d.js → chart-piechart-Dsxs70px.js} +3 -3
- package/dist/client/chunks/{chart-piechart-B-0BQh-d.js.map → chart-piechart-Dsxs70px.js.map} +1 -1
- package/dist/client/chunks/{chart-radarchart-BwZM1yTd.js → chart-radarchart-2qnrlYCv.js} +3 -3
- package/dist/client/chunks/{chart-radarchart-BwZM1yTd.js.map → chart-radarchart-2qnrlYCv.js.map} +1 -1
- package/dist/client/chunks/{chart-radialbarchart-CythI1zx.js → chart-radialbarchart-DPi9fYc7.js} +3 -3
- package/dist/client/chunks/{chart-radialbarchart-CythI1zx.js.map → chart-radialbarchart-DPi9fYc7.js.map} +1 -1
- package/dist/client/chunks/{chart-scatterchart-om9-qmtE.js → chart-scatterchart-DNleJCr4.js} +2 -2
- package/dist/client/chunks/{chart-scatterchart-om9-qmtE.js.map → chart-scatterchart-DNleJCr4.js.map} +1 -1
- package/dist/client/chunks/{chart-treemapchart-Dc35Miif.js → chart-treemapchart-B2-Qr28e.js} +3 -3
- package/dist/client/chunks/{chart-treemapchart-Dc35Miif.js.map → chart-treemapchart-B2-Qr28e.js.map} +1 -1
- package/dist/client/chunks/{charts-DL9XOlaK.js → charts-BmpuCBGG.js} +25 -25
- package/dist/client/chunks/{charts-DL9XOlaK.js.map → charts-BmpuCBGG.js.map} +1 -1
- package/dist/client/chunks/{index-DpEuGmcW.js → index-EfJ-vN-5.js} +2 -2
- package/dist/client/chunks/{index-DpEuGmcW.js.map → index-EfJ-vN-5.js.map} +1 -1
- package/dist/client/components.js +1 -1
- package/dist/client/hooks.js +9 -9
- package/dist/client/index.js +748 -748
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.d.ts +1 -0
- package/dist/client/providers.js +8 -4
- package/dist/client/providers.js.map +1 -1
- package/dist/client-bundle-stats.html +1 -1
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { L as
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
4
|
-
import { u as kt } from "./chunks/chart-activitygridchart-
|
|
5
|
-
import {
|
|
1
|
+
import { L as mr } from "./chunks/chart-chartcontainer-CdwzIKP1.js";
|
|
2
|
+
import { u as fr, i as Ht, L as ft, g as Gt } from "./chunks/charts-BmpuCBGG.js";
|
|
3
|
+
import { c as _a, f as Ia, b as ja, p as Qa, a as Ba } from "./chunks/charts-BmpuCBGG.js";
|
|
4
|
+
import { u as kt } from "./chunks/chart-activitygridchart-B5OqLgbD.js";
|
|
5
|
+
import { y as Ua, T as Ja, E as Ha, A as Ga, g as Wa, B as Ya, H as Ka, F as Xa, G as Za, D as en, w as tn } from "./chunks/chart-activitygridchart-B5OqLgbD.js";
|
|
6
|
+
import { useScrollContainer as hr, ScrollContainerProvider as Wt } from "./providers.js";
|
|
6
7
|
import { useCubeQuery as pr, useDebounce as xr, useFilterValues as br, useResponsiveDashboard as gr } from "./hooks.js";
|
|
7
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
8
|
+
import { jsxs as r, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
8
9
|
import * as Pe from "react";
|
|
9
|
-
import Ie, {
|
|
10
|
-
import { F as Ge, q as
|
|
11
|
-
import
|
|
12
|
-
import { barChartConfig as
|
|
13
|
-
import { lineChartConfig as
|
|
14
|
-
import { areaChartConfig as
|
|
15
|
-
import { pieChartConfig as
|
|
16
|
-
import { scatterChartConfig as
|
|
17
|
-
import { bubbleChartConfig as
|
|
18
|
-
import { radarChartConfig as
|
|
19
|
-
import { radialBarChartConfig as
|
|
20
|
-
import { treemapChartConfig as
|
|
21
|
-
import { dataTableConfig as
|
|
22
|
-
import { activityGridChartConfig as
|
|
23
|
-
import { kpiNumberConfig as
|
|
24
|
-
import { kpiDeltaConfig as
|
|
25
|
-
import { kpiTextConfig as
|
|
26
|
-
import { markdownConfig as
|
|
27
|
-
var yt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new WeakMap(), Lt = 0,
|
|
28
|
-
function
|
|
10
|
+
import Ie, { Component as yr, forwardRef as Yt, useState as q, useRef as fe, useEffect as se, useMemo as ye, useImperativeHandle as Kt, useCallback as B, Suspense as vr, lazy as Nr } from "react";
|
|
11
|
+
import { F as Ge, q as wr, r as Cr, s as kr, t as Sr, u as Dr, v as Tr, w as Ar, x as Rr, y as Er, z as Xt, A as Ue, B as rt, C as Fr, D as $r, E as be, G as Et, H as Je, J as Be, K as ht, L as ge, M as we, N as Or, O as De, P as pt, Q as Lr, R as xt, S as Oe, T as Vr, U as Pr, V as Ft, W as bt, X as Mr, Y as $t, Z as Ke, _ as Zt, $ as Le, a0 as qr, a1 as _r, a2 as St, a3 as Ot, a4 as He, a5 as Ir, a6 as st, a7 as jr, a8 as Qr, a9 as Br, aa as gt, ab as zr, ac as Ur } from "./chunks/icons-D-n_woAP.js";
|
|
12
|
+
import Jr from "react-grid-layout";
|
|
13
|
+
import { barChartConfig as Hr } from "./chunks/chart-barchart-config-DxatOnVV.js";
|
|
14
|
+
import { lineChartConfig as Gr } from "./chunks/chart-linechart-config-BS1qVC8K.js";
|
|
15
|
+
import { areaChartConfig as Wr } from "./chunks/chart-areachart-config-InZgxubz.js";
|
|
16
|
+
import { pieChartConfig as Yr } from "./chunks/chart-piechart-config-6ZK8XaSX.js";
|
|
17
|
+
import { scatterChartConfig as Kr } from "./chunks/chart-scatterchart-config-DgYa-5vm.js";
|
|
18
|
+
import { bubbleChartConfig as Xr } from "./chunks/chart-bubblechart-config-CcZTMTCx.js";
|
|
19
|
+
import { radarChartConfig as Zr } from "./chunks/chart-radarchart-config-CCWOkkwO.js";
|
|
20
|
+
import { radialBarChartConfig as es } from "./chunks/chart-radialbarchart-config-DicXYrMW.js";
|
|
21
|
+
import { treemapChartConfig as ts } from "./chunks/chart-treemapchart-config-DGhteyBe.js";
|
|
22
|
+
import { dataTableConfig as rs } from "./chunks/chart-datatable-config-D7mojhYA.js";
|
|
23
|
+
import { activityGridChartConfig as ss } from "./chunks/chart-activitygridchart-config-D9CgNH02.js";
|
|
24
|
+
import { kpiNumberConfig as as } from "./chunks/chart-kpinumber-config-T39g03ud.js";
|
|
25
|
+
import { kpiDeltaConfig as ns } from "./chunks/chart-kpidelta-config-icJXuFxe.js";
|
|
26
|
+
import { kpiTextConfig as ls } from "./chunks/chart-kpitext-config-BbJGXAVk.js";
|
|
27
|
+
import { markdownConfig as is } from "./chunks/chart-markdownchart-config-DMCD8phf.js";
|
|
28
|
+
var yt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new WeakMap(), Lt = 0, os;
|
|
29
|
+
function ds(t) {
|
|
29
30
|
return t ? (Xe.has(t) || (Lt += 1, Xe.set(t, Lt.toString())), Xe.get(t)) : "0";
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function cs(t) {
|
|
32
33
|
return Object.keys(t).sort().filter(
|
|
33
34
|
(s) => t[s] !== void 0
|
|
34
|
-
).map((s) => `${s}_${s === "root" ?
|
|
35
|
+
).map((s) => `${s}_${s === "root" ? ds(t.root) : t[s]}`).toString();
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const s =
|
|
38
|
-
let
|
|
39
|
-
if (!
|
|
37
|
+
function us(t) {
|
|
38
|
+
const s = cs(t);
|
|
39
|
+
let a = yt.get(s);
|
|
40
|
+
if (!a) {
|
|
40
41
|
const i = /* @__PURE__ */ new Map();
|
|
41
42
|
let u;
|
|
42
43
|
const d = new IntersectionObserver((f) => {
|
|
@@ -48,21 +49,21 @@ function fs(t) {
|
|
|
48
49
|
});
|
|
49
50
|
});
|
|
50
51
|
}, t);
|
|
51
|
-
u = d.thresholds || (Array.isArray(t.threshold) ? t.threshold : [t.threshold || 0]),
|
|
52
|
+
u = d.thresholds || (Array.isArray(t.threshold) ? t.threshold : [t.threshold || 0]), a = {
|
|
52
53
|
id: s,
|
|
53
54
|
observer: d,
|
|
54
55
|
elements: i
|
|
55
|
-
}, yt.set(s,
|
|
56
|
+
}, yt.set(s, a);
|
|
56
57
|
}
|
|
57
|
-
return
|
|
58
|
+
return a;
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function ms(t, s, a = {}, i = os) {
|
|
60
61
|
if (typeof window.IntersectionObserver > "u" && i !== void 0) {
|
|
61
62
|
const o = t.getBoundingClientRect();
|
|
62
63
|
return s(i, {
|
|
63
64
|
isIntersecting: i,
|
|
64
65
|
target: t,
|
|
65
|
-
intersectionRatio: typeof
|
|
66
|
+
intersectionRatio: typeof a.threshold == "number" ? a.threshold : 0,
|
|
66
67
|
time: 0,
|
|
67
68
|
boundingClientRect: o,
|
|
68
69
|
intersectionRect: o,
|
|
@@ -70,15 +71,15 @@ function hs(t, s, n = {}, i = cs) {
|
|
|
70
71
|
}), () => {
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
|
-
const { id: u, observer: d, elements: f } =
|
|
74
|
+
const { id: u, observer: d, elements: f } = us(a), g = f.get(t) || [];
|
|
74
75
|
return f.has(t) || f.set(t, g), g.push(s), d.observe(t), function() {
|
|
75
76
|
g.splice(g.indexOf(s), 1), g.length === 0 && (f.delete(t), d.unobserve(t)), f.size === 0 && (d.disconnect(), yt.delete(u));
|
|
76
77
|
};
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function fs({
|
|
79
80
|
threshold: t,
|
|
80
81
|
delay: s,
|
|
81
|
-
trackVisibility:
|
|
82
|
+
trackVisibility: a,
|
|
82
83
|
rootMargin: i,
|
|
83
84
|
root: u,
|
|
84
85
|
triggerOnce: d,
|
|
@@ -96,21 +97,21 @@ function ps({
|
|
|
96
97
|
() => {
|
|
97
98
|
if (x.current === void 0 && (x.current = g), f || !h) return;
|
|
98
99
|
let R;
|
|
99
|
-
return R =
|
|
100
|
+
return R = ms(
|
|
100
101
|
h,
|
|
101
|
-
(L,
|
|
102
|
+
(L, n) => {
|
|
102
103
|
const b = x.current;
|
|
103
104
|
x.current = L, !(b === void 0 && !L) && (S({
|
|
104
105
|
inView: L,
|
|
105
|
-
entry:
|
|
106
|
-
}), k.current && k.current(L,
|
|
106
|
+
entry: n
|
|
107
|
+
}), k.current && k.current(L, n), n.isIntersecting && d && R && (R(), R = void 0));
|
|
107
108
|
},
|
|
108
109
|
{
|
|
109
110
|
root: u,
|
|
110
111
|
rootMargin: i,
|
|
111
112
|
threshold: t,
|
|
112
113
|
// @ts-expect-error
|
|
113
|
-
trackVisibility:
|
|
114
|
+
trackVisibility: a,
|
|
114
115
|
delay: s
|
|
115
116
|
},
|
|
116
117
|
o
|
|
@@ -128,7 +129,7 @@ function ps({
|
|
|
128
129
|
i,
|
|
129
130
|
d,
|
|
130
131
|
f,
|
|
131
|
-
|
|
132
|
+
a,
|
|
132
133
|
o,
|
|
133
134
|
s
|
|
134
135
|
]
|
|
@@ -141,8 +142,7 @@ function ps({
|
|
|
141
142
|
const V = [l, D.inView, D.entry];
|
|
142
143
|
return V.ref = V[0], V.inView = V[1], V.entry = V[2], V;
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
class bs extends Nr {
|
|
145
|
+
class hs extends yr {
|
|
146
146
|
constructor(s) {
|
|
147
147
|
super(s), this.state = {
|
|
148
148
|
hasError: !1,
|
|
@@ -157,11 +157,11 @@ class bs extends Nr {
|
|
|
157
157
|
errorInfo: null
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
componentDidCatch(s,
|
|
160
|
+
componentDidCatch(s, a) {
|
|
161
161
|
this.setState({
|
|
162
162
|
error: s,
|
|
163
|
-
errorInfo:
|
|
164
|
-
}), console.error("Chart Error Boundary caught a rendering error:", s,
|
|
163
|
+
errorInfo: a.componentStack || null
|
|
164
|
+
}), console.error("Chart Error Boundary caught a rendering error:", s, a);
|
|
165
165
|
}
|
|
166
166
|
handleReset = () => {
|
|
167
167
|
this.setState({
|
|
@@ -237,47 +237,47 @@ class bs extends Nr {
|
|
|
237
237
|
) : this.props.children;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function er(t) {
|
|
241
241
|
if ("member" in t && "operator" in t) {
|
|
242
242
|
const s = t;
|
|
243
243
|
return ["set", "notSet", "isEmpty", "isNotEmpty"].includes(s.operator) || s.operator === "inDateRange" && s.dateRange ? !0 : !!(s.values && s.values.length > 0);
|
|
244
244
|
}
|
|
245
|
-
return "type" in t && "filters" in t ? t.filters.filter((i) =>
|
|
245
|
+
return "type" in t && "filters" in t ? t.filters.filter((i) => er(i)).length > 0 : !1;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return !t || !t.length ? [] : !s || !s.length ? [] : t.filter((
|
|
247
|
+
function ps(t, s) {
|
|
248
|
+
return !t || !t.length ? [] : !s || !s.length ? [] : t.filter((a) => s.includes(a.id)).filter((a) => er(a.filter)).map((a) => a.filter);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function tr(t) {
|
|
251
251
|
if ("type" in t && "filters" in t) {
|
|
252
|
-
const s = t,
|
|
253
|
-
return s.type === "and" ? { and:
|
|
252
|
+
const s = t, a = s.filters.map(tr);
|
|
253
|
+
return s.type === "and" ? { and: a } : { or: a };
|
|
254
254
|
}
|
|
255
255
|
return t;
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function xs(t, s) {
|
|
258
258
|
return !t || t.length === 0 ? s : !s || s.length === 0 ? t : [{
|
|
259
|
-
and: [...t, ...s].map(
|
|
259
|
+
and: [...t, ...s].map(tr)
|
|
260
260
|
}];
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
const s = /* @__PURE__ */ new Set(),
|
|
262
|
+
function bs(t) {
|
|
263
|
+
const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
264
264
|
return t.portlets.forEach((u) => {
|
|
265
265
|
try {
|
|
266
266
|
const d = JSON.parse(u.query);
|
|
267
|
-
d.measures && Array.isArray(d.measures) && d.measures.forEach((f) => s.add(f)), d.dimensions && Array.isArray(d.dimensions) && d.dimensions.forEach((f) =>
|
|
267
|
+
d.measures && Array.isArray(d.measures) && d.measures.forEach((f) => s.add(f)), d.dimensions && Array.isArray(d.dimensions) && d.dimensions.forEach((f) => a.add(f)), d.timeDimensions && Array.isArray(d.timeDimensions) && d.timeDimensions.forEach((f) => {
|
|
268
268
|
f.dimension && i.add(f.dimension);
|
|
269
|
-
}), d.filters &&
|
|
270
|
-
|
|
269
|
+
}), d.filters && rr(d.filters).forEach((f) => {
|
|
270
|
+
a.add(f);
|
|
271
271
|
});
|
|
272
272
|
} catch (d) {
|
|
273
273
|
console.warn("Failed to parse portlet query:", u.id, d);
|
|
274
274
|
}
|
|
275
|
-
}), { measures: s, dimensions:
|
|
275
|
+
}), { measures: s, dimensions: a, timeDimensions: i };
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function rr(t) {
|
|
278
278
|
const s = [];
|
|
279
|
-
return t.forEach((
|
|
280
|
-
"member" in
|
|
279
|
+
return t.forEach((a) => {
|
|
280
|
+
"member" in a ? s.push(a.member) : "type" in a && "filters" in a && s.push(...rr(a.filters));
|
|
281
281
|
}), [...new Set(s)];
|
|
282
282
|
}
|
|
283
283
|
function Vt(t) {
|
|
@@ -286,26 +286,26 @@ function Vt(t) {
|
|
|
286
286
|
if (t.values && t.values.length > 0)
|
|
287
287
|
return t.values.length === 1 ? t.values[0] : t.values;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
if (!
|
|
291
|
-
return
|
|
289
|
+
function gs(t, s, a) {
|
|
290
|
+
if (!a || a.length === 0 || !s || s.length === 0)
|
|
291
|
+
return a;
|
|
292
292
|
const i = t?.filter((g) => g.isUniversalTime && s.includes(g.id))?.filter((g) => {
|
|
293
293
|
if (!("member" in g.filter)) return !1;
|
|
294
294
|
const o = g.filter;
|
|
295
295
|
return Vt(o) !== void 0;
|
|
296
296
|
});
|
|
297
297
|
if (!i || i.length === 0)
|
|
298
|
-
return
|
|
298
|
+
return a;
|
|
299
299
|
const d = i[0].filter, f = Vt(d);
|
|
300
|
-
return
|
|
300
|
+
return a.map((g) => ({
|
|
301
301
|
...g,
|
|
302
302
|
dateRange: f
|
|
303
303
|
}));
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const nt = Yt(({
|
|
306
306
|
query: t,
|
|
307
307
|
chartType: s,
|
|
308
|
-
chartConfig:
|
|
308
|
+
chartConfig: a,
|
|
309
309
|
displayConfig: i,
|
|
310
310
|
dashboardFilters: u,
|
|
311
311
|
dashboardFilterMapping: d,
|
|
@@ -318,7 +318,7 @@ const at = Wt(({
|
|
|
318
318
|
loadingComponent: h,
|
|
319
319
|
onDebugDataReady: l
|
|
320
320
|
}, k) => {
|
|
321
|
-
const [x, D] = q(0), S = fe(l), O =
|
|
321
|
+
const [x, D] = q(0), S = fe(l), O = hr(), { ref: $, inView: V } = fs({
|
|
322
322
|
root: O,
|
|
323
323
|
rootMargin: "200px",
|
|
324
324
|
// Start loading 200px before entering viewport
|
|
@@ -332,11 +332,11 @@ const at = Wt(({
|
|
|
332
332
|
se(() => {
|
|
333
333
|
S.current = l;
|
|
334
334
|
}, [l]);
|
|
335
|
-
const { config: L } =
|
|
336
|
-
if (
|
|
335
|
+
const { config: L } = fr(s), n = L.skipQuery === !0, b = ye(() => {
|
|
336
|
+
if (n)
|
|
337
337
|
return null;
|
|
338
338
|
try {
|
|
339
|
-
const C = JSON.parse(t), I = u?.filter((oe) => !oe.isUniversalTime), U =
|
|
339
|
+
const C = JSON.parse(t), I = u?.filter((oe) => !oe.isUniversalTime), U = ps(I, d), J = xs(U, C.filters), te = gs(
|
|
340
340
|
u,
|
|
341
341
|
d,
|
|
342
342
|
C.timeDimensions
|
|
@@ -350,16 +350,16 @@ const at = Wt(({
|
|
|
350
350
|
} catch (C) {
|
|
351
351
|
return console.error("AnalyticsPortlet: Invalid query JSON:", C), null;
|
|
352
352
|
}
|
|
353
|
-
}, [t, x,
|
|
353
|
+
}, [t, x, n, u, d]), p = !b || n || !f && !R, { resultSet: N, isLoading: E, error: T } = pr(b, {
|
|
354
354
|
skip: p,
|
|
355
355
|
resetResultSetOnChange: !0
|
|
356
356
|
});
|
|
357
|
-
|
|
357
|
+
Kt(k, () => ({
|
|
358
358
|
refresh: () => {
|
|
359
359
|
D((C) => C + 1);
|
|
360
360
|
}
|
|
361
361
|
}), []), se(() => {
|
|
362
|
-
if (S.current &&
|
|
362
|
+
if (S.current && a && b && N && !T) {
|
|
363
363
|
const I = (() => {
|
|
364
364
|
switch (s) {
|
|
365
365
|
case "pie":
|
|
@@ -370,28 +370,28 @@ const at = Wt(({
|
|
|
370
370
|
}
|
|
371
371
|
})();
|
|
372
372
|
I && S.current({
|
|
373
|
-
chartConfig:
|
|
373
|
+
chartConfig: a || {},
|
|
374
374
|
displayConfig: i || {},
|
|
375
375
|
queryObject: b,
|
|
376
376
|
data: I,
|
|
377
377
|
chartType: s
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
|
-
}, [
|
|
381
|
-
const z = !
|
|
382
|
-
if (!
|
|
380
|
+
}, [a, i, b, N, s, T]);
|
|
381
|
+
const z = !n && L.dropZones.some((C) => C.mandatory === !0);
|
|
382
|
+
if (!a && z)
|
|
383
383
|
return /* @__PURE__ */ e("div", { ref: $, className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: o }, children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
384
384
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold mb-1", children: "Configuration Required" }),
|
|
385
385
|
/* @__PURE__ */ e("div", { className: "text-xs text-dc-text-secondary", children: "Please configure this chart" })
|
|
386
386
|
] }) });
|
|
387
|
-
if (!
|
|
387
|
+
if (!n && !f && !R)
|
|
388
388
|
return /* @__PURE__ */ e("div", { ref: $, className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: o }, children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
389
389
|
/* @__PURE__ */ e("div", { className: "w-8 h-8 mx-auto mb-2 rounded-full bg-dc-surface-secondary animate-pulse" }),
|
|
390
390
|
/* @__PURE__ */ e("div", { className: "text-xs text-dc-text-secondary", children: "Scroll to load" })
|
|
391
391
|
] }) });
|
|
392
|
-
if (!
|
|
392
|
+
if (!n) {
|
|
393
393
|
if (E || b && !N && !T)
|
|
394
|
-
return /* @__PURE__ */ e("div", { ref: $, className: "flex items-center justify-center w-full", style: { height: o }, children: h || /* @__PURE__ */ e(
|
|
394
|
+
return /* @__PURE__ */ e("div", { ref: $, className: "flex items-center justify-center w-full", style: { height: o }, children: h || /* @__PURE__ */ e(mr, { size: "md" }) });
|
|
395
395
|
if (T)
|
|
396
396
|
return /* @__PURE__ */ r("div", { ref: $, className: "p-4 border rounded-sm", style: { height: o, borderColor: "var(--dc-border)", backgroundColor: "var(--dc-surface)" }, children: [
|
|
397
397
|
/* @__PURE__ */ e("div", { className: "mb-2", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
@@ -416,7 +416,7 @@ const at = Wt(({
|
|
|
416
416
|
/* @__PURE__ */ e("summary", { className: "cursor-pointer font-medium", style: { color: "var(--dc-text-secondary)" }, children: "Chart Config" }),
|
|
417
417
|
/* @__PURE__ */ e("pre", { className: "mt-1 p-2 rounded-sm text-xs overflow-auto max-h-20", style: { backgroundColor: "rgba(var(--dc-primary-rgb), 0.05)" }, children: JSON.stringify({
|
|
418
418
|
chartType: s,
|
|
419
|
-
chartConfig:
|
|
419
|
+
chartConfig: a,
|
|
420
420
|
displayConfig: i
|
|
421
421
|
}, null, 2) })
|
|
422
422
|
] })
|
|
@@ -429,7 +429,7 @@ const at = Wt(({
|
|
|
429
429
|
] }) });
|
|
430
430
|
}
|
|
431
431
|
const y = (() => {
|
|
432
|
-
if (
|
|
432
|
+
if (n)
|
|
433
433
|
return [];
|
|
434
434
|
if (!N)
|
|
435
435
|
return [];
|
|
@@ -442,12 +442,12 @@ const at = Wt(({
|
|
|
442
442
|
}
|
|
443
443
|
})();
|
|
444
444
|
return /* @__PURE__ */ e("div", { ref: $, className: "w-full h-full", children: /* @__PURE__ */ e(
|
|
445
|
-
|
|
445
|
+
hs,
|
|
446
446
|
{
|
|
447
447
|
portletTitle: m,
|
|
448
448
|
portletConfig: {
|
|
449
449
|
chartType: s,
|
|
450
|
-
chartConfig:
|
|
450
|
+
chartConfig: a,
|
|
451
451
|
displayConfig: i,
|
|
452
452
|
height: o
|
|
453
453
|
},
|
|
@@ -460,7 +460,7 @@ const at = Wt(({
|
|
|
460
460
|
{
|
|
461
461
|
chartType: s,
|
|
462
462
|
data: s === "markdown" ? [] : y,
|
|
463
|
-
chartConfig:
|
|
463
|
+
chartConfig: a,
|
|
464
464
|
displayConfig: i,
|
|
465
465
|
queryObject: b ?? void 0,
|
|
466
466
|
height: C,
|
|
@@ -488,11 +488,11 @@ const at = Wt(({
|
|
|
488
488
|
}
|
|
489
489
|
) });
|
|
490
490
|
});
|
|
491
|
-
|
|
491
|
+
nt.displayName = "AnalyticsPortlet";
|
|
492
492
|
const lt = ({
|
|
493
493
|
isOpen: t,
|
|
494
494
|
onClose: s,
|
|
495
|
-
title:
|
|
495
|
+
title: a,
|
|
496
496
|
size: i = "md",
|
|
497
497
|
closeOnBackdropClick: u = !0,
|
|
498
498
|
closeOnEscape: d = !0,
|
|
@@ -542,10 +542,10 @@ const lt = ({
|
|
|
542
542
|
onClick: (l) => l.stopPropagation(),
|
|
543
543
|
role: "dialog",
|
|
544
544
|
"aria-modal": "true",
|
|
545
|
-
"aria-labelledby":
|
|
545
|
+
"aria-labelledby": a ? "modal-title" : void 0,
|
|
546
546
|
children: [
|
|
547
|
-
(
|
|
548
|
-
|
|
547
|
+
(a || f) && /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-6 py-4 border-b border-dc-border", children: [
|
|
548
|
+
a && /* @__PURE__ */ e("h2", { id: "modal-title", className: "text-xl font-semibold text-dc-text", children: a }),
|
|
549
549
|
f && /* @__PURE__ */ e(
|
|
550
550
|
"button",
|
|
551
551
|
{
|
|
@@ -566,30 +566,30 @@ const lt = ({
|
|
|
566
566
|
) : null;
|
|
567
567
|
};
|
|
568
568
|
function Dt(t, s = "w-4 h-4") {
|
|
569
|
-
const
|
|
570
|
-
return /* @__PURE__ */ e(
|
|
569
|
+
const a = ys[t || ""] || Xt;
|
|
570
|
+
return /* @__PURE__ */ e(a, { className: s });
|
|
571
571
|
}
|
|
572
|
-
const
|
|
572
|
+
const ys = {
|
|
573
573
|
// Count variants (chart-based)
|
|
574
|
-
count:
|
|
575
|
-
countDistinct:
|
|
576
|
-
countDistinctApprox:
|
|
574
|
+
count: Xt,
|
|
575
|
+
countDistinct: Er,
|
|
576
|
+
countDistinctApprox: Rr,
|
|
577
577
|
// Aggregations (semantic)
|
|
578
|
-
sum:
|
|
579
|
-
avg:
|
|
580
|
-
min:
|
|
581
|
-
max:
|
|
578
|
+
sum: Ar,
|
|
579
|
+
avg: Tr,
|
|
580
|
+
min: Dr,
|
|
581
|
+
max: Sr,
|
|
582
582
|
// Advanced (semantic)
|
|
583
|
-
runningTotal:
|
|
584
|
-
calculated:
|
|
583
|
+
runningTotal: kr,
|
|
584
|
+
calculated: Cr,
|
|
585
585
|
// Numeric (chart-based)
|
|
586
|
-
number:
|
|
587
|
-
},
|
|
588
|
-
() => import("./chunks/index-
|
|
586
|
+
number: wr
|
|
587
|
+
}, vs = Nr(
|
|
588
|
+
() => import("./chunks/index-EfJ-vN-5.js").then((t) => ({ default: t.CubeRelationshipDiagram }))
|
|
589
589
|
), vt = ({
|
|
590
590
|
schema: t,
|
|
591
591
|
schemaStatus: s,
|
|
592
|
-
schemaError:
|
|
592
|
+
schemaError: a,
|
|
593
593
|
selectedFields: i,
|
|
594
594
|
onFieldSelect: u,
|
|
595
595
|
onFieldDeselect: d,
|
|
@@ -628,11 +628,11 @@ const ws = {
|
|
|
628
628
|
/* @__PURE__ */ e("div", { className: "text-xs", children: "Fetching cube metadata" })
|
|
629
629
|
] }) });
|
|
630
630
|
if (s === "error") {
|
|
631
|
-
const y =
|
|
631
|
+
const y = a?.toLowerCase().includes("cors") || a?.toLowerCase().includes("fetch");
|
|
632
632
|
return /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "text-center max-w-sm p-6", children: [
|
|
633
633
|
/* @__PURE__ */ e(Ue, { className: "w-12 h-12 mx-auto text-red-500 mb-4" }),
|
|
634
634
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold text-dc-text mb-2", children: "Failed to Load Schema" }),
|
|
635
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-dc-text-secondary mb-4", children: y ? /* @__PURE__ */ e(
|
|
635
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-dc-text-secondary mb-4", children: y ? /* @__PURE__ */ e(ae, { children: "CORS error detected. The API endpoint may be incorrect or not accessible." }) : /* @__PURE__ */ e(ae, { children: a || "Unable to connect to the Cube.js API" }) }),
|
|
636
636
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
637
637
|
f && /* @__PURE__ */ r(
|
|
638
638
|
"button",
|
|
@@ -672,7 +672,7 @@ const ws = {
|
|
|
672
672
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold mb-1", children: "No Schema" }),
|
|
673
673
|
/* @__PURE__ */ e("div", { className: "text-xs", children: "Schema not loaded" })
|
|
674
674
|
] }) });
|
|
675
|
-
const
|
|
675
|
+
const n = (y) => {
|
|
676
676
|
const F = new Set(c);
|
|
677
677
|
if (F.has(y) ? F.delete(y) : F.add(y), h(F), $ !== null) {
|
|
678
678
|
const C = new Set($);
|
|
@@ -841,7 +841,7 @@ const ws = {
|
|
|
841
841
|
${S === "tree" ? "bg-dc-surface text-dc-text shadow-xs" : "text-dc-text-secondary hover:text-dc-text"}
|
|
842
842
|
`,
|
|
843
843
|
children: [
|
|
844
|
-
/* @__PURE__ */ e(
|
|
844
|
+
/* @__PURE__ */ e(Fr, { className: "w-3 h-3 mr-1.5" }),
|
|
845
845
|
"Fields"
|
|
846
846
|
]
|
|
847
847
|
}
|
|
@@ -857,7 +857,7 @@ const ws = {
|
|
|
857
857
|
${S === "diagram" ? "bg-dc-surface text-dc-text shadow-xs" : "text-dc-text-secondary hover:text-dc-text"}
|
|
858
858
|
`,
|
|
859
859
|
children: [
|
|
860
|
-
/* @__PURE__ */ e(
|
|
860
|
+
/* @__PURE__ */ e($r, { className: "w-3 h-3 mr-1.5" }),
|
|
861
861
|
"Schema"
|
|
862
862
|
]
|
|
863
863
|
}
|
|
@@ -880,8 +880,8 @@ const ws = {
|
|
|
880
880
|
] }) }),
|
|
881
881
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0 overflow-hidden", children: S === "diagram" ? (
|
|
882
882
|
/* Diagram View - schema relationship diagram */
|
|
883
|
-
/* @__PURE__ */ e("div", { className: "h-full", children: /* @__PURE__ */ e(
|
|
884
|
-
|
|
883
|
+
/* @__PURE__ */ e("div", { className: "h-full", children: /* @__PURE__ */ e(vr, { fallback: /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ e("div", { className: "animate-pulse text-dc-text-muted", children: "Loading diagram..." }) }), children: /* @__PURE__ */ e(
|
|
884
|
+
vs,
|
|
885
885
|
{
|
|
886
886
|
className: "h-full",
|
|
887
887
|
onCubeClick: (y) => {
|
|
@@ -919,7 +919,7 @@ const ws = {
|
|
|
919
919
|
"div",
|
|
920
920
|
{
|
|
921
921
|
className: "flex items-center px-3 py-2 cursor-pointer hover:bg-dc-surface-hover rounded-t-lg",
|
|
922
|
-
onClick: () =>
|
|
922
|
+
onClick: () => n(F.name),
|
|
923
923
|
children: [
|
|
924
924
|
/* @__PURE__ */ e("div", { className: "mr-2", children: C ? /* @__PURE__ */ e(be, { className: "w-4 h-4 text-dc-text-secondary" }) : /* @__PURE__ */ e(Et, { className: "w-4 h-4 text-dc-text-secondary" }) }),
|
|
925
925
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
@@ -996,14 +996,14 @@ const ws = {
|
|
|
996
996
|
})() })
|
|
997
997
|
) })
|
|
998
998
|
] });
|
|
999
|
-
},
|
|
999
|
+
}, Ns = [
|
|
1000
1000
|
{ value: "hour", label: "Hour" },
|
|
1001
1001
|
{ value: "day", label: "Day" },
|
|
1002
1002
|
{ value: "week", label: "Week" },
|
|
1003
1003
|
{ value: "month", label: "Month" },
|
|
1004
1004
|
{ value: "quarter", label: "Quarter" },
|
|
1005
1005
|
{ value: "year", label: "Year" }
|
|
1006
|
-
],
|
|
1006
|
+
], sr = {
|
|
1007
1007
|
// String operators
|
|
1008
1008
|
equals: {
|
|
1009
1009
|
label: "equals",
|
|
@@ -1279,14 +1279,14 @@ const ws = {
|
|
|
1279
1279
|
{ value: "last_n_quarters", label: "Last N quarters" },
|
|
1280
1280
|
{ value: "last_year", label: "Last year" },
|
|
1281
1281
|
{ value: "last_n_years", label: "Last N years" }
|
|
1282
|
-
],
|
|
1282
|
+
], ws = ({
|
|
1283
1283
|
fieldName: t,
|
|
1284
1284
|
operator: s,
|
|
1285
|
-
values:
|
|
1285
|
+
values: a,
|
|
1286
1286
|
onValuesChange: i,
|
|
1287
1287
|
schema: u
|
|
1288
1288
|
}) => {
|
|
1289
|
-
const d =
|
|
1289
|
+
const d = sr[s], [f, g] = q(!1), [o, m] = q(""), [c, h] = q(!1), l = fe(null), k = fe(""), x = xr(o, 300), D = ye(() => u ? u.cubes.some(
|
|
1290
1290
|
(C) => C.dimensions.some((I) => I.name === t)
|
|
1291
1291
|
) : !1, [u, t]), S = ye(() => u ? u.cubes.some(
|
|
1292
1292
|
(C) => C.dimensions.some((I) => I.name === t && I.type === "time")
|
|
@@ -1297,7 +1297,7 @@ const ws = {
|
|
|
1297
1297
|
values: V,
|
|
1298
1298
|
loading: R,
|
|
1299
1299
|
error: L,
|
|
1300
|
-
searchValues:
|
|
1300
|
+
searchValues: n
|
|
1301
1301
|
} = br(t, O);
|
|
1302
1302
|
se(() => {
|
|
1303
1303
|
const C = (I) => {
|
|
@@ -1305,10 +1305,10 @@ const ws = {
|
|
|
1305
1305
|
};
|
|
1306
1306
|
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
1307
1307
|
}, []), se(() => {
|
|
1308
|
-
f && O &&
|
|
1309
|
-
}, [f, O,
|
|
1310
|
-
c && O &&
|
|
1311
|
-
}, [x, c, O,
|
|
1308
|
+
f && O && n && (n("", !0), h(!0), k.current = "");
|
|
1309
|
+
}, [f, O, n]), se(() => {
|
|
1310
|
+
c && O && n && x !== k.current && (k.current = x, n(x));
|
|
1311
|
+
}, [x, c, O, n]);
|
|
1312
1312
|
const b = B(() => {
|
|
1313
1313
|
const C = !f;
|
|
1314
1314
|
g(C), C || (m(""), k.current = "");
|
|
@@ -1316,10 +1316,10 @@ const ws = {
|
|
|
1316
1316
|
const I = C.target.value;
|
|
1317
1317
|
m(I);
|
|
1318
1318
|
}, []), N = B((C) => {
|
|
1319
|
-
d.supportsMultipleValues ?
|
|
1320
|
-
}, [d.supportsMultipleValues,
|
|
1321
|
-
i(
|
|
1322
|
-
}, [
|
|
1319
|
+
d.supportsMultipleValues ? a.includes(C) || i([...a, C]) : (i([C]), g(!1)), m("");
|
|
1320
|
+
}, [d.supportsMultipleValues, a, i]), E = B((C) => {
|
|
1321
|
+
i(a.filter((I) => I !== C));
|
|
1322
|
+
}, [a, i]), T = B((C) => {
|
|
1323
1323
|
const I = C.target.value;
|
|
1324
1324
|
if (d.valueType === "number") {
|
|
1325
1325
|
const U = parseFloat(I);
|
|
@@ -1329,26 +1329,26 @@ const ws = {
|
|
|
1329
1329
|
}, [d.valueType, i]), z = B((C) => {
|
|
1330
1330
|
const I = C.target.value;
|
|
1331
1331
|
if (s === "inDateRange") {
|
|
1332
|
-
const U =
|
|
1332
|
+
const U = a.length >= 2 ? a : ["", ""];
|
|
1333
1333
|
i([I, U[1]]);
|
|
1334
1334
|
} else
|
|
1335
1335
|
i(I ? [I] : []);
|
|
1336
|
-
}, [s,
|
|
1337
|
-
const I = C.target.value, U =
|
|
1336
|
+
}, [s, a, i]), P = B((C) => {
|
|
1337
|
+
const I = C.target.value, U = a.length >= 2 ? a : ["", ""];
|
|
1338
1338
|
i([U[0], I]);
|
|
1339
|
-
}, [
|
|
1340
|
-
const I = parseFloat(C.target.value), U =
|
|
1339
|
+
}, [a, i]), y = B((C) => {
|
|
1340
|
+
const I = parseFloat(C.target.value), U = a.length >= 2 ? a : ["", ""], J = [isNaN(I) ? C.target.value === "" ? "" : U[0] : I, U[1]];
|
|
1341
1341
|
i(J.filter((te) => te !== ""));
|
|
1342
|
-
}, [
|
|
1343
|
-
const I = parseFloat(C.target.value), U =
|
|
1342
|
+
}, [a, i]), F = B((C) => {
|
|
1343
|
+
const I = parseFloat(C.target.value), U = a.length >= 2 ? a : ["", ""], J = [U[0], isNaN(I) ? C.target.value === "" ? "" : U[1] : I];
|
|
1344
1344
|
i(J.filter((te) => te !== ""));
|
|
1345
|
-
}, [
|
|
1345
|
+
}, [a, i]);
|
|
1346
1346
|
return d.requiresValues ? s === "inDateRange" ? /* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
1347
1347
|
/* @__PURE__ */ e(
|
|
1348
1348
|
"input",
|
|
1349
1349
|
{
|
|
1350
1350
|
type: "date",
|
|
1351
|
-
value:
|
|
1351
|
+
value: a[0] || "",
|
|
1352
1352
|
onChange: z,
|
|
1353
1353
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
1354
1354
|
}
|
|
@@ -1358,7 +1358,7 @@ const ws = {
|
|
|
1358
1358
|
"input",
|
|
1359
1359
|
{
|
|
1360
1360
|
type: "date",
|
|
1361
|
-
value:
|
|
1361
|
+
value: a[1] || "",
|
|
1362
1362
|
onChange: P,
|
|
1363
1363
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
1364
1364
|
}
|
|
@@ -1368,7 +1368,7 @@ const ws = {
|
|
|
1368
1368
|
"input",
|
|
1369
1369
|
{
|
|
1370
1370
|
type: "number",
|
|
1371
|
-
value:
|
|
1371
|
+
value: a[0] !== void 0 && a[0] !== null ? a[0] : "",
|
|
1372
1372
|
onChange: y,
|
|
1373
1373
|
placeholder: "Min",
|
|
1374
1374
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
@@ -1379,7 +1379,7 @@ const ws = {
|
|
|
1379
1379
|
"input",
|
|
1380
1380
|
{
|
|
1381
1381
|
type: "number",
|
|
1382
|
-
value:
|
|
1382
|
+
value: a[1] !== void 0 && a[1] !== null ? a[1] : "",
|
|
1383
1383
|
onChange: F,
|
|
1384
1384
|
placeholder: "Max",
|
|
1385
1385
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
@@ -1389,7 +1389,7 @@ const ws = {
|
|
|
1389
1389
|
"input",
|
|
1390
1390
|
{
|
|
1391
1391
|
type: "date",
|
|
1392
|
-
value:
|
|
1392
|
+
value: a[0] || "",
|
|
1393
1393
|
onChange: z,
|
|
1394
1394
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
1395
1395
|
}
|
|
@@ -1397,13 +1397,13 @@ const ws = {
|
|
|
1397
1397
|
"input",
|
|
1398
1398
|
{
|
|
1399
1399
|
type: "number",
|
|
1400
|
-
value:
|
|
1400
|
+
value: a[0] !== void 0 && a[0] !== null ? a[0] : "",
|
|
1401
1401
|
onChange: T,
|
|
1402
1402
|
placeholder: "Enter number",
|
|
1403
1403
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
1404
1404
|
}
|
|
1405
1405
|
) : S && ["equals", "notEquals", "in", "notIn"].includes(s) ? d.supportsMultipleValues ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
1406
|
-
|
|
1406
|
+
a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: a.map((C, I) => /* @__PURE__ */ r(
|
|
1407
1407
|
"div",
|
|
1408
1408
|
{
|
|
1409
1409
|
className: "inline-flex items-center bg-dc-time-dimension text-dc-time-dimension text-xs px-2 py-1 rounded-sm border border-dc-time-dimension",
|
|
@@ -1426,7 +1426,7 @@ const ws = {
|
|
|
1426
1426
|
{
|
|
1427
1427
|
type: "date",
|
|
1428
1428
|
onChange: (C) => {
|
|
1429
|
-
C.target.value && !
|
|
1429
|
+
C.target.value && !a.includes(C.target.value) && (i([...a, C.target.value]), C.target.value = "");
|
|
1430
1430
|
},
|
|
1431
1431
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
|
|
1432
1432
|
placeholder: "Add date..."
|
|
@@ -1436,12 +1436,12 @@ const ws = {
|
|
|
1436
1436
|
"input",
|
|
1437
1437
|
{
|
|
1438
1438
|
type: "date",
|
|
1439
|
-
value:
|
|
1439
|
+
value: a[0] || "",
|
|
1440
1440
|
onChange: z,
|
|
1441
1441
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
1442
1442
|
}
|
|
1443
1443
|
) : $ ? /* @__PURE__ */ r("div", { className: "relative", ref: l, children: [
|
|
1444
|
-
d.supportsMultipleValues &&
|
|
1444
|
+
d.supportsMultipleValues && a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-2", children: a.map((C, I) => /* @__PURE__ */ r(
|
|
1445
1445
|
"div",
|
|
1446
1446
|
{
|
|
1447
1447
|
className: "inline-flex items-center bg-dc-time-dimension text-dc-time-dimension text-xs px-2 py-1 rounded-sm border border-dc-time-dimension",
|
|
@@ -1459,8 +1459,8 @@ const ws = {
|
|
|
1459
1459
|
},
|
|
1460
1460
|
I
|
|
1461
1461
|
)) }),
|
|
1462
|
-
!d.supportsMultipleValues &&
|
|
1463
|
-
/* @__PURE__ */ e("span", { className: "mr-1", children: String(
|
|
1462
|
+
!d.supportsMultipleValues && a.length > 0 && /* @__PURE__ */ e("div", { className: "mb-2", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center bg-dc-time-dimension text-dc-time-dimension text-xs px-2 py-1 rounded-sm border border-dc-time-dimension", children: [
|
|
1463
|
+
/* @__PURE__ */ e("span", { className: "mr-1", children: String(a[0]) }),
|
|
1464
1464
|
/* @__PURE__ */ e(
|
|
1465
1465
|
"button",
|
|
1466
1466
|
{
|
|
@@ -1497,7 +1497,7 @@ const ws = {
|
|
|
1497
1497
|
"Error loading values: ",
|
|
1498
1498
|
L
|
|
1499
1499
|
] }) : V.length === 0 ? /* @__PURE__ */ e("div", { className: "p-2 text-sm text-dc-text-muted", children: o ? "No matching values" : "No values available" }) : V.map((C, I) => {
|
|
1500
|
-
const U =
|
|
1500
|
+
const U = a.includes(C);
|
|
1501
1501
|
return /* @__PURE__ */ r(
|
|
1502
1502
|
"button",
|
|
1503
1503
|
{
|
|
@@ -1516,7 +1516,7 @@ const ws = {
|
|
|
1516
1516
|
"input",
|
|
1517
1517
|
{
|
|
1518
1518
|
type: "text",
|
|
1519
|
-
value:
|
|
1519
|
+
value: a[0] !== void 0 && a[0] !== null ? a[0] : "",
|
|
1520
1520
|
onChange: T,
|
|
1521
1521
|
placeholder: `Enter ${d.valueType} value`,
|
|
1522
1522
|
className: "text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
@@ -1526,7 +1526,7 @@ const ws = {
|
|
|
1526
1526
|
function _e(t) {
|
|
1527
1527
|
return !!(t.measures && t.measures.length > 0 || t.dimensions && t.dimensions.length > 0 || t.timeDimensions && t.timeDimensions.length > 0);
|
|
1528
1528
|
}
|
|
1529
|
-
function
|
|
1529
|
+
function Cs(t) {
|
|
1530
1530
|
let s = 0;
|
|
1531
1531
|
return t.measures && (s += t.measures.length), t.dimensions && (s += t.dimensions.length), t.timeDimensions && (s += t.timeDimensions.length), s;
|
|
1532
1532
|
}
|
|
@@ -1536,7 +1536,7 @@ function Se(t) {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
function $e(t) {
|
|
1538
1538
|
const s = Se(t);
|
|
1539
|
-
return s.filters && s.filters.length > 0 && (s.filters =
|
|
1539
|
+
return s.filters && s.filters.length > 0 && (s.filters = Rs(s.filters)), s;
|
|
1540
1540
|
}
|
|
1541
1541
|
function dt() {
|
|
1542
1542
|
return {};
|
|
@@ -1547,70 +1547,70 @@ function Qe(t) {
|
|
|
1547
1547
|
function ze(t) {
|
|
1548
1548
|
return "type" in t && "filters" in t;
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1550
|
+
function ks(t) {
|
|
1551
1551
|
return ze(t) && t.type === "and";
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1553
|
+
function Ss(t) {
|
|
1554
1554
|
return ze(t) && t.type === "or";
|
|
1555
1555
|
}
|
|
1556
1556
|
function ct(t, s) {
|
|
1557
|
-
const
|
|
1557
|
+
const a = [];
|
|
1558
1558
|
if (t.cubes.forEach((d) => {
|
|
1559
|
-
|
|
1559
|
+
a.push(...d.measures), a.push(...d.dimensions);
|
|
1560
1560
|
}), !s)
|
|
1561
|
-
return
|
|
1561
|
+
return a.sort((d, f) => d.name.localeCompare(f.name));
|
|
1562
1562
|
const i = /* @__PURE__ */ new Set();
|
|
1563
|
-
return s.measures && s.measures.forEach((d) => i.add(d)), s.dimensions && s.dimensions.forEach((d) => i.add(d)), s.timeDimensions && s.timeDimensions.forEach((d) => i.add(d.dimension)),
|
|
1563
|
+
return s.measures && s.measures.forEach((d) => i.add(d)), s.dimensions && s.dimensions.forEach((d) => i.add(d)), s.timeDimensions && s.timeDimensions.forEach((d) => i.add(d.dimension)), a.filter((d) => i.has(d.name)).sort((d, f) => d.name.localeCompare(f.name));
|
|
1564
1564
|
}
|
|
1565
1565
|
function Tt(t) {
|
|
1566
1566
|
const s = [];
|
|
1567
|
-
return t.cubes.forEach((
|
|
1568
|
-
s.push(...
|
|
1569
|
-
}), s.sort((
|
|
1567
|
+
return t.cubes.forEach((a) => {
|
|
1568
|
+
s.push(...a.measures), s.push(...a.dimensions);
|
|
1569
|
+
}), s.sort((a, i) => a.name.localeCompare(i.name));
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1572
|
-
const
|
|
1571
|
+
function Ds(t, s) {
|
|
1572
|
+
const a = Tt(t);
|
|
1573
1573
|
if (!s)
|
|
1574
1574
|
return {
|
|
1575
1575
|
queryFields: [],
|
|
1576
|
-
allFields:
|
|
1576
|
+
allFields: a
|
|
1577
1577
|
};
|
|
1578
1578
|
const i = /* @__PURE__ */ new Set();
|
|
1579
1579
|
return s.measures && s.measures.forEach((d) => i.add(d)), s.dimensions && s.dimensions.forEach((d) => i.add(d)), s.timeDimensions && s.timeDimensions.forEach((d) => i.add(d.dimension)), {
|
|
1580
|
-
queryFields:
|
|
1581
|
-
allFields:
|
|
1580
|
+
queryFields: a.filter((d) => i.has(d.name)),
|
|
1581
|
+
allFields: a
|
|
1582
1582
|
};
|
|
1583
1583
|
}
|
|
1584
1584
|
function Pt(t) {
|
|
1585
1585
|
const s = [];
|
|
1586
|
-
for (const [
|
|
1586
|
+
for (const [a, i] of Object.entries(sr))
|
|
1587
1587
|
i.fieldTypes.includes(t) && s.push({
|
|
1588
|
-
operator:
|
|
1588
|
+
operator: a,
|
|
1589
1589
|
label: i.label
|
|
1590
1590
|
});
|
|
1591
1591
|
return s;
|
|
1592
1592
|
}
|
|
1593
1593
|
function ar(t, s) {
|
|
1594
|
-
for (const
|
|
1595
|
-
const i =
|
|
1594
|
+
for (const a of s.cubes) {
|
|
1595
|
+
const i = a.measures.find((d) => d.name === t);
|
|
1596
1596
|
if (i) return i.type;
|
|
1597
|
-
const u =
|
|
1597
|
+
const u = a.dimensions.find((d) => d.name === t);
|
|
1598
1598
|
if (u) return u.type;
|
|
1599
1599
|
}
|
|
1600
1600
|
return "string";
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function Ts(t) {
|
|
1603
1603
|
let s = 0;
|
|
1604
|
-
const
|
|
1605
|
-
Qe(i) ? s++ : ze(i) && i.filters.forEach(
|
|
1604
|
+
const a = (i) => {
|
|
1605
|
+
Qe(i) ? s++ : ze(i) && i.filters.forEach(a);
|
|
1606
1606
|
};
|
|
1607
|
-
return t.forEach(
|
|
1607
|
+
return t.forEach(a), s;
|
|
1608
1608
|
}
|
|
1609
|
-
function Ze(t, s = "equals",
|
|
1609
|
+
function Ze(t, s = "equals", a = []) {
|
|
1610
1610
|
return {
|
|
1611
1611
|
member: t,
|
|
1612
1612
|
operator: s,
|
|
1613
|
-
values:
|
|
1613
|
+
values: a
|
|
1614
1614
|
};
|
|
1615
1615
|
}
|
|
1616
1616
|
function ve(t = []) {
|
|
@@ -1625,23 +1625,23 @@ function Ne(t = []) {
|
|
|
1625
1625
|
filters: t
|
|
1626
1626
|
};
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function As(t, s) {
|
|
1629
1629
|
return t || [];
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const s = (
|
|
1633
|
-
if (Qe(
|
|
1634
|
-
return
|
|
1635
|
-
if (ze(
|
|
1636
|
-
const i =
|
|
1637
|
-
return
|
|
1631
|
+
function Rs(t) {
|
|
1632
|
+
const s = (a) => {
|
|
1633
|
+
if (Qe(a))
|
|
1634
|
+
return a;
|
|
1635
|
+
if (ze(a)) {
|
|
1636
|
+
const i = a.filters.map(s);
|
|
1637
|
+
return a.type === "and" ? { and: i } : { or: i };
|
|
1638
1638
|
}
|
|
1639
|
-
return
|
|
1639
|
+
return a;
|
|
1640
1640
|
};
|
|
1641
1641
|
return t.map(s);
|
|
1642
1642
|
}
|
|
1643
1643
|
function Re(t, s) {
|
|
1644
|
-
const
|
|
1644
|
+
const a = {
|
|
1645
1645
|
today: "today",
|
|
1646
1646
|
yesterday: "yesterday",
|
|
1647
1647
|
this_week: "this week",
|
|
@@ -1660,7 +1660,7 @@ function Re(t, s) {
|
|
|
1660
1660
|
const i = t.replace("last_n_", ""), u = i.slice(0, -1);
|
|
1661
1661
|
return s === 1 ? `last ${u}` : `last ${s} ${i}`;
|
|
1662
1662
|
}
|
|
1663
|
-
return
|
|
1663
|
+
return a[t] || t;
|
|
1664
1664
|
}
|
|
1665
1665
|
function Ee(t) {
|
|
1666
1666
|
return t.startsWith("last_n_");
|
|
@@ -1668,13 +1668,13 @@ function Ee(t) {
|
|
|
1668
1668
|
function Nt(t) {
|
|
1669
1669
|
return t.toISOString().split("T")[0];
|
|
1670
1670
|
}
|
|
1671
|
-
function
|
|
1671
|
+
function Es(t) {
|
|
1672
1672
|
const s = {};
|
|
1673
|
-
return t.timeDimensions && t.timeDimensions.forEach((
|
|
1674
|
-
|
|
1673
|
+
return t.timeDimensions && t.timeDimensions.forEach((a) => {
|
|
1674
|
+
a.dateRange && (s[a.dimension] = a.dateRange);
|
|
1675
1675
|
}), s;
|
|
1676
1676
|
}
|
|
1677
|
-
function
|
|
1677
|
+
function Fs(t) {
|
|
1678
1678
|
return !!(t.timeDimensions && t.timeDimensions.length > 0);
|
|
1679
1679
|
}
|
|
1680
1680
|
function Me(t) {
|
|
@@ -1697,10 +1697,10 @@ function et(t) {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
function Mt(t, s) {
|
|
1699
1699
|
if (!s) return t;
|
|
1700
|
-
for (const
|
|
1701
|
-
const i =
|
|
1700
|
+
for (const a of s.cubes) {
|
|
1701
|
+
const i = a.measures.find((d) => d.name === t);
|
|
1702
1702
|
if (i) return i.title || i.shortTitle || t;
|
|
1703
|
-
const u =
|
|
1703
|
+
const u = a.dimensions.find((d) => d.name === t);
|
|
1704
1704
|
if (u) return u.title || u.shortTitle || t;
|
|
1705
1705
|
}
|
|
1706
1706
|
return t;
|
|
@@ -1718,7 +1718,7 @@ function qt(t) {
|
|
|
1718
1718
|
return "Click to sort ascending";
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function $s(t) {
|
|
1722
1722
|
switch (t) {
|
|
1723
1723
|
case null:
|
|
1724
1724
|
return "asc";
|
|
@@ -1733,7 +1733,7 @@ function Vs(t) {
|
|
|
1733
1733
|
const At = ({
|
|
1734
1734
|
filter: t,
|
|
1735
1735
|
index: s,
|
|
1736
|
-
onFilterChange:
|
|
1736
|
+
onFilterChange: a,
|
|
1737
1737
|
onFilterRemove: i,
|
|
1738
1738
|
schema: u,
|
|
1739
1739
|
query: d,
|
|
@@ -1741,13 +1741,13 @@ const At = ({
|
|
|
1741
1741
|
hideOperatorSelector: g = !1,
|
|
1742
1742
|
hideRemoveButton: o = !1
|
|
1743
1743
|
}) => {
|
|
1744
|
-
const [m, c] = q(!1), [h, l] = q(!1), [k, x] = q(!1), [D, S] = q(""), O = fe(null), $ = fe(null), [V, R] = q("this_month"), [L,
|
|
1744
|
+
const [m, c] = q(!1), [h, l] = q(!1), [k, x] = q(!1), [D, S] = q(""), O = fe(null), $ = fe(null), [V, R] = q("this_month"), [L, n] = q({
|
|
1745
1745
|
startDate: Nt(/* @__PURE__ */ new Date()),
|
|
1746
1746
|
endDate: Nt(/* @__PURE__ */ new Date())
|
|
1747
1747
|
}), [b, p] = q(1);
|
|
1748
1748
|
se(() => {
|
|
1749
|
-
const M = (
|
|
1750
|
-
O.current && !O.current.contains(
|
|
1749
|
+
const M = (ne) => {
|
|
1750
|
+
O.current && !O.current.contains(ne.target) && (c(!1), l(!1));
|
|
1751
1751
|
};
|
|
1752
1752
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
1753
1753
|
}, []);
|
|
@@ -1757,40 +1757,40 @@ const At = ({
|
|
|
1757
1757
|
c(M), S(""), M && setTimeout(() => $.current?.focus(), 50);
|
|
1758
1758
|
}, E = () => {
|
|
1759
1759
|
c(!1), l(!h);
|
|
1760
|
-
}, T = u ? Tt(u) : [], { queryFields: z } = u ?
|
|
1760
|
+
}, T = u ? Tt(u) : [], { queryFields: z } = u ? Ds(u, d) : { queryFields: [] }, P = T.find((M) => M.name === t.member), y = P ? P.type : "string", F = Pt(y), C = y === "time" && t.operator === "inDateRange";
|
|
1761
1761
|
if (se(() => {
|
|
1762
1762
|
if (!(!C || !t.dateRange))
|
|
1763
1763
|
if (Array.isArray(t.dateRange))
|
|
1764
|
-
R("custom"),
|
|
1764
|
+
R("custom"), n({
|
|
1765
1765
|
startDate: t.dateRange[0] || "",
|
|
1766
1766
|
endDate: t.dateRange[1] || t.dateRange[0] || ""
|
|
1767
1767
|
});
|
|
1768
1768
|
else {
|
|
1769
1769
|
const M = t.dateRange.match(/^last (\d+) (days|weeks|months|quarters|years)$/);
|
|
1770
1770
|
if (M) {
|
|
1771
|
-
const [,
|
|
1772
|
-
R(`last_n_${X === "days" ? "days" : X === "weeks" ? "weeks" : X === "months" ? "months" : X === "quarters" ? "quarters" : "years"}`), p(parseInt(
|
|
1771
|
+
const [, ne, X] = M;
|
|
1772
|
+
R(`last_n_${X === "days" ? "days" : X === "weeks" ? "weeks" : X === "months" ? "months" : X === "quarters" ? "quarters" : "years"}`), p(parseInt(ne) || 1);
|
|
1773
1773
|
} else {
|
|
1774
|
-
let
|
|
1774
|
+
let ne = !1;
|
|
1775
1775
|
for (const X of je)
|
|
1776
1776
|
if (X.value !== "custom" && !Ee(X.value) && Re(X.value) === t.dateRange) {
|
|
1777
|
-
R(X.value),
|
|
1777
|
+
R(X.value), ne = !0;
|
|
1778
1778
|
break;
|
|
1779
1779
|
}
|
|
1780
|
-
|
|
1780
|
+
ne || R("custom");
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
1783
|
}, [t.dateRange, C]), !u)
|
|
1784
1784
|
return /* @__PURE__ */ e("div", { className: "text-sm text-dc-text-muted", children: "Schema not loaded" });
|
|
1785
1785
|
const I = (M) => {
|
|
1786
1786
|
if (!D) return M;
|
|
1787
|
-
const
|
|
1787
|
+
const ne = D.toLowerCase();
|
|
1788
1788
|
return M.filter(
|
|
1789
|
-
(X) => X.name.toLowerCase().includes(
|
|
1789
|
+
(X) => X.name.toLowerCase().includes(ne) || X.title.toLowerCase().includes(ne) || X.shortTitle.toLowerCase().includes(ne)
|
|
1790
1790
|
);
|
|
1791
1791
|
}, U = I(z), J = I(T), te = (M) => M.type === "time" ? /* @__PURE__ */ e(Be, { className: "w-3 h-3 text-blue-500" }) : ["count", "sum", "avg", "min", "max", "countDistinct", "countDistinctApprox", "runningTotal", "calculated", "number"].includes(M.type) ? Dt(M.type, "w-3 h-3 text-amber-500") : /* @__PURE__ */ e(Je, { className: "w-3 h-3 text-green-500" }), oe = (M) => M.type === "time" ? /* @__PURE__ */ e("span", { className: "text-xs bg-dc-time-dimension text-dc-time-dimension px-1.5 py-0.5 rounded-sm", children: "T" }) : ["count", "sum", "avg", "min", "max", "countDistinct", "number"].includes(M.type) ? /* @__PURE__ */ e("span", { className: "text-xs bg-dc-measure text-dc-measure px-1.5 py-0.5 rounded-sm", children: "M" }) : /* @__PURE__ */ e("span", { className: "text-xs bg-dc-dimension text-dc-dimension px-1.5 py-0.5 rounded-sm", children: "D" }), he = (M) => {
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1792
|
+
const ne = ar(M, u), ie = Pt(ne)[0]?.operator || "equals";
|
|
1793
|
+
a(s, {
|
|
1794
1794
|
member: M,
|
|
1795
1795
|
operator: ie,
|
|
1796
1796
|
values: [],
|
|
@@ -1798,7 +1798,7 @@ const At = ({
|
|
|
1798
1798
|
// Reset dateRange when field changes
|
|
1799
1799
|
}), c(!1);
|
|
1800
1800
|
}, j = (M) => {
|
|
1801
|
-
|
|
1801
|
+
a(s, {
|
|
1802
1802
|
...t,
|
|
1803
1803
|
operator: M,
|
|
1804
1804
|
values: [],
|
|
@@ -1807,39 +1807,39 @@ const At = ({
|
|
|
1807
1807
|
// Reset dateRange when operator changes
|
|
1808
1808
|
}), l(!1);
|
|
1809
1809
|
}, K = (M) => {
|
|
1810
|
-
|
|
1810
|
+
a(s, {
|
|
1811
1811
|
...t,
|
|
1812
1812
|
values: M
|
|
1813
1813
|
});
|
|
1814
1814
|
}, W = (M) => {
|
|
1815
|
-
|
|
1815
|
+
a(s, {
|
|
1816
1816
|
...t,
|
|
1817
1817
|
dateRange: M
|
|
1818
1818
|
});
|
|
1819
1819
|
}, ee = (M) => {
|
|
1820
1820
|
if (x(!1), M === "custom") {
|
|
1821
1821
|
if (L.startDate && L.endDate) {
|
|
1822
|
-
const
|
|
1823
|
-
W(
|
|
1822
|
+
const ne = L.startDate === L.endDate ? L.startDate : [L.startDate, L.endDate];
|
|
1823
|
+
W(ne);
|
|
1824
1824
|
}
|
|
1825
1825
|
} else if (Ee(M)) {
|
|
1826
|
-
const
|
|
1827
|
-
W(
|
|
1826
|
+
const ne = Re(M, b);
|
|
1827
|
+
W(ne);
|
|
1828
1828
|
} else {
|
|
1829
|
-
const
|
|
1830
|
-
W(
|
|
1829
|
+
const ne = Re(M);
|
|
1830
|
+
W(ne);
|
|
1831
1831
|
}
|
|
1832
1832
|
R(M);
|
|
1833
|
-
}, de = (M,
|
|
1834
|
-
const X = { ...L, [M]:
|
|
1835
|
-
if (
|
|
1833
|
+
}, de = (M, ne) => {
|
|
1834
|
+
const X = { ...L, [M]: ne };
|
|
1835
|
+
if (n(X), V === "custom" && X.startDate) {
|
|
1836
1836
|
const ie = !X.endDate || X.startDate === X.endDate ? X.startDate : [X.startDate, X.endDate];
|
|
1837
1837
|
W(ie);
|
|
1838
1838
|
}
|
|
1839
1839
|
}, ce = (M) => {
|
|
1840
1840
|
if (p(M), Ee(V)) {
|
|
1841
|
-
const
|
|
1842
|
-
W(
|
|
1841
|
+
const ne = Re(V, M);
|
|
1842
|
+
W(ne);
|
|
1843
1843
|
}
|
|
1844
1844
|
}, pe = je.find((M) => M.value === V)?.label || "Custom";
|
|
1845
1845
|
return /* @__PURE__ */ e("div", { ref: O, className: "bg-dc-surface border border-dc-border rounded-lg p-3", children: /* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row sm:items-center gap-3 min-w-0", children: [
|
|
@@ -1859,7 +1859,7 @@ const At = ({
|
|
|
1859
1859
|
),
|
|
1860
1860
|
m && /* @__PURE__ */ r("div", { className: "absolute z-20 left-0 right-0 mt-1 bg-dc-surface border border-dc-border rounded-md shadow-lg max-h-80 overflow-hidden", children: [
|
|
1861
1861
|
/* @__PURE__ */ e("div", { className: "p-2 border-b border-dc-border", children: /* @__PURE__ */ r("div", { className: "relative", children: [
|
|
1862
|
-
/* @__PURE__ */ e(
|
|
1862
|
+
/* @__PURE__ */ e(Or, { className: "w-4 h-4 absolute left-2 top-1/2 transform -translate-y-1/2 text-dc-text-muted" }),
|
|
1863
1863
|
/* @__PURE__ */ e(
|
|
1864
1864
|
"input",
|
|
1865
1865
|
{
|
|
@@ -1982,7 +1982,7 @@ const At = ({
|
|
|
1982
1982
|
M.value
|
|
1983
1983
|
)) })
|
|
1984
1984
|
] }),
|
|
1985
|
-
V === "custom" ? /* @__PURE__ */ r(
|
|
1985
|
+
V === "custom" ? /* @__PURE__ */ r(ae, { children: [
|
|
1986
1986
|
/* @__PURE__ */ e(
|
|
1987
1987
|
"input",
|
|
1988
1988
|
{
|
|
@@ -2003,7 +2003,7 @@ const At = ({
|
|
|
2003
2003
|
className: "flex-1 min-w-0 text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text hover:bg-dc-surface-hover focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
2004
2004
|
}
|
|
2005
2005
|
)
|
|
2006
|
-
] }) : Ee(V) ? /* @__PURE__ */ r(
|
|
2006
|
+
] }) : Ee(V) ? /* @__PURE__ */ r(ae, { children: [
|
|
2007
2007
|
/* @__PURE__ */ e(
|
|
2008
2008
|
"input",
|
|
2009
2009
|
{
|
|
@@ -2022,7 +2022,7 @@ const At = ({
|
|
|
2022
2022
|
) : (
|
|
2023
2023
|
/* Regular FilterValueSelector for non-dateRange filters */
|
|
2024
2024
|
/* @__PURE__ */ e(
|
|
2025
|
-
|
|
2025
|
+
ws,
|
|
2026
2026
|
{
|
|
2027
2027
|
fieldName: t.member,
|
|
2028
2028
|
operator: t.operator,
|
|
@@ -2043,10 +2043,10 @@ const At = ({
|
|
|
2043
2043
|
}
|
|
2044
2044
|
) })
|
|
2045
2045
|
] }) });
|
|
2046
|
-
},
|
|
2046
|
+
}, nr = ({
|
|
2047
2047
|
group: t,
|
|
2048
2048
|
index: s,
|
|
2049
|
-
onGroupChange:
|
|
2049
|
+
onGroupChange: a,
|
|
2050
2050
|
onGroupChangeWithUnwrap: i,
|
|
2051
2051
|
onGroupRemove: u,
|
|
2052
2052
|
schema: d,
|
|
@@ -2056,27 +2056,27 @@ const At = ({
|
|
|
2056
2056
|
const [o, m] = q(!1), c = t.type === "and", h = c ? "AND" : "OR", l = t.filters, k = g > 0 ? `ml-${Math.min(g * 4, 16)}` : "", x = "border-slate-200", D = "bg-slate-50", S = "text-slate-700", O = () => {
|
|
2057
2057
|
if (c) {
|
|
2058
2058
|
const N = Ne(l);
|
|
2059
|
-
|
|
2059
|
+
a(s, N);
|
|
2060
2060
|
} else {
|
|
2061
2061
|
const N = ve(l);
|
|
2062
|
-
|
|
2062
|
+
a(s, N);
|
|
2063
2063
|
}
|
|
2064
2064
|
}, $ = () => {
|
|
2065
2065
|
if (!d) return;
|
|
2066
2066
|
const E = ct(d, f)[0]?.name || "", T = Ze(E, "equals", []), z = [...l, T];
|
|
2067
|
-
c ?
|
|
2067
|
+
c ? a(s, ve(z)) : a(s, Ne(z)), m(!1);
|
|
2068
2068
|
}, V = () => {
|
|
2069
2069
|
if (!d) return;
|
|
2070
2070
|
const E = ct(d, f)[0]?.name || "", T = ve([Ze(E, "equals", [])]), z = [...l, T];
|
|
2071
|
-
c ?
|
|
2071
|
+
c ? a(s, ve(z)) : a(s, Ne(z)), m(!1);
|
|
2072
2072
|
}, R = () => {
|
|
2073
2073
|
if (!d) return;
|
|
2074
2074
|
const E = ct(d, f)[0]?.name || "", T = Ne([Ze(E, "equals", [])]), z = [...l, T];
|
|
2075
|
-
c ?
|
|
2075
|
+
c ? a(s, ve(z)) : a(s, Ne(z)), m(!1);
|
|
2076
2076
|
}, L = (N, E) => {
|
|
2077
2077
|
const T = [...l];
|
|
2078
|
-
T[N] = E, c ?
|
|
2079
|
-
},
|
|
2078
|
+
T[N] = E, c ? a(s, ve(T)) : a(s, Ne(T));
|
|
2079
|
+
}, n = (N) => {
|
|
2080
2080
|
const E = l.filter((z, P) => P !== N);
|
|
2081
2081
|
if (E.length === 0) {
|
|
2082
2082
|
u(s);
|
|
@@ -2084,16 +2084,16 @@ const At = ({
|
|
|
2084
2084
|
}
|
|
2085
2085
|
if (E.length === 1) {
|
|
2086
2086
|
const z = t.type === "and" ? ve(E) : Ne(E);
|
|
2087
|
-
i ? i(s, z) :
|
|
2087
|
+
i ? i(s, z) : a(s, z);
|
|
2088
2088
|
return;
|
|
2089
2089
|
}
|
|
2090
2090
|
const T = t.type === "and" ? ve(E) : Ne(E);
|
|
2091
|
-
|
|
2091
|
+
a(s, T);
|
|
2092
2092
|
}, b = (N, E) => {
|
|
2093
2093
|
const T = [...l];
|
|
2094
|
-
T[N] = E, c ?
|
|
2094
|
+
T[N] = E, c ? a(s, ve(T)) : a(s, Ne(T));
|
|
2095
2095
|
}, p = (N) => {
|
|
2096
|
-
|
|
2096
|
+
n(N);
|
|
2097
2097
|
};
|
|
2098
2098
|
return /* @__PURE__ */ r("div", { className: `${k} ${x} border-2 ${D} rounded-lg p-4 space-y-3`, children: [
|
|
2099
2099
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
@@ -2168,13 +2168,13 @@ const At = ({
|
|
|
2168
2168
|
filter: N,
|
|
2169
2169
|
index: E,
|
|
2170
2170
|
onFilterChange: L,
|
|
2171
|
-
onFilterRemove:
|
|
2171
|
+
onFilterRemove: n,
|
|
2172
2172
|
schema: d,
|
|
2173
2173
|
query: f
|
|
2174
2174
|
},
|
|
2175
2175
|
E
|
|
2176
2176
|
) : ze(N) ? /* @__PURE__ */ e(
|
|
2177
|
-
|
|
2177
|
+
nr,
|
|
2178
2178
|
{
|
|
2179
2179
|
group: N,
|
|
2180
2180
|
index: E,
|
|
@@ -2199,14 +2199,14 @@ const At = ({
|
|
|
2199
2199
|
] })
|
|
2200
2200
|
] })
|
|
2201
2201
|
] });
|
|
2202
|
-
},
|
|
2202
|
+
}, lr = ({
|
|
2203
2203
|
filters: t,
|
|
2204
2204
|
schema: s,
|
|
2205
|
-
query:
|
|
2205
|
+
query: a,
|
|
2206
2206
|
onFiltersChange: i,
|
|
2207
2207
|
hideFieldSelector: u = !1
|
|
2208
2208
|
}) => {
|
|
2209
|
-
const d =
|
|
2209
|
+
const d = Ts(t), f = s ? Tt(s) : [], g = f.length > 0, o = () => {
|
|
2210
2210
|
if (!g) return;
|
|
2211
2211
|
const D = f[0]?.name || "", S = Ze(D, "equals", []);
|
|
2212
2212
|
if (t.length === 0)
|
|
@@ -2214,10 +2214,10 @@ const At = ({
|
|
|
2214
2214
|
else if (t.length === 1 && Qe(t[0])) {
|
|
2215
2215
|
const O = ve([t[0], S]);
|
|
2216
2216
|
i([O]);
|
|
2217
|
-
} else if (t.length === 1 &&
|
|
2217
|
+
} else if (t.length === 1 && ks(t[0])) {
|
|
2218
2218
|
const O = t[0], $ = ve([...O.filters, S]);
|
|
2219
2219
|
i([$]);
|
|
2220
|
-
} else if (t.length === 1 &&
|
|
2220
|
+
} else if (t.length === 1 && Ss(t[0])) {
|
|
2221
2221
|
const O = t[0], $ = Ne([...O.filters, S]);
|
|
2222
2222
|
i([$]);
|
|
2223
2223
|
} else
|
|
@@ -2280,13 +2280,13 @@ const At = ({
|
|
|
2280
2280
|
onFilterChange: m,
|
|
2281
2281
|
onFilterRemove: c,
|
|
2282
2282
|
schema: s,
|
|
2283
|
-
query:
|
|
2283
|
+
query: a,
|
|
2284
2284
|
hideFieldSelector: u,
|
|
2285
2285
|
hideRemoveButton: u
|
|
2286
2286
|
},
|
|
2287
2287
|
S
|
|
2288
2288
|
) : ze(D) ? /* @__PURE__ */ e(
|
|
2289
|
-
|
|
2289
|
+
nr,
|
|
2290
2290
|
{
|
|
2291
2291
|
group: D,
|
|
2292
2292
|
index: S,
|
|
@@ -2294,7 +2294,7 @@ const At = ({
|
|
|
2294
2294
|
onGroupChangeWithUnwrap: l,
|
|
2295
2295
|
onGroupRemove: k,
|
|
2296
2296
|
schema: s,
|
|
2297
|
-
query:
|
|
2297
|
+
query: a,
|
|
2298
2298
|
depth: 0
|
|
2299
2299
|
},
|
|
2300
2300
|
S
|
|
@@ -2303,7 +2303,7 @@ const At = ({
|
|
|
2303
2303
|
}, Rt = ({
|
|
2304
2304
|
timeDimension: t,
|
|
2305
2305
|
availableTimeDimensions: s,
|
|
2306
|
-
currentDateRange:
|
|
2306
|
+
currentDateRange: a,
|
|
2307
2307
|
onDateRangeChange: i,
|
|
2308
2308
|
onTimeDimensionChange: u,
|
|
2309
2309
|
onRemove: d,
|
|
@@ -2311,29 +2311,29 @@ const At = ({
|
|
|
2311
2311
|
hideRemoveButton: g = !1
|
|
2312
2312
|
}) => {
|
|
2313
2313
|
const o = () => {
|
|
2314
|
-
if (!
|
|
2315
|
-
if (Array.isArray(
|
|
2314
|
+
if (!a) return "this_month";
|
|
2315
|
+
if (Array.isArray(a))
|
|
2316
2316
|
return "custom";
|
|
2317
|
-
const P =
|
|
2317
|
+
const P = a.match(/^last (\d+) (days|weeks|months|quarters|years)$/);
|
|
2318
2318
|
if (P) {
|
|
2319
2319
|
const [, , y] = P;
|
|
2320
2320
|
return `last_n_${y === "days" ? "days" : y === "weeks" ? "weeks" : y === "months" ? "months" : y === "quarters" ? "quarters" : "years"}`;
|
|
2321
2321
|
}
|
|
2322
2322
|
for (const y of je)
|
|
2323
|
-
if (y.value !== "custom" && !Ee(y.value) && Re(y.value) ===
|
|
2323
|
+
if (y.value !== "custom" && !Ee(y.value) && Re(y.value) === a)
|
|
2324
2324
|
return y.value;
|
|
2325
2325
|
return "custom";
|
|
2326
2326
|
}, m = () => {
|
|
2327
|
-
if (Array.isArray(
|
|
2327
|
+
if (Array.isArray(a) && a.length >= 1)
|
|
2328
2328
|
return {
|
|
2329
|
-
startDate:
|
|
2330
|
-
endDate:
|
|
2329
|
+
startDate: a[0] || "",
|
|
2330
|
+
endDate: a[1] || a[0] || ""
|
|
2331
2331
|
};
|
|
2332
2332
|
const P = Nt(/* @__PURE__ */ new Date());
|
|
2333
2333
|
return { startDate: P, endDate: P };
|
|
2334
2334
|
}, c = () => {
|
|
2335
|
-
if (!
|
|
2336
|
-
const P =
|
|
2335
|
+
if (!a || Array.isArray(a)) return 1;
|
|
2336
|
+
const P = a.match(/^last (\d+) (days|weeks|months|quarters|years)$/);
|
|
2337
2337
|
return P && parseInt(P[1]) || 1;
|
|
2338
2338
|
}, [h, l] = q(o()), [k, x] = q(m()), [D, S] = q(c()), [O, $] = q(!1), [V, R] = q(!1), L = fe(null);
|
|
2339
2339
|
se(() => {
|
|
@@ -2342,7 +2342,7 @@ const At = ({
|
|
|
2342
2342
|
};
|
|
2343
2343
|
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
2344
2344
|
}, []);
|
|
2345
|
-
const
|
|
2345
|
+
const n = () => {
|
|
2346
2346
|
$(!1), R(!V);
|
|
2347
2347
|
}, b = () => {
|
|
2348
2348
|
R(!1), $(!O);
|
|
@@ -2380,7 +2380,7 @@ const At = ({
|
|
|
2380
2380
|
/* @__PURE__ */ r(
|
|
2381
2381
|
"button",
|
|
2382
2382
|
{
|
|
2383
|
-
onClick:
|
|
2383
|
+
onClick: n,
|
|
2384
2384
|
className: "w-full flex items-center justify-between text-left text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text hover:bg-dc-surface-hover focus:ring-2 focus:ring-blue-500 focus:border-blue-500 min-w-0",
|
|
2385
2385
|
children: [
|
|
2386
2386
|
/* @__PURE__ */ e("span", { className: "truncate", children: t }),
|
|
@@ -2422,7 +2422,7 @@ const At = ({
|
|
|
2422
2422
|
)) })
|
|
2423
2423
|
] }) }),
|
|
2424
2424
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
2425
|
-
h === "custom" ? /* @__PURE__ */ r(
|
|
2425
|
+
h === "custom" ? /* @__PURE__ */ r(ae, { children: [
|
|
2426
2426
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ e(
|
|
2427
2427
|
"input",
|
|
2428
2428
|
{
|
|
@@ -2443,7 +2443,7 @@ const At = ({
|
|
|
2443
2443
|
className: "w-full text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text hover:bg-dc-surface-hover focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
2444
2444
|
}
|
|
2445
2445
|
) })
|
|
2446
|
-
] }) : Ee(h) ? /* @__PURE__ */ r(
|
|
2446
|
+
] }) : Ee(h) ? /* @__PURE__ */ r(ae, { children: [
|
|
2447
2447
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ e(
|
|
2448
2448
|
"input",
|
|
2449
2449
|
{
|
|
@@ -2472,18 +2472,18 @@ const At = ({
|
|
|
2472
2472
|
)
|
|
2473
2473
|
] })
|
|
2474
2474
|
] }) });
|
|
2475
|
-
},
|
|
2475
|
+
}, Os = ({
|
|
2476
2476
|
timeDimensions: t,
|
|
2477
2477
|
onDateRangeChange: s,
|
|
2478
|
-
onDateRangeRemove:
|
|
2478
|
+
onDateRangeRemove: a
|
|
2479
2479
|
}) => {
|
|
2480
|
-
const i =
|
|
2480
|
+
const i = Es({ timeDimensions: t }), u = t.filter((o) => !o.dateRange), d = Object.keys(i).length, f = () => {
|
|
2481
2481
|
if (u.length === 0) return;
|
|
2482
2482
|
const o = u[0];
|
|
2483
2483
|
s(o.dimension, "this month");
|
|
2484
2484
|
}, g = () => {
|
|
2485
2485
|
Object.keys(i).forEach((o) => {
|
|
2486
|
-
|
|
2486
|
+
a(o);
|
|
2487
2487
|
});
|
|
2488
2488
|
};
|
|
2489
2489
|
return !t || t.length === 0 ? null : /* @__PURE__ */ r("div", { className: "space-y-4 bg-dc-surface-secondary rounded-lg p-4", children: [
|
|
@@ -2531,9 +2531,9 @@ const At = ({
|
|
|
2531
2531
|
currentDateRange: o.dateRange,
|
|
2532
2532
|
onDateRangeChange: s,
|
|
2533
2533
|
onTimeDimensionChange: (c, h) => {
|
|
2534
|
-
|
|
2534
|
+
a(c), s(h, o.dateRange);
|
|
2535
2535
|
},
|
|
2536
|
-
onRemove:
|
|
2536
|
+
onRemove: a
|
|
2537
2537
|
},
|
|
2538
2538
|
o.dimension
|
|
2539
2539
|
);
|
|
@@ -2543,7 +2543,7 @@ const At = ({
|
|
|
2543
2543
|
function _t(t) {
|
|
2544
2544
|
return t.replace(/_/g, " ");
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function Ls(t) {
|
|
2547
2547
|
switch (t) {
|
|
2548
2548
|
case "most_dimensions":
|
|
2549
2549
|
return "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300";
|
|
@@ -2557,10 +2557,10 @@ function Ms(t) {
|
|
|
2557
2557
|
return "bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-300";
|
|
2558
2558
|
}
|
|
2559
2559
|
}
|
|
2560
|
-
const
|
|
2560
|
+
const Vs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-surface-secondary border border-dc-border rounded-lg p-4 space-y-4", children: [
|
|
2561
2561
|
/* @__PURE__ */ r("div", { className: "border-b border-dc-border pb-3", children: [
|
|
2562
2562
|
/* @__PURE__ */ r("h4", { className: "text-sm font-semibold text-dc-text mb-2 flex items-center", children: [
|
|
2563
|
-
/* @__PURE__ */ e(
|
|
2563
|
+
/* @__PURE__ */ e(Lr, { className: "w-4 h-4 mr-2" }),
|
|
2564
2564
|
"Query Summary"
|
|
2565
2565
|
] }),
|
|
2566
2566
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 text-xs", children: [
|
|
@@ -2590,7 +2590,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2590
2590
|
/* @__PURE__ */ r("div", { className: "bg-dc-surface p-3 rounded text-sm", children: [
|
|
2591
2591
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-2 flex-wrap", children: [
|
|
2592
2592
|
/* @__PURE__ */ e("span", { className: "font-mono font-medium text-dc-primary", children: t.primaryCube.selectedCube }),
|
|
2593
|
-
/* @__PURE__ */ e("span", { className: `text-xs px-2 py-0.5 rounded ${
|
|
2593
|
+
/* @__PURE__ */ e("span", { className: `text-xs px-2 py-0.5 rounded ${Ls(t.primaryCube.reason)}`, children: _t(t.primaryCube.reason) })
|
|
2594
2594
|
] }),
|
|
2595
2595
|
/* @__PURE__ */ e("p", { className: "text-dc-text-secondary text-xs", children: t.primaryCube.explanation }),
|
|
2596
2596
|
t.primaryCube.candidates && t.primaryCube.candidates.length > 1 && /* @__PURE__ */ r("details", { className: "mt-2", children: [
|
|
@@ -2599,7 +2599,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2599
2599
|
t.primaryCube.candidates.length,
|
|
2600
2600
|
")"
|
|
2601
2601
|
] }),
|
|
2602
|
-
/* @__PURE__ */ e("div", { className: "mt-2 space-y-1 ml-2", children: t.primaryCube.candidates.map((s,
|
|
2602
|
+
/* @__PURE__ */ e("div", { className: "mt-2 space-y-1 ml-2", children: t.primaryCube.candidates.map((s, a) => /* @__PURE__ */ r("div", { className: "text-xs flex items-center gap-2 flex-wrap", children: [
|
|
2603
2603
|
/* @__PURE__ */ e("span", { className: `font-mono ${s.cubeName === t.primaryCube.selectedCube ? "font-bold text-dc-primary" : "text-dc-text-muted"}`, children: s.cubeName }),
|
|
2604
2604
|
/* @__PURE__ */ r("span", { className: "text-dc-text-muted", children: [
|
|
2605
2605
|
"dims: ",
|
|
@@ -2611,19 +2611,19 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2611
2611
|
/* @__PURE__ */ e(Oe, { className: "w-3 h-3" }),
|
|
2612
2612
|
"reachable"
|
|
2613
2613
|
] }) : /* @__PURE__ */ r("span", { className: "text-red-600 dark:text-red-400 flex items-center gap-0.5", children: [
|
|
2614
|
-
/* @__PURE__ */ e(
|
|
2614
|
+
/* @__PURE__ */ e(Vr, { className: "w-3 h-3" }),
|
|
2615
2615
|
"cannot reach all"
|
|
2616
2616
|
] })
|
|
2617
|
-
] },
|
|
2617
|
+
] }, a)) })
|
|
2618
2618
|
] })
|
|
2619
2619
|
] })
|
|
2620
2620
|
] }),
|
|
2621
2621
|
t.joinPaths.length > 0 && /* @__PURE__ */ r("div", { className: "border-b border-dc-border pb-3", children: [
|
|
2622
2622
|
/* @__PURE__ */ r("h4", { className: "text-sm font-semibold text-dc-text mb-2 flex items-center", children: [
|
|
2623
|
-
/* @__PURE__ */ e(
|
|
2623
|
+
/* @__PURE__ */ e(Pr, { className: "w-4 h-4 mr-2" }),
|
|
2624
2624
|
"Join Paths"
|
|
2625
2625
|
] }),
|
|
2626
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: t.joinPaths.map((s,
|
|
2626
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: t.joinPaths.map((s, a) => /* @__PURE__ */ r("div", { className: "bg-dc-surface p-3 rounded text-sm", children: [
|
|
2627
2627
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-2 flex-wrap", children: [
|
|
2628
2628
|
/* @__PURE__ */ e("span", { className: "font-mono text-dc-text-secondary", children: t.primaryCube.selectedCube }),
|
|
2629
2629
|
/* @__PURE__ */ e(Ft, { className: "w-4 h-4 text-dc-text-muted" }),
|
|
@@ -2659,14 +2659,14 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2659
2659
|
] }),
|
|
2660
2660
|
/* @__PURE__ */ e("div", { className: "mt-1 text-xs text-dc-text-muted ml-2", children: s.visitedCubes.join(" → ") })
|
|
2661
2661
|
] })
|
|
2662
|
-
] },
|
|
2662
|
+
] }, a)) })
|
|
2663
2663
|
] }),
|
|
2664
2664
|
t.preAggregations.length > 0 && /* @__PURE__ */ r("div", { className: "border-b border-dc-border pb-3", children: [
|
|
2665
2665
|
/* @__PURE__ */ r("h4", { className: "text-sm font-semibold text-dc-text mb-2 flex items-center", children: [
|
|
2666
2666
|
/* @__PURE__ */ e(xt, { className: "w-4 h-4 mr-2" }),
|
|
2667
2667
|
"Pre-Aggregation CTEs"
|
|
2668
2668
|
] }),
|
|
2669
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: t.preAggregations.map((s,
|
|
2669
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: t.preAggregations.map((s, a) => /* @__PURE__ */ r("div", { className: "bg-dc-surface p-3 rounded text-sm", children: [
|
|
2670
2670
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-1 flex-wrap", children: [
|
|
2671
2671
|
/* @__PURE__ */ e("span", { className: "font-mono font-medium text-dc-text", children: s.cubeName }),
|
|
2672
2672
|
/* @__PURE__ */ e("span", { className: "text-xs text-dc-text-muted", children: "as" }),
|
|
@@ -2683,24 +2683,24 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2683
2683
|
" ",
|
|
2684
2684
|
s.joinKeys.map((i) => `${i.sourceColumn}=${i.targetColumn}`).join(", ")
|
|
2685
2685
|
] })
|
|
2686
|
-
] },
|
|
2686
|
+
] }, a)) })
|
|
2687
2687
|
] }),
|
|
2688
2688
|
t.warnings && t.warnings.length > 0 && /* @__PURE__ */ r("div", { children: [
|
|
2689
2689
|
/* @__PURE__ */ r("h4", { className: "text-sm font-semibold text-amber-600 dark:text-amber-400 mb-2 flex items-center", children: [
|
|
2690
2690
|
/* @__PURE__ */ e(Ue, { className: "w-4 h-4 mr-2" }),
|
|
2691
2691
|
"Warnings"
|
|
2692
2692
|
] }),
|
|
2693
|
-
/* @__PURE__ */ e("ul", { className: "list-disc list-inside text-xs text-amber-600 dark:text-amber-400 space-y-1", children: t.warnings.map((s,
|
|
2693
|
+
/* @__PURE__ */ e("ul", { className: "list-disc list-inside text-xs text-amber-600 dark:text-amber-400 space-y-1", children: t.warnings.map((s, a) => /* @__PURE__ */ e("li", { children: s }, a)) })
|
|
2694
2694
|
] }),
|
|
2695
2695
|
t.cubesInvolved.length > 0 && /* @__PURE__ */ r("div", { className: "text-xs text-dc-text-muted pt-2 border-t border-dc-border", children: [
|
|
2696
2696
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Cubes involved:" }),
|
|
2697
2697
|
" ",
|
|
2698
2698
|
t.cubesInvolved.join(", ")
|
|
2699
2699
|
] })
|
|
2700
|
-
] }),
|
|
2700
|
+
] }), Ps = ({
|
|
2701
2701
|
query: t,
|
|
2702
2702
|
schema: s,
|
|
2703
|
-
validationStatus:
|
|
2703
|
+
validationStatus: a,
|
|
2704
2704
|
validationError: i,
|
|
2705
2705
|
validationSql: u,
|
|
2706
2706
|
validationAnalysis: d,
|
|
@@ -2721,16 +2721,16 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2721
2721
|
shareButtonState: R = "idle",
|
|
2722
2722
|
isViewingShared: L = !1
|
|
2723
2723
|
}) => {
|
|
2724
|
-
const [
|
|
2724
|
+
const [n, b] = q(!1), [p, N] = q(!1), [E, T] = q(!1);
|
|
2725
2725
|
se(() => {
|
|
2726
|
-
(
|
|
2726
|
+
(n || p) && typeof window < "u" && window.Prism && setTimeout(() => {
|
|
2727
2727
|
try {
|
|
2728
2728
|
window.Prism.highlightAll();
|
|
2729
2729
|
} catch {
|
|
2730
2730
|
}
|
|
2731
2731
|
}, 0);
|
|
2732
|
-
}, [
|
|
2733
|
-
const z = _e(t), P =
|
|
2732
|
+
}, [n, p, t, u]);
|
|
2733
|
+
const z = _e(t), P = Cs(t), y = async () => {
|
|
2734
2734
|
const j = $e(t);
|
|
2735
2735
|
try {
|
|
2736
2736
|
await navigator.clipboard.writeText(JSON.stringify(j, null, 2));
|
|
@@ -2784,10 +2784,10 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2784
2784
|
case "desc":
|
|
2785
2785
|
return /* @__PURE__ */ e(be, { className: `w-4 h-4 ${j ? "stroke-3" : ""}` });
|
|
2786
2786
|
default:
|
|
2787
|
-
return /* @__PURE__ */ e(
|
|
2787
|
+
return /* @__PURE__ */ e(_r, { className: "w-4 h-4" });
|
|
2788
2788
|
}
|
|
2789
2789
|
}, U = (j) => {
|
|
2790
|
-
const K = qe(j, t.order), W =
|
|
2790
|
+
const K = qe(j, t.order), W = $s(K);
|
|
2791
2791
|
k(j, W);
|
|
2792
2792
|
}, J = (j, K) => {
|
|
2793
2793
|
const W = qe(j, t.order), ee = "focus:outline-hidden shrink-0 p-1 transition-colors";
|
|
@@ -2915,7 +2915,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2915
2915
|
onChange: (K) => m(j.dimension, K.target.value),
|
|
2916
2916
|
className: "bg-dc-time-dimension border-none text-dc-time-dimension text-xs rounded-sm focus:ring-2 focus:ring-blue-500 flex-1",
|
|
2917
2917
|
onClick: (K) => K.stopPropagation(),
|
|
2918
|
-
children:
|
|
2918
|
+
children: Ns.map((K) => /* @__PURE__ */ e("option", { value: K.value, children: K.label }, K.value))
|
|
2919
2919
|
}
|
|
2920
2920
|
)
|
|
2921
2921
|
] })
|
|
@@ -2950,7 +2950,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2950
2950
|
)
|
|
2951
2951
|
] }),
|
|
2952
2952
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
2953
|
-
z && /* @__PURE__ */ r(
|
|
2953
|
+
z && /* @__PURE__ */ r(ae, { children: [
|
|
2954
2954
|
/* @__PURE__ */ r("span", { className: "hidden lg:inline text-xs text-dc-text-muted mr-1", children: [
|
|
2955
2955
|
P,
|
|
2956
2956
|
" field",
|
|
@@ -2964,7 +2964,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2964
2964
|
className: "flex items-center gap-1 px-3 py-2 text-xs font-medium text-purple-700 dark:text-purple-300 bg-purple-100 dark:bg-purple-900/30 border border-purple-200 dark:border-purple-800 rounded-sm hover:bg-purple-200 dark:hover:bg-purple-900/50 focus:outline-hidden focus:ring-2 focus:ring-purple-500",
|
|
2965
2965
|
title: "Copy query to clipboard",
|
|
2966
2966
|
children: [
|
|
2967
|
-
/* @__PURE__ */ e(
|
|
2967
|
+
/* @__PURE__ */ e(Mr, { className: "w-3 h-3" }),
|
|
2968
2968
|
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "Copy Query" })
|
|
2969
2969
|
]
|
|
2970
2970
|
}
|
|
@@ -2976,13 +2976,13 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2976
2976
|
className: `flex items-center gap-1 px-3 py-2 text-xs font-medium rounded-sm focus:outline-hidden focus:ring-2 transition-colors ${R === "idle" ? "text-blue-700 dark:text-blue-300 bg-blue-100 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-800 hover:bg-blue-200 dark:hover:bg-blue-900/50 focus:ring-blue-500" : "text-green-700 dark:text-green-300 bg-green-100 dark:bg-green-900/30 border border-green-200 dark:border-green-800 focus:ring-green-500"}`,
|
|
2977
2977
|
title: R === "idle" ? "Share this analysis" : "Link copied!",
|
|
2978
2978
|
disabled: R !== "idle",
|
|
2979
|
-
children: R === "idle" ? /* @__PURE__ */ r(
|
|
2979
|
+
children: R === "idle" ? /* @__PURE__ */ r(ae, { children: [
|
|
2980
2980
|
/* @__PURE__ */ e($t, { className: "w-3 h-3" }),
|
|
2981
2981
|
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "Share" })
|
|
2982
|
-
] }) : R === "copied" ? /* @__PURE__ */ r(
|
|
2982
|
+
] }) : R === "copied" ? /* @__PURE__ */ r(ae, { children: [
|
|
2983
2983
|
/* @__PURE__ */ e(Ke, { className: "w-3 h-3" }),
|
|
2984
2984
|
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "Copied!" })
|
|
2985
|
-
] }) : /* @__PURE__ */ r(
|
|
2985
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
2986
2986
|
/* @__PURE__ */ e(Ke, { className: "w-3 h-3" }),
|
|
2987
2987
|
/* @__PURE__ */ e("span", { className: "hidden sm:inline", children: "Copied!" }),
|
|
2988
2988
|
/* @__PURE__ */ e("span", { className: "hidden lg:inline text-[10px] opacity-75", children: "(no chart)" })
|
|
@@ -2995,7 +2995,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
2995
2995
|
onClick: x,
|
|
2996
2996
|
className: "text-dc-text-muted hover:text-red-600 focus:outline-hidden p-2",
|
|
2997
2997
|
title: "Clear all fields",
|
|
2998
|
-
children: /* @__PURE__ */ e(
|
|
2998
|
+
children: /* @__PURE__ */ e(Zt, { className: "w-3 h-3 sm:w-4 sm:h-4" })
|
|
2999
2999
|
}
|
|
3000
3000
|
)
|
|
3001
3001
|
] }),
|
|
@@ -3009,7 +3009,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3009
3009
|
}
|
|
3010
3010
|
),
|
|
3011
3011
|
/* @__PURE__ */ e(() => {
|
|
3012
|
-
switch (
|
|
3012
|
+
switch (a) {
|
|
3013
3013
|
case "validating":
|
|
3014
3014
|
return /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-blue-600" });
|
|
3015
3015
|
case "valid":
|
|
@@ -3084,8 +3084,8 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3084
3084
|
}) })
|
|
3085
3085
|
] })
|
|
3086
3086
|
] }),
|
|
3087
|
-
|
|
3088
|
-
|
|
3087
|
+
Fs(t) && /* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(
|
|
3088
|
+
Os,
|
|
3089
3089
|
{
|
|
3090
3090
|
timeDimensions: t.timeDimensions || [],
|
|
3091
3091
|
onDateRangeChange: h,
|
|
@@ -3093,7 +3093,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3093
3093
|
}
|
|
3094
3094
|
) }),
|
|
3095
3095
|
/* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(
|
|
3096
|
-
|
|
3096
|
+
lr,
|
|
3097
3097
|
{
|
|
3098
3098
|
filters: t.filters || [],
|
|
3099
3099
|
schema: s,
|
|
@@ -3114,12 +3114,12 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3114
3114
|
"button",
|
|
3115
3115
|
{
|
|
3116
3116
|
onClick: () => {
|
|
3117
|
-
const j = !
|
|
3117
|
+
const j = !n;
|
|
3118
3118
|
b(j), j && (N(!1), T(!1));
|
|
3119
3119
|
},
|
|
3120
3120
|
className: "text-sm text-dc-text-secondary hover:text-dc-text focus:outline-hidden focus:underline",
|
|
3121
3121
|
children: [
|
|
3122
|
-
|
|
3122
|
+
n ? "Hide" : "Show",
|
|
3123
3123
|
" JSON Query"
|
|
3124
3124
|
]
|
|
3125
3125
|
}
|
|
@@ -3153,7 +3153,7 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3153
3153
|
}
|
|
3154
3154
|
)
|
|
3155
3155
|
] }),
|
|
3156
|
-
|
|
3156
|
+
n && /* @__PURE__ */ r("div", { className: "bg-dc-surface-secondary border border-dc-border rounded-lg p-4", children: [
|
|
3157
3157
|
/* @__PURE__ */ e("div", { className: "text-xs font-semibold text-dc-text-secondary mb-2", children: "JSON Query:" }),
|
|
3158
3158
|
/* @__PURE__ */ e("pre", { className: "text-dc-text-secondary overflow-x-auto font-mono", style: { fontSize: "12px", lineHeight: "1.4" }, children: /* @__PURE__ */ e("code", { className: "language-json", children: JSON.stringify($e(t), null, 2) }) })
|
|
3159
3159
|
] }),
|
|
@@ -3162,35 +3162,35 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3162
3162
|
/* @__PURE__ */ e("pre", { className: "text-dc-text-secondary overflow-x-auto whitespace-pre-wrap font-mono", style: { fontSize: "12px", lineHeight: "1.4" }, children: /* @__PURE__ */ e("code", { className: "language-sql", children: u.sql.join(`;
|
|
3163
3163
|
|
|
3164
3164
|
`) }) }),
|
|
3165
|
-
u.params && u.params.length > 0 && /* @__PURE__ */ r(
|
|
3165
|
+
u.params && u.params.length > 0 && /* @__PURE__ */ r(ae, { children: [
|
|
3166
3166
|
/* @__PURE__ */ e("div", { className: "text-xs font-semibold text-dc-text-secondary mb-2 mt-4", children: "Parameters:" }),
|
|
3167
3167
|
/* @__PURE__ */ e("pre", { className: "text-dc-text-secondary overflow-x-auto font-mono", style: { fontSize: "12px", lineHeight: "1.4" }, children: /* @__PURE__ */ e("code", { className: "language-json", children: JSON.stringify(u.params, null, 2) }) })
|
|
3168
3168
|
] })
|
|
3169
3169
|
] }),
|
|
3170
|
-
E && d && /* @__PURE__ */ e(
|
|
3170
|
+
E && d && /* @__PURE__ */ e(Vs, { analysis: d })
|
|
3171
3171
|
] })
|
|
3172
3172
|
] }) : /* @__PURE__ */ e("div", { className: "py-8 flex items-center justify-center text-dc-text-muted", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
3173
3173
|
/* @__PURE__ */ e(ht, { className: "w-12 h-12 mx-auto text-dc-text-muted mb-3" }),
|
|
3174
3174
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold mb-1", children: "No fields selected" }),
|
|
3175
3175
|
/* @__PURE__ */ e("div", { className: "text-xs", children: "Select measures, dimensions, or time dimensions from the schema explorer" })
|
|
3176
3176
|
] }) }) }),
|
|
3177
|
-
(z ||
|
|
3177
|
+
(z || a === "valid" || a === "invalid") && /* @__PURE__ */ e("div", { className: "border-t border-dc-border p-4", children: /* @__PURE__ */ r("div", { className: "flex space-x-3", children: [
|
|
3178
3178
|
/* @__PURE__ */ e(
|
|
3179
3179
|
"button",
|
|
3180
3180
|
{
|
|
3181
3181
|
onClick: f,
|
|
3182
|
-
disabled:
|
|
3183
|
-
className: `flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition-colors ${
|
|
3184
|
-
children:
|
|
3182
|
+
disabled: a === "validating",
|
|
3183
|
+
className: `flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition-colors ${a === "validating" ? "bg-dc-surface-secondary text-dc-text-muted cursor-not-allowed" : a === "valid" ? "bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 border border-green-200 dark:border-green-800 hover:bg-green-200 dark:hover:bg-green-900/50" : a === "invalid" ? "bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-300 border border-red-200 dark:border-red-800 hover:bg-red-200 dark:hover:bg-red-900/50" : "bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 border border-purple-200 dark:border-purple-800 hover:bg-purple-200 dark:hover:bg-purple-900/50"}`,
|
|
3184
|
+
children: a === "validating" ? /* @__PURE__ */ r(ae, { children: [
|
|
3185
3185
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-current mr-2" }),
|
|
3186
3186
|
"Validating..."
|
|
3187
|
-
] }) :
|
|
3187
|
+
] }) : a === "valid" ? /* @__PURE__ */ r(ae, { children: [
|
|
3188
3188
|
/* @__PURE__ */ e(Ke, { className: "w-4 h-4 mr-2" }),
|
|
3189
3189
|
"Re-validate Query"
|
|
3190
|
-
] }) :
|
|
3190
|
+
] }) : a === "invalid" ? /* @__PURE__ */ r(ae, { children: [
|
|
3191
3191
|
/* @__PURE__ */ e(Le, { className: "w-4 h-4 mr-2" }),
|
|
3192
3192
|
"Validate Again"
|
|
3193
|
-
] }) : /* @__PURE__ */ r(
|
|
3193
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
3194
3194
|
/* @__PURE__ */ e(Ke, { className: "w-4 h-4 mr-2" }),
|
|
3195
3195
|
"Validate Query"
|
|
3196
3196
|
] })
|
|
@@ -3200,40 +3200,40 @@ const qs = ({ analysis: t }) => /* @__PURE__ */ r("div", { className: "bg-dc-sur
|
|
|
3200
3200
|
"button",
|
|
3201
3201
|
{
|
|
3202
3202
|
onClick: g,
|
|
3203
|
-
disabled:
|
|
3204
|
-
className: `flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition-colors ${
|
|
3205
|
-
style:
|
|
3203
|
+
disabled: a !== "valid",
|
|
3204
|
+
className: `flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition-colors ${a !== "valid" ? "bg-dc-surface-secondary text-dc-text-muted cursor-not-allowed border border-dc-border" : "text-white border border-green-700 hover:bg-green-700 focus:ring-2 focus:ring-green-500"}`,
|
|
3205
|
+
style: a === "valid" ? { backgroundColor: "var(--dc-primary)" } : void 0,
|
|
3206
3206
|
children: [
|
|
3207
|
-
/* @__PURE__ */ e(
|
|
3207
|
+
/* @__PURE__ */ e(qr, { className: "w-4 h-4 mr-2" }),
|
|
3208
3208
|
"Run Query"
|
|
3209
3209
|
]
|
|
3210
3210
|
}
|
|
3211
3211
|
)
|
|
3212
3212
|
] }) })
|
|
3213
3213
|
] });
|
|
3214
|
-
},
|
|
3215
|
-
bar:
|
|
3216
|
-
line:
|
|
3217
|
-
area:
|
|
3218
|
-
pie:
|
|
3219
|
-
scatter:
|
|
3220
|
-
bubble:
|
|
3221
|
-
radar:
|
|
3222
|
-
radialBar:
|
|
3223
|
-
treemap:
|
|
3224
|
-
table:
|
|
3225
|
-
activityGrid:
|
|
3226
|
-
kpiNumber:
|
|
3227
|
-
kpiDelta:
|
|
3228
|
-
kpiText:
|
|
3229
|
-
markdown:
|
|
3214
|
+
}, at = {
|
|
3215
|
+
bar: Hr,
|
|
3216
|
+
line: Gr,
|
|
3217
|
+
area: Wr,
|
|
3218
|
+
pie: Yr,
|
|
3219
|
+
scatter: Kr,
|
|
3220
|
+
bubble: Xr,
|
|
3221
|
+
radar: Zr,
|
|
3222
|
+
radialBar: es,
|
|
3223
|
+
treemap: ts,
|
|
3224
|
+
table: rs,
|
|
3225
|
+
activityGrid: ss,
|
|
3226
|
+
kpiNumber: as,
|
|
3227
|
+
kpiDelta: ns,
|
|
3228
|
+
kpiText: ls,
|
|
3229
|
+
markdown: is
|
|
3230
3230
|
};
|
|
3231
|
-
function
|
|
3231
|
+
function ir({
|
|
3232
3232
|
selectedType: t,
|
|
3233
3233
|
onTypeChange: s,
|
|
3234
|
-
className:
|
|
3234
|
+
className: a = ""
|
|
3235
3235
|
}) {
|
|
3236
|
-
const [i, u] = q(!1), d = Object.entries(
|
|
3236
|
+
const [i, u] = q(!1), d = Object.entries(at), f = {
|
|
3237
3237
|
bar: "Bar Chart",
|
|
3238
3238
|
line: "Line Chart",
|
|
3239
3239
|
area: "Area Chart",
|
|
@@ -3249,8 +3249,8 @@ function or({
|
|
|
3249
3249
|
kpiDelta: "KPI Delta",
|
|
3250
3250
|
kpiText: "KPI Text",
|
|
3251
3251
|
markdown: "Markdown"
|
|
3252
|
-
}, o =
|
|
3253
|
-
return /* @__PURE__ */ r("div", { className: `${
|
|
3252
|
+
}, o = at[t]?.icon, m = f[t];
|
|
3253
|
+
return /* @__PURE__ */ r("div", { className: `${a} relative`, children: [
|
|
3254
3254
|
/* @__PURE__ */ r(
|
|
3255
3255
|
"button",
|
|
3256
3256
|
{
|
|
@@ -3318,10 +3318,10 @@ function or({
|
|
|
3318
3318
|
}) }) }) })
|
|
3319
3319
|
] });
|
|
3320
3320
|
}
|
|
3321
|
-
function
|
|
3321
|
+
function Ms({
|
|
3322
3322
|
config: t,
|
|
3323
3323
|
fields: s,
|
|
3324
|
-
onDrop:
|
|
3324
|
+
onDrop: a,
|
|
3325
3325
|
onRemove: i,
|
|
3326
3326
|
onDragStart: u,
|
|
3327
3327
|
onDragEnd: d,
|
|
@@ -3330,7 +3330,7 @@ function Is({
|
|
|
3330
3330
|
onReorder: o,
|
|
3331
3331
|
draggedItem: m
|
|
3332
3332
|
}) {
|
|
3333
|
-
const { key: c, label: h, description: l, mandatory: k, maxItems: x, emptyText: D, icon: S } = t, [O, $] = q(null), [V, R] = q(!1), [L,
|
|
3333
|
+
const { key: c, label: h, description: l, mandatory: k, maxItems: x, emptyText: D, icon: S } = t, [O, $] = q(null), [V, R] = q(!1), [L, n] = q(!1), b = () => {
|
|
3334
3334
|
let y = s.length;
|
|
3335
3335
|
return m && m.fromAxis === c && (y = Math.max(0, s.length - 1)), !x || y < x;
|
|
3336
3336
|
}, p = () => {
|
|
@@ -3339,20 +3339,20 @@ function Is({
|
|
|
3339
3339
|
}, N = b(), E = p();
|
|
3340
3340
|
Ie.useEffect(() => {
|
|
3341
3341
|
const y = () => {
|
|
3342
|
-
$(null), R(!1),
|
|
3342
|
+
$(null), R(!1), n(!1);
|
|
3343
3343
|
};
|
|
3344
3344
|
return document.addEventListener("dragend", y), () => {
|
|
3345
3345
|
document.removeEventListener("dragend", y);
|
|
3346
3346
|
};
|
|
3347
3347
|
}, []), Ie.useEffect(() => {
|
|
3348
|
-
m ? m.fromAxis !== c ? (
|
|
3348
|
+
m ? m.fromAxis !== c ? (n(!1), $(null)) : m.fromAxis === c && m.fromIndex !== void 0 && R(!1) : ($(null), R(!1), n(!1));
|
|
3349
3349
|
}, [m, c]);
|
|
3350
3350
|
const T = (y, F) => {
|
|
3351
|
-
m && m.fromAxis === c && m.fromIndex !== void 0 && (y.preventDefault(), y.stopPropagation(), $(F),
|
|
3351
|
+
m && m.fromAxis === c && m.fromIndex !== void 0 && (y.preventDefault(), y.stopPropagation(), $(F), n(!0));
|
|
3352
3352
|
}, z = () => {
|
|
3353
3353
|
$(null);
|
|
3354
3354
|
}, P = (y, F) => {
|
|
3355
|
-
if (y.preventDefault(), y.stopPropagation(), $(null),
|
|
3355
|
+
if (y.preventDefault(), y.stopPropagation(), $(null), n(!1), m && m.fromAxis === c && m.fromIndex !== void 0 && o) {
|
|
3356
3356
|
o(m.fromIndex, F, c);
|
|
3357
3357
|
return;
|
|
3358
3358
|
}
|
|
@@ -3394,12 +3394,12 @@ function Is({
|
|
|
3394
3394
|
},
|
|
3395
3395
|
onDragLeave: (y) => {
|
|
3396
3396
|
const F = y.currentTarget.getBoundingClientRect(), C = y.clientX < F.left || y.clientX > F.right || y.clientY < F.top || y.clientY > F.bottom, I = y.relatedTarget, U = I && !y.currentTarget.contains(I);
|
|
3397
|
-
(C || U || y.currentTarget === y.target) && (R(!1),
|
|
3397
|
+
(C || U || y.currentTarget === y.target) && (R(!1), n(!1));
|
|
3398
3398
|
},
|
|
3399
3399
|
onDrop: (y) => {
|
|
3400
3400
|
if (m && m.fromAxis === c && m.fromIndex !== void 0)
|
|
3401
3401
|
return;
|
|
3402
|
-
N || x === 1 ?
|
|
3402
|
+
N || x === 1 ? a(y, c) : y.preventDefault(), R(!1), n(!1);
|
|
3403
3403
|
},
|
|
3404
3404
|
children: s.length === 0 ? /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted text-center w-full", children: E ? "Maximum items reached" : D || "Drop fields here" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: s.map((y, F) => {
|
|
3405
3405
|
const { IconComponent: C, baseClasses: I, hoverClasses: U } = g(y), J = O === F, te = m && m.field === y && m.fromAxis === c;
|
|
@@ -3450,22 +3450,22 @@ function Is({
|
|
|
3450
3450
|
function wt({
|
|
3451
3451
|
chartType: t,
|
|
3452
3452
|
chartConfig: s,
|
|
3453
|
-
displayConfig:
|
|
3453
|
+
displayConfig: a,
|
|
3454
3454
|
availableFields: i,
|
|
3455
3455
|
colorPalette: u,
|
|
3456
3456
|
onChartConfigChange: d,
|
|
3457
3457
|
onDisplayConfigChange: f
|
|
3458
3458
|
}) {
|
|
3459
3459
|
const [g, o] = q(null), m = ye(
|
|
3460
|
-
() => Gt(t,
|
|
3460
|
+
() => Gt(t, at),
|
|
3461
3461
|
[t]
|
|
3462
|
-
), c = m.skipQuery === !0, h = (
|
|
3463
|
-
const b = s[
|
|
3462
|
+
), c = m.skipQuery === !0, h = (n) => {
|
|
3463
|
+
const b = s[n];
|
|
3464
3464
|
return Array.isArray(b) ? b : typeof b == "string" ? [b] : [];
|
|
3465
3465
|
};
|
|
3466
3466
|
se(() => {
|
|
3467
3467
|
if (!i) return;
|
|
3468
|
-
const
|
|
3468
|
+
const n = [
|
|
3469
3469
|
...i.dimensions,
|
|
3470
3470
|
...i.timeDimensions,
|
|
3471
3471
|
...i.measures
|
|
@@ -3473,12 +3473,12 @@ function wt({
|
|
|
3473
3473
|
let b = !1;
|
|
3474
3474
|
const p = { ...s };
|
|
3475
3475
|
m.dropZones.forEach((N) => {
|
|
3476
|
-
const E = h(N.key), T = E.filter((z) =>
|
|
3476
|
+
const E = h(N.key), T = E.filter((z) => n.includes(z));
|
|
3477
3477
|
T.length !== E.length && (b = !0, T.length === 0 ? delete p[N.key] : N.maxItems === 1 ? p[N.key] = T[0] : p[N.key] = T);
|
|
3478
3478
|
}), b && d(p);
|
|
3479
3479
|
}, [i, s, m.dropZones, d]);
|
|
3480
|
-
const l = (
|
|
3481
|
-
switch (l(
|
|
3480
|
+
const l = (n) => i ? i.measures.includes(n) ? "measure" : i.timeDimensions.includes(n) ? "timeDimension" : "dimension" : "dimension", k = (n) => {
|
|
3481
|
+
switch (l(n)) {
|
|
3482
3482
|
case "measure":
|
|
3483
3483
|
return {
|
|
3484
3484
|
IconComponent: He,
|
|
@@ -3498,15 +3498,15 @@ function wt({
|
|
|
3498
3498
|
hoverClasses: "hover:opacity-80"
|
|
3499
3499
|
};
|
|
3500
3500
|
}
|
|
3501
|
-
}, x = (
|
|
3502
|
-
|
|
3503
|
-
}, D = (
|
|
3504
|
-
|
|
3501
|
+
}, x = (n, b, p, N) => {
|
|
3502
|
+
n.dataTransfer.setData("text/plain", JSON.stringify({ field: b, fromAxis: p, fromIndex: N })), o({ field: b, fromAxis: p, fromIndex: N });
|
|
3503
|
+
}, D = (n) => {
|
|
3504
|
+
n.preventDefault();
|
|
3505
3505
|
}, S = () => {
|
|
3506
3506
|
o(null);
|
|
3507
|
-
}, O = (
|
|
3508
|
-
|
|
3509
|
-
const p = JSON.parse(
|
|
3507
|
+
}, O = (n, b) => {
|
|
3508
|
+
n.preventDefault();
|
|
3509
|
+
const p = JSON.parse(n.dataTransfer.getData("text/plain")), { field: N, fromAxis: E } = p, T = { ...s };
|
|
3510
3510
|
if (E !== "available" && E !== b) {
|
|
3511
3511
|
const y = T[E];
|
|
3512
3512
|
if (Array.isArray(y)) {
|
|
@@ -3516,28 +3516,28 @@ function wt({
|
|
|
3516
3516
|
}
|
|
3517
3517
|
const z = T[b];
|
|
3518
3518
|
m.dropZones.find((y) => y.key === b)?.maxItems === 1 ? T[b] = N : Array.isArray(z) ? z.includes(N) || (T[b] = [...z, N]) : T[b] = [N], o(null), d(T);
|
|
3519
|
-
}, $ = (
|
|
3519
|
+
}, $ = (n, b) => {
|
|
3520
3520
|
const p = { ...s }, N = p[b];
|
|
3521
3521
|
if (Array.isArray(N)) {
|
|
3522
|
-
const E = N.filter((T) => T !==
|
|
3522
|
+
const E = N.filter((T) => T !== n);
|
|
3523
3523
|
E.length === 0 ? delete p[b] : p[b] = E;
|
|
3524
|
-
} else N ===
|
|
3524
|
+
} else N === n && delete p[b];
|
|
3525
3525
|
d(p);
|
|
3526
|
-
}, V = (
|
|
3526
|
+
}, V = (n, b, p) => {
|
|
3527
3527
|
const N = { ...s }, E = N[p];
|
|
3528
|
-
if (Array.isArray(E) && E.length > 1 &&
|
|
3529
|
-
const T = [...E], [z] = T.splice(
|
|
3528
|
+
if (Array.isArray(E) && E.length > 1 && n !== b) {
|
|
3529
|
+
const T = [...E], [z] = T.splice(n, 1);
|
|
3530
3530
|
T.splice(b, 0, z), N[p] = T, o(null), d(N);
|
|
3531
3531
|
}
|
|
3532
3532
|
}, L = (() => {
|
|
3533
3533
|
if (!i) return { dimensions: [], timeDimensions: [], measures: [] };
|
|
3534
|
-
const
|
|
3534
|
+
const n = /* @__PURE__ */ new Set();
|
|
3535
3535
|
return m.dropZones.forEach((b) => {
|
|
3536
|
-
h(b.key).forEach((p) =>
|
|
3537
|
-
}), g && g.fromAxis !== "available" &&
|
|
3538
|
-
dimensions: i.dimensions.filter((b) => !
|
|
3539
|
-
timeDimensions: i.timeDimensions.filter((b) => !
|
|
3540
|
-
measures: i.measures.filter((b) => !
|
|
3536
|
+
h(b.key).forEach((p) => n.add(p));
|
|
3537
|
+
}), g && g.fromAxis !== "available" && n.add(g.field), {
|
|
3538
|
+
dimensions: i.dimensions.filter((b) => !n.has(b)),
|
|
3539
|
+
timeDimensions: i.timeDimensions.filter((b) => !n.has(b)),
|
|
3540
|
+
measures: i.measures.filter((b) => !n.has(b))
|
|
3541
3541
|
};
|
|
3542
3542
|
})();
|
|
3543
3543
|
return /* @__PURE__ */ r("div", { children: [
|
|
@@ -3550,19 +3550,19 @@ function wt({
|
|
|
3550
3550
|
"Dimensions"
|
|
3551
3551
|
] }),
|
|
3552
3552
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3553
|
-
L.dimensions.map((
|
|
3554
|
-
const b = g && g.field ===
|
|
3553
|
+
L.dimensions.map((n) => {
|
|
3554
|
+
const b = g && g.field === n && g.fromAxis === "available";
|
|
3555
3555
|
return /* @__PURE__ */ e(
|
|
3556
3556
|
"div",
|
|
3557
3557
|
{
|
|
3558
3558
|
draggable: !0,
|
|
3559
|
-
onDragStart: (p) => x(p,
|
|
3559
|
+
onDragStart: (p) => x(p, n, "available"),
|
|
3560
3560
|
onDragEnd: S,
|
|
3561
3561
|
className: `bg-dc-dimension text-dc-dimension border border-dc-dimension hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${b ? "opacity-50 cursor-grabbing" : ""}`,
|
|
3562
|
-
title:
|
|
3563
|
-
children:
|
|
3562
|
+
title: n,
|
|
3563
|
+
children: n
|
|
3564
3564
|
},
|
|
3565
|
-
|
|
3565
|
+
n
|
|
3566
3566
|
);
|
|
3567
3567
|
}),
|
|
3568
3568
|
L.dimensions.length === 0 && /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted italic", children: "None" })
|
|
@@ -3574,19 +3574,19 @@ function wt({
|
|
|
3574
3574
|
"Time Dimensions"
|
|
3575
3575
|
] }),
|
|
3576
3576
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3577
|
-
L.timeDimensions.map((
|
|
3578
|
-
const b = g && g.field ===
|
|
3577
|
+
L.timeDimensions.map((n) => {
|
|
3578
|
+
const b = g && g.field === n && g.fromAxis === "available";
|
|
3579
3579
|
return /* @__PURE__ */ e(
|
|
3580
3580
|
"div",
|
|
3581
3581
|
{
|
|
3582
3582
|
draggable: !0,
|
|
3583
|
-
onDragStart: (p) => x(p,
|
|
3583
|
+
onDragStart: (p) => x(p, n, "available"),
|
|
3584
3584
|
onDragEnd: S,
|
|
3585
3585
|
className: `bg-dc-time-dimension text-dc-time-dimension border border-dc-time-dimension hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${b ? "opacity-50 cursor-grabbing" : ""}`,
|
|
3586
|
-
title:
|
|
3587
|
-
children:
|
|
3586
|
+
title: n,
|
|
3587
|
+
children: n
|
|
3588
3588
|
},
|
|
3589
|
-
|
|
3589
|
+
n
|
|
3590
3590
|
);
|
|
3591
3591
|
}),
|
|
3592
3592
|
L.timeDimensions.length === 0 && /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted italic", children: "None" })
|
|
@@ -3598,19 +3598,19 @@ function wt({
|
|
|
3598
3598
|
"Measures"
|
|
3599
3599
|
] }),
|
|
3600
3600
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3601
|
-
L.measures.map((
|
|
3602
|
-
const b = g && g.field ===
|
|
3601
|
+
L.measures.map((n) => {
|
|
3602
|
+
const b = g && g.field === n && g.fromAxis === "available";
|
|
3603
3603
|
return /* @__PURE__ */ e(
|
|
3604
3604
|
"div",
|
|
3605
3605
|
{
|
|
3606
3606
|
draggable: !0,
|
|
3607
|
-
onDragStart: (p) => x(p,
|
|
3607
|
+
onDragStart: (p) => x(p, n, "available"),
|
|
3608
3608
|
onDragEnd: S,
|
|
3609
3609
|
className: `bg-dc-measure text-dc-measure border border-dc-measure hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${b ? "opacity-50 cursor-grabbing" : ""}`,
|
|
3610
|
-
title:
|
|
3611
|
-
children:
|
|
3610
|
+
title: n,
|
|
3611
|
+
children: n
|
|
3612
3612
|
},
|
|
3613
|
-
|
|
3613
|
+
n
|
|
3614
3614
|
);
|
|
3615
3615
|
}),
|
|
3616
3616
|
L.measures.length === 0 && /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted italic", children: "None" })
|
|
@@ -3620,11 +3620,11 @@ function wt({
|
|
|
3620
3620
|
] }),
|
|
3621
3621
|
!c && /* @__PURE__ */ r("div", { className: "mb-4", children: [
|
|
3622
3622
|
/* @__PURE__ */ e("h4", { className: "text-xs font-semibold text-dc-text-secondary mb-2", children: "Chart Configuration" }),
|
|
3623
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: m.dropZones.map((
|
|
3624
|
-
|
|
3623
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: m.dropZones.map((n) => /* @__PURE__ */ e(
|
|
3624
|
+
Ms,
|
|
3625
3625
|
{
|
|
3626
|
-
config:
|
|
3627
|
-
fields: h(
|
|
3626
|
+
config: n,
|
|
3627
|
+
fields: h(n.key),
|
|
3628
3628
|
onDrop: O,
|
|
3629
3629
|
onRemove: $,
|
|
3630
3630
|
onDragStart: x,
|
|
@@ -3634,7 +3634,7 @@ function wt({
|
|
|
3634
3634
|
onReorder: V,
|
|
3635
3635
|
draggedItem: g
|
|
3636
3636
|
},
|
|
3637
|
-
|
|
3637
|
+
n.key
|
|
3638
3638
|
)) })
|
|
3639
3639
|
] }),
|
|
3640
3640
|
(m.displayOptions && m.displayOptions.length > 0 || m.displayOptionsConfig && m.displayOptionsConfig.length > 0) && /* @__PURE__ */ r("div", { className: "mb-4", children: [
|
|
@@ -3645,10 +3645,10 @@ function wt({
|
|
|
3645
3645
|
"input",
|
|
3646
3646
|
{
|
|
3647
3647
|
type: "checkbox",
|
|
3648
|
-
checked:
|
|
3649
|
-
onChange: (
|
|
3650
|
-
...
|
|
3651
|
-
showLegend:
|
|
3648
|
+
checked: a.showLegend ?? !0,
|
|
3649
|
+
onChange: (n) => f({
|
|
3650
|
+
...a,
|
|
3651
|
+
showLegend: n.target.checked
|
|
3652
3652
|
}),
|
|
3653
3653
|
className: "rounded border-dc-border focus:ring-blue-500",
|
|
3654
3654
|
style: { color: "var(--dc-primary)" }
|
|
@@ -3661,10 +3661,10 @@ function wt({
|
|
|
3661
3661
|
"input",
|
|
3662
3662
|
{
|
|
3663
3663
|
type: "checkbox",
|
|
3664
|
-
checked:
|
|
3665
|
-
onChange: (
|
|
3666
|
-
...
|
|
3667
|
-
showGrid:
|
|
3664
|
+
checked: a.showGrid ?? !0,
|
|
3665
|
+
onChange: (n) => f({
|
|
3666
|
+
...a,
|
|
3667
|
+
showGrid: n.target.checked
|
|
3668
3668
|
}),
|
|
3669
3669
|
className: "rounded border-dc-border focus:ring-blue-500",
|
|
3670
3670
|
style: { color: "var(--dc-primary)" }
|
|
@@ -3677,10 +3677,10 @@ function wt({
|
|
|
3677
3677
|
"input",
|
|
3678
3678
|
{
|
|
3679
3679
|
type: "checkbox",
|
|
3680
|
-
checked:
|
|
3681
|
-
onChange: (
|
|
3682
|
-
...
|
|
3683
|
-
showTooltip:
|
|
3680
|
+
checked: a.showTooltip ?? !0,
|
|
3681
|
+
onChange: (n) => f({
|
|
3682
|
+
...a,
|
|
3683
|
+
showTooltip: n.target.checked
|
|
3684
3684
|
}),
|
|
3685
3685
|
className: "rounded border-dc-border focus:ring-blue-500",
|
|
3686
3686
|
style: { color: "var(--dc-primary)" }
|
|
@@ -3693,10 +3693,10 @@ function wt({
|
|
|
3693
3693
|
"input",
|
|
3694
3694
|
{
|
|
3695
3695
|
type: "checkbox",
|
|
3696
|
-
checked:
|
|
3697
|
-
onChange: (
|
|
3698
|
-
...
|
|
3699
|
-
stacked:
|
|
3696
|
+
checked: a.stacked ?? !1,
|
|
3697
|
+
onChange: (n) => f({
|
|
3698
|
+
...a,
|
|
3699
|
+
stacked: n.target.checked
|
|
3700
3700
|
}),
|
|
3701
3701
|
className: "rounded border-dc-border focus:ring-blue-500",
|
|
3702
3702
|
style: { color: "var(--dc-primary)" }
|
|
@@ -3709,10 +3709,10 @@ function wt({
|
|
|
3709
3709
|
"input",
|
|
3710
3710
|
{
|
|
3711
3711
|
type: "checkbox",
|
|
3712
|
-
checked:
|
|
3713
|
-
onChange: (
|
|
3714
|
-
...
|
|
3715
|
-
hideHeader:
|
|
3712
|
+
checked: a.hideHeader ?? !1,
|
|
3713
|
+
onChange: (n) => f({
|
|
3714
|
+
...a,
|
|
3715
|
+
hideHeader: n.target.checked
|
|
3716
3716
|
}),
|
|
3717
3717
|
className: "rounded border-dc-border focus:ring-blue-500",
|
|
3718
3718
|
style: { color: "var(--dc-primary)" }
|
|
@@ -3720,37 +3720,37 @@ function wt({
|
|
|
3720
3720
|
),
|
|
3721
3721
|
/* @__PURE__ */ e("span", { className: "text-sm text-dc-text", children: "Hide Header" })
|
|
3722
3722
|
] }),
|
|
3723
|
-
m.displayOptionsConfig?.map((
|
|
3724
|
-
|
|
3723
|
+
m.displayOptionsConfig?.map((n) => /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3724
|
+
n.type === "boolean" && /* @__PURE__ */ r("label", { className: "flex items-center space-x-2", children: [
|
|
3725
3725
|
/* @__PURE__ */ e(
|
|
3726
3726
|
"input",
|
|
3727
3727
|
{
|
|
3728
3728
|
type: "checkbox",
|
|
3729
|
-
checked: n
|
|
3729
|
+
checked: a[n.key] ?? n.defaultValue ?? !1,
|
|
3730
3730
|
onChange: (b) => f({
|
|
3731
|
-
...
|
|
3732
|
-
[
|
|
3731
|
+
...a,
|
|
3732
|
+
[n.key]: b.target.checked
|
|
3733
3733
|
}),
|
|
3734
3734
|
className: "rounded border-dc-border focus:ring-blue-500",
|
|
3735
3735
|
style: { color: "var(--dc-primary)" }
|
|
3736
3736
|
}
|
|
3737
3737
|
),
|
|
3738
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-dc-text", children:
|
|
3738
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-dc-text", children: n.label })
|
|
3739
3739
|
] }),
|
|
3740
|
-
|
|
3740
|
+
n.type === "string" && /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3741
3741
|
/* @__PURE__ */ r("label", { className: "text-sm text-dc-text-secondary", children: [
|
|
3742
|
-
|
|
3743
|
-
|
|
3742
|
+
n.label,
|
|
3743
|
+
n.key === "content" && /* @__PURE__ */ e("span", { className: "text-xs text-dc-text-muted ml-1", children: "(only headers, lists and links)" })
|
|
3744
3744
|
] }),
|
|
3745
|
-
|
|
3745
|
+
n.key === "content" ? /* @__PURE__ */ e(
|
|
3746
3746
|
"textarea",
|
|
3747
3747
|
{
|
|
3748
|
-
value: n
|
|
3748
|
+
value: a[n.key] ?? n.defaultValue ?? "",
|
|
3749
3749
|
onChange: (b) => f({
|
|
3750
|
-
...
|
|
3751
|
-
[
|
|
3750
|
+
...a,
|
|
3751
|
+
[n.key]: b.target.value
|
|
3752
3752
|
}),
|
|
3753
|
-
placeholder:
|
|
3753
|
+
placeholder: n.placeholder,
|
|
3754
3754
|
rows: 8,
|
|
3755
3755
|
className: "w-full px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 font-mono resize-y bg-dc-surface text-dc-text"
|
|
3756
3756
|
}
|
|
@@ -3758,28 +3758,28 @@ function wt({
|
|
|
3758
3758
|
"input",
|
|
3759
3759
|
{
|
|
3760
3760
|
type: "text",
|
|
3761
|
-
value: n
|
|
3761
|
+
value: a[n.key] ?? n.defaultValue ?? "",
|
|
3762
3762
|
onChange: (b) => f({
|
|
3763
|
-
...
|
|
3764
|
-
[
|
|
3763
|
+
...a,
|
|
3764
|
+
[n.key]: b.target.value
|
|
3765
3765
|
}),
|
|
3766
|
-
placeholder:
|
|
3766
|
+
placeholder: n.placeholder,
|
|
3767
3767
|
className: "w-full px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text"
|
|
3768
3768
|
}
|
|
3769
3769
|
),
|
|
3770
|
-
|
|
3770
|
+
n.description && /* @__PURE__ */ e("p", { className: "text-xs text-dc-text-muted", children: n.description })
|
|
3771
3771
|
] }),
|
|
3772
|
-
|
|
3773
|
-
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children:
|
|
3772
|
+
n.type === "paletteColor" && /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3773
|
+
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children: n.label }),
|
|
3774
3774
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: u?.colors.map((b, p) => {
|
|
3775
|
-
const N = (n
|
|
3775
|
+
const N = (a[n.key] ?? n.defaultValue ?? 0) === p;
|
|
3776
3776
|
return /* @__PURE__ */ e(
|
|
3777
3777
|
"button",
|
|
3778
3778
|
{
|
|
3779
3779
|
type: "button",
|
|
3780
3780
|
onClick: () => f({
|
|
3781
|
-
...
|
|
3782
|
-
[
|
|
3781
|
+
...a,
|
|
3782
|
+
[n.key]: p
|
|
3783
3783
|
}),
|
|
3784
3784
|
className: `w-8 h-8 rounded border-2 transition-all duration-200 hover:scale-110 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${N ? "ring-2 ring-offset-1 scale-110" : "hover:border-dc-text-muted"}`,
|
|
3785
3785
|
style: {
|
|
@@ -3797,8 +3797,8 @@ function wt({
|
|
|
3797
3797
|
{
|
|
3798
3798
|
type: "button",
|
|
3799
3799
|
onClick: () => f({
|
|
3800
|
-
...
|
|
3801
|
-
[
|
|
3800
|
+
...a,
|
|
3801
|
+
[n.key]: 0
|
|
3802
3802
|
}),
|
|
3803
3803
|
className: "w-8 h-8 rounded-sm border-2 ring-2 ring-offset-1",
|
|
3804
3804
|
style: {
|
|
@@ -3811,55 +3811,55 @@ function wt({
|
|
|
3811
3811
|
0
|
|
3812
3812
|
)
|
|
3813
3813
|
] }),
|
|
3814
|
-
|
|
3814
|
+
n.description && /* @__PURE__ */ e("p", { className: "text-xs text-dc-text-muted", children: n.description })
|
|
3815
3815
|
] }),
|
|
3816
|
-
|
|
3817
|
-
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children:
|
|
3816
|
+
n.type === "number" && /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3817
|
+
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children: n.label }),
|
|
3818
3818
|
/* @__PURE__ */ e(
|
|
3819
3819
|
"input",
|
|
3820
3820
|
{
|
|
3821
3821
|
type: "number",
|
|
3822
|
-
value: n
|
|
3822
|
+
value: a[n.key] ?? n.defaultValue ?? 0,
|
|
3823
3823
|
onChange: (b) => f({
|
|
3824
|
-
...
|
|
3825
|
-
[
|
|
3824
|
+
...a,
|
|
3825
|
+
[n.key]: b.target.value === "" ? void 0 : Number(b.target.value)
|
|
3826
3826
|
}),
|
|
3827
|
-
placeholder:
|
|
3828
|
-
min:
|
|
3829
|
-
max:
|
|
3830
|
-
step:
|
|
3827
|
+
placeholder: n.placeholder,
|
|
3828
|
+
min: n.min,
|
|
3829
|
+
max: n.max,
|
|
3830
|
+
step: n.step,
|
|
3831
3831
|
className: "w-full px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text"
|
|
3832
3832
|
}
|
|
3833
3833
|
),
|
|
3834
|
-
|
|
3834
|
+
n.description && /* @__PURE__ */ e("p", { className: "text-xs text-dc-text-muted", children: n.description })
|
|
3835
3835
|
] }),
|
|
3836
|
-
|
|
3837
|
-
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children:
|
|
3836
|
+
n.type === "select" && /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3837
|
+
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children: n.label }),
|
|
3838
3838
|
/* @__PURE__ */ e(
|
|
3839
3839
|
"select",
|
|
3840
3840
|
{
|
|
3841
|
-
value: n
|
|
3841
|
+
value: a[n.key] ?? n.defaultValue ?? "",
|
|
3842
3842
|
onChange: (b) => f({
|
|
3843
|
-
...
|
|
3844
|
-
[
|
|
3843
|
+
...a,
|
|
3844
|
+
[n.key]: b.target.value
|
|
3845
3845
|
}),
|
|
3846
3846
|
className: "w-full px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text",
|
|
3847
|
-
children:
|
|
3847
|
+
children: n.options?.map((b) => /* @__PURE__ */ e("option", { value: b.value, children: b.label }, b.value))
|
|
3848
3848
|
}
|
|
3849
3849
|
),
|
|
3850
|
-
|
|
3850
|
+
n.description && /* @__PURE__ */ e("p", { className: "text-xs text-dc-text-muted", children: n.description })
|
|
3851
3851
|
] }),
|
|
3852
|
-
|
|
3853
|
-
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children:
|
|
3852
|
+
n.type === "color" && /* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
3853
|
+
/* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children: n.label }),
|
|
3854
3854
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
3855
3855
|
/* @__PURE__ */ e(
|
|
3856
3856
|
"input",
|
|
3857
3857
|
{
|
|
3858
3858
|
type: "color",
|
|
3859
|
-
value: n
|
|
3859
|
+
value: a[n.key] ?? n.defaultValue ?? "#8884d8",
|
|
3860
3860
|
onChange: (b) => f({
|
|
3861
|
-
...
|
|
3862
|
-
[
|
|
3861
|
+
...a,
|
|
3862
|
+
[n.key]: b.target.value
|
|
3863
3863
|
}),
|
|
3864
3864
|
className: "w-12 h-8 border border-dc-border rounded-sm cursor-pointer"
|
|
3865
3865
|
}
|
|
@@ -3868,27 +3868,27 @@ function wt({
|
|
|
3868
3868
|
"input",
|
|
3869
3869
|
{
|
|
3870
3870
|
type: "text",
|
|
3871
|
-
value: n
|
|
3871
|
+
value: a[n.key] ?? n.defaultValue ?? "#8884d8",
|
|
3872
3872
|
onChange: (b) => f({
|
|
3873
|
-
...
|
|
3874
|
-
[
|
|
3873
|
+
...a,
|
|
3874
|
+
[n.key]: b.target.value
|
|
3875
3875
|
}),
|
|
3876
|
-
placeholder:
|
|
3876
|
+
placeholder: n.placeholder || "#8884d8",
|
|
3877
3877
|
className: "flex-1 px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text"
|
|
3878
3878
|
}
|
|
3879
3879
|
)
|
|
3880
3880
|
] }),
|
|
3881
|
-
|
|
3881
|
+
n.description && /* @__PURE__ */ e("p", { className: "text-xs text-dc-text-muted", children: n.description })
|
|
3882
3882
|
] })
|
|
3883
|
-
] },
|
|
3883
|
+
] }, n.key))
|
|
3884
3884
|
] })
|
|
3885
3885
|
] })
|
|
3886
3886
|
] });
|
|
3887
3887
|
}
|
|
3888
|
-
const
|
|
3888
|
+
const qs = ({
|
|
3889
3889
|
executionStatus: t,
|
|
3890
3890
|
executionResults: s,
|
|
3891
|
-
executionError:
|
|
3891
|
+
executionError: a,
|
|
3892
3892
|
query: i,
|
|
3893
3893
|
displayLimit: u = 10,
|
|
3894
3894
|
onDisplayLimitChange: d,
|
|
@@ -3906,7 +3906,7 @@ const js = ({
|
|
|
3906
3906
|
activeView: D = "table",
|
|
3907
3907
|
onActiveViewChange: S
|
|
3908
3908
|
}) => {
|
|
3909
|
-
const [O, $] = q("table"), V = S ? D : O, R = S || $, [L,
|
|
3909
|
+
const [O, $] = q("table"), V = S ? D : O, R = S || $, [L, n] = q(!1), b = () => /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
3910
3910
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 mx-auto mb-4", style: { borderBottomColor: "var(--dc-primary)" } }),
|
|
3911
3911
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold text-dc-text-secondary mb-1", children: "Executing Query..." }),
|
|
3912
3912
|
/* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted", children: "Running your query against the cube API" })
|
|
@@ -3914,7 +3914,7 @@ const js = ({
|
|
|
3914
3914
|
/* @__PURE__ */ e(Le, { className: "w-12 h-12 mx-auto text-red-500 mb-4" }),
|
|
3915
3915
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold text-dc-text mb-2", children: "Query Execution Failed" }),
|
|
3916
3916
|
/* @__PURE__ */ e("div", { className: "text-sm text-dc-text-secondary mb-4", children: "There was an error executing your query. Please check the query and try again." }),
|
|
3917
|
-
|
|
3917
|
+
a && /* @__PURE__ */ e("div", { className: "bg-red-50 border border-red-200 rounded-lg p-3 text-left", children: /* @__PURE__ */ e("div", { className: "text-xs font-mono text-red-800 break-words", children: a }) })
|
|
3918
3918
|
] }) }), N = () => /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "text-center mb-16", children: [
|
|
3919
3919
|
/* @__PURE__ */ e(st, { className: "w-12 h-12 mx-auto text-dc-text-muted mb-3" }),
|
|
3920
3920
|
/* @__PURE__ */ e("div", { className: "text-sm font-semibold text-dc-text-secondary mb-1", children: "No Results Yet" }),
|
|
@@ -4030,7 +4030,7 @@ const js = ({
|
|
|
4030
4030
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
4031
4031
|
/* @__PURE__ */ e("label", { className: "text-xs text-dc-text-secondary whitespace-nowrap", children: "Chart Type:" }),
|
|
4032
4032
|
/* @__PURE__ */ e(
|
|
4033
|
-
|
|
4033
|
+
ir,
|
|
4034
4034
|
{
|
|
4035
4035
|
selectedType: o,
|
|
4036
4036
|
onTypeChange: l
|
|
@@ -4040,10 +4040,10 @@ const js = ({
|
|
|
4040
4040
|
o !== "table" && k && x && /* @__PURE__ */ r(
|
|
4041
4041
|
"button",
|
|
4042
4042
|
{
|
|
4043
|
-
onClick: () =>
|
|
4043
|
+
onClick: () => n(!L),
|
|
4044
4044
|
className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${L ? "bg-dc-primary text-white" : "text-dc-text-secondary bg-dc-surface hover:bg-dc-surface-hover border border-dc-border"}`,
|
|
4045
4045
|
children: [
|
|
4046
|
-
/* @__PURE__ */ e(
|
|
4046
|
+
/* @__PURE__ */ e(Ir, { className: "w-4 h-4" }),
|
|
4047
4047
|
L ? "Hide Config" : "Configure",
|
|
4048
4048
|
L ? /* @__PURE__ */ e(St, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ e(be, { className: "w-3.5 h-3.5" })
|
|
4049
4049
|
]
|
|
@@ -4084,14 +4084,14 @@ const js = ({
|
|
|
4084
4084
|
t === "idle" && /* @__PURE__ */ e(N, {})
|
|
4085
4085
|
] })
|
|
4086
4086
|
] });
|
|
4087
|
-
},
|
|
4087
|
+
}, _s = ({
|
|
4088
4088
|
isOpen: t,
|
|
4089
4089
|
onToggle: s,
|
|
4090
|
-
config:
|
|
4090
|
+
config: a,
|
|
4091
4091
|
onConfigChange: i,
|
|
4092
4092
|
onReset: u
|
|
4093
4093
|
}) => {
|
|
4094
|
-
const [d, f] = q(
|
|
4094
|
+
const [d, f] = q(a), g = () => {
|
|
4095
4095
|
i(d);
|
|
4096
4096
|
}, o = () => {
|
|
4097
4097
|
const l = {
|
|
@@ -4104,7 +4104,7 @@ const js = ({
|
|
|
4104
4104
|
...x,
|
|
4105
4105
|
[l]: k
|
|
4106
4106
|
}));
|
|
4107
|
-
}, c = JSON.stringify(d) !== JSON.stringify(
|
|
4107
|
+
}, c = JSON.stringify(d) !== JSON.stringify(a), h = a.baseApiUrl === "/cubejs-api/v1" && a.apiToken === "";
|
|
4108
4108
|
return /* @__PURE__ */ r("div", { className: "bg-dc-surface border border-dc-border rounded-lg mb-4", children: [
|
|
4109
4109
|
/* @__PURE__ */ r(
|
|
4110
4110
|
"button",
|
|
@@ -4155,11 +4155,11 @@ const js = ({
|
|
|
4155
4155
|
/* @__PURE__ */ e("h4", { className: "text-xs font-medium text-dc-text-secondary", children: "Current Configuration" }),
|
|
4156
4156
|
/* @__PURE__ */ r("p", { className: "text-xs text-dc-text-secondary mt-1", children: [
|
|
4157
4157
|
"URL: ",
|
|
4158
|
-
/* @__PURE__ */ e("span", { className: "font-mono", children:
|
|
4158
|
+
/* @__PURE__ */ e("span", { className: "font-mono", children: a.baseApiUrl })
|
|
4159
4159
|
] }),
|
|
4160
4160
|
/* @__PURE__ */ r("p", { className: "text-xs text-dc-text-secondary", children: [
|
|
4161
4161
|
"Token: ",
|
|
4162
|
-
|
|
4162
|
+
a.apiToken ? /* @__PURE__ */ e("span", { className: "text-green-600", children: "Configured" }) : /* @__PURE__ */ e("span", { className: "text-dc-text-muted", children: "Not set" })
|
|
4163
4163
|
] })
|
|
4164
4164
|
] }),
|
|
4165
4165
|
!h && /* @__PURE__ */ r(
|
|
@@ -4179,7 +4179,7 @@ const js = ({
|
|
|
4179
4179
|
/* @__PURE__ */ e(
|
|
4180
4180
|
"button",
|
|
4181
4181
|
{
|
|
4182
|
-
onClick: () => f(
|
|
4182
|
+
onClick: () => f(a),
|
|
4183
4183
|
className: "px-3 py-1.5 text-sm font-medium text-dc-text-secondary bg-dc-surface border border-dc-border rounded-md hover:bg-dc-surface-hover focus:outline-hidden focus:ring-2 focus:ring-blue-500",
|
|
4184
4184
|
children: "Cancel"
|
|
4185
4185
|
}
|
|
@@ -4196,7 +4196,7 @@ const js = ({
|
|
|
4196
4196
|
] })
|
|
4197
4197
|
] }) })
|
|
4198
4198
|
] });
|
|
4199
|
-
},
|
|
4199
|
+
}, Is = `You are a SQL query builder assistant for a semantic layer using Cube.js format.
|
|
4200
4200
|
|
|
4201
4201
|
Available cube schema (JSON):
|
|
4202
4202
|
{CUBE_SCHEMA}
|
|
@@ -4253,19 +4253,19 @@ Rules:
|
|
|
4253
4253
|
2. All field references must be in "CubeName.fieldName" format
|
|
4254
4254
|
3. Verify every field exists in the provided schema before using it
|
|
4255
4255
|
|
|
4256
|
-
Respond with only the JSON query object, no explanation, no markdown formatting, no code blocks, no backtick wrapper.`,
|
|
4256
|
+
Respond with only the JSON query object, no explanation, no markdown formatting, no code blocks, no backtick wrapper.`, js = "drizzle-cube-ai-config", It = {
|
|
4257
4257
|
provider: "gemini",
|
|
4258
4258
|
apiKey: ""
|
|
4259
4259
|
};
|
|
4260
|
-
async function
|
|
4260
|
+
async function Qs(t, s, a = "/api/ai/generate") {
|
|
4261
4261
|
const i = {
|
|
4262
4262
|
text: s
|
|
4263
4263
|
// Send only the user's prompt, server handles system prompt
|
|
4264
4264
|
}, u = {
|
|
4265
4265
|
"Content-Type": "application/json"
|
|
4266
4266
|
};
|
|
4267
|
-
t && t.trim() && (u["X-API-Key"] = t), console.log("🤖 Client: Sending user prompt to AI proxy"), console.log(" URL:",
|
|
4268
|
-
const d = await fetch(
|
|
4267
|
+
t && t.trim() && (u["X-API-Key"] = t), console.log("🤖 Client: Sending user prompt to AI proxy"), console.log(" URL:", a), console.log(" Headers:", u), console.log(" User prompt length:", s.length);
|
|
4268
|
+
const d = await fetch(a, {
|
|
4269
4269
|
method: "POST",
|
|
4270
4270
|
headers: u,
|
|
4271
4271
|
body: JSON.stringify(i)
|
|
@@ -4296,9 +4296,9 @@ ${o.suggestion || "Add your own Gemini API key for unlimited access."}`
|
|
|
4296
4296
|
const f = await d.json();
|
|
4297
4297
|
return console.log("✅ Client: Successfully generated content"), f;
|
|
4298
4298
|
}
|
|
4299
|
-
function
|
|
4299
|
+
function Bs() {
|
|
4300
4300
|
try {
|
|
4301
|
-
const t = localStorage.getItem(
|
|
4301
|
+
const t = localStorage.getItem(js);
|
|
4302
4302
|
if (t) {
|
|
4303
4303
|
const s = JSON.parse(t);
|
|
4304
4304
|
return { ...It, ...s };
|
|
@@ -4308,20 +4308,20 @@ function Js() {
|
|
|
4308
4308
|
}
|
|
4309
4309
|
return { ...It };
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function zs(t) {
|
|
4312
4312
|
return (t.query || "").replace(/```json\s*/g, "").replace(/```\s*/g, "").replace(/^\s*```.*\n/gm, "").trim();
|
|
4313
4313
|
}
|
|
4314
|
-
const
|
|
4314
|
+
const Us = ({
|
|
4315
4315
|
isOpen: t,
|
|
4316
4316
|
onClose: s,
|
|
4317
|
-
onQueryLoad:
|
|
4317
|
+
onQueryLoad: a,
|
|
4318
4318
|
aiEndpoint: i = "/api/ai"
|
|
4319
4319
|
}) => {
|
|
4320
4320
|
const [u, d] = q(() => ({
|
|
4321
4321
|
step: "query",
|
|
4322
4322
|
// Skip API key step and go straight to query
|
|
4323
|
-
apiKey:
|
|
4324
|
-
systemPromptTemplate:
|
|
4323
|
+
apiKey: Bs().apiKey || "",
|
|
4324
|
+
systemPromptTemplate: Is,
|
|
4325
4325
|
userPrompt: "",
|
|
4326
4326
|
isSubmitting: !1,
|
|
4327
4327
|
response: null,
|
|
@@ -4341,11 +4341,11 @@ const Gs = ({
|
|
|
4341
4341
|
isValidating: !1
|
|
4342
4342
|
}));
|
|
4343
4343
|
try {
|
|
4344
|
-
const D = await
|
|
4344
|
+
const D = await Qs(
|
|
4345
4345
|
u.apiKey,
|
|
4346
4346
|
u.userPrompt,
|
|
4347
4347
|
i
|
|
4348
|
-
), S =
|
|
4348
|
+
), S = zs(D);
|
|
4349
4349
|
d((O) => ({
|
|
4350
4350
|
...O,
|
|
4351
4351
|
isSubmitting: !1,
|
|
@@ -4408,10 +4408,10 @@ const Gs = ({
|
|
|
4408
4408
|
}, o = async () => {
|
|
4409
4409
|
u.response && await g(u.response);
|
|
4410
4410
|
}, m = () => {
|
|
4411
|
-
if (!(!u.response || !
|
|
4411
|
+
if (!(!u.response || !a))
|
|
4412
4412
|
try {
|
|
4413
4413
|
const x = JSON.parse(u.response);
|
|
4414
|
-
|
|
4414
|
+
a(x), c();
|
|
4415
4415
|
} catch {
|
|
4416
4416
|
d((D) => ({
|
|
4417
4417
|
...D,
|
|
@@ -4460,7 +4460,7 @@ const Gs = ({
|
|
|
4460
4460
|
] }),
|
|
4461
4461
|
/* @__PURE__ */ r("div", { className: "w-full md:w-1/2 flex flex-col", children: [
|
|
4462
4462
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4463
|
-
/* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: u.response ? /* @__PURE__ */ r(
|
|
4463
|
+
/* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: u.response ? /* @__PURE__ */ r(ae, { children: [
|
|
4464
4464
|
/* @__PURE__ */ e(Oe, { className: "w-5 h-5 text-green-500" }),
|
|
4465
4465
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-green-700", children: "AI Generated Query" })
|
|
4466
4466
|
] }) : /* @__PURE__ */ e("span", { className: "text-sm font-medium text-dc-text-muted", children: "Generated Query" }) }),
|
|
@@ -4510,10 +4510,10 @@ const Gs = ({
|
|
|
4510
4510
|
style: {
|
|
4511
4511
|
backgroundColor: "var(--dc-primary)"
|
|
4512
4512
|
},
|
|
4513
|
-
children: u.isSubmitting ? /* @__PURE__ */ r(
|
|
4513
|
+
children: u.isSubmitting ? /* @__PURE__ */ r(ae, { children: [
|
|
4514
4514
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2" }),
|
|
4515
4515
|
"Generating..."
|
|
4516
|
-
] }) : /* @__PURE__ */ r(
|
|
4516
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
4517
4517
|
/* @__PURE__ */ e(bt, { className: "w-4 h-4 mr-2" }),
|
|
4518
4518
|
"Generate"
|
|
4519
4519
|
] })
|
|
@@ -4523,7 +4523,7 @@ const Gs = ({
|
|
|
4523
4523
|
"button",
|
|
4524
4524
|
{
|
|
4525
4525
|
onClick: m,
|
|
4526
|
-
disabled: !u.response || !
|
|
4526
|
+
disabled: !u.response || !a,
|
|
4527
4527
|
className: "px-4 py-2 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed flex items-center",
|
|
4528
4528
|
children: [
|
|
4529
4529
|
/* @__PURE__ */ e(Oe, { className: "w-4 h-4 mr-2" }),
|
|
@@ -4537,10 +4537,10 @@ const Gs = ({
|
|
|
4537
4537
|
);
|
|
4538
4538
|
};
|
|
4539
4539
|
var ut = { exports: {} }, jt;
|
|
4540
|
-
function
|
|
4540
|
+
function Js() {
|
|
4541
4541
|
return jt || (jt = 1, (function(t) {
|
|
4542
4542
|
var s = (function() {
|
|
4543
|
-
var
|
|
4543
|
+
var a = String.fromCharCode, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", d = {};
|
|
4544
4544
|
function f(o, m) {
|
|
4545
4545
|
if (!d[o]) {
|
|
4546
4546
|
d[o] = {};
|
|
@@ -4576,7 +4576,7 @@ function Ws() {
|
|
|
4576
4576
|
},
|
|
4577
4577
|
compressToUTF16: function(o) {
|
|
4578
4578
|
return o == null ? "" : g._compress(o, 15, function(m) {
|
|
4579
|
-
return
|
|
4579
|
+
return a(m + 32);
|
|
4580
4580
|
}) + " ";
|
|
4581
4581
|
},
|
|
4582
4582
|
decompressFromUTF16: function(o) {
|
|
@@ -4600,7 +4600,7 @@ function Ws() {
|
|
|
4600
4600
|
m[c] = o[c * 2] * 256 + o[c * 2 + 1];
|
|
4601
4601
|
var l = [];
|
|
4602
4602
|
return m.forEach(function(k) {
|
|
4603
|
-
l.push(
|
|
4603
|
+
l.push(a(k));
|
|
4604
4604
|
}), g.decompress(l.join(""));
|
|
4605
4605
|
},
|
|
4606
4606
|
//compress into a string that is already URI encoded
|
|
@@ -4617,12 +4617,12 @@ function Ws() {
|
|
|
4617
4617
|
},
|
|
4618
4618
|
compress: function(o) {
|
|
4619
4619
|
return g._compress(o, 16, function(m) {
|
|
4620
|
-
return
|
|
4620
|
+
return a(m);
|
|
4621
4621
|
});
|
|
4622
4622
|
},
|
|
4623
4623
|
_compress: function(o, m, c) {
|
|
4624
4624
|
if (o == null) return "";
|
|
4625
|
-
var h, l, k = {}, x = {}, D = "", S = "", O = "", $ = 2, V = 3, R = 2, L = [],
|
|
4625
|
+
var h, l, k = {}, x = {}, D = "", S = "", O = "", $ = 2, V = 3, R = 2, L = [], n = 0, b = 0, p;
|
|
4626
4626
|
for (p = 0; p < o.length; p += 1)
|
|
4627
4627
|
if (D = o.charAt(p), Object.prototype.hasOwnProperty.call(k, D) || (k[D] = V++, x[D] = !0), S = O + D, Object.prototype.hasOwnProperty.call(k, S))
|
|
4628
4628
|
O = S;
|
|
@@ -4630,45 +4630,45 @@ function Ws() {
|
|
|
4630
4630
|
if (Object.prototype.hasOwnProperty.call(x, O)) {
|
|
4631
4631
|
if (O.charCodeAt(0) < 256) {
|
|
4632
4632
|
for (h = 0; h < R; h++)
|
|
4633
|
-
|
|
4633
|
+
n = n << 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++;
|
|
4634
4634
|
for (l = O.charCodeAt(0), h = 0; h < 8; h++)
|
|
4635
|
-
|
|
4635
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4636
4636
|
} else {
|
|
4637
4637
|
for (l = 1, h = 0; h < R; h++)
|
|
4638
|
-
|
|
4638
|
+
n = n << 1 | l, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = 0;
|
|
4639
4639
|
for (l = O.charCodeAt(0), h = 0; h < 16; h++)
|
|
4640
|
-
|
|
4640
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4641
4641
|
}
|
|
4642
4642
|
$--, $ == 0 && ($ = Math.pow(2, R), R++), delete x[O];
|
|
4643
4643
|
} else
|
|
4644
4644
|
for (l = k[O], h = 0; h < R; h++)
|
|
4645
|
-
|
|
4645
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4646
4646
|
$--, $ == 0 && ($ = Math.pow(2, R), R++), k[S] = V++, O = String(D);
|
|
4647
4647
|
}
|
|
4648
4648
|
if (O !== "") {
|
|
4649
4649
|
if (Object.prototype.hasOwnProperty.call(x, O)) {
|
|
4650
4650
|
if (O.charCodeAt(0) < 256) {
|
|
4651
4651
|
for (h = 0; h < R; h++)
|
|
4652
|
-
|
|
4652
|
+
n = n << 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++;
|
|
4653
4653
|
for (l = O.charCodeAt(0), h = 0; h < 8; h++)
|
|
4654
|
-
|
|
4654
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4655
4655
|
} else {
|
|
4656
4656
|
for (l = 1, h = 0; h < R; h++)
|
|
4657
|
-
|
|
4657
|
+
n = n << 1 | l, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = 0;
|
|
4658
4658
|
for (l = O.charCodeAt(0), h = 0; h < 16; h++)
|
|
4659
|
-
|
|
4659
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4660
4660
|
}
|
|
4661
4661
|
$--, $ == 0 && ($ = Math.pow(2, R), R++), delete x[O];
|
|
4662
4662
|
} else
|
|
4663
4663
|
for (l = k[O], h = 0; h < R; h++)
|
|
4664
|
-
|
|
4664
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4665
4665
|
$--, $ == 0 && ($ = Math.pow(2, R), R++);
|
|
4666
4666
|
}
|
|
4667
4667
|
for (l = 2, h = 0; h < R; h++)
|
|
4668
|
-
|
|
4668
|
+
n = n << 1 | l & 1, b == m - 1 ? (b = 0, L.push(c(n)), n = 0) : b++, l = l >> 1;
|
|
4669
4669
|
for (; ; )
|
|
4670
|
-
if (
|
|
4671
|
-
L.push(c(
|
|
4670
|
+
if (n = n << 1, b == m - 1) {
|
|
4671
|
+
L.push(c(n));
|
|
4672
4672
|
break;
|
|
4673
4673
|
} else b++;
|
|
4674
4674
|
return L.join("");
|
|
@@ -4679,21 +4679,21 @@ function Ws() {
|
|
|
4679
4679
|
});
|
|
4680
4680
|
},
|
|
4681
4681
|
_decompress: function(o, m, c) {
|
|
4682
|
-
var h = [], l = 4, k = 4, x = 3, D = "", S = [], O, $, V, R, L,
|
|
4682
|
+
var h = [], l = 4, k = 4, x = 3, D = "", S = [], O, $, V, R, L, n, b, p = { val: c(0), position: m, index: 1 };
|
|
4683
4683
|
for (O = 0; O < 3; O += 1)
|
|
4684
4684
|
h[O] = O;
|
|
4685
|
-
for (V = 0, L = Math.pow(2, 2),
|
|
4686
|
-
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) *
|
|
4685
|
+
for (V = 0, L = Math.pow(2, 2), n = 1; n != L; )
|
|
4686
|
+
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) * n, n <<= 1;
|
|
4687
4687
|
switch (V) {
|
|
4688
4688
|
case 0:
|
|
4689
|
-
for (V = 0, L = Math.pow(2, 8),
|
|
4690
|
-
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) *
|
|
4691
|
-
b =
|
|
4689
|
+
for (V = 0, L = Math.pow(2, 8), n = 1; n != L; )
|
|
4690
|
+
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) * n, n <<= 1;
|
|
4691
|
+
b = a(V);
|
|
4692
4692
|
break;
|
|
4693
4693
|
case 1:
|
|
4694
|
-
for (V = 0, L = Math.pow(2, 16),
|
|
4695
|
-
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) *
|
|
4696
|
-
b =
|
|
4694
|
+
for (V = 0, L = Math.pow(2, 16), n = 1; n != L; )
|
|
4695
|
+
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) * n, n <<= 1;
|
|
4696
|
+
b = a(V);
|
|
4697
4697
|
break;
|
|
4698
4698
|
case 2:
|
|
4699
4699
|
return "";
|
|
@@ -4701,18 +4701,18 @@ function Ws() {
|
|
|
4701
4701
|
for (h[3] = b, $ = b, S.push(b); ; ) {
|
|
4702
4702
|
if (p.index > o)
|
|
4703
4703
|
return "";
|
|
4704
|
-
for (V = 0, L = Math.pow(2, x),
|
|
4705
|
-
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) *
|
|
4704
|
+
for (V = 0, L = Math.pow(2, x), n = 1; n != L; )
|
|
4705
|
+
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) * n, n <<= 1;
|
|
4706
4706
|
switch (b = V) {
|
|
4707
4707
|
case 0:
|
|
4708
|
-
for (V = 0, L = Math.pow(2, 8),
|
|
4709
|
-
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) *
|
|
4710
|
-
h[k++] =
|
|
4708
|
+
for (V = 0, L = Math.pow(2, 8), n = 1; n != L; )
|
|
4709
|
+
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) * n, n <<= 1;
|
|
4710
|
+
h[k++] = a(V), b = k - 1, l--;
|
|
4711
4711
|
break;
|
|
4712
4712
|
case 1:
|
|
4713
|
-
for (V = 0, L = Math.pow(2, 16),
|
|
4714
|
-
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) *
|
|
4715
|
-
h[k++] =
|
|
4713
|
+
for (V = 0, L = Math.pow(2, 16), n = 1; n != L; )
|
|
4714
|
+
R = p.val & p.position, p.position >>= 1, p.position == 0 && (p.position = m, p.val = c(p.index++)), V |= (R > 0 ? 1 : 0) * n, n <<= 1;
|
|
4715
|
+
h[k++] = a(V), b = k - 1, l--;
|
|
4716
4716
|
break;
|
|
4717
4717
|
case 2:
|
|
4718
4718
|
return S.join("");
|
|
@@ -4734,49 +4734,49 @@ function Ws() {
|
|
|
4734
4734
|
});
|
|
4735
4735
|
})(ut)), ut.exports;
|
|
4736
4736
|
}
|
|
4737
|
-
var
|
|
4737
|
+
var or = /* @__PURE__ */ Js();
|
|
4738
4738
|
const Ct = 1800, Qt = "share=";
|
|
4739
4739
|
function Bt(t) {
|
|
4740
4740
|
const s = JSON.stringify(t);
|
|
4741
|
-
return
|
|
4741
|
+
return or.compressToEncodedURIComponent(s);
|
|
4742
4742
|
}
|
|
4743
|
-
function
|
|
4743
|
+
function Hs(t) {
|
|
4744
4744
|
try {
|
|
4745
|
-
const s =
|
|
4745
|
+
const s = or.decompressFromEncodedURIComponent(t);
|
|
4746
4746
|
if (!s) return null;
|
|
4747
|
-
const
|
|
4748
|
-
return !
|
|
4747
|
+
const a = JSON.parse(s);
|
|
4748
|
+
return !a.query || typeof a.query != "object" ? null : a;
|
|
4749
4749
|
} catch {
|
|
4750
4750
|
return null;
|
|
4751
4751
|
}
|
|
4752
4752
|
}
|
|
4753
|
-
function
|
|
4753
|
+
function Gs(t) {
|
|
4754
4754
|
const s = Bt(t);
|
|
4755
4755
|
if (s.length <= Ct)
|
|
4756
4756
|
return { encoded: s, queryOnly: !1 };
|
|
4757
|
-
const
|
|
4757
|
+
const a = { query: t.query }, i = Bt(a);
|
|
4758
4758
|
return i.length <= Ct ? { encoded: i, queryOnly: !0 } : { encoded: null, queryOnly: !0 };
|
|
4759
4759
|
}
|
|
4760
|
-
function
|
|
4760
|
+
function Ws() {
|
|
4761
4761
|
if (typeof window > "u") return null;
|
|
4762
4762
|
const t = window.location.hash;
|
|
4763
4763
|
return !t || !t.startsWith(`#${Qt}`) ? null : t.slice(Qt.length + 1);
|
|
4764
4764
|
}
|
|
4765
|
-
function
|
|
4765
|
+
function Ys() {
|
|
4766
4766
|
if (typeof window > "u") return;
|
|
4767
4767
|
const t = new URL(window.location.href);
|
|
4768
4768
|
t.hash = "", window.history.replaceState(null, "", t.toString());
|
|
4769
4769
|
}
|
|
4770
|
-
function
|
|
4770
|
+
function Ks() {
|
|
4771
4771
|
return Ct;
|
|
4772
4772
|
}
|
|
4773
|
-
const
|
|
4773
|
+
const Xs = ({
|
|
4774
4774
|
isOpen: t,
|
|
4775
4775
|
onClose: s,
|
|
4776
|
-
size:
|
|
4776
|
+
size: a,
|
|
4777
4777
|
maxSize: i
|
|
4778
4778
|
}) => {
|
|
4779
|
-
const u = Math.min(Math.round(
|
|
4779
|
+
const u = Math.min(Math.round(a / i * 100), 100);
|
|
4780
4780
|
return /* @__PURE__ */ e(
|
|
4781
4781
|
lt,
|
|
4782
4782
|
{
|
|
@@ -4793,7 +4793,7 @@ const tn = ({
|
|
|
4793
4793
|
/* @__PURE__ */ r("div", { className: "flex justify-between text-xs text-dc-text-muted", children: [
|
|
4794
4794
|
/* @__PURE__ */ e("span", { children: "Compressed size" }),
|
|
4795
4795
|
/* @__PURE__ */ r("span", { className: "text-red-600 dark:text-red-400 font-medium", children: [
|
|
4796
|
-
|
|
4796
|
+
a.toLocaleString(),
|
|
4797
4797
|
" / ",
|
|
4798
4798
|
i.toLocaleString(),
|
|
4799
4799
|
" chars"
|
|
@@ -4839,16 +4839,16 @@ const tn = ({
|
|
|
4839
4839
|
] })
|
|
4840
4840
|
}
|
|
4841
4841
|
);
|
|
4842
|
-
}, mt = "drizzle-cube-query-builder-state", zt = "drizzle-cube-api-config",
|
|
4842
|
+
}, mt = "drizzle-cube-query-builder-state", zt = "drizzle-cube-api-config", dr = Yt(({
|
|
4843
4843
|
className: t = "",
|
|
4844
4844
|
initialQuery: s,
|
|
4845
|
-
disableLocalStorage:
|
|
4845
|
+
disableLocalStorage: a = !1,
|
|
4846
4846
|
hideSettings: i = !1,
|
|
4847
4847
|
enableSharing: u = !1,
|
|
4848
4848
|
onShare: d
|
|
4849
4849
|
}, f) => {
|
|
4850
4850
|
const { cubeApi: g, updateApiConfig: o, features: m } = kt(), c = () => {
|
|
4851
|
-
if (!
|
|
4851
|
+
if (!a)
|
|
4852
4852
|
try {
|
|
4853
4853
|
const w = localStorage.getItem(zt);
|
|
4854
4854
|
if (w)
|
|
@@ -4875,7 +4875,7 @@ const tn = ({
|
|
|
4875
4875
|
totalRowCount: null,
|
|
4876
4876
|
totalRowCountStatus: "idle"
|
|
4877
4877
|
};
|
|
4878
|
-
if (!
|
|
4878
|
+
if (!a)
|
|
4879
4879
|
try {
|
|
4880
4880
|
const w = localStorage.getItem(mt);
|
|
4881
4881
|
if (w) {
|
|
@@ -4916,7 +4916,7 @@ const tn = ({
|
|
|
4916
4916
|
totalRowCountStatus: "idle"
|
|
4917
4917
|
};
|
|
4918
4918
|
}, [l, k] = q(h()), [x, D] = q(10), O = (() => {
|
|
4919
|
-
if (!
|
|
4919
|
+
if (!a)
|
|
4920
4920
|
try {
|
|
4921
4921
|
const w = localStorage.getItem(mt);
|
|
4922
4922
|
if (w) {
|
|
@@ -4936,7 +4936,7 @@ const tn = ({
|
|
|
4936
4936
|
displayConfig: { showLegend: !0, showGrid: !0, showTooltip: !0 },
|
|
4937
4937
|
activeView: "table"
|
|
4938
4938
|
};
|
|
4939
|
-
})(), [$, V] = q(O.chartType), [R, L] = q(O.chartConfig), [
|
|
4939
|
+
})(), [$, V] = q(O.chartType), [R, L] = q(O.chartConfig), [n, b] = q(O.displayConfig), [p, N] = q(O.activeView), [E, T] = q(c()), [z, P] = q(!1), [y, F] = q(!1), [C, I] = q("tree"), [U, J] = q(!1), [te, oe] = q("idle"), [he, j] = q(!1), [K, W] = q({ size: 0, maxSize: 0 }), [ee, de] = q(!1);
|
|
4940
4940
|
se(() => {
|
|
4941
4941
|
s && JSON.stringify(s) !== JSON.stringify(l.query) && k((w) => ({
|
|
4942
4942
|
...w,
|
|
@@ -4953,12 +4953,12 @@ const tn = ({
|
|
|
4953
4953
|
totalRowCountStatus: "idle"
|
|
4954
4954
|
}));
|
|
4955
4955
|
}, [s]);
|
|
4956
|
-
const ce = fe(""), [pe, M] = q(null),
|
|
4956
|
+
const ce = fe(""), [pe, M] = q(null), ne = ye(() => pe?.pivotQuery?.query ? {
|
|
4957
4957
|
dimensions: pe.pivotQuery.query.dimensions || [],
|
|
4958
4958
|
timeDimensions: pe.pivotQuery.query.timeDimensions?.map((w) => w.dimension) || [],
|
|
4959
4959
|
measures: pe.pivotQuery.query.measures || []
|
|
4960
4960
|
} : null, [pe]);
|
|
4961
|
-
|
|
4961
|
+
Kt(f, () => ({
|
|
4962
4962
|
getCurrentQuery: () => $e(l.query),
|
|
4963
4963
|
getValidationState: () => ({
|
|
4964
4964
|
status: l.validationStatus,
|
|
@@ -4997,30 +4997,30 @@ const tn = ({
|
|
|
4997
4997
|
}
|
|
4998
4998
|
})();
|
|
4999
4999
|
}, [E.baseApiUrl, E.apiToken]), se(() => {
|
|
5000
|
-
if (!
|
|
5000
|
+
if (!a)
|
|
5001
5001
|
try {
|
|
5002
5002
|
localStorage.setItem(mt, JSON.stringify({
|
|
5003
5003
|
query: l.query,
|
|
5004
5004
|
chartType: $,
|
|
5005
5005
|
chartConfig: R,
|
|
5006
|
-
displayConfig:
|
|
5006
|
+
displayConfig: n,
|
|
5007
5007
|
activeView: p
|
|
5008
5008
|
}));
|
|
5009
5009
|
} catch {
|
|
5010
5010
|
}
|
|
5011
|
-
}, [l.query, $, R,
|
|
5012
|
-
if (!
|
|
5011
|
+
}, [l.query, $, R, n, p, a]), se(() => {
|
|
5012
|
+
if (!a)
|
|
5013
5013
|
try {
|
|
5014
5014
|
localStorage.setItem(zt, JSON.stringify(E));
|
|
5015
5015
|
} catch {
|
|
5016
5016
|
}
|
|
5017
|
-
}, [E,
|
|
5017
|
+
}, [E, a]);
|
|
5018
5018
|
const X = fe(!1);
|
|
5019
5019
|
se(() => {
|
|
5020
5020
|
if (!u) return;
|
|
5021
|
-
const w =
|
|
5021
|
+
const w = Ws();
|
|
5022
5022
|
if (!w) return;
|
|
5023
|
-
const v =
|
|
5023
|
+
const v = Hs(w);
|
|
5024
5024
|
v && (k((_) => ({
|
|
5025
5025
|
..._,
|
|
5026
5026
|
query: Me(v.query),
|
|
@@ -5032,7 +5032,7 @@ const tn = ({
|
|
|
5032
5032
|
executionError: null,
|
|
5033
5033
|
totalRowCount: null,
|
|
5034
5034
|
totalRowCountStatus: "idle"
|
|
5035
|
-
})), v.chartType && V(v.chartType), v.chartConfig && L(v.chartConfig), v.displayConfig && b(v.displayConfig), v.activeView && N(v.activeView), de(!0), X.current = !0),
|
|
5035
|
+
})), v.chartType && V(v.chartType), v.chartConfig && L(v.chartConfig), v.displayConfig && b(v.displayConfig), v.activeView && N(v.activeView), de(!0), X.current = !0), Ys();
|
|
5036
5036
|
}, [u]), se(() => {
|
|
5037
5037
|
l.executionStatus === "success" && _e(l.query) && l.validationStatus === "valid" && me();
|
|
5038
5038
|
}, [x, p]);
|
|
@@ -5040,7 +5040,7 @@ const tn = ({
|
|
|
5040
5040
|
k((v) => {
|
|
5041
5041
|
const _ = w(v.query), Q = {
|
|
5042
5042
|
..._,
|
|
5043
|
-
filters: _.filters ?
|
|
5043
|
+
filters: _.filters ? As(_.filters) : void 0
|
|
5044
5044
|
}, H = JSON.stringify(Q) !== JSON.stringify(v.query);
|
|
5045
5045
|
return {
|
|
5046
5046
|
...v,
|
|
@@ -5236,12 +5236,12 @@ const tn = ({
|
|
|
5236
5236
|
query: $e(l.query),
|
|
5237
5237
|
chartType: $,
|
|
5238
5238
|
chartConfig: R,
|
|
5239
|
-
displayConfig:
|
|
5239
|
+
displayConfig: n,
|
|
5240
5240
|
activeView: p
|
|
5241
|
-
}, { encoded: v, queryOnly: _ } =
|
|
5241
|
+
}, { encoded: v, queryOnly: _ } = Gs(w);
|
|
5242
5242
|
if (!v) {
|
|
5243
5243
|
const H = { query: w.query }, re = JSON.stringify(H).length;
|
|
5244
|
-
W({ size: re, maxSize:
|
|
5244
|
+
W({ size: re, maxSize: Ks() }), j(!0);
|
|
5245
5245
|
return;
|
|
5246
5246
|
}
|
|
5247
5247
|
const Q = `${window.location.origin}${window.location.pathname}#share=${v}`;
|
|
@@ -5254,7 +5254,7 @@ const tn = ({
|
|
|
5254
5254
|
oe(_ ? "copied-no-chart" : "copied"), d?.(Q), setTimeout(() => {
|
|
5255
5255
|
oe("idle");
|
|
5256
5256
|
}, 2e3);
|
|
5257
|
-
}, [u, l.query, $, R,
|
|
5257
|
+
}, [u, l.query, $, R, n, p, d]), We = B((w) => {
|
|
5258
5258
|
T(w), o(
|
|
5259
5259
|
{ apiUrl: w.baseApiUrl },
|
|
5260
5260
|
w.apiToken || void 0
|
|
@@ -5311,7 +5311,7 @@ const tn = ({
|
|
|
5311
5311
|
};
|
|
5312
5312
|
return /* @__PURE__ */ r("div", { className: `h-full flex flex-col ${t}`, style: { minHeight: "100%" }, children: [
|
|
5313
5313
|
!i && /* @__PURE__ */ e("div", { className: "shrink-0 p-4 pb-0", children: /* @__PURE__ */ e(
|
|
5314
|
-
|
|
5314
|
+
_s,
|
|
5315
5315
|
{
|
|
5316
5316
|
isOpen: z,
|
|
5317
5317
|
onToggle: () => P(!z),
|
|
@@ -5325,11 +5325,11 @@ const tn = ({
|
|
|
5325
5325
|
{
|
|
5326
5326
|
onClick: () => F(!y),
|
|
5327
5327
|
className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-dc-text-secondary bg-dc-surface-secondary hover:bg-dc-surface-hover rounded-md transition-colors",
|
|
5328
|
-
children: y ? /* @__PURE__ */ r(
|
|
5328
|
+
children: y ? /* @__PURE__ */ r(ae, { children: [
|
|
5329
5329
|
/* @__PURE__ */ e(ge, { className: "w-4 h-4" }),
|
|
5330
5330
|
" Hide Schema"
|
|
5331
|
-
] }) : /* @__PURE__ */ r(
|
|
5332
|
-
/* @__PURE__ */ e(
|
|
5331
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
5332
|
+
/* @__PURE__ */ e(jr, { className: "w-4 h-4" }),
|
|
5333
5333
|
" Show Schema"
|
|
5334
5334
|
] })
|
|
5335
5335
|
}
|
|
@@ -5387,7 +5387,7 @@ const tn = ({
|
|
|
5387
5387
|
) }),
|
|
5388
5388
|
C === "tree" && /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col gap-4 min-w-0 min-h-0", children: [
|
|
5389
5389
|
/* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(
|
|
5390
|
-
|
|
5390
|
+
Ps,
|
|
5391
5391
|
{
|
|
5392
5392
|
query: l.query,
|
|
5393
5393
|
schema: l.schema,
|
|
@@ -5413,7 +5413,7 @@ const tn = ({
|
|
|
5413
5413
|
}
|
|
5414
5414
|
) }),
|
|
5415
5415
|
/* @__PURE__ */ e("div", { className: `${l.executionStatus === "idle" ? "shrink-0 h-48" : "flex-1 min-h-0"}`, children: /* @__PURE__ */ e(
|
|
5416
|
-
|
|
5416
|
+
qs,
|
|
5417
5417
|
{
|
|
5418
5418
|
executionStatus: l.executionStatus,
|
|
5419
5419
|
executionResults: l.executionResults,
|
|
@@ -5425,8 +5425,8 @@ const tn = ({
|
|
|
5425
5425
|
totalRowCountStatus: l.totalRowCountStatus,
|
|
5426
5426
|
chartType: $,
|
|
5427
5427
|
chartConfig: R,
|
|
5428
|
-
displayConfig:
|
|
5429
|
-
availableFields:
|
|
5428
|
+
displayConfig: n,
|
|
5429
|
+
availableFields: ne,
|
|
5430
5430
|
onChartTypeChange: V,
|
|
5431
5431
|
onChartConfigChange: L,
|
|
5432
5432
|
onDisplayConfigChange: b,
|
|
@@ -5437,7 +5437,7 @@ const tn = ({
|
|
|
5437
5437
|
] })
|
|
5438
5438
|
] }),
|
|
5439
5439
|
m?.enableAI !== !1 && /* @__PURE__ */ e(
|
|
5440
|
-
|
|
5440
|
+
Us,
|
|
5441
5441
|
{
|
|
5442
5442
|
isOpen: U,
|
|
5443
5443
|
onClose: () => J(!1),
|
|
@@ -5478,7 +5478,7 @@ const tn = ({
|
|
|
5478
5478
|
}
|
|
5479
5479
|
),
|
|
5480
5480
|
/* @__PURE__ */ e(
|
|
5481
|
-
|
|
5481
|
+
Xs,
|
|
5482
5482
|
{
|
|
5483
5483
|
isOpen: he,
|
|
5484
5484
|
onClose: () => j(!1),
|
|
@@ -5488,8 +5488,8 @@ const tn = ({
|
|
|
5488
5488
|
)
|
|
5489
5489
|
] });
|
|
5490
5490
|
});
|
|
5491
|
-
|
|
5492
|
-
const
|
|
5491
|
+
dr.displayName = "QueryBuilder";
|
|
5492
|
+
const Zs = [
|
|
5493
5493
|
{
|
|
5494
5494
|
name: "Employee Count by Department",
|
|
5495
5495
|
query: JSON.stringify({
|
|
@@ -5548,13 +5548,13 @@ const rn = [
|
|
|
5548
5548
|
function Ut({
|
|
5549
5549
|
isOpen: t,
|
|
5550
5550
|
onClose: s,
|
|
5551
|
-
onSave:
|
|
5551
|
+
onSave: a,
|
|
5552
5552
|
portlet: i,
|
|
5553
5553
|
title: u,
|
|
5554
5554
|
submitText: d,
|
|
5555
5555
|
colorPalette: f
|
|
5556
5556
|
}) {
|
|
5557
|
-
const { cubeApi: g } = kt(), [o, m] = q(""), [c, h] = q(""), [l, k] = q("bar"), [x, D] = q([]), [S, O] = q(!1), [$, V] = q(null), [R, L] = q(""), [
|
|
5557
|
+
const { cubeApi: g } = kt(), [o, m] = q(""), [c, h] = q(""), [l, k] = q("bar"), [x, D] = q([]), [S, O] = q(!1), [$, V] = q(null), [R, L] = q(""), [n, b] = q(null), [p, N] = q({ xAxis: [], yAxis: [], series: [] }), [E, T] = q({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), [z, P] = q(!1), [y, F] = q(null), C = fe(null), U = Gt(l, at).skipQuery === !0, J = (Y) => {
|
|
5558
5558
|
}, te = 5, oe = 4;
|
|
5559
5559
|
se(() => {
|
|
5560
5560
|
if (t) {
|
|
@@ -5594,7 +5594,7 @@ function Ut({
|
|
|
5594
5594
|
}
|
|
5595
5595
|
}
|
|
5596
5596
|
const ue = U ? '{"measures":[]}' : c.trim();
|
|
5597
|
-
|
|
5597
|
+
a(i ? {
|
|
5598
5598
|
...i,
|
|
5599
5599
|
title: o.trim(),
|
|
5600
5600
|
query: ue,
|
|
@@ -5678,11 +5678,11 @@ function Ut({
|
|
|
5678
5678
|
P(!1), F(null);
|
|
5679
5679
|
}, M = () => {
|
|
5680
5680
|
m(""), h(""), k("bar"), N({ xAxis: [], yAxis: [], series: [] }), T({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), V(null), O(!1), L(""), b(null), P(!1), F(null), s();
|
|
5681
|
-
},
|
|
5682
|
-
dimensions:
|
|
5683
|
-
timeDimensions:
|
|
5684
|
-
measures:
|
|
5685
|
-
} : null, Te = z ? /* @__PURE__ */ r(
|
|
5681
|
+
}, ne = !!i, X = c.trim() !== R.trim() && R !== "", ie = $?.isValid && c.trim() === R.trim(), Fe = n?.pivotQuery?.query ? {
|
|
5682
|
+
dimensions: n.pivotQuery.query.dimensions || [],
|
|
5683
|
+
timeDimensions: n.pivotQuery.query.timeDimensions?.map((Y) => Y.dimension) || [],
|
|
5684
|
+
measures: n.pivotQuery.query.measures || []
|
|
5685
|
+
} : null, Te = z ? /* @__PURE__ */ r(ae, { children: [
|
|
5686
5686
|
/* @__PURE__ */ e(
|
|
5687
5687
|
"button",
|
|
5688
5688
|
{
|
|
@@ -5705,7 +5705,7 @@ function Ut({
|
|
|
5705
5705
|
children: "Apply Query"
|
|
5706
5706
|
}
|
|
5707
5707
|
)
|
|
5708
|
-
] }) : /* @__PURE__ */ r(
|
|
5708
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
5709
5709
|
/* @__PURE__ */ e(
|
|
5710
5710
|
"button",
|
|
5711
5711
|
{
|
|
@@ -5740,7 +5740,7 @@ function Ut({
|
|
|
5740
5740
|
footer: Te,
|
|
5741
5741
|
noPadding: z,
|
|
5742
5742
|
children: z ? /* @__PURE__ */ e(
|
|
5743
|
-
|
|
5743
|
+
dr,
|
|
5744
5744
|
{
|
|
5745
5745
|
ref: C,
|
|
5746
5746
|
initialQuery: y,
|
|
@@ -5768,7 +5768,7 @@ function Ut({
|
|
|
5768
5768
|
/* @__PURE__ */ r("div", { children: [
|
|
5769
5769
|
/* @__PURE__ */ e("label", { className: "block text-sm font-semibold text-dc-text-secondary mb-3", children: "Chart Type" }),
|
|
5770
5770
|
/* @__PURE__ */ e(
|
|
5771
|
-
|
|
5771
|
+
ir,
|
|
5772
5772
|
{
|
|
5773
5773
|
selectedType: l,
|
|
5774
5774
|
onTypeChange: k
|
|
@@ -5816,7 +5816,7 @@ function Ut({
|
|
|
5816
5816
|
onChartConfigChange: N,
|
|
5817
5817
|
onDisplayConfigChange: T
|
|
5818
5818
|
}
|
|
5819
|
-
) }) : !
|
|
5819
|
+
) }) : !n || !ie ? /* @__PURE__ */ e("div", { className: "flex-1 flex items-center justify-center border-2 border-dashed border-dc-border rounded-lg bg-dc-surface-secondary", children: /* @__PURE__ */ r("div", { className: "text-center text-dc-text-muted", children: [
|
|
5820
5820
|
/* @__PURE__ */ e("svg", { className: "h-8 w-8 mx-auto mb-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" }) }),
|
|
5821
5821
|
/* @__PURE__ */ e("p", { className: "text-sm", children: "Validate query first to configure chart axes" })
|
|
5822
5822
|
] }) }) : /* @__PURE__ */ e("div", { className: "rounded-lg bg-dc-surface p-3 border border-dc-border", children: /* @__PURE__ */ e(
|
|
@@ -5848,25 +5848,25 @@ function Ut({
|
|
|
5848
5848
|
onClick: ee,
|
|
5849
5849
|
disabled: S || !c.trim(),
|
|
5850
5850
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center space-x-1.5 ${$?.isValid && c.trim() === R.trim() ? "bg-green-600 text-white hover:bg-green-700" : $ && !$.isValid ? "bg-red-600 text-white hover:bg-red-700" : "bg-dc-primary text-white hover:bg-dc-primary-hover"} disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-dc-primary`,
|
|
5851
|
-
children: S ? /* @__PURE__ */ r(
|
|
5851
|
+
children: S ? /* @__PURE__ */ r(ae, { children: [
|
|
5852
5852
|
/* @__PURE__ */ r("svg", { className: "animate-spin h-4 w-4", fill: "none", viewBox: "0 0 24 24", children: [
|
|
5853
5853
|
/* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
5854
5854
|
/* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
5855
5855
|
] }),
|
|
5856
5856
|
/* @__PURE__ */ e("span", { children: "Validating" })
|
|
5857
|
-
] }) : $?.isValid && c.trim() === R.trim() ? /* @__PURE__ */ r(
|
|
5857
|
+
] }) : $?.isValid && c.trim() === R.trim() ? /* @__PURE__ */ r(ae, { children: [
|
|
5858
5858
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
5859
5859
|
/* @__PURE__ */ e("span", { children: "Validated" })
|
|
5860
|
-
] }) : /* @__PURE__ */ r(
|
|
5860
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
5861
5861
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
5862
5862
|
/* @__PURE__ */ e("span", { children: "Validate" })
|
|
5863
5863
|
] })
|
|
5864
5864
|
}
|
|
5865
5865
|
)
|
|
5866
5866
|
] }) }),
|
|
5867
|
-
!
|
|
5867
|
+
!ne && /* @__PURE__ */ r("div", { children: [
|
|
5868
5868
|
/* @__PURE__ */ e("label", { className: "block text-sm text-dc-text-muted mb-2", children: "Sample Queries (click to use)" }),
|
|
5869
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2 mb-2", children:
|
|
5869
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2 mb-2", children: Zs.map((Y, ue) => /* @__PURE__ */ e(
|
|
5870
5870
|
"button",
|
|
5871
5871
|
{
|
|
5872
5872
|
type: "button",
|
|
@@ -5881,10 +5881,10 @@ function Ut({
|
|
|
5881
5881
|
}
|
|
5882
5882
|
);
|
|
5883
5883
|
}
|
|
5884
|
-
function
|
|
5884
|
+
function ea({
|
|
5885
5885
|
isOpen: t,
|
|
5886
5886
|
onClose: s,
|
|
5887
|
-
dashboardFilters:
|
|
5887
|
+
dashboardFilters: a = [],
|
|
5888
5888
|
currentMapping: i = [],
|
|
5889
5889
|
onSave: u,
|
|
5890
5890
|
portletTitle: d
|
|
@@ -5926,7 +5926,7 @@ function sn({
|
|
|
5926
5926
|
'"'
|
|
5927
5927
|
] })
|
|
5928
5928
|
] }),
|
|
5929
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-6 py-4", children:
|
|
5929
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: a.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center py-8 text-dc-text-muted", children: [
|
|
5930
5930
|
/* @__PURE__ */ e(
|
|
5931
5931
|
"svg",
|
|
5932
5932
|
{
|
|
@@ -5953,11 +5953,11 @@ function sn({
|
|
|
5953
5953
|
/* @__PURE__ */ r("span", { className: "text-xs text-dc-text-secondary", children: [
|
|
5954
5954
|
f.length,
|
|
5955
5955
|
" of ",
|
|
5956
|
-
|
|
5956
|
+
a.length,
|
|
5957
5957
|
" selected"
|
|
5958
5958
|
] })
|
|
5959
5959
|
] }),
|
|
5960
|
-
|
|
5960
|
+
a.map((l) => {
|
|
5961
5961
|
const k = f.includes(l.id);
|
|
5962
5962
|
return /* @__PURE__ */ r(
|
|
5963
5963
|
"label",
|
|
@@ -6024,10 +6024,10 @@ function sn({
|
|
|
6024
6024
|
}
|
|
6025
6025
|
) }) : null;
|
|
6026
6026
|
}
|
|
6027
|
-
function
|
|
6027
|
+
function cr({
|
|
6028
6028
|
chartConfig: t,
|
|
6029
6029
|
displayConfig: s,
|
|
6030
|
-
queryObject:
|
|
6030
|
+
queryObject: a,
|
|
6031
6031
|
data: i,
|
|
6032
6032
|
chartType: u
|
|
6033
6033
|
}) {
|
|
@@ -6120,7 +6120,7 @@ function ur({
|
|
|
6120
6120
|
] }),
|
|
6121
6121
|
/* @__PURE__ */ r("div", { className: "lg:col-span-2", children: [
|
|
6122
6122
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-dc-text-secondary mb-2", children: "Query Object" }),
|
|
6123
|
-
/* @__PURE__ */ e("pre", { className: "text-dc-text-secondary overflow-x-auto font-mono p-2 rounded-sm border border-dc-border", style: { fontSize: "10px", lineHeight: "1.4" }, children: /* @__PURE__ */ e("code", { className: "language-json", children: JSON.stringify(
|
|
6123
|
+
/* @__PURE__ */ e("pre", { className: "text-dc-text-secondary overflow-x-auto font-mono p-2 rounded-sm border border-dc-border", style: { fontSize: "10px", lineHeight: "1.4" }, children: /* @__PURE__ */ e("code", { className: "language-json", children: JSON.stringify(a, null, 2) }) })
|
|
6124
6124
|
] }),
|
|
6125
6125
|
/* @__PURE__ */ r("div", { className: "lg:col-span-2", children: [
|
|
6126
6126
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-dc-text-secondary mb-2", children: "Data Sample (first 3 rows)" }),
|
|
@@ -7285,15 +7285,15 @@ const tt = [
|
|
|
7285
7285
|
]
|
|
7286
7286
|
}
|
|
7287
7287
|
];
|
|
7288
|
-
function
|
|
7289
|
-
return t && tt.find((
|
|
7288
|
+
function ur(t) {
|
|
7289
|
+
return t && tt.find((a) => a.name === t) || tt[0];
|
|
7290
7290
|
}
|
|
7291
|
-
function
|
|
7291
|
+
function ta({
|
|
7292
7292
|
currentPalette: t = "default",
|
|
7293
7293
|
onPaletteChange: s,
|
|
7294
|
-
className:
|
|
7294
|
+
className: a = ""
|
|
7295
7295
|
}) {
|
|
7296
|
-
const [i, u] = q(!1), d = fe(null), f =
|
|
7296
|
+
const [i, u] = q(!1), d = fe(null), f = ur(t);
|
|
7297
7297
|
se(() => {
|
|
7298
7298
|
function o(m) {
|
|
7299
7299
|
d.current && !d.current.contains(m.target) && u(!1);
|
|
@@ -7304,7 +7304,7 @@ function nn({
|
|
|
7304
7304
|
const g = (o) => {
|
|
7305
7305
|
s(o), u(!1);
|
|
7306
7306
|
};
|
|
7307
|
-
return /* @__PURE__ */ r("div", { className: `relative ${
|
|
7307
|
+
return /* @__PURE__ */ r("div", { className: `relative ${a}`, ref: d, children: [
|
|
7308
7308
|
/* @__PURE__ */ r(
|
|
7309
7309
|
"button",
|
|
7310
7310
|
{
|
|
@@ -7381,10 +7381,10 @@ function nn({
|
|
|
7381
7381
|
)) }) })
|
|
7382
7382
|
] });
|
|
7383
7383
|
}
|
|
7384
|
-
const
|
|
7384
|
+
const ra = ({
|
|
7385
7385
|
filter: t,
|
|
7386
7386
|
schema: s,
|
|
7387
|
-
dashboardConfig:
|
|
7387
|
+
dashboardConfig: a,
|
|
7388
7388
|
isOpen: i,
|
|
7389
7389
|
onSave: u,
|
|
7390
7390
|
onClose: d,
|
|
@@ -7395,7 +7395,7 @@ const an = ({
|
|
|
7395
7395
|
se(() => {
|
|
7396
7396
|
i && (m(t.label), h(t.filter));
|
|
7397
7397
|
}, [t, i]);
|
|
7398
|
-
const x = ye(() =>
|
|
7398
|
+
const x = ye(() => bs(a), [a]), D = ye(() => {
|
|
7399
7399
|
if (!s) return null;
|
|
7400
7400
|
if (l)
|
|
7401
7401
|
return g(s);
|
|
@@ -7433,7 +7433,7 @@ const an = ({
|
|
|
7433
7433
|
...c,
|
|
7434
7434
|
values: Array.isArray(N) ? N : [N]
|
|
7435
7435
|
});
|
|
7436
|
-
}, [c]), L = B(() => o.trim() ? !t.isUniversalTime && "member" in c && !c.member ? { isValid: !1, message: "Please select a field for the filter" } : { isValid: !0 } : { isValid: !1, message: "Filter label is required" }, [o, c, t.isUniversalTime]),
|
|
7436
|
+
}, [c]), L = B(() => o.trim() ? !t.isUniversalTime && "member" in c && !c.member ? { isValid: !1, message: "Please select a field for the filter" } : { isValid: !0 } : { isValid: !1, message: "Filter label is required" }, [o, c, t.isUniversalTime]), n = B(async () => {
|
|
7437
7437
|
const p = L();
|
|
7438
7438
|
if (!p.isValid) {
|
|
7439
7439
|
alert(p.message);
|
|
@@ -7488,11 +7488,11 @@ const an = ({
|
|
|
7488
7488
|
onClick: () => k(!l),
|
|
7489
7489
|
className: "flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400",
|
|
7490
7490
|
title: l ? "Show dashboard fields only" : "Show all fields",
|
|
7491
|
-
children: l ? /* @__PURE__ */ r(
|
|
7492
|
-
/* @__PURE__ */ e(
|
|
7491
|
+
children: l ? /* @__PURE__ */ r(ae, { children: [
|
|
7492
|
+
/* @__PURE__ */ e(Qr, { className: "w-3.5 h-3.5" }),
|
|
7493
7493
|
/* @__PURE__ */ e("span", { children: "Dashboard" })
|
|
7494
|
-
] }) : /* @__PURE__ */ r(
|
|
7495
|
-
/* @__PURE__ */ e(
|
|
7494
|
+
] }) : /* @__PURE__ */ r(ae, { children: [
|
|
7495
|
+
/* @__PURE__ */ e(Br, { className: "w-3.5 h-3.5" }),
|
|
7496
7496
|
/* @__PURE__ */ e("span", { children: "All" })
|
|
7497
7497
|
] })
|
|
7498
7498
|
}
|
|
@@ -7553,7 +7553,7 @@ const an = ({
|
|
|
7553
7553
|
) : (
|
|
7554
7554
|
/* Regular filter - show FilterBuilder */
|
|
7555
7555
|
/* @__PURE__ */ e(
|
|
7556
|
-
|
|
7556
|
+
lr,
|
|
7557
7557
|
{
|
|
7558
7558
|
filters: [c],
|
|
7559
7559
|
schema: g(s),
|
|
@@ -7575,17 +7575,17 @@ const an = ({
|
|
|
7575
7575
|
/* @__PURE__ */ e(
|
|
7576
7576
|
"button",
|
|
7577
7577
|
{
|
|
7578
|
-
onClick:
|
|
7578
|
+
onClick: n,
|
|
7579
7579
|
className: "px-4 py-2 text-sm font-medium rounded-md transition-colors bg-blue-600 hover:bg-blue-700 text-white",
|
|
7580
7580
|
children: "Done"
|
|
7581
7581
|
}
|
|
7582
7582
|
)
|
|
7583
7583
|
] })
|
|
7584
7584
|
] }) });
|
|
7585
|
-
},
|
|
7585
|
+
}, sa = ({
|
|
7586
7586
|
dashboardFilters: t,
|
|
7587
7587
|
schema: s,
|
|
7588
|
-
onFilterChange:
|
|
7588
|
+
onFilterChange: a,
|
|
7589
7589
|
onDateRangeChange: i,
|
|
7590
7590
|
convertToMetaResponse: u,
|
|
7591
7591
|
isTimeDimensionField: d
|
|
@@ -7643,7 +7643,7 @@ const an = ({
|
|
|
7643
7643
|
filter: l,
|
|
7644
7644
|
index: 0,
|
|
7645
7645
|
onFilterChange: (x, D) => {
|
|
7646
|
-
|
|
7646
|
+
a(o, {
|
|
7647
7647
|
...g,
|
|
7648
7648
|
filter: D
|
|
7649
7649
|
});
|
|
@@ -7658,7 +7658,7 @@ const an = ({
|
|
|
7658
7658
|
}
|
|
7659
7659
|
)
|
|
7660
7660
|
] }, o);
|
|
7661
|
-
}, [s, u, d,
|
|
7661
|
+
}, [s, u, d, a, i]);
|
|
7662
7662
|
return t.length === 0 ? null : /* @__PURE__ */ r("div", { className: "px-4 py-3", children: [
|
|
7663
7663
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
7664
7664
|
/* @__PURE__ */ e(we, { className: "w-4 h-4 shrink-0", style: { color: "var(--dc-primary)" } }),
|
|
@@ -7677,10 +7677,10 @@ const an = ({
|
|
|
7677
7677
|
] }),
|
|
7678
7678
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: t.map(f) })
|
|
7679
7679
|
] });
|
|
7680
|
-
},
|
|
7680
|
+
}, aa = ({
|
|
7681
7681
|
dashboardFilters: t,
|
|
7682
7682
|
onAddFilter: s,
|
|
7683
|
-
onAddTimeFilter:
|
|
7683
|
+
onAddTimeFilter: a,
|
|
7684
7684
|
onEditFilter: i,
|
|
7685
7685
|
onRemoveFilter: u,
|
|
7686
7686
|
selectedFilterId: d,
|
|
@@ -7736,7 +7736,7 @@ const an = ({
|
|
|
7736
7736
|
h
|
|
7737
7737
|
);
|
|
7738
7738
|
};
|
|
7739
|
-
return /* @__PURE__ */ r(
|
|
7739
|
+
return /* @__PURE__ */ r(ae, { children: [
|
|
7740
7740
|
/* @__PURE__ */ r("div", { className: "md:hidden", children: [
|
|
7741
7741
|
/* @__PURE__ */ r(
|
|
7742
7742
|
"div",
|
|
@@ -7771,7 +7771,7 @@ const an = ({
|
|
|
7771
7771
|
"button",
|
|
7772
7772
|
{
|
|
7773
7773
|
onClick: (c) => {
|
|
7774
|
-
c.stopPropagation(),
|
|
7774
|
+
c.stopPropagation(), a();
|
|
7775
7775
|
},
|
|
7776
7776
|
className: "inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors hover:opacity-80",
|
|
7777
7777
|
style: {
|
|
@@ -7848,7 +7848,7 @@ const an = ({
|
|
|
7848
7848
|
!t.some((c) => c.isUniversalTime) && /* @__PURE__ */ r(
|
|
7849
7849
|
"button",
|
|
7850
7850
|
{
|
|
7851
|
-
onClick:
|
|
7851
|
+
onClick: a,
|
|
7852
7852
|
className: "inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors hover:opacity-80",
|
|
7853
7853
|
style: {
|
|
7854
7854
|
backgroundColor: "var(--dc-surface)",
|
|
@@ -7880,10 +7880,10 @@ const an = ({
|
|
|
7880
7880
|
] })
|
|
7881
7881
|
] })
|
|
7882
7882
|
] });
|
|
7883
|
-
},
|
|
7883
|
+
}, na = ({
|
|
7884
7884
|
dashboardFilters: t,
|
|
7885
7885
|
editable: s,
|
|
7886
|
-
schema:
|
|
7886
|
+
schema: a,
|
|
7887
7887
|
dashboardConfig: i,
|
|
7888
7888
|
onDashboardFiltersChange: u,
|
|
7889
7889
|
onSaveFilters: d,
|
|
@@ -7978,14 +7978,14 @@ const an = ({
|
|
|
7978
7978
|
return T;
|
|
7979
7979
|
});
|
|
7980
7980
|
u(E);
|
|
7981
|
-
}, [t, u]),
|
|
7981
|
+
}, [t, u]), n = B((p, N) => {
|
|
7982
7982
|
const E = t.map(
|
|
7983
7983
|
(T) => T.id === p ? N : T
|
|
7984
7984
|
);
|
|
7985
7985
|
u(E);
|
|
7986
|
-
}, [t, u]), b = B((p) =>
|
|
7986
|
+
}, [t, u]), b = B((p) => a ? a.cubes.some(
|
|
7987
7987
|
(N) => N.dimensions.some((E) => E.name === p && E.type === "time")
|
|
7988
|
-
) : !1, [
|
|
7988
|
+
) : !1, [a]);
|
|
7989
7989
|
return !s || !o && t.length === 0 ? null : /* @__PURE__ */ r(
|
|
7990
7990
|
"div",
|
|
7991
7991
|
{
|
|
@@ -7997,7 +7997,7 @@ const an = ({
|
|
|
7997
7997
|
},
|
|
7998
7998
|
children: [
|
|
7999
7999
|
o ? /* @__PURE__ */ e(
|
|
8000
|
-
|
|
8000
|
+
aa,
|
|
8001
8001
|
{
|
|
8002
8002
|
dashboardFilters: t,
|
|
8003
8003
|
onAddFilter: D,
|
|
@@ -8010,11 +8010,11 @@ const an = ({
|
|
|
8010
8010
|
) : (
|
|
8011
8011
|
/* View Mode - Read-only interactive filters */
|
|
8012
8012
|
/* @__PURE__ */ e(
|
|
8013
|
-
|
|
8013
|
+
sa,
|
|
8014
8014
|
{
|
|
8015
8015
|
dashboardFilters: t,
|
|
8016
|
-
schema:
|
|
8017
|
-
onFilterChange:
|
|
8016
|
+
schema: a,
|
|
8017
|
+
onFilterChange: n,
|
|
8018
8018
|
onDateRangeChange: L,
|
|
8019
8019
|
convertToMetaResponse: k,
|
|
8020
8020
|
isTimeDimensionField: b
|
|
@@ -8022,10 +8022,10 @@ const an = ({
|
|
|
8022
8022
|
)
|
|
8023
8023
|
),
|
|
8024
8024
|
s && h && m && /* @__PURE__ */ e(
|
|
8025
|
-
|
|
8025
|
+
ra,
|
|
8026
8026
|
{
|
|
8027
8027
|
filter: m,
|
|
8028
|
-
schema:
|
|
8028
|
+
schema: a,
|
|
8029
8029
|
dashboardConfig: i,
|
|
8030
8030
|
isOpen: h,
|
|
8031
8031
|
onSave: V,
|
|
@@ -8038,10 +8038,10 @@ const an = ({
|
|
|
8038
8038
|
}
|
|
8039
8039
|
);
|
|
8040
8040
|
};
|
|
8041
|
-
function
|
|
8041
|
+
function la({
|
|
8042
8042
|
scaleFactor: t,
|
|
8043
8043
|
designWidth: s,
|
|
8044
|
-
children:
|
|
8044
|
+
children: a
|
|
8045
8045
|
}) {
|
|
8046
8046
|
const [i, u] = q(0), d = fe(null);
|
|
8047
8047
|
se(() => {
|
|
@@ -8071,17 +8071,17 @@ function cn({
|
|
|
8071
8071
|
transformOrigin: "top left",
|
|
8072
8072
|
width: s
|
|
8073
8073
|
},
|
|
8074
|
-
children:
|
|
8074
|
+
children: a
|
|
8075
8075
|
}
|
|
8076
8076
|
)
|
|
8077
8077
|
}
|
|
8078
8078
|
);
|
|
8079
8079
|
}
|
|
8080
|
-
function
|
|
8080
|
+
function ia(t) {
|
|
8081
8081
|
if (!t) return null;
|
|
8082
8082
|
let s = t.parentElement;
|
|
8083
8083
|
for (; s; ) {
|
|
8084
|
-
const
|
|
8084
|
+
const a = window.getComputedStyle(s), i = a.overflowY, u = a.overflowX, d = i === "auto" || i === "scroll" || u === "auto" || u === "scroll", f = s.scrollHeight > s.clientHeight || s.scrollWidth > s.clientWidth;
|
|
8085
8085
|
if (d && f)
|
|
8086
8086
|
return s;
|
|
8087
8087
|
if (s === document.body) break;
|
|
@@ -8089,18 +8089,18 @@ function un(t) {
|
|
|
8089
8089
|
}
|
|
8090
8090
|
return null;
|
|
8091
8091
|
}
|
|
8092
|
-
function
|
|
8092
|
+
function oa({
|
|
8093
8093
|
config: t,
|
|
8094
8094
|
colorPalette: s,
|
|
8095
|
-
dashboardFilters:
|
|
8095
|
+
dashboardFilters: a,
|
|
8096
8096
|
onPortletRefresh: i
|
|
8097
8097
|
}) {
|
|
8098
8098
|
const u = fe({}), [d, f] = q(null), g = fe(null), o = B((h) => {
|
|
8099
|
-
g.current = h, h && f(
|
|
8099
|
+
g.current = h, h && f(ia(h));
|
|
8100
8100
|
}, []), m = ye(() => [...t.portlets].sort((h, l) => h.y !== l.y ? h.y - l.y : h.x - l.x), [t.portlets]), c = (h) => {
|
|
8101
8101
|
u.current[h]?.refresh(), i?.(h);
|
|
8102
8102
|
};
|
|
8103
|
-
return /* @__PURE__ */ e(
|
|
8103
|
+
return /* @__PURE__ */ e(Wt, { value: d, children: /* @__PURE__ */ e("div", { ref: o, className: "mobile-stacked-layout space-y-4 px-2", children: m.map((h) => {
|
|
8104
8104
|
const l = Math.max(300, h.h * 80), k = h.displayConfig?.hideHeader ? 0 : 40, x = l - k - 24;
|
|
8105
8105
|
return /* @__PURE__ */ r(
|
|
8106
8106
|
"div",
|
|
@@ -8130,7 +8130,7 @@ function mn({
|
|
|
8130
8130
|
className: "px-2 py-3 overflow-visible flex flex-col",
|
|
8131
8131
|
style: { height: x },
|
|
8132
8132
|
children: /* @__PURE__ */ e(
|
|
8133
|
-
|
|
8133
|
+
nt,
|
|
8134
8134
|
{
|
|
8135
8135
|
ref: (D) => {
|
|
8136
8136
|
u.current[h.id] = D;
|
|
@@ -8139,7 +8139,7 @@ function mn({
|
|
|
8139
8139
|
chartType: h.chartType,
|
|
8140
8140
|
chartConfig: h.chartConfig,
|
|
8141
8141
|
displayConfig: h.displayConfig,
|
|
8142
|
-
dashboardFilters:
|
|
8142
|
+
dashboardFilters: a,
|
|
8143
8143
|
dashboardFilterMapping: h.dashboardFilterMapping,
|
|
8144
8144
|
eagerLoad: h.eagerLoad ?? t.eagerLoad ?? !1,
|
|
8145
8145
|
title: h.title,
|
|
@@ -8159,7 +8159,7 @@ function Jt(t) {
|
|
|
8159
8159
|
if (!t) return null;
|
|
8160
8160
|
let s = t.parentElement;
|
|
8161
8161
|
for (; s; ) {
|
|
8162
|
-
const
|
|
8162
|
+
const a = window.getComputedStyle(s), i = a.overflowY, u = a.overflowX, d = i === "auto" || i === "scroll" || u === "auto" || u === "scroll", f = s.scrollHeight > s.clientHeight || s.scrollWidth > s.clientWidth;
|
|
8163
8163
|
if (d && f)
|
|
8164
8164
|
return s;
|
|
8165
8165
|
if (s === document.body) break;
|
|
@@ -8167,10 +8167,10 @@ function Jt(t) {
|
|
|
8167
8167
|
}
|
|
8168
8168
|
return null;
|
|
8169
8169
|
}
|
|
8170
|
-
function
|
|
8170
|
+
function da({
|
|
8171
8171
|
config: t,
|
|
8172
8172
|
editable: s = !1,
|
|
8173
|
-
dashboardFilters:
|
|
8173
|
+
dashboardFilters: a,
|
|
8174
8174
|
loadingComponent: i,
|
|
8175
8175
|
onConfigChange: u,
|
|
8176
8176
|
onPortletRefresh: d,
|
|
@@ -8192,7 +8192,7 @@ function fn({
|
|
|
8192
8192
|
}, []);
|
|
8193
8193
|
const V = B((A) => {
|
|
8194
8194
|
$.current = A, c(A), A && O(Jt(A));
|
|
8195
|
-
}, [c]), R = l === "desktop" ? h : D, L = fe({}),
|
|
8195
|
+
}, [c]), R = l === "desktop" ? h : D, L = fe({}), n = fe({}), [b, p] = q(!1), [N, E] = q([]), [T, z] = q(!1), [P, y] = q(null);
|
|
8196
8196
|
se(() => {
|
|
8197
8197
|
(!T || !x) && P && y(null);
|
|
8198
8198
|
}, [T, x, P]), se(() => {
|
|
@@ -8291,8 +8291,8 @@ function fn({
|
|
|
8291
8291
|
} catch (le) {
|
|
8292
8292
|
console.error("Auto-save failed after resize:", le);
|
|
8293
8293
|
}
|
|
8294
|
-
}, [t.portlets, t.layouts, s, T, u, f, b, de]),
|
|
8295
|
-
const G =
|
|
8294
|
+
}, [t.portlets, t.layouts, s, T, u, f, b, de]), ne = B((A) => {
|
|
8295
|
+
const G = n.current[A];
|
|
8296
8296
|
G && G.refresh && G.refresh(), d && d(A);
|
|
8297
8297
|
}, [d]), X = B(() => {
|
|
8298
8298
|
te(null), U(!0);
|
|
@@ -8467,9 +8467,9 @@ function fn({
|
|
|
8467
8467
|
} catch (v) {
|
|
8468
8468
|
console.error("Auto-save failed:", v);
|
|
8469
8469
|
}
|
|
8470
|
-
}, [t, u, f]), Ae = P ?
|
|
8470
|
+
}, [t, u, f]), Ae = P ? a?.find((A) => A.id === P) : null;
|
|
8471
8471
|
if (!t.portlets || t.portlets.length === 0)
|
|
8472
|
-
return /* @__PURE__ */ r(
|
|
8472
|
+
return /* @__PURE__ */ r(ae, { children: [
|
|
8473
8473
|
/* @__PURE__ */ e("div", { className: "flex justify-center items-center min-h-[50vh]", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
8474
8474
|
/* @__PURE__ */ e(He, { style: { width: "64px", height: "64px", color: "var(--dc-text-muted)", margin: "0 auto 16px auto" } }),
|
|
8475
8475
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-2 text-dc-text", children: "No Portlets" }),
|
|
@@ -8516,7 +8516,7 @@ function fn({
|
|
|
8516
8516
|
minW: 3,
|
|
8517
8517
|
minH: 3
|
|
8518
8518
|
})), We = s && T && x && !P, Ye = () => /* @__PURE__ */ e(
|
|
8519
|
-
|
|
8519
|
+
Jr,
|
|
8520
8520
|
{
|
|
8521
8521
|
className: "layout",
|
|
8522
8522
|
layout: it,
|
|
@@ -8565,7 +8565,7 @@ function fn({
|
|
|
8565
8565
|
onTouchStart: (v) => v.stopPropagation(),
|
|
8566
8566
|
onTouchEnd: (v) => v.stopPropagation(),
|
|
8567
8567
|
children: /* @__PURE__ */ e(
|
|
8568
|
-
|
|
8568
|
+
cr,
|
|
8569
8569
|
{
|
|
8570
8570
|
chartConfig: W[A.id].chartConfig,
|
|
8571
8571
|
displayConfig: W[A.id].displayConfig,
|
|
@@ -8590,10 +8590,10 @@ function fn({
|
|
|
8590
8590
|
"button",
|
|
8591
8591
|
{
|
|
8592
8592
|
onClick: (v) => {
|
|
8593
|
-
v.stopPropagation(),
|
|
8593
|
+
v.stopPropagation(), ne(A.id);
|
|
8594
8594
|
},
|
|
8595
8595
|
onTouchEnd: (v) => {
|
|
8596
|
-
v.stopPropagation(), v.preventDefault(),
|
|
8596
|
+
v.stopPropagation(), v.preventDefault(), ne(A.id);
|
|
8597
8597
|
},
|
|
8598
8598
|
disabled: w,
|
|
8599
8599
|
className: `p-1 bg-transparent border-none rounded-sm text-dc-text-secondary transition-colors ${w ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-dc-surface-hover"}`,
|
|
@@ -8601,7 +8601,7 @@ function fn({
|
|
|
8601
8601
|
children: /* @__PURE__ */ e(Ge, { style: { width: "16px", height: "16px", color: "currentColor" } })
|
|
8602
8602
|
}
|
|
8603
8603
|
),
|
|
8604
|
-
s && T && !w && /* @__PURE__ */ r(
|
|
8604
|
+
s && T && !w && /* @__PURE__ */ r(ae, { children: [
|
|
8605
8605
|
/* @__PURE__ */ e(
|
|
8606
8606
|
"button",
|
|
8607
8607
|
{
|
|
@@ -8630,7 +8630,7 @@ function fn({
|
|
|
8630
8630
|
},
|
|
8631
8631
|
className: "p-1 bg-transparent border-none rounded-sm text-dc-text-secondary cursor-pointer hover:bg-dc-surface-hover transition-colors",
|
|
8632
8632
|
title: "Duplicate portlet",
|
|
8633
|
-
children: /* @__PURE__ */ e(
|
|
8633
|
+
children: /* @__PURE__ */ e(Ur, { style: { width: "16px", height: "16px", color: "currentColor" } })
|
|
8634
8634
|
}
|
|
8635
8635
|
),
|
|
8636
8636
|
/* @__PURE__ */ e(
|
|
@@ -8659,7 +8659,7 @@ function fn({
|
|
|
8659
8659
|
className: "p-1 bg-transparent border-none rounded-sm cursor-pointer hover:bg-red-50 transition-colors",
|
|
8660
8660
|
style: { color: "#ef4444" },
|
|
8661
8661
|
title: "Delete portlet",
|
|
8662
|
-
children: /* @__PURE__ */ e(
|
|
8662
|
+
children: /* @__PURE__ */ e(Zt, { style: { width: "16px", height: "16px", color: "currentColor" } })
|
|
8663
8663
|
}
|
|
8664
8664
|
)
|
|
8665
8665
|
] })
|
|
@@ -8668,16 +8668,16 @@ function fn({
|
|
|
8668
8668
|
)
|
|
8669
8669
|
] }),
|
|
8670
8670
|
/* @__PURE__ */ e("div", { className: "flex-1 px-2 py-3 md:px-4 md:py-4 min-h-0 overflow-visible flex flex-col", children: /* @__PURE__ */ e(
|
|
8671
|
-
|
|
8671
|
+
nt,
|
|
8672
8672
|
{
|
|
8673
8673
|
ref: (v) => {
|
|
8674
|
-
|
|
8674
|
+
n.current[A.id] = v;
|
|
8675
8675
|
},
|
|
8676
8676
|
query: A.query,
|
|
8677
8677
|
chartType: A.chartType,
|
|
8678
8678
|
chartConfig: A.chartConfig,
|
|
8679
8679
|
displayConfig: A.displayConfig,
|
|
8680
|
-
dashboardFilters:
|
|
8680
|
+
dashboardFilters: a,
|
|
8681
8681
|
dashboardFilterMapping: A.dashboardFilterMapping,
|
|
8682
8682
|
eagerLoad: A.eagerLoad ?? t.eagerLoad ?? !1,
|
|
8683
8683
|
title: A.title,
|
|
@@ -8699,7 +8699,7 @@ function fn({
|
|
|
8699
8699
|
})
|
|
8700
8700
|
}
|
|
8701
8701
|
);
|
|
8702
|
-
return /* @__PURE__ */ e(
|
|
8702
|
+
return /* @__PURE__ */ e(Wt, { value: S, children: /* @__PURE__ */ r("div", { ref: V, className: "dashboard-grid-container w-full", style: { maxWidth: "100%", overflow: "hidden" }, children: [
|
|
8703
8703
|
s && /* @__PURE__ */ r(
|
|
8704
8704
|
"div",
|
|
8705
8705
|
{
|
|
@@ -8726,14 +8726,14 @@ function fn({
|
|
|
8726
8726
|
}
|
|
8727
8727
|
),
|
|
8728
8728
|
!x && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-sm text-dc-text-secondary", children: [
|
|
8729
|
-
/* @__PURE__ */ e(
|
|
8729
|
+
/* @__PURE__ */ e(zr, { className: "w-4 h-4" }),
|
|
8730
8730
|
/* @__PURE__ */ e("span", { children: "Desktop view required for editing" })
|
|
8731
8731
|
] }),
|
|
8732
8732
|
T && x && /* @__PURE__ */ e("p", { className: "hidden md:block text-sm text-dc-text-secondary", children: "Drag to rearrange • Resize from corners • Changes save automatically" })
|
|
8733
8733
|
] }),
|
|
8734
8734
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
8735
8735
|
T && /* @__PURE__ */ e(
|
|
8736
|
-
|
|
8736
|
+
ta,
|
|
8737
8737
|
{
|
|
8738
8738
|
currentPalette: t.colorPalette,
|
|
8739
8739
|
onPaletteChange: ue,
|
|
@@ -8761,9 +8761,9 @@ function fn({
|
|
|
8761
8761
|
}
|
|
8762
8762
|
),
|
|
8763
8763
|
/* @__PURE__ */ e(
|
|
8764
|
-
|
|
8764
|
+
na,
|
|
8765
8765
|
{
|
|
8766
|
-
dashboardFilters:
|
|
8766
|
+
dashboardFilters: a || [],
|
|
8767
8767
|
editable: s,
|
|
8768
8768
|
schema: o || null,
|
|
8769
8769
|
dashboardConfig: t,
|
|
@@ -8834,14 +8834,14 @@ function fn({
|
|
|
8834
8834
|
}
|
|
8835
8835
|
),
|
|
8836
8836
|
l === "mobile" ? /* @__PURE__ */ e(
|
|
8837
|
-
|
|
8837
|
+
oa,
|
|
8838
8838
|
{
|
|
8839
8839
|
config: t,
|
|
8840
8840
|
colorPalette: g,
|
|
8841
|
-
dashboardFilters:
|
|
8842
|
-
onPortletRefresh:
|
|
8841
|
+
dashboardFilters: a,
|
|
8842
|
+
onPortletRefresh: ne
|
|
8843
8843
|
}
|
|
8844
|
-
) : l === "scaled" ? /* @__PURE__ */ e(
|
|
8844
|
+
) : l === "scaled" ? /* @__PURE__ */ e(la, { scaleFactor: k, designWidth: D, children: Ye() }) : Ye(),
|
|
8845
8845
|
/* @__PURE__ */ e(
|
|
8846
8846
|
Ut,
|
|
8847
8847
|
{
|
|
@@ -8857,13 +8857,13 @@ function fn({
|
|
|
8857
8857
|
}
|
|
8858
8858
|
),
|
|
8859
8859
|
/* @__PURE__ */ e(
|
|
8860
|
-
|
|
8860
|
+
ea,
|
|
8861
8861
|
{
|
|
8862
8862
|
isOpen: oe,
|
|
8863
8863
|
onClose: () => {
|
|
8864
8864
|
he(!1), K(null);
|
|
8865
8865
|
},
|
|
8866
|
-
dashboardFilters:
|
|
8866
|
+
dashboardFilters: a || [],
|
|
8867
8867
|
currentMapping: j?.dashboardFilterMapping || [],
|
|
8868
8868
|
onSave: ke,
|
|
8869
8869
|
portletTitle: j?.title || ""
|
|
@@ -8871,23 +8871,23 @@ function fn({
|
|
|
8871
8871
|
)
|
|
8872
8872
|
] }) });
|
|
8873
8873
|
}
|
|
8874
|
-
function
|
|
8874
|
+
function La({
|
|
8875
8875
|
config: t,
|
|
8876
8876
|
editable: s = !1,
|
|
8877
|
-
dashboardFilters:
|
|
8877
|
+
dashboardFilters: a,
|
|
8878
8878
|
loadingComponent: i,
|
|
8879
8879
|
onConfigChange: u,
|
|
8880
8880
|
onSave: d,
|
|
8881
8881
|
onDirtyStateChange: f
|
|
8882
8882
|
}) {
|
|
8883
8883
|
const { meta: g } = kt(), o = fe(t), m = fe(!1), c = ye(() => {
|
|
8884
|
-
const D = t.filters || [], S =
|
|
8884
|
+
const D = t.filters || [], S = a || [];
|
|
8885
8885
|
if (S.length === 0)
|
|
8886
8886
|
return D;
|
|
8887
8887
|
if (D.length === 0)
|
|
8888
8888
|
return S;
|
|
8889
8889
|
const O = D.map((R) => {
|
|
8890
|
-
const L = S.find((
|
|
8890
|
+
const L = S.find((n) => n.id === R.id);
|
|
8891
8891
|
return L ? {
|
|
8892
8892
|
...R,
|
|
8893
8893
|
// Preserve id, label, isUniversalTime from config
|
|
@@ -8896,7 +8896,7 @@ function Mn({
|
|
|
8896
8896
|
} : R;
|
|
8897
8897
|
}), $ = new Set(D.map((R) => R.id)), V = S.filter((R) => !$.has(R.id));
|
|
8898
8898
|
return [...O, ...V];
|
|
8899
|
-
}, [t.filters,
|
|
8899
|
+
}, [t.filters, a]), h = B(async (D) => {
|
|
8900
8900
|
if (m.current) {
|
|
8901
8901
|
f && f(!0);
|
|
8902
8902
|
try {
|
|
@@ -8910,7 +8910,7 @@ function Mn({
|
|
|
8910
8910
|
const S = JSON.stringify(D), O = JSON.stringify(o.current);
|
|
8911
8911
|
S !== O && (m.current = !0, f && f(!0));
|
|
8912
8912
|
}, [u, f]), k = B((D) => {
|
|
8913
|
-
if (!
|
|
8913
|
+
if (!a || a.length === 0) {
|
|
8914
8914
|
const S = {
|
|
8915
8915
|
...t,
|
|
8916
8916
|
filters: D
|
|
@@ -8918,12 +8918,12 @@ function Mn({
|
|
|
8918
8918
|
l(S);
|
|
8919
8919
|
} else
|
|
8920
8920
|
console.warn("Dashboard filters are controlled via props - config changes ignored");
|
|
8921
|
-
}, [t,
|
|
8921
|
+
}, [t, a, l]), x = ye(() => {
|
|
8922
8922
|
const D = t.colorPalette;
|
|
8923
|
-
return
|
|
8923
|
+
return ur(D);
|
|
8924
8924
|
}, [t.colorPalette]);
|
|
8925
8925
|
return /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(
|
|
8926
|
-
|
|
8926
|
+
da,
|
|
8927
8927
|
{
|
|
8928
8928
|
config: t,
|
|
8929
8929
|
editable: s,
|
|
@@ -8937,10 +8937,10 @@ function Mn({
|
|
|
8937
8937
|
}
|
|
8938
8938
|
) });
|
|
8939
8939
|
}
|
|
8940
|
-
function
|
|
8940
|
+
function Va({
|
|
8941
8941
|
portlet: t,
|
|
8942
8942
|
editable: s = !1,
|
|
8943
|
-
onEdit:
|
|
8943
|
+
onEdit: a,
|
|
8944
8944
|
onDelete: i,
|
|
8945
8945
|
onRefresh: u
|
|
8946
8946
|
}) {
|
|
@@ -8950,7 +8950,7 @@ function qn({
|
|
|
8950
8950
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
8951
8951
|
/* @__PURE__ */ e("h3", { className: "font-semibold text-sm truncate text-dc-text", children: t.title }),
|
|
8952
8952
|
d && /* @__PURE__ */ e(
|
|
8953
|
-
|
|
8953
|
+
cr,
|
|
8954
8954
|
{
|
|
8955
8955
|
chartConfig: d.chartConfig,
|
|
8956
8956
|
displayConfig: d.displayConfig,
|
|
@@ -8960,7 +8960,7 @@ function qn({
|
|
|
8960
8960
|
}
|
|
8961
8961
|
)
|
|
8962
8962
|
] }),
|
|
8963
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 ml-4", children: s && /* @__PURE__ */ r(
|
|
8963
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 ml-4", children: s && /* @__PURE__ */ r(ae, { children: [
|
|
8964
8964
|
/* @__PURE__ */ e(
|
|
8965
8965
|
"button",
|
|
8966
8966
|
{
|
|
@@ -8973,7 +8973,7 @@ function qn({
|
|
|
8973
8973
|
/* @__PURE__ */ e(
|
|
8974
8974
|
"button",
|
|
8975
8975
|
{
|
|
8976
|
-
onClick: () =>
|
|
8976
|
+
onClick: () => a?.(t),
|
|
8977
8977
|
className: "p-1.5 hover:bg-dc-surface-hover rounded-sm text-dc-text-secondary",
|
|
8978
8978
|
title: "Edit",
|
|
8979
8979
|
children: /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
|
|
@@ -8994,7 +8994,7 @@ function qn({
|
|
|
8994
8994
|
] }) })
|
|
8995
8995
|
] }),
|
|
8996
8996
|
/* @__PURE__ */ e("div", { className: "px-2 py-3 md:px-4 md:pt-6 md:pb-4 flex-1 min-h-0", children: /* @__PURE__ */ e(
|
|
8997
|
-
|
|
8997
|
+
nt,
|
|
8998
8998
|
{
|
|
8999
8999
|
query: t.query,
|
|
9000
9000
|
chartType: t.chartType,
|
|
@@ -9009,10 +9009,10 @@ function qn({
|
|
|
9009
9009
|
) })
|
|
9010
9010
|
] });
|
|
9011
9011
|
}
|
|
9012
|
-
function
|
|
9012
|
+
function Pa({
|
|
9013
9013
|
isOpen: t,
|
|
9014
9014
|
onClose: s,
|
|
9015
|
-
onSave:
|
|
9015
|
+
onSave: a,
|
|
9016
9016
|
title: i,
|
|
9017
9017
|
submitText: u,
|
|
9018
9018
|
initialName: d = "",
|
|
@@ -9026,7 +9026,7 @@ function _n({
|
|
|
9026
9026
|
if (S.preventDefault(), !!g.trim()) {
|
|
9027
9027
|
l(!0);
|
|
9028
9028
|
try {
|
|
9029
|
-
await
|
|
9029
|
+
await a({
|
|
9030
9030
|
name: g.trim(),
|
|
9031
9031
|
description: m.trim() || void 0
|
|
9032
9032
|
}), x();
|
|
@@ -9037,7 +9037,7 @@ function _n({
|
|
|
9037
9037
|
}
|
|
9038
9038
|
}, x = () => {
|
|
9039
9039
|
o(""), c(""), l(!1), s();
|
|
9040
|
-
}, D = /* @__PURE__ */ r(
|
|
9040
|
+
}, D = /* @__PURE__ */ r(ae, { children: [
|
|
9041
9041
|
/* @__PURE__ */ e(
|
|
9042
9042
|
"button",
|
|
9043
9043
|
{
|
|
@@ -9103,36 +9103,36 @@ function _n({
|
|
|
9103
9103
|
);
|
|
9104
9104
|
}
|
|
9105
9105
|
export {
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9106
|
+
La as AnalyticsDashboard,
|
|
9107
|
+
nt as AnalyticsPortlet,
|
|
9108
|
+
Ua as CubeProvider,
|
|
9109
|
+
Pa as DashboardEditModal,
|
|
9110
|
+
da as DashboardGrid,
|
|
9111
9111
|
ft as LazyChart,
|
|
9112
|
-
|
|
9112
|
+
mr as LoadingIndicator,
|
|
9113
9113
|
lt as Modal,
|
|
9114
|
-
|
|
9114
|
+
Va as PortletContainer,
|
|
9115
9115
|
Ut as PortletEditModal,
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9116
|
+
dr as QueryBuilder,
|
|
9117
|
+
Wt as ScrollContainerProvider,
|
|
9118
|
+
Ja as THEME_PRESETS,
|
|
9119
|
+
Ha as applyTheme,
|
|
9120
|
+
Ga as createCubeClient,
|
|
9121
|
+
_a as createDashboardLayout,
|
|
9122
|
+
Ia as formatChartData,
|
|
9123
|
+
ja as getAvailableChartTypes,
|
|
9124
|
+
Wa as getTheme,
|
|
9125
|
+
Ya as getThemeVariable,
|
|
9126
|
+
Ka as isDarkMode,
|
|
9127
9127
|
Ht as isValidChartType,
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9128
|
+
Qa as preloadChart,
|
|
9129
|
+
Ba as preloadCharts,
|
|
9130
|
+
Xa as resetTheme,
|
|
9131
|
+
Za as setTheme,
|
|
9132
|
+
en as setThemeVariable,
|
|
9133
9133
|
kt as useCubeContext,
|
|
9134
9134
|
pr as useCubeQuery,
|
|
9135
|
-
|
|
9136
|
-
|
|
9135
|
+
hr as useScrollContainer,
|
|
9136
|
+
tn as watchThemeChanges
|
|
9137
9137
|
};
|
|
9138
9138
|
//# sourceMappingURL=index.js.map
|