@databrainhq/plugin 0.17.9-beta.89 → 0.17.9-beta.90
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-Cm7NvhtU.mjs → Accordion-CBeM5jJS.mjs} +1 -1
- package/dist/{CardChartSlot-C6Mvfs25.mjs → CardChartSlot-B-Ngm7L2.mjs} +7 -7
- package/dist/{Chart-D59hFodU.mjs → Chart-DVy_ucZn.mjs} +8 -8
- package/dist/{ChartCardOverlay-BU9Az6O8.mjs → ChartCardOverlay-VSQRyMW2.mjs} +1 -1
- package/dist/{ChartTypePanel-Bd9xpwBz.mjs → ChartTypePanel-CD8UZYq_.mjs} +12 -12
- package/dist/{CreateGlobalFilter-BglIVAbU.mjs → CreateGlobalFilter-B0W6aBZS.mjs} +2 -2
- package/dist/{CreateMetricV2-B4Qh8ilT.mjs → CreateMetricV2-CfROozFF.mjs} +18 -14
- package/dist/{HorizontalStackTable-CbHC13wB.mjs → HorizontalStackTable-C6Y8jTZx.mjs} +3 -3
- package/dist/{ManageMetricsV2-DZ3hRAVE.mjs → ManageMetricsV2-CKLIByOd.mjs} +3 -3
- package/dist/{MetricCardV2-78VV9622.mjs → MetricCardV2-DzI3bmvs.mjs} +623 -626
- package/dist/{NoDataFound-C49L7xWQ.mjs → NoDataFound-DJlW6hHe.mjs} +1 -1
- package/dist/{Panel-CMkiqPwr.mjs → Panel-BHzPWaa8.mjs} +1 -1
- package/dist/{PivotTableV2-By0gA5rR.mjs → PivotTableV2-Bd1SHLUx.mjs} +2 -2
- package/dist/{PivotTableV3--v3NlWBG.mjs → PivotTableV3-CHm-stWR.mjs} +4 -4
- package/dist/{Portal-BINiwYIE.mjs → Portal-CL-S1tXR.mjs} +29 -11
- package/dist/{RadioButton-D2xlAse7.mjs → RadioButton-DZWBIci3.mjs} +30 -30
- package/dist/{ScheduleEmail-GnNMpHBH.mjs → ScheduleEmail-Dv8m65aQ.mjs} +145 -136
- package/dist/{SearchMetricData-DJW7y87n.mjs → SearchMetricData-LScEnff3.mjs} +13 -13
- package/dist/{SortPanel-B0K5hI59.mjs → SortPanel-BPOISeUj.mjs} +9 -9
- package/dist/{Table-DQlYOUYN.mjs → Table-DI_eYdYo.mjs} +4 -4
- package/dist/{TagInputField-BGM6vEtu.mjs → TagInputField-C0AKAT5E.mjs} +5 -5
- package/dist/{TextAreaField-DBMbqlLr.mjs → TextAreaField-BGLVqIH_.mjs} +2 -2
- package/dist/{TimeSeriesSettings-Bu9CIVts.mjs → TimeSeriesSettings-D-02eLGd.mjs} +2 -2
- package/dist/{cardStates-C6q56mQy.mjs → cardStates-YaeHm3yq.mjs} +1 -1
- package/dist/{charts-BCsWRROL.mjs → charts-BfKyYVQ3.mjs} +1 -1
- package/dist/{clickActions-D9ZeoDnp.mjs → clickActions-GtHmsSzk.mjs} +14 -14
- package/dist/{conditionalFormatting-ZjZ6wY0g.mjs → conditionalFormatting-Doxpmemq.mjs} +1 -1
- package/dist/{createGlobalFilter.module-B3nAWt-z.mjs → createGlobalFilter.module-D6HjUXWX.mjs} +1 -1
- package/dist/{crossPointer-1otwmut1.mjs → crossPointer-B3cgqnZo.mjs} +3 -3
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{metric.mutation-D6RtkleZ.mjs → metric.mutation-BmM7y6ro.mjs} +2 -2
- package/dist/{pluginV3Request-DDHTowqW.mjs → pluginV3Request-DSTXpnb2.mjs} +2 -2
- package/dist/{renderer-CYUeXAi5.mjs → renderer-DEJWO1tC.mjs} +1 -1
- package/dist/{timeseries-hkiBF4TC.mjs → timeseries-C3w9dXh4.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-CHzIT9Ex.mjs → useGuesTokenUsageLog-B4vI8cc-.mjs} +1 -1
- package/dist/{useLoadingDeadline-ZhTlljOz.mjs → useLoadingDeadline-AkEY8sVK.mjs} +13 -8
- package/dist/{usePublishArchivedMetrics-Cgh9agh-.mjs → usePublishArchivedMetrics-d7UD9S-D.mjs} +2 -2
- package/dist/{useQuery-CKH-_Ztf.mjs → useQuery-DsSv-fcD.mjs} +1 -1
- package/dist/webcomponents-styles.es.js +1 -1
- package/dist/webcomponents.es.js +2007 -1967
- package/dist/webcomponents.umd.js +191 -191
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import "react-dom";
|
|
3
3
|
import "react-dom/client";
|
|
4
|
-
import { p as t } from "./cardStates-
|
|
5
|
-
import { ht as n } from "./pluginV3Request-
|
|
6
|
-
import { Ga as r, H as i, Za as a, _ as o, br as s, nr as c, oo as l, vo as u, yr as d } from "./Portal-
|
|
7
|
-
import { C as f, S as p, T as m, c as h, f as g, m as _, p as v, w as y, x as ee, y as b } from "./crossPointer-
|
|
4
|
+
import { p as t } from "./cardStates-YaeHm3yq.mjs";
|
|
5
|
+
import { ht as n } from "./pluginV3Request-DSTXpnb2.mjs";
|
|
6
|
+
import { Ga as r, H as i, Za as a, _ as o, br as s, nr as c, oo as l, vo as u, yr as d } from "./Portal-CL-S1tXR.mjs";
|
|
7
|
+
import { C as f, S as p, T as m, c as h, f as g, m as _, p as v, w as y, x as ee, y as b } from "./crossPointer-B3cgqnZo.mjs";
|
|
8
8
|
import { n as te } from "./arrayToCsvString-CRmqd5Fp.mjs";
|
|
9
|
-
import { d as ne, r as x, t as re, u as ie } from "./useLoadingDeadline-
|
|
10
|
-
import {
|
|
11
|
-
import { A as oe, C as se, D as ce, E as le, O as ue, T as de, a as fe, c as pe, d as me, i as he, n as ge, o as _e, r as ve, s as ye, t as be, u as xe, w as Se } from "./clickActions-
|
|
9
|
+
import { d as ne, r as x, t as re, u as ie } from "./useLoadingDeadline-AkEY8sVK.mjs";
|
|
10
|
+
import { m as ae } from "./RadioButton-DZWBIci3.mjs";
|
|
11
|
+
import { A as oe, C as se, D as ce, E as le, O as ue, T as de, a as fe, c as pe, d as me, i as he, n as ge, o as _e, r as ve, s as ye, t as be, u as xe, w as Se } from "./clickActions-GtHmsSzk.mjs";
|
|
12
12
|
import { t as S } from "./createLucideIcon-B89xLYvS.mjs";
|
|
13
|
-
import { A as Ce, B as we, C as Te, D as
|
|
14
|
-
import { c as
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { n as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
var
|
|
13
|
+
import { A as Ce, B as we, C as Te, D as C, E as Ee, F as De, I as Oe, L as ke, M as Ae, N as je, O as Me, P as Ne, S as Pe, T as w, _ as T, a as Fe, b as Ie, c as Le, d as Re, f as ze, g as Be, h as Ve, i as He, j as Ue, k as We, m as Ge, n as Ke, o as qe, p as Je, s as Ye, t as Xe, u as Ze, v as Qe, x as $e, y as et } from "./CardChartSlot-B-Ngm7L2.mjs";
|
|
14
|
+
import { c as E, d as tt, f as D, g as nt, m as rt, o as it, p as at, s as ot, u as st } from "./qaSelectors-OdHjlXAo.mjs";
|
|
15
|
+
import { n as ct, t as lt } from "./x-aT15zz1n.mjs";
|
|
16
|
+
import { t as O } from "./dist-CfZineIA.mjs";
|
|
17
|
+
import { n as ut } from "./cardActions-KAyfWH7u.mjs";
|
|
18
|
+
import { Fragment as dt, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
19
|
+
var ft = S("archive", [
|
|
20
20
|
["rect", {
|
|
21
21
|
width: "20",
|
|
22
22
|
height: "5",
|
|
@@ -33,7 +33,7 @@ var pt = S("archive", [
|
|
|
33
33
|
d: "M10 12h4",
|
|
34
34
|
key: "a56b0p"
|
|
35
35
|
}]
|
|
36
|
-
]),
|
|
36
|
+
]), pt = S("copy", [["rect", {
|
|
37
37
|
width: "14",
|
|
38
38
|
height: "14",
|
|
39
39
|
x: "8",
|
|
@@ -44,19 +44,19 @@ var pt = S("archive", [
|
|
|
44
44
|
}], ["path", {
|
|
45
45
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
46
46
|
key: "zix9uf"
|
|
47
|
-
}]]),
|
|
47
|
+
}]]), mt = S("corner-down-right", [["path", {
|
|
48
48
|
d: "m15 10 5 5-5 5",
|
|
49
49
|
key: "qqa56n"
|
|
50
50
|
}], ["path", {
|
|
51
51
|
d: "M4 4v7a4 4 0 0 0 4 4h12",
|
|
52
52
|
key: "z08zvw"
|
|
53
|
-
}]]),
|
|
53
|
+
}]]), ht = S("corner-left-up", [["path", {
|
|
54
54
|
d: "M14 9 9 4 4 9",
|
|
55
55
|
key: "1af5af"
|
|
56
56
|
}], ["path", {
|
|
57
57
|
d: "M20 20h-7a4 4 0 0 1-4-4V4",
|
|
58
58
|
key: "1blwi3"
|
|
59
|
-
}]]),
|
|
59
|
+
}]]), gt = S("ellipsis-vertical", [
|
|
60
60
|
["circle", {
|
|
61
61
|
cx: "12",
|
|
62
62
|
cy: "12",
|
|
@@ -75,7 +75,7 @@ var pt = S("archive", [
|
|
|
75
75
|
r: "1",
|
|
76
76
|
key: "lyex9k"
|
|
77
77
|
}]
|
|
78
|
-
]),
|
|
78
|
+
]), _t = S("git-merge", [
|
|
79
79
|
["circle", {
|
|
80
80
|
cx: "18",
|
|
81
81
|
cy: "18",
|
|
@@ -92,7 +92,7 @@ var pt = S("archive", [
|
|
|
92
92
|
d: "M6 21V9a9 9 0 0 0 9 9",
|
|
93
93
|
key: "7kw0sc"
|
|
94
94
|
}]
|
|
95
|
-
]),
|
|
95
|
+
]), vt = S("image", [
|
|
96
96
|
["rect", {
|
|
97
97
|
width: "18",
|
|
98
98
|
height: "18",
|
|
@@ -112,7 +112,7 @@ var pt = S("archive", [
|
|
|
112
112
|
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
113
113
|
key: "1xmnt7"
|
|
114
114
|
}]
|
|
115
|
-
]),
|
|
115
|
+
]), yt = S("mail", [["path", {
|
|
116
116
|
d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",
|
|
117
117
|
key: "132q7q"
|
|
118
118
|
}], ["rect", {
|
|
@@ -122,7 +122,7 @@ var pt = S("archive", [
|
|
|
122
122
|
height: "16",
|
|
123
123
|
rx: "2",
|
|
124
124
|
key: "izxlao"
|
|
125
|
-
}]]),
|
|
125
|
+
}]]), bt = S("settings", [["path", {
|
|
126
126
|
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",
|
|
127
127
|
key: "1i5ecw"
|
|
128
128
|
}], ["circle", {
|
|
@@ -130,7 +130,7 @@ var pt = S("archive", [
|
|
|
130
130
|
cy: "12",
|
|
131
131
|
r: "3",
|
|
132
132
|
key: "1v7zrd"
|
|
133
|
-
}]]),
|
|
133
|
+
}]]), xt = S("trash-2", [
|
|
134
134
|
["path", {
|
|
135
135
|
d: "M10 11v6",
|
|
136
136
|
key: "nco0om"
|
|
@@ -151,12 +151,12 @@ var pt = S("archive", [
|
|
|
151
151
|
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
152
152
|
key: "e791ji"
|
|
153
153
|
}]
|
|
154
|
-
]),
|
|
154
|
+
]), St = (e) => e === "contextmenu" ? "secondary" : "primary", Ct = ({ route: e, canCrossFilter: t }) => !!t && e === "drill", wt = ({ gesture: e, route: t, canCrossFilter: n, canDrillInto: r, hasPointMenu: i }) => {
|
|
155
155
|
if (t === "terminal") return {
|
|
156
156
|
drillDown: !1,
|
|
157
157
|
adhocMenu: !1
|
|
158
158
|
};
|
|
159
|
-
let a =
|
|
159
|
+
let a = Ct({
|
|
160
160
|
route: t,
|
|
161
161
|
canCrossFilter: n
|
|
162
162
|
}), o = !!r;
|
|
@@ -169,7 +169,7 @@ var pt = S("archive", [
|
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
171
|
h.map((e) => e.value), Object.fromEntries(h.map((e) => [e.value, e.label]));
|
|
172
|
-
var
|
|
172
|
+
var Tt = (e) => {
|
|
173
173
|
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;
|
|
174
174
|
return {
|
|
175
175
|
activeIndex: n,
|
|
@@ -178,8 +178,8 @@ var Et = (e) => {
|
|
|
178
178
|
usedAliases: _(a?.dimensions),
|
|
179
179
|
activeLevel: a
|
|
180
180
|
};
|
|
181
|
-
},
|
|
182
|
-
let t =
|
|
181
|
+
}, Et = (e) => {
|
|
182
|
+
let t = Tt(e.config), n = t.activeLevel ? t.usedAliases : Dt(e.chartSettings), r = g({
|
|
183
183
|
subset: e.subset,
|
|
184
184
|
configuration: e.configuration,
|
|
185
185
|
usedAliases: n,
|
|
@@ -194,10 +194,10 @@ var Et = (e) => {
|
|
|
194
194
|
selectedDims: e.selectedDims,
|
|
195
195
|
usedAliases: n
|
|
196
196
|
});
|
|
197
|
-
},
|
|
197
|
+
}, Dt = (e) => {
|
|
198
198
|
let t = e, n = t?.seriesField && t.seriesField !== "ungrouped" ? t.seriesField : void 0;
|
|
199
199
|
return [t?.xAxis, n].filter((e) => !!e);
|
|
200
|
-
},
|
|
200
|
+
}, Ot = "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)", kt = 4, At = () => {
|
|
201
201
|
let t = e.useRef(null);
|
|
202
202
|
return {
|
|
203
203
|
navRef: t,
|
|
@@ -215,10 +215,10 @@ var Et = (e) => {
|
|
|
215
215
|
a = Math.min(Math.max(a, 0), r.length - 1), a !== i && (e.preventDefault(), r[a]?.focus());
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
},
|
|
219
|
-
let o = `${e.useId()}-drill-up-reason`, { navRef: s, onKeyDown: c } =
|
|
218
|
+
}, jt = ({ crumbs: t, onDrillLevelClick: n, onResetDrill: r, onUp: i, className: a }) => {
|
|
219
|
+
let o = `${e.useId()}-drill-up-reason`, { navRef: s, onKeyDown: c } = At(), l = t.length, [u, d] = e.useState(null), f = u === l;
|
|
220
220
|
if (!t.length) return null;
|
|
221
|
-
let p = !f && t.length >
|
|
221
|
+
let p = !f && t.length > kt, m = p ? t.length - 3 : 0, h = p ? [
|
|
222
222
|
{
|
|
223
223
|
kind: "crumb",
|
|
224
224
|
crumb: t[0],
|
|
@@ -235,16 +235,16 @@ var Et = (e) => {
|
|
|
235
235
|
crumb: e,
|
|
236
236
|
position: t
|
|
237
237
|
})), g = (t.length > 1 ? t[t.length - 2] : void 0)?.index, _ = !g, v = "Unavailable: this is the first level of the drill. Use All to clear the drill.";
|
|
238
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ A("nav", {
|
|
239
239
|
ref: s,
|
|
240
240
|
"aria-label": "Drill-down breadcrumb",
|
|
241
241
|
"data-testid": "metric-card-drill-crumbs",
|
|
242
242
|
onKeyDown: i ? c : void 0,
|
|
243
|
-
className:
|
|
244
|
-
children: [/* @__PURE__ */
|
|
243
|
+
className: O("flex min-w-0 flex-wrap items-center gap-1 pb-1.5 text-xs", a),
|
|
244
|
+
children: [/* @__PURE__ */ A("div", {
|
|
245
245
|
className: "sticky left-0 z-10 flex shrink-0 items-center gap-1 bg-(--card) pr-1",
|
|
246
|
-
children: [i ? /* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
246
|
+
children: [i ? /* @__PURE__ */ A(dt, { children: [
|
|
247
|
+
/* @__PURE__ */ A("button", {
|
|
248
248
|
type: "button",
|
|
249
249
|
"aria-disabled": _ || void 0,
|
|
250
250
|
"aria-describedby": _ ? o : void 0,
|
|
@@ -253,223 +253,223 @@ var Et = (e) => {
|
|
|
253
253
|
g && i(g);
|
|
254
254
|
},
|
|
255
255
|
"data-testid": "metric-card-drill-crumb-up",
|
|
256
|
-
className:
|
|
256
|
+
className: O(Ot, "inline-flex max-w-none items-center gap-1", _ && "cursor-not-allowed opacity-60 hover:text-(--muted-foreground) hover:no-underline"),
|
|
257
257
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ k(ht, {
|
|
259
259
|
className: "size-3",
|
|
260
260
|
"aria-hidden": "true"
|
|
261
261
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ k("span", { children: "Up" }),
|
|
263
|
+
/* @__PURE__ */ k("span", {
|
|
264
264
|
className: "sr-only",
|
|
265
265
|
children: " one level"
|
|
266
266
|
})
|
|
267
267
|
]
|
|
268
268
|
}),
|
|
269
|
-
_ ? /* @__PURE__ */
|
|
269
|
+
_ ? /* @__PURE__ */ k("span", {
|
|
270
270
|
id: o,
|
|
271
271
|
"data-testid": "metric-card-drill-crumb-up-reason",
|
|
272
272
|
className: "sr-only",
|
|
273
273
|
children: v
|
|
274
274
|
}) : null,
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ k("span", {
|
|
276
276
|
"aria-hidden": "true",
|
|
277
277
|
className: "mx-0.5 h-3 w-px shrink-0 bg-(--border)"
|
|
278
278
|
})
|
|
279
|
-
] }) : null, /* @__PURE__ */
|
|
279
|
+
] }) : null, /* @__PURE__ */ k("button", {
|
|
280
280
|
type: "button",
|
|
281
281
|
onClick: r,
|
|
282
282
|
"data-testid": "metric-card-drill-crumb-reset",
|
|
283
|
-
className:
|
|
283
|
+
className: Ot,
|
|
284
284
|
children: "All"
|
|
285
285
|
})]
|
|
286
286
|
}), h.map((r, i) => {
|
|
287
|
-
if (r.kind === "ellipsis") return /* @__PURE__ */
|
|
287
|
+
if (r.kind === "ellipsis") return /* @__PURE__ */ A(e.Fragment, { children: [/* @__PURE__ */ k("span", {
|
|
288
288
|
"aria-hidden": "true",
|
|
289
289
|
className: "shrink-0 text-(--muted-foreground)",
|
|
290
290
|
children: "/"
|
|
291
|
-
}), /* @__PURE__ */
|
|
291
|
+
}), /* @__PURE__ */ k("button", {
|
|
292
292
|
type: "button",
|
|
293
293
|
onClick: () => d(l),
|
|
294
294
|
"data-testid": "metric-card-drill-crumb-expand",
|
|
295
295
|
"aria-label": `Show ${m} hidden levels`,
|
|
296
296
|
title: `Show ${m} hidden levels`,
|
|
297
|
-
className:
|
|
297
|
+
className: O(Ot, "max-w-none"),
|
|
298
298
|
children: "..."
|
|
299
299
|
})] }, "ellipsis");
|
|
300
300
|
let { crumb: a, position: o } = r, s = o === t.length - 1, c = a.value !== void 0 && a.value !== null && a.value !== "" ? `${a.label}: ${String(a.value)}` : a.label;
|
|
301
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ A(e.Fragment, { children: [/* @__PURE__ */ k("span", {
|
|
302
302
|
"aria-hidden": "true",
|
|
303
303
|
className: "shrink-0 text-(--muted-foreground)",
|
|
304
304
|
children: "/"
|
|
305
|
-
}), s ? /* @__PURE__ */
|
|
305
|
+
}), s ? /* @__PURE__ */ k("span", {
|
|
306
306
|
"aria-current": "step",
|
|
307
307
|
title: c,
|
|
308
308
|
"data-testid": "metric-card-drill-crumb-current",
|
|
309
309
|
className: "min-w-0 max-w-full whitespace-normal break-words font-medium text-(--foreground)",
|
|
310
310
|
children: c
|
|
311
|
-
}) : /* @__PURE__ */
|
|
311
|
+
}) : /* @__PURE__ */ k("button", {
|
|
312
312
|
type: "button",
|
|
313
313
|
title: c,
|
|
314
314
|
onClick: () => n(a.index),
|
|
315
315
|
"data-testid": `metric-card-drill-crumb-${a.index}`,
|
|
316
|
-
className:
|
|
317
|
-
children: /* @__PURE__ */
|
|
316
|
+
className: Ot,
|
|
317
|
+
children: /* @__PURE__ */ k("span", {
|
|
318
318
|
className: "max-w-48 truncate",
|
|
319
319
|
children: c
|
|
320
320
|
})
|
|
321
321
|
})] }, a.index || `${a.label}-${o}-${i}`);
|
|
322
322
|
})]
|
|
323
323
|
});
|
|
324
|
-
},
|
|
324
|
+
}, Mt = ({ longDescription: e, meta: t, className: n }) => !e && !t ? null : /* @__PURE__ */ A("div", {
|
|
325
325
|
"data-testid": "metric-card-footer",
|
|
326
|
-
className:
|
|
327
|
-
children: [t ? /* @__PURE__ */
|
|
326
|
+
className: O("flex flex-col gap-1 text-xs text-(--muted-foreground)", n),
|
|
327
|
+
children: [t ? /* @__PURE__ */ k("div", {
|
|
328
328
|
"data-testid": "metric-card-footer-meta",
|
|
329
329
|
children: t
|
|
330
|
-
}) : null, e ? /* @__PURE__ */
|
|
330
|
+
}) : null, e ? /* @__PURE__ */ k("div", {
|
|
331
331
|
"data-testid": "metric-card-long-description",
|
|
332
332
|
className: "text-(--muted-foreground)",
|
|
333
333
|
dangerouslySetInnerHTML: { __html: i(e) }
|
|
334
334
|
}) : null]
|
|
335
|
-
}),
|
|
335
|
+
}), Nt = ({ title: e, description: t, isDisableCardTitle: n, infoContent: r, actions: i, onTitleClick: a, className: o }) => {
|
|
336
336
|
let s = !n && (e != null || t != null);
|
|
337
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ A("div", {
|
|
338
338
|
"data-slot": "metric-card-header",
|
|
339
|
-
className:
|
|
340
|
-
children: [/* @__PURE__ */
|
|
339
|
+
className: O("flex w-full items-start gap-2", o),
|
|
340
|
+
children: [/* @__PURE__ */ k("div", {
|
|
341
341
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
342
|
-
children: s ? /* @__PURE__ */
|
|
342
|
+
children: s ? /* @__PURE__ */ A(dt, { children: [e == null ? null : /* @__PURE__ */ A("div", {
|
|
343
343
|
className: "flex min-w-0 items-center gap-1",
|
|
344
|
-
children: [a ? /* @__PURE__ */
|
|
344
|
+
children: [a ? /* @__PURE__ */ k("h2", {
|
|
345
345
|
className: "min-w-0 truncate text-sm font-semibold",
|
|
346
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ k("button", {
|
|
347
347
|
type: "button",
|
|
348
348
|
"data-testid": "metric-card-title",
|
|
349
349
|
onClick: a,
|
|
350
350
|
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)",
|
|
351
351
|
children: e
|
|
352
352
|
})
|
|
353
|
-
}) : /* @__PURE__ */
|
|
353
|
+
}) : /* @__PURE__ */ k("h2", {
|
|
354
354
|
"data-testid": "metric-card-title",
|
|
355
355
|
className: "truncate text-sm font-semibold text-(--foreground)",
|
|
356
356
|
children: e
|
|
357
|
-
}), r == null ? null : /* @__PURE__ */
|
|
357
|
+
}), r == null ? null : /* @__PURE__ */ k(ze, { children: /* @__PURE__ */ A(Ze, { children: [/* @__PURE__ */ k(Je, {
|
|
358
358
|
asChild: !0,
|
|
359
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ k(E, {
|
|
360
360
|
type: "button",
|
|
361
361
|
variant: "ghost",
|
|
362
362
|
size: "icon-sm",
|
|
363
363
|
"data-testid": "metric-card-info-trigger",
|
|
364
364
|
"aria-label": "More information",
|
|
365
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ k(Oe, {
|
|
366
366
|
className: "size-3.5",
|
|
367
367
|
"aria-hidden": "true"
|
|
368
368
|
})
|
|
369
369
|
})
|
|
370
|
-
}), /* @__PURE__ */
|
|
370
|
+
}), /* @__PURE__ */ k(Re, {
|
|
371
371
|
"data-testid": "metric-card-info-content",
|
|
372
372
|
children: r
|
|
373
373
|
})] }) })]
|
|
374
|
-
}), t == null ? null : /* @__PURE__ */
|
|
374
|
+
}), t == null ? null : /* @__PURE__ */ k("span", {
|
|
375
375
|
"data-testid": "metric-card-description",
|
|
376
376
|
className: "truncate text-sm text-(--muted-foreground)",
|
|
377
377
|
children: t
|
|
378
378
|
})] }) : null
|
|
379
|
-
}), i == null ? null : /* @__PURE__ */
|
|
379
|
+
}), i == null ? null : /* @__PURE__ */ k("div", {
|
|
380
380
|
"data-testid": "metric-card-actions",
|
|
381
381
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
382
382
|
children: i
|
|
383
383
|
})]
|
|
384
384
|
});
|
|
385
|
-
},
|
|
385
|
+
}, Pt = ({ flags: e = {}, onDownloadCsv: t, onDownloadPng: n, onEmailCsv: r, onFullscreen: i, onUnderlyingData: a, onSettings: o, onArchive: s, onDelete: c, splitBySubmenu: l, optionsIcon: u, settingsIcon: d, defaultOpen: f, className: p }) => {
|
|
386
386
|
let { enableDownloadCsv: m, enableEmailCsv: h, disableDownloadPng: g, disableDownloadDataNoFilters: _ = !1, disableUnderlyingData: v, disableDownloadUnderlyingDataNoFilters: y = !1, disableFullscreen: ee } = e, b = !!m && !!t, te = !g && !!n, ne = !!h && !!r, x = b || te || ne, re = !ee && !!i, ie = !v && !!a, ae = re || ie, oe = !!o, se = !!l, ce = !!s, le = !!c, ue = ce || le;
|
|
387
|
-
return !x && !ae && !oe && !se && !ue ? null : /* @__PURE__ */
|
|
387
|
+
return !x && !ae && !oe && !se && !ue ? null : /* @__PURE__ */ A(Pe, {
|
|
388
388
|
defaultOpen: f,
|
|
389
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ k(Ue, {
|
|
390
390
|
asChild: !0,
|
|
391
|
-
children: /* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ k(E, {
|
|
392
392
|
type: "button",
|
|
393
393
|
variant: "ghost",
|
|
394
394
|
size: "icon-sm",
|
|
395
|
-
className:
|
|
395
|
+
className: O("size-8", p),
|
|
396
396
|
"aria-label": "Card options",
|
|
397
397
|
"data-testid": "metric-card-options-trigger",
|
|
398
|
-
children: u ?? /* @__PURE__ */
|
|
398
|
+
children: u ?? /* @__PURE__ */ k(gt, {})
|
|
399
399
|
})
|
|
400
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ A(Te, {
|
|
401
401
|
align: "end",
|
|
402
402
|
children: [
|
|
403
403
|
se && l,
|
|
404
|
-
se && (x || ae || oe || ue) && /* @__PURE__ */
|
|
405
|
-
b && /* @__PURE__ */
|
|
404
|
+
se && (x || ae || oe || ue) && /* @__PURE__ */ k(C, {}),
|
|
405
|
+
b && /* @__PURE__ */ A(w, {
|
|
406
406
|
className: "min-h-8",
|
|
407
407
|
"data-testid": "metric-card-option-download-csv",
|
|
408
408
|
onSelect: () => t?.({ withoutFilters: !1 }),
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ k(ke, {}), "Download CSV"]
|
|
410
410
|
}),
|
|
411
|
-
b && !_ && /* @__PURE__ */
|
|
411
|
+
b && !_ && /* @__PURE__ */ A(w, {
|
|
412
412
|
className: "min-h-8",
|
|
413
413
|
"data-testid": "metric-card-option-download-csv-nofilter",
|
|
414
414
|
onSelect: () => t?.({ withoutFilters: !0 }),
|
|
415
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ k(ke, {}), "Download CSV without filters"]
|
|
416
416
|
}),
|
|
417
|
-
te && /* @__PURE__ */
|
|
417
|
+
te && /* @__PURE__ */ A(w, {
|
|
418
418
|
className: "min-h-8",
|
|
419
419
|
"data-testid": "metric-card-option-download-png",
|
|
420
420
|
onSelect: () => n?.(),
|
|
421
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ k(vt, {}), "Download PNG"]
|
|
422
422
|
}),
|
|
423
|
-
ne && /* @__PURE__ */
|
|
423
|
+
ne && /* @__PURE__ */ A(w, {
|
|
424
424
|
className: "min-h-8",
|
|
425
425
|
"data-testid": "metric-card-option-email-csv",
|
|
426
426
|
onSelect: () => r?.(),
|
|
427
|
-
children: [/* @__PURE__ */
|
|
427
|
+
children: [/* @__PURE__ */ k(yt, {}), "Email CSV"]
|
|
428
428
|
}),
|
|
429
|
-
x && ae && /* @__PURE__ */
|
|
430
|
-
re && /* @__PURE__ */
|
|
429
|
+
x && ae && /* @__PURE__ */ k(C, {}),
|
|
430
|
+
re && /* @__PURE__ */ A(w, {
|
|
431
431
|
className: "min-h-8",
|
|
432
432
|
"data-testid": "metric-card-option-fullscreen",
|
|
433
433
|
onSelect: () => i?.(),
|
|
434
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ k(De, {}), "Fullscreen"]
|
|
435
435
|
}),
|
|
436
|
-
ie && /* @__PURE__ */
|
|
436
|
+
ie && /* @__PURE__ */ A(w, {
|
|
437
437
|
className: "min-h-8",
|
|
438
438
|
"data-testid": "metric-card-option-underlying-data",
|
|
439
439
|
onSelect: () => a?.({ withoutFilters: !1 }),
|
|
440
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ k(nt, {}), "Underlying data"]
|
|
441
441
|
}),
|
|
442
|
-
ie && !y && /* @__PURE__ */
|
|
442
|
+
ie && !y && /* @__PURE__ */ A(w, {
|
|
443
443
|
className: "min-h-8",
|
|
444
444
|
"data-testid": "metric-card-option-underlying-data-nofilter",
|
|
445
445
|
onSelect: () => a?.({ withoutFilters: !0 }),
|
|
446
|
-
children: [/* @__PURE__ */
|
|
446
|
+
children: [/* @__PURE__ */ k(nt, {}), "Underlying data without filters"]
|
|
447
447
|
}),
|
|
448
|
-
(x || ae) && oe && /* @__PURE__ */
|
|
449
|
-
oe && /* @__PURE__ */
|
|
448
|
+
(x || ae) && oe && /* @__PURE__ */ k(C, {}),
|
|
449
|
+
oe && /* @__PURE__ */ A(w, {
|
|
450
450
|
className: "min-h-8",
|
|
451
451
|
"data-testid": "metric-card-option-settings",
|
|
452
452
|
onSelect: () => o?.(),
|
|
453
|
-
children: [d ?? /* @__PURE__ */
|
|
453
|
+
children: [d ?? /* @__PURE__ */ k(bt, {}), "Edit metric"]
|
|
454
454
|
}),
|
|
455
|
-
(x || ae || oe) && ue && /* @__PURE__ */
|
|
456
|
-
ce && /* @__PURE__ */
|
|
455
|
+
(x || ae || oe) && ue && /* @__PURE__ */ k(C, {}),
|
|
456
|
+
ce && /* @__PURE__ */ A(w, {
|
|
457
457
|
className: "min-h-8",
|
|
458
458
|
"data-testid": "metric-card-option-archive",
|
|
459
459
|
onSelect: () => s?.(),
|
|
460
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ k(ft, {}), "Archive"]
|
|
461
461
|
}),
|
|
462
|
-
le && /* @__PURE__ */
|
|
462
|
+
le && /* @__PURE__ */ A(w, {
|
|
463
463
|
className: "min-h-8",
|
|
464
464
|
"data-testid": "metric-card-option-delete",
|
|
465
465
|
onSelect: () => c?.(),
|
|
466
466
|
variant: "destructive",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ k(xt, {}), "Delete"]
|
|
468
468
|
})
|
|
469
469
|
]
|
|
470
470
|
})]
|
|
471
471
|
});
|
|
472
|
-
},
|
|
472
|
+
}, Ft = e.lazy(() => import("./DatePickerCalendar-BLvQnZy2.mjs")), j = [
|
|
473
473
|
{
|
|
474
474
|
type: "day",
|
|
475
475
|
label: "Today",
|
|
@@ -536,83 +536,83 @@ var Et = (e) => {
|
|
|
536
536
|
startOffset: 0,
|
|
537
537
|
endOffset: 0
|
|
538
538
|
}
|
|
539
|
-
],
|
|
539
|
+
], It = ({ type: e, label: t, startOffset: n, endOffset: r }) => {
|
|
540
540
|
let i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date(), o = /* @__PURE__ */ new Date();
|
|
541
541
|
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)), {
|
|
542
542
|
start: a,
|
|
543
543
|
end: o
|
|
544
544
|
};
|
|
545
|
-
},
|
|
545
|
+
}, Lt = (e) => e ? `${e.getFullYear()}-${`0${e.getMonth() + 1}`.slice(-2)}-${`0${e.getDate()}`.slice(-2)}` : "", Rt = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), zt = (e, t, n) => {
|
|
546
546
|
if (!e || !t) return null;
|
|
547
|
-
let r =
|
|
547
|
+
let r = Lt(e), i = Lt(t);
|
|
548
548
|
return {
|
|
549
549
|
value: `${r} - ${i}`,
|
|
550
|
-
startDate:
|
|
551
|
-
endDate:
|
|
550
|
+
startDate: Rt(e),
|
|
551
|
+
endDate: Rt(t),
|
|
552
552
|
timeGrainValue: n || `${r} - ${i}`
|
|
553
553
|
};
|
|
554
|
-
},
|
|
554
|
+
}, Bt = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), Vt = new Intl.DateTimeFormat("en-US", {
|
|
555
555
|
year: "numeric",
|
|
556
556
|
month: "short",
|
|
557
557
|
day: "numeric"
|
|
558
|
-
}),
|
|
559
|
-
let [f, p] = e.useState(t?.startDate ?? r?.startDate), [m, h] = e.useState(t?.endDate ?? r?.endDate), [g, _] = e.useState(r?.timeGrainValue ?? ""), v = e.useMemo(() => new Set((s ?? []).map((e) => e.toLowerCase())), [s]), y = e.useMemo(() =>
|
|
558
|
+
}), Ht = (e) => Vt.format(e), Ut = (e) => j.some((t) => t.label === e), Wt = (e, t, n) => !e || !t ? "Select date range" : n && Ut(n) ? n : `${Ht(e)} - ${Ht(t)}`, Gt = ({ value: t, onChange: n, defaultOption: r, minDate: i, maxDate: a, hideDatePickerOptions: s, calendarType: c = "default", hidden: l, defaultOpen: u, className: d }) => {
|
|
559
|
+
let [f, p] = e.useState(t?.startDate ?? r?.startDate), [m, h] = e.useState(t?.endDate ?? r?.endDate), [g, _] = e.useState(r?.timeGrainValue ?? ""), v = e.useMemo(() => new Set((s ?? []).map((e) => e.toLowerCase())), [s]), y = e.useMemo(() => j.filter((e) => !v.has(e.label.toLowerCase())), [v]);
|
|
560
560
|
if (l) return null;
|
|
561
561
|
let ee = c === "ind", b = (e, t, r) => {
|
|
562
|
-
let i =
|
|
562
|
+
let i = zt(e, t, r);
|
|
563
563
|
i && n(i);
|
|
564
564
|
}, te = (e) => {
|
|
565
|
-
let { start: t, end: n } =
|
|
565
|
+
let { start: t, end: n } = It(e);
|
|
566
566
|
p(t), h(n), _(e.label), b(t, n, e.label);
|
|
567
567
|
}, ne = (e) => {
|
|
568
568
|
let [t, n] = e;
|
|
569
569
|
if (p(t ?? void 0), h(n ?? void 0), t && n) {
|
|
570
|
-
let e = `${
|
|
570
|
+
let e = `${Lt(t)} - ${Lt(n)}`;
|
|
571
571
|
_(e), b(t, n, e);
|
|
572
572
|
}
|
|
573
|
-
}, x =
|
|
574
|
-
return /* @__PURE__ */
|
|
573
|
+
}, x = Wt(f, m, g);
|
|
574
|
+
return /* @__PURE__ */ A(et, {
|
|
575
575
|
defaultOpen: u,
|
|
576
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ k($e, {
|
|
577
577
|
asChild: !0,
|
|
578
|
-
children: /* @__PURE__ */
|
|
578
|
+
children: /* @__PURE__ */ A(E, {
|
|
579
579
|
type: "button",
|
|
580
580
|
variant: "outline",
|
|
581
581
|
size: "sm",
|
|
582
|
-
className:
|
|
582
|
+
className: O(d),
|
|
583
583
|
"aria-label": f && m ? `Select date range, currently ${x}` : "Select date range",
|
|
584
584
|
"data-testid": "date-picker-control-trigger",
|
|
585
|
-
children: [/* @__PURE__ */
|
|
585
|
+
children: [/* @__PURE__ */ k(o, {}), x]
|
|
586
586
|
})
|
|
587
|
-
}), /* @__PURE__ */
|
|
587
|
+
}), /* @__PURE__ */ A(Ie, {
|
|
588
588
|
align: "end",
|
|
589
589
|
padding: "form",
|
|
590
|
-
className:
|
|
590
|
+
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"),
|
|
591
591
|
"data-testid": "date-picker-control-content",
|
|
592
592
|
"data-fiscal": ee,
|
|
593
|
-
children: [/* @__PURE__ */
|
|
593
|
+
children: [/* @__PURE__ */ k("div", {
|
|
594
594
|
className: "flex w-36 shrink-0 flex-col gap-0.5 border-r border-(--border) pr-3",
|
|
595
595
|
"data-testid": "date-picker-control-presets",
|
|
596
596
|
"aria-label": "Date range presets",
|
|
597
597
|
children: y.map((e) => {
|
|
598
598
|
let t = e.label === g;
|
|
599
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ k(E, {
|
|
600
600
|
type: "button",
|
|
601
601
|
variant: t ? "primary" : "ghost",
|
|
602
602
|
size: "sm",
|
|
603
603
|
className: "justify-start",
|
|
604
604
|
"aria-pressed": t,
|
|
605
|
-
"data-testid": `date-picker-preset-${
|
|
605
|
+
"data-testid": `date-picker-preset-${Bt(e.label)}`,
|
|
606
606
|
onClick: () => te(e),
|
|
607
607
|
children: e.label
|
|
608
608
|
}, e.label);
|
|
609
609
|
})
|
|
610
|
-
}), /* @__PURE__ */
|
|
611
|
-
fallback: /* @__PURE__ */
|
|
610
|
+
}), /* @__PURE__ */ k(e.Suspense, {
|
|
611
|
+
fallback: /* @__PURE__ */ k("div", {
|
|
612
612
|
className: "h-64 w-xl",
|
|
613
613
|
"aria-hidden": "true"
|
|
614
614
|
}),
|
|
615
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ k(Ft, {
|
|
616
616
|
startDate: f,
|
|
617
617
|
endDate: m,
|
|
618
618
|
onChange: ne,
|
|
@@ -622,7 +622,7 @@ var Et = (e) => {
|
|
|
622
622
|
})]
|
|
623
623
|
})]
|
|
624
624
|
});
|
|
625
|
-
},
|
|
625
|
+
}, M = 12, N = (e) => e.groups.reduce((e, t) => e + t.options.length, 0), Kt = (e) => {
|
|
626
626
|
switch (e.unavailableReason) {
|
|
627
627
|
case "all-dimensions-used": return "This chart already uses every field you can split by.";
|
|
628
628
|
case "max-depth-reached": return "Go back a step to split by something else.";
|
|
@@ -630,31 +630,31 @@ var Et = (e) => {
|
|
|
630
630
|
case "drill-off": return "Drill down is off for this chart, so it cannot be split by another field.";
|
|
631
631
|
default: return "No other fields to split by.";
|
|
632
632
|
}
|
|
633
|
-
},
|
|
634
|
-
let [a, o] = e.useState(""), s =
|
|
633
|
+
}, qt = ({ pool: t, onDrillInto: n, testIdPrefix: r = "metric-card-drill", gestureHint: i }) => {
|
|
634
|
+
let [a, o] = e.useState(""), s = N(t) > M, c = e.useMemo(() => {
|
|
635
635
|
let e = a.trim().toLowerCase();
|
|
636
636
|
return e ? t.groups.map((t) => ({
|
|
637
637
|
...t,
|
|
638
638
|
options: t.options.filter((t) => t.label.toLowerCase().includes(e))
|
|
639
639
|
})).filter((e) => e.options.length > 0) : t.groups;
|
|
640
640
|
}, [t.groups, a]);
|
|
641
|
-
return /* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ A(Me, { children: [/* @__PURE__ */ A(Ce, {
|
|
642
642
|
"data-testid": `${r}-trigger`,
|
|
643
643
|
children: [
|
|
644
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ k(mt, {}),
|
|
645
645
|
"Split by",
|
|
646
|
-
i ? /* @__PURE__ */
|
|
646
|
+
i ? /* @__PURE__ */ k("span", {
|
|
647
647
|
"data-testid": `${r}-gesture-hint`,
|
|
648
648
|
className: "ml-auto shrink-0 pl-4 text-caption text-(--muted-foreground)",
|
|
649
649
|
children: i
|
|
650
650
|
}) : null
|
|
651
651
|
]
|
|
652
|
-
}), /* @__PURE__ */
|
|
653
|
-
className:
|
|
652
|
+
}), /* @__PURE__ */ A(We, {
|
|
653
|
+
className: O("min-w-50 max-w-72", Ne),
|
|
654
654
|
"data-testid": `${r}-submenu`,
|
|
655
|
-
children: [s ? /* @__PURE__ */
|
|
655
|
+
children: [s ? /* @__PURE__ */ k("div", {
|
|
656
656
|
className: "p-1",
|
|
657
|
-
children: /* @__PURE__ */
|
|
657
|
+
children: /* @__PURE__ */ k("input", {
|
|
658
658
|
ref: (e) => {
|
|
659
659
|
e?.focus();
|
|
660
660
|
},
|
|
@@ -666,37 +666,37 @@ var Et = (e) => {
|
|
|
666
666
|
"data-testid": `${r}-search`,
|
|
667
667
|
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"
|
|
668
668
|
})
|
|
669
|
-
}) : null, c.length === 0 ? /* @__PURE__ */
|
|
670
|
-
className:
|
|
669
|
+
}) : null, c.length === 0 ? /* @__PURE__ */ k("div", {
|
|
670
|
+
className: Ae,
|
|
671
671
|
"data-testid": `${r}-empty`,
|
|
672
672
|
"data-reason": a.trim() ? "no-search-match" : t.unavailableReason ?? "none",
|
|
673
|
-
children: a.trim() ? `No field matches "${a.trim()}".` :
|
|
674
|
-
}) : c.map((t) => /* @__PURE__ */
|
|
673
|
+
children: a.trim() ? `No field matches "${a.trim()}".` : Kt(t)
|
|
674
|
+
}) : c.map((t) => /* @__PURE__ */ A(e.Fragment, { children: [t.label ? /* @__PURE__ */ A(Ee, {
|
|
675
675
|
className: "flex items-center gap-1.5",
|
|
676
676
|
"data-testid": `${r}-group-${t.tableName}`,
|
|
677
677
|
children: [
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ k(nt, { className: "size-3 text-(--muted-foreground)" }),
|
|
679
|
+
/* @__PURE__ */ k("span", {
|
|
680
680
|
className: "truncate",
|
|
681
681
|
children: t.label
|
|
682
682
|
}),
|
|
683
|
-
t.isBaseTable ? null : /* @__PURE__ */
|
|
683
|
+
t.isBaseTable ? null : /* @__PURE__ */ k("span", {
|
|
684
684
|
className: "ml-auto shrink-0 text-(--muted-foreground)",
|
|
685
685
|
children: "joined"
|
|
686
686
|
})
|
|
687
687
|
]
|
|
688
|
-
}) : null, t.options.map((e) => e.isDate ? /* @__PURE__ */
|
|
688
|
+
}) : null, t.options.map((e) => e.isDate ? /* @__PURE__ */ A(Me, { children: [/* @__PURE__ */ A(Ce, {
|
|
689
689
|
"data-testid": `${r}-option-${e.key}`,
|
|
690
|
-
children: [/* @__PURE__ */
|
|
690
|
+
children: [/* @__PURE__ */ k("span", {
|
|
691
691
|
className: "truncate",
|
|
692
692
|
children: e.label
|
|
693
|
-
}), /* @__PURE__ */
|
|
693
|
+
}), /* @__PURE__ */ A("span", {
|
|
694
694
|
className: "ml-auto shrink-0 pr-1 text-caption text-(--muted-foreground)",
|
|
695
695
|
children: ["by ", e.column?.timeGrain ?? "month"]
|
|
696
696
|
})]
|
|
697
|
-
}), /* @__PURE__ */
|
|
697
|
+
}), /* @__PURE__ */ k(We, {
|
|
698
698
|
"data-testid": `${r}-grains-${e.key}`,
|
|
699
|
-
children: h.map((t) => /* @__PURE__ */
|
|
699
|
+
children: h.map((t) => /* @__PURE__ */ k(w, {
|
|
700
700
|
onSelect: () => n({
|
|
701
701
|
...e,
|
|
702
702
|
column: b(e.column, t.value)
|
|
@@ -704,55 +704,55 @@ var Et = (e) => {
|
|
|
704
704
|
"data-testid": `${r}-grain-${e.key}-${t.value}`,
|
|
705
705
|
children: t.label
|
|
706
706
|
}, t.value))
|
|
707
|
-
})] }, e.key) : /* @__PURE__ */
|
|
707
|
+
})] }, e.key) : /* @__PURE__ */ A(w, {
|
|
708
708
|
onSelect: () => n(e),
|
|
709
709
|
"data-testid": `${r}-option-${e.key}`,
|
|
710
|
-
children: [/* @__PURE__ */
|
|
710
|
+
children: [/* @__PURE__ */ k("span", {
|
|
711
711
|
className: "truncate",
|
|
712
712
|
children: e.label
|
|
713
|
-
}), /* @__PURE__ */
|
|
713
|
+
}), /* @__PURE__ */ k("span", {
|
|
714
714
|
className: "ml-auto shrink-0 font-mono text-caption tracking-wide text-(--muted-foreground)",
|
|
715
715
|
children: e.datatype
|
|
716
716
|
})]
|
|
717
717
|
}, e.key))] }, t.tableName || "metric"))]
|
|
718
718
|
})] });
|
|
719
|
-
},
|
|
719
|
+
}, P = ({ point: e }) => {
|
|
720
720
|
let t = ee(e), n = e.measure, r = n?.formatted ?? (n?.value === void 0 ? void 0 : String(n.value));
|
|
721
|
-
return t.length === 0 && !r ? null : /* @__PURE__ */
|
|
722
|
-
className:
|
|
721
|
+
return t.length === 0 && !r ? null : /* @__PURE__ */ A("div", {
|
|
722
|
+
className: O(je, "text-caption"),
|
|
723
723
|
"data-testid": "metric-card-drill-context",
|
|
724
|
-
children: [t.map((e) => /* @__PURE__ */
|
|
724
|
+
children: [t.map((e) => /* @__PURE__ */ A("div", {
|
|
725
725
|
className: "flex items-baseline gap-3",
|
|
726
726
|
"data-testid": `metric-card-drill-context-${e.role}`,
|
|
727
|
-
children: [/* @__PURE__ */
|
|
727
|
+
children: [/* @__PURE__ */ k("span", {
|
|
728
728
|
className: "shrink-0 truncate text-(--muted-foreground)",
|
|
729
729
|
children: e.label
|
|
730
|
-
}), /* @__PURE__ */
|
|
730
|
+
}), /* @__PURE__ */ k("span", {
|
|
731
731
|
className: "ml-auto min-w-0 truncate text-right font-medium text-(--foreground)",
|
|
732
732
|
children: e.value
|
|
733
733
|
})]
|
|
734
|
-
}, `${e.role}-${e.label}`)), r ? /* @__PURE__ */
|
|
734
|
+
}, `${e.role}-${e.label}`)), r ? /* @__PURE__ */ A("div", {
|
|
735
735
|
className: "flex items-baseline gap-3 text-(--muted-foreground)",
|
|
736
736
|
"data-testid": "metric-card-drill-context-measure",
|
|
737
|
-
children: [/* @__PURE__ */
|
|
737
|
+
children: [/* @__PURE__ */ k("span", {
|
|
738
738
|
className: "shrink-0 truncate",
|
|
739
739
|
children: n?.label || n?.columnName || "Value"
|
|
740
|
-
}), /* @__PURE__ */
|
|
740
|
+
}), /* @__PURE__ */ k("span", {
|
|
741
741
|
className: "ml-auto min-w-0 truncate text-right font-medium",
|
|
742
742
|
children: r
|
|
743
743
|
})]
|
|
744
744
|
}) : null]
|
|
745
745
|
});
|
|
746
|
-
},
|
|
746
|
+
}, F = ({ point: e, onFilterTo: t, canExcludeValues: n, canFilterThisMetric: r, canFilterDashboard: i, isFilterableColumn: a }) => {
|
|
747
747
|
let o = e.dimensions.filter((e) => !!e.columnName && e.value !== void 0 && (a?.(e.columnName) ?? !0));
|
|
748
748
|
if (o.length === 0) return null;
|
|
749
749
|
let s = (e) => e.formatted ?? (e.value === null ? "Empty" : String(e.value)), c = (e, r, i, a) => {
|
|
750
750
|
if (r === "exclude" && !n) return null;
|
|
751
751
|
let o = r === "exclude" ? "Exclude" : i === "metric" ? "Keep only" : "Show only";
|
|
752
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ A(w, {
|
|
753
753
|
onSelect: () => t(e, r, i),
|
|
754
754
|
"data-testid": `metric-card-filter-${i}-${r}-${e.columnName}`,
|
|
755
|
-
children: [
|
|
755
|
+
children: [k(r === "exclude" ? we : ct, {}), /* @__PURE__ */ A("span", {
|
|
756
756
|
className: "truncate",
|
|
757
757
|
children: [
|
|
758
758
|
a ? `${e.label || e.columnName}: ` : "",
|
|
@@ -762,44 +762,44 @@ var Et = (e) => {
|
|
|
762
762
|
]
|
|
763
763
|
})]
|
|
764
764
|
}, `${i}-${r}-${e.columnName}`);
|
|
765
|
-
}, 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__ */
|
|
765
|
+
}, 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__ */ A(Me, { children: [/* @__PURE__ */ A(Ce, {
|
|
766
766
|
"data-testid": `metric-card-filter-${e}-dim-${t.columnName}`,
|
|
767
767
|
children: [
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ k(ct, {}),
|
|
769
|
+
/* @__PURE__ */ k("span", {
|
|
770
770
|
className: "truncate",
|
|
771
771
|
children: t.label || t.columnName
|
|
772
772
|
}),
|
|
773
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ k("span", {
|
|
774
774
|
className: "ml-auto shrink-0 truncate pl-4 text-caption text-(--muted-foreground)",
|
|
775
775
|
children: s(t)
|
|
776
776
|
})
|
|
777
777
|
]
|
|
778
|
-
}), /* @__PURE__ */
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
778
|
+
}), /* @__PURE__ */ k(We, { children: l(t, e, !1) })] }, `${e}-${t.columnName}`));
|
|
779
|
+
return /* @__PURE__ */ A(dt, { children: [r ? /* @__PURE__ */ A(dt, { children: [
|
|
780
|
+
/* @__PURE__ */ k(C, {}),
|
|
781
|
+
/* @__PURE__ */ k(Ee, {
|
|
782
782
|
"data-testid": "metric-card-filter-metric-label",
|
|
783
783
|
children: "Filter this chart"
|
|
784
784
|
}),
|
|
785
785
|
u("metric")
|
|
786
|
-
] }) : null, i ? /* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
786
|
+
] }) : null, i ? /* @__PURE__ */ A(dt, { children: [
|
|
787
|
+
/* @__PURE__ */ k(C, {}),
|
|
788
|
+
/* @__PURE__ */ k(Ee, {
|
|
789
789
|
"data-testid": "metric-card-filter-label",
|
|
790
790
|
children: "Filter this dashboard"
|
|
791
791
|
}),
|
|
792
792
|
u("dashboard")
|
|
793
793
|
] }) : null] });
|
|
794
|
-
},
|
|
794
|
+
}, Jt = ({ 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: m, defaultOpen: h, className: g }) => {
|
|
795
795
|
let _ = p(r);
|
|
796
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ A(Pe, {
|
|
797
797
|
open: e,
|
|
798
798
|
onOpenChange: t,
|
|
799
799
|
defaultOpen: h,
|
|
800
|
-
children: [/* @__PURE__ */
|
|
800
|
+
children: [/* @__PURE__ */ k(Ue, {
|
|
801
801
|
asChild: !0,
|
|
802
|
-
children: /* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ k("span", {
|
|
803
803
|
"aria-hidden": "true",
|
|
804
804
|
"data-testid": "metric-card-drill-anchor",
|
|
805
805
|
className: "pointer-events-none absolute top-(--drill-anchor-y) left-(--drill-anchor-x) block size-0",
|
|
@@ -808,28 +808,28 @@ var Et = (e) => {
|
|
|
808
808
|
"--drill-anchor-y": `${n?.y ?? 0}px`
|
|
809
809
|
}
|
|
810
810
|
})
|
|
811
|
-
}), /* @__PURE__ */
|
|
811
|
+
}), /* @__PURE__ */ A(Te, {
|
|
812
812
|
align: "start",
|
|
813
813
|
size: "auto",
|
|
814
|
-
className:
|
|
814
|
+
className: O("dbn-v2-above-chart-tip max-w-80 text-sm", g),
|
|
815
815
|
"data-testid": "metric-card-drill-menu",
|
|
816
816
|
children: [
|
|
817
|
-
r ? /* @__PURE__ */
|
|
818
|
-
c && _ ? /* @__PURE__ */
|
|
817
|
+
r ? /* @__PURE__ */ k(P, { point: r }) : null,
|
|
818
|
+
c && _ ? /* @__PURE__ */ A(w, {
|
|
819
819
|
onSelect: () => c(_),
|
|
820
820
|
"data-testid": "metric-card-drill-copy",
|
|
821
|
-
children: [/* @__PURE__ */
|
|
821
|
+
children: [/* @__PURE__ */ k(pt, {}), "Copy value"]
|
|
822
822
|
}) : null,
|
|
823
|
-
o ? /* @__PURE__ */
|
|
823
|
+
o ? /* @__PURE__ */ k(qt, {
|
|
824
824
|
pool: i,
|
|
825
825
|
onDrillInto: a
|
|
826
826
|
}) : null,
|
|
827
|
-
s ? /* @__PURE__ */
|
|
827
|
+
s ? /* @__PURE__ */ A(w, {
|
|
828
828
|
onSelect: s,
|
|
829
829
|
"data-testid": "metric-card-drill-underlying-data",
|
|
830
|
-
children: [/* @__PURE__ */
|
|
830
|
+
children: [/* @__PURE__ */ k(nt, {}), "View underlying data"]
|
|
831
831
|
}) : null,
|
|
832
|
-
r && l ? /* @__PURE__ */
|
|
832
|
+
r && l ? /* @__PURE__ */ k(F, {
|
|
833
833
|
point: r,
|
|
834
834
|
onFilterTo: l,
|
|
835
835
|
canExcludeValues: u,
|
|
@@ -840,28 +840,28 @@ var Et = (e) => {
|
|
|
840
840
|
]
|
|
841
841
|
})]
|
|
842
842
|
});
|
|
843
|
-
},
|
|
843
|
+
}, Yt = ({ open: e, onOpenChange: t, onDownload: n, onEmail: r, rows: i, customMessages: a = {} }) => {
|
|
844
844
|
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.");
|
|
845
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ k(it, {
|
|
846
846
|
open: e,
|
|
847
847
|
onOpenChange: t,
|
|
848
|
-
children: /* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
848
|
+
children: /* @__PURE__ */ A(st, { children: [
|
|
849
|
+
/* @__PURE__ */ k(at, { children: /* @__PURE__ */ k(rt, { children: o }) }),
|
|
850
|
+
/* @__PURE__ */ k(tt, { children: f }),
|
|
851
|
+
/* @__PURE__ */ A(D, { children: [
|
|
852
|
+
/* @__PURE__ */ k(E, {
|
|
853
853
|
type: "button",
|
|
854
854
|
variant: "outline",
|
|
855
855
|
onClick: () => t(!1),
|
|
856
856
|
children: u
|
|
857
857
|
}),
|
|
858
|
-
r && /* @__PURE__ */
|
|
858
|
+
r && /* @__PURE__ */ k(E, {
|
|
859
859
|
type: "button",
|
|
860
860
|
variant: "outline",
|
|
861
861
|
onClick: r,
|
|
862
862
|
children: l
|
|
863
863
|
}),
|
|
864
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ k(E, {
|
|
865
865
|
type: "button",
|
|
866
866
|
onClick: n,
|
|
867
867
|
children: c
|
|
@@ -869,37 +869,37 @@ var Et = (e) => {
|
|
|
869
869
|
] })
|
|
870
870
|
] })
|
|
871
871
|
});
|
|
872
|
-
},
|
|
872
|
+
}, Xt = ({ open: e, onOpenChange: n, metric: i, 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: v, underlyingData: y }) => {
|
|
873
873
|
let ee = f ? t(f, { resourceKind: "metric" }) : void 0, b = ee?.retryable !== !1, te = a?.chartType === r.singleValue, ne = !o?.length || !a?.chartType;
|
|
874
|
-
return /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ k(it, {
|
|
875
875
|
open: e,
|
|
876
876
|
onOpenChange: n,
|
|
877
|
-
children: /* @__PURE__ */
|
|
877
|
+
children: /* @__PURE__ */ A(st, {
|
|
878
878
|
"data-testid": "fullscreen-dialog-content",
|
|
879
879
|
showCloseButton: !1,
|
|
880
880
|
className: "flex h-9/10 max-h-9/10 w-19/20 max-w-19/20 flex-col sm:max-w-19/20",
|
|
881
881
|
children: [
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
882
|
+
/* @__PURE__ */ k(at, { children: /* @__PURE__ */ k(rt, { children: u ?? i?.name ?? i?.metricName ?? "Metric" }) }),
|
|
883
|
+
/* @__PURE__ */ A("div", {
|
|
884
884
|
className: "flex min-h-0 w-full flex-1 flex-col gap-3",
|
|
885
|
-
children: [/* @__PURE__ */
|
|
885
|
+
children: [/* @__PURE__ */ k("div", {
|
|
886
886
|
className: te ? "h-44 w-full shrink-0" : "min-h-0 w-full flex-1",
|
|
887
887
|
"data-testid": "fullscreen-dialog-chart-region",
|
|
888
|
-
children: d ? /* @__PURE__ */
|
|
888
|
+
children: d ? /* @__PURE__ */ k(Ye, { className: "h-full" }) : f ? /* @__PURE__ */ k(Le, {
|
|
889
889
|
error: ee,
|
|
890
890
|
onRetry: b ? h : void 0,
|
|
891
891
|
...g
|
|
892
|
-
}) : p ? /* @__PURE__ */
|
|
892
|
+
}) : p ? /* @__PURE__ */ k("div", {
|
|
893
893
|
"data-testid": "card-join-mismatch-state",
|
|
894
894
|
"data-slot": "metric-card-join-mismatch",
|
|
895
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ k(Le, {
|
|
896
896
|
error: t(_e("column")),
|
|
897
897
|
...g
|
|
898
898
|
})
|
|
899
|
-
}) : ne ? /* @__PURE__ */
|
|
899
|
+
}) : ne ? /* @__PURE__ */ k(qe, {
|
|
900
900
|
className: "h-full",
|
|
901
901
|
hasActiveFilters: m
|
|
902
|
-
}) : /* @__PURE__ */
|
|
902
|
+
}) : /* @__PURE__ */ k(Xe, {
|
|
903
903
|
hasActiveFilters: m,
|
|
904
904
|
tablePaging: _,
|
|
905
905
|
tableSearch: v,
|
|
@@ -913,16 +913,16 @@ var Et = (e) => {
|
|
|
913
913
|
width: "100%",
|
|
914
914
|
className: "h-full"
|
|
915
915
|
})
|
|
916
|
-
}), te && y ? /* @__PURE__ */
|
|
916
|
+
}), te && y ? /* @__PURE__ */ A("section", {
|
|
917
917
|
"aria-label": "Underlying data",
|
|
918
918
|
"data-testid": "fullscreen-underlying-data",
|
|
919
919
|
className: "flex min-h-0 flex-1 flex-col gap-2",
|
|
920
|
-
children: [/* @__PURE__ */
|
|
920
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
921
921
|
className: "text-sm font-medium",
|
|
922
922
|
children: "Underlying data"
|
|
923
|
-
}), /* @__PURE__ */
|
|
923
|
+
}), /* @__PURE__ */ k("div", {
|
|
924
924
|
className: "relative min-h-0 flex-1",
|
|
925
|
-
children: y.paging || y.rows.length ? /* @__PURE__ */
|
|
925
|
+
children: y.paging || y.rows.length ? /* @__PURE__ */ k(Fe, {
|
|
926
926
|
rows: y.rows,
|
|
927
927
|
columns: y.columns,
|
|
928
928
|
paging: y.paging,
|
|
@@ -932,20 +932,20 @@ var Et = (e) => {
|
|
|
932
932
|
ariaLabel: "Underlying data rows",
|
|
933
933
|
qaEntity: "metric-card-fullscreen-underlying-data",
|
|
934
934
|
className: "h-full"
|
|
935
|
-
}) : y.isLoading ? /* @__PURE__ */
|
|
935
|
+
}) : y.isLoading ? /* @__PURE__ */ k(Ye, { className: "h-full" }) : y.error ? /* @__PURE__ */ A("div", {
|
|
936
936
|
role: "alert",
|
|
937
937
|
className: "flex h-full flex-col items-center justify-center gap-3 rounded-(--radius-md) border border-(--border) p-6 text-center",
|
|
938
|
-
children: [/* @__PURE__ */
|
|
938
|
+
children: [/* @__PURE__ */ k("span", {
|
|
939
939
|
"data-dbn-card-muted": !0,
|
|
940
940
|
className: "text-sm text-(--muted-foreground)",
|
|
941
941
|
children: y.error
|
|
942
|
-
}), y.onRetry ? /* @__PURE__ */
|
|
942
|
+
}), y.onRetry ? /* @__PURE__ */ k(E, {
|
|
943
943
|
type: "button",
|
|
944
944
|
variant: "outline",
|
|
945
945
|
onClick: y.onRetry,
|
|
946
946
|
children: "Try again"
|
|
947
947
|
}) : null]
|
|
948
|
-
}) : /* @__PURE__ */
|
|
948
|
+
}) : /* @__PURE__ */ k("p", {
|
|
949
949
|
"data-dbn-card-muted": !0,
|
|
950
950
|
className: "flex h-full items-center justify-center text-sm text-(--muted-foreground)",
|
|
951
951
|
children: "No data to show."
|
|
@@ -953,7 +953,7 @@ var Et = (e) => {
|
|
|
953
953
|
})]
|
|
954
954
|
}) : null]
|
|
955
955
|
}),
|
|
956
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ k(D, { children: /* @__PURE__ */ k(E, {
|
|
957
957
|
type: "button",
|
|
958
958
|
variant: "outline",
|
|
959
959
|
onClick: () => n(!1),
|
|
@@ -962,7 +962,7 @@ var Et = (e) => {
|
|
|
962
962
|
]
|
|
963
963
|
})
|
|
964
964
|
});
|
|
965
|
-
},
|
|
965
|
+
}, Zt = ({ filters: t, onChange: n, position: r = "inside", multi: i = !1, defaultOpen: a, className: o, children: s, childActiveCount: c = 0, onClearAll: l }) => {
|
|
966
966
|
let [u, d] = e.useState({}), f = e.useMemo(() => Object.values(u).filter((e) => Array.isArray(e) ? e.length > 0 : !!e).length + c, [u, c]), p = e.useMemo(() => Object.fromEntries(t.map((e) => [e.id, new Set(u[e.id] ?? [])])), [t, u]);
|
|
967
967
|
if (!t?.length && !s) return null;
|
|
968
968
|
let m = (e) => {
|
|
@@ -979,68 +979,68 @@ var Et = (e) => {
|
|
|
979
979
|
[e]: i
|
|
980
980
|
});
|
|
981
981
|
};
|
|
982
|
-
return /* @__PURE__ */
|
|
982
|
+
return /* @__PURE__ */ A(et, {
|
|
983
983
|
defaultOpen: a,
|
|
984
|
-
children: [/* @__PURE__ */
|
|
984
|
+
children: [/* @__PURE__ */ k($e, {
|
|
985
985
|
asChild: !0,
|
|
986
|
-
children: /* @__PURE__ */
|
|
986
|
+
children: /* @__PURE__ */ A(E, {
|
|
987
987
|
type: "button",
|
|
988
988
|
variant: "outline",
|
|
989
989
|
size: "sm",
|
|
990
|
-
className:
|
|
990
|
+
className: O(o),
|
|
991
991
|
"aria-label": "Metric filters",
|
|
992
992
|
"data-testid": "metric-filter-control-trigger",
|
|
993
993
|
"data-position": r,
|
|
994
994
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ k(ct, {}),
|
|
996
996
|
"Filters",
|
|
997
997
|
f ? ` (${f})` : ""
|
|
998
998
|
]
|
|
999
999
|
})
|
|
1000
|
-
}), /* @__PURE__ */
|
|
1000
|
+
}), /* @__PURE__ */ k(Ie, {
|
|
1001
1001
|
align: r === "outside" ? "start" : "end",
|
|
1002
1002
|
size: "lg",
|
|
1003
1003
|
padding: "form",
|
|
1004
1004
|
"data-testid": "metric-filter-control-content",
|
|
1005
|
-
children: /* @__PURE__ */
|
|
1005
|
+
children: /* @__PURE__ */ A("div", {
|
|
1006
1006
|
className: "flex flex-col gap-4",
|
|
1007
1007
|
children: [
|
|
1008
|
-
t.map((e) => /* @__PURE__ */
|
|
1008
|
+
t.map((e) => /* @__PURE__ */ A("div", {
|
|
1009
1009
|
className: "flex flex-col gap-1.5",
|
|
1010
|
-
children: [/* @__PURE__ */
|
|
1010
|
+
children: [/* @__PURE__ */ k("span", {
|
|
1011
1011
|
className: "text-xs font-medium text-(--muted-foreground)",
|
|
1012
1012
|
children: e.label
|
|
1013
|
-
}), i ? /* @__PURE__ */
|
|
1013
|
+
}), i ? /* @__PURE__ */ k("div", {
|
|
1014
1014
|
className: "flex flex-col gap-1.5",
|
|
1015
1015
|
children: e.options.map((t) => {
|
|
1016
1016
|
let n = p[e.id]?.has(t);
|
|
1017
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ A("label", {
|
|
1018
1018
|
className: "flex cursor-pointer items-center gap-2 text-sm text-(--foreground)",
|
|
1019
|
-
children: [/* @__PURE__ */
|
|
1019
|
+
children: [/* @__PURE__ */ k(ot, {
|
|
1020
1020
|
checked: n,
|
|
1021
1021
|
onCheckedChange: (n) => g(e.id, t, n === !0),
|
|
1022
1022
|
"data-testid": `metric-filter-option-${e.id}-${t}`
|
|
1023
1023
|
}), t]
|
|
1024
1024
|
}, t);
|
|
1025
1025
|
})
|
|
1026
|
-
}) : /* @__PURE__ */
|
|
1026
|
+
}) : /* @__PURE__ */ A(Ge, {
|
|
1027
1027
|
value: u[e.id] ?? "",
|
|
1028
1028
|
onValueChange: (t) => h(e.id, t),
|
|
1029
|
-
children: [/* @__PURE__ */
|
|
1029
|
+
children: [/* @__PURE__ */ k(T, {
|
|
1030
1030
|
size: "sm",
|
|
1031
1031
|
className: "w-full",
|
|
1032
1032
|
"data-testid": `metric-filter-select-${e.id}`,
|
|
1033
|
-
children: /* @__PURE__ */
|
|
1034
|
-
}), /* @__PURE__ */
|
|
1033
|
+
children: /* @__PURE__ */ k(Qe, { placeholder: "All" })
|
|
1034
|
+
}), /* @__PURE__ */ k(Ve, { children: e.options.map((e) => /* @__PURE__ */ k(Be, {
|
|
1035
1035
|
value: e,
|
|
1036
1036
|
children: e
|
|
1037
1037
|
}, e)) })]
|
|
1038
1038
|
})]
|
|
1039
1039
|
}, e.id)),
|
|
1040
1040
|
s,
|
|
1041
|
-
l && f ? /* @__PURE__ */
|
|
1041
|
+
l && f ? /* @__PURE__ */ k("div", {
|
|
1042
1042
|
className: "flex justify-end border-t border-(--border) pt-3",
|
|
1043
|
-
children: /* @__PURE__ */
|
|
1043
|
+
children: /* @__PURE__ */ k(E, {
|
|
1044
1044
|
type: "button",
|
|
1045
1045
|
variant: "ghost",
|
|
1046
1046
|
size: "sm",
|
|
@@ -1055,15 +1055,15 @@ var Et = (e) => {
|
|
|
1055
1055
|
})
|
|
1056
1056
|
})]
|
|
1057
1057
|
});
|
|
1058
|
-
},
|
|
1058
|
+
}, Qt = (e) => {
|
|
1059
1059
|
let t = e.target;
|
|
1060
1060
|
t instanceof Element && t.closest("table") || e.preventDefault();
|
|
1061
1061
|
};
|
|
1062
|
-
function
|
|
1062
|
+
function I(...e) {
|
|
1063
1063
|
return e.find((e) => e !== void 0);
|
|
1064
1064
|
}
|
|
1065
|
-
var
|
|
1066
|
-
function
|
|
1065
|
+
var $t = "__dbnMetricDrillMenu", en = "STRING";
|
|
1066
|
+
function tn(e) {
|
|
1067
1067
|
return e ? e.getConnectedDataURL({
|
|
1068
1068
|
type: "png",
|
|
1069
1069
|
pixelRatio: 2,
|
|
@@ -1071,39 +1071,35 @@ function nn(e) {
|
|
|
1071
1071
|
backgroundColor: "#fff"
|
|
1072
1072
|
}) : "#";
|
|
1073
1073
|
}
|
|
1074
|
-
var
|
|
1075
|
-
function
|
|
1074
|
+
var nn = 5e3, rn = {}, an = 2e5;
|
|
1075
|
+
function on(e, t) {
|
|
1076
1076
|
let n = te(e), r = new Blob([JSON.parse("\"\\ufeff\""), n], { type: "text/csv;charset=utf-8;" }), i = URL.createObjectURL(r);
|
|
1077
1077
|
try {
|
|
1078
|
-
|
|
1078
|
+
sn(i, t);
|
|
1079
1079
|
} finally {
|
|
1080
1080
|
setTimeout(() => URL.revokeObjectURL(i), 0);
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function sn(e, t) {
|
|
1084
1084
|
if (!e || e === "#") return;
|
|
1085
1085
|
let n = document.createElement("a");
|
|
1086
1086
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1089
|
-
|
|
1090
|
-
if (typeof e == "string") return e;
|
|
1091
|
-
if (typeof e == "number") return String(e);
|
|
1092
|
-
let t = e;
|
|
1093
|
-
return String(t.label ?? t.value ?? t.name ?? "");
|
|
1088
|
+
function cn(e) {
|
|
1089
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
1094
1090
|
}
|
|
1095
|
-
function
|
|
1091
|
+
function ln(e) {
|
|
1096
1092
|
return e?.length ? e.filter((e) => e && !e.isHiddenInUi).map((e) => ({
|
|
1097
1093
|
id: String(e.name),
|
|
1098
1094
|
label: String(e.name),
|
|
1099
|
-
options: Array.isArray(e.options) ? e.options.map(
|
|
1095
|
+
options: Array.isArray(e.options) ? e.options.map(cn).filter(Boolean) : []
|
|
1100
1096
|
})) : [];
|
|
1101
1097
|
}
|
|
1102
|
-
var
|
|
1103
|
-
function
|
|
1104
|
-
return e?.filterType === "manual" && !e.isVariableFilter && e.filterVariant?.value !== "like";
|
|
1098
|
+
var un = "opacity-0 transition-opacity group-focus-within/metric-card:opacity-100 group-hover/metric-card:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100 [@media(pointer:coarse)]:opacity-100";
|
|
1099
|
+
function dn(e) {
|
|
1100
|
+
return e?.filterType === "manual" && !e.isVariableFilter && e.filterVariant?.value !== "like" && Array.isArray(e.options) && e.options.every((e) => typeof e == "string" || typeof e == "number");
|
|
1105
1101
|
}
|
|
1106
|
-
function
|
|
1102
|
+
function fn(e) {
|
|
1107
1103
|
let t = (Array.isArray(e?.options) ? e.options : []).find((e) => e?.range === "Date Range");
|
|
1108
1104
|
if (t?.startDate && t?.endDate && e?.value) return {
|
|
1109
1105
|
startDate: s(t.startDate),
|
|
@@ -1112,39 +1108,39 @@ function pn(e) {
|
|
|
1112
1108
|
value: ""
|
|
1113
1109
|
};
|
|
1114
1110
|
}
|
|
1115
|
-
function
|
|
1116
|
-
if (e != null) return typeof e == "string" ? e === "download" ? /* @__PURE__ */
|
|
1111
|
+
function pn(e) {
|
|
1112
|
+
if (e != null) return typeof e == "string" ? e === "download" ? /* @__PURE__ */ k(ke, {}) : e === "kebab-menu-vertical" ? void 0 : e.trimStart().startsWith("<") ? /* @__PURE__ */ k("span", { dangerouslySetInnerHTML: { __html: i(e) } }) : void 0 : e;
|
|
1117
1113
|
}
|
|
1118
|
-
var
|
|
1119
|
-
let { metricItem: s, metric: p, isDisableCardTitle: h, isShadowDisableOnHover: g, hideMetricCardShadow: _, disableBorder: v, disableMetricCardBorder: ee, isMergedMetric: b, colors: te, chartColors: S, chartRendererType: Ce, chartAppearance: we, appearanceOptions: Te, chartColumns:
|
|
1114
|
+
var mn = (o) => {
|
|
1115
|
+
let { metricItem: s, metric: p, isDisableCardTitle: h, isShadowDisableOnHover: g, hideMetricCardShadow: _, disableBorder: v, disableMetricCardBorder: ee, isMergedMetric: b, colors: te, chartColors: S, chartRendererType: Ce, chartAppearance: we, appearanceOptions: Te, chartColumns: C, chartHeight: Ee, width: Oe, optionsIcon: ke, settingsIcon: Ae, noDataImg: je, noDataFoundSvg: Me, enableDownloadCsv: Ne, enableEmailCsv: Pe, onDownloadRawCsv: w, onServerEvent: T, disableDownloadPng: Fe, disableDownloadDataNoFilters: Ie, disableDownloadUnderlyingDataNoFilters: Re, disableUnderlyingData: ze, isAllowedToSeeUnderlyingData: Be, disableFullscreen: Ve, enableTitleClickFullscreen: Ue, canEditMetric: We, onEditMetric: Ge, language: Je, translationDictionary: Ze, customMessages: Qe, className: $e, metricFilterPosition: et, enableMultiMetricFilters: tt, clientColumnType: D, hideDatePickerOptions: nt, dropdownTheme: rt, isFrontendApp: it, token: at, datasourceId: ot, isAllClient: st, workspaceId: ct, globalFilters: ft, calendarType: pt, enableAdhocDrill: mt, enableExcludeFilter: ht, enableCrossFilter: gt, enableCrossFilterBeforeDrill: vt, enableTablePaging: yt, enableFormattedUnderlyingData: bt, enableCoverageTruncation: xt, enableFilteredEmptyState: Ct, onClearAllFilters: Dt, isEditLayoutEnabled: Ot, isDisableMerge: kt, setOpenMergeModal: At, knownCause: Ft } = o, j = s ?? p, { data: It } = l(), Lt = It?.clientSubsetData, { client: Rt, param: zt, companyTenancyType: Bt, encryptedClient: Vt, isJoinMismatch: Ht, userProvidedDashboardId: Ut } = o, Wt = {
|
|
1120
1116
|
...o,
|
|
1121
|
-
metric:
|
|
1122
|
-
clientId:
|
|
1123
|
-
encryptedClientId:
|
|
1124
|
-
tenancyLevel:
|
|
1125
|
-
rlsFilters:
|
|
1126
|
-
isDisableQuery: !!
|
|
1127
|
-
dashboardId:
|
|
1128
|
-
},
|
|
1129
|
-
u("card",
|
|
1130
|
-
let { emptyCard:
|
|
1131
|
-
customMessages:
|
|
1132
|
-
translationDictionary:
|
|
1133
|
-
selectedLanguage:
|
|
1134
|
-
},
|
|
1117
|
+
metric: j,
|
|
1118
|
+
clientId: Rt,
|
|
1119
|
+
encryptedClientId: Vt,
|
|
1120
|
+
tenancyLevel: Bt,
|
|
1121
|
+
rlsFilters: zt,
|
|
1122
|
+
isDisableQuery: !!Ht,
|
|
1123
|
+
dashboardId: Ut
|
|
1124
|
+
}, M = me(Wt), N = !!I(M.isQueryLoading, M.isLoading), Kt = !!M.isMetricUpdating && !N, P = e.useMemo(() => I(M.dataDb, M.data) ?? [], [M.dataDb, M.data]), F = I(M.queryError, M.error), cn = We && c(F) ? F.message : void 0, mn = I(M.refetchMetricData, M.refetch), L = M.chartSettings ?? j?.chartOptions, R = !!M.isSingleValueNull, z = I(M.metricName, j?.name, j?.metricName), hn = I(M.description, j?.description), gn = M.longDescription, _n = M.footNote, vn = gn ? /* @__PURE__ */ k("span", { dangerouslySetInnerHTML: { __html: i(gn) } }) : void 0, yn = e.useMemo(() => F ? ye(F) : void 0, [F]);
|
|
1125
|
+
u("card", yn, { metricId: j?.metricId ?? j?.id });
|
|
1126
|
+
let { emptyCard: bn } = xe(), xn = {
|
|
1127
|
+
customMessages: Qe,
|
|
1128
|
+
translationDictionary: Ze,
|
|
1129
|
+
selectedLanguage: Je
|
|
1130
|
+
}, Sn = !!(I(v, ee) || b), Cn = !!I(g, _) || Sn, wn = I(te, S), [Tn, En] = e.useState(!1), [Dn, On] = e.useState(!1), [kn, An] = e.useState(!1), [B, jn] = e.useState(!1), [Mn, V] = e.useState(null), Nn = e.useCallback(() => V(null), []), Pn = e.useRef(!1), [Fn, In] = e.useState(!1);
|
|
1135
1131
|
e.useEffect(() => {
|
|
1136
|
-
|
|
1137
|
-
}, [
|
|
1138
|
-
let [
|
|
1139
|
-
let e = !!
|
|
1140
|
-
return
|
|
1132
|
+
V(null);
|
|
1133
|
+
}, [j?.id]);
|
|
1134
|
+
let [Ln, Rn] = e.useState([]), [zn, H] = e.useState(!1), Bn = e.useMemo(() => {
|
|
1135
|
+
let e = !!j?.clickActions?.underlyingData?.isEnable && !!j?.clickActions?.underlyingData?.sql;
|
|
1136
|
+
return L?.chartType !== r.singleValue || e ? "" : a(j?.query ?? "", j?.companyId ?? "");
|
|
1141
1137
|
}, [
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
]), Vn = e.useCallback((e) => Bn ? ae(e, Bn) : e, [Bn]), Hn = e.useMemo(() => Vn(
|
|
1138
|
+
L?.chartType,
|
|
1139
|
+
j?.clickActions?.underlyingData?.isEnable,
|
|
1140
|
+
j?.clickActions?.underlyingData?.sql,
|
|
1141
|
+
j?.query,
|
|
1142
|
+
j?.companyId
|
|
1143
|
+
]), Vn = e.useCallback((e) => Bn ? ae(e, Bn) : e, [Bn]), Hn = e.useMemo(() => Vn(Ln), [Vn, Ln]), Un = e.useMemo(() => Object.keys(Hn[0] ?? {}).map((e) => ({
|
|
1148
1144
|
key: e,
|
|
1149
1145
|
label: e
|
|
1150
1146
|
})), [Hn]), [U, Wn] = e.useState({
|
|
@@ -1158,43 +1154,43 @@ var hn = (o) => {
|
|
|
1158
1154
|
return (t) => (...n) => {
|
|
1159
1155
|
e === Qn.current && t(...n);
|
|
1160
1156
|
};
|
|
1161
|
-
}, []), er =
|
|
1162
|
-
enableAdhocDrill:
|
|
1163
|
-
enableExcludeFilter:
|
|
1164
|
-
enableCrossFilter:
|
|
1165
|
-
disableUnderlyingData:
|
|
1166
|
-
enableTablePaging:
|
|
1167
|
-
enableFormattedUnderlyingData:
|
|
1157
|
+
}, []), er = M.handleChartClick, tr = e.useMemo(() => x(It, {
|
|
1158
|
+
enableAdhocDrill: mt,
|
|
1159
|
+
enableExcludeFilter: ht,
|
|
1160
|
+
enableCrossFilter: gt,
|
|
1161
|
+
disableUnderlyingData: ze,
|
|
1162
|
+
enableTablePaging: yt,
|
|
1163
|
+
enableFormattedUnderlyingData: bt
|
|
1168
1164
|
}), [
|
|
1169
|
-
|
|
1165
|
+
It,
|
|
1166
|
+
mt,
|
|
1170
1167
|
ht,
|
|
1171
1168
|
gt,
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
bt
|
|
1175
|
-
xt
|
|
1169
|
+
ze,
|
|
1170
|
+
yt,
|
|
1171
|
+
bt
|
|
1176
1172
|
]), W = tr.canDrillIntoAnyDimension, nr = tr.canCrossFilter, rr = {
|
|
1177
|
-
enableDownloadCsv:
|
|
1178
|
-
enableEmailCsv: !!
|
|
1179
|
-
disableDownloadPng:
|
|
1180
|
-
disableDownloadDataNoFilters: !!
|
|
1181
|
-
disableDownloadUnderlyingDataNoFilters: !!
|
|
1182
|
-
disableUnderlyingData:
|
|
1183
|
-
disableFullscreen: !!
|
|
1184
|
-
}, ir = !
|
|
1173
|
+
enableDownloadCsv: Ne,
|
|
1174
|
+
enableEmailCsv: !!I(Pe, w ? !0 : void 0),
|
|
1175
|
+
disableDownloadPng: Fe,
|
|
1176
|
+
disableDownloadDataNoFilters: !!Ie,
|
|
1177
|
+
disableDownloadUnderlyingDataNoFilters: !!Re,
|
|
1178
|
+
disableUnderlyingData: I(ze, Be === void 0 ? void 0 : !Be),
|
|
1179
|
+
disableFullscreen: !!Ve
|
|
1180
|
+
}, ir = !Ve, G = !rr.disableUnderlyingData, ar = W || G, or = tr.canPageThroughLargeTables, K = tr.canReadFormattedUnderlyingData, [sr, cr] = e.useState({
|
|
1185
1181
|
open: !1,
|
|
1186
1182
|
anchor: null,
|
|
1187
1183
|
params: null
|
|
1188
1184
|
}), lr = e.useId(), ur = e.useRef(!1), dr = e.useCallback((e) => {
|
|
1189
|
-
typeof window < "u" && !sr.open && window.history.state?.[
|
|
1185
|
+
typeof window < "u" && !sr.open && window.history.state?.[$t] !== lr && (ur.current = !1, window.history.pushState({
|
|
1190
1186
|
...window.history.state,
|
|
1191
|
-
[
|
|
1187
|
+
[$t]: lr
|
|
1192
1188
|
}, "")), cr(e);
|
|
1193
1189
|
}, [sr.open, lr]), fr = e.useCallback(() => {
|
|
1194
1190
|
cr((e) => ({
|
|
1195
1191
|
...e,
|
|
1196
1192
|
open: !1
|
|
1197
|
-
})), typeof window < "u" && !ur.current && window.history.state?.[
|
|
1193
|
+
})), typeof window < "u" && !ur.current && window.history.state?.[$t] === lr && (ur.current = !0, window.history.back());
|
|
1198
1194
|
}, [lr]);
|
|
1199
1195
|
e.useEffect(() => {
|
|
1200
1196
|
if (typeof window > "u") return;
|
|
@@ -1206,37 +1202,37 @@ var hn = (o) => {
|
|
|
1206
1202
|
};
|
|
1207
1203
|
return window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e);
|
|
1208
1204
|
}, []);
|
|
1209
|
-
let pr =
|
|
1210
|
-
subset:
|
|
1211
|
-
configuration:
|
|
1212
|
-
selectedDims:
|
|
1205
|
+
let pr = M.drillDownSettings, q = e.useMemo(() => pr?.configV2?.levels ?? [], [pr?.configV2?.levels]), mr = Tt(pr?.configV2), hr = mr.activeLevel, gr = hr?.dimensions?.[0]?.alias || L?.xAxis || j?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.[0]?.alias, _r = e.useMemo(() => W ? Et({
|
|
1206
|
+
subset: Lt,
|
|
1207
|
+
configuration: j?.datasetMetricSettings?.newDatasetSettings?.configuration,
|
|
1208
|
+
selectedDims: j?.datasetMetricSettings?.newDatasetSettings?.selectedDims,
|
|
1213
1209
|
config: pr?.configV2,
|
|
1214
|
-
chartSettings:
|
|
1215
|
-
isCustomSql: !!
|
|
1216
|
-
isDrillEnabled: !!
|
|
1210
|
+
chartSettings: L,
|
|
1211
|
+
isCustomSql: !!j?.datasetMetricSettings?.isUseRawSQL,
|
|
1212
|
+
isDrillEnabled: !!j?.drillDownSettings?.isEnableGroupBy
|
|
1217
1213
|
}) : { groups: [] }, [
|
|
1218
1214
|
W,
|
|
1219
|
-
|
|
1220
|
-
|
|
1215
|
+
Lt,
|
|
1216
|
+
j,
|
|
1221
1217
|
pr?.configV2,
|
|
1222
|
-
|
|
1223
|
-
]), vr = _r.groups.some((e) => e.options.length > 0), yr =
|
|
1224
|
-
chartType:
|
|
1225
|
-
isDrillEnabled:
|
|
1226
|
-
dimensions:
|
|
1227
|
-
drilledLevel:
|
|
1218
|
+
L
|
|
1219
|
+
]), vr = _r.groups.some((e) => e.options.length > 0), yr = M.onDrillIntoDimension, br = M.onDrillLevelClick, xr = M.onDrillDown, Sr = M.onFilterDashboardTo, Cr = M.onFilterMetricTo, wr = e.useMemo(() => ue({
|
|
1220
|
+
chartType: L?.chartType,
|
|
1221
|
+
isDrillEnabled: j?.drillDownSettings?.isEnableGroupBy,
|
|
1222
|
+
dimensions: M.dimensions,
|
|
1223
|
+
drilledLevel: M.drilledLevel,
|
|
1228
1224
|
drillLevels: q
|
|
1229
1225
|
}), [
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1226
|
+
L?.chartType,
|
|
1227
|
+
j?.drillDownSettings?.isEnableGroupBy,
|
|
1228
|
+
M.dimensions,
|
|
1229
|
+
M.drilledLevel,
|
|
1234
1230
|
q
|
|
1235
|
-
]), Tr = o.enableClickActions, J = e.useMemo(() =>
|
|
1231
|
+
]), Tr = o.enableClickActions, J = e.useMemo(() => j?.clickActions ?? {}, [j?.clickActions]), Er = o.onMaximize, Dr = o.chartClickFunction, Or = e.useCallback((e) => {
|
|
1236
1232
|
if (!Tr) return;
|
|
1237
|
-
let t =
|
|
1238
|
-
columnName:
|
|
1239
|
-
value:
|
|
1233
|
+
let t = L?.chartType, n = M.dimensions?.length, i = M.drilledLevel, a = !!j?.drillDownSettings?.isEnableGroupBy, s = t === r.singleValue ? [{
|
|
1234
|
+
columnName: L?.singleValue,
|
|
1235
|
+
value: P?.[0]?.[L?.singleValue || ""]
|
|
1240
1236
|
}] : e?.rowFilters, c = t === r.table || t === r.singleValue || a && i === n ? s : e, l = be({
|
|
1241
1237
|
chart: J.chart,
|
|
1242
1238
|
chartWithMetric: J.chartWithMetric,
|
|
@@ -1245,18 +1241,18 @@ var hn = (o) => {
|
|
|
1245
1241
|
drilledLevel: i,
|
|
1246
1242
|
dimensionCount: n,
|
|
1247
1243
|
isLastConfiguredDrillLevel: !!q[q.length - 1]?.isEnable,
|
|
1248
|
-
isTableRedirectAllowed: !
|
|
1244
|
+
isTableRedirectAllowed: !Ke.has(t) || !!L?.tableSettings?.chartAction?.isEnableColumnRedirection
|
|
1249
1245
|
}), u = (e, t) => ge({
|
|
1250
|
-
chart:
|
|
1246
|
+
chart: L,
|
|
1251
1247
|
valueColumn: e,
|
|
1252
1248
|
isDrillEnabled: a,
|
|
1253
1249
|
drilledLevel: i,
|
|
1254
1250
|
dimensionCount: n,
|
|
1255
1251
|
params: c,
|
|
1256
1252
|
passAllData: t
|
|
1257
|
-
}), d = J.chart?.valueColumn, f = J.chartWithDashboard?.valueColumn ??
|
|
1258
|
-
if (l.host ? Dr?.(u(d, J.chart?.isPassAllData) || void 0) : l.navigate &&
|
|
1259
|
-
metric:
|
|
1253
|
+
}), d = J.chart?.valueColumn, f = J.chartWithDashboard?.valueColumn ?? L?.xAxis;
|
|
1254
|
+
if (l.host ? Dr?.(u(d, J.chart?.isPassAllData) || void 0) : l.navigate && ut(J.chart, u(d) || void 0), l.openNestedMetric && Er?.({
|
|
1255
|
+
metric: j,
|
|
1260
1256
|
rlsFilters: o.param,
|
|
1261
1257
|
appFilters: o.appFilters,
|
|
1262
1258
|
appliedMetricFilters: o.appliedMetricFilters,
|
|
@@ -1271,33 +1267,33 @@ var hn = (o) => {
|
|
|
1271
1267
|
}, [
|
|
1272
1268
|
Tr,
|
|
1273
1269
|
J,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1270
|
+
L,
|
|
1271
|
+
P,
|
|
1272
|
+
M.dimensions,
|
|
1273
|
+
M.drilledLevel,
|
|
1274
|
+
j,
|
|
1279
1275
|
q,
|
|
1280
1276
|
Dr,
|
|
1281
1277
|
Er,
|
|
1282
1278
|
o
|
|
1283
1279
|
]), kr = e.useCallback((e, t) => {
|
|
1284
1280
|
er?.(e);
|
|
1285
|
-
let n = e?.event?.event ?? e?.event, r = t ??
|
|
1281
|
+
let n = e?.event?.event ?? e?.event, r = t ?? St(n?.type), i = wt({
|
|
1286
1282
|
gesture: r,
|
|
1287
1283
|
route: wr,
|
|
1288
1284
|
canCrossFilter: nr,
|
|
1289
1285
|
canDrillInto: W,
|
|
1290
1286
|
hasPointMenu: ar
|
|
1291
1287
|
});
|
|
1292
|
-
if (r === "primary" && Or(e), i.drillDown && (
|
|
1288
|
+
if (r === "primary" && Or(e), i.drillDown && (vt === !0 && !o.isInternalApp && gr && e?.name !== void 0 && !Ke.has(L?.chartType) && Sr?.({
|
|
1293
1289
|
columnName: gr,
|
|
1294
1290
|
value: e.name,
|
|
1295
1291
|
mode: "only"
|
|
1296
1292
|
}), xr?.(de({
|
|
1297
|
-
chartType:
|
|
1293
|
+
chartType: L?.chartType,
|
|
1298
1294
|
params: e,
|
|
1299
1295
|
rowFilters: e?.rowFilters,
|
|
1300
|
-
dimensions:
|
|
1296
|
+
dimensions: M.dimensions
|
|
1301
1297
|
}))), !i.adhocMenu) return;
|
|
1302
1298
|
r === "secondary" && n?.preventDefault?.();
|
|
1303
1299
|
let a = jr.current?.getBoundingClientRect(), s = a && typeof n?.clientX == "number" && typeof n?.clientY == "number";
|
|
@@ -1321,15 +1317,15 @@ var hn = (o) => {
|
|
|
1321
1317
|
wr,
|
|
1322
1318
|
xr,
|
|
1323
1319
|
Sr,
|
|
1324
|
-
|
|
1320
|
+
vt,
|
|
1325
1321
|
o.isInternalApp,
|
|
1326
1322
|
gr,
|
|
1327
|
-
|
|
1328
|
-
|
|
1323
|
+
L?.chartType,
|
|
1324
|
+
M.dimensions,
|
|
1329
1325
|
dr
|
|
1330
1326
|
]), Ar = e.useRef(null), jr = e.useRef(null), Mr = e.useCallback((e) => {
|
|
1331
1327
|
let t = jr.current;
|
|
1332
|
-
t !== e && (t?.removeEventListener("contextmenu",
|
|
1328
|
+
t !== e && (t?.removeEventListener("contextmenu", Qt), e?.addEventListener("contextmenu", Qt), jr.current = e);
|
|
1333
1329
|
}, []), Nr = e.useCallback((e) => {
|
|
1334
1330
|
let t = jr.current, n = e.anchor.getBoundingClientRect(), r = t?.getBoundingClientRect(), i = Object.keys(e.row || {}).map((t) => ({
|
|
1335
1331
|
columnName: t,
|
|
@@ -1346,8 +1342,8 @@ var hn = (o) => {
|
|
|
1346
1342
|
},
|
|
1347
1343
|
params: { rowFilters: i }
|
|
1348
1344
|
});
|
|
1349
|
-
}, [dr]), Pr = e.useMemo(() => m(
|
|
1350
|
-
let e = hr?.dimensions?.[0]?.alias ||
|
|
1345
|
+
}, [dr]), Pr = e.useMemo(() => m(L), [L]), Fr = e.useMemo(() => {
|
|
1346
|
+
let e = hr?.dimensions?.[0]?.alias || L?.xAxis || j?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.[0]?.alias, t = (L?.isMultiDimension || L?.isDynamicSeries) && L?.seriesField && L.seriesField !== "ungrouped" ? L.seriesField : void 0;
|
|
1351
1347
|
return y({
|
|
1352
1348
|
params: sr.params,
|
|
1353
1349
|
axisDimension: e ? {
|
|
@@ -1356,41 +1352,41 @@ var hn = (o) => {
|
|
|
1356
1352
|
} : void 0,
|
|
1357
1353
|
seriesDimension: t ? {
|
|
1358
1354
|
columnName: t,
|
|
1359
|
-
label: ((e) => e ? (
|
|
1355
|
+
label: ((e) => e ? (j?.datasetMetricSettings?.newDatasetSettings?.selectedDims)?.find((t) => t?.alias === e) : void 0)(t)?.label || t
|
|
1360
1356
|
} : void 0,
|
|
1361
1357
|
measure: {
|
|
1362
|
-
columnName:
|
|
1363
|
-
label:
|
|
1358
|
+
columnName: j?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.[0]?.alias,
|
|
1359
|
+
label: j?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.[0]?.label
|
|
1364
1360
|
},
|
|
1365
1361
|
formatMeasure: Pr
|
|
1366
1362
|
});
|
|
1367
1363
|
}, [
|
|
1368
1364
|
sr.params,
|
|
1369
1365
|
hr,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1366
|
+
j,
|
|
1367
|
+
L?.isMultiDimension,
|
|
1368
|
+
L?.isDynamicSeries,
|
|
1369
|
+
L?.seriesField,
|
|
1370
|
+
L?.xAxis,
|
|
1375
1371
|
Pr
|
|
1376
1372
|
]), [Y, Ir] = e.useState([]), Lr = e.useMemo(() => {
|
|
1377
1373
|
let e = hr?.filters || [], t = new Set(Y.map((e) => e.columnName)), n = [...e.filter((e) => !t.has(e.columnName)), ...Y];
|
|
1378
1374
|
if (!n.length) return;
|
|
1379
|
-
let r =
|
|
1375
|
+
let r = j?.datasetMetricSettings?.newDatasetSettings?.selectedDims || [];
|
|
1380
1376
|
return n.filter((e) => !!e?.columnName && e?.value !== void 0).map((e) => ({
|
|
1381
1377
|
label: r.find((t) => t?.alias === e.columnName)?.label || e.columnName,
|
|
1382
1378
|
value: e.value === null ? "Empty" : String(e.value)
|
|
1383
1379
|
}));
|
|
1384
1380
|
}, [
|
|
1385
1381
|
hr,
|
|
1386
|
-
|
|
1382
|
+
j,
|
|
1387
1383
|
Y
|
|
1388
1384
|
]), Rr = e.useCallback((e) => {
|
|
1389
1385
|
fr(), navigator?.clipboard?.writeText?.(e)?.catch?.(() => void 0);
|
|
1390
1386
|
}, [fr]), zr = ce({
|
|
1391
|
-
runtimeEnabled:
|
|
1387
|
+
runtimeEnabled: gt,
|
|
1392
1388
|
metricEnabled: pr?.isEnableCrossFilter
|
|
1393
|
-
}), Br = !!Sr && tr.canCrossFilter && zr, Vr = e.useCallback((e) => le(e,
|
|
1389
|
+
}), Br = !!Sr && tr.canCrossFilter && zr, Vr = e.useCallback((e) => le(e, j?.datasetMetricSettings?.newDatasetSettings?.selectedDims), [j]), Hr = e.useCallback((e, t, n) => {
|
|
1394
1390
|
fr(), (n === "metric" ? Cr : Sr)?.({
|
|
1395
1391
|
columnName: e.columnName,
|
|
1396
1392
|
value: e.value,
|
|
@@ -1418,7 +1414,7 @@ var hn = (o) => {
|
|
|
1418
1414
|
W,
|
|
1419
1415
|
nr,
|
|
1420
1416
|
q
|
|
1421
|
-
]), Wr = e.useRef(null), Gr =
|
|
1417
|
+
]), Wr = e.useRef(null), Gr = M.containerRef, Kr = e.useCallback((e) => {
|
|
1422
1418
|
Wr.current = e, Gr && (Gr.current = e);
|
|
1423
1419
|
}, [Gr]), qr = X.length > 1 ? X[X.length - 2]?.index : "";
|
|
1424
1420
|
e.useEffect(() => {
|
|
@@ -1431,36 +1427,36 @@ var hn = (o) => {
|
|
|
1431
1427
|
};
|
|
1432
1428
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
1433
1429
|
}, [qr, br]);
|
|
1434
|
-
let Z = typeof
|
|
1435
|
-
|
|
1430
|
+
let Z = typeof z == "string" && z || typeof M.metricName == "string" && M.metricName || "metric", Jr = [B ? "Underlying data without filters" : "Underlying data", typeof z == "string" ? z.trim() : ""].filter(Boolean).join(": "), Yr = e.useMemo(() => I(M.tableResultsDownloadData, P) ?? [], [M.tableResultsDownloadData, P]), Xr = Ke.has(L?.chartType), Zr = e.useCallback((e, t = Z) => {
|
|
1431
|
+
on(e ?? [], `${t}.csv`);
|
|
1436
1432
|
}, [Z]), Qr = e.useCallback(() => {
|
|
1437
|
-
let e =
|
|
1438
|
-
!e || e === "#" ?
|
|
1439
|
-
}, [Z, Xr]), Q =
|
|
1440
|
-
|
|
1433
|
+
let e = tn(Ar.current);
|
|
1434
|
+
!e || e === "#" ? V(Xr ? "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.") : (V(null), sn(e, `${Z}.png`));
|
|
1435
|
+
}, [Z, Xr]), Q = M.getUnderlyingData, $r = e.useCallback(() => {
|
|
1436
|
+
On(!0);
|
|
1441
1437
|
}, []), ei = e.useCallback(() => {
|
|
1442
|
-
Zr(Yr, Z),
|
|
1438
|
+
Zr(Yr, Z), T?.(n, j?.id), On(!1);
|
|
1443
1439
|
}, [
|
|
1444
1440
|
Zr,
|
|
1445
1441
|
Yr,
|
|
1446
1442
|
Z,
|
|
1447
|
-
|
|
1448
|
-
|
|
1443
|
+
T,
|
|
1444
|
+
j?.id
|
|
1449
1445
|
]), ti = e.useCallback((e) => {
|
|
1450
|
-
if (!Q ||
|
|
1451
|
-
|
|
1452
|
-
let t =
|
|
1446
|
+
if (!Q || Pn.current) return;
|
|
1447
|
+
Pn.current = !0, In(!0), V(null);
|
|
1448
|
+
let t = j?.dataSecuritySettings?.csvColumns || [], i = new Set(t), a = [], o, s = !1;
|
|
1453
1449
|
Q({
|
|
1454
1450
|
columnName: void 0,
|
|
1455
1451
|
value: void 0,
|
|
1456
|
-
isSingleValueChart:
|
|
1452
|
+
isSingleValueChart: L?.chartType === r.singleValue,
|
|
1457
1453
|
setData: (e) => {
|
|
1458
1454
|
a = e || [];
|
|
1459
1455
|
},
|
|
1460
1456
|
setLoading: (e) => {
|
|
1461
1457
|
if (e) return;
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
1458
|
+
if (Pn.current = !1, In(!1), s) {
|
|
1459
|
+
V(pe(o, "Failed to download CSV without filters. Please try again.").text);
|
|
1464
1460
|
return;
|
|
1465
1461
|
}
|
|
1466
1462
|
let r = t.length ? a.map((e) => {
|
|
@@ -1469,34 +1465,34 @@ var hn = (o) => {
|
|
|
1469
1465
|
i.has(n) || (t[n] = e[n]);
|
|
1470
1466
|
}), t;
|
|
1471
1467
|
}) : a;
|
|
1472
|
-
Zr(r, Z),
|
|
1468
|
+
Zr(r, Z), T?.(n, j?.id);
|
|
1473
1469
|
},
|
|
1474
1470
|
onError: (e) => {
|
|
1475
1471
|
s = !0, o = e;
|
|
1476
1472
|
},
|
|
1477
|
-
clientColumnType:
|
|
1473
|
+
clientColumnType: D ?? en,
|
|
1478
1474
|
withoutFilters: !0,
|
|
1479
1475
|
pointFilters: e?.pointFilters?.length ? e.pointFilters : void 0
|
|
1480
1476
|
});
|
|
1481
1477
|
}, [
|
|
1482
1478
|
Q,
|
|
1483
|
-
|
|
1484
|
-
|
|
1479
|
+
L?.chartType,
|
|
1480
|
+
D,
|
|
1485
1481
|
Zr,
|
|
1486
1482
|
Z,
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
]), $ =
|
|
1490
|
-
$ && (
|
|
1483
|
+
T,
|
|
1484
|
+
j
|
|
1485
|
+
]), $ = M.onChangeFilterValue, ni = e.useMemo(() => (M.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && e.datatype === "date"), [M.metricFilters]), ri = e.useMemo(() => ln(M.metricFilters?.filter((e) => e && e.datatype !== "date" && dn(e))), [M.metricFilters]), ii = e.useMemo(() => (M.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && e.datatype !== "date" && !dn(e)), [M.metricFilters]), ai = ii.filter((e) => Array.isArray(e.value) ? e.value.length > 0 : !!e.value).length, oi = e.useCallback(() => {
|
|
1486
|
+
$ && (M.metricFilters ?? []).forEach((e) => {
|
|
1491
1487
|
e && !e.isHiddenInUi && e.datatype !== "date" && (Array.isArray(e.value) ? e.value.length && $(e.name, "", void 0, void 0, []) : e.value && $(e.name, ""));
|
|
1492
1488
|
});
|
|
1493
|
-
}, [$,
|
|
1494
|
-
...
|
|
1489
|
+
}, [$, M.metricFilters]), si = e.useMemo(() => ({
|
|
1490
|
+
...rt,
|
|
1495
1491
|
width: "100%"
|
|
1496
|
-
}), [
|
|
1497
|
-
...
|
|
1498
|
-
filters:
|
|
1499
|
-
}, [
|
|
1492
|
+
}), [rt]), ci = e.useMemo(() => ft && {
|
|
1493
|
+
...ft,
|
|
1494
|
+
filters: ft.filters?.filter((e) => !e?.restrictedMetrics?.some((e) => e.value === j?.id))
|
|
1495
|
+
}, [ft, j?.id]), li = e.useCallback((e) => {
|
|
1500
1496
|
$ && Object.entries(e).forEach(([e, t]) => {
|
|
1501
1497
|
Array.isArray(t) ? $(e, "", void 0, void 0, t.map((e) => ({
|
|
1502
1498
|
value: e,
|
|
@@ -1509,43 +1505,43 @@ var hn = (o) => {
|
|
|
1509
1505
|
endDate: t.endDate
|
|
1510
1506
|
}, void 0, t.timeGrainValue);
|
|
1511
1507
|
}, [$]), di = e.useCallback((e) => {
|
|
1512
|
-
if (
|
|
1508
|
+
if (jn(!!e?.withoutFilters), H(!0), An(!0), Ir(e?.withoutFilters ? [] : e?.pointFilters ?? []), Wn({
|
|
1513
1509
|
limit: 100,
|
|
1514
1510
|
offset: 0
|
|
1515
1511
|
}), Kn(0), Zn(null), K) return;
|
|
1516
|
-
if (!
|
|
1517
|
-
|
|
1512
|
+
if (!N && !F && (!P.length || R)) {
|
|
1513
|
+
Rn([]), H(!1);
|
|
1518
1514
|
return;
|
|
1519
1515
|
}
|
|
1520
1516
|
let t = $n();
|
|
1521
1517
|
Q?.({
|
|
1522
1518
|
columnName: void 0,
|
|
1523
1519
|
value: void 0,
|
|
1524
|
-
isSingleValueChart:
|
|
1525
|
-
setData: t(
|
|
1520
|
+
isSingleValueChart: L?.chartType === r.singleValue,
|
|
1521
|
+
setData: t(Rn),
|
|
1526
1522
|
setLoading: t(H),
|
|
1527
|
-
clientColumnType:
|
|
1523
|
+
clientColumnType: D ?? en,
|
|
1528
1524
|
withoutFilters: !!e?.withoutFilters,
|
|
1529
1525
|
pointFilters: e?.withoutFilters ? void 0 : e?.pointFilters,
|
|
1530
1526
|
onError: t((e) => {
|
|
1531
1527
|
Zn(pe(e, "We couldn't load these rows. Check your connection and try again.")), H(!1);
|
|
1532
1528
|
})
|
|
1533
|
-
}),
|
|
1529
|
+
}), T?.(n, j?.id);
|
|
1534
1530
|
}, [
|
|
1535
1531
|
$n,
|
|
1536
1532
|
Q,
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
M,
|
|
1542
|
-
P,
|
|
1533
|
+
L?.chartType,
|
|
1534
|
+
D,
|
|
1535
|
+
T,
|
|
1536
|
+
j?.id,
|
|
1543
1537
|
N,
|
|
1544
|
-
|
|
1538
|
+
F,
|
|
1539
|
+
P,
|
|
1540
|
+
R,
|
|
1545
1541
|
K
|
|
1546
1542
|
]), fi = !!(Tr && (J.chart?.isEnable || J.chartWithMetric?.isEnable || J.chartWithDashboard?.isEnable)), pi = e.useMemo(() => {
|
|
1547
|
-
if (
|
|
1548
|
-
if (!fi && !G) return
|
|
1543
|
+
if (L?.chartType !== r.singleValue) return;
|
|
1544
|
+
if (!fi && !G) return rn;
|
|
1549
1545
|
let e = (e, t) => {
|
|
1550
1546
|
t === "primary" && fi ? Or(e) : G && di();
|
|
1551
1547
|
};
|
|
@@ -1554,31 +1550,31 @@ var hn = (o) => {
|
|
|
1554
1550
|
contextmenu: (t) => e(t, "secondary")
|
|
1555
1551
|
};
|
|
1556
1552
|
}, [
|
|
1557
|
-
|
|
1553
|
+
L?.chartType,
|
|
1558
1554
|
fi,
|
|
1559
1555
|
Or,
|
|
1560
1556
|
G,
|
|
1561
1557
|
di
|
|
1562
|
-
]), mi = e.useMemo(() => K ? m(
|
|
1558
|
+
]), mi = e.useMemo(() => K ? m(L) : void 0, [K, L]), hi = e.useCallback((e, t) => {
|
|
1563
1559
|
if (!Q) return;
|
|
1564
1560
|
if (Wn({
|
|
1565
1561
|
limit: e.limit,
|
|
1566
1562
|
offset: e.offset
|
|
1567
|
-
}), Zn(null), !
|
|
1568
|
-
|
|
1563
|
+
}), Zn(null), !N && !F && (!P.length || R)) {
|
|
1564
|
+
Rn([]), Kn(0), H(!1);
|
|
1569
1565
|
return;
|
|
1570
1566
|
}
|
|
1571
|
-
let n = t?.withoutFilters ??
|
|
1567
|
+
let n = t?.withoutFilters ?? B, i = t?.pointFilters ?? Y, a = $n();
|
|
1572
1568
|
Q({
|
|
1573
1569
|
pointFilters: n ? void 0 : i,
|
|
1574
1570
|
withoutFilters: n,
|
|
1575
1571
|
columnName: void 0,
|
|
1576
1572
|
value: void 0,
|
|
1577
|
-
isSingleValueChart:
|
|
1578
|
-
setData: a(
|
|
1573
|
+
isSingleValueChart: L?.chartType === r.singleValue,
|
|
1574
|
+
setData: a(Rn),
|
|
1579
1575
|
setLoading: a(H),
|
|
1580
1576
|
setTotalRecords: a(Kn),
|
|
1581
|
-
clientColumnType:
|
|
1577
|
+
clientColumnType: D ?? en,
|
|
1582
1578
|
limit: String(e.limit),
|
|
1583
1579
|
offset: String(e.offset),
|
|
1584
1580
|
search: e.search,
|
|
@@ -1591,16 +1587,16 @@ var hn = (o) => {
|
|
|
1591
1587
|
$n,
|
|
1592
1588
|
Q,
|
|
1593
1589
|
Y,
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
M,
|
|
1598
|
-
P,
|
|
1590
|
+
B,
|
|
1591
|
+
L?.chartType,
|
|
1592
|
+
D,
|
|
1599
1593
|
N,
|
|
1600
|
-
|
|
1594
|
+
F,
|
|
1595
|
+
P,
|
|
1596
|
+
R
|
|
1601
1597
|
]), gi = e.useCallback(() => {
|
|
1602
|
-
if (
|
|
1603
|
-
if (
|
|
1598
|
+
if (En(!0), !G || L?.chartType !== r.singleValue) return;
|
|
1599
|
+
if (jn(!1), Ir([]), Rn([]), Wn({
|
|
1604
1600
|
limit: 100,
|
|
1605
1601
|
offset: 0
|
|
1606
1602
|
}), Kn(0), Zn(null), K) {
|
|
@@ -1613,8 +1609,8 @@ var hn = (o) => {
|
|
|
1613
1609
|
});
|
|
1614
1610
|
return;
|
|
1615
1611
|
}
|
|
1616
|
-
if (!
|
|
1617
|
-
|
|
1612
|
+
if (!N && !F && (!P.length || R)) {
|
|
1613
|
+
Rn([]), H(!1);
|
|
1618
1614
|
return;
|
|
1619
1615
|
}
|
|
1620
1616
|
if (!Q) return;
|
|
@@ -1624,29 +1620,29 @@ var hn = (o) => {
|
|
|
1624
1620
|
columnName: void 0,
|
|
1625
1621
|
value: void 0,
|
|
1626
1622
|
isSingleValueChart: !0,
|
|
1627
|
-
setData: e(
|
|
1623
|
+
setData: e(Rn),
|
|
1628
1624
|
setLoading: e(H),
|
|
1629
|
-
clientColumnType:
|
|
1625
|
+
clientColumnType: D ?? en,
|
|
1630
1626
|
withoutFilters: !1,
|
|
1631
1627
|
pointFilters: void 0,
|
|
1632
1628
|
onError: e((e) => {
|
|
1633
1629
|
Zn(pe(e, "We couldn't load these rows. Check your connection and try again.")), H(!1);
|
|
1634
1630
|
})
|
|
1635
|
-
}),
|
|
1631
|
+
}), T?.(n, j?.id);
|
|
1636
1632
|
}, [
|
|
1637
1633
|
$n,
|
|
1638
1634
|
G,
|
|
1639
|
-
|
|
1635
|
+
L?.chartType,
|
|
1640
1636
|
K,
|
|
1641
1637
|
hi,
|
|
1642
|
-
M,
|
|
1643
|
-
P,
|
|
1644
1638
|
N,
|
|
1645
|
-
|
|
1639
|
+
F,
|
|
1640
|
+
P,
|
|
1641
|
+
R,
|
|
1646
1642
|
Q,
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1643
|
+
D,
|
|
1644
|
+
T,
|
|
1645
|
+
j?.id
|
|
1650
1646
|
]), _i = e.useCallback((e) => new Promise((t, n) => {
|
|
1651
1647
|
if (!Q) {
|
|
1652
1648
|
n(/* @__PURE__ */ Error("Underlying data is not available for this card."));
|
|
@@ -1654,18 +1650,18 @@ var hn = (o) => {
|
|
|
1654
1650
|
}
|
|
1655
1651
|
let i = [], a = !1;
|
|
1656
1652
|
Q({
|
|
1657
|
-
pointFilters:
|
|
1658
|
-
withoutFilters:
|
|
1653
|
+
pointFilters: B ? void 0 : Y,
|
|
1654
|
+
withoutFilters: B,
|
|
1659
1655
|
columnName: void 0,
|
|
1660
1656
|
value: void 0,
|
|
1661
|
-
isSingleValueChart:
|
|
1657
|
+
isSingleValueChart: L?.chartType === r.singleValue,
|
|
1662
1658
|
setData: (e) => {
|
|
1663
1659
|
i = Array.isArray(e) ? Vn(e) : [];
|
|
1664
1660
|
},
|
|
1665
1661
|
setLoading: (e) => {
|
|
1666
1662
|
e || (a ? n(/* @__PURE__ */ Error("Underlying data request failed.")) : t(i));
|
|
1667
1663
|
},
|
|
1668
|
-
clientColumnType:
|
|
1664
|
+
clientColumnType: D ?? en,
|
|
1669
1665
|
limit: String(e.limit),
|
|
1670
1666
|
offset: String(e.offset),
|
|
1671
1667
|
search: e.search,
|
|
@@ -1677,13 +1673,13 @@ var hn = (o) => {
|
|
|
1677
1673
|
}), [
|
|
1678
1674
|
Q,
|
|
1679
1675
|
Y,
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1676
|
+
B,
|
|
1677
|
+
L?.chartType,
|
|
1678
|
+
D,
|
|
1683
1679
|
Vn
|
|
1684
1680
|
]), vi = e.useCallback(async (e) => {
|
|
1685
1681
|
if (!Q || Yn.current) return;
|
|
1686
|
-
Yn.current = !0,
|
|
1682
|
+
Yn.current = !0, V(null), Jn({
|
|
1687
1683
|
isRunning: !0,
|
|
1688
1684
|
fetchedRows: 0
|
|
1689
1685
|
});
|
|
@@ -1691,7 +1687,7 @@ var hn = (o) => {
|
|
|
1691
1687
|
try {
|
|
1692
1688
|
for (;;) {
|
|
1693
1689
|
let n = await _i({
|
|
1694
|
-
limit:
|
|
1690
|
+
limit: nn,
|
|
1695
1691
|
offset: r,
|
|
1696
1692
|
search: e.search,
|
|
1697
1693
|
searchColumns: e.searchColumns
|
|
@@ -1700,16 +1696,16 @@ var hn = (o) => {
|
|
|
1700
1696
|
if (Jn({
|
|
1701
1697
|
isRunning: !0,
|
|
1702
1698
|
fetchedRows: t.length
|
|
1703
|
-
}), n.length <
|
|
1704
|
-
if (t.length >=
|
|
1699
|
+
}), n.length < nn || e.total > 0 && t.length >= e.total) break;
|
|
1700
|
+
if (t.length >= an) {
|
|
1705
1701
|
i = !0;
|
|
1706
1702
|
break;
|
|
1707
1703
|
}
|
|
1708
|
-
r +=
|
|
1704
|
+
r += nn;
|
|
1709
1705
|
}
|
|
1710
|
-
|
|
1706
|
+
on(t, `${Z}.csv`), T?.(n, j?.id), i && V(`This export stopped at the first ${an.toLocaleString()} rows. Narrow the metric or use a scheduled report for the full result.`);
|
|
1711
1707
|
} catch (e) {
|
|
1712
|
-
|
|
1708
|
+
V(pe(e, "We couldn't download every row. Check your connection and try again, or download this page instead.").text);
|
|
1713
1709
|
} finally {
|
|
1714
1710
|
Yn.current = !1, Jn({
|
|
1715
1711
|
isRunning: !1,
|
|
@@ -1720,8 +1716,8 @@ var hn = (o) => {
|
|
|
1720
1716
|
Q,
|
|
1721
1717
|
_i,
|
|
1722
1718
|
Z,
|
|
1723
|
-
|
|
1724
|
-
|
|
1719
|
+
T,
|
|
1720
|
+
j?.id
|
|
1725
1721
|
]), yi = e.useMemo(() => se({
|
|
1726
1722
|
position: mr,
|
|
1727
1723
|
hasAuthoredNextLevel: wr === "drill",
|
|
@@ -1729,7 +1725,7 @@ var hn = (o) => {
|
|
|
1729
1725
|
clickActions: J,
|
|
1730
1726
|
canViewUnderlyingData: G,
|
|
1731
1727
|
canDrillIntoAnyDimension: W,
|
|
1732
|
-
resultState:
|
|
1728
|
+
resultState: F ? "failed" : P?.length ? "ok" : "empty"
|
|
1733
1729
|
}), [
|
|
1734
1730
|
mr,
|
|
1735
1731
|
wr,
|
|
@@ -1737,108 +1733,108 @@ var hn = (o) => {
|
|
|
1737
1733
|
_r,
|
|
1738
1734
|
J,
|
|
1739
1735
|
G,
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
]), bi = !!(
|
|
1736
|
+
F,
|
|
1737
|
+
P
|
|
1738
|
+
]), bi = !!(We && Ge), xi = !!o.isInternalApp && !!o.isInternalDashboardCard && !o.disableActions, Si = xi ? o.onDashboardMetricArchive : void 0, Ci = xi ? o.onDashboardMetricDelete : void 0, wi = !!(Ot && At && !kt), Ti = W && wr !== "terminal" ? /* @__PURE__ */ k(qt, {
|
|
1743
1739
|
pool: _r,
|
|
1744
1740
|
testIdPrefix: "metric-card-options-drill",
|
|
1745
1741
|
gestureHint: vr ? "Right-click chart" : void 0,
|
|
1746
1742
|
onDrillInto: (e) => {
|
|
1747
1743
|
yr?.({ dimension: e.column });
|
|
1748
1744
|
}
|
|
1749
|
-
}) : void 0, Ei = /* @__PURE__ */
|
|
1745
|
+
}) : void 0, Ei = /* @__PURE__ */ k(Pt, {
|
|
1750
1746
|
flags: rr,
|
|
1751
|
-
optionsIcon:
|
|
1752
|
-
settingsIcon:
|
|
1753
|
-
onDownloadCsv:
|
|
1754
|
-
onDownloadPng:
|
|
1755
|
-
onEmailCsv:
|
|
1747
|
+
optionsIcon: pn(ke),
|
|
1748
|
+
settingsIcon: pn(Ae),
|
|
1749
|
+
onDownloadCsv: Ne ? (e) => e?.withoutFilters ? ti() : $r() : void 0,
|
|
1750
|
+
onDownloadPng: Fe ? void 0 : Qr,
|
|
1751
|
+
onEmailCsv: w ? () => w() : void 0,
|
|
1756
1752
|
onFullscreen: ir ? gi : void 0,
|
|
1757
1753
|
onUnderlyingData: G ? di : void 0,
|
|
1758
|
-
onSettings: bi ? () =>
|
|
1754
|
+
onSettings: bi ? () => Ge?.(j) : void 0,
|
|
1759
1755
|
onArchive: Si,
|
|
1760
1756
|
onDelete: Ci,
|
|
1761
1757
|
splitBySubmenu: Ti
|
|
1762
|
-
}), Di = /* @__PURE__ */
|
|
1758
|
+
}), Di = /* @__PURE__ */ A("span", {
|
|
1763
1759
|
"data-testid": "metric-card-filter-slot",
|
|
1764
1760
|
className: "flex items-center gap-1",
|
|
1765
1761
|
children: [
|
|
1766
|
-
ni.map((e) => /* @__PURE__ */
|
|
1767
|
-
defaultOption:
|
|
1762
|
+
ni.map((e) => /* @__PURE__ */ k(Gt, {
|
|
1763
|
+
defaultOption: fn(e),
|
|
1768
1764
|
onChange: ui(String(e.name)),
|
|
1769
|
-
hideDatePickerOptions:
|
|
1770
|
-
calendarType:
|
|
1765
|
+
hideDatePickerOptions: nt,
|
|
1766
|
+
calendarType: pt
|
|
1771
1767
|
}, String(e.name))),
|
|
1772
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ k(Zt, {
|
|
1773
1769
|
filters: ri,
|
|
1774
1770
|
onChange: li,
|
|
1775
|
-
position:
|
|
1776
|
-
multi:
|
|
1771
|
+
position: et,
|
|
1772
|
+
multi: tt,
|
|
1777
1773
|
childActiveCount: ai,
|
|
1778
|
-
className:
|
|
1774
|
+
className: O(un, "data-[state=open]:opacity-100"),
|
|
1779
1775
|
onClearAll: $ ? oi : void 0,
|
|
1780
|
-
children: ii.length ? ii.map((e) => /* @__PURE__ */
|
|
1781
|
-
externalMetricId:
|
|
1782
|
-
encryptedClientId:
|
|
1783
|
-
isFrontendApp: !!
|
|
1784
|
-
token:
|
|
1785
|
-
defaultFilter:
|
|
1776
|
+
children: ii.length ? ii.map((e) => /* @__PURE__ */ k(fe, {
|
|
1777
|
+
externalMetricId: j?.rlsConditions?.length ? j?.id : void 0,
|
|
1778
|
+
encryptedClientId: it ? Vt || "" : Rt || "",
|
|
1779
|
+
isFrontendApp: !!it,
|
|
1780
|
+
token: at || "",
|
|
1781
|
+
defaultFilter: M.savedMetricFilters?.find((t) => t.name === e.name),
|
|
1786
1782
|
globalFilters: ci,
|
|
1787
|
-
datasourceId:
|
|
1788
|
-
isAllClient:
|
|
1789
|
-
hideDatePickerOptions:
|
|
1783
|
+
datasourceId: ot || "",
|
|
1784
|
+
isAllClient: st,
|
|
1785
|
+
hideDatePickerOptions: nt,
|
|
1790
1786
|
dropdownTheme: si,
|
|
1791
|
-
workspaceId:
|
|
1787
|
+
workspaceId: ct || "",
|
|
1792
1788
|
rlsConditions: e,
|
|
1793
1789
|
onChangeFilterValue: $,
|
|
1794
|
-
clientId:
|
|
1795
|
-
rlsConditionList:
|
|
1796
|
-
tenancyLevel:
|
|
1797
|
-
clientColumnType:
|
|
1790
|
+
clientId: Rt,
|
|
1791
|
+
rlsConditionList: M.rlsConditions ?? [],
|
|
1792
|
+
tenancyLevel: Bt,
|
|
1793
|
+
clientColumnType: D
|
|
1798
1794
|
}, String(e.name))) : null
|
|
1799
1795
|
}),
|
|
1800
|
-
wi ? /* @__PURE__ */
|
|
1796
|
+
wi ? /* @__PURE__ */ k(E, {
|
|
1801
1797
|
type: "button",
|
|
1802
1798
|
variant: "outline",
|
|
1803
1799
|
size: "icon-sm",
|
|
1804
1800
|
"aria-label": "Merge metrics",
|
|
1805
1801
|
"data-testid": "metric-card-merge",
|
|
1806
|
-
onClick: () =>
|
|
1802
|
+
onClick: () => At?.({
|
|
1807
1803
|
isOpen: !0,
|
|
1808
|
-
chartOptions:
|
|
1809
|
-
id:
|
|
1804
|
+
chartOptions: L,
|
|
1805
|
+
id: j?.id
|
|
1810
1806
|
}),
|
|
1811
|
-
children: /* @__PURE__ */
|
|
1807
|
+
children: /* @__PURE__ */ k(_t, { "aria-hidden": "true" })
|
|
1812
1808
|
}) : null,
|
|
1813
|
-
ir ? /* @__PURE__ */
|
|
1809
|
+
ir ? /* @__PURE__ */ k(E, {
|
|
1814
1810
|
type: "button",
|
|
1815
1811
|
variant: "ghost",
|
|
1816
1812
|
size: "icon-sm",
|
|
1817
|
-
className:
|
|
1813
|
+
className: O("size-8", un),
|
|
1818
1814
|
"aria-label": "Fullscreen",
|
|
1819
1815
|
title: "Fullscreen",
|
|
1820
1816
|
"data-testid": "metric-card-fullscreen",
|
|
1821
1817
|
onClick: gi,
|
|
1822
|
-
children: /* @__PURE__ */
|
|
1818
|
+
children: /* @__PURE__ */ k(De, { "aria-hidden": "true" })
|
|
1823
1819
|
}) : null,
|
|
1824
1820
|
Ei
|
|
1825
1821
|
]
|
|
1826
|
-
}), Oi = !!
|
|
1822
|
+
}), Oi = !!M.isExternalChart, ki = L?.tableSettings, Ai = L?.chartType === r.table && ki?.disablePagination !== !0, ji = Number(ki?.defaultRowSize) || 100, Mi = L?.chartType === r.table && !!ki?.enableTableSearch, Ni = e.useMemo(() => {
|
|
1827
1823
|
if (!Xr || !(or || Ai)) return;
|
|
1828
1824
|
if (!Oi) return {
|
|
1829
1825
|
mode: "client",
|
|
1830
1826
|
pageSize: ji,
|
|
1831
1827
|
autoPageAbove: ji
|
|
1832
1828
|
};
|
|
1833
|
-
let e =
|
|
1829
|
+
let e = M.paginationInfo;
|
|
1834
1830
|
return {
|
|
1835
1831
|
mode: "server",
|
|
1836
1832
|
limit: e?.limit || 100,
|
|
1837
1833
|
offset: e?.offset || 0,
|
|
1838
1834
|
totalRows: e?.totalRecords || 0,
|
|
1839
|
-
onChangePage:
|
|
1840
|
-
isEnableNextBtn: !!
|
|
1841
|
-
isEnablePrevBtn: !!
|
|
1835
|
+
onChangePage: M.onChangePage,
|
|
1836
|
+
isEnableNextBtn: !!M.isEnableNextBtn,
|
|
1837
|
+
isEnablePrevBtn: !!M.isEnablePrevBtn
|
|
1842
1838
|
};
|
|
1843
1839
|
}, [
|
|
1844
1840
|
or,
|
|
@@ -1846,10 +1842,10 @@ var hn = (o) => {
|
|
|
1846
1842
|
ji,
|
|
1847
1843
|
Xr,
|
|
1848
1844
|
Oi,
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1845
|
+
M.paginationInfo,
|
|
1846
|
+
M.onChangePage,
|
|
1847
|
+
M.isEnableNextBtn,
|
|
1848
|
+
M.isEnablePrevBtn
|
|
1853
1849
|
]), Pi = e.useMemo(() => {
|
|
1854
1850
|
if (K) return {
|
|
1855
1851
|
mode: "server",
|
|
@@ -1873,52 +1869,52 @@ var hn = (o) => {
|
|
|
1873
1869
|
U.offset,
|
|
1874
1870
|
Gn,
|
|
1875
1871
|
hi
|
|
1876
|
-
]), Fi = !
|
|
1872
|
+
]), Fi = !N && !F && (!P.length || R), Ii = (e) => {
|
|
1877
1873
|
let t = e?.value;
|
|
1878
1874
|
return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim() !== "" : t != null;
|
|
1879
|
-
}, Li = (
|
|
1880
|
-
isCustomSqlMetric: !!
|
|
1881
|
-
query:
|
|
1882
|
-
metricId:
|
|
1875
|
+
}, Li = (M.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && Ii(e)), Ri = Li.length > 0 || !!o.globalFilters?.filters?.length || !!o.crossDashboardFilters?.length || (M.rlsConditions ?? []).some((e) => e.isAppFilter && e.isAddOnMetrics && Ii({ value: o.appFilters?.values?.[e.name] ?? e.value })), zi = ve({
|
|
1876
|
+
isCustomSqlMetric: !!j?.datasetMetricSettings?.isUseRawSQL,
|
|
1877
|
+
query: j?.query,
|
|
1878
|
+
metricId: j?.id,
|
|
1883
1879
|
filters: [...Li, ...o.globalFilters?.filters || []]
|
|
1884
1880
|
}), Bi = e.useCallback(() => {
|
|
1885
1881
|
$ && Li.forEach((e) => {
|
|
1886
1882
|
Array.isArray(e.value) ? $(e.name, "", void 0, void 0, []) : $(e.name, "");
|
|
1887
|
-
}),
|
|
1883
|
+
}), Dt?.(), M.refetchMetricData();
|
|
1888
1884
|
}, [
|
|
1889
1885
|
$,
|
|
1890
1886
|
Li,
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
]), Vi = !!$ && Li.length > 0 || !!
|
|
1887
|
+
Dt,
|
|
1888
|
+
M.refetchMetricData
|
|
1889
|
+
]), Vi = !!$ && Li.length > 0 || !!Dt, Hi = Ct === !0 || d() && Ct !== !1, Ui = Se({
|
|
1894
1890
|
kind: "none",
|
|
1895
1891
|
reason: "empty-result"
|
|
1896
|
-
}), Wi = X.length > 0 ? /* @__PURE__ */
|
|
1892
|
+
}), Wi = X.length > 0 ? /* @__PURE__ */ k("div", {
|
|
1897
1893
|
"data-testid": "card-drill-empty-state",
|
|
1898
1894
|
"data-slot": "metric-card-drill-empty",
|
|
1899
1895
|
className: "flex min-h-0 w-full flex-1 flex-col",
|
|
1900
|
-
children: /* @__PURE__ */
|
|
1896
|
+
children: /* @__PURE__ */ k(qe, {
|
|
1901
1897
|
hasActiveFilters: Ri,
|
|
1902
|
-
noDataImg:
|
|
1903
|
-
noDataFoundSvg:
|
|
1898
|
+
noDataImg: je,
|
|
1899
|
+
noDataFoundSvg: Me,
|
|
1904
1900
|
message: `${Ui.title}. ${Ui.body}`,
|
|
1905
|
-
...
|
|
1901
|
+
...xn
|
|
1906
1902
|
})
|
|
1907
|
-
}) : Hi ? /* @__PURE__ */
|
|
1903
|
+
}) : Hi ? /* @__PURE__ */ k(qe, {
|
|
1908
1904
|
hasActiveFilters: Ri,
|
|
1909
|
-
noDataImg:
|
|
1910
|
-
noDataFoundSvg:
|
|
1911
|
-
message:
|
|
1912
|
-
action: Ri && Vi ? /* @__PURE__ */
|
|
1905
|
+
noDataImg: je,
|
|
1906
|
+
noDataFoundSvg: Me,
|
|
1907
|
+
message: bn,
|
|
1908
|
+
action: Ri && Vi ? /* @__PURE__ */ k(E, {
|
|
1913
1909
|
type: "button",
|
|
1914
1910
|
"data-testid": "card-clear-filters",
|
|
1915
1911
|
variant: "outline",
|
|
1916
1912
|
size: "sm",
|
|
1917
1913
|
onClick: Bi,
|
|
1918
|
-
children:
|
|
1914
|
+
children: Dt ? "Clear all filters" : "Clear card filters"
|
|
1919
1915
|
}) : void 0,
|
|
1920
|
-
...
|
|
1921
|
-
}) : null, Gi = !!Ni && Ni.mode === "server" && !!
|
|
1916
|
+
...xn
|
|
1917
|
+
}) : null, Gi = !!Ni && Ni.mode === "server" && !!N && !F && P.length > 0, Ki = (W || nr) && X.length ? /* @__PURE__ */ k(jt, {
|
|
1922
1918
|
crumbs: X,
|
|
1923
1919
|
onDrillLevelClick: (e) => {
|
|
1924
1920
|
br?.(e);
|
|
@@ -1929,89 +1925,89 @@ var hn = (o) => {
|
|
|
1929
1925
|
onResetDrill: () => {
|
|
1930
1926
|
br?.("", !0);
|
|
1931
1927
|
}
|
|
1932
|
-
}) : void 0, qi =
|
|
1928
|
+
}) : void 0, qi = N && !Gi, Ji = Fi && X.length > 0, Yi = qi || Ji ? void 0 : M.drillBlockedNotice ? /* @__PURE__ */ k("span", {
|
|
1933
1929
|
className: "text-caption text-(--muted-foreground)",
|
|
1934
1930
|
"data-testid": "metric-card-drill-blocked-notice",
|
|
1935
1931
|
"data-reason": "blank-value",
|
|
1936
|
-
children:
|
|
1937
|
-
}) : X.length && yi.kind === "none" ? /* @__PURE__ */
|
|
1932
|
+
children: M.drillBlockedNotice.title
|
|
1933
|
+
}) : X.length && yi.kind === "none" ? /* @__PURE__ */ k("span", {
|
|
1938
1934
|
className: "text-caption text-(--muted-foreground)",
|
|
1939
1935
|
"data-testid": "metric-card-terminal-notice",
|
|
1940
1936
|
"data-reason": yi.reason,
|
|
1941
1937
|
children: Se(yi).title
|
|
1942
|
-
}) : void 0, Xi = Ki != null || Yi != null ? /* @__PURE__ */
|
|
1938
|
+
}) : void 0, Xi = Ki != null || Yi != null ? /* @__PURE__ */ A("div", {
|
|
1943
1939
|
"data-testid": "metric-card-drill-breadcrumb",
|
|
1944
1940
|
"data-slot": "metric-card-drill-chrome",
|
|
1945
1941
|
className: "mb-2 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1",
|
|
1946
1942
|
children: [Ki, Yi]
|
|
1947
1943
|
}) : null, Zi;
|
|
1948
|
-
if (
|
|
1944
|
+
if (N && !Gi) Zi = /* @__PURE__ */ k(Ye, {
|
|
1949
1945
|
className: "flex-1",
|
|
1950
1946
|
deadlineMs: re,
|
|
1951
|
-
onRetry: typeof
|
|
1952
|
-
|
|
1953
|
-
} :
|
|
1954
|
-
widgetName: typeof
|
|
1955
|
-
chartType:
|
|
1956
|
-
...
|
|
1947
|
+
onRetry: typeof M.refetchMetricData == "function" ? () => {
|
|
1948
|
+
M.refetchMetricData({ cancelRefetch: !1 });
|
|
1949
|
+
} : mn,
|
|
1950
|
+
widgetName: typeof z == "string" ? z : void 0,
|
|
1951
|
+
chartType: L?.chartType,
|
|
1952
|
+
...xn
|
|
1957
1953
|
});
|
|
1958
|
-
else if (
|
|
1959
|
-
message: c(
|
|
1960
|
-
error: c(
|
|
1961
|
-
widgetName: typeof
|
|
1962
|
-
chartType:
|
|
1963
|
-
onRetry:
|
|
1964
|
-
knownCause:
|
|
1965
|
-
...
|
|
1954
|
+
else if (F) Zi = /* @__PURE__ */ k(Le, {
|
|
1955
|
+
message: c(F) ? cn : void 0,
|
|
1956
|
+
error: c(F) ? void 0 : yn,
|
|
1957
|
+
widgetName: typeof z == "string" ? z : void 0,
|
|
1958
|
+
chartType: L?.chartType,
|
|
1959
|
+
onRetry: cn || yn?.retryable === !1 ? void 0 : mn,
|
|
1960
|
+
knownCause: Ft,
|
|
1961
|
+
...xn
|
|
1966
1962
|
});
|
|
1967
|
-
else if (
|
|
1963
|
+
else if (Ht) Zi = /* @__PURE__ */ k("div", {
|
|
1968
1964
|
"data-testid": "card-join-mismatch-state",
|
|
1969
1965
|
"data-slot": "metric-card-join-mismatch",
|
|
1970
|
-
children: /* @__PURE__ */
|
|
1966
|
+
children: /* @__PURE__ */ k(Le, {
|
|
1971
1967
|
error: t(_e(o.mismatchReason === "column" ? "column" : "join")),
|
|
1972
|
-
...
|
|
1968
|
+
...xn
|
|
1973
1969
|
})
|
|
1974
1970
|
});
|
|
1975
|
-
else if (Fi) Zi = Wi ?? /* @__PURE__ */
|
|
1971
|
+
else if (Fi) Zi = Wi ?? /* @__PURE__ */ k(qe, {
|
|
1976
1972
|
hasActiveFilters: Ri,
|
|
1977
|
-
noDataImg:
|
|
1978
|
-
noDataFoundSvg:
|
|
1979
|
-
message:
|
|
1980
|
-
...
|
|
1973
|
+
noDataImg: je,
|
|
1974
|
+
noDataFoundSvg: Me,
|
|
1975
|
+
message: bn,
|
|
1976
|
+
...xn
|
|
1981
1977
|
});
|
|
1982
1978
|
else {
|
|
1983
|
-
let e = /* @__PURE__ */
|
|
1979
|
+
let e = /* @__PURE__ */ k(Xe, {
|
|
1984
1980
|
hasActiveFilters: Ri,
|
|
1985
1981
|
canOpenDataPointMenu: ar,
|
|
1986
|
-
metric:
|
|
1987
|
-
chartSettings:
|
|
1988
|
-
data:
|
|
1989
|
-
serverTruncation:
|
|
1982
|
+
metric: j,
|
|
1983
|
+
chartSettings: L,
|
|
1984
|
+
data: P,
|
|
1985
|
+
serverTruncation: M.truncation ?? null,
|
|
1990
1986
|
isLoading: !1,
|
|
1991
1987
|
tablePaging: Ni,
|
|
1992
1988
|
tableSearch: Mi,
|
|
1993
1989
|
isTableRefreshing: Gi,
|
|
1994
|
-
enableCoverageTruncation:
|
|
1990
|
+
enableCoverageTruncation: xt,
|
|
1995
1991
|
emptyState: Wi ?? void 0,
|
|
1996
|
-
chartColors:
|
|
1992
|
+
chartColors: wn,
|
|
1997
1993
|
chartRendererType: Ce,
|
|
1998
1994
|
chartAppearance: we,
|
|
1999
1995
|
appearanceOptions: Te,
|
|
2000
|
-
chartColumns:
|
|
2001
|
-
height:
|
|
2002
|
-
width:
|
|
1996
|
+
chartColumns: C,
|
|
1997
|
+
height: Ee,
|
|
1998
|
+
width: Oe,
|
|
2003
1999
|
onEvents: pi ?? Ur,
|
|
2004
2000
|
onTableCellClick: W ? Nr : void 0,
|
|
2005
|
-
onOpenSection: bi ? () =>
|
|
2001
|
+
onOpenSection: bi ? () => Ge?.(j) : void 0,
|
|
2006
2002
|
openSectionLabel: "Edit metric",
|
|
2007
2003
|
onChartReady: (e) => {
|
|
2008
2004
|
Ar.current = e;
|
|
2009
2005
|
}
|
|
2010
2006
|
});
|
|
2011
|
-
Zi = ar ? /* @__PURE__ */
|
|
2007
|
+
Zi = ar ? /* @__PURE__ */ A("div", {
|
|
2012
2008
|
ref: Mr,
|
|
2013
2009
|
className: "relative flex min-h-0 w-full flex-1 flex-col",
|
|
2014
|
-
children: [e, /* @__PURE__ */
|
|
2010
|
+
children: [e, /* @__PURE__ */ k(Jt, {
|
|
2015
2011
|
open: sr.open,
|
|
2016
2012
|
onOpenChange: (e) => {
|
|
2017
2013
|
e || fr();
|
|
@@ -2019,8 +2015,8 @@ var hn = (o) => {
|
|
|
2019
2015
|
anchor: sr.anchor,
|
|
2020
2016
|
point: Fr,
|
|
2021
2017
|
onCopyValue: Rr,
|
|
2022
|
-
onFilterTo: W && (Cr &&
|
|
2023
|
-
canFilterThisMetric: !!Cr && !!
|
|
2018
|
+
onFilterTo: W && (Cr && M.onMetricFiltersChange || Br) ? Hr : void 0,
|
|
2019
|
+
canFilterThisMetric: !!Cr && !!M.onMetricFiltersChange,
|
|
2024
2020
|
canFilterDashboard: Br,
|
|
2025
2021
|
isFilterableColumn: Vr,
|
|
2026
2022
|
canExcludeValues: tr.canExcludeFilterValues,
|
|
@@ -2039,98 +2035,99 @@ var hn = (o) => {
|
|
|
2039
2035
|
})]
|
|
2040
2036
|
}) : e;
|
|
2041
2037
|
}
|
|
2042
|
-
let Qi = !!(
|
|
2043
|
-
return /* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2038
|
+
let Qi = !!(Ue && ir);
|
|
2039
|
+
return /* @__PURE__ */ A(dt, { children: [
|
|
2040
|
+
/* @__PURE__ */ A("div", {
|
|
2045
2041
|
ref: Kr,
|
|
2046
2042
|
"data-testid": "metric-card-v2",
|
|
2047
2043
|
"data-slot": "metric-card",
|
|
2048
|
-
"data-fullscreen-open":
|
|
2049
|
-
"data-download-open":
|
|
2050
|
-
"data-underlying-open":
|
|
2044
|
+
"data-fullscreen-open": Tn || void 0,
|
|
2045
|
+
"data-download-open": Dn || void 0,
|
|
2046
|
+
"data-underlying-open": kn || void 0,
|
|
2051
2047
|
"data-title-click-fullscreen": Qi ? "" : void 0,
|
|
2052
|
-
className:
|
|
2048
|
+
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", $e),
|
|
2053
2049
|
children: [
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
title:
|
|
2056
|
-
description:
|
|
2050
|
+
/* @__PURE__ */ k(Nt, {
|
|
2051
|
+
title: z,
|
|
2052
|
+
description: hn,
|
|
2057
2053
|
isDisableCardTitle: h,
|
|
2058
|
-
infoContent:
|
|
2054
|
+
infoContent: vn,
|
|
2059
2055
|
actions: Di,
|
|
2060
2056
|
onTitleClick: Qi ? gi : void 0
|
|
2061
2057
|
}),
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
className:
|
|
2064
|
-
"aria-busy":
|
|
2058
|
+
/* @__PURE__ */ A("div", {
|
|
2059
|
+
className: O("flex min-h-0 w-full flex-1 flex-col", Kt && "relative opacity-60 transition-opacity motion-reduce:transition-none"),
|
|
2060
|
+
"aria-busy": Kt || void 0,
|
|
2065
2061
|
children: [
|
|
2066
|
-
|
|
2062
|
+
Kt ? /* @__PURE__ */ k("div", {
|
|
2067
2063
|
"data-testid": "metric-card-updating",
|
|
2068
2064
|
"aria-hidden": "true",
|
|
2069
2065
|
className: "pointer-events-none absolute inset-x-0 top-0 z-2 h-0.5 animate-pulse bg-(--primary) motion-reduce:animate-none"
|
|
2070
2066
|
}) : null,
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
|
|
2067
|
+
/* @__PURE__ */ k(he, { text: zi }),
|
|
2068
|
+
M.filterNotAppliedNotice ? /* @__PURE__ */ k("div", {
|
|
2073
2069
|
role: "status",
|
|
2074
2070
|
className: "mb-2 text-caption text-(--muted-foreground)",
|
|
2075
2071
|
"data-testid": "metric-card-filter-not-applied-notice",
|
|
2076
|
-
children:
|
|
2072
|
+
children: M.filterNotAppliedNotice
|
|
2077
2073
|
}) : null,
|
|
2078
2074
|
Xi,
|
|
2079
2075
|
Zi
|
|
2080
2076
|
]
|
|
2081
2077
|
}),
|
|
2082
|
-
|
|
2078
|
+
Mn ? /* @__PURE__ */ A("div", {
|
|
2083
2079
|
role: "alert",
|
|
2084
2080
|
"data-testid": "card-download-error",
|
|
2085
2081
|
"data-slot": "metric-card-download-error",
|
|
2086
2082
|
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)",
|
|
2087
2083
|
children: [
|
|
2088
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ k(ie, {
|
|
2089
2085
|
className: "size-3.5 shrink-0",
|
|
2090
2086
|
"aria-hidden": "true"
|
|
2091
2087
|
}),
|
|
2092
|
-
/* @__PURE__ */
|
|
2088
|
+
/* @__PURE__ */ k("span", {
|
|
2093
2089
|
className: "flex-1",
|
|
2094
|
-
children:
|
|
2090
|
+
children: Mn
|
|
2095
2091
|
}),
|
|
2096
|
-
/* @__PURE__ */
|
|
2092
|
+
/* @__PURE__ */ k(E, {
|
|
2097
2093
|
type: "button",
|
|
2098
2094
|
variant: "ghost",
|
|
2099
2095
|
size: "icon-xs",
|
|
2100
2096
|
"aria-label": "Dismiss",
|
|
2101
2097
|
"data-testid": "card-download-error-dismiss",
|
|
2102
2098
|
className: "text-(--destructive) hover:bg-(--destructive)/15 hover:text-(--destructive)",
|
|
2103
|
-
onClick:
|
|
2104
|
-
children: /* @__PURE__ */
|
|
2099
|
+
onClick: Nn,
|
|
2100
|
+
children: /* @__PURE__ */ k(lt, { "aria-hidden": "true" })
|
|
2105
2101
|
})
|
|
2106
2102
|
]
|
|
2107
2103
|
}) : null,
|
|
2108
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ k(Mt, { longDescription: _n })
|
|
2109
2105
|
]
|
|
2110
2106
|
}),
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
open:
|
|
2113
|
-
onOpenChange:
|
|
2107
|
+
/* @__PURE__ */ k(Yt, {
|
|
2108
|
+
open: Dn,
|
|
2109
|
+
onOpenChange: On,
|
|
2114
2110
|
rows: Yr,
|
|
2115
2111
|
onDownload: ei,
|
|
2116
|
-
onEmail:
|
|
2112
|
+
onEmail: w ? () => w() : void 0
|
|
2117
2113
|
}),
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
hasActiveFilters: !
|
|
2120
|
-
open:
|
|
2121
|
-
onOpenChange:
|
|
2114
|
+
/* @__PURE__ */ k(He, {
|
|
2115
|
+
hasActiveFilters: !B && Ri,
|
|
2116
|
+
open: kn,
|
|
2117
|
+
onOpenChange: An,
|
|
2122
2118
|
title: Jr,
|
|
2119
|
+
description: Bn ? "Only columns used by this KPI are included in this table and its filtered download." : void 0,
|
|
2123
2120
|
columns: Un,
|
|
2124
2121
|
rows: Hn,
|
|
2125
2122
|
error: Xn?.text ?? null,
|
|
2126
2123
|
isRefused: Xn?.isRefusal ?? !1,
|
|
2127
2124
|
isLoading: zn,
|
|
2128
|
-
onDownloadRaw: rr.disableDownloadUnderlyingDataNoFilters ||
|
|
2129
|
-
isDownloadingRaw:
|
|
2130
|
-
downloadError:
|
|
2125
|
+
onDownloadRaw: rr.disableDownloadUnderlyingDataNoFilters || B ? void 0 : () => ti({ pointFilters: Y }),
|
|
2126
|
+
isDownloadingRaw: Fn,
|
|
2127
|
+
downloadError: kn ? Mn : null,
|
|
2131
2128
|
presentation: K ? {
|
|
2132
|
-
selectedDims:
|
|
2133
|
-
selectedMetrics:
|
|
2129
|
+
selectedDims: j?.datasetMetricSettings?.newDatasetSettings?.selectedDims,
|
|
2130
|
+
selectedMetrics: j?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics,
|
|
2134
2131
|
measureFormatter: mi,
|
|
2135
2132
|
scope: Lr,
|
|
2136
2133
|
isLoading: zn,
|
|
@@ -2142,8 +2139,8 @@ var hn = (o) => {
|
|
|
2142
2139
|
totalRows: Gn,
|
|
2143
2140
|
onRequestPage: hi,
|
|
2144
2141
|
canSearch: oe({
|
|
2145
|
-
language:
|
|
2146
|
-
translationDictionary:
|
|
2142
|
+
language: Je,
|
|
2143
|
+
translationDictionary: Ze
|
|
2147
2144
|
})
|
|
2148
2145
|
}
|
|
2149
2146
|
} : void 0,
|
|
@@ -2151,25 +2148,25 @@ var hn = (o) => {
|
|
|
2151
2148
|
onDownloadAll: K ? vi : void 0,
|
|
2152
2149
|
downloadAllState: qn
|
|
2153
2150
|
}),
|
|
2154
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ k(Xt, {
|
|
2155
2152
|
hasActiveFilters: Ri,
|
|
2156
|
-
open:
|
|
2157
|
-
onOpenChange:
|
|
2158
|
-
metric:
|
|
2159
|
-
chartSettings:
|
|
2160
|
-
data:
|
|
2161
|
-
chartColors:
|
|
2153
|
+
open: Tn,
|
|
2154
|
+
onOpenChange: En,
|
|
2155
|
+
metric: j,
|
|
2156
|
+
chartSettings: L,
|
|
2157
|
+
data: P,
|
|
2158
|
+
chartColors: wn,
|
|
2162
2159
|
chartAppearance: we,
|
|
2163
2160
|
chartRendererType: Ce,
|
|
2164
|
-
title:
|
|
2165
|
-
isLoading:
|
|
2166
|
-
error:
|
|
2167
|
-
isJoinMismatch: !!
|
|
2168
|
-
onRetry:
|
|
2169
|
-
copyProps:
|
|
2161
|
+
title: z,
|
|
2162
|
+
isLoading: N && !Gi,
|
|
2163
|
+
error: F,
|
|
2164
|
+
isJoinMismatch: !!Ht,
|
|
2165
|
+
onRetry: mn,
|
|
2166
|
+
copyProps: xn,
|
|
2170
2167
|
tablePaging: Ni,
|
|
2171
2168
|
tableSearch: Mi,
|
|
2172
|
-
underlyingData: G &&
|
|
2169
|
+
underlyingData: G && L?.chartType === r.singleValue ? {
|
|
2173
2170
|
rows: Hn,
|
|
2174
2171
|
columns: Un,
|
|
2175
2172
|
isLoading: zn,
|
|
@@ -2180,4 +2177,4 @@ var hn = (o) => {
|
|
|
2180
2177
|
})
|
|
2181
2178
|
] });
|
|
2182
2179
|
};
|
|
2183
|
-
export {
|
|
2180
|
+
export { mn as MetricCardV2, mn as default };
|