@carto/ps-react-ui 4.4.2 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/download-config-DemuQ3Jm.js +56 -0
- package/dist/download-config-DemuQ3Jm.js.map +1 -0
- package/dist/error-Cj8eUMrl.js +40 -0
- package/dist/error-Cj8eUMrl.js.map +1 -0
- package/dist/formatter-B9Bxn1k7.js +6 -0
- package/dist/formatter-B9Bxn1k7.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/styles-Y8q7Jff3.js +118 -0
- package/dist/styles-Y8q7Jff3.js.map +1 -0
- package/dist/types/widgets/actions/brush-toggle/types.d.ts +8 -2
- package/dist/types/widgets/category/components/category-row-multi.d.ts +2 -1
- package/dist/types/widgets/category/components/category-row-single.d.ts +2 -1
- package/dist/types/widgets/category/types.d.ts +1 -0
- package/dist/types/widgets/echart/shared-resize-observer.d.ts +12 -0
- package/dist/types/widgets/echart/types.d.ts +2 -0
- package/dist/types/widgets/histogram/config.d.ts +15 -3
- package/dist/types/widgets/histogram/index.d.ts +2 -1
- package/dist/types/widgets/histogram/types.d.ts +6 -3
- package/dist/types/widgets/stores/index.d.ts +2 -1
- package/dist/types/widgets/stores/types.d.ts +2 -0
- 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/types/widgets/utils/chart-config/index.d.ts +1 -1
- package/dist/types/widgets/utils/chart-config/option-builders.d.ts +13 -8
- package/dist/types/widgets/utils/formatter.d.ts +1 -0
- package/dist/types/widgets/utils/index.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 +799 -817
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +53 -47
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +261 -255
- 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 +119 -80
- 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 +111 -99
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +146 -144
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/scatterplot.js +50 -44
- package/dist/widgets/scatterplot.js.map +1 -1
- 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 +52 -46
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +101 -6693
- package/dist/widgets/toolbar-actions.js.map +1 -1
- package/dist/widgets/utils.js +16 -14
- package/dist/widgets/utils.js.map +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 +5 -4
- package/src/hooks/use-widget-ref.ts +3 -4
- package/src/widgets/README.md +3 -3
- package/src/widgets/actions/brush-toggle/brush-toggle.tsx +60 -79
- package/src/widgets/actions/brush-toggle/types.ts +8 -2
- 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/bar/config.ts +22 -14
- package/src/widgets/category/category-ui.tsx +31 -27
- package/src/widgets/category/components/category-row-multi.tsx +6 -2
- package/src/widgets/category/components/category-row-single.tsx +5 -1
- package/src/widgets/category/types.ts +1 -0
- 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/echart/types.ts +2 -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/histogram/config.ts +101 -20
- package/src/widgets/histogram/index.ts +6 -1
- package/src/widgets/histogram/types.ts +9 -3
- 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/pie/config.ts +17 -5
- package/src/widgets/range/components/range-item.tsx +20 -18
- package/src/widgets/scatterplot/config.ts +8 -3
- 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/types.ts +2 -0
- 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/timeseries/config.ts +21 -13
- package/src/widgets/utils/chart-config/index.ts +1 -1
- package/src/widgets/utils/chart-config/option-builders.ts +22 -12
- package/src/widgets/utils/formatter.ts +2 -1
- package/src/widgets/utils/index.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/formatter-B1Xh8XDH.js +0 -5
- package/dist/formatter-B1Xh8XDH.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/styles-C_8vOEep.js +0 -167
- package/dist/styles-C_8vOEep.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,19 +1,19 @@
|
|
|
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 Y, a as Q } from "../exports-Cr43OCul.js";
|
|
10
|
+
import { d as P, a as G } from "../exports-Cr43OCul.js";
|
|
11
11
|
import "../lasso-tool-BYbxrJ-7.js";
|
|
12
12
|
import "../cjs-D4KH3azB.js";
|
|
13
13
|
import "@dnd-kit/core";
|
|
14
14
|
import "@dnd-kit/sortable";
|
|
15
15
|
import "@dnd-kit/utilities";
|
|
16
|
-
const
|
|
16
|
+
const u = {
|
|
17
17
|
root: {
|
|
18
18
|
display: "flex",
|
|
19
19
|
flexDirection: "column",
|
|
@@ -22,12 +22,12 @@ const d = {
|
|
|
22
22
|
list: {
|
|
23
23
|
display: "flex",
|
|
24
24
|
flexDirection: "column",
|
|
25
|
-
gap: (
|
|
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 d = {
|
|
|
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 d = {
|
|
|
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 d = {
|
|
|
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,279 +143,285 @@ const d = {
|
|
|
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] !==
|
|
155
|
-
...
|
|
156
|
-
width: `${
|
|
157
|
-
backgroundColor:
|
|
146
|
+
function N(t) {
|
|
147
|
+
const e = D(6), {
|
|
148
|
+
value: o,
|
|
149
|
+
maxValue: l,
|
|
150
|
+
color: r,
|
|
151
|
+
selected: d
|
|
152
|
+
} = t, s = d === void 0 ? !0 : d, a = l > 0 ? o / l * 100 : 0;
|
|
153
|
+
let i;
|
|
154
|
+
e[0] !== r || e[1] !== a || e[2] !== s ? (i = s ? {
|
|
155
|
+
...u.barFill,
|
|
156
|
+
width: `${a}%`,
|
|
157
|
+
backgroundColor: r
|
|
158
158
|
} : {
|
|
159
|
-
...
|
|
160
|
-
...
|
|
161
|
-
width: `${
|
|
162
|
-
}, e[0] =
|
|
163
|
-
const n =
|
|
164
|
-
let
|
|
165
|
-
return e[4] !== n ? (
|
|
159
|
+
...u.barFill,
|
|
160
|
+
...u.barFillMuted,
|
|
161
|
+
width: `${a}%`
|
|
162
|
+
}, e[0] = r, e[1] = a, e[2] = s, e[3] = i) : i = e[3];
|
|
163
|
+
const n = i;
|
|
164
|
+
let c;
|
|
165
|
+
return e[4] !== n ? (c = /* @__PURE__ */ h(y, { sx: u.bar, children: /* @__PURE__ */ h(y, { sx: n }) }), e[4] = n, e[5] = c) : c = e[5], c;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
const e =
|
|
169
|
-
name:
|
|
170
|
-
value:
|
|
171
|
-
maxValue:
|
|
172
|
-
color:
|
|
173
|
-
formatter:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
167
|
+
function Y(t) {
|
|
168
|
+
const e = D(26), {
|
|
169
|
+
name: o,
|
|
170
|
+
value: l,
|
|
171
|
+
maxValue: r,
|
|
172
|
+
color: d,
|
|
173
|
+
formatter: s,
|
|
174
|
+
labelFormatter: a,
|
|
175
|
+
onClick: i,
|
|
176
|
+
selected: n
|
|
177
|
+
} = t, c = n === void 0 ? !0 : n;
|
|
178
|
+
let m;
|
|
179
|
+
e[0] !== o || e[1] !== i ? (m = i ? () => i({
|
|
180
|
+
name: o
|
|
181
|
+
}) : void 0, e[0] = o, e[1] = i, e[2] = m) : m = e[2];
|
|
182
|
+
const C = m, k = i ? u.rowClickable : u.row;
|
|
183
|
+
let b;
|
|
184
|
+
e[3] !== a || e[4] !== o ? (b = a ? a(o) : o, e[3] = a, e[4] = o, e[5] = b) : b = e[5];
|
|
185
|
+
let f;
|
|
186
|
+
e[6] !== b ? (f = /* @__PURE__ */ h(_, { sx: u.rowLabel, children: b }), e[6] = b, e[7] = f) : f = e[7];
|
|
187
|
+
let g;
|
|
188
|
+
e[8] !== s || e[9] !== l ? (g = s(l), e[8] = s, e[9] = l, e[10] = g) : g = e[10];
|
|
189
|
+
let w;
|
|
190
|
+
e[11] !== g ? (w = /* @__PURE__ */ h(_, { sx: u.rowValue, children: g }), e[11] = g, e[12] = w) : w = e[12];
|
|
184
191
|
let p;
|
|
185
|
-
e[
|
|
192
|
+
e[13] !== f || e[14] !== w ? (p = /* @__PURE__ */ $(y, { sx: u.rowHeader, children: [
|
|
193
|
+
f,
|
|
194
|
+
w
|
|
195
|
+
] }), e[13] = f, e[14] = w, e[15] = p) : p = e[15];
|
|
186
196
|
let x;
|
|
187
|
-
e[
|
|
188
|
-
let
|
|
189
|
-
e[
|
|
190
|
-
|
|
197
|
+
e[16] !== d || e[17] !== r || e[18] !== c || e[19] !== l ? (x = /* @__PURE__ */ h(N, { value: l, maxValue: r, color: d, selected: c }), e[16] = d, e[17] = r, e[18] = c, e[19] = l, e[20] = x) : x = e[20];
|
|
198
|
+
let v;
|
|
199
|
+
return e[21] !== C || e[22] !== k || e[23] !== p || e[24] !== x ? (v = /* @__PURE__ */ $(y, { sx: k, onClick: C, children: [
|
|
200
|
+
p,
|
|
191
201
|
x
|
|
192
|
-
] }), e[
|
|
202
|
+
] }), e[21] = C, e[22] = k, e[23] = p, e[24] = x, e[25] = v) : v = e[25], v;
|
|
203
|
+
}
|
|
204
|
+
function Z(t) {
|
|
205
|
+
const e = D(28), {
|
|
206
|
+
name: o,
|
|
207
|
+
values: l,
|
|
208
|
+
maxValue: r,
|
|
209
|
+
colors: d,
|
|
210
|
+
formatter: s,
|
|
211
|
+
labelFormatter: a,
|
|
212
|
+
onClick: i,
|
|
213
|
+
selected: n
|
|
214
|
+
} = t, c = n === void 0 ? !0 : n;
|
|
215
|
+
let m;
|
|
216
|
+
e[0] !== o || e[1] !== i ? (m = i ? () => i({
|
|
217
|
+
name: o
|
|
218
|
+
}) : void 0, e[0] = o, e[1] = i, e[2] = m) : m = e[2];
|
|
219
|
+
const C = m, k = i ? u.rowClickable : u.row;
|
|
220
|
+
let b;
|
|
221
|
+
e[3] !== a || e[4] !== o ? (b = a ? a(o) : o, e[3] = a, e[4] = o, e[5] = b) : b = e[5];
|
|
222
|
+
let f;
|
|
223
|
+
e[6] !== b ? (f = /* @__PURE__ */ h(_, { sx: u.rowLabel, children: b }), e[6] = b, e[7] = f) : f = e[7];
|
|
224
|
+
let g;
|
|
225
|
+
if (e[8] !== d || e[9] !== s || e[10] !== r || e[11] !== o || e[12] !== c || e[13] !== l) {
|
|
226
|
+
let x;
|
|
227
|
+
e[15] !== d || e[16] !== s || e[17] !== r || e[18] !== o || e[19] !== c ? (x = (v, S) => /* @__PURE__ */ $(y, { sx: u.multiBarRow, children: [
|
|
228
|
+
/* @__PURE__ */ h(y, { sx: u.multiBarContainer, children: /* @__PURE__ */ h(N, { value: v, maxValue: r, color: d[S % d.length] ?? "", selected: c }) }),
|
|
229
|
+
/* @__PURE__ */ h(_, { sx: u.multiBarValue, children: s(v) })
|
|
230
|
+
] }, `${o}-${v}-${S}`), e[15] = d, e[16] = s, e[17] = r, e[18] = o, e[19] = c, e[20] = x) : x = e[20], g = l.map(x), e[8] = d, e[9] = s, e[10] = r, e[11] = o, e[12] = c, e[13] = l, e[14] = g;
|
|
231
|
+
} else
|
|
232
|
+
g = e[14];
|
|
193
233
|
let w;
|
|
194
|
-
e[
|
|
195
|
-
let
|
|
196
|
-
return e[
|
|
197
|
-
|
|
234
|
+
e[21] !== g ? (w = /* @__PURE__ */ h(y, { sx: u.barContainer, children: g }), e[21] = g, e[22] = w) : w = e[22];
|
|
235
|
+
let p;
|
|
236
|
+
return e[23] !== C || e[24] !== k || e[25] !== f || e[26] !== w ? (p = /* @__PURE__ */ $(y, { sx: k, onClick: C, children: [
|
|
237
|
+
f,
|
|
198
238
|
w
|
|
199
|
-
] }), e[
|
|
239
|
+
] }), e[23] = C, e[24] = k, e[25] = f, e[26] = w, e[27] = p) : p = e[27], p;
|
|
200
240
|
}
|
|
201
|
-
function
|
|
202
|
-
const e =
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
formatter: i,
|
|
208
|
-
onClick: s,
|
|
209
|
-
selected: g
|
|
210
|
-
} = o, n = g === void 0 ? !0 : g;
|
|
241
|
+
function ee(t) {
|
|
242
|
+
const e = D(10), {
|
|
243
|
+
hiddenCount: o,
|
|
244
|
+
otherLabel: l,
|
|
245
|
+
otherCountLabel: r
|
|
246
|
+
} = t, d = l === void 0 ? "Other" : l, s = r === void 0 ? "{count} more" : r;
|
|
211
247
|
let a;
|
|
212
|
-
e[0] !==
|
|
213
|
-
|
|
214
|
-
}) : void 0, e[0] = t, e[1] = s, e[2] = a) : a = e[2];
|
|
215
|
-
const u = a, y = s ? d.rowClickable : d.row;
|
|
216
|
-
let h;
|
|
217
|
-
e[3] !== t ? (h = /* @__PURE__ */ m(T, { sx: d.rowLabel, children: t }), e[3] = t, e[4] = h) : h = e[4];
|
|
218
|
-
let p;
|
|
219
|
-
if (e[5] !== c || e[6] !== i || e[7] !== l || e[8] !== t || e[9] !== n || e[10] !== r) {
|
|
220
|
-
let w;
|
|
221
|
-
e[12] !== c || e[13] !== i || e[14] !== l || e[15] !== t || e[16] !== n ? (w = (v, E) => /* @__PURE__ */ k(b, { sx: d.multiBarRow, children: [
|
|
222
|
-
/* @__PURE__ */ m(b, { sx: d.multiBarContainer, children: /* @__PURE__ */ m(Z, { value: v, maxValue: l, color: c[E % c.length] ?? "", selected: n }) }),
|
|
223
|
-
/* @__PURE__ */ m(T, { sx: d.multiBarValue, children: i(v) })
|
|
224
|
-
] }, `${t}-${v}`), e[12] = c, e[13] = i, e[14] = l, e[15] = t, e[16] = n, e[17] = w) : w = e[17], p = r.map(w), e[5] = c, e[6] = i, e[7] = l, e[8] = t, e[9] = n, e[10] = r, e[11] = p;
|
|
225
|
-
} else
|
|
226
|
-
p = e[11];
|
|
227
|
-
let x;
|
|
228
|
-
e[18] !== p ? (x = /* @__PURE__ */ m(b, { sx: d.barContainer, children: p }), e[18] = p, e[19] = x) : x = e[19];
|
|
229
|
-
let C;
|
|
230
|
-
return e[20] !== u || e[21] !== y || e[22] !== h || e[23] !== x ? (C = /* @__PURE__ */ k(b, { sx: y, onClick: u, children: [
|
|
231
|
-
h,
|
|
232
|
-
x
|
|
233
|
-
] }), e[20] = u, e[21] = y, e[22] = h, e[23] = x, e[24] = C) : C = e[24], C;
|
|
234
|
-
}
|
|
235
|
-
function ie(o) {
|
|
236
|
-
const e = V(10), {
|
|
237
|
-
hiddenCount: t,
|
|
238
|
-
otherLabel: r,
|
|
239
|
-
otherCountLabel: l
|
|
240
|
-
} = o, c = r === void 0 ? "Other" : r, i = l === void 0 ? "{count} more" : l;
|
|
241
|
-
let s;
|
|
242
|
-
e[0] !== t || e[1] !== i ? (s = i.replace("{count}", String(t)), e[0] = t, e[1] = i, e[2] = s) : s = e[2];
|
|
243
|
-
const g = s;
|
|
248
|
+
e[0] !== o || e[1] !== s ? (a = s.replace("{count}", String(o)), e[0] = o, e[1] = s, e[2] = a) : a = e[2];
|
|
249
|
+
const i = a;
|
|
244
250
|
let n;
|
|
245
|
-
e[3] !==
|
|
246
|
-
let
|
|
247
|
-
e[5] !==
|
|
251
|
+
e[3] !== d ? (n = /* @__PURE__ */ h(_, { sx: u.otherLabel, children: d }), e[3] = d, e[4] = n) : n = e[4];
|
|
252
|
+
let c;
|
|
253
|
+
e[5] !== i ? (c = /* @__PURE__ */ $(_, { sx: u.otherCount, children: [
|
|
248
254
|
"(",
|
|
249
|
-
|
|
255
|
+
i,
|
|
250
256
|
")"
|
|
251
|
-
] }), e[5] =
|
|
252
|
-
let
|
|
253
|
-
return e[7] !== n || e[8] !==
|
|
257
|
+
] }), e[5] = i, e[6] = c) : c = e[6];
|
|
258
|
+
let m;
|
|
259
|
+
return e[7] !== n || e[8] !== c ? (m = /* @__PURE__ */ $(y, { sx: u.otherRow, children: [
|
|
254
260
|
n,
|
|
255
|
-
|
|
256
|
-
] }), e[7] = n, e[8] =
|
|
261
|
+
c
|
|
262
|
+
] }), e[7] = n, e[8] = c, e[9] = m) : m = e[9], m;
|
|
257
263
|
}
|
|
258
|
-
function
|
|
259
|
-
const e =
|
|
260
|
-
series:
|
|
261
|
-
colors:
|
|
262
|
-
} =
|
|
263
|
-
if (
|
|
264
|
+
function te(t) {
|
|
265
|
+
const e = D(7), {
|
|
266
|
+
series: o,
|
|
267
|
+
colors: l
|
|
268
|
+
} = t;
|
|
269
|
+
if (o.length === 0)
|
|
264
270
|
return null;
|
|
265
|
-
let
|
|
266
|
-
if (e[0] !==
|
|
267
|
-
let
|
|
268
|
-
e[3] !==
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
...
|
|
271
|
-
backgroundColor:
|
|
271
|
+
let r;
|
|
272
|
+
if (e[0] !== l || e[1] !== o) {
|
|
273
|
+
let s;
|
|
274
|
+
e[3] !== l ? (s = (a, i) => /* @__PURE__ */ $(y, { sx: u.legendItem, children: [
|
|
275
|
+
/* @__PURE__ */ h(y, { sx: {
|
|
276
|
+
...u.legendDot,
|
|
277
|
+
backgroundColor: a.color ?? l[i % l.length]
|
|
272
278
|
} }),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
] },
|
|
279
|
+
/* @__PURE__ */ h(_, { sx: u.legendLabel, children: a.name })
|
|
280
|
+
] }, a.name), e[3] = l, e[4] = s) : s = e[4], r = o.map(s), e[0] = l, e[1] = o, e[2] = r;
|
|
275
281
|
} else
|
|
276
|
-
|
|
277
|
-
let
|
|
278
|
-
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;
|
|
279
285
|
}
|
|
280
|
-
function
|
|
281
|
-
const e =
|
|
282
|
-
id:
|
|
283
|
-
} =
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
e[8] !== t ? (y = (f) => f.getWidget(t)?.labels, e[8] = t, e[9] = y) : y = e[9];
|
|
298
|
-
const h = R(D(y));
|
|
299
|
-
let p;
|
|
300
|
-
e[10] !== t ? (p = (f) => f.getWidget(t)?.onRowClick, e[10] = t, e[11] = p) : p = e[11];
|
|
301
|
-
const x = R(D(p));
|
|
302
|
-
let C;
|
|
303
|
-
e[12] !== t ? (C = (f) => f.getWidget(t)?.selected, e[12] = t, e[13] = C) : C = e[13];
|
|
304
|
-
const w = R(D(C));
|
|
305
|
-
let v;
|
|
306
|
-
e[14] !== t ? (v = (f) => f.getWidget(t)?.max, e[14] = t, e[15] = v) : v = e[15];
|
|
307
|
-
const E = R(D(v)), P = c ?? le, S = s ?? [], [G] = oe(u ? 40 * (S.length || 1) * u : void 0), X = Object.values(r.palette.qualitative.bold), M = S.length > 0 ? S.map((f, U) => f.color ?? X[U % X.length] ?? r.palette.secondary.main) : [r.palette.secondary.main];
|
|
308
|
-
let B, _, L, W, F, I, j, A;
|
|
309
|
-
if (e[16] !== M || e[17] !== n || e[18] !== P || e[19] !== E || e[20] !== G || e[21] !== u || e[22] !== x || e[23] !== w || e[24] !== S) {
|
|
310
|
-
j = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
286
|
+
function ve(t) {
|
|
287
|
+
const e = D(40), {
|
|
288
|
+
id: o
|
|
289
|
+
} = t, l = z(), {
|
|
290
|
+
_formatter: r,
|
|
291
|
+
_labelFormatter: d,
|
|
292
|
+
_series: s,
|
|
293
|
+
data: a,
|
|
294
|
+
maxItems: i,
|
|
295
|
+
labels: n,
|
|
296
|
+
onRowClick: c,
|
|
297
|
+
selected: m,
|
|
298
|
+
max: C
|
|
299
|
+
} = J(o, re), k = r ?? X, b = d ?? Q, f = s ?? [], [g] = K(i ? 40 * (f.length || 1) * i : void 0), w = Object.values(l.palette.qualitative.bold), p = f.length > 0 ? f.map((R, O) => R.color ?? w[O % w.length] ?? l.palette.secondary.main) : [l.palette.secondary.main];
|
|
300
|
+
let x, v, S, M, F, T, I, V;
|
|
301
|
+
if (e[0] !== p || e[1] !== a || e[2] !== k || e[3] !== b || e[4] !== C || e[5] !== g || e[6] !== i || e[7] !== c || e[8] !== m || e[9] !== f) {
|
|
302
|
+
V = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
311
303
|
e: {
|
|
312
|
-
const
|
|
313
|
-
data:
|
|
304
|
+
const R = le({
|
|
305
|
+
data: a
|
|
314
306
|
});
|
|
315
|
-
if (
|
|
316
|
-
|
|
307
|
+
if (R.length === 0) {
|
|
308
|
+
V = null;
|
|
317
309
|
break e;
|
|
318
310
|
}
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
...
|
|
324
|
-
}, e[
|
|
325
|
-
const
|
|
326
|
-
e[
|
|
327
|
-
maxHeight:
|
|
328
|
-
overflow:
|
|
329
|
-
}, e[
|
|
311
|
+
const O = C ?? Math.max(...R.flatMap(oe)), H = i !== void 0 && i >= 0 ? R.slice(0, i) : R;
|
|
312
|
+
S = R.length - H.length;
|
|
313
|
+
const U = f.length > 1;
|
|
314
|
+
v = y, e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = {
|
|
315
|
+
...u.root
|
|
316
|
+
}, e[18] = I) : I = e[18], x = y, M = u.list;
|
|
317
|
+
const q = S === 0 ? "auto" : "hidden";
|
|
318
|
+
e[19] !== g || e[20] !== q ? (F = {
|
|
319
|
+
maxHeight: g,
|
|
320
|
+
overflow: q
|
|
321
|
+
}, e[19] = g, e[20] = q, e[21] = F) : F = e[21], T = U ? H.map((L) => /* @__PURE__ */ h(Z, { name: L.name, values: L.values, maxValue: O, colors: p, formatter: k, labelFormatter: b, onClick: c, selected: m?.(L.name) ?? !0 }, L.name)) : H.map((L) => /* @__PURE__ */ h(Y, { name: L.name, value: L.values[0] ?? 0, selected: m?.(L.name) ?? !0, maxValue: O, color: p[0], formatter: k, labelFormatter: b, onClick: c }, L.name));
|
|
330
322
|
}
|
|
331
|
-
e[
|
|
323
|
+
e[0] = p, e[1] = a, e[2] = k, e[3] = b, e[4] = C, e[5] = g, e[6] = i, e[7] = c, e[8] = m, e[9] = f, e[10] = x, e[11] = v, e[12] = S, e[13] = M, e[14] = F, e[15] = T, e[16] = I, e[17] = V;
|
|
332
324
|
} else
|
|
333
|
-
|
|
334
|
-
if (
|
|
335
|
-
return
|
|
336
|
-
let
|
|
337
|
-
e[
|
|
338
|
-
let
|
|
339
|
-
e[
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
] }), e[
|
|
343
|
-
let
|
|
344
|
-
e[
|
|
345
|
-
let
|
|
346
|
-
return e[
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
] }), 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;
|
|
350
345
|
}
|
|
351
|
-
function
|
|
352
|
-
|
|
346
|
+
function re(t) {
|
|
347
|
+
const e = t;
|
|
348
|
+
return {
|
|
349
|
+
_formatter: e?.formatter,
|
|
350
|
+
_labelFormatter: e?.labelFormatter,
|
|
351
|
+
_series: e?.series,
|
|
352
|
+
data: e?.data,
|
|
353
|
+
maxItems: e?.maxItems,
|
|
354
|
+
labels: e?.labels,
|
|
355
|
+
onRowClick: e?.onRowClick,
|
|
356
|
+
selected: e?.selected,
|
|
357
|
+
max: e?.max
|
|
358
|
+
};
|
|
353
359
|
}
|
|
354
|
-
function
|
|
355
|
-
data:
|
|
360
|
+
function le({
|
|
361
|
+
data: t
|
|
356
362
|
}) {
|
|
357
|
-
if (!
|
|
358
|
-
const e = Math.max(
|
|
359
|
-
for (let
|
|
360
|
-
const
|
|
361
|
-
for (const
|
|
362
|
-
let
|
|
363
|
-
|
|
363
|
+
if (!t || t.length === 0) return [];
|
|
364
|
+
const e = Math.max(t.length, 1), o = /* @__PURE__ */ new Map(), l = [];
|
|
365
|
+
for (let r = 0; r < t.length; r++) {
|
|
366
|
+
const d = t[r];
|
|
367
|
+
for (const s of d) {
|
|
368
|
+
let a = o.get(s.name);
|
|
369
|
+
a || (a = new Array(e).fill(0), o.set(s.name, a), l.push(s.name)), a[r] = s.value;
|
|
364
370
|
}
|
|
365
371
|
}
|
|
366
|
-
return
|
|
367
|
-
name:
|
|
368
|
-
values:
|
|
372
|
+
return l.map((r) => ({
|
|
373
|
+
name: r,
|
|
374
|
+
values: o.get(r)
|
|
369
375
|
}));
|
|
370
376
|
}
|
|
371
|
-
const
|
|
372
|
-
function
|
|
373
|
-
const
|
|
377
|
+
const ne = [85, 70, 55, 75, 60];
|
|
378
|
+
function ke() {
|
|
379
|
+
const t = D(1);
|
|
374
380
|
let e;
|
|
375
|
-
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({
|
|
376
382
|
length: 5
|
|
377
|
-
}).map(
|
|
383
|
+
}).map(ae) }), t[0] = e) : e = t[0], e;
|
|
378
384
|
}
|
|
379
|
-
function
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__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 })
|
|
384
390
|
] }),
|
|
385
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ h(E, { variant: "rectangular", height: 4, sx: {
|
|
386
392
|
borderRadius: 2,
|
|
387
|
-
width: `${
|
|
393
|
+
width: `${ne[e]}%`
|
|
388
394
|
} })
|
|
389
395
|
] }, e);
|
|
390
396
|
}
|
|
391
|
-
function
|
|
392
|
-
refUI:
|
|
397
|
+
function Se({
|
|
398
|
+
refUI: t,
|
|
393
399
|
series: e
|
|
394
400
|
}) {
|
|
395
401
|
return [{
|
|
396
|
-
...
|
|
397
|
-
modifier: () =>
|
|
402
|
+
...P,
|
|
403
|
+
modifier: () => P.modifier(t)
|
|
398
404
|
}, {
|
|
399
|
-
...
|
|
400
|
-
modifier: async (
|
|
401
|
-
if (!
|
|
402
|
-
return
|
|
403
|
-
const
|
|
404
|
-
for (let n = 0; n <
|
|
405
|
-
const
|
|
406
|
-
for (const
|
|
407
|
-
let
|
|
408
|
-
|
|
405
|
+
...G,
|
|
406
|
+
modifier: async (o) => {
|
|
407
|
+
if (!o?.length || o[0]?.length === 0)
|
|
408
|
+
return G.modifier([]);
|
|
409
|
+
const l = o.length, r = /* @__PURE__ */ new Map(), d = [];
|
|
410
|
+
for (let n = 0; n < l; n++) {
|
|
411
|
+
const c = o[n];
|
|
412
|
+
for (const m of c) {
|
|
413
|
+
let C = r.get(m.name);
|
|
414
|
+
C || (C = new Array(l).fill(0), r.set(m.name, C), d.push(m.name)), C[n] = m.value;
|
|
409
415
|
}
|
|
410
416
|
}
|
|
411
|
-
const
|
|
412
|
-
length:
|
|
413
|
-
}, (n,
|
|
414
|
-
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]);
|
|
415
421
|
}
|
|
416
422
|
}];
|
|
417
423
|
}
|
|
418
|
-
function
|
|
424
|
+
function $e() {
|
|
419
425
|
return {
|
|
420
426
|
series: [],
|
|
421
427
|
maxItems: 10,
|
|
@@ -423,14 +429,14 @@ function De() {
|
|
|
423
429
|
};
|
|
424
430
|
}
|
|
425
431
|
export {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
432
|
+
N as CategoryBar,
|
|
433
|
+
te as CategoryLegend,
|
|
434
|
+
Z as CategoryRowMulti,
|
|
435
|
+
ee as CategoryRowOther,
|
|
436
|
+
Y as CategoryRowSingle,
|
|
437
|
+
ke as CategorySkeleton,
|
|
438
|
+
ve as CategoryUI,
|
|
439
|
+
$e as categoryConfig,
|
|
440
|
+
Se as categoryDownloadConfig
|
|
435
441
|
};
|
|
436
442
|
//# sourceMappingURL=category.js.map
|