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