@carto/ps-react-ui 4.4.3 → 4.5.0

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