@carto/ps-react-ui 4.3.5 → 4.3.7

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 (125) hide show
  1. package/dist/components.js +123 -123
  2. package/dist/components.js.map +1 -1
  3. package/dist/error-CEkRPccv.js +39 -0
  4. package/dist/error-CEkRPccv.js.map +1 -0
  5. package/dist/{lasso-tool-wFqOD6wk.js → lasso-tool-jl4YK02H.js} +184 -159
  6. package/dist/lasso-tool-jl4YK02H.js.map +1 -0
  7. package/dist/no-data-hR3KcJ-_.js +60 -0
  8. package/dist/no-data-hR3KcJ-_.js.map +1 -0
  9. package/dist/{row-DrHwXNvF.js → row-BKmVAUN5.js} +2 -2
  10. package/dist/{row-DrHwXNvF.js.map → row-BKmVAUN5.js.map} +1 -1
  11. package/dist/{series-D3Pc-kYX.js → series-D1pynfeh.js} +3 -3
  12. package/dist/{series-D3Pc-kYX.js.map → series-D1pynfeh.js.map} +1 -1
  13. package/dist/{styles-CCZnY17y.js → styles-DrPyd0y5.js} +28 -22
  14. package/dist/styles-DrPyd0y5.js.map +1 -0
  15. package/dist/types/components/lasso-tool/types.d.ts +1 -1
  16. package/dist/types/widgets/_shared/chart-config/index.d.ts +1 -1
  17. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +7 -0
  18. package/dist/types/widgets/_shared/chart-config/option-builders.test.d.ts +1 -0
  19. package/dist/types/widgets/actions/index.d.ts +4 -4
  20. package/dist/types/widgets/actions/lock-selection/types.d.ts +0 -13
  21. package/dist/types/widgets/actions/relative-data/types.d.ts +0 -4
  22. package/dist/types/widgets/actions/searcher/types.d.ts +0 -2
  23. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +3 -2
  24. package/dist/types/widgets/actions/stack-toggle/types.d.ts +0 -4
  25. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +4 -0
  26. package/dist/types/widgets/echart/types.d.ts +0 -4
  27. package/dist/types/widgets/echart/utils.d.ts +2 -1
  28. package/dist/types/widgets/error/error.d.ts +1 -1
  29. package/dist/types/widgets/error/types.d.ts +8 -0
  30. package/dist/types/widgets/loader/loader.d.ts +1 -1
  31. package/dist/types/widgets/loader/types.d.ts +1 -1
  32. package/dist/types/widgets/stores/index.d.ts +1 -1
  33. package/dist/types/widgets/stores/types.d.ts +15 -0
  34. package/dist/{use-widget-ref-B0aNCANx.js → use-widget-ref-P-2i0MJG.js} +2 -2
  35. package/dist/{use-widget-ref-B0aNCANx.js.map → use-widget-ref-P-2i0MJG.js.map} +1 -1
  36. package/dist/{utils-D3-eQyDR.js → utils-idmvq0Oa.js} +17 -16
  37. package/dist/utils-idmvq0Oa.js.map +1 -0
  38. package/dist/widget-store-CzDt8oSK.js +163 -0
  39. package/dist/widget-store-CzDt8oSK.js.map +1 -0
  40. package/dist/widgets/actions.js +714 -659
  41. package/dist/widgets/actions.js.map +1 -1
  42. package/dist/widgets/bar.js +67 -63
  43. package/dist/widgets/bar.js.map +1 -1
  44. package/dist/widgets/category.js +250 -241
  45. package/dist/widgets/category.js.map +1 -1
  46. package/dist/widgets/echart.js +93 -100
  47. package/dist/widgets/echart.js.map +1 -1
  48. package/dist/widgets/error.js +1 -1
  49. package/dist/widgets/formula.js +64 -72
  50. package/dist/widgets/formula.js.map +1 -1
  51. package/dist/widgets/histogram.js +75 -73
  52. package/dist/widgets/histogram.js.map +1 -1
  53. package/dist/widgets/loader.js +41 -40
  54. package/dist/widgets/loader.js.map +1 -1
  55. package/dist/widgets/markdown.js +2 -2
  56. package/dist/widgets/no-data.js +1 -1
  57. package/dist/widgets/pie.js +4 -4
  58. package/dist/widgets/range.js +97 -105
  59. package/dist/widgets/range.js.map +1 -1
  60. package/dist/widgets/scatterplot.js +8 -8
  61. package/dist/widgets/skeleton-loader.js +1 -1
  62. package/dist/widgets/spread.js +84 -100
  63. package/dist/widgets/spread.js.map +1 -1
  64. package/dist/widgets/stores.js +1 -1
  65. package/dist/widgets/table.js +493 -485
  66. package/dist/widgets/table.js.map +1 -1
  67. package/dist/widgets/timeseries.js +4 -4
  68. package/dist/widgets/wrapper.js +156 -156
  69. package/dist/widgets/wrapper.js.map +1 -1
  70. package/dist/widgets.js +4 -4
  71. package/package.json +3 -3
  72. package/src/components/lasso-tool/lasso-tool-inline.tsx +19 -17
  73. package/src/components/lasso-tool/lasso-tool.tsx +27 -22
  74. package/src/components/lasso-tool/types.ts +4 -3
  75. package/src/widgets/_shared/chart-config/index.ts +1 -0
  76. package/src/widgets/_shared/chart-config/option-builders.test.ts +40 -0
  77. package/src/widgets/_shared/chart-config/option-builders.ts +12 -0
  78. package/src/widgets/actions/fullscreen/fullscreen.tsx +5 -8
  79. package/src/widgets/actions/index.ts +4 -7
  80. package/src/widgets/actions/lock-selection/lock-selection.test.tsx +28 -30
  81. package/src/widgets/actions/lock-selection/lock-selection.tsx +25 -26
  82. package/src/widgets/actions/lock-selection/types.ts +0 -17
  83. package/src/widgets/actions/relative-data/relative-data.test.tsx +13 -13
  84. package/src/widgets/actions/relative-data/relative-data.tsx +18 -21
  85. package/src/widgets/actions/relative-data/types.ts +0 -7
  86. package/src/widgets/actions/searcher/searcher.tsx +40 -22
  87. package/src/widgets/actions/searcher/types.ts +0 -2
  88. package/src/widgets/actions/stack-toggle/stack-toggle.test.tsx +160 -16
  89. package/src/widgets/actions/stack-toggle/stack-toggle.tsx +79 -78
  90. package/src/widgets/actions/stack-toggle/types.ts +0 -8
  91. package/src/widgets/actions/zoom-toggle/zoom-toggle.tsx +137 -87
  92. package/src/widgets/bar/config.ts +37 -28
  93. package/src/widgets/category/category-ui.tsx +25 -22
  94. package/src/widgets/echart/echart-ui.test.tsx +3 -18
  95. package/src/widgets/echart/echart-ui.tsx +4 -22
  96. package/src/widgets/echart/echart.test.tsx +9 -25
  97. package/src/widgets/echart/echart.tsx +36 -29
  98. package/src/widgets/echart/types.ts +0 -4
  99. package/src/widgets/echart/utils.ts +3 -1
  100. package/src/widgets/error/error.tsx +17 -14
  101. package/src/widgets/error/types.ts +10 -0
  102. package/src/widgets/formula/components/value.tsx +13 -13
  103. package/src/widgets/histogram/config.ts +36 -29
  104. package/src/widgets/loader/loader.tsx +20 -8
  105. package/src/widgets/loader/types.ts +3 -1
  106. package/src/widgets/no-data/no-data.tsx +8 -11
  107. package/src/widgets/range/components/range-item.tsx +9 -13
  108. package/src/widgets/spread/components/max-value.tsx +13 -13
  109. package/src/widgets/spread/components/min-value.tsx +13 -13
  110. package/src/widgets/stores/index.ts +1 -0
  111. package/src/widgets/stores/types.ts +17 -0
  112. package/src/widgets/stores/widget-store.test.ts +141 -0
  113. package/src/widgets/stores/widget-store.ts +73 -2
  114. package/src/widgets/table/hooks/use-pagination.ts +44 -35
  115. package/src/widgets/table/hooks/use-sort.ts +25 -23
  116. package/src/widgets/wrapper/wrapper-ui.tsx +16 -17
  117. package/dist/error-B2IJ9d2h.js +0 -38
  118. package/dist/error-B2IJ9d2h.js.map +0 -1
  119. package/dist/lasso-tool-wFqOD6wk.js.map +0 -1
  120. package/dist/no-data-C54XJt13.js +0 -61
  121. package/dist/no-data-C54XJt13.js.map +0 -1
  122. package/dist/styles-CCZnY17y.js.map +0 -1
  123. package/dist/utils-D3-eQyDR.js.map +0 -1
  124. package/dist/widget-store-CB6Trp_0.js +0 -131
  125. package/dist/widget-store-CB6Trp_0.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { jsx as h, jsxs as S } from "react/jsx-runtime";
2
- import { c as M } from "react/compiler-runtime";
3
- import { Box as b, Typography as D, useTheme as N, Skeleton as H } from "@mui/material";
4
- import { u as U } from "../widget-store-CB6Trp_0.js";
5
- import { useShallow as z } from "zustand/shallow";
6
- import { useState as J } from "react";
1
+ import { jsx as m, jsxs as k } from "react/jsx-runtime";
2
+ import { c as V } from "react/compiler-runtime";
3
+ import { Box as b, Typography as T, useTheme as te, Skeleton as K } from "@mui/material";
4
+ import { u as R } from "../widget-store-CzDt8oSK.js";
5
+ import { useShallow as D } from "zustand/shallow";
6
+ import { useState as oe } from "react";
7
7
  import "@mui/icons-material";
8
8
  import "react-markdown";
9
- import { d as E, a as q } from "../exports-Cr43OCul.js";
10
- import "../lasso-tool-wFqOD6wk.js";
9
+ import { d as Y, a as Q } from "../exports-Cr43OCul.js";
10
+ import "../lasso-tool-jl4YK02H.js";
11
11
  import "../cjs-D4KH3azB.js";
12
12
  import "@dnd-kit/core";
13
13
  import "@dnd-kit/sortable";
@@ -21,12 +21,12 @@ const d = {
21
21
  list: {
22
22
  display: "flex",
23
23
  flexDirection: "column",
24
- gap: (t) => t.spacing(1)
24
+ gap: (o) => o.spacing(1)
25
25
  },
26
26
  row: {
27
27
  display: "flex",
28
28
  flexDirection: "column",
29
- gap: (t) => t.spacing(0.5),
29
+ gap: (o) => o.spacing(0.5),
30
30
  pointerEvents: "none"
31
31
  },
32
32
  rowClickable: {
@@ -64,13 +64,13 @@ const d = {
64
64
  bar: {
65
65
  height: 4,
66
66
  borderRadius: 2,
67
- backgroundColor: (t) => t.palette.action.disabledBackground,
67
+ backgroundColor: (o) => o.palette.action.disabledBackground,
68
68
  overflow: "hidden",
69
69
  position: "relative",
70
70
  transition: "background-color 0.15s ease-in-out",
71
71
  cursor: "pointer",
72
72
  "&:hover": {
73
- backgroundColor: (t) => t.palette.action.hover,
73
+ backgroundColor: (o) => o.palette.action.hover,
74
74
  "& > div": {
75
75
  filter: "brightness(1.2)"
76
76
  }
@@ -82,24 +82,24 @@ const d = {
82
82
  transition: "width 0.3s ease-in-out, background-color 0.15s ease-in-out"
83
83
  },
84
84
  barFillMuted: {
85
- backgroundColor: (t) => t.palette.action.disabled
85
+ backgroundColor: (o) => o.palette.action.disabled
86
86
  },
87
87
  legend: {
88
88
  display: "flex",
89
89
  alignItems: "center",
90
- gap: (t) => t.spacing(2),
90
+ gap: (o) => o.spacing(2),
91
91
  flexWrap: "wrap",
92
- paddingTop: (t) => t.spacing(2),
92
+ paddingTop: (o) => o.spacing(2),
93
93
  position: "sticky",
94
94
  bottom: 0,
95
95
  backgroundColor: "background.paper",
96
- borderTop: (t) => `1px solid ${t.palette.divider}`,
97
- marginTop: (t) => t.spacing(2)
96
+ borderTop: (o) => `1px solid ${o.palette.divider}`,
97
+ marginTop: (o) => o.spacing(2)
98
98
  },
99
99
  legendItem: {
100
100
  display: "flex",
101
101
  alignItems: "center",
102
- gap: (t) => t.spacing(1)
102
+ gap: (o) => o.spacing(1)
103
103
  },
104
104
  legendDot: {
105
105
  width: 8,
@@ -115,7 +115,7 @@ const d = {
115
115
  multiBarRow: {
116
116
  display: "flex",
117
117
  alignItems: "center",
118
- gap: (t) => t.spacing(1)
118
+ gap: (o) => o.spacing(1)
119
119
  },
120
120
  multiBarValue: {
121
121
  typography: "body2",
@@ -142,271 +142,280 @@ const d = {
142
142
  color: "text.disabled"
143
143
  }
144
144
  };
145
- function G(t) {
146
- const e = M(6), {
147
- value: o,
148
- maxValue: a,
149
- color: r,
150
- selected: i
151
- } = t, s = i === void 0 ? !0 : i, l = a > 0 ? o / a * 100 : 0;
152
- let u;
153
- e[0] !== r || e[1] !== l || e[2] !== s ? (u = s ? {
145
+ function Z(o) {
146
+ const e = V(6), {
147
+ value: t,
148
+ maxValue: r,
149
+ color: l,
150
+ selected: c
151
+ } = o, i = c === void 0 ? !0 : c, s = r > 0 ? t / r * 100 : 0;
152
+ let g;
153
+ e[0] !== l || e[1] !== s || e[2] !== i ? (g = i ? {
154
154
  ...d.barFill,
155
- width: `${l}%`,
156
- backgroundColor: r
155
+ width: `${s}%`,
156
+ backgroundColor: l
157
157
  } : {
158
158
  ...d.barFill,
159
159
  ...d.barFillMuted,
160
- width: `${l}%`
161
- }, e[0] = r, e[1] = l, e[2] = s, e[3] = u) : u = e[3];
162
- const n = u;
163
- let c;
164
- return e[4] !== n ? (c = /* @__PURE__ */ h(b, { sx: d.bar, children: /* @__PURE__ */ h(b, { sx: n }) }), e[4] = n, e[5] = c) : c = e[5], c;
160
+ width: `${s}%`
161
+ }, e[0] = l, e[1] = s, e[2] = i, e[3] = g) : g = e[3];
162
+ const n = g;
163
+ let a;
164
+ return e[4] !== n ? (a = /* @__PURE__ */ m(b, { sx: d.bar, children: /* @__PURE__ */ m(b, { sx: n }) }), e[4] = n, e[5] = a) : a = e[5], a;
165
165
  }
166
- function K(t) {
167
- const e = M(23), {
168
- name: o,
169
- value: a,
170
- maxValue: r,
171
- color: i,
172
- formatter: s,
173
- onClick: l,
174
- selected: u
175
- } = t, n = u === void 0 ? !0 : u;
176
- let c;
177
- e[0] !== o || e[1] !== l ? (c = l ? () => l({
178
- name: o
179
- }) : void 0, e[0] = o, e[1] = l, e[2] = c) : c = e[2];
180
- const m = c, x = l ? d.rowClickable : d.row;
181
- let y;
182
- e[3] !== o ? (y = /* @__PURE__ */ h(D, { sx: d.rowLabel, children: o }), e[3] = o, e[4] = y) : y = e[4];
183
- let f;
184
- e[5] !== s || e[6] !== a ? (f = s(a), e[5] = s, e[6] = a, e[7] = f) : f = e[7];
185
- let C;
186
- e[8] !== f ? (C = /* @__PURE__ */ h(D, { sx: d.rowValue, children: f }), e[8] = f, e[9] = C) : C = e[9];
187
- let g;
188
- e[10] !== y || e[11] !== C ? (g = /* @__PURE__ */ S(b, { sx: d.rowHeader, children: [
189
- y,
190
- C
191
- ] }), e[10] = y, e[11] = C, e[12] = g) : g = e[12];
166
+ function le(o) {
167
+ const e = V(23), {
168
+ name: t,
169
+ value: r,
170
+ maxValue: l,
171
+ color: c,
172
+ formatter: i,
173
+ onClick: s,
174
+ selected: g
175
+ } = o, n = g === void 0 ? !0 : g;
176
+ let a;
177
+ e[0] !== t || e[1] !== s ? (a = s ? () => s({
178
+ name: t
179
+ }) : void 0, e[0] = t, e[1] = s, e[2] = a) : a = e[2];
180
+ const u = a, y = s ? d.rowClickable : d.row;
181
+ let h;
182
+ e[3] !== t ? (h = /* @__PURE__ */ m(T, { sx: d.rowLabel, children: t }), e[3] = t, e[4] = h) : h = e[4];
192
183
  let p;
193
- e[13] !== i || e[14] !== r || e[15] !== n || e[16] !== a ? (p = /* @__PURE__ */ h(G, { value: a, maxValue: r, color: i, selected: n }), e[13] = i, e[14] = r, e[15] = n, e[16] = a, e[17] = p) : p = e[17];
184
+ e[5] !== i || e[6] !== r ? (p = i(r), e[5] = i, e[6] = r, e[7] = p) : p = e[7];
185
+ let x;
186
+ e[8] !== p ? (x = /* @__PURE__ */ m(T, { sx: d.rowValue, children: p }), e[8] = p, e[9] = x) : x = e[9];
187
+ let C;
188
+ e[10] !== h || e[11] !== x ? (C = /* @__PURE__ */ k(b, { sx: d.rowHeader, children: [
189
+ h,
190
+ x
191
+ ] }), e[10] = h, e[11] = x, e[12] = C) : C = e[12];
194
192
  let w;
195
- return e[18] !== m || e[19] !== x || e[20] !== g || e[21] !== p ? (w = /* @__PURE__ */ S(b, { sx: x, onClick: m, children: [
196
- g,
197
- p
198
- ] }), e[18] = m, e[19] = x, e[20] = g, e[21] = p, e[22] = w) : w = e[22], w;
193
+ e[13] !== c || e[14] !== l || e[15] !== n || e[16] !== r ? (w = /* @__PURE__ */ m(Z, { value: r, maxValue: l, color: c, selected: n }), e[13] = c, e[14] = l, e[15] = n, e[16] = r, e[17] = w) : w = e[17];
194
+ let v;
195
+ return e[18] !== u || e[19] !== y || e[20] !== C || e[21] !== w ? (v = /* @__PURE__ */ k(b, { sx: y, onClick: u, children: [
196
+ C,
197
+ w
198
+ ] }), e[18] = u, e[19] = y, e[20] = C, e[21] = w, e[22] = v) : v = e[22], v;
199
199
  }
200
- function Q(t) {
201
- const e = M(25), {
202
- name: o,
203
- values: a,
204
- maxValue: r,
205
- colors: i,
206
- formatter: s,
207
- onClick: l,
208
- selected: u
209
- } = t, n = u === void 0 ? !0 : u;
210
- let c;
211
- e[0] !== o || e[1] !== l ? (c = l ? () => l({
212
- name: o
213
- }) : void 0, e[0] = o, e[1] = l, e[2] = c) : c = e[2];
214
- const m = c, x = l ? d.rowClickable : d.row;
215
- let y;
216
- e[3] !== o ? (y = /* @__PURE__ */ h(D, { sx: d.rowLabel, children: o }), e[3] = o, e[4] = y) : y = e[4];
217
- let f;
218
- if (e[5] !== i || e[6] !== s || e[7] !== r || e[8] !== o || e[9] !== n || e[10] !== a) {
219
- let p;
220
- e[12] !== i || e[13] !== s || e[14] !== r || e[15] !== o || e[16] !== n ? (p = (w, k) => /* @__PURE__ */ S(b, { sx: d.multiBarRow, children: [
221
- /* @__PURE__ */ h(b, { sx: d.multiBarContainer, children: /* @__PURE__ */ h(G, { value: w, maxValue: r, color: i[k % i.length] ?? "", selected: n }) }),
222
- /* @__PURE__ */ h(D, { sx: d.multiBarValue, children: s(w) })
223
- ] }, `${o}-${w}-${k}`), e[12] = i, e[13] = s, e[14] = r, e[15] = o, e[16] = n, e[17] = p) : p = e[17], f = a.map(p), e[5] = i, e[6] = s, e[7] = r, e[8] = o, e[9] = n, e[10] = a, e[11] = f;
200
+ function re(o) {
201
+ const e = V(25), {
202
+ name: t,
203
+ values: r,
204
+ maxValue: l,
205
+ colors: c,
206
+ formatter: i,
207
+ onClick: s,
208
+ selected: g
209
+ } = o, n = g === void 0 ? !0 : g;
210
+ let a;
211
+ e[0] !== t || e[1] !== s ? (a = s ? () => s({
212
+ name: t
213
+ }) : void 0, e[0] = t, e[1] = s, e[2] = a) : a = e[2];
214
+ const u = a, y = s ? d.rowClickable : d.row;
215
+ let h;
216
+ e[3] !== t ? (h = /* @__PURE__ */ m(T, { sx: d.rowLabel, children: t }), e[3] = t, e[4] = h) : h = e[4];
217
+ let p;
218
+ if (e[5] !== c || e[6] !== i || e[7] !== l || e[8] !== t || e[9] !== n || e[10] !== r) {
219
+ let w;
220
+ e[12] !== c || e[13] !== i || e[14] !== l || e[15] !== t || e[16] !== n ? (w = (v, B) => /* @__PURE__ */ k(b, { sx: d.multiBarRow, children: [
221
+ /* @__PURE__ */ m(b, { sx: d.multiBarContainer, children: /* @__PURE__ */ m(Z, { value: v, maxValue: l, color: c[B % c.length] ?? "", selected: n }) }),
222
+ /* @__PURE__ */ m(T, { sx: d.multiBarValue, children: i(v) })
223
+ ] }, `${t}-${v}-${B}`), e[12] = c, e[13] = i, e[14] = l, e[15] = t, e[16] = n, e[17] = w) : w = e[17], p = r.map(w), e[5] = c, e[6] = i, e[7] = l, e[8] = t, e[9] = n, e[10] = r, e[11] = p;
224
224
  } else
225
- f = e[11];
225
+ p = e[11];
226
+ let x;
227
+ e[18] !== p ? (x = /* @__PURE__ */ m(b, { sx: d.barContainer, children: p }), e[18] = p, e[19] = x) : x = e[19];
226
228
  let C;
227
- e[18] !== f ? (C = /* @__PURE__ */ h(b, { sx: d.barContainer, children: f }), e[18] = f, e[19] = C) : C = e[19];
228
- let g;
229
- return e[20] !== m || e[21] !== x || e[22] !== y || e[23] !== C ? (g = /* @__PURE__ */ S(b, { sx: x, onClick: m, children: [
230
- y,
231
- C
232
- ] }), e[20] = m, e[21] = x, e[22] = y, e[23] = C, e[24] = g) : g = e[24], g;
229
+ return e[20] !== u || e[21] !== y || e[22] !== h || e[23] !== x ? (C = /* @__PURE__ */ k(b, { sx: y, onClick: u, children: [
230
+ h,
231
+ x
232
+ ] }), e[20] = u, e[21] = y, e[22] = h, e[23] = x, e[24] = C) : C = e[24], C;
233
233
  }
234
- function X(t) {
235
- const e = M(10), {
236
- hiddenCount: o,
237
- otherLabel: a,
238
- otherCountLabel: r
239
- } = t, i = a === void 0 ? "Other" : a, s = r === void 0 ? "{count} more" : r;
240
- let l;
241
- e[0] !== o || e[1] !== s ? (l = s.replace("{count}", String(o)), e[0] = o, e[1] = s, e[2] = l) : l = e[2];
242
- const u = l;
234
+ function ne(o) {
235
+ const e = V(10), {
236
+ hiddenCount: t,
237
+ otherLabel: r,
238
+ otherCountLabel: l
239
+ } = o, c = r === void 0 ? "Other" : r, i = l === void 0 ? "{count} more" : l;
240
+ let s;
241
+ e[0] !== t || e[1] !== i ? (s = i.replace("{count}", String(t)), e[0] = t, e[1] = i, e[2] = s) : s = e[2];
242
+ const g = s;
243
243
  let n;
244
- e[3] !== i ? (n = /* @__PURE__ */ h(D, { sx: d.otherLabel, children: i }), e[3] = i, e[4] = n) : n = e[4];
245
- let c;
246
- e[5] !== u ? (c = /* @__PURE__ */ S(D, { sx: d.otherCount, children: [
244
+ e[3] !== c ? (n = /* @__PURE__ */ m(T, { sx: d.otherLabel, children: c }), e[3] = c, e[4] = n) : n = e[4];
245
+ let a;
246
+ e[5] !== g ? (a = /* @__PURE__ */ k(T, { sx: d.otherCount, children: [
247
247
  "(",
248
- u,
248
+ g,
249
249
  ")"
250
- ] }), e[5] = u, e[6] = c) : c = e[6];
251
- let m;
252
- return e[7] !== n || e[8] !== c ? (m = /* @__PURE__ */ S(b, { sx: d.otherRow, children: [
250
+ ] }), e[5] = g, e[6] = a) : a = e[6];
251
+ let u;
252
+ return e[7] !== n || e[8] !== a ? (u = /* @__PURE__ */ k(b, { sx: d.otherRow, children: [
253
253
  n,
254
- c
255
- ] }), e[7] = n, e[8] = c, e[9] = m) : m = e[9], m;
254
+ a
255
+ ] }), e[7] = n, e[8] = a, e[9] = u) : u = e[9], u;
256
256
  }
257
- function Y(t) {
258
- const e = M(7), {
259
- series: o,
260
- colors: a
261
- } = t;
262
- if (o.length === 0)
257
+ function ie(o) {
258
+ const e = V(7), {
259
+ series: t,
260
+ colors: r
261
+ } = o;
262
+ if (t.length === 0)
263
263
  return null;
264
- let r;
265
- if (e[0] !== a || e[1] !== o) {
266
- let s;
267
- e[3] !== a ? (s = (l, u) => /* @__PURE__ */ S(b, { sx: d.legendItem, children: [
268
- /* @__PURE__ */ h(b, { sx: {
264
+ let l;
265
+ if (e[0] !== r || e[1] !== t) {
266
+ let i;
267
+ e[3] !== r ? (i = (s, g) => /* @__PURE__ */ k(b, { sx: d.legendItem, children: [
268
+ /* @__PURE__ */ m(b, { sx: {
269
269
  ...d.legendDot,
270
- backgroundColor: l.color ?? a[u % a.length]
270
+ backgroundColor: s.color ?? r[g % r.length]
271
271
  } }),
272
- /* @__PURE__ */ h(D, { sx: d.legendLabel, children: l.name })
273
- ] }, l.name), e[3] = a, e[4] = s) : s = e[4], r = o.map(s), e[0] = a, e[1] = o, e[2] = r;
272
+ /* @__PURE__ */ m(T, { sx: d.legendLabel, children: s.name })
273
+ ] }, s.name), e[3] = r, e[4] = i) : i = e[4], l = t.map(i), e[0] = r, e[1] = t, e[2] = l;
274
274
  } else
275
- r = e[2];
276
- let i;
277
- return e[5] !== r ? (i = /* @__PURE__ */ h(b, { sx: d.legend, children: r }), e[5] = r, e[6] = i) : i = e[6], i;
275
+ l = e[2];
276
+ let c;
277
+ return e[5] !== l ? (c = /* @__PURE__ */ m(b, { sx: d.legend, children: l }), e[5] = l, e[6] = c) : c = e[6], c;
278
278
  }
279
- const Z = (t) => t.toString();
280
- function ye(t) {
281
- const e = M(41), {
282
- id: o
283
- } = t, a = N();
284
- let r;
285
- e[0] !== o ? (r = ($) => {
286
- const v = $.getWidget(o);
287
- return {
288
- formatter: v?.formatter,
289
- series: v?.series,
290
- data: v?.data,
291
- maxItems: v?.maxItems,
292
- labels: v?.labels,
293
- onRowClick: v?.onRowClick,
294
- selected: v?.selected,
295
- max: v?.max
296
- };
297
- }, e[0] = o, e[1] = r) : r = e[1];
298
- const i = U(z(r)), s = i?.formatter ?? Z, l = i?.series ?? [], u = i?.data, n = i?.maxItems, c = i?.labels, m = i?.onRowClick, x = i?.selected, y = i?.max, [f] = J(n ? 40 * (l.length || 1) * n : void 0), C = Object.values(a.palette.qualitative.bold), g = l.length > 0 ? l.map(($, v) => $.color ?? C[v % C.length] ?? a.palette.secondary.main) : [a.palette.secondary.main];
299
- let p, w, k, T, R, V, L, B;
300
- if (e[2] !== g || e[3] !== u || e[4] !== s || e[5] !== y || e[6] !== f || e[7] !== n || e[8] !== m || e[9] !== x || e[10] !== l) {
301
- B = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
279
+ const se = (o) => o.toString();
280
+ function Le(o) {
281
+ const e = V(55), {
282
+ id: t
283
+ } = o, r = te();
284
+ let l;
285
+ e[0] !== t ? (l = (f) => f.getWidget(t)?.formatter, e[0] = t, e[1] = l) : l = e[1];
286
+ const c = R(D(l));
287
+ let i;
288
+ e[2] !== t ? (i = (f) => f.getWidget(t)?.series, e[2] = t, e[3] = i) : i = e[3];
289
+ const s = R(D(i));
290
+ let g;
291
+ e[4] !== t ? (g = (f) => f.getWidget(t)?.data, e[4] = t, e[5] = g) : g = e[5];
292
+ const n = R(D(g));
293
+ let a;
294
+ e[6] !== t ? (a = (f) => f.getWidget(t)?.maxItems, e[6] = t, e[7] = a) : a = e[7];
295
+ const u = R(D(a));
296
+ let y;
297
+ e[8] !== t ? (y = (f) => f.getWidget(t)?.labels, e[8] = t, e[9] = y) : y = e[9];
298
+ const h = R(D(y));
299
+ let p;
300
+ e[10] !== t ? (p = (f) => f.getWidget(t)?.onRowClick, e[10] = t, e[11] = p) : p = e[11];
301
+ const x = R(D(p));
302
+ let C;
303
+ e[12] !== t ? (C = (f) => f.getWidget(t)?.selected, e[12] = t, e[13] = C) : C = e[13];
304
+ const w = R(D(C));
305
+ let v;
306
+ e[14] !== t ? (v = (f) => f.getWidget(t)?.max, e[14] = t, e[15] = v) : v = e[15];
307
+ const B = R(D(v)), P = c ?? se, S = s ?? [], [G] = oe(u ? 40 * (S.length || 1) * u : void 0), X = Object.values(r.palette.qualitative.bold), M = S.length > 0 ? S.map((f, U) => f.color ?? X[U % X.length] ?? r.palette.secondary.main) : [r.palette.secondary.main];
308
+ let _, F, L, W, j, I, A, O;
309
+ if (e[16] !== M || e[17] !== n || e[18] !== P || e[19] !== B || e[20] !== G || e[21] !== u || e[22] !== x || e[23] !== w || e[24] !== S) {
310
+ A = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
302
311
  e: {
303
- const $ = te({
304
- data: u
312
+ const f = ce({
313
+ data: n
305
314
  });
306
- if ($.length === 0) {
307
- B = null;
315
+ if (f.length === 0) {
316
+ A = null;
308
317
  break e;
309
318
  }
310
- const v = y ?? Math.max(...$.flatMap(ee)), A = n !== void 0 && n >= 0 ? $.slice(0, n) : $;
311
- k = $.length - A.length;
312
- const P = l.length > 1;
313
- w = b, e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = {
319
+ const U = B ?? Math.max(...f.flatMap(ae)), z = u !== void 0 && u >= 0 ? f.slice(0, u) : f;
320
+ L = f.length - z.length;
321
+ const ee = S.length > 1;
322
+ F = b, e[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = {
314
323
  ...d.root
315
- }, e[19] = L) : L = e[19], p = b, T = d.list;
316
- const O = k === 0 ? "auto" : "hidden";
317
- e[20] !== f || e[21] !== O ? (R = {
318
- maxHeight: f,
319
- overflow: O
320
- }, e[20] = f, e[21] = O, e[22] = R) : R = e[22], V = P ? A.map((I) => /* @__PURE__ */ h(Q, { name: I.name, values: I.values, maxValue: v, colors: g, formatter: s, onClick: m, selected: x?.(I.name) ?? !0 }, I.name)) : A.map((I) => /* @__PURE__ */ h(K, { name: I.name, value: I.values[0] ?? 0, selected: x?.(I.name) ?? !0, maxValue: v, color: g[0], formatter: s, onClick: m }, I.name));
324
+ }, e[33] = I) : I = e[33], _ = b, O = d.list;
325
+ const J = L === 0 ? "auto" : "hidden";
326
+ e[34] !== G || e[35] !== J ? (W = {
327
+ maxHeight: G,
328
+ overflow: J
329
+ }, e[34] = G, e[35] = J, e[36] = W) : W = e[36], j = ee ? z.map(($) => /* @__PURE__ */ m(re, { name: $.name, values: $.values, maxValue: U, colors: M, formatter: P, onClick: x, selected: w?.($.name) ?? !0 }, $.name)) : z.map(($) => /* @__PURE__ */ m(le, { name: $.name, value: $.values[0] ?? 0, selected: w?.($.name) ?? !0, maxValue: U, color: M[0], formatter: P, onClick: x }, $.name));
321
330
  }
322
- e[2] = g, e[3] = u, e[4] = s, e[5] = y, e[6] = f, e[7] = n, e[8] = m, e[9] = x, e[10] = l, e[11] = p, e[12] = w, e[13] = k, e[14] = T, e[15] = R, e[16] = V, e[17] = L, e[18] = B;
331
+ e[16] = M, e[17] = n, e[18] = P, e[19] = B, e[20] = G, e[21] = u, e[22] = x, e[23] = w, e[24] = S, e[25] = _, e[26] = F, e[27] = L, e[28] = W, e[29] = j, e[30] = I, e[31] = A, e[32] = O;
323
332
  } else
324
- p = e[11], w = e[12], k = e[13], T = e[14], R = e[15], V = e[16], L = e[17], B = e[18];
325
- if (B !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
326
- return B;
327
- let F;
328
- e[23] !== k || e[24] !== c?.other || e[25] !== c?.otherCount ? (F = k > 0 && /* @__PURE__ */ h(X, { hiddenCount: k, otherLabel: c?.other, otherCountLabel: c?.otherCount }), e[23] = k, e[24] = c?.other, e[25] = c?.otherCount, e[26] = F) : F = e[26];
329
- let W;
330
- e[27] !== p || e[28] !== T || e[29] !== R || e[30] !== V || e[31] !== F ? (W = /* @__PURE__ */ S(p, { sx: T, style: R, children: [
331
- V,
332
- F
333
- ] }), e[27] = p, e[28] = T, e[29] = R, e[30] = V, e[31] = F, e[32] = W) : W = e[32];
334
- let _;
335
- e[33] !== g || e[34] !== l ? (_ = l.length > 0 && /* @__PURE__ */ h(Y, { series: l, colors: g }), e[33] = g, e[34] = l, e[35] = _) : _ = e[35];
336
- let j;
337
- return e[36] !== w || e[37] !== L || e[38] !== W || e[39] !== _ ? (j = /* @__PURE__ */ S(w, { sx: L, children: [
338
- W,
339
- _
340
- ] }), e[36] = w, e[37] = L, e[38] = W, e[39] = _, e[40] = j) : j = e[40], j;
333
+ _ = e[25], F = e[26], L = e[27], W = e[28], j = e[29], I = e[30], A = e[31], O = e[32];
334
+ if (A !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
335
+ return A;
336
+ let H;
337
+ e[37] !== L || e[38] !== h?.other || e[39] !== h?.otherCount ? (H = L > 0 && /* @__PURE__ */ m(ne, { hiddenCount: L, otherLabel: h?.other, otherCountLabel: h?.otherCount }), e[37] = L, e[38] = h?.other, e[39] = h?.otherCount, e[40] = H) : H = e[40];
338
+ let q;
339
+ e[41] !== _ || e[42] !== W || e[43] !== j || e[44] !== H || e[45] !== O ? (q = /* @__PURE__ */ k(_, { sx: O, style: W, children: [
340
+ j,
341
+ H
342
+ ] }), e[41] = _, e[42] = W, e[43] = j, e[44] = H, e[45] = O, e[46] = q) : q = e[46];
343
+ let E;
344
+ e[47] !== M || e[48] !== S ? (E = S.length > 0 && /* @__PURE__ */ m(ie, { series: S, colors: M }), e[47] = M, e[48] = S, e[49] = E) : E = e[49];
345
+ let N;
346
+ return e[50] !== F || e[51] !== I || e[52] !== q || e[53] !== E ? (N = /* @__PURE__ */ k(F, { sx: I, children: [
347
+ q,
348
+ E
349
+ ] }), e[50] = F, e[51] = I, e[52] = q, e[53] = E, e[54] = N) : N = e[54], N;
341
350
  }
342
- function ee(t) {
343
- return t.values;
351
+ function ae(o) {
352
+ return o.values;
344
353
  }
345
- function te({
346
- data: t
354
+ function ce({
355
+ data: o
347
356
  }) {
348
- if (!t || t.length === 0) return [];
349
- const e = Math.max(t.length, 1), o = /* @__PURE__ */ new Map(), a = [];
350
- for (let r = 0; r < t.length; r++) {
351
- const i = t[r];
352
- for (const s of i) {
353
- let l = o.get(s.name);
354
- l || (l = new Array(e).fill(0), o.set(s.name, l), a.push(s.name)), l[r] = s.value;
357
+ if (!o || o.length === 0) return [];
358
+ const e = Math.max(o.length, 1), t = /* @__PURE__ */ new Map(), r = [];
359
+ for (let l = 0; l < o.length; l++) {
360
+ const c = o[l];
361
+ for (const i of c) {
362
+ let s = t.get(i.name);
363
+ s || (s = new Array(e).fill(0), t.set(i.name, s), r.push(i.name)), s[l] = i.value;
355
364
  }
356
365
  }
357
- return a.map((r) => ({
358
- name: r,
359
- values: o.get(r)
366
+ return r.map((l) => ({
367
+ name: l,
368
+ values: t.get(l)
360
369
  }));
361
370
  }
362
- const oe = [85, 70, 55, 75, 60];
363
- function be() {
364
- const t = M(1);
371
+ const de = [85, 70, 55, 75, 60];
372
+ function We() {
373
+ const o = V(1);
365
374
  let e;
366
- return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ h(b, { sx: d.list, "aria-label": "Category skeleton", children: Array.from({
375
+ return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ m(b, { sx: d.list, "aria-label": "Category skeleton", children: Array.from({
367
376
  length: 5
368
- }).map(le) }), t[0] = e) : e = t[0], e;
377
+ }).map(ue) }), o[0] = e) : e = o[0], e;
369
378
  }
370
- function le(t, e) {
371
- return /* @__PURE__ */ S(b, { sx: d.row, children: [
372
- /* @__PURE__ */ S(b, { sx: d.rowHeader, children: [
373
- /* @__PURE__ */ h(H, { width: 80, height: 16 }),
374
- /* @__PURE__ */ h(H, { width: 40, height: 16 })
379
+ function ue(o, e) {
380
+ return /* @__PURE__ */ k(b, { sx: d.row, children: [
381
+ /* @__PURE__ */ k(b, { sx: d.rowHeader, children: [
382
+ /* @__PURE__ */ m(K, { width: 80, height: 16 }),
383
+ /* @__PURE__ */ m(K, { width: 40, height: 16 })
375
384
  ] }),
376
- /* @__PURE__ */ h(H, { variant: "rectangular", height: 4, sx: {
385
+ /* @__PURE__ */ m(K, { variant: "rectangular", height: 4, sx: {
377
386
  borderRadius: 2,
378
- width: `${oe[e]}%`
387
+ width: `${de[e]}%`
379
388
  } })
380
389
  ] }, e);
381
390
  }
382
- function Ce({
383
- refUI: t,
391
+ function Ie({
392
+ refUI: o,
384
393
  series: e
385
394
  }) {
386
395
  return [{
387
- ...E,
388
- modifier: () => E.modifier(t)
396
+ ...Y,
397
+ modifier: () => Y.modifier(o)
389
398
  }, {
390
- ...q,
391
- modifier: async (o) => {
392
- if (!o?.length || o[0]?.length === 0)
393
- return q.modifier([]);
394
- const a = o.length, r = /* @__PURE__ */ new Map(), i = [];
395
- for (let n = 0; n < a; n++) {
396
- const c = o[n];
397
- for (const m of c) {
398
- let x = r.get(m.name);
399
- x || (x = new Array(a).fill(0), r.set(m.name, x), i.push(m.name)), x[n] = m.value;
399
+ ...Q,
400
+ modifier: async (t) => {
401
+ if (!t?.length || t[0]?.length === 0)
402
+ return Q.modifier([]);
403
+ const r = t.length, l = /* @__PURE__ */ new Map(), c = [];
404
+ for (let n = 0; n < r; n++) {
405
+ const a = t[n];
406
+ for (const u of a) {
407
+ let y = l.get(u.name);
408
+ y || (y = new Array(r).fill(0), l.set(u.name, y), c.push(u.name)), y[n] = u.value;
400
409
  }
401
410
  }
402
- const s = i.map((n) => [n, ...r.get(n)]), u = a > 1 ? ["Category", ...e?.map((n) => n.name) ?? Array.from({
403
- length: a
404
- }, (n, c) => `Series ${c + 1}`)] : ["Category", "Value"];
405
- return q.modifier([u, ...s]);
411
+ const i = c.map((n) => [n, ...l.get(n)]), g = r > 1 ? ["Category", ...e?.map((n) => n.name) ?? Array.from({
412
+ length: r
413
+ }, (n, a) => `Series ${a + 1}`)] : ["Category", "Value"];
414
+ return Q.modifier([g, ...i]);
406
415
  }
407
416
  }];
408
417
  }
409
- function we() {
418
+ function Re() {
410
419
  return {
411
420
  series: [],
412
421
  maxItems: 10,
@@ -414,14 +423,14 @@ function we() {
414
423
  };
415
424
  }
416
425
  export {
417
- G as CategoryBar,
418
- Y as CategoryLegend,
419
- Q as CategoryRowMulti,
420
- X as CategoryRowOther,
421
- K as CategoryRowSingle,
422
- be as CategorySkeleton,
423
- ye as CategoryUI,
424
- we as categoryConfig,
425
- Ce as categoryDownloadConfig
426
+ Z as CategoryBar,
427
+ ie as CategoryLegend,
428
+ re as CategoryRowMulti,
429
+ ne as CategoryRowOther,
430
+ le as CategoryRowSingle,
431
+ We as CategorySkeleton,
432
+ Le as CategoryUI,
433
+ Re as categoryConfig,
434
+ Ie as categoryDownloadConfig
426
435
  };
427
436
  //# sourceMappingURL=category.js.map