@aintela/bi 0.2.1 → 0.2.3
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/README.md +32 -1
- package/dist/ChartCardDefaultsContext-BDRsVljO.js +34 -0
- package/dist/ChartCardDefaultsContext-BDRsVljO.js.map +1 -0
- package/dist/{GridLayout-BgPzzPiP.js → GridLayout-1gWuIKeZ.js} +3 -4
- package/dist/GridLayout-1gWuIKeZ.js.map +1 -0
- package/dist/{ScriptDashboardViewerVertical-DKaHcL1o.js → ScriptDashboardViewerVertical-Rr_4adpH.js} +4 -4
- package/dist/{ScriptDashboardViewerVertical-DKaHcL1o.js.map → ScriptDashboardViewerVertical-Rr_4adpH.js.map} +1 -1
- package/dist/{biModuleSurface-dtnpBMtT.js → biModuleSurface-BdJK7sSL.js} +6 -6
- package/dist/{biModuleSurface-dtnpBMtT.js.map → biModuleSurface-BdJK7sSL.js.map} +1 -1
- package/dist/cards.js +1 -1
- package/dist/composer/index.d.ts +3 -1
- package/dist/composer/view/ComposerView.d.ts +20 -1
- package/dist/composer/view/SessionVisualizationsPanel.d.ts +19 -0
- package/dist/composer.js +73 -71
- package/dist/data/ChartCardDefaultsContext.d.ts +9 -0
- package/dist/data.js +1 -1
- package/dist/grid.js +16 -17
- package/dist/grid.js.map +1 -1
- package/dist/{index-DeiweWw8.js → index-9LcZjCK0.js} +54 -50
- package/dist/index-9LcZjCK0.js.map +1 -0
- package/dist/{index-Dz2ulBiy.js → index-BzUugG0A.js} +4 -5
- package/dist/{index-Dz2ulBiy.js.map → index-BzUugG0A.js.map} +1 -1
- package/dist/index-C4_VSDeU.js +3856 -0
- package/dist/index-C4_VSDeU.js.map +1 -0
- package/dist/{index-CPHaT2or.js → index-DChE_l-p.js} +2 -2
- package/dist/index-DChE_l-p.js.map +1 -0
- package/dist/{index-DOpx0R4Y.js → index-Dy6hwDjs.js} +2 -2
- package/dist/index-Dy6hwDjs.js.map +1 -0
- package/dist/index.js +228 -223
- package/dist/index.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/sessionVisualizations.d.ts +61 -0
- package/dist/runtime/version.d.ts +1 -1
- package/dist/runtime.js +16 -11
- package/dist/runtime.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/version-BTc4ElDG.js +122 -0
- package/dist/version-BTc4ElDG.js.map +1 -0
- package/dist/viewer.js +1 -1
- package/package.json +1 -1
- package/dist/ChartCardDefaultsContext-Cl5T25H0.js +0 -32
- package/dist/ChartCardDefaultsContext-Cl5T25H0.js.map +0 -1
- package/dist/GridLayout-BgPzzPiP.js.map +0 -1
- package/dist/index-7p-ogAPK.js +0 -3631
- package/dist/index-7p-ogAPK.js.map +0 -1
- package/dist/index-CPHaT2or.js.map +0 -1
- package/dist/index-DOpx0R4Y.js.map +0 -1
- package/dist/index-DeiweWw8.js.map +0 -1
- package/dist/version-BgIpi4UM.js +0 -84
- package/dist/version-BgIpi4UM.js.map +0 -1
package/dist/composer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as e, a as t, b as o, c as r, d as n, e as i, f as d, g as C, h as m, i as E, D as S, j as
|
|
2
|
-
import { EnvironmentProvider as
|
|
1
|
+
import { C as e, a as t, b as o, c as r, d as n, e as i, f as d, g as C, h as m, i as E, D as S, j as l, k as p, l as P, m as T, n as _, o as u, p as c, q as D, E as I, r as h, s as A, t as v, u as R, v as O, F as k, w as g, x as L, G as b, y as f, H as y, P as N, z as V, A as F, S as x, B as G, I as H, J as B, K as M, M as Y, T as z, N as U, O as w, Q as K, R as j, V as q, X as W, Y as X, Z as J, _ as Q, $ as Z, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as oa, a6 as ra, a7 as na, a8 as ia, a9 as da, aa as Ca, ab as ma, ac as Ea, ad as Sa, ae as la, af as pa, ag as Pa, ah as Ta, ai as _a, aj as ua, ak as ca, al as Da, am as Ia, an as ha, ao as Aa, ap as va, aq as Ra, ar as Oa, as as ka, at as ga, au as La, av as ba, aw as fa, ax as ya, ay as Na, az as Va, aA as Fa, aB as xa, aC as Ga, aD as Ha, aF as Ba } from "./index-C4_VSDeU.js";
|
|
2
|
+
import { EnvironmentProvider as Ya, InertEnvironmentProvider as za, useEnvironment as Ua, useEnvironmentOptional as wa } from "@aintela/chat/components";
|
|
3
3
|
export {
|
|
4
4
|
e as CARD_TYPE_CATALOG,
|
|
5
5
|
t as CATEGORY_ICONS,
|
|
@@ -12,88 +12,90 @@ export {
|
|
|
12
12
|
m as ComposerProvider,
|
|
13
13
|
E as ComposerView,
|
|
14
14
|
S as DEFAULT_PAD_HEIGHT_PX,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
l as DRAFT_SAVE_DEBOUNCE_MS,
|
|
16
|
+
p as DashboardPad,
|
|
17
|
+
P as DashboardPadEditor,
|
|
18
|
+
T as DashboardPadSketch,
|
|
19
|
+
_ as DashboardPin,
|
|
20
|
+
u as DashboardSidePanel,
|
|
21
|
+
c as DatasetParameterizationControls,
|
|
22
|
+
D as DrawablePrompt,
|
|
23
|
+
I as ENV_HIGHLIGHT_CLASS,
|
|
24
|
+
h as EntryEmptyState,
|
|
25
|
+
Ya as EnvironmentProvider,
|
|
26
26
|
A as ExampleCardSkath,
|
|
27
27
|
v as ExampleCardSketch,
|
|
28
28
|
R as ExampleCardSketh,
|
|
29
29
|
O as ExamplePad,
|
|
30
30
|
k as FILTER_TYPE_CATALOG,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
g as FILTER_TYPE_ICONS,
|
|
32
|
+
L as FilterSketch,
|
|
33
33
|
b as GRID_ROW_HEIGHT_PX,
|
|
34
34
|
f as GUIDE_SHOW_DELAY_MS,
|
|
35
35
|
y as HoverButton,
|
|
36
|
-
|
|
36
|
+
za as InertEnvironmentProvider,
|
|
37
37
|
N as PAD_INTERNAL_CLASSES,
|
|
38
|
-
|
|
38
|
+
V as PAD_INTERNAL_IDS,
|
|
39
39
|
F as PrototypePad,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Y as
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
K as
|
|
40
|
+
x as SPECIFIC_TYPE_ICONS,
|
|
41
|
+
G as SPECIFIC_TYPE_ICON_NAMES,
|
|
42
|
+
H as STARTER_TEMPLATES,
|
|
43
|
+
B as SessionVisualizationsPanel,
|
|
44
|
+
M as SessionVisualizationsPanelButton,
|
|
45
|
+
Y as SpotlightOverlay,
|
|
46
|
+
z as TEMPLATE_KIND_TO_SKETCH,
|
|
47
|
+
U as TextSketh,
|
|
48
|
+
w as TitleSkath,
|
|
49
|
+
K as TitleSketch,
|
|
50
|
+
j as ToolBox,
|
|
51
|
+
q as VIEWER_COMMIT_DEBOUNCE_MS,
|
|
50
52
|
W as activityPanelVariants,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
X as activityPanelVariantsReduced,
|
|
54
|
+
J as ambientVariants,
|
|
55
|
+
Q as ambientVariantsReduced,
|
|
56
|
+
Z as autoComplete,
|
|
57
|
+
$ as c,
|
|
58
|
+
aa as categoryPrefix,
|
|
59
|
+
sa as composerLayoutTransition,
|
|
60
|
+
ea as composerLayoutTransitionReduced,
|
|
61
|
+
ta as createComposerStore,
|
|
62
|
+
oa as createDashboardDraft,
|
|
63
|
+
ra as datePicker,
|
|
64
|
+
na as dateRange,
|
|
65
|
+
ia as defaultCardTypeIcons,
|
|
66
|
+
da as defaultComposerSuggestions,
|
|
67
|
+
Ca as defaultComposerTemplates,
|
|
68
|
+
ma as environmentFromStore,
|
|
69
|
+
Ea as fromUpsertResponse,
|
|
70
|
+
Sa as groupCardCatalog,
|
|
71
|
+
la as guideStepsRequireSketch,
|
|
72
|
+
pa as isElementVisible,
|
|
73
|
+
Pa as isSimplePadDefinition,
|
|
74
|
+
Ta as joinClientSideChanges,
|
|
75
|
+
_a as padConfigToDashboard,
|
|
76
|
+
ua as pickBestElement,
|
|
77
|
+
ca as randomId,
|
|
78
|
+
Da as resolveComposerSurfaces,
|
|
77
79
|
Ia as resolveEnvironmentElements,
|
|
78
80
|
ha as resolveGuideElement,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
Aa as sanitizeToJsVariable,
|
|
82
|
+
va as seedFromTemplate,
|
|
83
|
+
Ra as sketchCardItemComparer,
|
|
84
|
+
Oa as sketchFilterComparer,
|
|
85
|
+
ka as targetSuggestsPadInternal,
|
|
86
|
+
ga as templateKinds,
|
|
87
|
+
La as toDraftPayload,
|
|
88
|
+
ba as toSelectorList,
|
|
89
|
+
fa as upsertDashboardDraft,
|
|
90
|
+
ya as useCardTypeIcons,
|
|
91
|
+
Na as useComposer,
|
|
92
|
+
Va as useComposerChatBridge,
|
|
93
|
+
Fa as useComposerEnvironment,
|
|
92
94
|
xa as useComposerStore,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
Ga as useComposerStoreOptional,
|
|
96
|
+
Ha as useDashboardPad,
|
|
97
|
+
Ua as useEnvironment,
|
|
98
|
+
wa as useEnvironmentOptional,
|
|
99
|
+
Ba as validateSketch
|
|
98
100
|
};
|
|
99
101
|
//# sourceMappingURL=composer.js.map
|
|
@@ -20,6 +20,14 @@ export interface ChartCardDefaults {
|
|
|
20
20
|
* primer colour from the palette in round-robin mount order.
|
|
21
21
|
*/
|
|
22
22
|
rotateBasePerChart?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Gridline colour for every chart under the provider. Without it a chart
|
|
25
|
+
* derives one from `text.primary` at 12%, which is right on a neutral
|
|
26
|
+
* canvas and too heavy on a warm one — and the alternative was the
|
|
27
|
+
* per-card `gridColor` prop, i.e. a host repeating one decision on every
|
|
28
|
+
* card of every dashboard.
|
|
29
|
+
*/
|
|
30
|
+
gridColor?: string;
|
|
23
31
|
/**
|
|
24
32
|
* Internal: provider-supplied counter used by ChartCard to claim a slot
|
|
25
33
|
* index on first mount. Use `ChartCardDefaultsProvider` rather than
|
|
@@ -33,6 +41,7 @@ export interface ChartCardDefaultsProviderProps {
|
|
|
33
41
|
palette?: readonly string[];
|
|
34
42
|
monoShadePerCategory?: boolean;
|
|
35
43
|
rotateBasePerChart?: boolean;
|
|
44
|
+
gridColor?: string;
|
|
36
45
|
children: React.ReactNode;
|
|
37
46
|
}
|
|
38
47
|
/**
|
package/dist/data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as e, c as s, a as r, b as o, d as m, e as l, f as u, g as i, h as c, i as f, j as C, k as n, l as D, m as p, p as d, t as x, n as h, o as b, q as B, r as P, s as S, u as T, v, w as F, x as N } from "./dataUtils-CAUE5uZY.js";
|
|
2
|
-
import { C as g, a as k, u as w } from "./ChartCardDefaultsContext-
|
|
2
|
+
import { C as g, a as k, u as w } from "./ChartCardDefaultsContext-BDRsVljO.js";
|
|
3
3
|
import { c as j, r as q, u as z } from "./createBiTheme-TyUv_UHM.js";
|
|
4
4
|
export {
|
|
5
5
|
g as ChartCardDefaultsContext,
|
package/dist/grid.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as p, a as u, b as R, u as l } from "./index-Dz2ulBiy.js";
|
|
1
|
+
import { B as s, D as o, a as t, b as e, c as i, d, G as n, e as C } from "./GridLayout-1gWuIKeZ.js";
|
|
2
|
+
import { G as E } from "./GridCardPlaceHolder-DVVT3pqn.js";
|
|
3
|
+
import { C as T, u as f } from "./ChartContext-C_f_6khG.js";
|
|
4
|
+
import { t as _, a as u, b as R, u as l } from "./index-BzUugG0A.js";
|
|
6
5
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
s as BiErrorBoundary,
|
|
7
|
+
T as ChartContextProvider,
|
|
8
|
+
o as DEFAULT_BREAKPOINTS,
|
|
9
|
+
t as DEFAULT_COLS,
|
|
10
|
+
e as DEFAULT_MAX_ROWS,
|
|
11
|
+
i as DEFAULT_ROW_HEIGHT,
|
|
12
|
+
d as DEFAULT_ROW_MULTIPLIER,
|
|
13
|
+
n as GridCard,
|
|
14
|
+
E as GridCardPlaceHolder,
|
|
15
|
+
C as GridLayout,
|
|
16
|
+
_ as translateGridConfig,
|
|
18
17
|
u as translateGridConfigAutoResponsive,
|
|
19
18
|
R as translateResponsiveGridConfig,
|
|
20
|
-
|
|
19
|
+
f as useChartContext,
|
|
21
20
|
l as useGridConfigTranslator
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=grid.js.map
|
package/dist/grid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grid.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -6,14 +6,14 @@ import { p as kt, h as ne, v as St, j as tt, s as le, g as Ct, m as wt, i as Mt,
|
|
|
6
6
|
import { u as Tt, r as we } from "./createBiTheme-TyUv_UHM.js";
|
|
7
7
|
import { u as Ne } from "./ChartContext-C_f_6khG.js";
|
|
8
8
|
import Be, { useEffect as rt, useState as re, useMemo as E, useRef as nt, createContext as It, useContext as Rt, useCallback as ke } from "react";
|
|
9
|
-
import { alpha as
|
|
9
|
+
import { alpha as ee } from "@mui/material/styles";
|
|
10
10
|
import Et from "@mui/icons-material/FileDownloadOutlined";
|
|
11
11
|
import $t from "@mui/icons-material/TableViewOutlined";
|
|
12
12
|
import Bt from "@mui/icons-material/FilterAltOffOutlined";
|
|
13
13
|
import { DataGridPro as At, gridClasses as Ve, getGridSingleSelectOperators as _t, useGridApiContext as Gt, useGridSelector as Nt, gridFilterModelSelector as Pt, GridToolbarContainer as zt, GridToolbarColumnsButton as Ht, GridToolbarFilterButton as Kt, GridToolbarDensitySelector as Ft, GridToolbarExportContainer as Wt } from "@mui/x-data-grid-pro";
|
|
14
14
|
import { LicenseInfo as Ot } from "@mui/x-license";
|
|
15
15
|
import { ResponsiveContainer as ye, PieChart as jt, Pie as Xt, Cell as qe, Tooltip as Ie, Legend as Re, ScatterChart as Yt, CartesianGrid as De, XAxis as Ee, YAxis as $e, Scatter as Zt, ComposedChart as Ut, BarChart as Vt, AreaChart as qt, LineChart as Dt, Bar as Qt, Area as Jt, Line as er, Treemap as tr } from "recharts";
|
|
16
|
-
import { u as rr } from "./ChartCardDefaultsContext-
|
|
16
|
+
import { u as rr } from "./ChartCardDefaultsContext-BDRsVljO.js";
|
|
17
17
|
import { u as ot } from "./useContainerRectangle-D464wPFX.js";
|
|
18
18
|
import { ComposableMap as at, ZoomableGroup as it, Geographies as Se, Geography as Ce, useZoomPanContext as Pe, Marker as Ae, useMapContext as nr } from "react-simple-maps";
|
|
19
19
|
function st({
|
|
@@ -91,12 +91,12 @@ function Je({ zones: t, ratio: e, needleColor: o, strokeWidth: i, textPrimaryCol
|
|
|
91
91
|
const d = te + e * (be - te), [b, y] = _e(d);
|
|
92
92
|
return /* @__PURE__ */ x("svg", { className: g, x: "0", y: "0", viewBox: `0 0 ${ir} ${sr}`, width: "100%", height: "100%", preserveAspectRatio: "xMidYMid meet", children: [
|
|
93
93
|
t.map((w, M) => {
|
|
94
|
-
const T = Math.min(M > 0 ? t[M - 1].value : 0, 1),
|
|
94
|
+
const T = Math.min(M > 0 ? t[M - 1].value : 0, 1), G = te + T * (be - te), L = Math.min(te + w.value * (be - te), be);
|
|
95
95
|
return /* @__PURE__ */ r(
|
|
96
96
|
"path",
|
|
97
97
|
{
|
|
98
98
|
className: f,
|
|
99
|
-
d: Qe(
|
|
99
|
+
d: Qe(G, L),
|
|
100
100
|
fill: "none",
|
|
101
101
|
stroke: w.color,
|
|
102
102
|
strokeWidth: i,
|
|
@@ -283,35 +283,35 @@ function xr({
|
|
|
283
283
|
rt(() => {
|
|
284
284
|
lt();
|
|
285
285
|
}, []), t && e && console.warn("[DataTableCard] Both `data` and `lazyData` were provided. These props are mutually exclusive. Using `lazyData` and ignoring `data`.");
|
|
286
|
-
const
|
|
286
|
+
const G = g ?? (T ? 50 : 20), [L, Z] = re({ page: 0, pageSize: G }), U = E(() => {
|
|
287
287
|
const k = o ?? (e == null ? void 0 : e.columnSchema) ?? (t == null ? void 0 : t.columnSchema);
|
|
288
288
|
return k ? k.build() : [];
|
|
289
|
-
}, [o, t == null ? void 0 : t.columnSchema, e == null ? void 0 : e.columnSchema]),
|
|
289
|
+
}, [o, t == null ? void 0 : t.columnSchema, e == null ? void 0 : e.columnSchema]), N = e == null ? void 0 : e.getRows, D = E(() => N ? { getRows: N } : void 0, [N]), { naked: $ } = Ne() ?? {}, j = vr({ containerRef: M, multiplier: $ ? 1 : 0.9, naked: $, minHeight: 300 }), K = E(() => gr(U, b), [U, b]), I = e == null ? void 0 : e.downloadCsv, X = e == null ? void 0 : e.downloadXlsx, B = (e == null ? void 0 : e.exporting) ?? !1, [u, P] = re(null), z = Be.useCallback(
|
|
290
290
|
async (k) => {
|
|
291
291
|
const O = k === "xlsx" ? X : I;
|
|
292
292
|
if (!O) return;
|
|
293
293
|
const se = k === "xlsx" ? "Excel" : "CSV";
|
|
294
|
-
|
|
294
|
+
P({ kind: "progress", message: `Exportando ${se}…` });
|
|
295
295
|
try {
|
|
296
|
-
await O(),
|
|
296
|
+
await O(), P({ kind: "success", message: `${se} exportado com sucesso` });
|
|
297
297
|
} catch (fe) {
|
|
298
|
-
console.error(`[DataTableCard] ${se} export failed`, fe),
|
|
298
|
+
console.error(`[DataTableCard] ${se} export failed`, fe), P({ kind: "error", message: fe instanceof Error ? fe.message : `Falha ao exportar ${se}` });
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
301
|
[I, X]
|
|
302
|
-
),
|
|
302
|
+
), H = E(() => I ? () => z("csv") : void 0, [I, z]), J = E(() => X ? () => z("xlsx") : void 0, [X, z]), V = e == null ? void 0 : e.apiRef, oe = E(
|
|
303
303
|
() => V ? () => {
|
|
304
304
|
var k;
|
|
305
305
|
return (k = V.current) == null ? void 0 : k.setFilterModel({ items: [], quickFilterValues: [] });
|
|
306
306
|
} : void 0,
|
|
307
307
|
[V]
|
|
308
308
|
), ae = E(() => {
|
|
309
|
-
if (!(!
|
|
310
|
-
return { onCsvExport:
|
|
311
|
-
}, [
|
|
309
|
+
if (!(!H && !J && !oe))
|
|
310
|
+
return { onCsvExport: H, onXlsxExport: J, onClearFilters: oe, exporting: B };
|
|
311
|
+
}, [H, J, oe, B]), ve = E(() => {
|
|
312
312
|
const k = { density: m ? "compact" : "standard" };
|
|
313
313
|
return y && (k.pinnedColumns = y), k;
|
|
314
|
-
}, []), Me = E(() => t ? t.rows.map((k, O) => ({ id: O, ...k })) : [], [t]), ie = f ?? w.palette.action.hover, me = v ?? "transparent", Le = l ??
|
|
314
|
+
}, []), Me = E(() => t ? t.rows.map((k, O) => ({ id: O, ...k })) : [], [t]), ie = f ?? w.palette.action.hover, me = v ?? "transparent", Le = l ?? ee(w.palette.primary.main, w.palette.mode === "dark" ? 0.24 : 0.1);
|
|
315
315
|
return /* @__PURE__ */ x(S, { "data-testid": d ? "loading" : "", sx: { width: "100%", height: "100%", p: m ? 1 : 2, display: "flex", flexDirection: "column", overflow: "auto" }, ref: M, children: [
|
|
316
316
|
s && $ && /* @__PURE__ */ r(A, { variant: "h6", sx: { mb: 1 }, children: s }),
|
|
317
317
|
/* @__PURE__ */ r(
|
|
@@ -373,12 +373,12 @@ function xr({
|
|
|
373
373
|
{
|
|
374
374
|
open: u !== null,
|
|
375
375
|
autoHideDuration: (u == null ? void 0 : u.kind) === "progress" ? null : (u == null ? void 0 : u.kind) === "error" ? 6e3 : 3e3,
|
|
376
|
-
onClose: /* @__PURE__ */ p(() =>
|
|
376
|
+
onClose: /* @__PURE__ */ p(() => P(null), "onClose"),
|
|
377
377
|
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
378
378
|
children: /* @__PURE__ */ r(
|
|
379
379
|
vt,
|
|
380
380
|
{
|
|
381
|
-
onClose: /* @__PURE__ */ p(() =>
|
|
381
|
+
onClose: /* @__PURE__ */ p(() => P(null), "onClose"),
|
|
382
382
|
severity: (u == null ? void 0 : u.kind) === "error" ? "error" : (u == null ? void 0 : u.kind) === "success" ? "success" : "info",
|
|
383
383
|
icon: (u == null ? void 0 : u.kind) === "progress" ? /* @__PURE__ */ r(bt, { size: 16, color: "inherit" }) : void 0,
|
|
384
384
|
variant: "outlined",
|
|
@@ -415,7 +415,7 @@ function Ge(t, e, o, i = 0.25, s = 1) {
|
|
|
415
415
|
if (o <= 1) return t;
|
|
416
416
|
const c = e / Math.max(1, o - 1), f = i + (s - i) * c;
|
|
417
417
|
try {
|
|
418
|
-
return
|
|
418
|
+
return ee(t, f);
|
|
419
419
|
} catch {
|
|
420
420
|
return t;
|
|
421
421
|
}
|
|
@@ -440,13 +440,15 @@ function yr({
|
|
|
440
440
|
maxSlices: w = 4,
|
|
441
441
|
palette: M,
|
|
442
442
|
backgroundColor: T,
|
|
443
|
-
gridColor:
|
|
443
|
+
gridColor: G
|
|
444
444
|
}) {
|
|
445
445
|
var We, Oe;
|
|
446
|
-
const L = ue(), { naked: Z } = Ne() ?? {}, U = t ? Array.isArray(t) ? t : t.rows : [],
|
|
446
|
+
const L = ue(), { naked: Z } = Ne() ?? {}, U = t ? Array.isArray(t) ? t : t.rows : [], N = E(() => o ? U.map((a) => ({
|
|
447
447
|
...a,
|
|
448
448
|
__xLabel: (g ?? br)(a[o])
|
|
449
|
-
})) : U, [U, o, g]), D = m ?? ((a) => ne(a, 0)), $ = L.palette.text.secondary
|
|
449
|
+
})) : U, [U, o, g]), D = m ?? ((a) => ne(a, 0)), $ = L.palette.text.secondary;
|
|
450
|
+
let Q = G ?? ee(L.palette.text.primary, 0.12);
|
|
451
|
+
const j = o ? "__xLabel" : void 0, K = /* @__PURE__ */ p((a, R) => {
|
|
450
452
|
var W, ge;
|
|
451
453
|
if (!a) return R;
|
|
452
454
|
const C = { ...R }, Y = a.color ?? ((W = R.tick) == null ? void 0 : W.fill) ?? $, F = a.fontSize ?? ((ge = R.tick) == null ? void 0 : ge.fontSize) ?? 12;
|
|
@@ -468,10 +470,12 @@ function yr({
|
|
|
468
470
|
stroke: L.palette.action.selected,
|
|
469
471
|
strokeWidth: 1
|
|
470
472
|
}
|
|
471
|
-
}, u = rr()
|
|
473
|
+
}, u = rr();
|
|
474
|
+
Q = G ?? u.gridColor ?? Q;
|
|
475
|
+
const P = M ?? u.palette ?? we(L).series, z = u.monoShadePerCategory ?? !0, H = (u.rotateBasePerChart ?? !0) && P.length > 0, [J] = re(() => {
|
|
472
476
|
var a;
|
|
473
|
-
return
|
|
474
|
-
}), V = /* @__PURE__ */ p((a) =>
|
|
477
|
+
return H ? ((a = u.allocateChartSlot) == null ? void 0 : a.call(u)) ?? 0 : 0;
|
|
478
|
+
}), V = /* @__PURE__ */ p((a) => P[((H ? J : 0) + a) % P.length], "pickPaletteColor"), oe = Math.PI / 180, ae = /* @__PURE__ */ p(({ cx: a, cy: R, midAngle: C, innerRadius: Y, outerRadius: F, percent: W, fill: ge }) => {
|
|
475
479
|
if (a == null || R == null || Y == null || F == null) return null;
|
|
476
480
|
const je = Y + (F - Y) * 0.5, Xe = Number(a), Ye = Xe + je * Math.cos(-(C ?? 0) * oe), ft = Number(R) + je * Math.sin(-(C ?? 0) * oe);
|
|
477
481
|
let Ze = L.palette.text.primary;
|
|
@@ -481,16 +485,16 @@ function yr({
|
|
|
481
485
|
} catch {
|
|
482
486
|
}
|
|
483
487
|
return /* @__PURE__ */ r("text", { x: Ye, y: ft, fill: Ze, fontSize: 14, textAnchor: Ye > Xe ? "start" : "end", dominantBaseline: "central", children: `${((W ?? 1) * 100).toFixed(0)}%` });
|
|
484
|
-
}, "renderCustomizedLabel"), ve = i.map((a, R) => a.color ?? V(R)), Me =
|
|
488
|
+
}, "renderCustomizedLabel"), ve = i.map((a, R) => a.color ?? V(R)), Me = z && i.length === 1, ie = E(() => {
|
|
485
489
|
if (e !== "pie" && e !== "donut") return [];
|
|
486
|
-
const a =
|
|
490
|
+
const a = N.map((F, W) => ({
|
|
487
491
|
name: X(j ? String(F[j] ?? F[o] ?? W) : `#${W}`),
|
|
488
492
|
value: Number(i[0] ? F[i[0].dataKey] : 0) || 0
|
|
489
493
|
}));
|
|
490
494
|
if (a.length <= w) return a;
|
|
491
495
|
const R = [...a].sort((F, W) => W.value - F.value), C = R.slice(0, w - 1), Y = R.slice(w - 1).reduce((F, W) => F + W.value, 0);
|
|
492
496
|
return [...C, { name: "Others", value: Y }];
|
|
493
|
-
}, [e,
|
|
497
|
+
}, [e, N, j, o, i, w]), me = nt(null), [, Le] = ot(me);
|
|
494
498
|
if (y || !t)
|
|
495
499
|
return /* @__PURE__ */ x(S, { "data-testid": "loading", sx: { height: "100%", p: 2, width: "100%", backgroundColor: T }, children: [
|
|
496
500
|
s && Z && /* @__PURE__ */ r(_, { variant: "text", width: 180, sx: { fontSize: "1.25rem", mb: 1 } }),
|
|
@@ -517,7 +521,7 @@ function yr({
|
|
|
517
521
|
ie.map((a, R) => /* @__PURE__ */ r(
|
|
518
522
|
qe,
|
|
519
523
|
{
|
|
520
|
-
fill:
|
|
524
|
+
fill: z && ie.length > 1 ? Ge(V(0), R, ie.length) : V(R)
|
|
521
525
|
},
|
|
522
526
|
R
|
|
523
527
|
)),
|
|
@@ -532,19 +536,19 @@ function yr({
|
|
|
532
536
|
return /* @__PURE__ */ x(S, { sx: { height: "100%", p: 0, backgroundColor: T }, children: [
|
|
533
537
|
s && Z && /* @__PURE__ */ r(A, { variant: "h6", sx: { mb: 1 }, children: s }),
|
|
534
538
|
/* @__PURE__ */ r(ye, { width: "100%", height: c, children: /* @__PURE__ */ x(Yt, { margin: { top: 8, right: 16, bottom: d != null && d.tickAngle ? 24 : 8, left: 0 }, children: [
|
|
535
|
-
h && /* @__PURE__ */ r(De, { stroke:
|
|
539
|
+
h && /* @__PURE__ */ r(De, { stroke: Q }),
|
|
536
540
|
/* @__PURE__ */ r(Ee, { dataKey: o, name: o, ...K(d, { tick: { fill: $, fontSize: 12 } }) }),
|
|
537
541
|
/* @__PURE__ */ r($e, { dataKey: (We = i[0]) == null ? void 0 : We.dataKey, tickFormatter: D, name: (Oe = i[0]) == null ? void 0 : Oe.name, ...K(b, { tick: { fill: $, fontSize: 12 } }) }),
|
|
538
542
|
l && /* @__PURE__ */ r(Ie, { ...B }),
|
|
539
543
|
v && /* @__PURE__ */ r(Re, { wrapperStyle: { color: L.palette.text.secondary } }),
|
|
540
|
-
i.map((a, R) => /* @__PURE__ */ r(Zt, { name: a.name ?? a.dataKey, data:
|
|
544
|
+
i.map((a, R) => /* @__PURE__ */ r(Zt, { name: a.name ?? a.dataKey, data: N, fill: ve[R] }, a.dataKey))
|
|
541
545
|
] }) })
|
|
542
546
|
] });
|
|
543
547
|
const k = e === "bar" ? "barH" : e, O = k === "barH", se = k === "stackedArea" || k === "stackedBar", fe = k === "combo" ? Ut : k === "barH" || k === "barV" || k === "stackedBar" ? Vt : k === "area" || k === "stackedArea" ? qt : Dt, pt = O ? "vertical" : "horizontal", Te = f || se, mt = /* @__PURE__ */ p((a) => a.type ? a.type : k === "combo" || k === "barV" || k === "barH" || k === "stackedBar" ? "bar" : k === "area" || k === "stackedArea" ? "area" : "line", "resolveSeriesType");
|
|
544
548
|
return /* @__PURE__ */ x(S, { sx: { height: "100%", p: 0.3, backgroundColor: T }, ref: me, children: [
|
|
545
549
|
s && Z && /* @__PURE__ */ r(A, { variant: "h6", sx: { mb: 1 }, children: s }),
|
|
546
|
-
/* @__PURE__ */ r(ye, { width: "100%", height: "100%", children: /* @__PURE__ */ x(fe, { data:
|
|
547
|
-
h && /* @__PURE__ */ r(De, { stroke:
|
|
550
|
+
/* @__PURE__ */ r(ye, { width: "100%", height: "100%", children: /* @__PURE__ */ x(fe, { data: N, layout: pt, margin: { top: 0, right: 16, bottom: d != null && d.tickAngle ? 24 : 8, left: 0 }, style: { maxHeight: "95%" }, children: [
|
|
551
|
+
h && /* @__PURE__ */ r(De, { stroke: Q, strokeDasharray: "3 3" }),
|
|
548
552
|
O ? /* @__PURE__ */ x(xe, { children: [
|
|
549
553
|
/* @__PURE__ */ r(Ee, { type: "number", tickFormatter: D, ...K(d, { tick: { fill: $, fontSize: 12 } }) }),
|
|
550
554
|
/* @__PURE__ */ r($e, { type: "category", dataKey: j ?? o, ...K(b, { tick: { fill: $, fontSize: 12 }, width: 80 }) })
|
|
@@ -565,10 +569,10 @@ function yr({
|
|
|
565
569
|
stackId: Te ? "stack" : void 0,
|
|
566
570
|
radius: O ? [0, 4, 4, 0] : [4, 4, 0, 0],
|
|
567
571
|
maxBarSize: 24,
|
|
568
|
-
children: Me &&
|
|
572
|
+
children: Me && N.map((F, W) => (
|
|
569
573
|
// Bars are typically sorted descending, so invert the shade
|
|
570
574
|
// index: the largest bar gets the strongest alpha.
|
|
571
|
-
/* @__PURE__ */ r(qe, { fill: Ge(C,
|
|
575
|
+
/* @__PURE__ */ r(qe, { fill: Ge(C, N.length - 1 - W, N.length) }, W)
|
|
572
576
|
))
|
|
573
577
|
},
|
|
574
578
|
a.dataKey
|
|
@@ -599,7 +603,7 @@ function kr(t) {
|
|
|
599
603
|
/* @__PURE__ */ r("rect", { x: e, y: o, width: i, height: s, rx: 4, fill: v, stroke: h, strokeWidth: 1 }),
|
|
600
604
|
i > 50 && s > 30 && /* @__PURE__ */ x(xe, { children: [
|
|
601
605
|
/* @__PURE__ */ r("text", { x: e + 6, y: o + 16, fill: m, fontSize: 12, fontWeight: 600, children: (c ?? "").length > i / 7 ? (c ?? "").slice(0, Math.floor(i / 7)) + "…" : c }),
|
|
602
|
-
s > 44 && /* @__PURE__ */ r("text", { x: e + 6, y: o + 32, fill:
|
|
606
|
+
s > 44 && /* @__PURE__ */ r("text", { x: e + 6, y: o + 32, fill: ee(m, 0.7), fontSize: 11, children: g(f ?? 0) })
|
|
603
607
|
] })
|
|
604
608
|
] });
|
|
605
609
|
}
|
|
@@ -653,7 +657,7 @@ function He(t, e = {}) {
|
|
|
653
657
|
center: s ?? [0, 20],
|
|
654
658
|
zoom: i ?? 1
|
|
655
659
|
};
|
|
656
|
-
const c = t.map((
|
|
660
|
+
const c = t.map((G) => G.lat), f = t.map((G) => G.lng), v = Math.min(...c), h = Math.max(...c), l = Math.min(...f), g = Math.max(...f), m = s ?? [
|
|
657
661
|
(l + g) / 2,
|
|
658
662
|
(v + h) / 2
|
|
659
663
|
];
|
|
@@ -696,7 +700,7 @@ function Rr({
|
|
|
696
700
|
autoFit: g = !0,
|
|
697
701
|
geoUrl: m
|
|
698
702
|
}) {
|
|
699
|
-
const d = ue(), b = (t == null ? void 0 : t.rows) ?? [], [y, w] = re(null), M = f ?? ne, T = c ?? we(d).series[0],
|
|
703
|
+
const d = ue(), b = (t == null ? void 0 : t.rows) ?? [], [y, w] = re(null), M = f ?? ne, T = c ?? we(d).series[0], G = Fe(m), L = ee(d.palette.text.primary, 0.06), Z = ee(d.palette.text.primary, 0.09), U = d.palette.divider, N = d.palette.text.disabled, D = E(() => Math.max(1, ...b.map((I) => Math.abs(I.value))), [b]), $ = E(() => He(b, { autoFit: g, defaultZoom: h, center: l }), [b, g, h, l]), Q = ke((I, X) => {
|
|
700
704
|
const B = I.currentTarget.closest("svg");
|
|
701
705
|
if (!B) return;
|
|
702
706
|
const u = B.getBoundingClientRect();
|
|
@@ -720,10 +724,10 @@ function Rr({
|
|
|
720
724
|
height: 500,
|
|
721
725
|
style: { width: "100%", height: "100%", display: "block", background: d.palette.background.default, borderRadius: d.shape.borderRadius },
|
|
722
726
|
children: /* @__PURE__ */ x(it, { center: $.center, zoom: $.zoom, minZoom: 1, maxZoom: 40, children: [
|
|
723
|
-
|
|
724
|
-
(I, X) => X === 0 ? /* @__PURE__ */ r(Se, { geography: I, children: /* @__PURE__ */ p(({ geographies: B }) => B.map((u) => /* @__PURE__ */ r(Ce, { geography: u, fill: L, stroke: U, strokeWidth: 0.5, style: { ...K, hover: { outline: "none", fill: Z } } }, u.rsmKey)), "children") }, I) : /* @__PURE__ */ r(Se, { geography: I, children: /* @__PURE__ */ p(({ geographies: B }) => B.map((u) => /* @__PURE__ */ r(Ce, { geography: u, fill: "none", stroke:
|
|
727
|
+
G.map(
|
|
728
|
+
(I, X) => X === 0 ? /* @__PURE__ */ r(Se, { geography: I, children: /* @__PURE__ */ p(({ geographies: B }) => B.map((u) => /* @__PURE__ */ r(Ce, { geography: u, fill: L, stroke: U, strokeWidth: 0.5, style: { ...K, hover: { outline: "none", fill: Z } } }, u.rsmKey)), "children") }, I) : /* @__PURE__ */ r(Se, { geography: I, children: /* @__PURE__ */ p(({ geographies: B }) => B.map((u) => /* @__PURE__ */ r(Ce, { geography: u, fill: "none", stroke: N, strokeWidth: 0.3, style: K }, u.rsmKey)), "children") }, I)
|
|
725
729
|
),
|
|
726
|
-
/* @__PURE__ */ r(Ir, { bubbles: b, maxVal: D, minBubbleSize: i, maxBubbleSize: s, fillColor: T, fmt: M, onHover:
|
|
730
|
+
/* @__PURE__ */ r(Ir, { bubbles: b, maxVal: D, minBubbleSize: i, maxBubbleSize: s, fillColor: T, fmt: M, onHover: Q, onLeave: j })
|
|
727
731
|
] })
|
|
728
732
|
}
|
|
729
733
|
),
|
|
@@ -795,14 +799,14 @@ function Ar({
|
|
|
795
799
|
autoFit: l = !0,
|
|
796
800
|
geoUrl: g
|
|
797
801
|
}) {
|
|
798
|
-
const m = ue(), d = (t == null ? void 0 : t.rows) ?? [], [b, y] = re(null), [w, M] = re(null), T = c ?? ne,
|
|
799
|
-
(u,
|
|
800
|
-
const
|
|
801
|
-
if (!
|
|
802
|
-
const
|
|
803
|
-
if (!
|
|
804
|
-
const V =
|
|
805
|
-
M(u), y({ x:
|
|
802
|
+
const m = ue(), d = (t == null ? void 0 : t.rows) ?? [], [b, y] = re(null), [w, M] = re(null), T = c ?? ne, G = we(m).series, L = i ?? G[1 % G.length], Z = Fe(g), U = ee(m.palette.text.primary, 0.06), N = ee(m.palette.text.primary, 0.09), D = m.palette.divider, $ = m.palette.text.disabled, Q = E(() => Math.max(1, ...d.map((u) => Math.abs(u.value ?? 1))), [d]), j = E(() => d.flatMap((u) => [{ lat: u.fromLat, lng: u.fromLng }, { lat: u.toLat, lng: u.toLng }]), [d]), K = E(() => He(j, { autoFit: l, defaultZoom: v, center: h }), [j, l, v, h]), I = ke(
|
|
803
|
+
(u, P) => {
|
|
804
|
+
const z = d[u], H = `${z.label ?? ""} ${z.value != null ? T(z.value) : ""}`.trim();
|
|
805
|
+
if (!H) return;
|
|
806
|
+
const J = P.currentTarget.closest("svg");
|
|
807
|
+
if (!J) return;
|
|
808
|
+
const V = J.getBoundingClientRect();
|
|
809
|
+
M(u), y({ x: P.clientX - V.left, y: P.clientY - V.top, text: H });
|
|
806
810
|
},
|
|
807
811
|
[d, T]
|
|
808
812
|
), X = ke(() => {
|
|
@@ -826,9 +830,9 @@ function Ar({
|
|
|
826
830
|
style: { width: "100%", height: "100%", display: "block", background: m.palette.background.default, borderRadius: m.shape.borderRadius },
|
|
827
831
|
children: /* @__PURE__ */ x(it, { center: K.center, zoom: K.zoom, minZoom: 1, maxZoom: 40, children: [
|
|
828
832
|
Z.map(
|
|
829
|
-
(u,
|
|
833
|
+
(u, P) => P === 0 ? /* @__PURE__ */ r(Se, { geography: u, children: /* @__PURE__ */ p(({ geographies: z }) => z.map((H) => /* @__PURE__ */ r(Ce, { geography: H, fill: U, stroke: D, strokeWidth: 0.5, style: { ...B, hover: { outline: "none", fill: N } } }, H.rsmKey)), "children") }, u) : /* @__PURE__ */ r(Se, { geography: u, children: /* @__PURE__ */ p(({ geographies: z }) => z.map((H) => /* @__PURE__ */ r(Ce, { geography: H, fill: "none", stroke: $, strokeWidth: 0.3, style: B }, H.rsmKey)), "children") }, u)
|
|
830
834
|
),
|
|
831
|
-
/* @__PURE__ */ r($r, { connections: d, maxVal:
|
|
835
|
+
/* @__PURE__ */ r($r, { connections: d, maxVal: Q, strokeColor: L, hoveredIdx: w, onHover: I, onLeave: X }),
|
|
832
836
|
s && /* @__PURE__ */ r(Br, { connections: d, strokeColor: L })
|
|
833
837
|
] })
|
|
834
838
|
}
|
|
@@ -1042,4 +1046,4 @@ export {
|
|
|
1042
1046
|
Fe as u,
|
|
1043
1047
|
lt as w
|
|
1044
1048
|
};
|
|
1045
|
-
//# sourceMappingURL=index-
|
|
1049
|
+
//# sourceMappingURL=index-9LcZjCK0.js.map
|