react-semaphor 0.1.183 → 0.1.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/calendar-preferences-dialog-D9oF_URo.js +1 -0
- package/dist/chunks/calendar-preferences-dialog-DeXKY9JD.js +457 -0
- package/dist/chunks/common-types-CfJLrTJd.js +1 -0
- package/dist/chunks/common-types-DhqlRVrq.js +8 -0
- package/dist/chunks/{dashboard-controls-BqMZqU3v.js → dashboard-controls-CB8282ob.js} +8 -8
- package/dist/chunks/{dashboard-controls-F8wbPI8x.js → dashboard-controls-lRs5t5cg.js} +499 -484
- package/dist/chunks/{dashboard-json-DUNbo5Io.js → dashboard-json-BmzqRV5Q.js} +1 -1
- package/dist/chunks/{dashboard-json-BFRJvB_f.js → dashboard-json-Brn4hMd-.js} +1 -1
- package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
- package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
- package/dist/chunks/{edit-dashboard-visual-CPwMz-Gl.js → edit-dashboard-visual--FJBg3i3.js} +713 -713
- package/dist/chunks/{edit-dashboard-visual-C-2xW9ZO.js → edit-dashboard-visual-DNq8ni5W.js} +8 -8
- package/dist/chunks/{editor-action-buttons-DEi2BM_u.js → editor-action-buttons-COCkxvCM.js} +27 -27
- package/dist/chunks/{editor-action-buttons-C5pFQC5d.js → editor-action-buttons-RPpMm3Zr.js} +1 -1
- package/dist/chunks/{index-LgltNjBB.js → index-CyYJ0bVW.js} +21147 -20949
- package/dist/chunks/{index-CcVMCdNu.js → index-Dz2kwOQh.js} +229 -229
- package/dist/chunks/{notification-bell-BCdcnJx6.js → notification-bell-B86bWytX.js} +109 -109
- package/dist/chunks/{notification-bell-C0rpelXK.js → notification-bell-Bdk-qQIx.js} +2 -2
- package/dist/chunks/{resource-management-panel-D6ZT7DsU.js → resource-management-panel-BZKSwkRq.js} +160 -160
- package/dist/chunks/{resource-management-panel-CaKtrD1Q.js → resource-management-panel-CvKBoIFQ.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-B3xYm_4b.js → use-role-aware-display-preferences-D-jgaajh.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-F6Zc7Evm.js → use-role-aware-display-preferences-Kxc427Zx.js} +1 -1
- package/dist/chunks/{use-visual-utils-B1yUV6dt.js → use-visual-utils-Du4NIgMk.js} +1 -1
- package/dist/chunks/{use-visual-utils-D48U4CBx.js → use-visual-utils-DwQQN6wI.js} +33 -33
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +3 -3
- package/dist/format-utils/index.cjs +5 -5
- package/dist/format-utils/index.js +200 -250
- package/dist/index.cjs +1 -1
- package/dist/index.js +75 -71
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -4
- package/dist/types/format-utils.d.ts +43 -20
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -5
- package/dist/types/main.d.ts +87 -2
- package/dist/types/surfboard.d.ts +7 -0
- package/dist/types/types.d.ts +313 -0
- package/package.json +1 -1
- package/dist/chunks/index-8Crk3ROJ.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { aT as me, cw as Cl, I as ut, aJ as ne, aI as M, cx as ta, L, cy as H, cz as Y, cA as W, cB as Q, cC as B, cD as fe, B as K, b9 as We, cE as Ta, cF as bs, cG as Ns, cH as vs, cI as ys, cJ as Aa, V as st, X as Ae, cK as cn, be as dn, m as St, n as kt, o as Tt, p as At, q as jt, aX as Ve, bA as qe, bw as Ke, bx as Ie, by as Me, cL as $n, cM as un, u as ye, G as ba, cN as $t, bj as aa, c as Z, bL as _e, cO as Cs, b2 as ws, cP as wl, cQ as Sl, cR as kl, cS as la, cT as Tl, cU as Ss, cV as Al, bZ as El, cW as Dl, cX as ks, cY as Ol, cZ as mn, c_ as Il, c$ as pt, d0 as it, d1 as hn, aU as Ml, d2 as Rl, d3 as an, d4 as Et, d5 as Le, d6 as Dt, H as qt, d7 as Ll, d8 as Na, d9 as va, da as ya, db as Ts, ct as Kt, bO as Ea, R as da, dc as pn, dd as ua, bk as fn, r as ft, Y as Fl, de as Pl, bS as Vl, df as at, dg as mt, dh as Bl, di as ht, e as zl, bP as gn, aG as As, dj as xn, dk as jl, dl as Es, dm as Ds, dn as Gt, cq as qa, dp as $l, dq as ql, dr as Os, ds as Kl, dt as Gl, du as Ul, dv as Da, dw as _l, dx as Jl, dy as qn, dz as Hl, J as Oa, Q as bn, dA as Yl, dB as Nn, b$ as Wl, W as Oe, dC as Ql, dD as Xl, ce as Ia, cf as Ma, cg as nt, ch as ga, dE as Zl, bz as er, dF as Is, dG as tr, dH as ar, bH as Ra, bF as $e, P as Je, s as He, dI as nr, t as Ye, b4 as vn, b5 as yn, b7 as Cn, c1 as Ms, bd as Bt, dJ as ot, dK as Ot, dL as It, dM as gt, dN as Ut, dO as sr, ao as lr, dP as rr, bN as zt, dQ as ir, dR as Rs, dS as or, dT as cr, dU as dr, dV as ur, dW as mr, dX as hr, dY as pr, dZ as Ls, d_ as wn, c0 as ge, d$ as _t, e0 as ia, e1 as fr, e2 as gr, e3 as Jt, e4 as xe, e5 as be, e6 as Ne, e7 as xr, e8 as br, e9 as ct, ea as pa, eb as Kn, ec as Nr, cu as Fs, ed as vr, ee as yr, ef as Cr, v as Ht, w as Yt, x as Wt, y as Qt, z as Xt, A as Zt, eg as wr, eh as Sr, ei as Gn, ej as kr, E as na, ek as Te, el as Tr, em as Ka, en as Un, eo as ze, ep as Ar, eq as Er, er as Dr, es as Or, et as ma, eu as Ir, ev as Ga, ew as Ps, ex as Mr, ey as Rr, ez as Lr, eA as Ca, eB as Fr, eC as Pr, eD as wt, b3 as Sn, eE as kn, eF as Vs, eG as Vr, bE as Bs, eH as Br, eI as _n, l as La, aC as zr, Z as jr, eJ as $r, eK as qr, eL as Kr, eM as Gr, eN as Ur, ay as Jn, eO as Hn, eP as _r, eQ as Jr, eR as zs, eS as Hr, eT as js, eU as Yr, eV as Wr, eW as Qr, eX as Xr, eY as Zr, eZ as ei, e_ as ti, e$ as ai, f0 as ni, f1 as si, f2 as $s, f3 as li, f4 as ri, f5 as ii, f6 as oi, f7 as ci, f8 as di, f9 as ui, fa as qs, b6 as mi, fb as hi, fc as Yn, fd as Wn, ai as pi, fe as fi, ff as gi, fg as xi, fh as bi, fi as Ks, fj as Ni, c7 as Gs, fk as Ee, bK as vi, ak as wa, fl as yi, c8 as Ci, fm as wi, fn as Fa, fo as Us, fp as Pa, fq as Si, bI as ki, fr as Qn, fs as Ti, ft as Ai, fu as Ei, fv as xa, fw as Di, fx as Tn, fy as Oi, fz as Ii, fA as Sa, fB as Mi, C as Ri, fC as Li, fD as oa, fE as dt, fF as nn, fG as sn, fH as ca, fI as _s, fJ as ea, fK as Fi, fL as Ua, fM as _a, fN as Pi, fO as Ja, fP as Vi, fQ as Xn, fR as Bi, fS as zi, fT as ji, fU as $i, b8 as Be, fV as qi, fW as Ki, fX as Gi, fY as Ui, fZ as Va, bg as Ba, f_ as Zn, f$ as Js, cm as Ha, g0 as _i, g1 as Ji, g2 as Hi, K as Yi } from "./index-CyYJ0bVW.js";
|
|
3
3
|
import * as ln from "react";
|
|
4
4
|
import rn, { useState as q, useRef as Pe, useEffect as ue, useCallback as Fe, useContext as An, useMemo as Ce } from "react";
|
|
5
|
-
import { C as Wi, d as En } from "./editor-action-buttons-
|
|
5
|
+
import { C as Wi, d as En } from "./editor-action-buttons-COCkxvCM.js";
|
|
6
6
|
import { createPortal as Qi } from "react-dom";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -475,13 +475,13 @@ function Xs({
|
|
|
475
475
|
}, [t, s]), ue(() => {
|
|
476
476
|
o.current && l !== c.current && (n(l), c.current = l);
|
|
477
477
|
}, [l, n]);
|
|
478
|
-
const
|
|
479
|
-
(
|
|
480
|
-
o.current = !0, d(
|
|
478
|
+
const m = Fe(
|
|
479
|
+
(h) => {
|
|
480
|
+
o.current = !0, d(h ?? s);
|
|
481
481
|
},
|
|
482
482
|
[s]
|
|
483
483
|
);
|
|
484
|
-
return { value: i, onChange:
|
|
484
|
+
return { value: i, onChange: m };
|
|
485
485
|
}
|
|
486
486
|
function So({
|
|
487
487
|
initialJoinPlan: t,
|
|
@@ -792,9 +792,9 @@ function ko({
|
|
|
792
792
|
const { columnGroups: l } = ta(), {
|
|
793
793
|
joinPlan: c,
|
|
794
794
|
expandedJoins: o,
|
|
795
|
-
setJoinPlan:
|
|
796
|
-
addJoin:
|
|
797
|
-
removeJoin:
|
|
795
|
+
setJoinPlan: m,
|
|
796
|
+
addJoin: h,
|
|
797
|
+
removeJoin: u,
|
|
798
798
|
updateJoin: p,
|
|
799
799
|
moveJoinUp: k,
|
|
800
800
|
moveJoinDown: b,
|
|
@@ -827,7 +827,7 @@ function ko({
|
|
|
827
827
|
const S = s.find(
|
|
828
828
|
(O) => O.name === N
|
|
829
829
|
);
|
|
830
|
-
|
|
830
|
+
m({
|
|
831
831
|
...c,
|
|
832
832
|
baseEntity: {
|
|
833
833
|
connectionId: (S == null ? void 0 : S.connectionId) || "",
|
|
@@ -870,7 +870,7 @@ function ko({
|
|
|
870
870
|
c.joins.length,
|
|
871
871
|
")"
|
|
872
872
|
] }),
|
|
873
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a(K, { variant: "outline", size: "sm", onClick:
|
|
873
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a(K, { variant: "outline", size: "sm", onClick: h, children: [
|
|
874
874
|
/* @__PURE__ */ e(We, { className: "mr-1 h-4 w-4" }),
|
|
875
875
|
"Add Join"
|
|
876
876
|
] }) })
|
|
@@ -932,7 +932,7 @@ function ko({
|
|
|
932
932
|
{
|
|
933
933
|
variant: "ghost",
|
|
934
934
|
size: "sm",
|
|
935
|
-
onClick: () =>
|
|
935
|
+
onClick: () => u(N.id),
|
|
936
936
|
children: /* @__PURE__ */ e(Ae, { className: "h-4 w-4" })
|
|
937
937
|
}
|
|
938
938
|
)
|
|
@@ -1451,11 +1451,11 @@ function To({
|
|
|
1451
1451
|
] }),
|
|
1452
1452
|
/* @__PURE__ */ e("div", { className: "space-y-2", children: [...t].sort((i, d) => i.sequence - d.sequence).map((i, d) => {
|
|
1453
1453
|
const l = n.find(
|
|
1454
|
-
(
|
|
1454
|
+
(m) => m.name === i.source.name
|
|
1455
1455
|
), c = n.find(
|
|
1456
|
-
(
|
|
1456
|
+
(m) => m.name === i.target.name
|
|
1457
1457
|
), o = i.joinKeyGroups.reduce(
|
|
1458
|
-
(
|
|
1458
|
+
(m, h) => m + h.keys.length,
|
|
1459
1459
|
0
|
|
1460
1460
|
);
|
|
1461
1461
|
return /* @__PURE__ */ a(
|
|
@@ -1515,18 +1515,18 @@ function ts({
|
|
|
1515
1515
|
dialect: "none"
|
|
1516
1516
|
},
|
|
1517
1517
|
joins: []
|
|
1518
|
-
}, [c, o] = q(!1),
|
|
1518
|
+
}, [c, o] = q(!1), m = t !== void 0, h = m ? t : c, u = m ? s : o, p = ((F = r == null ? void 0 : r.dataSource) == null ? void 0 : F.selectedEntities) || [], k = (I) => {
|
|
1519
1519
|
d(r.id, {
|
|
1520
1520
|
...r == null ? void 0 : r.config,
|
|
1521
1521
|
joinPlan: I
|
|
1522
|
-
}),
|
|
1522
|
+
}), u(!1);
|
|
1523
1523
|
}, b = () => {
|
|
1524
1524
|
d(r.id, {
|
|
1525
1525
|
...r == null ? void 0 : r.config,
|
|
1526
1526
|
joinPlan: void 0
|
|
1527
1527
|
});
|
|
1528
1528
|
}, x = () => {
|
|
1529
|
-
|
|
1529
|
+
u(!1);
|
|
1530
1530
|
}, f = () => {
|
|
1531
1531
|
const I = [...l.joins].sort(
|
|
1532
1532
|
(y, w) => y.sequence - w.sequence
|
|
@@ -1582,7 +1582,7 @@ ${y.joinType} JOIN ${w.name}
|
|
|
1582
1582
|
variant: "secondary",
|
|
1583
1583
|
className: "h-5 cursor-pointer gap-1 px-1.5 text-xs transition-colors hover:bg-secondary/80",
|
|
1584
1584
|
onClick: (I) => {
|
|
1585
|
-
I.stopPropagation(),
|
|
1585
|
+
I.stopPropagation(), u(!0);
|
|
1586
1586
|
},
|
|
1587
1587
|
children: [
|
|
1588
1588
|
/* @__PURE__ */ e($n, { className: "h-3 w-3" }),
|
|
@@ -1592,7 +1592,7 @@ ${y.joinType} JOIN ${w.name}
|
|
|
1592
1592
|
) : /* @__PURE__ */ a(
|
|
1593
1593
|
K,
|
|
1594
1594
|
{
|
|
1595
|
-
onClick: () =>
|
|
1595
|
+
onClick: () => u(!0),
|
|
1596
1596
|
variant: "outline",
|
|
1597
1597
|
className: "w-full bg-muted/50",
|
|
1598
1598
|
children: [
|
|
@@ -1618,8 +1618,8 @@ ${y.joinType} JOIN ${w.name}
|
|
|
1618
1618
|
/* @__PURE__ */ e(
|
|
1619
1619
|
Zs,
|
|
1620
1620
|
{
|
|
1621
|
-
open:
|
|
1622
|
-
onOpenChange:
|
|
1621
|
+
open: h,
|
|
1622
|
+
onOpenChange: u,
|
|
1623
1623
|
joinPlan: l,
|
|
1624
1624
|
availableDataSources: p,
|
|
1625
1625
|
onSave: k,
|
|
@@ -1648,9 +1648,9 @@ function Ao({
|
|
|
1648
1648
|
) : [...x, b]);
|
|
1649
1649
|
}, o = () => {
|
|
1650
1650
|
r([...l]);
|
|
1651
|
-
}, u = () => {
|
|
1652
|
-
r([]);
|
|
1653
1651
|
}, m = () => {
|
|
1652
|
+
r([]);
|
|
1653
|
+
}, h = () => {
|
|
1654
1654
|
if (n.length === 0) return;
|
|
1655
1655
|
const b = n[0], x = b.connectionId || "", f = b.connectionType || "", v = n.some((I) => I.type === "dataset") ? "semanticDomain" : "database";
|
|
1656
1656
|
i({
|
|
@@ -1659,7 +1659,7 @@ function Ao({
|
|
|
1659
1659
|
mode: v,
|
|
1660
1660
|
selectedEntities: n
|
|
1661
1661
|
}), s(!1);
|
|
1662
|
-
},
|
|
1662
|
+
}, u = (b) => "label" in b && b.label ? b.label : b.name, p = (b) => {
|
|
1663
1663
|
if ("description" in b && b.description)
|
|
1664
1664
|
return b.description;
|
|
1665
1665
|
const x = [];
|
|
@@ -1696,7 +1696,7 @@ function Ao({
|
|
|
1696
1696
|
{
|
|
1697
1697
|
variant: "outline",
|
|
1698
1698
|
size: "sm",
|
|
1699
|
-
onClick:
|
|
1699
|
+
onClick: m,
|
|
1700
1700
|
disabled: n.length === 0,
|
|
1701
1701
|
children: "Clear All"
|
|
1702
1702
|
}
|
|
@@ -1727,7 +1727,7 @@ function Ao({
|
|
|
1727
1727
|
),
|
|
1728
1728
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 text-muted-foreground", children: Cs(b.type) }),
|
|
1729
1729
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1730
|
-
/* @__PURE__ */ e("div", { className: "truncate font-medium", children:
|
|
1730
|
+
/* @__PURE__ */ e("div", { className: "truncate font-medium", children: u(b) }),
|
|
1731
1731
|
/* @__PURE__ */ e("div", { className: "truncate text-sm text-muted-foreground", children: p(b) })
|
|
1732
1732
|
] }),
|
|
1733
1733
|
/* @__PURE__ */ e(fe, { variant: "outline", className: "text-xs", children: b.type })
|
|
@@ -1741,7 +1741,7 @@ function Ao({
|
|
|
1741
1741
|
/* @__PURE__ */ a(
|
|
1742
1742
|
K,
|
|
1743
1743
|
{
|
|
1744
|
-
onClick:
|
|
1744
|
+
onClick: h,
|
|
1745
1745
|
disabled: n.length === 0,
|
|
1746
1746
|
children: [
|
|
1747
1747
|
"Select",
|
|
@@ -1774,7 +1774,7 @@ function as({
|
|
|
1774
1774
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: "Description:" }),
|
|
1775
1775
|
/* @__PURE__ */ e("div", { className: "text-xs leading-relaxed", children: l.value })
|
|
1776
1776
|
] }),
|
|
1777
|
-
c.length > 0 && /* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: c.map((o,
|
|
1777
|
+
c.length > 0 && /* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: c.map((o, m) => /* @__PURE__ */ a(
|
|
1778
1778
|
"div",
|
|
1779
1779
|
{
|
|
1780
1780
|
className: "flex justify-between text-xs",
|
|
@@ -1786,7 +1786,7 @@ function as({
|
|
|
1786
1786
|
/* @__PURE__ */ e("span", { className: "font-mono", children: o.value })
|
|
1787
1787
|
]
|
|
1788
1788
|
},
|
|
1789
|
-
|
|
1789
|
+
m
|
|
1790
1790
|
)) })
|
|
1791
1791
|
]
|
|
1792
1792
|
},
|
|
@@ -1811,10 +1811,10 @@ function tl({
|
|
|
1811
1811
|
var x, f;
|
|
1812
1812
|
const s = M((g) => g.isDevMode);
|
|
1813
1813
|
kl();
|
|
1814
|
-
const [n, r] = q(!1), [i, d] = q(!1), [l, c] = el("semaphor:data-source-collapsed", !1), o = M((g) => g.card.dataSource),
|
|
1814
|
+
const [n, r] = q(!1), [i, d] = q(!1), [l, c] = el("semaphor:data-source-collapsed", !1), o = M((g) => g.card.dataSource), m = M((g) => {
|
|
1815
1815
|
var v, F;
|
|
1816
1816
|
return (F = (v = g.card) == null ? void 0 : v.config) == null ? void 0 : F.joinPlan;
|
|
1817
|
-
}), { updateDataSource:
|
|
1817
|
+
}), { updateDataSource: h } = ne(), u = ((x = o == null ? void 0 : o.selectedEntities) == null ? void 0 : x.length) || 0, p = ((f = m == null ? void 0 : m.joins) == null ? void 0 : f.length) || 0, b = {
|
|
1818
1818
|
...{
|
|
1819
1819
|
connectionId: "",
|
|
1820
1820
|
connectionType: "",
|
|
@@ -1835,7 +1835,7 @@ function tl({
|
|
|
1835
1835
|
}
|
|
1836
1836
|
),
|
|
1837
1837
|
children: [
|
|
1838
|
-
|
|
1838
|
+
u === 0 && p === 0 ? /* @__PURE__ */ e("div", { className: "p-4 px-6", children: /* @__PURE__ */ a(
|
|
1839
1839
|
K,
|
|
1840
1840
|
{
|
|
1841
1841
|
className: "w-full bg-muted/50",
|
|
@@ -1864,7 +1864,7 @@ function tl({
|
|
|
1864
1864
|
className: "flex items-center gap-1.5",
|
|
1865
1865
|
onClick: (g) => g.stopPropagation(),
|
|
1866
1866
|
children: [
|
|
1867
|
-
|
|
1867
|
+
u > 0 && /* @__PURE__ */ e(Ke, { delayDuration: 100, children: /* @__PURE__ */ a(Ie, { children: [
|
|
1868
1868
|
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1869
1869
|
fe,
|
|
1870
1870
|
{
|
|
@@ -1873,7 +1873,7 @@ function tl({
|
|
|
1873
1873
|
onClick: () => r(!0),
|
|
1874
1874
|
children: [
|
|
1875
1875
|
/* @__PURE__ */ e(la, { className: "h-3 w-3" }),
|
|
1876
|
-
|
|
1876
|
+
u
|
|
1877
1877
|
]
|
|
1878
1878
|
}
|
|
1879
1879
|
) }),
|
|
@@ -1881,7 +1881,7 @@ function tl({
|
|
|
1881
1881
|
as,
|
|
1882
1882
|
{
|
|
1883
1883
|
entities: b.selectedEntities,
|
|
1884
|
-
title: `${
|
|
1884
|
+
title: `${u} selected ${u === 1 ? "entity" : "entities"}`
|
|
1885
1885
|
}
|
|
1886
1886
|
)
|
|
1887
1887
|
] }) }),
|
|
@@ -1922,8 +1922,8 @@ function tl({
|
|
|
1922
1922
|
onClick: () => r(!0),
|
|
1923
1923
|
children: [
|
|
1924
1924
|
/* @__PURE__ */ e(la, { className: "mr-2 h-3.5 w-3.5" }),
|
|
1925
|
-
|
|
1926
|
-
/* @__PURE__ */ e("span", { className: "ml-2 flex h-5 min-w-5 items-center justify-center rounded-full border bg-muted-foreground px-1.5 text-xs font-medium text-background", children:
|
|
1925
|
+
u === 1 ? "Dataset" : "Datasets",
|
|
1926
|
+
/* @__PURE__ */ e("span", { className: "ml-2 flex h-5 min-w-5 items-center justify-center rounded-full border bg-muted-foreground px-1.5 text-xs font-medium text-background", children: u })
|
|
1927
1927
|
]
|
|
1928
1928
|
}
|
|
1929
1929
|
) }),
|
|
@@ -1931,11 +1931,11 @@ function tl({
|
|
|
1931
1931
|
as,
|
|
1932
1932
|
{
|
|
1933
1933
|
entities: b.selectedEntities,
|
|
1934
|
-
title: `${
|
|
1934
|
+
title: `${u} selected ${u === 1 ? "entity" : "entities"}`
|
|
1935
1935
|
}
|
|
1936
1936
|
)
|
|
1937
1937
|
] }) }) }),
|
|
1938
|
-
!s &&
|
|
1938
|
+
!s && u > 1 && /* @__PURE__ */ e("div", { className: "mt-3 px-6", children: /* @__PURE__ */ e(ts, {}) })
|
|
1939
1939
|
]
|
|
1940
1940
|
}
|
|
1941
1941
|
)
|
|
@@ -1966,30 +1966,30 @@ function Eo(t) {
|
|
|
1966
1966
|
return Al({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(t);
|
|
1967
1967
|
}
|
|
1968
1968
|
function al(t) {
|
|
1969
|
-
const { theme: s } = El(), n = ye((x) => x.theme), r = M((x) => x.frame), i = M((x) => x.card), d = M((x) => x.activeTabCardId), l = Dl(), { refetch: c } = Ve(i), { updateCardTab: o, setRunSql:
|
|
1969
|
+
const { theme: s } = El(), n = ye((x) => x.theme), r = M((x) => x.frame), i = M((x) => x.card), d = M((x) => x.activeTabCardId), l = Dl(), { refetch: c } = Ve(i), { updateCardTab: o, setRunSql: m } = ne(), h = Pe(void 0), u = Pe({}), p = r.cards.find((x) => x.id === d), k = Fe(() => {
|
|
1970
1970
|
let x = "";
|
|
1971
1971
|
return t === "python" && (x = (p == null ? void 0 : p.python) || ks), t === "sql" && (x = (p == null ? void 0 : p.sql) || ""), x;
|
|
1972
1972
|
}, [t, p]);
|
|
1973
1973
|
ue(() => {
|
|
1974
1974
|
if (d && i.id && i.id !== d) {
|
|
1975
|
-
if (
|
|
1976
|
-
const x =
|
|
1977
|
-
x && (
|
|
1978
|
-
let f =
|
|
1975
|
+
if (h.current && l) {
|
|
1976
|
+
const x = h.current.getModel();
|
|
1977
|
+
x && (u.current[i.id] = x);
|
|
1978
|
+
let f = u.current[d];
|
|
1979
1979
|
if (!f) {
|
|
1980
1980
|
const g = k();
|
|
1981
|
-
f = l.editor.createModel(g, t),
|
|
1981
|
+
f = l.editor.createModel(g, t), u.current[d] = f;
|
|
1982
1982
|
}
|
|
1983
|
-
|
|
1983
|
+
h.current.setModel(f);
|
|
1984
1984
|
}
|
|
1985
|
-
o(d, i),
|
|
1985
|
+
o(d, i), m(!0);
|
|
1986
1986
|
}
|
|
1987
1987
|
}, [
|
|
1988
1988
|
d,
|
|
1989
1989
|
i,
|
|
1990
1990
|
o,
|
|
1991
1991
|
l,
|
|
1992
|
-
|
|
1992
|
+
m,
|
|
1993
1993
|
t,
|
|
1994
1994
|
k
|
|
1995
1995
|
]), ue(() => {
|
|
@@ -2009,7 +2009,7 @@ function al(t) {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
}), l.editor.setTheme("default");
|
|
2011
2011
|
}, [s, n, l]), ue(() => {
|
|
2012
|
-
const x =
|
|
2012
|
+
const x = h.current;
|
|
2013
2013
|
x && l && i && x.addCommand(
|
|
2014
2014
|
l.KeyMod.Shift | l.KeyCode.Enter,
|
|
2015
2015
|
function() {
|
|
@@ -2018,21 +2018,21 @@ function al(t) {
|
|
|
2018
2018
|
);
|
|
2019
2019
|
}, [l, c, i]);
|
|
2020
2020
|
function b(x, f) {
|
|
2021
|
-
if (
|
|
2021
|
+
if (h.current = x, !u.current[i.id]) {
|
|
2022
2022
|
const g = x.getModel(), v = k();
|
|
2023
|
-
|
|
2023
|
+
u.current[i.id] = g || (f == null ? void 0 : f.editor.createModel(v, t)) || x.getModel();
|
|
2024
2024
|
}
|
|
2025
|
-
x.setModel(
|
|
2025
|
+
x.setModel(u.current[i.id]);
|
|
2026
2026
|
}
|
|
2027
2027
|
return { handleEditorDidMount: b };
|
|
2028
2028
|
}
|
|
2029
2029
|
const Do = 300;
|
|
2030
2030
|
function Oo() {
|
|
2031
|
-
const t = M((
|
|
2031
|
+
const t = M((h) => h.card.sql), s = M((h) => h.sqlGen), { setCardSql: n, setSqlGen: r } = ne(), { handleEditorDidMount: i } = al("sql"), d = Pe(s);
|
|
2032
2032
|
d.current = s;
|
|
2033
2033
|
const l = Fe(
|
|
2034
|
-
(
|
|
2035
|
-
n(
|
|
2034
|
+
(h) => {
|
|
2035
|
+
n(h);
|
|
2036
2036
|
},
|
|
2037
2037
|
[n]
|
|
2038
2038
|
), { value: c, onChange: o } = Xs({
|
|
@@ -2041,8 +2041,8 @@ function Oo() {
|
|
|
2041
2041
|
onStoreUpdate: l,
|
|
2042
2042
|
delay: Do
|
|
2043
2043
|
});
|
|
2044
|
-
function
|
|
2045
|
-
o(
|
|
2044
|
+
function m(h) {
|
|
2045
|
+
o(h), Il(d.current) || r({});
|
|
2046
2046
|
}
|
|
2047
2047
|
return /* @__PURE__ */ a("div", { className: "relative h-full w-full", children: [
|
|
2048
2048
|
!c && /* @__PURE__ */ e("div", { className: "pointer-events-none absolute left-[65px] top-3 z-10 font-mono text-sm text-muted-foreground", children: "Write your SQL here" }),
|
|
@@ -2051,7 +2051,7 @@ function Oo() {
|
|
|
2051
2051
|
{
|
|
2052
2052
|
theme: "default",
|
|
2053
2053
|
className: "pt-3",
|
|
2054
|
-
onChange:
|
|
2054
|
+
onChange: m,
|
|
2055
2055
|
value: c,
|
|
2056
2056
|
options: {
|
|
2057
2057
|
minimap: {
|
|
@@ -2108,12 +2108,12 @@ function nl({
|
|
|
2108
2108
|
showCardDetails: s = !1,
|
|
2109
2109
|
className: n
|
|
2110
2110
|
}) {
|
|
2111
|
-
const [r, i] = q(!1), d = M((k) => k.card), l = M((k) => k.frame), c = M((k) => k.isDevMode), o = ye((k) => k.selectedSheetId),
|
|
2111
|
+
const [r, i] = q(!1), d = M((k) => k.card), l = M((k) => k.frame), c = M((k) => k.isDevMode), o = ye((k) => k.selectedSheetId), m = ye((k) => {
|
|
2112
2112
|
var b;
|
|
2113
2113
|
return (b = k.dashboard) == null ? void 0 : b.id;
|
|
2114
|
-
}), { switchEditorMode:
|
|
2115
|
-
|
|
2116
|
-
|
|
2114
|
+
}), { switchEditorMode: h, setRunSql: u } = ne(), p = () => {
|
|
2115
|
+
h("dev", { sqlToLoad: t }), setTimeout(() => {
|
|
2116
|
+
u(!0);
|
|
2117
2117
|
}, 100);
|
|
2118
2118
|
};
|
|
2119
2119
|
return /* @__PURE__ */ a("div", { className: Z("flex min-h-0 flex-1 flex-col", n), children: [
|
|
@@ -2174,9 +2174,9 @@ function nl({
|
|
|
2174
2174
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between rounded-md bg-background/60 px-3 py-2", children: [
|
|
2175
2175
|
/* @__PURE__ */ a("div", { className: "flex flex-col gap-1", children: [
|
|
2176
2176
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Dashboard ID" }),
|
|
2177
|
-
/* @__PURE__ */ e("code", { className: "font-mono text-xs", children:
|
|
2177
|
+
/* @__PURE__ */ e("code", { className: "font-mono text-xs", children: m || "N/A" })
|
|
2178
2178
|
] }),
|
|
2179
|
-
/* @__PURE__ */ e(it, { text:
|
|
2179
|
+
/* @__PURE__ */ e(it, { text: m || "", className: "h-6 w-6" })
|
|
2180
2180
|
] })
|
|
2181
2181
|
] })
|
|
2182
2182
|
] }) }),
|
|
@@ -2212,9 +2212,9 @@ function Ro() {
|
|
|
2212
2212
|
), c = ye(
|
|
2213
2213
|
($) => $.inlineFilterValuesMap[(i == null ? void 0 : i.id) ?? ""]
|
|
2214
2214
|
), o = Pe(!0), {
|
|
2215
|
-
setCardCustomCfg:
|
|
2216
|
-
setQueryResultColumns:
|
|
2217
|
-
setCardSql:
|
|
2215
|
+
setCardCustomCfg: m,
|
|
2216
|
+
setQueryResultColumns: h,
|
|
2217
|
+
setCardSql: u,
|
|
2218
2218
|
setTempQueryData: p,
|
|
2219
2219
|
// setQueryError,
|
|
2220
2220
|
setPythonStdOut: k,
|
|
@@ -2246,10 +2246,10 @@ function Ro() {
|
|
|
2246
2246
|
richColors: !0
|
|
2247
2247
|
}), k((y == null ? void 0 : y.output) || ""), y.records.length > 0)) {
|
|
2248
2248
|
const { dimensionKeys: $ } = an(y.records);
|
|
2249
|
-
|
|
2249
|
+
h($);
|
|
2250
2250
|
}
|
|
2251
|
-
}, [y,
|
|
2252
|
-
(w || E) && T(!0), (N || P) && T(!1), N && (
|
|
2251
|
+
}, [y, h, k]), ue(() => {
|
|
2252
|
+
(w || E) && T(!0), (N || P) && T(!1), N && (h([]), k(""));
|
|
2253
2253
|
}, [
|
|
2254
2254
|
w,
|
|
2255
2255
|
E,
|
|
@@ -2258,7 +2258,7 @@ function Ro() {
|
|
|
2258
2258
|
N,
|
|
2259
2259
|
P,
|
|
2260
2260
|
T,
|
|
2261
|
-
|
|
2261
|
+
h,
|
|
2262
2262
|
// setQueryError,
|
|
2263
2263
|
S
|
|
2264
2264
|
]), ue(() => {
|
|
@@ -2489,22 +2489,22 @@ function Fo({ className: t }) {
|
|
|
2489
2489
|
if (!d || !l)
|
|
2490
2490
|
return null;
|
|
2491
2491
|
const c = (o) => {
|
|
2492
|
-
var
|
|
2493
|
-
const
|
|
2494
|
-
if (
|
|
2495
|
-
const
|
|
2492
|
+
var h;
|
|
2493
|
+
const m = o;
|
|
2494
|
+
if (m === "aggregateTable" && ((h = s.config) != null && h.pivotByColumns) && s.config.pivotByColumns.length > 0) {
|
|
2495
|
+
const u = {
|
|
2496
2496
|
...s,
|
|
2497
|
-
type:
|
|
2497
|
+
type: m,
|
|
2498
2498
|
config: {
|
|
2499
2499
|
...s.config,
|
|
2500
2500
|
pivotByColumns: []
|
|
2501
2501
|
}
|
|
2502
2502
|
};
|
|
2503
|
-
r(
|
|
2503
|
+
r(u), i(u);
|
|
2504
2504
|
} else {
|
|
2505
|
-
n(
|
|
2506
|
-
const
|
|
2507
|
-
i(
|
|
2505
|
+
n(m);
|
|
2506
|
+
const u = { ...s, type: m };
|
|
2507
|
+
i(u);
|
|
2508
2508
|
}
|
|
2509
2509
|
};
|
|
2510
2510
|
return /* @__PURE__ */ e("div", { className: Z("flex items-center", t), children: /* @__PURE__ */ e(
|
|
@@ -2514,7 +2514,7 @@ function Fo({ className: t }) {
|
|
|
2514
2514
|
onValueChange: c,
|
|
2515
2515
|
className: "flex flex-row items-center justify-between gap-1 rounded-lg border p-1",
|
|
2516
2516
|
children: Lo.map((o) => {
|
|
2517
|
-
const
|
|
2517
|
+
const m = o.icon, h = s.type === o.value;
|
|
2518
2518
|
return /* @__PURE__ */ a("div", { className: "flex items-center", children: [
|
|
2519
2519
|
/* @__PURE__ */ e(
|
|
2520
2520
|
ft,
|
|
@@ -2530,10 +2530,10 @@ function Fo({ className: t }) {
|
|
|
2530
2530
|
htmlFor: `table-type-${o.value}`,
|
|
2531
2531
|
className: Z(
|
|
2532
2532
|
"flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1 text-sm font-medium transition-all",
|
|
2533
|
-
|
|
2533
|
+
h ? "bg-muted text-foreground shadow-sm" : "text-muted-foreground hover:bg-muted/50"
|
|
2534
2534
|
),
|
|
2535
2535
|
children: [
|
|
2536
|
-
/* @__PURE__ */ e(
|
|
2536
|
+
/* @__PURE__ */ e(m, { className: "h-3.5 w-3.5" }),
|
|
2537
2537
|
o.label
|
|
2538
2538
|
]
|
|
2539
2539
|
}
|
|
@@ -2568,13 +2568,13 @@ function Po({ type: t, isLinked: s, className: n }) {
|
|
|
2568
2568
|
}, o = {
|
|
2569
2569
|
linked: "Linked to library: Changes made here update the library visual and all linked instances.",
|
|
2570
2570
|
library: "Library visual: Share and reuse this visual across multiple dashboards."
|
|
2571
|
-
},
|
|
2571
|
+
}, m = {
|
|
2572
2572
|
linked: "border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",
|
|
2573
2573
|
library: "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"
|
|
2574
|
-
},
|
|
2574
|
+
}, h = {
|
|
2575
2575
|
linked: "fill-purple-50 dark:fill-purple-950",
|
|
2576
2576
|
library: "fill-blue-50 dark:fill-blue-950"
|
|
2577
|
-
},
|
|
2577
|
+
}, u = {
|
|
2578
2578
|
linked: /* @__PURE__ */ e(co, { className: "h-3.5 w-3.5" }),
|
|
2579
2579
|
library: /* @__PURE__ */ e(oo, { className: "h-3.5 w-3.5" })
|
|
2580
2580
|
};
|
|
@@ -2588,16 +2588,16 @@ function Po({ type: t, isLinked: s, className: n }) {
|
|
|
2588
2588
|
c[l],
|
|
2589
2589
|
n
|
|
2590
2590
|
),
|
|
2591
|
-
children:
|
|
2591
|
+
children: u[l]
|
|
2592
2592
|
}
|
|
2593
2593
|
) }),
|
|
2594
2594
|
/* @__PURE__ */ a(
|
|
2595
2595
|
qe,
|
|
2596
2596
|
{
|
|
2597
2597
|
side: "bottom",
|
|
2598
|
-
className: Z("max-w-xs",
|
|
2598
|
+
className: Z("max-w-xs", m[l]),
|
|
2599
2599
|
children: [
|
|
2600
|
-
/* @__PURE__ */ e(Pl, { className:
|
|
2600
|
+
/* @__PURE__ */ e(Pl, { className: h[l] }),
|
|
2601
2601
|
/* @__PURE__ */ e("p", { children: o[l] })
|
|
2602
2602
|
]
|
|
2603
2603
|
}
|
|
@@ -2614,7 +2614,7 @@ function On({
|
|
|
2614
2614
|
showFeedbackButton: l = !0,
|
|
2615
2615
|
className: c
|
|
2616
2616
|
}) {
|
|
2617
|
-
const [o,
|
|
2617
|
+
const [o, m] = q(!1);
|
|
2618
2618
|
return /* @__PURE__ */ e(
|
|
2619
2619
|
"div",
|
|
2620
2620
|
{
|
|
@@ -2643,7 +2643,7 @@ function On({
|
|
|
2643
2643
|
at,
|
|
2644
2644
|
{
|
|
2645
2645
|
open: o,
|
|
2646
|
-
onOpenChange:
|
|
2646
|
+
onOpenChange: m,
|
|
2647
2647
|
children: /* @__PURE__ */ e(mt, { asChild: !0, children: /* @__PURE__ */ e(K, { variant: "outline", size: "sm", className: "h-8", children: o ? /* @__PURE__ */ a(ce, { children: [
|
|
2648
2648
|
/* @__PURE__ */ e(Aa, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
2649
2649
|
"Hide Details"
|
|
@@ -2693,7 +2693,7 @@ function On({
|
|
|
2693
2693
|
}
|
|
2694
2694
|
)
|
|
2695
2695
|
] }),
|
|
2696
|
-
s && /* @__PURE__ */ e(at, { open: o, onOpenChange:
|
|
2696
|
+
s && /* @__PURE__ */ e(at, { open: o, onOpenChange: m, children: /* @__PURE__ */ e(ht, { className: "space-y-2", children: /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: [
|
|
2697
2697
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
2698
2698
|
/* @__PURE__ */ e("p", { className: "text-xs font-medium text-muted-foreground", children: "Query" }),
|
|
2699
2699
|
/* @__PURE__ */ e(it, { text: s, className: "h-6 w-6" })
|
|
@@ -2706,18 +2706,18 @@ function On({
|
|
|
2706
2706
|
);
|
|
2707
2707
|
}
|
|
2708
2708
|
function sl(t, s) {
|
|
2709
|
-
const n = M((
|
|
2709
|
+
const n = M((m) => m.card), r = M((m) => m.isDevMode), { switchEditorMode: i, setRunSql: d, runAssistant: l } = ne();
|
|
2710
2710
|
return {
|
|
2711
2711
|
isDevMode: r,
|
|
2712
2712
|
// Handlers - only available when appropriate for the current mode
|
|
2713
2713
|
handleOpenInEditor: r ? void 0 : () => {
|
|
2714
|
-
const
|
|
2715
|
-
i("dev", { sqlToLoad:
|
|
2714
|
+
const m = s || n.sql || n.python || "";
|
|
2715
|
+
i("dev", { sqlToLoad: m }), setTimeout(() => {
|
|
2716
2716
|
d(!0);
|
|
2717
2717
|
}, 100);
|
|
2718
2718
|
},
|
|
2719
2719
|
handleDebugWithAssistant: r ? () => {
|
|
2720
|
-
const
|
|
2720
|
+
const m = `Can you help me debug this query?
|
|
2721
2721
|
|
|
2722
2722
|
Error:
|
|
2723
2723
|
|
|
@@ -2728,7 +2728,7 @@ function sl(t, s) {
|
|
|
2728
2728
|
${s || n.sql || n.python}
|
|
2729
2729
|
|
|
2730
2730
|
`;
|
|
2731
|
-
l(
|
|
2731
|
+
l(m);
|
|
2732
2732
|
} : void 0
|
|
2733
2733
|
};
|
|
2734
2734
|
}
|
|
@@ -2739,7 +2739,7 @@ function ll({
|
|
|
2739
2739
|
...s
|
|
2740
2740
|
}) {
|
|
2741
2741
|
var $, _, X;
|
|
2742
|
-
const n = M((G) => G.card), r = (($ = n.customCardPreferences) == null ? void 0 : $.showCardHeader) ?? !0, i = ((X = (_ = n.preferences) == null ? void 0 : _.displayOptions) == null ? void 0 : X.showInlineFilterBar) ?? !0, d = M((G) => G.frame), l = ye((G) => G.dashboard.filters), c = ye((G) => G.selectedSheetId), [o,
|
|
2742
|
+
const n = M((G) => G.card), r = (($ = n.customCardPreferences) == null ? void 0 : $.showCardHeader) ?? !0, i = ((X = (_ = n.preferences) == null ? void 0 : _.displayOptions) == null ? void 0 : X.showInlineFilterBar) ?? !0, d = M((G) => G.frame), l = ye((G) => G.dashboard.filters), c = ye((G) => G.selectedSheetId), [o, m] = q(!1), { currentUser: h } = zl(), { tokenProps: u } = An(gn), p = M((G) => G.actions.setRunSql), { updateFilter: k } = As(), b = l == null ? void 0 : l.find((G) => G.id === d.filterId), { data: x, isLoading: f, isFetching: g, errorMessage: v, errorSql: F, pagination: I } = Ve(n), { handleOpenInEditor: C, handleDebugWithAssistant: T } = sl(
|
|
2743
2743
|
v,
|
|
2744
2744
|
F || n.sql || n.python
|
|
2745
2745
|
), y = Ce(() => (x == null ? void 0 : x.records) || [], [x == null ? void 0 : x.records]), { setCard: w, updateCardInFrame: E } = ne(), { data: P } = xn(n), N = Ce(() => {
|
|
@@ -2759,13 +2759,13 @@ function ll({
|
|
|
2759
2759
|
x == null ? void 0 : x.pivotSchema,
|
|
2760
2760
|
x == null ? void 0 : x.groupByColumns
|
|
2761
2761
|
]), S = jl(n, N), O = () => {
|
|
2762
|
-
|
|
2762
|
+
m(!0);
|
|
2763
2763
|
}, V = Ce(() => {
|
|
2764
2764
|
const G = typeof window < "u" ? window.location.href : "", ae = typeof navigator < "u" ? navigator.userAgent : "", te = typeof window < "u" ? `${window.innerWidth}x${window.innerHeight}` : "";
|
|
2765
2765
|
return {
|
|
2766
2766
|
category: Es.QUERY_GENERATION,
|
|
2767
|
-
user:
|
|
2768
|
-
tokenContext:
|
|
2767
|
+
user: h,
|
|
2768
|
+
tokenContext: u,
|
|
2769
2769
|
systemState: {
|
|
2770
2770
|
cardConfig: n.config,
|
|
2771
2771
|
dataSource: n.dataSource,
|
|
@@ -2781,7 +2781,7 @@ function ll({
|
|
|
2781
2781
|
viewport: te
|
|
2782
2782
|
}
|
|
2783
2783
|
};
|
|
2784
|
-
}, [
|
|
2784
|
+
}, [h, u, n, l, v, F]), D = (G, ae) => {
|
|
2785
2785
|
var j, le;
|
|
2786
2786
|
const te = {
|
|
2787
2787
|
...n,
|
|
@@ -2970,7 +2970,7 @@ function ll({
|
|
|
2970
2970
|
Os,
|
|
2971
2971
|
{
|
|
2972
2972
|
open: o,
|
|
2973
|
-
onOpenChange:
|
|
2973
|
+
onOpenChange: m,
|
|
2974
2974
|
feedbackData: V,
|
|
2975
2975
|
showDebugInfo: !0
|
|
2976
2976
|
}
|
|
@@ -3092,7 +3092,7 @@ const Qa = ({
|
|
|
3092
3092
|
/* @__PURE__ */ e(K, { onClick: i, variant: "outline", children: "Close" })
|
|
3093
3093
|
] });
|
|
3094
3094
|
function jo() {
|
|
3095
|
-
const [t, s] = q(!1), [n, r] = q(""), [i, d] = q(""), [l, c] = q(""), [o,
|
|
3095
|
+
const [t, s] = q(!1), [n, r] = q(""), [i, d] = q(""), [l, c] = q(""), [o, m] = q(""), h = M((C) => C.card), u = M((C) => C.card.customCfg), p = u ? JSON.stringify(u, null, 2) : "", { data: k } = Ve(h), { data: b } = xn(h), { setCardCustomCfg: x, setCustomVisualCode: f } = ne(), g = (C) => {
|
|
3096
3096
|
var T, y;
|
|
3097
3097
|
return JSON.stringify(
|
|
3098
3098
|
{
|
|
@@ -3112,17 +3112,17 @@ function jo() {
|
|
|
3112
3112
|
var T, y;
|
|
3113
3113
|
if (!((T = k == null ? void 0 : k.records) != null && T.length)) return;
|
|
3114
3114
|
const C = Ds({
|
|
3115
|
-
card:
|
|
3115
|
+
card: h,
|
|
3116
3116
|
data: k.records,
|
|
3117
|
-
cardType:
|
|
3118
|
-
queryConfig:
|
|
3117
|
+
cardType: h.type,
|
|
3118
|
+
queryConfig: h.queryConfig,
|
|
3119
3119
|
//cfg: card.cfg,
|
|
3120
|
-
preferences:
|
|
3120
|
+
preferences: h.preferences,
|
|
3121
3121
|
topoJson: b
|
|
3122
3122
|
});
|
|
3123
3123
|
if (C) {
|
|
3124
|
-
r(g(C)), c(((y =
|
|
3125
|
-
const w = Xl(C,
|
|
3124
|
+
r(g(C)), c(((y = h.preferences) == null ? void 0 : y.customVisualCode) || "");
|
|
3125
|
+
const w = Xl(C, u);
|
|
3126
3126
|
d(g(w));
|
|
3127
3127
|
}
|
|
3128
3128
|
}, F = () => {
|
|
@@ -3134,12 +3134,12 @@ function jo() {
|
|
|
3134
3134
|
JSON.parse(n),
|
|
3135
3135
|
C
|
|
3136
3136
|
);
|
|
3137
|
-
x(T),
|
|
3137
|
+
x(T), m("");
|
|
3138
3138
|
}
|
|
3139
3139
|
} catch {
|
|
3140
|
-
|
|
3140
|
+
m("Invalid JSON configuration");
|
|
3141
3141
|
}
|
|
3142
|
-
}, I = Object.keys(
|
|
3142
|
+
}, I = Object.keys(u || {}).length === 0;
|
|
3143
3143
|
return /* @__PURE__ */ a(St, { open: t, onOpenChange: s, children: [
|
|
3144
3144
|
/* @__PURE__ */ e(Wl, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3145
3145
|
Oe,
|
|
@@ -3169,7 +3169,7 @@ function jo() {
|
|
|
3169
3169
|
zo,
|
|
3170
3170
|
{
|
|
3171
3171
|
error: o,
|
|
3172
|
-
hasCardCustomConfig: !!
|
|
3172
|
+
hasCardCustomConfig: !!u,
|
|
3173
3173
|
onReset: () => {
|
|
3174
3174
|
d(n), x(null);
|
|
3175
3175
|
},
|
|
@@ -3287,7 +3287,7 @@ const ss = [
|
|
|
3287
3287
|
// { id: 'tableBuilder', name: 'Table Builder' },
|
|
3288
3288
|
];
|
|
3289
3289
|
function rl({ onChartSelect: t, onClose: s }) {
|
|
3290
|
-
const [n, r] = q(""), { starredCharts: i, isStarred: d, toggleStar: l } = tr(), { data: c = [], isLoading: o } = ar(), { setCardType:
|
|
3290
|
+
const [n, r] = q(""), { starredCharts: i, isStarred: d, toggleStar: l } = tr(), { data: c = [], isLoading: o } = ar(), { setCardType: m, setCardPreferences: h, setIsDevMode: u } = M(
|
|
3291
3291
|
(C) => C.actions
|
|
3292
3292
|
), { setCardCustomCfg: p, setCustomCardPreferences: k, setQueryConfig: b } = ne(), x = Ce(() => {
|
|
3293
3293
|
if (!n) return ss;
|
|
@@ -3305,9 +3305,9 @@ function rl({ onChartSelect: t, onClose: s }) {
|
|
|
3305
3305
|
(y) => y.name.toLowerCase().includes(T)
|
|
3306
3306
|
);
|
|
3307
3307
|
}, [c, n]), g = (C) => {
|
|
3308
|
-
p(null),
|
|
3308
|
+
p(null), h({}), m(C), ["custom", "text", "map"].includes(C) && (u(!0), b(void 0)), t == null || t(C), s == null || s();
|
|
3309
3309
|
}, v = (C) => {
|
|
3310
|
-
p(null),
|
|
3310
|
+
p(null), h({}), m("custom"), k({
|
|
3311
3311
|
type: "component",
|
|
3312
3312
|
visualType: "single",
|
|
3313
3313
|
url: C.url,
|
|
@@ -3429,22 +3429,22 @@ function il({
|
|
|
3429
3429
|
function qo() {
|
|
3430
3430
|
const t = M(
|
|
3431
3431
|
(o) => {
|
|
3432
|
-
var
|
|
3433
|
-
return (
|
|
3432
|
+
var m, h;
|
|
3433
|
+
return (h = (m = o.card.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : h.indexAxis;
|
|
3434
3434
|
}
|
|
3435
3435
|
), s = M((o) => o.card.type), { setChartOrientation: n, setCardPreferences: r } = M(
|
|
3436
3436
|
(o) => o.actions
|
|
3437
3437
|
), i = (o) => {
|
|
3438
3438
|
if (n(o), s !== "bullet")
|
|
3439
3439
|
return;
|
|
3440
|
-
const
|
|
3441
|
-
...
|
|
3440
|
+
const m = o === "y" ? "horizontal" : "vertical", h = M.getState().card.preferences, u = {
|
|
3441
|
+
...h || {},
|
|
3442
3442
|
bulletConfig: {
|
|
3443
|
-
...(
|
|
3444
|
-
orientation:
|
|
3443
|
+
...(h == null ? void 0 : h.bulletConfig) || {},
|
|
3444
|
+
orientation: m
|
|
3445
3445
|
}
|
|
3446
3446
|
};
|
|
3447
|
-
r(
|
|
3447
|
+
r(u);
|
|
3448
3448
|
};
|
|
3449
3449
|
function d() {
|
|
3450
3450
|
const o = t ?? "x";
|
|
@@ -3469,7 +3469,7 @@ function Ko({
|
|
|
3469
3469
|
className: t
|
|
3470
3470
|
}) {
|
|
3471
3471
|
var k, b, x, f, g, v, F, I, C, T;
|
|
3472
|
-
const s = M((y) => y.card), { setCardPreferences: n, updateCardInFrame: r, setCard: i } = ne(), [d, l] = q(!1), c = ((b = (k = s.preferences) == null ? void 0 : k.displayOptions) == null ? void 0 : b.showFilterInfo) ?? !0, o = ((f = (x = s.preferences) == null ? void 0 : x.displayOptions) == null ? void 0 : f.showCardToolbar) ?? !0,
|
|
3472
|
+
const s = M((y) => y.card), { setCardPreferences: n, updateCardInFrame: r, setCard: i } = ne(), [d, l] = q(!1), c = ((b = (k = s.preferences) == null ? void 0 : k.displayOptions) == null ? void 0 : b.showFilterInfo) ?? !0, o = ((f = (x = s.preferences) == null ? void 0 : x.displayOptions) == null ? void 0 : f.showCardToolbar) ?? !0, m = ((v = (g = s.preferences) == null ? void 0 : g.displayOptions) == null ? void 0 : v.showChrome) ?? !0, h = ((I = (F = s.preferences) == null ? void 0 : F.displayOptions) == null ? void 0 : I.allowScroll) ?? !0, u = ((T = (C = s.preferences) == null ? void 0 : C.displayOptions) == null ? void 0 : T.showInlineFilterBar) ?? !0, p = (y, w) => {
|
|
3473
3473
|
var N;
|
|
3474
3474
|
const E = {
|
|
3475
3475
|
...s.preferences,
|
|
@@ -3528,7 +3528,7 @@ function Ko({
|
|
|
3528
3528
|
/* @__PURE__ */ a(
|
|
3529
3529
|
ot,
|
|
3530
3530
|
{
|
|
3531
|
-
checked:
|
|
3531
|
+
checked: m,
|
|
3532
3532
|
onCheckedChange: (y) => {
|
|
3533
3533
|
p("showChrome", y);
|
|
3534
3534
|
},
|
|
@@ -3543,7 +3543,7 @@ function Ko({
|
|
|
3543
3543
|
/* @__PURE__ */ a(
|
|
3544
3544
|
ot,
|
|
3545
3545
|
{
|
|
3546
|
-
checked:
|
|
3546
|
+
checked: h,
|
|
3547
3547
|
onCheckedChange: (y) => {
|
|
3548
3548
|
p("allowScroll", y);
|
|
3549
3549
|
},
|
|
@@ -3558,7 +3558,7 @@ function Ko({
|
|
|
3558
3558
|
/* @__PURE__ */ a(
|
|
3559
3559
|
ot,
|
|
3560
3560
|
{
|
|
3561
|
-
checked:
|
|
3561
|
+
checked: u,
|
|
3562
3562
|
onCheckedChange: (y) => {
|
|
3563
3563
|
p("showInlineFilterBar", y);
|
|
3564
3564
|
},
|
|
@@ -3574,27 +3574,27 @@ function Ko({
|
|
|
3574
3574
|
] }) });
|
|
3575
3575
|
}
|
|
3576
3576
|
function Go() {
|
|
3577
|
-
const [t, s] = q(!1), n = M((
|
|
3578
|
-
(
|
|
3577
|
+
const [t, s] = q(!1), n = M((u) => u.card), r = M((u) => u.selectedConnectionId), { setCard: i } = ne(), d = ye(
|
|
3578
|
+
(u) => u.actions.removeCardInlineFilterValue
|
|
3579
3579
|
), l = (n == null ? void 0 : n.inlineFilters) || [];
|
|
3580
|
-
function c(
|
|
3580
|
+
function c(u) {
|
|
3581
3581
|
var F, I, C;
|
|
3582
|
-
const p = ((C = (I = (F = n == null ? void 0 : n.dataSource) == null ? void 0 : F.selectedEntities) == null ? void 0 : I[0]) == null ? void 0 : C.database) || "", k =
|
|
3582
|
+
const p = ((C = (I = (F = n == null ? void 0 : n.dataSource) == null ? void 0 : F.selectedEntities) == null ? void 0 : I[0]) == null ? void 0 : C.database) || "", k = u.qualifiedFieldName || u.name;
|
|
3583
3583
|
if (l.find(
|
|
3584
3584
|
(T) => T.column === k
|
|
3585
3585
|
))
|
|
3586
3586
|
return;
|
|
3587
|
-
const x =
|
|
3587
|
+
const x = u.qualifiedFieldName ? u.qualifiedFieldName.split(".").slice(0, -1).join(".") : u.qualifiedEntityName || u.entityName, f = lr(u.name), g = u.qualifiedFieldName || f, v = {
|
|
3588
3588
|
id: zt(),
|
|
3589
3589
|
column: k,
|
|
3590
|
-
title:
|
|
3591
|
-
dataType:
|
|
3592
|
-
table:
|
|
3590
|
+
title: u.label || u.name,
|
|
3591
|
+
dataType: u.dataType,
|
|
3592
|
+
table: u.entityName || "",
|
|
3593
3593
|
database: p,
|
|
3594
3594
|
connectionId: r || "",
|
|
3595
3595
|
operation: "in",
|
|
3596
3596
|
sql: rr(
|
|
3597
|
-
|
|
3597
|
+
u.dataType,
|
|
3598
3598
|
x,
|
|
3599
3599
|
g
|
|
3600
3600
|
),
|
|
@@ -3606,16 +3606,16 @@ function Go() {
|
|
|
3606
3606
|
inlineFilters: [...l, v]
|
|
3607
3607
|
});
|
|
3608
3608
|
}
|
|
3609
|
-
function o(
|
|
3610
|
-
const p = l.filter((k) => k.id !==
|
|
3609
|
+
function o(u) {
|
|
3610
|
+
const p = l.filter((k) => k.id !== u);
|
|
3611
3611
|
i({
|
|
3612
3612
|
...n,
|
|
3613
3613
|
inlineFilters: p
|
|
3614
|
-
}), d(n.id,
|
|
3614
|
+
}), d(n.id, u);
|
|
3615
3615
|
}
|
|
3616
|
-
function u
|
|
3616
|
+
function m(u, p) {
|
|
3617
3617
|
const k = l.map(
|
|
3618
|
-
(b) => b.id ===
|
|
3618
|
+
(b) => b.id === u ? { ...b, ...p } : b
|
|
3619
3619
|
);
|
|
3620
3620
|
i({
|
|
3621
3621
|
...n,
|
|
@@ -3674,14 +3674,14 @@ function Go() {
|
|
|
3674
3674
|
) }) }),
|
|
3675
3675
|
l.length > 0 && /* @__PURE__ */ a("div", { className: "border-t px-4 py-3", children: [
|
|
3676
3676
|
/* @__PURE__ */ e("p", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "Active Filters" }),
|
|
3677
|
-
/* @__PURE__ */ e("div", { className: "space-y-1", children: l.map((
|
|
3677
|
+
/* @__PURE__ */ e("div", { className: "space-y-1", children: l.map((u) => /* @__PURE__ */ e(
|
|
3678
3678
|
Uo,
|
|
3679
3679
|
{
|
|
3680
|
-
filter:
|
|
3681
|
-
onUpdate: (p) => u
|
|
3682
|
-
onRemove: () => o(
|
|
3680
|
+
filter: u,
|
|
3681
|
+
onUpdate: (p) => m(u.id, p),
|
|
3682
|
+
onRemove: () => o(u.id)
|
|
3683
3683
|
},
|
|
3684
|
-
|
|
3684
|
+
u.id
|
|
3685
3685
|
)) })
|
|
3686
3686
|
] })
|
|
3687
3687
|
] }) })
|
|
@@ -3780,15 +3780,15 @@ function _o() {
|
|
|
3780
3780
|
initializeModeDrafts: c
|
|
3781
3781
|
} = ne(), o = (f, g) => {
|
|
3782
3782
|
f.dataTransfer.setData("tabIndex", g.toString());
|
|
3783
|
-
},
|
|
3783
|
+
}, m = (f) => {
|
|
3784
3784
|
f.preventDefault();
|
|
3785
|
-
},
|
|
3785
|
+
}, h = (f, g) => {
|
|
3786
3786
|
const v = f.dataTransfer.getData("tabIndex");
|
|
3787
3787
|
if (v === g.toString()) return;
|
|
3788
3788
|
const F = Array.from(t.cards), [I] = F.splice(parseInt(v), 1);
|
|
3789
3789
|
F.splice(g, 0, I), n({ ...t, cards: F });
|
|
3790
3790
|
};
|
|
3791
|
-
function
|
|
3791
|
+
function u(f) {
|
|
3792
3792
|
const g = t.cards.filter((C) => C.id !== f), v = g[0], F = {
|
|
3793
3793
|
...t,
|
|
3794
3794
|
cards: g,
|
|
@@ -3863,8 +3863,8 @@ function _o() {
|
|
|
3863
3863
|
{
|
|
3864
3864
|
draggable: !0,
|
|
3865
3865
|
onDragStart: (v) => o(v, g),
|
|
3866
|
-
onDragOver:
|
|
3867
|
-
onDrop: (v) =>
|
|
3866
|
+
onDragOver: m,
|
|
3867
|
+
onDrop: (v) => h(v, g),
|
|
3868
3868
|
className: "",
|
|
3869
3869
|
value: f.id,
|
|
3870
3870
|
children: [
|
|
@@ -3894,7 +3894,7 @@ function _o() {
|
|
|
3894
3894
|
Ae,
|
|
3895
3895
|
{
|
|
3896
3896
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3897
|
-
onClick: () =>
|
|
3897
|
+
onClick: () => u(f.id)
|
|
3898
3898
|
}
|
|
3899
3899
|
)
|
|
3900
3900
|
]
|
|
@@ -3922,11 +3922,11 @@ function on() {
|
|
|
3922
3922
|
setRunSql: l,
|
|
3923
3923
|
mergeDraftsIntoCard: c,
|
|
3924
3924
|
clearModeDrafts: o,
|
|
3925
|
-
initializeModeDrafts:
|
|
3926
|
-
} = ne(), { data:
|
|
3925
|
+
initializeModeDrafts: m
|
|
3926
|
+
} = ne(), { data: h, isLoading: u, isFetching: p, isError: k } = Ve(s);
|
|
3927
3927
|
function b(g) {
|
|
3928
3928
|
const v = t.cards.find((F) => F.id === g);
|
|
3929
|
-
v && (c(), x(g), i(g), o(),
|
|
3929
|
+
v && (c(), x(g), i(g), o(), m(v));
|
|
3930
3930
|
}
|
|
3931
3931
|
function x(g) {
|
|
3932
3932
|
const v = M.getState().card, F = M.getState().frame, I = {
|
|
@@ -3939,20 +3939,20 @@ function on() {
|
|
|
3939
3939
|
C.sql && l(!0), d(C);
|
|
3940
3940
|
}
|
|
3941
3941
|
function f() {
|
|
3942
|
-
return s.type === "kpi" ?
|
|
3942
|
+
return s.type === "kpi" ? u || p ? /* @__PURE__ */ e("div", { className: "z-50 flex h-full items-center justify-center", children: /* @__PURE__ */ e(Gt, { size: "md", color: "muted", "aria-label": "Loading data" }) }) : /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border border-border", children: /* @__PURE__ */ e(
|
|
3943
3943
|
cr,
|
|
3944
3944
|
{
|
|
3945
3945
|
card: s,
|
|
3946
|
-
data:
|
|
3947
|
-
isPending:
|
|
3946
|
+
data: h == null ? void 0 : h.records,
|
|
3947
|
+
isPending: u || p,
|
|
3948
3948
|
isError: k
|
|
3949
3949
|
}
|
|
3950
|
-
) }) }) : s.type === "text" ?
|
|
3950
|
+
) }) }) : s.type === "text" ? u || p ? /* @__PURE__ */ e("div", { className: "z-50 flex h-full items-center justify-center", children: /* @__PURE__ */ e(Gt, { size: "md", color: "muted", "aria-label": "Loading data" }) }) : /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(aa, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
|
|
3951
3951
|
dr,
|
|
3952
3952
|
{
|
|
3953
3953
|
isLoading: n,
|
|
3954
3954
|
card: s,
|
|
3955
|
-
data:
|
|
3955
|
+
data: h == null ? void 0 : h.records
|
|
3956
3956
|
}
|
|
3957
3957
|
) }) }) }) : /* @__PURE__ */ e(Oa, { FallbackComponent: bn, children: /* @__PURE__ */ e(ll, { className: "grow border-none shadow-none" }) });
|
|
3958
3958
|
}
|
|
@@ -3974,9 +3974,9 @@ function ls({
|
|
|
3974
3974
|
}) {
|
|
3975
3975
|
const s = M((R) => R.frame), n = M((R) => R.card), r = M((R) => R.isDevMode), i = M((R) => R.isShowingVisual), d = ye((R) => R.isVisualEditing), l = M((R) => R.pythonStdOut), c = M((R) => R.actions.setRunSql), {
|
|
3976
3976
|
setFrame: o,
|
|
3977
|
-
setCard:
|
|
3978
|
-
setActiveTabCardId:
|
|
3979
|
-
runAssistant:
|
|
3977
|
+
setCard: m,
|
|
3978
|
+
setActiveTabCardId: h,
|
|
3979
|
+
runAssistant: u,
|
|
3980
3980
|
setCardPreferences: p,
|
|
3981
3981
|
mergeDraftsIntoCard: k,
|
|
3982
3982
|
clearModeDrafts: b,
|
|
@@ -3995,7 +3995,7 @@ function ls({
|
|
|
3995
3995
|
pageSize: A
|
|
3996
3996
|
}
|
|
3997
3997
|
};
|
|
3998
|
-
|
|
3998
|
+
m(z);
|
|
3999
3999
|
const U = {
|
|
4000
4000
|
...s,
|
|
4001
4001
|
cards: s.cards.map((X) => X.id === n.id ? z : X)
|
|
@@ -4015,7 +4015,7 @@ function ls({
|
|
|
4015
4015
|
sortByColumns: A
|
|
4016
4016
|
}
|
|
4017
4017
|
};
|
|
4018
|
-
|
|
4018
|
+
m(z);
|
|
4019
4019
|
const U = {
|
|
4020
4020
|
...s,
|
|
4021
4021
|
cards: s.cards.map((ae) => ae.id === n.id ? z : ae)
|
|
@@ -4038,7 +4038,7 @@ function ls({
|
|
|
4038
4038
|
}
|
|
4039
4039
|
function D() {
|
|
4040
4040
|
const R = `Can you get the documentation for ${n.type} chart?`;
|
|
4041
|
-
|
|
4041
|
+
u(R);
|
|
4042
4042
|
}
|
|
4043
4043
|
return n ? /* @__PURE__ */ a(
|
|
4044
4044
|
"div",
|
|
@@ -4221,7 +4221,7 @@ function Re({
|
|
|
4221
4221
|
type: n,
|
|
4222
4222
|
placeholder: r,
|
|
4223
4223
|
value: d,
|
|
4224
|
-
onChange: (
|
|
4224
|
+
onChange: (h) => l(h.target.value),
|
|
4225
4225
|
onBlur: () => {
|
|
4226
4226
|
if (c.current) {
|
|
4227
4227
|
c.current = !1;
|
|
@@ -4229,12 +4229,12 @@ function Re({
|
|
|
4229
4229
|
}
|
|
4230
4230
|
d !== t && s(d);
|
|
4231
4231
|
},
|
|
4232
|
-
onKeyDown: (
|
|
4233
|
-
if (
|
|
4234
|
-
|
|
4232
|
+
onKeyDown: (h) => {
|
|
4233
|
+
if (h.key === "Enter") {
|
|
4234
|
+
h.currentTarget.blur();
|
|
4235
4235
|
return;
|
|
4236
4236
|
}
|
|
4237
|
-
|
|
4237
|
+
h.key === "Escape" && (c.current = !0, l(t), h.currentTarget.blur());
|
|
4238
4238
|
},
|
|
4239
4239
|
className: i
|
|
4240
4240
|
}
|
|
@@ -4289,10 +4289,10 @@ function cl() {
|
|
|
4289
4289
|
(g) => g.card.customCardPreferences
|
|
4290
4290
|
), { data: s } = fr(), n = (s == null ? void 0 : s.plugins) || [], r = M((g) => g.card), i = M((g) => g.frame), d = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: l } = ne(), { components: c, manifest: o } = gr(
|
|
4291
4291
|
(t == null ? void 0 : t.url) || ""
|
|
4292
|
-
),
|
|
4292
|
+
), m = (x = o == null ? void 0 : o.visuals) == null ? void 0 : x.find(
|
|
4293
4293
|
(g) => g.name === (t == null ? void 0 : t.componentName)
|
|
4294
4294
|
);
|
|
4295
|
-
function
|
|
4295
|
+
function h(g, v) {
|
|
4296
4296
|
if (!t) return;
|
|
4297
4297
|
const I = {
|
|
4298
4298
|
...(t == null ? void 0 : t.dataInputCardIds) || {},
|
|
@@ -4306,7 +4306,7 @@ function cl() {
|
|
|
4306
4306
|
dataInputCardIds: I
|
|
4307
4307
|
});
|
|
4308
4308
|
}
|
|
4309
|
-
function
|
|
4309
|
+
function u(g) {
|
|
4310
4310
|
var F, I;
|
|
4311
4311
|
const v = (F = i == null ? void 0 : i.cards) == null ? void 0 : F.filter((C) => {
|
|
4312
4312
|
var T;
|
|
@@ -4330,7 +4330,7 @@ function cl() {
|
|
|
4330
4330
|
label: "",
|
|
4331
4331
|
options: v || [],
|
|
4332
4332
|
value: ((w = (y = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : y[T]) == null ? void 0 : w.cardId) || "",
|
|
4333
|
-
onValueChange: (E) =>
|
|
4333
|
+
onValueChange: (E) => h(T, E)
|
|
4334
4334
|
}
|
|
4335
4335
|
)
|
|
4336
4336
|
]
|
|
@@ -4466,8 +4466,8 @@ function cl() {
|
|
|
4466
4466
|
] }),
|
|
4467
4467
|
((f = r == null ? void 0 : r.customCardPreferences) == null ? void 0 : f.componentName) && /* @__PURE__ */ a(xe, { className: "border-none", value: "component-settings", children: [
|
|
4468
4468
|
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
4469
|
-
/* @__PURE__ */ e("span", { children: (
|
|
4470
|
-
(
|
|
4469
|
+
/* @__PURE__ */ e("span", { children: (m == null ? void 0 : m.name) || "Settings" }),
|
|
4470
|
+
(m == null ? void 0 : m.docs) && /* @__PURE__ */ a(Na, { openDelay: 0, closeDelay: 100, children: [
|
|
4471
4471
|
/* @__PURE__ */ e(
|
|
4472
4472
|
va,
|
|
4473
4473
|
{
|
|
@@ -4483,21 +4483,21 @@ function cl() {
|
|
|
4483
4483
|
align: "start",
|
|
4484
4484
|
className: "max-h-[40vh] w-[500px] overflow-y-auto text-left",
|
|
4485
4485
|
children: /* @__PURE__ */ a("div", { className: "space-y-4 text-left", children: [
|
|
4486
|
-
|
|
4487
|
-
|
|
4486
|
+
m.docs.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: m.docs.description }),
|
|
4487
|
+
m.docs.dataSchema && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
4488
4488
|
/* @__PURE__ */ e("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Data Schema" }),
|
|
4489
4489
|
/* @__PURE__ */ e("div", { className: "prose prose-sm dark:prose-invert prose-pre:bg-muted prose-pre:text-xs max-w-none", children: /* @__PURE__ */ e(
|
|
4490
4490
|
xr,
|
|
4491
4491
|
{
|
|
4492
4492
|
remarkPlugins: [br],
|
|
4493
4493
|
components: Yo,
|
|
4494
|
-
children:
|
|
4494
|
+
children: m.docs.dataSchema
|
|
4495
4495
|
}
|
|
4496
4496
|
) })
|
|
4497
4497
|
] }),
|
|
4498
|
-
|
|
4498
|
+
m.docs.useCases && m.docs.useCases.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
4499
4499
|
/* @__PURE__ */ e("h4", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Use Cases" }),
|
|
4500
|
-
/* @__PURE__ */ e("ul", { className: "space-y-1 text-sm", children:
|
|
4500
|
+
/* @__PURE__ */ e("ul", { className: "space-y-1 text-sm", children: m.docs.useCases.map(
|
|
4501
4501
|
(g, v) => /* @__PURE__ */ a(
|
|
4502
4502
|
"li",
|
|
4503
4503
|
{
|
|
@@ -4517,11 +4517,11 @@ function cl() {
|
|
|
4517
4517
|
] })
|
|
4518
4518
|
] }) }),
|
|
4519
4519
|
/* @__PURE__ */ a(Ne, { children: [
|
|
4520
|
-
|
|
4520
|
+
m && m.dataInputs && /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
4521
4521
|
/* @__PURE__ */ e(L, { children: "Input Mapping" }),
|
|
4522
|
-
/* @__PURE__ */ e("div", { className: "px-2", children:
|
|
4522
|
+
/* @__PURE__ */ e("div", { className: "px-2", children: u(m) })
|
|
4523
4523
|
] }),
|
|
4524
|
-
|
|
4524
|
+
m && m.settings && /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e("div", { className: "px-2", children: k(m) }) })
|
|
4525
4525
|
] })
|
|
4526
4526
|
] })
|
|
4527
4527
|
]
|
|
@@ -4538,11 +4538,11 @@ function Wo({
|
|
|
4538
4538
|
color: ""
|
|
4539
4539
|
};
|
|
4540
4540
|
function r(l, c, o) {
|
|
4541
|
-
const
|
|
4542
|
-
|
|
4543
|
-
...
|
|
4541
|
+
const m = [...t];
|
|
4542
|
+
m[l] = {
|
|
4543
|
+
...m[l],
|
|
4544
4544
|
[c]: o
|
|
4545
|
-
}, s(
|
|
4545
|
+
}, s(m);
|
|
4546
4546
|
}
|
|
4547
4547
|
function i(l) {
|
|
4548
4548
|
const c = [...t];
|
|
@@ -4611,7 +4611,7 @@ function Wo({
|
|
|
4611
4611
|
] });
|
|
4612
4612
|
}
|
|
4613
4613
|
function Qo() {
|
|
4614
|
-
var
|
|
4614
|
+
var h, u, p, k, b;
|
|
4615
4615
|
const t = M((x) => x.card.preferences), s = M(
|
|
4616
4616
|
(x) => x.actions.setCardPreferences
|
|
4617
4617
|
), n = M((x) => x.card), r = Ea(n.config), i = M(
|
|
@@ -4644,13 +4644,13 @@ function Qo() {
|
|
|
4644
4644
|
}
|
|
4645
4645
|
) || [], o = M(
|
|
4646
4646
|
(x) => x.actions.setColorRanges
|
|
4647
|
-
),
|
|
4647
|
+
), m = [...new Set(Kn.map((x) => x.currency))];
|
|
4648
4648
|
return /* @__PURE__ */ a("div", { children: [
|
|
4649
4649
|
!r && /* @__PURE__ */ a("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4650
4650
|
/* @__PURE__ */ e(
|
|
4651
4651
|
_e,
|
|
4652
4652
|
{
|
|
4653
|
-
checked: !!((
|
|
4653
|
+
checked: !!((h = t == null ? void 0 : t.formatNumber) != null && h.enabled),
|
|
4654
4654
|
onCheckedChange: (x) => {
|
|
4655
4655
|
s({
|
|
4656
4656
|
...t,
|
|
@@ -4664,7 +4664,7 @@ function Qo() {
|
|
|
4664
4664
|
),
|
|
4665
4665
|
/* @__PURE__ */ e(L, { children: "Format Number" })
|
|
4666
4666
|
] }),
|
|
4667
|
-
(((
|
|
4667
|
+
(((u = t == null ? void 0 : t.formatNumber) == null ? void 0 : u.enabled) === !0 || r) && /* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: [
|
|
4668
4668
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
4669
4669
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
4670
4670
|
/* @__PURE__ */ a("div", { className: "w-full space-y-1", children: [
|
|
@@ -4713,7 +4713,7 @@ function Qo() {
|
|
|
4713
4713
|
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ a(_t, { children: [
|
|
4714
4714
|
/* @__PURE__ */ e(ia, { children: "Currency" }),
|
|
4715
4715
|
/* @__PURE__ */ e(B, { value: "none", children: "None" }, "none"),
|
|
4716
|
-
|
|
4716
|
+
m.map((x) => /* @__PURE__ */ e(B, { value: x, children: x }, x))
|
|
4717
4717
|
] }) })
|
|
4718
4718
|
]
|
|
4719
4719
|
}
|
|
@@ -5149,27 +5149,27 @@ function rs({
|
|
|
5149
5149
|
);
|
|
5150
5150
|
}
|
|
5151
5151
|
function dl() {
|
|
5152
|
-
const [t, s] = q([]), n = M((
|
|
5153
|
-
(
|
|
5152
|
+
const [t, s] = q([]), n = M((m) => m.card.preferences), { setFilterOnClickColumnIndex: r, setCardPreferences: i } = M(
|
|
5153
|
+
(m) => m.actions
|
|
5154
5154
|
), d = M(
|
|
5155
|
-
(
|
|
5155
|
+
(m) => m.queryResultColumns
|
|
5156
5156
|
);
|
|
5157
5157
|
M(
|
|
5158
|
-
(
|
|
5159
|
-
var
|
|
5160
|
-
return (
|
|
5158
|
+
(m) => {
|
|
5159
|
+
var h;
|
|
5160
|
+
return (h = m.card.preferences) == null ? void 0 : h.filterOnClickColumnIndex;
|
|
5161
5161
|
}
|
|
5162
5162
|
), ue(() => {
|
|
5163
5163
|
d && s(new Array(d.length).fill(!1));
|
|
5164
5164
|
}, [d]);
|
|
5165
|
-
function l(
|
|
5166
|
-
var
|
|
5167
|
-
|
|
5165
|
+
function l(m, h) {
|
|
5166
|
+
var u, p;
|
|
5167
|
+
h ? n != null && n.onClickFilter && ((u = n == null ? void 0 : n.onClickFilter) == null ? void 0 : u.length) > 0 ? i({
|
|
5168
5168
|
...n,
|
|
5169
5169
|
onClickFilter: [
|
|
5170
5170
|
...n.onClickFilter,
|
|
5171
5171
|
{
|
|
5172
|
-
columnIndex:
|
|
5172
|
+
columnIndex: m,
|
|
5173
5173
|
expression: ""
|
|
5174
5174
|
}
|
|
5175
5175
|
]
|
|
@@ -5177,47 +5177,47 @@ function dl() {
|
|
|
5177
5177
|
...n,
|
|
5178
5178
|
onClickFilter: [
|
|
5179
5179
|
{
|
|
5180
|
-
columnIndex:
|
|
5180
|
+
columnIndex: m,
|
|
5181
5181
|
expression: ""
|
|
5182
5182
|
}
|
|
5183
5183
|
]
|
|
5184
5184
|
}) : (i({
|
|
5185
5185
|
...n,
|
|
5186
5186
|
onClickFilter: (p = n == null ? void 0 : n.onClickFilter) == null ? void 0 : p.filter(
|
|
5187
|
-
(k) => k.columnIndex !==
|
|
5187
|
+
(k) => k.columnIndex !== m
|
|
5188
5188
|
)
|
|
5189
5189
|
}), s((k) => {
|
|
5190
5190
|
const b = [...k];
|
|
5191
|
-
return b[
|
|
5191
|
+
return b[m] = !1, b;
|
|
5192
5192
|
}));
|
|
5193
5193
|
}
|
|
5194
|
-
function c(
|
|
5194
|
+
function c(m, h) {
|
|
5195
5195
|
var p;
|
|
5196
|
-
const
|
|
5196
|
+
const u = (p = n == null ? void 0 : n.onClickFilter) == null ? void 0 : p.map((k) => k.columnIndex === m ? {
|
|
5197
5197
|
...k,
|
|
5198
|
-
expression:
|
|
5198
|
+
expression: h.target.value
|
|
5199
5199
|
} : k);
|
|
5200
5200
|
i({
|
|
5201
5201
|
...n,
|
|
5202
|
-
onClickFilter:
|
|
5202
|
+
onClickFilter: u
|
|
5203
5203
|
});
|
|
5204
5204
|
}
|
|
5205
|
-
function o(
|
|
5206
|
-
var
|
|
5207
|
-
if (t != null && t[
|
|
5205
|
+
function o(m) {
|
|
5206
|
+
var h, u, p, k;
|
|
5207
|
+
if (t != null && t[m] || (u = (h = n == null ? void 0 : n.onClickFilter) == null ? void 0 : h.find((b) => b.columnIndex === m)) != null && u.expression)
|
|
5208
5208
|
return /* @__PURE__ */ e(
|
|
5209
5209
|
ge,
|
|
5210
5210
|
{
|
|
5211
|
-
value: (k = (p = n == null ? void 0 : n.onClickFilter) == null ? void 0 : p.find((b) => b.columnIndex ===
|
|
5212
|
-
onChange: (b) => c(
|
|
5211
|
+
value: (k = (p = n == null ? void 0 : n.onClickFilter) == null ? void 0 : p.find((b) => b.columnIndex === m)) == null ? void 0 : k.expression,
|
|
5212
|
+
onChange: (b) => c(m, b),
|
|
5213
5213
|
type: "text",
|
|
5214
5214
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
5215
5215
|
placeholder: "Expression"
|
|
5216
5216
|
}
|
|
5217
5217
|
);
|
|
5218
5218
|
}
|
|
5219
|
-
return /* @__PURE__ */ e("div", { className: "max-h-[150px] space-y-2 overflow-y-auto", children: d == null ? void 0 : d.map((
|
|
5220
|
-
var
|
|
5219
|
+
return /* @__PURE__ */ e("div", { className: "max-h-[150px] space-y-2 overflow-y-auto", children: d == null ? void 0 : d.map((m, h) => {
|
|
5220
|
+
var u, p;
|
|
5221
5221
|
return /* @__PURE__ */ e(
|
|
5222
5222
|
"div",
|
|
5223
5223
|
{
|
|
@@ -5227,38 +5227,38 @@ function dl() {
|
|
|
5227
5227
|
/* @__PURE__ */ e(
|
|
5228
5228
|
_e,
|
|
5229
5229
|
{
|
|
5230
|
-
checked: !!((
|
|
5231
|
-
(k) => k.columnIndex ===
|
|
5230
|
+
checked: !!((u = n == null ? void 0 : n.onClickFilter) != null && u.find(
|
|
5231
|
+
(k) => k.columnIndex === h
|
|
5232
5232
|
)),
|
|
5233
|
-
onCheckedChange: (k) => l(
|
|
5233
|
+
onCheckedChange: (k) => l(h, k)
|
|
5234
5234
|
}
|
|
5235
5235
|
),
|
|
5236
5236
|
/* @__PURE__ */ e(
|
|
5237
5237
|
"label",
|
|
5238
5238
|
{
|
|
5239
5239
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
5240
|
-
children:
|
|
5240
|
+
children: m
|
|
5241
5241
|
}
|
|
5242
5242
|
),
|
|
5243
5243
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((p = n == null ? void 0 : n.onClickFilter) == null ? void 0 : p.find(
|
|
5244
|
-
(k) => k.columnIndex ===
|
|
5244
|
+
(k) => k.columnIndex === h
|
|
5245
5245
|
)) && /* @__PURE__ */ e(
|
|
5246
5246
|
Fs,
|
|
5247
5247
|
{
|
|
5248
5248
|
onClick: () => {
|
|
5249
5249
|
s((k) => {
|
|
5250
5250
|
const b = [...k];
|
|
5251
|
-
return b[
|
|
5251
|
+
return b[h] = !k[h], b;
|
|
5252
5252
|
});
|
|
5253
5253
|
},
|
|
5254
5254
|
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
5255
5255
|
}
|
|
5256
5256
|
) })
|
|
5257
5257
|
] }),
|
|
5258
|
-
o(
|
|
5258
|
+
o(h)
|
|
5259
5259
|
] })
|
|
5260
5260
|
},
|
|
5261
|
-
|
|
5261
|
+
m
|
|
5262
5262
|
);
|
|
5263
5263
|
}) });
|
|
5264
5264
|
}
|
|
@@ -5363,9 +5363,9 @@ const ac = [
|
|
|
5363
5363
|
value: t
|
|
5364
5364
|
}));
|
|
5365
5365
|
function lc() {
|
|
5366
|
-
var o,
|
|
5367
|
-
const t = M((P) => P.card), s = (
|
|
5368
|
-
((
|
|
5366
|
+
var o, m, h, u, p, k, b, x, f, g, v, F, I, C, T, y, w, E;
|
|
5367
|
+
const t = M((P) => P.card), s = (m = (o = t == null ? void 0 : t.preferences) == null ? void 0 : o.mapVisualOptions) == null ? void 0 : m.topoJsonUrl, [n, r] = q(
|
|
5368
|
+
((u = (h = t == null ? void 0 : t.preferences) == null ? void 0 : h.mapVisualOptions) == null ? void 0 : u.customTopoJsonUrl) || ""
|
|
5369
5369
|
), { setCardPreferences: i } = ne(), { data: d } = xn(t), l = Object.keys((d == null ? void 0 : d.objects) || {}).map((P) => ({
|
|
5370
5370
|
label: P,
|
|
5371
5371
|
value: P
|
|
@@ -5611,8 +5611,8 @@ function ic({
|
|
|
5611
5611
|
{
|
|
5612
5612
|
value: c.name,
|
|
5613
5613
|
onSelect: (o) => {
|
|
5614
|
-
const
|
|
5615
|
-
d(
|
|
5614
|
+
const m = o === i ? "" : o;
|
|
5615
|
+
d(m), r(!1), m && s(c);
|
|
5616
5616
|
},
|
|
5617
5617
|
children: [
|
|
5618
5618
|
c.label || c.name,
|
|
@@ -5711,24 +5711,24 @@ function dc() {
|
|
|
5711
5711
|
] });
|
|
5712
5712
|
}
|
|
5713
5713
|
function ul({ color: t, onColorChange: s, onClose: n }) {
|
|
5714
|
-
const [r, i] = q(0), [d, l] = q(100), [c, o] = q(50), [
|
|
5714
|
+
const [r, i] = q(0), [d, l] = q(100), [c, o] = q(50), [m, h] = q(t);
|
|
5715
5715
|
ue(() => {
|
|
5716
5716
|
const f = is(t);
|
|
5717
5717
|
if (f) {
|
|
5718
5718
|
const g = os(f.r, f.g, f.b);
|
|
5719
|
-
i(g.h), l(g.s), o(g.l),
|
|
5719
|
+
i(g.h), l(g.s), o(g.l), h(t);
|
|
5720
5720
|
}
|
|
5721
5721
|
}, [t]);
|
|
5722
|
-
const
|
|
5722
|
+
const u = (f) => {
|
|
5723
5723
|
i(f), k(f, d, c);
|
|
5724
5724
|
}, p = (f) => {
|
|
5725
5725
|
const g = f.currentTarget.getBoundingClientRect(), v = Math.max(0, Math.min(1, (f.clientX - g.left) / g.width)), F = Math.max(0, Math.min(1, (f.clientY - g.top) / g.height)), I = v * 100, C = (1 - F) * 100;
|
|
5726
5726
|
l(I), o(C), k(r, I, C);
|
|
5727
5727
|
}, k = (f, g, v) => {
|
|
5728
5728
|
const F = mc(f, g, v), I = uc(F.r, F.g, F.b);
|
|
5729
|
-
|
|
5729
|
+
h(I);
|
|
5730
5730
|
}, b = (f) => {
|
|
5731
|
-
if (
|
|
5731
|
+
if (h(f), /^#[0-9A-Fa-f]{6}$/.test(f)) {
|
|
5732
5732
|
const g = is(f);
|
|
5733
5733
|
if (g) {
|
|
5734
5734
|
const v = os(g.r, g.g, g.b);
|
|
@@ -5736,7 +5736,7 @@ function ul({ color: t, onColorChange: s, onClose: n }) {
|
|
|
5736
5736
|
}
|
|
5737
5737
|
}
|
|
5738
5738
|
}, x = () => {
|
|
5739
|
-
/^#[0-9A-Fa-f]{6}$/.test(
|
|
5739
|
+
/^#[0-9A-Fa-f]{6}$/.test(m) && (s(m), n());
|
|
5740
5740
|
};
|
|
5741
5741
|
return /* @__PURE__ */ a("div", { className: "p-4 space-y-4 w-[320px]", children: [
|
|
5742
5742
|
/* @__PURE__ */ a(
|
|
@@ -5776,7 +5776,7 @@ function ul({ color: t, onColorChange: s, onClose: n }) {
|
|
|
5776
5776
|
style: {
|
|
5777
5777
|
left: `${d}%`,
|
|
5778
5778
|
top: `${100 - c}%`,
|
|
5779
|
-
backgroundColor:
|
|
5779
|
+
backgroundColor: m
|
|
5780
5780
|
}
|
|
5781
5781
|
}
|
|
5782
5782
|
)
|
|
@@ -5790,7 +5790,7 @@ function ul({ color: t, onColorChange: s, onClose: n }) {
|
|
|
5790
5790
|
min: "0",
|
|
5791
5791
|
max: "360",
|
|
5792
5792
|
value: r,
|
|
5793
|
-
onChange: (f) =>
|
|
5793
|
+
onChange: (f) => u(Number(f.target.value)),
|
|
5794
5794
|
className: "w-full h-4 rounded-lg appearance-none cursor-pointer",
|
|
5795
5795
|
style: {
|
|
5796
5796
|
background: "linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"
|
|
@@ -5802,7 +5802,7 @@ function ul({ color: t, onColorChange: s, onClose: n }) {
|
|
|
5802
5802
|
/* @__PURE__ */ e(
|
|
5803
5803
|
ge,
|
|
5804
5804
|
{
|
|
5805
|
-
value:
|
|
5805
|
+
value: m,
|
|
5806
5806
|
onChange: (f) => b(f.target.value),
|
|
5807
5807
|
placeholder: "#000000",
|
|
5808
5808
|
className: "font-mono"
|
|
@@ -5825,7 +5825,7 @@ function ul({ color: t, onColorChange: s, onClose: n }) {
|
|
|
5825
5825
|
"div",
|
|
5826
5826
|
{
|
|
5827
5827
|
className: "w-12 h-12 rounded-full border shadow-sm",
|
|
5828
|
-
style: { backgroundColor:
|
|
5828
|
+
style: { backgroundColor: m }
|
|
5829
5829
|
}
|
|
5830
5830
|
),
|
|
5831
5831
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground mt-1", children: "NEW" })
|
|
@@ -5879,7 +5879,7 @@ function mc(t, s, n) {
|
|
|
5879
5879
|
if (s === 0)
|
|
5880
5880
|
r = i = d = n;
|
|
5881
5881
|
else {
|
|
5882
|
-
const l = (
|
|
5882
|
+
const l = (m, h, u) => (u < 0 && (u += 1), u > 1 && (u -= 1), u < 0.16666666666666666 ? m + (h - m) * 6 * u : u < 0.5 ? h : u < 0.6666666666666666 ? m + (h - m) * (0.6666666666666666 - u) * 6 : m), c = n < 0.5 ? n * (1 + s) : n + s - n * s, o = 2 * n - c;
|
|
5883
5883
|
r = l(o, c, t + 1 / 3), i = l(o, c, t), d = l(o, c, t - 1 / 3);
|
|
5884
5884
|
}
|
|
5885
5885
|
return {
|
|
@@ -5927,7 +5927,7 @@ function pc() {
|
|
|
5927
5927
|
return (V = O.card) == null ? void 0 : V.preferences;
|
|
5928
5928
|
}), { setCardPreferences: n, updateCardInFrame: r } = ne(), { data: i } = Ve(t), [d, l] = q({}), [c, o] = q(
|
|
5929
5929
|
null
|
|
5930
|
-
), [
|
|
5930
|
+
), [m, h] = q(null), u = Ce(() => {
|
|
5931
5931
|
var R, A, z, U, $, _, X;
|
|
5932
5932
|
if (!(i != null && i.records) || i.records.length === 0) return [];
|
|
5933
5933
|
const O = (t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine", V = (t == null ? void 0 : t.type) === "bar" || (t == null ? void 0 : t.type) === "line" || (t == null ? void 0 : t.type) === "horizontalBar" || (t == null ? void 0 : t.type) === "bullet" || (t == null ? void 0 : t.type) === "combo" || (t == null ? void 0 : t.type) === "area" || (t == null ? void 0 : t.type) === "stackedArea", D = ((R = t == null ? void 0 : t.config) == null ? void 0 : R.pivotByColumns) && t.config.pivotByColumns.length > 0;
|
|
@@ -5975,14 +5975,14 @@ function pc() {
|
|
|
5975
5975
|
]), p = Ce(() => Sr(), []);
|
|
5976
5976
|
ue(() => {
|
|
5977
5977
|
const O = {};
|
|
5978
|
-
|
|
5978
|
+
u.forEach((V, D) => {
|
|
5979
5979
|
O[V] = Gn(
|
|
5980
5980
|
V,
|
|
5981
5981
|
D,
|
|
5982
5982
|
s == null ? void 0 : s.colorConfig
|
|
5983
5983
|
);
|
|
5984
5984
|
}), l(O);
|
|
5985
|
-
}, [
|
|
5985
|
+
}, [u, s == null ? void 0 : s.colorConfig, p]);
|
|
5986
5986
|
const k = (O, V) => {
|
|
5987
5987
|
const D = {
|
|
5988
5988
|
...d,
|
|
@@ -6019,7 +6019,7 @@ function pc() {
|
|
|
6019
6019
|
[O]: D
|
|
6020
6020
|
}));
|
|
6021
6021
|
};
|
|
6022
|
-
if (!
|
|
6022
|
+
if (!u.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((y = (T = t == null ? void 0 : t.config) == null ? void 0 : T.groupByColumns) == null ? void 0 : y.length) || ((E = (w = t == null ? void 0 : t.config) == null ? void 0 : w.pivotByColumns) == null ? void 0 : E.length) : (N = (P = t == null ? void 0 : t.config) == null ? void 0 : P.groupByColumns) == null ? void 0 : N.length) || ["table", "kpi", "text", "custom", "heatmap"].includes(t.type))
|
|
6023
6023
|
return null;
|
|
6024
6024
|
const g = () => {
|
|
6025
6025
|
const O = {
|
|
@@ -6035,7 +6035,7 @@ function pc() {
|
|
|
6035
6035
|
};
|
|
6036
6036
|
r(V);
|
|
6037
6037
|
const D = {};
|
|
6038
|
-
|
|
6038
|
+
u.forEach((R, A) => {
|
|
6039
6039
|
D[R] = Gn(R, A, void 0);
|
|
6040
6040
|
}), l(D);
|
|
6041
6041
|
}, v = Object.keys(((S = s == null ? void 0 : s.colorConfig) == null ? void 0 : S.segments) || {}).length > 0;
|
|
@@ -6056,7 +6056,7 @@ function pc() {
|
|
|
6056
6056
|
]
|
|
6057
6057
|
}
|
|
6058
6058
|
) }) }),
|
|
6059
|
-
/* @__PURE__ */ e("div", { className: "max-h-[200px] space-y-2 overflow-y-auto pr-1", children:
|
|
6059
|
+
/* @__PURE__ */ e("div", { className: "max-h-[200px] space-y-2 overflow-y-auto pr-1", children: u.map((O, V) => {
|
|
6060
6060
|
const D = kr(d[O], V), R = !D;
|
|
6061
6061
|
return /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
6062
6062
|
/* @__PURE__ */ a(
|
|
@@ -6118,7 +6118,7 @@ function pc() {
|
|
|
6118
6118
|
{
|
|
6119
6119
|
className: "text-sm font-medium text-blue-600 hover:text-blue-700",
|
|
6120
6120
|
onClick: () => {
|
|
6121
|
-
|
|
6121
|
+
h({
|
|
6122
6122
|
value: O,
|
|
6123
6123
|
color: d[O]
|
|
6124
6124
|
}), o(null);
|
|
@@ -6148,22 +6148,22 @@ function pc() {
|
|
|
6148
6148
|
R && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "(custom)" })
|
|
6149
6149
|
] }, O);
|
|
6150
6150
|
}) }),
|
|
6151
|
-
|
|
6151
|
+
m && /* @__PURE__ */ a("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
6152
6152
|
/* @__PURE__ */ e(
|
|
6153
6153
|
"div",
|
|
6154
6154
|
{
|
|
6155
6155
|
className: "absolute inset-0 bg-black/50",
|
|
6156
|
-
onClick: () =>
|
|
6156
|
+
onClick: () => h(null)
|
|
6157
6157
|
}
|
|
6158
6158
|
),
|
|
6159
6159
|
/* @__PURE__ */ e("div", { className: "relative rounded-lg bg-white shadow-lg", children: /* @__PURE__ */ e(
|
|
6160
6160
|
ul,
|
|
6161
6161
|
{
|
|
6162
|
-
color:
|
|
6162
|
+
color: m.color,
|
|
6163
6163
|
onColorChange: (O) => {
|
|
6164
|
-
k(
|
|
6164
|
+
k(m.value, O), h(null);
|
|
6165
6165
|
},
|
|
6166
|
-
onClose: () =>
|
|
6166
|
+
onClose: () => h(null)
|
|
6167
6167
|
}
|
|
6168
6168
|
) })
|
|
6169
6169
|
] })
|
|
@@ -6181,9 +6181,9 @@ function je({
|
|
|
6181
6181
|
rn.useEffect(() => {
|
|
6182
6182
|
l(t ?? "");
|
|
6183
6183
|
}, [t]);
|
|
6184
|
-
const
|
|
6184
|
+
const m = () => {
|
|
6185
6185
|
s(d), o(!1);
|
|
6186
|
-
},
|
|
6186
|
+
}, h = () => {
|
|
6187
6187
|
l(t ?? ""), o(!1);
|
|
6188
6188
|
};
|
|
6189
6189
|
return /* @__PURE__ */ a("div", { className: `flex items-center gap-2 ${i}`, children: [
|
|
@@ -6193,15 +6193,15 @@ function je({
|
|
|
6193
6193
|
placeholder: n,
|
|
6194
6194
|
type: r,
|
|
6195
6195
|
value: c ? d : t ?? "",
|
|
6196
|
-
onChange: (
|
|
6197
|
-
l(
|
|
6196
|
+
onChange: (u) => {
|
|
6197
|
+
l(u.target.value), o(!0);
|
|
6198
6198
|
},
|
|
6199
6199
|
onFocus: () => o(!0),
|
|
6200
|
-
onClick: (
|
|
6200
|
+
onClick: (u) => u.stopPropagation(),
|
|
6201
6201
|
className: "h-8 text-xs",
|
|
6202
|
-
onPointerDown: (
|
|
6203
|
-
onKeyDown: (
|
|
6204
|
-
|
|
6202
|
+
onPointerDown: (u) => u.stopPropagation(),
|
|
6203
|
+
onKeyDown: (u) => {
|
|
6204
|
+
u.stopPropagation(), u.key === "Enter" && c && d !== t ? m() : u.key === "Escape" && h();
|
|
6205
6205
|
},
|
|
6206
6206
|
"aria-label": n || "Edit field"
|
|
6207
6207
|
}
|
|
@@ -6214,7 +6214,7 @@ function je({
|
|
|
6214
6214
|
size: "icon",
|
|
6215
6215
|
className: "h-6 w-6 p-0",
|
|
6216
6216
|
"aria-label": "Confirm edit",
|
|
6217
|
-
onClick:
|
|
6217
|
+
onClick: m,
|
|
6218
6218
|
children: /* @__PURE__ */ e(na, { className: "h-4 w-4 text-green-600" })
|
|
6219
6219
|
}
|
|
6220
6220
|
),
|
|
@@ -6225,7 +6225,7 @@ function je({
|
|
|
6225
6225
|
size: "icon",
|
|
6226
6226
|
className: "h-6 w-6 p-0",
|
|
6227
6227
|
"aria-label": "Cancel edit",
|
|
6228
|
-
onClick:
|
|
6228
|
+
onClick: h,
|
|
6229
6229
|
children: /* @__PURE__ */ e(Ae, { className: "h-4 w-4 text-muted-foreground" })
|
|
6230
6230
|
}
|
|
6231
6231
|
)
|
|
@@ -6496,7 +6496,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6496
6496
|
fontWeight: N === "fontWeight" ? S : (U = r == null ? void 0 : r.name) == null ? void 0 : U.fontWeight
|
|
6497
6497
|
}
|
|
6498
6498
|
});
|
|
6499
|
-
},
|
|
6499
|
+
}, m = (N, S) => {
|
|
6500
6500
|
var O, V;
|
|
6501
6501
|
i({
|
|
6502
6502
|
...r ?? {},
|
|
@@ -6505,7 +6505,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6505
6505
|
rotation: N === "rotation" ? S : (V = r == null ? void 0 : r.labels) == null ? void 0 : V.rotation
|
|
6506
6506
|
}
|
|
6507
6507
|
});
|
|
6508
|
-
},
|
|
6508
|
+
}, h = (N, S) => {
|
|
6509
6509
|
i({
|
|
6510
6510
|
...r ?? {},
|
|
6511
6511
|
scale: {
|
|
@@ -6513,7 +6513,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6513
6513
|
[N]: S === "" ? "auto" : Number(S)
|
|
6514
6514
|
}
|
|
6515
6515
|
});
|
|
6516
|
-
},
|
|
6516
|
+
}, u = t === "x" ? ["auto", "top", "bottom"] : ["auto", "left", "right"], p = ["auto", "0", "45", "90", "-45", "-90"];
|
|
6517
6517
|
return /* @__PURE__ */ a(xe, { value: `${t}-axis`, className: "border-b-0", children: [
|
|
6518
6518
|
/* @__PURE__ */ a("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
6519
6519
|
/* @__PURE__ */ e(be, { className: "flex grow items-center justify-between gap-3 py-2 text-sm font-medium hover:no-underline", children: /* @__PURE__ */ e("div", { className: "flex grow items-center justify-between gap-2", children: /* @__PURE__ */ e("span", { children: s }) }) }),
|
|
@@ -6599,7 +6599,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6599
6599
|
onValueChange: (N) => c("position", N),
|
|
6600
6600
|
children: [
|
|
6601
6601
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
6602
|
-
/* @__PURE__ */ e(Q, { children:
|
|
6602
|
+
/* @__PURE__ */ e(Q, { children: u.map((N) => /* @__PURE__ */ e(B, { value: N, className: "text-xs", children: N === "auto" ? "Auto (Default)" : ze(N) }, N)) })
|
|
6603
6603
|
]
|
|
6604
6604
|
}
|
|
6605
6605
|
)
|
|
@@ -6611,7 +6611,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6611
6611
|
Te,
|
|
6612
6612
|
{
|
|
6613
6613
|
checked: ((v = r == null ? void 0 : r.labels) == null ? void 0 : v.enabled) !== !1,
|
|
6614
|
-
onCheckedChange: (N) =>
|
|
6614
|
+
onCheckedChange: (N) => m("enabled", N)
|
|
6615
6615
|
}
|
|
6616
6616
|
)
|
|
6617
6617
|
] }),
|
|
@@ -6621,7 +6621,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6621
6621
|
H,
|
|
6622
6622
|
{
|
|
6623
6623
|
value: String(((I = r == null ? void 0 : r.labels) == null ? void 0 : I.rotation) || "auto"),
|
|
6624
|
-
onValueChange: (N) =>
|
|
6624
|
+
onValueChange: (N) => m(
|
|
6625
6625
|
"rotation",
|
|
6626
6626
|
N === "auto" ? "auto" : Number(N)
|
|
6627
6627
|
),
|
|
@@ -6656,7 +6656,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6656
6656
|
type: "number",
|
|
6657
6657
|
placeholder: "auto",
|
|
6658
6658
|
value: ((C = r == null ? void 0 : r.scale) == null ? void 0 : C.min) === "auto" || ((T = r == null ? void 0 : r.scale) == null ? void 0 : T.min) === void 0 ? "" : String(r.scale.min),
|
|
6659
|
-
onSave: (N) =>
|
|
6659
|
+
onSave: (N) => h("min", N),
|
|
6660
6660
|
className: ""
|
|
6661
6661
|
}
|
|
6662
6662
|
) })
|
|
@@ -6669,7 +6669,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6669
6669
|
type: "number",
|
|
6670
6670
|
placeholder: "auto",
|
|
6671
6671
|
value: ((y = r == null ? void 0 : r.scale) == null ? void 0 : y.max) === "auto" || ((w = r == null ? void 0 : r.scale) == null ? void 0 : w.max) === void 0 ? "" : String(r.scale.max),
|
|
6672
|
-
onSave: (N) =>
|
|
6672
|
+
onSave: (N) => h("max", N),
|
|
6673
6673
|
className: ""
|
|
6674
6674
|
}
|
|
6675
6675
|
) })
|
|
@@ -6682,7 +6682,7 @@ function Xa({ axis: t, label: s, type: n, config: r, onChange: i, defaultTitle:
|
|
|
6682
6682
|
type: "number",
|
|
6683
6683
|
placeholder: "auto",
|
|
6684
6684
|
value: ((E = r == null ? void 0 : r.scale) == null ? void 0 : E.stepSize) === "auto" || ((P = r == null ? void 0 : r.scale) == null ? void 0 : P.stepSize) === void 0 ? "" : String(r.scale.stepSize),
|
|
6685
|
-
onSave: (N) =>
|
|
6685
|
+
onSave: (N) => h("stepSize", N),
|
|
6686
6686
|
className: ""
|
|
6687
6687
|
}
|
|
6688
6688
|
) })
|
|
@@ -6700,16 +6700,16 @@ function Za(t, s, n) {
|
|
|
6700
6700
|
}
|
|
6701
6701
|
const r = ((c = s == null ? void 0 : s.config) == null ? void 0 : c.metricColumns) || [], i = (n == null ? void 0 : n.datasetOptions) || [];
|
|
6702
6702
|
if (t === "y") {
|
|
6703
|
-
const o = r.filter((
|
|
6704
|
-
const
|
|
6705
|
-
return !
|
|
6703
|
+
const o = r.filter((m, h) => {
|
|
6704
|
+
const u = i.find((p) => p.idx === h);
|
|
6705
|
+
return !u || u.yAxisId !== "y2";
|
|
6706
6706
|
});
|
|
6707
6707
|
return o.length === 1 && (o[0].label || o[0].name) || "";
|
|
6708
6708
|
}
|
|
6709
6709
|
if (t === "y2") {
|
|
6710
|
-
const o = r.filter((
|
|
6711
|
-
const
|
|
6712
|
-
return (
|
|
6710
|
+
const o = r.filter((m, h) => {
|
|
6711
|
+
const u = i.find((p) => p.idx === h);
|
|
6712
|
+
return (u == null ? void 0 : u.yAxisId) === "y2";
|
|
6713
6713
|
});
|
|
6714
6714
|
return o.length === 1 && (o[0].label || o[0].name) || "";
|
|
6715
6715
|
}
|
|
@@ -6726,18 +6726,18 @@ function Nc() {
|
|
|
6726
6726
|
if (!i.hasXAxis && !i.hasYAxis)
|
|
6727
6727
|
return null;
|
|
6728
6728
|
const d = (c, o) => {
|
|
6729
|
-
let
|
|
6730
|
-
c === "x" ?
|
|
6731
|
-
const
|
|
6729
|
+
let m;
|
|
6730
|
+
c === "x" ? m = "xAxisConfig" : c === "y" ? m = "yAxisConfig" : m = "secondaryYAxisConfig";
|
|
6731
|
+
const h = {
|
|
6732
6732
|
...s || {},
|
|
6733
|
-
[
|
|
6733
|
+
[m]: o
|
|
6734
6734
|
};
|
|
6735
|
-
n(
|
|
6736
|
-
const
|
|
6735
|
+
n(h);
|
|
6736
|
+
const u = {
|
|
6737
6737
|
...t,
|
|
6738
|
-
preferences:
|
|
6738
|
+
preferences: h
|
|
6739
6739
|
};
|
|
6740
|
-
r(
|
|
6740
|
+
r(u);
|
|
6741
6741
|
}, l = i.hasY2Axis && t.type === "combo";
|
|
6742
6742
|
return /* @__PURE__ */ a(xe, { value: "axes", className: "border-b-0", children: [
|
|
6743
6743
|
/* @__PURE__ */ e(be, { className: "flex w-full items-center gap-2 py-2 text-sm font-medium hover:no-underline", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
@@ -6792,21 +6792,21 @@ function Nc() {
|
|
|
6792
6792
|
] });
|
|
6793
6793
|
}
|
|
6794
6794
|
function vc() {
|
|
6795
|
-
const t = M((
|
|
6796
|
-
(
|
|
6797
|
-
var
|
|
6798
|
-
return (b = (k = (p = (
|
|
6795
|
+
const t = M((h) => h.card), s = M(
|
|
6796
|
+
(h) => {
|
|
6797
|
+
var u, p, k, b;
|
|
6798
|
+
return (b = (k = (p = (u = h.card) == null ? void 0 : u.preferences) == null ? void 0 : p.chartOptions) == null ? void 0 : k.plugins) == null ? void 0 : b.legend;
|
|
6799
6799
|
}
|
|
6800
6800
|
), { setLegendOptions: n } = ne();
|
|
6801
6801
|
if (!t || !Ar(t.type))
|
|
6802
6802
|
return null;
|
|
6803
|
-
const r = Er(t.type), i = (r == null ? void 0 : r.display) ?? !0, d = (r == null ? void 0 : r.position) ?? "top", l = (r == null ? void 0 : r.align) ?? "center", c = (
|
|
6803
|
+
const r = Er(t.type), i = (r == null ? void 0 : r.display) ?? !0, d = (r == null ? void 0 : r.position) ?? "top", l = (r == null ? void 0 : r.align) ?? "center", c = (h, u) => {
|
|
6804
6804
|
const p = {
|
|
6805
6805
|
...s,
|
|
6806
|
-
[
|
|
6806
|
+
[h]: u
|
|
6807
6807
|
};
|
|
6808
6808
|
n(p);
|
|
6809
|
-
}, o = ["top", "bottom", "left", "right"],
|
|
6809
|
+
}, o = ["top", "bottom", "left", "right"], m = ["start", "center", "end"];
|
|
6810
6810
|
return /* @__PURE__ */ a(xe, { value: "legend", className: "border-b-0", children: [
|
|
6811
6811
|
/* @__PURE__ */ e(be, { className: "flex w-full items-center gap-2 py-2 text-sm font-medium hover:no-underline", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
6812
6812
|
/* @__PURE__ */ e(io, { className: "h-4 w-4 text-muted-foreground" }),
|
|
@@ -6819,7 +6819,7 @@ function vc() {
|
|
|
6819
6819
|
Te,
|
|
6820
6820
|
{
|
|
6821
6821
|
checked: (s == null ? void 0 : s.display) ?? i,
|
|
6822
|
-
onCheckedChange: (
|
|
6822
|
+
onCheckedChange: (h) => c("display", h)
|
|
6823
6823
|
}
|
|
6824
6824
|
)
|
|
6825
6825
|
] }),
|
|
@@ -6830,10 +6830,10 @@ function vc() {
|
|
|
6830
6830
|
H,
|
|
6831
6831
|
{
|
|
6832
6832
|
value: (s == null ? void 0 : s.position) || d,
|
|
6833
|
-
onValueChange: (
|
|
6833
|
+
onValueChange: (h) => c("position", h),
|
|
6834
6834
|
children: [
|
|
6835
6835
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
6836
|
-
/* @__PURE__ */ e(Q, { children: o.map((
|
|
6836
|
+
/* @__PURE__ */ e(Q, { children: o.map((h) => /* @__PURE__ */ e(B, { value: h, className: "text-xs", children: ze(h) }, h)) })
|
|
6837
6837
|
]
|
|
6838
6838
|
}
|
|
6839
6839
|
)
|
|
@@ -6844,10 +6844,10 @@ function vc() {
|
|
|
6844
6844
|
H,
|
|
6845
6845
|
{
|
|
6846
6846
|
value: (s == null ? void 0 : s.align) || l,
|
|
6847
|
-
onValueChange: (
|
|
6847
|
+
onValueChange: (h) => c("align", h),
|
|
6848
6848
|
children: [
|
|
6849
6849
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
6850
|
-
/* @__PURE__ */ e(Q, { children:
|
|
6850
|
+
/* @__PURE__ */ e(Q, { children: m.map((h) => /* @__PURE__ */ e(B, { value: h, className: "text-xs", children: ze(h) }, h)) })
|
|
6851
6851
|
]
|
|
6852
6852
|
}
|
|
6853
6853
|
)
|
|
@@ -6869,7 +6869,7 @@ function yc() {
|
|
|
6869
6869
|
}), { setCardPreferences: r, updateCardInFrame: i } = ne();
|
|
6870
6870
|
if (!t || !Dr(t.type))
|
|
6871
6871
|
return null;
|
|
6872
|
-
const d = t.type === "bullet" ? ((D = n == null ? void 0 : n.bulletConfig) == null ? void 0 : D.orientation) ?? (((R = n == null ? void 0 : n.chartOptions) == null ? void 0 : R.indexAxis) === "x" ? "vertical" : "horizontal") : void 0, l = d != null ? d === "horizontal" : ((A = n == null ? void 0 : n.chartOptions) == null ? void 0 : A.indexAxis) === "y", c = t.type === "stackedBar" || t.type === "stackedLine", o = t.type === "pie" || t.type === "doughnut" || t.type === "polarArea" || t.type === "funnel",
|
|
6872
|
+
const d = t.type === "bullet" ? ((D = n == null ? void 0 : n.bulletConfig) == null ? void 0 : D.orientation) ?? (((R = n == null ? void 0 : n.chartOptions) == null ? void 0 : R.indexAxis) === "x" ? "vertical" : "horizontal") : void 0, l = d != null ? d === "horizontal" : ((A = n == null ? void 0 : n.chartOptions) == null ? void 0 : A.indexAxis) === "y", c = t.type === "stackedBar" || t.type === "stackedLine", o = t.type === "pie" || t.type === "doughnut" || t.type === "polarArea" || t.type === "funnel", m = !o, h = t.type === "bubble" || t.type === "scatter", u = (U = (z = n == null ? void 0 : n.chartOptions) == null ? void 0 : z.plugins) == null ? void 0 : U.datalabels, p = (u == null ? void 0 : u.display) !== !1 && ((u == null ? void 0 : u.anchor) || (u == null ? void 0 : u.align)), k = Or(
|
|
6873
6873
|
t.type,
|
|
6874
6874
|
t.preferences
|
|
6875
6875
|
), b = s ?? k, x = (k == null ? void 0 : k.enabled) ?? p ?? !1, f = (s == null ? void 0 : s.enabled) !== void 0 ? s.enabled : x, g = (j, le) => {
|
|
@@ -6878,7 +6878,7 @@ function yc() {
|
|
|
6878
6878
|
...s ?? {},
|
|
6879
6879
|
[j]: le
|
|
6880
6880
|
};
|
|
6881
|
-
j === "enabled" && (ie.display = le, le &&
|
|
6881
|
+
j === "enabled" && (ie.display = le, le && h && !ie.position && (ie.position = "bottom")), j === "position" && h && (ie.position = "bottom");
|
|
6882
6882
|
const we = {
|
|
6883
6883
|
...t.preferences || {},
|
|
6884
6884
|
dataLabelsConfig: ie
|
|
@@ -6931,7 +6931,7 @@ function yc() {
|
|
|
6931
6931
|
}, C = t.type !== "treemap" && t.type !== "heatmap", T = t.type !== "treemap", y = I();
|
|
6932
6932
|
let w = [];
|
|
6933
6933
|
if (C)
|
|
6934
|
-
if (
|
|
6934
|
+
if (h)
|
|
6935
6935
|
w = ["bottom"];
|
|
6936
6936
|
else if (c || o)
|
|
6937
6937
|
w = ["center"];
|
|
@@ -6939,7 +6939,7 @@ function yc() {
|
|
|
6939
6939
|
const j = l ? ["center", "left", "right"] : ["center", "top", "bottom"];
|
|
6940
6940
|
w = ["auto", ...t.type === "bullet" ? j : j.filter((de) => de !== y), "custom"];
|
|
6941
6941
|
}
|
|
6942
|
-
const E = () => ze(y), P = ["center", "start", "end"], N = ["center", "start", "end", "top", "bottom"], S =
|
|
6942
|
+
const E = () => ze(y), P = ["center", "start", "end"], N = ["center", "start", "end", "top", "bottom"], S = m ? ["auto", "number", "currency", "percent", "none"] : ["number", "currency", "percent", "none"], O = [
|
|
6943
6943
|
{ value: "USD", label: "USD - US Dollar" },
|
|
6944
6944
|
{ value: "EUR", label: "EUR - Euro" },
|
|
6945
6945
|
{ value: "GBP", label: "GBP - British Pound" },
|
|
@@ -6980,7 +6980,7 @@ function yc() {
|
|
|
6980
6980
|
/* @__PURE__ */ a(
|
|
6981
6981
|
H,
|
|
6982
6982
|
{
|
|
6983
|
-
value:
|
|
6983
|
+
value: h ? (b == null ? void 0 : b.position) || "bottom" : (b == null ? void 0 : b.position) || "auto",
|
|
6984
6984
|
onValueChange: (j) => g("position", j),
|
|
6985
6985
|
children: [
|
|
6986
6986
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
@@ -7034,11 +7034,11 @@ function yc() {
|
|
|
7034
7034
|
/* @__PURE__ */ a(
|
|
7035
7035
|
H,
|
|
7036
7036
|
{
|
|
7037
|
-
value: (b == null ? void 0 : b.format) || (
|
|
7037
|
+
value: (b == null ? void 0 : b.format) || (m ? "auto" : "none"),
|
|
7038
7038
|
onValueChange: (j) => g("format", j),
|
|
7039
7039
|
children: [
|
|
7040
7040
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
7041
|
-
/* @__PURE__ */ e(Q, { children: S.map((j) => /* @__PURE__ */ e(B, { value: j, className: "text-xs", children: j === "auto" &&
|
|
7041
|
+
/* @__PURE__ */ e(Q, { children: S.map((j) => /* @__PURE__ */ e(B, { value: j, className: "text-xs", children: j === "auto" && m ? "Auto (Use Axis)" : j === "none" ? "None (Raw Value)" : ze(j) }, j)) })
|
|
7042
7042
|
]
|
|
7043
7043
|
}
|
|
7044
7044
|
)
|
|
@@ -7202,7 +7202,7 @@ function ra({
|
|
|
7202
7202
|
label: n
|
|
7203
7203
|
}) {
|
|
7204
7204
|
const [r, i] = q(!1), [d, l] = q(!1), c = () => {
|
|
7205
|
-
const o = cs.find((
|
|
7205
|
+
const o = cs.find((m) => m.value === t);
|
|
7206
7206
|
return o ? o.color : t.startsWith("#") ? t : cs[2].color;
|
|
7207
7207
|
};
|
|
7208
7208
|
return /* @__PURE__ */ a(ce, { children: [
|
|
@@ -7312,7 +7312,7 @@ function wc() {
|
|
|
7312
7312
|
}
|
|
7313
7313
|
};
|
|
7314
7314
|
s(w);
|
|
7315
|
-
},
|
|
7315
|
+
}, m = d || c.enabled, h = ((f = t.config) == null ? void 0 : f.comparisonType) || "none", u = h === "previous_period" || h === "same_period_last_year" || h === "start_vs_end";
|
|
7316
7316
|
return /* @__PURE__ */ a(xe, { value: "comparison", className: "border-none", children: [
|
|
7317
7317
|
/* @__PURE__ */ e(be, { className: "flex items-center gap-2 py-2 text-sm hover:no-underline", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
7318
7318
|
/* @__PURE__ */ e(lo, { className: "h-4 w-4" }),
|
|
@@ -7334,7 +7334,7 @@ function wc() {
|
|
|
7334
7334
|
}
|
|
7335
7335
|
)
|
|
7336
7336
|
] }),
|
|
7337
|
-
|
|
7337
|
+
m && /* @__PURE__ */ a(ce, { children: [
|
|
7338
7338
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
7339
7339
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
7340
7340
|
/* @__PURE__ */ e(
|
|
@@ -7389,7 +7389,7 @@ function wc() {
|
|
|
7389
7389
|
title: "COMPARISON FORMAT"
|
|
7390
7390
|
}
|
|
7391
7391
|
),
|
|
7392
|
-
(
|
|
7392
|
+
(u || i) && /* @__PURE__ */ a("div", { className: "space-y-3 border-t pt-3", children: [
|
|
7393
7393
|
/* @__PURE__ */ e(L, { className: "text-xs font-medium uppercase text-muted-foreground", children: "Indicator" }),
|
|
7394
7394
|
i && /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
7395
7395
|
/* @__PURE__ */ e(L, { className: "text-xs text-muted-foreground", children: "Position" }),
|
|
@@ -7741,18 +7741,18 @@ function Ac() {
|
|
|
7741
7741
|
...s || {},
|
|
7742
7742
|
heatmapConfig: k
|
|
7743
7743
|
});
|
|
7744
|
-
},
|
|
7744
|
+
}, m = (p) => {
|
|
7745
7745
|
o({
|
|
7746
7746
|
colorPalette: p,
|
|
7747
7747
|
colorRange: p === "custom" ? i.colorRange ?? [...Ga] : void 0
|
|
7748
7748
|
});
|
|
7749
|
-
},
|
|
7749
|
+
}, h = (p, k) => {
|
|
7750
7750
|
const b = [...c];
|
|
7751
7751
|
b[p] = k, o({
|
|
7752
7752
|
colorPalette: "custom",
|
|
7753
7753
|
colorRange: b
|
|
7754
7754
|
});
|
|
7755
|
-
},
|
|
7755
|
+
}, u = (p) => {
|
|
7756
7756
|
o({ legendPosition: p });
|
|
7757
7757
|
};
|
|
7758
7758
|
return r ? /* @__PURE__ */ a(xe, { value: "heatmap-color-config", className: "border-none", children: [
|
|
@@ -7765,7 +7765,7 @@ function Ac() {
|
|
|
7765
7765
|
da,
|
|
7766
7766
|
{
|
|
7767
7767
|
value: d,
|
|
7768
|
-
onValueChange: (p) =>
|
|
7768
|
+
onValueChange: (p) => m(p ?? "blue"),
|
|
7769
7769
|
className: "space-y-3",
|
|
7770
7770
|
children: [
|
|
7771
7771
|
Tc.map((p) => {
|
|
@@ -7810,7 +7810,7 @@ function Ac() {
|
|
|
7810
7810
|
ra,
|
|
7811
7811
|
{
|
|
7812
7812
|
value: c[0],
|
|
7813
|
-
onChange: (p) =>
|
|
7813
|
+
onChange: (p) => h(0, p),
|
|
7814
7814
|
label: "Start color"
|
|
7815
7815
|
}
|
|
7816
7816
|
),
|
|
@@ -7818,7 +7818,7 @@ function Ac() {
|
|
|
7818
7818
|
ra,
|
|
7819
7819
|
{
|
|
7820
7820
|
value: c[1],
|
|
7821
|
-
onChange: (p) =>
|
|
7821
|
+
onChange: (p) => h(1, p),
|
|
7822
7822
|
label: "End color"
|
|
7823
7823
|
}
|
|
7824
7824
|
)
|
|
@@ -7833,7 +7833,7 @@ function Ac() {
|
|
|
7833
7833
|
H,
|
|
7834
7834
|
{
|
|
7835
7835
|
value: l,
|
|
7836
|
-
onValueChange: (p) =>
|
|
7836
|
+
onValueChange: (p) => u(
|
|
7837
7837
|
p ?? "bottom"
|
|
7838
7838
|
),
|
|
7839
7839
|
children: [
|
|
@@ -7857,17 +7857,17 @@ function Ec() {
|
|
|
7857
7857
|
const t = M((D) => D.card.preferences), s = M((D) => D.card), n = M((D) => D.isDevMode), { setCardPreferences: r, setChartOrientation: i } = ne(), d = Ce(
|
|
7858
7858
|
() => (t == null ? void 0 : t.bulletConfig) || {},
|
|
7859
7859
|
[t == null ? void 0 : t.bulletConfig]
|
|
7860
|
-
), c = Ea(s == null ? void 0 : s.config) && !n, [o,
|
|
7860
|
+
), c = Ea(s == null ? void 0 : s.config) && !n, [o, m] = q(
|
|
7861
7861
|
d.showRanges ?? !1
|
|
7862
|
-
), [
|
|
7862
|
+
), [h, u] = q(
|
|
7863
7863
|
d.rangesArePercentages ?? !1
|
|
7864
7864
|
), p = d.disableAutoComparative ? !1 : d.comparativeMetricKey !== void 0 || !c, [k, b] = q(
|
|
7865
7865
|
p
|
|
7866
7866
|
);
|
|
7867
7867
|
ue(() => {
|
|
7868
|
-
|
|
7868
|
+
m(d.showRanges ?? !1);
|
|
7869
7869
|
}, [d.showRanges]), ue(() => {
|
|
7870
|
-
|
|
7870
|
+
u(d.rangesArePercentages ?? !1);
|
|
7871
7871
|
}, [d.rangesArePercentages]);
|
|
7872
7872
|
const x = d.targetValue === void 0 ? "" : String(d.targetValue);
|
|
7873
7873
|
ue(() => {
|
|
@@ -7956,9 +7956,9 @@ function Ec() {
|
|
|
7956
7956
|
rangeLabels: Object.keys(z).length > 0 ? z : void 0
|
|
7957
7957
|
});
|
|
7958
7958
|
}, T = (D) => {
|
|
7959
|
-
|
|
7959
|
+
m(D), g({ showRanges: D });
|
|
7960
7960
|
}, y = (D) => {
|
|
7961
|
-
|
|
7961
|
+
u(D), g({ rangesArePercentages: D });
|
|
7962
7962
|
}, w = d.orientation || (((V = t == null ? void 0 : t.chartOptions) == null ? void 0 : V.indexAxis) === "y" ? "horizontal" : "vertical"), E = (D) => {
|
|
7963
7963
|
g({ orientation: D }), i(D === "horizontal" ? "y" : "x");
|
|
7964
7964
|
}, P = [
|
|
@@ -8123,7 +8123,7 @@ function Ec() {
|
|
|
8123
8123
|
"input",
|
|
8124
8124
|
{
|
|
8125
8125
|
type: "checkbox",
|
|
8126
|
-
checked:
|
|
8126
|
+
checked: h,
|
|
8127
8127
|
disabled: !o,
|
|
8128
8128
|
onChange: (D) => y(D.target.checked),
|
|
8129
8129
|
className: "h-3.5 w-3.5 accent-primary disabled:opacity-50"
|
|
@@ -8204,7 +8204,7 @@ function Ec() {
|
|
|
8204
8204
|
Re,
|
|
8205
8205
|
{
|
|
8206
8206
|
type: "number",
|
|
8207
|
-
placeholder:
|
|
8207
|
+
placeholder: h ? "0.80" : "Static value",
|
|
8208
8208
|
value: ((U = d.ranges) == null ? void 0 : U[D]) === void 0 ? "" : String(($ = d.ranges) == null ? void 0 : $[D]),
|
|
8209
8209
|
onCommit: (_) => F(D, _),
|
|
8210
8210
|
className: "h-8 text-xs"
|
|
@@ -8231,7 +8231,7 @@ function Dc() {
|
|
|
8231
8231
|
const t = M((A) => A.card.preferences), s = M((A) => A.card), n = M((A) => A.card.type), r = M((A) => A.isDevMode), { setCardPreferences: i, updateCardInFrame: d } = ne(), l = n === "bubble", c = n === "scatter", o = Ce(
|
|
8232
8232
|
() => (t == null ? void 0 : t.bubbleScatterConfig) || {},
|
|
8233
8233
|
[t == null ? void 0 : t.bubbleScatterConfig]
|
|
8234
|
-
),
|
|
8234
|
+
), h = Ea(s == null ? void 0 : s.config) && !r, u = Ce(() => {
|
|
8235
8235
|
var A, z;
|
|
8236
8236
|
return ((z = (A = s == null ? void 0 : s.config) == null ? void 0 : A.metricColumns) == null ? void 0 : z.map((U) => {
|
|
8237
8237
|
const $ = U.label || U.name || U.alias || "";
|
|
@@ -8263,10 +8263,10 @@ function Dc() {
|
|
|
8263
8263
|
});
|
|
8264
8264
|
};
|
|
8265
8265
|
ue(() => {
|
|
8266
|
-
if (!t ||
|
|
8266
|
+
if (!t || u.length === 0) return;
|
|
8267
8267
|
const A = {};
|
|
8268
8268
|
let z = !1;
|
|
8269
|
-
if (!o.xMetricKey &&
|
|
8269
|
+
if (!o.xMetricKey && u[0] && (A.xMetricKey = u[0].value, z = !0), !o.yMetricKey && u[1] && (A.yMetricKey = u[1].value, z = !0), l && !o.radiusMetricKey && u[2] && (A.radiusMetricKey = u[2].value, z = !0), !o.labelKey && p[0] && (A.labelKey = p[0].value, z = !0), k && !o.groupKey && p[1] && (A.groupKey = p[1].value, A.enableGrouping = !0, z = !0), z) {
|
|
8270
8270
|
const U = hs({
|
|
8271
8271
|
...o,
|
|
8272
8272
|
...A
|
|
@@ -8274,7 +8274,7 @@ function Dc() {
|
|
|
8274
8274
|
f(U);
|
|
8275
8275
|
}
|
|
8276
8276
|
}, [
|
|
8277
|
-
|
|
8277
|
+
u,
|
|
8278
8278
|
p,
|
|
8279
8279
|
o,
|
|
8280
8280
|
t,
|
|
@@ -8313,7 +8313,7 @@ function Dc() {
|
|
|
8313
8313
|
] }),
|
|
8314
8314
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
8315
8315
|
/* @__PURE__ */ e(L, { className: "text-xs", children: "Label Column" }),
|
|
8316
|
-
|
|
8316
|
+
h ? /* @__PURE__ */ a(
|
|
8317
8317
|
H,
|
|
8318
8318
|
{
|
|
8319
8319
|
value: o.labelKey || "",
|
|
@@ -8345,7 +8345,7 @@ function Dc() {
|
|
|
8345
8345
|
] }),
|
|
8346
8346
|
b && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
8347
8347
|
/* @__PURE__ */ e(L, { className: "text-xs", children: "Group By" }),
|
|
8348
|
-
|
|
8348
|
+
h ? /* @__PURE__ */ a(
|
|
8349
8349
|
H,
|
|
8350
8350
|
{
|
|
8351
8351
|
value: o.groupKey || "",
|
|
@@ -8370,14 +8370,14 @@ function Dc() {
|
|
|
8370
8370
|
/* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted-foreground", children: "Metrics" }),
|
|
8371
8371
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
8372
8372
|
/* @__PURE__ */ e(L, { className: "text-xs", children: "X Axis" }),
|
|
8373
|
-
|
|
8373
|
+
h ? /* @__PURE__ */ a(
|
|
8374
8374
|
H,
|
|
8375
8375
|
{
|
|
8376
8376
|
value: o.xMetricKey || "",
|
|
8377
8377
|
onValueChange: (A) => v({ xMetricKey: A }),
|
|
8378
8378
|
children: [
|
|
8379
8379
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, { placeholder: "Select X metric" }) }),
|
|
8380
|
-
/* @__PURE__ */ e(Q, { children:
|
|
8380
|
+
/* @__PURE__ */ e(Q, { children: u.map((A) => /* @__PURE__ */ e(B, { value: A.value, children: A.label }, A.value)) })
|
|
8381
8381
|
]
|
|
8382
8382
|
}
|
|
8383
8383
|
) : /* @__PURE__ */ e(
|
|
@@ -8392,14 +8392,14 @@ function Dc() {
|
|
|
8392
8392
|
] }),
|
|
8393
8393
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
8394
8394
|
/* @__PURE__ */ e(L, { className: "text-xs", children: "Y Axis" }),
|
|
8395
|
-
|
|
8395
|
+
h ? /* @__PURE__ */ a(
|
|
8396
8396
|
H,
|
|
8397
8397
|
{
|
|
8398
8398
|
value: o.yMetricKey || "",
|
|
8399
8399
|
onValueChange: (A) => v({ yMetricKey: A }),
|
|
8400
8400
|
children: [
|
|
8401
8401
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, { placeholder: "Select Y metric" }) }),
|
|
8402
|
-
/* @__PURE__ */ e(Q, { children:
|
|
8402
|
+
/* @__PURE__ */ e(Q, { children: u.map((A) => /* @__PURE__ */ e(B, { value: A.value, children: A.label }, A.value)) })
|
|
8403
8403
|
]
|
|
8404
8404
|
}
|
|
8405
8405
|
) : /* @__PURE__ */ e(
|
|
@@ -8414,14 +8414,14 @@ function Dc() {
|
|
|
8414
8414
|
] }),
|
|
8415
8415
|
l && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
8416
8416
|
/* @__PURE__ */ e(L, { className: "text-xs", children: "Radius" }),
|
|
8417
|
-
|
|
8417
|
+
h ? /* @__PURE__ */ a(
|
|
8418
8418
|
H,
|
|
8419
8419
|
{
|
|
8420
8420
|
value: o.radiusMetricKey || "",
|
|
8421
8421
|
onValueChange: (A) => v({ radiusMetricKey: A }),
|
|
8422
8422
|
children: [
|
|
8423
8423
|
/* @__PURE__ */ e(Y, { className: "h-8 text-xs", children: /* @__PURE__ */ e(W, { placeholder: "Select radius metric" }) }),
|
|
8424
|
-
/* @__PURE__ */ e(Q, { children:
|
|
8424
|
+
/* @__PURE__ */ e(Q, { children: u.map((A) => /* @__PURE__ */ e(B, { value: A.value, children: A.label }, A.value)) })
|
|
8425
8425
|
]
|
|
8426
8426
|
}
|
|
8427
8427
|
) : /* @__PURE__ */ e(
|
|
@@ -8633,11 +8633,11 @@ function Ic() {
|
|
|
8633
8633
|
...s || {},
|
|
8634
8634
|
funnelConfig: k
|
|
8635
8635
|
});
|
|
8636
|
-
}, u = (p) => {
|
|
8637
|
-
o({ percentMode: p });
|
|
8638
8636
|
}, m = (p) => {
|
|
8639
|
-
o({
|
|
8637
|
+
o({ percentMode: p });
|
|
8640
8638
|
}, h = (p) => {
|
|
8639
|
+
o({ shrinkFraction: p[0] });
|
|
8640
|
+
}, u = (p) => {
|
|
8641
8641
|
o({ labelThreshold: p[0] });
|
|
8642
8642
|
};
|
|
8643
8643
|
return r ? /* @__PURE__ */ a(xe, { value: "funnel-config", className: "border-none", children: [
|
|
@@ -8652,7 +8652,7 @@ function Ic() {
|
|
|
8652
8652
|
da,
|
|
8653
8653
|
{
|
|
8654
8654
|
value: d,
|
|
8655
|
-
onValueChange: (p) =>
|
|
8655
|
+
onValueChange: (p) => m(p),
|
|
8656
8656
|
className: "space-y-2",
|
|
8657
8657
|
children: Oc.map((p) => /* @__PURE__ */ a(
|
|
8658
8658
|
"div",
|
|
@@ -8693,7 +8693,7 @@ function Ic() {
|
|
|
8693
8693
|
Ca,
|
|
8694
8694
|
{
|
|
8695
8695
|
value: [l],
|
|
8696
|
-
onValueChange:
|
|
8696
|
+
onValueChange: h,
|
|
8697
8697
|
min: 0,
|
|
8698
8698
|
max: 1,
|
|
8699
8699
|
step: 0.1,
|
|
@@ -8716,7 +8716,7 @@ function Ic() {
|
|
|
8716
8716
|
Ca,
|
|
8717
8717
|
{
|
|
8718
8718
|
value: [c],
|
|
8719
|
-
onValueChange:
|
|
8719
|
+
onValueChange: u,
|
|
8720
8720
|
min: 0,
|
|
8721
8721
|
max: 25,
|
|
8722
8722
|
step: 1,
|
|
@@ -8783,7 +8783,7 @@ function $a({
|
|
|
8783
8783
|
[I]: C
|
|
8784
8784
|
};
|
|
8785
8785
|
s(T);
|
|
8786
|
-
},
|
|
8786
|
+
}, m = (I, C) => {
|
|
8787
8787
|
const T = {
|
|
8788
8788
|
...t,
|
|
8789
8789
|
font: {
|
|
@@ -8792,7 +8792,7 @@ function $a({
|
|
|
8792
8792
|
}
|
|
8793
8793
|
};
|
|
8794
8794
|
s(T);
|
|
8795
|
-
},
|
|
8795
|
+
}, h = (I, C) => {
|
|
8796
8796
|
const T = {
|
|
8797
8797
|
...t,
|
|
8798
8798
|
formatOptions: {
|
|
@@ -8801,7 +8801,7 @@ function $a({
|
|
|
8801
8801
|
}
|
|
8802
8802
|
};
|
|
8803
8803
|
s(T);
|
|
8804
|
-
},
|
|
8804
|
+
}, u = () => n ? "Right" : "Top", p = t || {}, k = p.format || (r ? "auto" : "number");
|
|
8805
8805
|
return /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
8806
8806
|
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
8807
8807
|
/* @__PURE__ */ e(L, { className: "text-xs text-muted-foreground", children: "Position" }),
|
|
@@ -8812,7 +8812,7 @@ function $a({
|
|
|
8812
8812
|
onValueChange: (I) => o("position", I),
|
|
8813
8813
|
children: [
|
|
8814
8814
|
/* @__PURE__ */ e(Y, { className: "h-7 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
8815
|
-
/* @__PURE__ */ e(Q, { children: l.map((I) => /* @__PURE__ */ e(B, { value: I, className: "text-xs", children: I === "auto" ?
|
|
8815
|
+
/* @__PURE__ */ e(Q, { children: l.map((I) => /* @__PURE__ */ e(B, { value: I, className: "text-xs", children: I === "auto" ? u() : I === "custom" ? "Custom (Advanced)" : ze(I) }, I)) })
|
|
8816
8816
|
]
|
|
8817
8817
|
}
|
|
8818
8818
|
)
|
|
@@ -8872,7 +8872,7 @@ function $a({
|
|
|
8872
8872
|
value: String(
|
|
8873
8873
|
((b = p.formatOptions) == null ? void 0 : b.decimalPlaces) ?? (k === "currency" ? 2 : k === "percent" ? 1 : 0)
|
|
8874
8874
|
),
|
|
8875
|
-
onSave: (I) =>
|
|
8875
|
+
onSave: (I) => h("decimalPlaces", Number(I)),
|
|
8876
8876
|
className: ""
|
|
8877
8877
|
}
|
|
8878
8878
|
) })
|
|
@@ -8883,7 +8883,7 @@ function $a({
|
|
|
8883
8883
|
H,
|
|
8884
8884
|
{
|
|
8885
8885
|
value: ((x = p.formatOptions) == null ? void 0 : x.currency) || "USD",
|
|
8886
|
-
onValueChange: (I) =>
|
|
8886
|
+
onValueChange: (I) => h("currency", I),
|
|
8887
8887
|
children: [
|
|
8888
8888
|
/* @__PURE__ */ e(Y, { className: "h-7 w-28 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
8889
8889
|
/* @__PURE__ */ e(Q, { children: Mc.map((I) => /* @__PURE__ */ e(
|
|
@@ -8905,7 +8905,7 @@ function $a({
|
|
|
8905
8905
|
Te,
|
|
8906
8906
|
{
|
|
8907
8907
|
checked: ((f = p.formatOptions) == null ? void 0 : f.useSuffix) ?? !1,
|
|
8908
|
-
onCheckedChange: (I) =>
|
|
8908
|
+
onCheckedChange: (I) => h("useSuffix", I)
|
|
8909
8909
|
}
|
|
8910
8910
|
)
|
|
8911
8911
|
] }),
|
|
@@ -8915,7 +8915,7 @@ function $a({
|
|
|
8915
8915
|
H,
|
|
8916
8916
|
{
|
|
8917
8917
|
value: ((g = p.formatOptions) == null ? void 0 : g.locale) || "en-US",
|
|
8918
|
-
onValueChange: (I) =>
|
|
8918
|
+
onValueChange: (I) => h("locale", I),
|
|
8919
8919
|
children: [
|
|
8920
8920
|
/* @__PURE__ */ e(Y, { className: "h-7 w-28 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
8921
8921
|
/* @__PURE__ */ e(Q, { children: Rc.map((I) => /* @__PURE__ */ e(
|
|
@@ -8943,7 +8943,7 @@ function $a({
|
|
|
8943
8943
|
type: "number",
|
|
8944
8944
|
placeholder: "12",
|
|
8945
8945
|
value: String(((v = p.font) == null ? void 0 : v.size) || 12),
|
|
8946
|
-
onSave: (I) =>
|
|
8946
|
+
onSave: (I) => m("size", Number(I)),
|
|
8947
8947
|
className: ""
|
|
8948
8948
|
}
|
|
8949
8949
|
) })
|
|
@@ -8954,7 +8954,7 @@ function $a({
|
|
|
8954
8954
|
H,
|
|
8955
8955
|
{
|
|
8956
8956
|
value: ((F = p.font) == null ? void 0 : F.weight) || "normal",
|
|
8957
|
-
onValueChange: (I) =>
|
|
8957
|
+
onValueChange: (I) => m("weight", I),
|
|
8958
8958
|
children: [
|
|
8959
8959
|
/* @__PURE__ */ e(Y, { className: "h-7 w-24 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
8960
8960
|
/* @__PURE__ */ a(Q, { children: [
|
|
@@ -9050,12 +9050,12 @@ function qc({ metricKey: t, idx: s }) {
|
|
|
9050
9050
|
var F, I;
|
|
9051
9051
|
return (I = (F = v.card) == null ? void 0 : F.preferences) == null ? void 0 : I.datasetOptions;
|
|
9052
9052
|
}
|
|
9053
|
-
), l = d == null ? void 0 : d.find((v) => v.idx === s), { setCardPreferences: c } = M((v) => v.actions), o = (l == null ? void 0 : l.type) || "bar",
|
|
9053
|
+
), l = d == null ? void 0 : d.find((v) => v.idx === s), { setCardPreferences: c } = M((v) => v.actions), o = (l == null ? void 0 : l.type) || "bar", m = (l == null ? void 0 : l.yAxisId) || "y", h = ((g = l == null ? void 0 : l.dataLabels) == null ? void 0 : g.enabled) ?? !1, u = o === "line" ? Sn : kn;
|
|
9054
9054
|
function p(v) {
|
|
9055
9055
|
const F = {
|
|
9056
9056
|
idx: s,
|
|
9057
9057
|
type: o,
|
|
9058
|
-
yAxisId:
|
|
9058
|
+
yAxisId: m,
|
|
9059
9059
|
dataLabels: l == null ? void 0 : l.dataLabels,
|
|
9060
9060
|
...v
|
|
9061
9061
|
};
|
|
@@ -9116,7 +9116,7 @@ function qc({ metricKey: t, idx: s }) {
|
|
|
9116
9116
|
"border border-border bg-background text-muted-foreground"
|
|
9117
9117
|
),
|
|
9118
9118
|
children: [
|
|
9119
|
-
/* @__PURE__ */ e(
|
|
9119
|
+
/* @__PURE__ */ e(u, { className: "h-3 w-3" }),
|
|
9120
9120
|
o === "line" ? "Line" : "Bar"
|
|
9121
9121
|
]
|
|
9122
9122
|
}
|
|
@@ -9128,7 +9128,7 @@ function qc({ metricKey: t, idx: s }) {
|
|
|
9128
9128
|
"rounded px-1.5 py-0.5 text-xs",
|
|
9129
9129
|
"border border-border bg-background text-muted-foreground"
|
|
9130
9130
|
),
|
|
9131
|
-
children:
|
|
9131
|
+
children: m === "y2" ? "Y2" : "Y1"
|
|
9132
9132
|
}
|
|
9133
9133
|
)
|
|
9134
9134
|
] })
|
|
@@ -9158,7 +9158,7 @@ function qc({ metricKey: t, idx: s }) {
|
|
|
9158
9158
|
/* @__PURE__ */ a(
|
|
9159
9159
|
H,
|
|
9160
9160
|
{
|
|
9161
|
-
value:
|
|
9161
|
+
value: m,
|
|
9162
9162
|
onValueChange: (v) => b(v),
|
|
9163
9163
|
children: [
|
|
9164
9164
|
/* @__PURE__ */ e(Y, { className: "h-8 w-20 text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
@@ -9248,12 +9248,12 @@ function qc({ metricKey: t, idx: s }) {
|
|
|
9248
9248
|
/* @__PURE__ */ e(
|
|
9249
9249
|
Te,
|
|
9250
9250
|
{
|
|
9251
|
-
checked:
|
|
9251
|
+
checked: h,
|
|
9252
9252
|
onCheckedChange: x
|
|
9253
9253
|
}
|
|
9254
9254
|
)
|
|
9255
9255
|
] }),
|
|
9256
|
-
|
|
9256
|
+
h && /* @__PURE__ */ e("div", { className: "rounded-md border border-border bg-background p-2", children: /* @__PURE__ */ e(
|
|
9257
9257
|
$a,
|
|
9258
9258
|
{
|
|
9259
9259
|
config: l == null ? void 0 : l.dataLabels,
|
|
@@ -9321,8 +9321,8 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9321
9321
|
var g, v;
|
|
9322
9322
|
return (v = (g = f.card) == null ? void 0 : g.preferences) == null ? void 0 : v.datasetOptions;
|
|
9323
9323
|
}
|
|
9324
|
-
), l = d == null ? void 0 : d.find((f) => f.idx === s), { setCardPreferences: c } = M((f) => f.actions), o = _c(l == null ? void 0 : l.fill),
|
|
9325
|
-
function
|
|
9324
|
+
), l = d == null ? void 0 : d.find((f) => f.idx === s), { setCardPreferences: c } = M((f) => f.actions), o = _c(l == null ? void 0 : l.fill), m = ((x = l == null ? void 0 : l.dataLabels) == null ? void 0 : x.enabled) ?? !1, h = en.find((f) => f.value === o) || en[0];
|
|
9325
|
+
function u(f) {
|
|
9326
9326
|
const g = {
|
|
9327
9327
|
idx: s,
|
|
9328
9328
|
fill: o,
|
|
@@ -9345,10 +9345,10 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9345
9345
|
}
|
|
9346
9346
|
}
|
|
9347
9347
|
function p(f) {
|
|
9348
|
-
|
|
9348
|
+
u({ fill: f === "false" ? !1 : f });
|
|
9349
9349
|
}
|
|
9350
9350
|
function k(f) {
|
|
9351
|
-
|
|
9351
|
+
u({
|
|
9352
9352
|
dataLabels: {
|
|
9353
9353
|
...l == null ? void 0 : l.dataLabels,
|
|
9354
9354
|
enabled: f
|
|
@@ -9356,7 +9356,7 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9356
9356
|
});
|
|
9357
9357
|
}
|
|
9358
9358
|
function b(f) {
|
|
9359
|
-
|
|
9359
|
+
u({
|
|
9360
9360
|
dataLabels: f
|
|
9361
9361
|
});
|
|
9362
9362
|
}
|
|
@@ -9383,7 +9383,7 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9383
9383
|
),
|
|
9384
9384
|
children: [
|
|
9385
9385
|
/* @__PURE__ */ e(Vs, { className: "h-3 w-3" }),
|
|
9386
|
-
|
|
9386
|
+
h.label.split(" ")[0]
|
|
9387
9387
|
]
|
|
9388
9388
|
}
|
|
9389
9389
|
) })
|
|
@@ -9420,7 +9420,7 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9420
9420
|
H,
|
|
9421
9421
|
{
|
|
9422
9422
|
value: (l == null ? void 0 : l.lineStyle) || "solid",
|
|
9423
|
-
onValueChange: (f) =>
|
|
9423
|
+
onValueChange: (f) => u({ lineStyle: f }),
|
|
9424
9424
|
children: [
|
|
9425
9425
|
/* @__PURE__ */ e(Y, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
9426
9426
|
/* @__PURE__ */ e(Q, { children: Uc.map(({ value: f, label: g }) => /* @__PURE__ */ e(
|
|
@@ -9442,7 +9442,7 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9442
9442
|
H,
|
|
9443
9443
|
{
|
|
9444
9444
|
value: String((l == null ? void 0 : l.pointRadius) ?? 3),
|
|
9445
|
-
onValueChange: (f) =>
|
|
9445
|
+
onValueChange: (f) => u({ pointRadius: Number(f) }),
|
|
9446
9446
|
children: [
|
|
9447
9447
|
/* @__PURE__ */ e(Y, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
9448
9448
|
/* @__PURE__ */ e(Q, { children: Kc.map((f) => /* @__PURE__ */ e(
|
|
@@ -9464,7 +9464,7 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9464
9464
|
H,
|
|
9465
9465
|
{
|
|
9466
9466
|
value: (l == null ? void 0 : l.pointStyle) || "circle",
|
|
9467
|
-
onValueChange: (f) =>
|
|
9467
|
+
onValueChange: (f) => u({ pointStyle: f }),
|
|
9468
9468
|
children: [
|
|
9469
9469
|
/* @__PURE__ */ e(Y, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
9470
9470
|
/* @__PURE__ */ e(Q, { children: Gc.map(({ value: f, label: g }) => /* @__PURE__ */ e(
|
|
@@ -9488,12 +9488,12 @@ function Yc({ metricKey: t, idx: s }) {
|
|
|
9488
9488
|
/* @__PURE__ */ e(
|
|
9489
9489
|
Te,
|
|
9490
9490
|
{
|
|
9491
|
-
checked:
|
|
9491
|
+
checked: m,
|
|
9492
9492
|
onCheckedChange: k
|
|
9493
9493
|
}
|
|
9494
9494
|
)
|
|
9495
9495
|
] }),
|
|
9496
|
-
|
|
9496
|
+
m && /* @__PURE__ */ e("div", { className: "rounded-md border border-border bg-background p-2", children: /* @__PURE__ */ e(
|
|
9497
9497
|
$a,
|
|
9498
9498
|
{
|
|
9499
9499
|
config: l == null ? void 0 : l.dataLabels,
|
|
@@ -9550,13 +9550,13 @@ function ed({ metricKey: t, idx: s }) {
|
|
|
9550
9550
|
var v, F;
|
|
9551
9551
|
return (F = (v = g.card) == null ? void 0 : v.preferences) == null ? void 0 : F.datasetOptions;
|
|
9552
9552
|
}
|
|
9553
|
-
), l = d == null ? void 0 : d.find((g) => g.idx === s), { setCardPreferences: c } = M((g) => g.actions), o = (l == null ? void 0 : l.lineStyle) || "solid",
|
|
9553
|
+
), l = d == null ? void 0 : d.find((g) => g.idx === s), { setCardPreferences: c } = M((g) => g.actions), o = (l == null ? void 0 : l.lineStyle) || "solid", m = (l == null ? void 0 : l.pointRadius) ?? 3, h = (l == null ? void 0 : l.pointStyle) || "circle", u = ((f = l == null ? void 0 : l.dataLabels) == null ? void 0 : f.enabled) ?? !1, p = tn.find((g) => g.value === o) || tn[0];
|
|
9554
9554
|
function k(g) {
|
|
9555
9555
|
const v = {
|
|
9556
9556
|
idx: s,
|
|
9557
9557
|
lineStyle: o,
|
|
9558
|
-
pointRadius:
|
|
9559
|
-
pointStyle:
|
|
9558
|
+
pointRadius: m,
|
|
9559
|
+
pointStyle: h,
|
|
9560
9560
|
dataLabels: l == null ? void 0 : l.dataLabels,
|
|
9561
9561
|
...g
|
|
9562
9562
|
};
|
|
@@ -9647,7 +9647,7 @@ function ed({ metricKey: t, idx: s }) {
|
|
|
9647
9647
|
/* @__PURE__ */ a(
|
|
9648
9648
|
H,
|
|
9649
9649
|
{
|
|
9650
|
-
value: String(
|
|
9650
|
+
value: String(m),
|
|
9651
9651
|
onValueChange: (g) => k({ pointRadius: Number(g) }),
|
|
9652
9652
|
children: [
|
|
9653
9653
|
/* @__PURE__ */ e(Y, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
@@ -9669,7 +9669,7 @@ function ed({ metricKey: t, idx: s }) {
|
|
|
9669
9669
|
/* @__PURE__ */ a(
|
|
9670
9670
|
H,
|
|
9671
9671
|
{
|
|
9672
|
-
value:
|
|
9672
|
+
value: h,
|
|
9673
9673
|
onValueChange: (g) => k({ pointStyle: g }),
|
|
9674
9674
|
children: [
|
|
9675
9675
|
/* @__PURE__ */ e(Y, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
@@ -9694,12 +9694,12 @@ function ed({ metricKey: t, idx: s }) {
|
|
|
9694
9694
|
/* @__PURE__ */ e(
|
|
9695
9695
|
Te,
|
|
9696
9696
|
{
|
|
9697
|
-
checked:
|
|
9697
|
+
checked: u,
|
|
9698
9698
|
onCheckedChange: b
|
|
9699
9699
|
}
|
|
9700
9700
|
)
|
|
9701
9701
|
] }),
|
|
9702
|
-
|
|
9702
|
+
u && /* @__PURE__ */ e("div", { className: "rounded-md border border-border bg-background p-2", children: /* @__PURE__ */ e(
|
|
9703
9703
|
$a,
|
|
9704
9704
|
{
|
|
9705
9705
|
config: l == null ? void 0 : l.dataLabels,
|
|
@@ -9744,11 +9744,11 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9744
9744
|
var f, g;
|
|
9745
9745
|
return (g = (f = x.card) == null ? void 0 : f.preferences) == null ? void 0 : g.datasetOptions;
|
|
9746
9746
|
}
|
|
9747
|
-
), c = l == null ? void 0 : l.find((x) => x.idx === s), { setCardPreferences: o } = M((x) => x.actions),
|
|
9748
|
-
function
|
|
9747
|
+
), c = l == null ? void 0 : l.find((x) => x.idx === s), { setCardPreferences: o } = M((x) => x.actions), m = (c == null ? void 0 : c.borderRadius) ?? 0, h = ((b = c == null ? void 0 : c.dataLabels) == null ? void 0 : b.enabled) ?? !1;
|
|
9748
|
+
function u(x) {
|
|
9749
9749
|
const f = {
|
|
9750
9750
|
idx: s,
|
|
9751
|
-
borderRadius:
|
|
9751
|
+
borderRadius: m,
|
|
9752
9752
|
// barBorderWidth: currentBorderWidth,
|
|
9753
9753
|
dataLabels: c == null ? void 0 : c.dataLabels,
|
|
9754
9754
|
...x
|
|
@@ -9769,7 +9769,7 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9769
9769
|
}
|
|
9770
9770
|
}
|
|
9771
9771
|
function p(x) {
|
|
9772
|
-
|
|
9772
|
+
u({
|
|
9773
9773
|
dataLabels: {
|
|
9774
9774
|
...c == null ? void 0 : c.dataLabels,
|
|
9775
9775
|
enabled: x
|
|
@@ -9777,7 +9777,7 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9777
9777
|
});
|
|
9778
9778
|
}
|
|
9779
9779
|
function k(x) {
|
|
9780
|
-
|
|
9780
|
+
u({
|
|
9781
9781
|
dataLabels: x
|
|
9782
9782
|
});
|
|
9783
9783
|
}
|
|
@@ -9795,7 +9795,7 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9795
9795
|
),
|
|
9796
9796
|
/* @__PURE__ */ e("span", { className: "max-w-[100px] truncate text-xs font-medium", title: t, children: t })
|
|
9797
9797
|
] }),
|
|
9798
|
-
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1.5", children:
|
|
9798
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1.5", children: m > 0 && /* @__PURE__ */ a(
|
|
9799
9799
|
"span",
|
|
9800
9800
|
{
|
|
9801
9801
|
className: Z(
|
|
@@ -9805,7 +9805,7 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9805
9805
|
children: [
|
|
9806
9806
|
/* @__PURE__ */ e(Bs, { className: "h-3 w-3" }),
|
|
9807
9807
|
"r:",
|
|
9808
|
-
|
|
9808
|
+
m
|
|
9809
9809
|
]
|
|
9810
9810
|
}
|
|
9811
9811
|
) })
|
|
@@ -9818,8 +9818,8 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9818
9818
|
/* @__PURE__ */ a(
|
|
9819
9819
|
H,
|
|
9820
9820
|
{
|
|
9821
|
-
value: String(
|
|
9822
|
-
onValueChange: (x) =>
|
|
9821
|
+
value: String(m),
|
|
9822
|
+
onValueChange: (x) => u({ borderRadius: Number(x) }),
|
|
9823
9823
|
children: [
|
|
9824
9824
|
/* @__PURE__ */ e(Y, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(W, {}) }),
|
|
9825
9825
|
/* @__PURE__ */ e(Q, { children: td.map((x) => /* @__PURE__ */ e(
|
|
@@ -9842,12 +9842,12 @@ function sd({ metricKey: t, idx: s }) {
|
|
|
9842
9842
|
/* @__PURE__ */ e(
|
|
9843
9843
|
Te,
|
|
9844
9844
|
{
|
|
9845
|
-
checked:
|
|
9845
|
+
checked: h,
|
|
9846
9846
|
onCheckedChange: p
|
|
9847
9847
|
}
|
|
9848
9848
|
)
|
|
9849
9849
|
] }),
|
|
9850
|
-
|
|
9850
|
+
h && /* @__PURE__ */ e("div", { className: "rounded-md border border-border bg-background p-2", children: /* @__PURE__ */ e(
|
|
9851
9851
|
$a,
|
|
9852
9852
|
{
|
|
9853
9853
|
config: c == null ? void 0 : c.dataLabels,
|
|
@@ -10193,12 +10193,12 @@ function xd(t) {
|
|
|
10193
10193
|
const [s, n] = q(""), [r, i] = q(null), { authToken: d, tokenProps: l } = La(), c = M((J) => {
|
|
10194
10194
|
var he;
|
|
10195
10195
|
return (he = J == null ? void 0 : J.card) == null ? void 0 : he.sql;
|
|
10196
|
-
}), o = M((J) => J.isDevMode),
|
|
10196
|
+
}), o = M((J) => J.isDevMode), m = M((J) => {
|
|
10197
10197
|
var he;
|
|
10198
10198
|
return (he = J == null ? void 0 : J.card) == null ? void 0 : he.python;
|
|
10199
10199
|
}), {
|
|
10200
|
-
setCardPython:
|
|
10201
|
-
setCardSql:
|
|
10200
|
+
setCardPython: h,
|
|
10201
|
+
setCardSql: u,
|
|
10202
10202
|
setRunSql: p,
|
|
10203
10203
|
switchCardType: k,
|
|
10204
10204
|
setQueryConfig: b
|
|
@@ -10275,7 +10275,7 @@ function xd(t) {
|
|
|
10275
10275
|
var he, Ue, Xe, Mt, Ze, xt, et, bt, Rt, lt, Lt, Ft, Pt, Vt, Nt, vt;
|
|
10276
10276
|
if (["createChartFromSql", "createForecast"].includes(J.toolName)) {
|
|
10277
10277
|
const se = ((he = J.input) == null ? void 0 : he.sql) ?? ((Ue = J.args) == null ? void 0 : Ue.sql), Se = ((Xe = J.input) == null ? void 0 : Xe.python) ?? ((Mt = J.args) == null ? void 0 : Mt.python), ke = ((Ze = J.input) == null ? void 0 : Ze.chartType) ?? ((xt = J.args) == null ? void 0 : xt.chartType);
|
|
10278
|
-
k(ke),
|
|
10278
|
+
k(ke), u(se), h(Se), p(!0), ae({
|
|
10279
10279
|
tool: J.toolName,
|
|
10280
10280
|
toolCallId: J.toolCallId,
|
|
10281
10281
|
output: {
|
|
@@ -10301,13 +10301,13 @@ function xd(t) {
|
|
|
10301
10301
|
output: {
|
|
10302
10302
|
status: "success",
|
|
10303
10303
|
sql: c,
|
|
10304
|
-
python:
|
|
10304
|
+
python: m || ""
|
|
10305
10305
|
}
|
|
10306
10306
|
});
|
|
10307
10307
|
} else if (J.toolName === "generateQueryConfig") {
|
|
10308
10308
|
n("Generating query config...");
|
|
10309
10309
|
const se = ((et = J.input) == null ? void 0 : et.chartType) ?? ((bt = J.args) == null ? void 0 : bt.chartType), Se = ((Rt = J.input) == null ? void 0 : Rt.queryConfig) ?? ((lt = J.args) == null ? void 0 : lt.queryConfig);
|
|
10310
|
-
((Lt = J.input) == null ? void 0 : Lt.cardConfig) ?? ((Ft = J.args) == null || Ft.cardConfig), k(se), O(Se),
|
|
10310
|
+
((Lt = J.input) == null ? void 0 : Lt.cardConfig) ?? ((Ft = J.args) == null || Ft.cardConfig), k(se), O(Se), u(void 0), h(void 0);
|
|
10311
10311
|
const ke = await E();
|
|
10312
10312
|
if ((Pt = ke == null ? void 0 : ke.data) != null && Pt.error) {
|
|
10313
10313
|
ae({
|
|
@@ -10440,7 +10440,7 @@ function ps({
|
|
|
10440
10440
|
onFullscreenChange: s,
|
|
10441
10441
|
fullscreenContainer: n
|
|
10442
10442
|
}) {
|
|
10443
|
-
const r = Pe(null), [i, d] = q(!1), [l, c] = q(zs), [o,
|
|
10443
|
+
const r = Pe(null), [i, d] = q(!1), [l, c] = q(zs), [o, m] = q(!1), [h, u] = q(!1), [p, k] = q(!1), b = t ?? p, x = Hr(), { setCurrentAIContext: f } = js(), { clearQueue: g } = Yr(), { clearFileAttachments: v } = Wr(), F = Qr("editor"), I = ye((se) => se.dashboard.aiContext), C = M((se) => se.card.dataSource), T = M((se) => se.actions.setCardSql), y = M((se) => se.actions.setRunSql), w = M((se) => se.showAIDialog), E = ye(
|
|
10444
10444
|
(se) => se.handleOpenAssistantProfile
|
|
10445
10445
|
), { setShowAIDialog: P, setCardPython: N } = ne(), { setDataSource: S } = ne(), { assistantProfile: O } = Xr(), {
|
|
10446
10446
|
messages: V,
|
|
@@ -10600,7 +10600,7 @@ function ps({
|
|
|
10600
10600
|
ot,
|
|
10601
10601
|
{
|
|
10602
10602
|
checked: o,
|
|
10603
|
-
onCheckedChange:
|
|
10603
|
+
onCheckedChange: m,
|
|
10604
10604
|
children: "System Message"
|
|
10605
10605
|
}
|
|
10606
10606
|
)
|
|
@@ -10791,8 +10791,8 @@ function ps({
|
|
|
10791
10791
|
Ss,
|
|
10792
10792
|
{
|
|
10793
10793
|
incomingSelectedEntities: (C == null ? void 0 : C.selectedEntities) || [],
|
|
10794
|
-
open:
|
|
10795
|
-
onOpenChange:
|
|
10794
|
+
open: h,
|
|
10795
|
+
onOpenChange: u,
|
|
10796
10796
|
dataSource: C || qs,
|
|
10797
10797
|
dialogMode: "aiContext"
|
|
10798
10798
|
}
|
|
@@ -10813,7 +10813,7 @@ function Nd({
|
|
|
10813
10813
|
var o;
|
|
10814
10814
|
if (t === "custom")
|
|
10815
10815
|
return ((o = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : o.componentName) || "Custom Visual";
|
|
10816
|
-
const c = Wn.find((
|
|
10816
|
+
const c = Wn.find((m) => m.id === t);
|
|
10817
10817
|
return (c == null ? void 0 : c.label) || "Select chart type";
|
|
10818
10818
|
};
|
|
10819
10819
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ a(Je, { open: n, onOpenChange: r, children: [
|
|
@@ -10829,13 +10829,13 @@ function Nd({
|
|
|
10829
10829
|
(() => {
|
|
10830
10830
|
var o;
|
|
10831
10831
|
if (t === "custom") {
|
|
10832
|
-
const
|
|
10833
|
-
if (
|
|
10834
|
-
const
|
|
10835
|
-
return
|
|
10832
|
+
const m = (o = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : o.componentName;
|
|
10833
|
+
if (m) {
|
|
10834
|
+
const h = hi(m);
|
|
10835
|
+
return h || /* @__PURE__ */ e(
|
|
10836
10836
|
Is,
|
|
10837
10837
|
{
|
|
10838
|
-
chartName:
|
|
10838
|
+
chartName: m,
|
|
10839
10839
|
isCustom: !0,
|
|
10840
10840
|
className: "h-4 w-4"
|
|
10841
10841
|
}
|
|
@@ -10843,10 +10843,10 @@ function Nd({
|
|
|
10843
10843
|
}
|
|
10844
10844
|
return /* @__PURE__ */ e(Yn, { className: "h-4 w-4" });
|
|
10845
10845
|
}
|
|
10846
|
-
const c = Wn.find((
|
|
10846
|
+
const c = Wn.find((m) => m.id === t);
|
|
10847
10847
|
if (c) {
|
|
10848
|
-
const
|
|
10849
|
-
return /* @__PURE__ */ e(
|
|
10848
|
+
const m = c.icon;
|
|
10849
|
+
return /* @__PURE__ */ e(m, { className: "h-4 w-4" });
|
|
10850
10850
|
}
|
|
10851
10851
|
return /* @__PURE__ */ e(Yn, { className: "h-4 w-4" });
|
|
10852
10852
|
})(),
|
|
@@ -10942,24 +10942,24 @@ const ka = [
|
|
|
10942
10942
|
}
|
|
10943
10943
|
];
|
|
10944
10944
|
function yd(t, s, n, r, i, d, l, c, o) {
|
|
10945
|
-
const
|
|
10946
|
-
if (!
|
|
10945
|
+
const m = ka.find((x) => x.id === s);
|
|
10946
|
+
if (!m)
|
|
10947
10947
|
throw new Error(`Unknown operation: ${s}`);
|
|
10948
|
-
let
|
|
10948
|
+
let h, u = [], p;
|
|
10949
10949
|
if (s === "custom") {
|
|
10950
10950
|
if (!(c != null && c.trim()))
|
|
10951
10951
|
throw new Error("Custom expression is required");
|
|
10952
|
-
|
|
10952
|
+
h = c.trim();
|
|
10953
10953
|
} else if (s === "scale") {
|
|
10954
10954
|
if (!n)
|
|
10955
10955
|
throw new Error("Metric A is required for scale operation");
|
|
10956
10956
|
if (o === void 0 || o === 0)
|
|
10957
10957
|
throw new Error("Constant factor is required for scale operation");
|
|
10958
|
-
|
|
10958
|
+
h = m.template().replace("{constant}", String(o)), u = [n], p = o;
|
|
10959
10959
|
} else {
|
|
10960
10960
|
if (!n || !r)
|
|
10961
10961
|
throw new Error("Metrics A and B are required for standard operations");
|
|
10962
|
-
|
|
10962
|
+
h = m.template(), u = [
|
|
10963
10963
|
n,
|
|
10964
10964
|
// Full MetricField object with all metadata
|
|
10965
10965
|
r
|
|
@@ -10968,7 +10968,7 @@ function yd(t, s, n, r, i, d, l, c, o) {
|
|
|
10968
10968
|
}
|
|
10969
10969
|
const k = {
|
|
10970
10970
|
operation: s,
|
|
10971
|
-
inputFields:
|
|
10971
|
+
inputFields: u,
|
|
10972
10972
|
// Full MetricField objects with all metadata
|
|
10973
10973
|
...p !== void 0 && { constant: p }
|
|
10974
10974
|
// Include constant if present
|
|
@@ -10983,7 +10983,7 @@ function yd(t, s, n, r, i, d, l, c, o) {
|
|
|
10983
10983
|
role: "metric",
|
|
10984
10984
|
aggregate: "SUM",
|
|
10985
10985
|
// Default aggregate for calculated fields
|
|
10986
|
-
expression:
|
|
10986
|
+
expression: h,
|
|
10987
10987
|
// ← Generated with tokens
|
|
10988
10988
|
calculatedFormula: k,
|
|
10989
10989
|
// ← Generated from same inputs
|
|
@@ -11012,9 +11012,9 @@ function Cd({
|
|
|
11012
11012
|
onAliasTemplateChange: s
|
|
11013
11013
|
}) {
|
|
11014
11014
|
var o;
|
|
11015
|
-
const [n, r] = q(t), [i, d] = q(!1), l = (o = M((
|
|
11016
|
-
var
|
|
11017
|
-
return (
|
|
11015
|
+
const [n, r] = q(t), [i, d] = q(!1), l = (o = M((m) => {
|
|
11016
|
+
var h;
|
|
11017
|
+
return (h = m.card.config) == null ? void 0 : h.pivotByColumns;
|
|
11018
11018
|
})) == null ? void 0 : o[0], c = l ? `e.g. Min Sales in {{${l.name}}}` : "e.g. Min Sales in {{region}}";
|
|
11019
11019
|
return /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
11020
11020
|
/* @__PURE__ */ e(L, { className: "text-xs font-medium text-gray-600", children: "Pivot Alias Template" }),
|
|
@@ -11024,14 +11024,14 @@ function Cd({
|
|
|
11024
11024
|
{
|
|
11025
11025
|
placeholder: c,
|
|
11026
11026
|
value: i ? n : t,
|
|
11027
|
-
onChange: (
|
|
11028
|
-
r(
|
|
11027
|
+
onChange: (m) => {
|
|
11028
|
+
r(m.target.value), d(!0);
|
|
11029
11029
|
},
|
|
11030
11030
|
onFocus: () => d(!0),
|
|
11031
|
-
onPointerDown: (
|
|
11031
|
+
onPointerDown: (m) => m.stopPropagation(),
|
|
11032
11032
|
className: "h-8 text-xs",
|
|
11033
|
-
onKeyDown: (
|
|
11034
|
-
|
|
11033
|
+
onKeyDown: (m) => {
|
|
11034
|
+
m.key === "Enter" && i && n !== t ? (s(n), d(!1)) : m.key === "Escape" && (r(t), d(!1));
|
|
11035
11035
|
},
|
|
11036
11036
|
"aria-label": "Edit alias template"
|
|
11037
11037
|
}
|
|
@@ -11073,17 +11073,17 @@ function wd({
|
|
|
11073
11073
|
}) {
|
|
11074
11074
|
const [n, r] = q(null), [i, d] = q(""), [l, c] = q(""), o = () => {
|
|
11075
11075
|
s({ ...t, "": "" });
|
|
11076
|
-
},
|
|
11076
|
+
}, m = (u) => {
|
|
11077
11077
|
const p = { ...t };
|
|
11078
|
-
delete p[
|
|
11079
|
-
},
|
|
11078
|
+
delete p[u], s(p);
|
|
11079
|
+
}, h = (u) => {
|
|
11080
11080
|
const p = { ...t };
|
|
11081
|
-
delete p[
|
|
11081
|
+
delete p[u], p[i] = l, s(p), r(null);
|
|
11082
11082
|
};
|
|
11083
11083
|
return /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
11084
11084
|
/* @__PURE__ */ e(L, { className: "text-xs font-medium text-muted-foreground", children: "Pivot Value Aliases" }),
|
|
11085
11085
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
11086
|
-
Object.entries(t).map(([
|
|
11086
|
+
Object.entries(t).map(([u, p], k) => /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: n === u ? /* @__PURE__ */ a(ce, { children: [
|
|
11087
11087
|
/* @__PURE__ */ e(
|
|
11088
11088
|
$e,
|
|
11089
11089
|
{
|
|
@@ -11093,7 +11093,7 @@ function wd({
|
|
|
11093
11093
|
className: "h-8 w-24 text-xs",
|
|
11094
11094
|
onPointerDown: (b) => b.stopPropagation(),
|
|
11095
11095
|
onKeyDown: (b) => {
|
|
11096
|
-
b.key === "Enter" ?
|
|
11096
|
+
b.key === "Enter" ? h(u) : b.key === "Escape" && r(null);
|
|
11097
11097
|
},
|
|
11098
11098
|
"aria-label": "Edit value alias key"
|
|
11099
11099
|
}
|
|
@@ -11107,7 +11107,7 @@ function wd({
|
|
|
11107
11107
|
className: "h-8 w-24 text-xs",
|
|
11108
11108
|
onPointerDown: (b) => b.stopPropagation(),
|
|
11109
11109
|
onKeyDown: (b) => {
|
|
11110
|
-
b.key === "Enter" ?
|
|
11110
|
+
b.key === "Enter" ? h(u) : b.key === "Escape" && r(null);
|
|
11111
11111
|
},
|
|
11112
11112
|
"aria-label": "Edit value alias label"
|
|
11113
11113
|
}
|
|
@@ -11119,7 +11119,7 @@ function wd({
|
|
|
11119
11119
|
size: "icon",
|
|
11120
11120
|
className: "h-6 w-6 p-0",
|
|
11121
11121
|
"aria-label": "Confirm value alias edit",
|
|
11122
|
-
onClick: () =>
|
|
11122
|
+
onClick: () => h(u),
|
|
11123
11123
|
children: /* @__PURE__ */ e(na, { className: "h-4 w-4 text-green-600" })
|
|
11124
11124
|
}
|
|
11125
11125
|
),
|
|
@@ -11139,11 +11139,11 @@ function wd({
|
|
|
11139
11139
|
$e,
|
|
11140
11140
|
{
|
|
11141
11141
|
placeholder: "Value key",
|
|
11142
|
-
value:
|
|
11142
|
+
value: u,
|
|
11143
11143
|
className: "h-8 w-24 text-xs",
|
|
11144
11144
|
readOnly: !0,
|
|
11145
11145
|
onClick: () => {
|
|
11146
|
-
r(
|
|
11146
|
+
r(u), d(u), c(p);
|
|
11147
11147
|
},
|
|
11148
11148
|
"aria-label": "Edit value alias key"
|
|
11149
11149
|
}
|
|
@@ -11156,7 +11156,7 @@ function wd({
|
|
|
11156
11156
|
className: "h-8 w-24 text-xs",
|
|
11157
11157
|
readOnly: !0,
|
|
11158
11158
|
onClick: () => {
|
|
11159
|
-
r(
|
|
11159
|
+
r(u), d(u), c(p);
|
|
11160
11160
|
},
|
|
11161
11161
|
"aria-label": "Edit value alias label"
|
|
11162
11162
|
}
|
|
@@ -11167,12 +11167,12 @@ function wd({
|
|
|
11167
11167
|
variant: "ghost",
|
|
11168
11168
|
size: "sm",
|
|
11169
11169
|
className: "h-8 w-8 p-0",
|
|
11170
|
-
onClick: () => u
|
|
11170
|
+
onClick: () => m(u),
|
|
11171
11171
|
"aria-label": "Remove value alias",
|
|
11172
11172
|
children: /* @__PURE__ */ e(Ae, { className: "h-3 w-3" })
|
|
11173
11173
|
}
|
|
11174
11174
|
)
|
|
11175
|
-
] }) },
|
|
11175
|
+
] }) }, u + k)),
|
|
11176
11176
|
/* @__PURE__ */ a(
|
|
11177
11177
|
K,
|
|
11178
11178
|
{
|
|
@@ -11192,19 +11192,19 @@ function wd({
|
|
|
11192
11192
|
function Sd({ idx: t }) {
|
|
11193
11193
|
var c;
|
|
11194
11194
|
const s = M((o) => {
|
|
11195
|
-
var
|
|
11196
|
-
return (
|
|
11195
|
+
var m;
|
|
11196
|
+
return (m = o.card) == null ? void 0 : m.preferences;
|
|
11197
11197
|
}), n = M(
|
|
11198
11198
|
(o) => {
|
|
11199
|
-
var
|
|
11200
|
-
return (
|
|
11199
|
+
var m;
|
|
11200
|
+
return (m = o.card.preferences) == null ? void 0 : m.datasetOptions;
|
|
11201
11201
|
}
|
|
11202
11202
|
), r = M(
|
|
11203
11203
|
(o) => o.actions.setCardPreferences
|
|
11204
11204
|
), i = (c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis, d = n == null ? void 0 : n.find((o) => o.idx === t);
|
|
11205
|
-
function l(o,
|
|
11205
|
+
function l(o, m) {
|
|
11206
11206
|
(o === "end" || o === "start") && xi(bi());
|
|
11207
|
-
const
|
|
11207
|
+
const h = {
|
|
11208
11208
|
display: o !== "none",
|
|
11209
11209
|
align: o,
|
|
11210
11210
|
anchor: o,
|
|
@@ -11216,16 +11216,16 @@ function Sd({ idx: t }) {
|
|
|
11216
11216
|
datasetOptions: [
|
|
11217
11217
|
...n || [],
|
|
11218
11218
|
{
|
|
11219
|
-
idx:
|
|
11220
|
-
datalabels:
|
|
11219
|
+
idx: m,
|
|
11220
|
+
datalabels: h
|
|
11221
11221
|
}
|
|
11222
11222
|
]
|
|
11223
11223
|
});
|
|
11224
11224
|
else {
|
|
11225
|
-
const
|
|
11226
|
-
|
|
11225
|
+
const u = { ...d };
|
|
11226
|
+
u.datalabels = h;
|
|
11227
11227
|
const p = n == null ? void 0 : n.map(
|
|
11228
|
-
(k) => k.idx ===
|
|
11228
|
+
(k) => k.idx === m ? u : k
|
|
11229
11229
|
);
|
|
11230
11230
|
r({
|
|
11231
11231
|
...s,
|
|
@@ -11321,16 +11321,16 @@ function Td({
|
|
|
11321
11321
|
iconClassName: r,
|
|
11322
11322
|
children: i
|
|
11323
11323
|
}) {
|
|
11324
|
-
const d = M((
|
|
11325
|
-
var
|
|
11326
|
-
return (
|
|
11324
|
+
const d = M((h) => {
|
|
11325
|
+
var u;
|
|
11326
|
+
return (u = h.card) == null ? void 0 : u.preferences;
|
|
11327
11327
|
}), l = M(
|
|
11328
|
-
(
|
|
11329
|
-
var
|
|
11330
|
-
return (p = (
|
|
11328
|
+
(h) => {
|
|
11329
|
+
var u, p;
|
|
11330
|
+
return (p = (u = h.card) == null ? void 0 : u.preferences) == null ? void 0 : p.datasetOptions;
|
|
11331
11331
|
}
|
|
11332
|
-
), c = l == null ? void 0 : l.find((
|
|
11333
|
-
function
|
|
11332
|
+
), c = l == null ? void 0 : l.find((h) => h.idx === s), { setCardPreferences: o } = M((h) => h.actions);
|
|
11333
|
+
function m(h) {
|
|
11334
11334
|
if (!c)
|
|
11335
11335
|
o({
|
|
11336
11336
|
...d,
|
|
@@ -11338,16 +11338,16 @@ function Td({
|
|
|
11338
11338
|
...l || [],
|
|
11339
11339
|
{
|
|
11340
11340
|
idx: s,
|
|
11341
|
-
type:
|
|
11342
|
-
fill:
|
|
11341
|
+
type: h === "area" ? "line" : h,
|
|
11342
|
+
fill: h === "area" ? "origin" : ""
|
|
11343
11343
|
}
|
|
11344
11344
|
]
|
|
11345
11345
|
});
|
|
11346
11346
|
else {
|
|
11347
|
-
const
|
|
11348
|
-
|
|
11347
|
+
const u = { ...c };
|
|
11348
|
+
u.type = h === "area" ? "line" : h, u.fill = h === "area" ? "origin" : "";
|
|
11349
11349
|
const p = l == null ? void 0 : l.map(
|
|
11350
|
-
(k) => k.idx === s ?
|
|
11350
|
+
(k) => k.idx === s ? u : k
|
|
11351
11351
|
);
|
|
11352
11352
|
o({
|
|
11353
11353
|
...d,
|
|
@@ -11368,7 +11368,7 @@ function Td({
|
|
|
11368
11368
|
/* @__PURE__ */ e(
|
|
11369
11369
|
kn,
|
|
11370
11370
|
{
|
|
11371
|
-
onClick: () =>
|
|
11371
|
+
onClick: () => m("bar"),
|
|
11372
11372
|
className: Z(
|
|
11373
11373
|
"size-4 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
11374
11374
|
r
|
|
@@ -11378,7 +11378,7 @@ function Td({
|
|
|
11378
11378
|
/* @__PURE__ */ e(
|
|
11379
11379
|
Sn,
|
|
11380
11380
|
{
|
|
11381
|
-
onClick: () =>
|
|
11381
|
+
onClick: () => m("line"),
|
|
11382
11382
|
className: Z(
|
|
11383
11383
|
"size-4 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
11384
11384
|
r
|
|
@@ -11388,7 +11388,7 @@ function Td({
|
|
|
11388
11388
|
/* @__PURE__ */ e(
|
|
11389
11389
|
Vs,
|
|
11390
11390
|
{
|
|
11391
|
-
onClick: () =>
|
|
11391
|
+
onClick: () => m("area"),
|
|
11392
11392
|
className: Z(
|
|
11393
11393
|
"size-4 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
11394
11394
|
r
|
|
@@ -11404,7 +11404,7 @@ function Td({
|
|
|
11404
11404
|
function Ad() {
|
|
11405
11405
|
const t = M((c) => c.card.type), s = M((c) => c.isDevMode), n = M((c) => c.card.preferences), { setCardPreferences: r } = M((c) => c.actions);
|
|
11406
11406
|
function i(c) {
|
|
11407
|
-
var
|
|
11407
|
+
var h;
|
|
11408
11408
|
const o = {
|
|
11409
11409
|
datalabels: {
|
|
11410
11410
|
display: c !== "none",
|
|
@@ -11412,26 +11412,26 @@ function Ad() {
|
|
|
11412
11412
|
anchor: c,
|
|
11413
11413
|
clamp: !0
|
|
11414
11414
|
}
|
|
11415
|
-
},
|
|
11415
|
+
}, m = {
|
|
11416
11416
|
...n,
|
|
11417
11417
|
chartOptions: {
|
|
11418
11418
|
...n == null ? void 0 : n.chartOptions,
|
|
11419
11419
|
plugins: {
|
|
11420
|
-
...(
|
|
11420
|
+
...(h = n == null ? void 0 : n.chartOptions) == null ? void 0 : h.plugins,
|
|
11421
11421
|
...o
|
|
11422
11422
|
}
|
|
11423
11423
|
}
|
|
11424
11424
|
};
|
|
11425
|
-
r(
|
|
11425
|
+
r(m);
|
|
11426
11426
|
}
|
|
11427
11427
|
function d() {
|
|
11428
|
-
var c, o,
|
|
11428
|
+
var c, o, m;
|
|
11429
11429
|
return /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
11430
11430
|
/* @__PURE__ */ e("label", { className: "font-medium", children: "Data Labels" }),
|
|
11431
11431
|
/* @__PURE__ */ a(
|
|
11432
11432
|
H,
|
|
11433
11433
|
{
|
|
11434
|
-
value: ((
|
|
11434
|
+
value: ((m = (o = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : m.anchor) || "none",
|
|
11435
11435
|
onValueChange: i,
|
|
11436
11436
|
defaultValue: "none",
|
|
11437
11437
|
children: [
|
|
@@ -11449,11 +11449,11 @@ function Ad() {
|
|
|
11449
11449
|
] });
|
|
11450
11450
|
}
|
|
11451
11451
|
function l() {
|
|
11452
|
-
var c, o,
|
|
11452
|
+
var c, o, m;
|
|
11453
11453
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ a(
|
|
11454
11454
|
H,
|
|
11455
11455
|
{
|
|
11456
|
-
value: ((
|
|
11456
|
+
value: ((m = (o = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : m.anchor) || "none",
|
|
11457
11457
|
onValueChange: i,
|
|
11458
11458
|
defaultValue: "none",
|
|
11459
11459
|
children: [
|
|
@@ -11475,8 +11475,8 @@ function Ed({
|
|
|
11475
11475
|
}) {
|
|
11476
11476
|
const s = M((o) => o.card.type), n = M(
|
|
11477
11477
|
(o) => {
|
|
11478
|
-
var
|
|
11479
|
-
return (
|
|
11478
|
+
var m, h;
|
|
11479
|
+
return (h = (m = o.card) == null ? void 0 : m.config) == null ? void 0 : h.metricColumns;
|
|
11480
11480
|
}
|
|
11481
11481
|
), r = (n == null ? void 0 : n.map((o) => o.label)) || [], i = r == null ? void 0 : r.find(
|
|
11482
11482
|
(o) => o === t.label || o === t.name
|
|
@@ -11500,7 +11500,7 @@ function Dd({
|
|
|
11500
11500
|
searchQuery: s = "",
|
|
11501
11501
|
limit: n = 500
|
|
11502
11502
|
}) {
|
|
11503
|
-
const { authToken: r, tokenProps: i } = La(), d = M((
|
|
11503
|
+
const { authToken: r, tokenProps: i } = La(), d = M((m) => m.card), l = d == null ? void 0 : d.dataSource, c = [
|
|
11504
11504
|
"attribute-values",
|
|
11505
11505
|
t.entityName,
|
|
11506
11506
|
t.name,
|
|
@@ -11512,7 +11512,7 @@ function Dd({
|
|
|
11512
11512
|
if (!(l != null && l.connectionId))
|
|
11513
11513
|
return console.warn("No connection ID available for attribute values query"), [];
|
|
11514
11514
|
try {
|
|
11515
|
-
const
|
|
11515
|
+
const m = {
|
|
11516
11516
|
groupByColumns: [
|
|
11517
11517
|
{
|
|
11518
11518
|
...t,
|
|
@@ -11536,22 +11536,22 @@ function Dd({
|
|
|
11536
11536
|
groups: []
|
|
11537
11537
|
} : void 0,
|
|
11538
11538
|
rowLimit: n
|
|
11539
|
-
},
|
|
11539
|
+
}, h = {
|
|
11540
11540
|
connection_id: l.connectionId,
|
|
11541
|
-
cardConfig:
|
|
11541
|
+
cardConfig: m,
|
|
11542
11542
|
cardDataSource: l,
|
|
11543
11543
|
cache_config: Ni({ card: d })
|
|
11544
11544
|
};
|
|
11545
|
-
console.log("requestBody",
|
|
11546
|
-
const
|
|
11545
|
+
console.log("requestBody", h);
|
|
11546
|
+
const u = await Gs(
|
|
11547
11547
|
`${i.apiServiceUrl}/v1/query`,
|
|
11548
11548
|
(r == null ? void 0 : r.accessToken) || "",
|
|
11549
|
-
|
|
11549
|
+
h
|
|
11550
11550
|
);
|
|
11551
|
-
if (
|
|
11552
|
-
return console.error("Error fetching attribute values:",
|
|
11551
|
+
if (u != null && u.error)
|
|
11552
|
+
return console.error("Error fetching attribute values:", u.error), [];
|
|
11553
11553
|
const p = t.name;
|
|
11554
|
-
return ((
|
|
11554
|
+
return ((u == null ? void 0 : u.records) || []).map(
|
|
11555
11555
|
(b) => {
|
|
11556
11556
|
const x = b[p] || b[t.alias || p] || b[t.label];
|
|
11557
11557
|
return {
|
|
@@ -11561,8 +11561,8 @@ function Dd({
|
|
|
11561
11561
|
};
|
|
11562
11562
|
}
|
|
11563
11563
|
);
|
|
11564
|
-
} catch (
|
|
11565
|
-
return console.error("Error fetching attribute values:",
|
|
11564
|
+
} catch (m) {
|
|
11565
|
+
return console.error("Error fetching attribute values:", m), [];
|
|
11566
11566
|
}
|
|
11567
11567
|
},
|
|
11568
11568
|
enabled: !!t && !!(l != null && l.connectionId),
|
|
@@ -11589,7 +11589,7 @@ function hl({
|
|
|
11589
11589
|
onSave: d
|
|
11590
11590
|
}) {
|
|
11591
11591
|
var F, I;
|
|
11592
|
-
const l = !!i, [c, o] = q(l ? "values" : "fields"), [
|
|
11592
|
+
const l = !!i, [c, o] = q(l ? "values" : "fields"), [m, h] = q(""), [u, p] = q({
|
|
11593
11593
|
id: (i == null ? void 0 : i.id) || zt(),
|
|
11594
11594
|
field: (i == null ? void 0 : i.field) || null,
|
|
11595
11595
|
selectedValues: i ? Array.isArray(i.value) ? i.value : [i.value] : []
|
|
@@ -11597,19 +11597,19 @@ function hl({
|
|
|
11597
11597
|
var y;
|
|
11598
11598
|
return l ? !1 : !((y = r == null ? void 0 : r.conditions) == null ? void 0 : y.some(
|
|
11599
11599
|
(w) => w.field.id === C.id
|
|
11600
|
-
)) && C.label.toLowerCase().includes(
|
|
11600
|
+
)) && C.label.toLowerCase().includes(m.toLowerCase());
|
|
11601
11601
|
}), b = (C) => {
|
|
11602
11602
|
p({
|
|
11603
|
-
...
|
|
11603
|
+
...u,
|
|
11604
11604
|
field: C
|
|
11605
11605
|
}), o("values");
|
|
11606
11606
|
}, x = () => {
|
|
11607
|
-
if (
|
|
11607
|
+
if (u.field && u.selectedValues.length > 0) {
|
|
11608
11608
|
const C = {
|
|
11609
|
-
id:
|
|
11610
|
-
field:
|
|
11609
|
+
id: u.id,
|
|
11610
|
+
field: u.field,
|
|
11611
11611
|
operator: "in",
|
|
11612
|
-
value:
|
|
11612
|
+
value: u.selectedValues
|
|
11613
11613
|
};
|
|
11614
11614
|
let T;
|
|
11615
11615
|
if (l) {
|
|
@@ -11648,7 +11648,7 @@ function hl({
|
|
|
11648
11648
|
s(!1);
|
|
11649
11649
|
}, g = (C) => {
|
|
11650
11650
|
p({
|
|
11651
|
-
...
|
|
11651
|
+
...u,
|
|
11652
11652
|
selectedValues: C
|
|
11653
11653
|
});
|
|
11654
11654
|
}, v = () => {
|
|
@@ -11660,12 +11660,12 @@ function hl({
|
|
|
11660
11660
|
id: zt(),
|
|
11661
11661
|
field: null,
|
|
11662
11662
|
selectedValues: []
|
|
11663
|
-
}), o("fields")),
|
|
11663
|
+
}), o("fields")), h("");
|
|
11664
11664
|
};
|
|
11665
11665
|
return ue(() => {
|
|
11666
11666
|
t && v();
|
|
11667
11667
|
}, [t, l, i]), /* @__PURE__ */ e(St, { open: t, onOpenChange: s, children: /* @__PURE__ */ a(kt, { className: "max-w-2xl", children: [
|
|
11668
|
-
/* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(At, { children: l ? `Edit Filter: ${(F =
|
|
11668
|
+
/* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(At, { children: l ? `Edit Filter: ${(F = u.field) == null ? void 0 : F.label}` : c === "fields" ? "Select Field to Filter" : `Select Values for ${(I = u.field) == null ? void 0 : I.label}` }) }),
|
|
11669
11669
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
11670
11670
|
!l && (r == null ? void 0 : r.conditions) && r.conditions.length > 0 && c === "fields" && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
11671
11671
|
/* @__PURE__ */ e(L, { className: "text-xs font-medium text-muted-foreground", children: "Current Filters:" }),
|
|
@@ -11691,8 +11691,8 @@ function hl({
|
|
|
11691
11691
|
$e,
|
|
11692
11692
|
{
|
|
11693
11693
|
placeholder: "Search fields...",
|
|
11694
|
-
value:
|
|
11695
|
-
onChange: (C) =>
|
|
11694
|
+
value: m,
|
|
11695
|
+
onChange: (C) => h(C.target.value),
|
|
11696
11696
|
className: "pl-10"
|
|
11697
11697
|
}
|
|
11698
11698
|
)
|
|
@@ -11717,17 +11717,17 @@ function hl({
|
|
|
11717
11717
|
},
|
|
11718
11718
|
C.id
|
|
11719
11719
|
)) }),
|
|
11720
|
-
k.length === 0 &&
|
|
11720
|
+
k.length === 0 && m && /* @__PURE__ */ a("div", { className: "text-center py-4 text-sm text-muted-foreground", children: [
|
|
11721
11721
|
'No fields found matching "',
|
|
11722
|
-
|
|
11722
|
+
m,
|
|
11723
11723
|
'"'
|
|
11724
11724
|
] }),
|
|
11725
|
-
k.length === 0 && !
|
|
11725
|
+
k.length === 0 && !m && n.length > 0 && /* @__PURE__ */ e("div", { className: "text-center py-4 text-sm text-muted-foreground", children: "All available fields are already filtered" })
|
|
11726
11726
|
] }) : /* @__PURE__ */ e(
|
|
11727
11727
|
Od,
|
|
11728
11728
|
{
|
|
11729
|
-
field:
|
|
11730
|
-
selectedValues:
|
|
11729
|
+
field: u.field,
|
|
11730
|
+
selectedValues: u.selectedValues,
|
|
11731
11731
|
onValuesChange: g,
|
|
11732
11732
|
onBack: l ? void 0 : () => o("fields")
|
|
11733
11733
|
}
|
|
@@ -11740,7 +11740,7 @@ function hl({
|
|
|
11740
11740
|
K,
|
|
11741
11741
|
{
|
|
11742
11742
|
onClick: x,
|
|
11743
|
-
disabled: !
|
|
11743
|
+
disabled: !u.field || u.selectedValues.length === 0,
|
|
11744
11744
|
children: "Apply"
|
|
11745
11745
|
}
|
|
11746
11746
|
)
|
|
@@ -11763,13 +11763,13 @@ function Od({
|
|
|
11763
11763
|
field: t,
|
|
11764
11764
|
searchQuery: i,
|
|
11765
11765
|
limit: 500
|
|
11766
|
-
}),
|
|
11766
|
+
}), m = i ? l.filter(
|
|
11767
11767
|
(p) => String(p.value).toLowerCase().includes(i.toLowerCase())
|
|
11768
|
-
) : l,
|
|
11768
|
+
) : l, h = (p) => {
|
|
11769
11769
|
const k = s.includes(p);
|
|
11770
11770
|
n(k ? s.filter((b) => b !== p) : [...s, p]);
|
|
11771
|
-
},
|
|
11772
|
-
s.length ===
|
|
11771
|
+
}, u = () => {
|
|
11772
|
+
s.length === m.length && m.length > 0 ? n([]) : n(m.map((p) => p.value));
|
|
11773
11773
|
};
|
|
11774
11774
|
return /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
11775
11775
|
r && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
@@ -11796,27 +11796,27 @@ function Od({
|
|
|
11796
11796
|
/* @__PURE__ */ e(
|
|
11797
11797
|
_e,
|
|
11798
11798
|
{
|
|
11799
|
-
checked: s.length ===
|
|
11800
|
-
onCheckedChange:
|
|
11799
|
+
checked: s.length === m.length && m.length > 0,
|
|
11800
|
+
onCheckedChange: u
|
|
11801
11801
|
}
|
|
11802
11802
|
),
|
|
11803
11803
|
/* @__PURE__ */ a(L, { className: "text-sm", children: [
|
|
11804
11804
|
"Select All (",
|
|
11805
|
-
|
|
11805
|
+
m.length,
|
|
11806
11806
|
")"
|
|
11807
11807
|
] })
|
|
11808
11808
|
] }),
|
|
11809
|
-
/* @__PURE__ */ e("div", { className: "max-h-[300px] overflow-y-auto space-y-1", children:
|
|
11809
|
+
/* @__PURE__ */ e("div", { className: "max-h-[300px] overflow-y-auto space-y-1", children: m.map((p) => /* @__PURE__ */ a(
|
|
11810
11810
|
"div",
|
|
11811
11811
|
{
|
|
11812
11812
|
className: "flex items-center gap-2 p-2 hover:bg-muted/50 rounded cursor-pointer",
|
|
11813
|
-
onClick: () =>
|
|
11813
|
+
onClick: () => h(p.value),
|
|
11814
11814
|
children: [
|
|
11815
11815
|
/* @__PURE__ */ e(
|
|
11816
11816
|
_e,
|
|
11817
11817
|
{
|
|
11818
11818
|
checked: s.includes(p.value),
|
|
11819
|
-
onCheckedChange: () =>
|
|
11819
|
+
onCheckedChange: () => h(p.value)
|
|
11820
11820
|
}
|
|
11821
11821
|
),
|
|
11822
11822
|
/* @__PURE__ */ e(Ln, { className: "text-sm", children: p.label })
|
|
@@ -11835,14 +11835,14 @@ function pl({
|
|
|
11835
11835
|
onSave: i,
|
|
11836
11836
|
cardId: d
|
|
11837
11837
|
}) {
|
|
11838
|
-
const [l, c] = q(""), [o,
|
|
11838
|
+
const [l, c] = q(""), [o, m] = q("ratio"), [h, u] = q(null), [p, k] = q(null), [b, x] = q(1), [f, g] = q(""), [v, F] = q({
|
|
11839
11839
|
format: "number",
|
|
11840
11840
|
decimalPlaces: 2
|
|
11841
|
-
}), [I, C] = q({}), T = ka.find((S) => S.id === o), y = n.find((S) => S.id ===
|
|
11841
|
+
}), [I, C] = q({}), T = ka.find((S) => S.id === o), y = n.find((S) => S.id === h), w = n.find((S) => S.id === p);
|
|
11842
11842
|
ue(() => {
|
|
11843
11843
|
if (r && t)
|
|
11844
11844
|
if (c(r.label), r.calculatedFormula)
|
|
11845
|
-
if (
|
|
11845
|
+
if (m(r.calculatedFormula.operation), r.calculatedFormula.operation === "custom")
|
|
11846
11846
|
g(r.expression || "");
|
|
11847
11847
|
else if (r.calculatedFormula.operation === "scale") {
|
|
11848
11848
|
const S = r.calculatedFormula.inputFields;
|
|
@@ -11850,7 +11850,7 @@ function pl({
|
|
|
11850
11850
|
const O = n.find(
|
|
11851
11851
|
(V) => V.qualifiedFieldName === S[0].qualifiedFieldName
|
|
11852
11852
|
);
|
|
11853
|
-
|
|
11853
|
+
u((O == null ? void 0 : O.id) || null);
|
|
11854
11854
|
}
|
|
11855
11855
|
r.calculatedFormula.constant !== void 0 && x(r.calculatedFormula.constant);
|
|
11856
11856
|
} else {
|
|
@@ -11861,15 +11861,15 @@ function pl({
|
|
|
11861
11861
|
), V = n.find(
|
|
11862
11862
|
(D) => D.qualifiedFieldName === S[1].qualifiedFieldName
|
|
11863
11863
|
);
|
|
11864
|
-
|
|
11864
|
+
u((O == null ? void 0 : O.id) || null), k((V == null ? void 0 : V.id) || null);
|
|
11865
11865
|
}
|
|
11866
11866
|
}
|
|
11867
11867
|
else
|
|
11868
|
-
|
|
11868
|
+
m("custom"), g(r.expression || "");
|
|
11869
11869
|
}, [r, t, n]);
|
|
11870
11870
|
const E = () => {
|
|
11871
11871
|
const S = {};
|
|
11872
|
-
return l.trim() || (S.name = "Name is required"), o === "custom" ? f.trim() || (S.customExpression = "Custom expression is required") : o === "scale" ? (
|
|
11872
|
+
return l.trim() || (S.name = "Name is required"), o === "custom" ? f.trim() || (S.customExpression = "Custom expression is required") : o === "scale" ? (h || (S.inputA = "Please select a metric for input A"), (isNaN(b) || b === 0) && (S.constantFactor = "Please enter a valid non-zero number"), r && h === r.id && (S.circular = "Cannot reference the field being edited")) : (h || (S.inputA = "Please select a metric for input A"), p || (S.inputB = "Please select a metric for input B"), h === p && (S.inputs = "Inputs A and B must be different metrics"), r && (h === r.id || p === r.id) && (S.circular = "Cannot reference the field being edited")), C(S), Object.keys(S).length === 0;
|
|
11873
11873
|
}, P = () => {
|
|
11874
11874
|
if (!E()) return;
|
|
11875
11875
|
const S = yd(
|
|
@@ -11885,7 +11885,7 @@ function pl({
|
|
|
11885
11885
|
);
|
|
11886
11886
|
i(S), N();
|
|
11887
11887
|
}, N = () => {
|
|
11888
|
-
c(""),
|
|
11888
|
+
c(""), m("ratio"), u(null), k(null), x(1), g(""), C({}), s(!1);
|
|
11889
11889
|
};
|
|
11890
11890
|
return /* @__PURE__ */ a(St, { modal: !1, open: t, onOpenChange: s, children: [
|
|
11891
11891
|
t && /* @__PURE__ */ e("div", { className: "pointer-events-none fixed inset-0 z-40 bg-background/80 backdrop-blur-sm" }),
|
|
@@ -11926,7 +11926,7 @@ function pl({
|
|
|
11926
11926
|
{
|
|
11927
11927
|
value: o,
|
|
11928
11928
|
onValueChange: (S) => {
|
|
11929
|
-
|
|
11929
|
+
m(S), S === "custom" ? (u(null), k(null)) : o === "custom" && g("");
|
|
11930
11930
|
},
|
|
11931
11931
|
children: [
|
|
11932
11932
|
/* @__PURE__ */ e(Y, { id: "operation", children: /* @__PURE__ */ e(W, {}) }),
|
|
@@ -11962,7 +11962,7 @@ function pl({
|
|
|
11962
11962
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Write a SQL expression using column names from your data source" })
|
|
11963
11963
|
] }) : /* @__PURE__ */ a("div", { className: "rounded-md bg-muted p-3 font-mono text-sm", children: [
|
|
11964
11964
|
"= ",
|
|
11965
|
-
|
|
11965
|
+
h && y ? y.label : "A",
|
|
11966
11966
|
" ",
|
|
11967
11967
|
T == null ? void 0 : T.symbol,
|
|
11968
11968
|
" ",
|
|
@@ -11972,7 +11972,7 @@ function pl({
|
|
|
11972
11972
|
/* @__PURE__ */ e(L, { htmlFor: "inputA", children: "Where" }),
|
|
11973
11973
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
11974
11974
|
/* @__PURE__ */ e("div", { className: "flex h-8 w-8 items-center justify-center rounded bg-muted font-mono text-sm font-medium", children: "A" }),
|
|
11975
|
-
/* @__PURE__ */ a(H, { value:
|
|
11975
|
+
/* @__PURE__ */ a(H, { value: h || "", onValueChange: u, children: [
|
|
11976
11976
|
/* @__PURE__ */ e(
|
|
11977
11977
|
Y,
|
|
11978
11978
|
{
|
|
@@ -12082,9 +12082,9 @@ function Id({
|
|
|
12082
12082
|
const {
|
|
12083
12083
|
attributes: c,
|
|
12084
12084
|
listeners: o,
|
|
12085
|
-
setNodeRef:
|
|
12086
|
-
transform:
|
|
12087
|
-
transition:
|
|
12085
|
+
setNodeRef: m,
|
|
12086
|
+
transform: h,
|
|
12087
|
+
transition: u,
|
|
12088
12088
|
isDragging: p
|
|
12089
12089
|
} = Fa({ id: t.id }), k = M((ee) => ee.card), {
|
|
12090
12090
|
updateLabel: b,
|
|
@@ -12140,8 +12140,8 @@ function Id({
|
|
|
12140
12140
|
}, Mt = () => {
|
|
12141
12141
|
I(s, n);
|
|
12142
12142
|
}, Ze = {
|
|
12143
|
-
transform: Pa.Transform.toString(
|
|
12144
|
-
transition:
|
|
12143
|
+
transform: Pa.Transform.toString(h),
|
|
12144
|
+
transition: u
|
|
12145
12145
|
}, xt = Ee(t.dataType), et = xt === "date", bt = l === "kpi", Rt = Qn(ae), lt = s !== "pivotBy", Lt = et && s === "groupBy" && (!bt || ((Vn = k.config) == null ? void 0 : Vn.comparisonType) === "start_vs_end"), Ft = !bt && et && s === "groupBy", Pt = l && Ti.includes(l) && et && s === "groupBy", Vt = l === "kpi" && et && s === "groupBy", Nt = l && l !== "pivotTable" && s === "metrics" && ((Bn = k.config) == null ? void 0 : Bn.comparisonType) === "target", vt = s === "metrics", se = () => {
|
|
12146
12146
|
const ee = t, ve = s === "metrics" && wa(ee);
|
|
12147
12147
|
return /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
@@ -12482,7 +12482,7 @@ function Id({
|
|
|
12482
12482
|
/* @__PURE__ */ a(
|
|
12483
12483
|
"div",
|
|
12484
12484
|
{
|
|
12485
|
-
ref:
|
|
12485
|
+
ref: m,
|
|
12486
12486
|
style: Ze,
|
|
12487
12487
|
...c,
|
|
12488
12488
|
...o,
|
|
@@ -12722,19 +12722,19 @@ function fa({
|
|
|
12722
12722
|
}) {
|
|
12723
12723
|
const { isOver: c, setNodeRef: o } = Ei({
|
|
12724
12724
|
id: t
|
|
12725
|
-
}), { updateSortByColumn:
|
|
12725
|
+
}), { updateSortByColumn: m } = ne(), h = M((f) => f.card), u = M((f) => f.card.type), p = s.length > 0, k = Ce(() => !l || !c ? !0 : xa(
|
|
12726
12726
|
l,
|
|
12727
12727
|
t,
|
|
12728
|
-
|
|
12729
|
-
).isValid, [l, c, t,
|
|
12728
|
+
u
|
|
12729
|
+
).isValid, [l, c, t, u]), b = (f, g) => {
|
|
12730
12730
|
var F;
|
|
12731
|
-
!((F =
|
|
12731
|
+
!((F = h.config) != null && F.sortByColumns) || h.config.sortByColumns.findIndex(
|
|
12732
12732
|
(I) => I.id === f
|
|
12733
|
-
) === -1 ||
|
|
12733
|
+
) === -1 || m(h.id, f, { direction: g });
|
|
12734
12734
|
};
|
|
12735
12735
|
if (t === "sortBy" && i === !1)
|
|
12736
12736
|
return null;
|
|
12737
|
-
const x = t !== "sortBy" &&
|
|
12737
|
+
const x = t !== "sortBy" && u !== "kpi";
|
|
12738
12738
|
return /* @__PURE__ */ a("div", { className: "mb-4 w-full", children: [
|
|
12739
12739
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
12740
12740
|
/* @__PURE__ */ e(
|
|
@@ -12787,7 +12787,7 @@ function fa({
|
|
|
12787
12787
|
sortDirection: F,
|
|
12788
12788
|
onSortDirectionChange: (I) => b(f.id, I),
|
|
12789
12789
|
hasPivotColumns: d,
|
|
12790
|
-
cardType:
|
|
12790
|
+
cardType: u
|
|
12791
12791
|
}
|
|
12792
12792
|
) })
|
|
12793
12793
|
},
|
|
@@ -12812,9 +12812,9 @@ function Rd({
|
|
|
12812
12812
|
var I;
|
|
12813
12813
|
return ((I = F.card.customCardPreferences) == null ? void 0 : I.url) && F.card.type === "custom";
|
|
12814
12814
|
}
|
|
12815
|
-
), o = M((F) => F.card),
|
|
12815
|
+
), o = M((F) => F.card), m = M(
|
|
12816
12816
|
(F) => F.actions.updateCardConfig
|
|
12817
|
-
),
|
|
12817
|
+
), h = o == null ? void 0 : o.type, u = t.length > 0 || n.length > 0, p = h !== "kpi" || n.length <= 2, k = h !== "kpi", b = h !== "kpi" && u, x = [
|
|
12818
12818
|
"pie",
|
|
12819
12819
|
"doughnut",
|
|
12820
12820
|
"polar",
|
|
@@ -12822,13 +12822,13 @@ function Rd({
|
|
|
12822
12822
|
"aggregateTable",
|
|
12823
12823
|
"bubble",
|
|
12824
12824
|
"scatter"
|
|
12825
|
-
].includes(
|
|
12825
|
+
].includes(h), f = k && !x, g = () => h === "kpi" ? {
|
|
12826
12826
|
label: "Trend By",
|
|
12827
12827
|
placeholder: "Drop fields to trend data"
|
|
12828
12828
|
} : {
|
|
12829
12829
|
label: "Rows",
|
|
12830
12830
|
placeholder: "Drop fields to group data"
|
|
12831
|
-
}, v = () =>
|
|
12831
|
+
}, v = () => h === "kpi" ? {
|
|
12832
12832
|
label: "Metric",
|
|
12833
12833
|
placeholder: "Drop field for KPI"
|
|
12834
12834
|
} : {
|
|
@@ -12930,7 +12930,7 @@ function Rd({
|
|
|
12930
12930
|
onOpenChange: l,
|
|
12931
12931
|
availableMetrics: n,
|
|
12932
12932
|
onSave: (F) => {
|
|
12933
|
-
|
|
12933
|
+
m(o.id, {
|
|
12934
12934
|
metricColumns: [...n, F]
|
|
12935
12935
|
});
|
|
12936
12936
|
},
|
|
@@ -12948,10 +12948,10 @@ function Ld({ onEditJoins: t }) {
|
|
|
12948
12948
|
return null;
|
|
12949
12949
|
const d = (c) => !c || c.length === 0 ? "No conditions" : c.map((o) => {
|
|
12950
12950
|
var p, k, b, x;
|
|
12951
|
-
const
|
|
12952
|
-
return `${
|
|
12953
|
-
}).join(" AND "), l = (c) => !c.joinKeyGroups || c.joinKeyGroups.length === 0 ? "No conditions defined" : c.joinKeyGroups.length === 1 ? d(c.joinKeyGroups[0].keys) : c.joinKeyGroups.map((o,
|
|
12954
|
-
id:
|
|
12951
|
+
const m = `${(p = o.source) == null ? void 0 : p.entityName}.${(k = o.source) == null ? void 0 : k.name}`, h = `${(b = o.target) == null ? void 0 : b.entityName}.${(x = o.target) == null ? void 0 : x.name}`, u = o.operator || "=";
|
|
12952
|
+
return `${m} ${u} ${h}`;
|
|
12953
|
+
}).join(" AND "), l = (c) => !c.joinKeyGroups || c.joinKeyGroups.length === 0 ? "No conditions defined" : c.joinKeyGroups.length === 1 ? d(c.joinKeyGroups[0].keys) : c.joinKeyGroups.map((o, m) => ({
|
|
12954
|
+
id: m,
|
|
12955
12955
|
operator: o.operator,
|
|
12956
12956
|
condition: d(o.keys)
|
|
12957
12957
|
}));
|
|
@@ -12975,7 +12975,7 @@ function Ld({ onEditJoins: t }) {
|
|
|
12975
12975
|
align: "start",
|
|
12976
12976
|
className: "max-w-md p-3",
|
|
12977
12977
|
children: /* @__PURE__ */ e("div", { className: "space-y-2", children: i.map((c, o) => {
|
|
12978
|
-
const
|
|
12978
|
+
const m = l(c), h = Array.isArray(m);
|
|
12979
12979
|
return /* @__PURE__ */ a(
|
|
12980
12980
|
"div",
|
|
12981
12981
|
{
|
|
@@ -12996,26 +12996,26 @@ function Ld({ onEditJoins: t }) {
|
|
|
12996
12996
|
}
|
|
12997
12997
|
)
|
|
12998
12998
|
] }),
|
|
12999
|
-
/* @__PURE__ */ e("div", { className: "mt-1 space-y-1", children:
|
|
12999
|
+
/* @__PURE__ */ e("div", { className: "mt-1 space-y-1", children: h ? (
|
|
13000
13000
|
// Multiple join groups
|
|
13001
|
-
|
|
13001
|
+
m.map((u) => /* @__PURE__ */ a(
|
|
13002
13002
|
"div",
|
|
13003
13003
|
{
|
|
13004
13004
|
className: "rounded bg-muted/30 px-2 py-1",
|
|
13005
13005
|
children: [
|
|
13006
|
-
/* @__PURE__ */ e("code", { className: "block break-all text-xs text-muted-foreground", children:
|
|
13007
|
-
|
|
13006
|
+
/* @__PURE__ */ e("code", { className: "block break-all text-xs text-muted-foreground", children: u.condition }),
|
|
13007
|
+
u.operator && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-muted-foreground", children: [
|
|
13008
13008
|
"(",
|
|
13009
|
-
|
|
13009
|
+
u.operator,
|
|
13010
13010
|
")"
|
|
13011
13011
|
] })
|
|
13012
13012
|
]
|
|
13013
13013
|
},
|
|
13014
|
-
|
|
13014
|
+
u.id
|
|
13015
13015
|
))
|
|
13016
13016
|
) : (
|
|
13017
13017
|
// Single join condition
|
|
13018
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted/30 px-2 py-1", children: /* @__PURE__ */ e("code", { className: "block break-all text-xs text-muted-foreground", children:
|
|
13018
|
+
/* @__PURE__ */ e("div", { className: "rounded bg-muted/30 px-2 py-1", children: /* @__PURE__ */ e("code", { className: "block break-all text-xs text-muted-foreground", children: m }) })
|
|
13019
13019
|
) })
|
|
13020
13020
|
]
|
|
13021
13021
|
},
|
|
@@ -13066,9 +13066,9 @@ function Fd({
|
|
|
13066
13066
|
activeField: l
|
|
13067
13067
|
}) {
|
|
13068
13068
|
var y, w;
|
|
13069
|
-
const [c, o] = q(() => gs.getItem("chart-selector-expanded") === "true"), [
|
|
13069
|
+
const [c, o] = q(() => gs.getItem("chart-selector-expanded") === "true"), [m, h] = q(!1), u = M((E) => E.card), p = M(
|
|
13070
13070
|
(E) => E.actions.updateCardConfig
|
|
13071
|
-
), k = n.length > 0 || r.length > 0 || i.length > 0, { data: b, autoJoinMetadata: x } = Ve(
|
|
13071
|
+
), k = n.length > 0 || r.length > 0 || i.length > 0, { data: b, autoJoinMetadata: x } = Ve(u), f = ((y = u == null ? void 0 : u.config) == null ? void 0 : y.joinPlan) || (x != null && x.autoResolved ? x.resolvedJoinPlan : {
|
|
13072
13072
|
baseEntity: {
|
|
13073
13073
|
type: "table",
|
|
13074
13074
|
name: "",
|
|
@@ -13079,20 +13079,20 @@ function Fd({
|
|
|
13079
13079
|
dialect: "none"
|
|
13080
13080
|
},
|
|
13081
13081
|
joins: []
|
|
13082
|
-
}), g = ((w =
|
|
13083
|
-
p(
|
|
13084
|
-
...
|
|
13082
|
+
}), g = ((w = u == null ? void 0 : u.dataSource) == null ? void 0 : w.selectedEntities) || [], v = (E) => {
|
|
13083
|
+
p(u.id, {
|
|
13084
|
+
...u == null ? void 0 : u.config,
|
|
13085
13085
|
joinPlan: E
|
|
13086
|
-
}),
|
|
13086
|
+
}), h(!1);
|
|
13087
13087
|
}, F = () => {
|
|
13088
|
-
p(
|
|
13089
|
-
...
|
|
13088
|
+
p(u.id, {
|
|
13089
|
+
...u == null ? void 0 : u.config,
|
|
13090
13090
|
joinPlan: void 0
|
|
13091
|
-
}),
|
|
13091
|
+
}), h(!1);
|
|
13092
13092
|
}, I = () => {
|
|
13093
|
-
|
|
13093
|
+
h(!1);
|
|
13094
13094
|
}, C = () => {
|
|
13095
|
-
|
|
13095
|
+
h(!0);
|
|
13096
13096
|
};
|
|
13097
13097
|
ue(() => {
|
|
13098
13098
|
gs.setItem(
|
|
@@ -13177,8 +13177,8 @@ function Fd({
|
|
|
13177
13177
|
/* @__PURE__ */ e(
|
|
13178
13178
|
Zs,
|
|
13179
13179
|
{
|
|
13180
|
-
open:
|
|
13181
|
-
onOpenChange:
|
|
13180
|
+
open: m,
|
|
13181
|
+
onOpenChange: h,
|
|
13182
13182
|
joinPlan: f,
|
|
13183
13183
|
availableDataSources: g,
|
|
13184
13184
|
onSave: v,
|
|
@@ -13214,7 +13214,7 @@ function Pd({
|
|
|
13214
13214
|
entityId: "default",
|
|
13215
13215
|
entityName: "Default",
|
|
13216
13216
|
entityType: "table"
|
|
13217
|
-
},
|
|
13217
|
+
}, m = (C) => {
|
|
13218
13218
|
const T = (y) => {
|
|
13219
13219
|
if (y.id === C) {
|
|
13220
13220
|
const w = c[0] || o, E = Ee(w.dataType) === "date";
|
|
@@ -13237,7 +13237,7 @@ function Pd({
|
|
|
13237
13237
|
};
|
|
13238
13238
|
};
|
|
13239
13239
|
r(T(n));
|
|
13240
|
-
},
|
|
13240
|
+
}, h = (C) => {
|
|
13241
13241
|
const T = (y) => {
|
|
13242
13242
|
if (y.id === C) {
|
|
13243
13243
|
const w = c[0] || o, E = Ee(w.dataType) === "date";
|
|
@@ -13268,7 +13268,7 @@ function Pd({
|
|
|
13268
13268
|
};
|
|
13269
13269
|
};
|
|
13270
13270
|
r(T(n));
|
|
13271
|
-
},
|
|
13271
|
+
}, u = (C, T) => {
|
|
13272
13272
|
const y = (w) => w.id === C ? {
|
|
13273
13273
|
...w,
|
|
13274
13274
|
conditions: w.conditions.filter((E) => E.id !== T)
|
|
@@ -13403,9 +13403,9 @@ function Pd({
|
|
|
13403
13403
|
setCurrentFilters: r,
|
|
13404
13404
|
availableFields: c,
|
|
13405
13405
|
isLoading: d,
|
|
13406
|
-
addCondition:
|
|
13407
|
-
addGroup:
|
|
13408
|
-
removeCondition:
|
|
13406
|
+
addCondition: m,
|
|
13407
|
+
addGroup: h,
|
|
13408
|
+
removeCondition: u,
|
|
13409
13409
|
removeGroup: p,
|
|
13410
13410
|
updateCondition: k,
|
|
13411
13411
|
updateConditionFields: b,
|
|
@@ -13452,9 +13452,9 @@ function zd({
|
|
|
13452
13452
|
}) {
|
|
13453
13453
|
const [d, l] = rn.useState(!1), c = rn.useMemo(() => {
|
|
13454
13454
|
const o = {};
|
|
13455
|
-
return n.forEach((
|
|
13456
|
-
const
|
|
13457
|
-
o[
|
|
13455
|
+
return n.forEach((m) => {
|
|
13456
|
+
const h = Bd(m);
|
|
13457
|
+
o[h] || (o[h] = {}), o[h][m.entityId] || (o[h][m.entityId] = []), o[h][m.entityId].push(m);
|
|
13458
13458
|
}), o;
|
|
13459
13459
|
}, [n]);
|
|
13460
13460
|
return /* @__PURE__ */ a(Je, { modal: !0, open: d, onOpenChange: l, children: [
|
|
@@ -13482,19 +13482,19 @@ function zd({
|
|
|
13482
13482
|
/* @__PURE__ */ e(Ye, { className: "z-50 w-80 p-0", align: "start", children: /* @__PURE__ */ a(Ht, { children: [
|
|
13483
13483
|
/* @__PURE__ */ e(Yt, { placeholder: "Search fields...", className: "h-9" }),
|
|
13484
13484
|
/* @__PURE__ */ e(Qt, { children: "No fields found." }),
|
|
13485
|
-
/* @__PURE__ */ e(Wt, { className: "max-h-80", children: Object.entries(c).map(([o,
|
|
13485
|
+
/* @__PURE__ */ e(Wt, { className: "max-h-80", children: Object.entries(c).map(([o, m]) => /* @__PURE__ */ e(
|
|
13486
13486
|
Xt,
|
|
13487
13487
|
{
|
|
13488
13488
|
heading: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
13489
13489
|
/* @__PURE__ */ e(la, { className: "h-3 w-3" }),
|
|
13490
13490
|
o
|
|
13491
13491
|
] }),
|
|
13492
|
-
children: Object.entries(
|
|
13492
|
+
children: Object.entries(m).map(([h, u]) => /* @__PURE__ */ a("div", { children: [
|
|
13493
13493
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 bg-gray-50/50 px-2 py-1 text-xs font-medium text-gray-600", children: [
|
|
13494
|
-
Cs(
|
|
13495
|
-
/* @__PURE__ */ e("span", { children:
|
|
13494
|
+
Cs(u[0].entityType, { size: "h-3 w-3" }),
|
|
13495
|
+
/* @__PURE__ */ e("span", { children: u[0].entityName })
|
|
13496
13496
|
] }),
|
|
13497
|
-
|
|
13497
|
+
u.map((p, k) => /* @__PURE__ */ a(
|
|
13498
13498
|
Zt,
|
|
13499
13499
|
{
|
|
13500
13500
|
value: p.id,
|
|
@@ -13520,7 +13520,7 @@ function zd({
|
|
|
13520
13520
|
},
|
|
13521
13521
|
p.id + k
|
|
13522
13522
|
))
|
|
13523
|
-
] }, `${o}-${
|
|
13523
|
+
] }, `${o}-${h}`))
|
|
13524
13524
|
},
|
|
13525
13525
|
o
|
|
13526
13526
|
)) })
|
|
@@ -13545,12 +13545,12 @@ function Fn(t) {
|
|
|
13545
13545
|
...l,
|
|
13546
13546
|
role: "sortby",
|
|
13547
13547
|
direction: "asc"
|
|
13548
|
-
},
|
|
13548
|
+
}, m = {
|
|
13549
13549
|
joinPlan: d,
|
|
13550
13550
|
groupByColumns: [l],
|
|
13551
13551
|
metricColumns: [c],
|
|
13552
13552
|
sortByColumns: [o]
|
|
13553
|
-
},
|
|
13553
|
+
}, h = ((x = s.dataSource) == null ? void 0 : x.connectionId) || s.connectionId, { data: u, isPending: p, error: k } = Ks({
|
|
13554
13554
|
queryKey: [
|
|
13555
13555
|
"filterValues",
|
|
13556
13556
|
t.entityId,
|
|
@@ -13563,8 +13563,8 @@ function Fn(t) {
|
|
|
13563
13563
|
`${r.apiServiceUrl}/v1/query`,
|
|
13564
13564
|
(n == null ? void 0 : n.accessToken) || "",
|
|
13565
13565
|
{
|
|
13566
|
-
connection_id:
|
|
13567
|
-
cardConfig:
|
|
13566
|
+
connection_id: h,
|
|
13567
|
+
cardConfig: m,
|
|
13568
13568
|
cardDataSource: s.dataSource
|
|
13569
13569
|
}
|
|
13570
13570
|
);
|
|
@@ -13572,11 +13572,11 @@ function Fn(t) {
|
|
|
13572
13572
|
console.log(t), console.error("error", f);
|
|
13573
13573
|
}
|
|
13574
13574
|
},
|
|
13575
|
-
enabled: !!
|
|
13575
|
+
enabled: !!h,
|
|
13576
13576
|
refetchOnMount: !0,
|
|
13577
13577
|
refetchOnWindowFocus: !1
|
|
13578
13578
|
});
|
|
13579
|
-
return { filterValues: ((
|
|
13579
|
+
return { filterValues: ((u == null ? void 0 : u.records) || []).map(
|
|
13580
13580
|
(f) => ({
|
|
13581
13581
|
label: f.value || "BLANK",
|
|
13582
13582
|
value: f.value || "BLANK",
|
|
@@ -13593,10 +13593,10 @@ function jd({
|
|
|
13593
13593
|
}) {
|
|
13594
13594
|
const [d, l] = ln.useState(!1), {
|
|
13595
13595
|
filterValues: c
|
|
13596
|
-
} = Fn(t), o = (
|
|
13597
|
-
n(s.filter((
|
|
13598
|
-
},
|
|
13599
|
-
s.includes(
|
|
13596
|
+
} = Fn(t), o = (h) => {
|
|
13597
|
+
n(s.filter((u) => u !== h));
|
|
13598
|
+
}, m = (h) => {
|
|
13599
|
+
s.includes(h) ? n(s.filter((u) => u !== h)) : n([...s, h]);
|
|
13600
13600
|
};
|
|
13601
13601
|
return /* @__PURE__ */ e("div", { className: Z("w-full", i), children: /* @__PURE__ */ a(Je, { open: d, onOpenChange: l, modal: !0, children: [
|
|
13602
13602
|
/* @__PURE__ */ e(He, { asChild: !0, children: /* @__PURE__ */ a(
|
|
@@ -13607,27 +13607,27 @@ function jd({
|
|
|
13607
13607
|
"aria-expanded": d,
|
|
13608
13608
|
className: "h-auto min-h-10 w-full justify-between p-2",
|
|
13609
13609
|
children: [
|
|
13610
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-wrap gap-1", children: s.length > 0 ? s.map((
|
|
13611
|
-
const
|
|
13610
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-wrap gap-1", children: s.length > 0 ? s.map((h) => {
|
|
13611
|
+
const u = c.find((p) => p.value === h);
|
|
13612
13612
|
return /* @__PURE__ */ a(fe, { variant: "secondary", className: "text-xs", children: [
|
|
13613
|
-
|
|
13613
|
+
u == null ? void 0 : u.label,
|
|
13614
13614
|
/* @__PURE__ */ e(
|
|
13615
13615
|
"div",
|
|
13616
13616
|
{
|
|
13617
13617
|
className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
13618
13618
|
onKeyDown: (p) => {
|
|
13619
|
-
p.key === "Enter" && o(
|
|
13619
|
+
p.key === "Enter" && o(h);
|
|
13620
13620
|
},
|
|
13621
13621
|
onMouseDown: (p) => {
|
|
13622
13622
|
p.preventDefault(), p.stopPropagation();
|
|
13623
13623
|
},
|
|
13624
13624
|
onClick: (p) => {
|
|
13625
|
-
p.stopPropagation(), o(
|
|
13625
|
+
p.stopPropagation(), o(h);
|
|
13626
13626
|
},
|
|
13627
13627
|
children: /* @__PURE__ */ e(Ae, { className: "h-3 w-3 text-muted-foreground hover:text-foreground" })
|
|
13628
13628
|
}
|
|
13629
13629
|
)
|
|
13630
|
-
] },
|
|
13630
|
+
] }, h);
|
|
13631
13631
|
}) : /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: r }) }),
|
|
13632
13632
|
/* @__PURE__ */ e(st, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
13633
13633
|
]
|
|
@@ -13637,27 +13637,27 @@ function jd({
|
|
|
13637
13637
|
/* @__PURE__ */ e(Yt, { placeholder: "Search..." }),
|
|
13638
13638
|
/* @__PURE__ */ a(Wt, { children: [
|
|
13639
13639
|
/* @__PURE__ */ e(Qt, { children: "No results found." }),
|
|
13640
|
-
/* @__PURE__ */ e(Xt, { children: c.map((
|
|
13640
|
+
/* @__PURE__ */ e(Xt, { children: c.map((h, u) => /* @__PURE__ */ a(
|
|
13641
13641
|
Zt,
|
|
13642
13642
|
{
|
|
13643
|
-
onSelect: () =>
|
|
13643
|
+
onSelect: () => m(h.value),
|
|
13644
13644
|
children: [
|
|
13645
13645
|
/* @__PURE__ */ e(
|
|
13646
13646
|
na,
|
|
13647
13647
|
{
|
|
13648
13648
|
className: Z(
|
|
13649
13649
|
"mr-2 h-4 w-4",
|
|
13650
|
-
s.includes(
|
|
13650
|
+
s.includes(h.value) ? "opacity-100" : "opacity-0"
|
|
13651
13651
|
)
|
|
13652
13652
|
}
|
|
13653
13653
|
),
|
|
13654
13654
|
/* @__PURE__ */ a("div", { className: "flex grow items-center justify-between gap-4", children: [
|
|
13655
|
-
/* @__PURE__ */ e("span", { children:
|
|
13656
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children:
|
|
13655
|
+
/* @__PURE__ */ e("span", { children: h.label }),
|
|
13656
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: h.count })
|
|
13657
13657
|
] })
|
|
13658
13658
|
]
|
|
13659
13659
|
},
|
|
13660
|
-
|
|
13660
|
+
h.value + u
|
|
13661
13661
|
)) })
|
|
13662
13662
|
] })
|
|
13663
13663
|
] }) })
|
|
@@ -13676,14 +13676,14 @@ function $d({
|
|
|
13676
13676
|
" Loading values..."
|
|
13677
13677
|
] }) : c ? /* @__PURE__ */ e("div", { className: "flex-1 p-2 text-xs text-red-500", children: "Error loading values" }) : /* @__PURE__ */ a(H, { value: s, onValueChange: n, children: [
|
|
13678
13678
|
/* @__PURE__ */ e(Y, { className: i || "flex-1", children: /* @__PURE__ */ e(W, { placeholder: r, children: s }) }),
|
|
13679
|
-
/* @__PURE__ */ e(Q, { children: d.map((o,
|
|
13679
|
+
/* @__PURE__ */ e(Q, { children: d.map((o, m) => /* @__PURE__ */ e(
|
|
13680
13680
|
B,
|
|
13681
13681
|
{
|
|
13682
13682
|
className: "hover:bg-muted",
|
|
13683
13683
|
value: o.value,
|
|
13684
13684
|
children: o.label
|
|
13685
13685
|
},
|
|
13686
|
-
o.value +
|
|
13686
|
+
o.value + m
|
|
13687
13687
|
)) })
|
|
13688
13688
|
] });
|
|
13689
13689
|
}
|
|
@@ -13693,14 +13693,14 @@ function qd({
|
|
|
13693
13693
|
onChange: n,
|
|
13694
13694
|
className: r
|
|
13695
13695
|
}) {
|
|
13696
|
-
var o;
|
|
13697
|
-
const { tokenProps: i } = La(), d = (o = i == null ? void 0 : i.params) == null ? void 0 : o.timezone, l = Ce(() => {
|
|
13696
|
+
var o, m, h;
|
|
13697
|
+
const { tokenProps: i } = La(), d = ((m = (o = i == null ? void 0 : i.params) == null ? void 0 : o.calendarContext) == null ? void 0 : m.tz) || ((h = i == null ? void 0 : i.params) == null ? void 0 : h.timezone), l = Ce(() => {
|
|
13698
13698
|
if (t) {
|
|
13699
13699
|
if (s === "between" || s === "not between") {
|
|
13700
13700
|
if (Array.isArray(t) && t.length === 2) {
|
|
13701
|
-
const u = t[0] ? new Date(t[0]) : void 0,
|
|
13702
|
-
if (u &&
|
|
13703
|
-
return { from: u, to:
|
|
13701
|
+
const u = t[0] ? new Date(t[0]) : void 0, p = t[1] ? new Date(t[1]) : void 0;
|
|
13702
|
+
if (u && p)
|
|
13703
|
+
return { from: u, to: p };
|
|
13704
13704
|
}
|
|
13705
13705
|
} else if (s === "=" || s === "!=") {
|
|
13706
13706
|
if (!Array.isArray(t) && t) {
|
|
@@ -13721,9 +13721,9 @@ function qd({
|
|
|
13721
13721
|
return { from: void 0, to: u };
|
|
13722
13722
|
}
|
|
13723
13723
|
} else if ((s === "in" || s === "not in") && Array.isArray(t) && t.length > 0) {
|
|
13724
|
-
const u = new Date(t[0]),
|
|
13724
|
+
const u = new Date(t[0]), p = t.length > 1 ? new Date(t[t.length - 1]) : u;
|
|
13725
13725
|
if (!isNaN(u.getTime()))
|
|
13726
|
-
return { from: u, to:
|
|
13726
|
+
return { from: u, to: p };
|
|
13727
13727
|
}
|
|
13728
13728
|
}
|
|
13729
13729
|
}, [t, s]);
|
|
@@ -13739,11 +13739,11 @@ function qd({
|
|
|
13739
13739
|
if (u.from && u.to)
|
|
13740
13740
|
n([u.from.toISOString(), u.to.toISOString()]);
|
|
13741
13741
|
else if (u.from) {
|
|
13742
|
-
const
|
|
13743
|
-
|
|
13742
|
+
const p = new Date(u.from);
|
|
13743
|
+
p.setHours(23, 59, 59, 999), n([u.from.toISOString(), p.toISOString()]);
|
|
13744
13744
|
} else if (u.to) {
|
|
13745
|
-
const
|
|
13746
|
-
|
|
13745
|
+
const p = new Date(u.to);
|
|
13746
|
+
p.setHours(0, 0, 0, 0), n([p.toISOString(), u.to.toISOString()]);
|
|
13747
13747
|
}
|
|
13748
13748
|
},
|
|
13749
13749
|
timezone: d,
|
|
@@ -13839,9 +13839,9 @@ function fl({
|
|
|
13839
13839
|
updateConditionFields: o
|
|
13840
13840
|
}) {
|
|
13841
13841
|
const {
|
|
13842
|
-
attributes:
|
|
13843
|
-
listeners:
|
|
13844
|
-
setNodeRef:
|
|
13842
|
+
attributes: m,
|
|
13843
|
+
listeners: h,
|
|
13844
|
+
setNodeRef: u,
|
|
13845
13845
|
transform: p,
|
|
13846
13846
|
transition: k,
|
|
13847
13847
|
isDragging: b
|
|
@@ -13854,15 +13854,15 @@ function fl({
|
|
|
13854
13854
|
return /* @__PURE__ */ a(
|
|
13855
13855
|
"div",
|
|
13856
13856
|
{
|
|
13857
|
-
ref:
|
|
13857
|
+
ref: u,
|
|
13858
13858
|
style: g,
|
|
13859
13859
|
className: `mb-2 flex items-center gap-2 rounded p-2 hover:bg-muted/50 ${b ? "z-50 opacity-50" : ""}`,
|
|
13860
13860
|
children: [
|
|
13861
13861
|
/* @__PURE__ */ e(
|
|
13862
13862
|
"div",
|
|
13863
13863
|
{
|
|
13864
|
-
...u,
|
|
13865
13864
|
...m,
|
|
13865
|
+
...h,
|
|
13866
13866
|
className: "cursor-grab active:cursor-grabbing",
|
|
13867
13867
|
children: /* @__PURE__ */ e(ea, { className: "h-4 w-4 flex-shrink-0 text-gray-400" })
|
|
13868
13868
|
}
|
|
@@ -14021,9 +14021,9 @@ function Wd({
|
|
|
14021
14021
|
onUpdateCondition: l,
|
|
14022
14022
|
onUpdateField: c,
|
|
14023
14023
|
onRemoveCondition: o,
|
|
14024
|
-
onReorderConditions:
|
|
14025
|
-
onReorderGroups:
|
|
14026
|
-
onAddCondition:
|
|
14024
|
+
onReorderConditions: m,
|
|
14025
|
+
onReorderGroups: h,
|
|
14026
|
+
onAddCondition: u,
|
|
14027
14027
|
onAddGroup: p,
|
|
14028
14028
|
availableFields: k,
|
|
14029
14029
|
renderFilterGroup: b,
|
|
@@ -14047,13 +14047,13 @@ function Wd({
|
|
|
14047
14047
|
), O = t.conditions.findIndex(
|
|
14048
14048
|
(V) => V.id === N.id
|
|
14049
14049
|
);
|
|
14050
|
-
S !== -1 && O !== -1 &&
|
|
14050
|
+
S !== -1 && O !== -1 && m(t.id, S, O);
|
|
14051
14051
|
}
|
|
14052
14052
|
}, w = (E) => {
|
|
14053
14053
|
const { active: P, over: N } = E;
|
|
14054
14054
|
if (N && P.id !== N.id && n) {
|
|
14055
14055
|
const S = t.groups.findIndex((V) => V.id === P.id), O = t.groups.findIndex((V) => V.id === N.id);
|
|
14056
|
-
S !== -1 && O !== -1 &&
|
|
14056
|
+
S !== -1 && O !== -1 && h(n, S, O);
|
|
14057
14057
|
}
|
|
14058
14058
|
};
|
|
14059
14059
|
return /* @__PURE__ */ a(
|
|
@@ -14178,7 +14178,7 @@ function Wd({
|
|
|
14178
14178
|
size: "sm",
|
|
14179
14179
|
variant: "outline",
|
|
14180
14180
|
className: "h-7 text-xs",
|
|
14181
|
-
onClick: () =>
|
|
14181
|
+
onClick: () => u(t.id),
|
|
14182
14182
|
children: [
|
|
14183
14183
|
/* @__PURE__ */ e(We, { className: "mr-1 h-3 w-3" }),
|
|
14184
14184
|
"Add Condition"
|
|
@@ -14216,9 +14216,9 @@ function Qd({
|
|
|
14216
14216
|
availableFields: l,
|
|
14217
14217
|
isLoading: c,
|
|
14218
14218
|
addCondition: o,
|
|
14219
|
-
addGroup:
|
|
14220
|
-
removeCondition:
|
|
14221
|
-
removeGroup:
|
|
14219
|
+
addGroup: m,
|
|
14220
|
+
removeCondition: h,
|
|
14221
|
+
removeGroup: u,
|
|
14222
14222
|
updateCondition: p,
|
|
14223
14223
|
updateConditionFields: k,
|
|
14224
14224
|
updateGroupOperator: b,
|
|
@@ -14280,7 +14280,7 @@ function Qd({
|
|
|
14280
14280
|
groupLogicalOperator: N.logicalOperator,
|
|
14281
14281
|
onUpdateCondition: p,
|
|
14282
14282
|
onUpdateField: w,
|
|
14283
|
-
onRemoveCondition:
|
|
14283
|
+
onRemoveCondition: h,
|
|
14284
14284
|
onUpdateGroupOperator: b,
|
|
14285
14285
|
availableFields: l,
|
|
14286
14286
|
updateConditionFields: k
|
|
@@ -14339,7 +14339,7 @@ function Qd({
|
|
|
14339
14339
|
variant: "outline",
|
|
14340
14340
|
size: "sm",
|
|
14341
14341
|
className: "h-7 text-xs",
|
|
14342
|
-
onClick: () =>
|
|
14342
|
+
onClick: () => m(N.id),
|
|
14343
14343
|
children: [
|
|
14344
14344
|
/* @__PURE__ */ e(We, { className: "mr-1 h-3 w-3" }),
|
|
14345
14345
|
"Add Group"
|
|
@@ -14355,14 +14355,14 @@ function Qd({
|
|
|
14355
14355
|
parentGroupId: O,
|
|
14356
14356
|
onUpdateGroupOperator: b,
|
|
14357
14357
|
onUpdateGroupNegate: x,
|
|
14358
|
-
onRemoveGroup:
|
|
14358
|
+
onRemoveGroup: u,
|
|
14359
14359
|
onUpdateCondition: p,
|
|
14360
14360
|
onUpdateField: w,
|
|
14361
|
-
onRemoveCondition:
|
|
14361
|
+
onRemoveCondition: h,
|
|
14362
14362
|
onReorderConditions: f,
|
|
14363
14363
|
onReorderGroups: g,
|
|
14364
14364
|
onAddCondition: o,
|
|
14365
|
-
onAddGroup:
|
|
14365
|
+
onAddGroup: m,
|
|
14366
14366
|
availableFields: l,
|
|
14367
14367
|
renderFilterGroup: E,
|
|
14368
14368
|
updateConditionFields: k
|
|
@@ -14427,8 +14427,8 @@ function Xd({
|
|
|
14427
14427
|
kt,
|
|
14428
14428
|
{
|
|
14429
14429
|
className: "max-h-[80vh] max-w-4xl overflow-y-auto",
|
|
14430
|
-
onInteractOutside: (
|
|
14431
|
-
|
|
14430
|
+
onInteractOutside: (m) => {
|
|
14431
|
+
m.preventDefault();
|
|
14432
14432
|
},
|
|
14433
14433
|
children: [
|
|
14434
14434
|
/* @__PURE__ */ a(Tt, { children: [
|
|
@@ -14440,8 +14440,8 @@ function Xd({
|
|
|
14440
14440
|
{
|
|
14441
14441
|
filters: s,
|
|
14442
14442
|
availableFields: i,
|
|
14443
|
-
onSave: (
|
|
14444
|
-
n(t,
|
|
14443
|
+
onSave: (m) => {
|
|
14444
|
+
n(t, m), l(!1);
|
|
14445
14445
|
},
|
|
14446
14446
|
onCancel: () => l(!1),
|
|
14447
14447
|
onClearAll: () => {
|
|
@@ -14463,7 +14463,7 @@ function Zd({
|
|
|
14463
14463
|
var f, g;
|
|
14464
14464
|
const [i, d] = q(null), l = M((v) => v.card), c = M(
|
|
14465
14465
|
(v) => v.actions.updateCardConfig
|
|
14466
|
-
), o = (f = l == null ? void 0 : l.config) == null ? void 0 : f.joinPlan,
|
|
14466
|
+
), o = (f = l == null ? void 0 : l.config) == null ? void 0 : f.joinPlan, m = (g = l == null ? void 0 : l.dataSource) == null ? void 0 : g.semanticDomainId, { data: h } = Fi(m), u = [
|
|
14467
14467
|
...s,
|
|
14468
14468
|
...n("groupBy"),
|
|
14469
14469
|
...n("pivotBy"),
|
|
@@ -14557,9 +14557,9 @@ function Zd({
|
|
|
14557
14557
|
return;
|
|
14558
14558
|
}
|
|
14559
14559
|
if (R !== P.qualifiedEntityName && P.qualifiedEntityName)
|
|
14560
|
-
if (
|
|
14560
|
+
if (m && (h != null && h.joinabilityMap)) {
|
|
14561
14561
|
if (Pi(P, {
|
|
14562
|
-
joinabilityMap:
|
|
14562
|
+
joinabilityMap: h.joinabilityMap,
|
|
14563
14563
|
selectedFields: N,
|
|
14564
14564
|
baseEntityName: (E = o == null ? void 0 : o.baseEntity) == null ? void 0 : E.name
|
|
14565
14565
|
// Pass authoritative base entity
|
|
@@ -14672,13 +14672,13 @@ function Zd({
|
|
|
14672
14672
|
r,
|
|
14673
14673
|
p,
|
|
14674
14674
|
o,
|
|
14675
|
-
u,
|
|
14676
14675
|
m,
|
|
14676
|
+
h,
|
|
14677
14677
|
l.type,
|
|
14678
14678
|
c,
|
|
14679
14679
|
l.config
|
|
14680
14680
|
]
|
|
14681
|
-
), x = i ?
|
|
14681
|
+
), x = i ? u.find((v) => v.id === i) : null;
|
|
14682
14682
|
return {
|
|
14683
14683
|
activeId: i,
|
|
14684
14684
|
activeField: x,
|
|
@@ -14737,22 +14737,22 @@ const tu = [
|
|
|
14737
14737
|
// { value: 'custom', label: 'Custom' },
|
|
14738
14738
|
];
|
|
14739
14739
|
function au() {
|
|
14740
|
-
var o,
|
|
14741
|
-
const t = M((
|
|
14742
|
-
if (
|
|
14740
|
+
var o, m;
|
|
14741
|
+
const t = M((h) => h.card), { updateRowLimit: s } = ne(), [n, r] = q(!1), [i, d] = q(""), l = (h) => {
|
|
14742
|
+
if (h === "custom") {
|
|
14743
14743
|
r(!0);
|
|
14744
14744
|
return;
|
|
14745
14745
|
}
|
|
14746
|
-
r(!1), s(t.id, parseInt(
|
|
14746
|
+
r(!1), s(t.id, parseInt(h));
|
|
14747
14747
|
};
|
|
14748
14748
|
return /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: n ? /* @__PURE__ */ e(
|
|
14749
14749
|
ge,
|
|
14750
14750
|
{
|
|
14751
14751
|
type: "number",
|
|
14752
14752
|
value: i,
|
|
14753
|
-
onChange: (
|
|
14754
|
-
const
|
|
14755
|
-
d(
|
|
14753
|
+
onChange: (h) => {
|
|
14754
|
+
const u = h.target.value;
|
|
14755
|
+
d(u), u && !isNaN(parseInt(u)) && s(t.id, parseInt(u));
|
|
14756
14756
|
},
|
|
14757
14757
|
className: "h-7 w-24",
|
|
14758
14758
|
placeholder: "Enter limit",
|
|
@@ -14761,11 +14761,11 @@ function au() {
|
|
|
14761
14761
|
) : /* @__PURE__ */ a(
|
|
14762
14762
|
H,
|
|
14763
14763
|
{
|
|
14764
|
-
value: ((
|
|
14764
|
+
value: ((m = (o = t.config) == null ? void 0 : o.rowLimit) == null ? void 0 : m.toString()) || "100",
|
|
14765
14765
|
onValueChange: l,
|
|
14766
14766
|
children: [
|
|
14767
14767
|
/* @__PURE__ */ e(Y, { className: "h-8 w-24 border-none px-1 [&>svg]:hidden", children: /* @__PURE__ */ e(W, { placeholder: "Select limit" }) }),
|
|
14768
|
-
/* @__PURE__ */ e(Q, { children: tu.map((
|
|
14768
|
+
/* @__PURE__ */ e(Q, { children: tu.map((h) => /* @__PURE__ */ e(B, { value: h.value, children: h.label }, h.value)) })
|
|
14769
14769
|
]
|
|
14770
14770
|
}
|
|
14771
14771
|
) });
|
|
@@ -14781,7 +14781,7 @@ function nu({
|
|
|
14781
14781
|
sortState: c,
|
|
14782
14782
|
splitViewEnabled: o
|
|
14783
14783
|
}) {
|
|
14784
|
-
const
|
|
14784
|
+
const m = Ce(() => (s == null ? void 0 : s.records) || [], [s == null ? void 0 : s.records]);
|
|
14785
14785
|
return !o || ["table", "pivotTable", "aggregateTable"].includes(t.type) ? /* @__PURE__ */ e(on, {}) : /* @__PURE__ */ a(Et, { direction: "vertical", className: "h-full min-h-0 w-full", children: [
|
|
14786
14786
|
/* @__PURE__ */ e(
|
|
14787
14787
|
Le,
|
|
@@ -14807,7 +14807,7 @@ function nu({
|
|
|
14807
14807
|
Da,
|
|
14808
14808
|
{
|
|
14809
14809
|
card: t,
|
|
14810
|
-
data:
|
|
14810
|
+
data: m,
|
|
14811
14811
|
paginationMetadata: i,
|
|
14812
14812
|
onPaginationChange: d,
|
|
14813
14813
|
isLoading: n || r,
|
|
@@ -14842,7 +14842,7 @@ function ru({
|
|
|
14842
14842
|
// setActiveCard,
|
|
14843
14843
|
}) {
|
|
14844
14844
|
var pe, ie, we;
|
|
14845
|
-
const
|
|
14845
|
+
const m = M((re) => re.card), h = ye((re) => re.filterValues), u = ye((re) => re.selectedSheetId), p = ye(
|
|
14846
14846
|
(re) => re.inlineFilterValuesMap[(d == null ? void 0 : d.id) || ""]
|
|
14847
14847
|
), { updateCardConfig: k, setCard: b, updateCardInFrame: x, setShowAIDialog: f } = ne(), g = M((re) => re.showAIDialog), v = ye((re) => re.isVisualEditing), [F, I] = q(!1), [C, T] = q(!1), [y, w] = q(
|
|
14848
14848
|
null
|
|
@@ -14897,11 +14897,11 @@ function ru({
|
|
|
14897
14897
|
/* @__PURE__ */ a("div", { className: "space-y-4 pr-8", children: [
|
|
14898
14898
|
/* @__PURE__ */ a("div", { children: [
|
|
14899
14899
|
/* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium", children: "Active Card Config" }),
|
|
14900
|
-
/* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: JSON.stringify(
|
|
14900
|
+
/* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: JSON.stringify(m.config || {}, null, 2) })
|
|
14901
14901
|
] }),
|
|
14902
14902
|
/* @__PURE__ */ a("div", { children: [
|
|
14903
14903
|
/* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium", children: "Dashboard Filters" }),
|
|
14904
|
-
/* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: JSON.stringify(
|
|
14904
|
+
/* @__PURE__ */ e("pre", { className: "max-h-40 overflow-auto rounded border bg-background p-3 text-xs", children: JSON.stringify(h || {}, null, 2) })
|
|
14905
14905
|
] }),
|
|
14906
14906
|
/* @__PURE__ */ a("div", { children: [
|
|
14907
14907
|
/* @__PURE__ */ e("h3", { className: "mb-2 text-sm font-medium", children: "Card Data Source State" }),
|
|
@@ -14919,20 +14919,20 @@ function ru({
|
|
|
14919
14919
|
] });
|
|
14920
14920
|
}
|
|
14921
14921
|
const le = (re) => {
|
|
14922
|
-
if (!
|
|
14922
|
+
if (!m.config) return;
|
|
14923
14923
|
const Ge = Nn(
|
|
14924
14924
|
re,
|
|
14925
|
-
|
|
14926
|
-
|
|
14925
|
+
m.config.metricColumns,
|
|
14926
|
+
m.config.groupByColumns
|
|
14927
14927
|
);
|
|
14928
|
-
k(
|
|
14929
|
-
...
|
|
14928
|
+
k(m.id, {
|
|
14929
|
+
...m.config,
|
|
14930
14930
|
sortByColumns: Ge
|
|
14931
14931
|
});
|
|
14932
14932
|
}, de = Ce(() => {
|
|
14933
14933
|
var re;
|
|
14934
|
-
return Bi((re =
|
|
14935
|
-
}, [(pe =
|
|
14934
|
+
return Bi((re = m.config) == null ? void 0 : re.sortByColumns);
|
|
14935
|
+
}, [(pe = m.config) == null ? void 0 : pe.sortByColumns]);
|
|
14936
14936
|
return /* @__PURE__ */ a(
|
|
14937
14937
|
"div",
|
|
14938
14938
|
{
|
|
@@ -14964,7 +14964,7 @@ function ru({
|
|
|
14964
14964
|
onFiltersClick: i,
|
|
14965
14965
|
inlineFilters: d.inlineFilters,
|
|
14966
14966
|
inlineFilterValues: p,
|
|
14967
|
-
sheetId:
|
|
14967
|
+
sheetId: u || ""
|
|
14968
14968
|
}
|
|
14969
14969
|
),
|
|
14970
14970
|
$ && /* @__PURE__ */ e(
|
|
@@ -15067,9 +15067,9 @@ function ru({
|
|
|
15067
15067
|
const re = $i(
|
|
15068
15068
|
Es.QUERY_GENERATION,
|
|
15069
15069
|
{
|
|
15070
|
-
cardConfig:
|
|
15070
|
+
cardConfig: m.config,
|
|
15071
15071
|
dataSource: d.dataSource,
|
|
15072
|
-
dashboardFilters:
|
|
15072
|
+
dashboardFilters: h,
|
|
15073
15073
|
errorMessage: V,
|
|
15074
15074
|
errorSql: A,
|
|
15075
15075
|
generatedSql: O == null ? void 0 : O.sql
|
|
@@ -15149,7 +15149,7 @@ const ou = () => {
|
|
|
15149
15149
|
};
|
|
15150
15150
|
function cu({ column: t, isSelected: s, onSelect: n, availableFields: r, width: i, onWidthChange: d }) {
|
|
15151
15151
|
var U, $, _;
|
|
15152
|
-
const l = M((X) => X.card), { updateCardConfig: c, removeGroupByColumn: o, removeMetricColumn:
|
|
15152
|
+
const l = M((X) => X.card), { updateCardConfig: c, removeGroupByColumn: o, removeMetricColumn: m, updateFilters: h } = ne(), [u, p] = q(!1), [k, b] = q(!1), x = Pe(null), f = Fe((X) => {
|
|
15153
15153
|
X.preventDefault(), X.stopPropagation(), b(!0), x.current = {
|
|
15154
15154
|
startX: X.clientX,
|
|
15155
15155
|
startWidth: i || 150
|
|
@@ -15165,7 +15165,7 @@ function cu({ column: t, isSelected: s, onSelect: n, availableFields: r, width:
|
|
|
15165
15165
|
}, [i, t.id, d]), g = (U = l == null ? void 0 : l.config) == null ? void 0 : U.filters, v = ($ = g == null ? void 0 : g.conditions) == null ? void 0 : $.some(
|
|
15166
15166
|
(X) => X.field.name === t.name && X.field.qualifiedEntityName === t.qualifiedEntityName
|
|
15167
15167
|
), F = (X) => {
|
|
15168
|
-
X ?
|
|
15168
|
+
X ? h(l.id, X) : c(l.id, { filters: void 0 });
|
|
15169
15169
|
}, {
|
|
15170
15170
|
attributes: I,
|
|
15171
15171
|
listeners: C,
|
|
@@ -15243,7 +15243,7 @@ function cu({ column: t, isSelected: s, onSelect: n, availableFields: r, width:
|
|
|
15243
15243
|
});
|
|
15244
15244
|
}
|
|
15245
15245
|
}, A = () => {
|
|
15246
|
-
t.role === "groupby" ? o(l.id, t.id) : t.role === "metric" &&
|
|
15246
|
+
t.role === "groupby" ? o(l.id, t.id) : t.role === "metric" && m(l.id, t.id);
|
|
15247
15247
|
}, z = {
|
|
15248
15248
|
...P,
|
|
15249
15249
|
width: i ? `${i}px` : void 0,
|
|
@@ -15365,7 +15365,7 @@ function cu({ column: t, isSelected: s, onSelect: n, availableFields: r, width:
|
|
|
15365
15365
|
/* @__PURE__ */ e(
|
|
15366
15366
|
hl,
|
|
15367
15367
|
{
|
|
15368
|
-
open:
|
|
15368
|
+
open: u,
|
|
15369
15369
|
onOpenChange: p,
|
|
15370
15370
|
availableFields: r.length > 0 ? r : [t],
|
|
15371
15371
|
existingFilters: g,
|
|
@@ -15397,7 +15397,7 @@ function uu({
|
|
|
15397
15397
|
sourceFields: r = []
|
|
15398
15398
|
}) {
|
|
15399
15399
|
var w, E, P, N;
|
|
15400
|
-
const i = M((S) => S.card), { updateCardConfig: d } = ne(), [l, c] = q(null), [o,
|
|
15400
|
+
const i = M((S) => S.card), { updateCardConfig: d } = ne(), [l, c] = q(null), [o, m] = q({}), [h, u] = q(!1), p = Ce(() => {
|
|
15401
15401
|
var V, D;
|
|
15402
15402
|
const S = ((V = i == null ? void 0 : i.config) == null ? void 0 : V.groupByColumns) || [], O = ((D = i == null ? void 0 : i.config) == null ? void 0 : D.metricColumns) || [];
|
|
15403
15403
|
return [...S, ...O];
|
|
@@ -15405,7 +15405,7 @@ function uu({
|
|
|
15405
15405
|
const S = new Set(p.map((O) => `${O.qualifiedEntityName}.${O.name}`));
|
|
15406
15406
|
return r.filter((O) => !S.has(`${O.qualifiedEntityName}.${O.name}`));
|
|
15407
15407
|
}, [r, p]), { data: b, isLoading: x } = Ve(i), f = (b == null ? void 0 : b.records) || [], g = Fe((S, O) => {
|
|
15408
|
-
|
|
15408
|
+
m((V) => ({ ...V, [S]: O }));
|
|
15409
15409
|
}, []), v = Fe((S) => {
|
|
15410
15410
|
var R, A;
|
|
15411
15411
|
const O = Ee(S.dataType), V = ((R = i == null ? void 0 : i.config) == null ? void 0 : R.groupByColumns) || [], D = ((A = i == null ? void 0 : i.config) == null ? void 0 : A.metricColumns) || [];
|
|
@@ -15429,7 +15429,7 @@ function uu({
|
|
|
15429
15429
|
groupByColumns: [...V, z]
|
|
15430
15430
|
});
|
|
15431
15431
|
}
|
|
15432
|
-
|
|
15432
|
+
u(!1);
|
|
15433
15433
|
}, [(P = i == null ? void 0 : i.config) == null ? void 0 : P.groupByColumns, (N = i == null ? void 0 : i.config) == null ? void 0 : N.metricColumns, i.id, d]), F = oa(
|
|
15434
15434
|
dt(ca, {
|
|
15435
15435
|
activationConstraint: {
|
|
@@ -15513,7 +15513,7 @@ function uu({
|
|
|
15513
15513
|
))
|
|
15514
15514
|
}
|
|
15515
15515
|
),
|
|
15516
|
-
/* @__PURE__ */ e("th", { className: "w-10 border-r border-border bg-background px-1 py-2", children: /* @__PURE__ */ a(Je, { open:
|
|
15516
|
+
/* @__PURE__ */ e("th", { className: "w-10 border-r border-border bg-background px-1 py-2", children: /* @__PURE__ */ a(Je, { open: h, onOpenChange: u, children: [
|
|
15517
15517
|
/* @__PURE__ */ e(He, { asChild: !0, children: /* @__PURE__ */ e(
|
|
15518
15518
|
K,
|
|
15519
15519
|
{
|
|
@@ -15641,9 +15641,9 @@ function hu({
|
|
|
15641
15641
|
isLoading: s = !1
|
|
15642
15642
|
}) {
|
|
15643
15643
|
var F, I;
|
|
15644
|
-
const n = M((C) => C.card), { updateCardConfig: r, removeGroupByColumn: i, removeMetricColumn: d } = ne(), [l, c] = q(!0), [o,
|
|
15645
|
-
const T = new Set(
|
|
15646
|
-
T.has(C) ? T.delete(C) : T.add(C),
|
|
15644
|
+
const n = M((C) => C.card), { updateCardConfig: r, removeGroupByColumn: i, removeMetricColumn: d } = ne(), [l, c] = q(!0), [o, m] = q(""), [h, u] = q(/* @__PURE__ */ new Set()), p = ((F = n == null ? void 0 : n.config) == null ? void 0 : F.groupByColumns) || [], k = ((I = n == null ? void 0 : n.config) == null ? void 0 : I.metricColumns) || [], b = (C) => {
|
|
15645
|
+
const T = new Set(h);
|
|
15646
|
+
T.has(C) ? T.delete(C) : T.add(C), u(T);
|
|
15647
15647
|
}, x = (C) => p.some((T) => T.name === C.name && T.qualifiedEntityName === C.qualifiedEntityName) || k.some((T) => T.name === C.name && T.qualifiedEntityName === C.qualifiedEntityName), f = (C, T) => {
|
|
15648
15648
|
if (T)
|
|
15649
15649
|
if (Ee(C.dataType) === "number") {
|
|
@@ -15712,7 +15712,7 @@ function hu({
|
|
|
15712
15712
|
{
|
|
15713
15713
|
placeholder: "Search columns...",
|
|
15714
15714
|
value: o,
|
|
15715
|
-
onChange: (C) =>
|
|
15715
|
+
onChange: (C) => m(C.target.value),
|
|
15716
15716
|
className: "h-8 pl-8 text-sm"
|
|
15717
15717
|
}
|
|
15718
15718
|
)
|
|
@@ -15789,7 +15789,7 @@ function hu({
|
|
|
15789
15789
|
/* @__PURE__ */ e(aa, { className: "flex-1", children: /* @__PURE__ */ e("div", { className: "p-2", children: s ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ e("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" }) }) : t.length === 0 ? /* @__PURE__ */ e("div", { className: "py-8 text-center text-sm text-muted-foreground", children: "No columns available" }) : t.map((C) => {
|
|
15790
15790
|
const T = g(C.columns);
|
|
15791
15791
|
if (T.length === 0) return null;
|
|
15792
|
-
const y =
|
|
15792
|
+
const y = h.has(C.entityId) || o.length > 0;
|
|
15793
15793
|
return /* @__PURE__ */ a(
|
|
15794
15794
|
at,
|
|
15795
15795
|
{
|
|
@@ -15877,15 +15877,15 @@ function fu({
|
|
|
15877
15877
|
selectedColumn: i,
|
|
15878
15878
|
availableColumns: d
|
|
15879
15879
|
}) {
|
|
15880
|
-
const [l, c] = q(!1), [o,
|
|
15880
|
+
const [l, c] = q(!1), [o, m] = q("column"), h = Pe(null);
|
|
15881
15881
|
ue(() => {
|
|
15882
15882
|
const b = (x) => {
|
|
15883
15883
|
x.key === "Escape" && t ? r() : x.key === "Enter" && t && !l && n(t);
|
|
15884
15884
|
};
|
|
15885
15885
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
15886
15886
|
}, [t, r, n, l]);
|
|
15887
|
-
const
|
|
15888
|
-
const x = `[${b.label || b.name}]`, f =
|
|
15887
|
+
const u = (b) => {
|
|
15888
|
+
const x = `[${b.label || b.name}]`, f = h.current;
|
|
15889
15889
|
if (f) {
|
|
15890
15890
|
const g = f.selectionStart || 0, v = f.selectionEnd || 0, F = t.slice(0, g) + x + t.slice(v);
|
|
15891
15891
|
s(F), setTimeout(() => {
|
|
@@ -15895,7 +15895,7 @@ function fu({
|
|
|
15895
15895
|
s(t + x);
|
|
15896
15896
|
c(!1);
|
|
15897
15897
|
}, p = (b) => {
|
|
15898
|
-
const x =
|
|
15898
|
+
const x = h.current;
|
|
15899
15899
|
if (x) {
|
|
15900
15900
|
const f = x.selectionStart || 0, g = x.selectionEnd || 0, v = t.slice(0, f) + b.syntax + t.slice(g);
|
|
15901
15901
|
s(v), setTimeout(() => {
|
|
@@ -15917,7 +15917,7 @@ function fu({
|
|
|
15917
15917
|
return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 border-b border-border bg-muted/30 px-3 py-1.5", children: [
|
|
15918
15918
|
/* @__PURE__ */ e("div", { className: "flex min-w-[100px] items-center justify-center rounded border border-border bg-background px-2 py-1 text-xs font-medium text-muted-foreground", children: i ? /* @__PURE__ */ e("span", { className: "truncate", children: i.label || i.name }) : /* @__PURE__ */ e("span", { children: "—" }) }),
|
|
15919
15919
|
/* @__PURE__ */ a(Je, { open: l && o === "function", onOpenChange: (b) => {
|
|
15920
|
-
c(b), b &&
|
|
15920
|
+
c(b), b && m("function");
|
|
15921
15921
|
}, children: [
|
|
15922
15922
|
/* @__PURE__ */ e(He, { asChild: !0, children: /* @__PURE__ */ e(
|
|
15923
15923
|
K,
|
|
@@ -15952,7 +15952,7 @@ function fu({
|
|
|
15952
15952
|
] }) })
|
|
15953
15953
|
] }),
|
|
15954
15954
|
/* @__PURE__ */ a(Je, { open: l && o === "column", onOpenChange: (b) => {
|
|
15955
|
-
c(b), b &&
|
|
15955
|
+
c(b), b && m("column");
|
|
15956
15956
|
}, children: [
|
|
15957
15957
|
/* @__PURE__ */ e(He, { asChild: !0, children: /* @__PURE__ */ a(
|
|
15958
15958
|
K,
|
|
@@ -15977,7 +15977,7 @@ function fu({
|
|
|
15977
15977
|
Zt,
|
|
15978
15978
|
{
|
|
15979
15979
|
value: b.label || b.name,
|
|
15980
|
-
onSelect: () =>
|
|
15980
|
+
onSelect: () => u(b),
|
|
15981
15981
|
children: [
|
|
15982
15982
|
/* @__PURE__ */ e(x, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
15983
15983
|
/* @__PURE__ */ e("span", { className: "truncate", children: b.label || b.name })
|
|
@@ -15992,7 +15992,7 @@ function fu({
|
|
|
15992
15992
|
/* @__PURE__ */ e("div", { className: "relative flex-1", children: /* @__PURE__ */ e(
|
|
15993
15993
|
ge,
|
|
15994
15994
|
{
|
|
15995
|
-
ref:
|
|
15995
|
+
ref: h,
|
|
15996
15996
|
value: t,
|
|
15997
15997
|
onChange: (b) => s(b.target.value),
|
|
15998
15998
|
placeholder: "Enter a formula or select a column...",
|
|
@@ -16033,11 +16033,11 @@ function gu({ className: t }) {
|
|
|
16033
16033
|
isLoading: o
|
|
16034
16034
|
} = ta();
|
|
16035
16035
|
(p = s == null ? void 0 : s.config) != null && p.groupByColumns, (k = s == null ? void 0 : s.config) != null && k.metricColumns, (b = s == null ? void 0 : s.config) != null && b.groupByColumns, (x = s == null ? void 0 : s.config) != null && x.pivotByColumns;
|
|
16036
|
-
const
|
|
16036
|
+
const m = (f) => {
|
|
16037
16037
|
r(f), d(f ? `[${f.label || f.name}]` : "");
|
|
16038
|
-
},
|
|
16038
|
+
}, h = (f) => {
|
|
16039
16039
|
console.log("Formula submitted:", f), d(""), r(null);
|
|
16040
|
-
},
|
|
16040
|
+
}, u = () => {
|
|
16041
16041
|
d(""), r(null);
|
|
16042
16042
|
};
|
|
16043
16043
|
return /* @__PURE__ */ a("div", { className: Z("flex h-full w-full flex-col", t), children: [
|
|
@@ -16046,8 +16046,8 @@ function gu({ className: t }) {
|
|
|
16046
16046
|
{
|
|
16047
16047
|
value: i,
|
|
16048
16048
|
onChange: d,
|
|
16049
|
-
onSubmit:
|
|
16050
|
-
onCancel:
|
|
16049
|
+
onSubmit: h,
|
|
16050
|
+
onCancel: u,
|
|
16051
16051
|
selectedColumn: n,
|
|
16052
16052
|
availableColumns: l
|
|
16053
16053
|
}
|
|
@@ -16057,7 +16057,7 @@ function gu({ className: t }) {
|
|
|
16057
16057
|
uu,
|
|
16058
16058
|
{
|
|
16059
16059
|
selectedColumn: n,
|
|
16060
|
-
onColumnSelect:
|
|
16060
|
+
onColumnSelect: m,
|
|
16061
16061
|
isLoading: o,
|
|
16062
16062
|
sourceFields: l
|
|
16063
16063
|
}
|
|
@@ -16076,10 +16076,10 @@ function xu() {
|
|
|
16076
16076
|
var U, $;
|
|
16077
16077
|
const [t, s] = q(
|
|
16078
16078
|
"chart"
|
|
16079
|
-
), [n, r] = q(!1), [i, d] = q(!1), [l, c] = q(!0), o = M((_) => _.showAIDialog),
|
|
16079
|
+
), [n, r] = q(!1), [i, d] = q(!1), [l, c] = q(!0), o = M((_) => _.showAIDialog), m = ye((_) => _.isVisualEditing), { setCardType: h } = ne(), u = M((_) => _.card.type);
|
|
16080
16080
|
ue(() => ou(), []);
|
|
16081
16081
|
const p = (_) => {
|
|
16082
|
-
|
|
16082
|
+
h(_);
|
|
16083
16083
|
}, k = M((_) => _.frame), b = M((_) => _.card);
|
|
16084
16084
|
M((_) => _.activeTabCardId), M(
|
|
16085
16085
|
(_) => _.actions.getAvailableFields
|
|
@@ -16135,11 +16135,11 @@ function xu() {
|
|
|
16135
16135
|
onToggleVisibility: () => c(!l)
|
|
16136
16136
|
}
|
|
16137
16137
|
),
|
|
16138
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 transition-all duration-300 ease-in-out", children:
|
|
16138
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 transition-all duration-300 ease-in-out", children: u === "tableBuilder" ? /* @__PURE__ */ e(gu, { className: "flex-1" }) : /* @__PURE__ */ a(ce, { children: [
|
|
16139
16139
|
!o && /* @__PURE__ */ e(
|
|
16140
16140
|
Fd,
|
|
16141
16141
|
{
|
|
16142
|
-
selectedChart:
|
|
16142
|
+
selectedChart: u,
|
|
16143
16143
|
onChartChange: p,
|
|
16144
16144
|
groupByFields: E("groupBy"),
|
|
16145
16145
|
pivotByFields: E("pivotBy"),
|
|
@@ -16151,7 +16151,7 @@ function xu() {
|
|
|
16151
16151
|
/* @__PURE__ */ e(
|
|
16152
16152
|
ru,
|
|
16153
16153
|
{
|
|
16154
|
-
selectedChart:
|
|
16154
|
+
selectedChart: u,
|
|
16155
16155
|
activeView: t,
|
|
16156
16156
|
onViewChange: s,
|
|
16157
16157
|
showDebug: n,
|
|
@@ -16171,7 +16171,7 @@ function xu() {
|
|
|
16171
16171
|
}
|
|
16172
16172
|
)
|
|
16173
16173
|
] }) }),
|
|
16174
|
-
!l &&
|
|
16174
|
+
!l && m && /* @__PURE__ */ e("div", { className: "fixed left-6 top-[105px] z-50", children: /* @__PURE__ */ e(
|
|
16175
16175
|
K,
|
|
16176
16176
|
{
|
|
16177
16177
|
size: "sm",
|
|
@@ -16201,7 +16201,7 @@ function xu() {
|
|
|
16201
16201
|
);
|
|
16202
16202
|
}
|
|
16203
16203
|
function bu({ authToken: t, onSave: s, onClose: n }) {
|
|
16204
|
-
const r = Pe(null), i = M((T) => T.showAIDialog), d = M((T) => T.isDevMode), l = Ha((T) => T.setFullscreen), c = Ha((T) => T.setPanelOpen), o = Ha((T) => T.setContainer),
|
|
16204
|
+
const r = Pe(null), i = M((T) => T.showAIDialog), d = M((T) => T.isDevMode), l = Ha((T) => T.setFullscreen), c = Ha((T) => T.setPanelOpen), o = Ha((T) => T.setContainer), m = _i("editor"), h = Ji(), u = Hi("editor"), p = h === "editor", k = Fe(
|
|
16205
16205
|
(T) => {
|
|
16206
16206
|
o("editor", T);
|
|
16207
16207
|
},
|
|
@@ -16213,17 +16213,17 @@ function bu({ authToken: t, onSave: s, onClose: n }) {
|
|
|
16213
16213
|
t && t.accessToken && b(t);
|
|
16214
16214
|
}, [t, b]), ue(() => {
|
|
16215
16215
|
var T, y;
|
|
16216
|
-
i ? ((T = r.current) == null || T.resize(40), c("editor", !0), v("editor")) : ((y = r.current) == null || y.resize(0), c("editor", !1),
|
|
16216
|
+
i ? ((T = r.current) == null || T.resize(40), c("editor", !0), v("editor")) : ((y = r.current) == null || y.resize(0), c("editor", !1), h === "editor" && l(null), v(null));
|
|
16217
16217
|
}, [
|
|
16218
16218
|
i,
|
|
16219
16219
|
c,
|
|
16220
16220
|
v,
|
|
16221
16221
|
l,
|
|
16222
|
-
|
|
16222
|
+
h
|
|
16223
16223
|
]);
|
|
16224
16224
|
function F(T) {
|
|
16225
16225
|
var y;
|
|
16226
|
-
T < 1 ? (x(!1), c("editor", !1),
|
|
16226
|
+
T < 1 ? (x(!1), c("editor", !1), h === "editor" && l(null), v(null), (y = r.current) == null || y.resize(0)) : (i || (x(!0), v("editor")), m.isOpen || c("editor", !0));
|
|
16227
16227
|
}
|
|
16228
16228
|
function I() {
|
|
16229
16229
|
return /* @__PURE__ */ a(ce, { children: [
|
|
@@ -16248,14 +16248,14 @@ function bu({ authToken: t, onSave: s, onClose: n }) {
|
|
|
16248
16248
|
"data-role": "editor-assistant-panel",
|
|
16249
16249
|
ref: r,
|
|
16250
16250
|
onResize: F,
|
|
16251
|
-
defaultSize:
|
|
16251
|
+
defaultSize: m.isOpen ? 40 : 0,
|
|
16252
16252
|
className: "flex",
|
|
16253
16253
|
children: /* @__PURE__ */ e("div", { className: "grow overflow-y-auto", children: /* @__PURE__ */ e(
|
|
16254
16254
|
ps,
|
|
16255
16255
|
{
|
|
16256
16256
|
isFullscreen: p,
|
|
16257
16257
|
onFullscreenChange: (T) => l(T ? "editor" : null),
|
|
16258
|
-
fullscreenContainer:
|
|
16258
|
+
fullscreenContainer: u
|
|
16259
16259
|
}
|
|
16260
16260
|
) })
|
|
16261
16261
|
}
|
|
@@ -16296,14 +16296,14 @@ function bu({ authToken: t, onSave: s, onClose: n }) {
|
|
|
16296
16296
|
"data-role": "editor-assistant-panel",
|
|
16297
16297
|
ref: r,
|
|
16298
16298
|
onResize: F,
|
|
16299
|
-
defaultSize:
|
|
16299
|
+
defaultSize: m.isOpen ? 40 : 0,
|
|
16300
16300
|
className: "flex",
|
|
16301
16301
|
children: /* @__PURE__ */ e("div", { className: "grow overflow-y-auto", children: /* @__PURE__ */ e(
|
|
16302
16302
|
ps,
|
|
16303
16303
|
{
|
|
16304
16304
|
isFullscreen: p,
|
|
16305
16305
|
onFullscreenChange: (T) => l(T ? "editor" : null),
|
|
16306
|
-
fullscreenContainer:
|
|
16306
|
+
fullscreenContainer: u
|
|
16307
16307
|
}
|
|
16308
16308
|
) })
|
|
16309
16309
|
}
|