@carto/ps-react-ui 5.0.0-widgets.10 → 5.0.0-widgets.12
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/types/widgets/actions/lock-selection/types.d.ts +0 -2
- package/dist/types/widgets/category/style.d.ts +0 -1
- package/dist/widgets/actions.js +417 -420
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/category.js +233 -273
- package/dist/widgets/category.js.map +1 -1
- package/dist/widgets/wrapper.js.map +1 -1
- package/package.json +1 -1
package/dist/widgets/category.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
1
|
+
import { jsx as h, jsxs as S } from "react/jsx-runtime";
|
|
2
2
|
import { c as M } from "react/compiler-runtime";
|
|
3
|
-
import { Box as
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { Box as b, Typography as D, useTheme as N, Skeleton as H } from "@mui/material";
|
|
4
|
+
import { u as U } from "../widget-store-CB6Trp_0.js";
|
|
5
|
+
import { useShallow as z } from "zustand/shallow";
|
|
6
|
+
import { useState as J } from "react";
|
|
7
7
|
import "@mui/icons-material";
|
|
8
8
|
import "react-markdown";
|
|
9
|
-
import { d as
|
|
9
|
+
import { d as E, a as q } from "../exports-Cr43OCul.js";
|
|
10
10
|
import "../lasso-tool-CYn3ivf-.js";
|
|
11
11
|
import "../cjs-D9ro6BXv.js";
|
|
12
12
|
import "@dnd-kit/core";
|
|
13
13
|
import "@dnd-kit/sortable";
|
|
14
14
|
import "@dnd-kit/utilities";
|
|
15
|
-
const
|
|
15
|
+
const d = {
|
|
16
16
|
root: {
|
|
17
17
|
display: "flex",
|
|
18
18
|
flexDirection: "column",
|
|
19
|
-
position: "relative"
|
|
20
|
-
overflow: "auto"
|
|
19
|
+
position: "relative"
|
|
21
20
|
},
|
|
22
21
|
list: {
|
|
23
22
|
display: "flex",
|
|
@@ -143,310 +142,271 @@ const u = {
|
|
|
143
142
|
color: "text.disabled"
|
|
144
143
|
}
|
|
145
144
|
};
|
|
146
|
-
function
|
|
145
|
+
function G(t) {
|
|
147
146
|
const e = M(6), {
|
|
148
|
-
value:
|
|
149
|
-
maxValue:
|
|
150
|
-
color:
|
|
151
|
-
selected:
|
|
152
|
-
} = t,
|
|
153
|
-
let
|
|
154
|
-
e[0] !==
|
|
155
|
-
...
|
|
156
|
-
width: `${
|
|
157
|
-
backgroundColor:
|
|
147
|
+
value: o,
|
|
148
|
+
maxValue: i,
|
|
149
|
+
color: l,
|
|
150
|
+
selected: a
|
|
151
|
+
} = t, s = a === void 0 ? !0 : a, r = i > 0 ? o / i * 100 : 0;
|
|
152
|
+
let u;
|
|
153
|
+
e[0] !== l || e[1] !== r || e[2] !== s ? (u = s ? {
|
|
154
|
+
...d.barFill,
|
|
155
|
+
width: `${r}%`,
|
|
156
|
+
backgroundColor: l
|
|
158
157
|
} : {
|
|
159
|
-
...
|
|
160
|
-
...
|
|
161
|
-
width: `${
|
|
162
|
-
}, e[0] =
|
|
163
|
-
const
|
|
164
|
-
let
|
|
165
|
-
return e[4] !==
|
|
158
|
+
...d.barFill,
|
|
159
|
+
...d.barFillMuted,
|
|
160
|
+
width: `${r}%`
|
|
161
|
+
}, e[0] = l, e[1] = r, e[2] = s, e[3] = u) : u = e[3];
|
|
162
|
+
const n = u;
|
|
163
|
+
let c;
|
|
164
|
+
return e[4] !== n ? (c = /* @__PURE__ */ h(b, { sx: d.bar, children: /* @__PURE__ */ h(b, { sx: n }) }), e[4] = n, e[5] = c) : c = e[5], c;
|
|
166
165
|
}
|
|
167
|
-
function
|
|
166
|
+
function K(t) {
|
|
168
167
|
const e = M(23), {
|
|
169
|
-
name:
|
|
170
|
-
value:
|
|
171
|
-
maxValue:
|
|
172
|
-
color:
|
|
173
|
-
formatter:
|
|
174
|
-
onClick:
|
|
175
|
-
selected:
|
|
176
|
-
} = t,
|
|
177
|
-
let
|
|
178
|
-
e[0] !==
|
|
179
|
-
name:
|
|
180
|
-
}) : void 0, e[0] =
|
|
181
|
-
const
|
|
168
|
+
name: o,
|
|
169
|
+
value: i,
|
|
170
|
+
maxValue: l,
|
|
171
|
+
color: a,
|
|
172
|
+
formatter: s,
|
|
173
|
+
onClick: r,
|
|
174
|
+
selected: u
|
|
175
|
+
} = t, n = u === void 0 ? !0 : u;
|
|
176
|
+
let c;
|
|
177
|
+
e[0] !== o || e[1] !== r ? (c = r ? () => r({
|
|
178
|
+
name: o
|
|
179
|
+
}) : void 0, e[0] = o, e[1] = r, e[2] = c) : c = e[2];
|
|
180
|
+
const m = c, x = r ? d.rowClickable : d.row;
|
|
181
|
+
let y;
|
|
182
|
+
e[3] !== o ? (y = /* @__PURE__ */ h(D, { sx: d.rowLabel, children: o }), e[3] = o, e[4] = y) : y = e[4];
|
|
183
|
+
let f;
|
|
184
|
+
e[5] !== s || e[6] !== i ? (f = s(i), e[5] = s, e[6] = i, e[7] = f) : f = e[7];
|
|
185
|
+
let C;
|
|
186
|
+
e[8] !== f ? (C = /* @__PURE__ */ h(D, { sx: d.rowValue, children: f }), e[8] = f, e[9] = C) : C = e[9];
|
|
182
187
|
let g;
|
|
183
|
-
e[
|
|
188
|
+
e[10] !== y || e[11] !== C ? (g = /* @__PURE__ */ S(b, { sx: d.rowHeader, children: [
|
|
189
|
+
y,
|
|
190
|
+
C
|
|
191
|
+
] }), e[10] = y, e[11] = C, e[12] = g) : g = e[12];
|
|
192
|
+
let p;
|
|
193
|
+
e[13] !== a || e[14] !== l || e[15] !== n || e[16] !== i ? (p = /* @__PURE__ */ h(G, { value: i, maxValue: l, color: a, selected: n }), e[13] = a, e[14] = l, e[15] = n, e[16] = i, e[17] = p) : p = e[17];
|
|
184
194
|
let w;
|
|
185
|
-
e[
|
|
186
|
-
let x;
|
|
187
|
-
e[8] !== w ? (x = /* @__PURE__ */ h(L, { sx: u.rowValue, children: w }), e[8] = w, e[9] = x) : x = e[9];
|
|
188
|
-
let b;
|
|
189
|
-
e[10] !== g || e[11] !== x ? (b = /* @__PURE__ */ R(C, { sx: u.rowHeader, children: [
|
|
195
|
+
return e[18] !== m || e[19] !== x || e[20] !== g || e[21] !== p ? (w = /* @__PURE__ */ S(b, { sx: x, onClick: m, children: [
|
|
190
196
|
g,
|
|
191
|
-
|
|
192
|
-
] }), e[
|
|
193
|
-
let k;
|
|
194
|
-
e[13] !== n || e[14] !== i || e[15] !== l || e[16] !== o ? (k = /* @__PURE__ */ h(J, { value: o, maxValue: i, color: n, selected: l }), e[13] = n, e[14] = i, e[15] = l, e[16] = o, e[17] = k) : k = e[17];
|
|
195
|
-
let v;
|
|
196
|
-
return e[18] !== f || e[19] !== y || e[20] !== b || e[21] !== k ? (v = /* @__PURE__ */ R(C, { sx: y, onClick: f, children: [
|
|
197
|
-
b,
|
|
198
|
-
k
|
|
199
|
-
] }), e[18] = f, e[19] = y, e[20] = b, e[21] = k, e[22] = v) : v = e[22], v;
|
|
197
|
+
p
|
|
198
|
+
] }), e[18] = m, e[19] = x, e[20] = g, e[21] = p, e[22] = w) : w = e[22], w;
|
|
200
199
|
}
|
|
201
|
-
function
|
|
200
|
+
function Q(t) {
|
|
202
201
|
const e = M(25), {
|
|
203
|
-
name:
|
|
204
|
-
values:
|
|
205
|
-
maxValue:
|
|
206
|
-
colors:
|
|
207
|
-
formatter:
|
|
208
|
-
onClick:
|
|
209
|
-
selected:
|
|
210
|
-
} = t,
|
|
211
|
-
let
|
|
212
|
-
e[0] !==
|
|
213
|
-
name:
|
|
214
|
-
}) : void 0, e[0] =
|
|
215
|
-
const
|
|
216
|
-
let
|
|
217
|
-
e[3] !==
|
|
218
|
-
let
|
|
219
|
-
if (e[5] !==
|
|
220
|
-
let
|
|
221
|
-
e[12] !==
|
|
222
|
-
/* @__PURE__ */ h(
|
|
223
|
-
/* @__PURE__ */ h(
|
|
224
|
-
] }, `${
|
|
202
|
+
name: o,
|
|
203
|
+
values: i,
|
|
204
|
+
maxValue: l,
|
|
205
|
+
colors: a,
|
|
206
|
+
formatter: s,
|
|
207
|
+
onClick: r,
|
|
208
|
+
selected: u
|
|
209
|
+
} = t, n = u === void 0 ? !0 : u;
|
|
210
|
+
let c;
|
|
211
|
+
e[0] !== o || e[1] !== r ? (c = r ? () => r({
|
|
212
|
+
name: o
|
|
213
|
+
}) : void 0, e[0] = o, e[1] = r, e[2] = c) : c = e[2];
|
|
214
|
+
const m = c, x = r ? d.rowClickable : d.row;
|
|
215
|
+
let y;
|
|
216
|
+
e[3] !== o ? (y = /* @__PURE__ */ h(D, { sx: d.rowLabel, children: o }), e[3] = o, e[4] = y) : y = e[4];
|
|
217
|
+
let f;
|
|
218
|
+
if (e[5] !== a || e[6] !== s || e[7] !== l || e[8] !== o || e[9] !== n || e[10] !== i) {
|
|
219
|
+
let p;
|
|
220
|
+
e[12] !== a || e[13] !== s || e[14] !== l || e[15] !== o || e[16] !== n ? (p = (w, k) => /* @__PURE__ */ S(b, { sx: d.multiBarRow, children: [
|
|
221
|
+
/* @__PURE__ */ h(b, { sx: d.multiBarContainer, children: /* @__PURE__ */ h(G, { value: w, maxValue: l, color: a[k % a.length] ?? "", selected: n }) }),
|
|
222
|
+
/* @__PURE__ */ h(D, { sx: d.multiBarValue, children: s(w) })
|
|
223
|
+
] }, `${o}-${w}-${k}`), e[12] = a, e[13] = s, e[14] = l, e[15] = o, e[16] = n, e[17] = p) : p = e[17], f = i.map(p), e[5] = a, e[6] = s, e[7] = l, e[8] = o, e[9] = n, e[10] = i, e[11] = f;
|
|
225
224
|
} else
|
|
226
|
-
|
|
227
|
-
let
|
|
228
|
-
e[18] !==
|
|
229
|
-
let
|
|
230
|
-
return e[20] !==
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
] }), e[20] =
|
|
225
|
+
f = e[11];
|
|
226
|
+
let C;
|
|
227
|
+
e[18] !== f ? (C = /* @__PURE__ */ h(b, { sx: d.barContainer, children: f }), e[18] = f, e[19] = C) : C = e[19];
|
|
228
|
+
let g;
|
|
229
|
+
return e[20] !== m || e[21] !== x || e[22] !== y || e[23] !== C ? (g = /* @__PURE__ */ S(b, { sx: x, onClick: m, children: [
|
|
230
|
+
y,
|
|
231
|
+
C
|
|
232
|
+
] }), e[20] = m, e[21] = x, e[22] = y, e[23] = C, e[24] = g) : g = e[24], g;
|
|
234
233
|
}
|
|
235
|
-
function
|
|
234
|
+
function X(t) {
|
|
236
235
|
const e = M(10), {
|
|
237
|
-
hiddenCount:
|
|
238
|
-
otherLabel:
|
|
239
|
-
otherCountLabel:
|
|
240
|
-
} = t,
|
|
241
|
-
let
|
|
242
|
-
e[0] !==
|
|
243
|
-
const
|
|
244
|
-
let
|
|
245
|
-
e[3] !==
|
|
246
|
-
let
|
|
247
|
-
e[5] !==
|
|
236
|
+
hiddenCount: o,
|
|
237
|
+
otherLabel: i,
|
|
238
|
+
otherCountLabel: l
|
|
239
|
+
} = t, a = i === void 0 ? "Other" : i, s = l === void 0 ? "{count} more" : l;
|
|
240
|
+
let r;
|
|
241
|
+
e[0] !== o || e[1] !== s ? (r = s.replace("{count}", String(o)), e[0] = o, e[1] = s, e[2] = r) : r = e[2];
|
|
242
|
+
const u = r;
|
|
243
|
+
let n;
|
|
244
|
+
e[3] !== a ? (n = /* @__PURE__ */ h(D, { sx: d.otherLabel, children: a }), e[3] = a, e[4] = n) : n = e[4];
|
|
245
|
+
let c;
|
|
246
|
+
e[5] !== u ? (c = /* @__PURE__ */ S(D, { sx: d.otherCount, children: [
|
|
248
247
|
"(",
|
|
249
|
-
|
|
248
|
+
u,
|
|
250
249
|
")"
|
|
251
|
-
] }), e[5] =
|
|
252
|
-
let
|
|
253
|
-
return e[7] !==
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
] }), e[7] =
|
|
250
|
+
] }), e[5] = u, e[6] = c) : c = e[6];
|
|
251
|
+
let m;
|
|
252
|
+
return e[7] !== n || e[8] !== c ? (m = /* @__PURE__ */ S(b, { sx: d.otherRow, children: [
|
|
253
|
+
n,
|
|
254
|
+
c
|
|
255
|
+
] }), e[7] = n, e[8] = c, e[9] = m) : m = e[9], m;
|
|
257
256
|
}
|
|
258
|
-
function
|
|
257
|
+
function Y(t) {
|
|
259
258
|
const e = M(7), {
|
|
260
|
-
series:
|
|
261
|
-
colors:
|
|
259
|
+
series: o,
|
|
260
|
+
colors: i
|
|
262
261
|
} = t;
|
|
263
|
-
if (
|
|
262
|
+
if (o.length === 0)
|
|
264
263
|
return null;
|
|
265
|
-
let
|
|
266
|
-
if (e[0] !==
|
|
267
|
-
let
|
|
268
|
-
e[3] !==
|
|
269
|
-
/* @__PURE__ */ h(
|
|
270
|
-
...
|
|
271
|
-
backgroundColor:
|
|
264
|
+
let l;
|
|
265
|
+
if (e[0] !== i || e[1] !== o) {
|
|
266
|
+
let s;
|
|
267
|
+
e[3] !== i ? (s = (r, u) => /* @__PURE__ */ S(b, { sx: d.legendItem, children: [
|
|
268
|
+
/* @__PURE__ */ h(b, { sx: {
|
|
269
|
+
...d.legendDot,
|
|
270
|
+
backgroundColor: r.color ?? i[u % i.length]
|
|
272
271
|
} }),
|
|
273
|
-
/* @__PURE__ */ h(
|
|
274
|
-
] },
|
|
272
|
+
/* @__PURE__ */ h(D, { sx: d.legendLabel, children: r.name })
|
|
273
|
+
] }, r.name), e[3] = i, e[4] = s) : s = e[4], l = o.map(s), e[0] = i, e[1] = o, e[2] = l;
|
|
275
274
|
} else
|
|
276
|
-
|
|
277
|
-
let
|
|
278
|
-
return e[5] !==
|
|
275
|
+
l = e[2];
|
|
276
|
+
let a;
|
|
277
|
+
return e[5] !== l ? (a = /* @__PURE__ */ h(b, { sx: d.legend, children: l }), e[5] = l, e[6] = a) : a = e[6], a;
|
|
279
278
|
}
|
|
280
|
-
const
|
|
281
|
-
function
|
|
282
|
-
const e = M(
|
|
283
|
-
id:
|
|
284
|
-
} = t,
|
|
285
|
-
let
|
|
286
|
-
e[0] !==
|
|
287
|
-
const
|
|
279
|
+
const Z = (t) => t.toString();
|
|
280
|
+
function ye(t) {
|
|
281
|
+
const e = M(42), {
|
|
282
|
+
id: o
|
|
283
|
+
} = t, i = N();
|
|
284
|
+
let l;
|
|
285
|
+
e[0] !== o ? (l = ($) => {
|
|
286
|
+
const v = $.getWidget(o);
|
|
288
287
|
return {
|
|
289
|
-
formatter:
|
|
290
|
-
series:
|
|
291
|
-
data:
|
|
292
|
-
maxItems:
|
|
293
|
-
labels:
|
|
294
|
-
onRowClick:
|
|
295
|
-
selected:
|
|
296
|
-
max:
|
|
288
|
+
formatter: v?.formatter,
|
|
289
|
+
series: v?.series,
|
|
290
|
+
data: v?.data,
|
|
291
|
+
maxItems: v?.maxItems,
|
|
292
|
+
labels: v?.labels,
|
|
293
|
+
onRowClick: v?.onRowClick,
|
|
294
|
+
selected: v?.selected,
|
|
295
|
+
max: v?.max
|
|
297
296
|
};
|
|
298
|
-
}, e[0] =
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
let p;
|
|
311
|
-
if (e[6] !== b || e[7] !== d || e[8] !== o.palette.primary.main) {
|
|
312
|
-
let $;
|
|
313
|
-
e[10] !== b || e[11] !== o.palette.primary.main ? ($ = (_, S) => _.color ?? b[S % b.length] ?? o.palette.primary.main, e[10] = b, e[11] = o.palette.primary.main, e[12] = $) : $ = e[12], p = d.map($), e[6] = b, e[7] = d, e[8] = o.palette.primary.main, e[9] = p;
|
|
314
|
-
} else
|
|
315
|
-
p = e[9];
|
|
316
|
-
k = p;
|
|
317
|
-
break e;
|
|
318
|
-
}
|
|
319
|
-
let s;
|
|
320
|
-
e[13] !== o.palette.primary.main ? (s = [o.palette.primary.main], e[13] = o.palette.primary.main, e[14] = s) : s = e[14], k = s;
|
|
321
|
-
}
|
|
322
|
-
const v = k;
|
|
323
|
-
let D;
|
|
324
|
-
e: {
|
|
325
|
-
if (!l || l.length === 0) {
|
|
326
|
-
let $;
|
|
327
|
-
e[15] === Symbol.for("react.memo_cache_sentinel") ? ($ = [], e[15] = $) : $ = e[15], D = $;
|
|
328
|
-
break e;
|
|
329
|
-
}
|
|
330
|
-
const s = Math.max(l.length, 1);
|
|
331
|
-
let p;
|
|
332
|
-
if (e[16] !== l || e[17] !== s) {
|
|
333
|
-
const $ = /* @__PURE__ */ new Map(), _ = [];
|
|
334
|
-
for (let S = 0; S < l.length; S++) {
|
|
335
|
-
const K = l[S];
|
|
336
|
-
for (const E of K) {
|
|
337
|
-
let P = $.get(E.name);
|
|
338
|
-
P || (P = new Array(s).fill(0), $.set(E.name, P), _.push(E.name)), P[S] = E.value;
|
|
339
|
-
}
|
|
297
|
+
}, e[0] = o, e[1] = l) : l = e[1];
|
|
298
|
+
const a = U(z(l)), s = a?.formatter ?? Z, r = a?.series ?? [], u = a?.data, n = a?.maxItems, c = a?.labels, m = a?.onRowClick, x = a?.selected, y = a?.max, [f] = J(n ? 40 * (r.length || 1) * n : void 0), C = Object.values(i.palette.qualitative.bold), g = r.length > 0 ? r.map(($, v) => $.color ?? C[v % C.length] ?? i.palette.primary.main) : [i.palette.primary.main];
|
|
299
|
+
let p, w, k, T, R, V, L, B;
|
|
300
|
+
if (e[2] !== g || e[3] !== u || e[4] !== s || e[5] !== y || e[6] !== f || e[7] !== n || e[8] !== m || e[9] !== x || e[10] !== r || e[11] !== i.palette.primary) {
|
|
301
|
+
B = Symbol.for("react.early_return_sentinel");
|
|
302
|
+
e: {
|
|
303
|
+
const $ = te({
|
|
304
|
+
data: u
|
|
305
|
+
});
|
|
306
|
+
if ($.length === 0) {
|
|
307
|
+
B = null;
|
|
308
|
+
break e;
|
|
340
309
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if (w !== void 0) {
|
|
353
|
-
j = w;
|
|
354
|
-
break e;
|
|
355
|
-
}
|
|
356
|
-
if (I.length === 0) {
|
|
357
|
-
j = 0;
|
|
358
|
-
break e;
|
|
359
|
-
}
|
|
360
|
-
let s;
|
|
361
|
-
e[19] !== I ? (s = I.flatMap(re), e[19] = I, e[20] = s) : s = e[20], j = Math.max(...s);
|
|
362
|
-
}
|
|
363
|
-
const A = j;
|
|
364
|
-
let O;
|
|
365
|
-
e: {
|
|
366
|
-
if (m === void 0) {
|
|
367
|
-
O = I;
|
|
368
|
-
break e;
|
|
310
|
+
const v = y ?? Math.max(...$.flatMap(ee)), A = n !== void 0 && n >= 0 ? $.slice(0, n) : $;
|
|
311
|
+
k = $.length - A.length;
|
|
312
|
+
const P = r.length > 1;
|
|
313
|
+
w = b, e[20] === Symbol.for("react.memo_cache_sentinel") ? (L = {
|
|
314
|
+
...d.root
|
|
315
|
+
}, e[20] = L) : L = e[20], p = b, T = d.list;
|
|
316
|
+
const O = k === 0 ? "auto" : "hidden";
|
|
317
|
+
e[21] !== f || e[22] !== O ? (R = {
|
|
318
|
+
maxHeight: f,
|
|
319
|
+
overflow: O
|
|
320
|
+
}, e[21] = f, e[22] = O, e[23] = R) : R = e[23], V = P ? A.map((I) => /* @__PURE__ */ h(Q, { name: I.name, values: I.values, maxValue: v, colors: g, formatter: s, onClick: m, selected: x?.(I.name) ?? !0 }, I.name)) : A.map((I) => /* @__PURE__ */ h(K, { name: I.name, value: I.values[0] ?? 0, selected: x?.(I.name) ?? !0, maxValue: v, color: g[0] ?? i.palette.primary.main, formatter: s, onClick: m }, I.name));
|
|
369
321
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
let p;
|
|
376
|
-
e[21] !== I || e[22] !== s ? (p = I.slice(0, s), e[21] = I, e[22] = s, e[23] = p) : p = e[23], O = p;
|
|
377
|
-
}
|
|
378
|
-
const W = O, q = I.length - W.length;
|
|
379
|
-
if (I.length === 0)
|
|
380
|
-
return null;
|
|
381
|
-
const G = d.length > 1;
|
|
382
|
-
let V;
|
|
383
|
-
e[24] !== v || e[25] !== c || e[26] !== G || e[27] !== A || e[28] !== y || e[29] !== g || e[30] !== o || e[31] !== W ? (V = G ? W.map((s) => /* @__PURE__ */ h(ee, { name: s.name, values: s.values, maxValue: A, colors: v, formatter: c, onClick: y, selected: g?.(s.name) ?? !0 }, s.name)) : W.map((s) => /* @__PURE__ */ h(Z, { name: s.name, value: s.values[0] ?? 0, selected: g?.(s.name) ?? !0, maxValue: A, color: v[0] ?? o.palette.primary.main, formatter: c, onClick: y }, s.name)), e[24] = v, e[25] = c, e[26] = G, e[27] = A, e[28] = y, e[29] = g, e[30] = o, e[31] = W, e[32] = V) : V = e[32];
|
|
384
|
-
let B;
|
|
385
|
-
e[33] !== q || e[34] !== f?.other || e[35] !== f?.otherCount ? (B = q > 0 && /* @__PURE__ */ h(te, { hiddenCount: q, otherLabel: f?.other, otherCountLabel: f?.otherCount }), e[33] = q, e[34] = f?.other, e[35] = f?.otherCount, e[36] = B) : B = e[36];
|
|
386
|
-
let T;
|
|
387
|
-
e[37] !== V || e[38] !== B ? (T = /* @__PURE__ */ R(C, { sx: u.list, children: [
|
|
388
|
-
V,
|
|
389
|
-
B
|
|
390
|
-
] }), e[37] = V, e[38] = B, e[39] = T) : T = e[39];
|
|
322
|
+
e[2] = g, e[3] = u, e[4] = s, e[5] = y, e[6] = f, e[7] = n, e[8] = m, e[9] = x, e[10] = r, e[11] = i.palette.primary, e[12] = p, e[13] = w, e[14] = k, e[15] = T, e[16] = R, e[17] = V, e[18] = L, e[19] = B;
|
|
323
|
+
} else
|
|
324
|
+
p = e[12], w = e[13], k = e[14], T = e[15], R = e[16], V = e[17], L = e[18], B = e[19];
|
|
325
|
+
if (B !== Symbol.for("react.early_return_sentinel"))
|
|
326
|
+
return B;
|
|
391
327
|
let F;
|
|
392
|
-
e[
|
|
393
|
-
let
|
|
394
|
-
|
|
395
|
-
|
|
328
|
+
e[24] !== k || e[25] !== c?.other || e[26] !== c?.otherCount ? (F = k > 0 && /* @__PURE__ */ h(X, { hiddenCount: k, otherLabel: c?.other, otherCountLabel: c?.otherCount }), e[24] = k, e[25] = c?.other, e[26] = c?.otherCount, e[27] = F) : F = e[27];
|
|
329
|
+
let W;
|
|
330
|
+
e[28] !== p || e[29] !== T || e[30] !== R || e[31] !== V || e[32] !== F ? (W = /* @__PURE__ */ S(p, { sx: T, style: R, children: [
|
|
331
|
+
V,
|
|
396
332
|
F
|
|
397
|
-
] }), e[
|
|
333
|
+
] }), e[28] = p, e[29] = T, e[30] = R, e[31] = V, e[32] = F, e[33] = W) : W = e[33];
|
|
334
|
+
let _;
|
|
335
|
+
e[34] !== g || e[35] !== r ? (_ = r.length > 0 && /* @__PURE__ */ h(Y, { series: r, colors: g }), e[34] = g, e[35] = r, e[36] = _) : _ = e[36];
|
|
336
|
+
let j;
|
|
337
|
+
return e[37] !== w || e[38] !== L || e[39] !== W || e[40] !== _ ? (j = /* @__PURE__ */ S(w, { sx: L, children: [
|
|
338
|
+
W,
|
|
339
|
+
_
|
|
340
|
+
] }), e[37] = w, e[38] = L, e[39] = W, e[40] = _, e[41] = j) : j = e[41], j;
|
|
398
341
|
}
|
|
399
|
-
function
|
|
342
|
+
function ee(t) {
|
|
400
343
|
return t.values;
|
|
401
344
|
}
|
|
402
|
-
|
|
403
|
-
|
|
345
|
+
function te({
|
|
346
|
+
data: t
|
|
347
|
+
}) {
|
|
348
|
+
if (!t || t.length === 0) return [];
|
|
349
|
+
const e = Math.max(t.length, 1), o = /* @__PURE__ */ new Map(), i = [];
|
|
350
|
+
for (let l = 0; l < t.length; l++) {
|
|
351
|
+
const a = t[l];
|
|
352
|
+
for (const s of a) {
|
|
353
|
+
let r = o.get(s.name);
|
|
354
|
+
r || (r = new Array(e).fill(0), o.set(s.name, r), i.push(s.name)), r[l] = s.value;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return i.map((l) => ({
|
|
358
|
+
name: l,
|
|
359
|
+
values: o.get(l)
|
|
360
|
+
}));
|
|
361
|
+
}
|
|
362
|
+
const oe = [85, 70, 55, 75, 60];
|
|
363
|
+
function be() {
|
|
404
364
|
const t = M(1);
|
|
405
365
|
let e;
|
|
406
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ h(
|
|
366
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ h(b, { sx: d.list, "aria-label": "Category skeleton", children: Array.from({
|
|
407
367
|
length: 5
|
|
408
|
-
}).map(
|
|
368
|
+
}).map(re) }), t[0] = e) : e = t[0], e;
|
|
409
369
|
}
|
|
410
|
-
function
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */ h(
|
|
414
|
-
/* @__PURE__ */ h(
|
|
370
|
+
function re(t, e) {
|
|
371
|
+
return /* @__PURE__ */ S(b, { sx: d.row, children: [
|
|
372
|
+
/* @__PURE__ */ S(b, { sx: d.rowHeader, children: [
|
|
373
|
+
/* @__PURE__ */ h(H, { width: 80, height: 16 }),
|
|
374
|
+
/* @__PURE__ */ h(H, { width: 40, height: 16 })
|
|
415
375
|
] }),
|
|
416
|
-
/* @__PURE__ */ h(
|
|
376
|
+
/* @__PURE__ */ h(H, { variant: "rectangular", height: 4, sx: {
|
|
417
377
|
borderRadius: 2,
|
|
418
|
-
width: `${
|
|
378
|
+
width: `${oe[e]}%`
|
|
419
379
|
} })
|
|
420
380
|
] }, e);
|
|
421
381
|
}
|
|
422
|
-
function
|
|
382
|
+
function Ce({
|
|
423
383
|
refUI: t,
|
|
424
384
|
series: e
|
|
425
385
|
}) {
|
|
426
386
|
return [{
|
|
427
|
-
...
|
|
428
|
-
modifier: () =>
|
|
387
|
+
...E,
|
|
388
|
+
modifier: () => E.modifier(t)
|
|
429
389
|
}, {
|
|
430
|
-
...
|
|
431
|
-
modifier: async (
|
|
432
|
-
if (!
|
|
433
|
-
return
|
|
434
|
-
const
|
|
435
|
-
for (let
|
|
436
|
-
const
|
|
437
|
-
for (const
|
|
438
|
-
let
|
|
439
|
-
|
|
390
|
+
...q,
|
|
391
|
+
modifier: async (o) => {
|
|
392
|
+
if (!o?.length || o[0]?.length === 0)
|
|
393
|
+
return q.modifier([]);
|
|
394
|
+
const i = o.length, l = /* @__PURE__ */ new Map(), a = [];
|
|
395
|
+
for (let n = 0; n < i; n++) {
|
|
396
|
+
const c = o[n];
|
|
397
|
+
for (const m of c) {
|
|
398
|
+
let x = l.get(m.name);
|
|
399
|
+
x || (x = new Array(i).fill(0), l.set(m.name, x), a.push(m.name)), x[n] = m.value;
|
|
440
400
|
}
|
|
441
401
|
}
|
|
442
|
-
const
|
|
443
|
-
length:
|
|
444
|
-
}, (
|
|
445
|
-
return
|
|
402
|
+
const s = a.map((n) => [n, ...l.get(n)]), u = i > 1 ? ["Category", ...e?.map((n) => n.name) ?? Array.from({
|
|
403
|
+
length: i
|
|
404
|
+
}, (n, c) => `Series ${c + 1}`)] : ["Category", "Value"];
|
|
405
|
+
return q.modifier([u, ...s]);
|
|
446
406
|
}
|
|
447
407
|
}];
|
|
448
408
|
}
|
|
449
|
-
function
|
|
409
|
+
function we() {
|
|
450
410
|
return {
|
|
451
411
|
series: [],
|
|
452
412
|
maxItems: void 0,
|
|
@@ -454,14 +414,14 @@ function $e() {
|
|
|
454
414
|
};
|
|
455
415
|
}
|
|
456
416
|
export {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
417
|
+
G as CategoryBar,
|
|
418
|
+
Y as CategoryLegend,
|
|
419
|
+
Q as CategoryRowMulti,
|
|
420
|
+
X as CategoryRowOther,
|
|
421
|
+
K as CategoryRowSingle,
|
|
422
|
+
be as CategorySkeleton,
|
|
423
|
+
ye as CategoryUI,
|
|
424
|
+
we as categoryConfig,
|
|
425
|
+
Ce as categoryDownloadConfig
|
|
466
426
|
};
|
|
467
427
|
//# sourceMappingURL=category.js.map
|