@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.
Files changed (35) hide show
  1. package/CATALOG.md +1 -0
  2. package/dist/IconX-C2wmVYSK.js +11 -0
  3. package/dist/components/charts/_common/format.js +49 -0
  4. package/dist/components/charts/_common/utils.js +12 -7
  5. package/dist/components/charts/chart-wrapper/index.js +36 -34
  6. package/dist/components/charts/column-line-mix/logic.js +78 -78
  7. package/dist/components/charts/donut-chart/index.js +11 -0
  8. package/dist/components/charts/donut-chart/logic.js +67 -0
  9. package/dist/components/charts/donut-chart/styled.js +12 -0
  10. package/dist/components/charts/drill-down-treemap/logic.js +123 -123
  11. package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
  12. package/dist/components/charts/heatmap/logic.js +73 -73
  13. package/dist/components/charts/line/logic.js +66 -66
  14. package/dist/components/charts/logaritmic-scale/logic.js +65 -65
  15. package/dist/components/charts/multiple-value-axes/logic.js +75 -74
  16. package/dist/components/charts/nested-pie/logic.js +43 -42
  17. package/dist/components/charts/packed-circles/logic.js +111 -110
  18. package/dist/components/charts/pie-chart/logic.js +40 -39
  19. package/dist/components/charts/stacked-area-radar/logic.js +51 -51
  20. package/dist/components/charts/stacked-column-chart/logic.js +79 -79
  21. package/dist/components/charts/xy-chart/logic.js +71 -71
  22. package/dist/components/color-picker/index.js +1645 -1602
  23. package/dist/components/color-picker/logic.js +21 -12
  24. package/dist/components/color-picker/styled.js +4 -2
  25. package/dist/components/date-range-picker/index.js +359 -365
  26. package/dist/components/metric-card/helpers.js +12 -5
  27. package/dist/components/metric-card/logic.js +65 -57
  28. package/dist/components/metric-card/styled.js +55 -47
  29. package/dist/components/simple-pivot-table/index.js +129 -54
  30. package/dist/components/simple-pivot-table/logic.js +111 -45
  31. package/dist/components/simple-pivot-table/styled.js +31 -11
  32. package/dist/main.d.ts +128 -8
  33. package/dist/main.js +163 -157
  34. package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
  35. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- const e = (r, a = "default") => {
2
- switch (a) {
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
- }, t = (r, a) => a === "up" ? r.palette.success.main : a === "down" ? r.palette.error.main : r.palette.text.secondary;
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
- t as trendColor,
17
- e as variantColor
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 { c as p } from "../../createReactComponent-C7L-DMHj.js";
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 A = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]], B = p("outline", "arrow-right", "ArrowRight", A);
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 O = [["path", { d: "M3 7l6 6l4 -4l8 8", key: "svg-0" }], ["path", { d: "M21 10l0 7l-7 0", key: "svg-1" }]], V = p("outline", "trending-down", "TrendingDown", O);
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 Z = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "M14 7l7 0l0 7", key: "svg-1" }]], H = p("outline", "trending-up", "TrendingUp", Z), j = (I) => {
24
- const r = U({ props: I, name: "HCMetricCard" }), {
25
- value: o = [],
26
- variant: M = "default",
27
- layout: u = "overlay",
28
- valuePrefix: T,
29
- valueSuffix: b,
30
- showChange: C = !1,
31
- changeType: s = "percentage",
32
- showTrend: $ = !1,
33
- showIcon: f = !1,
34
- icon: i,
35
- iconPosition: l = "right"
36
- } = r, k = o.length > 0, d = o[o.length - 1], m = o[o.length - 2], e = d ? Number(d.v) : NaN, t = m ? Number(m.v) : NaN, v = !isNaN(e) && !isNaN(t);
37
- let c = "—", N = "";
38
- if (!isNaN(e)) {
39
- const y = new Intl.NumberFormat("en-US", {
40
- maximumFractionDigits: 2
41
- }).format(e);
42
- c = `${T ?? ""}${y}${b ?? ""}`, N = d.t;
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 a;
45
- if (C)
46
- if (v && !(t === 0 && s === "percentage")) {
47
- const h = s === "absolute" ? e - t : (e - t) / t * 100, P = h > 0 ? "+" : h < 0 ? "−" : "", F = s === "percentage" ? 1 : 2, R = s === "percentage" ? "%" : "";
48
- a = `${P}${Math.abs(h).toFixed(F)}${R}`;
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
- a = "—";
56
+ c = "—";
51
57
  let n;
52
- $ && v && (e > t ? n = "up" : e < t ? n = "down" : n = "neutral");
53
- let g = B;
54
- n === "up" ? g = H : n === "down" && (g = V);
55
- const w = [
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(l), _ = f && !!i && w, x = f && !!i && !w, D = JSON.stringify({
61
- metric: r.label,
62
- value: c,
63
- change: a,
64
- asOf: N
65
- }), S = {
66
- ...r,
67
- variant: M,
68
- layout: u,
69
- changeType: s,
70
- iconPosition: l,
71
- calculatedValue: c,
72
- calculatedChange: a,
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
- hasData: k
80
+ calculatedValueColor: M,
81
+ calculatedValueBg: I,
82
+ hasData: V
75
83
  };
76
84
  return {
77
85
  refs: {},
78
86
  state: {
79
- ownerState: S,
80
- layout: u,
81
- calculatedValue: c,
82
- calculatedChange: a,
87
+ ownerState: B,
88
+ layout: v,
89
+ calculatedValue: a,
90
+ calculatedChange: c,
83
91
  TrendIcon: g,
84
- Icon: i,
85
- showCornerIcon: _,
86
- showSideIcon: x,
87
- iconPosition: l,
88
- snapshotPayload: D
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
- j as useMetricCardLogic
102
+ W as useMetricCardLogic
95
103
  };
@@ -1,16 +1,16 @@
1
- import { styled as i, alpha as p, Stack as C, Typography as d } from "@mui/material";
2
- import { Widget as g } from "../widget/styled.js";
3
- import { variantColor as s, trendColor as f } from "./helpers.js";
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
- }, x = i(g.Root, {
6
+ }, v = a(f.Root, {
7
7
  name: "HCMetricCard",
8
8
  slot: "Root",
9
9
  ...e
10
- })(({ theme: o, ownerState: t }) => {
11
- const n = s(o, t.variant), a = t.layout === "panel";
10
+ })(({ theme: o, ownerState: i }) => {
11
+ const n = d(o, i.variant), t = i.layout === "panel";
12
12
  let r;
13
- return n ? r = p(n, 0.05) : a && (r = o.palette.background.default), {
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
- }), m = i(C, {
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
- })), v = i(d, {
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
- })), y = i(d, {
37
+ })), k = a(s, {
38
38
  name: "HCMetricCard",
39
39
  slot: "Value",
40
40
  ...e
41
- })(({ theme: o, ownerState: t }) => ({
42
- color: s(o, t.variant) ?? o.palette.text.primary,
43
- fontWeight: 500,
44
- marginBottom: o.spacing(0.5),
45
- whiteSpace: "nowrap",
46
- [o.breakpoints.down("md")]: { fontSize: "1.35rem" },
47
- [o.breakpoints.up("md")]: { fontSize: "2rem" }
48
- })), I = i("div", {
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: t }) => {
53
- const n = f(o, t.calculatedTrend), a = t.layout === "panel";
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
- ...a ? {
61
- backgroundColor: p(n, 0.14),
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
- }), k = i(d, {
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
- })), w = i("div", {
90
+ })), P = a("div", {
83
91
  name: "HCMetricCard",
84
92
  slot: "Icon",
85
93
  ...e
86
- })(({ theme: o, ownerState: t }) => ({
94
+ })(({ theme: o, ownerState: i }) => ({
87
95
  display: "flex",
88
96
  alignItems: "center",
89
97
  justifyContent: "center",
90
- color: s(o, t.variant) ?? o.palette.text.secondary,
91
- marginRight: t.iconPosition === "left" ? o.spacing(2) : 0,
92
- marginLeft: t.iconPosition === "right" ? o.spacing(2) : 0,
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
- })), H = i("div", {
107
+ })), R = a("div", {
100
108
  name: "HCMetricCard",
101
109
  slot: "CornerIcon",
102
110
  ...e
103
- })(({ theme: o, ownerState: t }) => {
104
- var c, l;
105
- const n = {}, a = (c = t.iconPosition) != null && c.startsWith("top") ? "top" : "bottom", r = (l = t.iconPosition) != null && l.endsWith("left") ? "left" : "right";
106
- return n[a] = o.spacing(2), n[r] = o.spacing(2), {
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: s(o, t.variant) ?? o.palette.text.secondary,
117
+ color: d(o, i.variant) ?? o.palette.text.secondary,
110
118
  zIndex: 2
111
119
  };
112
- }), P = i("div", {
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
- })), S = i("div", {
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
- })), z = i("div", {
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
- P as MetricCardChartContainer,
156
- m as MetricCardContent,
157
- H as MetricCardCornerIconContainer,
158
- k as MetricCardDescription,
159
- w as MetricCardIconContainer,
160
- v as MetricCardLabel,
161
- S as MetricCardPanel,
162
- x as MetricCardRoot,
163
- z as MetricCardSideChart,
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
- y as MetricCardValue
173
+ k as MetricCardValue
166
174
  };
@@ -1,66 +1,141 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { Typography as r, Divider as p, TableContainer as S, Table as x, TableBody as y, TableRow as u, TableCell as b } from "@mui/material";
3
- import { useSimplePivotTableLogic as P } from "./logic.js";
4
- import { SimplePivotTableRoot as C, SimplePivotTableHeader as F, SimplePivotTableContent as N, SimplePivotTableFooter as j } from "./styled.js";
5
- const z = (n) => {
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: d,
8
- dimensions: m,
8
+ title: m,
9
+ dimensions: n,
9
10
  values: c,
10
- data: s,
11
- aggregations: h,
12
- formatCell: v,
13
- ownerState: a,
14
- sx: T,
15
- other: g
16
- } = P(n), f = {
17
- title: d,
18
- description: n.description,
19
- dimensions: m,
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: s,
22
- aggregations: h
33
+ data: h,
34
+ summaries: v
23
35
  };
24
- return /* @__PURE__ */ l(
25
- C,
36
+ return /* @__PURE__ */ o(
37
+ M,
26
38
  {
27
- ownerState: a,
28
- sx: T,
29
- "data-snapshot": JSON.stringify(f),
30
- ...g,
39
+ ownerState: t,
40
+ sx: H,
41
+ "data-snapshot": JSON.stringify(W),
42
+ ...L,
31
43
  children: [
32
- /* @__PURE__ */ e(F, { ownerState: a, children: /* @__PURE__ */ e(r, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: d }) }),
33
- /* @__PURE__ */ e(p, {}),
34
- /* @__PURE__ */ e(N, { ownerState: a, children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(x, { size: "small", children: /* @__PURE__ */ e(y, { children: s.map((i, o) => /* @__PURE__ */ l(
35
- u,
36
- {
37
- hover: !0,
38
- sx: { "&:last-child td": { borderBottom: 0 } },
39
- children: [
40
- m.map((t) => /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(r, { variant: "body2", children: i[t.value] ?? "—" }) }, t.value)),
41
- c.map((t) => /* @__PURE__ */ e(b, { align: "right", children: /* @__PURE__ */ e(
42
- r,
43
- {
44
- variant: "body2",
45
- fontWeight: 500,
46
- color: "primary.main",
47
- children: v(i[t.dataFieldName])
48
- }
49
- ) }, t.dataFieldName))
50
- ]
51
- },
52
- o
53
- )) }) }) }) }),
54
- /* @__PURE__ */ e(p, {}),
55
- /* @__PURE__ */ e(j, { ownerState: a, children: h.map(({ label: i, value: o }) => /* @__PURE__ */ l(r, { variant: "caption", color: "text.disabled", children: [
56
- i,
57
- ": ",
58
- o
59
- ] }, i)) })
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
- z as SimplePivotTable
140
+ Z as SimplePivotTable
66
141
  };