@hybridcore/ui 1.6.4 → 1.6.6
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/CATALOG.md +1 -0
- package/dist/IconX-C2wmVYSK.js +11 -0
- package/dist/components/charts/_common/format.js +49 -0
- package/dist/components/charts/_common/utils.js +12 -7
- package/dist/components/charts/chart-wrapper/index.js +36 -34
- package/dist/components/charts/column-line-mix/logic.js +78 -78
- package/dist/components/charts/donut-chart/index.js +11 -0
- package/dist/components/charts/donut-chart/logic.js +67 -0
- package/dist/components/charts/donut-chart/styled.js +12 -0
- package/dist/components/charts/drill-down-treemap/logic.js +123 -123
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
- package/dist/components/charts/heatmap/logic.js +73 -73
- package/dist/components/charts/line/logic.js +66 -66
- package/dist/components/charts/logaritmic-scale/logic.js +65 -65
- package/dist/components/charts/multiple-value-axes/logic.js +75 -74
- package/dist/components/charts/nested-pie/logic.js +43 -42
- package/dist/components/charts/packed-circles/logic.js +111 -110
- package/dist/components/charts/pie-chart/logic.js +40 -39
- package/dist/components/charts/stacked-area-radar/logic.js +51 -51
- package/dist/components/charts/stacked-column-chart/logic.js +79 -79
- package/dist/components/charts/xy-chart/logic.js +71 -71
- package/dist/components/color-picker/index.js +1645 -1602
- package/dist/components/color-picker/logic.js +21 -12
- package/dist/components/color-picker/styled.js +4 -2
- package/dist/components/date-range-picker/index.js +359 -365
- package/dist/components/metric-card/helpers.js +12 -5
- package/dist/components/metric-card/logic.js +65 -57
- package/dist/components/metric-card/styled.js +55 -47
- package/dist/components/simple-pivot-table/index.js +129 -54
- package/dist/components/simple-pivot-table/logic.js +111 -45
- package/dist/components/simple-pivot-table/styled.js +31 -11
- package/dist/main.d.ts +128 -8
- package/dist/main.js +163 -157
- package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
switch (
|
|
1
|
+
const n = (r, t = "default") => {
|
|
2
|
+
switch (t) {
|
|
3
3
|
case "primary":
|
|
4
4
|
return r.palette.primary.main;
|
|
5
5
|
case "success":
|
|
@@ -11,8 +11,15 @@ const e = (r, a = "default") => {
|
|
|
11
11
|
default:
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, o = (r, t) => {
|
|
15
|
+
if (!t) return;
|
|
16
|
+
let e = r.palette;
|
|
17
|
+
for (const a of t.split("."))
|
|
18
|
+
e = e && typeof e == "object" ? e[a] : void 0;
|
|
19
|
+
return typeof e == "string" ? e : t;
|
|
20
|
+
}, s = (r, t) => t === "up" ? r.palette.success.main : t === "down" ? r.palette.error.main : r.palette.text.secondary;
|
|
15
21
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
o as resolvePaletteColor,
|
|
23
|
+
s as trendColor,
|
|
24
|
+
n as variantColor
|
|
18
25
|
};
|
|
@@ -1,95 +1,103 @@
|
|
|
1
1
|
import { useThemeProps as U } from "@mui/material";
|
|
2
|
-
import {
|
|
2
|
+
import { formatValue as Z, resolveConditionalStyle as H } from "../charts/_common/format.js";
|
|
3
|
+
import { c as f } from "../../createReactComponent-C7L-DMHj.js";
|
|
3
4
|
/**
|
|
4
5
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
5
6
|
*
|
|
6
7
|
* This source code is licensed under the MIT license.
|
|
7
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
9
|
*/
|
|
9
|
-
const
|
|
10
|
+
const J = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]], L = f("outline", "arrow-right", "ArrowRight", J);
|
|
10
11
|
/**
|
|
11
12
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
12
13
|
*
|
|
13
14
|
* This source code is licensed under the MIT license.
|
|
14
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const j = [["path", { d: "M3 7l6 6l4 -4l8 8", key: "svg-0" }], ["path", { d: "M21 10l0 7l-7 0", key: "svg-1" }]], q = f("outline", "trending-down", "TrendingDown", j);
|
|
17
18
|
/**
|
|
18
19
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
19
20
|
*
|
|
20
21
|
* This source code is licensed under the MIT license.
|
|
21
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
23
|
*/
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
value:
|
|
26
|
-
variant:
|
|
27
|
-
layout:
|
|
28
|
-
valuePrefix:
|
|
29
|
-
valueSuffix:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
const z = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "M14 7l7 0l0 7", key: "svg-1" }]], E = f("outline", "trending-up", "TrendingUp", z), W = (b) => {
|
|
25
|
+
const i = U({ props: b, name: "HCMetricCard" }), {
|
|
26
|
+
value: s = [],
|
|
27
|
+
variant: k = "default",
|
|
28
|
+
layout: v = "overlay",
|
|
29
|
+
valuePrefix: x,
|
|
30
|
+
valueSuffix: S,
|
|
31
|
+
format: e,
|
|
32
|
+
showChange: _ = !1,
|
|
33
|
+
changeType: l = "percentage",
|
|
34
|
+
showTrend: R = !1,
|
|
35
|
+
showIcon: y = !1,
|
|
36
|
+
icon: r,
|
|
37
|
+
iconPosition: d = "right"
|
|
38
|
+
} = i, V = s.length > 0, u = s[s.length - 1], N = s[s.length - 2], t = u ? Number(u.v) : NaN, o = N ? Number(N.v) : NaN, w = !isNaN(t) && !isNaN(o), m = {
|
|
39
|
+
prefix: (e == null ? void 0 : e.prefix) ?? x,
|
|
40
|
+
suffix: (e == null ? void 0 : e.suffix) ?? S,
|
|
41
|
+
decimals: e == null ? void 0 : e.decimals,
|
|
42
|
+
conditionalRules: e == null ? void 0 : e.conditionalRules
|
|
43
|
+
};
|
|
44
|
+
let a = "—", C = "", M, I;
|
|
45
|
+
if (!isNaN(t)) {
|
|
46
|
+
a = Z(t, m), C = u.t;
|
|
47
|
+
const p = H(t, m);
|
|
48
|
+
M = p.color, I = p.backgroundColor;
|
|
43
49
|
}
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
47
|
-
const h =
|
|
48
|
-
|
|
50
|
+
let c;
|
|
51
|
+
if (_)
|
|
52
|
+
if (w && !(o === 0 && l === "percentage")) {
|
|
53
|
+
const h = l === "absolute" ? t - o : (t - o) / o * 100, A = h > 0 ? "+" : h < 0 ? "−" : "", F = l === "percentage" ? 1 : 2, O = l === "percentage" ? "%" : "";
|
|
54
|
+
c = `${A}${Math.abs(h).toFixed(F)}${O}`;
|
|
49
55
|
} else
|
|
50
|
-
|
|
56
|
+
c = "—";
|
|
51
57
|
let n;
|
|
52
|
-
|
|
53
|
-
let g =
|
|
54
|
-
n === "up" ? g =
|
|
55
|
-
const
|
|
58
|
+
R && w && (t > o ? n = "up" : t < o ? n = "down" : n = "neutral");
|
|
59
|
+
let g = L;
|
|
60
|
+
n === "up" ? g = E : n === "down" && (g = q);
|
|
61
|
+
const T = [
|
|
56
62
|
"top-left",
|
|
57
63
|
"top-right",
|
|
58
64
|
"bottom-left",
|
|
59
65
|
"bottom-right"
|
|
60
|
-
].includes(
|
|
61
|
-
metric:
|
|
62
|
-
value:
|
|
63
|
-
change:
|
|
64
|
-
asOf:
|
|
65
|
-
}),
|
|
66
|
-
...
|
|
67
|
-
variant:
|
|
68
|
-
layout:
|
|
69
|
-
changeType:
|
|
70
|
-
iconPosition:
|
|
71
|
-
calculatedValue:
|
|
72
|
-
calculatedChange:
|
|
66
|
+
].includes(d), $ = y && !!r && T, D = y && !!r && !T, P = JSON.stringify({
|
|
67
|
+
metric: i.label,
|
|
68
|
+
value: a,
|
|
69
|
+
change: c,
|
|
70
|
+
asOf: C
|
|
71
|
+
}), B = {
|
|
72
|
+
...i,
|
|
73
|
+
variant: k,
|
|
74
|
+
layout: v,
|
|
75
|
+
changeType: l,
|
|
76
|
+
iconPosition: d,
|
|
77
|
+
calculatedValue: a,
|
|
78
|
+
calculatedChange: c,
|
|
73
79
|
calculatedTrend: n,
|
|
74
|
-
|
|
80
|
+
calculatedValueColor: M,
|
|
81
|
+
calculatedValueBg: I,
|
|
82
|
+
hasData: V
|
|
75
83
|
};
|
|
76
84
|
return {
|
|
77
85
|
refs: {},
|
|
78
86
|
state: {
|
|
79
|
-
ownerState:
|
|
80
|
-
layout:
|
|
81
|
-
calculatedValue:
|
|
82
|
-
calculatedChange:
|
|
87
|
+
ownerState: B,
|
|
88
|
+
layout: v,
|
|
89
|
+
calculatedValue: a,
|
|
90
|
+
calculatedChange: c,
|
|
83
91
|
TrendIcon: g,
|
|
84
|
-
Icon:
|
|
85
|
-
showCornerIcon:
|
|
86
|
-
showSideIcon:
|
|
87
|
-
iconPosition:
|
|
88
|
-
snapshotPayload:
|
|
92
|
+
Icon: r,
|
|
93
|
+
showCornerIcon: $,
|
|
94
|
+
showSideIcon: D,
|
|
95
|
+
iconPosition: d,
|
|
96
|
+
snapshotPayload: P
|
|
89
97
|
},
|
|
90
98
|
actions: {}
|
|
91
99
|
};
|
|
92
100
|
};
|
|
93
101
|
export {
|
|
94
|
-
|
|
102
|
+
W as useMetricCardLogic
|
|
95
103
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { Widget as
|
|
3
|
-
import { variantColor as
|
|
1
|
+
import { styled as a, alpha as C, Stack as g, Typography as s } from "@mui/material";
|
|
2
|
+
import { Widget as f } from "../widget/styled.js";
|
|
3
|
+
import { variantColor as d, resolvePaletteColor as p, trendColor as u } from "./helpers.js";
|
|
4
4
|
const e = {
|
|
5
5
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
6
|
-
},
|
|
6
|
+
}, v = a(f.Root, {
|
|
7
7
|
name: "HCMetricCard",
|
|
8
8
|
slot: "Root",
|
|
9
9
|
...e
|
|
10
|
-
})(({ theme: o, ownerState:
|
|
11
|
-
const n =
|
|
10
|
+
})(({ theme: o, ownerState: i }) => {
|
|
11
|
+
const n = d(o, i.variant), t = i.layout === "panel";
|
|
12
12
|
let r;
|
|
13
|
-
return n ? r =
|
|
13
|
+
return n ? r = C(n, 0.05) : t && (r = o.palette.background.default), {
|
|
14
14
|
position: "relative",
|
|
15
15
|
overflow: "hidden",
|
|
16
16
|
padding: o.spacing(1.5, 2),
|
|
@@ -19,7 +19,7 @@ const e = {
|
|
|
19
19
|
padding: o.spacing(1.5)
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
}),
|
|
22
|
+
}), y = a(g, {
|
|
23
23
|
name: "HCMetricCard",
|
|
24
24
|
slot: "Content"
|
|
25
25
|
})(() => ({
|
|
@@ -27,38 +27,46 @@ const e = {
|
|
|
27
27
|
width: "100%",
|
|
28
28
|
minWidth: 0,
|
|
29
29
|
zIndex: 1
|
|
30
|
-
})),
|
|
30
|
+
})), m = a(s, {
|
|
31
31
|
name: "HCMetricCard",
|
|
32
32
|
slot: "Label"
|
|
33
33
|
})(({ theme: o }) => ({
|
|
34
34
|
color: o.palette.text.secondary,
|
|
35
35
|
marginBottom: o.spacing(0.5),
|
|
36
36
|
fontWeight: 500
|
|
37
|
-
})),
|
|
37
|
+
})), k = a(s, {
|
|
38
38
|
name: "HCMetricCard",
|
|
39
39
|
slot: "Value",
|
|
40
40
|
...e
|
|
41
|
-
})(({ theme: o, ownerState:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
})(({ theme: o, ownerState: i }) => {
|
|
42
|
+
const n = p(o, i.calculatedValueColor), t = p(o, i.calculatedValueBg);
|
|
43
|
+
return {
|
|
44
|
+
color: n ?? d(o, i.variant) ?? o.palette.text.primary,
|
|
45
|
+
fontWeight: 500,
|
|
46
|
+
marginBottom: o.spacing(0.5),
|
|
47
|
+
whiteSpace: "nowrap",
|
|
48
|
+
...t && {
|
|
49
|
+
backgroundColor: t,
|
|
50
|
+
borderRadius: o.shape.borderRadius,
|
|
51
|
+
padding: o.spacing(0, 0.75)
|
|
52
|
+
},
|
|
53
|
+
[o.breakpoints.down("md")]: { fontSize: "1.35rem" },
|
|
54
|
+
[o.breakpoints.up("md")]: { fontSize: "2rem" }
|
|
55
|
+
};
|
|
56
|
+
}), I = a("div", {
|
|
49
57
|
name: "HCMetricCard",
|
|
50
58
|
slot: "TrendContainer",
|
|
51
59
|
...e
|
|
52
|
-
})(({ theme: o, ownerState:
|
|
53
|
-
const n =
|
|
60
|
+
})(({ theme: o, ownerState: i }) => {
|
|
61
|
+
const n = u(o, i.calculatedTrend), t = i.layout === "panel";
|
|
54
62
|
return {
|
|
55
63
|
display: "inline-flex",
|
|
56
64
|
alignItems: "center",
|
|
57
65
|
gap: o.spacing(0.5),
|
|
58
66
|
fontWeight: 500,
|
|
59
67
|
color: n,
|
|
60
|
-
...
|
|
61
|
-
backgroundColor:
|
|
68
|
+
...t ? {
|
|
69
|
+
backgroundColor: C(n, 0.14),
|
|
62
70
|
borderRadius: 999,
|
|
63
71
|
padding: o.spacing(0.25, 1),
|
|
64
72
|
fontSize: "0.8125rem",
|
|
@@ -71,7 +79,7 @@ const e = {
|
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
81
|
};
|
|
74
|
-
}),
|
|
82
|
+
}), H = a(s, {
|
|
75
83
|
name: "HCMetricCard",
|
|
76
84
|
slot: "Description"
|
|
77
85
|
})(({ theme: o }) => ({
|
|
@@ -79,37 +87,37 @@ const e = {
|
|
|
79
87
|
display: "block",
|
|
80
88
|
position: "relative",
|
|
81
89
|
zIndex: 1
|
|
82
|
-
})),
|
|
90
|
+
})), P = a("div", {
|
|
83
91
|
name: "HCMetricCard",
|
|
84
92
|
slot: "Icon",
|
|
85
93
|
...e
|
|
86
|
-
})(({ theme: o, ownerState:
|
|
94
|
+
})(({ theme: o, ownerState: i }) => ({
|
|
87
95
|
display: "flex",
|
|
88
96
|
alignItems: "center",
|
|
89
97
|
justifyContent: "center",
|
|
90
|
-
color:
|
|
91
|
-
marginRight:
|
|
92
|
-
marginLeft:
|
|
98
|
+
color: d(o, i.variant) ?? o.palette.text.secondary,
|
|
99
|
+
marginRight: i.iconPosition === "left" ? o.spacing(2) : 0,
|
|
100
|
+
marginLeft: i.iconPosition === "right" ? o.spacing(2) : 0,
|
|
93
101
|
[o.breakpoints.down("sm")]: {
|
|
94
102
|
position: "absolute",
|
|
95
103
|
top: o.spacing(2),
|
|
96
104
|
left: o.spacing(2),
|
|
97
105
|
margin: 0
|
|
98
106
|
}
|
|
99
|
-
})),
|
|
107
|
+
})), R = a("div", {
|
|
100
108
|
name: "HCMetricCard",
|
|
101
109
|
slot: "CornerIcon",
|
|
102
110
|
...e
|
|
103
|
-
})(({ theme: o, ownerState:
|
|
104
|
-
var
|
|
105
|
-
const n = {},
|
|
106
|
-
return n[
|
|
111
|
+
})(({ theme: o, ownerState: i }) => {
|
|
112
|
+
var l, c;
|
|
113
|
+
const n = {}, t = (l = i.iconPosition) != null && l.startsWith("top") ? "top" : "bottom", r = (c = i.iconPosition) != null && c.endsWith("left") ? "left" : "right";
|
|
114
|
+
return n[t] = o.spacing(2), n[r] = o.spacing(2), {
|
|
107
115
|
position: "absolute",
|
|
108
116
|
...n,
|
|
109
|
-
color:
|
|
117
|
+
color: d(o, i.variant) ?? o.palette.text.secondary,
|
|
110
118
|
zIndex: 2
|
|
111
119
|
};
|
|
112
|
-
}),
|
|
120
|
+
}), w = a("div", {
|
|
113
121
|
name: "HCMetricCard",
|
|
114
122
|
slot: "Chart"
|
|
115
123
|
})(({ theme: o }) => ({
|
|
@@ -122,7 +130,7 @@ const e = {
|
|
|
122
130
|
alignItems: "flex-end",
|
|
123
131
|
overflow: "hidden",
|
|
124
132
|
borderRadius: o.shape.borderRadius
|
|
125
|
-
})),
|
|
133
|
+
})), z = a("div", {
|
|
126
134
|
name: "HCMetricCard",
|
|
127
135
|
slot: "Panel"
|
|
128
136
|
})(({ theme: o }) => ({
|
|
@@ -139,7 +147,7 @@ const e = {
|
|
|
139
147
|
backgroundColor: o.palette.background.paper,
|
|
140
148
|
boxShadow: o.shadows[1],
|
|
141
149
|
overflow: "hidden"
|
|
142
|
-
})),
|
|
150
|
+
})), S = a("div", {
|
|
143
151
|
name: "HCMetricCard",
|
|
144
152
|
slot: "SideChart"
|
|
145
153
|
})(() => ({
|
|
@@ -152,15 +160,15 @@ const e = {
|
|
|
152
160
|
alignItems: "flex-end"
|
|
153
161
|
}));
|
|
154
162
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
w as MetricCardChartContainer,
|
|
164
|
+
y as MetricCardContent,
|
|
165
|
+
R as MetricCardCornerIconContainer,
|
|
166
|
+
H as MetricCardDescription,
|
|
167
|
+
P as MetricCardIconContainer,
|
|
168
|
+
m as MetricCardLabel,
|
|
169
|
+
z as MetricCardPanel,
|
|
170
|
+
v as MetricCardRoot,
|
|
171
|
+
S as MetricCardSideChart,
|
|
164
172
|
I as MetricCardTrendContainer,
|
|
165
|
-
|
|
173
|
+
k as MetricCardValue
|
|
166
174
|
};
|
|
@@ -1,66 +1,141 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useSimplePivotTableLogic as
|
|
4
|
-
import { SimplePivotTableRoot as
|
|
5
|
-
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as i, Divider as f, TableContainer as I, Table as R, TableHead as j, TableRow as g, TableCell as r, TableBody as w, Box as D, IconButton as G } from "@mui/material";
|
|
3
|
+
import { useSimplePivotTableLogic as J } from "./logic.js";
|
|
4
|
+
import { SimplePivotTableRoot as M, SimplePivotTableHeader as O, SimplePivotTableContent as V, SimplePivotTableFooter as X, SimplePivotTableScrollHint as q } from "./styled.js";
|
|
5
|
+
import { I as A } from "../../IconX-C2wmVYSK.js";
|
|
6
|
+
const Z = (s) => {
|
|
6
7
|
const {
|
|
7
|
-
title:
|
|
8
|
-
dimensions:
|
|
8
|
+
title: m,
|
|
9
|
+
dimensions: n,
|
|
9
10
|
values: c,
|
|
10
|
-
data:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
data: h,
|
|
12
|
+
summaries: v,
|
|
13
|
+
selectedField: p,
|
|
14
|
+
selectedSummary: d,
|
|
15
|
+
selectColumn: b,
|
|
16
|
+
clearSelection: S,
|
|
17
|
+
dimensionLabel: x,
|
|
18
|
+
valueLabel: T,
|
|
19
|
+
formatDimensionValue: y,
|
|
20
|
+
formatCell: C,
|
|
21
|
+
getCellStyle: F,
|
|
22
|
+
ownerState: t,
|
|
23
|
+
scrollRef: N,
|
|
24
|
+
canScroll: k,
|
|
25
|
+
scrollModifierLabel: P,
|
|
26
|
+
sx: H,
|
|
27
|
+
other: L
|
|
28
|
+
} = J(s), W = {
|
|
29
|
+
title: m,
|
|
30
|
+
description: s.description,
|
|
31
|
+
dimensions: n,
|
|
20
32
|
values: c,
|
|
21
|
-
data:
|
|
22
|
-
|
|
33
|
+
data: h,
|
|
34
|
+
summaries: v
|
|
23
35
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
36
|
+
return /* @__PURE__ */ o(
|
|
37
|
+
M,
|
|
26
38
|
{
|
|
27
|
-
ownerState:
|
|
28
|
-
sx:
|
|
29
|
-
"data-snapshot": JSON.stringify(
|
|
30
|
-
...
|
|
39
|
+
ownerState: t,
|
|
40
|
+
sx: H,
|
|
41
|
+
"data-snapshot": JSON.stringify(W),
|
|
42
|
+
...L,
|
|
31
43
|
children: [
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
/* @__PURE__ */ e(O, { ownerState: t, children: /* @__PURE__ */ e(i, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
|
|
45
|
+
/* @__PURE__ */ e(f, {}),
|
|
46
|
+
/* @__PURE__ */ e(V, { ownerState: t, children: /* @__PURE__ */ e(I, { ref: N, children: /* @__PURE__ */ o(R, { size: "small", stickyHeader: !0, children: [
|
|
47
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ o(g, { children: [
|
|
48
|
+
n.map((l) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: x(l) }) }, l.value)),
|
|
49
|
+
c.map((l) => /* @__PURE__ */ e(
|
|
50
|
+
r,
|
|
51
|
+
{
|
|
52
|
+
align: "right",
|
|
53
|
+
onClick: () => b(l.dataFieldName),
|
|
54
|
+
sx: {
|
|
55
|
+
cursor: "pointer",
|
|
56
|
+
...p === l.dataFieldName && {
|
|
57
|
+
backgroundColor: "action.selected"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: T(l) })
|
|
61
|
+
},
|
|
62
|
+
l.dataFieldName
|
|
63
|
+
))
|
|
64
|
+
] }) }),
|
|
65
|
+
/* @__PURE__ */ e(w, { children: h.map((l, z) => /* @__PURE__ */ o(
|
|
66
|
+
g,
|
|
67
|
+
{
|
|
68
|
+
hover: !0,
|
|
69
|
+
sx: { "&:last-child td": { borderBottom: 0 } },
|
|
70
|
+
children: [
|
|
71
|
+
n.map((a) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(i, { variant: "body2", children: y(l[a.value], a) }) }, a.value)),
|
|
72
|
+
c.map((a) => {
|
|
73
|
+
const u = F(
|
|
74
|
+
l[a.dataFieldName],
|
|
75
|
+
a.format
|
|
76
|
+
), B = p === a.dataFieldName;
|
|
77
|
+
return /* @__PURE__ */ e(
|
|
78
|
+
r,
|
|
79
|
+
{
|
|
80
|
+
align: "right",
|
|
81
|
+
onClick: () => b(a.dataFieldName),
|
|
82
|
+
sx: {
|
|
83
|
+
cursor: "pointer",
|
|
84
|
+
// Conditional background wins; otherwise tint the
|
|
85
|
+
// selected column.
|
|
86
|
+
backgroundColor: u.backgroundColor ?? (B ? "action.hover" : void 0)
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */ e(
|
|
89
|
+
i,
|
|
90
|
+
{
|
|
91
|
+
variant: "body2",
|
|
92
|
+
fontWeight: 500,
|
|
93
|
+
color: u.color ?? "primary.main",
|
|
94
|
+
children: C(l[a.dataFieldName], a.format)
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
},
|
|
98
|
+
a.dataFieldName
|
|
99
|
+
);
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
z
|
|
104
|
+
)) })
|
|
105
|
+
] }) }) }),
|
|
106
|
+
/* @__PURE__ */ e(f, {}),
|
|
107
|
+
/* @__PURE__ */ o(X, { ownerState: t, children: [
|
|
108
|
+
k && /* @__PURE__ */ e(q, { ownerState: t, children: /* @__PURE__ */ o(i, { variant: "caption", children: [
|
|
109
|
+
"Hold ",
|
|
110
|
+
P,
|
|
111
|
+
" to scroll"
|
|
112
|
+
] }) }),
|
|
113
|
+
d ? /* @__PURE__ */ o(
|
|
114
|
+
D,
|
|
115
|
+
{
|
|
116
|
+
sx: {
|
|
117
|
+
display: "flex",
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
flexWrap: "wrap",
|
|
120
|
+
columnGap: 1.5,
|
|
121
|
+
rowGap: 0.5
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: d.name }),
|
|
125
|
+
d.items.map((l) => /* @__PURE__ */ o(i, { variant: "caption", color: "text.secondary", children: [
|
|
126
|
+
l.label,
|
|
127
|
+
": ",
|
|
128
|
+
l.value
|
|
129
|
+
] }, l.label)),
|
|
130
|
+
/* @__PURE__ */ e(G, { size: "small", onClick: S, sx: { p: 0.25 }, children: /* @__PURE__ */ e(A, { size: 14 }) })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ e(i, { variant: "caption", color: "text.disabled", children: "Select a column to summarize" })
|
|
134
|
+
] })
|
|
60
135
|
]
|
|
61
136
|
}
|
|
62
137
|
);
|
|
63
138
|
};
|
|
64
139
|
export {
|
|
65
|
-
|
|
140
|
+
Z as SimplePivotTable
|
|
66
141
|
};
|