@databrainhq/plugin 0.17.9-beta.47 → 0.17.9-beta.49
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/{Accordion-DLMkpjMx.mjs → Accordion-B1HmpZ2P.mjs} +1 -1
- package/dist/{CardChartSlot-Cqx5rc-5.mjs → CardChartSlot-BIIjmHsu.mjs} +616 -566
- package/dist/{Chart-CnS4idQI.mjs → Chart-BcmkjXMD.mjs} +60 -54
- package/dist/{ChartTypePanel-CeV5M5SQ.mjs → ChartTypePanel-DUwZ5B-_.mjs} +8 -8
- package/dist/{CreateGlobalFilter-DKwF-Iao.mjs → CreateGlobalFilter-DDtIpgRd.mjs} +2 -2
- package/dist/{CreateMetricV2-DPggXSWk.mjs → CreateMetricV2-BEXaszJA.mjs} +15 -15
- package/dist/{HorizontalStackTable-yf-l8lvj.mjs → HorizontalStackTable-BYQaEbea.mjs} +3 -3
- package/dist/{ManageMetricsV2-BRrSgY7w.mjs → ManageMetricsV2-C_6BeI6L.mjs} +3 -3
- package/dist/{MetricCardV2-CxeNPQQP.mjs → MetricCardV2-ChILinwX.mjs} +853 -842
- package/dist/{NoDataFound-BINw6Y12.mjs → NoDataFound-DtuATv-f.mjs} +1 -1
- package/dist/{Panel-DzPYLDDl.mjs → Panel-BCuB-6P0.mjs} +20 -20
- package/dist/{PivotTableV2-D9Lj9nWq.mjs → PivotTableV2-CXcYGUEl.mjs} +2 -2
- package/dist/{PivotTableV3--m_-X-4T.mjs → PivotTableV3-9ZxfPQvr.mjs} +4 -4
- package/dist/{Portal-BsPkfI4N.mjs → Portal-rrOaB4Bd.mjs} +2 -2
- package/dist/{RadioButton-BpO_7LIW.mjs → RadioButton-CdjohtqA.mjs} +1 -1
- package/dist/{ScheduleEmail-C7DLEstd.mjs → ScheduleEmail-B8LYb0Rp.mjs} +6 -6
- package/dist/{SearchMetricData-4z1FR3EV.mjs → SearchMetricData-Ch25t99l.mjs} +13 -13
- package/dist/{SortPanel-B0doOUAt.mjs → SortPanel-C5iHNq2W.mjs} +8 -8
- package/dist/{Table-yiT9hOaS.mjs → Table-CU_DPx7I.mjs} +84 -83
- package/dist/{TagInputField-iILkucCX.mjs → TagInputField-CFdoNB_N.mjs} +4 -4
- package/dist/{TextAreaField-1klDZ00B.mjs → TextAreaField-BCPTYecn.mjs} +2 -2
- package/dist/{TimeSeriesSettings-KOsSPF2S.mjs → TimeSeriesSettings-Cf0qN7IA.mjs} +2 -2
- package/dist/{cardQueryError-CWeSg4L9.mjs → cardQueryError-DswvG8Em.mjs} +9 -9
- package/dist/{conditionalFormatting-BfWx4ldB.mjs → conditionalFormatting-Dr6Ko980.mjs} +1 -1
- package/dist/{createGlobalFilter.module-C-vtJ58v.mjs → createGlobalFilter.module-CBdoZ9am.mjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{echarts-ZOgCIR7l.mjs → echarts-YvdpwAXr.mjs} +2 -2
- package/dist/{metric.mutation-BgklcDqd.mjs → metric.mutation-CpTlOouC.mjs} +1 -1
- package/dist/{permissions-D0tFL379.mjs → permissions-tSNA3qFl.mjs} +5 -5
- package/dist/{pluginV3Request-BVxZrR4v.mjs → pluginV3Request-vedxVBZb.mjs} +1 -1
- package/dist/{renderer-DegBsuVl.mjs → renderer-DY_lFWZ1.mjs} +1 -1
- package/dist/{timeseries-BAn41226.mjs → timeseries-zAu_-AJo.mjs} +1 -1
- package/dist/{toTasteAppearance-DBN4QaIw.mjs → toTasteAppearance-B4_PDCSX.mjs} +95 -92
- package/dist/{useGuesTokenUsageLog-Cgj9filf.mjs → useGuesTokenUsageLog-CbjKeY_o.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-ix_1Nf_o.mjs → usePublishArchivedMetrics-vrjAvHIS.mjs} +2 -2
- package/dist/{useQuery-zFv2LqWt.mjs → useQuery-D8fC1CBL.mjs} +1 -1
- package/dist/webcomponents.css +2 -2
- package/dist/webcomponents.es.js +1834 -1831
- package/dist/webcomponents.umd.js +108 -108
- package/package.json +1 -1
- package/types/index.d.ts +14 -0
|
@@ -2,21 +2,21 @@ import "react";
|
|
|
2
2
|
import "react-dom";
|
|
3
3
|
import "react-dom/client";
|
|
4
4
|
import { l as e } from "./cardStates-pxkuDK8H.mjs";
|
|
5
|
-
import { ht as t } from "./pluginV3Request-
|
|
6
|
-
import { $a as n, U as r, Va as i, _ as a, _r as o, er as s, uo as c, vr as l } from "./Portal-
|
|
7
|
-
import { s as u } from "./toTasteAppearance-
|
|
5
|
+
import { ht as t } from "./pluginV3Request-vedxVBZb.mjs";
|
|
6
|
+
import { $a as n, U as r, Va as i, _ as a, _r as o, er as s, uo as c, vr as l } from "./Portal-rrOaB4Bd.mjs";
|
|
7
|
+
import { s as u } from "./toTasteAppearance-B4_PDCSX.mjs";
|
|
8
8
|
import { n as d } from "./arrayToCsvString-Bj2E5XgM.mjs";
|
|
9
|
-
import { C as f, E as p, T as m, _ as h, a as g, d as _, g as ee, h as v, o as y, t as te, w as b, x
|
|
10
|
-
import { C as
|
|
11
|
-
import { t as
|
|
12
|
-
import { A as
|
|
13
|
-
import { c as
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { n as
|
|
17
|
-
import * as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
var
|
|
9
|
+
import { C as f, E as p, T as m, _ as h, a as g, d as _, g as ee, h as v, o as y, t as te, w as b, x } from "./permissions-tSNA3qFl.mjs";
|
|
10
|
+
import { C as ne, E as re, F as ie, S as ae, a as oe, b as se, i as ce, n as le, o as ue, r as de, s as fe, t as pe, w as me, x as he, y as ge } from "./cardQueryError-DswvG8Em.mjs";
|
|
11
|
+
import { t as S } from "./createLucideIcon-C-N26TaJ.mjs";
|
|
12
|
+
import { A as _e, B as ve, C as ye, D as be, E as C, F as xe, I as Se, L as Ce, M as we, N as Te, O as w, P as Ee, S as De, _ as Oe, a as T, b as ke, c as Ae, d as je, f as Me, g as Ne, h as Pe, i as Fe, j as Ie, k as Le, m as Re, n as ze, p as Be, s as Ve, t as He, u as Ue, v as We, w as Ge, x as Ke, y as qe } from "./CardChartSlot-BIIjmHsu.mjs";
|
|
13
|
+
import { c as E, d as Je, f as Ye, h as D, l as Xe, o as Ze, p as Qe, s as $e, u as et } from "./qaSelectors-CqSLYZ9l.mjs";
|
|
14
|
+
import { n as tt, t as nt } from "./x-DDC7VFx5.mjs";
|
|
15
|
+
import { t as O } from "./dist-C0uxSp1k.mjs";
|
|
16
|
+
import { n as rt } from "./cardActions-DEbl3R_a.mjs";
|
|
17
|
+
import * as k from "react";
|
|
18
|
+
import { Fragment as it, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
19
|
+
var at = S("copy", [["rect", {
|
|
20
20
|
width: "14",
|
|
21
21
|
height: "14",
|
|
22
22
|
x: "8",
|
|
@@ -27,19 +27,19 @@ var ot = x("copy", [["rect", {
|
|
|
27
27
|
}], ["path", {
|
|
28
28
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
29
29
|
key: "zix9uf"
|
|
30
|
-
}]]),
|
|
30
|
+
}]]), ot = S("corner-down-right", [["path", {
|
|
31
31
|
d: "m15 10 5 5-5 5",
|
|
32
32
|
key: "qqa56n"
|
|
33
33
|
}], ["path", {
|
|
34
34
|
d: "M4 4v7a4 4 0 0 0 4 4h12",
|
|
35
35
|
key: "z08zvw"
|
|
36
|
-
}]]),
|
|
36
|
+
}]]), st = S("corner-left-up", [["path", {
|
|
37
37
|
d: "M14 9 9 4 4 9",
|
|
38
38
|
key: "1af5af"
|
|
39
39
|
}], ["path", {
|
|
40
40
|
d: "M20 20h-7a4 4 0 0 1-4-4V4",
|
|
41
41
|
key: "1blwi3"
|
|
42
|
-
}]]),
|
|
42
|
+
}]]), ct = S("download", [
|
|
43
43
|
["path", {
|
|
44
44
|
d: "M12 15V3",
|
|
45
45
|
key: "m9g1x1"
|
|
@@ -52,7 +52,7 @@ var ot = x("copy", [["rect", {
|
|
|
52
52
|
d: "m7 10 5 5 5-5",
|
|
53
53
|
key: "brsn70"
|
|
54
54
|
}]
|
|
55
|
-
]),
|
|
55
|
+
]), lt = S("ellipsis-vertical", [
|
|
56
56
|
["circle", {
|
|
57
57
|
cx: "12",
|
|
58
58
|
cy: "12",
|
|
@@ -71,7 +71,7 @@ var ot = x("copy", [["rect", {
|
|
|
71
71
|
r: "1",
|
|
72
72
|
key: "lyex9k"
|
|
73
73
|
}]
|
|
74
|
-
]),
|
|
74
|
+
]), ut = S("git-merge", [
|
|
75
75
|
["circle", {
|
|
76
76
|
cx: "18",
|
|
77
77
|
cy: "18",
|
|
@@ -88,7 +88,7 @@ var ot = x("copy", [["rect", {
|
|
|
88
88
|
d: "M6 21V9a9 9 0 0 0 9 9",
|
|
89
89
|
key: "7kw0sc"
|
|
90
90
|
}]
|
|
91
|
-
]),
|
|
91
|
+
]), dt = S("image", [
|
|
92
92
|
["rect", {
|
|
93
93
|
width: "18",
|
|
94
94
|
height: "18",
|
|
@@ -108,7 +108,7 @@ var ot = x("copy", [["rect", {
|
|
|
108
108
|
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
109
109
|
key: "1xmnt7"
|
|
110
110
|
}]
|
|
111
|
-
]),
|
|
111
|
+
]), ft = S("mail", [["path", {
|
|
112
112
|
d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",
|
|
113
113
|
key: "132q7q"
|
|
114
114
|
}], ["rect", {
|
|
@@ -118,7 +118,7 @@ var ot = x("copy", [["rect", {
|
|
|
118
118
|
height: "16",
|
|
119
119
|
rx: "2",
|
|
120
120
|
key: "izxlao"
|
|
121
|
-
}]]),
|
|
121
|
+
}]]), pt = S("settings", [["path", {
|
|
122
122
|
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
123
123
|
key: "1i5ecw"
|
|
124
124
|
}], ["circle", {
|
|
@@ -126,12 +126,12 @@ var ot = x("copy", [["rect", {
|
|
|
126
126
|
cy: "12",
|
|
127
127
|
r: "3",
|
|
128
128
|
key: "1v7zrd"
|
|
129
|
-
}]]),
|
|
129
|
+
}]]), mt = (e) => e === "contextmenu" ? "secondary" : "primary", ht = ({ route: e, canCrossFilter: t }) => !!t && e === "drill", gt = ({ gesture: e, route: t, canCrossFilter: n, canDrillInto: r, hasPointMenu: i }) => {
|
|
130
130
|
if (t === "terminal") return {
|
|
131
131
|
drillDown: !1,
|
|
132
132
|
adhocMenu: !1
|
|
133
133
|
};
|
|
134
|
-
let a =
|
|
134
|
+
let a = ht({
|
|
135
135
|
route: t,
|
|
136
136
|
canCrossFilter: n
|
|
137
137
|
}), o = !!r;
|
|
@@ -144,7 +144,7 @@ var ot = x("copy", [["rect", {
|
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
146
|
_.map((e) => e.value), Object.fromEntries(_.map((e) => [e.value, e.label]));
|
|
147
|
-
var
|
|
147
|
+
var _t = (e) => {
|
|
148
148
|
let t = e?.levels || [], n = t.findIndex((e) => e?.isEnable), r = n >= 0 ? n + 1 : 0, i = t.slice(0, Math.max(r, 0)).some((e) => (e?.dimensions || []).some((e) => !!e?.timeGrain)), a = n >= 0 ? t[n] : void 0;
|
|
149
149
|
return {
|
|
150
150
|
activeIndex: n,
|
|
@@ -153,8 +153,8 @@ var vt = (e) => {
|
|
|
153
153
|
usedAliases: h(a?.dimensions),
|
|
154
154
|
activeLevel: a
|
|
155
155
|
};
|
|
156
|
-
},
|
|
157
|
-
let t =
|
|
156
|
+
}, vt = (e) => {
|
|
157
|
+
let t = _t(e.config), n = v({
|
|
158
158
|
subset: e.subset,
|
|
159
159
|
configuration: e.configuration,
|
|
160
160
|
usedAliases: t.usedAliases,
|
|
@@ -166,8 +166,8 @@ var vt = (e) => {
|
|
|
166
166
|
selectedDims: e.selectedDims,
|
|
167
167
|
usedAliases: t.usedAliases
|
|
168
168
|
});
|
|
169
|
-
},
|
|
170
|
-
let e =
|
|
169
|
+
}, M = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius-xs) px-2 text-(--muted-foreground) hover:text-(--foreground) hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)", yt = 4, bt = () => {
|
|
170
|
+
let e = k.useRef(null);
|
|
171
171
|
return {
|
|
172
172
|
navRef: e,
|
|
173
173
|
onKeyDown: (t) => {
|
|
@@ -184,10 +184,10 @@ var vt = (e) => {
|
|
|
184
184
|
a = Math.min(Math.max(a, 0), r.length - 1), a !== i && (t.preventDefault(), r[a]?.focus());
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
},
|
|
188
|
-
let a = `${
|
|
187
|
+
}, xt = ({ crumbs: e, onDrillLevelClick: t, onResetDrill: n, onUp: r, className: i }) => {
|
|
188
|
+
let a = `${k.useId()}-drill-up-reason`, { navRef: o, onKeyDown: s } = bt(), c = e.length, [l, u] = k.useState(null), d = l === c;
|
|
189
189
|
if (!e.length) return null;
|
|
190
|
-
let f = !d && e.length >
|
|
190
|
+
let f = !d && e.length > yt, p = f ? e.length - 3 : 0, m = f ? [
|
|
191
191
|
{
|
|
192
192
|
kind: "crumb",
|
|
193
193
|
crumb: e[0],
|
|
@@ -204,16 +204,16 @@ var vt = (e) => {
|
|
|
204
204
|
crumb: e,
|
|
205
205
|
position: t
|
|
206
206
|
})), h = (e.length > 1 ? e[e.length - 2] : void 0)?.index, g = !h, _ = "Unavailable: this is the first level of the drill. Use All to clear the drill.";
|
|
207
|
-
return /* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ j("nav", {
|
|
208
208
|
ref: o,
|
|
209
209
|
"aria-label": "Drill-down breadcrumb",
|
|
210
210
|
"data-testid": "metric-card-drill-crumbs",
|
|
211
211
|
onKeyDown: r ? s : void 0,
|
|
212
|
-
className:
|
|
213
|
-
children: [/* @__PURE__ */
|
|
212
|
+
className: O("flex min-w-0 flex-wrap items-center gap-1 pb-1.5 text-xs", i),
|
|
213
|
+
children: [/* @__PURE__ */ j("div", {
|
|
214
214
|
className: "sticky left-0 z-10 flex shrink-0 items-center gap-1 bg-(--card) pr-1",
|
|
215
|
-
children: [r ? /* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
215
|
+
children: [r ? /* @__PURE__ */ j(it, { children: [
|
|
216
|
+
/* @__PURE__ */ j("button", {
|
|
217
217
|
type: "button",
|
|
218
218
|
"aria-disabled": g || void 0,
|
|
219
219
|
"aria-describedby": g ? a : void 0,
|
|
@@ -222,209 +222,209 @@ var vt = (e) => {
|
|
|
222
222
|
h && r(h);
|
|
223
223
|
},
|
|
224
224
|
"data-testid": "metric-card-drill-crumb-up",
|
|
225
|
-
className:
|
|
225
|
+
className: O(M, "inline-flex max-w-none items-center gap-1", g && "cursor-not-allowed opacity-60 hover:text-(--muted-foreground) hover:no-underline"),
|
|
226
226
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ A(st, {
|
|
228
228
|
className: "size-3",
|
|
229
229
|
"aria-hidden": "true"
|
|
230
230
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ A("span", { children: "Up" }),
|
|
232
|
+
/* @__PURE__ */ A("span", {
|
|
233
233
|
className: "sr-only",
|
|
234
234
|
children: " one level"
|
|
235
235
|
})
|
|
236
236
|
]
|
|
237
237
|
}),
|
|
238
|
-
g ? /* @__PURE__ */
|
|
238
|
+
g ? /* @__PURE__ */ A("span", {
|
|
239
239
|
id: a,
|
|
240
240
|
"data-testid": "metric-card-drill-crumb-up-reason",
|
|
241
241
|
className: "sr-only",
|
|
242
242
|
children: _
|
|
243
243
|
}) : null,
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ A("span", {
|
|
245
245
|
"aria-hidden": "true",
|
|
246
246
|
className: "mx-0.5 h-3 w-px shrink-0 bg-(--border)"
|
|
247
247
|
})
|
|
248
|
-
] }) : null, /* @__PURE__ */
|
|
248
|
+
] }) : null, /* @__PURE__ */ A("button", {
|
|
249
249
|
type: "button",
|
|
250
250
|
onClick: n,
|
|
251
251
|
"data-testid": "metric-card-drill-crumb-reset",
|
|
252
|
-
className:
|
|
252
|
+
className: M,
|
|
253
253
|
children: "All"
|
|
254
254
|
})]
|
|
255
255
|
}), m.map((n, r) => {
|
|
256
|
-
if (n.kind === "ellipsis") return /* @__PURE__ */
|
|
256
|
+
if (n.kind === "ellipsis") return /* @__PURE__ */ j(k.Fragment, { children: [/* @__PURE__ */ A("span", {
|
|
257
257
|
"aria-hidden": "true",
|
|
258
258
|
className: "shrink-0 text-(--muted-foreground)",
|
|
259
259
|
children: "/"
|
|
260
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ A("button", {
|
|
261
261
|
type: "button",
|
|
262
262
|
onClick: () => u(c),
|
|
263
263
|
"data-testid": "metric-card-drill-crumb-expand",
|
|
264
264
|
"aria-label": `Show ${p} hidden levels`,
|
|
265
265
|
title: `Show ${p} hidden levels`,
|
|
266
|
-
className:
|
|
266
|
+
className: O(M, "max-w-none"),
|
|
267
267
|
children: "..."
|
|
268
268
|
})] }, "ellipsis");
|
|
269
269
|
let { crumb: i, position: a } = n, o = a === e.length - 1, s = i.value !== void 0 && i.value !== null && i.value !== "" ? `${i.label}: ${String(i.value)}` : i.label;
|
|
270
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ j(k.Fragment, { children: [/* @__PURE__ */ A("span", {
|
|
271
271
|
"aria-hidden": "true",
|
|
272
272
|
className: "shrink-0 text-(--muted-foreground)",
|
|
273
273
|
children: "/"
|
|
274
|
-
}), o ? /* @__PURE__ */
|
|
274
|
+
}), o ? /* @__PURE__ */ A("span", {
|
|
275
275
|
"aria-current": "step",
|
|
276
276
|
title: s,
|
|
277
277
|
"data-testid": "metric-card-drill-crumb-current",
|
|
278
278
|
className: "min-w-0 max-w-full whitespace-normal break-words font-medium text-(--foreground)",
|
|
279
279
|
children: s
|
|
280
|
-
}) : /* @__PURE__ */
|
|
280
|
+
}) : /* @__PURE__ */ A("button", {
|
|
281
281
|
type: "button",
|
|
282
282
|
title: s,
|
|
283
283
|
onClick: () => t(i.index),
|
|
284
284
|
"data-testid": `metric-card-drill-crumb-${i.index}`,
|
|
285
|
-
className:
|
|
286
|
-
children: /* @__PURE__ */
|
|
285
|
+
className: M,
|
|
286
|
+
children: /* @__PURE__ */ A("span", {
|
|
287
287
|
className: "max-w-48 truncate",
|
|
288
288
|
children: s
|
|
289
289
|
})
|
|
290
290
|
})] }, i.index || `${i.label}-${a}-${r}`);
|
|
291
291
|
})]
|
|
292
292
|
});
|
|
293
|
-
},
|
|
293
|
+
}, St = ({ longDescription: e, meta: t, className: n }) => !e && !t ? null : /* @__PURE__ */ j("div", {
|
|
294
294
|
"data-testid": "metric-card-footer",
|
|
295
|
-
className:
|
|
296
|
-
children: [t ? /* @__PURE__ */
|
|
295
|
+
className: O("flex flex-col gap-1 text-xs text-(--muted-foreground)", n),
|
|
296
|
+
children: [t ? /* @__PURE__ */ A("div", {
|
|
297
297
|
"data-testid": "metric-card-footer-meta",
|
|
298
298
|
children: t
|
|
299
|
-
}) : null, e ? /* @__PURE__ */
|
|
299
|
+
}) : null, e ? /* @__PURE__ */ A("div", {
|
|
300
300
|
"data-testid": "metric-card-long-description",
|
|
301
301
|
className: "text-(--muted-foreground)",
|
|
302
302
|
dangerouslySetInnerHTML: { __html: r(e) }
|
|
303
303
|
}) : null]
|
|
304
|
-
}),
|
|
304
|
+
}), Ct = ({ title: e, description: t, isDisableCardTitle: n, infoContent: r, actions: i, onTitleClick: a, className: o }) => {
|
|
305
305
|
let s = !n && (e != null || t != null);
|
|
306
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ j("div", {
|
|
307
307
|
"data-slot": "metric-card-header",
|
|
308
|
-
className:
|
|
309
|
-
children: [/* @__PURE__ */
|
|
308
|
+
className: O("flex w-full items-start gap-2", o),
|
|
309
|
+
children: [/* @__PURE__ */ A("div", {
|
|
310
310
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
311
|
-
children: s ? /* @__PURE__ */
|
|
311
|
+
children: s ? /* @__PURE__ */ j(it, { children: [e == null ? null : /* @__PURE__ */ j("div", {
|
|
312
312
|
className: "flex min-w-0 items-center gap-1",
|
|
313
|
-
children: [a ? /* @__PURE__ */
|
|
313
|
+
children: [a ? /* @__PURE__ */ A("h2", {
|
|
314
314
|
className: "min-w-0 truncate text-sm font-semibold",
|
|
315
|
-
children: /* @__PURE__ */
|
|
315
|
+
children: /* @__PURE__ */ A("button", {
|
|
316
316
|
type: "button",
|
|
317
317
|
"data-testid": "metric-card-title",
|
|
318
318
|
onClick: a,
|
|
319
319
|
className: "min-w-0 cursor-pointer truncate border-0 bg-transparent p-0 text-left text-sm font-semibold text-(--foreground) hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)",
|
|
320
320
|
children: e
|
|
321
321
|
})
|
|
322
|
-
}) : /* @__PURE__ */
|
|
322
|
+
}) : /* @__PURE__ */ A("h2", {
|
|
323
323
|
"data-testid": "metric-card-title",
|
|
324
324
|
className: "truncate text-sm font-semibold text-(--foreground)",
|
|
325
325
|
children: e
|
|
326
|
-
}), r == null ? null : /* @__PURE__ */
|
|
326
|
+
}), r == null ? null : /* @__PURE__ */ A(Be, { children: /* @__PURE__ */ j(je, { children: [/* @__PURE__ */ A(Re, {
|
|
327
327
|
asChild: !0,
|
|
328
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ A(E, {
|
|
329
329
|
type: "button",
|
|
330
330
|
variant: "ghost",
|
|
331
331
|
size: "icon-sm",
|
|
332
332
|
"data-testid": "metric-card-info-trigger",
|
|
333
333
|
"aria-label": "More information",
|
|
334
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ A(Ce, {
|
|
335
335
|
className: "size-3.5",
|
|
336
336
|
"aria-hidden": "true"
|
|
337
337
|
})
|
|
338
338
|
})
|
|
339
|
-
}), /* @__PURE__ */
|
|
339
|
+
}), /* @__PURE__ */ A(Me, {
|
|
340
340
|
"data-testid": "metric-card-info-content",
|
|
341
341
|
children: r
|
|
342
342
|
})] }) })]
|
|
343
|
-
}), t == null ? null : /* @__PURE__ */
|
|
343
|
+
}), t == null ? null : /* @__PURE__ */ A("span", {
|
|
344
344
|
"data-testid": "metric-card-description",
|
|
345
345
|
className: "truncate text-sm text-(--muted-foreground)",
|
|
346
346
|
children: t
|
|
347
347
|
})] }) : null
|
|
348
|
-
}), i == null ? null : /* @__PURE__ */
|
|
348
|
+
}), i == null ? null : /* @__PURE__ */ A("div", {
|
|
349
349
|
"data-testid": "metric-card-actions",
|
|
350
350
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
351
351
|
children: i
|
|
352
352
|
})]
|
|
353
353
|
});
|
|
354
|
-
},
|
|
355
|
-
let { enableDownloadCsv: f, enableEmailCsv: p, disableDownloadPng: m, disableDownloadDataNoFilters: h = !1, disableUnderlyingData: g, disableDownloadUnderlyingDataNoFilters: _ = !1, disableFullscreen: ee } = e, v = !!f && !!t, y = !m && !!n, te = !!p && !!r, b = v || y || te,
|
|
356
|
-
return !b && !
|
|
354
|
+
}, wt = ({ flags: e = {}, onDownloadCsv: t, onDownloadPng: n, onEmailCsv: r, onFullscreen: i, onUnderlyingData: a, onSettings: o, splitBySubmenu: s, optionsIcon: c, settingsIcon: l, defaultOpen: u, className: d }) => {
|
|
355
|
+
let { enableDownloadCsv: f, enableEmailCsv: p, disableDownloadPng: m, disableDownloadDataNoFilters: h = !1, disableUnderlyingData: g, disableDownloadUnderlyingDataNoFilters: _ = !1, disableFullscreen: ee } = e, v = !!f && !!t, y = !m && !!n, te = !!p && !!r, b = v || y || te, x = !ee && !!i, ne = !g && !!a, re = x || ne, ie = !!o, ae = !!s;
|
|
356
|
+
return !b && !re && !ie && !ae ? null : /* @__PURE__ */ j(ye, {
|
|
357
357
|
defaultOpen: u,
|
|
358
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ A(we, {
|
|
359
359
|
asChild: !0,
|
|
360
|
-
children: /* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ A(E, {
|
|
361
361
|
type: "button",
|
|
362
362
|
variant: "ghost",
|
|
363
363
|
size: "icon-sm",
|
|
364
|
-
className:
|
|
364
|
+
className: O("size-8", d),
|
|
365
365
|
"aria-label": "Card options",
|
|
366
366
|
"data-testid": "metric-card-options-trigger",
|
|
367
|
-
children: c ?? /* @__PURE__ */
|
|
367
|
+
children: c ?? /* @__PURE__ */ A(lt, {})
|
|
368
368
|
})
|
|
369
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ j(Ge, {
|
|
370
370
|
align: "end",
|
|
371
371
|
children: [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
v && /* @__PURE__ */
|
|
372
|
+
ae && s,
|
|
373
|
+
ae && (b || re || ie) && /* @__PURE__ */ A(w, {}),
|
|
374
|
+
v && /* @__PURE__ */ j(C, {
|
|
375
375
|
className: "min-h-8",
|
|
376
376
|
"data-testid": "metric-card-option-download-csv",
|
|
377
377
|
onSelect: () => t?.({ withoutFilters: !1 }),
|
|
378
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ A(ct, {}), "Download CSV"]
|
|
379
379
|
}),
|
|
380
|
-
v && !h && /* @__PURE__ */
|
|
380
|
+
v && !h && /* @__PURE__ */ j(C, {
|
|
381
381
|
className: "min-h-8",
|
|
382
382
|
"data-testid": "metric-card-option-download-csv-nofilter",
|
|
383
383
|
onSelect: () => t?.({ withoutFilters: !0 }),
|
|
384
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ A(ct, {}), "Download CSV without filters"]
|
|
385
385
|
}),
|
|
386
|
-
y && /* @__PURE__ */
|
|
386
|
+
y && /* @__PURE__ */ j(C, {
|
|
387
387
|
className: "min-h-8",
|
|
388
388
|
"data-testid": "metric-card-option-download-png",
|
|
389
389
|
onSelect: () => n?.(),
|
|
390
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ A(dt, {}), "Download PNG"]
|
|
391
391
|
}),
|
|
392
|
-
te && /* @__PURE__ */
|
|
392
|
+
te && /* @__PURE__ */ j(C, {
|
|
393
393
|
className: "min-h-8",
|
|
394
394
|
"data-testid": "metric-card-option-email-csv",
|
|
395
395
|
onSelect: () => r?.(),
|
|
396
|
-
children: [/* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ A(ft, {}), "Email CSV"]
|
|
397
397
|
}),
|
|
398
|
-
b &&
|
|
399
|
-
|
|
398
|
+
b && re && /* @__PURE__ */ A(w, {}),
|
|
399
|
+
x && /* @__PURE__ */ j(C, {
|
|
400
400
|
className: "min-h-8",
|
|
401
401
|
"data-testid": "metric-card-option-fullscreen",
|
|
402
402
|
onSelect: () => i?.(),
|
|
403
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ A(Se, {}), "Fullscreen"]
|
|
404
404
|
}),
|
|
405
|
-
|
|
405
|
+
ne && /* @__PURE__ */ j(C, {
|
|
406
406
|
className: "min-h-8",
|
|
407
407
|
"data-testid": "metric-card-option-underlying-data",
|
|
408
408
|
onSelect: () => a?.({ withoutFilters: !1 }),
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ A(D, {}), "Underlying Data"]
|
|
410
410
|
}),
|
|
411
|
-
|
|
411
|
+
ne && !_ && /* @__PURE__ */ j(C, {
|
|
412
412
|
className: "min-h-8",
|
|
413
413
|
"data-testid": "metric-card-option-underlying-data-nofilter",
|
|
414
414
|
onSelect: () => a?.({ withoutFilters: !0 }),
|
|
415
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ A(D, {}), "Underlying Data without filters"]
|
|
416
416
|
}),
|
|
417
|
-
(b ||
|
|
418
|
-
|
|
417
|
+
(b || re) && ie && /* @__PURE__ */ A(w, {}),
|
|
418
|
+
ie && /* @__PURE__ */ j(C, {
|
|
419
419
|
className: "min-h-8",
|
|
420
420
|
"data-testid": "metric-card-option-settings",
|
|
421
421
|
onSelect: () => o?.(),
|
|
422
|
-
children: [l ?? /* @__PURE__ */
|
|
422
|
+
children: [l ?? /* @__PURE__ */ A(pt, {}), "Edit metric"]
|
|
423
423
|
})
|
|
424
424
|
]
|
|
425
425
|
})]
|
|
426
426
|
});
|
|
427
|
-
},
|
|
427
|
+
}, Tt = k.lazy(() => import("./DatePickerCalendar-uant91M3.mjs")), Et = [
|
|
428
428
|
{
|
|
429
429
|
type: "day",
|
|
430
430
|
label: "Today",
|
|
@@ -491,83 +491,83 @@ var vt = (e) => {
|
|
|
491
491
|
startOffset: 0,
|
|
492
492
|
endOffset: 0
|
|
493
493
|
}
|
|
494
|
-
],
|
|
494
|
+
], Dt = ({ type: e, label: t, startOffset: n, endOffset: r }) => {
|
|
495
495
|
let i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date(), o = /* @__PURE__ */ new Date();
|
|
496
496
|
return e === "all_time" ? (a = new Date(1, 0, 1), o = new Date(9999, 11, 31)) : e === "month" ? t === "Last 6 Months" ? (a.setMonth(i.getMonth() - 6), a.setDate(1), o.setMonth(i.getMonth()), o.setDate(0)) : t === "Last 3 Months" ? (a.setMonth(i.getMonth() - 3), a.setDate(1), o.setMonth(i.getMonth()), o.setDate(0)) : t === "Last Month" ? (a = new Date(i.getFullYear(), i.getMonth() - 1, 1), o = new Date(i.getFullYear(), i.getMonth(), 0)) : (a = new Date(i.getFullYear(), i.getMonth() + n, 1), n === 0 && (a.setDate(1), o = new Date(i.getFullYear(), i.getMonth() + 1, 0))) : e === "year" ? (a = new Date(i.getFullYear() + n, 0, 1), n === 0 && (a.setMonth(0), a.setDate(1)), o = t === "Last Year" ? new Date(i.getFullYear() + n, 11, 31) : new Date(i.getFullYear(), 11, 31)) : (a = new Date(i.getFullYear(), i.getMonth(), i.getDate() + n), o = new Date(i.getFullYear(), i.getMonth(), i.getDate() + r)), {
|
|
497
497
|
start: a,
|
|
498
498
|
end: o
|
|
499
499
|
};
|
|
500
|
-
},
|
|
500
|
+
}, Ot = (e) => e ? `${e.getFullYear()}-${`0${e.getMonth() + 1}`.slice(-2)}-${`0${e.getDate()}`.slice(-2)}` : "", kt = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), At = (e, t, n) => {
|
|
501
501
|
if (!e || !t) return null;
|
|
502
|
-
let r =
|
|
502
|
+
let r = Ot(e), i = Ot(t);
|
|
503
503
|
return {
|
|
504
504
|
value: `${r} - ${i}`,
|
|
505
|
-
startDate:
|
|
506
|
-
endDate:
|
|
505
|
+
startDate: kt(e),
|
|
506
|
+
endDate: kt(t),
|
|
507
507
|
timeGrainValue: n || `${r} - ${i}`
|
|
508
508
|
};
|
|
509
|
-
},
|
|
509
|
+
}, jt = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), N = new Intl.DateTimeFormat("en-US", {
|
|
510
510
|
year: "numeric",
|
|
511
511
|
month: "short",
|
|
512
512
|
day: "numeric"
|
|
513
|
-
}),
|
|
514
|
-
let [d, f] =
|
|
513
|
+
}), P = (e) => N.format(e), Mt = (e) => Et.some((t) => t.label === e), F = (e, t, n) => !e || !t ? "Select date range" : n && Mt(n) ? n : `${P(e)} - ${P(t)}`, Nt = ({ value: e, onChange: t, defaultOption: n, minDate: r, maxDate: i, hideDatePickerOptions: o, calendarType: s = "default", hidden: c, defaultOpen: l, className: u }) => {
|
|
514
|
+
let [d, f] = k.useState(e?.startDate ?? n?.startDate), [p, m] = k.useState(e?.endDate ?? n?.endDate), [h, g] = k.useState(n?.timeGrainValue ?? ""), _ = k.useMemo(() => new Set((o ?? []).map((e) => e.toLowerCase())), [o]), ee = k.useMemo(() => Et.filter((e) => !_.has(e.label.toLowerCase())), [_]);
|
|
515
515
|
if (c) return null;
|
|
516
516
|
let v = s === "ind", y = (e, n, r) => {
|
|
517
|
-
let i =
|
|
517
|
+
let i = At(e, n, r);
|
|
518
518
|
i && t(i);
|
|
519
519
|
}, te = (e) => {
|
|
520
|
-
let { start: t, end: n } =
|
|
520
|
+
let { start: t, end: n } = Dt(e);
|
|
521
521
|
f(t), m(n), g(e.label), y(t, n, e.label);
|
|
522
522
|
}, b = (e) => {
|
|
523
523
|
let [t, n] = e;
|
|
524
524
|
if (f(t ?? void 0), m(n ?? void 0), t && n) {
|
|
525
|
-
let e = `${
|
|
525
|
+
let e = `${Ot(t)} - ${Ot(n)}`;
|
|
526
526
|
g(e), y(t, n, e);
|
|
527
527
|
}
|
|
528
|
-
},
|
|
529
|
-
return /* @__PURE__ */
|
|
528
|
+
}, x = F(d, p, h);
|
|
529
|
+
return /* @__PURE__ */ j(ke, {
|
|
530
530
|
defaultOpen: l,
|
|
531
|
-
children: [/* @__PURE__ */
|
|
531
|
+
children: [/* @__PURE__ */ A(De, {
|
|
532
532
|
asChild: !0,
|
|
533
|
-
children: /* @__PURE__ */
|
|
533
|
+
children: /* @__PURE__ */ j(E, {
|
|
534
534
|
type: "button",
|
|
535
535
|
variant: "outline",
|
|
536
536
|
size: "sm",
|
|
537
|
-
className:
|
|
538
|
-
"aria-label": d && p ? `Select date range, currently ${
|
|
537
|
+
className: O(u),
|
|
538
|
+
"aria-label": d && p ? `Select date range, currently ${x}` : "Select date range",
|
|
539
539
|
"data-testid": "date-picker-control-trigger",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ A(a, {}), x]
|
|
541
541
|
})
|
|
542
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ j(Ke, {
|
|
543
543
|
align: "end",
|
|
544
544
|
padding: "form",
|
|
545
|
-
className:
|
|
545
|
+
className: O("flex w-auto gap-3", "[&_.react-datepicker]:border-none [&_.react-datepicker]:bg-(--popover) [&_.react-datepicker]:font-sans [&_.react-datepicker]:text-(--foreground) [&_.react-datepicker]:shadow-none", "[&_.react-datepicker__month-container]:bg-(--popover)", "[&_.react-datepicker__header]:border-b [&_.react-datepicker__header]:border-(--border) [&_.react-datepicker__header]:bg-(--muted)", "[&_.react-datepicker__current-month]:text-(--foreground)", "[&_.react-datepicker__day-name]:text-(--muted-foreground)", "[&_.react-datepicker__day]:text-(--foreground)", "[&_.react-datepicker__day:hover]:bg-(--accent)", "[&_.react-datepicker__day--outside-month]:text-(--muted-foreground)", "[&_.react-datepicker__day--selected]:bg-(--primary) [&_.react-datepicker__day--selected]:text-(--primary-foreground)", "[&_.react-datepicker__day--range-start]:bg-(--primary) [&_.react-datepicker__day--range-start]:text-(--primary-foreground)", "[&_.react-datepicker__day--range-end]:bg-(--primary) [&_.react-datepicker__day--range-end]:text-(--primary-foreground)", "[&_.react-datepicker__day--in-range]:bg-(--accent) [&_.react-datepicker__day--in-range]:text-(--foreground)", "[&_.react-datepicker__day--in-selecting-range]:bg-(--accent) [&_.react-datepicker__day--in-selecting-range]:text-(--foreground)", "[&_.react-datepicker__day--keyboard-selected]:bg-(--accent) [&_.react-datepicker__day--keyboard-selected]:text-(--foreground)", "[&_.react-datepicker__day:focus-visible]:outline [&_.react-datepicker__day:focus-visible]:outline-2 [&_.react-datepicker__day:focus-visible]:outline-(--ring)", "[&_.react-datepicker__navigation-icon::before]:border-(--border)", "[&_.react-datepicker__triangle]:hidden"),
|
|
546
546
|
"data-testid": "date-picker-control-content",
|
|
547
547
|
"data-fiscal": v,
|
|
548
|
-
children: [/* @__PURE__ */
|
|
548
|
+
children: [/* @__PURE__ */ A("div", {
|
|
549
549
|
className: "flex w-36 shrink-0 flex-col gap-0.5 border-r border-(--border) pr-3",
|
|
550
550
|
"data-testid": "date-picker-control-presets",
|
|
551
551
|
"aria-label": "Date range presets",
|
|
552
552
|
children: ee.map((e) => {
|
|
553
553
|
let t = e.label === h;
|
|
554
|
-
return /* @__PURE__ */
|
|
554
|
+
return /* @__PURE__ */ A(E, {
|
|
555
555
|
type: "button",
|
|
556
556
|
variant: t ? "primary" : "ghost",
|
|
557
557
|
size: "sm",
|
|
558
558
|
className: "justify-start",
|
|
559
559
|
"aria-pressed": t,
|
|
560
|
-
"data-testid": `date-picker-preset-${
|
|
560
|
+
"data-testid": `date-picker-preset-${jt(e.label)}`,
|
|
561
561
|
onClick: () => te(e),
|
|
562
562
|
children: e.label
|
|
563
563
|
}, e.label);
|
|
564
564
|
})
|
|
565
|
-
}), /* @__PURE__ */ k
|
|
566
|
-
fallback: /* @__PURE__ */
|
|
565
|
+
}), /* @__PURE__ */ A(k.Suspense, {
|
|
566
|
+
fallback: /* @__PURE__ */ A("div", {
|
|
567
567
|
className: "h-64 w-xl",
|
|
568
568
|
"aria-hidden": "true"
|
|
569
569
|
}),
|
|
570
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ A(Tt, {
|
|
571
571
|
startDate: d,
|
|
572
572
|
endDate: p,
|
|
573
573
|
onChange: b,
|
|
@@ -577,38 +577,38 @@ var vt = (e) => {
|
|
|
577
577
|
})]
|
|
578
578
|
})]
|
|
579
579
|
});
|
|
580
|
-
},
|
|
580
|
+
}, I = 12, Pt = (e) => e.groups.reduce((e, t) => e + t.options.length, 0), Ft = (e) => {
|
|
581
581
|
switch (e.unavailableReason) {
|
|
582
582
|
case "all-dimensions-used": return "This chart already uses every field you can split by.";
|
|
583
583
|
case "max-depth-reached": return "Go back a step to split by something else.";
|
|
584
584
|
case "custom-sql": return "This chart cannot be split by another field. You can still view its underlying data.";
|
|
585
585
|
default: return "No other fields to split by.";
|
|
586
586
|
}
|
|
587
|
-
},
|
|
588
|
-
let [i, a] =
|
|
587
|
+
}, It = ({ pool: e, onDrillInto: t, testIdPrefix: n = "metric-card-drill", gestureHint: r }) => {
|
|
588
|
+
let [i, a] = k.useState(""), o = Pt(e) > I, s = k.useMemo(() => {
|
|
589
589
|
let t = i.trim().toLowerCase();
|
|
590
590
|
return t ? e.groups.map((e) => ({
|
|
591
591
|
...e,
|
|
592
592
|
options: e.options.filter((e) => e.label.toLowerCase().includes(t))
|
|
593
593
|
})).filter((e) => e.options.length > 0) : e.groups;
|
|
594
594
|
}, [e.groups, i]);
|
|
595
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ j(Le, { children: [/* @__PURE__ */ j(Ie, {
|
|
596
596
|
"data-testid": `${n}-trigger`,
|
|
597
597
|
children: [
|
|
598
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ A(ot, {}),
|
|
599
599
|
"Split by",
|
|
600
|
-
r ? /* @__PURE__ */
|
|
600
|
+
r ? /* @__PURE__ */ A("span", {
|
|
601
601
|
"data-testid": `${n}-gesture-hint`,
|
|
602
602
|
className: "ml-auto shrink-0 pl-4 text-caption text-(--muted-foreground)",
|
|
603
603
|
children: r
|
|
604
604
|
}) : null
|
|
605
605
|
]
|
|
606
|
-
}), /* @__PURE__ */
|
|
607
|
-
className:
|
|
606
|
+
}), /* @__PURE__ */ j(_e, {
|
|
607
|
+
className: O("min-w-50", xe),
|
|
608
608
|
"data-testid": `${n}-submenu`,
|
|
609
|
-
children: [o ? /* @__PURE__ */
|
|
609
|
+
children: [o ? /* @__PURE__ */ A("div", {
|
|
610
610
|
className: "p-1",
|
|
611
|
-
children: /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */ A("input", {
|
|
612
612
|
ref: (e) => {
|
|
613
613
|
e?.focus();
|
|
614
614
|
},
|
|
@@ -620,93 +620,93 @@ var vt = (e) => {
|
|
|
620
620
|
"data-testid": `${n}-search`,
|
|
621
621
|
className: "h-7 w-full rounded-(--radius-xs) border border-(--border) bg-(--muted) px-2 text-sm text-(--foreground) outline-hidden placeholder:text-(--muted-foreground) focus-visible:ring-2 focus-visible:ring-(--ring)/20"
|
|
622
622
|
})
|
|
623
|
-
}) : null, s.length === 0 ? /* @__PURE__ */
|
|
624
|
-
className:
|
|
623
|
+
}) : null, s.length === 0 ? /* @__PURE__ */ A("div", {
|
|
624
|
+
className: Te,
|
|
625
625
|
"data-testid": `${n}-empty`,
|
|
626
626
|
"data-reason": i.trim() ? "no-search-match" : e.unavailableReason ?? "none",
|
|
627
|
-
children: i.trim() ? `No field matches "${i.trim()}".` :
|
|
628
|
-
}) : s.map((e) => /* @__PURE__ */
|
|
627
|
+
children: i.trim() ? `No field matches "${i.trim()}".` : Ft(e)
|
|
628
|
+
}) : s.map((e) => /* @__PURE__ */ j(k.Fragment, { children: [e.label ? /* @__PURE__ */ j(be, {
|
|
629
629
|
className: "flex items-center gap-1.5",
|
|
630
630
|
"data-testid": `${n}-group-${e.tableName}`,
|
|
631
631
|
children: [
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ A(D, { className: "size-3 text-(--muted-foreground)" }),
|
|
633
|
+
/* @__PURE__ */ A("span", {
|
|
634
634
|
className: "truncate",
|
|
635
635
|
children: e.label
|
|
636
636
|
}),
|
|
637
|
-
e.isBaseTable ? null : /* @__PURE__ */
|
|
637
|
+
e.isBaseTable ? null : /* @__PURE__ */ A("span", {
|
|
638
638
|
className: "ml-auto shrink-0 text-(--muted-foreground)",
|
|
639
639
|
children: "joined"
|
|
640
640
|
})
|
|
641
641
|
]
|
|
642
|
-
}) : null, e.options.map((e) => e.isDate ? /* @__PURE__ */
|
|
642
|
+
}) : null, e.options.map((e) => e.isDate ? /* @__PURE__ */ j(Le, { children: [/* @__PURE__ */ j(Ie, {
|
|
643
643
|
"data-testid": `${n}-option-${e.key}`,
|
|
644
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */ A("span", {
|
|
645
645
|
className: "truncate",
|
|
646
646
|
children: e.label
|
|
647
|
-
}), /* @__PURE__ */
|
|
647
|
+
}), /* @__PURE__ */ j("span", {
|
|
648
648
|
className: "ml-auto shrink-0 pr-1 text-caption text-(--muted-foreground)",
|
|
649
649
|
children: ["by ", e.column?.timeGrain ?? "month"]
|
|
650
650
|
})]
|
|
651
|
-
}), /* @__PURE__ */
|
|
651
|
+
}), /* @__PURE__ */ A(_e, {
|
|
652
652
|
"data-testid": `${n}-grains-${e.key}`,
|
|
653
|
-
children: _.map((r) => /* @__PURE__ */
|
|
653
|
+
children: _.map((r) => /* @__PURE__ */ A(C, {
|
|
654
654
|
onSelect: () => t({
|
|
655
655
|
...e,
|
|
656
|
-
column:
|
|
656
|
+
column: x(e.column, r.value)
|
|
657
657
|
}),
|
|
658
658
|
"data-testid": `${n}-grain-${e.key}-${r.value}`,
|
|
659
659
|
children: r.label
|
|
660
660
|
}, r.value))
|
|
661
|
-
})] }, e.key) : /* @__PURE__ */
|
|
661
|
+
})] }, e.key) : /* @__PURE__ */ j(C, {
|
|
662
662
|
onSelect: () => t(e),
|
|
663
663
|
"data-testid": `${n}-option-${e.key}`,
|
|
664
|
-
children: [/* @__PURE__ */
|
|
664
|
+
children: [/* @__PURE__ */ A("span", {
|
|
665
665
|
className: "truncate",
|
|
666
666
|
children: e.label
|
|
667
|
-
}), /* @__PURE__ */
|
|
667
|
+
}), /* @__PURE__ */ A("span", {
|
|
668
668
|
className: "ml-auto shrink-0 font-mono text-caption tracking-wide text-(--muted-foreground)",
|
|
669
669
|
children: e.datatype
|
|
670
670
|
})]
|
|
671
671
|
}, e.key))] }, e.tableName || "metric"))]
|
|
672
672
|
})] });
|
|
673
|
-
},
|
|
673
|
+
}, L = ({ point: e }) => {
|
|
674
674
|
let t = f(e), n = e.measure, r = n?.formatted ?? (n?.value === void 0 ? void 0 : String(n.value));
|
|
675
|
-
return t.length === 0 && !r ? null : /* @__PURE__ */
|
|
676
|
-
className:
|
|
675
|
+
return t.length === 0 && !r ? null : /* @__PURE__ */ j("div", {
|
|
676
|
+
className: Ee,
|
|
677
677
|
"data-testid": "metric-card-drill-context",
|
|
678
|
-
children: [t.map((e) => /* @__PURE__ */
|
|
678
|
+
children: [t.map((e) => /* @__PURE__ */ j("div", {
|
|
679
679
|
className: "flex items-baseline gap-3",
|
|
680
680
|
"data-testid": `metric-card-drill-context-${e.role}`,
|
|
681
|
-
children: [/* @__PURE__ */
|
|
681
|
+
children: [/* @__PURE__ */ A("span", {
|
|
682
682
|
className: "shrink-0 truncate text-(--muted-foreground)",
|
|
683
683
|
children: e.label
|
|
684
|
-
}), /* @__PURE__ */
|
|
684
|
+
}), /* @__PURE__ */ A("span", {
|
|
685
685
|
className: "ml-auto min-w-0 truncate text-right font-medium text-(--foreground)",
|
|
686
686
|
children: e.value
|
|
687
687
|
})]
|
|
688
|
-
}, `${e.role}-${e.label}`)), r ? /* @__PURE__ */
|
|
688
|
+
}, `${e.role}-${e.label}`)), r ? /* @__PURE__ */ j("div", {
|
|
689
689
|
className: "flex items-baseline gap-3 text-(--muted-foreground)",
|
|
690
690
|
"data-testid": "metric-card-drill-context-measure",
|
|
691
|
-
children: [/* @__PURE__ */
|
|
691
|
+
children: [/* @__PURE__ */ A("span", {
|
|
692
692
|
className: "shrink-0 truncate",
|
|
693
693
|
children: n?.label || n?.columnName || "Value"
|
|
694
|
-
}), /* @__PURE__ */
|
|
694
|
+
}), /* @__PURE__ */ A("span", {
|
|
695
695
|
className: "ml-auto min-w-0 truncate text-right font-medium",
|
|
696
696
|
children: r
|
|
697
697
|
})]
|
|
698
698
|
}) : null]
|
|
699
699
|
});
|
|
700
|
-
},
|
|
700
|
+
}, R = ({ point: e, onFilterTo: t, canExcludeValues: n, canFilterThisMetric: r, canFilterDashboard: i, isFilterableColumn: a }) => {
|
|
701
701
|
let o = e.dimensions.filter((e) => !!e.columnName && e.value !== void 0 && (a?.(e.columnName) ?? !0));
|
|
702
702
|
if (o.length === 0) return null;
|
|
703
703
|
let s = (e) => e.formatted ?? (e.value === null ? "Empty" : String(e.value)), c = (e, r, i, a) => {
|
|
704
704
|
if (r === "exclude" && !n) return null;
|
|
705
705
|
let o = r === "exclude" ? "Exclude" : i === "metric" ? "Keep only" : "Show only";
|
|
706
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ j(C, {
|
|
707
707
|
onSelect: () => t(e, r, i),
|
|
708
708
|
"data-testid": `metric-card-filter-${i}-${r}-${e.columnName}`,
|
|
709
|
-
children: [
|
|
709
|
+
children: [A(r === "exclude" ? ve : tt, {}), /* @__PURE__ */ j("span", {
|
|
710
710
|
className: "truncate",
|
|
711
711
|
children: [
|
|
712
712
|
a ? `${e.label || e.columnName}: ` : "",
|
|
@@ -716,44 +716,44 @@ var vt = (e) => {
|
|
|
716
716
|
]
|
|
717
717
|
})]
|
|
718
718
|
}, `${i}-${r}-${e.columnName}`);
|
|
719
|
-
}, l = (e, t, n) => [c(e, "only", t, n), c(e, "exclude", t, n)], u = (e) => o.length === 1 ? l(o[0], e, !1) : o.map((t) => /* @__PURE__ */
|
|
719
|
+
}, l = (e, t, n) => [c(e, "only", t, n), c(e, "exclude", t, n)], u = (e) => o.length === 1 ? l(o[0], e, !1) : o.map((t) => /* @__PURE__ */ j(Le, { children: [/* @__PURE__ */ j(Ie, {
|
|
720
720
|
"data-testid": `metric-card-filter-${e}-dim-${t.columnName}`,
|
|
721
721
|
children: [
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ A(tt, {}),
|
|
723
|
+
/* @__PURE__ */ A("span", {
|
|
724
724
|
className: "truncate",
|
|
725
725
|
children: t.label || t.columnName
|
|
726
726
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ A("span", {
|
|
728
728
|
className: "ml-auto shrink-0 truncate pl-4 text-caption text-(--muted-foreground)",
|
|
729
729
|
children: s(t)
|
|
730
730
|
})
|
|
731
731
|
]
|
|
732
|
-
}), /* @__PURE__ */
|
|
733
|
-
return /* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
732
|
+
}), /* @__PURE__ */ A(_e, { children: l(t, e, !1) })] }, `${e}-${t.columnName}`));
|
|
733
|
+
return /* @__PURE__ */ j(it, { children: [r ? /* @__PURE__ */ j(it, { children: [
|
|
734
|
+
/* @__PURE__ */ A(w, {}),
|
|
735
|
+
/* @__PURE__ */ A(be, {
|
|
736
736
|
"data-testid": "metric-card-filter-metric-label",
|
|
737
737
|
children: "Filter this chart"
|
|
738
738
|
}),
|
|
739
739
|
u("metric")
|
|
740
|
-
] }) : null, i ? /* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
740
|
+
] }) : null, i ? /* @__PURE__ */ j(it, { children: [
|
|
741
|
+
/* @__PURE__ */ A(w, {}),
|
|
742
|
+
/* @__PURE__ */ A(be, {
|
|
743
743
|
"data-testid": "metric-card-filter-label",
|
|
744
744
|
children: "Filter this dashboard"
|
|
745
745
|
}),
|
|
746
746
|
u("dashboard")
|
|
747
747
|
] }) : null] });
|
|
748
|
-
},
|
|
748
|
+
}, Lt = ({ open: e, onOpenChange: t, anchor: n, point: r, pool: i, onDrillInto: a, canSplitBy: o = !0, onViewUnderlyingData: s, onCopyValue: c, onFilterTo: l, canExcludeValues: u = !1, canFilterThisMetric: d = !1, canFilterDashboard: f = !1, isFilterableColumn: p, defaultOpen: m, className: h }) => {
|
|
749
749
|
let g = b(r);
|
|
750
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ j(ye, {
|
|
751
751
|
open: e,
|
|
752
752
|
onOpenChange: t,
|
|
753
753
|
defaultOpen: m,
|
|
754
|
-
children: [/* @__PURE__ */
|
|
754
|
+
children: [/* @__PURE__ */ A(we, {
|
|
755
755
|
asChild: !0,
|
|
756
|
-
children: /* @__PURE__ */
|
|
756
|
+
children: /* @__PURE__ */ A("span", {
|
|
757
757
|
"aria-hidden": "true",
|
|
758
758
|
"data-testid": "metric-card-drill-anchor",
|
|
759
759
|
className: "pointer-events-none absolute top-(--drill-anchor-y) left-(--drill-anchor-x) block size-0",
|
|
@@ -762,28 +762,28 @@ var vt = (e) => {
|
|
|
762
762
|
"--drill-anchor-y": `${n?.y ?? 0}px`
|
|
763
763
|
}
|
|
764
764
|
})
|
|
765
|
-
}), /* @__PURE__ */
|
|
765
|
+
}), /* @__PURE__ */ j(Ge, {
|
|
766
766
|
align: "start",
|
|
767
767
|
size: "sm",
|
|
768
|
-
className:
|
|
768
|
+
className: O("dbn-v2-above-chart-tip min-w-56 max-w-80", h),
|
|
769
769
|
"data-testid": "metric-card-drill-menu",
|
|
770
770
|
children: [
|
|
771
|
-
r ? /* @__PURE__ */
|
|
772
|
-
c && g ? /* @__PURE__ */
|
|
771
|
+
r ? /* @__PURE__ */ A(L, { point: r }) : null,
|
|
772
|
+
c && g ? /* @__PURE__ */ j(C, {
|
|
773
773
|
onSelect: () => c(g),
|
|
774
774
|
"data-testid": "metric-card-drill-copy",
|
|
775
|
-
children: [/* @__PURE__ */
|
|
775
|
+
children: [/* @__PURE__ */ A(at, {}), "Copy value"]
|
|
776
776
|
}) : null,
|
|
777
|
-
o ? /* @__PURE__ */
|
|
777
|
+
o ? /* @__PURE__ */ A(It, {
|
|
778
778
|
pool: i,
|
|
779
779
|
onDrillInto: a
|
|
780
780
|
}) : null,
|
|
781
|
-
s ? /* @__PURE__ */
|
|
781
|
+
s ? /* @__PURE__ */ j(C, {
|
|
782
782
|
onSelect: s,
|
|
783
783
|
"data-testid": "metric-card-drill-underlying-data",
|
|
784
|
-
children: [/* @__PURE__ */
|
|
784
|
+
children: [/* @__PURE__ */ A(D, {}), "View underlying data"]
|
|
785
785
|
}) : null,
|
|
786
|
-
r && l ? /* @__PURE__ */
|
|
786
|
+
r && l ? /* @__PURE__ */ A(R, {
|
|
787
787
|
point: r,
|
|
788
788
|
onFilterTo: l,
|
|
789
789
|
canExcludeValues: u,
|
|
@@ -794,28 +794,28 @@ var vt = (e) => {
|
|
|
794
794
|
]
|
|
795
795
|
})]
|
|
796
796
|
});
|
|
797
|
-
},
|
|
797
|
+
}, Rt = ({ open: e, onOpenChange: t, onDownload: n, onEmail: r, rows: i, customMessages: a = {} }) => {
|
|
798
798
|
let { downloadCsvTitle: o = "Download CSV", downloadCsvBody: s, downloadCsvConfirmLabel: c = "Download", emailCsvLabel: l = "Email", cancelLabel: u = "Cancel" } = a, d = i?.length, f = s ?? (typeof d == "number" ? `Export ${d} row${d === 1 ? "" : "s"} as a CSV file.` : "Export the current data as a CSV file.");
|
|
799
|
-
return /* @__PURE__ */
|
|
799
|
+
return /* @__PURE__ */ A(Ze, {
|
|
800
800
|
open: e,
|
|
801
801
|
onOpenChange: t,
|
|
802
|
-
children: /* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ j(Xe, { children: [
|
|
803
|
+
/* @__PURE__ */ A(Ye, { children: /* @__PURE__ */ A(Qe, { children: o }) }),
|
|
804
|
+
/* @__PURE__ */ A(et, { children: f }),
|
|
805
|
+
/* @__PURE__ */ j(Je, { children: [
|
|
806
|
+
/* @__PURE__ */ A(E, {
|
|
807
807
|
type: "button",
|
|
808
808
|
variant: "outline",
|
|
809
809
|
onClick: () => t(!1),
|
|
810
810
|
children: u
|
|
811
811
|
}),
|
|
812
|
-
r && /* @__PURE__ */
|
|
812
|
+
r && /* @__PURE__ */ A(E, {
|
|
813
813
|
type: "button",
|
|
814
814
|
variant: "outline",
|
|
815
815
|
onClick: r,
|
|
816
816
|
children: l
|
|
817
817
|
}),
|
|
818
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ A(E, {
|
|
819
819
|
type: "button",
|
|
820
820
|
onClick: n,
|
|
821
821
|
children: c
|
|
@@ -823,38 +823,40 @@ var vt = (e) => {
|
|
|
823
823
|
] })
|
|
824
824
|
] })
|
|
825
825
|
});
|
|
826
|
-
},
|
|
827
|
-
let
|
|
828
|
-
return /* @__PURE__ */
|
|
826
|
+
}, zt = ({ open: t, onOpenChange: n, metric: r, chartSettings: a, data: o, chartColors: s, chartAppearance: c, chartRendererType: l, title: u, isLoading: d = !1, error: f, isJoinMismatch: p = !1, hasActiveFilters: m, onRetry: h, copyProps: g = {}, tablePaging: _, tableSearch: ee, underlyingData: v }) => {
|
|
827
|
+
let y = f ? e(f, { resourceKind: "metric" }) : void 0, te = y?.retryable !== !1, b = a?.chartType === i.singleValue, x = !o?.length || !a?.chartType;
|
|
828
|
+
return /* @__PURE__ */ A(Ze, {
|
|
829
829
|
open: t,
|
|
830
830
|
onOpenChange: n,
|
|
831
|
-
children: /* @__PURE__ */
|
|
831
|
+
children: /* @__PURE__ */ j(Xe, {
|
|
832
832
|
"data-testid": "fullscreen-dialog-content",
|
|
833
833
|
showCloseButton: !1,
|
|
834
834
|
className: "flex h-9/10 max-h-9/10 w-19/20 max-w-19/20 flex-col sm:max-w-19/20",
|
|
835
835
|
children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ A(Ye, { children: /* @__PURE__ */ A(Qe, { children: u ?? r?.name ?? r?.metricName ?? "Metric" }) }),
|
|
837
|
+
/* @__PURE__ */ j("div", {
|
|
838
838
|
className: "flex min-h-0 w-full flex-1 flex-col gap-3",
|
|
839
|
-
children: [/* @__PURE__ */
|
|
840
|
-
className:
|
|
839
|
+
children: [/* @__PURE__ */ A("div", {
|
|
840
|
+
className: b ? "h-44 w-full shrink-0" : "min-h-0 w-full flex-1",
|
|
841
841
|
"data-testid": "fullscreen-dialog-chart-region",
|
|
842
|
-
children: d ? /* @__PURE__ */
|
|
843
|
-
error:
|
|
844
|
-
onRetry:
|
|
842
|
+
children: d ? /* @__PURE__ */ A(Ue, { className: "h-full" }) : f ? /* @__PURE__ */ A(Ae, {
|
|
843
|
+
error: y,
|
|
844
|
+
onRetry: te ? h : void 0,
|
|
845
845
|
...g
|
|
846
|
-
}) : p ? /* @__PURE__ */
|
|
846
|
+
}) : p ? /* @__PURE__ */ A("div", {
|
|
847
847
|
"data-testid": "card-join-mismatch-state",
|
|
848
848
|
"data-slot": "metric-card-join-mismatch",
|
|
849
|
-
children: /* @__PURE__ */
|
|
850
|
-
error: e(
|
|
849
|
+
children: /* @__PURE__ */ A(Ae, {
|
|
850
|
+
error: e(pe("column")),
|
|
851
851
|
...g
|
|
852
852
|
})
|
|
853
|
-
}) :
|
|
853
|
+
}) : x ? /* @__PURE__ */ A(Ve, {
|
|
854
854
|
className: "h-full",
|
|
855
855
|
hasActiveFilters: m
|
|
856
|
-
}) : /* @__PURE__ */
|
|
856
|
+
}) : /* @__PURE__ */ A(He, {
|
|
857
857
|
hasActiveFilters: m,
|
|
858
|
+
tablePaging: _,
|
|
859
|
+
tableSearch: ee,
|
|
858
860
|
metric: r,
|
|
859
861
|
chartSettings: a,
|
|
860
862
|
data: o,
|
|
@@ -865,45 +867,45 @@ var vt = (e) => {
|
|
|
865
867
|
width: "100%",
|
|
866
868
|
className: "h-full"
|
|
867
869
|
})
|
|
868
|
-
}),
|
|
870
|
+
}), b && v ? /* @__PURE__ */ j("section", {
|
|
869
871
|
"aria-label": "Underlying data",
|
|
870
872
|
"data-testid": "fullscreen-underlying-data",
|
|
871
873
|
className: "flex min-h-0 flex-1 flex-col gap-2",
|
|
872
|
-
children: [/* @__PURE__ */
|
|
874
|
+
children: [/* @__PURE__ */ A("h3", {
|
|
873
875
|
className: "text-sm font-medium text-(--foreground)",
|
|
874
876
|
children: "Underlying data"
|
|
875
|
-
}), /* @__PURE__ */
|
|
877
|
+
}), /* @__PURE__ */ A("div", {
|
|
876
878
|
className: "relative min-h-0 flex-1",
|
|
877
|
-
children:
|
|
878
|
-
rows:
|
|
879
|
-
columns:
|
|
880
|
-
paging:
|
|
881
|
-
isLoading:
|
|
882
|
-
error:
|
|
883
|
-
onRetry:
|
|
879
|
+
children: v.paging || v.rows.length ? /* @__PURE__ */ A(T, {
|
|
880
|
+
rows: v.rows,
|
|
881
|
+
columns: v.columns,
|
|
882
|
+
paging: v.paging,
|
|
883
|
+
isLoading: v.isLoading,
|
|
884
|
+
error: v.error,
|
|
885
|
+
onRetry: v.onRetry,
|
|
884
886
|
ariaLabel: "Underlying data rows",
|
|
885
887
|
qaEntity: "metric-card-fullscreen-underlying-data",
|
|
886
888
|
className: "h-full"
|
|
887
|
-
}) :
|
|
889
|
+
}) : v.isLoading ? /* @__PURE__ */ A(Ue, { className: "h-full" }) : v.error ? /* @__PURE__ */ j("div", {
|
|
888
890
|
role: "alert",
|
|
889
891
|
className: "flex h-full flex-col items-center justify-center gap-3 rounded-(--radius-md) border border-(--border) p-6 text-center",
|
|
890
|
-
children: [/* @__PURE__ */
|
|
892
|
+
children: [/* @__PURE__ */ A("span", {
|
|
891
893
|
className: "text-sm text-(--muted-foreground)",
|
|
892
|
-
children:
|
|
893
|
-
}), /* @__PURE__ */
|
|
894
|
+
children: v.error
|
|
895
|
+
}), /* @__PURE__ */ A(E, {
|
|
894
896
|
type: "button",
|
|
895
897
|
variant: "outline",
|
|
896
|
-
onClick:
|
|
898
|
+
onClick: v.onRetry,
|
|
897
899
|
children: "Try again"
|
|
898
900
|
})]
|
|
899
|
-
}) : /* @__PURE__ */
|
|
901
|
+
}) : /* @__PURE__ */ A("p", {
|
|
900
902
|
className: "flex h-full items-center justify-center text-sm text-(--muted-foreground)",
|
|
901
903
|
children: "No data to show."
|
|
902
904
|
})
|
|
903
905
|
})]
|
|
904
906
|
}) : null]
|
|
905
907
|
}),
|
|
906
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ A(Je, { children: /* @__PURE__ */ A(E, {
|
|
907
909
|
type: "button",
|
|
908
910
|
variant: "outline",
|
|
909
911
|
onClick: () => n(!1),
|
|
@@ -912,8 +914,8 @@ var vt = (e) => {
|
|
|
912
914
|
]
|
|
913
915
|
})
|
|
914
916
|
});
|
|
915
|
-
},
|
|
916
|
-
let [o, s] =
|
|
917
|
+
}, Bt = ({ filters: e, onChange: t, position: n = "inside", multi: r = !1, defaultOpen: i, className: a }) => {
|
|
918
|
+
let [o, s] = k.useState({}), c = k.useMemo(() => Object.values(o).filter((e) => Array.isArray(e) ? e.length > 0 : !!e).length, [o]), l = k.useMemo(() => Object.fromEntries(e.map((e) => [e.id, new Set(o[e.id] ?? [])])), [e, o]);
|
|
917
919
|
if (!e?.length) return null;
|
|
918
920
|
let u = (e) => {
|
|
919
921
|
s(e), t(e);
|
|
@@ -929,58 +931,58 @@ var vt = (e) => {
|
|
|
929
931
|
[e]: i
|
|
930
932
|
});
|
|
931
933
|
};
|
|
932
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ j(ke, {
|
|
933
935
|
defaultOpen: i,
|
|
934
|
-
children: [/* @__PURE__ */
|
|
936
|
+
children: [/* @__PURE__ */ A(De, {
|
|
935
937
|
asChild: !0,
|
|
936
|
-
children: /* @__PURE__ */
|
|
938
|
+
children: /* @__PURE__ */ j(E, {
|
|
937
939
|
type: "button",
|
|
938
940
|
variant: "outline",
|
|
939
941
|
size: "sm",
|
|
940
|
-
className:
|
|
942
|
+
className: O(a),
|
|
941
943
|
"aria-label": "Metric filters",
|
|
942
944
|
"data-testid": "metric-filter-control-trigger",
|
|
943
945
|
"data-position": n,
|
|
944
946
|
children: [
|
|
945
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ A(tt, {}),
|
|
946
948
|
"Filters",
|
|
947
949
|
c ? ` (${c})` : ""
|
|
948
950
|
]
|
|
949
951
|
})
|
|
950
|
-
}), /* @__PURE__ */
|
|
952
|
+
}), /* @__PURE__ */ A(Ke, {
|
|
951
953
|
align: n === "outside" ? "start" : "end",
|
|
952
954
|
size: "lg",
|
|
953
955
|
padding: "form",
|
|
954
956
|
"data-testid": "metric-filter-control-content",
|
|
955
|
-
children: /* @__PURE__ */
|
|
957
|
+
children: /* @__PURE__ */ A("div", {
|
|
956
958
|
className: "flex flex-col gap-4",
|
|
957
|
-
children: e.map((e) => /* @__PURE__ */
|
|
959
|
+
children: e.map((e) => /* @__PURE__ */ j("div", {
|
|
958
960
|
className: "flex flex-col gap-1.5",
|
|
959
|
-
children: [/* @__PURE__ */
|
|
961
|
+
children: [/* @__PURE__ */ A("span", {
|
|
960
962
|
className: "text-xs font-medium text-(--muted-foreground)",
|
|
961
963
|
children: e.label
|
|
962
|
-
}), r ? /* @__PURE__ */
|
|
964
|
+
}), r ? /* @__PURE__ */ A("div", {
|
|
963
965
|
className: "flex flex-col gap-1.5",
|
|
964
966
|
children: e.options.map((t) => {
|
|
965
967
|
let n = l[e.id]?.has(t);
|
|
966
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ j("label", {
|
|
967
969
|
className: "flex cursor-pointer items-center gap-2 text-sm text-(--foreground)",
|
|
968
|
-
children: [/* @__PURE__ */
|
|
970
|
+
children: [/* @__PURE__ */ A($e, {
|
|
969
971
|
checked: n,
|
|
970
972
|
onCheckedChange: (n) => f(e.id, t, n === !0),
|
|
971
973
|
"data-testid": `metric-filter-option-${e.id}-${t}`
|
|
972
974
|
}), t]
|
|
973
975
|
}, t);
|
|
974
976
|
})
|
|
975
|
-
}) : /* @__PURE__ */
|
|
977
|
+
}) : /* @__PURE__ */ j(Pe, {
|
|
976
978
|
value: o[e.id] ?? "",
|
|
977
979
|
onValueChange: (t) => d(e.id, t),
|
|
978
|
-
children: [/* @__PURE__ */
|
|
980
|
+
children: [/* @__PURE__ */ A(We, {
|
|
979
981
|
size: "sm",
|
|
980
982
|
className: "w-full",
|
|
981
983
|
"data-testid": `metric-filter-select-${e.id}`,
|
|
982
|
-
children: /* @__PURE__ */
|
|
983
|
-
}), /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ A(qe, { placeholder: "All" })
|
|
985
|
+
}), /* @__PURE__ */ A(Ne, { children: e.options.map((e) => /* @__PURE__ */ A(Oe, {
|
|
984
986
|
value: e,
|
|
985
987
|
children: e
|
|
986
988
|
}, e)) })]
|
|
@@ -989,15 +991,15 @@ var vt = (e) => {
|
|
|
989
991
|
})
|
|
990
992
|
})]
|
|
991
993
|
});
|
|
992
|
-
},
|
|
994
|
+
}, Vt = (e) => {
|
|
993
995
|
let t = e.target;
|
|
994
996
|
t instanceof Element && t.closest("table") || e.preventDefault();
|
|
995
997
|
};
|
|
996
|
-
function
|
|
998
|
+
function z(...e) {
|
|
997
999
|
return e.find((e) => e !== void 0);
|
|
998
1000
|
}
|
|
999
|
-
var
|
|
1000
|
-
function
|
|
1001
|
+
var Ht = "__dbnMetricDrillMenu", Ut = "STRING";
|
|
1002
|
+
function Wt(e) {
|
|
1001
1003
|
return e ? e.getConnectedDataURL({
|
|
1002
1004
|
type: "png",
|
|
1003
1005
|
pixelRatio: 2,
|
|
@@ -1005,35 +1007,35 @@ function Gt(e) {
|
|
|
1005
1007
|
backgroundColor: "#fff"
|
|
1006
1008
|
}) : "#";
|
|
1007
1009
|
}
|
|
1008
|
-
var
|
|
1009
|
-
function
|
|
1010
|
+
var Gt = 5e3, Kt = {}, qt = 2e5;
|
|
1011
|
+
function Jt(e, t) {
|
|
1010
1012
|
let n = d(e), r = new Blob(["", n], { type: "text/csv;charset=utf-8;" }), i = URL.createObjectURL(r);
|
|
1011
1013
|
try {
|
|
1012
|
-
|
|
1014
|
+
Yt(i, t);
|
|
1013
1015
|
} finally {
|
|
1014
1016
|
setTimeout(() => URL.revokeObjectURL(i), 0);
|
|
1015
1017
|
}
|
|
1016
1018
|
}
|
|
1017
|
-
function
|
|
1019
|
+
function Yt(e, t) {
|
|
1018
1020
|
if (!e || e === "#") return;
|
|
1019
1021
|
let n = document.createElement("a");
|
|
1020
1022
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
1021
1023
|
}
|
|
1022
|
-
function
|
|
1024
|
+
function B(e) {
|
|
1023
1025
|
if (e == null) return "";
|
|
1024
1026
|
if (typeof e == "string") return e;
|
|
1025
1027
|
if (typeof e == "number") return String(e);
|
|
1026
1028
|
let t = e;
|
|
1027
1029
|
return String(t.label ?? t.value ?? t.name ?? "");
|
|
1028
1030
|
}
|
|
1029
|
-
function
|
|
1031
|
+
function Xt(e) {
|
|
1030
1032
|
return e?.length ? e.filter((e) => e && !e.isHiddenInUi).map((e) => ({
|
|
1031
1033
|
id: String(e.name),
|
|
1032
1034
|
label: String(e.name),
|
|
1033
|
-
options: Array.isArray(e.options) ? e.options.map(
|
|
1035
|
+
options: Array.isArray(e.options) ? e.options.map(B).filter(Boolean) : []
|
|
1034
1036
|
})) : [];
|
|
1035
1037
|
}
|
|
1036
|
-
function
|
|
1038
|
+
function Zt(e) {
|
|
1037
1039
|
let t = (Array.isArray(e?.options) ? e.options : []).find((e) => e?.range === "Date Range");
|
|
1038
1040
|
if (t?.startDate && t?.endDate && e?.value) return {
|
|
1039
1041
|
startDate: l(t.startDate),
|
|
@@ -1042,176 +1044,176 @@ function Qt(e) {
|
|
|
1042
1044
|
value: ""
|
|
1043
1045
|
};
|
|
1044
1046
|
}
|
|
1045
|
-
function
|
|
1046
|
-
if (e != null) return typeof e == "string" ? e === "download" ? /* @__PURE__ */
|
|
1047
|
+
function Qt(e) {
|
|
1048
|
+
if (e != null) return typeof e == "string" ? e === "download" ? /* @__PURE__ */ A(ct, {}) : e === "kebab-menu-vertical" ? void 0 : e.trimStart().startsWith("<") ? /* @__PURE__ */ A("span", { dangerouslySetInnerHTML: { __html: r(e) } }) : void 0 : e;
|
|
1047
1049
|
}
|
|
1048
|
-
var
|
|
1049
|
-
let { metricItem: l, metric: d, isDisableCardTitle: f, isShadowDisableOnHover: h, hideMetricCardShadow: _, disableBorder: ee, disableMetricCardBorder: v, isMergedMetric: b, colors:
|
|
1050
|
+
var $t = (a) => {
|
|
1051
|
+
let { metricItem: l, metric: d, isDisableCardTitle: f, isShadowDisableOnHover: h, hideMetricCardShadow: _, disableBorder: ee, disableMetricCardBorder: v, isMergedMetric: b, colors: x, chartColors: S, chartRendererType: _e, chartAppearance: ve, appearanceOptions: ye, chartColumns: be, chartHeight: C, width: xe, optionsIcon: Ce, settingsIcon: we, noDataImg: Te, noDataFoundSvg: w, enableDownloadCsv: Ee, enableEmailCsv: De, onDownloadRawCsv: Oe, onServerEvent: T, disableDownloadPng: ke, disableDownloadDataNoFilters: je, disableDownloadUnderlyingDataNoFilters: Me, disableUnderlyingData: Ne, isAllowedToSeeUnderlyingData: Pe, disableFullscreen: Ie, enableTitleClickFullscreen: Le, canEditMetric: Re, onEditMetric: Be, language: We, translationDictionary: Ge, customMessages: Ke, className: qe, metricFilterPosition: Je, enableMultiMetricFilters: Ye, clientColumnType: D, hideDatePickerOptions: Xe, calendarType: Ze, enableAdhocDrill: Qe, enableExcludeFilter: $e, enableCrossFilter: et, enableCrossFilterBeforeDrill: tt, enableTablePaging: at, enableFormattedUnderlyingData: ot, enableCoverageTruncation: st, enableFilteredEmptyState: ct, onClearAllFilters: lt, isEditLayoutEnabled: dt, isDisableMerge: ft, setOpenMergeModal: pt, knownCause: ht } = a, M = l ?? d, { data: yt } = n(), bt = yt?.clientSubsetData, { client: Tt, param: Et, companyTenancyType: Dt, encryptedClient: Ot, isJoinMismatch: kt, userProvidedDashboardId: At } = a, jt = {
|
|
1050
1052
|
...a,
|
|
1051
|
-
metric:
|
|
1052
|
-
clientId:
|
|
1053
|
-
encryptedClientId:
|
|
1054
|
-
tenancyLevel:
|
|
1055
|
-
rlsFilters:
|
|
1056
|
-
isDisableQuery: !!
|
|
1057
|
-
dashboardId:
|
|
1058
|
-
},
|
|
1059
|
-
c("card",
|
|
1060
|
-
let { emptyCard:
|
|
1061
|
-
customMessages:
|
|
1062
|
-
translationDictionary:
|
|
1063
|
-
selectedLanguage:
|
|
1064
|
-
},
|
|
1065
|
-
|
|
1053
|
+
metric: M,
|
|
1054
|
+
clientId: Tt,
|
|
1055
|
+
encryptedClientId: Ot,
|
|
1056
|
+
tenancyLevel: Dt,
|
|
1057
|
+
rlsFilters: Et,
|
|
1058
|
+
isDisableQuery: !!kt,
|
|
1059
|
+
dashboardId: At
|
|
1060
|
+
}, N = fe(jt), P = !!z(N.isQueryLoading, N.isLoading), Mt = !!N.isMetricUpdating && !P, F = k.useMemo(() => z(N.dataDb, N.data) ?? [], [N.dataDb, N.data]), I = z(N.queryError, N.error), Pt = Re && s(I) ? I.message : void 0, Ft = z(N.refetchMetricData, N.refetch), L = N.chartSettings ?? M?.chartOptions, R = !!N.isSingleValueNull, B = z(N.metricName, M?.name, M?.metricName), $t = z(N.description, M?.description), en = N.longDescription, tn = N.footNote, nn = en ? /* @__PURE__ */ A("span", { dangerouslySetInnerHTML: { __html: r(en) } }) : void 0, rn = k.useMemo(() => I ? le(I) : void 0, [I]);
|
|
1061
|
+
c("card", rn, { metricId: M?.metricId ?? M?.id });
|
|
1062
|
+
let { emptyCard: an } = ie(), on = {
|
|
1063
|
+
customMessages: Ke,
|
|
1064
|
+
translationDictionary: Ge,
|
|
1065
|
+
selectedLanguage: We
|
|
1066
|
+
}, sn = !!(z(ee, v) || b), cn = !!z(h, _) || sn, ln = z(x, S), [un, dn] = k.useState(!1), [fn, pn] = k.useState(!1), [mn, hn] = k.useState(!1), [gn, _n] = k.useState(!1), [vn, V] = k.useState(null), yn = k.useCallback(() => V(null), []), bn = k.useRef(!1);
|
|
1067
|
+
k.useEffect(() => {
|
|
1066
1068
|
V(null);
|
|
1067
|
-
}, [
|
|
1068
|
-
let [xn,
|
|
1069
|
+
}, [M?.id]);
|
|
1070
|
+
let [xn, Sn] = k.useState([]), [Cn, H] = k.useState(!1), wn = k.useMemo(() => Object.keys(xn[0] ?? {}).map((e) => ({
|
|
1069
1071
|
key: e,
|
|
1070
1072
|
label: e
|
|
1071
|
-
})), [xn]), [
|
|
1073
|
+
})), [xn]), [U, Tn] = k.useState({
|
|
1072
1074
|
limit: 100,
|
|
1073
1075
|
offset: 0
|
|
1074
|
-
}), [
|
|
1076
|
+
}), [En, Dn] = k.useState(0), [On, kn] = k.useState({
|
|
1075
1077
|
isRunning: !1,
|
|
1076
1078
|
fetchedRows: 0
|
|
1077
|
-
}),
|
|
1078
|
-
enableAdhocDrill:
|
|
1079
|
-
enableExcludeFilter:
|
|
1080
|
-
enableCrossFilter:
|
|
1081
|
-
disableUnderlyingData:
|
|
1082
|
-
enableTablePaging:
|
|
1083
|
-
enableFormattedUnderlyingData:
|
|
1079
|
+
}), An = k.useRef(!1), [jn, Mn] = k.useState(null), Nn = N.handleChartClick, Pn = k.useMemo(() => te(yt, {
|
|
1080
|
+
enableAdhocDrill: Qe,
|
|
1081
|
+
enableExcludeFilter: $e,
|
|
1082
|
+
enableCrossFilter: et,
|
|
1083
|
+
disableUnderlyingData: Ne,
|
|
1084
|
+
enableTablePaging: at,
|
|
1085
|
+
enableFormattedUnderlyingData: ot
|
|
1084
1086
|
}), [
|
|
1085
|
-
|
|
1087
|
+
yt,
|
|
1088
|
+
Qe,
|
|
1086
1089
|
$e,
|
|
1087
1090
|
et,
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
ot
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}, In = !Le, K = !Fn.disableUnderlyingData, Ln = G || K, Rn = Nn.canPageThroughLargeTables, q = Nn.canReadFormattedUnderlyingData, [zn, Bn] = O.useState({
|
|
1091
|
+
Ne,
|
|
1092
|
+
at,
|
|
1093
|
+
ot
|
|
1094
|
+
]), W = Pn.canDrillIntoAnyDimension, Fn = Pn.canCrossFilter, In = {
|
|
1095
|
+
enableDownloadCsv: Ee,
|
|
1096
|
+
enableEmailCsv: !!z(De, Oe ? !0 : void 0),
|
|
1097
|
+
disableDownloadPng: ke,
|
|
1098
|
+
disableDownloadDataNoFilters: !!je,
|
|
1099
|
+
disableDownloadUnderlyingDataNoFilters: !!Me,
|
|
1100
|
+
disableUnderlyingData: z(Ne, Pe === void 0 ? void 0 : !Pe),
|
|
1101
|
+
disableFullscreen: !!Ie
|
|
1102
|
+
}, Ln = !Ie, G = !In.disableUnderlyingData, Rn = W || G, zn = Pn.canPageThroughLargeTables, K = Pn.canReadFormattedUnderlyingData, [Bn, Vn] = k.useState({
|
|
1101
1103
|
open: !1,
|
|
1102
1104
|
anchor: null,
|
|
1103
1105
|
params: null
|
|
1104
|
-
}),
|
|
1105
|
-
typeof window < "u" && !
|
|
1106
|
+
}), Hn = k.useId(), Un = k.useRef(!1), Wn = k.useCallback((e) => {
|
|
1107
|
+
typeof window < "u" && !Bn.open && window.history.state?.[Ht] !== Hn && (Un.current = !1, window.history.pushState({
|
|
1106
1108
|
...window.history.state,
|
|
1107
|
-
[
|
|
1108
|
-
}, "")),
|
|
1109
|
-
}, [
|
|
1110
|
-
|
|
1109
|
+
[Ht]: Hn
|
|
1110
|
+
}, "")), Vn(e);
|
|
1111
|
+
}, [Bn.open, Hn]), Gn = k.useCallback(() => {
|
|
1112
|
+
Vn((e) => ({
|
|
1111
1113
|
...e,
|
|
1112
1114
|
open: !1
|
|
1113
|
-
})), typeof window < "u" && !
|
|
1114
|
-
}, [
|
|
1115
|
-
|
|
1115
|
+
})), typeof window < "u" && !Un.current && window.history.state?.[Ht] === Hn && (Un.current = !0, window.history.back());
|
|
1116
|
+
}, [Hn]);
|
|
1117
|
+
k.useEffect(() => {
|
|
1116
1118
|
if (typeof window > "u") return;
|
|
1117
1119
|
let e = () => {
|
|
1118
|
-
|
|
1120
|
+
Un.current = !1, Vn((e) => ({
|
|
1119
1121
|
...e,
|
|
1120
1122
|
open: !1
|
|
1121
1123
|
}));
|
|
1122
1124
|
};
|
|
1123
1125
|
return window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e);
|
|
1124
1126
|
}, []);
|
|
1125
|
-
let
|
|
1126
|
-
subset:
|
|
1127
|
-
configuration:
|
|
1128
|
-
selectedDims:
|
|
1129
|
-
config:
|
|
1130
|
-
isCustomSql: !!
|
|
1127
|
+
let Kn = N.drillDownSettings, q = k.useMemo(() => Kn?.configV2?.levels ?? [], [Kn?.configV2?.levels]), qn = _t(Kn?.configV2), Jn = qn.activeLevel, Yn = Jn?.dimensions?.[0]?.alias || L?.xAxis || M?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.[0]?.alias, Xn = k.useMemo(() => W ? vt({
|
|
1128
|
+
subset: bt,
|
|
1129
|
+
configuration: M?.datasetMetricSettings?.newDatasetSettings?.configuration,
|
|
1130
|
+
selectedDims: M?.datasetMetricSettings?.newDatasetSettings?.selectedDims,
|
|
1131
|
+
config: Kn?.configV2,
|
|
1132
|
+
isCustomSql: !!M?.datasetMetricSettings?.isUseRawSQL
|
|
1131
1133
|
}) : { groups: [] }, [
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
]),
|
|
1137
|
-
chartType:
|
|
1138
|
-
isDrillEnabled:
|
|
1139
|
-
dimensions:
|
|
1140
|
-
drilledLevel:
|
|
1141
|
-
drillLevels:
|
|
1134
|
+
W,
|
|
1135
|
+
bt,
|
|
1136
|
+
M,
|
|
1137
|
+
Kn?.configV2
|
|
1138
|
+
]), Zn = Xn.groups.some((e) => e.options.length > 0), Qn = N.onDrillIntoDimension, $n = N.onDrillLevelClick, er = N.onDrillDown, tr = N.onFilterDashboardTo, nr = N.onFilterMetricTo, rr = k.useMemo(() => me({
|
|
1139
|
+
chartType: L?.chartType,
|
|
1140
|
+
isDrillEnabled: M?.drillDownSettings?.isEnableGroupBy,
|
|
1141
|
+
dimensions: N.dimensions,
|
|
1142
|
+
drilledLevel: N.drilledLevel,
|
|
1143
|
+
drillLevels: q
|
|
1142
1144
|
}), [
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
]),
|
|
1149
|
-
if (!
|
|
1150
|
-
let t =
|
|
1151
|
-
columnName:
|
|
1152
|
-
value:
|
|
1153
|
-
}] : e?.rowFilters, c = t === i.table || t === i.singleValue || o && r === n ? s : e, l =
|
|
1154
|
-
chart:
|
|
1155
|
-
chartWithMetric:
|
|
1156
|
-
chartWithDashboard:
|
|
1145
|
+
L?.chartType,
|
|
1146
|
+
M?.drillDownSettings?.isEnableGroupBy,
|
|
1147
|
+
N.dimensions,
|
|
1148
|
+
N.drilledLevel,
|
|
1149
|
+
q
|
|
1150
|
+
]), ir = a.enableClickActions, J = k.useMemo(() => M?.clickActions ?? {}, [M?.clickActions]), ar = a.onMaximize, or = a.chartClickFunction, sr = k.useCallback((e) => {
|
|
1151
|
+
if (!ir) return;
|
|
1152
|
+
let t = L?.chartType, n = N.dimensions?.length, r = N.drilledLevel, o = !!M?.drillDownSettings?.isEnableGroupBy, s = t === i.singleValue ? [{
|
|
1153
|
+
columnName: L?.singleValue,
|
|
1154
|
+
value: F?.[0]?.[L?.singleValue || ""]
|
|
1155
|
+
}] : e?.rowFilters, c = t === i.table || t === i.singleValue || o && r === n ? s : e, l = de({
|
|
1156
|
+
chart: J.chart,
|
|
1157
|
+
chartWithMetric: J.chartWithMetric,
|
|
1158
|
+
chartWithDashboard: J.chartWithDashboard,
|
|
1157
1159
|
isDrillEnabled: o,
|
|
1158
1160
|
drilledLevel: r,
|
|
1159
1161
|
dimensionCount: n,
|
|
1160
|
-
isLastConfiguredDrillLevel: !!
|
|
1161
|
-
isTableRedirectAllowed: !
|
|
1162
|
-
}), u = (e, t) =>
|
|
1163
|
-
chart:
|
|
1162
|
+
isLastConfiguredDrillLevel: !!q[q.length - 1]?.isEnable,
|
|
1163
|
+
isTableRedirectAllowed: !ze.has(t) || !!L?.tableSettings?.chartAction?.isEnableColumnRedirection
|
|
1164
|
+
}), u = (e, t) => ce({
|
|
1165
|
+
chart: L,
|
|
1164
1166
|
valueColumn: e,
|
|
1165
1167
|
isDrillEnabled: o,
|
|
1166
1168
|
drilledLevel: r,
|
|
1167
1169
|
dimensionCount: n,
|
|
1168
1170
|
params: c,
|
|
1169
1171
|
passAllData: t
|
|
1170
|
-
}), d =
|
|
1171
|
-
if (l.host ?
|
|
1172
|
-
metric:
|
|
1172
|
+
}), d = J.chart?.valueColumn, f = J.chartWithDashboard?.valueColumn ?? L?.xAxis;
|
|
1173
|
+
if (l.host ? or?.(u(d, J.chart?.isPassAllData) || void 0) : l.navigate && rt(J.chart, u(d) || void 0), l.openNestedMetric && ar?.({
|
|
1174
|
+
metric: M,
|
|
1173
1175
|
rlsFilters: a.param,
|
|
1174
1176
|
appFilters: a.appFilters,
|
|
1175
1177
|
appliedMetricFilters: a.appliedMetricFilters,
|
|
1176
1178
|
isClickOnChart: !0
|
|
1177
1179
|
}), l.openDashboard) {
|
|
1178
1180
|
let e = y({
|
|
1179
|
-
config:
|
|
1181
|
+
config: J.chartWithDashboard,
|
|
1180
1182
|
value: u(f)
|
|
1181
1183
|
});
|
|
1182
|
-
e.ok &&
|
|
1184
|
+
e.ok && or?.(e.intent);
|
|
1183
1185
|
}
|
|
1184
1186
|
}, [
|
|
1185
|
-
|
|
1186
|
-
Y,
|
|
1187
|
-
I,
|
|
1188
|
-
P,
|
|
1189
|
-
M.dimensions,
|
|
1190
|
-
M.drilledLevel,
|
|
1191
|
-
j,
|
|
1187
|
+
ir,
|
|
1192
1188
|
J,
|
|
1189
|
+
L,
|
|
1190
|
+
F,
|
|
1191
|
+
N.dimensions,
|
|
1192
|
+
N.drilledLevel,
|
|
1193
|
+
M,
|
|
1194
|
+
q,
|
|
1195
|
+
or,
|
|
1193
1196
|
ar,
|
|
1194
|
-
ir,
|
|
1195
1197
|
a
|
|
1196
|
-
]),
|
|
1197
|
-
|
|
1198
|
-
let n = e?.event?.event ?? e?.event, r = t ??
|
|
1198
|
+
]), cr = k.useCallback((e, t) => {
|
|
1199
|
+
Nn?.(e);
|
|
1200
|
+
let n = e?.event?.event ?? e?.event, r = t ?? mt(n?.type), i = gt({
|
|
1199
1201
|
gesture: r,
|
|
1200
|
-
route:
|
|
1201
|
-
canCrossFilter:
|
|
1202
|
-
canDrillInto:
|
|
1203
|
-
hasPointMenu:
|
|
1202
|
+
route: rr,
|
|
1203
|
+
canCrossFilter: Fn,
|
|
1204
|
+
canDrillInto: W,
|
|
1205
|
+
hasPointMenu: Rn
|
|
1204
1206
|
});
|
|
1205
|
-
r === "primary" &&
|
|
1206
|
-
columnName:
|
|
1207
|
+
r === "primary" && sr(e), i.drillDown && (tt === !0 && !a.isInternalApp && Yn && e?.name !== void 0 && !ze.has(L?.chartType) && tr?.({
|
|
1208
|
+
columnName: Yn,
|
|
1207
1209
|
value: e.name,
|
|
1208
1210
|
mode: "only"
|
|
1209
|
-
}),
|
|
1210
|
-
chartType:
|
|
1211
|
+
}), er?.(he({
|
|
1212
|
+
chartType: L?.chartType,
|
|
1211
1213
|
params: e,
|
|
1212
1214
|
rowFilters: e?.rowFilters,
|
|
1213
|
-
dimensions:
|
|
1214
|
-
}))), i.adhocMenu && (r === "secondary" && n?.preventDefault?.(),
|
|
1215
|
+
dimensions: N.dimensions
|
|
1216
|
+
}))), i.adhocMenu && (r === "secondary" && n?.preventDefault?.(), Wn({
|
|
1215
1217
|
open: !0,
|
|
1216
1218
|
anchor: {
|
|
1217
1219
|
x: n?.offsetX ?? 0,
|
|
@@ -1220,29 +1222,29 @@ var en = (a) => {
|
|
|
1220
1222
|
params: e
|
|
1221
1223
|
}));
|
|
1222
1224
|
}, [
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
$n,
|
|
1225
|
+
Nn,
|
|
1226
|
+
sr,
|
|
1227
|
+
W,
|
|
1228
|
+
Rn,
|
|
1229
|
+
Fn,
|
|
1230
|
+
rr,
|
|
1230
1231
|
er,
|
|
1231
|
-
|
|
1232
|
+
tr,
|
|
1233
|
+
tt,
|
|
1232
1234
|
a.isInternalApp,
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
]),
|
|
1238
|
-
let t =
|
|
1239
|
-
t !== e && (t?.removeEventListener("contextmenu",
|
|
1240
|
-
}, []),
|
|
1241
|
-
let t =
|
|
1235
|
+
Yn,
|
|
1236
|
+
L?.chartType,
|
|
1237
|
+
N.dimensions,
|
|
1238
|
+
Wn
|
|
1239
|
+
]), lr = k.useRef(null), ur = k.useRef(null), dr = k.useCallback((e) => {
|
|
1240
|
+
let t = ur.current;
|
|
1241
|
+
t !== e && (t?.removeEventListener("contextmenu", Vt), e?.addEventListener("contextmenu", Vt), ur.current = e);
|
|
1242
|
+
}, []), fr = k.useCallback((e) => {
|
|
1243
|
+
let t = ur.current, n = e.anchor.getBoundingClientRect(), r = t?.getBoundingClientRect(), i = Object.keys(e.row || {}).map((t) => ({
|
|
1242
1244
|
columnName: t,
|
|
1243
1245
|
value: e.row?.[t]
|
|
1244
1246
|
}));
|
|
1245
|
-
|
|
1247
|
+
Wn({
|
|
1246
1248
|
open: !0,
|
|
1247
1249
|
anchor: r ? {
|
|
1248
1250
|
x: n.left - r.left,
|
|
@@ -1253,68 +1255,68 @@ var en = (a) => {
|
|
|
1253
1255
|
},
|
|
1254
1256
|
params: { rowFilters: i }
|
|
1255
1257
|
});
|
|
1256
|
-
}, [
|
|
1257
|
-
let e =
|
|
1258
|
+
}, [Wn]), pr = k.useMemo(() => u(L), [L]), mr = k.useMemo(() => {
|
|
1259
|
+
let e = Jn?.dimensions?.[0]?.alias || L?.xAxis || M?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.[0]?.alias, t = (L?.isMultiDimension || L?.isDynamicSeries) && L?.seriesField && L.seriesField !== "ungrouped" ? L.seriesField : void 0;
|
|
1258
1260
|
return p({
|
|
1259
|
-
params:
|
|
1261
|
+
params: Bn.params,
|
|
1260
1262
|
axisDimension: e ? {
|
|
1261
1263
|
columnName: e,
|
|
1262
|
-
label:
|
|
1264
|
+
label: Jn?.dimensions?.[0]?.label || e
|
|
1263
1265
|
} : void 0,
|
|
1264
1266
|
seriesDimension: t ? {
|
|
1265
1267
|
columnName: t,
|
|
1266
|
-
label: ((e) => e ? (
|
|
1268
|
+
label: ((e) => e ? (M?.datasetMetricSettings?.newDatasetSettings?.selectedDims)?.find((t) => t?.alias === e) : void 0)(t)?.label || t
|
|
1267
1269
|
} : void 0,
|
|
1268
1270
|
measure: {
|
|
1269
|
-
columnName:
|
|
1270
|
-
label:
|
|
1271
|
+
columnName: M?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.[0]?.alias,
|
|
1272
|
+
label: M?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.[0]?.label
|
|
1271
1273
|
},
|
|
1272
|
-
formatMeasure:
|
|
1274
|
+
formatMeasure: pr
|
|
1273
1275
|
});
|
|
1274
1276
|
}, [
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
]), [
|
|
1284
|
-
let e =
|
|
1277
|
+
Bn.params,
|
|
1278
|
+
Jn,
|
|
1279
|
+
M,
|
|
1280
|
+
L?.isMultiDimension,
|
|
1281
|
+
L?.isDynamicSeries,
|
|
1282
|
+
L?.seriesField,
|
|
1283
|
+
L?.xAxis,
|
|
1284
|
+
pr
|
|
1285
|
+
]), [hr, gr] = k.useState([]), _r = k.useMemo(() => {
|
|
1286
|
+
let e = Jn?.filters || [], t = new Set(hr.map((e) => e.columnName)), n = [...e.filter((e) => !t.has(e.columnName)), ...hr];
|
|
1285
1287
|
if (!n.length) return;
|
|
1286
|
-
let r =
|
|
1288
|
+
let r = M?.datasetMetricSettings?.newDatasetSettings?.selectedDims || [];
|
|
1287
1289
|
return n.filter((e) => !!e?.columnName && e?.value !== void 0).map((e) => ({
|
|
1288
1290
|
label: r.find((t) => t?.alias === e.columnName)?.label || e.columnName,
|
|
1289
1291
|
value: e.value === null ? "Empty" : String(e.value)
|
|
1290
1292
|
}));
|
|
1291
1293
|
}, [
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
]),
|
|
1296
|
-
|
|
1297
|
-
}, [
|
|
1298
|
-
runtimeEnabled:
|
|
1299
|
-
metricEnabled:
|
|
1300
|
-
}),
|
|
1301
|
-
|
|
1294
|
+
Jn,
|
|
1295
|
+
M,
|
|
1296
|
+
hr
|
|
1297
|
+
]), vr = k.useCallback((e) => {
|
|
1298
|
+
Gn(), navigator?.clipboard?.writeText?.(e)?.catch?.(() => void 0);
|
|
1299
|
+
}, [Gn]), yr = ne({
|
|
1300
|
+
runtimeEnabled: et,
|
|
1301
|
+
metricEnabled: Kn?.isEnableCrossFilter
|
|
1302
|
+
}), br = !!tr && Pn.canCrossFilter && yr, xr = k.useCallback((e) => ae(e, M?.datasetMetricSettings?.newDatasetSettings?.selectedDims), [M]), Sr = k.useCallback((e, t, n) => {
|
|
1303
|
+
Gn(), (n === "metric" ? nr : tr)?.({
|
|
1302
1304
|
columnName: e.columnName,
|
|
1303
1305
|
value: e.value,
|
|
1304
1306
|
mode: t
|
|
1305
1307
|
});
|
|
1306
1308
|
}, [
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
]),
|
|
1311
|
-
let e = { click: (e) =>
|
|
1312
|
-
return
|
|
1313
|
-
}, [
|
|
1314
|
-
if (!
|
|
1315
|
-
let e =
|
|
1316
|
-
return e < 0 ? [] :
|
|
1317
|
-
let r =
|
|
1309
|
+
Gn,
|
|
1310
|
+
tr,
|
|
1311
|
+
nr
|
|
1312
|
+
]), Cr = k.useMemo(() => {
|
|
1313
|
+
let e = { click: (e) => cr(e) };
|
|
1314
|
+
return Rn && (e.contextmenu = (e) => cr(e, "secondary")), e;
|
|
1315
|
+
}, [Rn, cr]), Y = k.useMemo(() => {
|
|
1316
|
+
if (!W && !Fn) return [];
|
|
1317
|
+
let e = q.findIndex((e) => e?.isEnable);
|
|
1318
|
+
return e < 0 ? [] : q.slice(0, e + 1).map((t, n) => {
|
|
1319
|
+
let r = q[n + 1], i = t?.dimensions?.[0], a = i?.alias ?? t?.name ?? "", o = String(t?.name ?? "").trim(), s = (o && !/drill level/i.test(o) && o !== i?.alias ? o : "") || i?.label || a, c = n < e ? r?.filters?.find((e) => e?.columnName === a)?.value : void 0;
|
|
1318
1320
|
return {
|
|
1319
1321
|
index: t?.index ?? String(n),
|
|
1320
1322
|
label: s,
|
|
@@ -1322,49 +1324,49 @@ var en = (a) => {
|
|
|
1322
1324
|
};
|
|
1323
1325
|
});
|
|
1324
1326
|
}, [
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
]),
|
|
1329
|
-
|
|
1330
|
-
}, [
|
|
1331
|
-
|
|
1332
|
-
let e =
|
|
1333
|
-
if (!e || !
|
|
1327
|
+
W,
|
|
1328
|
+
Fn,
|
|
1329
|
+
q
|
|
1330
|
+
]), wr = k.useRef(null), Tr = N.containerRef, Er = k.useCallback((e) => {
|
|
1331
|
+
wr.current = e, Tr && (Tr.current = e);
|
|
1332
|
+
}, [Tr]), Dr = Y.length > 1 ? Y[Y.length - 2]?.index : "";
|
|
1333
|
+
k.useEffect(() => {
|
|
1334
|
+
let e = wr.current;
|
|
1335
|
+
if (!e || !Dr) return;
|
|
1334
1336
|
let t = (e) => {
|
|
1335
1337
|
if (e.key !== "Escape" || e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
1336
1338
|
let t = e.target, n = t?.tagName;
|
|
1337
|
-
n === "INPUT" || n === "TEXTAREA" || n === "SELECT" || t?.isContentEditable || (e.preventDefault(), e.stopPropagation(),
|
|
1339
|
+
n === "INPUT" || n === "TEXTAREA" || n === "SELECT" || t?.isContentEditable || (e.preventDefault(), e.stopPropagation(), $n?.(Dr));
|
|
1338
1340
|
};
|
|
1339
1341
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
1340
|
-
}, [
|
|
1341
|
-
let
|
|
1342
|
-
|
|
1343
|
-
}, [
|
|
1344
|
-
let e =
|
|
1342
|
+
}, [Dr, $n]);
|
|
1343
|
+
let X = typeof B == "string" && B || typeof N.metricName == "string" && N.metricName || "metric", Or = k.useMemo(() => z(N.tableResultsDownloadData, F) ?? [], [N.tableResultsDownloadData, F]), kr = ze.has(L?.chartType), Ar = k.useCallback((e, t = X) => {
|
|
1344
|
+
Jt(e ?? [], `${t}.csv`);
|
|
1345
|
+
}, [X]), jr = k.useCallback(() => {
|
|
1346
|
+
let e = Wt(lr.current);
|
|
1345
1347
|
if (!e || e === "#") {
|
|
1346
|
-
V(
|
|
1348
|
+
V(kr ? "PNG export is only available for charts. Use Download CSV for this card." : "The chart is still drawing. Try Download PNG again in a moment.");
|
|
1347
1349
|
return;
|
|
1348
1350
|
}
|
|
1349
|
-
V(null),
|
|
1350
|
-
}, [
|
|
1351
|
-
|
|
1352
|
-
}, []),
|
|
1353
|
-
|
|
1351
|
+
V(null), Yt(e, `${X}.png`);
|
|
1352
|
+
}, [X, kr]), Z = N.getUnderlyingData, Mr = k.useCallback(() => {
|
|
1353
|
+
pn(!0);
|
|
1354
|
+
}, []), Nr = k.useCallback(() => {
|
|
1355
|
+
Ar(Or, X), T?.(t, M?.id), pn(!1);
|
|
1354
1356
|
}, [
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
]),
|
|
1361
|
-
if (!
|
|
1357
|
+
Ar,
|
|
1358
|
+
Or,
|
|
1359
|
+
X,
|
|
1360
|
+
T,
|
|
1361
|
+
M?.id
|
|
1362
|
+
]), Pr = k.useCallback(() => {
|
|
1363
|
+
if (!Z || bn.current) return;
|
|
1362
1364
|
bn.current = !0, V(null);
|
|
1363
|
-
let e =
|
|
1364
|
-
|
|
1365
|
+
let e = M?.dataSecuritySettings?.csvColumns || [], n = new Set(e), r = [], a = !1;
|
|
1366
|
+
Z({
|
|
1365
1367
|
columnName: void 0,
|
|
1366
1368
|
value: void 0,
|
|
1367
|
-
isSingleValueChart:
|
|
1369
|
+
isSingleValueChart: L?.chartType === i.singleValue,
|
|
1368
1370
|
setData: (e) => {
|
|
1369
1371
|
r = e || [];
|
|
1370
1372
|
},
|
|
@@ -1380,130 +1382,130 @@ var en = (a) => {
|
|
|
1380
1382
|
n.has(r) || (t[r] = e[r]);
|
|
1381
1383
|
}), t;
|
|
1382
1384
|
}) : r;
|
|
1383
|
-
|
|
1385
|
+
Ar(o, X), T?.(t, M?.id);
|
|
1384
1386
|
},
|
|
1385
1387
|
onError: () => {
|
|
1386
1388
|
a = !0;
|
|
1387
1389
|
},
|
|
1388
|
-
clientColumnType:
|
|
1390
|
+
clientColumnType: D ?? Ut,
|
|
1389
1391
|
withoutFilters: !0
|
|
1390
1392
|
});
|
|
1391
1393
|
}, [
|
|
1392
|
-
Q,
|
|
1393
|
-
I?.chartType,
|
|
1394
|
-
E,
|
|
1395
|
-
kr,
|
|
1396
1394
|
Z,
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1395
|
+
L?.chartType,
|
|
1396
|
+
D,
|
|
1397
|
+
Ar,
|
|
1398
|
+
X,
|
|
1399
|
+
T,
|
|
1400
|
+
M
|
|
1401
|
+
]), Q = N.onChangeFilterValue, Fr = k.useMemo(() => (N.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && e.datatype === "date"), [N.metricFilters]), Ir = k.useMemo(() => Xt(N.metricFilters?.filter((e) => e && e.datatype !== "date")), [N.metricFilters]), Lr = k.useCallback((e) => {
|
|
1402
|
+
Q && Object.entries(e).forEach(([e, t]) => {
|
|
1403
|
+
Array.isArray(t) ? Q(e, "", void 0, void 0, t.map((e) => ({
|
|
1402
1404
|
value: e,
|
|
1403
1405
|
label: e
|
|
1404
|
-
}))) :
|
|
1406
|
+
}))) : Q(e, t);
|
|
1405
1407
|
});
|
|
1406
|
-
}, [
|
|
1407
|
-
|
|
1408
|
+
}, [Q]), Rr = k.useCallback((e) => (t) => {
|
|
1409
|
+
Q?.(e, t.value, "", {
|
|
1408
1410
|
startDate: t.startDate,
|
|
1409
1411
|
endDate: t.endDate
|
|
1410
1412
|
}, void 0, t.timeGrainValue);
|
|
1411
|
-
}, [
|
|
1412
|
-
if (_n(!!e?.withoutFilters),
|
|
1413
|
+
}, [Q]), zr = k.useCallback((e) => {
|
|
1414
|
+
if (_n(!!e?.withoutFilters), H(!0), hn(!0), gr(e?.withoutFilters ? [] : e?.pointFilters ?? []), Tn({
|
|
1413
1415
|
limit: 100,
|
|
1414
1416
|
offset: 0
|
|
1415
|
-
}),
|
|
1416
|
-
if (!
|
|
1417
|
-
|
|
1417
|
+
}), Dn(0), Mn(null), !K) {
|
|
1418
|
+
if (!P && !I && (!F.length || R)) {
|
|
1419
|
+
Sn([]), H(!1);
|
|
1418
1420
|
return;
|
|
1419
1421
|
}
|
|
1420
|
-
|
|
1422
|
+
Z?.({
|
|
1421
1423
|
columnName: void 0,
|
|
1422
1424
|
value: void 0,
|
|
1423
|
-
isSingleValueChart:
|
|
1424
|
-
setData:
|
|
1425
|
-
setLoading:
|
|
1426
|
-
clientColumnType:
|
|
1425
|
+
isSingleValueChart: L?.chartType === i.singleValue,
|
|
1426
|
+
setData: Sn,
|
|
1427
|
+
setLoading: H,
|
|
1428
|
+
clientColumnType: D ?? Ut,
|
|
1427
1429
|
withoutFilters: !!e?.withoutFilters,
|
|
1428
1430
|
pointFilters: e?.withoutFilters ? void 0 : e?.pointFilters
|
|
1429
|
-
}),
|
|
1431
|
+
}), T?.(t, M?.id);
|
|
1430
1432
|
}
|
|
1431
1433
|
}, [
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
N,
|
|
1438
|
-
F,
|
|
1434
|
+
Z,
|
|
1435
|
+
L?.chartType,
|
|
1436
|
+
D,
|
|
1437
|
+
T,
|
|
1438
|
+
M?.id,
|
|
1439
1439
|
P,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1440
|
+
I,
|
|
1441
|
+
F,
|
|
1442
|
+
R,
|
|
1443
|
+
K
|
|
1444
|
+
]), Br = !!(ir && (J.chart?.isEnable || J.chartWithMetric?.isEnable || J.chartWithDashboard?.isEnable)), Vr = k.useMemo(() => {
|
|
1445
|
+
if (L?.chartType !== i.singleValue) return;
|
|
1446
|
+
if (!Br && !G) return Kt;
|
|
1445
1447
|
let e = (e, t) => {
|
|
1446
|
-
if (t === "primary" &&
|
|
1447
|
-
|
|
1448
|
+
if (t === "primary" && Br) {
|
|
1449
|
+
sr(e);
|
|
1448
1450
|
return;
|
|
1449
1451
|
}
|
|
1450
|
-
|
|
1452
|
+
G && zr();
|
|
1451
1453
|
};
|
|
1452
1454
|
return {
|
|
1453
1455
|
click: (t) => e(t, "primary"),
|
|
1454
1456
|
contextmenu: (t) => e(t, "secondary")
|
|
1455
1457
|
};
|
|
1456
1458
|
}, [
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
]),
|
|
1463
|
-
if (!
|
|
1464
|
-
if (
|
|
1459
|
+
L?.chartType,
|
|
1460
|
+
Br,
|
|
1461
|
+
sr,
|
|
1462
|
+
G,
|
|
1463
|
+
zr
|
|
1464
|
+
]), Hr = k.useMemo(() => K ? u(L) : void 0, [K, L]), Ur = k.useCallback((e, t) => {
|
|
1465
|
+
if (!Z) return;
|
|
1466
|
+
if (Tn({
|
|
1465
1467
|
limit: e.limit,
|
|
1466
1468
|
offset: e.offset
|
|
1467
|
-
}),
|
|
1468
|
-
|
|
1469
|
+
}), Mn(null), !P && !I && (!F.length || R)) {
|
|
1470
|
+
Sn([]), Dn(0), H(!1);
|
|
1469
1471
|
return;
|
|
1470
1472
|
}
|
|
1471
|
-
let n = t?.withoutFilters ??
|
|
1472
|
-
|
|
1473
|
+
let n = t?.withoutFilters ?? gn, r = t?.pointFilters ?? hr;
|
|
1474
|
+
Z({
|
|
1473
1475
|
pointFilters: n ? void 0 : r,
|
|
1474
1476
|
withoutFilters: n,
|
|
1475
1477
|
columnName: void 0,
|
|
1476
1478
|
value: void 0,
|
|
1477
|
-
isSingleValueChart:
|
|
1478
|
-
setData:
|
|
1479
|
-
setLoading:
|
|
1480
|
-
setTotalRecords:
|
|
1481
|
-
clientColumnType:
|
|
1479
|
+
isSingleValueChart: L?.chartType === i.singleValue,
|
|
1480
|
+
setData: Sn,
|
|
1481
|
+
setLoading: H,
|
|
1482
|
+
setTotalRecords: Dn,
|
|
1483
|
+
clientColumnType: D ?? Ut,
|
|
1482
1484
|
limit: String(e.limit),
|
|
1483
1485
|
offset: String(e.offset),
|
|
1484
1486
|
search: e.search,
|
|
1485
1487
|
searchColumns: e.searchColumns,
|
|
1486
1488
|
onError: () => {
|
|
1487
|
-
|
|
1489
|
+
Mn("We couldn't load these rows. Check your connection and try again."), H(!1);
|
|
1488
1490
|
}
|
|
1489
1491
|
});
|
|
1490
1492
|
}, [
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
N,
|
|
1497
|
-
F,
|
|
1493
|
+
Z,
|
|
1494
|
+
hr,
|
|
1495
|
+
gn,
|
|
1496
|
+
L?.chartType,
|
|
1497
|
+
D,
|
|
1498
1498
|
P,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1499
|
+
I,
|
|
1500
|
+
F,
|
|
1501
|
+
R
|
|
1502
|
+
]), Wr = k.useCallback(() => {
|
|
1503
|
+
if (dn(!0), G && L?.chartType === i.singleValue) {
|
|
1504
|
+
if (_n(!1), gr([]), Sn([]), Tn({
|
|
1503
1505
|
limit: 100,
|
|
1504
1506
|
offset: 0
|
|
1505
|
-
}),
|
|
1506
|
-
|
|
1507
|
+
}), Dn(0), Mn(null), K) {
|
|
1508
|
+
Ur({
|
|
1507
1509
|
limit: 100,
|
|
1508
1510
|
offset: 0
|
|
1509
1511
|
}, {
|
|
@@ -1512,49 +1514,49 @@ var en = (a) => {
|
|
|
1512
1514
|
});
|
|
1513
1515
|
return;
|
|
1514
1516
|
}
|
|
1515
|
-
if (!
|
|
1516
|
-
|
|
1517
|
+
if (!P && !I && (!F.length || R)) {
|
|
1518
|
+
Sn([]), H(!1);
|
|
1517
1519
|
return;
|
|
1518
1520
|
}
|
|
1519
|
-
|
|
1521
|
+
Z && (H(!0), Z({
|
|
1520
1522
|
columnName: void 0,
|
|
1521
1523
|
value: void 0,
|
|
1522
1524
|
isSingleValueChart: !0,
|
|
1523
|
-
setData:
|
|
1524
|
-
setLoading:
|
|
1525
|
-
clientColumnType:
|
|
1525
|
+
setData: Sn,
|
|
1526
|
+
setLoading: H,
|
|
1527
|
+
clientColumnType: D ?? Ut,
|
|
1526
1528
|
withoutFilters: !1,
|
|
1527
1529
|
pointFilters: void 0,
|
|
1528
1530
|
onError: () => {
|
|
1529
|
-
|
|
1531
|
+
Mn("We couldn't load these rows. Check your connection and try again."), H(!1);
|
|
1530
1532
|
}
|
|
1531
|
-
}),
|
|
1533
|
+
}), T?.(t, M?.id));
|
|
1532
1534
|
}
|
|
1533
1535
|
}, [
|
|
1536
|
+
G,
|
|
1537
|
+
L?.chartType,
|
|
1534
1538
|
K,
|
|
1535
|
-
|
|
1536
|
-
q,
|
|
1537
|
-
Hr,
|
|
1538
|
-
N,
|
|
1539
|
-
F,
|
|
1539
|
+
Ur,
|
|
1540
1540
|
P,
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1541
|
+
I,
|
|
1542
|
+
F,
|
|
1543
|
+
R,
|
|
1544
|
+
Z,
|
|
1545
|
+
D,
|
|
1546
|
+
T,
|
|
1547
|
+
M?.id
|
|
1548
|
+
]), Gr = k.useCallback((e) => new Promise((t, n) => {
|
|
1549
|
+
if (!Z) {
|
|
1548
1550
|
n(/* @__PURE__ */ Error("Underlying data is not available for this card."));
|
|
1549
1551
|
return;
|
|
1550
1552
|
}
|
|
1551
1553
|
let r = [], a = !1;
|
|
1552
|
-
|
|
1553
|
-
pointFilters:
|
|
1554
|
-
withoutFilters:
|
|
1554
|
+
Z({
|
|
1555
|
+
pointFilters: gn ? void 0 : hr,
|
|
1556
|
+
withoutFilters: gn,
|
|
1555
1557
|
columnName: void 0,
|
|
1556
1558
|
value: void 0,
|
|
1557
|
-
isSingleValueChart:
|
|
1559
|
+
isSingleValueChart: L?.chartType === i.singleValue,
|
|
1558
1560
|
setData: (e) => {
|
|
1559
1561
|
r = Array.isArray(e) ? e : [];
|
|
1560
1562
|
},
|
|
@@ -1567,7 +1569,7 @@ var en = (a) => {
|
|
|
1567
1569
|
t(r);
|
|
1568
1570
|
}
|
|
1569
1571
|
},
|
|
1570
|
-
clientColumnType:
|
|
1572
|
+
clientColumnType: D ?? Ut,
|
|
1571
1573
|
limit: String(e.limit),
|
|
1572
1574
|
offset: String(e.offset),
|
|
1573
1575
|
search: e.search,
|
|
@@ -1577,117 +1579,117 @@ var en = (a) => {
|
|
|
1577
1579
|
}
|
|
1578
1580
|
});
|
|
1579
1581
|
}), [
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
]),
|
|
1586
|
-
if (!
|
|
1587
|
-
|
|
1582
|
+
Z,
|
|
1583
|
+
hr,
|
|
1584
|
+
gn,
|
|
1585
|
+
L?.chartType,
|
|
1586
|
+
D
|
|
1587
|
+
]), Kr = k.useCallback(async (e) => {
|
|
1588
|
+
if (!Z || An.current) return;
|
|
1589
|
+
An.current = !0, V(null), kn({
|
|
1588
1590
|
isRunning: !0,
|
|
1589
1591
|
fetchedRows: 0
|
|
1590
1592
|
});
|
|
1591
1593
|
let n = [], r = 0, i = !1;
|
|
1592
1594
|
try {
|
|
1593
1595
|
for (;;) {
|
|
1594
|
-
let t = await
|
|
1595
|
-
limit:
|
|
1596
|
+
let t = await Gr({
|
|
1597
|
+
limit: Gt,
|
|
1596
1598
|
offset: r,
|
|
1597
1599
|
search: e.search,
|
|
1598
1600
|
searchColumns: e.searchColumns
|
|
1599
1601
|
});
|
|
1600
1602
|
for (let e of t) n.push(e);
|
|
1601
|
-
if (
|
|
1603
|
+
if (kn({
|
|
1602
1604
|
isRunning: !0,
|
|
1603
1605
|
fetchedRows: n.length
|
|
1604
|
-
}), t.length <
|
|
1605
|
-
if (n.length >=
|
|
1606
|
+
}), t.length < Gt || e.total > 0 && n.length >= e.total) break;
|
|
1607
|
+
if (n.length >= qt) {
|
|
1606
1608
|
i = !0;
|
|
1607
1609
|
break;
|
|
1608
1610
|
}
|
|
1609
|
-
r +=
|
|
1611
|
+
r += Gt;
|
|
1610
1612
|
}
|
|
1611
|
-
|
|
1613
|
+
Jt(n, `${X}.csv`), T?.(t, M?.id), i && V(`This export stopped at the first ${qt.toLocaleString()} rows. Narrow the metric or use a scheduled report for the full result.`);
|
|
1612
1614
|
} catch {
|
|
1613
1615
|
V("We couldn't download every row. Check your connection and try again, or download this page instead.");
|
|
1614
1616
|
} finally {
|
|
1615
|
-
|
|
1617
|
+
An.current = !1, kn({
|
|
1616
1618
|
isRunning: !1,
|
|
1617
1619
|
fetchedRows: 0
|
|
1618
1620
|
});
|
|
1619
1621
|
}
|
|
1620
1622
|
}, [
|
|
1621
|
-
Q,
|
|
1622
|
-
Wr,
|
|
1623
1623
|
Z,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1624
|
+
Gr,
|
|
1625
|
+
X,
|
|
1626
|
+
T,
|
|
1627
|
+
M?.id
|
|
1628
|
+
]), qr = k.useMemo(() => ge({
|
|
1629
|
+
position: qn,
|
|
1630
|
+
hasAuthoredNextLevel: rr === "drill",
|
|
1631
|
+
pool: W ? Xn : void 0,
|
|
1632
|
+
clickActions: J,
|
|
1633
|
+
canViewUnderlyingData: G,
|
|
1634
|
+
canDrillIntoAnyDimension: W,
|
|
1635
|
+
resultState: I ? "failed" : F?.length ? "ok" : "empty"
|
|
1634
1636
|
}), [
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
+
qn,
|
|
1638
|
+
rr,
|
|
1639
|
+
W,
|
|
1640
|
+
Xn,
|
|
1641
|
+
J,
|
|
1637
1642
|
G,
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
P
|
|
1643
|
-
]), qr = !!(ze && Ve), Jr = !!(ft && mt && !pt), Yr = G && nr !== "terminal" ? /* @__PURE__ */ k(Lt, {
|
|
1644
|
-
pool: Yn,
|
|
1643
|
+
I,
|
|
1644
|
+
F
|
|
1645
|
+
]), Jr = !!(Re && Be), Yr = !!(dt && pt && !ft), Xr = W && rr !== "terminal" ? /* @__PURE__ */ A(It, {
|
|
1646
|
+
pool: Xn,
|
|
1645
1647
|
testIdPrefix: "metric-card-options-drill",
|
|
1646
|
-
gestureHint:
|
|
1648
|
+
gestureHint: Zn ? "Right-click chart" : void 0,
|
|
1647
1649
|
onDrillInto: (e) => {
|
|
1648
|
-
|
|
1650
|
+
Qn?.({ dimension: e.column });
|
|
1649
1651
|
}
|
|
1650
|
-
}) : void 0,
|
|
1651
|
-
flags:
|
|
1652
|
-
optionsIcon:
|
|
1653
|
-
settingsIcon:
|
|
1654
|
-
onDownloadCsv:
|
|
1655
|
-
onDownloadPng:
|
|
1656
|
-
onEmailCsv:
|
|
1657
|
-
onFullscreen:
|
|
1658
|
-
onUnderlyingData:
|
|
1659
|
-
onSettings:
|
|
1660
|
-
splitBySubmenu:
|
|
1661
|
-
}),
|
|
1652
|
+
}) : void 0, Zr = /* @__PURE__ */ A(wt, {
|
|
1653
|
+
flags: In,
|
|
1654
|
+
optionsIcon: Qt(Ce),
|
|
1655
|
+
settingsIcon: Qt(we),
|
|
1656
|
+
onDownloadCsv: Ee ? (e) => e?.withoutFilters ? Pr() : Mr() : void 0,
|
|
1657
|
+
onDownloadPng: ke ? void 0 : jr,
|
|
1658
|
+
onEmailCsv: Oe ? () => Oe() : void 0,
|
|
1659
|
+
onFullscreen: Ln ? Wr : void 0,
|
|
1660
|
+
onUnderlyingData: G ? zr : void 0,
|
|
1661
|
+
onSettings: Jr ? () => Be?.(M) : void 0,
|
|
1662
|
+
splitBySubmenu: Xr
|
|
1663
|
+
}), Qr = /* @__PURE__ */ j("span", {
|
|
1662
1664
|
"data-testid": "metric-card-filter-slot",
|
|
1663
1665
|
className: "flex items-center gap-1",
|
|
1664
1666
|
children: [
|
|
1665
|
-
|
|
1666
|
-
defaultOption:
|
|
1667
|
-
onChange:
|
|
1668
|
-
hideDatePickerOptions:
|
|
1669
|
-
calendarType:
|
|
1667
|
+
Fr.map((e) => /* @__PURE__ */ A(Nt, {
|
|
1668
|
+
defaultOption: Zt(e),
|
|
1669
|
+
onChange: Rr(String(e.name)),
|
|
1670
|
+
hideDatePickerOptions: Xe,
|
|
1671
|
+
calendarType: Ze
|
|
1670
1672
|
}, String(e.name))),
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
filters:
|
|
1673
|
-
onChange:
|
|
1674
|
-
position:
|
|
1675
|
-
multi:
|
|
1673
|
+
/* @__PURE__ */ A(Bt, {
|
|
1674
|
+
filters: Ir,
|
|
1675
|
+
onChange: Lr,
|
|
1676
|
+
position: Je,
|
|
1677
|
+
multi: Ye
|
|
1676
1678
|
}),
|
|
1677
|
-
|
|
1679
|
+
Yr ? /* @__PURE__ */ A(E, {
|
|
1678
1680
|
type: "button",
|
|
1679
1681
|
variant: "outline",
|
|
1680
1682
|
size: "icon-sm",
|
|
1681
1683
|
"aria-label": "Merge metrics",
|
|
1682
1684
|
"data-testid": "metric-card-merge",
|
|
1683
|
-
onClick: () =>
|
|
1685
|
+
onClick: () => pt?.({
|
|
1684
1686
|
isOpen: !0,
|
|
1685
|
-
chartOptions:
|
|
1686
|
-
id:
|
|
1687
|
+
chartOptions: L,
|
|
1688
|
+
id: M?.id
|
|
1687
1689
|
}),
|
|
1688
|
-
children: /* @__PURE__ */
|
|
1690
|
+
children: /* @__PURE__ */ A(ut, { "aria-hidden": "true" })
|
|
1689
1691
|
}) : null,
|
|
1690
|
-
|
|
1692
|
+
Ln ? /* @__PURE__ */ A(E, {
|
|
1691
1693
|
type: "button",
|
|
1692
1694
|
variant: "ghost",
|
|
1693
1695
|
size: "icon-sm",
|
|
@@ -1695,41 +1697,47 @@ var en = (a) => {
|
|
|
1695
1697
|
"aria-label": "Fullscreen",
|
|
1696
1698
|
title: "Fullscreen",
|
|
1697
1699
|
"data-testid": "metric-card-fullscreen",
|
|
1698
|
-
onClick:
|
|
1699
|
-
children: /* @__PURE__ */
|
|
1700
|
+
onClick: Wr,
|
|
1701
|
+
children: /* @__PURE__ */ A(Se, { "aria-hidden": "true" })
|
|
1700
1702
|
}) : null,
|
|
1701
|
-
|
|
1703
|
+
Zr
|
|
1702
1704
|
]
|
|
1703
|
-
}),
|
|
1704
|
-
if (!
|
|
1705
|
-
if (
|
|
1706
|
-
|
|
1705
|
+
}), $r = !!N.isExternalChart, ei = L?.tableSettings, ti = L?.chartType === i.table && ei?.disablePagination !== !0, ni = Number(ei?.defaultRowSize) || 100, ri = L?.chartType === i.table && !!ei?.enableTableSearch, ii = k.useMemo(() => {
|
|
1706
|
+
if (!kr || !(zn || ti)) return;
|
|
1707
|
+
if (!$r) return zn ? { mode: "client" } : {
|
|
1708
|
+
mode: "client",
|
|
1709
|
+
pageSize: ni,
|
|
1710
|
+
autoPageAbove: ni
|
|
1711
|
+
};
|
|
1712
|
+
let e = N.paginationInfo;
|
|
1707
1713
|
return {
|
|
1708
1714
|
mode: "server",
|
|
1709
1715
|
limit: e?.limit || 100,
|
|
1710
1716
|
offset: e?.offset || 0,
|
|
1711
1717
|
totalRows: e?.totalRecords || 0,
|
|
1712
|
-
onChangePage:
|
|
1713
|
-
isEnableNextBtn: !!
|
|
1714
|
-
isEnablePrevBtn: !!
|
|
1718
|
+
onChangePage: N.onChangePage,
|
|
1719
|
+
isEnableNextBtn: !!N.isEnableNextBtn,
|
|
1720
|
+
isEnablePrevBtn: !!N.isEnablePrevBtn
|
|
1715
1721
|
};
|
|
1716
1722
|
}, [
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1723
|
+
zn,
|
|
1724
|
+
ti,
|
|
1725
|
+
ni,
|
|
1726
|
+
kr,
|
|
1727
|
+
$r,
|
|
1728
|
+
N.paginationInfo,
|
|
1729
|
+
N.onChangePage,
|
|
1730
|
+
N.isEnableNextBtn,
|
|
1731
|
+
N.isEnablePrevBtn
|
|
1732
|
+
]), ai = k.useMemo(() => {
|
|
1733
|
+
if (K) return {
|
|
1726
1734
|
mode: "server",
|
|
1727
|
-
limit:
|
|
1728
|
-
offset:
|
|
1729
|
-
totalRows:
|
|
1735
|
+
limit: U.limit,
|
|
1736
|
+
offset: U.offset,
|
|
1737
|
+
totalRows: En,
|
|
1730
1738
|
onChangePage: (e, t, n) => {
|
|
1731
|
-
let r = t ??
|
|
1732
|
-
|
|
1739
|
+
let r = t ?? U.limit, i = t === void 0 ? n ?? (e ? Math.max(0, U.offset - r) : U.offset + r) : 0;
|
|
1740
|
+
Ur({
|
|
1733
1741
|
limit: r,
|
|
1734
1742
|
offset: i
|
|
1735
1743
|
}, {
|
|
@@ -1739,222 +1747,223 @@ var en = (a) => {
|
|
|
1739
1747
|
}
|
|
1740
1748
|
};
|
|
1741
1749
|
}, [
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
]),
|
|
1750
|
+
K,
|
|
1751
|
+
U.limit,
|
|
1752
|
+
U.offset,
|
|
1753
|
+
En,
|
|
1754
|
+
Ur
|
|
1755
|
+
]), oi = !P && !I && (!F.length || R), si = (e) => {
|
|
1748
1756
|
let t = e?.value;
|
|
1749
1757
|
return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim() !== "" : t != null;
|
|
1750
|
-
},
|
|
1751
|
-
isCustomSqlMetric: !!
|
|
1752
|
-
query:
|
|
1753
|
-
metricId:
|
|
1754
|
-
filters: [...
|
|
1755
|
-
}),
|
|
1756
|
-
|
|
1757
|
-
Array.isArray(e.value) ?
|
|
1758
|
-
}),
|
|
1758
|
+
}, ci = (N.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && si(e)), $ = ci.length > 0 || !!a.globalFilters?.filters?.length || !!a.crossDashboardFilters?.length || (N.rlsConditions ?? []).some((e) => e.isAppFilter && e.isAddOnMetrics && si({ value: a.appFilters?.values?.[e.name] ?? e.value })), li = oe({
|
|
1759
|
+
isCustomSqlMetric: !!M?.datasetMetricSettings?.isUseRawSQL,
|
|
1760
|
+
query: M?.query,
|
|
1761
|
+
metricId: M?.id,
|
|
1762
|
+
filters: [...ci, ...a.globalFilters?.filters || []]
|
|
1763
|
+
}), ui = k.useCallback(() => {
|
|
1764
|
+
Q && ci.forEach((e) => {
|
|
1765
|
+
Array.isArray(e.value) ? Q(e.name, "", void 0, void 0, []) : Q(e.name, "");
|
|
1766
|
+
}), lt?.(), N.refetchMetricData();
|
|
1759
1767
|
}, [
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
]),
|
|
1768
|
+
Q,
|
|
1769
|
+
ci,
|
|
1770
|
+
lt,
|
|
1771
|
+
N.refetchMetricData
|
|
1772
|
+
]), di = !!Q && ci.length > 0 || !!lt, fi = ct === !0 || o() && ct !== !1, pi = se({
|
|
1765
1773
|
kind: "none",
|
|
1766
1774
|
reason: "empty-result"
|
|
1767
|
-
}),
|
|
1775
|
+
}), mi = Y.length > 0 ? /* @__PURE__ */ A("div", {
|
|
1768
1776
|
"data-testid": "card-drill-empty-state",
|
|
1769
1777
|
"data-slot": "metric-card-drill-empty",
|
|
1770
1778
|
className: "flex min-h-0 w-full flex-1 flex-col",
|
|
1771
|
-
children: /* @__PURE__ */
|
|
1772
|
-
hasActiveFilters:
|
|
1773
|
-
noDataImg:
|
|
1774
|
-
noDataFoundSvg:
|
|
1775
|
-
message: `${
|
|
1776
|
-
...
|
|
1779
|
+
children: /* @__PURE__ */ A(Ve, {
|
|
1780
|
+
hasActiveFilters: $,
|
|
1781
|
+
noDataImg: Te,
|
|
1782
|
+
noDataFoundSvg: w,
|
|
1783
|
+
message: `${pi.title}. ${pi.body}`,
|
|
1784
|
+
...on
|
|
1777
1785
|
})
|
|
1778
|
-
}) :
|
|
1779
|
-
hasActiveFilters:
|
|
1780
|
-
noDataImg:
|
|
1781
|
-
noDataFoundSvg:
|
|
1782
|
-
message:
|
|
1783
|
-
action:
|
|
1786
|
+
}) : fi ? /* @__PURE__ */ A(Ve, {
|
|
1787
|
+
hasActiveFilters: $,
|
|
1788
|
+
noDataImg: Te,
|
|
1789
|
+
noDataFoundSvg: w,
|
|
1790
|
+
message: an,
|
|
1791
|
+
action: $ && di ? /* @__PURE__ */ A(E, {
|
|
1784
1792
|
type: "button",
|
|
1785
1793
|
"data-testid": "card-clear-filters",
|
|
1786
1794
|
variant: "outline",
|
|
1787
1795
|
size: "sm",
|
|
1788
|
-
onClick:
|
|
1789
|
-
children:
|
|
1796
|
+
onClick: ui,
|
|
1797
|
+
children: lt ? "Clear all filters" : "Clear card filters"
|
|
1790
1798
|
}) : void 0,
|
|
1791
|
-
...
|
|
1792
|
-
}) : null,
|
|
1793
|
-
crumbs:
|
|
1799
|
+
...on
|
|
1800
|
+
}) : null, hi = !!ii && ii.mode === "server" && !!P && !I && F.length > 0, gi = (W || Fn) && Y.length ? /* @__PURE__ */ A(xt, {
|
|
1801
|
+
crumbs: Y,
|
|
1794
1802
|
onDrillLevelClick: (e) => {
|
|
1795
|
-
|
|
1803
|
+
$n?.(e);
|
|
1796
1804
|
},
|
|
1797
1805
|
onUp: (e) => {
|
|
1798
|
-
|
|
1806
|
+
$n?.(e);
|
|
1799
1807
|
},
|
|
1800
1808
|
onResetDrill: () => {
|
|
1801
|
-
|
|
1809
|
+
$n?.("", !0);
|
|
1802
1810
|
}
|
|
1803
|
-
}) : void 0,
|
|
1811
|
+
}) : void 0, _i = P && !hi, vi = oi && Y.length > 0, yi = _i || vi ? void 0 : N.drillBlockedNotice ? /* @__PURE__ */ A("span", {
|
|
1804
1812
|
className: "text-caption text-(--muted-foreground)",
|
|
1805
1813
|
"data-testid": "metric-card-drill-blocked-notice",
|
|
1806
1814
|
"data-reason": "blank-value",
|
|
1807
|
-
children:
|
|
1808
|
-
}) :
|
|
1815
|
+
children: N.drillBlockedNotice.title
|
|
1816
|
+
}) : Y.length && qr.kind === "none" ? /* @__PURE__ */ A("span", {
|
|
1809
1817
|
className: "text-caption text-(--muted-foreground)",
|
|
1810
1818
|
"data-testid": "metric-card-terminal-notice",
|
|
1811
|
-
"data-reason":
|
|
1812
|
-
children:
|
|
1813
|
-
}) : void 0,
|
|
1819
|
+
"data-reason": qr.reason,
|
|
1820
|
+
children: se(qr).title
|
|
1821
|
+
}) : void 0, bi = gi != null || yi != null ? /* @__PURE__ */ j("div", {
|
|
1814
1822
|
"data-testid": "metric-card-drill-breadcrumb",
|
|
1815
1823
|
"data-slot": "metric-card-drill-chrome",
|
|
1816
1824
|
className: "mb-2 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1",
|
|
1817
|
-
children: [
|
|
1818
|
-
}) : null,
|
|
1819
|
-
if (
|
|
1820
|
-
else if (
|
|
1821
|
-
message: s(
|
|
1822
|
-
error: s(
|
|
1823
|
-
widgetName: typeof
|
|
1824
|
-
chartType:
|
|
1825
|
-
onRetry:
|
|
1826
|
-
knownCause:
|
|
1827
|
-
...
|
|
1825
|
+
children: [gi, yi]
|
|
1826
|
+
}) : null, xi;
|
|
1827
|
+
if (P && !hi) xi = /* @__PURE__ */ A(Ue, { className: "flex-1" });
|
|
1828
|
+
else if (I) xi = /* @__PURE__ */ A(Ae, {
|
|
1829
|
+
message: s(I) ? Pt : void 0,
|
|
1830
|
+
error: s(I) ? void 0 : rn,
|
|
1831
|
+
widgetName: typeof B == "string" ? B : void 0,
|
|
1832
|
+
chartType: L?.chartType,
|
|
1833
|
+
onRetry: Pt || rn?.retryable === !1 ? void 0 : Ft,
|
|
1834
|
+
knownCause: ht,
|
|
1835
|
+
...on
|
|
1828
1836
|
});
|
|
1829
|
-
else if (
|
|
1837
|
+
else if (kt) xi = /* @__PURE__ */ A("div", {
|
|
1830
1838
|
"data-testid": "card-join-mismatch-state",
|
|
1831
1839
|
"data-slot": "metric-card-join-mismatch",
|
|
1832
|
-
children: /* @__PURE__ */
|
|
1833
|
-
error: e(
|
|
1834
|
-
...
|
|
1840
|
+
children: /* @__PURE__ */ A(Ae, {
|
|
1841
|
+
error: e(pe(a.mismatchReason === "column" ? "column" : "join")),
|
|
1842
|
+
...on
|
|
1835
1843
|
})
|
|
1836
1844
|
});
|
|
1837
|
-
else if (
|
|
1838
|
-
hasActiveFilters:
|
|
1839
|
-
noDataImg:
|
|
1840
|
-
noDataFoundSvg:
|
|
1841
|
-
message:
|
|
1842
|
-
...
|
|
1845
|
+
else if (oi) xi = mi ?? /* @__PURE__ */ A(Ve, {
|
|
1846
|
+
hasActiveFilters: $,
|
|
1847
|
+
noDataImg: Te,
|
|
1848
|
+
noDataFoundSvg: w,
|
|
1849
|
+
message: an,
|
|
1850
|
+
...on
|
|
1843
1851
|
});
|
|
1844
1852
|
else {
|
|
1845
|
-
let e = /* @__PURE__ */
|
|
1846
|
-
hasActiveFilters:
|
|
1847
|
-
canOpenDataPointMenu:
|
|
1848
|
-
metric:
|
|
1849
|
-
chartSettings:
|
|
1850
|
-
data:
|
|
1851
|
-
serverTruncation:
|
|
1853
|
+
let e = /* @__PURE__ */ A(He, {
|
|
1854
|
+
hasActiveFilters: $,
|
|
1855
|
+
canOpenDataPointMenu: Rn,
|
|
1856
|
+
metric: M,
|
|
1857
|
+
chartSettings: L,
|
|
1858
|
+
data: F,
|
|
1859
|
+
serverTruncation: N.truncation ?? null,
|
|
1852
1860
|
isLoading: !1,
|
|
1853
|
-
tablePaging:
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1861
|
+
tablePaging: ii,
|
|
1862
|
+
tableSearch: ri,
|
|
1863
|
+
isTableRefreshing: hi,
|
|
1864
|
+
enableCoverageTruncation: st,
|
|
1865
|
+
emptyState: mi ?? void 0,
|
|
1866
|
+
chartColors: ln,
|
|
1867
|
+
chartRendererType: _e,
|
|
1868
|
+
chartAppearance: ve,
|
|
1869
|
+
appearanceOptions: ye,
|
|
1870
|
+
chartColumns: be,
|
|
1871
|
+
height: C,
|
|
1872
|
+
width: xe,
|
|
1873
|
+
onEvents: Vr ?? Cr,
|
|
1874
|
+
onTableCellClick: W ? fr : void 0,
|
|
1875
|
+
onOpenSection: Jr ? () => Be?.(M) : void 0,
|
|
1867
1876
|
openSectionLabel: "Edit metric",
|
|
1868
1877
|
onChartReady: (e) => {
|
|
1869
|
-
|
|
1878
|
+
lr.current = e;
|
|
1870
1879
|
}
|
|
1871
1880
|
});
|
|
1872
|
-
|
|
1873
|
-
ref:
|
|
1881
|
+
xi = Rn ? /* @__PURE__ */ j("div", {
|
|
1882
|
+
ref: dr,
|
|
1874
1883
|
className: "relative flex min-h-0 w-full flex-1 flex-col",
|
|
1875
|
-
children: [e, /* @__PURE__ */
|
|
1876
|
-
open:
|
|
1884
|
+
children: [e, /* @__PURE__ */ A(Lt, {
|
|
1885
|
+
open: Bn.open,
|
|
1877
1886
|
onOpenChange: (e) => {
|
|
1878
|
-
e ||
|
|
1887
|
+
e || Gn();
|
|
1879
1888
|
},
|
|
1880
|
-
anchor:
|
|
1881
|
-
point:
|
|
1882
|
-
onCopyValue:
|
|
1883
|
-
onFilterTo:
|
|
1884
|
-
canFilterThisMetric: !!
|
|
1885
|
-
canFilterDashboard:
|
|
1886
|
-
isFilterableColumn:
|
|
1887
|
-
canExcludeValues:
|
|
1888
|
-
pool:
|
|
1889
|
-
canSplitBy:
|
|
1889
|
+
anchor: Bn.anchor,
|
|
1890
|
+
point: mr,
|
|
1891
|
+
onCopyValue: vr,
|
|
1892
|
+
onFilterTo: W && (nr && N.onMetricFiltersChange || br) ? Sr : void 0,
|
|
1893
|
+
canFilterThisMetric: !!nr && !!N.onMetricFiltersChange,
|
|
1894
|
+
canFilterDashboard: br,
|
|
1895
|
+
isFilterableColumn: xr,
|
|
1896
|
+
canExcludeValues: Pn.canExcludeFilterValues,
|
|
1897
|
+
pool: Xn,
|
|
1898
|
+
canSplitBy: W,
|
|
1890
1899
|
onDrillInto: (e) => {
|
|
1891
|
-
|
|
1900
|
+
Gn(), Qn?.({
|
|
1892
1901
|
dimension: e.column,
|
|
1893
|
-
params:
|
|
1894
|
-
point:
|
|
1902
|
+
params: Bn.params,
|
|
1903
|
+
point: mr
|
|
1895
1904
|
});
|
|
1896
1905
|
},
|
|
1897
|
-
onViewUnderlyingData:
|
|
1898
|
-
|
|
1906
|
+
onViewUnderlyingData: G ? () => {
|
|
1907
|
+
Gn(), zr({ pointFilters: m(mr).filters });
|
|
1899
1908
|
} : void 0
|
|
1900
1909
|
})]
|
|
1901
1910
|
}) : e;
|
|
1902
1911
|
}
|
|
1903
|
-
let
|
|
1904
|
-
return /* @__PURE__ */
|
|
1905
|
-
/* @__PURE__ */
|
|
1906
|
-
ref:
|
|
1912
|
+
let Si = !!(Le && Ln);
|
|
1913
|
+
return /* @__PURE__ */ j(it, { children: [
|
|
1914
|
+
/* @__PURE__ */ j("div", {
|
|
1915
|
+
ref: Er,
|
|
1907
1916
|
"data-testid": "metric-card-v2",
|
|
1908
1917
|
"data-slot": "metric-card",
|
|
1909
|
-
"data-fullscreen-open":
|
|
1910
|
-
"data-download-open":
|
|
1911
|
-
"data-underlying-open":
|
|
1912
|
-
"data-title-click-fullscreen":
|
|
1913
|
-
className:
|
|
1918
|
+
"data-fullscreen-open": un || void 0,
|
|
1919
|
+
"data-download-open": fn || void 0,
|
|
1920
|
+
"data-underlying-open": mn || void 0,
|
|
1921
|
+
"data-title-click-fullscreen": Si ? "" : void 0,
|
|
1922
|
+
className: O("group/metric-card flex h-full w-full flex-col gap-3 bg-(--card) text-(--card-foreground) rounded-(--radius-lg) p-4", "overflow-clip", !sn && "border border-border-strong", !cn && "transition-shadow hover:ring-1 hover:ring-border-strong motion-reduce:transition-none", qe),
|
|
1914
1923
|
children: [
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
title:
|
|
1917
|
-
description:
|
|
1924
|
+
/* @__PURE__ */ A(Ct, {
|
|
1925
|
+
title: B,
|
|
1926
|
+
description: $t,
|
|
1918
1927
|
isDisableCardTitle: f,
|
|
1919
|
-
infoContent:
|
|
1920
|
-
actions:
|
|
1921
|
-
onTitleClick:
|
|
1928
|
+
infoContent: nn,
|
|
1929
|
+
actions: Qr,
|
|
1930
|
+
onTitleClick: Si ? Wr : void 0
|
|
1922
1931
|
}),
|
|
1923
|
-
/* @__PURE__ */
|
|
1924
|
-
className:
|
|
1925
|
-
"aria-busy":
|
|
1932
|
+
/* @__PURE__ */ j("div", {
|
|
1933
|
+
className: O("flex min-h-0 w-full flex-1 flex-col", Mt && "relative opacity-60 transition-opacity motion-reduce:transition-none"),
|
|
1934
|
+
"aria-busy": Mt || void 0,
|
|
1926
1935
|
children: [
|
|
1927
|
-
|
|
1936
|
+
Mt ? /* @__PURE__ */ A("div", {
|
|
1928
1937
|
"data-testid": "metric-card-updating",
|
|
1929
1938
|
"aria-hidden": "true",
|
|
1930
1939
|
className: "pointer-events-none absolute inset-x-0 top-0 z-2 h-0.5 animate-pulse bg-(--primary) motion-reduce:animate-none"
|
|
1931
1940
|
}) : null,
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
|
|
1941
|
+
/* @__PURE__ */ A(ue, { text: li }),
|
|
1942
|
+
N.filterNotAppliedNotice ? /* @__PURE__ */ A("div", {
|
|
1934
1943
|
role: "status",
|
|
1935
1944
|
className: "mb-2 text-caption text-(--muted-foreground)",
|
|
1936
1945
|
"data-testid": "metric-card-filter-not-applied-notice",
|
|
1937
|
-
children:
|
|
1946
|
+
children: N.filterNotAppliedNotice
|
|
1938
1947
|
}) : null,
|
|
1939
|
-
|
|
1940
|
-
|
|
1948
|
+
bi,
|
|
1949
|
+
xi
|
|
1941
1950
|
]
|
|
1942
1951
|
}),
|
|
1943
|
-
vn ? /* @__PURE__ */
|
|
1952
|
+
vn ? /* @__PURE__ */ j("div", {
|
|
1944
1953
|
role: "alert",
|
|
1945
1954
|
"data-testid": "card-download-error",
|
|
1946
1955
|
"data-slot": "metric-card-download-error",
|
|
1947
1956
|
className: "flex items-center gap-2 rounded-(--radius-sm) border border-(--destructive)/20 bg-(--destructive)/10 px-2.5 py-1.5 text-xs text-(--destructive)",
|
|
1948
1957
|
children: [
|
|
1949
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ A(g, {
|
|
1950
1959
|
className: "size-3.5 shrink-0",
|
|
1951
1960
|
"aria-hidden": "true"
|
|
1952
1961
|
}),
|
|
1953
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ A("span", {
|
|
1954
1963
|
className: "flex-1",
|
|
1955
1964
|
children: vn
|
|
1956
1965
|
}),
|
|
1957
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ A(E, {
|
|
1958
1967
|
type: "button",
|
|
1959
1968
|
variant: "ghost",
|
|
1960
1969
|
size: "icon-xs",
|
|
@@ -1962,75 +1971,77 @@ var en = (a) => {
|
|
|
1962
1971
|
"data-testid": "card-download-error-dismiss",
|
|
1963
1972
|
className: "text-(--destructive) hover:bg-(--destructive)/15 hover:text-(--destructive)",
|
|
1964
1973
|
onClick: yn,
|
|
1965
|
-
children: /* @__PURE__ */
|
|
1974
|
+
children: /* @__PURE__ */ A(nt, { "aria-hidden": "true" })
|
|
1966
1975
|
})
|
|
1967
1976
|
]
|
|
1968
1977
|
}) : null,
|
|
1969
|
-
/* @__PURE__ */
|
|
1978
|
+
/* @__PURE__ */ A(St, { longDescription: tn })
|
|
1970
1979
|
]
|
|
1971
1980
|
}),
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
-
open:
|
|
1974
|
-
onOpenChange:
|
|
1975
|
-
rows:
|
|
1976
|
-
onDownload:
|
|
1977
|
-
onEmail:
|
|
1981
|
+
/* @__PURE__ */ A(Rt, {
|
|
1982
|
+
open: fn,
|
|
1983
|
+
onOpenChange: pn,
|
|
1984
|
+
rows: Or,
|
|
1985
|
+
onDownload: Nr,
|
|
1986
|
+
onEmail: Oe ? () => Oe() : void 0
|
|
1978
1987
|
}),
|
|
1979
|
-
/* @__PURE__ */
|
|
1980
|
-
hasActiveFilters: !
|
|
1981
|
-
open:
|
|
1982
|
-
onOpenChange:
|
|
1983
|
-
title:
|
|
1984
|
-
columns:
|
|
1988
|
+
/* @__PURE__ */ A(Fe, {
|
|
1989
|
+
hasActiveFilters: !gn && $,
|
|
1990
|
+
open: mn,
|
|
1991
|
+
onOpenChange: hn,
|
|
1992
|
+
title: gn ? "Underlying data (filters ignored)" : "Underlying data",
|
|
1993
|
+
columns: wn,
|
|
1985
1994
|
rows: xn,
|
|
1986
|
-
presentation:
|
|
1987
|
-
selectedDims:
|
|
1988
|
-
selectedMetrics:
|
|
1989
|
-
measureFormatter:
|
|
1990
|
-
scope:
|
|
1991
|
-
isLoading:
|
|
1992
|
-
error:
|
|
1995
|
+
presentation: K ? {
|
|
1996
|
+
selectedDims: M?.datasetMetricSettings?.newDatasetSettings?.selectedDims,
|
|
1997
|
+
selectedMetrics: M?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics,
|
|
1998
|
+
measureFormatter: Hr,
|
|
1999
|
+
scope: _r,
|
|
2000
|
+
isLoading: Cn,
|
|
2001
|
+
error: jn,
|
|
1993
2002
|
paging: {
|
|
1994
|
-
limit:
|
|
1995
|
-
offset:
|
|
1996
|
-
totalRows:
|
|
1997
|
-
onRequestPage:
|
|
1998
|
-
canSearch:
|
|
1999
|
-
language:
|
|
2000
|
-
translationDictionary:
|
|
2003
|
+
limit: U.limit,
|
|
2004
|
+
offset: U.offset,
|
|
2005
|
+
totalRows: En,
|
|
2006
|
+
onRequestPage: Ur,
|
|
2007
|
+
canSearch: re({
|
|
2008
|
+
language: We,
|
|
2009
|
+
translationDictionary: Ge
|
|
2001
2010
|
})
|
|
2002
2011
|
}
|
|
2003
2012
|
} : void 0,
|
|
2004
|
-
onDownload: () =>
|
|
2005
|
-
onDownloadAll:
|
|
2006
|
-
downloadAllState:
|
|
2013
|
+
onDownload: () => Ar(xn),
|
|
2014
|
+
onDownloadAll: K ? Kr : void 0,
|
|
2015
|
+
downloadAllState: On
|
|
2007
2016
|
}),
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
hasActiveFilters:
|
|
2010
|
-
open:
|
|
2011
|
-
onOpenChange:
|
|
2012
|
-
metric:
|
|
2013
|
-
chartSettings:
|
|
2014
|
-
data:
|
|
2015
|
-
chartColors:
|
|
2016
|
-
chartAppearance:
|
|
2017
|
-
chartRendererType:
|
|
2018
|
-
title:
|
|
2019
|
-
isLoading:
|
|
2020
|
-
error:
|
|
2021
|
-
isJoinMismatch: !!
|
|
2022
|
-
onRetry:
|
|
2023
|
-
copyProps:
|
|
2024
|
-
|
|
2017
|
+
/* @__PURE__ */ A(zt, {
|
|
2018
|
+
hasActiveFilters: $,
|
|
2019
|
+
open: un,
|
|
2020
|
+
onOpenChange: dn,
|
|
2021
|
+
metric: M,
|
|
2022
|
+
chartSettings: L,
|
|
2023
|
+
data: F,
|
|
2024
|
+
chartColors: ln,
|
|
2025
|
+
chartAppearance: ve,
|
|
2026
|
+
chartRendererType: _e,
|
|
2027
|
+
title: B,
|
|
2028
|
+
isLoading: P && !hi,
|
|
2029
|
+
error: I,
|
|
2030
|
+
isJoinMismatch: !!kt,
|
|
2031
|
+
onRetry: Ft,
|
|
2032
|
+
copyProps: on,
|
|
2033
|
+
tablePaging: ii,
|
|
2034
|
+
tableSearch: ri,
|
|
2035
|
+
underlyingData: G && L?.chartType === i.singleValue ? {
|
|
2025
2036
|
rows: xn,
|
|
2026
|
-
columns:
|
|
2027
|
-
isLoading:
|
|
2028
|
-
error:
|
|
2029
|
-
onRetry:
|
|
2030
|
-
paging:
|
|
2037
|
+
columns: wn,
|
|
2038
|
+
isLoading: Cn,
|
|
2039
|
+
error: jn,
|
|
2040
|
+
onRetry: Wr,
|
|
2041
|
+
paging: ai
|
|
2031
2042
|
} : void 0
|
|
2032
2043
|
})
|
|
2033
2044
|
] });
|
|
2034
2045
|
};
|
|
2035
2046
|
//#endregion
|
|
2036
|
-
export {
|
|
2047
|
+
export { $t as MetricCardV2, $t as default };
|