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