@carto/ps-react-ui 4.25.0 → 4.27.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 (91) hide show
  1. package/dist/actions-DON6fSCh.js +1289 -0
  2. package/dist/actions-DON6fSCh.js.map +1 -0
  3. package/dist/category-BoT5FHHp.js +950 -0
  4. package/dist/category-BoT5FHHp.js.map +1 -0
  5. package/dist/item-color-C1cu6EJd.js +20 -0
  6. package/dist/item-color-C1cu6EJd.js.map +1 -0
  7. package/dist/scale-0elCv3tk.js +29 -0
  8. package/dist/scale-0elCv3tk.js.map +1 -0
  9. package/dist/types/widgets-v2/actions/index.d.ts +1 -1
  10. package/dist/types/widgets-v2/actions/relative-data/index.d.ts +1 -0
  11. package/dist/types/widgets-v2/actions/relative-data/labels.d.ts +3 -0
  12. package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +16 -2
  13. package/dist/types/widgets-v2/actions/relative-data/scale.d.ts +26 -0
  14. package/dist/types/widgets-v2/actions/relative-data/style.d.ts +12 -0
  15. package/dist/types/widgets-v2/bar/types.d.ts +6 -0
  16. package/dist/types/widgets-v2/category/category.d.ts +2 -1
  17. package/dist/types/widgets-v2/histogram/bins.d.ts +7 -0
  18. package/dist/types/widgets-v2/histogram/download.d.ts +2 -2
  19. package/dist/types/widgets-v2/histogram/index.d.ts +2 -1
  20. package/dist/types/widgets-v2/histogram/options.d.ts +1 -1
  21. package/dist/types/widgets-v2/histogram/transforms.d.ts +5 -4
  22. package/dist/types/widgets-v2/histogram/types.d.ts +22 -5
  23. package/dist/types/widgets-v2/index.d.ts +2 -2
  24. package/dist/types/widgets-v2/pie/types.d.ts +6 -0
  25. package/dist/types/widgets-v2/scatterplot/download.d.ts +2 -2
  26. package/dist/types/widgets-v2/scatterplot/index.d.ts +2 -1
  27. package/dist/types/widgets-v2/scatterplot/points.d.ts +7 -0
  28. package/dist/types/widgets-v2/scatterplot/transforms.d.ts +4 -3
  29. package/dist/types/widgets-v2/scatterplot/types.d.ts +21 -2
  30. package/dist/types/widgets-v2/timeseries/types.d.ts +6 -0
  31. package/dist/types/widgets-v2/utils/item-color.d.ts +26 -0
  32. package/dist/widgets-v2/actions.js +1 -1
  33. package/dist/widgets-v2/bar.js +91 -81
  34. package/dist/widgets-v2/bar.js.map +1 -1
  35. package/dist/widgets-v2/category.js +1 -1
  36. package/dist/widgets-v2/histogram.js +133 -100
  37. package/dist/widgets-v2/histogram.js.map +1 -1
  38. package/dist/widgets-v2/pie.js +98 -78
  39. package/dist/widgets-v2/pie.js.map +1 -1
  40. package/dist/widgets-v2/scatterplot.js +151 -110
  41. package/dist/widgets-v2/scatterplot.js.map +1 -1
  42. package/dist/widgets-v2/timeseries.js +96 -86
  43. package/dist/widgets-v2/timeseries.js.map +1 -1
  44. package/dist/widgets-v2.js +2 -2
  45. package/dist/widgets-v2.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/widgets-v2/actions/fullscreen/fullscreen-store.test.tsx +77 -13
  48. package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +48 -5
  49. package/src/widgets-v2/actions/index.ts +1 -0
  50. package/src/widgets-v2/actions/relative-data/index.ts +1 -0
  51. package/src/widgets-v2/actions/relative-data/labels.ts +6 -0
  52. package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +78 -1
  53. package/src/widgets-v2/actions/relative-data/relative-data.tsx +137 -20
  54. package/src/widgets-v2/actions/relative-data/scale.ts +48 -0
  55. package/src/widgets-v2/actions/relative-data/style.ts +10 -0
  56. package/src/widgets-v2/bar/options.test.ts +122 -0
  57. package/src/widgets-v2/bar/options.ts +31 -16
  58. package/src/widgets-v2/bar/types.ts +6 -0
  59. package/src/widgets-v2/category/category.relative-data.test.tsx +51 -63
  60. package/src/widgets-v2/category/category.tsx +25 -11
  61. package/src/widgets-v2/histogram/bins.ts +22 -0
  62. package/src/widgets-v2/histogram/download.test.ts +10 -0
  63. package/src/widgets-v2/histogram/download.ts +7 -3
  64. package/src/widgets-v2/histogram/index.ts +3 -0
  65. package/src/widgets-v2/histogram/options.test.ts +62 -0
  66. package/src/widgets-v2/histogram/options.ts +44 -19
  67. package/src/widgets-v2/histogram/transforms.test.ts +21 -7
  68. package/src/widgets-v2/histogram/transforms.ts +26 -12
  69. package/src/widgets-v2/histogram/types.ts +25 -5
  70. package/src/widgets-v2/index.ts +7 -1
  71. package/src/widgets-v2/pie/options.test.ts +91 -0
  72. package/src/widgets-v2/pie/options.ts +50 -20
  73. package/src/widgets-v2/pie/types.ts +6 -0
  74. package/src/widgets-v2/scatterplot/download.test.ts +9 -0
  75. package/src/widgets-v2/scatterplot/download.ts +5 -3
  76. package/src/widgets-v2/scatterplot/index.ts +3 -0
  77. package/src/widgets-v2/scatterplot/options.test.ts +90 -0
  78. package/src/widgets-v2/scatterplot/options.ts +53 -15
  79. package/src/widgets-v2/scatterplot/points.ts +35 -0
  80. package/src/widgets-v2/scatterplot/transforms.test.ts +19 -0
  81. package/src/widgets-v2/scatterplot/transforms.ts +23 -18
  82. package/src/widgets-v2/scatterplot/types.ts +25 -2
  83. package/src/widgets-v2/timeseries/options.test.ts +65 -0
  84. package/src/widgets-v2/timeseries/options.ts +38 -19
  85. package/src/widgets-v2/timeseries/types.ts +6 -0
  86. package/src/widgets-v2/utils/item-color.test.ts +74 -0
  87. package/src/widgets-v2/utils/item-color.ts +55 -0
  88. package/dist/actions-B1ss030_.js +0 -1167
  89. package/dist/actions-B1ss030_.js.map +0 -1
  90. package/dist/category-DuKx_CJX.js +0 -933
  91. package/dist/category-DuKx_CJX.js.map +0 -1
@@ -1,933 +0,0 @@
1
- import { t as e } from "./tooltip-DJUGNZxY.js";
2
- import "./components-DKjBezcJ.js";
3
- import { C as t, S as n, T as r, p as i } from "./stores-BVFMfgyo.js";
4
- import { n as a, t as o } from "./download--wRRnf19.js";
5
- import { c as s } from "react/compiler-runtime";
6
- import { useRef as c, useState as l } from "react";
7
- import { Box as u, Skeleton as d, Typography as f, useTheme as p } from "@mui/material";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- var g = {
10
- root: {
11
- display: "flex",
12
- flexDirection: "column",
13
- position: "relative",
14
- width: "100%"
15
- },
16
- list: {
17
- position: "relative",
18
- display: "grid",
19
- gridTemplateColumns: "minmax(0, 1fr)",
20
- gap: 1,
21
- py: .5
22
- },
23
- listMulti: { gridTemplateColumns: "minmax(0, 1fr) max-content" },
24
- barWrap: { position: "relative" },
25
- multiZeroArea: {
26
- position: "absolute",
27
- inset: 0,
28
- gridColumn: "1 / 2",
29
- pointerEvents: "none"
30
- },
31
- zeroTick: {
32
- position: "absolute",
33
- top: -6,
34
- bottom: -6,
35
- width: "1px",
36
- transform: "translateX(-50%)",
37
- bgcolor: "text.disabled",
38
- pointerEvents: "none"
39
- },
40
- listScroll: { pr: 1 },
41
- rowSingle: {
42
- gridColumn: "1 / -1",
43
- display: "flex",
44
- flexDirection: "column",
45
- gap: .5,
46
- cursor: "pointer",
47
- userSelect: "none",
48
- transition: "background-color 80ms ease",
49
- "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
50
- "&:focus-visible": {
51
- outline: "2px solid",
52
- outlineColor: "primary.main",
53
- outlineOffset: -2
54
- }
55
- },
56
- rowHeader: {
57
- display: "flex",
58
- justifyContent: "space-between",
59
- alignItems: "center",
60
- gap: 1
61
- },
62
- rowMulti: {
63
- position: "relative",
64
- gridColumn: "1 / -1",
65
- display: "grid",
66
- gridTemplateColumns: "subgrid",
67
- rowGap: .5,
68
- cursor: "pointer",
69
- userSelect: "none",
70
- transition: "background-color 80ms ease",
71
- "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
72
- "&:focus-visible": {
73
- outline: "2px solid",
74
- outlineColor: "primary.main",
75
- outlineOffset: -2
76
- }
77
- },
78
- name: {
79
- overflow: "hidden",
80
- whiteSpace: "nowrap",
81
- textOverflow: "ellipsis",
82
- color: "text.primary",
83
- fontWeight: "medium"
84
- },
85
- multiName: {
86
- gridColumn: "1 / -1",
87
- overflow: "hidden",
88
- whiteSpace: "nowrap",
89
- textOverflow: "ellipsis",
90
- color: "text.primary",
91
- fontWeight: "medium"
92
- },
93
- value: {
94
- color: "text.secondary",
95
- fontVariantNumeric: "tabular-nums",
96
- minWidth: 48,
97
- textAlign: "right",
98
- alignSelf: "center"
99
- },
100
- bar: {
101
- small: {
102
- position: "relative",
103
- height: 4,
104
- bgcolor: "action.hover",
105
- borderRadius: 1,
106
- overflow: "hidden",
107
- transition: "background-color 150ms ease"
108
- },
109
- medium: {
110
- position: "relative",
111
- height: 12,
112
- bgcolor: "action.hover",
113
- borderRadius: .25,
114
- overflow: "hidden",
115
- transition: "background-color 150ms ease"
116
- }
117
- },
118
- barFill: {
119
- small: {
120
- position: "absolute",
121
- top: 0,
122
- bottom: 0,
123
- borderRadius: 1,
124
- transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
125
- },
126
- medium: {
127
- position: "absolute",
128
- top: 0,
129
- bottom: 0,
130
- borderRadius: .25,
131
- transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
132
- }
133
- },
134
- stackedSegment: {
135
- small: {
136
- position: "absolute",
137
- top: 0,
138
- bottom: 0,
139
- transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
140
- },
141
- medium: {
142
- position: "absolute",
143
- top: 0,
144
- bottom: 0,
145
- transition: "left 300ms ease-in-out, width 300ms ease-in-out, background-color 150ms ease, filter 150ms ease"
146
- }
147
- },
148
- multiBarRow: { display: "contents" },
149
- multiBarContainer: { alignSelf: "center" },
150
- rowStacked: {
151
- gridColumn: "1 / -1",
152
- display: "flex",
153
- flexDirection: "column",
154
- gap: .5,
155
- cursor: "pointer",
156
- userSelect: "none",
157
- transition: "background-color 80ms ease",
158
- "&:hover [data-bar-fill=\"true\"]": { filter: "brightness(1.2)" },
159
- "&:focus-visible": {
160
- outline: "2px solid",
161
- outlineColor: "primary.main",
162
- outlineOffset: -2
163
- }
164
- },
165
- stackedHeader: {
166
- display: "flex",
167
- justifyContent: "space-between",
168
- alignItems: "center",
169
- gap: 1
170
- },
171
- stackedTotal: {
172
- color: "text.primary",
173
- fontWeight: "medium",
174
- fontVariantNumeric: "tabular-nums",
175
- minWidth: 48,
176
- textAlign: "right"
177
- },
178
- stackedBreakdown: {
179
- display: "flex",
180
- flexWrap: "wrap",
181
- columnGap: 2,
182
- rowGap: .25
183
- },
184
- stackedBreakdownItem: {
185
- color: "text.secondary",
186
- fontVariantNumeric: "tabular-nums"
187
- },
188
- legend: {
189
- display: "flex",
190
- alignItems: "center",
191
- gap: 2,
192
- flexWrap: "wrap",
193
- pt: 2,
194
- mt: 2,
195
- position: "sticky",
196
- bottom: 0,
197
- bgcolor: "background.paper",
198
- borderTop: (e) => `1px solid ${e.palette.divider}`
199
- },
200
- legendItem: {
201
- display: "flex",
202
- alignItems: "center",
203
- gap: 1,
204
- cursor: "pointer"
205
- },
206
- legendItemHidden: {
207
- display: "flex",
208
- alignItems: "center",
209
- gap: 1,
210
- cursor: "pointer",
211
- opacity: .5
212
- },
213
- legendDot: {
214
- width: 14,
215
- height: 14,
216
- borderRadius: "50%"
217
- },
218
- legendLabel: {
219
- color: "text.secondary",
220
- textTransform: "uppercase",
221
- fontWeight: "medium"
222
- },
223
- otherRow: {
224
- gridColumn: "1 / -1",
225
- display: "flex",
226
- alignItems: "center",
227
- gap: 1,
228
- py: .5,
229
- px: .5
230
- },
231
- otherLabelButton: {
232
- cursor: "pointer",
233
- userSelect: "none",
234
- borderRadius: 1,
235
- px: .5,
236
- ml: -.5,
237
- transition: "background-color 80ms ease",
238
- "&:hover": { bgcolor: "action.hover" },
239
- "&:focus-visible": {
240
- outline: "2px solid",
241
- outlineColor: "primary.main",
242
- outlineOffset: 2
243
- }
244
- },
245
- otherLabel: {
246
- color: "text.primary",
247
- fontWeight: "medium"
248
- },
249
- otherCount: {
250
- color: "text.secondary",
251
- fontVariantNumeric: "tabular-nums"
252
- }
253
- };
254
- //#endregion
255
- //#region src/widgets-v2/category/components/category-bar.tsx
256
- function _(e) {
257
- let t = s(17), { value: n, maxValue: r, minValue: i, color: a, size: o, zeroTick: c } = e, l = i === void 0 ? 0 : i, d = o === void 0 ? "small" : o, f = c === void 0 || c, p = r - l, h = p > 0 ? (Math.min(0, n) - l) / p * 100 : 0, _ = p > 0 ? Math.abs(n) / p * 100 : 0, y = f && l < 0 && r > 0 ? -l / p * 100 : void 0, b = g.bar[d], x = g.barFill[d], S = `${h}%`, C = `${_}%`, w;
258
- t[0] === n ? w = t[1] : (w = n < 0 ? {
259
- borderTopRightRadius: 0,
260
- borderBottomRightRadius: 0
261
- } : {
262
- borderTopLeftRadius: 0,
263
- borderBottomLeftRadius: 0
264
- }, t[0] = n, t[1] = w);
265
- let T;
266
- t[2] !== a || t[3] !== S || t[4] !== C || t[5] !== w ? (T = {
267
- left: S,
268
- width: C,
269
- backgroundColor: a,
270
- ...w
271
- }, t[2] = a, t[3] = S, t[4] = C, t[5] = w, t[6] = T) : T = t[6];
272
- let E;
273
- t[7] !== T || t[8] !== x ? (E = /* @__PURE__ */ m(u, {
274
- sx: x,
275
- style: T,
276
- "data-bar-fill": "true"
277
- }), t[7] = T, t[8] = x, t[9] = E) : E = t[9];
278
- let D;
279
- t[10] !== d || t[11] !== E || t[12] !== b ? (D = /* @__PURE__ */ m(u, {
280
- sx: b,
281
- "data-size": d,
282
- children: E
283
- }), t[10] = d, t[11] = E, t[12] = b, t[13] = D) : D = t[13];
284
- let O;
285
- return t[14] !== D || t[15] !== y ? (O = /* @__PURE__ */ m(v, {
286
- zeroPct: y,
287
- children: D
288
- }), t[14] = D, t[15] = y, t[16] = O) : O = t[16], O;
289
- }
290
- function v(e) {
291
- let t = s(5), { zeroPct: n, children: r } = e;
292
- if (n === void 0) return r;
293
- let i = `${n}%`, a;
294
- t[0] === i ? a = t[1] : (a = /* @__PURE__ */ m(u, {
295
- "aria-hidden": !0,
296
- "data-zero-tick": "true",
297
- sx: g.zeroTick,
298
- style: { left: i }
299
- }), t[0] = i, t[1] = a);
300
- let o;
301
- return t[2] !== r || t[3] !== a ? (o = /* @__PURE__ */ h(u, {
302
- sx: g.barWrap,
303
- children: [a, r]
304
- }), t[2] = r, t[3] = a, t[4] = o) : o = t[4], o;
305
- }
306
- //#endregion
307
- //#region src/widgets-v2/category/components/category-row-single.tsx
308
- function y(e) {
309
- let t = s(28), { name: n, displayName: r, value: i, maxValue: a, minValue: o, color: c, formatter: l, selected: d, onToggle: p, size: v } = e, y;
310
- t[0] !== n || t[1] !== p ? (y = (e) => {
311
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p(n));
312
- }, t[0] = n, t[1] = p, t[2] = y) : y = t[2];
313
- let b = y, x;
314
- t[3] !== n || t[4] !== p ? (x = () => p(n), t[3] = n, t[4] = p, t[5] = x) : x = t[5];
315
- let S = r ?? n, C;
316
- t[6] === S ? C = t[7] : (C = /* @__PURE__ */ m(f, {
317
- variant: "body2",
318
- sx: g.name,
319
- children: S
320
- }), t[6] = S, t[7] = C);
321
- let w;
322
- t[8] !== l || t[9] !== i ? (w = l(i), t[8] = l, t[9] = i, t[10] = w) : w = t[10];
323
- let T;
324
- t[11] === w ? T = t[12] : (T = /* @__PURE__ */ m(f, {
325
- variant: "body2",
326
- sx: g.value,
327
- children: w
328
- }), t[11] = w, t[12] = T);
329
- let E;
330
- t[13] !== C || t[14] !== T ? (E = /* @__PURE__ */ h(u, {
331
- sx: g.rowHeader,
332
- children: [C, T]
333
- }), t[13] = C, t[14] = T, t[15] = E) : E = t[15];
334
- let D;
335
- t[16] !== c || t[17] !== a || t[18] !== o || t[19] !== v || t[20] !== i ? (D = /* @__PURE__ */ m(_, {
336
- value: i,
337
- maxValue: a,
338
- minValue: o,
339
- color: c,
340
- size: v
341
- }), t[16] = c, t[17] = a, t[18] = o, t[19] = v, t[20] = i, t[21] = D) : D = t[21];
342
- let O;
343
- return t[22] !== b || t[23] !== d || t[24] !== x || t[25] !== E || t[26] !== D ? (O = /* @__PURE__ */ h(u, {
344
- role: "button",
345
- "aria-pressed": d,
346
- tabIndex: 0,
347
- onClick: x,
348
- onKeyDown: b,
349
- sx: g.rowSingle,
350
- children: [E, D]
351
- }), t[22] = b, t[23] = d, t[24] = x, t[25] = E, t[26] = D, t[27] = O) : O = t[27], O;
352
- }
353
- //#endregion
354
- //#region src/widgets-v2/category/components/category-row-multi.tsx
355
- function b(e) {
356
- let t = s(34), { name: n, displayName: r, values: i, colors: a, maxValue: o, minValue: c, formatter: l, selected: d, onToggle: p, size: v } = e, y = c ?? 0, b;
357
- t[0] !== n || t[1] !== p ? (b = (e) => {
358
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p(n));
359
- }, t[0] = n, t[1] = p, t[2] = b) : b = t[2];
360
- let x = b, S;
361
- t[3] !== n || t[4] !== p ? (S = () => p(n), t[3] = n, t[4] = p, t[5] = S) : S = t[5];
362
- let C = r ?? n, w;
363
- t[6] === C ? w = t[7] : (w = /* @__PURE__ */ m(f, {
364
- variant: "body2",
365
- sx: g.multiName,
366
- children: C
367
- }), t[6] = C, t[7] = w);
368
- let T;
369
- t[8] !== o || t[9] !== y || t[10] !== i.length ? (T = y < 0 && o > 0 && /* @__PURE__ */ m(u, {
370
- "aria-hidden": !0,
371
- sx: g.multiZeroArea,
372
- style: { gridRow: `2 / span ${i.length}` },
373
- children: /* @__PURE__ */ m(u, {
374
- "data-zero-tick": "true",
375
- sx: g.zeroTick,
376
- style: { left: `${-y / (o - y) * 100}%` }
377
- })
378
- }), t[8] = o, t[9] = y, t[10] = i.length, t[11] = T) : T = t[11];
379
- let E;
380
- if (t[12] !== a || t[13] !== l || t[14] !== o || t[15] !== c || t[16] !== n || t[17] !== v || t[18] !== i) {
381
- let e;
382
- t[20] !== a || t[21] !== l || t[22] !== o || t[23] !== c || t[24] !== n || t[25] !== v ? (e = (e, t) => /* @__PURE__ */ h(u, {
383
- sx: g.multiBarRow,
384
- children: [/* @__PURE__ */ m(u, {
385
- sx: g.multiBarContainer,
386
- children: /* @__PURE__ */ m(_, {
387
- value: e,
388
- maxValue: o,
389
- minValue: c,
390
- color: a[t] ?? "",
391
- size: v,
392
- zeroTick: !1
393
- })
394
- }), /* @__PURE__ */ m(f, {
395
- variant: "body2",
396
- sx: g.value,
397
- children: l(e)
398
- })]
399
- }, `${n}-series-${t}`), t[20] = a, t[21] = l, t[22] = o, t[23] = c, t[24] = n, t[25] = v, t[26] = e) : e = t[26], E = i.map(e), t[12] = a, t[13] = l, t[14] = o, t[15] = c, t[16] = n, t[17] = v, t[18] = i, t[19] = E;
400
- } else E = t[19];
401
- let D;
402
- return t[27] !== x || t[28] !== d || t[29] !== S || t[30] !== w || t[31] !== T || t[32] !== E ? (D = /* @__PURE__ */ h(u, {
403
- role: "button",
404
- "aria-pressed": d,
405
- tabIndex: 0,
406
- onClick: S,
407
- onKeyDown: x,
408
- sx: g.rowMulti,
409
- children: [
410
- w,
411
- T,
412
- E
413
- ]
414
- }), t[27] = x, t[28] = d, t[29] = S, t[30] = w, t[31] = T, t[32] = E, t[33] = D) : D = t[33], D;
415
- }
416
- //#endregion
417
- //#region src/widgets-v2/category/components/category-bar-stacked.tsx
418
- function x(e) {
419
- let t = s(22), { values: n, colors: r, maxValue: i, zeroPct: a, size: o } = e, c = a === void 0 ? 0 : a, l = o === void 0 ? "small" : o, d;
420
- if (t[0] !== n) {
421
- d = [];
422
- let e = 0, r = 0;
423
- for (let t of n) t < 0 && (r -= t), d.push(t < 0 ? -r : e), t > 0 && (e += t);
424
- t[0] = n, t[1] = d;
425
- } else d = t[1];
426
- let f = c > 0 && c < 100 ? c : void 0, p = g.bar[l], h;
427
- if (t[2] !== r || t[3] !== d || t[4] !== i || t[5] !== l || t[6] !== n || t[7] !== c) {
428
- let e;
429
- t[9] !== r || t[10] !== d || t[11] !== i || t[12] !== l || t[13] !== c ? (e = (e, t) => {
430
- if (e === 0 || i <= 0) return null;
431
- let n = c + d[t] / i * 100, a = Math.abs(e) / i * 100;
432
- return /* @__PURE__ */ m(u, {
433
- sx: g.stackedSegment[l],
434
- style: {
435
- left: `${n}%`,
436
- width: `${a}%`,
437
- backgroundColor: r[t] ?? ""
438
- },
439
- "data-bar-fill": "true"
440
- }, `seg-${r[t] ?? "none"}-${t}`);
441
- }, t[9] = r, t[10] = d, t[11] = i, t[12] = l, t[13] = c, t[14] = e) : e = t[14], h = n.map(e), t[2] = r, t[3] = d, t[4] = i, t[5] = l, t[6] = n, t[7] = c, t[8] = h;
442
- } else h = t[8];
443
- let _;
444
- t[15] !== l || t[16] !== p || t[17] !== h ? (_ = /* @__PURE__ */ m(u, {
445
- sx: p,
446
- "data-size": l,
447
- children: h
448
- }), t[15] = l, t[16] = p, t[17] = h, t[18] = _) : _ = t[18];
449
- let y;
450
- return t[19] !== f || t[20] !== _ ? (y = /* @__PURE__ */ m(v, {
451
- zeroPct: f,
452
- children: _
453
- }), t[19] = f, t[20] = _, t[21] = y) : y = t[21], y;
454
- }
455
- //#endregion
456
- //#region src/widgets-v2/category/components/category-row-stacked.tsx
457
- function S(e) {
458
- let t = s(67), { name: n, displayName: r, values: i, colors: a, seriesNames: o, formatter: c, selected: l, onToggle: d, size: p, zeroPct: _ } = e, v = _ === void 0 ? 0 : _, y;
459
- t[0] !== n || t[1] !== d ? (y = (e) => {
460
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d(n));
461
- }, t[0] = n, t[1] = d, t[2] = y) : y = t[2];
462
- let b = y, S, w, T, E, D, O, k, A, j, M, N, P, F, I, L;
463
- if (t[3] !== r || t[4] !== c || t[5] !== b || t[6] !== n || t[7] !== d || t[8] !== l || t[9] !== i || t[10] !== v) {
464
- let e = i.reduce(C, 0), a = 0, o = 0;
465
- for (let e of i) e > 0 ? a += e : o -= e;
466
- E = Math.max(v < 100 ? a * 100 / (100 - v) : 0, v > 0 ? o * 100 / v : 0), T = u, I = "button", L = l, D = 0, t[26] !== n || t[27] !== d ? (O = () => d(n), t[26] = n, t[27] = d, t[28] = O) : O = t[28], k = b, A = g.rowStacked, w = u, P = g.stackedHeader;
467
- let s = r ?? n;
468
- t[29] === s ? F = t[30] : (F = /* @__PURE__ */ m(f, {
469
- variant: "body2",
470
- sx: g.multiName,
471
- children: s
472
- }), t[29] = s, t[30] = F), S = f, j = "body2", M = g.stackedTotal, N = c(e), t[3] = r, t[4] = c, t[5] = b, t[6] = n, t[7] = d, t[8] = l, t[9] = i, t[10] = v, t[11] = S, t[12] = w, t[13] = T, t[14] = E, t[15] = D, t[16] = O, t[17] = k, t[18] = A, t[19] = j, t[20] = M, t[21] = N, t[22] = P, t[23] = F, t[24] = I, t[25] = L;
473
- } else S = t[11], w = t[12], T = t[13], E = t[14], D = t[15], O = t[16], k = t[17], A = t[18], j = t[19], M = t[20], N = t[21], P = t[22], F = t[23], I = t[24], L = t[25];
474
- let R;
475
- t[31] !== S || t[32] !== j || t[33] !== M || t[34] !== N ? (R = /* @__PURE__ */ m(S, {
476
- variant: j,
477
- sx: M,
478
- children: N
479
- }), t[31] = S, t[32] = j, t[33] = M, t[34] = N, t[35] = R) : R = t[35];
480
- let z;
481
- t[36] !== w || t[37] !== R || t[38] !== P || t[39] !== F ? (z = /* @__PURE__ */ h(w, {
482
- sx: P,
483
- children: [F, R]
484
- }), t[36] = w, t[37] = R, t[38] = P, t[39] = F, t[40] = z) : z = t[40];
485
- let B;
486
- t[41] !== a || t[42] !== E || t[43] !== p || t[44] !== i || t[45] !== v ? (B = /* @__PURE__ */ m(x, {
487
- values: i,
488
- colors: a,
489
- maxValue: E,
490
- zeroPct: v,
491
- size: p
492
- }), t[41] = a, t[42] = E, t[43] = p, t[44] = i, t[45] = v, t[46] = B) : B = t[46];
493
- let V;
494
- if (t[47] !== c || t[48] !== o || t[49] !== i) {
495
- let e;
496
- t[51] !== c || t[52] !== o ? (e = (e, t) => /* @__PURE__ */ m(f, {
497
- variant: "body2",
498
- sx: g.stackedBreakdownItem,
499
- children: `${o[t]}: ${c(e)}`
500
- }, `breakdown-${o[t]}`), t[51] = c, t[52] = o, t[53] = e) : e = t[53], V = i.map(e), t[47] = c, t[48] = o, t[49] = i, t[50] = V;
501
- } else V = t[50];
502
- let H;
503
- t[54] === V ? H = t[55] : (H = /* @__PURE__ */ m(u, {
504
- sx: g.stackedBreakdown,
505
- children: V
506
- }), t[54] = V, t[55] = H);
507
- let U;
508
- return t[56] !== T || t[57] !== D || t[58] !== O || t[59] !== k || t[60] !== A || t[61] !== z || t[62] !== B || t[63] !== H || t[64] !== I || t[65] !== L ? (U = /* @__PURE__ */ h(T, {
509
- role: I,
510
- "aria-pressed": L,
511
- tabIndex: D,
512
- onClick: O,
513
- onKeyDown: k,
514
- sx: A,
515
- children: [
516
- z,
517
- B,
518
- H
519
- ]
520
- }), t[56] = T, t[57] = D, t[58] = O, t[59] = k, t[60] = A, t[61] = z, t[62] = B, t[63] = H, t[64] = I, t[65] = L, t[66] = U) : U = t[66], U;
521
- }
522
- function C(e, t) {
523
- return e + t;
524
- }
525
- //#endregion
526
- //#region src/widgets-v2/category/components/category-row-other.tsx
527
- function w(t) {
528
- let n = s(23), { hiddenCount: r, otherLabel: i, otherCountLabel: a, onShowAll: o, showAllLabel: c } = t, l = i === void 0 ? "Others" : i, d = a === void 0 ? "{count}" : a, p = c === void 0 ? "Show all" : c, _;
529
- n[0] !== r || n[1] !== d ? (_ = d.replace("{count}", String(r)), n[0] = r, n[1] = d, n[2] = _) : _ = n[2];
530
- let v = _, y;
531
- n[3] === v ? y = n[4] : (y = /* @__PURE__ */ m(f, {
532
- variant: "body2",
533
- sx: g.otherCount,
534
- children: v
535
- }), n[3] = v, n[4] = y);
536
- let b = y;
537
- if (!o) {
538
- let e;
539
- n[5] === l ? e = n[6] : (e = /* @__PURE__ */ m(f, {
540
- variant: "body2",
541
- sx: g.otherLabel,
542
- children: l
543
- }), n[5] = l, n[6] = e);
544
- let t;
545
- return n[7] !== b || n[8] !== e ? (t = /* @__PURE__ */ h(u, {
546
- sx: g.otherRow,
547
- children: [e, b]
548
- }), n[7] = b, n[8] = e, n[9] = t) : t = n[9], t;
549
- }
550
- let x;
551
- n[10] === o ? x = n[11] : (x = (e) => {
552
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
553
- }, n[10] = o, n[11] = x);
554
- let S = x, C;
555
- n[12] === Symbol.for("react.memo_cache_sentinel") ? (C = {
556
- ...g.otherLabel,
557
- ...g.otherLabelButton
558
- }, n[12] = C) : C = n[12];
559
- let w;
560
- n[13] !== S || n[14] !== o || n[15] !== l ? (w = /* @__PURE__ */ m(f, {
561
- variant: "body2",
562
- component: "span",
563
- role: "button",
564
- tabIndex: 0,
565
- onClick: o,
566
- onKeyDown: S,
567
- sx: C,
568
- children: l
569
- }), n[13] = S, n[14] = o, n[15] = l, n[16] = w) : w = n[16];
570
- let T;
571
- n[17] !== p || n[18] !== w ? (T = /* @__PURE__ */ m(e, {
572
- title: p,
573
- children: w
574
- }), n[17] = p, n[18] = w, n[19] = T) : T = n[19];
575
- let E;
576
- return n[20] !== b || n[21] !== T ? (E = /* @__PURE__ */ h(u, {
577
- sx: g.otherRow,
578
- children: [T, b]
579
- }), n[20] = b, n[21] = T, n[22] = E) : E = n[22], E;
580
- }
581
- //#endregion
582
- //#region src/widgets-v2/category/components/category-legend.tsx
583
- var T = /* @__PURE__ */ new Set();
584
- function E(e) {
585
- let t = s(11), { series: n, colorAt: r, hiddenSeries: i, onToggle: a } = e, o = i === void 0 ? T : i;
586
- if (n.length === 0) return null;
587
- let c;
588
- if (t[0] !== r || t[1] !== o || t[2] !== a || t[3] !== n) {
589
- let e;
590
- t[5] !== r || t[6] !== o || t[7] !== a ? (e = (e, t) => {
591
- let n = o.has(t);
592
- return /* @__PURE__ */ h(u, {
593
- role: "checkbox",
594
- "aria-checked": !n,
595
- tabIndex: 0,
596
- onClick: () => a?.(t),
597
- onKeyDown: (e) => {
598
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a?.(t));
599
- },
600
- sx: n ? g.legendItemHidden : g.legendItem,
601
- children: [/* @__PURE__ */ m(u, {
602
- sx: g.legendDot,
603
- style: { backgroundColor: e.color ?? r(t) }
604
- }), /* @__PURE__ */ m(f, {
605
- variant: "caption",
606
- sx: g.legendLabel,
607
- children: e.name
608
- })]
609
- }, e.name);
610
- }, t[5] = r, t[6] = o, t[7] = a, t[8] = e) : e = t[8], c = n.map(e), t[0] = r, t[1] = o, t[2] = a, t[3] = n, t[4] = c;
611
- } else c = t[4];
612
- let l;
613
- return t[9] === c ? l = t[10] : (l = /* @__PURE__ */ m(u, {
614
- sx: g.legend,
615
- children: c
616
- }), t[9] = c, t[10] = l), l;
617
- }
618
- //#endregion
619
- //#region src/widgets-v2/category/category-ui.tsx
620
- var D = 20, O = {
621
- small: 36,
622
- medium: 44
623
- }, k = 8;
624
- function A(e) {
625
- if (!e || e.length === 0) return [];
626
- let t = Math.max(e.length, 1), n = /* @__PURE__ */ new Map(), r = [];
627
- for (let i = 0; i < e.length; i++) {
628
- let a = e[i] ?? [];
629
- for (let e of a) {
630
- let a = n.get(e.name);
631
- a || (a = {
632
- name: e.name,
633
- values: Array(t).fill(0),
634
- rowColors: Array(t).fill(void 0)
635
- }, n.set(e.name, a), r.push(e.name)), a.values[i] = e.value, a.rowColors[i] = e.color;
636
- }
637
- }
638
- return r.map((e) => n.get(e));
639
- }
640
- function j(e, t, n) {
641
- let r = 0, i = 0;
642
- for (let t of e) for (let e of t.values) e < r && (r = e), e > i && (i = e);
643
- if (typeof t == "number" && t < 0 && (r = t), typeof n == "number" && n > 0 && (i = n), r < 0 && i > 0) {
644
- let e = Math.max(-r, i);
645
- return [-e, e];
646
- }
647
- return [r, i];
648
- }
649
- function M(e, t) {
650
- return (t < 0 ? "−" : "") + e(Math.abs(t));
651
- }
652
- function N(e) {
653
- let t = s(94), { data: n, selection: r, onSelectionChange: i, formatter: a, labelFormatter: o, series: d, maxItems: f, labels: _, onShowAll: v, maxOverride: x, minOverride: C, size: T, stacked: N, hiddenSeries: R, onHiddenSeriesChange: z } = e, B = f === void 0 ? D : f, V = T === void 0 ? "small" : T, H = N !== void 0 && N, U = p(), W = a ?? L, ee;
654
- t[0] === W ? ee = t[1] : (ee = (e) => M(W, e), t[0] = W, t[1] = ee);
655
- let G = ee, te = !!r && r.length > 0, K;
656
- t[2] === r ? K = t[3] : (K = r ?? [], t[2] = r, t[3] = K);
657
- let ne;
658
- t[4] === K ? ne = t[5] : (ne = new Set(K), t[4] = K, t[5] = ne);
659
- let re = ne, ie;
660
- t[6] !== i || t[7] !== r ? (ie = (e) => {
661
- if (!i) return;
662
- let t = r ?? [], n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
663
- i(n);
664
- }, t[6] = i, t[7] = r, t[8] = ie) : ie = t[8];
665
- let ae = ie, oe = U.palette.secondary.main, se;
666
- t[9] === U.palette ? se = t[10] : (se = Object.values(U.palette.qualitative?.bold ?? {}), t[9] = U.palette, t[10] = se);
667
- let ce;
668
- t[11] !== se || t[12] !== U.palette.secondary.main ? (ce = [oe, ...se], t[11] = se, t[12] = U.palette.secondary.main, t[13] = ce) : ce = t[13];
669
- let le = ce, ue;
670
- t[14] !== le || t[15] !== d || t[16] !== U.palette.secondary.main ? (ue = (e, t) => t || d?.[e]?.color || (le[e % le.length] ?? U.palette.secondary.main), t[14] = le, t[15] = d, t[16] = U.palette.secondary.main, t[17] = ue) : ue = t[17];
671
- let de = ue, fe = U.palette.action.disabled, pe;
672
- t[18] === n ? pe = t[19] : (pe = A(n), t[18] = n, t[19] = pe);
673
- let q = pe, me;
674
- t[20] !== q || t[21] !== x || t[22] !== C ? (me = j(q, C, x), t[20] = q, t[21] = x, t[22] = C, t[23] = me) : me = t[23];
675
- let [J, he] = me, ge = he > J ? -J / (he - J) * 100 : 0, Y = B === 0, _e = c(!1), [ve, ye] = l(null), be;
676
- t[24] === Y ? be = t[25] : (be = (e) => {
677
- if (!e || _e.current || Y) return;
678
- let t = e.clientHeight;
679
- t > 0 && (_e.current = !0, ye(t));
680
- }, t[24] = Y, t[25] = be);
681
- let xe = be, [Se, Ce] = l(I), X = R ?? Se, we;
682
- t[26] === d ? we = t[27] : (we = JSON.stringify(d?.map(F) ?? []), t[26] = d, t[27] = we);
683
- let Te = we, [Ee, De] = l(Te);
684
- Te !== Ee && (De(Te), Ce(/* @__PURE__ */ new Set()));
685
- let Oe = Math.max(n.length, 1), ke;
686
- t[28] !== X || t[29] !== z || t[30] !== Oe ? (ke = (e) => {
687
- let t = new Set(X);
688
- t.has(e) ? t.delete(e) : t.add(e), (z ?? Ce)(t.size >= Oe ? /* @__PURE__ */ new Set() : t);
689
- }, t[28] = X, t[29] = z, t[30] = Oe, t[31] = ke) : ke = t[31];
690
- let Ae = ke;
691
- if (q.length === 0) return null;
692
- let je;
693
- t[32] === B ? je = t[33] : (je = typeof B == "number" && Number.isFinite(B) && B > 0, t[32] = B, t[33] = je);
694
- let Me = je, Ne, Pe, Fe, Z, Ie, Q, $, Le, Re;
695
- if (t[34] !== de || t[35] !== n.length || t[36] !== fe || t[37] !== G || t[38] !== q || t[39] !== Me || t[40] !== te || t[41] !== X || t[42] !== o || t[43] !== xe || t[44] !== B || t[45] !== he || t[46] !== J || t[47] !== ve || t[48] !== Y || t[49] !== re || t[50] !== d || t[51] !== Oe || t[52] !== V || t[53] !== H || t[54] !== ae || t[55] !== ge) {
696
- let e = Me ? q.slice(0, B) : q;
697
- Z = Me ? q.length - e.length : 0;
698
- let r = n.length > 1;
699
- Fe = r && !!d && d.length > 0;
700
- let i = Array.from({ length: Oe }, P).filter((e) => !X.has(e)), a = Y ? ve ?? O[V] * k : void 0;
701
- Pe = u, Re = g.root, Ne = u, Ie = xe;
702
- let s = r && !H && g.listMulti, c = Y && g.listScroll;
703
- t[65] !== s || t[66] !== c ? (Q = {
704
- ...g.list,
705
- ...s,
706
- ...c
707
- }, t[65] = s, t[66] = c, t[67] = Q) : Q = t[67], t[68] === a ? $ = t[69] : ($ = a === void 0 ? void 0 : {
708
- maxHeight: a,
709
- overflowY: "auto"
710
- }, t[68] = a, t[69] = $), Le = e.map((e) => {
711
- let t = re.has(e.name), n = te && !t, a = o ? o(e.name) : void 0, s = (t) => n ? fe : de(t, e.rowColors[t]);
712
- return r ? H ? /* @__PURE__ */ m(S, {
713
- name: e.name,
714
- displayName: a,
715
- values: i.map((t) => e.values[t]),
716
- colors: i.map((e) => s(e)),
717
- seriesNames: i.map((e) => d?.[e]?.name ?? `Series ${e + 1}`),
718
- formatter: G,
719
- selected: t,
720
- onToggle: ae,
721
- size: V,
722
- zeroPct: ge
723
- }, String(e.name)) : /* @__PURE__ */ m(b, {
724
- name: e.name,
725
- displayName: a,
726
- values: i.map((t) => e.values[t]),
727
- colors: i.map((e) => s(e)),
728
- maxValue: he,
729
- minValue: J,
730
- formatter: G,
731
- selected: t,
732
- onToggle: ae,
733
- size: V
734
- }, String(e.name)) : /* @__PURE__ */ m(y, {
735
- name: e.name,
736
- displayName: a,
737
- value: e.values[0] ?? 0,
738
- maxValue: he,
739
- minValue: J,
740
- color: s(0),
741
- formatter: G,
742
- selected: t,
743
- onToggle: ae,
744
- size: V
745
- }, String(e.name));
746
- }), t[34] = de, t[35] = n.length, t[36] = fe, t[37] = G, t[38] = q, t[39] = Me, t[40] = te, t[41] = X, t[42] = o, t[43] = xe, t[44] = B, t[45] = he, t[46] = J, t[47] = ve, t[48] = Y, t[49] = re, t[50] = d, t[51] = Oe, t[52] = V, t[53] = H, t[54] = ae, t[55] = ge, t[56] = Ne, t[57] = Pe, t[58] = Fe, t[59] = Z, t[60] = Ie, t[61] = Q, t[62] = $, t[63] = Le, t[64] = Re;
747
- } else Ne = t[56], Pe = t[57], Fe = t[58], Z = t[59], Ie = t[60], Q = t[61], $ = t[62], Le = t[63], Re = t[64];
748
- let ze;
749
- t[70] !== Z || t[71] !== _?.other || t[72] !== _?.otherCount || t[73] !== _?.showAll || t[74] !== v ? (ze = Z > 0 && /* @__PURE__ */ m(w, {
750
- hiddenCount: Z,
751
- otherLabel: _?.other,
752
- otherCountLabel: _?.otherCount,
753
- showAllLabel: _?.showAll,
754
- onShowAll: v
755
- }), t[70] = Z, t[71] = _?.other, t[72] = _?.otherCount, t[73] = _?.showAll, t[74] = v, t[75] = ze) : ze = t[75];
756
- let Be;
757
- t[76] !== Ne || t[77] !== Ie || t[78] !== Q || t[79] !== $ || t[80] !== Le || t[81] !== ze ? (Be = /* @__PURE__ */ h(Ne, {
758
- ref: Ie,
759
- sx: Q,
760
- style: $,
761
- children: [Le, ze]
762
- }), t[76] = Ne, t[77] = Ie, t[78] = Q, t[79] = $, t[80] = Le, t[81] = ze, t[82] = Be) : Be = t[82];
763
- let Ve;
764
- t[83] !== de || t[84] !== Fe || t[85] !== X || t[86] !== d || t[87] !== Ae ? (Ve = Fe && d && /* @__PURE__ */ m(E, {
765
- series: d,
766
- colorAt: (e) => de(e),
767
- hiddenSeries: X,
768
- onToggle: Ae
769
- }), t[83] = de, t[84] = Fe, t[85] = X, t[86] = d, t[87] = Ae, t[88] = Ve) : Ve = t[88];
770
- let He;
771
- return t[89] !== Pe || t[90] !== Re || t[91] !== Be || t[92] !== Ve ? (He = /* @__PURE__ */ h(Pe, {
772
- sx: Re,
773
- children: [Be, Ve]
774
- }), t[89] = Pe, t[90] = Re, t[91] = Be, t[92] = Ve, t[93] = He) : He = t[93], He;
775
- }
776
- function P(e, t) {
777
- return t;
778
- }
779
- function F(e) {
780
- return e.name;
781
- }
782
- function I() {
783
- return /* @__PURE__ */ new Set();
784
- }
785
- function L(e) {
786
- return String(e);
787
- }
788
- //#endregion
789
- //#region src/widgets-v2/category/category.tsx
790
- var R = (e) => ({
791
- data: e.data ?? [],
792
- rawData: e.rawData ?? void 0,
793
- formatter: e.formatter,
794
- labelFormatter: e.labelFormatter
795
- }), z = /* @__PURE__ */ new Set();
796
- function B(e) {
797
- let t = 0, n = 0;
798
- for (let r of e ?? []) for (let e of r) e.value < t && (t = e.value), e.value > n && (n = e.value);
799
- return [t, n];
800
- }
801
- function V(e) {
802
- let a = s(23), { selection: o, onSelectionChange: c, series: l, maxItems: u, labels: d, onShowAll: f, maxOverride: p, minOverride: h, size: g, stacked: _ } = e, v = r(), y = t(v, R), b;
803
- a[0] === y.rawData ? b = a[1] : (b = B(y.rawData), a[0] = y.rawData, a[1] = b);
804
- let [x, S] = b, C = S > 0 ? p ?? S : void 0, w = x < 0 ? h ?? x : void 0, T;
805
- a[2] === l ? T = a[3] : (T = JSON.stringify(l?.map(U) ?? []), a[2] = l, a[3] = T);
806
- let E = T, D = n(v, H), O = D?.key === E ? D.indices : z, k;
807
- a[4] !== v || a[5] !== E ? (k = (e) => i(v).setState({ categoryHiddenSeries: {
808
- key: E,
809
- indices: e
810
- } }), a[4] = v, a[5] = E, a[6] = k) : k = a[6];
811
- let A = k, j;
812
- return a[7] !== C || a[8] !== w || a[9] !== O || a[10] !== d || a[11] !== u || a[12] !== A || a[13] !== c || a[14] !== f || a[15] !== o || a[16] !== l || a[17] !== g || a[18] !== y.data || a[19] !== y.formatter || a[20] !== y.labelFormatter || a[21] !== _ ? (j = /* @__PURE__ */ m(N, {
813
- data: y.data,
814
- formatter: y.formatter,
815
- labelFormatter: y.labelFormatter,
816
- selection: o,
817
- onSelectionChange: c,
818
- series: l,
819
- maxItems: u,
820
- labels: d,
821
- onShowAll: f,
822
- maxOverride: C,
823
- minOverride: w,
824
- size: g,
825
- stacked: _,
826
- hiddenSeries: O,
827
- onHiddenSeriesChange: A
828
- }), a[7] = C, a[8] = w, a[9] = O, a[10] = d, a[11] = u, a[12] = A, a[13] = c, a[14] = f, a[15] = o, a[16] = l, a[17] = g, a[18] = y.data, a[19] = y.formatter, a[20] = y.labelFormatter, a[21] = _, a[22] = j) : j = a[22], j;
829
- }
830
- function H(e) {
831
- return e.categoryHiddenSeries;
832
- }
833
- function U(e) {
834
- return e.name;
835
- }
836
- //#endregion
837
- //#region src/widgets-v2/category/skeleton.tsx
838
- var W = {
839
- root: {
840
- display: "flex",
841
- flexDirection: "column",
842
- gap: 1,
843
- py: .5
844
- },
845
- row: {
846
- display: "flex",
847
- flexDirection: "column",
848
- gap: .5
849
- },
850
- rowHeader: {
851
- display: "flex",
852
- justifyContent: "space-between",
853
- alignItems: "center",
854
- gap: 1
855
- },
856
- name: {
857
- height: 14,
858
- width: 80
859
- },
860
- value: {
861
- height: 14,
862
- width: 48
863
- }
864
- }, ee = {
865
- small: 4,
866
- medium: 12
867
- }, G = [
868
- "95%",
869
- "80%",
870
- "55%",
871
- "75%",
872
- "60%"
873
- ];
874
- function te(e) {
875
- let t = s(5), { rows: n, size: r } = e, i = n === void 0 ? 5 : n, a = r === void 0 ? "small" : r, o;
876
- t[0] === i ? o = t[1] : (o = Array.from({ length: i }), t[0] = i, t[1] = o);
877
- let c;
878
- return t[2] !== a || t[3] !== o ? (c = /* @__PURE__ */ m(u, {
879
- sx: W.root,
880
- children: o.map((e, t) => /* @__PURE__ */ h(u, {
881
- sx: W.row,
882
- children: [/* @__PURE__ */ h(u, {
883
- sx: W.rowHeader,
884
- children: [/* @__PURE__ */ m(d, {
885
- variant: "rectangular",
886
- sx: W.name
887
- }), /* @__PURE__ */ m(d, {
888
- variant: "rectangular",
889
- sx: W.value
890
- })]
891
- }), /* @__PURE__ */ m(d, {
892
- variant: "rectangular",
893
- sx: {
894
- height: ee[a],
895
- width: G[t % G.length]
896
- }
897
- })]
898
- }, `row-${t}`))
899
- }), t[2] = a, t[3] = o, t[4] = c) : c = t[4], c;
900
- }
901
- //#endregion
902
- //#region src/widgets-v2/category/download.ts
903
- function K(e) {
904
- let t = [];
905
- return e.getCaptureEl && t.push(a({
906
- filename: e.filename,
907
- getCaptureEl: e.getCaptureEl,
908
- pixelRatio: e.pngPixelRatio,
909
- backgroundColor: e.pngBackgroundColor
910
- })), t.push(o({
911
- filename: e.filename,
912
- getRows: (t) => {
913
- let n = e.getData(t), r = [[
914
- "series",
915
- "name",
916
- "value"
917
- ]];
918
- for (let [t, i] of n.entries()) {
919
- let n = e.seriesNames?.[t] ?? `series_${t + 1}`;
920
- for (let e of i) r.push([
921
- n,
922
- e.name,
923
- e.value
924
- ]);
925
- }
926
- return r;
927
- }
928
- })), t;
929
- }
930
- //#endregion
931
- export { E as a, y as c, N as i, _ as l, te as n, w as o, V as r, b as s, K as t };
932
-
933
- //# sourceMappingURL=category-DuKx_CJX.js.map