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