@carto/ps-react-ui 4.4.3 → 4.5.1

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 (116) 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/category/style.d.ts +1 -0
  12. package/dist/types/widgets/echart/shared-resize-observer.d.ts +12 -0
  13. package/dist/types/widgets/stores/index.d.ts +2 -1
  14. package/dist/types/widgets/stores/use-widget-selector.d.ts +35 -0
  15. package/dist/types/widgets/stores/widget-store-performance.test.d.ts +1 -0
  16. package/dist/types/widgets/stores/widget-store.d.ts +49 -27
  17. package/dist/types/widgets/table/types.d.ts +1 -1
  18. package/dist/use-widget-ref-BFazQvJK.js +22 -0
  19. package/dist/use-widget-ref-BFazQvJK.js.map +1 -0
  20. package/dist/use-widget-selector-DqRmWQ1K.js +12 -0
  21. package/dist/use-widget-selector-DqRmWQ1K.js.map +1 -0
  22. package/dist/widget-store-CIrb9RKP.js +263 -0
  23. package/dist/widget-store-CIrb9RKP.js.map +1 -0
  24. package/dist/widgets/actions.js +783 -817
  25. package/dist/widgets/actions.js.map +1 -1
  26. package/dist/widgets/bar.js +2 -2
  27. package/dist/widgets/category.js +259 -258
  28. package/dist/widgets/category.js.map +1 -1
  29. package/dist/widgets/echart.js +109 -99
  30. package/dist/widgets/echart.js.map +1 -1
  31. package/dist/widgets/error.js +1 -1
  32. package/dist/widgets/formula.js +71 -63
  33. package/dist/widgets/formula.js.map +1 -1
  34. package/dist/widgets/histogram.js +7 -8
  35. package/dist/widgets/histogram.js.map +1 -1
  36. package/dist/widgets/loader.js +53 -60
  37. package/dist/widgets/loader.js.map +1 -1
  38. package/dist/widgets/markdown.js +51 -50
  39. package/dist/widgets/markdown.js.map +1 -1
  40. package/dist/widgets/no-data.js +1 -1
  41. package/dist/widgets/pie.js +2 -2
  42. package/dist/widgets/range.js +146 -144
  43. package/dist/widgets/range.js.map +1 -1
  44. package/dist/widgets/scatterplot.js +2 -2
  45. package/dist/widgets/skeleton-loader.js +18 -17
  46. package/dist/widgets/skeleton-loader.js.map +1 -1
  47. package/dist/widgets/spread.js +110 -94
  48. package/dist/widgets/spread.js.map +1 -1
  49. package/dist/widgets/stores.js +5 -2
  50. package/dist/widgets/stores.js.map +1 -1
  51. package/dist/widgets/subheader.js +29 -29
  52. package/dist/widgets/subheader.js.map +1 -1
  53. package/dist/widgets/table.js +422 -436
  54. package/dist/widgets/table.js.map +1 -1
  55. package/dist/widgets/timeseries.js +2 -2
  56. package/dist/widgets/utils.js +1 -1
  57. package/dist/widgets/wrapper.js +156 -158
  58. package/dist/widgets/wrapper.js.map +1 -1
  59. package/dist/widgets.js +4 -4
  60. package/package.json +1 -1
  61. package/src/hooks/use-widget-ref.ts +3 -4
  62. package/src/widgets/actions/brush-toggle/brush-toggle.tsx +18 -32
  63. package/src/widgets/actions/change-column/change-column.tsx +15 -15
  64. package/src/widgets/actions/change-column/sortable-column-item.tsx +3 -1
  65. package/src/widgets/actions/download/download.tsx +4 -3
  66. package/src/widgets/actions/fullscreen/fullscreen.tsx +7 -11
  67. package/src/widgets/actions/lock-selection/lock-selection.tsx +12 -15
  68. package/src/widgets/actions/relative-data/relative-data.tsx +22 -26
  69. package/src/widgets/actions/searcher/searcher-toggle.tsx +11 -12
  70. package/src/widgets/actions/searcher/searcher.tsx +20 -21
  71. package/src/widgets/actions/stack-toggle/stack-toggle.tsx +15 -21
  72. package/src/widgets/actions/zoom-toggle/zoom-toggle.tsx +27 -43
  73. package/src/widgets/category/category-ui.tsx +30 -31
  74. package/src/widgets/category/style.ts +1 -0
  75. package/src/widgets/echart/echart-ui.test.tsx +20 -16
  76. package/src/widgets/echart/echart-ui.tsx +6 -12
  77. package/src/widgets/echart/echart.tsx +13 -27
  78. package/src/widgets/echart/shared-resize-observer.ts +45 -0
  79. package/src/widgets/error/error.tsx +7 -9
  80. package/src/widgets/formula/components/prefix.tsx +4 -6
  81. package/src/widgets/formula/components/row.tsx +4 -4
  82. package/src/widgets/formula/components/series.tsx +4 -6
  83. package/src/widgets/formula/components/suffix.tsx +4 -6
  84. package/src/widgets/formula/components/value.tsx +9 -16
  85. package/src/widgets/loader/loader.tsx +31 -44
  86. package/src/widgets/markdown/markdown.tsx +4 -7
  87. package/src/widgets/no-data/no-data.tsx +7 -10
  88. package/src/widgets/range/components/range-item.tsx +20 -18
  89. package/src/widgets/skeleton-loader/skeleton-loader.tsx +2 -5
  90. package/src/widgets/spread/components/max-value.tsx +14 -16
  91. package/src/widgets/spread/components/min-value.tsx +14 -16
  92. package/src/widgets/stores/index.ts +2 -1
  93. package/src/widgets/stores/use-widget-selector.ts +47 -0
  94. package/src/widgets/stores/widget-store-performance.test.ts +750 -0
  95. package/src/widgets/stores/widget-store.test.ts +81 -0
  96. package/src/widgets/stores/widget-store.ts +225 -44
  97. package/src/widgets/subheader/subheader.tsx +11 -3
  98. package/src/widgets/table/config.ts +0 -1
  99. package/src/widgets/table/hooks/use-pagination.ts +28 -52
  100. package/src/widgets/table/hooks/use-selection.ts +20 -24
  101. package/src/widgets/table/hooks/use-sort.ts +22 -39
  102. package/src/widgets/table/types.ts +1 -1
  103. package/src/widgets/wrapper/wrapper-ui.tsx +12 -13
  104. package/src/widgets/wrapper/wrapper.tsx +4 -6
  105. package/dist/error-CEkRPccv.js +0 -39
  106. package/dist/error-CEkRPccv.js.map +0 -1
  107. package/dist/no-data-hR3KcJ-_.js +0 -60
  108. package/dist/no-data-hR3KcJ-_.js.map +0 -1
  109. package/dist/row-DTCV0Ocm.js +0 -35
  110. package/dist/row-DTCV0Ocm.js.map +0 -1
  111. package/dist/series-CYNOu2Ju.js +0 -91
  112. package/dist/series-CYNOu2Ju.js.map +0 -1
  113. package/dist/use-widget-ref-wtFLDFCD.js +0 -25
  114. package/dist/use-widget-ref-wtFLDFCD.js.map +0 -1
  115. package/dist/widget-store-CzDt8oSK.js +0 -163
  116. package/dist/widget-store-CzDt8oSK.js.map +0 -1
@@ -1,13 +1,14 @@
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 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-DqRmWQ1K.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-BFazQvJK.js";
8
+ import "../widget-store-CIrb9RKP.js";
9
+ import "zustand/shallow";
8
10
  import "@mui/icons-material";
9
- import "react-markdown";
10
- import { d as te, a as Z } 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,17 +18,18 @@ 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",
24
26
  flexDirection: "column",
25
- gap: (o) => o.spacing(1)
27
+ gap: (t) => t.spacing(1)
26
28
  },
27
29
  row: {
28
30
  display: "flex",
29
31
  flexDirection: "column",
30
- gap: (o) => o.spacing(0.5),
32
+ gap: (t) => t.spacing(0.5),
31
33
  pointerEvents: "none"
32
34
  },
33
35
  rowClickable: {
@@ -65,13 +67,13 @@ const u = {
65
67
  bar: {
66
68
  height: 4,
67
69
  borderRadius: 2,
68
- backgroundColor: (o) => o.palette.action.disabledBackground,
70
+ backgroundColor: (t) => t.palette.action.disabledBackground,
69
71
  overflow: "hidden",
70
72
  position: "relative",
71
73
  transition: "background-color 0.15s ease-in-out",
72
74
  cursor: "pointer",
73
75
  "&:hover": {
74
- backgroundColor: (o) => o.palette.action.hover,
76
+ backgroundColor: (t) => t.palette.action.hover,
75
77
  "& > div": {
76
78
  filter: "brightness(1.2)"
77
79
  }
@@ -83,24 +85,24 @@ const u = {
83
85
  transition: "width 0.3s ease-in-out, background-color 0.15s ease-in-out"
84
86
  },
85
87
  barFillMuted: {
86
- backgroundColor: (o) => o.palette.action.disabled
88
+ backgroundColor: (t) => t.palette.action.disabled
87
89
  },
88
90
  legend: {
89
91
  display: "flex",
90
92
  alignItems: "center",
91
- gap: (o) => o.spacing(2),
93
+ gap: (t) => t.spacing(2),
92
94
  flexWrap: "wrap",
93
- paddingTop: (o) => o.spacing(2),
95
+ paddingTop: (t) => t.spacing(2),
94
96
  position: "sticky",
95
97
  bottom: 0,
96
98
  backgroundColor: "background.paper",
97
- borderTop: (o) => `1px solid ${o.palette.divider}`,
98
- marginTop: (o) => o.spacing(2)
99
+ borderTop: (t) => `1px solid ${t.palette.divider}`,
100
+ marginTop: (t) => t.spacing(2)
99
101
  },
100
102
  legendItem: {
101
103
  display: "flex",
102
104
  alignItems: "center",
103
- gap: (o) => o.spacing(1)
105
+ gap: (t) => t.spacing(1)
104
106
  },
105
107
  legendDot: {
106
108
  width: 8,
@@ -116,7 +118,7 @@ const u = {
116
118
  multiBarRow: {
117
119
  display: "flex",
118
120
  alignItems: "center",
119
- gap: (o) => o.spacing(1)
121
+ gap: (t) => t.spacing(1)
120
122
  },
121
123
  multiBarValue: {
122
124
  typography: "body2",
@@ -143,288 +145,287 @@ const u = {
143
145
  color: "text.disabled"
144
146
  }
145
147
  };
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 ? {
148
+ function z(t) {
149
+ const e = M(6), {
150
+ value: o,
151
+ maxValue: l,
152
+ color: r,
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: `${i}%`,
157
- backgroundColor: l
158
+ width: `${s}%`,
159
+ backgroundColor: r
158
160
  } : {
159
161
  ...u.barFill,
160
162
  ...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;
163
+ width: `${s}%`
164
+ }, e[0] = r, e[1] = s, e[2] = i, e[3] = d) : d = e[3];
165
+ const n = d;
164
166
  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;
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 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;
178
- 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;
183
- 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];
169
+ function te(t) {
170
+ const e = M(26), {
171
+ name: o,
172
+ value: l,
173
+ maxValue: r,
174
+ color: c,
175
+ formatter: i,
176
+ labelFormatter: s,
177
+ onClick: d,
178
+ selected: n
179
+ } = t, a = n === void 0 ? !0 : n;
180
+ let m;
181
+ e[0] !== o || e[1] !== d ? (m = d ? () => d({
182
+ name: o
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;
187
185
  let b;
188
- e[8] !== n || e[9] !== r ? (b = n(r), e[8] = n, e[9] = r, e[10] = b) : b = e[10];
186
+ e[3] !== s || e[4] !== o ? (b = s ? s(o) : o, e[3] = s, e[4] = o, e[5] = b) : b = e[5];
189
187
  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];
196
- 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;
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;
188
+ e[6] !== b ? (x = /* @__PURE__ */ h(D, { sx: u.rowLabel, children: b }), e[6] = b, e[7] = x) : x = e[7];
215
189
  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;
190
+ e[8] !== i || e[9] !== l ? (f = i(l), e[8] = i, e[9] = l, e[10] = f) : f = e[10];
191
+ let g;
192
+ e[11] !== f ? (g = /* @__PURE__ */ h(D, { sx: u.rowValue, children: f }), e[11] = f, e[12] = g) : g = e[12];
193
+ let 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];
220
198
  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];
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;
205
+ }
206
+ function oe(t) {
207
+ const e = M(28), {
208
+ name: o,
209
+ values: l,
210
+ maxValue: r,
211
+ colors: c,
212
+ formatter: i,
213
+ labelFormatter: s,
214
+ onClick: d,
215
+ selected: n
216
+ } = t, a = n === void 0 ? !0 : n;
217
+ let m;
218
+ e[0] !== o || e[1] !== d ? (m = d ? () => d({
219
+ name: o
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;
224
222
  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;
231
- } else
232
- b = e[14];
223
+ e[3] !== s || e[4] !== o ? (b = s ? s(o) : o, e[3] = s, e[4] = o, e[5] = b) : b = e[5];
233
224
  let x;
234
- e[21] !== b ? (x = /* @__PURE__ */ g(C, { sx: u.barContainer, children: b }), e[21] = b, e[22] = x) : x = e[22];
235
- 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;
225
+ e[6] !== b ? (x = /* @__PURE__ */ h(D, { sx: u.rowLabel, children: b }), e[6] = b, e[7] = x) : x = e[7];
226
+ let f;
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;
233
+ } else
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 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];
243
+ function re(t) {
244
+ const e = M(10), {
245
+ hiddenCount: o,
246
+ otherLabel: l,
247
+ otherCountLabel: r
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;
252
+ let n;
253
+ e[3] !== c ? (n = /* @__PURE__ */ h(D, { sx: u.otherLabel, children: c }), e[3] = c, e[4] = n) : n = e[4];
252
254
  let a;
253
- e[5] !== c ? (a = /* @__PURE__ */ $(V, { sx: u.otherCount, children: [
255
+ e[5] !== d ? (a = /* @__PURE__ */ S(D, { sx: u.otherCount, children: [
254
256
  "(",
255
- c,
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
257
  d,
258
+ ")"
259
+ ] }), e[5] = d, e[6] = a) : a = e[6];
260
+ let m;
261
+ return e[7] !== n || e[8] !== a ? (m = /* @__PURE__ */ S(C, { sx: u.otherRow, children: [
262
+ n,
261
263
  a
262
- ] }), e[7] = d, e[8] = a, e[9] = f) : f = e[9], f;
264
+ ] }), e[7] = n, e[8] = a, e[9] = m) : m = e[9], m;
263
265
  }
264
- function ue(o) {
265
- const e = B(7), {
266
- series: t,
267
- colors: r
268
- } = o;
269
- if (t.length === 0)
266
+ function le(t) {
267
+ const e = M(7), {
268
+ series: o,
269
+ colors: l
270
+ } = t;
271
+ if (o.length === 0)
270
272
  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: {
273
+ let r;
274
+ if (e[0] !== l || e[1] !== o) {
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: i.color ?? r[c % r.length]
279
+ backgroundColor: s.color ?? l[d % l.length]
278
280
  } }),
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;
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
- 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;
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));
284
+ r = e[2];
296
285
  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
+ return e[5] !== r ? (c = /* @__PURE__ */ h(C, { sx: u.legend, children: r }), e[5] = r, e[6] = c) : c = e[6], c;
287
+ }
288
+ function Le(t) {
289
+ const e = M(43), {
290
+ id: o
291
+ } = t, {
292
+ ref: l
293
+ } = ee(o), r = K(), {
294
+ _formatter: c,
295
+ _labelFormatter: i,
296
+ _series: s,
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");
320
307
  e: {
321
- const m = fe({
322
- data: f
308
+ const _ = ie({
309
+ data: d
323
310
  });
324
- if (m.length === 0) {
325
- q = null;
311
+ if (_.length === 0) {
312
+ W = null;
326
313
  break e;
327
314
  }
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 = {
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 = {
332
319
  ...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));
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 = {
323
+ maxHeight: g,
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));
339
326
  }
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;
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;
341
328
  } 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;
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;
332
+ let j;
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];
334
+ let A;
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,
337
+ j
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;
346
+ }
347
+ function ne(t) {
348
+ return t.values;
359
349
  }
360
- function me(o) {
361
- return o.values;
350
+ function ae(t) {
351
+ const e = t;
352
+ return {
353
+ _formatter: e?.formatter,
354
+ _labelFormatter: e?.labelFormatter,
355
+ _series: e?.series,
356
+ data: e?.data,
357
+ maxItems: e?.maxItems,
358
+ labels: e?.labels,
359
+ onRowClick: e?.onRowClick,
360
+ selected: e?.selected,
361
+ max: e?.max
362
+ };
362
363
  }
363
- function fe({
364
- data: o
364
+ function ie({
365
+ data: t
365
366
  }) {
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;
367
+ if (!t || t.length === 0) return [];
368
+ const e = Math.max(t.length, 1), o = /* @__PURE__ */ new Map(), l = [];
369
+ for (let r = 0; r < t.length; r++) {
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;
373
374
  }
374
375
  }
375
- return r.map((l) => ({
376
- name: l,
377
- values: t.get(l)
376
+ return l.map((r) => ({
377
+ name: r,
378
+ values: o.get(r)
378
379
  }));
379
380
  }
380
- const ge = [85, 70, 55, 75, 60];
381
- function Me() {
382
- const o = B(1);
381
+ const se = [85, 70, 55, 75, 60];
382
+ function Re() {
383
+ const t = M(1);
383
384
  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({
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({
385
386
  length: 5
386
- }).map(he) }), o[0] = e) : e = o[0], e;
387
+ }).map(ce) }), t[0] = e) : e = t[0], e;
387
388
  }
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 })
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 })
393
394
  ] }),
394
- /* @__PURE__ */ g(Y, { variant: "rectangular", height: 4, sx: {
395
+ /* @__PURE__ */ h(P, { variant: "rectangular", height: 4, sx: {
395
396
  borderRadius: 2,
396
- width: `${ge[e]}%`
397
+ width: `${se[e]}%`
397
398
  } })
398
399
  ] }, e);
399
400
  }
400
- function Te({
401
- refUI: o,
401
+ function Fe({
402
+ refUI: t,
402
403
  series: e
403
404
  }) {
404
405
  return [{
405
- ...te,
406
- modifier: () => te.modifier(o)
406
+ ...U,
407
+ modifier: () => U.modifier(t)
407
408
  }, {
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;
409
+ ...N,
410
+ modifier: async (o) => {
411
+ if (!o?.length || o[0]?.length === 0)
412
+ return N.modifier([]);
413
+ const l = o.length, r = /* @__PURE__ */ new Map(), c = [];
414
+ for (let n = 0; n < l; n++) {
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;
418
419
  }
419
420
  }
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]);
421
+ const i = c.map((n) => [n, ...r.get(n)]), d = l > 1 ? ["Category", ...e?.map((n) => n.name) ?? Array.from({
422
+ length: l
423
+ }, (n, a) => `Series ${a + 1}`)] : ["Category", "Value"];
424
+ return N.modifier([d, ...i]);
424
425
  }
425
426
  }];
426
427
  }
427
- function Ve() {
428
+ function Ie() {
428
429
  return {
429
430
  series: [],
430
431
  maxItems: 10,
@@ -432,14 +433,14 @@ function Ve() {
432
433
  };
433
434
  }
434
435
  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
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
444
445
  };
445
446
  //# sourceMappingURL=category.js.map