@databrainhq/plugin 0.17.9-beta.30 → 0.17.9-beta.31
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-D3DbH3Cx.mjs → Accordion-BhLebRAm.mjs} +32 -25
- package/dist/{Chart-7AGA9h2g.mjs → Chart-BLXiGOie.mjs} +361 -361
- package/dist/{CreateGlobalFilter-oHjA0P9O.mjs → CreateGlobalFilter-DJ75cI8r.mjs} +200 -200
- package/dist/{CreateMetricV2-BGDt9B3L.mjs → CreateMetricV2-DNSbMIqg.mjs} +20 -20
- package/dist/{DraggableItem-7fQUo0x4.mjs → DraggableItem-HJ4Wt8qx.mjs} +11 -11
- package/dist/{HorizontalStackTable-CH68bWy3.mjs → HorizontalStackTable-DadBH16u.mjs} +17 -17
- package/dist/{ManageMetricsV2-tyQYXoAT.mjs → ManageMetricsV2-DQ0F-Sxo.mjs} +3 -3
- package/dist/{MetricCardV2-C2n6LzkA.mjs → MetricCardV2-ndXX9kcc.mjs} +1251 -1170
- package/dist/{NoDataFound-N3gF0Pse.mjs → NoDataFound-C6lIIOZF.mjs} +1 -1
- package/dist/{NoDataState-C6hX-CHr.mjs → NoDataState-Dx5ksEt-.mjs} +2 -2
- package/dist/{Panel-BeWefwKs.mjs → Panel-oW--_1YF.mjs} +1 -1
- package/dist/{PivotTableV2-De4TXsMc.mjs → PivotTableV2-BufQEGso.mjs} +2 -2
- package/dist/{PivotTableV3-2nzDp4Nc.mjs → PivotTableV3-DwleqfW7.mjs} +4 -4
- package/dist/{Portal-C4N01WKg.mjs → Portal-CuJ3yA9x.mjs} +1222 -1200
- package/dist/{RadioButton-DvzkXfzO.mjs → RadioButton-BagXnWOk.mjs} +1 -1
- package/dist/{ScheduleEmail-PEzbadHC.mjs → ScheduleEmail-C_H0_DNM.mjs} +220 -220
- package/dist/{SearchMetricData-CxmDM20t.mjs → SearchMetricData-DPWkvX0c.mjs} +237 -237
- package/dist/{SortPanel-DQjM_vyk.mjs → SortPanel-DctP-Eyd.mjs} +110 -110
- package/dist/{Table-CvDTChaZ.mjs → Table-BSKvdU4q.mjs} +4 -4
- package/dist/{TagInputField-C9M_Ip9e.mjs → TagInputField-B09tGuSM.mjs} +6 -6
- package/dist/{TextAreaField-Q78INHKO.mjs → TextAreaField-CLmioFXe.mjs} +113 -113
- package/dist/{TimeSeriesSettings-C8lvzgja.mjs → TimeSeriesSettings-BS9LodDk.mjs} +2 -2
- package/dist/{cardQueryError-3MGl4pbM.mjs → cardQueryError-Jo2LkSBF.mjs} +810 -790
- package/dist/{chevron-down-Dxhk-Tao.mjs → chevron-down-CTH4bR6n.mjs} +107 -106
- package/dist/{conditionalFormatting-BuG_4wOq.mjs → conditionalFormatting-BU6BaaPb.mjs} +1 -1
- package/dist/{createGlobalFilter.module-DisUwLsO.mjs → createGlobalFilter.module-Cw_A7yeo.mjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +1 -1
- package/dist/{echarts-BE7AhqVy.mjs → echarts-Dw5Z2Ho-.mjs} +2 -2
- package/dist/{metric.mutation-BRWn1UMi.mjs → metric.mutation-cOoqy5Bi.mjs} +1 -1
- package/dist/{permissions-B5UHxn_4.mjs → permissions-CxZW60Bd.mjs} +289 -261
- package/dist/{pluginV3Request-Dfy8fkbS.mjs → pluginV3Request-CQzo3G0-.mjs} +1 -1
- package/dist/{renderer-qB-6Euan.mjs → renderer-D1fTygev.mjs} +1 -1
- package/dist/{timeseries-Clp-TrGQ.mjs → timeseries-D_nzmvUF.mjs} +1347 -1304
- package/dist/{toTasteAppearance-cIHX7fPm.mjs → toTasteAppearance-C4jy9fG3.mjs} +1 -1
- package/dist/{useGuesTokenUsageLog-BtooXte_.mjs → useGuesTokenUsageLog-BgjAaf3E.mjs} +1 -1
- package/dist/{usePublishArchivedMetrics-CM4KQARj.mjs → usePublishArchivedMetrics-CM7fUNzL.mjs} +2 -2
- package/dist/{useQuery-D3fpbSfw.mjs → useQuery-DhtsBbBi.mjs} +1 -1
- package/dist/webcomponents.css +2 -2
- package/dist/webcomponents.es.js +483 -459
- package/dist/webcomponents.umd.js +153 -153
- package/package.json +1 -1
|
@@ -2,29 +2,29 @@ import "react";
|
|
|
2
2
|
import "react-dom";
|
|
3
3
|
import "react-dom/client";
|
|
4
4
|
import { c as e } from "./cardStates-DiUMQ7_o.mjs";
|
|
5
|
-
import { ht as t } from "./pluginV3Request-
|
|
6
|
-
import { $n as n, Da as r, Fa as i, Hn as a, Ka as o, Qn as s, R as c, Zn as l,
|
|
7
|
-
import { i as x, n as S, r as ee, t as C } from "./toTasteAppearance-
|
|
5
|
+
import { ht as t } from "./pluginV3Request-CQzo3G0-.mjs";
|
|
6
|
+
import { $n as n, Da as r, Fa as i, Hn as a, Ka as o, Qn as s, R as c, Zn as l, dr as u, er as d, fr as f, ir as p, ka as m, lr as h, nr as g, pr as _, rr as v, ur as y, wa as b } from "./Portal-CuJ3yA9x.mjs";
|
|
7
|
+
import { i as x, n as S, r as ee, t as C } from "./toTasteAppearance-C4jy9fG3.mjs";
|
|
8
8
|
import { k as te } from "./option-DX8yNc39.mjs";
|
|
9
9
|
import { r as ne } from "./contrast-CSSalhs_.mjs";
|
|
10
|
-
import { a as w, i as re, n as T, o as E, r as D, s as ie, t as O } from "./chevron-down-
|
|
11
|
-
import {
|
|
10
|
+
import { a as w, i as re, n as T, o as E, r as D, s as ie, t as O } from "./chevron-down-CTH4bR6n.mjs";
|
|
11
|
+
import { g as k, p as A } from "./timeseries-D_nzmvUF.mjs";
|
|
12
12
|
import { n as ae } from "./arrayToCsvString-Cb1t-QbR.mjs";
|
|
13
|
-
import { t as oe } from "./permissions-
|
|
14
|
-
import { $ as se, A as j, B as ce, D as le, E as ue, H as de, O as fe, S as pe, T as me, V as he, W as
|
|
15
|
-
import { n as
|
|
16
|
-
import { t as
|
|
17
|
-
import { t as
|
|
18
|
-
import { B as
|
|
19
|
-
import { C as
|
|
20
|
-
import { n as
|
|
21
|
-
import { t as
|
|
22
|
-
import { n as
|
|
23
|
-
import { a as
|
|
24
|
-
import * as
|
|
25
|
-
import { useLayoutEffect as
|
|
26
|
-
import { Fragment as
|
|
27
|
-
var
|
|
13
|
+
import { t as oe } from "./permissions-CxZW60Bd.mjs";
|
|
14
|
+
import { $ as se, A as j, B as ce, D as le, E as ue, H as de, O as fe, S as pe, T as me, V as he, W as M, _ as ge, a as _e, b as ve, c as ye, d as be, f as N, g as xe, h as Se, j as Ce, k as we, l as Te, n as Ee, o as De, s as Oe, t as P, u as ke, v as Ae, w as je, x as Me, y as Ne } from "./cardQueryError-Jo2LkSBF.mjs";
|
|
15
|
+
import { n as Pe } from "./cardActions-BLBLsjcd.mjs";
|
|
16
|
+
import { t as Fe } from "./loading-state-C-J1F-xq.mjs";
|
|
17
|
+
import { t as F } from "./createLucideIcon-C-N26TaJ.mjs";
|
|
18
|
+
import { B as Ie, C as Le, D as Re, E as ze, F as Be, H as Ve, I, L as He, O as Ue, P as We, R as Ge, S as Ke, T as qe, U as Je, V as Ye, _ as L, a as Xe, b as R, c as Ze, d as Qe, f as $e, g as et, h as tt, i as nt, k as rt, l as it, m as z, n as at, o as ot, p as st, r as B, s as V, t as ct, u as lt, v as ut, w as H, x as dt, z as ft } from "./NoDataState-Dx5ksEt-.mjs";
|
|
19
|
+
import { C as pt, L as mt, M as U, R as ht, a as gt, t as W } from "./qaSelectors-BfSWLSdW.mjs";
|
|
20
|
+
import { n as _t, t as vt } from "./x-DDC7VFx5.mjs";
|
|
21
|
+
import { t as G } from "./dist-C0uxSp1k.mjs";
|
|
22
|
+
import { n as yt, r as bt } from "./ChartCardOverlay-BPnVbfOU.mjs";
|
|
23
|
+
import { a as xt, i as St, n as Ct, o as wt, r as Tt, t as Et } from "./dialog-6bw6aLOP.mjs";
|
|
24
|
+
import * as K from "react";
|
|
25
|
+
import { useLayoutEffect as Dt, useState as Ot } from "react";
|
|
26
|
+
import { Fragment as kt, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
27
|
+
var At = F("copy", [["rect", {
|
|
28
28
|
width: "14",
|
|
29
29
|
height: "14",
|
|
30
30
|
x: "8",
|
|
@@ -35,19 +35,19 @@ var Mt = P("copy", [["rect", {
|
|
|
35
35
|
}], ["path", {
|
|
36
36
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
37
37
|
key: "zix9uf"
|
|
38
|
-
}]]),
|
|
38
|
+
}]]), jt = F("corner-down-right", [["path", {
|
|
39
39
|
d: "m15 10 5 5-5 5",
|
|
40
40
|
key: "qqa56n"
|
|
41
41
|
}], ["path", {
|
|
42
42
|
d: "M4 4v7a4 4 0 0 0 4 4h12",
|
|
43
43
|
key: "z08zvw"
|
|
44
|
-
}]]),
|
|
44
|
+
}]]), Mt = F("corner-left-up", [["path", {
|
|
45
45
|
d: "M14 9 9 4 4 9",
|
|
46
46
|
key: "1af5af"
|
|
47
47
|
}], ["path", {
|
|
48
48
|
d: "M20 20h-7a4 4 0 0 1-4-4V4",
|
|
49
49
|
key: "1blwi3"
|
|
50
|
-
}]]),
|
|
50
|
+
}]]), Y = F("download", [
|
|
51
51
|
["path", {
|
|
52
52
|
d: "M12 15V3",
|
|
53
53
|
key: "m9g1x1"
|
|
@@ -60,7 +60,7 @@ var Mt = P("copy", [["rect", {
|
|
|
60
60
|
d: "m7 10 5 5 5-5",
|
|
61
61
|
key: "brsn70"
|
|
62
62
|
}]
|
|
63
|
-
]),
|
|
63
|
+
]), Nt = F("ellipsis-vertical", [
|
|
64
64
|
["circle", {
|
|
65
65
|
cx: "12",
|
|
66
66
|
cy: "12",
|
|
@@ -79,7 +79,7 @@ var Mt = P("copy", [["rect", {
|
|
|
79
79
|
r: "1",
|
|
80
80
|
key: "lyex9k"
|
|
81
81
|
}]
|
|
82
|
-
]),
|
|
82
|
+
]), Pt = F("git-merge", [
|
|
83
83
|
["circle", {
|
|
84
84
|
cx: "18",
|
|
85
85
|
cy: "18",
|
|
@@ -96,7 +96,7 @@ var Mt = P("copy", [["rect", {
|
|
|
96
96
|
d: "M6 21V9a9 9 0 0 0 9 9",
|
|
97
97
|
key: "7kw0sc"
|
|
98
98
|
}]
|
|
99
|
-
]),
|
|
99
|
+
]), Ft = F("image", [
|
|
100
100
|
["rect", {
|
|
101
101
|
width: "18",
|
|
102
102
|
height: "18",
|
|
@@ -116,7 +116,7 @@ var Mt = P("copy", [["rect", {
|
|
|
116
116
|
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
117
117
|
key: "1xmnt7"
|
|
118
118
|
}]
|
|
119
|
-
]),
|
|
119
|
+
]), It = F("info", [
|
|
120
120
|
["circle", {
|
|
121
121
|
cx: "12",
|
|
122
122
|
cy: "12",
|
|
@@ -131,7 +131,7 @@ var Mt = P("copy", [["rect", {
|
|
|
131
131
|
d: "M12 8h.01",
|
|
132
132
|
key: "e9boi3"
|
|
133
133
|
}]
|
|
134
|
-
]),
|
|
134
|
+
]), Lt = F("mail", [["path", {
|
|
135
135
|
d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",
|
|
136
136
|
key: "132q7q"
|
|
137
137
|
}], ["rect", {
|
|
@@ -141,7 +141,7 @@ var Mt = P("copy", [["rect", {
|
|
|
141
141
|
height: "16",
|
|
142
142
|
rx: "2",
|
|
143
143
|
key: "izxlao"
|
|
144
|
-
}]]),
|
|
144
|
+
}]]), Rt = F("settings", [["path", {
|
|
145
145
|
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",
|
|
146
146
|
key: "1i5ecw"
|
|
147
147
|
}], ["circle", {
|
|
@@ -149,22 +149,22 @@ var Mt = P("copy", [["rect", {
|
|
|
149
149
|
cy: "12",
|
|
150
150
|
r: "3",
|
|
151
151
|
key: "1v7zrd"
|
|
152
|
-
}]]),
|
|
153
|
-
function
|
|
154
|
-
let [t, n] =
|
|
155
|
-
return
|
|
152
|
+
}]]), zt = typeof window < "u" ? K.useLayoutEffect : K.useEffect;
|
|
153
|
+
function Bt(e) {
|
|
154
|
+
let [t, n] = K.useState("full");
|
|
155
|
+
return zt(() => {
|
|
156
156
|
let t = e.current;
|
|
157
157
|
if (!t) return;
|
|
158
|
-
let r = typeof t.closest == "function" ? t.closest(`[${
|
|
158
|
+
let r = typeof t.closest == "function" ? t.closest(`[${yt}]`) : null, i = () => {
|
|
159
159
|
let e = t.getBoundingClientRect(), i = r?.getBoundingClientRect(), a = (e, t) => t !== void 0 && t > 0 && (!(e > 0) || t < e) ? t : e;
|
|
160
|
-
n(
|
|
160
|
+
n(bt(a(e.width, i?.width), a(e.height, i?.height)));
|
|
161
161
|
};
|
|
162
162
|
if (i(), typeof ResizeObserver > "u") return;
|
|
163
163
|
let a = new ResizeObserver(i);
|
|
164
164
|
return a.observe(t), r && a.observe(r), () => a.disconnect();
|
|
165
165
|
}, [e]), t;
|
|
166
166
|
}
|
|
167
|
-
var
|
|
167
|
+
var Vt = {
|
|
168
168
|
columns: "Choose columns",
|
|
169
169
|
configure: "Open Configure",
|
|
170
170
|
appearance: "Open Appearance",
|
|
@@ -172,66 +172,66 @@ var Ut = {
|
|
|
172
172
|
groupBy: "Set Group by",
|
|
173
173
|
filters: "Edit filters",
|
|
174
174
|
geo: "Open Geography"
|
|
175
|
-
},
|
|
176
|
-
let l =
|
|
175
|
+
}, Ht = ({ reason: e, section: t, onOpenSection: n, actionLabel: r, widgetName: i, customMessages: a, translationDictionary: o, selectedLanguage: s, className: c }) => {
|
|
176
|
+
let l = K.useRef(null), u = Bt(l), d = B(e, "empty", e, {
|
|
177
177
|
customMessages: a,
|
|
178
178
|
translationDictionary: o,
|
|
179
179
|
selectedLanguage: s
|
|
180
|
-
}), f =
|
|
181
|
-
if (t) return
|
|
180
|
+
}), f = K.useMemo(() => {
|
|
181
|
+
if (t) return Ut(r ?? Vt[t], o, s);
|
|
182
182
|
}, [
|
|
183
183
|
t,
|
|
184
184
|
r,
|
|
185
185
|
o,
|
|
186
186
|
s
|
|
187
187
|
]), p = !!(t && n && f), m = i ? `${i}: ${d}` : d;
|
|
188
|
-
if (u === "none") return /* @__PURE__ */
|
|
188
|
+
if (u === "none") return /* @__PURE__ */ q("div", {
|
|
189
189
|
ref: l,
|
|
190
190
|
"data-testid": "card-mismatch-state",
|
|
191
191
|
"data-slot": "metric-card-mismatch",
|
|
192
192
|
"data-density": "none",
|
|
193
|
-
className:
|
|
194
|
-
children: /* @__PURE__ */
|
|
193
|
+
className: G("flex min-h-0 w-full flex-1", c),
|
|
194
|
+
children: /* @__PURE__ */ q("span", {
|
|
195
195
|
className: "sr-only",
|
|
196
196
|
children: m
|
|
197
197
|
})
|
|
198
198
|
});
|
|
199
199
|
let h = u === "inline";
|
|
200
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ J("div", {
|
|
201
201
|
ref: l,
|
|
202
202
|
"data-testid": "card-mismatch-state",
|
|
203
203
|
"data-slot": "metric-card-mismatch",
|
|
204
204
|
"data-density": u,
|
|
205
205
|
role: "note",
|
|
206
206
|
"aria-label": m,
|
|
207
|
-
className:
|
|
208
|
-
children: [/* @__PURE__ */
|
|
207
|
+
className: G("flex min-h-0 w-full flex-1 flex-col justify-center gap-2 overflow-hidden", h ? "px-3 py-1.5" : "px-4 py-3", c),
|
|
208
|
+
children: [/* @__PURE__ */ q("p", {
|
|
209
209
|
"data-testid": "card-mismatch-reason",
|
|
210
|
-
className:
|
|
210
|
+
className: G("m-0 text-xs leading-4 text-(--foreground)", h ? "line-clamp-1" : "line-clamp-3"),
|
|
211
211
|
children: d
|
|
212
|
-
}), p && !h ? /* @__PURE__ */
|
|
212
|
+
}), p && !h ? /* @__PURE__ */ q("div", { children: /* @__PURE__ */ q("button", {
|
|
213
213
|
type: "button",
|
|
214
214
|
"data-testid": "card-mismatch-action",
|
|
215
215
|
onClick: () => t && n?.(t),
|
|
216
|
-
className:
|
|
216
|
+
className: G("inline-flex min-h-6 items-center rounded-(--radius-sm) border border-(--border)", "bg-(--background) px-2.5 py-1 text-xs font-medium text-(--foreground)", "hover:bg-(--accent)", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-(--ring) focus-visible:ring-offset-2 focus-visible:ring-offset-(--background)"),
|
|
217
217
|
children: f
|
|
218
218
|
}) }) : null]
|
|
219
219
|
});
|
|
220
220
|
};
|
|
221
|
-
function
|
|
222
|
-
return
|
|
221
|
+
function Ut(e, t, n) {
|
|
222
|
+
return B(e, "empty", e, {
|
|
223
223
|
translationDictionary: t,
|
|
224
224
|
selectedLanguage: n
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
//#endregion
|
|
228
228
|
//#region src/core/metric-builder/chartGesture.ts
|
|
229
|
-
var
|
|
229
|
+
var Wt = (e) => e === "contextmenu" ? "secondary" : "primary", Gt = ({ route: e, canCrossFilter: t }) => !!t && e === "drill", Kt = ({ gesture: e, route: t, canCrossFilter: n, canDrillInto: r, hasPointMenu: i }) => {
|
|
230
230
|
if (t === "terminal") return {
|
|
231
231
|
drillDown: !1,
|
|
232
232
|
adhocMenu: !1
|
|
233
233
|
};
|
|
234
|
-
let a =
|
|
234
|
+
let a = Gt({
|
|
235
235
|
route: t,
|
|
236
236
|
canCrossFilter: n
|
|
237
237
|
}), o = !!r;
|
|
@@ -243,18 +243,18 @@ var Kt = (e) => e === "contextmenu" ? "secondary" : "primary", qt = ({ route: e,
|
|
|
243
243
|
adhocMenu: o && !a
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
|
-
|
|
247
|
-
var
|
|
246
|
+
ge.map((e) => e.value), Object.fromEntries(ge.map((e) => [e.value, e.label]));
|
|
247
|
+
var qt = (e) => {
|
|
248
248
|
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;
|
|
249
249
|
return {
|
|
250
250
|
activeIndex: n,
|
|
251
251
|
currentDepth: r,
|
|
252
252
|
hasDateLevel: i,
|
|
253
|
-
usedAliases:
|
|
253
|
+
usedAliases: ve(a?.dimensions),
|
|
254
254
|
activeLevel: a
|
|
255
255
|
};
|
|
256
|
-
},
|
|
257
|
-
let t =
|
|
256
|
+
}, Jt = (e) => {
|
|
257
|
+
let t = qt(e.config), n = Ae({
|
|
258
258
|
subset: e.subset,
|
|
259
259
|
configuration: e.configuration,
|
|
260
260
|
usedAliases: t.usedAliases,
|
|
@@ -262,11 +262,11 @@ var Yt = (e) => {
|
|
|
262
262
|
hasDateLevel: t.hasDateLevel,
|
|
263
263
|
isCustomSql: e.isCustomSql
|
|
264
264
|
});
|
|
265
|
-
return n.unavailableReason === "custom-sql" || n.groups.length || n.unavailableReason !== "no-subset" ? n :
|
|
265
|
+
return n.unavailableReason === "custom-sql" || n.groups.length || n.unavailableReason !== "no-subset" ? n : Ne({
|
|
266
266
|
selectedDims: e.selectedDims,
|
|
267
267
|
usedAliases: t.usedAliases
|
|
268
268
|
});
|
|
269
|
-
},
|
|
269
|
+
}, Yt = [
|
|
270
270
|
10,
|
|
271
271
|
25,
|
|
272
272
|
50,
|
|
@@ -275,8 +275,8 @@ var Yt = (e) => {
|
|
|
275
275
|
250,
|
|
276
276
|
500,
|
|
277
277
|
1e3
|
|
278
|
-
],
|
|
279
|
-
function
|
|
278
|
+
], Xt = 1e3;
|
|
279
|
+
function Zt(e, t) {
|
|
280
280
|
return !e || e.key !== t ? {
|
|
281
281
|
key: t,
|
|
282
282
|
direction: "asc"
|
|
@@ -285,7 +285,7 @@ function $t(e, t) {
|
|
|
285
285
|
direction: "desc"
|
|
286
286
|
} : null;
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Qt(e, t, n) {
|
|
289
289
|
let r = e == null || e === "", i = t == null || t === "";
|
|
290
290
|
if (r && i) return 0;
|
|
291
291
|
if (r) return 1;
|
|
@@ -296,18 +296,18 @@ function en(e, t, n) {
|
|
|
296
296
|
}
|
|
297
297
|
return String(e).localeCompare(String(t));
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function $t(e, t, n) {
|
|
300
300
|
if (!t || !e?.length) return e;
|
|
301
301
|
let r = n(t.key), i = e.map((e, t) => ({
|
|
302
302
|
row: e,
|
|
303
303
|
index: t
|
|
304
304
|
}));
|
|
305
305
|
return i.sort((e, n) => {
|
|
306
|
-
let i =
|
|
306
|
+
let i = Qt(e.row?.[t.key], n.row?.[t.key], r), a = t.direction === "asc" ? i : -i;
|
|
307
307
|
return a === 0 ? e.index - n.index : a;
|
|
308
308
|
}), i.map((e) => e.row);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function en({ total: e, limit: t, offset: n, renderedRowCount: r }) {
|
|
311
311
|
let i = Math.max(1, Math.floor(t) || 1), a = Math.max(0, Math.floor(e) || 0), o = Math.max(0, Math.floor(n) || 0), s = Math.max(1, Math.ceil(a / i)), c = Math.floor(o / i), l = r === void 0 ? Math.max(0, Math.min(i, a - o)) : Math.max(0, Math.floor(r)), u = a === 0 || l === 0 ? 0 : o + 1, d = u === 0 ? 0 : o + l;
|
|
312
312
|
return {
|
|
313
313
|
from: u,
|
|
@@ -319,55 +319,69 @@ function nn({ total: e, limit: t, offset: n, renderedRowCount: r }) {
|
|
|
319
319
|
isLastPage: d >= a
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function tn(e, t, n) {
|
|
323
323
|
let r = Math.max(1, Math.floor(t) || 1), i = Math.max(0, Math.floor(n) || 0);
|
|
324
324
|
return !e?.length || i === 0 && e.length <= r ? e : e.slice(i, i + r);
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function X({ offset: e, nextLimit: t }) {
|
|
327
327
|
let n = Math.max(1, Math.floor(t) || 1);
|
|
328
328
|
return Math.floor(Math.max(0, Math.floor(e) || 0) / n) * n;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function nn(e) {
|
|
331
331
|
return e === "client";
|
|
332
332
|
}
|
|
333
333
|
//#endregion
|
|
334
334
|
//#region src/charts/cardNotice.ts
|
|
335
|
-
var
|
|
336
|
-
let t = e.truncationFootnote?.trim() || null, n = e.reduction, r = !n || n.kind ===
|
|
335
|
+
var rn = "topN", an = (e = {}) => {
|
|
336
|
+
let t = e.truncationFootnote?.trim() || null, n = e.reduction, r = !n || n.kind === rn && t !== null ? void 0 : s(n, e.rowsIn, { pixelPerfectLine: e.pixelPerfectLine === !0 }), i = [r ? d(r) : void 0, t].filter((e) => typeof e == "string" && e.trim().length > 0);
|
|
337
337
|
return i.length ? i.join(" ") : null;
|
|
338
|
-
},
|
|
339
|
-
function
|
|
338
|
+
}, on = "chartReason", sn = "@app:chartReason";
|
|
339
|
+
function cn(e) {
|
|
340
340
|
try {
|
|
341
|
-
e === null ? window.localStorage.removeItem(
|
|
341
|
+
e === null ? window.localStorage.removeItem(sn) : window.localStorage.setItem(sn, e);
|
|
342
342
|
} catch {}
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function ln() {
|
|
345
345
|
try {
|
|
346
|
-
let e = window.localStorage.getItem(
|
|
346
|
+
let e = window.localStorage.getItem(sn);
|
|
347
347
|
if (e === "on" || e === "off") return e;
|
|
348
348
|
} catch {}
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function un() {
|
|
352
352
|
if (typeof window < "u") try {
|
|
353
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
354
|
-
(e === "on" || e === "off") &&
|
|
353
|
+
let e = new URLSearchParams(window.location.search).get(on);
|
|
354
|
+
(e === "on" || e === "off") && cn(e);
|
|
355
355
|
} catch {}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
return typeof window > "u" ? !1 : (
|
|
357
|
+
function dn() {
|
|
358
|
+
return typeof window > "u" ? !1 : (un(), ln() === "on");
|
|
359
359
|
}
|
|
360
|
-
|
|
360
|
+
un();
|
|
361
361
|
//#endregion
|
|
362
|
-
//#region src/charts/
|
|
363
|
-
var
|
|
362
|
+
//#region src/charts/missingSavedColumns.ts
|
|
363
|
+
var fn = 6, pn = (e) => {
|
|
364
|
+
let t = e.slice(0, fn), n = e.length - t.length;
|
|
365
|
+
return n > 0 ? `${t.join(", ")} and ${n} more` : t.length < 2 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
|
|
366
|
+
}, mn = (e, t) => {
|
|
367
|
+
if (!e || !Array.isArray(t) || !t.length) return null;
|
|
368
|
+
let n = [...new Set([
|
|
369
|
+
...e.yAxisList ?? [],
|
|
370
|
+
e.progressColumn,
|
|
371
|
+
e.singleValue
|
|
372
|
+
].filter((e) => typeof e == "string" && !!e.trim()))];
|
|
373
|
+
if (!n.length) return null;
|
|
374
|
+
let r = /* @__PURE__ */ new Set();
|
|
375
|
+
for (let e of t) if (e) for (let t of Object.keys(e)) r.add(t);
|
|
376
|
+
return !r.size || n.some((e) => r.has(e)) ? null : `This chart reads ${pn(n)}, but the query returns ${pn([...r])}. Pick the columns again in Configure.`;
|
|
377
|
+
}, hn = (e, t, n) => {
|
|
364
378
|
if (!e) return !1;
|
|
365
379
|
let r = ne(e, t, n);
|
|
366
380
|
return r !== null && r < 4.5;
|
|
367
|
-
},
|
|
381
|
+
}, gn = (e, t, n) => {
|
|
368
382
|
let r = e?.tableSettings;
|
|
369
383
|
if (!r || !t) return e;
|
|
370
|
-
let i =
|
|
384
|
+
let i = hn(r.contentColor, t, n), a = hn(r.tableTitleColor, t, n);
|
|
371
385
|
return !i && !a ? e : {
|
|
372
386
|
...e,
|
|
373
387
|
tableSettings: {
|
|
@@ -379,26 +393,26 @@ var mn = (e, t, n) => {
|
|
|
379
393
|
};
|
|
380
394
|
//#endregion
|
|
381
395
|
//#region src/charts/toTruncatedChartData.ts
|
|
382
|
-
function
|
|
396
|
+
function _n(e) {
|
|
383
397
|
let t = e?.trim();
|
|
384
398
|
if (!t || /[A-Z]{2,}/.test(t)) return;
|
|
385
399
|
let n = t.toLowerCase();
|
|
386
400
|
if (!n.endsWith("s")) return /[^aeiou]y$/.test(n) ? `${n.slice(0, -1)}ies` : /(ch|sh|x|z)$/.test(n) ? `${n}es` : `${n}s`;
|
|
387
401
|
}
|
|
388
|
-
function
|
|
402
|
+
function vn(e, t) {
|
|
389
403
|
if (t && e?.length) return e.find((e) => e?.alias === t || e?.name === t);
|
|
390
404
|
}
|
|
391
|
-
function
|
|
392
|
-
let n =
|
|
405
|
+
function yn(e, t) {
|
|
406
|
+
let n = vn(e, t)?.label;
|
|
393
407
|
return typeof n == "string" && n.trim() ? n.trim() : void 0;
|
|
394
408
|
}
|
|
395
|
-
function
|
|
396
|
-
let n =
|
|
409
|
+
function bn(e, t) {
|
|
410
|
+
let n = vn(e, t);
|
|
397
411
|
if (!n) return;
|
|
398
412
|
let r = String(n.datatype ?? n.dataType ?? "");
|
|
399
413
|
return !!(/date|time|timestamp|year|month|week/i.test(r) || n.timeGrain || n.functionConfiguration?.dateFormat);
|
|
400
414
|
}
|
|
401
|
-
function
|
|
415
|
+
function xn(e, t, n, r, i) {
|
|
402
416
|
let a = {
|
|
403
417
|
rows: t,
|
|
404
418
|
collapsedRows: [],
|
|
@@ -410,60 +424,60 @@ function bn(e, t, n, r, i) {
|
|
|
410
424
|
if (!s || o?.isMultiDimension || o?.isDynamicSeries) return a;
|
|
411
425
|
let c = o?.xAxis, l = (o?.yAxisList ?? []).filter(Boolean);
|
|
412
426
|
if (!c || !l.length) return a;
|
|
413
|
-
let d = r?.datasetMetricSettings?.newDatasetSettings, { rows:
|
|
427
|
+
let d = r?.datasetMetricSettings?.newDatasetSettings, { rows: p, collapsedRows: m, summary: h } = u(t, {
|
|
414
428
|
categoryKey: c,
|
|
415
429
|
valueKeys: l,
|
|
416
|
-
maxCategories:
|
|
430
|
+
maxCategories: f(o?.chartType),
|
|
417
431
|
gap: s.gap,
|
|
418
|
-
categoryIsTemporal:
|
|
432
|
+
categoryIsTemporal: bn(d?.selectedDims, c)
|
|
419
433
|
});
|
|
420
434
|
if (!h) return a;
|
|
421
435
|
let g = ce(t);
|
|
422
436
|
return {
|
|
423
|
-
rows:
|
|
437
|
+
rows: p,
|
|
424
438
|
collapsedRows: m,
|
|
425
439
|
summary: h,
|
|
426
|
-
truncated: de(g, "chart-coverage",
|
|
440
|
+
truncated: de(g, "chart-coverage", p.slice(0, h.keptCount)).truncated
|
|
427
441
|
};
|
|
428
442
|
}
|
|
429
|
-
function
|
|
430
|
-
let r = n?.datasetMetricSettings?.newDatasetSettings, i = t, a =
|
|
431
|
-
return
|
|
443
|
+
function Sn(e, t, n) {
|
|
444
|
+
let r = n?.datasetMetricSettings?.newDatasetSettings, i = t, a = _n(yn(r?.selectedDims, i?.xAxis)), o = (i?.yAxisList ?? []).filter(Boolean), s = o.length === 1 ? yn(r?.selectedMetrics, o[0])?.toLowerCase() : void 0;
|
|
445
|
+
return h(e, {
|
|
432
446
|
categoryPlural: a,
|
|
433
447
|
measureLabel: s
|
|
434
448
|
});
|
|
435
449
|
}
|
|
436
450
|
//#endregion
|
|
437
451
|
//#region src/charts/useLegacyChartInk.ts
|
|
438
|
-
var
|
|
452
|
+
var Cn = (e) => !e || e === "transparent" || /rgba\([^)]*,\s*0\s*\)$/.test(e), wn = (e) => /^rgb\(/.test(e) || /rgba\([^)]*,\s*1\s*\)$/.test(e), Tn = (e) => {
|
|
439
453
|
let t;
|
|
440
454
|
for (let n = e; n; n = n.parentElement) {
|
|
441
455
|
let e = getComputedStyle(n).backgroundColor;
|
|
442
|
-
if (!
|
|
456
|
+
if (!Cn(e)) {
|
|
443
457
|
if (!t) {
|
|
444
|
-
if (t = e,
|
|
445
|
-
} else if (
|
|
458
|
+
if (t = e, wn(e)) return { surface: t };
|
|
459
|
+
} else if (wn(e)) return {
|
|
446
460
|
surface: t,
|
|
447
461
|
backdrop: e
|
|
448
462
|
};
|
|
449
463
|
}
|
|
450
464
|
}
|
|
451
465
|
return { surface: t };
|
|
452
|
-
},
|
|
466
|
+
}, En = (e) => {
|
|
453
467
|
let t = getComputedStyle(e), n = t.getPropertyValue("--text-secondary").trim() || t.color, r = t.fontFamily;
|
|
454
468
|
return n ? {
|
|
455
469
|
fontColor: n,
|
|
456
470
|
fontFamily: r,
|
|
457
|
-
...
|
|
471
|
+
...Tn(e)
|
|
458
472
|
} : void 0;
|
|
459
|
-
},
|
|
460
|
-
function
|
|
461
|
-
let [t, n] =
|
|
462
|
-
return
|
|
473
|
+
}, Dn = (e, t) => e?.fontColor === t?.fontColor && e?.fontFamily === t?.fontFamily && e?.surface === t?.surface && e?.backdrop === t?.backdrop;
|
|
474
|
+
function On(e) {
|
|
475
|
+
let [t, n] = Ot(void 0);
|
|
476
|
+
return Dt(() => {
|
|
463
477
|
if (!e) return;
|
|
464
478
|
let t = () => {
|
|
465
|
-
let t =
|
|
466
|
-
n((e) =>
|
|
479
|
+
let t = En(e);
|
|
480
|
+
n((e) => Dn(e, t) ? e : t);
|
|
467
481
|
};
|
|
468
482
|
if (t(), typeof MutationObserver != "function") return;
|
|
469
483
|
let r = new MutationObserver(t);
|
|
@@ -479,10 +493,10 @@ function Dn(e) {
|
|
|
479
493
|
}
|
|
480
494
|
//#endregion
|
|
481
495
|
//#region src/charts/withLegibleLabelInk.ts
|
|
482
|
-
var
|
|
496
|
+
var kn = (e, t) => !t || e?.chartLabelInk?.strategy ? e : {
|
|
483
497
|
...e ?? {},
|
|
484
498
|
chartLabelInk: { strategy: "legible" }
|
|
485
|
-
},
|
|
499
|
+
}, Z = (e, t) => !t || e?.chartLabelOverlap?.strategy ? e : {
|
|
486
500
|
...e ?? {},
|
|
487
501
|
chartLabelOverlap: { strategy: "declutter" }
|
|
488
502
|
}, An = (e, t) => !t || e?.chartInteraction?.suppressNativeContextMenu !== void 0 ? e : {
|
|
@@ -491,33 +505,33 @@ var On = (e, t) => !t || e?.chartLabelInk?.strategy ? e : {
|
|
|
491
505
|
...e?.chartInteraction ?? {},
|
|
492
506
|
suppressNativeContextMenu: !0
|
|
493
507
|
}
|
|
494
|
-
}, jn = (e, t, n = t) => An(kn(
|
|
495
|
-
function
|
|
508
|
+
}, jn = (e, t, n = t) => An(Z(kn(e, t), t), n), Mn = "tableDomBound", Nn = "@app:tableDomBound";
|
|
509
|
+
function Pn(e) {
|
|
496
510
|
try {
|
|
497
|
-
e === null ? window.localStorage.removeItem(
|
|
511
|
+
e === null ? window.localStorage.removeItem(Nn) : window.localStorage.setItem(Nn, e);
|
|
498
512
|
} catch {}
|
|
499
513
|
}
|
|
500
|
-
function
|
|
514
|
+
function Fn() {
|
|
501
515
|
try {
|
|
502
|
-
let e = window.localStorage.getItem(
|
|
516
|
+
let e = window.localStorage.getItem(Nn);
|
|
503
517
|
if (e === "on" || e === "off") return e;
|
|
504
518
|
} catch {}
|
|
505
519
|
return null;
|
|
506
520
|
}
|
|
507
|
-
function
|
|
521
|
+
function In() {
|
|
508
522
|
if (typeof window < "u") try {
|
|
509
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
510
|
-
(e === "on" || e === "off") &&
|
|
523
|
+
let e = new URLSearchParams(window.location.search).get(Mn);
|
|
524
|
+
(e === "on" || e === "off") && Pn(e);
|
|
511
525
|
} catch {}
|
|
512
526
|
}
|
|
513
|
-
function
|
|
514
|
-
return typeof window > "u" || (
|
|
527
|
+
function Ln() {
|
|
528
|
+
return typeof window > "u" || (In(), Fn() !== "off");
|
|
515
529
|
}
|
|
516
|
-
|
|
530
|
+
In();
|
|
517
531
|
//#endregion
|
|
518
532
|
//#region src/v2/surfaces/MetricCard/useCardTableRowWindow.ts
|
|
519
|
-
var
|
|
520
|
-
function
|
|
533
|
+
var Rn = 12, zn = 36, Bn = 720;
|
|
534
|
+
function Vn(e, t) {
|
|
521
535
|
let n = Array(e + 1);
|
|
522
536
|
n[0] = 0;
|
|
523
537
|
for (let r = 0; r < e; r += 1) {
|
|
@@ -526,7 +540,7 @@ function Bn(e, t) {
|
|
|
526
540
|
}
|
|
527
541
|
return n;
|
|
528
542
|
}
|
|
529
|
-
function
|
|
543
|
+
function Hn(e, t) {
|
|
530
544
|
let n = 0, r = e.length - 1;
|
|
531
545
|
for (; n < r;) {
|
|
532
546
|
let i = Math.floor((n + r + 1) / 2);
|
|
@@ -534,7 +548,7 @@ function Vn(e, t) {
|
|
|
534
548
|
}
|
|
535
549
|
return n;
|
|
536
550
|
}
|
|
537
|
-
function
|
|
551
|
+
function Un({ offsets: e, viewTop: t, viewBottom: n, overscan: r = Rn }) {
|
|
538
552
|
let i = e.length - 1;
|
|
539
553
|
if (i <= 0) return {
|
|
540
554
|
start: 0,
|
|
@@ -544,31 +558,31 @@ function Hn({ offsets: e, viewTop: t, viewBottom: n, overscan: r = Ln }) {
|
|
|
544
558
|
start: 0,
|
|
545
559
|
end: i
|
|
546
560
|
};
|
|
547
|
-
let a =
|
|
561
|
+
let a = Hn(e, t), o = Hn(e, n);
|
|
548
562
|
return {
|
|
549
563
|
start: Math.max(0, Math.min(i, a - r)),
|
|
550
564
|
end: Math.max(0, Math.min(i, o + 1 + r))
|
|
551
565
|
};
|
|
552
566
|
}
|
|
553
|
-
function
|
|
567
|
+
function Wn({ offsets: e, start: t, end: n }) {
|
|
554
568
|
let r = e.length - 1;
|
|
555
569
|
return {
|
|
556
570
|
top: t > 0 ? Math.max(0, e[t]) : 0,
|
|
557
571
|
bottom: n < r ? Math.max(0, e[r] - e[n]) : 0
|
|
558
572
|
};
|
|
559
573
|
}
|
|
560
|
-
function
|
|
561
|
-
let [r, i] =
|
|
574
|
+
function Gn({ rowCount: e, scrollElRef: t, minRows: n = 200 }) {
|
|
575
|
+
let [r, i] = K.useState(zn), [a, o] = K.useState({
|
|
562
576
|
viewTop: 0,
|
|
563
577
|
viewBottom: Infinity
|
|
564
|
-
}), [s, c] =
|
|
578
|
+
}), [s, c] = K.useState(!1), l = K.useRef(null), u = K.useRef(!1), d = K.useRef(null), f = e > n && !s, p = K.useRef(/* @__PURE__ */ new Map()), [m, h] = K.useState(() => /* @__PURE__ */ new Map()), g = K.useMemo(() => Vn(e, (e) => m.get(e) ?? r), [
|
|
565
579
|
e,
|
|
566
580
|
r,
|
|
567
581
|
m
|
|
568
|
-
]), _ =
|
|
582
|
+
]), _ = K.useMemo(() => f ? Un({
|
|
569
583
|
offsets: g,
|
|
570
584
|
viewTop: a.viewTop,
|
|
571
|
-
viewBottom: Number.isFinite(a.viewBottom) ? a.viewBottom :
|
|
585
|
+
viewBottom: Number.isFinite(a.viewBottom) ? a.viewBottom : Bn
|
|
572
586
|
}) : {
|
|
573
587
|
start: 0,
|
|
574
588
|
end: e
|
|
@@ -578,7 +592,7 @@ function Wn({ rowCount: e, scrollElRef: t, minRows: n = 200 }) {
|
|
|
578
592
|
a.viewTop,
|
|
579
593
|
a.viewBottom,
|
|
580
594
|
e
|
|
581
|
-
]), v =
|
|
595
|
+
]), v = K.useMemo(() => f ? Wn({
|
|
582
596
|
offsets: g,
|
|
583
597
|
start: _.start,
|
|
584
598
|
end: _.end
|
|
@@ -591,14 +605,14 @@ function Wn({ rowCount: e, scrollElRef: t, minRows: n = 200 }) {
|
|
|
591
605
|
_.start,
|
|
592
606
|
_.end
|
|
593
607
|
]);
|
|
594
|
-
|
|
608
|
+
K.useEffect(() => {
|
|
595
609
|
if (typeof window > "u") return;
|
|
596
610
|
let e = () => c(!0), t = () => c(!1);
|
|
597
611
|
return window.addEventListener("beforeprint", e), window.addEventListener("afterprint", t), () => {
|
|
598
612
|
window.removeEventListener("beforeprint", e), window.removeEventListener("afterprint", t);
|
|
599
613
|
};
|
|
600
614
|
}, []);
|
|
601
|
-
let y =
|
|
615
|
+
let y = K.useCallback(() => {
|
|
602
616
|
let e = l.current, n = t.current;
|
|
603
617
|
if (!e || !n) return;
|
|
604
618
|
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect().top - r.top, a = i + n.clientHeight;
|
|
@@ -607,9 +621,9 @@ function Wn({ rowCount: e, scrollElRef: t, minRows: n = 200 }) {
|
|
|
607
621
|
viewBottom: a
|
|
608
622
|
});
|
|
609
623
|
}, [t]), b = g[e] ?? 0;
|
|
610
|
-
|
|
624
|
+
K.useEffect(() => {
|
|
611
625
|
b >= 0 && y();
|
|
612
|
-
}, [y, b]),
|
|
626
|
+
}, [y, b]), K.useEffect(() => {
|
|
613
627
|
if (typeof window > "u" || !f) return;
|
|
614
628
|
let e = t.current, n = () => {
|
|
615
629
|
d.current === null && (d.current = window.requestAnimationFrame(() => {
|
|
@@ -626,14 +640,14 @@ function Wn({ rowCount: e, scrollElRef: t, minRows: n = 200 }) {
|
|
|
626
640
|
y,
|
|
627
641
|
t
|
|
628
642
|
]);
|
|
629
|
-
let x =
|
|
643
|
+
let x = K.useCallback((e) => (t) => {
|
|
630
644
|
if (!t) return;
|
|
631
645
|
let n = t.getBoundingClientRect().height;
|
|
632
646
|
if (!Number.isFinite(n) || n <= 0) return;
|
|
633
647
|
let r = p.current.get(e);
|
|
634
648
|
r !== void 0 && Math.abs(r - n) < .5 || (p.current.set(e, n), h(new Map(p.current)), u.current || (u.current = !0, i((e) => Math.abs(e - n) < .5 ? e : n)));
|
|
635
649
|
}, []);
|
|
636
|
-
return
|
|
650
|
+
return K.useEffect(() => {
|
|
637
651
|
p.current = /* @__PURE__ */ new Map(), h(/* @__PURE__ */ new Map());
|
|
638
652
|
}, [e]), {
|
|
639
653
|
range: _,
|
|
@@ -644,14 +658,14 @@ function Wn({ rowCount: e, scrollElRef: t, minRows: n = 200 }) {
|
|
|
644
658
|
measureRowRef: x
|
|
645
659
|
};
|
|
646
660
|
}
|
|
647
|
-
var
|
|
648
|
-
let p = e.length > 1e3 &&
|
|
649
|
-
return !n && !l && !p ? /* @__PURE__ */
|
|
661
|
+
var Kn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null, onRetry: a, emptyMessage: o, emptyAction: s, renderCell: c, onCellClick: l, ariaLabel: u, qaEntity: d = "metric-card-chart-table", className: f }) => {
|
|
662
|
+
let p = e.length > 1e3 && Ln();
|
|
663
|
+
return !n && !l && !p ? /* @__PURE__ */ q(qn, {
|
|
650
664
|
rows: e,
|
|
651
665
|
columns: t,
|
|
652
666
|
renderCell: c,
|
|
653
667
|
className: f
|
|
654
|
-
}) : /* @__PURE__ */
|
|
668
|
+
}) : /* @__PURE__ */ q(Xn, {
|
|
655
669
|
rows: e,
|
|
656
670
|
columns: t,
|
|
657
671
|
paging: n ?? {
|
|
@@ -669,30 +683,30 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
669
683
|
qaEntity: d,
|
|
670
684
|
className: f
|
|
671
685
|
});
|
|
672
|
-
},
|
|
673
|
-
let i =
|
|
686
|
+
}, qn = ({ rows: e, columns: t, renderCell: n, className: r }) => {
|
|
687
|
+
let i = K.useRef(null), { range: a, spacerTop: o, spacerBottom: s, isWindowed: c, tbodyRef: l, measureRowRef: u } = Gn({
|
|
674
688
|
rowCount: e.length,
|
|
675
689
|
scrollElRef: i
|
|
676
690
|
}), d = e.slice(a.start, a.end);
|
|
677
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ q("div", {
|
|
678
692
|
ref: i,
|
|
679
693
|
"data-testid": "metric-card-chart-table",
|
|
680
|
-
className:
|
|
681
|
-
children: /* @__PURE__ */
|
|
694
|
+
className: G("h-full w-full overflow-auto rounded-(--radius-md) border border-(--border)", r),
|
|
695
|
+
children: /* @__PURE__ */ J("table", {
|
|
682
696
|
className: "w-full text-left text-sm",
|
|
683
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ q("thead", { children: /* @__PURE__ */ q("tr", {
|
|
684
698
|
className: "border-b border-(--border)",
|
|
685
|
-
children: t.map((e) => /* @__PURE__ */
|
|
699
|
+
children: t.map((e) => /* @__PURE__ */ q("th", {
|
|
686
700
|
scope: "col",
|
|
687
701
|
className: "px-3 py-2 font-medium text-(--muted-foreground)",
|
|
688
702
|
children: e.label
|
|
689
703
|
}, e.key))
|
|
690
|
-
}) }), /* @__PURE__ */
|
|
704
|
+
}) }), /* @__PURE__ */ J("tbody", {
|
|
691
705
|
ref: l,
|
|
692
706
|
children: [
|
|
693
|
-
c && o > 0 ? /* @__PURE__ */
|
|
707
|
+
c && o > 0 ? /* @__PURE__ */ q("tr", {
|
|
694
708
|
"data-virtual-spacer": "top",
|
|
695
|
-
children: /* @__PURE__ */
|
|
709
|
+
children: /* @__PURE__ */ q("td", {
|
|
696
710
|
colSpan: t.length,
|
|
697
711
|
className: "h-(--spacer-h) border-none p-0",
|
|
698
712
|
style: { "--spacer-h": `${o}px` }
|
|
@@ -700,18 +714,18 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
700
714
|
}) : null,
|
|
701
715
|
d.map((e, r) => {
|
|
702
716
|
let i = a.start + r;
|
|
703
|
-
return /* @__PURE__ */
|
|
717
|
+
return /* @__PURE__ */ q("tr", {
|
|
704
718
|
ref: c ? u(i) : void 0,
|
|
705
719
|
className: "border-b border-(--border) last:border-0",
|
|
706
|
-
children: t.map((t) => /* @__PURE__ */
|
|
720
|
+
children: t.map((t) => /* @__PURE__ */ q("td", {
|
|
707
721
|
className: "px-3 py-2 text-(--foreground)",
|
|
708
722
|
children: n ? n(e?.[t.key], t, e) : String(e?.[t.key] ?? "")
|
|
709
723
|
}, t.key))
|
|
710
724
|
}, i);
|
|
711
725
|
}),
|
|
712
|
-
c && s > 0 ? /* @__PURE__ */
|
|
726
|
+
c && s > 0 ? /* @__PURE__ */ q("tr", {
|
|
713
727
|
"data-virtual-spacer": "bottom",
|
|
714
|
-
children: /* @__PURE__ */
|
|
728
|
+
children: /* @__PURE__ */ q("td", {
|
|
715
729
|
colSpan: t.length,
|
|
716
730
|
className: "h-(--spacer-h) border-none p-0",
|
|
717
731
|
style: { "--spacer-h": `${s}px` }
|
|
@@ -721,30 +735,30 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
721
735
|
})]
|
|
722
736
|
})
|
|
723
737
|
});
|
|
724
|
-
},
|
|
738
|
+
}, Jn = 256, Yn = () => /* @__PURE__ */ q("td", {
|
|
725
739
|
"aria-hidden": "true",
|
|
726
740
|
className: "dbn-v2-table__filler"
|
|
727
|
-
}),
|
|
728
|
-
let p = n.mode === "server", m =
|
|
741
|
+
}), Xn = ({ rows: e, columns: t, paging: n, isLoading: r, error: i, onRetry: a, emptyMessage: o, emptyAction: s, renderCell: c, onCellClick: l, ariaLabel: u, qaEntity: d, className: f }) => {
|
|
742
|
+
let p = n.mode === "server", m = nn(n.mode), [h, g] = K.useState(null), [_, v] = K.useState({
|
|
729
743
|
limit: n.mode === "client" ? n.pageSize ?? 100 : 100,
|
|
730
744
|
offset: 0
|
|
731
|
-
}), y =
|
|
745
|
+
}), y = K.useCallback((e) => !!t.find((t) => t.key === e)?.isNumeric, [t]), b = h && t.some((e) => e.key === h.key) ? h : null, x = K.useMemo(() => m ? $t(e, b, y) : e, [
|
|
732
746
|
e,
|
|
733
747
|
b,
|
|
734
748
|
m,
|
|
735
749
|
y
|
|
736
|
-
]), S = n.mode === "client" ? Math.min(n.autoPageAbove ?? 1e3,
|
|
750
|
+
]), S = n.mode === "client" ? Math.min(n.autoPageAbove ?? 1e3, Xt) : 0, ee = n.mode === "client" && e.length > S, C = p ? n.limit : _.limit, te = x.length, ne = Math.max(0, Math.min(_.offset, Math.floor(Math.max(0, te - 1) / _.limit) * _.limit)), w = p ? n.offset : ee ? ne : 0, re = K.useMemo(() => p || !ee ? x : tn(x, C, w), [
|
|
737
751
|
p,
|
|
738
752
|
ee,
|
|
739
753
|
x,
|
|
740
754
|
C,
|
|
741
755
|
w
|
|
742
|
-
]), T =
|
|
756
|
+
]), T = en({
|
|
743
757
|
total: p ? n.totalRows : x.length,
|
|
744
758
|
limit: C,
|
|
745
759
|
offset: w,
|
|
746
760
|
renderedRowCount: re.length
|
|
747
|
-
}), E =
|
|
761
|
+
}), E = K.useRef(null), { range: D, spacerTop: ie, spacerBottom: O, isWindowed: k, tbodyRef: A, measureRowRef: ae } = Gn({
|
|
748
762
|
rowCount: re.length,
|
|
749
763
|
scrollElRef: E
|
|
750
764
|
}), oe = re.slice(D.start, D.end), se = t.length + 1, j = (e) => {
|
|
@@ -763,95 +777,95 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
763
777
|
}
|
|
764
778
|
v((t) => ({
|
|
765
779
|
limit: e,
|
|
766
|
-
offset:
|
|
780
|
+
offset: X({
|
|
767
781
|
offset: t.offset,
|
|
768
782
|
nextLimit: e
|
|
769
783
|
})
|
|
770
784
|
}));
|
|
771
785
|
}, le = n, ue = p ? le.isEnablePrevBtn ?? !T.isFirstPage : !T.isFirstPage, de = p ? le.isEnableNextBtn ?? !T.isLastPage : !T.isLastPage, fe = p || ee, pe = !!r && re.length > 0, me = !!r && re.length === 0, he = fe ? `${T.total.toLocaleString()} rows, ${C.toLocaleString()} per page.${m ? "" : " Sorting is unavailable while this table loads one page at a time."}` : null;
|
|
772
|
-
return /* @__PURE__ */
|
|
786
|
+
return /* @__PURE__ */ J("div", {
|
|
773
787
|
"data-testid": "metric-card-chart-table",
|
|
774
788
|
"data-paging-mode": n.mode,
|
|
775
|
-
className:
|
|
776
|
-
children: [/* @__PURE__ */
|
|
789
|
+
className: G("dbn-v2-table dbn-v2-table--fit flex h-full w-full flex-col overflow-hidden rounded-(--radius-md) border border-(--border)", f),
|
|
790
|
+
children: [/* @__PURE__ */ J("div", {
|
|
777
791
|
ref: E,
|
|
778
792
|
className: "relative min-h-0 flex-1 overflow-auto",
|
|
779
793
|
children: [
|
|
780
|
-
pe ? /* @__PURE__ */
|
|
794
|
+
pe ? /* @__PURE__ */ q("div", {
|
|
781
795
|
"data-testid": `${d}-refreshing`,
|
|
782
796
|
"aria-hidden": "true",
|
|
783
797
|
className: "sticky top-0 z-2 -mb-0.5 h-0.5 w-full animate-pulse bg-(--primary) motion-reduce:animate-none"
|
|
784
798
|
}) : null,
|
|
785
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ J("table", {
|
|
786
800
|
"aria-label": u,
|
|
787
801
|
"aria-busy": r || void 0,
|
|
788
|
-
className:
|
|
802
|
+
className: G(pe && "opacity-60 transition-opacity motion-reduce:transition-none"),
|
|
789
803
|
children: [
|
|
790
|
-
he ? /* @__PURE__ */
|
|
804
|
+
he ? /* @__PURE__ */ q("caption", {
|
|
791
805
|
"data-testid": `${d}-caption`,
|
|
792
806
|
className: "sr-only",
|
|
793
807
|
children: he
|
|
794
808
|
}) : null,
|
|
795
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ q("thead", { children: /* @__PURE__ */ J("tr", { children: [t.map((e) => {
|
|
796
810
|
let t = b?.key === e.key ? b.direction : null;
|
|
797
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ q("th", {
|
|
798
812
|
scope: "col",
|
|
799
813
|
"aria-sort": m ? t === "asc" ? "ascending" : t === "desc" ? "descending" : "none" : void 0,
|
|
800
814
|
className: e.isNumeric ? "dbn-num" : void 0,
|
|
801
815
|
title: m ? void 0 : "Sorting is unavailable while this table loads one page at a time.",
|
|
802
|
-
children: m ? /* @__PURE__ */
|
|
816
|
+
children: m ? /* @__PURE__ */ J("button", {
|
|
803
817
|
type: "button",
|
|
804
|
-
...
|
|
818
|
+
...W(d, "sort", e.key),
|
|
805
819
|
onClick: () => {
|
|
806
|
-
g((t) =>
|
|
820
|
+
g((t) => Zt(t, e.key)), v((e) => e.offset === 0 ? e : {
|
|
807
821
|
...e,
|
|
808
822
|
offset: 0
|
|
809
823
|
});
|
|
810
824
|
},
|
|
811
825
|
className: "inline-flex min-h-6 cursor-pointer items-center gap-1 rounded-(--radius-xs) focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)",
|
|
812
|
-
children: [e.label, t === "asc" ? /* @__PURE__ */
|
|
826
|
+
children: [e.label, t === "asc" ? /* @__PURE__ */ q(Ye, {
|
|
813
827
|
"aria-hidden": "true",
|
|
814
828
|
className: "size-3"
|
|
815
|
-
}) : t === "desc" ? /* @__PURE__ */
|
|
829
|
+
}) : t === "desc" ? /* @__PURE__ */ q(Je, {
|
|
816
830
|
"aria-hidden": "true",
|
|
817
831
|
className: "size-3"
|
|
818
|
-
}) : /* @__PURE__ */
|
|
832
|
+
}) : /* @__PURE__ */ q(Ve, {
|
|
819
833
|
"aria-hidden": "true",
|
|
820
834
|
className: "size-3 opacity-40"
|
|
821
835
|
})]
|
|
822
836
|
}) : e.label
|
|
823
837
|
}, e.key);
|
|
824
|
-
}), /* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
838
|
+
}), /* @__PURE__ */ q(Yn, {})] }) }),
|
|
839
|
+
/* @__PURE__ */ J("tbody", {
|
|
826
840
|
ref: A,
|
|
827
841
|
children: [
|
|
828
|
-
k && !me && ie > 0 ? /* @__PURE__ */
|
|
842
|
+
k && !me && ie > 0 ? /* @__PURE__ */ q("tr", {
|
|
829
843
|
"data-virtual-spacer": "top",
|
|
830
|
-
children: /* @__PURE__ */
|
|
844
|
+
children: /* @__PURE__ */ q("td", {
|
|
831
845
|
colSpan: se,
|
|
832
846
|
className: "h-(--spacer-h) border-none p-0",
|
|
833
847
|
style: { "--spacer-h": `${ie}px` }
|
|
834
848
|
})
|
|
835
849
|
}) : null,
|
|
836
|
-
me ? /* @__PURE__ */
|
|
850
|
+
me ? /* @__PURE__ */ q("tr", {
|
|
837
851
|
"data-testid": `${d}-loading-row`,
|
|
838
|
-
children: /* @__PURE__ */
|
|
852
|
+
children: /* @__PURE__ */ q("td", {
|
|
839
853
|
colSpan: se,
|
|
840
854
|
className: "border-none p-0",
|
|
841
|
-
children: /* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ q(Fe, {
|
|
842
856
|
label: "Loading rows",
|
|
843
|
-
minHeight:
|
|
857
|
+
minHeight: Jn
|
|
844
858
|
})
|
|
845
859
|
})
|
|
846
860
|
}) : oe.map((e, n) => {
|
|
847
861
|
let r = D.start + n;
|
|
848
|
-
return /* @__PURE__ */
|
|
862
|
+
return /* @__PURE__ */ J("tr", {
|
|
849
863
|
ref: k ? ae(r) : void 0,
|
|
850
864
|
children: [t.map((t) => {
|
|
851
865
|
let n = c ? c(e?.[t.key], t, e) : String(e?.[t.key] ?? "");
|
|
852
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ q("td", {
|
|
853
867
|
className: t.isNumeric ? "dbn-num" : void 0,
|
|
854
|
-
children: l ? /* @__PURE__ */
|
|
868
|
+
children: l ? /* @__PURE__ */ q("button", {
|
|
855
869
|
type: "button",
|
|
856
870
|
className: "dbn-v2-table__cell-btn",
|
|
857
871
|
"data-testid": `${d}-cell`,
|
|
@@ -865,12 +879,12 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
865
879
|
children: n
|
|
866
880
|
}) : n
|
|
867
881
|
}, t.key);
|
|
868
|
-
}), /* @__PURE__ */
|
|
882
|
+
}), /* @__PURE__ */ q(Yn, {})]
|
|
869
883
|
}, r);
|
|
870
884
|
}),
|
|
871
|
-
k && !me && O > 0 ? /* @__PURE__ */
|
|
885
|
+
k && !me && O > 0 ? /* @__PURE__ */ q("tr", {
|
|
872
886
|
"data-virtual-spacer": "bottom",
|
|
873
|
-
children: /* @__PURE__ */
|
|
887
|
+
children: /* @__PURE__ */ q("td", {
|
|
874
888
|
colSpan: se,
|
|
875
889
|
className: "h-(--spacer-h) border-none p-0",
|
|
876
890
|
style: { "--spacer-h": `${O}px` }
|
|
@@ -880,44 +894,44 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
880
894
|
})
|
|
881
895
|
]
|
|
882
896
|
}),
|
|
883
|
-
!r && i ? /* @__PURE__ */
|
|
897
|
+
!r && i ? /* @__PURE__ */ J("div", {
|
|
884
898
|
role: "alert",
|
|
885
899
|
"data-testid": `${d}-error`,
|
|
886
900
|
className: "flex flex-col items-center justify-center gap-3 p-8 text-center",
|
|
887
901
|
children: [
|
|
888
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ q(ke, {
|
|
889
903
|
"aria-hidden": "true",
|
|
890
904
|
className: "size-6 text-(--destructive)"
|
|
891
905
|
}),
|
|
892
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ q("span", {
|
|
893
907
|
className: "text-sm text-(--muted-foreground)",
|
|
894
908
|
children: i
|
|
895
909
|
}),
|
|
896
|
-
a ? /* @__PURE__ */
|
|
910
|
+
a ? /* @__PURE__ */ q("button", {
|
|
897
911
|
type: "button",
|
|
898
|
-
...
|
|
912
|
+
...W(d, "error", "retry"),
|
|
899
913
|
onClick: a,
|
|
900
914
|
className: "inline-flex h-6 cursor-pointer items-center rounded-(--radius-sm) border border-(--border) bg-(--muted) px-3 text-xs font-medium text-(--foreground) transition-colors hover:bg-(--accent) focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)",
|
|
901
915
|
children: "Try again"
|
|
902
916
|
}) : null
|
|
903
917
|
]
|
|
904
918
|
}) : null,
|
|
905
|
-
!r && !i && re.length === 0 ? /* @__PURE__ */
|
|
919
|
+
!r && !i && re.length === 0 ? /* @__PURE__ */ J("div", {
|
|
906
920
|
"data-testid": `${d}-empty`,
|
|
907
921
|
className: "flex flex-col items-center justify-center gap-3 p-8 text-center",
|
|
908
|
-
children: [/* @__PURE__ */
|
|
922
|
+
children: [/* @__PURE__ */ q("span", {
|
|
909
923
|
className: "text-sm text-(--muted-foreground)",
|
|
910
924
|
children: o || "No data to show."
|
|
911
|
-
}), s ? /* @__PURE__ */
|
|
925
|
+
}), s ? /* @__PURE__ */ q("button", {
|
|
912
926
|
type: "button",
|
|
913
|
-
...
|
|
927
|
+
...W(d, "empty", "action"),
|
|
914
928
|
onClick: s.onClick,
|
|
915
929
|
className: "inline-flex h-6 cursor-pointer items-center rounded-(--radius-sm) border border-(--border) bg-(--muted) px-3 text-xs font-medium text-(--foreground) transition-colors hover:bg-(--accent) focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)",
|
|
916
930
|
children: s.label
|
|
917
931
|
}) : null]
|
|
918
932
|
}) : null
|
|
919
933
|
]
|
|
920
|
-
}), fe ? /* @__PURE__ */
|
|
934
|
+
}), fe ? /* @__PURE__ */ q(Zn, {
|
|
921
935
|
qaEntity: d,
|
|
922
936
|
limit: C,
|
|
923
937
|
window: T,
|
|
@@ -927,38 +941,38 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
927
941
|
onGoToOffset: j
|
|
928
942
|
}) : null]
|
|
929
943
|
});
|
|
930
|
-
},
|
|
931
|
-
let s =
|
|
932
|
-
return /* @__PURE__ */
|
|
944
|
+
}, Zn = ({ qaEntity: e, limit: t, window: n, canPrev: r, canNext: i, onChangePageSize: a, onGoToOffset: o }) => {
|
|
945
|
+
let s = W(e, "page-size").id, c = "inline-flex size-6 cursor-pointer items-center justify-center rounded-(--radius-xs) text-(--muted-foreground) transition-colors hover:text-(--foreground) focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring) disabled:pointer-events-none disabled:opacity-40";
|
|
946
|
+
return /* @__PURE__ */ J("nav", {
|
|
933
947
|
"data-testid": `${e}-pagination`,
|
|
934
948
|
"aria-label": "Table pagination",
|
|
935
949
|
className: "flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-(--border) px-3 py-1.5 text-xs text-(--muted-foreground)",
|
|
936
|
-
children: [/* @__PURE__ */
|
|
950
|
+
children: [/* @__PURE__ */ J("div", {
|
|
937
951
|
className: "flex items-center gap-1.5",
|
|
938
|
-
children: [/* @__PURE__ */
|
|
952
|
+
children: [/* @__PURE__ */ q("label", {
|
|
939
953
|
htmlFor: s,
|
|
940
954
|
children: "Rows per page"
|
|
941
|
-
}), /* @__PURE__ */
|
|
955
|
+
}), /* @__PURE__ */ J("span", {
|
|
942
956
|
className: "relative inline-flex items-center",
|
|
943
|
-
children: [/* @__PURE__ */
|
|
944
|
-
...
|
|
957
|
+
children: [/* @__PURE__ */ q("select", {
|
|
958
|
+
...W(e, "page-size"),
|
|
945
959
|
value: t,
|
|
946
960
|
onChange: (e) => a(Number(e.target.value)),
|
|
947
961
|
className: "h-6 cursor-pointer appearance-none rounded-(--radius-sm) border border-(--border) bg-(--muted) pr-5 pl-1.5 text-xs text-(--foreground) transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--ring)",
|
|
948
|
-
children: (
|
|
962
|
+
children: (Yt.includes(t) ? Yt : [...Yt, t].sort((e, t) => e - t)).map((e) => /* @__PURE__ */ J("option", {
|
|
949
963
|
value: e,
|
|
950
964
|
children: ["Show ", e]
|
|
951
965
|
}, e))
|
|
952
|
-
}), /* @__PURE__ */
|
|
966
|
+
}), /* @__PURE__ */ q(O, {
|
|
953
967
|
"aria-hidden": "true",
|
|
954
968
|
className: "pointer-events-none absolute right-1.5 size-3 text-(--muted-foreground)"
|
|
955
969
|
})]
|
|
956
970
|
})]
|
|
957
|
-
}), /* @__PURE__ */
|
|
971
|
+
}), /* @__PURE__ */ J("div", {
|
|
958
972
|
"aria-live": "polite",
|
|
959
973
|
"aria-atomic": "true",
|
|
960
974
|
className: "flex items-center gap-2",
|
|
961
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ J("span", {
|
|
962
976
|
className: "tabular-nums",
|
|
963
977
|
children: [
|
|
964
978
|
n.from.toLocaleString(),
|
|
@@ -968,34 +982,34 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
968
982
|
" ",
|
|
969
983
|
n.total.toLocaleString()
|
|
970
984
|
]
|
|
971
|
-
}), /* @__PURE__ */
|
|
985
|
+
}), /* @__PURE__ */ J("div", {
|
|
972
986
|
className: "flex items-center gap-0.5",
|
|
973
987
|
children: [
|
|
974
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ q("button", {
|
|
975
989
|
type: "button",
|
|
976
|
-
...
|
|
990
|
+
...W(e, "pagination", "first"),
|
|
977
991
|
"aria-label": "First page",
|
|
978
992
|
disabled: !r,
|
|
979
993
|
onClick: () => o(0),
|
|
980
994
|
className: c,
|
|
981
|
-
children: /* @__PURE__ */
|
|
995
|
+
children: /* @__PURE__ */ q(I, {
|
|
982
996
|
"aria-hidden": "true",
|
|
983
997
|
className: "size-3.5"
|
|
984
998
|
})
|
|
985
999
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ q("button", {
|
|
987
1001
|
type: "button",
|
|
988
|
-
...
|
|
1002
|
+
...W(e, "pagination", "prev"),
|
|
989
1003
|
"aria-label": "Previous page",
|
|
990
1004
|
disabled: !r,
|
|
991
1005
|
onClick: () => o(Math.max(0, (n.pageIndex - 1) * t)),
|
|
992
1006
|
className: c,
|
|
993
|
-
children: /* @__PURE__ */
|
|
1007
|
+
children: /* @__PURE__ */ q(Ge, {
|
|
994
1008
|
"aria-hidden": "true",
|
|
995
1009
|
className: "size-3.5"
|
|
996
1010
|
})
|
|
997
1011
|
}),
|
|
998
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ J("span", {
|
|
999
1013
|
className: "px-1 tabular-nums",
|
|
1000
1014
|
children: [
|
|
1001
1015
|
n.pageIndex + 1,
|
|
@@ -1003,26 +1017,26 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
1003
1017
|
n.pageCount
|
|
1004
1018
|
]
|
|
1005
1019
|
}),
|
|
1006
|
-
/* @__PURE__ */
|
|
1020
|
+
/* @__PURE__ */ q("button", {
|
|
1007
1021
|
type: "button",
|
|
1008
|
-
...
|
|
1022
|
+
...W(e, "pagination", "next"),
|
|
1009
1023
|
"aria-label": "Next page",
|
|
1010
1024
|
disabled: !i,
|
|
1011
1025
|
onClick: () => o((n.pageIndex + 1) * t),
|
|
1012
1026
|
className: c,
|
|
1013
|
-
children: /* @__PURE__ */
|
|
1027
|
+
children: /* @__PURE__ */ q(He, {
|
|
1014
1028
|
"aria-hidden": "true",
|
|
1015
1029
|
className: "size-3.5"
|
|
1016
1030
|
})
|
|
1017
1031
|
}),
|
|
1018
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ q("button", {
|
|
1019
1033
|
type: "button",
|
|
1020
|
-
...
|
|
1034
|
+
...W(e, "pagination", "last"),
|
|
1021
1035
|
"aria-label": "Last page",
|
|
1022
1036
|
disabled: !i,
|
|
1023
1037
|
onClick: () => o((n.pageCount - 1) * t),
|
|
1024
1038
|
className: c,
|
|
1025
|
-
children: /* @__PURE__ */
|
|
1039
|
+
children: /* @__PURE__ */ q(Be, {
|
|
1026
1040
|
"aria-hidden": "true",
|
|
1027
1041
|
className: "size-3.5"
|
|
1028
1042
|
})
|
|
@@ -1031,38 +1045,38 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
1031
1045
|
})]
|
|
1032
1046
|
})]
|
|
1033
1047
|
});
|
|
1034
|
-
},
|
|
1048
|
+
}, Qn = (e) => {
|
|
1035
1049
|
let t = e.indexOf(", because ");
|
|
1036
1050
|
return t <= 0 ? { rest: e } : {
|
|
1037
1051
|
type: e.slice(0, t),
|
|
1038
1052
|
rest: e.slice(t)
|
|
1039
1053
|
};
|
|
1040
|
-
},
|
|
1054
|
+
}, $n = (e) => {
|
|
1041
1055
|
let t = 0;
|
|
1042
1056
|
return e.split(/(\d[\d,]*%?)/g).map((e) => {
|
|
1043
1057
|
let n = `${t}`;
|
|
1044
|
-
return t += e.length, /^\d/.test(e) ? /* @__PURE__ */
|
|
1058
|
+
return t += e.length, /^\d/.test(e) ? /* @__PURE__ */ q("span", {
|
|
1045
1059
|
className: "tabular-nums",
|
|
1046
1060
|
children: e
|
|
1047
|
-
}, n) : /* @__PURE__ */
|
|
1061
|
+
}, n) : /* @__PURE__ */ q(K.Fragment, { children: e }, n);
|
|
1048
1062
|
});
|
|
1049
|
-
},
|
|
1063
|
+
}, er = ({ sentences: e, className: t }) => {
|
|
1050
1064
|
let n = e?.[0]?.trim();
|
|
1051
1065
|
if (!n) return null;
|
|
1052
|
-
let { type: r, rest: i } =
|
|
1053
|
-
return /* @__PURE__ */
|
|
1066
|
+
let { type: r, rest: i } = Qn(n);
|
|
1067
|
+
return /* @__PURE__ */ q("p", {
|
|
1054
1068
|
"data-slot": "metric-card-reason",
|
|
1055
1069
|
"data-testid": "card-reason-strip",
|
|
1056
1070
|
role: "note",
|
|
1057
1071
|
tabIndex: 0,
|
|
1058
1072
|
title: n,
|
|
1059
|
-
className:
|
|
1060
|
-
children: r ? /* @__PURE__ */
|
|
1073
|
+
className: G("line-clamp-1 shrink-0 text-xs text-(--muted-foreground)", "rounded-xs focus-visible:outline-2 focus-visible:outline-offset-2", "focus-visible:outline-(--ring)", t),
|
|
1074
|
+
children: r ? /* @__PURE__ */ J(kt, { children: [/* @__PURE__ */ q("span", {
|
|
1061
1075
|
className: "text-(--foreground)",
|
|
1062
1076
|
children: r
|
|
1063
|
-
}),
|
|
1077
|
+
}), $n(i)] }) : $n(i)
|
|
1064
1078
|
});
|
|
1065
|
-
},
|
|
1079
|
+
}, tr = /(?:^|[_\s.-])(id|ids|uuid|guid|sku|code|no|num|number|zip|zipcode|postcode|pincode|phone|isbn|ean|upc)$/i, nr = /* @__PURE__ */ new Set([
|
|
1066
1080
|
"id",
|
|
1067
1081
|
"ids",
|
|
1068
1082
|
"url",
|
|
@@ -1086,57 +1100,57 @@ var Gn = ({ rows: e, columns: t, paging: n, isLoading: r = !1, error: i = null,
|
|
|
1086
1100
|
"sla",
|
|
1087
1101
|
"uuid"
|
|
1088
1102
|
]);
|
|
1089
|
-
function
|
|
1103
|
+
function rr(e) {
|
|
1090
1104
|
let t = String(e ?? "").trim();
|
|
1091
1105
|
if (!t) return "";
|
|
1092
1106
|
let n = t.lastIndexOf("."), r = n >= 0 ? t.slice(n + 1) : t, i = r.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[_\-\s]+/g, " ").replace(/([a-zA-Z])(\d)/g, "$1 $2").trim().split(" ").filter(Boolean);
|
|
1093
1107
|
return i.length ? i.map((e, t) => {
|
|
1094
1108
|
let n = e.toLowerCase();
|
|
1095
|
-
return
|
|
1109
|
+
return nr.has(n) ? n.toUpperCase() : e.length > 1 && e === e.toUpperCase() && /[A-Z]/.test(e) ? e : t === 0 ? n.charAt(0).toUpperCase() + n.slice(1) : n;
|
|
1096
1110
|
}).join(" ") : r;
|
|
1097
1111
|
}
|
|
1098
|
-
function
|
|
1112
|
+
function ir(e) {
|
|
1099
1113
|
let t = String(e ?? "").trim();
|
|
1100
1114
|
if (!t) return "";
|
|
1101
1115
|
let n = t.lastIndexOf(".");
|
|
1102
1116
|
return (n >= 0 ? t.slice(n + 1) : t).toLowerCase();
|
|
1103
1117
|
}
|
|
1104
|
-
function
|
|
1118
|
+
function Q(e) {
|
|
1105
1119
|
return String(e?.configType ?? "").toUpperCase() === "AGGREGATE" || String(e?.dropType ?? "").toUpperCase() === "METRIC";
|
|
1106
1120
|
}
|
|
1107
|
-
function
|
|
1121
|
+
function ar(e, t) {
|
|
1108
1122
|
for (let n of e ?? []) {
|
|
1109
1123
|
let e = n?.[t];
|
|
1110
1124
|
if (e != null && e !== "") return typeof e == "number" ? Number.isFinite(e) ? "number" : "text" : typeof e == "boolean" ? "boolean" : "text";
|
|
1111
1125
|
}
|
|
1112
1126
|
return "text";
|
|
1113
1127
|
}
|
|
1114
|
-
function
|
|
1128
|
+
function or({ keys: e, rows: t = [], selectedDims: n = [], selectedMetrics: r = [] }) {
|
|
1115
1129
|
let i = /* @__PURE__ */ new Map(), a = (e) => {
|
|
1116
1130
|
if (e) for (let t of [
|
|
1117
1131
|
e.alias,
|
|
1118
1132
|
e.name,
|
|
1119
1133
|
e.label
|
|
1120
1134
|
]) {
|
|
1121
|
-
let n =
|
|
1135
|
+
let n = ir(t);
|
|
1122
1136
|
n && !i.has(n) && i.set(n, e);
|
|
1123
1137
|
}
|
|
1124
1138
|
};
|
|
1125
1139
|
n.forEach(a), r.forEach(a);
|
|
1126
|
-
let o = (e, t, ...n) => e !== "number" || t ? e : n.some((e) => e &&
|
|
1140
|
+
let o = (e, t, ...n) => e !== "number" || t ? e : n.some((e) => e && tr.test(e.trim())) ? "identifier" : e;
|
|
1127
1141
|
return (e ?? []).map((e) => {
|
|
1128
|
-
let n = i.get(
|
|
1142
|
+
let n = i.get(ir(e));
|
|
1129
1143
|
if (!n) {
|
|
1130
|
-
let n =
|
|
1144
|
+
let n = rr(e);
|
|
1131
1145
|
return {
|
|
1132
1146
|
key: e,
|
|
1133
1147
|
label: n,
|
|
1134
|
-
kind: o(
|
|
1148
|
+
kind: o(ar(t, e), !1, e, n),
|
|
1135
1149
|
isMeasure: !1,
|
|
1136
1150
|
isDerived: !0
|
|
1137
1151
|
};
|
|
1138
1152
|
}
|
|
1139
|
-
let r =
|
|
1153
|
+
let r = Q(n), a = Me(n.datatype), s = r ? "number" : a === "number" || a === "date" || a === "boolean" ? a : ar(t, e), c = n.label?.trim() || n.alias?.trim() || n.name?.trim() || rr(e);
|
|
1140
1154
|
return {
|
|
1141
1155
|
key: e,
|
|
1142
1156
|
label: c,
|
|
@@ -1146,7 +1160,7 @@ function ar({ keys: e, rows: t = [], selectedDims: n = [], selectedMetrics: r =
|
|
|
1146
1160
|
};
|
|
1147
1161
|
});
|
|
1148
1162
|
}
|
|
1149
|
-
function
|
|
1163
|
+
function sr(e) {
|
|
1150
1164
|
if (!Number.isFinite(e)) return "";
|
|
1151
1165
|
try {
|
|
1152
1166
|
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 6 }).format(e);
|
|
@@ -1154,15 +1168,15 @@ function Z(e) {
|
|
|
1154
1168
|
return String(e);
|
|
1155
1169
|
}
|
|
1156
1170
|
}
|
|
1157
|
-
function
|
|
1171
|
+
function cr(e, t, n) {
|
|
1158
1172
|
if (e == null || e === "") return "-";
|
|
1159
1173
|
if (t.kind === "identifier" || t.kind !== "number") return String(e);
|
|
1160
1174
|
let r = typeof e == "number" ? e : Number(e);
|
|
1161
|
-
return Number.isFinite(r) ? t.isMeasure && n ? n(r, t.key) :
|
|
1175
|
+
return Number.isFinite(r) ? t.isMeasure && n ? n(r, t.key) : sr(r) : String(e);
|
|
1162
1176
|
}
|
|
1163
1177
|
//#endregion
|
|
1164
1178
|
//#region src/v2/surfaces/MetricCard/dialogs/UnderlyingDataDialog.tsx
|
|
1165
|
-
var
|
|
1179
|
+
var lr = 300, ur = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload: i, onDownloadAll: a, downloadAllState: o, title: s = "Underlying data", description: c, downloadLabel: l = "Download", presentation: u }) => u ? /* @__PURE__ */ q(fr, {
|
|
1166
1180
|
open: e,
|
|
1167
1181
|
onOpenChange: t,
|
|
1168
1182
|
columns: n,
|
|
@@ -1174,7 +1188,7 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1174
1188
|
description: c,
|
|
1175
1189
|
downloadLabel: l,
|
|
1176
1190
|
presentation: u
|
|
1177
|
-
}) : /* @__PURE__ */
|
|
1191
|
+
}) : /* @__PURE__ */ q(dr, {
|
|
1178
1192
|
open: e,
|
|
1179
1193
|
onOpenChange: t,
|
|
1180
1194
|
columns: n,
|
|
@@ -1183,40 +1197,40 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1183
1197
|
title: s,
|
|
1184
1198
|
description: c,
|
|
1185
1199
|
downloadLabel: l
|
|
1186
|
-
}),
|
|
1200
|
+
}), dr = ({ hasActiveFilters: e, open: t, onOpenChange: n, columns: r, rows: i, onDownload: a, title: o, description: s, downloadLabel: c }) => {
|
|
1187
1201
|
let l = !i?.length;
|
|
1188
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ q(Et, {
|
|
1189
1203
|
open: t,
|
|
1190
1204
|
onOpenChange: n,
|
|
1191
|
-
children: /* @__PURE__ */
|
|
1205
|
+
children: /* @__PURE__ */ J(Ct, {
|
|
1192
1206
|
className: "flex max-h-4/5 w-full flex-col sm:max-w-180",
|
|
1193
1207
|
children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ J(xt, { children: [/* @__PURE__ */ q(wt, { children: o }), s == null ? null : /* @__PURE__ */ q(Tt, { children: s })] }),
|
|
1209
|
+
/* @__PURE__ */ q("div", {
|
|
1196
1210
|
className: "min-h-0 flex-1",
|
|
1197
|
-
children: l ? /* @__PURE__ */
|
|
1211
|
+
children: l ? /* @__PURE__ */ q(ct, { hasActiveFilters: e }) : /* @__PURE__ */ q(Kn, {
|
|
1198
1212
|
rows: i,
|
|
1199
1213
|
columns: r
|
|
1200
1214
|
})
|
|
1201
1215
|
}),
|
|
1202
|
-
a != null && !l ? /* @__PURE__ */
|
|
1216
|
+
a != null && !l ? /* @__PURE__ */ q(St, { children: /* @__PURE__ */ q(U, {
|
|
1203
1217
|
onClick: a,
|
|
1204
1218
|
children: c
|
|
1205
1219
|
}) }) : null
|
|
1206
1220
|
]
|
|
1207
1221
|
})
|
|
1208
1222
|
});
|
|
1209
|
-
},
|
|
1210
|
-
let { selectedDims: f, selectedMetrics: p, measureFormatter: m, paging: h, scope: g, isLoading: _ = !1, error: v = null, onRetry: y } = d, [b, x] =
|
|
1211
|
-
|
|
1223
|
+
}, fr = ({ hasActiveFilters: e, open: t, onOpenChange: n, columns: r, rows: i, onDownload: a, onDownloadAll: o, downloadAllState: s, title: c, description: l, downloadLabel: u, presentation: d }) => {
|
|
1224
|
+
let { selectedDims: f, selectedMetrics: p, measureFormatter: m, paging: h, scope: g, isLoading: _ = !1, error: v = null, onRetry: y } = d, [b, x] = K.useState(""), [S, ee] = K.useState("");
|
|
1225
|
+
K.useEffect(() => {
|
|
1212
1226
|
let e = b.trim();
|
|
1213
1227
|
if (e === S) return;
|
|
1214
|
-
let t = setTimeout(() => ee(e),
|
|
1228
|
+
let t = setTimeout(() => ee(e), lr);
|
|
1215
1229
|
return () => clearTimeout(t);
|
|
1216
|
-
}, [b, S]),
|
|
1230
|
+
}, [b, S]), K.useEffect(() => {
|
|
1217
1231
|
t || (x(""), ee(""));
|
|
1218
1232
|
}, [t]);
|
|
1219
|
-
let C =
|
|
1233
|
+
let C = K.useMemo(() => r?.length ? r.map((e) => e.key) : Object.keys(i?.[0] ?? {}), [r, i]), te = K.useMemo(() => or({
|
|
1220
1234
|
keys: C,
|
|
1221
1235
|
rows: i,
|
|
1222
1236
|
selectedDims: f,
|
|
@@ -1226,19 +1240,19 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1226
1240
|
i,
|
|
1227
1241
|
f,
|
|
1228
1242
|
p
|
|
1229
|
-
]), ne =
|
|
1243
|
+
]), ne = K.useMemo(() => te.map((e) => ({
|
|
1230
1244
|
key: e.key,
|
|
1231
1245
|
label: e.label,
|
|
1232
1246
|
isNumeric: e.kind === "number" || e.kind === "identifier"
|
|
1233
|
-
})), [te]), w =
|
|
1247
|
+
})), [te]), w = K.useMemo(() => new Map(te.map((e) => [e.key, e])), [te]), re = K.useCallback((e, t) => {
|
|
1234
1248
|
let n = w.get(t.key);
|
|
1235
|
-
return n ?
|
|
1236
|
-
}, [w, m]), T = !!h, E = !T || h.canSearch !== !1, D = C, ie = h?.onRequestPage, O =
|
|
1237
|
-
|
|
1249
|
+
return n ? cr(e, n, m) : String(e ?? "");
|
|
1250
|
+
}, [w, m]), T = !!h, E = !T || h.canSearch !== !1, D = C, ie = h?.onRequestPage, O = K.useRef(ie);
|
|
1251
|
+
K.useEffect(() => {
|
|
1238
1252
|
O.current = ie;
|
|
1239
1253
|
}, [ie]);
|
|
1240
|
-
let k = h?.limit ?? 100, A = h?.offset ?? 0, ae =
|
|
1241
|
-
|
|
1254
|
+
let k = h?.limit ?? 100, A = h?.offset ?? 0, ae = K.useRef(null);
|
|
1255
|
+
K.useEffect(() => {
|
|
1242
1256
|
if (!t || !T) {
|
|
1243
1257
|
ae.current = null;
|
|
1244
1258
|
return;
|
|
@@ -1263,8 +1277,8 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1263
1277
|
E,
|
|
1264
1278
|
D
|
|
1265
1279
|
]);
|
|
1266
|
-
let oe =
|
|
1267
|
-
|
|
1280
|
+
let oe = K.useRef(S);
|
|
1281
|
+
K.useEffect(() => {
|
|
1268
1282
|
let e = oe.current !== S;
|
|
1269
1283
|
oe.current = S, e && T && t && A !== 0 && O.current?.({
|
|
1270
1284
|
limit: k,
|
|
@@ -1281,7 +1295,7 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1281
1295
|
S,
|
|
1282
1296
|
D
|
|
1283
1297
|
]);
|
|
1284
|
-
let se =
|
|
1298
|
+
let se = K.useMemo(() => {
|
|
1285
1299
|
if (T || !S) return i;
|
|
1286
1300
|
let e = S.toLowerCase();
|
|
1287
1301
|
return (i ?? []).filter((t) => C.some((n) => String(t?.[n] ?? "").toLowerCase().includes(e)));
|
|
@@ -1307,12 +1321,12 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1307
1321
|
} : {
|
|
1308
1322
|
mode: "client",
|
|
1309
1323
|
pageSize: 100
|
|
1310
|
-
}, le =
|
|
1324
|
+
}, le = en({
|
|
1311
1325
|
total: T ? h.totalRows : j.length,
|
|
1312
1326
|
limit: k,
|
|
1313
1327
|
offset: T ? A : 0,
|
|
1314
1328
|
renderedRowCount: j.length
|
|
1315
|
-
}), ue =
|
|
1329
|
+
}), ue = K.useMemo(() => {
|
|
1316
1330
|
if (y) return y;
|
|
1317
1331
|
if (T) return () => h.onRequestPage({
|
|
1318
1332
|
limit: k,
|
|
@@ -1332,37 +1346,37 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1332
1346
|
]), de = !!S, fe = !_ && !v && j.length === 0, pe = de ? `No rows match “${S}”.` : "There are no rows behind this value.", me = de ? {
|
|
1333
1347
|
label: "Clear search",
|
|
1334
1348
|
onClick: () => x("")
|
|
1335
|
-
} : void 0, he = fe && !de && !T,
|
|
1336
|
-
return /* @__PURE__ */
|
|
1349
|
+
} : void 0, he = fe && !de && !T, M = a != null && j.length > 0, ge = T && le.total > j.length, _e = o != null && ge, ve = !!s?.isRunning, ye = ge ? `Download this page (${j.length.toLocaleString()} rows)` : u;
|
|
1350
|
+
return /* @__PURE__ */ q(Et, {
|
|
1337
1351
|
open: t,
|
|
1338
1352
|
onOpenChange: n,
|
|
1339
|
-
children: /* @__PURE__ */
|
|
1353
|
+
children: /* @__PURE__ */ J(Ct, {
|
|
1340
1354
|
"data-testid": "underlying-data-dialog",
|
|
1341
1355
|
className: "flex h-4/5 max-h-4/5 w-full flex-col sm:max-w-260",
|
|
1342
1356
|
children: [
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
g?.length ? /* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ J(xt, { children: [/* @__PURE__ */ q(wt, { children: c }), l == null ? null : /* @__PURE__ */ q(Tt, { children: l })] }),
|
|
1358
|
+
g?.length ? /* @__PURE__ */ J("div", {
|
|
1345
1359
|
className: "flex shrink-0 flex-wrap items-center gap-1.5 text-xs text-(--muted-foreground)",
|
|
1346
1360
|
"data-testid": "underlying-data-scope",
|
|
1347
|
-
children: [/* @__PURE__ */
|
|
1361
|
+
children: [/* @__PURE__ */ q("span", { children: "Showing rows where" }), g.map((e, t) => /* @__PURE__ */ J(K.Fragment, { children: [t > 0 ? /* @__PURE__ */ q("span", { children: "and" }) : null, /* @__PURE__ */ J("span", {
|
|
1348
1362
|
className: "inline-flex max-w-72 items-baseline gap-1 truncate rounded-(--radius-xs) border border-(--border) bg-(--muted) px-1.5 py-0.5",
|
|
1349
|
-
children: [/* @__PURE__ */
|
|
1363
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1350
1364
|
className: "truncate",
|
|
1351
1365
|
children: e.label
|
|
1352
|
-
}), /* @__PURE__ */
|
|
1366
|
+
}), /* @__PURE__ */ q("span", {
|
|
1353
1367
|
className: "truncate font-medium text-(--foreground)",
|
|
1354
1368
|
children: e.value
|
|
1355
1369
|
})]
|
|
1356
1370
|
})] }, `${e.label}-${e.value}`))]
|
|
1357
1371
|
}) : null,
|
|
1358
|
-
E && !he ? /* @__PURE__ */
|
|
1372
|
+
E && !he ? /* @__PURE__ */ J("div", {
|
|
1359
1373
|
className: "relative shrink-0",
|
|
1360
1374
|
children: [
|
|
1361
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ q(ht, {
|
|
1362
1376
|
"aria-hidden": "true",
|
|
1363
1377
|
className: "pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-(--muted-foreground)"
|
|
1364
1378
|
}),
|
|
1365
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ q(gt, {
|
|
1366
1380
|
type: "search",
|
|
1367
1381
|
value: b,
|
|
1368
1382
|
onChange: (e) => x(e.target.value),
|
|
@@ -1371,7 +1385,7 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1371
1385
|
"data-testid": "underlying-data-search",
|
|
1372
1386
|
className: "h-8 pr-8 pl-8 text-sm"
|
|
1373
1387
|
}),
|
|
1374
|
-
b ? /* @__PURE__ */
|
|
1388
|
+
b ? /* @__PURE__ */ q(U, {
|
|
1375
1389
|
type: "button",
|
|
1376
1390
|
variant: "ghost",
|
|
1377
1391
|
size: "icon-xs",
|
|
@@ -1379,17 +1393,17 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1379
1393
|
"data-testid": "underlying-data-search-clear",
|
|
1380
1394
|
onClick: () => x(""),
|
|
1381
1395
|
className: "absolute top-1/2 right-1.5 -translate-y-1/2 text-(--muted-foreground)",
|
|
1382
|
-
children: /* @__PURE__ */
|
|
1396
|
+
children: /* @__PURE__ */ q(vt, { "aria-hidden": "true" })
|
|
1383
1397
|
}) : null
|
|
1384
1398
|
]
|
|
1385
1399
|
}) : null,
|
|
1386
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ q("div", {
|
|
1387
1401
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1388
|
-
children: he ? /* @__PURE__ */
|
|
1402
|
+
children: he ? /* @__PURE__ */ q(ct, {
|
|
1389
1403
|
className: "flex-1",
|
|
1390
1404
|
message: pe,
|
|
1391
1405
|
hasActiveFilters: e
|
|
1392
|
-
}) : /* @__PURE__ */
|
|
1406
|
+
}) : /* @__PURE__ */ q(Kn, {
|
|
1393
1407
|
rows: j,
|
|
1394
1408
|
columns: ne,
|
|
1395
1409
|
paging: ce,
|
|
@@ -1404,45 +1418,85 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1404
1418
|
className: "min-h-0 flex-1"
|
|
1405
1419
|
})
|
|
1406
1420
|
}),
|
|
1407
|
-
|
|
1421
|
+
M ? /* @__PURE__ */ J(St, {
|
|
1408
1422
|
className: "items-center sm:justify-between",
|
|
1409
|
-
children: [/* @__PURE__ */
|
|
1423
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1410
1424
|
"data-testid": "underlying-data-download-scope",
|
|
1411
1425
|
className: "text-xs text-(--muted-foreground)",
|
|
1412
1426
|
"aria-live": "polite",
|
|
1413
|
-
children:
|
|
1414
|
-
}), /* @__PURE__ */
|
|
1427
|
+
children: ve ? `Preparing ${(s?.fetchedRows ?? 0).toLocaleString()} of ${le.total.toLocaleString()} rows...` : ge ? `Showing ${j.length.toLocaleString()} of ${le.total.toLocaleString()} rows` : `Downloads all ${le.total.toLocaleString()} rows`
|
|
1428
|
+
}), /* @__PURE__ */ J("div", {
|
|
1415
1429
|
className: "flex items-center gap-2",
|
|
1416
|
-
children: [/* @__PURE__ */
|
|
1417
|
-
variant:
|
|
1430
|
+
children: [/* @__PURE__ */ q(U, {
|
|
1431
|
+
variant: _e ? "outline" : "default",
|
|
1418
1432
|
"data-testid": "underlying-data-download-page",
|
|
1419
|
-
disabled:
|
|
1433
|
+
disabled: ve,
|
|
1420
1434
|
onClick: a,
|
|
1421
|
-
children:
|
|
1422
|
-
}),
|
|
1435
|
+
children: ye
|
|
1436
|
+
}), _e ? /* @__PURE__ */ q(U, {
|
|
1423
1437
|
"data-testid": "underlying-data-download-all",
|
|
1424
|
-
disabled:
|
|
1438
|
+
disabled: ve,
|
|
1425
1439
|
onClick: () => o?.({
|
|
1426
1440
|
search: E && S ? S : void 0,
|
|
1427
1441
|
searchColumns: E && S ? D : void 0,
|
|
1428
1442
|
total: le.total
|
|
1429
1443
|
}),
|
|
1430
|
-
children:
|
|
1444
|
+
children: ve ? "Preparing..." : `Download all ${le.total.toLocaleString()} rows`
|
|
1431
1445
|
}) : null]
|
|
1432
1446
|
})]
|
|
1433
1447
|
}) : null
|
|
1434
1448
|
]
|
|
1435
1449
|
})
|
|
1436
1450
|
});
|
|
1437
|
-
},
|
|
1451
|
+
}, pr = K.lazy(async () => ({ default: (await import("./charts-BHJis_Jc.mjs").then((e) => e.t)).DbnChart })), mr = K.lazy(async () => ({ default: (await import("./Chart-BLXiGOie.mjs").then((e) => e.n)).Chart })), hr = Object.freeze({
|
|
1438
1452
|
isLoading: !1,
|
|
1439
1453
|
error: "",
|
|
1440
1454
|
data: [],
|
|
1441
1455
|
currentValue: ""
|
|
1442
|
-
}),
|
|
1456
|
+
}), gr = new Set([...Object.keys(b), ...Object.values(b)].map(y)), _r = (e) => gr.has(y(e)), vr = (e) => {
|
|
1443
1457
|
let t = e?.customSettings?.chartTypeSource;
|
|
1444
1458
|
return t === "default" || t === "engine";
|
|
1445
|
-
},
|
|
1459
|
+
}, yr = "__dbnStackBar", br = (e, t) => {
|
|
1460
|
+
let n = Number(e?.[t]);
|
|
1461
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
1462
|
+
}, xr = (e, t) => t.reduce((t, n) => t + br(e, n), 0), Sr = [
|
|
1463
|
+
"fill-(--chart-1)",
|
|
1464
|
+
"fill-(--chart-2)",
|
|
1465
|
+
"fill-(--chart-3)",
|
|
1466
|
+
"fill-(--chart-4)",
|
|
1467
|
+
"fill-(--chart-5)"
|
|
1468
|
+
], Cr = ({ row: e, cols: t, max: n, format: r }) => {
|
|
1469
|
+
let i = t.map((t) => `${t}: ${r(br(e, t), t)}`).join(", "), a = 0, o = n > 0 ? t.flatMap((t, r) => {
|
|
1470
|
+
let i = br(e, t);
|
|
1471
|
+
if (!i) return [];
|
|
1472
|
+
let o = i / n * 100, s = a;
|
|
1473
|
+
return a += o, [{
|
|
1474
|
+
key: t,
|
|
1475
|
+
x: s,
|
|
1476
|
+
width: o,
|
|
1477
|
+
fill: Sr[r % Sr.length]
|
|
1478
|
+
}];
|
|
1479
|
+
}) : [];
|
|
1480
|
+
return /* @__PURE__ */ q("div", {
|
|
1481
|
+
className: "h-3 min-w-24 w-full overflow-hidden rounded-sm bg-(--muted)",
|
|
1482
|
+
title: i,
|
|
1483
|
+
"data-slot": "card-stack-row-bar",
|
|
1484
|
+
children: /* @__PURE__ */ J("svg", {
|
|
1485
|
+
className: "block size-full",
|
|
1486
|
+
viewBox: "0 0 100 1",
|
|
1487
|
+
preserveAspectRatio: "none",
|
|
1488
|
+
role: "img",
|
|
1489
|
+
"aria-label": i,
|
|
1490
|
+
children: [/* @__PURE__ */ q("title", { children: i }), o.map((e) => /* @__PURE__ */ q("rect", {
|
|
1491
|
+
x: e.x,
|
|
1492
|
+
y: 0,
|
|
1493
|
+
width: e.width,
|
|
1494
|
+
height: 1,
|
|
1495
|
+
className: e.fill
|
|
1496
|
+
}, e.key))]
|
|
1497
|
+
})
|
|
1498
|
+
});
|
|
1499
|
+
}, wr = /* @__PURE__ */ new Set([
|
|
1446
1500
|
b.table,
|
|
1447
1501
|
b.trendAnalyzer,
|
|
1448
1502
|
b.pivot,
|
|
@@ -1450,31 +1504,31 @@ var sr = 300, cr = ({ open: e, onOpenChange: t, columns: n, rows: r, onDownload:
|
|
|
1450
1504
|
b.pivotV3,
|
|
1451
1505
|
b.horizontalStackTable
|
|
1452
1506
|
]);
|
|
1453
|
-
function
|
|
1507
|
+
function Tr(e) {
|
|
1454
1508
|
if (e != null) return typeof e == "number" ? `${e}px` : e;
|
|
1455
1509
|
}
|
|
1456
|
-
var
|
|
1457
|
-
let
|
|
1458
|
-
|
|
1510
|
+
var Er = ({ metric: e, chartSettings: t, data: i, isLoading: a, drillBreadcrumb: o, terminalNotice: s, chartColors: c, chartRendererType: u, chartAppearance: d, chartColumns: f, tablePaging: h, onTableCellClick: _, isTableRefreshing: v, height: ne, width: O, onEvents: ae, onChartReady: oe, enableCoverageTruncation: se, chartTasteCapability: j, canOpenDataPointMenu: ce, emptyState: le, hasActiveFilters: ue, className: de, reduction: fe, reductionRowsIn: pe, serverTruncation: me }) => {
|
|
1511
|
+
let M = wr.has(t?.chartType), ge = c ?? t?.chartColors, ve = A(j), ye = g(), be = ye && vr(t) && se !== !1, N = K.useMemo(() => M ? null : xn(t, i, be, e, me), [
|
|
1512
|
+
M,
|
|
1459
1513
|
t,
|
|
1460
1514
|
i,
|
|
1461
|
-
|
|
1515
|
+
be,
|
|
1462
1516
|
e,
|
|
1463
1517
|
me
|
|
1464
|
-
]),
|
|
1465
|
-
|
|
1518
|
+
]), xe = K.useMemo(() => N?.summary ? Sn(N.summary, t, e) : null, [
|
|
1519
|
+
N?.summary,
|
|
1466
1520
|
t,
|
|
1467
1521
|
e
|
|
1468
|
-
]),
|
|
1469
|
-
truncationFootnote:
|
|
1522
|
+
]), Se = K.useMemo(() => xe ?? he(N?.truncated ?? null), [xe, N?.truncated]), Ce = K.useMemo(() => an({
|
|
1523
|
+
truncationFootnote: Se,
|
|
1470
1524
|
reduction: fe,
|
|
1471
1525
|
rowsIn: pe
|
|
1472
1526
|
}), [
|
|
1473
|
-
|
|
1527
|
+
Se,
|
|
1474
1528
|
fe,
|
|
1475
1529
|
pe
|
|
1476
|
-
]),
|
|
1477
|
-
if (
|
|
1530
|
+
]), we = K.useMemo(() => {
|
|
1531
|
+
if (Ce || !dn()) return;
|
|
1478
1532
|
let e = t?.chartType;
|
|
1479
1533
|
if (e && i?.length) try {
|
|
1480
1534
|
let t = l(i);
|
|
@@ -1483,67 +1537,67 @@ var vr = ({ metric: e, chartSettings: t, data: i, isLoading: a, drillBreadcrumb:
|
|
|
1483
1537
|
return;
|
|
1484
1538
|
}
|
|
1485
1539
|
}, [
|
|
1486
|
-
|
|
1540
|
+
Ce,
|
|
1487
1541
|
t?.chartType,
|
|
1488
1542
|
i
|
|
1489
|
-
]),
|
|
1490
|
-
if (!
|
|
1543
|
+
]), Te = K.useMemo(() => {
|
|
1544
|
+
if (!ye) return null;
|
|
1491
1545
|
let e = t?.chartType;
|
|
1492
1546
|
if (!e || !i?.length) return null;
|
|
1493
1547
|
try {
|
|
1494
|
-
let n = w[e] ?? w[
|
|
1548
|
+
let n = w[e] ?? w[y(e)] ?? e, a = r[y(n)];
|
|
1495
1549
|
if (!a) return null;
|
|
1496
|
-
let o = a.checkRenderable(
|
|
1550
|
+
let o = a.checkRenderable(p(i), ie(t, i));
|
|
1497
1551
|
return o.ok ? null : o;
|
|
1498
1552
|
} catch {
|
|
1499
1553
|
return null;
|
|
1500
1554
|
}
|
|
1501
1555
|
}, [
|
|
1502
|
-
|
|
1556
|
+
ye,
|
|
1503
1557
|
t,
|
|
1504
1558
|
i
|
|
1505
|
-
]),
|
|
1506
|
-
mapping: E(t,
|
|
1559
|
+
]), Ee = N?.rows ?? i, De = A(j), Oe = x(null), P = K.useMemo(() => !Oe || M ? null : ee({
|
|
1560
|
+
mapping: E(t, Ee),
|
|
1507
1561
|
chartOptions: t,
|
|
1508
|
-
rows:
|
|
1509
|
-
enabled:
|
|
1562
|
+
rows: Ee,
|
|
1563
|
+
enabled: De
|
|
1510
1564
|
}), [
|
|
1511
|
-
|
|
1512
|
-
|
|
1565
|
+
Oe,
|
|
1566
|
+
M,
|
|
1513
1567
|
t,
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
]),
|
|
1568
|
+
Ee,
|
|
1569
|
+
De
|
|
1570
|
+
]), ke = N?.summary?.bucketLabel, [Ae, je] = K.useState(null), Me = K.useMemo(() => Ae === "collapsed" ? N?.collapsedRows ?? [] : i, [
|
|
1517
1571
|
i,
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
]),
|
|
1521
|
-
|
|
1522
|
-
|
|
1572
|
+
N?.collapsedRows,
|
|
1573
|
+
Ae
|
|
1574
|
+
]), Ne = K.useMemo(() => Dr(f, Me, !0), [f, Me]), Pe = _e(), Fe = K.useRef(null), F = K.useRef(oe);
|
|
1575
|
+
K.useLayoutEffect(() => {
|
|
1576
|
+
F.current = oe;
|
|
1523
1577
|
}, [oe]);
|
|
1524
|
-
let
|
|
1525
|
-
t &&
|
|
1526
|
-
}, []),
|
|
1578
|
+
let Ie = K.useCallback((e, t) => {
|
|
1579
|
+
t && Fe.current !== t && (Fe.current = t, F.current?.(t));
|
|
1580
|
+
}, []), Le = K.useMemo(() => {
|
|
1527
1581
|
let t = !!oe, n = (e) => {
|
|
1528
1582
|
if (!t) return e;
|
|
1529
1583
|
let n = e?.finished;
|
|
1530
1584
|
return {
|
|
1531
1585
|
...e ?? {},
|
|
1532
1586
|
finished: (...e) => {
|
|
1533
|
-
n?.(...e),
|
|
1587
|
+
n?.(...e), Ie(e[0], e[1]);
|
|
1534
1588
|
}
|
|
1535
1589
|
};
|
|
1536
1590
|
};
|
|
1537
|
-
if (!
|
|
1591
|
+
if (!ke && !Pe) return n(ae);
|
|
1538
1592
|
let { click: r, ...i } = ae ?? {};
|
|
1539
1593
|
return n({
|
|
1540
1594
|
...i,
|
|
1541
1595
|
click: (t, ...n) => {
|
|
1542
|
-
if (
|
|
1543
|
-
|
|
1596
|
+
if (ke && t?.name === ke) {
|
|
1597
|
+
je("collapsed");
|
|
1544
1598
|
return;
|
|
1545
1599
|
}
|
|
1546
|
-
|
|
1600
|
+
Pe?.(e, {
|
|
1547
1601
|
params: t,
|
|
1548
1602
|
rowFilters: Array.isArray(t?.rowFilters) ? t.rowFilters : void 0
|
|
1549
1603
|
}) || r?.(t, ...n);
|
|
@@ -1551,38 +1605,61 @@ var vr = ({ metric: e, chartSettings: t, data: i, isLoading: a, drillBreadcrumb:
|
|
|
1551
1605
|
});
|
|
1552
1606
|
}, [
|
|
1553
1607
|
ae,
|
|
1554
|
-
|
|
1608
|
+
ke,
|
|
1555
1609
|
e,
|
|
1556
|
-
|
|
1610
|
+
Pe,
|
|
1557
1611
|
oe,
|
|
1558
|
-
|
|
1559
|
-
]),
|
|
1612
|
+
Ie
|
|
1613
|
+
]), Re = K.useMemo(() => jn(T(d, {
|
|
1560
1614
|
...D(t?.customSettings),
|
|
1561
1615
|
tooltipSettings: t?.tooltipSettings,
|
|
1562
|
-
categoryField:
|
|
1616
|
+
categoryField: P?.type === "gaugeV2" ? null : t?.xAxis,
|
|
1563
1617
|
chartZoom: t?.customSettings?.chartZoom,
|
|
1564
1618
|
percentageSize: t?.percentageSize,
|
|
1565
1619
|
repulsion: t?.customSettings?.repulsion,
|
|
1566
1620
|
isUseAsDifference: t?.waterfallSettings?.isUseAsDifference,
|
|
1567
1621
|
hideNullValues: t?.customSettings?.hideNullValues
|
|
1568
|
-
}),
|
|
1622
|
+
}), ve, !!ce || ve), [
|
|
1569
1623
|
d,
|
|
1570
1624
|
t,
|
|
1571
|
-
|
|
1572
|
-
|
|
1625
|
+
P?.type,
|
|
1626
|
+
ve,
|
|
1573
1627
|
ce
|
|
1574
|
-
]),
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
]),
|
|
1628
|
+
]), ze = K.useMemo(() => C(Re, S(P?.data ?? {}, De)), [
|
|
1629
|
+
Re,
|
|
1630
|
+
P?.data,
|
|
1631
|
+
De
|
|
1632
|
+
]), Be = K.useMemo(() => M ? void 0 : re(t), [M, t]), Ve = K.useMemo(() => te(re(t), "precise"), [t]), I = K.useMemo(() => t?.chartType === b.horizontalStackTable ? (t?.stackTableCols ?? []).filter(Boolean) : [], [t?.chartType, t?.stackTableCols]), He = K.useMemo(() => {
|
|
1633
|
+
if (!I.length) return 0;
|
|
1634
|
+
let e = 0;
|
|
1635
|
+
for (let t of i ?? []) e = Math.max(e, xr(t, I));
|
|
1636
|
+
return e;
|
|
1637
|
+
}, [i, I]), Ue = K.useCallback((e) => I.length ? [...e.filter((e) => !I.includes(e.key)), {
|
|
1638
|
+
key: yr,
|
|
1639
|
+
label: t?.tableSettings?.stackColAlias || ""
|
|
1640
|
+
}] : e, [I, t?.tableSettings?.stackColAlias]), We = K.useCallback((e, t, n) => t.key === yr && I.length ? /* @__PURE__ */ q(Cr, {
|
|
1641
|
+
row: n ?? {},
|
|
1642
|
+
cols: I,
|
|
1643
|
+
max: He,
|
|
1644
|
+
format: (e, t) => Ve(e, t)
|
|
1645
|
+
}) : typeof e == "number" && Number.isFinite(e) ? Ve(e, t.key) : String(e ?? ""), [
|
|
1646
|
+
Ve,
|
|
1647
|
+
I,
|
|
1648
|
+
He
|
|
1649
|
+
]), [Ge, Ke] = K.useState(null), qe = On(Ge), Je = K.useMemo(() => gn(t, qe?.surface, qe?.backdrop), [
|
|
1579
1650
|
t,
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
]),
|
|
1651
|
+
qe?.surface,
|
|
1652
|
+
qe?.backdrop
|
|
1653
|
+
]), Ye = K.useMemo(() => ye && !M && !P ? mn(t, i) : null, [
|
|
1654
|
+
ye,
|
|
1655
|
+
M,
|
|
1656
|
+
P,
|
|
1657
|
+
t,
|
|
1658
|
+
i
|
|
1659
|
+
]), L = K.useMemo(() => {
|
|
1583
1660
|
let e = k(i, t);
|
|
1584
1661
|
if (!e?.length) return !0;
|
|
1585
|
-
if (
|
|
1662
|
+
if (M) return !1;
|
|
1586
1663
|
let n = [
|
|
1587
1664
|
...t.yAxisList ?? [],
|
|
1588
1665
|
t.progressColumn,
|
|
@@ -1591,125 +1668,129 @@ var vr = ({ metric: e, chartSettings: t, data: i, isLoading: a, drillBreadcrumb:
|
|
|
1591
1668
|
return n.length ? !e.some((e) => n.some((t) => e?.[t] !== null && e?.[t] !== void 0)) : !1;
|
|
1592
1669
|
}, [
|
|
1593
1670
|
i,
|
|
1594
|
-
|
|
1671
|
+
M,
|
|
1595
1672
|
t
|
|
1596
|
-
]),
|
|
1597
|
-
"--slot-h":
|
|
1598
|
-
"--slot-w":
|
|
1673
|
+
]), Xe = {
|
|
1674
|
+
"--slot-h": Tr(ne),
|
|
1675
|
+
"--slot-w": Tr(O)
|
|
1599
1676
|
};
|
|
1600
|
-
return /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ J("div", {
|
|
1601
1678
|
"data-slot": "metric-card-chart",
|
|
1602
1679
|
"data-testid": "metric-card-chart-slot",
|
|
1603
|
-
"data-chart-engine":
|
|
1680
|
+
"data-chart-engine": P ? "v2" : void 0,
|
|
1604
1681
|
"data-chart-renderer": u,
|
|
1605
|
-
className:
|
|
1606
|
-
style:
|
|
1682
|
+
className: G("flex h-(--slot-h,auto) w-(--slot-w,100%) min-h-0 flex-1 flex-col gap-2", de),
|
|
1683
|
+
style: Xe,
|
|
1607
1684
|
children: [
|
|
1608
|
-
o != null || s != null ? /* @__PURE__ */
|
|
1685
|
+
o != null || s != null ? /* @__PURE__ */ J("div", {
|
|
1609
1686
|
"data-testid": "metric-card-drill-breadcrumb",
|
|
1610
1687
|
className: "flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1",
|
|
1611
1688
|
children: [o, s]
|
|
1612
1689
|
}) : null,
|
|
1613
|
-
a ? /* @__PURE__ */
|
|
1690
|
+
a ? /* @__PURE__ */ q(nt, { className: "flex-1" }) : /* @__PURE__ */ J(kt, { children: [/* @__PURE__ */ q("div", {
|
|
1614
1691
|
className: "min-h-0 w-full flex-1",
|
|
1615
|
-
children:
|
|
1692
|
+
children: Ye ? /* @__PURE__ */ q(Ht, {
|
|
1616
1693
|
className: "h-full",
|
|
1617
|
-
reason:
|
|
1618
|
-
section:
|
|
1619
|
-
}) :
|
|
1694
|
+
reason: Ye,
|
|
1695
|
+
section: "configure"
|
|
1696
|
+
}) : le != null && L ? le : Te && P ? /* @__PURE__ */ q(Ht, {
|
|
1697
|
+
className: "h-full",
|
|
1698
|
+
reason: Te.reason,
|
|
1699
|
+
section: Te.section
|
|
1700
|
+
}) : M ? /* @__PURE__ */ q(Kn, {
|
|
1620
1701
|
rows: i,
|
|
1621
|
-
columns:
|
|
1622
|
-
paging:
|
|
1623
|
-
isLoading: !!
|
|
1624
|
-
renderCell:
|
|
1625
|
-
onCellClick:
|
|
1626
|
-
}) :
|
|
1627
|
-
fallback: /* @__PURE__ */
|
|
1628
|
-
children: /* @__PURE__ */
|
|
1629
|
-
type:
|
|
1702
|
+
columns: Ue(Dr(f, i, !!h)),
|
|
1703
|
+
paging: h,
|
|
1704
|
+
isLoading: !!h && !!v,
|
|
1705
|
+
renderCell: We,
|
|
1706
|
+
onCellClick: _
|
|
1707
|
+
}) : P ? /* @__PURE__ */ q(K.Suspense, {
|
|
1708
|
+
fallback: /* @__PURE__ */ q(nt, { className: "h-full" }),
|
|
1709
|
+
children: /* @__PURE__ */ q(pr, {
|
|
1710
|
+
type: P.type,
|
|
1630
1711
|
family: m(t.chartType)?.family ?? void 0,
|
|
1631
|
-
data:
|
|
1632
|
-
appearance:
|
|
1633
|
-
applyDensity:
|
|
1634
|
-
mutedCategory:
|
|
1635
|
-
colorBy:
|
|
1636
|
-
valueFormatter:
|
|
1637
|
-
chartColors:
|
|
1712
|
+
data: P.data,
|
|
1713
|
+
appearance: ze,
|
|
1714
|
+
applyDensity: ye,
|
|
1715
|
+
mutedCategory: ke,
|
|
1716
|
+
colorBy: P.colorBy,
|
|
1717
|
+
valueFormatter: Be,
|
|
1718
|
+
chartColors: ge,
|
|
1638
1719
|
renderer: u,
|
|
1639
|
-
onEvents:
|
|
1720
|
+
onEvents: Le,
|
|
1640
1721
|
className: "h-full w-full"
|
|
1641
1722
|
})
|
|
1642
|
-
}) :
|
|
1723
|
+
}) : L ? /* @__PURE__ */ q(ct, {
|
|
1643
1724
|
className: "h-full",
|
|
1644
1725
|
hasActiveFilters: ue
|
|
1645
|
-
}) :
|
|
1726
|
+
}) : _r(t?.chartType) ? y(t?.chartType) === y(b.radar) ? /* @__PURE__ */ q(ct, {
|
|
1646
1727
|
className: "h-full",
|
|
1647
|
-
message:
|
|
1648
|
-
}) : /* @__PURE__ */
|
|
1649
|
-
fallback: /* @__PURE__ */
|
|
1650
|
-
children: /* @__PURE__ */
|
|
1651
|
-
ref:
|
|
1728
|
+
message: Oe ? "Radar needs one category and at least three measures. Update it in Configure." : "Radar requires the new chart engine."
|
|
1729
|
+
}) : /* @__PURE__ */ q(K.Suspense, {
|
|
1730
|
+
fallback: /* @__PURE__ */ q(nt, { className: "h-full" }),
|
|
1731
|
+
children: /* @__PURE__ */ q("div", {
|
|
1732
|
+
ref: Ke,
|
|
1652
1733
|
"data-testid": "metric-card-legacy-chart",
|
|
1653
1734
|
"data-slot": "metric-card-legacy-chart",
|
|
1654
1735
|
className: "dbn:h-full dbn:w-full h-full w-full",
|
|
1655
|
-
children: /* @__PURE__ */
|
|
1656
|
-
chartOptions:
|
|
1657
|
-
data:
|
|
1736
|
+
children: /* @__PURE__ */ q(mr, {
|
|
1737
|
+
chartOptions: Je,
|
|
1738
|
+
data: Ee,
|
|
1658
1739
|
chartAppearance: d,
|
|
1659
|
-
colors:
|
|
1740
|
+
colors: ge,
|
|
1660
1741
|
metricCardColor: "transparent",
|
|
1661
|
-
chartFontSettings:
|
|
1662
|
-
events:
|
|
1663
|
-
pivotDrillState:
|
|
1742
|
+
chartFontSettings: qe,
|
|
1743
|
+
events: Le,
|
|
1744
|
+
pivotDrillState: hr,
|
|
1664
1745
|
isMetricCard: !0,
|
|
1665
1746
|
isDashboard: !0,
|
|
1666
1747
|
className: "dbn:h-full dbn:w-full"
|
|
1667
1748
|
})
|
|
1668
1749
|
})
|
|
1669
|
-
}) : /* @__PURE__ */
|
|
1750
|
+
}) : /* @__PURE__ */ q(ct, {
|
|
1670
1751
|
className: "h-full",
|
|
1671
1752
|
message: "This chart type is no longer available. Pick another type in Configure."
|
|
1672
1753
|
})
|
|
1673
|
-
}),
|
|
1754
|
+
}), Ce ? /* @__PURE__ */ J("div", {
|
|
1674
1755
|
"data-testid": "card-truncation-footnote",
|
|
1675
1756
|
"data-slot": "metric-card-truncation-footnote",
|
|
1676
1757
|
"data-notice-slot": "metric-card-notice",
|
|
1677
|
-
title:
|
|
1758
|
+
title: N?.summary && Ce === xe ? `${Ce} - View all ${N.summary.totalCount.toLocaleString("en-US")}` : Ce,
|
|
1678
1759
|
className: "flex shrink-0 items-center overflow-hidden text-xs text-(--muted-foreground)",
|
|
1679
|
-
children: [/* @__PURE__ */
|
|
1760
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1680
1761
|
className: "truncate",
|
|
1681
|
-
children:
|
|
1682
|
-
}),
|
|
1762
|
+
children: Ce
|
|
1763
|
+
}), N?.summary && Ce === xe ? /* @__PURE__ */ J(kt, { children: [/* @__PURE__ */ q("span", {
|
|
1683
1764
|
"aria-hidden": "true",
|
|
1684
1765
|
children: " - "
|
|
1685
|
-
}), /* @__PURE__ */
|
|
1766
|
+
}), /* @__PURE__ */ J(U, {
|
|
1686
1767
|
type: "button",
|
|
1687
1768
|
variant: "link",
|
|
1688
1769
|
size: "sm",
|
|
1689
1770
|
className: "h-auto shrink-0 p-0 text-xs",
|
|
1690
1771
|
"data-testid": "card-truncation-view-all",
|
|
1691
|
-
onClick: () =>
|
|
1772
|
+
onClick: () => je("all"),
|
|
1692
1773
|
children: [
|
|
1693
1774
|
"View all",
|
|
1694
1775
|
" ",
|
|
1695
|
-
|
|
1776
|
+
N.summary.totalCount.toLocaleString("en-US")
|
|
1696
1777
|
]
|
|
1697
1778
|
})] }) : null]
|
|
1698
|
-
}) : /* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
open:
|
|
1779
|
+
}) : /* @__PURE__ */ q(er, { sentences: we })] }),
|
|
1780
|
+
/* @__PURE__ */ q(ur, {
|
|
1781
|
+
open: Ae != null,
|
|
1701
1782
|
onOpenChange: (e) => {
|
|
1702
|
-
e ||
|
|
1783
|
+
e || je(null);
|
|
1703
1784
|
},
|
|
1704
|
-
columns:
|
|
1705
|
-
rows:
|
|
1706
|
-
title:
|
|
1707
|
-
description:
|
|
1785
|
+
columns: Ne,
|
|
1786
|
+
rows: Me,
|
|
1787
|
+
title: Ae === "collapsed" ? "All Other members" : "All categories",
|
|
1788
|
+
description: Ae === "collapsed" && N?.summary ? `${N.summary.tailCount.toLocaleString("en-US")} categories are combined in ${N.summary.bucketLabel}.` : N?.summary ? `${N.summary.totalCount.toLocaleString("en-US")} categories in descending order.` : void 0
|
|
1708
1789
|
})
|
|
1709
1790
|
]
|
|
1710
1791
|
});
|
|
1711
1792
|
};
|
|
1712
|
-
function
|
|
1793
|
+
function Dr(e, t, n = !1) {
|
|
1713
1794
|
let r = e?.length ? e : Object.keys(t?.[0] ?? {});
|
|
1714
1795
|
return n ? r.map((e) => {
|
|
1715
1796
|
let n = !1;
|
|
@@ -1732,8 +1813,8 @@ function yr(e, t, n = !1) {
|
|
|
1732
1813
|
}
|
|
1733
1814
|
//#endregion
|
|
1734
1815
|
//#region src/v2/surfaces/MetricCard/CardDrillBreadcrumb.tsx
|
|
1735
|
-
var
|
|
1736
|
-
let e =
|
|
1816
|
+
var Or = "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)", kr = 4, Ar = () => {
|
|
1817
|
+
let e = K.useRef(null);
|
|
1737
1818
|
return {
|
|
1738
1819
|
navRef: e,
|
|
1739
1820
|
onKeyDown: (t) => {
|
|
@@ -1750,10 +1831,10 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
1750
1831
|
a = Math.min(Math.max(a, 0), r.length - 1), a !== i && (t.preventDefault(), r[a]?.focus());
|
|
1751
1832
|
}
|
|
1752
1833
|
};
|
|
1753
|
-
},
|
|
1754
|
-
let a = `${
|
|
1834
|
+
}, jr = ({ crumbs: e, onDrillLevelClick: t, onResetDrill: n, onUp: r, className: i }) => {
|
|
1835
|
+
let a = `${K.useId()}-drill-up-reason`, { navRef: o, onKeyDown: s } = Ar(), c = e.length, [l, u] = K.useState(null), d = l === c;
|
|
1755
1836
|
if (!e.length) return null;
|
|
1756
|
-
let f = !d && e.length >
|
|
1837
|
+
let f = !d && e.length > kr, p = f ? e.length - 3 : 0, m = f ? [
|
|
1757
1838
|
{
|
|
1758
1839
|
kind: "crumb",
|
|
1759
1840
|
crumb: e[0],
|
|
@@ -1770,16 +1851,16 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
1770
1851
|
crumb: e,
|
|
1771
1852
|
position: t
|
|
1772
1853
|
})), h = (e.length > 1 ? e[e.length - 2] : void 0)?.index, g = !h, _ = "Unavailable: this is the first level of the drill. Use All to clear the drill.";
|
|
1773
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ J("nav", {
|
|
1774
1855
|
ref: o,
|
|
1775
1856
|
"aria-label": "Drill-down breadcrumb",
|
|
1776
1857
|
"data-testid": "metric-card-drill-crumbs",
|
|
1777
1858
|
onKeyDown: r ? s : void 0,
|
|
1778
|
-
className:
|
|
1779
|
-
children: [/* @__PURE__ */
|
|
1859
|
+
className: G("flex min-w-0 flex-wrap items-center gap-1 pb-1.5 text-xs", i),
|
|
1860
|
+
children: [/* @__PURE__ */ J("div", {
|
|
1780
1861
|
className: "sticky left-0 z-10 flex shrink-0 items-center gap-1 bg-(--card) pr-1",
|
|
1781
|
-
children: [r ? /* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1862
|
+
children: [r ? /* @__PURE__ */ J(kt, { children: [
|
|
1863
|
+
/* @__PURE__ */ J("button", {
|
|
1783
1864
|
type: "button",
|
|
1784
1865
|
"aria-disabled": g || void 0,
|
|
1785
1866
|
"aria-describedby": g ? a : void 0,
|
|
@@ -1788,209 +1869,209 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
1788
1869
|
h && r(h);
|
|
1789
1870
|
},
|
|
1790
1871
|
"data-testid": "metric-card-drill-crumb-up",
|
|
1791
|
-
className:
|
|
1872
|
+
className: G(Or, "inline-flex max-w-none items-center gap-1", g && "cursor-not-allowed opacity-60 hover:text-(--muted-foreground) hover:no-underline"),
|
|
1792
1873
|
children: [
|
|
1793
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ q(Mt, {
|
|
1794
1875
|
className: "size-3",
|
|
1795
1876
|
"aria-hidden": "true"
|
|
1796
1877
|
}),
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1878
|
+
/* @__PURE__ */ q("span", { children: "Up" }),
|
|
1879
|
+
/* @__PURE__ */ q("span", {
|
|
1799
1880
|
className: "sr-only",
|
|
1800
1881
|
children: " one level"
|
|
1801
1882
|
})
|
|
1802
1883
|
]
|
|
1803
1884
|
}),
|
|
1804
|
-
g ? /* @__PURE__ */
|
|
1885
|
+
g ? /* @__PURE__ */ q("span", {
|
|
1805
1886
|
id: a,
|
|
1806
1887
|
"data-testid": "metric-card-drill-crumb-up-reason",
|
|
1807
1888
|
className: "sr-only",
|
|
1808
1889
|
children: _
|
|
1809
1890
|
}) : null,
|
|
1810
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ q("span", {
|
|
1811
1892
|
"aria-hidden": "true",
|
|
1812
1893
|
className: "mx-0.5 h-3 w-px shrink-0 bg-(--border)"
|
|
1813
1894
|
})
|
|
1814
|
-
] }) : null, /* @__PURE__ */
|
|
1895
|
+
] }) : null, /* @__PURE__ */ q("button", {
|
|
1815
1896
|
type: "button",
|
|
1816
1897
|
onClick: n,
|
|
1817
1898
|
"data-testid": "metric-card-drill-crumb-reset",
|
|
1818
|
-
className:
|
|
1899
|
+
className: Or,
|
|
1819
1900
|
children: "All"
|
|
1820
1901
|
})]
|
|
1821
1902
|
}), m.map((n, r) => {
|
|
1822
|
-
if (n.kind === "ellipsis") return /* @__PURE__ */ K
|
|
1903
|
+
if (n.kind === "ellipsis") return /* @__PURE__ */ J(K.Fragment, { children: [/* @__PURE__ */ q("span", {
|
|
1823
1904
|
"aria-hidden": "true",
|
|
1824
1905
|
className: "shrink-0 text-(--muted-foreground)",
|
|
1825
1906
|
children: "/"
|
|
1826
|
-
}), /* @__PURE__ */
|
|
1907
|
+
}), /* @__PURE__ */ q("button", {
|
|
1827
1908
|
type: "button",
|
|
1828
1909
|
onClick: () => u(c),
|
|
1829
1910
|
"data-testid": "metric-card-drill-crumb-expand",
|
|
1830
1911
|
"aria-label": `Show ${p} hidden levels`,
|
|
1831
1912
|
title: `Show ${p} hidden levels`,
|
|
1832
|
-
className:
|
|
1913
|
+
className: G(Or, "max-w-none"),
|
|
1833
1914
|
children: "..."
|
|
1834
1915
|
})] }, "ellipsis");
|
|
1835
1916
|
let { crumb: i, position: a } = n, o = a === e.length - 1, s = i.value !== void 0 && i.value !== null && i.value !== "" ? `${i.label}: ${String(i.value)}` : i.label;
|
|
1836
|
-
return /* @__PURE__ */ K
|
|
1917
|
+
return /* @__PURE__ */ J(K.Fragment, { children: [/* @__PURE__ */ q("span", {
|
|
1837
1918
|
"aria-hidden": "true",
|
|
1838
1919
|
className: "shrink-0 text-(--muted-foreground)",
|
|
1839
1920
|
children: "/"
|
|
1840
|
-
}), o ? /* @__PURE__ */
|
|
1921
|
+
}), o ? /* @__PURE__ */ q("span", {
|
|
1841
1922
|
"aria-current": "step",
|
|
1842
1923
|
title: s,
|
|
1843
1924
|
"data-testid": "metric-card-drill-crumb-current",
|
|
1844
1925
|
className: "min-w-0 max-w-full whitespace-normal break-words font-medium text-(--foreground)",
|
|
1845
1926
|
children: s
|
|
1846
|
-
}) : /* @__PURE__ */
|
|
1927
|
+
}) : /* @__PURE__ */ q("button", {
|
|
1847
1928
|
type: "button",
|
|
1848
1929
|
title: s,
|
|
1849
1930
|
onClick: () => t(i.index),
|
|
1850
1931
|
"data-testid": `metric-card-drill-crumb-${i.index}`,
|
|
1851
|
-
className:
|
|
1852
|
-
children: /* @__PURE__ */
|
|
1932
|
+
className: Or,
|
|
1933
|
+
children: /* @__PURE__ */ q("span", {
|
|
1853
1934
|
className: "max-w-48 truncate",
|
|
1854
1935
|
children: s
|
|
1855
1936
|
})
|
|
1856
1937
|
})] }, i.index || `${i.label}-${a}-${r}`);
|
|
1857
1938
|
})]
|
|
1858
1939
|
});
|
|
1859
|
-
},
|
|
1940
|
+
}, Mr = ({ longDescription: e, meta: t, className: n }) => !e && !t ? null : /* @__PURE__ */ J("div", {
|
|
1860
1941
|
"data-testid": "metric-card-footer",
|
|
1861
|
-
className:
|
|
1862
|
-
children: [t ? /* @__PURE__ */
|
|
1942
|
+
className: G("flex flex-col gap-1 text-xs text-(--muted-foreground)", n),
|
|
1943
|
+
children: [t ? /* @__PURE__ */ q("div", {
|
|
1863
1944
|
"data-testid": "metric-card-footer-meta",
|
|
1864
1945
|
children: t
|
|
1865
|
-
}) : null, e ? /* @__PURE__ */
|
|
1946
|
+
}) : null, e ? /* @__PURE__ */ q("div", {
|
|
1866
1947
|
"data-testid": "metric-card-long-description",
|
|
1867
1948
|
className: "text-(--muted-foreground)",
|
|
1868
1949
|
dangerouslySetInnerHTML: { __html: c(e) }
|
|
1869
1950
|
}) : null]
|
|
1870
|
-
}),
|
|
1951
|
+
}), Nr = ({ title: e, description: t, isDisableCardTitle: n, infoContent: r, actions: i, onTitleClick: a, className: o }) => {
|
|
1871
1952
|
let s = !n && (e != null || t != null);
|
|
1872
|
-
return /* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ J("div", {
|
|
1873
1954
|
"data-slot": "metric-card-header",
|
|
1874
|
-
className:
|
|
1875
|
-
children: [/* @__PURE__ */
|
|
1955
|
+
className: G("flex w-full items-start gap-2", o),
|
|
1956
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1876
1957
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
1877
|
-
children: s ? /* @__PURE__ */
|
|
1958
|
+
children: s ? /* @__PURE__ */ J(kt, { children: [e == null ? null : /* @__PURE__ */ J("div", {
|
|
1878
1959
|
className: "flex min-w-0 items-center gap-1",
|
|
1879
|
-
children: [a ? /* @__PURE__ */
|
|
1960
|
+
children: [a ? /* @__PURE__ */ q("h2", {
|
|
1880
1961
|
className: "min-w-0 truncate text-sm font-semibold",
|
|
1881
|
-
children: /* @__PURE__ */
|
|
1962
|
+
children: /* @__PURE__ */ q("button", {
|
|
1882
1963
|
type: "button",
|
|
1883
1964
|
"data-testid": "metric-card-title",
|
|
1884
1965
|
onClick: a,
|
|
1885
1966
|
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)",
|
|
1886
1967
|
children: e
|
|
1887
1968
|
})
|
|
1888
|
-
}) : /* @__PURE__ */
|
|
1969
|
+
}) : /* @__PURE__ */ q("h2", {
|
|
1889
1970
|
"data-testid": "metric-card-title",
|
|
1890
1971
|
className: "truncate text-sm font-semibold text-(--foreground)",
|
|
1891
1972
|
children: e
|
|
1892
|
-
}), r == null ? null : /* @__PURE__ */
|
|
1973
|
+
}), r == null ? null : /* @__PURE__ */ q(V, { children: /* @__PURE__ */ J(Xe, { children: [/* @__PURE__ */ q(Ze, {
|
|
1893
1974
|
asChild: !0,
|
|
1894
|
-
children: /* @__PURE__ */
|
|
1975
|
+
children: /* @__PURE__ */ q(U, {
|
|
1895
1976
|
type: "button",
|
|
1896
1977
|
variant: "ghost",
|
|
1897
1978
|
size: "icon-sm",
|
|
1898
1979
|
"data-testid": "metric-card-info-trigger",
|
|
1899
1980
|
"aria-label": "More information",
|
|
1900
|
-
children: /* @__PURE__ */
|
|
1981
|
+
children: /* @__PURE__ */ q(It, {
|
|
1901
1982
|
className: "size-3.5",
|
|
1902
1983
|
"aria-hidden": "true"
|
|
1903
1984
|
})
|
|
1904
1985
|
})
|
|
1905
|
-
}), /* @__PURE__ */
|
|
1986
|
+
}), /* @__PURE__ */ q(ot, {
|
|
1906
1987
|
"data-testid": "metric-card-info-content",
|
|
1907
1988
|
children: r
|
|
1908
1989
|
})] }) })]
|
|
1909
|
-
}), t == null ? null : /* @__PURE__ */
|
|
1990
|
+
}), t == null ? null : /* @__PURE__ */ q("span", {
|
|
1910
1991
|
"data-testid": "metric-card-description",
|
|
1911
1992
|
className: "truncate text-sm text-(--muted-foreground)",
|
|
1912
1993
|
children: t
|
|
1913
1994
|
})] }) : null
|
|
1914
|
-
}), i == null ? null : /* @__PURE__ */
|
|
1995
|
+
}), i == null ? null : /* @__PURE__ */ q("div", {
|
|
1915
1996
|
"data-testid": "metric-card-actions",
|
|
1916
1997
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
1917
1998
|
children: i
|
|
1918
1999
|
})]
|
|
1919
2000
|
});
|
|
1920
|
-
},
|
|
2001
|
+
}, Pr = ({ flags: e = {}, onDownloadCsv: t, onDownloadPng: n, onEmailCsv: r, onFullscreen: i, onUnderlyingData: a, onSettings: o, splitBySubmenu: s, optionsIcon: c, settingsIcon: l, defaultOpen: u, className: d }) => {
|
|
1921
2002
|
let { enableDownloadCsv: f, enableEmailCsv: p, disableDownloadPng: m, disableDownloadDataNoFilters: h = !1, disableUnderlyingData: g, disableDownloadUnderlyingDataNoFilters: _ = !1, disableFullscreen: v } = e, y = !!f && !!t, b = !m && !!n, x = !!p && !!r, S = y || b || x, ee = !v && !!i, C = !g && !!a, te = ee || C, ne = !!o, w = !!s;
|
|
1922
|
-
return !S && !te && !ne && !w ? null : /* @__PURE__ */
|
|
2003
|
+
return !S && !te && !ne && !w ? null : /* @__PURE__ */ J(L, {
|
|
1923
2004
|
defaultOpen: u,
|
|
1924
|
-
children: [/* @__PURE__ */
|
|
2005
|
+
children: [/* @__PURE__ */ q(ze, {
|
|
1925
2006
|
asChild: !0,
|
|
1926
|
-
children: /* @__PURE__ */
|
|
2007
|
+
children: /* @__PURE__ */ q(U, {
|
|
1927
2008
|
type: "button",
|
|
1928
2009
|
variant: "ghost",
|
|
1929
2010
|
size: "icon-sm",
|
|
1930
|
-
className:
|
|
2011
|
+
className: G("size-8", d),
|
|
1931
2012
|
"aria-label": "Card options",
|
|
1932
2013
|
"data-testid": "metric-card-options-trigger",
|
|
1933
|
-
children: c ?? /* @__PURE__ */
|
|
2014
|
+
children: c ?? /* @__PURE__ */ q(Nt, {})
|
|
1934
2015
|
})
|
|
1935
|
-
}), /* @__PURE__ */
|
|
2016
|
+
}), /* @__PURE__ */ J(ut, {
|
|
1936
2017
|
align: "end",
|
|
1937
2018
|
children: [
|
|
1938
2019
|
w && s,
|
|
1939
|
-
w && (S || te || ne) && /* @__PURE__ */
|
|
1940
|
-
y && /* @__PURE__ */
|
|
2020
|
+
w && (S || te || ne) && /* @__PURE__ */ q(Ke, {}),
|
|
2021
|
+
y && /* @__PURE__ */ J(R, {
|
|
1941
2022
|
className: "min-h-8",
|
|
1942
2023
|
"data-testid": "metric-card-option-download-csv",
|
|
1943
2024
|
onSelect: () => t?.({ withoutFilters: !1 }),
|
|
1944
|
-
children: [/* @__PURE__ */
|
|
2025
|
+
children: [/* @__PURE__ */ q(Y, {}), "Download CSV"]
|
|
1945
2026
|
}),
|
|
1946
|
-
y && !h && /* @__PURE__ */
|
|
2027
|
+
y && !h && /* @__PURE__ */ J(R, {
|
|
1947
2028
|
className: "min-h-8",
|
|
1948
2029
|
"data-testid": "metric-card-option-download-csv-nofilter",
|
|
1949
2030
|
onSelect: () => t?.({ withoutFilters: !0 }),
|
|
1950
|
-
children: [/* @__PURE__ */
|
|
2031
|
+
children: [/* @__PURE__ */ q(Y, {}), "Download CSV without filters"]
|
|
1951
2032
|
}),
|
|
1952
|
-
b && /* @__PURE__ */
|
|
2033
|
+
b && /* @__PURE__ */ J(R, {
|
|
1953
2034
|
className: "min-h-8",
|
|
1954
2035
|
"data-testid": "metric-card-option-download-png",
|
|
1955
2036
|
onSelect: () => n?.(),
|
|
1956
|
-
children: [/* @__PURE__ */
|
|
2037
|
+
children: [/* @__PURE__ */ q(Ft, {}), "Download PNG"]
|
|
1957
2038
|
}),
|
|
1958
|
-
x && /* @__PURE__ */
|
|
2039
|
+
x && /* @__PURE__ */ J(R, {
|
|
1959
2040
|
className: "min-h-8",
|
|
1960
2041
|
"data-testid": "metric-card-option-email-csv",
|
|
1961
2042
|
onSelect: () => r?.(),
|
|
1962
|
-
children: [/* @__PURE__ */
|
|
2043
|
+
children: [/* @__PURE__ */ q(Lt, {}), "Email CSV"]
|
|
1963
2044
|
}),
|
|
1964
|
-
S && te && /* @__PURE__ */
|
|
1965
|
-
ee && /* @__PURE__ */
|
|
2045
|
+
S && te && /* @__PURE__ */ q(Ke, {}),
|
|
2046
|
+
ee && /* @__PURE__ */ J(R, {
|
|
1966
2047
|
className: "min-h-8",
|
|
1967
2048
|
"data-testid": "metric-card-option-fullscreen",
|
|
1968
2049
|
onSelect: () => i?.(),
|
|
1969
|
-
children: [/* @__PURE__ */
|
|
2050
|
+
children: [/* @__PURE__ */ q(We, {}), "Fullscreen"]
|
|
1970
2051
|
}),
|
|
1971
|
-
C && /* @__PURE__ */
|
|
2052
|
+
C && /* @__PURE__ */ J(R, {
|
|
1972
2053
|
className: "min-h-8",
|
|
1973
2054
|
"data-testid": "metric-card-option-underlying-data",
|
|
1974
2055
|
onSelect: () => a?.({ withoutFilters: !1 }),
|
|
1975
|
-
children: [/* @__PURE__ */
|
|
2056
|
+
children: [/* @__PURE__ */ q(mt, {}), "Underlying Data"]
|
|
1976
2057
|
}),
|
|
1977
|
-
C && !_ && /* @__PURE__ */
|
|
2058
|
+
C && !_ && /* @__PURE__ */ J(R, {
|
|
1978
2059
|
className: "min-h-8",
|
|
1979
2060
|
"data-testid": "metric-card-option-underlying-data-nofilter",
|
|
1980
2061
|
onSelect: () => a?.({ withoutFilters: !0 }),
|
|
1981
|
-
children: [/* @__PURE__ */
|
|
2062
|
+
children: [/* @__PURE__ */ q(mt, {}), "Underlying Data without filters"]
|
|
1982
2063
|
}),
|
|
1983
|
-
(S || te) && ne && /* @__PURE__ */
|
|
1984
|
-
ne && /* @__PURE__ */
|
|
2064
|
+
(S || te) && ne && /* @__PURE__ */ q(Ke, {}),
|
|
2065
|
+
ne && /* @__PURE__ */ J(R, {
|
|
1985
2066
|
className: "min-h-8",
|
|
1986
2067
|
"data-testid": "metric-card-option-settings",
|
|
1987
2068
|
onSelect: () => o?.(),
|
|
1988
|
-
children: [l ?? /* @__PURE__ */
|
|
2069
|
+
children: [l ?? /* @__PURE__ */ q(Rt, {}), "Edit metric"]
|
|
1989
2070
|
})
|
|
1990
2071
|
]
|
|
1991
2072
|
})]
|
|
1992
2073
|
});
|
|
1993
|
-
},
|
|
2074
|
+
}, Fr = K.lazy(() => import("./DatePickerCalendar-BMkwOuUP.mjs")), Ir = [
|
|
1994
2075
|
{
|
|
1995
2076
|
type: "day",
|
|
1996
2077
|
label: "Today",
|
|
@@ -2057,83 +2138,83 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2057
2138
|
startOffset: 0,
|
|
2058
2139
|
endOffset: 0
|
|
2059
2140
|
}
|
|
2060
|
-
],
|
|
2141
|
+
], Lr = ({ type: e, label: t, startOffset: n, endOffset: r }) => {
|
|
2061
2142
|
let i = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date(), o = /* @__PURE__ */ new Date();
|
|
2062
2143
|
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)), {
|
|
2063
2144
|
start: a,
|
|
2064
2145
|
end: o
|
|
2065
2146
|
};
|
|
2066
|
-
},
|
|
2147
|
+
}, Rr = (e) => e ? `${e.getFullYear()}-${`0${e.getMonth() + 1}`.slice(-2)}-${`0${e.getDate()}`.slice(-2)}` : "", zr = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), Br = (e, t, n) => {
|
|
2067
2148
|
if (!e || !t) return null;
|
|
2068
|
-
let r =
|
|
2149
|
+
let r = Rr(e), i = Rr(t);
|
|
2069
2150
|
return {
|
|
2070
2151
|
value: `${r} - ${i}`,
|
|
2071
|
-
startDate:
|
|
2072
|
-
endDate:
|
|
2152
|
+
startDate: zr(e),
|
|
2153
|
+
endDate: zr(t),
|
|
2073
2154
|
timeGrainValue: n || `${r} - ${i}`
|
|
2074
2155
|
};
|
|
2075
|
-
},
|
|
2156
|
+
}, Vr = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), Hr = new Intl.DateTimeFormat("en-US", {
|
|
2076
2157
|
year: "numeric",
|
|
2077
2158
|
month: "short",
|
|
2078
2159
|
day: "numeric"
|
|
2079
|
-
}),
|
|
2080
|
-
let [u, d] =
|
|
2160
|
+
}), Ur = (e) => Hr.format(e), Wr = (e) => Ir.some((t) => t.label === e), Gr = (e, t, n) => !e || !t ? "Select date range" : n && Wr(n) ? n : `${Ur(e)} - ${Ur(t)}`, Kr = ({ value: e, onChange: t, defaultOption: n, minDate: r, maxDate: i, hideDatePickerOptions: a, calendarType: o = "default", hidden: s, defaultOpen: c, className: l }) => {
|
|
2161
|
+
let [u, d] = K.useState(e?.startDate ?? n?.startDate), [f, p] = K.useState(e?.endDate ?? n?.endDate), [m, h] = K.useState(n?.timeGrainValue ?? ""), g = K.useMemo(() => new Set((a ?? []).map((e) => e.toLowerCase())), [a]), _ = K.useMemo(() => Ir.filter((e) => !g.has(e.label.toLowerCase())), [g]);
|
|
2081
2162
|
if (s) return null;
|
|
2082
2163
|
let v = o === "ind", y = (e, n, r) => {
|
|
2083
|
-
let i =
|
|
2164
|
+
let i = Br(e, n, r);
|
|
2084
2165
|
i && t(i);
|
|
2085
2166
|
}, b = (e) => {
|
|
2086
|
-
let { start: t, end: n } =
|
|
2167
|
+
let { start: t, end: n } = Lr(e);
|
|
2087
2168
|
d(t), p(n), h(e.label), y(t, n, e.label);
|
|
2088
2169
|
}, x = (e) => {
|
|
2089
2170
|
let [t, n] = e;
|
|
2090
2171
|
if (d(t ?? void 0), p(n ?? void 0), t && n) {
|
|
2091
|
-
let e = `${
|
|
2172
|
+
let e = `${Rr(t)} - ${Rr(n)}`;
|
|
2092
2173
|
h(e), y(t, n, e);
|
|
2093
2174
|
}
|
|
2094
|
-
}, S =
|
|
2095
|
-
return /* @__PURE__ */
|
|
2175
|
+
}, S = Gr(u, f, m);
|
|
2176
|
+
return /* @__PURE__ */ J(z, {
|
|
2096
2177
|
defaultOpen: c,
|
|
2097
|
-
children: [/* @__PURE__ */
|
|
2178
|
+
children: [/* @__PURE__ */ q(et, {
|
|
2098
2179
|
asChild: !0,
|
|
2099
|
-
children: /* @__PURE__ */
|
|
2180
|
+
children: /* @__PURE__ */ J(U, {
|
|
2100
2181
|
type: "button",
|
|
2101
2182
|
variant: "outline",
|
|
2102
2183
|
size: "sm",
|
|
2103
|
-
className:
|
|
2184
|
+
className: G(l),
|
|
2104
2185
|
"aria-label": u && f ? `Select date range, currently ${S}` : "Select date range",
|
|
2105
2186
|
"data-testid": "date-picker-control-trigger",
|
|
2106
|
-
children: [/* @__PURE__ */
|
|
2187
|
+
children: [/* @__PURE__ */ q(ft, {}), S]
|
|
2107
2188
|
})
|
|
2108
|
-
}), /* @__PURE__ */
|
|
2189
|
+
}), /* @__PURE__ */ J(tt, {
|
|
2109
2190
|
align: "end",
|
|
2110
2191
|
padding: "form",
|
|
2111
|
-
className:
|
|
2192
|
+
className: G("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"),
|
|
2112
2193
|
"data-testid": "date-picker-control-content",
|
|
2113
2194
|
"data-fiscal": v,
|
|
2114
|
-
children: [/* @__PURE__ */
|
|
2195
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2115
2196
|
className: "flex w-36 shrink-0 flex-col gap-0.5 border-r border-(--border) pr-3",
|
|
2116
2197
|
"data-testid": "date-picker-control-presets",
|
|
2117
2198
|
"aria-label": "Date range presets",
|
|
2118
2199
|
children: _.map((e) => {
|
|
2119
2200
|
let t = e.label === m;
|
|
2120
|
-
return /* @__PURE__ */
|
|
2201
|
+
return /* @__PURE__ */ q(U, {
|
|
2121
2202
|
type: "button",
|
|
2122
2203
|
variant: t ? "primary" : "ghost",
|
|
2123
2204
|
size: "sm",
|
|
2124
2205
|
className: "justify-start",
|
|
2125
2206
|
"aria-pressed": t,
|
|
2126
|
-
"data-testid": `date-picker-preset-${
|
|
2207
|
+
"data-testid": `date-picker-preset-${Vr(e.label)}`,
|
|
2127
2208
|
onClick: () => b(e),
|
|
2128
2209
|
children: e.label
|
|
2129
2210
|
}, e.label);
|
|
2130
2211
|
})
|
|
2131
|
-
}), /* @__PURE__ */
|
|
2132
|
-
fallback: /* @__PURE__ */
|
|
2212
|
+
}), /* @__PURE__ */ q(K.Suspense, {
|
|
2213
|
+
fallback: /* @__PURE__ */ q("div", {
|
|
2133
2214
|
className: "h-64 w-xl",
|
|
2134
2215
|
"aria-hidden": "true"
|
|
2135
2216
|
}),
|
|
2136
|
-
children: /* @__PURE__ */
|
|
2217
|
+
children: /* @__PURE__ */ q(Fr, {
|
|
2137
2218
|
startDate: u,
|
|
2138
2219
|
endDate: f,
|
|
2139
2220
|
onChange: x,
|
|
@@ -2143,38 +2224,38 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2143
2224
|
})]
|
|
2144
2225
|
})]
|
|
2145
2226
|
});
|
|
2146
|
-
},
|
|
2227
|
+
}, qr = 12, Jr = (e) => e.groups.reduce((e, t) => e + t.options.length, 0), Yr = (e) => {
|
|
2147
2228
|
switch (e.unavailableReason) {
|
|
2148
2229
|
case "all-dimensions-used": return "This chart already uses every field you can split by.";
|
|
2149
2230
|
case "max-depth-reached": return "Go back a step to split by something else.";
|
|
2150
2231
|
case "custom-sql": return "This chart cannot be split by another field. You can still view its underlying data.";
|
|
2151
2232
|
default: return "No other fields to split by.";
|
|
2152
2233
|
}
|
|
2153
|
-
},
|
|
2154
|
-
let [i, a] =
|
|
2234
|
+
}, Xr = ({ pool: e, onDrillInto: t, testIdPrefix: n = "metric-card-drill", gestureHint: r }) => {
|
|
2235
|
+
let [i, a] = K.useState(""), o = Jr(e) > qr, s = K.useMemo(() => {
|
|
2155
2236
|
let t = i.trim().toLowerCase();
|
|
2156
2237
|
return t ? e.groups.map((e) => ({
|
|
2157
2238
|
...e,
|
|
2158
2239
|
options: e.options.filter((e) => e.label.toLowerCase().includes(t))
|
|
2159
2240
|
})).filter((e) => e.options.length > 0) : e.groups;
|
|
2160
2241
|
}, [e.groups, i]);
|
|
2161
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ J(Le, { children: [/* @__PURE__ */ J(qe, {
|
|
2162
2243
|
"data-testid": `${n}-trigger`,
|
|
2163
2244
|
children: [
|
|
2164
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ q(jt, {}),
|
|
2165
2246
|
"Split by",
|
|
2166
|
-
r ? /* @__PURE__ */
|
|
2247
|
+
r ? /* @__PURE__ */ q("span", {
|
|
2167
2248
|
"data-testid": `${n}-gesture-hint`,
|
|
2168
2249
|
className: "ml-auto shrink-0 pl-4 text-caption text-(--muted-foreground)",
|
|
2169
2250
|
children: r
|
|
2170
2251
|
}) : null
|
|
2171
2252
|
]
|
|
2172
|
-
}), /* @__PURE__ */
|
|
2173
|
-
className:
|
|
2253
|
+
}), /* @__PURE__ */ J(H, {
|
|
2254
|
+
className: G("min-w-50", rt),
|
|
2174
2255
|
"data-testid": `${n}-submenu`,
|
|
2175
|
-
children: [o ? /* @__PURE__ */
|
|
2256
|
+
children: [o ? /* @__PURE__ */ q("div", {
|
|
2176
2257
|
className: "p-1",
|
|
2177
|
-
children: /* @__PURE__ */
|
|
2258
|
+
children: /* @__PURE__ */ q("input", {
|
|
2178
2259
|
ref: (e) => {
|
|
2179
2260
|
e?.focus();
|
|
2180
2261
|
},
|
|
@@ -2186,37 +2267,37 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2186
2267
|
"data-testid": `${n}-search`,
|
|
2187
2268
|
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"
|
|
2188
2269
|
})
|
|
2189
|
-
}) : null, s.length === 0 ? /* @__PURE__ */
|
|
2190
|
-
className:
|
|
2270
|
+
}) : null, s.length === 0 ? /* @__PURE__ */ q("div", {
|
|
2271
|
+
className: Re,
|
|
2191
2272
|
"data-testid": `${n}-empty`,
|
|
2192
2273
|
"data-reason": i.trim() ? "no-search-match" : e.unavailableReason ?? "none",
|
|
2193
|
-
children: i.trim() ? `No field matches "${i.trim()}".` :
|
|
2194
|
-
}) : s.map((e) => /* @__PURE__ */ K
|
|
2274
|
+
children: i.trim() ? `No field matches "${i.trim()}".` : Yr(e)
|
|
2275
|
+
}) : s.map((e) => /* @__PURE__ */ J(K.Fragment, { children: [e.label ? /* @__PURE__ */ J(dt, {
|
|
2195
2276
|
className: "flex items-center gap-1.5",
|
|
2196
2277
|
"data-testid": `${n}-group-${e.tableName}`,
|
|
2197
2278
|
children: [
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2279
|
+
/* @__PURE__ */ q(mt, { className: "size-3 text-(--muted-foreground)" }),
|
|
2280
|
+
/* @__PURE__ */ q("span", {
|
|
2200
2281
|
className: "truncate",
|
|
2201
2282
|
children: e.label
|
|
2202
2283
|
}),
|
|
2203
|
-
e.isBaseTable ? null : /* @__PURE__ */
|
|
2284
|
+
e.isBaseTable ? null : /* @__PURE__ */ q("span", {
|
|
2204
2285
|
className: "ml-auto shrink-0 text-(--muted-foreground)",
|
|
2205
2286
|
children: "joined"
|
|
2206
2287
|
})
|
|
2207
2288
|
]
|
|
2208
|
-
}) : null, e.options.map((e) => e.isDate ? /* @__PURE__ */
|
|
2289
|
+
}) : null, e.options.map((e) => e.isDate ? /* @__PURE__ */ J(Le, { children: [/* @__PURE__ */ J(qe, {
|
|
2209
2290
|
"data-testid": `${n}-option-${e.key}`,
|
|
2210
|
-
children: [/* @__PURE__ */
|
|
2291
|
+
children: [/* @__PURE__ */ q("span", {
|
|
2211
2292
|
className: "truncate",
|
|
2212
2293
|
children: e.label
|
|
2213
|
-
}), /* @__PURE__ */
|
|
2294
|
+
}), /* @__PURE__ */ J("span", {
|
|
2214
2295
|
className: "ml-auto shrink-0 pr-1 text-caption text-(--muted-foreground)",
|
|
2215
2296
|
children: ["by ", e.column?.timeGrain ?? "month"]
|
|
2216
2297
|
})]
|
|
2217
|
-
}), /* @__PURE__ */
|
|
2298
|
+
}), /* @__PURE__ */ q(H, {
|
|
2218
2299
|
"data-testid": `${n}-grains-${e.key}`,
|
|
2219
|
-
children:
|
|
2300
|
+
children: ge.map((r) => /* @__PURE__ */ q(R, {
|
|
2220
2301
|
onSelect: () => t({
|
|
2221
2302
|
...e,
|
|
2222
2303
|
column: pe(e.column, r.value)
|
|
@@ -2224,55 +2305,55 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2224
2305
|
"data-testid": `${n}-grain-${e.key}-${r.value}`,
|
|
2225
2306
|
children: r.label
|
|
2226
2307
|
}, r.value))
|
|
2227
|
-
})] }, e.key) : /* @__PURE__ */
|
|
2308
|
+
})] }, e.key) : /* @__PURE__ */ J(R, {
|
|
2228
2309
|
onSelect: () => t(e),
|
|
2229
2310
|
"data-testid": `${n}-option-${e.key}`,
|
|
2230
|
-
children: [/* @__PURE__ */
|
|
2311
|
+
children: [/* @__PURE__ */ q("span", {
|
|
2231
2312
|
className: "truncate",
|
|
2232
2313
|
children: e.label
|
|
2233
|
-
}), /* @__PURE__ */
|
|
2314
|
+
}), /* @__PURE__ */ q("span", {
|
|
2234
2315
|
className: "ml-auto shrink-0 font-mono text-caption tracking-wide text-(--muted-foreground)",
|
|
2235
2316
|
children: e.datatype
|
|
2236
2317
|
})]
|
|
2237
2318
|
}, e.key))] }, e.tableName || "metric"))]
|
|
2238
2319
|
})] });
|
|
2239
|
-
},
|
|
2240
|
-
let t =
|
|
2241
|
-
return t.length === 0 && !r ? null : /* @__PURE__ */
|
|
2242
|
-
className:
|
|
2320
|
+
}, Zr = ({ point: e }) => {
|
|
2321
|
+
let t = je(e), n = e.measure, r = n?.formatted ?? (n?.value === void 0 ? void 0 : String(n.value));
|
|
2322
|
+
return t.length === 0 && !r ? null : /* @__PURE__ */ J("div", {
|
|
2323
|
+
className: Ue,
|
|
2243
2324
|
"data-testid": "metric-card-drill-context",
|
|
2244
|
-
children: [t.map((e) => /* @__PURE__ */
|
|
2325
|
+
children: [t.map((e) => /* @__PURE__ */ J("div", {
|
|
2245
2326
|
className: "flex items-baseline gap-3",
|
|
2246
2327
|
"data-testid": `metric-card-drill-context-${e.role}`,
|
|
2247
|
-
children: [/* @__PURE__ */
|
|
2328
|
+
children: [/* @__PURE__ */ q("span", {
|
|
2248
2329
|
className: "shrink-0 truncate text-(--muted-foreground)",
|
|
2249
2330
|
children: e.label
|
|
2250
|
-
}), /* @__PURE__ */
|
|
2331
|
+
}), /* @__PURE__ */ q("span", {
|
|
2251
2332
|
className: "ml-auto min-w-0 truncate text-right font-medium text-(--foreground)",
|
|
2252
2333
|
children: e.value
|
|
2253
2334
|
})]
|
|
2254
|
-
}, `${e.role}-${e.label}`)), r ? /* @__PURE__ */
|
|
2335
|
+
}, `${e.role}-${e.label}`)), r ? /* @__PURE__ */ J("div", {
|
|
2255
2336
|
className: "flex items-baseline gap-3 text-(--muted-foreground)",
|
|
2256
2337
|
"data-testid": "metric-card-drill-context-measure",
|
|
2257
|
-
children: [/* @__PURE__ */
|
|
2338
|
+
children: [/* @__PURE__ */ q("span", {
|
|
2258
2339
|
className: "shrink-0 truncate",
|
|
2259
2340
|
children: n?.label || n?.columnName || "Value"
|
|
2260
|
-
}), /* @__PURE__ */
|
|
2341
|
+
}), /* @__PURE__ */ q("span", {
|
|
2261
2342
|
className: "ml-auto min-w-0 truncate text-right font-medium",
|
|
2262
2343
|
children: r
|
|
2263
2344
|
})]
|
|
2264
2345
|
}) : null]
|
|
2265
2346
|
});
|
|
2266
|
-
},
|
|
2347
|
+
}, Qr = ({ point: e, onFilterTo: t, canExcludeValues: n, canFilterThisMetric: r, canFilterDashboard: i, isFilterableColumn: a }) => {
|
|
2267
2348
|
let o = e.dimensions.filter((e) => !!e.columnName && e.value !== void 0 && (a?.(e.columnName) ?? !0));
|
|
2268
2349
|
if (o.length === 0) return null;
|
|
2269
2350
|
let s = (e) => e.formatted ?? (e.value === null ? "Empty" : String(e.value)), c = (e, r, i, a) => {
|
|
2270
2351
|
if (r === "exclude" && !n) return null;
|
|
2271
2352
|
let o = r === "exclude" ? "Exclude" : i === "metric" ? "Keep only" : "Show only";
|
|
2272
|
-
return /* @__PURE__ */
|
|
2353
|
+
return /* @__PURE__ */ J(R, {
|
|
2273
2354
|
onSelect: () => t(e, r, i),
|
|
2274
2355
|
"data-testid": `metric-card-filter-${i}-${r}-${e.columnName}`,
|
|
2275
|
-
children: [
|
|
2356
|
+
children: [q(r === "exclude" ? Ie : _t, {}), /* @__PURE__ */ J("span", {
|
|
2276
2357
|
className: "truncate",
|
|
2277
2358
|
children: [
|
|
2278
2359
|
a ? `${e.label || e.columnName}: ` : "",
|
|
@@ -2282,44 +2363,44 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2282
2363
|
]
|
|
2283
2364
|
})]
|
|
2284
2365
|
}, `${i}-${r}-${e.columnName}`);
|
|
2285
|
-
}, 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__ */
|
|
2366
|
+
}, l = (e, t, n) => [c(e, "only", t, n), c(e, "exclude", t, n)], u = (e) => o.length === 1 ? l(o[0], e, !1) : o.map((t) => /* @__PURE__ */ J(Le, { children: [/* @__PURE__ */ J(qe, {
|
|
2286
2367
|
"data-testid": `metric-card-filter-${e}-dim-${t.columnName}`,
|
|
2287
2368
|
children: [
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ q(_t, {}),
|
|
2370
|
+
/* @__PURE__ */ q("span", {
|
|
2290
2371
|
className: "truncate",
|
|
2291
2372
|
children: t.label || t.columnName
|
|
2292
2373
|
}),
|
|
2293
|
-
/* @__PURE__ */
|
|
2374
|
+
/* @__PURE__ */ q("span", {
|
|
2294
2375
|
className: "ml-auto shrink-0 truncate pl-4 text-caption text-(--muted-foreground)",
|
|
2295
2376
|
children: s(t)
|
|
2296
2377
|
})
|
|
2297
2378
|
]
|
|
2298
|
-
}), /* @__PURE__ */
|
|
2299
|
-
return /* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2379
|
+
}), /* @__PURE__ */ q(H, { children: l(t, e, !1) })] }, `${e}-${t.columnName}`));
|
|
2380
|
+
return /* @__PURE__ */ J(kt, { children: [r ? /* @__PURE__ */ J(kt, { children: [
|
|
2381
|
+
/* @__PURE__ */ q(Ke, {}),
|
|
2382
|
+
/* @__PURE__ */ q(dt, {
|
|
2302
2383
|
"data-testid": "metric-card-filter-metric-label",
|
|
2303
2384
|
children: "Filter this chart"
|
|
2304
2385
|
}),
|
|
2305
2386
|
u("metric")
|
|
2306
|
-
] }) : null, i ? /* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2308
|
-
/* @__PURE__ */
|
|
2387
|
+
] }) : null, i ? /* @__PURE__ */ J(kt, { children: [
|
|
2388
|
+
/* @__PURE__ */ q(Ke, {}),
|
|
2389
|
+
/* @__PURE__ */ q(dt, {
|
|
2309
2390
|
"data-testid": "metric-card-filter-label",
|
|
2310
2391
|
children: "Filter this dashboard"
|
|
2311
2392
|
}),
|
|
2312
2393
|
u("dashboard")
|
|
2313
2394
|
] }) : null] });
|
|
2314
|
-
},
|
|
2395
|
+
}, $r = ({ open: e, onOpenChange: t, anchor: n, point: r, pool: i, onDrillInto: a, canSplitBy: o = !0, onViewUnderlyingData: s, onCopyValue: c, onFilterTo: l, canExcludeValues: u = !1, canFilterThisMetric: d = !1, canFilterDashboard: f = !1, isFilterableColumn: p, defaultOpen: m, className: h }) => {
|
|
2315
2396
|
let g = me(r);
|
|
2316
|
-
return /* @__PURE__ */
|
|
2397
|
+
return /* @__PURE__ */ J(L, {
|
|
2317
2398
|
open: e,
|
|
2318
2399
|
onOpenChange: t,
|
|
2319
2400
|
defaultOpen: m,
|
|
2320
|
-
children: [/* @__PURE__ */
|
|
2401
|
+
children: [/* @__PURE__ */ q(ze, {
|
|
2321
2402
|
asChild: !0,
|
|
2322
|
-
children: /* @__PURE__ */
|
|
2403
|
+
children: /* @__PURE__ */ q("span", {
|
|
2323
2404
|
"aria-hidden": "true",
|
|
2324
2405
|
"data-testid": "metric-card-drill-anchor",
|
|
2325
2406
|
className: "pointer-events-none absolute top-(--drill-anchor-y) left-(--drill-anchor-x) block size-0",
|
|
@@ -2328,28 +2409,28 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2328
2409
|
"--drill-anchor-y": `${n?.y ?? 0}px`
|
|
2329
2410
|
}
|
|
2330
2411
|
})
|
|
2331
|
-
}), /* @__PURE__ */
|
|
2412
|
+
}), /* @__PURE__ */ J(ut, {
|
|
2332
2413
|
align: "start",
|
|
2333
2414
|
size: "sm",
|
|
2334
|
-
className:
|
|
2415
|
+
className: G("dbn-v2-above-chart-tip min-w-56 max-w-80", h),
|
|
2335
2416
|
"data-testid": "metric-card-drill-menu",
|
|
2336
2417
|
children: [
|
|
2337
|
-
r ? /* @__PURE__ */
|
|
2338
|
-
c && g ? /* @__PURE__ */
|
|
2418
|
+
r ? /* @__PURE__ */ q(Zr, { point: r }) : null,
|
|
2419
|
+
c && g ? /* @__PURE__ */ J(R, {
|
|
2339
2420
|
onSelect: () => c(g),
|
|
2340
2421
|
"data-testid": "metric-card-drill-copy",
|
|
2341
|
-
children: [/* @__PURE__ */
|
|
2422
|
+
children: [/* @__PURE__ */ q(At, {}), "Copy value"]
|
|
2342
2423
|
}) : null,
|
|
2343
|
-
o ? /* @__PURE__ */
|
|
2424
|
+
o ? /* @__PURE__ */ q(Xr, {
|
|
2344
2425
|
pool: i,
|
|
2345
2426
|
onDrillInto: a
|
|
2346
2427
|
}) : null,
|
|
2347
|
-
s ? /* @__PURE__ */
|
|
2428
|
+
s ? /* @__PURE__ */ J(R, {
|
|
2348
2429
|
onSelect: s,
|
|
2349
2430
|
"data-testid": "metric-card-drill-underlying-data",
|
|
2350
|
-
children: [/* @__PURE__ */
|
|
2431
|
+
children: [/* @__PURE__ */ q(mt, {}), "View underlying data"]
|
|
2351
2432
|
}) : null,
|
|
2352
|
-
r && l ? /* @__PURE__ */
|
|
2433
|
+
r && l ? /* @__PURE__ */ q(Qr, {
|
|
2353
2434
|
point: r,
|
|
2354
2435
|
onFilterTo: l,
|
|
2355
2436
|
canExcludeValues: u,
|
|
@@ -2360,28 +2441,28 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2360
2441
|
]
|
|
2361
2442
|
})]
|
|
2362
2443
|
});
|
|
2363
|
-
},
|
|
2444
|
+
}, ei = ({ open: e, onOpenChange: t, onDownload: n, onEmail: r, rows: i, customMessages: a = {} }) => {
|
|
2364
2445
|
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.");
|
|
2365
|
-
return /* @__PURE__ */
|
|
2446
|
+
return /* @__PURE__ */ q(Et, {
|
|
2366
2447
|
open: e,
|
|
2367
2448
|
onOpenChange: t,
|
|
2368
|
-
children: /* @__PURE__ */
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ J(Ct, { children: [
|
|
2450
|
+
/* @__PURE__ */ q(xt, { children: /* @__PURE__ */ q(wt, { children: o }) }),
|
|
2451
|
+
/* @__PURE__ */ q(Tt, { children: f }),
|
|
2452
|
+
/* @__PURE__ */ J(St, { children: [
|
|
2453
|
+
/* @__PURE__ */ q(U, {
|
|
2373
2454
|
type: "button",
|
|
2374
2455
|
variant: "outline",
|
|
2375
2456
|
onClick: () => t(!1),
|
|
2376
2457
|
children: u
|
|
2377
2458
|
}),
|
|
2378
|
-
r && /* @__PURE__ */
|
|
2459
|
+
r && /* @__PURE__ */ q(U, {
|
|
2379
2460
|
type: "button",
|
|
2380
2461
|
variant: "outline",
|
|
2381
2462
|
onClick: r,
|
|
2382
2463
|
children: l
|
|
2383
2464
|
}),
|
|
2384
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ q(U, {
|
|
2385
2466
|
type: "button",
|
|
2386
2467
|
onClick: n,
|
|
2387
2468
|
children: c
|
|
@@ -2389,37 +2470,37 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2389
2470
|
] })
|
|
2390
2471
|
] })
|
|
2391
2472
|
});
|
|
2392
|
-
},
|
|
2473
|
+
}, ti = ({ open: t, onOpenChange: n, metric: r, chartSettings: i, data: a, chartColors: o, chartAppearance: s, chartRendererType: c, title: l, isLoading: u = !1, error: d, isJoinMismatch: f = !1, hasActiveFilters: p, onRetry: m, copyProps: h = {} }) => {
|
|
2393
2474
|
let g = d ? e(d, { resourceKind: "metric" }) : void 0, _ = g?.retryable !== !1, v = i?.chartType === b.singleValue, y = !a?.length || !i?.chartType;
|
|
2394
|
-
return /* @__PURE__ */
|
|
2475
|
+
return /* @__PURE__ */ q(Et, {
|
|
2395
2476
|
open: t,
|
|
2396
2477
|
onOpenChange: n,
|
|
2397
|
-
children: /* @__PURE__ */
|
|
2478
|
+
children: /* @__PURE__ */ J(Ct, {
|
|
2398
2479
|
"data-testid": "fullscreen-dialog-content",
|
|
2399
2480
|
showCloseButton: !1,
|
|
2400
2481
|
className: v ? "flex h-fit max-h-9/10 w-19/20 max-w-lg flex-col sm:max-w-lg" : "flex h-9/10 max-h-9/10 w-19/20 max-w-19/20 flex-col sm:max-w-19/20",
|
|
2401
2482
|
children: [
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ q(xt, { children: /* @__PURE__ */ q(wt, { children: l ?? r?.name ?? r?.metricName ?? "Metric" }) }),
|
|
2484
|
+
/* @__PURE__ */ q("div", {
|
|
2404
2485
|
className: "flex min-h-0 w-full flex-1 flex-col gap-3",
|
|
2405
|
-
children: /* @__PURE__ */
|
|
2486
|
+
children: /* @__PURE__ */ q("div", {
|
|
2406
2487
|
className: v ? "h-44 w-full shrink-0" : "min-h-0 w-full flex-1",
|
|
2407
2488
|
"data-testid": "fullscreen-dialog-chart-region",
|
|
2408
|
-
children: u ? /* @__PURE__ */
|
|
2489
|
+
children: u ? /* @__PURE__ */ q(nt, { className: "h-full" }) : d ? /* @__PURE__ */ q(at, {
|
|
2409
2490
|
error: g,
|
|
2410
2491
|
onRetry: _ ? m : void 0,
|
|
2411
2492
|
...h
|
|
2412
|
-
}) : f ? /* @__PURE__ */
|
|
2493
|
+
}) : f ? /* @__PURE__ */ q("div", {
|
|
2413
2494
|
"data-testid": "card-join-mismatch-state",
|
|
2414
2495
|
"data-slot": "metric-card-join-mismatch",
|
|
2415
|
-
children: /* @__PURE__ */
|
|
2416
|
-
error: e(
|
|
2496
|
+
children: /* @__PURE__ */ q(at, {
|
|
2497
|
+
error: e(P("column")),
|
|
2417
2498
|
...h
|
|
2418
2499
|
})
|
|
2419
|
-
}) : y ? /* @__PURE__ */
|
|
2500
|
+
}) : y ? /* @__PURE__ */ q(ct, {
|
|
2420
2501
|
className: "h-full",
|
|
2421
2502
|
hasActiveFilters: p
|
|
2422
|
-
}) : /* @__PURE__ */
|
|
2503
|
+
}) : /* @__PURE__ */ q(Er, {
|
|
2423
2504
|
hasActiveFilters: p,
|
|
2424
2505
|
metric: r,
|
|
2425
2506
|
chartSettings: i,
|
|
@@ -2433,7 +2514,7 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2433
2514
|
})
|
|
2434
2515
|
})
|
|
2435
2516
|
}),
|
|
2436
|
-
/* @__PURE__ */
|
|
2517
|
+
/* @__PURE__ */ q(St, { children: /* @__PURE__ */ q(U, {
|
|
2437
2518
|
type: "button",
|
|
2438
2519
|
variant: "outline",
|
|
2439
2520
|
onClick: () => n(!1),
|
|
@@ -2442,8 +2523,8 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2442
2523
|
]
|
|
2443
2524
|
})
|
|
2444
2525
|
});
|
|
2445
|
-
},
|
|
2446
|
-
let [o, s] =
|
|
2526
|
+
}, ni = ({ filters: e, onChange: t, position: n = "inside", multi: r = !1, defaultOpen: i, className: a }) => {
|
|
2527
|
+
let [o, s] = K.useState({}), c = K.useMemo(() => Object.values(o).filter((e) => Array.isArray(e) ? e.length > 0 : !!e).length, [o]), l = K.useMemo(() => Object.fromEntries(e.map((e) => [e.id, new Set(o[e.id] ?? [])])), [e, o]);
|
|
2447
2528
|
if (!e?.length) return null;
|
|
2448
2529
|
let u = (e) => {
|
|
2449
2530
|
s(e), t(e);
|
|
@@ -2459,58 +2540,58 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2459
2540
|
[e]: i
|
|
2460
2541
|
});
|
|
2461
2542
|
};
|
|
2462
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ J(z, {
|
|
2463
2544
|
defaultOpen: i,
|
|
2464
|
-
children: [/* @__PURE__ */
|
|
2545
|
+
children: [/* @__PURE__ */ q(et, {
|
|
2465
2546
|
asChild: !0,
|
|
2466
|
-
children: /* @__PURE__ */
|
|
2547
|
+
children: /* @__PURE__ */ J(U, {
|
|
2467
2548
|
type: "button",
|
|
2468
2549
|
variant: "outline",
|
|
2469
2550
|
size: "sm",
|
|
2470
|
-
className:
|
|
2551
|
+
className: G(a),
|
|
2471
2552
|
"aria-label": "Metric filters",
|
|
2472
2553
|
"data-testid": "metric-filter-control-trigger",
|
|
2473
2554
|
"data-position": n,
|
|
2474
2555
|
children: [
|
|
2475
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ q(_t, {}),
|
|
2476
2557
|
"Filters",
|
|
2477
2558
|
c ? ` (${c})` : ""
|
|
2478
2559
|
]
|
|
2479
2560
|
})
|
|
2480
|
-
}), /* @__PURE__ */
|
|
2561
|
+
}), /* @__PURE__ */ q(tt, {
|
|
2481
2562
|
align: n === "outside" ? "start" : "end",
|
|
2482
2563
|
size: "lg",
|
|
2483
2564
|
padding: "form",
|
|
2484
2565
|
"data-testid": "metric-filter-control-content",
|
|
2485
|
-
children: /* @__PURE__ */
|
|
2566
|
+
children: /* @__PURE__ */ q("div", {
|
|
2486
2567
|
className: "flex flex-col gap-4",
|
|
2487
|
-
children: e.map((e) => /* @__PURE__ */
|
|
2568
|
+
children: e.map((e) => /* @__PURE__ */ J("div", {
|
|
2488
2569
|
className: "flex flex-col gap-1.5",
|
|
2489
|
-
children: [/* @__PURE__ */
|
|
2570
|
+
children: [/* @__PURE__ */ q("span", {
|
|
2490
2571
|
className: "text-xs font-medium text-(--muted-foreground)",
|
|
2491
2572
|
children: e.label
|
|
2492
|
-
}), r ? /* @__PURE__ */
|
|
2573
|
+
}), r ? /* @__PURE__ */ q("div", {
|
|
2493
2574
|
className: "flex flex-col gap-1.5",
|
|
2494
2575
|
children: e.options.map((t) => {
|
|
2495
2576
|
let n = l[e.id]?.has(t);
|
|
2496
|
-
return /* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ J("label", {
|
|
2497
2578
|
className: "flex cursor-pointer items-center gap-2 text-sm text-(--foreground)",
|
|
2498
|
-
children: [/* @__PURE__ */
|
|
2579
|
+
children: [/* @__PURE__ */ q(pt, {
|
|
2499
2580
|
checked: n,
|
|
2500
2581
|
onCheckedChange: (n) => f(e.id, t, n === !0),
|
|
2501
2582
|
"data-testid": `metric-filter-option-${e.id}-${t}`
|
|
2502
2583
|
}), t]
|
|
2503
2584
|
}, t);
|
|
2504
2585
|
})
|
|
2505
|
-
}) : /* @__PURE__ */
|
|
2586
|
+
}) : /* @__PURE__ */ J(it, {
|
|
2506
2587
|
value: o[e.id] ?? "",
|
|
2507
2588
|
onValueChange: (t) => d(e.id, t),
|
|
2508
|
-
children: [/* @__PURE__ */
|
|
2589
|
+
children: [/* @__PURE__ */ q($e, {
|
|
2509
2590
|
size: "sm",
|
|
2510
2591
|
className: "w-full",
|
|
2511
2592
|
"data-testid": `metric-filter-select-${e.id}`,
|
|
2512
|
-
children: /* @__PURE__ */
|
|
2513
|
-
}), /* @__PURE__ */
|
|
2593
|
+
children: /* @__PURE__ */ q(st, { placeholder: "All" })
|
|
2594
|
+
}), /* @__PURE__ */ q(lt, { children: e.options.map((e) => /* @__PURE__ */ q(Qe, {
|
|
2514
2595
|
value: e,
|
|
2515
2596
|
children: e
|
|
2516
2597
|
}, e)) })]
|
|
@@ -2519,15 +2600,15 @@ var br = "inline-flex min-h-7 max-w-full shrink-0 items-center rounded-(--radius
|
|
|
2519
2600
|
})
|
|
2520
2601
|
})]
|
|
2521
2602
|
});
|
|
2522
|
-
},
|
|
2603
|
+
}, ri = (e) => {
|
|
2523
2604
|
let t = e.target;
|
|
2524
2605
|
t instanceof Element && t.closest("table") || e.preventDefault();
|
|
2525
2606
|
};
|
|
2526
2607
|
function $(...e) {
|
|
2527
2608
|
return e.find((e) => e !== void 0);
|
|
2528
2609
|
}
|
|
2529
|
-
var
|
|
2530
|
-
function
|
|
2610
|
+
var ii = "__dbnMetricDrillMenu";
|
|
2611
|
+
function ai(e) {
|
|
2531
2612
|
return e ? e.getConnectedDataURL({
|
|
2532
2613
|
type: "png",
|
|
2533
2614
|
pixelRatio: 2,
|
|
@@ -2535,91 +2616,91 @@ function Zr(e) {
|
|
|
2535
2616
|
backgroundColor: "#fff"
|
|
2536
2617
|
}) : "#";
|
|
2537
2618
|
}
|
|
2538
|
-
var
|
|
2539
|
-
function
|
|
2619
|
+
var oi = 5e3, si = {}, ci = 2e5;
|
|
2620
|
+
function li(e, t) {
|
|
2540
2621
|
let n = ae(e), r = new Blob(["", n], { type: "text/csv;charset=utf-8;" }), i = URL.createObjectURL(r);
|
|
2541
2622
|
try {
|
|
2542
|
-
|
|
2623
|
+
ui(i, t);
|
|
2543
2624
|
} finally {
|
|
2544
2625
|
setTimeout(() => URL.revokeObjectURL(i), 0);
|
|
2545
2626
|
}
|
|
2546
2627
|
}
|
|
2547
|
-
function
|
|
2628
|
+
function ui(e, t) {
|
|
2548
2629
|
if (!e || e === "#") return;
|
|
2549
2630
|
let n = document.createElement("a");
|
|
2550
2631
|
n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
2551
2632
|
}
|
|
2552
|
-
function
|
|
2633
|
+
function di(e) {
|
|
2553
2634
|
if (e == null) return "";
|
|
2554
2635
|
if (typeof e == "string") return e;
|
|
2555
2636
|
if (typeof e == "number") return String(e);
|
|
2556
2637
|
let t = e;
|
|
2557
2638
|
return String(t.label ?? t.value ?? t.name ?? "");
|
|
2558
2639
|
}
|
|
2559
|
-
function
|
|
2640
|
+
function fi(e) {
|
|
2560
2641
|
return e?.length ? e.filter((e) => e && !e.isHiddenInUi).map((e) => ({
|
|
2561
2642
|
id: String(e.name),
|
|
2562
2643
|
label: String(e.name),
|
|
2563
|
-
options: Array.isArray(e.options) ? e.options.map(
|
|
2644
|
+
options: Array.isArray(e.options) ? e.options.map(di).filter(Boolean) : []
|
|
2564
2645
|
})) : [];
|
|
2565
2646
|
}
|
|
2566
|
-
function
|
|
2647
|
+
function pi(e) {
|
|
2567
2648
|
let t = (Array.isArray(e?.options) ? e.options : []).find((e) => e?.range === "Date Range");
|
|
2568
2649
|
if (t?.startDate && t?.endDate && e?.value) return {
|
|
2569
|
-
startDate:
|
|
2570
|
-
endDate:
|
|
2650
|
+
startDate: v(t.startDate),
|
|
2651
|
+
endDate: v(t.endDate),
|
|
2571
2652
|
timeGrainValue: t.timeGrainValue || "",
|
|
2572
2653
|
value: ""
|
|
2573
2654
|
};
|
|
2574
2655
|
}
|
|
2575
|
-
function
|
|
2576
|
-
if (e != null) return typeof e == "string" ? e === "download" ? /* @__PURE__ */
|
|
2656
|
+
function mi(e) {
|
|
2657
|
+
if (e != null) return typeof e == "string" ? e === "download" ? /* @__PURE__ */ q(Y, {}) : e === "kebab-menu-vertical" ? void 0 : e.trimStart().startsWith("<") ? /* @__PURE__ */ q("span", { dangerouslySetInnerHTML: { __html: c(e) } }) : void 0 : e;
|
|
2577
2658
|
}
|
|
2578
|
-
var
|
|
2579
|
-
let { metricItem: r, metric: s, isDisableCardTitle: l, isShadowDisableOnHover: u, hideMetricCardShadow: d, disableBorder: f, disableMetricCardBorder: p, isMergedMetric: m, colors: h, chartColors:
|
|
2659
|
+
var hi = (n) => {
|
|
2660
|
+
let { metricItem: r, metric: s, isDisableCardTitle: l, isShadowDisableOnHover: u, hideMetricCardShadow: d, disableBorder: f, disableMetricCardBorder: p, isMergedMetric: m, colors: h, chartColors: _, chartRendererType: v, chartAppearance: y, appearanceOptions: x, chartColumns: S, chartHeight: ee, width: C, optionsIcon: te, settingsIcon: ne, noDataImg: w, noDataFoundSvg: T, enableDownloadCsv: E, enableEmailCsv: D, onDownloadRawCsv: ie, onServerEvent: O, disableDownloadPng: k, disableDownloadDataNoFilters: A, disableDownloadUnderlyingDataNoFilters: ae, disableUnderlyingData: ce, isAllowedToSeeUnderlyingData: de, disableFullscreen: pe, enableTitleClickFullscreen: me, canEditMetric: he, onEditMetric: ge, language: _e, translationDictionary: ve, customMessages: Ae, className: je, metricFilterPosition: Me, enableMultiMetricFilters: Ne, clientColumnType: Fe, hideDatePickerOptions: F, calendarType: Ie, enableAdhocDrill: Le, enableExcludeFilter: Re, enableCrossFilter: ze, enableCrossFilterBeforeDrill: Be, enableTablePaging: Ve, enableFormattedUnderlyingData: I, enableCoverageTruncation: He, enableFilteredEmptyState: Ue, onClearAllFilters: Ge, isEditLayoutEnabled: Ke, isDisableMerge: qe, setOpenMergeModal: Je, knownCause: Ye } = n, L = r ?? s, { data: Xe } = i(), R = Xe?.clientSubsetData, { client: Ze, param: Qe, companyTenancyType: $e, encryptedClient: et, isJoinMismatch: tt, userProvidedDashboardId: rt } = n, it = {
|
|
2580
2661
|
...n,
|
|
2581
|
-
metric:
|
|
2582
|
-
clientId:
|
|
2583
|
-
encryptedClientId:
|
|
2584
|
-
tenancyLevel:
|
|
2585
|
-
rlsFilters:
|
|
2586
|
-
isDisableQuery: !!
|
|
2587
|
-
dashboardId:
|
|
2588
|
-
},
|
|
2589
|
-
o("card",
|
|
2590
|
-
let { emptyCard:
|
|
2591
|
-
customMessages:
|
|
2592
|
-
translationDictionary:
|
|
2593
|
-
selectedLanguage:
|
|
2594
|
-
},
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
}, [
|
|
2598
|
-
let [
|
|
2662
|
+
metric: L,
|
|
2663
|
+
clientId: Ze,
|
|
2664
|
+
encryptedClientId: et,
|
|
2665
|
+
tenancyLevel: $e,
|
|
2666
|
+
rlsFilters: Qe,
|
|
2667
|
+
isDisableQuery: !!tt,
|
|
2668
|
+
dashboardId: rt
|
|
2669
|
+
}, z = N(it), ot = !!$(z.isQueryLoading, z.isLoading), st = !!z.isMetricUpdating && !ot, B = K.useMemo(() => $(z.dataDb, z.data) ?? [], [z.dataDb, z.data]), V = $(z.queryError, z.error), lt = he && a(V) ? V.message : void 0, ut = $(z.refetchMetricData, z.refetch), H = z.chartSettings ?? L?.chartOptions, dt = !!z.isSingleValueNull, ft = $(z.metricName, L?.name, L?.metricName), pt = $(z.description, L?.description), mt = z.longDescription, ht = z.footNote, gt = mt ? /* @__PURE__ */ q("span", { dangerouslySetInnerHTML: { __html: c(mt) } }) : void 0, W = K.useMemo(() => V ? Ee(V) : void 0, [V]);
|
|
2670
|
+
o("card", W, { metricId: L?.metricId ?? L?.id });
|
|
2671
|
+
let { emptyCard: _t } = se(), yt = {
|
|
2672
|
+
customMessages: Ae,
|
|
2673
|
+
translationDictionary: ve,
|
|
2674
|
+
selectedLanguage: _e
|
|
2675
|
+
}, bt = !!($(f, p) || m), xt = !!$(u, d) || bt, St = $(h, _), [Ct, wt] = K.useState(!1), [Tt, Et] = K.useState(!1), [Dt, Ot] = K.useState(!1), [At, jt] = K.useState(!1), [Mt, Y] = K.useState(null), Nt = K.useCallback(() => Y(null), []), Ft = K.useRef(!1);
|
|
2676
|
+
K.useEffect(() => {
|
|
2677
|
+
Y(null);
|
|
2678
|
+
}, [L?.id]);
|
|
2679
|
+
let [It, Lt] = K.useState([]), [Rt, zt] = K.useState(!1), Bt = K.useMemo(() => Object.keys(It[0] ?? {}).map((e) => ({
|
|
2599
2680
|
key: e,
|
|
2600
2681
|
label: e
|
|
2601
|
-
})), [
|
|
2682
|
+
})), [It]), [Vt, Ht] = K.useState({
|
|
2602
2683
|
limit: 100,
|
|
2603
2684
|
offset: 0
|
|
2604
|
-
}), [
|
|
2685
|
+
}), [Ut, Gt] = K.useState(0), [Yt, Xt] = K.useState({
|
|
2605
2686
|
isRunning: !1,
|
|
2606
2687
|
fetchedRows: 0
|
|
2607
|
-
}),
|
|
2608
|
-
enableAdhocDrill:
|
|
2609
|
-
enableExcludeFilter:
|
|
2610
|
-
enableCrossFilter:
|
|
2688
|
+
}), Zt = K.useRef(!1), [Qt, $t] = K.useState(null), en = z.handleChartClick, tn = K.useMemo(() => oe(Xe, {
|
|
2689
|
+
enableAdhocDrill: Le,
|
|
2690
|
+
enableExcludeFilter: Re,
|
|
2691
|
+
enableCrossFilter: ze,
|
|
2611
2692
|
disableUnderlyingData: ce,
|
|
2612
|
-
enableTablePaging:
|
|
2613
|
-
enableFormattedUnderlyingData:
|
|
2693
|
+
enableTablePaging: Ve,
|
|
2694
|
+
enableFormattedUnderlyingData: I
|
|
2614
2695
|
}), [
|
|
2615
|
-
|
|
2696
|
+
Xe,
|
|
2697
|
+
Le,
|
|
2616
2698
|
Re,
|
|
2617
2699
|
ze,
|
|
2618
|
-
Be,
|
|
2619
2700
|
ce,
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
]),
|
|
2701
|
+
Ve,
|
|
2702
|
+
I
|
|
2703
|
+
]), X = tn.canDrillIntoAnyDimension, nn = tn.canCrossFilter, rn = {
|
|
2623
2704
|
enableDownloadCsv: E,
|
|
2624
2705
|
enableEmailCsv: !!$(D, ie ? !0 : void 0),
|
|
2625
2706
|
disableDownloadPng: k,
|
|
@@ -2627,121 +2708,121 @@ var si = (n) => {
|
|
|
2627
2708
|
disableDownloadUnderlyingDataNoFilters: !!ae,
|
|
2628
2709
|
disableUnderlyingData: $(ce, de === void 0 ? void 0 : !de),
|
|
2629
2710
|
disableFullscreen: !!pe
|
|
2630
|
-
},
|
|
2711
|
+
}, an = !pe, on = !rn.disableUnderlyingData, sn = X || on, cn = tn.canPageThroughLargeTables, ln = tn.canReadFormattedUnderlyingData, [un, dn] = K.useState({
|
|
2631
2712
|
open: !1,
|
|
2632
2713
|
anchor: null,
|
|
2633
2714
|
params: null
|
|
2634
|
-
}),
|
|
2635
|
-
typeof window < "u" && !
|
|
2715
|
+
}), fn = K.useId(), pn = K.useRef(!1), mn = K.useCallback((e) => {
|
|
2716
|
+
typeof window < "u" && !un.open && window.history.state?.[ii] !== fn && (pn.current = !1, window.history.pushState({
|
|
2636
2717
|
...window.history.state,
|
|
2637
|
-
[
|
|
2638
|
-
}, "")),
|
|
2639
|
-
}, [
|
|
2640
|
-
|
|
2718
|
+
[ii]: fn
|
|
2719
|
+
}, "")), dn(e);
|
|
2720
|
+
}, [un.open, fn]), hn = K.useCallback(() => {
|
|
2721
|
+
dn((e) => ({
|
|
2641
2722
|
...e,
|
|
2642
2723
|
open: !1
|
|
2643
|
-
})), typeof window < "u" && !
|
|
2644
|
-
}, [
|
|
2645
|
-
|
|
2724
|
+
})), typeof window < "u" && !pn.current && window.history.state?.[ii] === fn && (pn.current = !0, window.history.back());
|
|
2725
|
+
}, [fn]);
|
|
2726
|
+
K.useEffect(() => {
|
|
2646
2727
|
if (typeof window > "u") return;
|
|
2647
2728
|
let e = () => {
|
|
2648
|
-
|
|
2729
|
+
pn.current = !1, dn((e) => ({
|
|
2649
2730
|
...e,
|
|
2650
2731
|
open: !1
|
|
2651
2732
|
}));
|
|
2652
2733
|
};
|
|
2653
2734
|
return window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e);
|
|
2654
2735
|
}, []);
|
|
2655
|
-
let
|
|
2656
|
-
subset:
|
|
2657
|
-
configuration:
|
|
2658
|
-
selectedDims:
|
|
2659
|
-
config:
|
|
2660
|
-
isCustomSql: !!
|
|
2736
|
+
let gn = z.drillDownSettings, _n = K.useMemo(() => gn?.configV2?.levels ?? [], [gn?.configV2?.levels]), vn = qt(gn?.configV2), yn = vn.activeLevel, bn = yn?.dimensions?.[0]?.alias || H?.xAxis || L?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.[0]?.alias, xn = K.useMemo(() => X ? Jt({
|
|
2737
|
+
subset: R,
|
|
2738
|
+
configuration: L?.datasetMetricSettings?.newDatasetSettings?.configuration,
|
|
2739
|
+
selectedDims: L?.datasetMetricSettings?.newDatasetSettings?.selectedDims,
|
|
2740
|
+
config: gn?.configV2,
|
|
2741
|
+
isCustomSql: !!L?.datasetMetricSettings?.isUseRawSQL
|
|
2661
2742
|
}) : { groups: [] }, [
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
]),
|
|
2667
|
-
chartType:
|
|
2668
|
-
isDrillEnabled:
|
|
2669
|
-
dimensions:
|
|
2670
|
-
drilledLevel:
|
|
2671
|
-
drillLevels:
|
|
2743
|
+
X,
|
|
2744
|
+
R,
|
|
2745
|
+
L,
|
|
2746
|
+
gn?.configV2
|
|
2747
|
+
]), Sn = xn.groups.some((e) => e.options.length > 0), Cn = z.onDrillIntoDimension, wn = z.onDrillLevelClick, Tn = z.onDrillDown, En = z.onFilterDashboardTo, Dn = z.onFilterMetricTo, On = K.useMemo(() => Ce({
|
|
2748
|
+
chartType: H?.chartType,
|
|
2749
|
+
isDrillEnabled: L?.drillDownSettings?.isEnableGroupBy,
|
|
2750
|
+
dimensions: z.dimensions,
|
|
2751
|
+
drilledLevel: z.drilledLevel,
|
|
2752
|
+
drillLevels: _n
|
|
2672
2753
|
}), [
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
]),
|
|
2679
|
-
if (!
|
|
2680
|
-
let t =
|
|
2681
|
-
columnName:
|
|
2682
|
-
value:
|
|
2683
|
-
}] : e?.rowFilters, s = t === b.table || t === b.singleValue || a && i === r ? o : e, c =
|
|
2684
|
-
chart:
|
|
2685
|
-
chartWithMetric:
|
|
2686
|
-
chartWithDashboard:
|
|
2754
|
+
H?.chartType,
|
|
2755
|
+
L?.drillDownSettings?.isEnableGroupBy,
|
|
2756
|
+
z.dimensions,
|
|
2757
|
+
z.drilledLevel,
|
|
2758
|
+
_n
|
|
2759
|
+
]), kn = n.enableClickActions, Z = K.useMemo(() => L?.clickActions ?? {}, [L?.clickActions]), An = n.onMaximize, jn = n.chartClickFunction, Mn = K.useCallback((e) => {
|
|
2760
|
+
if (!kn) return;
|
|
2761
|
+
let t = H?.chartType, r = z.dimensions?.length, i = z.drilledLevel, a = !!L?.drillDownSettings?.isEnableGroupBy, o = t === b.singleValue ? [{
|
|
2762
|
+
columnName: H?.singleValue,
|
|
2763
|
+
value: B?.[0]?.[H?.singleValue || ""]
|
|
2764
|
+
}] : e?.rowFilters, s = t === b.table || t === b.singleValue || a && i === r ? o : e, c = De({
|
|
2765
|
+
chart: Z.chart,
|
|
2766
|
+
chartWithMetric: Z.chartWithMetric,
|
|
2767
|
+
chartWithDashboard: Z.chartWithDashboard,
|
|
2687
2768
|
isDrillEnabled: a,
|
|
2688
2769
|
drilledLevel: i,
|
|
2689
2770
|
dimensionCount: r,
|
|
2690
|
-
isLastConfiguredDrillLevel: !!
|
|
2691
|
-
isTableRedirectAllowed: !
|
|
2692
|
-
}), l = (e, t) =>
|
|
2693
|
-
chart:
|
|
2771
|
+
isLastConfiguredDrillLevel: !!_n[_n.length - 1]?.isEnable,
|
|
2772
|
+
isTableRedirectAllowed: !wr.has(t) || !!H?.tableSettings?.chartAction?.isEnableColumnRedirection
|
|
2773
|
+
}), l = (e, t) => Oe({
|
|
2774
|
+
chart: H,
|
|
2694
2775
|
valueColumn: e,
|
|
2695
2776
|
isDrillEnabled: a,
|
|
2696
2777
|
drilledLevel: i,
|
|
2697
2778
|
dimensionCount: r,
|
|
2698
2779
|
params: s,
|
|
2699
2780
|
passAllData: t
|
|
2700
|
-
}), u =
|
|
2701
|
-
if (c.host ?
|
|
2702
|
-
metric:
|
|
2781
|
+
}), u = Z.chart?.valueColumn, d = Z.chartWithDashboard?.valueColumn ?? H?.xAxis;
|
|
2782
|
+
if (c.host ? jn?.(l(u, Z.chart?.isPassAllData) || void 0) : c.navigate && Pe(Z.chart, l(u) || void 0), c.openNestedMetric && An?.({
|
|
2783
|
+
metric: L,
|
|
2703
2784
|
rlsFilters: n.param,
|
|
2704
2785
|
appFilters: n.appFilters,
|
|
2705
2786
|
appliedMetricFilters: n.appliedMetricFilters,
|
|
2706
2787
|
isClickOnChart: !0
|
|
2707
2788
|
}), c.openDashboard) {
|
|
2708
|
-
let e =
|
|
2709
|
-
config:
|
|
2789
|
+
let e = be({
|
|
2790
|
+
config: Z.chartWithDashboard,
|
|
2710
2791
|
value: l(d)
|
|
2711
2792
|
});
|
|
2712
|
-
e.ok &&
|
|
2793
|
+
e.ok && jn?.(e.intent);
|
|
2713
2794
|
}
|
|
2714
2795
|
}, [
|
|
2715
|
-
|
|
2716
|
-
|
|
2796
|
+
kn,
|
|
2797
|
+
Z,
|
|
2798
|
+
H,
|
|
2717
2799
|
B,
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
L
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
Mn,
|
|
2800
|
+
z.dimensions,
|
|
2801
|
+
z.drilledLevel,
|
|
2802
|
+
L,
|
|
2803
|
+
_n,
|
|
2804
|
+
jn,
|
|
2805
|
+
An,
|
|
2725
2806
|
n
|
|
2726
|
-
]),
|
|
2727
|
-
|
|
2728
|
-
let r = e?.event?.event ?? e?.event, i = t ??
|
|
2807
|
+
]), Nn = K.useCallback((e, t) => {
|
|
2808
|
+
en?.(e);
|
|
2809
|
+
let r = e?.event?.event ?? e?.event, i = t ?? Wt(r?.type), a = Kt({
|
|
2729
2810
|
gesture: i,
|
|
2730
|
-
route:
|
|
2731
|
-
canCrossFilter:
|
|
2732
|
-
canDrillInto:
|
|
2733
|
-
hasPointMenu:
|
|
2811
|
+
route: On,
|
|
2812
|
+
canCrossFilter: nn,
|
|
2813
|
+
canDrillInto: X,
|
|
2814
|
+
hasPointMenu: sn
|
|
2734
2815
|
});
|
|
2735
|
-
i === "primary" &&
|
|
2736
|
-
columnName:
|
|
2816
|
+
i === "primary" && Mn(e), a.drillDown && (Be === !0 && !n.isInternalApp && bn && e?.name !== void 0 && !wr.has(H?.chartType) && En?.({
|
|
2817
|
+
columnName: bn,
|
|
2737
2818
|
value: e.name,
|
|
2738
2819
|
mode: "only"
|
|
2739
|
-
}),
|
|
2740
|
-
chartType:
|
|
2820
|
+
}), Tn?.(fe({
|
|
2821
|
+
chartType: H?.chartType,
|
|
2741
2822
|
params: e,
|
|
2742
2823
|
rowFilters: e?.rowFilters,
|
|
2743
|
-
dimensions:
|
|
2744
|
-
}))), a.adhocMenu && (i === "secondary" && r?.preventDefault?.(),
|
|
2824
|
+
dimensions: z.dimensions
|
|
2825
|
+
}))), a.adhocMenu && (i === "secondary" && r?.preventDefault?.(), mn({
|
|
2745
2826
|
open: !0,
|
|
2746
2827
|
anchor: {
|
|
2747
2828
|
x: r?.offsetX ?? 0,
|
|
@@ -2750,29 +2831,29 @@ var si = (n) => {
|
|
|
2750
2831
|
params: e
|
|
2751
2832
|
}));
|
|
2752
2833
|
}, [
|
|
2834
|
+
en,
|
|
2835
|
+
Mn,
|
|
2836
|
+
X,
|
|
2837
|
+
sn,
|
|
2753
2838
|
nn,
|
|
2754
|
-
Pn,
|
|
2755
|
-
J,
|
|
2756
|
-
ln,
|
|
2757
|
-
an,
|
|
2758
|
-
An,
|
|
2759
|
-
Dn,
|
|
2760
2839
|
On,
|
|
2761
|
-
|
|
2840
|
+
Tn,
|
|
2841
|
+
En,
|
|
2842
|
+
Be,
|
|
2762
2843
|
n.isInternalApp,
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
]),
|
|
2768
|
-
let t =
|
|
2769
|
-
t !== e && (t?.removeEventListener("contextmenu",
|
|
2770
|
-
}, []),
|
|
2771
|
-
let t =
|
|
2844
|
+
bn,
|
|
2845
|
+
H?.chartType,
|
|
2846
|
+
z.dimensions,
|
|
2847
|
+
mn
|
|
2848
|
+
]), Pn = K.useRef(null), Fn = K.useRef(null), In = K.useCallback((e) => {
|
|
2849
|
+
let t = Fn.current;
|
|
2850
|
+
t !== e && (t?.removeEventListener("contextmenu", ri), e?.addEventListener("contextmenu", ri), Fn.current = e);
|
|
2851
|
+
}, []), Ln = K.useCallback((e) => {
|
|
2852
|
+
let t = Fn.current, n = e.anchor.getBoundingClientRect(), r = t?.getBoundingClientRect(), i = Object.keys(e.row || {}).map((t) => ({
|
|
2772
2853
|
columnName: t,
|
|
2773
2854
|
value: e.row?.[t]
|
|
2774
2855
|
}));
|
|
2775
|
-
|
|
2856
|
+
mn({
|
|
2776
2857
|
open: !0,
|
|
2777
2858
|
anchor: r ? {
|
|
2778
2859
|
x: n.left - r.left,
|
|
@@ -2783,68 +2864,68 @@ var si = (n) => {
|
|
|
2783
2864
|
},
|
|
2784
2865
|
params: { rowFilters: i }
|
|
2785
2866
|
});
|
|
2786
|
-
}, [
|
|
2787
|
-
let e =
|
|
2867
|
+
}, [mn]), Rn = K.useMemo(() => re(H), [H]), zn = K.useMemo(() => {
|
|
2868
|
+
let e = yn?.dimensions?.[0]?.alias || H?.xAxis || L?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.[0]?.alias, t = (H?.isMultiDimension || H?.isDynamicSeries) && H?.seriesField && H.seriesField !== "ungrouped" ? H.seriesField : void 0;
|
|
2788
2869
|
return le({
|
|
2789
|
-
params:
|
|
2870
|
+
params: un.params,
|
|
2790
2871
|
axisDimension: e ? {
|
|
2791
2872
|
columnName: e,
|
|
2792
|
-
label:
|
|
2873
|
+
label: yn?.dimensions?.[0]?.label || e
|
|
2793
2874
|
} : void 0,
|
|
2794
2875
|
seriesDimension: t ? {
|
|
2795
2876
|
columnName: t,
|
|
2796
|
-
label: ((e) => e ? (
|
|
2877
|
+
label: ((e) => e ? (L?.datasetMetricSettings?.newDatasetSettings?.selectedDims)?.find((t) => t?.alias === e) : void 0)(t)?.label || t
|
|
2797
2878
|
} : void 0,
|
|
2798
2879
|
measure: {
|
|
2799
|
-
columnName:
|
|
2800
|
-
label:
|
|
2880
|
+
columnName: L?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.[0]?.alias,
|
|
2881
|
+
label: L?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.[0]?.label
|
|
2801
2882
|
},
|
|
2802
|
-
formatMeasure:
|
|
2883
|
+
formatMeasure: Rn
|
|
2803
2884
|
});
|
|
2804
2885
|
}, [
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
]), [
|
|
2814
|
-
let e =
|
|
2886
|
+
un.params,
|
|
2887
|
+
yn,
|
|
2888
|
+
L,
|
|
2889
|
+
H?.isMultiDimension,
|
|
2890
|
+
H?.isDynamicSeries,
|
|
2891
|
+
H?.seriesField,
|
|
2892
|
+
H?.xAxis,
|
|
2893
|
+
Rn
|
|
2894
|
+
]), [Bn, Vn] = K.useState([]), Hn = K.useMemo(() => {
|
|
2895
|
+
let e = yn?.filters || [], t = new Set(Bn.map((e) => e.columnName)), n = [...e.filter((e) => !t.has(e.columnName)), ...Bn];
|
|
2815
2896
|
if (!n.length) return;
|
|
2816
|
-
let r =
|
|
2897
|
+
let r = L?.datasetMetricSettings?.newDatasetSettings?.selectedDims || [];
|
|
2817
2898
|
return n.filter((e) => !!e?.columnName && e?.value !== void 0).map((e) => ({
|
|
2818
2899
|
label: r.find((t) => t?.alias === e.columnName)?.label || e.columnName,
|
|
2819
2900
|
value: e.value === null ? "Empty" : String(e.value)
|
|
2820
2901
|
}));
|
|
2821
2902
|
}, [
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
]),
|
|
2826
|
-
|
|
2827
|
-
}, [
|
|
2828
|
-
runtimeEnabled:
|
|
2829
|
-
metricEnabled:
|
|
2830
|
-
}),
|
|
2831
|
-
|
|
2903
|
+
yn,
|
|
2904
|
+
L,
|
|
2905
|
+
Bn
|
|
2906
|
+
]), Un = K.useCallback((e) => {
|
|
2907
|
+
hn(), navigator?.clipboard?.writeText?.(e)?.catch?.(() => void 0);
|
|
2908
|
+
}, [hn]), Wn = j({
|
|
2909
|
+
runtimeEnabled: ze,
|
|
2910
|
+
metricEnabled: gn?.isEnableCrossFilter
|
|
2911
|
+
}), Gn = !!En && tn.canCrossFilter && Wn, Kn = K.useCallback((e) => we(e, L?.datasetMetricSettings?.newDatasetSettings?.selectedDims), [L]), qn = K.useCallback((e, t, n) => {
|
|
2912
|
+
hn(), (n === "metric" ? Dn : En)?.({
|
|
2832
2913
|
columnName: e.columnName,
|
|
2833
2914
|
value: e.value,
|
|
2834
2915
|
mode: t
|
|
2835
2916
|
});
|
|
2836
2917
|
}, [
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
]),
|
|
2841
|
-
let e = { click: (e) =>
|
|
2842
|
-
return
|
|
2843
|
-
}, [
|
|
2844
|
-
if (!
|
|
2845
|
-
let e =
|
|
2846
|
-
return e < 0 ? [] :
|
|
2847
|
-
let r =
|
|
2918
|
+
hn,
|
|
2919
|
+
En,
|
|
2920
|
+
Dn
|
|
2921
|
+
]), Jn = K.useMemo(() => {
|
|
2922
|
+
let e = { click: (e) => Nn(e) };
|
|
2923
|
+
return sn && (e.contextmenu = (e) => Nn(e, "secondary")), e;
|
|
2924
|
+
}, [sn, Nn]), Yn = K.useMemo(() => {
|
|
2925
|
+
if (!X && !nn) return [];
|
|
2926
|
+
let e = _n.findIndex((e) => e?.isEnable);
|
|
2927
|
+
return e < 0 ? [] : _n.slice(0, e + 1).map((t, n) => {
|
|
2928
|
+
let r = _n[n + 1], i = t?.dimensions?.[0], a = i?.alias ?? t?.name ?? "", o = String(t?.name ?? "").trim(), s = (o && !/drill level/i.test(o) && o !== i?.alias ? o : "") || i?.label || a, c = n < e ? r?.filters?.find((e) => e?.columnName === a)?.value : void 0;
|
|
2848
2929
|
return {
|
|
2849
2930
|
index: t?.index ?? String(n),
|
|
2850
2931
|
label: s,
|
|
@@ -2852,56 +2933,56 @@ var si = (n) => {
|
|
|
2852
2933
|
};
|
|
2853
2934
|
});
|
|
2854
2935
|
}, [
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
]),
|
|
2859
|
-
|
|
2860
|
-
}, [
|
|
2861
|
-
|
|
2862
|
-
let e =
|
|
2863
|
-
if (!e ||
|
|
2936
|
+
X,
|
|
2937
|
+
nn,
|
|
2938
|
+
_n
|
|
2939
|
+
]), Xn = K.useRef(null), Zn = z.containerRef, Qn = K.useCallback((e) => {
|
|
2940
|
+
Xn.current = e, Zn && (Zn.current = e);
|
|
2941
|
+
}, [Zn]), $n = Yn.length > 1 ? Yn[Yn.length - 2]?.index : "";
|
|
2942
|
+
K.useEffect(() => {
|
|
2943
|
+
let e = Xn.current;
|
|
2944
|
+
if (!e || !$n) return;
|
|
2864
2945
|
let t = (e) => {
|
|
2865
2946
|
if (e.key !== "Escape" || e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
2866
2947
|
let t = e.target, n = t?.tagName;
|
|
2867
|
-
n === "INPUT" || n === "TEXTAREA" || n === "SELECT" || t?.isContentEditable || (e.preventDefault(), e.stopPropagation(),
|
|
2948
|
+
n === "INPUT" || n === "TEXTAREA" || n === "SELECT" || t?.isContentEditable || (e.preventDefault(), e.stopPropagation(), wn?.($n));
|
|
2868
2949
|
};
|
|
2869
2950
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
2870
|
-
}, [
|
|
2871
|
-
let
|
|
2872
|
-
|
|
2873
|
-
}, [
|
|
2874
|
-
let e =
|
|
2951
|
+
}, [$n, wn]);
|
|
2952
|
+
let er = typeof ft == "string" && ft || typeof z.metricName == "string" && z.metricName || "metric", tr = K.useMemo(() => $(z.tableResultsDownloadData, B) ?? [], [z.tableResultsDownloadData, B]), nr = wr.has(H?.chartType), rr = K.useCallback((e, t = er) => {
|
|
2953
|
+
li(e ?? [], `${t}.csv`);
|
|
2954
|
+
}, [er]), ir = K.useCallback(() => {
|
|
2955
|
+
let e = ai(Pn.current);
|
|
2875
2956
|
if (!e || e === "#") {
|
|
2876
|
-
|
|
2957
|
+
Y(nr ? "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.");
|
|
2877
2958
|
return;
|
|
2878
2959
|
}
|
|
2879
|
-
|
|
2880
|
-
}, [
|
|
2881
|
-
|
|
2882
|
-
}, []),
|
|
2883
|
-
|
|
2960
|
+
Y(null), ui(e, `${er}.png`);
|
|
2961
|
+
}, [er, nr]), Q = z.getUnderlyingData, ar = K.useCallback(() => {
|
|
2962
|
+
Et(!0);
|
|
2963
|
+
}, []), or = K.useCallback(() => {
|
|
2964
|
+
rr(tr, er), O?.(t, L?.id), Et(!1);
|
|
2884
2965
|
}, [
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2966
|
+
rr,
|
|
2967
|
+
tr,
|
|
2968
|
+
er,
|
|
2888
2969
|
O,
|
|
2889
|
-
|
|
2890
|
-
]),
|
|
2891
|
-
if (!
|
|
2892
|
-
|
|
2893
|
-
let e =
|
|
2894
|
-
|
|
2970
|
+
L?.id
|
|
2971
|
+
]), sr = K.useCallback(() => {
|
|
2972
|
+
if (!Q || Ft.current) return;
|
|
2973
|
+
Ft.current = !0, Y(null);
|
|
2974
|
+
let e = L?.dataSecuritySettings?.csvColumns || [], n = new Set(e), r = [], i = !1;
|
|
2975
|
+
Q({
|
|
2895
2976
|
columnName: void 0,
|
|
2896
2977
|
value: void 0,
|
|
2897
|
-
isSingleValueChart:
|
|
2978
|
+
isSingleValueChart: H?.chartType === b.singleValue,
|
|
2898
2979
|
setData: (e) => {
|
|
2899
2980
|
r = e || [];
|
|
2900
2981
|
},
|
|
2901
2982
|
setLoading: (a) => {
|
|
2902
2983
|
if (a) return;
|
|
2903
|
-
if (
|
|
2904
|
-
|
|
2984
|
+
if (Ft.current = !1, i) {
|
|
2985
|
+
Y("Failed to download CSV without filters. Please try again.");
|
|
2905
2986
|
return;
|
|
2906
2987
|
}
|
|
2907
2988
|
let o = e.length ? r.map((e) => {
|
|
@@ -2910,135 +2991,135 @@ var si = (n) => {
|
|
|
2910
2991
|
n.has(r) || (t[r] = e[r]);
|
|
2911
2992
|
}), t;
|
|
2912
2993
|
}) : r;
|
|
2913
|
-
|
|
2994
|
+
rr(o, er), O?.(t, L?.id);
|
|
2914
2995
|
},
|
|
2915
2996
|
onError: () => {
|
|
2916
2997
|
i = !0;
|
|
2917
2998
|
},
|
|
2918
|
-
clientColumnType: $(
|
|
2999
|
+
clientColumnType: $(Fe, "STRING"),
|
|
2919
3000
|
withoutFilters: !0
|
|
2920
3001
|
});
|
|
2921
3002
|
}, [
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
3003
|
+
Q,
|
|
3004
|
+
H?.chartType,
|
|
3005
|
+
Fe,
|
|
3006
|
+
rr,
|
|
3007
|
+
er,
|
|
2927
3008
|
O,
|
|
2928
|
-
|
|
2929
|
-
]),
|
|
2930
|
-
|
|
2931
|
-
Array.isArray(t) ?
|
|
3009
|
+
L
|
|
3010
|
+
]), cr = z.onChangeFilterValue, lr = K.useMemo(() => (z.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && e.datatype === "date"), [z.metricFilters]), dr = K.useMemo(() => fi(z.metricFilters?.filter((e) => e && e.datatype !== "date")), [z.metricFilters]), fr = K.useCallback((e) => {
|
|
3011
|
+
cr && Object.entries(e).forEach(([e, t]) => {
|
|
3012
|
+
Array.isArray(t) ? cr(e, "", void 0, void 0, t.map((e) => ({
|
|
2932
3013
|
value: e,
|
|
2933
3014
|
label: e
|
|
2934
|
-
}))) :
|
|
3015
|
+
}))) : cr(e, t);
|
|
2935
3016
|
});
|
|
2936
|
-
}, [
|
|
2937
|
-
|
|
3017
|
+
}, [cr]), pr = K.useCallback((e) => (t) => {
|
|
3018
|
+
cr?.(e, t.value, "", {
|
|
2938
3019
|
startDate: t.startDate,
|
|
2939
3020
|
endDate: t.endDate
|
|
2940
3021
|
}, void 0, t.timeGrainValue);
|
|
2941
|
-
}, [
|
|
2942
|
-
if (
|
|
3022
|
+
}, [cr]), mr = K.useCallback((e) => {
|
|
3023
|
+
if (jt(!!e?.withoutFilters), zt(!0), Ot(!0), Vn(e?.withoutFilters ? [] : e?.pointFilters ?? []), Ht({
|
|
2943
3024
|
limit: 100,
|
|
2944
3025
|
offset: 0
|
|
2945
|
-
}),
|
|
2946
|
-
if (!
|
|
2947
|
-
|
|
3026
|
+
}), Gt(0), $t(null), !ln) {
|
|
3027
|
+
if (!ot && !V && (!B.length || dt)) {
|
|
3028
|
+
Lt([]), zt(!1);
|
|
2948
3029
|
return;
|
|
2949
3030
|
}
|
|
2950
|
-
|
|
3031
|
+
Q?.({
|
|
2951
3032
|
columnName: void 0,
|
|
2952
3033
|
value: void 0,
|
|
2953
|
-
isSingleValueChart:
|
|
2954
|
-
setData:
|
|
2955
|
-
setLoading:
|
|
2956
|
-
clientColumnType: $(
|
|
3034
|
+
isSingleValueChart: H?.chartType === b.singleValue,
|
|
3035
|
+
setData: Lt,
|
|
3036
|
+
setLoading: zt,
|
|
3037
|
+
clientColumnType: $(Fe, "STRING"),
|
|
2957
3038
|
withoutFilters: !!e?.withoutFilters,
|
|
2958
3039
|
pointFilters: e?.withoutFilters ? void 0 : e?.pointFilters
|
|
2959
|
-
}), O?.(t,
|
|
3040
|
+
}), O?.(t, L?.id);
|
|
2960
3041
|
}
|
|
2961
3042
|
}, [
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3043
|
+
Q,
|
|
3044
|
+
H?.chartType,
|
|
3045
|
+
Fe,
|
|
2965
3046
|
O,
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
]), hr = !!(
|
|
2973
|
-
if (
|
|
2974
|
-
if (!hr && !
|
|
3047
|
+
L?.id,
|
|
3048
|
+
ot,
|
|
3049
|
+
V,
|
|
3050
|
+
B,
|
|
3051
|
+
dt,
|
|
3052
|
+
ln
|
|
3053
|
+
]), hr = !!(kn && (Z.chart?.isEnable || Z.chartWithMetric?.isEnable || Z.chartWithDashboard?.isEnable)), gr = K.useMemo(() => {
|
|
3054
|
+
if (H?.chartType !== b.singleValue) return;
|
|
3055
|
+
if (!hr && !on) return si;
|
|
2975
3056
|
let e = (e, t) => {
|
|
2976
3057
|
if (t === "primary" && hr) {
|
|
2977
|
-
|
|
3058
|
+
Mn(e);
|
|
2978
3059
|
return;
|
|
2979
3060
|
}
|
|
2980
|
-
|
|
3061
|
+
on && mr();
|
|
2981
3062
|
};
|
|
2982
3063
|
return {
|
|
2983
3064
|
click: (t) => e(t, "primary"),
|
|
2984
3065
|
contextmenu: (t) => e(t, "secondary")
|
|
2985
3066
|
};
|
|
2986
3067
|
}, [
|
|
2987
|
-
|
|
3068
|
+
H?.chartType,
|
|
2988
3069
|
hr,
|
|
2989
|
-
|
|
2990
|
-
|
|
3070
|
+
Mn,
|
|
3071
|
+
on,
|
|
2991
3072
|
mr
|
|
2992
|
-
]),
|
|
2993
|
-
if (
|
|
2994
|
-
if (
|
|
3073
|
+
]), _r = K.useMemo(() => ln ? re(H) : void 0, [ln, H]), vr = K.useCallback((e) => {
|
|
3074
|
+
if (Q) {
|
|
3075
|
+
if (Ht({
|
|
2995
3076
|
limit: e.limit,
|
|
2996
3077
|
offset: e.offset
|
|
2997
|
-
}),
|
|
2998
|
-
|
|
3078
|
+
}), $t(null), !ot && !V && (!B.length || dt)) {
|
|
3079
|
+
Lt([]), Gt(0), zt(!1);
|
|
2999
3080
|
return;
|
|
3000
3081
|
}
|
|
3001
|
-
|
|
3002
|
-
pointFilters:
|
|
3003
|
-
withoutFilters:
|
|
3082
|
+
Q({
|
|
3083
|
+
pointFilters: At ? void 0 : Bn,
|
|
3084
|
+
withoutFilters: At,
|
|
3004
3085
|
columnName: void 0,
|
|
3005
3086
|
value: void 0,
|
|
3006
|
-
isSingleValueChart:
|
|
3007
|
-
setData:
|
|
3008
|
-
setLoading:
|
|
3009
|
-
setTotalRecords:
|
|
3010
|
-
clientColumnType: $(
|
|
3087
|
+
isSingleValueChart: H?.chartType === b.singleValue,
|
|
3088
|
+
setData: Lt,
|
|
3089
|
+
setLoading: zt,
|
|
3090
|
+
setTotalRecords: Gt,
|
|
3091
|
+
clientColumnType: $(Fe, "STRING"),
|
|
3011
3092
|
limit: String(e.limit),
|
|
3012
3093
|
offset: String(e.offset),
|
|
3013
3094
|
search: e.search,
|
|
3014
3095
|
searchColumns: e.searchColumns,
|
|
3015
3096
|
onError: () => {
|
|
3016
|
-
|
|
3097
|
+
$t("We couldn't load these rows. Check your connection and try again."), zt(!1);
|
|
3017
3098
|
}
|
|
3018
3099
|
});
|
|
3019
3100
|
}
|
|
3020
3101
|
}, [
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
]),
|
|
3031
|
-
if (!
|
|
3102
|
+
Q,
|
|
3103
|
+
Bn,
|
|
3104
|
+
At,
|
|
3105
|
+
H?.chartType,
|
|
3106
|
+
Fe,
|
|
3107
|
+
ot,
|
|
3108
|
+
V,
|
|
3109
|
+
B,
|
|
3110
|
+
dt
|
|
3111
|
+
]), yr = K.useCallback((e) => new Promise((t, n) => {
|
|
3112
|
+
if (!Q) {
|
|
3032
3113
|
n(/* @__PURE__ */ Error("Underlying data is not available for this card."));
|
|
3033
3114
|
return;
|
|
3034
3115
|
}
|
|
3035
3116
|
let r = [], i = !1;
|
|
3036
|
-
|
|
3037
|
-
pointFilters:
|
|
3038
|
-
withoutFilters:
|
|
3117
|
+
Q({
|
|
3118
|
+
pointFilters: At ? void 0 : Bn,
|
|
3119
|
+
withoutFilters: At,
|
|
3039
3120
|
columnName: void 0,
|
|
3040
3121
|
value: void 0,
|
|
3041
|
-
isSingleValueChart:
|
|
3122
|
+
isSingleValueChart: H?.chartType === b.singleValue,
|
|
3042
3123
|
setData: (e) => {
|
|
3043
3124
|
r = Array.isArray(e) ? e : [];
|
|
3044
3125
|
},
|
|
@@ -3051,7 +3132,7 @@ var si = (n) => {
|
|
|
3051
3132
|
t(r);
|
|
3052
3133
|
}
|
|
3053
3134
|
},
|
|
3054
|
-
clientColumnType: $(
|
|
3135
|
+
clientColumnType: $(Fe, "STRING"),
|
|
3055
3136
|
limit: String(e.limit),
|
|
3056
3137
|
offset: String(e.offset),
|
|
3057
3138
|
search: e.search,
|
|
@@ -3061,117 +3142,117 @@ var si = (n) => {
|
|
|
3061
3142
|
}
|
|
3062
3143
|
});
|
|
3063
3144
|
}), [
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
]),
|
|
3070
|
-
if (!
|
|
3071
|
-
|
|
3145
|
+
Q,
|
|
3146
|
+
Bn,
|
|
3147
|
+
At,
|
|
3148
|
+
H?.chartType,
|
|
3149
|
+
Fe
|
|
3150
|
+
]), br = K.useCallback(async (e) => {
|
|
3151
|
+
if (!Q || Zt.current) return;
|
|
3152
|
+
Zt.current = !0, Y(null), Xt({
|
|
3072
3153
|
isRunning: !0,
|
|
3073
3154
|
fetchedRows: 0
|
|
3074
3155
|
});
|
|
3075
3156
|
let n = [], r = 0, i = !1;
|
|
3076
3157
|
try {
|
|
3077
3158
|
for (;;) {
|
|
3078
|
-
let t = await
|
|
3079
|
-
limit:
|
|
3159
|
+
let t = await yr({
|
|
3160
|
+
limit: oi,
|
|
3080
3161
|
offset: r,
|
|
3081
3162
|
search: e.search,
|
|
3082
3163
|
searchColumns: e.searchColumns
|
|
3083
3164
|
});
|
|
3084
3165
|
for (let e of t) n.push(e);
|
|
3085
|
-
if (
|
|
3166
|
+
if (Xt({
|
|
3086
3167
|
isRunning: !0,
|
|
3087
3168
|
fetchedRows: n.length
|
|
3088
|
-
}), t.length <
|
|
3089
|
-
if (n.length >=
|
|
3169
|
+
}), t.length < oi || e.total > 0 && n.length >= e.total) break;
|
|
3170
|
+
if (n.length >= ci) {
|
|
3090
3171
|
i = !0;
|
|
3091
3172
|
break;
|
|
3092
3173
|
}
|
|
3093
|
-
r +=
|
|
3174
|
+
r += oi;
|
|
3094
3175
|
}
|
|
3095
|
-
|
|
3176
|
+
li(n, `${er}.csv`), O?.(t, L?.id), i && Y(`This export stopped at the first ${ci.toLocaleString()} rows. Narrow the metric or use a scheduled report for the full result.`);
|
|
3096
3177
|
} catch {
|
|
3097
|
-
|
|
3178
|
+
Y("We couldn't download every row. Check your connection and try again, or download this page instead.");
|
|
3098
3179
|
} finally {
|
|
3099
|
-
|
|
3180
|
+
Zt.current = !1, Xt({
|
|
3100
3181
|
isRunning: !1,
|
|
3101
3182
|
fetchedRows: 0
|
|
3102
3183
|
});
|
|
3103
3184
|
}
|
|
3104
3185
|
}, [
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3186
|
+
Q,
|
|
3187
|
+
yr,
|
|
3188
|
+
er,
|
|
3108
3189
|
O,
|
|
3109
|
-
|
|
3110
|
-
]),
|
|
3111
|
-
position:
|
|
3112
|
-
hasAuthoredNextLevel:
|
|
3113
|
-
pool:
|
|
3114
|
-
clickActions:
|
|
3115
|
-
canViewUnderlyingData:
|
|
3116
|
-
canDrillIntoAnyDimension:
|
|
3117
|
-
resultState:
|
|
3190
|
+
L?.id
|
|
3191
|
+
]), xr = K.useMemo(() => Se({
|
|
3192
|
+
position: vn,
|
|
3193
|
+
hasAuthoredNextLevel: On === "drill",
|
|
3194
|
+
pool: X ? xn : void 0,
|
|
3195
|
+
clickActions: Z,
|
|
3196
|
+
canViewUnderlyingData: on,
|
|
3197
|
+
canDrillIntoAnyDimension: X,
|
|
3198
|
+
resultState: V ? "failed" : B?.length ? "ok" : "empty"
|
|
3118
3199
|
}), [
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
]),
|
|
3128
|
-
pool:
|
|
3200
|
+
vn,
|
|
3201
|
+
On,
|
|
3202
|
+
X,
|
|
3203
|
+
xn,
|
|
3204
|
+
Z,
|
|
3205
|
+
on,
|
|
3206
|
+
V,
|
|
3207
|
+
B
|
|
3208
|
+
]), Sr = !!(he && ge), Cr = !!(Ke && Je && !qe), Tr = X && On !== "terminal" ? /* @__PURE__ */ q(Xr, {
|
|
3209
|
+
pool: xn,
|
|
3129
3210
|
testIdPrefix: "metric-card-options-drill",
|
|
3130
|
-
gestureHint:
|
|
3211
|
+
gestureHint: Sn ? "Right-click chart" : void 0,
|
|
3131
3212
|
onDrillInto: (e) => {
|
|
3132
|
-
|
|
3213
|
+
Cn?.({ dimension: e.column });
|
|
3133
3214
|
}
|
|
3134
|
-
}) : void 0,
|
|
3135
|
-
flags:
|
|
3136
|
-
optionsIcon:
|
|
3137
|
-
settingsIcon:
|
|
3138
|
-
onDownloadCsv: E ? (e) => e?.withoutFilters ?
|
|
3139
|
-
onDownloadPng: k ? void 0 :
|
|
3215
|
+
}) : void 0, Dr = /* @__PURE__ */ q(Pr, {
|
|
3216
|
+
flags: rn,
|
|
3217
|
+
optionsIcon: mi(te),
|
|
3218
|
+
settingsIcon: mi(ne),
|
|
3219
|
+
onDownloadCsv: E ? (e) => e?.withoutFilters ? sr() : ar() : void 0,
|
|
3220
|
+
onDownloadPng: k ? void 0 : ir,
|
|
3140
3221
|
onEmailCsv: ie ? () => ie() : void 0,
|
|
3141
|
-
onFullscreen:
|
|
3142
|
-
onUnderlyingData:
|
|
3143
|
-
onSettings:
|
|
3144
|
-
splitBySubmenu:
|
|
3145
|
-
}),
|
|
3222
|
+
onFullscreen: an ? () => wt(!0) : void 0,
|
|
3223
|
+
onUnderlyingData: on ? mr : void 0,
|
|
3224
|
+
onSettings: Sr ? () => ge?.(L) : void 0,
|
|
3225
|
+
splitBySubmenu: Tr
|
|
3226
|
+
}), Or = /* @__PURE__ */ J("span", {
|
|
3146
3227
|
"data-testid": "metric-card-filter-slot",
|
|
3147
3228
|
className: "flex items-center gap-1",
|
|
3148
3229
|
children: [
|
|
3149
|
-
|
|
3150
|
-
defaultOption:
|
|
3230
|
+
lr.map((e) => /* @__PURE__ */ q(Kr, {
|
|
3231
|
+
defaultOption: pi(e),
|
|
3151
3232
|
onChange: pr(String(e.name)),
|
|
3152
|
-
hideDatePickerOptions:
|
|
3153
|
-
calendarType:
|
|
3233
|
+
hideDatePickerOptions: F,
|
|
3234
|
+
calendarType: Ie
|
|
3154
3235
|
}, String(e.name))),
|
|
3155
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ q(ni, {
|
|
3156
3237
|
filters: dr,
|
|
3157
3238
|
onChange: fr,
|
|
3158
|
-
position:
|
|
3159
|
-
multi:
|
|
3239
|
+
position: Me,
|
|
3240
|
+
multi: Ne
|
|
3160
3241
|
}),
|
|
3161
|
-
|
|
3242
|
+
Cr ? /* @__PURE__ */ q(U, {
|
|
3162
3243
|
type: "button",
|
|
3163
3244
|
variant: "outline",
|
|
3164
3245
|
size: "icon-sm",
|
|
3165
3246
|
"aria-label": "Merge metrics",
|
|
3166
3247
|
"data-testid": "metric-card-merge",
|
|
3167
|
-
onClick: () =>
|
|
3248
|
+
onClick: () => Je?.({
|
|
3168
3249
|
isOpen: !0,
|
|
3169
|
-
chartOptions:
|
|
3170
|
-
id:
|
|
3250
|
+
chartOptions: H,
|
|
3251
|
+
id: L?.id
|
|
3171
3252
|
}),
|
|
3172
|
-
children: /* @__PURE__ */
|
|
3253
|
+
children: /* @__PURE__ */ q(Pt, { "aria-hidden": "true" })
|
|
3173
3254
|
}) : null,
|
|
3174
|
-
|
|
3255
|
+
an ? /* @__PURE__ */ q(U, {
|
|
3175
3256
|
type: "button",
|
|
3176
3257
|
variant: "ghost",
|
|
3177
3258
|
size: "icon-sm",
|
|
@@ -3179,309 +3260,309 @@ var si = (n) => {
|
|
|
3179
3260
|
"aria-label": "Fullscreen",
|
|
3180
3261
|
title: "Fullscreen",
|
|
3181
3262
|
"data-testid": "metric-card-fullscreen",
|
|
3182
|
-
onClick: () =>
|
|
3183
|
-
children: /* @__PURE__ */
|
|
3263
|
+
onClick: () => wt(!0),
|
|
3264
|
+
children: /* @__PURE__ */ q(We, { "aria-hidden": "true" })
|
|
3184
3265
|
}) : null,
|
|
3185
|
-
|
|
3266
|
+
Dr
|
|
3186
3267
|
]
|
|
3187
|
-
}),
|
|
3188
|
-
if (!
|
|
3189
|
-
if (!
|
|
3190
|
-
let e =
|
|
3268
|
+
}), kr = !!z.isExternalChart, Ar = K.useMemo(() => {
|
|
3269
|
+
if (!cn || !nr) return;
|
|
3270
|
+
if (!kr) return { mode: "client" };
|
|
3271
|
+
let e = z.paginationInfo;
|
|
3191
3272
|
return {
|
|
3192
3273
|
mode: "server",
|
|
3193
3274
|
limit: e?.limit || 100,
|
|
3194
3275
|
offset: e?.offset || 0,
|
|
3195
3276
|
totalRows: e?.totalRecords || 0,
|
|
3196
|
-
onChangePage:
|
|
3197
|
-
isEnableNextBtn: !!
|
|
3198
|
-
isEnablePrevBtn: !!
|
|
3277
|
+
onChangePage: z.onChangePage,
|
|
3278
|
+
isEnableNextBtn: !!z.isEnableNextBtn,
|
|
3279
|
+
isEnablePrevBtn: !!z.isEnablePrevBtn
|
|
3199
3280
|
};
|
|
3200
3281
|
}, [
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
]), Fr = !
|
|
3282
|
+
cn,
|
|
3283
|
+
nr,
|
|
3284
|
+
kr,
|
|
3285
|
+
z.paginationInfo,
|
|
3286
|
+
z.onChangePage,
|
|
3287
|
+
z.isEnableNextBtn,
|
|
3288
|
+
z.isEnablePrevBtn
|
|
3289
|
+
]), Fr = !ot && !V && (!B.length || dt), Ir = (e) => {
|
|
3209
3290
|
let t = e?.value;
|
|
3210
3291
|
return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim() !== "" : t != null;
|
|
3211
|
-
}, Lr = (
|
|
3212
|
-
isCustomSqlMetric: !!
|
|
3213
|
-
query:
|
|
3214
|
-
metricId:
|
|
3292
|
+
}, Lr = (z.metricFilters ?? []).filter((e) => e && !e.isHiddenInUi && Ir(e)), Rr = Lr.length > 0 || !!n.globalFilters?.filters?.length || !!n.crossDashboardFilters?.length || (z.rlsConditions ?? []).some((e) => e.isAppFilter && e.isAddOnMetrics && Ir({ value: n.appFilters?.values?.[e.name] ?? e.value })), zr = ye({
|
|
3293
|
+
isCustomSqlMetric: !!L?.datasetMetricSettings?.isUseRawSQL,
|
|
3294
|
+
query: L?.query,
|
|
3295
|
+
metricId: L?.id,
|
|
3215
3296
|
filters: [...Lr, ...n.globalFilters?.filters || []]
|
|
3216
|
-
}),
|
|
3217
|
-
|
|
3218
|
-
Array.isArray(e.value) ?
|
|
3219
|
-
}),
|
|
3297
|
+
}), Br = K.useCallback(() => {
|
|
3298
|
+
cr && Lr.forEach((e) => {
|
|
3299
|
+
Array.isArray(e.value) ? cr(e.name, "", void 0, void 0, []) : cr(e.name, "");
|
|
3300
|
+
}), Ge?.(), z.refetchMetricData();
|
|
3220
3301
|
}, [
|
|
3221
|
-
|
|
3302
|
+
cr,
|
|
3222
3303
|
Lr,
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
]),
|
|
3304
|
+
Ge,
|
|
3305
|
+
z.refetchMetricData
|
|
3306
|
+
]), Vr = !!cr && Lr.length > 0 || !!Ge, Hr = Ue === !0 || g() && Ue !== !1, Ur = xe({
|
|
3226
3307
|
kind: "none",
|
|
3227
3308
|
reason: "empty-result"
|
|
3228
|
-
}),
|
|
3309
|
+
}), Wr = Yn.length > 0 ? /* @__PURE__ */ q("div", {
|
|
3229
3310
|
"data-testid": "card-drill-empty-state",
|
|
3230
3311
|
"data-slot": "metric-card-drill-empty",
|
|
3231
3312
|
className: "flex min-h-0 w-full flex-1 flex-col",
|
|
3232
|
-
children: /* @__PURE__ */
|
|
3233
|
-
hasActiveFilters:
|
|
3313
|
+
children: /* @__PURE__ */ q(ct, {
|
|
3314
|
+
hasActiveFilters: Rr,
|
|
3234
3315
|
noDataImg: w,
|
|
3235
3316
|
noDataFoundSvg: T,
|
|
3236
|
-
message: `${
|
|
3237
|
-
...
|
|
3317
|
+
message: `${Ur.title}. ${Ur.body}`,
|
|
3318
|
+
...yt
|
|
3238
3319
|
})
|
|
3239
|
-
}) :
|
|
3240
|
-
hasActiveFilters:
|
|
3320
|
+
}) : Hr ? /* @__PURE__ */ q(ct, {
|
|
3321
|
+
hasActiveFilters: Rr,
|
|
3241
3322
|
noDataImg: w,
|
|
3242
3323
|
noDataFoundSvg: T,
|
|
3243
|
-
message:
|
|
3244
|
-
action:
|
|
3324
|
+
message: _t,
|
|
3325
|
+
action: Rr && Vr ? /* @__PURE__ */ q(U, {
|
|
3245
3326
|
type: "button",
|
|
3246
3327
|
"data-testid": "card-clear-filters",
|
|
3247
3328
|
variant: "outline",
|
|
3248
3329
|
size: "sm",
|
|
3249
|
-
onClick:
|
|
3250
|
-
children:
|
|
3330
|
+
onClick: Br,
|
|
3331
|
+
children: Ge ? "Clear all filters" : "Clear card filters"
|
|
3251
3332
|
}) : void 0,
|
|
3252
|
-
...
|
|
3253
|
-
}) : null,
|
|
3254
|
-
crumbs:
|
|
3333
|
+
...yt
|
|
3334
|
+
}) : null, Gr = !!Ar && Ar.mode === "server" && !!ot && !V && B.length > 0, qr = (X || nn) && Yn.length ? /* @__PURE__ */ q(jr, {
|
|
3335
|
+
crumbs: Yn,
|
|
3255
3336
|
onDrillLevelClick: (e) => {
|
|
3256
|
-
|
|
3337
|
+
wn?.(e);
|
|
3257
3338
|
},
|
|
3258
3339
|
onUp: (e) => {
|
|
3259
|
-
|
|
3340
|
+
wn?.(e);
|
|
3260
3341
|
},
|
|
3261
3342
|
onResetDrill: () => {
|
|
3262
|
-
|
|
3343
|
+
wn?.("", !0);
|
|
3263
3344
|
}
|
|
3264
|
-
}) : void 0,
|
|
3345
|
+
}) : void 0, Jr = ot && !Gr, Yr = Fr && Yn.length > 0, Zr = Jr || Yr ? void 0 : z.drillBlockedNotice ? /* @__PURE__ */ q("span", {
|
|
3265
3346
|
className: "text-caption text-(--muted-foreground)",
|
|
3266
3347
|
"data-testid": "metric-card-drill-blocked-notice",
|
|
3267
3348
|
"data-reason": "blank-value",
|
|
3268
|
-
children:
|
|
3269
|
-
}) :
|
|
3349
|
+
children: z.drillBlockedNotice.title
|
|
3350
|
+
}) : Yn.length && xr.kind === "none" ? /* @__PURE__ */ q("span", {
|
|
3270
3351
|
className: "text-caption text-(--muted-foreground)",
|
|
3271
3352
|
"data-testid": "metric-card-terminal-notice",
|
|
3272
|
-
"data-reason":
|
|
3273
|
-
children:
|
|
3274
|
-
}) : void 0,
|
|
3353
|
+
"data-reason": xr.reason,
|
|
3354
|
+
children: xe(xr).title
|
|
3355
|
+
}) : void 0, Qr = qr != null || Zr != null ? /* @__PURE__ */ J("div", {
|
|
3275
3356
|
"data-testid": "metric-card-drill-breadcrumb",
|
|
3276
3357
|
"data-slot": "metric-card-drill-chrome",
|
|
3277
3358
|
className: "mb-2 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1",
|
|
3278
|
-
children: [
|
|
3279
|
-
}) : null,
|
|
3280
|
-
if (
|
|
3281
|
-
else if (
|
|
3282
|
-
message: a(
|
|
3283
|
-
error: a(
|
|
3284
|
-
widgetName: typeof
|
|
3285
|
-
chartType:
|
|
3286
|
-
onRetry:
|
|
3287
|
-
knownCause:
|
|
3288
|
-
...
|
|
3359
|
+
children: [qr, Zr]
|
|
3360
|
+
}) : null, di;
|
|
3361
|
+
if (ot && !Gr) di = /* @__PURE__ */ q(nt, { className: "flex-1" });
|
|
3362
|
+
else if (V) di = /* @__PURE__ */ q(at, {
|
|
3363
|
+
message: a(V) ? lt : void 0,
|
|
3364
|
+
error: a(V) ? void 0 : W,
|
|
3365
|
+
widgetName: typeof ft == "string" ? ft : void 0,
|
|
3366
|
+
chartType: H?.chartType,
|
|
3367
|
+
onRetry: lt || W?.retryable === !1 ? void 0 : ut,
|
|
3368
|
+
knownCause: Ye,
|
|
3369
|
+
...yt
|
|
3289
3370
|
});
|
|
3290
|
-
else if (
|
|
3371
|
+
else if (tt) di = /* @__PURE__ */ q("div", {
|
|
3291
3372
|
"data-testid": "card-join-mismatch-state",
|
|
3292
3373
|
"data-slot": "metric-card-join-mismatch",
|
|
3293
|
-
children: /* @__PURE__ */
|
|
3294
|
-
error: e(
|
|
3295
|
-
...
|
|
3374
|
+
children: /* @__PURE__ */ q(at, {
|
|
3375
|
+
error: e(P(n.mismatchReason === "column" ? "column" : "join")),
|
|
3376
|
+
...yt
|
|
3296
3377
|
})
|
|
3297
3378
|
});
|
|
3298
|
-
else if (Fr)
|
|
3299
|
-
hasActiveFilters:
|
|
3379
|
+
else if (Fr) di = Wr ?? /* @__PURE__ */ q(ct, {
|
|
3380
|
+
hasActiveFilters: Rr,
|
|
3300
3381
|
noDataImg: w,
|
|
3301
3382
|
noDataFoundSvg: T,
|
|
3302
|
-
message:
|
|
3303
|
-
...
|
|
3383
|
+
message: _t,
|
|
3384
|
+
...yt
|
|
3304
3385
|
});
|
|
3305
3386
|
else {
|
|
3306
|
-
let e = /* @__PURE__ */
|
|
3307
|
-
hasActiveFilters:
|
|
3308
|
-
canOpenDataPointMenu:
|
|
3309
|
-
metric:
|
|
3310
|
-
chartSettings:
|
|
3311
|
-
data:
|
|
3312
|
-
serverTruncation:
|
|
3387
|
+
let e = /* @__PURE__ */ q(Er, {
|
|
3388
|
+
hasActiveFilters: Rr,
|
|
3389
|
+
canOpenDataPointMenu: sn,
|
|
3390
|
+
metric: L,
|
|
3391
|
+
chartSettings: H,
|
|
3392
|
+
data: B,
|
|
3393
|
+
serverTruncation: z.truncation ?? null,
|
|
3313
3394
|
isLoading: !1,
|
|
3314
|
-
tablePaging:
|
|
3315
|
-
isTableRefreshing:
|
|
3316
|
-
enableCoverageTruncation:
|
|
3317
|
-
emptyState:
|
|
3318
|
-
chartColors:
|
|
3319
|
-
chartRendererType:
|
|
3320
|
-
chartAppearance:
|
|
3395
|
+
tablePaging: Ar,
|
|
3396
|
+
isTableRefreshing: Gr,
|
|
3397
|
+
enableCoverageTruncation: He,
|
|
3398
|
+
emptyState: Wr ?? void 0,
|
|
3399
|
+
chartColors: St,
|
|
3400
|
+
chartRendererType: v,
|
|
3401
|
+
chartAppearance: y,
|
|
3321
3402
|
appearanceOptions: x,
|
|
3322
3403
|
chartColumns: S,
|
|
3323
3404
|
height: ee,
|
|
3324
3405
|
width: C,
|
|
3325
|
-
onEvents:
|
|
3326
|
-
onTableCellClick:
|
|
3406
|
+
onEvents: gr ?? Jn,
|
|
3407
|
+
onTableCellClick: X ? Ln : void 0,
|
|
3327
3408
|
onChartReady: (e) => {
|
|
3328
|
-
|
|
3409
|
+
Pn.current = e;
|
|
3329
3410
|
}
|
|
3330
3411
|
});
|
|
3331
|
-
|
|
3332
|
-
ref:
|
|
3412
|
+
di = sn ? /* @__PURE__ */ J("div", {
|
|
3413
|
+
ref: In,
|
|
3333
3414
|
className: "relative flex min-h-0 w-full flex-1 flex-col",
|
|
3334
|
-
children: [e, /* @__PURE__ */
|
|
3335
|
-
open:
|
|
3415
|
+
children: [e, /* @__PURE__ */ q($r, {
|
|
3416
|
+
open: un.open,
|
|
3336
3417
|
onOpenChange: (e) => {
|
|
3337
|
-
e ||
|
|
3418
|
+
e || hn();
|
|
3338
3419
|
},
|
|
3339
|
-
anchor:
|
|
3340
|
-
point:
|
|
3341
|
-
onCopyValue:
|
|
3342
|
-
onFilterTo:
|
|
3343
|
-
canFilterThisMetric: !!
|
|
3344
|
-
canFilterDashboard:
|
|
3345
|
-
isFilterableColumn:
|
|
3346
|
-
canExcludeValues:
|
|
3347
|
-
pool:
|
|
3348
|
-
canSplitBy:
|
|
3420
|
+
anchor: un.anchor,
|
|
3421
|
+
point: zn,
|
|
3422
|
+
onCopyValue: Un,
|
|
3423
|
+
onFilterTo: X && (Dn && z.onMetricFiltersChange || Gn) ? qn : void 0,
|
|
3424
|
+
canFilterThisMetric: !!Dn && !!z.onMetricFiltersChange,
|
|
3425
|
+
canFilterDashboard: Gn,
|
|
3426
|
+
isFilterableColumn: Kn,
|
|
3427
|
+
canExcludeValues: tn.canExcludeFilterValues,
|
|
3428
|
+
pool: xn,
|
|
3429
|
+
canSplitBy: X,
|
|
3349
3430
|
onDrillInto: (e) => {
|
|
3350
|
-
|
|
3431
|
+
hn(), Cn?.({
|
|
3351
3432
|
dimension: e.column,
|
|
3352
|
-
params:
|
|
3353
|
-
point:
|
|
3433
|
+
params: un.params,
|
|
3434
|
+
point: zn
|
|
3354
3435
|
});
|
|
3355
3436
|
},
|
|
3356
|
-
onViewUnderlyingData:
|
|
3357
|
-
|
|
3437
|
+
onViewUnderlyingData: on ? () => {
|
|
3438
|
+
hn(), mr({ pointFilters: ue(zn).filters });
|
|
3358
3439
|
} : void 0
|
|
3359
3440
|
})]
|
|
3360
3441
|
}) : e;
|
|
3361
3442
|
}
|
|
3362
|
-
let hi = !!(me &&
|
|
3363
|
-
return /* @__PURE__ */
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
ref:
|
|
3443
|
+
let hi = !!(me && an);
|
|
3444
|
+
return /* @__PURE__ */ J(kt, { children: [
|
|
3445
|
+
/* @__PURE__ */ J("div", {
|
|
3446
|
+
ref: Qn,
|
|
3366
3447
|
"data-testid": "metric-card-v2",
|
|
3367
3448
|
"data-slot": "metric-card",
|
|
3368
|
-
"data-fullscreen-open":
|
|
3369
|
-
"data-download-open":
|
|
3370
|
-
"data-underlying-open":
|
|
3449
|
+
"data-fullscreen-open": Ct || void 0,
|
|
3450
|
+
"data-download-open": Tt || void 0,
|
|
3451
|
+
"data-underlying-open": Dt || void 0,
|
|
3371
3452
|
"data-title-click-fullscreen": hi ? "" : void 0,
|
|
3372
|
-
className:
|
|
3453
|
+
className: G("group/metric-card flex h-full w-full flex-col gap-3 bg-(--card) text-(--card-foreground) rounded-(--radius-lg) p-4", "overflow-clip", !bt && "border border-border-strong", !xt && "transition-shadow hover:ring-1 hover:ring-border-strong motion-reduce:transition-none", je),
|
|
3373
3454
|
children: [
|
|
3374
|
-
/* @__PURE__ */
|
|
3375
|
-
title:
|
|
3376
|
-
description:
|
|
3455
|
+
/* @__PURE__ */ q(Nr, {
|
|
3456
|
+
title: ft,
|
|
3457
|
+
description: pt,
|
|
3377
3458
|
isDisableCardTitle: l,
|
|
3378
|
-
infoContent:
|
|
3379
|
-
actions:
|
|
3380
|
-
onTitleClick: hi ? () =>
|
|
3459
|
+
infoContent: gt,
|
|
3460
|
+
actions: Or,
|
|
3461
|
+
onTitleClick: hi ? () => wt(!0) : void 0
|
|
3381
3462
|
}),
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
className:
|
|
3384
|
-
"aria-busy":
|
|
3463
|
+
/* @__PURE__ */ J("div", {
|
|
3464
|
+
className: G("flex min-h-0 w-full flex-1 flex-col", st && "relative opacity-60 transition-opacity motion-reduce:transition-none"),
|
|
3465
|
+
"aria-busy": st || void 0,
|
|
3385
3466
|
children: [
|
|
3386
|
-
|
|
3467
|
+
st ? /* @__PURE__ */ q("div", {
|
|
3387
3468
|
"data-testid": "metric-card-updating",
|
|
3388
3469
|
"aria-hidden": "true",
|
|
3389
3470
|
className: "pointer-events-none absolute inset-x-0 top-0 z-2 h-0.5 animate-pulse bg-(--primary) motion-reduce:animate-none"
|
|
3390
3471
|
}) : null,
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
|
|
3472
|
+
/* @__PURE__ */ q(Te, { text: zr }),
|
|
3473
|
+
z.filterNotAppliedNotice ? /* @__PURE__ */ q("div", {
|
|
3393
3474
|
role: "status",
|
|
3394
3475
|
className: "mb-2 text-caption text-(--muted-foreground)",
|
|
3395
3476
|
"data-testid": "metric-card-filter-not-applied-notice",
|
|
3396
|
-
children:
|
|
3477
|
+
children: z.filterNotAppliedNotice
|
|
3397
3478
|
}) : null,
|
|
3398
|
-
|
|
3399
|
-
|
|
3479
|
+
Qr,
|
|
3480
|
+
di
|
|
3400
3481
|
]
|
|
3401
3482
|
}),
|
|
3402
|
-
|
|
3483
|
+
Mt ? /* @__PURE__ */ J("div", {
|
|
3403
3484
|
role: "alert",
|
|
3404
3485
|
"data-testid": "card-download-error",
|
|
3405
3486
|
"data-slot": "metric-card-download-error",
|
|
3406
3487
|
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)",
|
|
3407
3488
|
children: [
|
|
3408
|
-
/* @__PURE__ */
|
|
3489
|
+
/* @__PURE__ */ q(ke, {
|
|
3409
3490
|
className: "size-3.5 shrink-0",
|
|
3410
3491
|
"aria-hidden": "true"
|
|
3411
3492
|
}),
|
|
3412
|
-
/* @__PURE__ */
|
|
3493
|
+
/* @__PURE__ */ q("span", {
|
|
3413
3494
|
className: "flex-1",
|
|
3414
|
-
children:
|
|
3495
|
+
children: Mt
|
|
3415
3496
|
}),
|
|
3416
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ q(U, {
|
|
3417
3498
|
type: "button",
|
|
3418
3499
|
variant: "ghost",
|
|
3419
3500
|
size: "icon-xs",
|
|
3420
3501
|
"aria-label": "Dismiss",
|
|
3421
3502
|
"data-testid": "card-download-error-dismiss",
|
|
3422
3503
|
className: "text-(--destructive) hover:bg-(--destructive)/15 hover:text-(--destructive)",
|
|
3423
|
-
onClick:
|
|
3424
|
-
children: /* @__PURE__ */
|
|
3504
|
+
onClick: Nt,
|
|
3505
|
+
children: /* @__PURE__ */ q(vt, { "aria-hidden": "true" })
|
|
3425
3506
|
})
|
|
3426
3507
|
]
|
|
3427
3508
|
}) : null,
|
|
3428
|
-
/* @__PURE__ */
|
|
3509
|
+
/* @__PURE__ */ q(Mr, { longDescription: ht })
|
|
3429
3510
|
]
|
|
3430
3511
|
}),
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
open:
|
|
3433
|
-
onOpenChange:
|
|
3434
|
-
rows:
|
|
3435
|
-
onDownload:
|
|
3512
|
+
/* @__PURE__ */ q(ei, {
|
|
3513
|
+
open: Tt,
|
|
3514
|
+
onOpenChange: Et,
|
|
3515
|
+
rows: tr,
|
|
3516
|
+
onDownload: or,
|
|
3436
3517
|
onEmail: ie ? () => ie() : void 0
|
|
3437
3518
|
}),
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
hasActiveFilters: !
|
|
3440
|
-
open:
|
|
3441
|
-
onOpenChange:
|
|
3442
|
-
title:
|
|
3443
|
-
columns:
|
|
3444
|
-
rows:
|
|
3445
|
-
presentation:
|
|
3446
|
-
selectedDims:
|
|
3447
|
-
selectedMetrics:
|
|
3448
|
-
measureFormatter:
|
|
3449
|
-
scope:
|
|
3450
|
-
isLoading:
|
|
3451
|
-
error:
|
|
3519
|
+
/* @__PURE__ */ q(ur, {
|
|
3520
|
+
hasActiveFilters: !At && Rr,
|
|
3521
|
+
open: Dt,
|
|
3522
|
+
onOpenChange: Ot,
|
|
3523
|
+
title: At ? "Underlying data (filters ignored)" : "Underlying data",
|
|
3524
|
+
columns: Bt,
|
|
3525
|
+
rows: It,
|
|
3526
|
+
presentation: ln ? {
|
|
3527
|
+
selectedDims: L?.datasetMetricSettings?.newDatasetSettings?.selectedDims,
|
|
3528
|
+
selectedMetrics: L?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics,
|
|
3529
|
+
measureFormatter: _r,
|
|
3530
|
+
scope: Hn,
|
|
3531
|
+
isLoading: Rt,
|
|
3532
|
+
error: Qt,
|
|
3452
3533
|
paging: {
|
|
3453
|
-
limit:
|
|
3454
|
-
offset:
|
|
3455
|
-
totalRows:
|
|
3456
|
-
onRequestPage:
|
|
3457
|
-
canSearch:
|
|
3458
|
-
language:
|
|
3459
|
-
translationDictionary:
|
|
3534
|
+
limit: Vt.limit,
|
|
3535
|
+
offset: Vt.offset,
|
|
3536
|
+
totalRows: Ut,
|
|
3537
|
+
onRequestPage: vr,
|
|
3538
|
+
canSearch: M({
|
|
3539
|
+
language: _e,
|
|
3540
|
+
translationDictionary: ve
|
|
3460
3541
|
})
|
|
3461
3542
|
}
|
|
3462
3543
|
} : void 0,
|
|
3463
|
-
onDownload: () =>
|
|
3464
|
-
onDownloadAll:
|
|
3465
|
-
downloadAllState:
|
|
3544
|
+
onDownload: () => rr(It),
|
|
3545
|
+
onDownloadAll: ln ? br : void 0,
|
|
3546
|
+
downloadAllState: Yt
|
|
3466
3547
|
}),
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
hasActiveFilters:
|
|
3469
|
-
open:
|
|
3470
|
-
onOpenChange:
|
|
3471
|
-
metric:
|
|
3472
|
-
chartSettings:
|
|
3473
|
-
data:
|
|
3474
|
-
chartColors:
|
|
3475
|
-
chartAppearance:
|
|
3476
|
-
chartRendererType:
|
|
3477
|
-
title:
|
|
3478
|
-
isLoading:
|
|
3479
|
-
error:
|
|
3480
|
-
isJoinMismatch: !!
|
|
3481
|
-
onRetry:
|
|
3482
|
-
copyProps:
|
|
3548
|
+
/* @__PURE__ */ q(ti, {
|
|
3549
|
+
hasActiveFilters: Rr,
|
|
3550
|
+
open: Ct,
|
|
3551
|
+
onOpenChange: wt,
|
|
3552
|
+
metric: L,
|
|
3553
|
+
chartSettings: H,
|
|
3554
|
+
data: B,
|
|
3555
|
+
chartColors: St,
|
|
3556
|
+
chartAppearance: y,
|
|
3557
|
+
chartRendererType: v,
|
|
3558
|
+
title: ft,
|
|
3559
|
+
isLoading: ot && !Gr,
|
|
3560
|
+
error: V,
|
|
3561
|
+
isJoinMismatch: !!tt,
|
|
3562
|
+
onRetry: ut,
|
|
3563
|
+
copyProps: yt
|
|
3483
3564
|
})
|
|
3484
3565
|
] });
|
|
3485
3566
|
};
|
|
3486
3567
|
//#endregion
|
|
3487
|
-
export {
|
|
3568
|
+
export { hi as MetricCardV2, hi as default };
|