@carto/ps-react-ui 4.25.0 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions-DON6fSCh.js +1289 -0
- package/dist/actions-DON6fSCh.js.map +1 -0
- package/dist/category-BoT5FHHp.js +950 -0
- package/dist/category-BoT5FHHp.js.map +1 -0
- package/dist/item-color-C1cu6EJd.js +20 -0
- package/dist/item-color-C1cu6EJd.js.map +1 -0
- package/dist/scale-0elCv3tk.js +29 -0
- package/dist/scale-0elCv3tk.js.map +1 -0
- package/dist/types/widgets-v2/actions/index.d.ts +1 -1
- package/dist/types/widgets-v2/actions/relative-data/index.d.ts +1 -0
- package/dist/types/widgets-v2/actions/relative-data/labels.d.ts +3 -0
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +16 -2
- package/dist/types/widgets-v2/actions/relative-data/scale.d.ts +26 -0
- package/dist/types/widgets-v2/actions/relative-data/style.d.ts +12 -0
- package/dist/types/widgets-v2/bar/types.d.ts +6 -0
- package/dist/types/widgets-v2/category/category.d.ts +2 -1
- 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 +2 -2
- 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 +91 -81
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/category.js +1 -1
- package/dist/widgets-v2/histogram.js +133 -100
- 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 +151 -110
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +96 -86
- 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 +1 -1
- 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/actions/index.ts +1 -0
- package/src/widgets-v2/actions/relative-data/index.ts +1 -0
- package/src/widgets-v2/actions/relative-data/labels.ts +6 -0
- package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +78 -1
- package/src/widgets-v2/actions/relative-data/relative-data.tsx +137 -20
- package/src/widgets-v2/actions/relative-data/scale.ts +48 -0
- package/src/widgets-v2/actions/relative-data/style.ts +10 -0
- package/src/widgets-v2/bar/options.test.ts +122 -0
- package/src/widgets-v2/bar/options.ts +31 -16
- package/src/widgets-v2/bar/types.ts +6 -0
- package/src/widgets-v2/category/category.relative-data.test.tsx +51 -63
- package/src/widgets-v2/category/category.tsx +25 -11
- 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 +44 -19
- 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 +7 -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 +90 -0
- package/src/widgets-v2/scatterplot/options.ts +53 -15
- 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 +38 -19
- 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 +0 -1167
- package/dist/actions-B1ss030_.js.map +0 -1
- package/dist/category-DuKx_CJX.js +0 -933
- package/dist/category-DuKx_CJX.js.map +0 -1
|
@@ -0,0 +1,1289 @@
|
|
|
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, b as i, f as a, h as o, i as s, l as c, m as l, n as u, p as d, r as f, w as p, x as m, y as h } from "./stores-BVFMfgyo.js";
|
|
4
|
+
import "./zoom-toggle-KA63b6-J.js";
|
|
5
|
+
import { i as g, t as _ } from "./scale-0elCv3tk.js";
|
|
6
|
+
import "./download--wRRnf19.js";
|
|
7
|
+
import { c as v } from "react/compiler-runtime";
|
|
8
|
+
import { useEffect as y, useLayoutEffect as b, useRef as x, useState as S } from "react";
|
|
9
|
+
import { Box as C, Dialog as w, DialogContent as T, DialogTitle as E, IconButton as D, InputAdornment as O, ListItemText as k, ListSubheader as A, Menu as j, MenuItem as M, SvgIcon as N, TextField as P, Typography as F, useMediaQuery as I, useTheme as L } from "@mui/material";
|
|
10
|
+
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
11
|
+
import { ArrowDropDown as ee, Clear as te, Close as ne, DragIndicator as V, Fullscreen as H, FullscreenExit as U, HighlightAlt as W, Lock as G, LockOpen as K, Percent as re, Search as q, StackedBarChart as J } from "@mui/icons-material";
|
|
12
|
+
import { debounce as Y } from "@carto/ps-utils";
|
|
13
|
+
import { SortableContext as ie, arrayMove as ae, sortableKeyboardCoordinates as X, useSortable as Z, verticalListSortingStrategy as oe } from "@dnd-kit/sortable";
|
|
14
|
+
import { CSS as Q } from "@dnd-kit/utilities";
|
|
15
|
+
import { DndContext as se, KeyboardSensor as ce, PointerSensor as le, closestCenter as ue, useSensor as de, useSensors as fe } from "@dnd-kit/core";
|
|
16
|
+
//#region src/widgets-v2/provider/widget-provider.tsx
|
|
17
|
+
function $(e) {
|
|
18
|
+
let t = v(31), { id: n, data: r, isLoading: i, isFetching: a, error: s, formatter: u, labelFormatter: f, keepAlive: g, children: _ } = e, y = g !== void 0 && g, x;
|
|
19
|
+
t[0] !== r || t[1] !== s || t[2] !== u || t[3] !== n || t[4] !== a || t[5] !== i || t[6] !== f ? (x = () => {
|
|
20
|
+
if (l(n)) return d(n);
|
|
21
|
+
let e = c(n, {
|
|
22
|
+
data: r,
|
|
23
|
+
isLoading: i,
|
|
24
|
+
isFetching: a,
|
|
25
|
+
error: s,
|
|
26
|
+
formatter: u,
|
|
27
|
+
labelFormatter: f
|
|
28
|
+
});
|
|
29
|
+
return h(n, e), e;
|
|
30
|
+
}, t[0] = r, t[1] = s, t[2] = u, t[3] = n, t[4] = a, t[5] = i, t[6] = f, t[7] = x) : x = t[7];
|
|
31
|
+
let [C] = S(x), w, T;
|
|
32
|
+
t[8] !== n || t[9] !== y || t[10] !== C ? (w = () => (o(n, C), () => {
|
|
33
|
+
m(n, { keepAlive: y });
|
|
34
|
+
}), T = [
|
|
35
|
+
n,
|
|
36
|
+
C,
|
|
37
|
+
y
|
|
38
|
+
], t[8] = n, t[9] = y, t[10] = C, t[11] = w, t[12] = T) : (w = t[11], T = t[12]), b(w, T);
|
|
39
|
+
let E, D;
|
|
40
|
+
t[13] !== r || t[14] !== C ? (E = () => {
|
|
41
|
+
C.setState({ rawData: r });
|
|
42
|
+
}, D = [C, r], t[13] = r, t[14] = C, t[15] = E, t[16] = D) : (E = t[15], D = t[16]), b(E, D);
|
|
43
|
+
let O, k;
|
|
44
|
+
t[17] !== s || t[18] !== a || t[19] !== i || t[20] !== C ? (O = () => {
|
|
45
|
+
C.setState({
|
|
46
|
+
isLoading: i ?? !1,
|
|
47
|
+
isFetching: a ?? !1,
|
|
48
|
+
error: s
|
|
49
|
+
});
|
|
50
|
+
}, k = [
|
|
51
|
+
C,
|
|
52
|
+
i,
|
|
53
|
+
a,
|
|
54
|
+
s
|
|
55
|
+
], t[17] = s, t[18] = a, t[19] = i, t[20] = C, t[21] = O, t[22] = k) : (O = t[21], k = t[22]), b(O, k);
|
|
56
|
+
let A, j;
|
|
57
|
+
t[23] !== u || t[24] !== f || t[25] !== C ? (j = () => {
|
|
58
|
+
C.setState({
|
|
59
|
+
rawFormatter: u,
|
|
60
|
+
formatter: u,
|
|
61
|
+
labelFormatter: f
|
|
62
|
+
});
|
|
63
|
+
}, A = [
|
|
64
|
+
C,
|
|
65
|
+
u,
|
|
66
|
+
f
|
|
67
|
+
], t[23] = u, t[24] = f, t[25] = C, t[26] = A, t[27] = j) : (A = t[26], j = t[27]), b(j, A);
|
|
68
|
+
let M;
|
|
69
|
+
return t[28] !== _ || t[29] !== n ? (M = /* @__PURE__ */ z(p.Provider, {
|
|
70
|
+
value: n,
|
|
71
|
+
children: _
|
|
72
|
+
}), t[28] = _, t[29] = n, t[30] = M) : M = t[30], M;
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/widgets-v2/actions/searcher/filter.ts
|
|
76
|
+
function pe(e, t, n) {
|
|
77
|
+
if (!t) return e;
|
|
78
|
+
let r = t.toLowerCase();
|
|
79
|
+
return Array.isArray(e) ? e.map((e) => Array.isArray(e) ? e.filter((e) => {
|
|
80
|
+
if (e == null) return !1;
|
|
81
|
+
if (typeof e == "object" && "name" in e) {
|
|
82
|
+
let t = e.name;
|
|
83
|
+
return me(t, n).toLowerCase().includes(r);
|
|
84
|
+
}
|
|
85
|
+
return he(e).toLowerCase().includes(r);
|
|
86
|
+
}) : e) : e;
|
|
87
|
+
}
|
|
88
|
+
function me(e, t) {
|
|
89
|
+
return e == null ? "" : he(t && (typeof e == "string" || typeof e == "number") ? t(e) : e);
|
|
90
|
+
}
|
|
91
|
+
function he(e) {
|
|
92
|
+
return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/widgets-v2/actions/searcher/labels.ts
|
|
96
|
+
var ge = {
|
|
97
|
+
toggle: "Search",
|
|
98
|
+
placeholder: "Search…",
|
|
99
|
+
clearAriaLabel: "Clear search",
|
|
100
|
+
noResults: "No matches."
|
|
101
|
+
}, _e = {
|
|
102
|
+
toggle: {
|
|
103
|
+
p: .5,
|
|
104
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
105
|
+
},
|
|
106
|
+
toggleActive: { background: (e) => e.palette.primary.relatedLight },
|
|
107
|
+
input: {
|
|
108
|
+
width: "100%",
|
|
109
|
+
mb: 1
|
|
110
|
+
}
|
|
111
|
+
}, ve = {
|
|
112
|
+
id: "searcher",
|
|
113
|
+
type: "data",
|
|
114
|
+
order: 20,
|
|
115
|
+
disables: ["lock-selection"]
|
|
116
|
+
};
|
|
117
|
+
function ye(t) {
|
|
118
|
+
let i = v(21), { labels: a, icon: o, iconProps: s, initialEnabled: c } = t, l = o === void 0 ? q : o, d = c !== void 0 && c, f = r(), p;
|
|
119
|
+
i[0] === a ? p = i[1] : (p = {
|
|
120
|
+
...ge,
|
|
121
|
+
...a
|
|
122
|
+
}, i[0] = a, i[1] = p);
|
|
123
|
+
let m = p, h = n(f, xe), g = n(f, be), _;
|
|
124
|
+
i[2] !== g || i[3] !== h ? (_ = (e) => pe(e, h, g), i[2] = g, i[3] = h, i[4] = _) : _ = i[4];
|
|
125
|
+
let y = _, b;
|
|
126
|
+
i[5] === d ? b = i[6] : (b = { initialEnabled: d }, i[5] = d, i[6] = b);
|
|
127
|
+
let { enabled: x, toggle: S } = u(f, ve, y, b), C = x && _e.toggleActive, w;
|
|
128
|
+
i[7] === C ? w = i[8] : (w = {
|
|
129
|
+
..._e.toggle,
|
|
130
|
+
...C
|
|
131
|
+
}, i[7] = C, i[8] = w);
|
|
132
|
+
let T;
|
|
133
|
+
i[9] !== l || i[10] !== s ? (T = /* @__PURE__ */ z(l, {
|
|
134
|
+
fontSize: "small",
|
|
135
|
+
...s
|
|
136
|
+
}), i[9] = l, i[10] = s, i[11] = T) : T = i[11];
|
|
137
|
+
let E;
|
|
138
|
+
i[12] !== x || i[13] !== m.toggle || i[14] !== w || i[15] !== T || i[16] !== S ? (E = /* @__PURE__ */ z(D, {
|
|
139
|
+
size: "small",
|
|
140
|
+
"aria-label": m.toggle,
|
|
141
|
+
"aria-pressed": x,
|
|
142
|
+
onClick: S,
|
|
143
|
+
sx: w,
|
|
144
|
+
children: T
|
|
145
|
+
}), i[12] = x, i[13] = m.toggle, i[14] = w, i[15] = T, i[16] = S, i[17] = E) : E = i[17];
|
|
146
|
+
let O;
|
|
147
|
+
return i[18] !== m.toggle || i[19] !== E ? (O = /* @__PURE__ */ z(e, {
|
|
148
|
+
title: m.toggle,
|
|
149
|
+
children: E
|
|
150
|
+
}), i[18] = m.toggle, i[19] = E, i[20] = O) : O = i[20], O;
|
|
151
|
+
}
|
|
152
|
+
function be(e) {
|
|
153
|
+
return e.labelFormatter;
|
|
154
|
+
}
|
|
155
|
+
function xe(e) {
|
|
156
|
+
return e.transformStates.searcher?.searchText ?? "";
|
|
157
|
+
}
|
|
158
|
+
function Se(e, t) {
|
|
159
|
+
d(e).setState((e) => ({ transformStates: {
|
|
160
|
+
...e.transformStates,
|
|
161
|
+
searcher: {
|
|
162
|
+
enabled: e.transformStates.searcher?.enabled ?? !1,
|
|
163
|
+
...e.transformStates.searcher,
|
|
164
|
+
searchText: t
|
|
165
|
+
}
|
|
166
|
+
} }));
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/widgets-v2/actions/searcher/searcher.tsx
|
|
170
|
+
var Ce = 300;
|
|
171
|
+
function we(e) {
|
|
172
|
+
let t = v(28), { labels: i, debounceMs: a } = e, o = a === void 0 ? Ce : a, s = r(), c;
|
|
173
|
+
t[0] === i ? c = t[1] : (c = {
|
|
174
|
+
...ge,
|
|
175
|
+
...i
|
|
176
|
+
}, t[0] = i, t[1] = c);
|
|
177
|
+
let l = c, u = n(s, Ee), f = x(null), p;
|
|
178
|
+
t[2] === s ? p = t[3] : (p = () => d(s).getState().transformStates.searcher?.searchText ?? "", t[2] = s, t[3] = p);
|
|
179
|
+
let [m, h] = S(p), [g, _] = S(!1), y = n(s, Te) ?? "", [b, C] = S(y);
|
|
180
|
+
y !== b && (C(y), g || h(y));
|
|
181
|
+
let w;
|
|
182
|
+
t[4] === s ? w = t[5] : (w = (e) => Se(s, e), t[4] = s, t[5] = w);
|
|
183
|
+
let T;
|
|
184
|
+
t[6] !== o || t[7] !== w ? (T = Y(w, o), t[6] = o, t[7] = w, t[8] = T) : T = t[8];
|
|
185
|
+
let E = T, k;
|
|
186
|
+
t[9] === E ? k = t[10] : (k = (e) => {
|
|
187
|
+
let t = e.target.value;
|
|
188
|
+
h(t), E(t);
|
|
189
|
+
}, t[9] = E, t[10] = k);
|
|
190
|
+
let A = k, j;
|
|
191
|
+
t[11] !== E || t[12] !== s ? (j = () => {
|
|
192
|
+
h(""), Se(s, ""), E(""), f.current?.focus();
|
|
193
|
+
}, t[11] = E, t[12] = s, t[13] = j) : j = t[13];
|
|
194
|
+
let M = j;
|
|
195
|
+
if (!u) return null;
|
|
196
|
+
let N, F;
|
|
197
|
+
t[14] === Symbol.for("react.memo_cache_sentinel") ? (N = () => _(!0), F = () => _(!1), t[14] = N, t[15] = F) : (N = t[14], F = t[15]);
|
|
198
|
+
let I;
|
|
199
|
+
t[16] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ z(O, {
|
|
200
|
+
position: "start",
|
|
201
|
+
children: /* @__PURE__ */ z(q, { fontSize: "small" })
|
|
202
|
+
}), t[16] = I) : I = t[16];
|
|
203
|
+
let L;
|
|
204
|
+
t[17] !== M || t[18] !== m || t[19] !== l.clearAriaLabel ? (L = m ? /* @__PURE__ */ z(O, {
|
|
205
|
+
position: "end",
|
|
206
|
+
children: /* @__PURE__ */ z(D, {
|
|
207
|
+
size: "small",
|
|
208
|
+
edge: "end",
|
|
209
|
+
"aria-label": l.clearAriaLabel,
|
|
210
|
+
onClick: M,
|
|
211
|
+
children: /* @__PURE__ */ z(te, { fontSize: "small" })
|
|
212
|
+
})
|
|
213
|
+
}) : null, t[17] = M, t[18] = m, t[19] = l.clearAriaLabel, t[20] = L) : L = t[20];
|
|
214
|
+
let R;
|
|
215
|
+
t[21] === L ? R = t[22] : (R = {
|
|
216
|
+
startAdornment: I,
|
|
217
|
+
endAdornment: L
|
|
218
|
+
}, t[21] = L, t[22] = R);
|
|
219
|
+
let B;
|
|
220
|
+
return t[23] !== A || t[24] !== m || t[25] !== l.placeholder || t[26] !== R ? (B = /* @__PURE__ */ z(P, {
|
|
221
|
+
inputRef: f,
|
|
222
|
+
size: "small",
|
|
223
|
+
fullWidth: !0,
|
|
224
|
+
variant: "filled",
|
|
225
|
+
placeholder: l.placeholder,
|
|
226
|
+
value: m,
|
|
227
|
+
onChange: A,
|
|
228
|
+
onFocus: N,
|
|
229
|
+
onBlur: F,
|
|
230
|
+
autoFocus: !0,
|
|
231
|
+
"aria-label": l.placeholder,
|
|
232
|
+
sx: _e.input,
|
|
233
|
+
InputProps: R
|
|
234
|
+
}), t[23] = A, t[24] = m, t[25] = l.placeholder, t[26] = R, t[27] = B) : B = t[27], B;
|
|
235
|
+
}
|
|
236
|
+
function Te(e) {
|
|
237
|
+
return e.transformStates.searcher?.searchText;
|
|
238
|
+
}
|
|
239
|
+
function Ee(e) {
|
|
240
|
+
return e.transformStates.searcher?.enabled ?? !1;
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/widgets-v2/actions/stack-toggle/transforms.ts
|
|
244
|
+
var De = (e) => {
|
|
245
|
+
if (typeof e != "object" || !e) return e;
|
|
246
|
+
let t = e, n = Array.isArray(t.series) ? t.series : [], r = n.length === 0 ? [{ stack: "total" }] : n.map((e) => typeof e != "object" || !e ? e : {
|
|
247
|
+
...e,
|
|
248
|
+
stack: "total"
|
|
249
|
+
});
|
|
250
|
+
return {
|
|
251
|
+
...t,
|
|
252
|
+
series: r
|
|
253
|
+
};
|
|
254
|
+
}, Oe = {
|
|
255
|
+
on: "Unstack series",
|
|
256
|
+
off: "Stack series"
|
|
257
|
+
}, ke = {
|
|
258
|
+
toggle: {
|
|
259
|
+
p: .5,
|
|
260
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
261
|
+
},
|
|
262
|
+
toggleActive: { background: (e) => e.palette.primary.relatedLight }
|
|
263
|
+
}, Ae = {
|
|
264
|
+
id: "stack-toggle",
|
|
265
|
+
type: "config",
|
|
266
|
+
order: 30
|
|
267
|
+
};
|
|
268
|
+
function je(t) {
|
|
269
|
+
let n = v(18), { initialEnabled: i, labels: a, icon: o, iconProps: s } = t, c = i !== void 0 && i, l = o === void 0 ? J : o, d = r(), f;
|
|
270
|
+
n[0] === a ? f = n[1] : (f = {
|
|
271
|
+
...Oe,
|
|
272
|
+
...a
|
|
273
|
+
}, n[0] = a, n[1] = f);
|
|
274
|
+
let p = f, m;
|
|
275
|
+
n[2] === c ? m = n[3] : (m = { initialEnabled: c }, n[2] = c, n[3] = m);
|
|
276
|
+
let { enabled: h, toggle: g } = u(d, Ae, De, m), _ = h ? p.on : p.off, y = h && ke.toggleActive, b;
|
|
277
|
+
n[4] === y ? b = n[5] : (b = {
|
|
278
|
+
...ke.toggle,
|
|
279
|
+
...y
|
|
280
|
+
}, n[4] = y, n[5] = b);
|
|
281
|
+
let x;
|
|
282
|
+
n[6] !== l || n[7] !== s ? (x = /* @__PURE__ */ z(l, {
|
|
283
|
+
fontSize: "small",
|
|
284
|
+
...s
|
|
285
|
+
}), n[6] = l, n[7] = s, n[8] = x) : x = n[8];
|
|
286
|
+
let S;
|
|
287
|
+
n[9] !== h || n[10] !== b || n[11] !== x || n[12] !== g || n[13] !== _ ? (S = /* @__PURE__ */ z(D, {
|
|
288
|
+
size: "small",
|
|
289
|
+
"aria-label": _,
|
|
290
|
+
"aria-pressed": h,
|
|
291
|
+
onClick: g,
|
|
292
|
+
sx: b,
|
|
293
|
+
children: x
|
|
294
|
+
}), n[9] = h, n[10] = b, n[11] = x, n[12] = g, n[13] = _, n[14] = S) : S = n[14];
|
|
295
|
+
let C;
|
|
296
|
+
return n[15] !== S || n[16] !== _ ? (C = /* @__PURE__ */ z(e, {
|
|
297
|
+
title: _,
|
|
298
|
+
children: S
|
|
299
|
+
}), n[15] = S, n[16] = _, n[17] = C) : C = n[17], C;
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/widgets-v2/actions/show-all/labels.ts
|
|
303
|
+
var Me = { toggle: "Show less" }, Ne = { toggle: {
|
|
304
|
+
p: .5,
|
|
305
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
306
|
+
} }, Pe = "show-all";
|
|
307
|
+
function Fe(t) {
|
|
308
|
+
let n = v(14), { labels: i, icon: a, iconProps: o } = t, s = a === void 0 ? ne : a, c = r(), l;
|
|
309
|
+
n[0] === i ? l = n[1] : (l = {
|
|
310
|
+
...Me,
|
|
311
|
+
...i
|
|
312
|
+
}, n[0] = i, n[1] = l);
|
|
313
|
+
let u = l, d;
|
|
314
|
+
n[2] === c ? d = n[3] : (d = () => Ie(c, !1), n[2] = c, n[3] = d);
|
|
315
|
+
let f;
|
|
316
|
+
n[4] !== s || n[5] !== o ? (f = /* @__PURE__ */ z(s, {
|
|
317
|
+
fontSize: "small",
|
|
318
|
+
...o
|
|
319
|
+
}), n[4] = s, n[5] = o, n[6] = f) : f = n[6];
|
|
320
|
+
let p;
|
|
321
|
+
n[7] !== u.toggle || n[8] !== d || n[9] !== f ? (p = /* @__PURE__ */ z(D, {
|
|
322
|
+
size: "small",
|
|
323
|
+
"aria-label": u.toggle,
|
|
324
|
+
"aria-pressed": !0,
|
|
325
|
+
onClick: d,
|
|
326
|
+
sx: Ne.toggle,
|
|
327
|
+
children: f
|
|
328
|
+
}), n[7] = u.toggle, n[8] = d, n[9] = f, n[10] = p) : p = n[10];
|
|
329
|
+
let m;
|
|
330
|
+
return n[11] !== u.toggle || n[12] !== p ? (m = /* @__PURE__ */ z(e, {
|
|
331
|
+
title: u.toggle,
|
|
332
|
+
children: p
|
|
333
|
+
}), n[11] = u.toggle, n[12] = p, n[13] = m) : m = n[13], m;
|
|
334
|
+
}
|
|
335
|
+
function Ie(e, t) {
|
|
336
|
+
d(e).setState((e) => ({ transformStates: {
|
|
337
|
+
...e.transformStates,
|
|
338
|
+
[Pe]: {
|
|
339
|
+
...e.transformStates[Pe],
|
|
340
|
+
enabled: t
|
|
341
|
+
}
|
|
342
|
+
} }));
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/widgets-v2/actions/brush-toggle/transforms.ts
|
|
346
|
+
var Le = (e) => {
|
|
347
|
+
if (typeof e != "object" || !e) return e;
|
|
348
|
+
let t = e;
|
|
349
|
+
return {
|
|
350
|
+
...t,
|
|
351
|
+
brush: {
|
|
352
|
+
toolbox: ["rect", "clear"],
|
|
353
|
+
xAxisIndex: "all",
|
|
354
|
+
brushLink: "all",
|
|
355
|
+
outOfBrush: { colorAlpha: .15 }
|
|
356
|
+
},
|
|
357
|
+
toolbox: {
|
|
358
|
+
...t.toolbox ?? {},
|
|
359
|
+
show: !1,
|
|
360
|
+
feature: {
|
|
361
|
+
...t.toolbox?.feature ?? {},
|
|
362
|
+
brush: { type: ["rect", "clear"] }
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
}, Re = {
|
|
367
|
+
on: "Disable brush selection",
|
|
368
|
+
off: "Enable brush selection"
|
|
369
|
+
}, ze = {
|
|
370
|
+
toggle: {
|
|
371
|
+
p: .5,
|
|
372
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
373
|
+
},
|
|
374
|
+
toggleActive: { background: (e) => e.palette.primary.relatedLight }
|
|
375
|
+
}, Be = {
|
|
376
|
+
id: "brush-toggle",
|
|
377
|
+
type: "config",
|
|
378
|
+
order: 25
|
|
379
|
+
};
|
|
380
|
+
function Ve(t) {
|
|
381
|
+
let n = v(33), { initialEnabled: i, brushType: a, brushMode: o, selection: c, labels: l, icon: d, iconProps: f } = t, p = i !== void 0 && i, m = a === void 0 ? "lineX" : a, h = o === void 0 ? "multiple" : o, g = d === void 0 ? W : d, _ = r(), b;
|
|
382
|
+
n[0] === l ? b = n[1] : (b = {
|
|
383
|
+
...Re,
|
|
384
|
+
...l
|
|
385
|
+
}, n[0] = l, n[1] = b);
|
|
386
|
+
let x = b, S;
|
|
387
|
+
n[2] === p ? S = n[3] : (S = { initialEnabled: p }, n[2] = p, n[3] = S);
|
|
388
|
+
let { enabled: C, toggle: w } = u(_, Be, Le, S), T = s(_), E, O;
|
|
389
|
+
n[4] !== h || n[5] !== m || n[6] !== T || n[7] !== C ? (E = () => {
|
|
390
|
+
if (!T) return;
|
|
391
|
+
if (!C) {
|
|
392
|
+
T.dispatchAction({ type: "takeGlobalCursor" }), T.dispatchAction({
|
|
393
|
+
type: "brush",
|
|
394
|
+
areas: []
|
|
395
|
+
});
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
let e = () => {
|
|
399
|
+
T.dispatchAction({
|
|
400
|
+
type: "takeGlobalCursor",
|
|
401
|
+
key: "brush",
|
|
402
|
+
brushOption: {
|
|
403
|
+
brushType: m,
|
|
404
|
+
brushMode: h
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
}, t = () => e();
|
|
408
|
+
return T.on("finished", t), e(), () => {
|
|
409
|
+
T.off("finished", t);
|
|
410
|
+
};
|
|
411
|
+
}, O = [
|
|
412
|
+
T,
|
|
413
|
+
C,
|
|
414
|
+
m,
|
|
415
|
+
h
|
|
416
|
+
], n[4] = h, n[5] = m, n[6] = T, n[7] = C, n[8] = E, n[9] = O) : (E = n[8], O = n[9]), y(E, O);
|
|
417
|
+
let k;
|
|
418
|
+
n[10] !== T || n[11] !== C || n[12] !== c?.length ? (k = () => {
|
|
419
|
+
!T || !C || c?.length === 0 && T.dispatchAction({
|
|
420
|
+
type: "brush",
|
|
421
|
+
areas: []
|
|
422
|
+
});
|
|
423
|
+
}, n[10] = T, n[11] = C, n[12] = c?.length, n[13] = k) : k = n[13];
|
|
424
|
+
let A;
|
|
425
|
+
n[14] !== T || n[15] !== C || n[16] !== c ? (A = [
|
|
426
|
+
T,
|
|
427
|
+
C,
|
|
428
|
+
c
|
|
429
|
+
], n[14] = T, n[15] = C, n[16] = c, n[17] = A) : A = n[17], y(k, A);
|
|
430
|
+
let j = C ? x.on : x.off, M = C ? "active" : void 0, N = C && ze.toggleActive, P;
|
|
431
|
+
n[18] === N ? P = n[19] : (P = {
|
|
432
|
+
...ze.toggle,
|
|
433
|
+
...N
|
|
434
|
+
}, n[18] = N, n[19] = P);
|
|
435
|
+
let F;
|
|
436
|
+
n[20] !== g || n[21] !== f ? (F = /* @__PURE__ */ z(g, {
|
|
437
|
+
fontSize: "small",
|
|
438
|
+
...f
|
|
439
|
+
}), n[20] = g, n[21] = f, n[22] = F) : F = n[22];
|
|
440
|
+
let I;
|
|
441
|
+
n[23] !== C || n[24] !== M || n[25] !== P || n[26] !== F || n[27] !== w || n[28] !== j ? (I = /* @__PURE__ */ z(D, {
|
|
442
|
+
size: "small",
|
|
443
|
+
"aria-label": j,
|
|
444
|
+
"aria-pressed": C,
|
|
445
|
+
onClick: w,
|
|
446
|
+
className: M,
|
|
447
|
+
sx: P,
|
|
448
|
+
children: F
|
|
449
|
+
}), n[23] = C, n[24] = M, n[25] = P, n[26] = F, n[27] = w, n[28] = j, n[29] = I) : I = n[29];
|
|
450
|
+
let L;
|
|
451
|
+
return n[30] !== I || n[31] !== j ? (L = /* @__PURE__ */ z(e, {
|
|
452
|
+
title: j,
|
|
453
|
+
children: I
|
|
454
|
+
}), n[30] = I, n[31] = j, n[32] = L) : L = n[32], L;
|
|
455
|
+
}
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/widgets-v2/actions/relative-data/transforms.ts
|
|
458
|
+
function He(e) {
|
|
459
|
+
return Array.isArray(e) ? e.every((e) => typeof e == "object" && !!e && "value" in e && typeof e.value == "number") : !1;
|
|
460
|
+
}
|
|
461
|
+
var Ue = (e) => Array.isArray(e) ? e.map((e) => {
|
|
462
|
+
if (!He(e)) return e;
|
|
463
|
+
let t = e.reduce((e, t) => e + Math.abs(t.value), 0);
|
|
464
|
+
return t <= 0 ? e : e.map((e) => ({
|
|
465
|
+
...e,
|
|
466
|
+
value: e.value / t * 100
|
|
467
|
+
}));
|
|
468
|
+
}) : e;
|
|
469
|
+
function We(e) {
|
|
470
|
+
let t = new Intl.NumberFormat(e, {
|
|
471
|
+
style: "percent",
|
|
472
|
+
minimumFractionDigits: 0,
|
|
473
|
+
maximumFractionDigits: 2
|
|
474
|
+
});
|
|
475
|
+
return (e) => typeof e != "number" || !Number.isFinite(e) ? String(e) : t.format(e / 100);
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/widgets-v2/actions/relative-data/labels.ts
|
|
479
|
+
var Ge = {
|
|
480
|
+
on: "Show absolute values",
|
|
481
|
+
off: "Show relative values",
|
|
482
|
+
scaleMenu: "Relative scale",
|
|
483
|
+
scaleMax: "Relative to max",
|
|
484
|
+
scaleTotal: "Relative to total"
|
|
485
|
+
}, Ke = {
|
|
486
|
+
group: {
|
|
487
|
+
display: "inline-flex",
|
|
488
|
+
alignItems: "center"
|
|
489
|
+
},
|
|
490
|
+
toggle: {
|
|
491
|
+
p: .5,
|
|
492
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
493
|
+
},
|
|
494
|
+
toggleActive: { background: (e) => e.palette.primary.relatedLight },
|
|
495
|
+
arrow: {
|
|
496
|
+
p: 0,
|
|
497
|
+
width: 16,
|
|
498
|
+
borderRadius: .5,
|
|
499
|
+
"& .MuiSvgIcon-root": { fontSize: 18 }
|
|
500
|
+
}
|
|
501
|
+
}, qe = {
|
|
502
|
+
id: _,
|
|
503
|
+
type: "data",
|
|
504
|
+
order: 15
|
|
505
|
+
}, Je = {
|
|
506
|
+
id: "relative-data-axis",
|
|
507
|
+
type: "config",
|
|
508
|
+
order: 15
|
|
509
|
+
}, Ye = (e) => e;
|
|
510
|
+
function Xe(t) {
|
|
511
|
+
let i = v(67), { initialEnabled: a, scale: o, locale: s, labels: c, icon: l, iconProps: u, transform: p } = t, m = a !== void 0 && a, h = o === void 0 ? "max" : o, _ = l === void 0 ? re : l, b = r(), x;
|
|
512
|
+
i[0] === c ? x = i[1] : (x = {
|
|
513
|
+
...Ge,
|
|
514
|
+
...c
|
|
515
|
+
}, i[0] = c, i[1] = x);
|
|
516
|
+
let w = x, T = n(b, Qe), E = T ?? h, O = p ?? Ue, A;
|
|
517
|
+
i[2] === O ? A = i[3] : (A = {
|
|
518
|
+
descriptor: qe,
|
|
519
|
+
fn: O
|
|
520
|
+
}, i[2] = O, i[3] = A);
|
|
521
|
+
let N = E === "total" ? g : Ye, P;
|
|
522
|
+
i[4] === N ? P = i[5] : (P = {
|
|
523
|
+
descriptor: Je,
|
|
524
|
+
fn: N
|
|
525
|
+
}, i[4] = N, i[5] = P);
|
|
526
|
+
let F;
|
|
527
|
+
i[6] !== A || i[7] !== P ? (F = [A, P], i[6] = A, i[7] = P, i[8] = F) : F = i[8];
|
|
528
|
+
let I = F, L;
|
|
529
|
+
i[9] === m ? L = i[10] : (L = { initialEnabled: m }, i[9] = m, i[10] = L);
|
|
530
|
+
let { enabled: R, setEnabled: te, toggle: ne } = f(b, I, L), V, H;
|
|
531
|
+
i[11] !== b || i[12] !== m || i[13] !== h || i[14] !== T ? (V = () => {
|
|
532
|
+
T === void 0 && et(b, h, m);
|
|
533
|
+
}, H = [
|
|
534
|
+
b,
|
|
535
|
+
T,
|
|
536
|
+
h,
|
|
537
|
+
m
|
|
538
|
+
], i[11] = b, i[12] = m, i[13] = h, i[14] = T, i[15] = V, i[16] = H) : (V = i[15], H = i[16]), y(V, H);
|
|
539
|
+
let [U, W] = S(null), G;
|
|
540
|
+
i[17] !== b || i[18] !== m || i[19] !== te ? (G = (e) => {
|
|
541
|
+
et(b, e, m), te(!0), W(null);
|
|
542
|
+
}, i[17] = b, i[18] = m, i[19] = te, i[20] = G) : G = i[20];
|
|
543
|
+
let K = G, q;
|
|
544
|
+
i[21] === s ? q = i[22] : (q = We(s), i[21] = s, i[22] = q);
|
|
545
|
+
let J = q, Y = n(b, Ze), ie, ae;
|
|
546
|
+
i[23] !== R || i[24] !== b || i[25] !== J || i[26] !== Y ? (ie = () => {
|
|
547
|
+
d(b).setState({ formatter: R ? J : Y });
|
|
548
|
+
}, ae = [
|
|
549
|
+
b,
|
|
550
|
+
R,
|
|
551
|
+
J,
|
|
552
|
+
Y
|
|
553
|
+
], i[23] = R, i[24] = b, i[25] = J, i[26] = Y, i[27] = ie, i[28] = ae) : (ie = i[27], ae = i[28]), y(ie, ae);
|
|
554
|
+
let X = R ? w.on : w.off, Z = R && Ke.toggleActive, oe;
|
|
555
|
+
i[29] === Z ? oe = i[30] : (oe = {
|
|
556
|
+
...Ke.toggle,
|
|
557
|
+
...Z
|
|
558
|
+
}, i[29] = Z, i[30] = oe);
|
|
559
|
+
let Q;
|
|
560
|
+
i[31] !== _ || i[32] !== u ? (Q = /* @__PURE__ */ z(_, {
|
|
561
|
+
fontSize: "small",
|
|
562
|
+
...u
|
|
563
|
+
}), i[31] = _, i[32] = u, i[33] = Q) : Q = i[33];
|
|
564
|
+
let se;
|
|
565
|
+
i[34] !== R || i[35] !== oe || i[36] !== Q || i[37] !== ne || i[38] !== X ? (se = /* @__PURE__ */ z(D, {
|
|
566
|
+
size: "small",
|
|
567
|
+
"aria-label": X,
|
|
568
|
+
"aria-pressed": R,
|
|
569
|
+
onClick: ne,
|
|
570
|
+
sx: oe,
|
|
571
|
+
children: Q
|
|
572
|
+
}), i[34] = R, i[35] = oe, i[36] = Q, i[37] = ne, i[38] = X, i[39] = se) : se = i[39];
|
|
573
|
+
let ce;
|
|
574
|
+
i[40] !== se || i[41] !== X ? (ce = /* @__PURE__ */ z(e, {
|
|
575
|
+
title: X,
|
|
576
|
+
children: se
|
|
577
|
+
}), i[40] = se, i[41] = X, i[42] = ce) : ce = i[42];
|
|
578
|
+
let le = U ? "true" : void 0, ue;
|
|
579
|
+
i[43] === Symbol.for("react.memo_cache_sentinel") ? (ue = (e) => W(e.currentTarget), i[43] = ue) : ue = i[43];
|
|
580
|
+
let de;
|
|
581
|
+
i[44] === Symbol.for("react.memo_cache_sentinel") ? (de = /* @__PURE__ */ z(ee, {}), i[44] = de) : de = i[44];
|
|
582
|
+
let fe;
|
|
583
|
+
i[45] !== w.scaleMenu || i[46] !== le ? (fe = /* @__PURE__ */ z(D, {
|
|
584
|
+
size: "small",
|
|
585
|
+
"aria-label": w.scaleMenu,
|
|
586
|
+
"aria-haspopup": "true",
|
|
587
|
+
"aria-expanded": le,
|
|
588
|
+
onClick: ue,
|
|
589
|
+
sx: Ke.arrow,
|
|
590
|
+
children: de
|
|
591
|
+
}), i[45] = w.scaleMenu, i[46] = le, i[47] = fe) : fe = i[47];
|
|
592
|
+
let $;
|
|
593
|
+
i[48] !== w.scaleMenu || i[49] !== fe ? ($ = /* @__PURE__ */ z(e, {
|
|
594
|
+
title: w.scaleMenu,
|
|
595
|
+
children: fe
|
|
596
|
+
}), i[48] = w.scaleMenu, i[49] = fe, i[50] = $) : $ = i[50];
|
|
597
|
+
let pe = !!U, me;
|
|
598
|
+
i[51] === Symbol.for("react.memo_cache_sentinel") ? (me = () => W(null), i[51] = me) : me = i[51];
|
|
599
|
+
let he, ge;
|
|
600
|
+
i[52] === Symbol.for("react.memo_cache_sentinel") ? (he = {
|
|
601
|
+
vertical: "bottom",
|
|
602
|
+
horizontal: "right"
|
|
603
|
+
}, ge = {
|
|
604
|
+
vertical: "top",
|
|
605
|
+
horizontal: "right"
|
|
606
|
+
}, i[52] = he, i[53] = ge) : (he = i[52], ge = i[53]);
|
|
607
|
+
let _e;
|
|
608
|
+
i[54] !== w.scaleMax || i[55] !== w.scaleTotal || i[56] !== E || i[57] !== K ? (_e = $e.map((e) => /* @__PURE__ */ z(M, {
|
|
609
|
+
selected: e === E,
|
|
610
|
+
onClick: () => K(e),
|
|
611
|
+
children: /* @__PURE__ */ z(k, { children: e === "max" ? w.scaleMax : w.scaleTotal })
|
|
612
|
+
}, e)), i[54] = w.scaleMax, i[55] = w.scaleTotal, i[56] = E, i[57] = K, i[58] = _e) : _e = i[58];
|
|
613
|
+
let ve;
|
|
614
|
+
i[59] !== U || i[60] !== pe || i[61] !== _e ? (ve = /* @__PURE__ */ z(j, {
|
|
615
|
+
anchorEl: U,
|
|
616
|
+
open: pe,
|
|
617
|
+
onClose: me,
|
|
618
|
+
variant: "menu",
|
|
619
|
+
elevation: 8,
|
|
620
|
+
anchorOrigin: he,
|
|
621
|
+
transformOrigin: ge,
|
|
622
|
+
children: _e
|
|
623
|
+
}), i[59] = U, i[60] = pe, i[61] = _e, i[62] = ve) : ve = i[62];
|
|
624
|
+
let ye;
|
|
625
|
+
return i[63] !== ce || i[64] !== $ || i[65] !== ve ? (ye = /* @__PURE__ */ B(C, {
|
|
626
|
+
sx: Ke.group,
|
|
627
|
+
children: [
|
|
628
|
+
ce,
|
|
629
|
+
$,
|
|
630
|
+
ve
|
|
631
|
+
]
|
|
632
|
+
}), i[63] = ce, i[64] = $, i[65] = ve, i[66] = ye) : ye = i[66], ye;
|
|
633
|
+
}
|
|
634
|
+
function Ze(e) {
|
|
635
|
+
return e.rawFormatter;
|
|
636
|
+
}
|
|
637
|
+
function Qe(e) {
|
|
638
|
+
return e.transformStates[qe.id]?.scale;
|
|
639
|
+
}
|
|
640
|
+
var $e = ["max", "total"];
|
|
641
|
+
function et(e, t, n) {
|
|
642
|
+
d(e).setState((e) => ({ transformStates: {
|
|
643
|
+
...e.transformStates,
|
|
644
|
+
[qe.id]: {
|
|
645
|
+
enabled: n,
|
|
646
|
+
...e.transformStates[qe.id],
|
|
647
|
+
scale: t
|
|
648
|
+
}
|
|
649
|
+
} }));
|
|
650
|
+
}
|
|
651
|
+
//#endregion
|
|
652
|
+
//#region src/widgets-v2/actions/fullscreen/labels.ts
|
|
653
|
+
var tt = {
|
|
654
|
+
open: "Open in full screen",
|
|
655
|
+
close: "Exit full screen"
|
|
656
|
+
}, nt = {
|
|
657
|
+
inlineSlot: {
|
|
658
|
+
display: "flex",
|
|
659
|
+
flexDirection: "column",
|
|
660
|
+
flex: 1,
|
|
661
|
+
minHeight: 0,
|
|
662
|
+
gap: 1
|
|
663
|
+
},
|
|
664
|
+
trigger: {
|
|
665
|
+
p: .5,
|
|
666
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
667
|
+
},
|
|
668
|
+
triggerActive: { background: (e) => e.palette.primary.relatedLight },
|
|
669
|
+
dialogPaper: {
|
|
670
|
+
width: "auto",
|
|
671
|
+
height: "auto",
|
|
672
|
+
minWidth: "70vw",
|
|
673
|
+
minHeight: "70vh",
|
|
674
|
+
maxWidth: "90vw",
|
|
675
|
+
maxHeight: "90vh"
|
|
676
|
+
},
|
|
677
|
+
dialogTitle: {
|
|
678
|
+
display: "flex",
|
|
679
|
+
alignItems: "center",
|
|
680
|
+
justifyContent: "space-between",
|
|
681
|
+
gap: 1,
|
|
682
|
+
py: 3,
|
|
683
|
+
pr: 3,
|
|
684
|
+
pb: 2
|
|
685
|
+
},
|
|
686
|
+
dialogActions: {
|
|
687
|
+
display: "flex",
|
|
688
|
+
alignItems: "center",
|
|
689
|
+
gap: .5,
|
|
690
|
+
flexShrink: 0
|
|
691
|
+
},
|
|
692
|
+
titleText: {
|
|
693
|
+
minWidth: 0,
|
|
694
|
+
overflow: "hidden",
|
|
695
|
+
textOverflow: "ellipsis",
|
|
696
|
+
whiteSpace: "nowrap"
|
|
697
|
+
},
|
|
698
|
+
dialogContent: {
|
|
699
|
+
display: "flex",
|
|
700
|
+
flexDirection: "column",
|
|
701
|
+
gap: 1,
|
|
702
|
+
py: 3,
|
|
703
|
+
px: 2.5,
|
|
704
|
+
overflow: "auto",
|
|
705
|
+
minHeight: 0
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
//#endregion
|
|
709
|
+
//#region src/widgets-v2/actions/fullscreen/fullscreen.tsx
|
|
710
|
+
function rt(t) {
|
|
711
|
+
let i = v(20), { labels: a, enterIcon: o, exitIcon: s, iconProps: c } = t, l = o === void 0 ? H : o, u = s === void 0 ? U : s, f = r(), p;
|
|
712
|
+
i[0] === a ? p = i[1] : (p = {
|
|
713
|
+
...tt,
|
|
714
|
+
...a
|
|
715
|
+
}, i[0] = a, i[1] = p);
|
|
716
|
+
let m = p, h = n(f, it), g;
|
|
717
|
+
i[2] !== f || i[3] !== h ? (g = () => {
|
|
718
|
+
d(f).setState({ isFullScreen: !h });
|
|
719
|
+
}, i[2] = f, i[3] = h, i[4] = g) : g = i[4];
|
|
720
|
+
let _ = g, y = h ? m.close : m.open, b = h ? u : l, x = h ? "active" : void 0, S = h && nt.triggerActive, C;
|
|
721
|
+
i[5] === S ? C = i[6] : (C = {
|
|
722
|
+
...nt.trigger,
|
|
723
|
+
...S
|
|
724
|
+
}, i[5] = S, i[6] = C);
|
|
725
|
+
let w;
|
|
726
|
+
i[7] !== b || i[8] !== c ? (w = /* @__PURE__ */ z(b, {
|
|
727
|
+
fontSize: "small",
|
|
728
|
+
...c
|
|
729
|
+
}), i[7] = b, i[8] = c, i[9] = w) : w = i[9];
|
|
730
|
+
let T;
|
|
731
|
+
i[10] !== _ || i[11] !== h || i[12] !== x || i[13] !== C || i[14] !== w || i[15] !== y ? (T = /* @__PURE__ */ z(D, {
|
|
732
|
+
size: "small",
|
|
733
|
+
"aria-label": y,
|
|
734
|
+
"aria-pressed": h,
|
|
735
|
+
onClick: _,
|
|
736
|
+
className: x,
|
|
737
|
+
sx: C,
|
|
738
|
+
children: w
|
|
739
|
+
}), i[10] = _, i[11] = h, i[12] = x, i[13] = C, i[14] = w, i[15] = y, i[16] = T) : T = i[16];
|
|
740
|
+
let E;
|
|
741
|
+
return i[17] !== T || i[18] !== y ? (E = /* @__PURE__ */ z(e, {
|
|
742
|
+
title: y,
|
|
743
|
+
children: T
|
|
744
|
+
}), i[17] = T, i[18] = y, i[19] = E) : E = i[19], E;
|
|
745
|
+
}
|
|
746
|
+
function it(e) {
|
|
747
|
+
return e.isFullScreen ?? !1;
|
|
748
|
+
}
|
|
749
|
+
function at(e) {
|
|
750
|
+
return `${e}::fullscreen`;
|
|
751
|
+
}
|
|
752
|
+
var ot = /* @__PURE__ */ new Set([
|
|
753
|
+
"rawData",
|
|
754
|
+
"data",
|
|
755
|
+
"dataTransforms",
|
|
756
|
+
"configTransforms",
|
|
757
|
+
"isLoading",
|
|
758
|
+
"isFetching",
|
|
759
|
+
"error",
|
|
760
|
+
"rawFormatter",
|
|
761
|
+
"labelFormatter",
|
|
762
|
+
"isFullScreen"
|
|
763
|
+
]);
|
|
764
|
+
function st(e) {
|
|
765
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => !ot.has(e)));
|
|
766
|
+
}
|
|
767
|
+
function ct(t) {
|
|
768
|
+
let i = v(56), { children: a, title: o, actions: s, paperSx: c, labels: u, closeIcon: f, iconProps: p } = t, m = f === void 0 ? ne : f, h = r(), g;
|
|
769
|
+
i[0] === u ? g = i[1] : (g = {
|
|
770
|
+
...tt,
|
|
771
|
+
...u
|
|
772
|
+
}, i[0] = u, i[1] = g);
|
|
773
|
+
let _ = g, y = n(h, lt), S = L(), O;
|
|
774
|
+
i[2] === S.breakpoints ? O = i[3] : (O = S.breakpoints.down("sm"), i[2] = S.breakpoints, i[3] = O);
|
|
775
|
+
let k = I(O), A;
|
|
776
|
+
i[4] === h ? A = i[5] : (A = () => {
|
|
777
|
+
d(h).setState({ isFullScreen: !1 });
|
|
778
|
+
}, i[4] = h, i[5] = A);
|
|
779
|
+
let j = A, M = x(y), N, P;
|
|
780
|
+
i[6] !== h || i[7] !== y ? (N = () => {
|
|
781
|
+
let e = at(h);
|
|
782
|
+
M.current && !y && l(e) && d(h).setState(st(d(e).getState())), M.current = y;
|
|
783
|
+
}, P = [h, y], i[6] = h, i[7] = y, i[8] = N, i[9] = P) : (N = i[8], P = i[9]), b(N, P);
|
|
784
|
+
let ee = `widget-fullscreen-title-${h}`, te;
|
|
785
|
+
i[10] === a ? te = i[11] : (te = (e) => typeof a == "function" ? a(e) : a, i[10] = a, i[11] = te);
|
|
786
|
+
let V = te, H;
|
|
787
|
+
i[12] === V ? H = i[13] : (H = V(!1), i[12] = V, i[13] = H);
|
|
788
|
+
let U;
|
|
789
|
+
i[14] === H ? U = i[15] : (U = /* @__PURE__ */ z(C, {
|
|
790
|
+
sx: nt.inlineSlot,
|
|
791
|
+
children: H
|
|
792
|
+
}), i[14] = H, i[15] = U);
|
|
793
|
+
let W;
|
|
794
|
+
i[16] !== k || i[17] !== c ? (W = k ? void 0 : { sx: gt(c) }, i[16] = k, i[17] = c, i[18] = W) : W = i[18];
|
|
795
|
+
let G;
|
|
796
|
+
i[19] === o ? G = i[20] : (G = /* @__PURE__ */ z(F, {
|
|
797
|
+
variant: "subtitle1",
|
|
798
|
+
component: "span",
|
|
799
|
+
sx: nt.titleText,
|
|
800
|
+
children: o
|
|
801
|
+
}), i[19] = o, i[20] = G);
|
|
802
|
+
let K;
|
|
803
|
+
i[21] !== m || i[22] !== p ? (K = /* @__PURE__ */ z(m, {
|
|
804
|
+
fontSize: "small",
|
|
805
|
+
...p
|
|
806
|
+
}), i[21] = m, i[22] = p, i[23] = K) : K = i[23];
|
|
807
|
+
let re;
|
|
808
|
+
i[24] !== _.close || i[25] !== j || i[26] !== K ? (re = /* @__PURE__ */ z(D, {
|
|
809
|
+
size: "medium",
|
|
810
|
+
"aria-label": _.close,
|
|
811
|
+
onClick: j,
|
|
812
|
+
children: K
|
|
813
|
+
}), i[24] = _.close, i[25] = j, i[26] = K, i[27] = re) : re = i[27];
|
|
814
|
+
let q;
|
|
815
|
+
i[28] !== _.close || i[29] !== re ? (q = /* @__PURE__ */ z(e, {
|
|
816
|
+
title: _.close,
|
|
817
|
+
children: re
|
|
818
|
+
}), i[28] = _.close, i[29] = re, i[30] = q) : q = i[30];
|
|
819
|
+
let J;
|
|
820
|
+
i[31] !== s || i[32] !== q ? (J = /* @__PURE__ */ B(C, {
|
|
821
|
+
sx: nt.dialogActions,
|
|
822
|
+
children: [s, q]
|
|
823
|
+
}), i[31] = s, i[32] = q, i[33] = J) : J = i[33];
|
|
824
|
+
let Y;
|
|
825
|
+
i[34] !== G || i[35] !== J || i[36] !== ee ? (Y = /* @__PURE__ */ B(E, {
|
|
826
|
+
id: ee,
|
|
827
|
+
component: "div",
|
|
828
|
+
sx: nt.dialogTitle,
|
|
829
|
+
children: [G, J]
|
|
830
|
+
}), i[34] = G, i[35] = J, i[36] = ee, i[37] = Y) : Y = i[37];
|
|
831
|
+
let ie;
|
|
832
|
+
i[38] === V ? ie = i[39] : (ie = V(!0), i[38] = V, i[39] = ie);
|
|
833
|
+
let ae;
|
|
834
|
+
i[40] === ie ? ae = i[41] : (ae = /* @__PURE__ */ z(T, {
|
|
835
|
+
sx: nt.dialogContent,
|
|
836
|
+
children: ie
|
|
837
|
+
}), i[40] = ie, i[41] = ae);
|
|
838
|
+
let X;
|
|
839
|
+
i[42] !== h || i[43] !== Y || i[44] !== ae ? (X = /* @__PURE__ */ B(ut, {
|
|
840
|
+
sourceId: h,
|
|
841
|
+
children: [Y, ae]
|
|
842
|
+
}), i[42] = h, i[43] = Y, i[44] = ae, i[45] = X) : X = i[45];
|
|
843
|
+
let Z;
|
|
844
|
+
i[46] !== k || i[47] !== j || i[48] !== y || i[49] !== W || i[50] !== X || i[51] !== ee ? (Z = /* @__PURE__ */ z(w, {
|
|
845
|
+
open: y,
|
|
846
|
+
onClose: j,
|
|
847
|
+
fullScreen: k,
|
|
848
|
+
PaperProps: W,
|
|
849
|
+
"aria-labelledby": ee,
|
|
850
|
+
children: X
|
|
851
|
+
}), i[46] = k, i[47] = j, i[48] = y, i[49] = W, i[50] = X, i[51] = ee, i[52] = Z) : Z = i[52];
|
|
852
|
+
let oe;
|
|
853
|
+
return i[53] !== Z || i[54] !== U ? (oe = /* @__PURE__ */ B(R, { children: [U, Z] }), i[53] = Z, i[54] = U, i[55] = oe) : oe = i[55], oe;
|
|
854
|
+
}
|
|
855
|
+
function lt(e) {
|
|
856
|
+
return e.isFullScreen ?? !1;
|
|
857
|
+
}
|
|
858
|
+
function ut(e) {
|
|
859
|
+
let n = v(24), { sourceId: r, children: a } = e, o;
|
|
860
|
+
n[0] === r ? o = n[1] : (o = at(r), n[0] = r, n[1] = o);
|
|
861
|
+
let s = o, l = t(r, dt), u;
|
|
862
|
+
n[2] !== s || n[3] !== l.error || n[4] !== l.formatter || n[5] !== l.isFetching || n[6] !== l.isLoading || n[7] !== l.labelFormatter || n[8] !== l.rawData || n[9] !== r ? (u = () => {
|
|
863
|
+
let e = c(s, {
|
|
864
|
+
data: l.rawData,
|
|
865
|
+
isLoading: l.isLoading,
|
|
866
|
+
isFetching: l.isFetching,
|
|
867
|
+
error: l.error,
|
|
868
|
+
formatter: l.formatter,
|
|
869
|
+
labelFormatter: l.labelFormatter
|
|
870
|
+
});
|
|
871
|
+
return e.setState(st(d(r).getState())), h(s, e), e;
|
|
872
|
+
}, n[2] = s, n[3] = l.error, n[4] = l.formatter, n[5] = l.isFetching, n[6] = l.isLoading, n[7] = l.labelFormatter, n[8] = l.rawData, n[9] = r, n[10] = u) : u = n[10], S(u);
|
|
873
|
+
let f, p;
|
|
874
|
+
n[11] !== s || n[12] !== r ? (f = () => {
|
|
875
|
+
let e = null, t = i(s, (t) => {
|
|
876
|
+
let n = ft(r);
|
|
877
|
+
t && n && pt(n, t, n.getOption()), e = t;
|
|
878
|
+
});
|
|
879
|
+
return () => {
|
|
880
|
+
t();
|
|
881
|
+
let n = ft(r);
|
|
882
|
+
n && e && !e.isDisposed() && pt(e, n, ht(e));
|
|
883
|
+
};
|
|
884
|
+
}, p = [s, r], n[11] = s, n[12] = r, n[13] = f, n[14] = p) : (f = n[13], p = n[14]), b(f, p);
|
|
885
|
+
let m;
|
|
886
|
+
return n[15] !== a || n[16] !== s || n[17] !== l.error || n[18] !== l.formatter || n[19] !== l.isFetching || n[20] !== l.isLoading || n[21] !== l.labelFormatter || n[22] !== l.rawData ? (m = /* @__PURE__ */ z($, {
|
|
887
|
+
id: s,
|
|
888
|
+
data: l.rawData,
|
|
889
|
+
isLoading: l.isLoading,
|
|
890
|
+
isFetching: l.isFetching,
|
|
891
|
+
error: l.error,
|
|
892
|
+
formatter: l.formatter,
|
|
893
|
+
labelFormatter: l.labelFormatter,
|
|
894
|
+
children: a
|
|
895
|
+
}), n[15] = a, n[16] = s, n[17] = l.error, n[18] = l.formatter, n[19] = l.isFetching, n[20] = l.isLoading, n[21] = l.labelFormatter, n[22] = l.rawData, n[23] = m) : m = n[23], m;
|
|
896
|
+
}
|
|
897
|
+
function dt(e) {
|
|
898
|
+
return {
|
|
899
|
+
rawData: e.rawData,
|
|
900
|
+
isLoading: e.isLoading,
|
|
901
|
+
isFetching: e.isFetching,
|
|
902
|
+
error: e.error,
|
|
903
|
+
formatter: e.rawFormatter,
|
|
904
|
+
labelFormatter: e.labelFormatter
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
function ft(e) {
|
|
908
|
+
let t = a(e);
|
|
909
|
+
return t && !t.isDisposed() ? t : null;
|
|
910
|
+
}
|
|
911
|
+
function pt(e, t, n) {
|
|
912
|
+
t.setOption(n), t.dispatchAction({ type: "hideTip" }), t.dispatchAction({
|
|
913
|
+
type: "updateAxisPointer",
|
|
914
|
+
currTrigger: "leave"
|
|
915
|
+
});
|
|
916
|
+
let r = e.getModel?.().getComponent("brush")?.areas;
|
|
917
|
+
r?.length && t.dispatchAction({
|
|
918
|
+
type: "brush",
|
|
919
|
+
areas: r
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
var mt = [
|
|
923
|
+
"start",
|
|
924
|
+
"end",
|
|
925
|
+
"startValue",
|
|
926
|
+
"endValue"
|
|
927
|
+
];
|
|
928
|
+
function ht(e) {
|
|
929
|
+
let { legend: t, dataZoom: n } = e.getOption(), r = {};
|
|
930
|
+
return t?.some((e) => e.selected) && (r.legend = t.map((e) => e.selected ? { selected: e.selected } : {})), n?.length && (r.dataZoom = n.map((e) => Object.fromEntries(mt.filter((t) => e[t] !== void 0).map((t) => [t, e[t]])))), r;
|
|
931
|
+
}
|
|
932
|
+
function gt(e) {
|
|
933
|
+
let t = e ?? {};
|
|
934
|
+
return {
|
|
935
|
+
...nt.dialogPaper,
|
|
936
|
+
...t.width !== void 0 && { minWidth: 0 },
|
|
937
|
+
...t.height !== void 0 && { minHeight: 0 },
|
|
938
|
+
...t
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
var _t = {
|
|
942
|
+
Trigger: rt,
|
|
943
|
+
Slot: ct
|
|
944
|
+
};
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/widgets-v2/actions/lock-selection/transforms.ts
|
|
947
|
+
function vt(e, t) {
|
|
948
|
+
if (t.length === 0 || !Array.isArray(e)) return e;
|
|
949
|
+
let n = new Set(t);
|
|
950
|
+
return e.map((e) => Array.isArray(e) ? e.filter((e) => {
|
|
951
|
+
if (e == null) return !1;
|
|
952
|
+
if (typeof e == "object" && "name" in e) {
|
|
953
|
+
let t = e.name;
|
|
954
|
+
return typeof t == "string" || typeof t == "number" ? n.has(t) : !1;
|
|
955
|
+
}
|
|
956
|
+
return !1;
|
|
957
|
+
}) : e);
|
|
958
|
+
}
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region src/widgets-v2/actions/lock-selection/labels.ts
|
|
961
|
+
var yt = {
|
|
962
|
+
lock: "Lock selection",
|
|
963
|
+
unlock: "Unlock selection",
|
|
964
|
+
disabled: "Select rows to lock"
|
|
965
|
+
}, bt = {
|
|
966
|
+
toggle: {
|
|
967
|
+
p: .5,
|
|
968
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
969
|
+
},
|
|
970
|
+
toggleActive: { background: (e) => e.palette.primary.relatedLight }
|
|
971
|
+
}, xt = {
|
|
972
|
+
id: "lock-selection",
|
|
973
|
+
type: "data",
|
|
974
|
+
order: 30
|
|
975
|
+
};
|
|
976
|
+
function St(t) {
|
|
977
|
+
let n = v(28), { selection: i, lockedItems: a, onLockChange: o, labels: s, lockIcon: c, unlockIcon: l, iconProps: u, filterFn: d } = t, p = c === void 0 ? G : c, m = l === void 0 ? K : l, h = d === void 0 ? vt : d, g = r(), _;
|
|
978
|
+
n[0] === s ? _ = n[1] : (_ = {
|
|
979
|
+
...yt,
|
|
980
|
+
...s
|
|
981
|
+
}, n[0] = s, n[1] = _);
|
|
982
|
+
let b = _, x = a.length > 0, S = x || i.length > 0, C = Ct(a, h), w;
|
|
983
|
+
n[2] === x ? w = n[3] : (w = { initialEnabled: x }, n[2] = x, n[3] = w);
|
|
984
|
+
let { enabled: T, setEnabled: E } = f(g, C, w), O, k;
|
|
985
|
+
n[4] !== T || n[5] !== x || n[6] !== E ? (O = () => {
|
|
986
|
+
T !== x && E(x);
|
|
987
|
+
}, k = [
|
|
988
|
+
T,
|
|
989
|
+
x,
|
|
990
|
+
E
|
|
991
|
+
], n[4] = T, n[5] = x, n[6] = E, n[7] = O, n[8] = k) : (O = n[7], k = n[8]), y(O, k);
|
|
992
|
+
let A;
|
|
993
|
+
n[9] !== x || n[10] !== o || n[11] !== i ? (A = () => {
|
|
994
|
+
o(x ? [] : [...i]);
|
|
995
|
+
}, n[9] = x, n[10] = o, n[11] = i, n[12] = A) : A = n[12];
|
|
996
|
+
let j = A, M = S ? x ? b.unlock : b.lock : b.disabled, N = x ? m : p, P = !S, F = x && bt.toggleActive, I;
|
|
997
|
+
n[13] === F ? I = n[14] : (I = {
|
|
998
|
+
...bt.toggle,
|
|
999
|
+
...F
|
|
1000
|
+
}, n[13] = F, n[14] = I);
|
|
1001
|
+
let L;
|
|
1002
|
+
n[15] !== N || n[16] !== u ? (L = /* @__PURE__ */ z(N, {
|
|
1003
|
+
fontSize: "small",
|
|
1004
|
+
...u
|
|
1005
|
+
}), n[15] = N, n[16] = u, n[17] = L) : L = n[17];
|
|
1006
|
+
let R;
|
|
1007
|
+
n[18] !== j || n[19] !== x || n[20] !== I || n[21] !== L || n[22] !== P || n[23] !== M ? (R = /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(D, {
|
|
1008
|
+
size: "small",
|
|
1009
|
+
"aria-label": M,
|
|
1010
|
+
"aria-pressed": x,
|
|
1011
|
+
disabled: P,
|
|
1012
|
+
onClick: j,
|
|
1013
|
+
sx: I,
|
|
1014
|
+
children: L
|
|
1015
|
+
}) }), n[18] = j, n[19] = x, n[20] = I, n[21] = L, n[22] = P, n[23] = M, n[24] = R) : R = n[24];
|
|
1016
|
+
let B;
|
|
1017
|
+
return n[25] !== R || n[26] !== M ? (B = /* @__PURE__ */ z(e, {
|
|
1018
|
+
title: M,
|
|
1019
|
+
children: R
|
|
1020
|
+
}), n[25] = R, n[26] = M, n[27] = B) : B = n[27], B;
|
|
1021
|
+
}
|
|
1022
|
+
function Ct(e, t) {
|
|
1023
|
+
let n = v(6), r = x(t), i;
|
|
1024
|
+
n[0] === t ? i = n[1] : (i = () => {
|
|
1025
|
+
r.current = t;
|
|
1026
|
+
}, n[0] = t, n[1] = i), y(i);
|
|
1027
|
+
let a;
|
|
1028
|
+
n[2] === e ? a = n[3] : (a = (t) => r.current(t, e), n[2] = e, n[3] = a);
|
|
1029
|
+
let o = a, s;
|
|
1030
|
+
return n[4] === o ? s = n[5] : (s = [{
|
|
1031
|
+
descriptor: xt,
|
|
1032
|
+
fn: o
|
|
1033
|
+
}], n[4] = o, n[5] = s), s;
|
|
1034
|
+
}
|
|
1035
|
+
//#endregion
|
|
1036
|
+
//#region src/widgets-v2/actions/change-column/change-column-icon.tsx
|
|
1037
|
+
function wt(e) {
|
|
1038
|
+
let t = v(3), n;
|
|
1039
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ z("path", {
|
|
1040
|
+
fill: "currentColor",
|
|
1041
|
+
fillRule: "evenodd",
|
|
1042
|
+
d: "M14.25 2.25H3.75c-.825 0-1.5.675-1.5 1.5v10.5c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5V3.75c0-.825-.675-1.5-1.5-1.5m-3.75 12h-3V3.75h3zM3.75 3.75H6v10.5H3.75zM12 14.25V3.75h2.25v10.5z",
|
|
1043
|
+
clipRule: "evenodd"
|
|
1044
|
+
}), t[0] = n) : n = t[0];
|
|
1045
|
+
let r;
|
|
1046
|
+
return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ z(N, {
|
|
1047
|
+
viewBox: "0 0 18 18",
|
|
1048
|
+
...e,
|
|
1049
|
+
children: n
|
|
1050
|
+
}), t[1] = e, t[2] = r), r;
|
|
1051
|
+
}
|
|
1052
|
+
//#endregion
|
|
1053
|
+
//#region src/widgets-v2/actions/change-column/labels.ts
|
|
1054
|
+
var Tt = {
|
|
1055
|
+
trigger: "Change column order",
|
|
1056
|
+
title: "Column reorder",
|
|
1057
|
+
reset: "Reset to default"
|
|
1058
|
+
}, Et = {
|
|
1059
|
+
toggle: {
|
|
1060
|
+
p: .5,
|
|
1061
|
+
"& .MuiSvgIcon-root": { fontSize: 20 }
|
|
1062
|
+
},
|
|
1063
|
+
toggleActive: { background: (e) => e.palette.primary.relatedLight },
|
|
1064
|
+
menuPaper: { overflow: "hidden" },
|
|
1065
|
+
header: {
|
|
1066
|
+
color: "text.secondary",
|
|
1067
|
+
backgroundColor: "transparent",
|
|
1068
|
+
typography: "caption",
|
|
1069
|
+
px: 2,
|
|
1070
|
+
py: .75
|
|
1071
|
+
},
|
|
1072
|
+
item: {
|
|
1073
|
+
position: "relative",
|
|
1074
|
+
cursor: "grab",
|
|
1075
|
+
px: 2,
|
|
1076
|
+
touchAction: "none",
|
|
1077
|
+
"&:hover .change-column-drag-handle": { opacity: 1 },
|
|
1078
|
+
"&:focus-visible": {
|
|
1079
|
+
outline: "2px solid",
|
|
1080
|
+
outlineColor: "primary.main",
|
|
1081
|
+
outlineOffset: -2
|
|
1082
|
+
},
|
|
1083
|
+
"&:focus-visible .change-column-drag-handle": { opacity: 1 }
|
|
1084
|
+
},
|
|
1085
|
+
itemDragging: {
|
|
1086
|
+
opacity: .5,
|
|
1087
|
+
cursor: "grabbing"
|
|
1088
|
+
},
|
|
1089
|
+
dragHandle: {
|
|
1090
|
+
position: "absolute",
|
|
1091
|
+
left: 0,
|
|
1092
|
+
top: "50%",
|
|
1093
|
+
transform: "translateY(-50%)",
|
|
1094
|
+
color: "text.secondary",
|
|
1095
|
+
fontSize: 18,
|
|
1096
|
+
opacity: 0,
|
|
1097
|
+
transition: "opacity 0.1s",
|
|
1098
|
+
"@media (hover: none)": { opacity: 1 }
|
|
1099
|
+
},
|
|
1100
|
+
dragHandleVisible: { opacity: 1 }
|
|
1101
|
+
};
|
|
1102
|
+
//#endregion
|
|
1103
|
+
//#region src/widgets-v2/actions/change-column/sortable-column-item.tsx
|
|
1104
|
+
function Dt(e) {
|
|
1105
|
+
let t = v(24), { id: n, label: r, dragHandleIcon: i } = e, a = i === void 0 ? V : i, o;
|
|
1106
|
+
t[0] === n ? o = t[1] : (o = { id: n }, t[0] = n, t[1] = o);
|
|
1107
|
+
let { attributes: s, listeners: c, setNodeRef: l, transform: u, transition: d, isDragging: f } = Z(o), p;
|
|
1108
|
+
t[2] === u ? p = t[3] : (p = Q.Transform.toString(u ? {
|
|
1109
|
+
...u,
|
|
1110
|
+
x: 0
|
|
1111
|
+
} : null), t[2] = u, t[3] = p);
|
|
1112
|
+
let m;
|
|
1113
|
+
t[4] !== p || t[5] !== d ? (m = {
|
|
1114
|
+
transform: p,
|
|
1115
|
+
transition: d
|
|
1116
|
+
}, t[4] = p, t[5] = d, t[6] = m) : m = t[6];
|
|
1117
|
+
let h = m, g = f && Et.itemDragging, _;
|
|
1118
|
+
t[7] === g ? _ = t[8] : (_ = {
|
|
1119
|
+
...Et.item,
|
|
1120
|
+
...g
|
|
1121
|
+
}, t[7] = g, t[8] = _);
|
|
1122
|
+
let y = f && Et.dragHandleVisible, b;
|
|
1123
|
+
t[9] === y ? b = t[10] : (b = {
|
|
1124
|
+
...Et.dragHandle,
|
|
1125
|
+
...y
|
|
1126
|
+
}, t[9] = y, t[10] = b);
|
|
1127
|
+
let x;
|
|
1128
|
+
t[11] !== a || t[12] !== b ? (x = /* @__PURE__ */ z(a, {
|
|
1129
|
+
className: "change-column-drag-handle",
|
|
1130
|
+
sx: b
|
|
1131
|
+
}), t[11] = a, t[12] = b, t[13] = x) : x = t[13];
|
|
1132
|
+
let S;
|
|
1133
|
+
t[14] === r ? S = t[15] : (S = /* @__PURE__ */ z(k, { children: r }), t[14] = r, t[15] = S);
|
|
1134
|
+
let C;
|
|
1135
|
+
return t[16] !== s || t[17] !== c || t[18] !== l || t[19] !== S || t[20] !== _ || t[21] !== x || t[22] !== h ? (C = /* @__PURE__ */ B(M, {
|
|
1136
|
+
ref: l,
|
|
1137
|
+
style: h,
|
|
1138
|
+
...s,
|
|
1139
|
+
...c,
|
|
1140
|
+
disableGutters: !0,
|
|
1141
|
+
role: "menuitem",
|
|
1142
|
+
tabIndex: 0,
|
|
1143
|
+
sx: _,
|
|
1144
|
+
children: [x, S]
|
|
1145
|
+
}), t[16] = s, t[17] = c, t[18] = l, t[19] = S, t[20] = _, t[21] = x, t[22] = h, t[23] = C) : C = t[23], C;
|
|
1146
|
+
}
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#region src/widgets-v2/actions/change-column/change-column.tsx
|
|
1149
|
+
function Ot(t) {
|
|
1150
|
+
let i = v(55), { columns: a, labels: o, icon: s, iconProps: c, dragHandleIcon: l } = t, u = s === void 0 ? wt : s, f = r(), p;
|
|
1151
|
+
i[0] === o ? p = i[1] : (p = {
|
|
1152
|
+
...Tt,
|
|
1153
|
+
...o
|
|
1154
|
+
}, i[0] = o, i[1] = p);
|
|
1155
|
+
let m = p, [h, g] = S(null), _ = n(f, jt), y;
|
|
1156
|
+
if (i[2] !== _ || i[3] !== a) {
|
|
1157
|
+
bb0: {
|
|
1158
|
+
let e = a.map(At);
|
|
1159
|
+
if (!_ || _.length === 0) {
|
|
1160
|
+
y = e;
|
|
1161
|
+
break bb0;
|
|
1162
|
+
}
|
|
1163
|
+
let t = new Set(e), n = /* @__PURE__ */ new Set(), r = [];
|
|
1164
|
+
for (let e of _) t.has(e) && !n.has(e) && (r.push(e), n.add(e));
|
|
1165
|
+
for (let t of e) n.has(t) || r.push(t);
|
|
1166
|
+
y = r;
|
|
1167
|
+
}
|
|
1168
|
+
i[2] = _, i[3] = a, i[4] = y;
|
|
1169
|
+
} else y = i[4];
|
|
1170
|
+
let b = y, x;
|
|
1171
|
+
i[5] === a ? x = i[6] : (x = new Map(a.map(kt)), i[5] = a, i[6] = x);
|
|
1172
|
+
let C = x, w;
|
|
1173
|
+
if (i[7] !== C || i[8] !== b) {
|
|
1174
|
+
w = [];
|
|
1175
|
+
for (let e of b) {
|
|
1176
|
+
let t = C.get(e);
|
|
1177
|
+
t != null && w.push(t);
|
|
1178
|
+
}
|
|
1179
|
+
i[7] = C, i[8] = b, i[9] = w;
|
|
1180
|
+
} else w = i[9];
|
|
1181
|
+
let T = w, E;
|
|
1182
|
+
i[10] === Symbol.for("react.memo_cache_sentinel") ? (E = { coordinateGetter: X }, i[10] = E) : E = i[10];
|
|
1183
|
+
let O = fe(de(le), de(ce, E)), k;
|
|
1184
|
+
i[11] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => {
|
|
1185
|
+
e.stopPropagation(), g(e.currentTarget);
|
|
1186
|
+
}, i[11] = k) : k = i[11];
|
|
1187
|
+
let M = k, N;
|
|
1188
|
+
i[12] === Symbol.for("react.memo_cache_sentinel") ? (N = () => g(null), i[12] = N) : N = i[12];
|
|
1189
|
+
let P = N, F;
|
|
1190
|
+
i[13] !== f || i[14] !== b ? (F = (e) => {
|
|
1191
|
+
let { active: t, over: n } = e;
|
|
1192
|
+
if (!n || t.id === n.id) return;
|
|
1193
|
+
let r = b.indexOf(String(t.id)), i = b.indexOf(String(n.id));
|
|
1194
|
+
if (r === -1 || i === -1) return;
|
|
1195
|
+
let a = ae([...b], r, i);
|
|
1196
|
+
d(f).setState({ columnOrder: a });
|
|
1197
|
+
}, i[13] = f, i[14] = b, i[15] = F) : F = i[15];
|
|
1198
|
+
let I = F;
|
|
1199
|
+
if (a.length < 2) return null;
|
|
1200
|
+
let L = !!h, ee = L ? "change-column-menu" : void 0, te = L ? "true" : void 0, ne = L ? "active" : void 0, V = L && Et.toggleActive, H;
|
|
1201
|
+
i[16] === V ? H = i[17] : (H = {
|
|
1202
|
+
...Et.toggle,
|
|
1203
|
+
...V
|
|
1204
|
+
}, i[16] = V, i[17] = H);
|
|
1205
|
+
let U;
|
|
1206
|
+
i[18] !== u || i[19] !== c ? (U = /* @__PURE__ */ z(u, {
|
|
1207
|
+
fontSize: "small",
|
|
1208
|
+
...c
|
|
1209
|
+
}), i[18] = u, i[19] = c, i[20] = U) : U = i[20];
|
|
1210
|
+
let W;
|
|
1211
|
+
i[21] !== m.trigger || i[22] !== L || i[23] !== te || i[24] !== ne || i[25] !== H || i[26] !== U || i[27] !== ee ? (W = /* @__PURE__ */ z(D, {
|
|
1212
|
+
size: "small",
|
|
1213
|
+
"aria-label": m.trigger,
|
|
1214
|
+
"aria-pressed": L,
|
|
1215
|
+
"aria-haspopup": "true",
|
|
1216
|
+
"aria-controls": ee,
|
|
1217
|
+
"aria-expanded": te,
|
|
1218
|
+
onClick: M,
|
|
1219
|
+
className: ne,
|
|
1220
|
+
sx: H,
|
|
1221
|
+
children: U
|
|
1222
|
+
}), i[21] = m.trigger, i[22] = L, i[23] = te, i[24] = ne, i[25] = H, i[26] = U, i[27] = ee, i[28] = W) : W = i[28];
|
|
1223
|
+
let G;
|
|
1224
|
+
i[29] !== m.trigger || i[30] !== W ? (G = /* @__PURE__ */ z(e, {
|
|
1225
|
+
title: m.trigger,
|
|
1226
|
+
children: W
|
|
1227
|
+
}), i[29] = m.trigger, i[30] = W, i[31] = G) : G = i[31];
|
|
1228
|
+
let K, re, q;
|
|
1229
|
+
i[32] === Symbol.for("react.memo_cache_sentinel") ? (K = {
|
|
1230
|
+
vertical: "bottom",
|
|
1231
|
+
horizontal: "right"
|
|
1232
|
+
}, re = {
|
|
1233
|
+
vertical: "top",
|
|
1234
|
+
horizontal: "right"
|
|
1235
|
+
}, q = { paper: { sx: Et.menuPaper } }, i[32] = K, i[33] = re, i[34] = q) : (K = i[32], re = i[33], q = i[34]);
|
|
1236
|
+
let J;
|
|
1237
|
+
i[35] === m.title ? J = i[36] : (J = /* @__PURE__ */ z(A, {
|
|
1238
|
+
disableSticky: !0,
|
|
1239
|
+
role: "presentation",
|
|
1240
|
+
sx: Et.header,
|
|
1241
|
+
children: m.title
|
|
1242
|
+
}), i[35] = m.title, i[36] = J);
|
|
1243
|
+
let Y;
|
|
1244
|
+
i[37] !== l || i[38] !== T ? (Y = T.map((e) => /* @__PURE__ */ z(Dt, {
|
|
1245
|
+
id: e.id,
|
|
1246
|
+
label: e.label,
|
|
1247
|
+
dragHandleIcon: l
|
|
1248
|
+
}, e.id)), i[37] = l, i[38] = T, i[39] = Y) : Y = i[39];
|
|
1249
|
+
let Z;
|
|
1250
|
+
i[40] !== b || i[41] !== Y ? (Z = /* @__PURE__ */ z(ie, {
|
|
1251
|
+
items: b,
|
|
1252
|
+
strategy: oe,
|
|
1253
|
+
children: Y
|
|
1254
|
+
}), i[40] = b, i[41] = Y, i[42] = Z) : Z = i[42];
|
|
1255
|
+
let Q;
|
|
1256
|
+
i[43] !== h || i[44] !== L || i[45] !== J || i[46] !== Z ? (Q = /* @__PURE__ */ B(j, {
|
|
1257
|
+
id: "change-column-menu",
|
|
1258
|
+
anchorEl: h,
|
|
1259
|
+
open: L,
|
|
1260
|
+
onClose: P,
|
|
1261
|
+
anchorOrigin: K,
|
|
1262
|
+
transformOrigin: re,
|
|
1263
|
+
slotProps: q,
|
|
1264
|
+
children: [J, Z]
|
|
1265
|
+
}), i[43] = h, i[44] = L, i[45] = J, i[46] = Z, i[47] = Q) : Q = i[47];
|
|
1266
|
+
let $;
|
|
1267
|
+
i[48] !== I || i[49] !== O || i[50] !== Q ? ($ = /* @__PURE__ */ z(se, {
|
|
1268
|
+
sensors: O,
|
|
1269
|
+
collisionDetection: ue,
|
|
1270
|
+
onDragEnd: I,
|
|
1271
|
+
autoScroll: !1,
|
|
1272
|
+
children: Q
|
|
1273
|
+
}), i[48] = I, i[49] = O, i[50] = Q, i[51] = $) : $ = i[51];
|
|
1274
|
+
let pe;
|
|
1275
|
+
return i[52] !== G || i[53] !== $ ? (pe = /* @__PURE__ */ B(R, { children: [G, $] }), i[52] = G, i[53] = $, i[54] = pe) : pe = i[54], pe;
|
|
1276
|
+
}
|
|
1277
|
+
function kt(e) {
|
|
1278
|
+
return [e.id, e];
|
|
1279
|
+
}
|
|
1280
|
+
function At(e) {
|
|
1281
|
+
return e.id;
|
|
1282
|
+
}
|
|
1283
|
+
function jt(e) {
|
|
1284
|
+
return e.columnOrder;
|
|
1285
|
+
}
|
|
1286
|
+
//#endregion
|
|
1287
|
+
export { ye as C, $ as D, pe as E, we as S, ge as T, Ie as _, vt as a, Oe as b, Xe as c, Ue as d, Ve as f, Fe as g, Pe as h, yt as i, Ge as l, Le as m, Tt as n, _t as o, Re as p, St as r, tt as s, Ot as t, We as u, Me as v, Se as w, De as x, je as y };
|
|
1288
|
+
|
|
1289
|
+
//# sourceMappingURL=actions-DON6fSCh.js.map
|