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