@carto/ps-react-ui 4.22.0 → 4.24.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.
Files changed (121) hide show
  1. package/dist/actions-B1ss030_.js +1167 -0
  2. package/dist/actions-B1ss030_.js.map +1 -0
  3. package/dist/category-Ca5XDx0N.js +839 -0
  4. package/dist/category-Ca5XDx0N.js.map +1 -0
  5. package/dist/{download-C7he8mSh.js → download--wRRnf19.js} +81 -80
  6. package/dist/download--wRRnf19.js.map +1 -0
  7. package/dist/{echart-BnJYXH7H.js → echart-CgOQw9XB.js} +3 -2
  8. package/dist/echart-CgOQw9XB.js.map +1 -0
  9. package/dist/{formula-Cqj84ZGX.js → formula-DRuMIVo8.js} +6 -6
  10. package/dist/formula-DRuMIVo8.js.map +1 -0
  11. package/dist/legend.js +34 -21
  12. package/dist/legend.js.map +1 -1
  13. package/dist/{markdown-CV_KP-at.js → markdown-C3OX9jyy.js} +6 -6
  14. package/dist/markdown-C3OX9jyy.js.map +1 -0
  15. package/dist/{spread-C8T12Nfh.js → spread-BT07rCJw.js} +7 -7
  16. package/dist/spread-BT07rCJw.js.map +1 -0
  17. package/dist/{table-CNQijNNB.js → table-CRG9eOs9.js} +3 -3
  18. package/dist/table-CRG9eOs9.js.map +1 -0
  19. package/dist/types/legend/stores/types.d.ts +4 -2
  20. package/dist/types/widgets-v2/actions/download/csv-item.d.ts +3 -3
  21. package/dist/types/widgets-v2/actions/download/index.d.ts +1 -1
  22. package/dist/types/widgets-v2/actions/download/png-item.d.ts +2 -2
  23. package/dist/types/widgets-v2/actions/download/types.d.ts +12 -1
  24. package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +20 -13
  25. package/dist/types/widgets-v2/actions/index.d.ts +1 -1
  26. package/dist/types/widgets-v2/actions/searcher/filter.d.ts +3 -2
  27. package/dist/types/widgets-v2/bar/download.d.ts +3 -3
  28. package/dist/types/widgets-v2/category/category-ui.d.ts +9 -1
  29. package/dist/types/widgets-v2/category/download.d.ts +3 -3
  30. package/dist/types/widgets-v2/echart/style.d.ts +1 -0
  31. package/dist/types/widgets-v2/formula/download.d.ts +3 -3
  32. package/dist/types/widgets-v2/histogram/download.d.ts +3 -3
  33. package/dist/types/widgets-v2/index.d.ts +1 -1
  34. package/dist/types/widgets-v2/markdown/download.d.ts +3 -3
  35. package/dist/types/widgets-v2/pie/download.d.ts +3 -3
  36. package/dist/types/widgets-v2/scatterplot/download.d.ts +3 -3
  37. package/dist/types/widgets-v2/spread/download.d.ts +3 -3
  38. package/dist/types/widgets-v2/table/download.d.ts +3 -3
  39. package/dist/types/widgets-v2/timeseries/download.d.ts +3 -3
  40. package/dist/types/widgets-v2/toolbox/toolbox.d.ts +1 -1
  41. package/dist/types/widgets-v2/wrapper/style.d.ts +31 -2
  42. package/dist/types/widgets-v2/wrapper/widget-actions.d.ts +2 -2
  43. package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +2 -2
  44. package/dist/widgets-v2/actions.js +2 -2
  45. package/dist/widgets-v2/bar.js +7 -7
  46. package/dist/widgets-v2/bar.js.map +1 -1
  47. package/dist/widgets-v2/category.js +1 -1
  48. package/dist/widgets-v2/echart.js +1 -1
  49. package/dist/widgets-v2/formula.js +1 -1
  50. package/dist/widgets-v2/histogram.js +10 -10
  51. package/dist/widgets-v2/histogram.js.map +1 -1
  52. package/dist/widgets-v2/markdown.js +1 -1
  53. package/dist/widgets-v2/pie.js +10 -10
  54. package/dist/widgets-v2/pie.js.map +1 -1
  55. package/dist/widgets-v2/scatterplot.js +9 -9
  56. package/dist/widgets-v2/scatterplot.js.map +1 -1
  57. package/dist/widgets-v2/spread.js +1 -1
  58. package/dist/widgets-v2/table.js +1 -1
  59. package/dist/widgets-v2/timeseries.js +12 -12
  60. package/dist/widgets-v2/timeseries.js.map +1 -1
  61. package/dist/widgets-v2.js +364 -376
  62. package/dist/widgets-v2.js.map +1 -1
  63. package/package.json +3 -3
  64. package/src/legend/components/legend-item/legend-item-ui.test.tsx +22 -1
  65. package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +22 -6
  66. package/src/legend/stores/types.ts +6 -11
  67. package/src/widgets-v2/actions/download/csv-item.test.tsx +3 -3
  68. package/src/widgets-v2/actions/download/csv-item.tsx +6 -6
  69. package/src/widgets-v2/actions/download/download.tsx +5 -3
  70. package/src/widgets-v2/actions/download/index.ts +1 -1
  71. package/src/widgets-v2/actions/download/png-item.test.tsx +5 -3
  72. package/src/widgets-v2/actions/download/png-item.tsx +4 -4
  73. package/src/widgets-v2/actions/download/types.ts +15 -1
  74. package/src/widgets-v2/actions/fullscreen/fullscreen-store.test.tsx +155 -0
  75. package/src/widgets-v2/actions/fullscreen/fullscreen.test.tsx +39 -41
  76. package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +211 -96
  77. package/src/widgets-v2/actions/index.ts +1 -0
  78. package/src/widgets-v2/actions/searcher/filter.test.ts +28 -0
  79. package/src/widgets-v2/actions/searcher/filter.ts +22 -4
  80. package/src/widgets-v2/actions/searcher/searcher-toggle.tsx +9 -4
  81. package/src/widgets-v2/actions/searcher/searcher.test.tsx +22 -0
  82. package/src/widgets-v2/actions/searcher/searcher.tsx +17 -2
  83. package/src/widgets-v2/bar/download.test.tsx +5 -3
  84. package/src/widgets-v2/bar/download.tsx +5 -4
  85. package/src/widgets-v2/category/category-ui.tsx +20 -9
  86. package/src/widgets-v2/category/category.tsx +37 -2
  87. package/src/widgets-v2/category/download.test.ts +4 -2
  88. package/src/widgets-v2/category/download.ts +5 -4
  89. package/src/widgets-v2/echart/style.ts +6 -0
  90. package/src/widgets-v2/formula/download.test.tsx +3 -1
  91. package/src/widgets-v2/formula/download.tsx +5 -4
  92. package/src/widgets-v2/histogram/download.test.ts +6 -4
  93. package/src/widgets-v2/histogram/download.ts +5 -4
  94. package/src/widgets-v2/index.ts +1 -0
  95. package/src/widgets-v2/markdown/download.test.ts +2 -2
  96. package/src/widgets-v2/markdown/download.tsx +5 -4
  97. package/src/widgets-v2/pie/download.test.ts +7 -3
  98. package/src/widgets-v2/pie/download.ts +5 -4
  99. package/src/widgets-v2/scatterplot/download.test.ts +4 -2
  100. package/src/widgets-v2/scatterplot/download.ts +5 -4
  101. package/src/widgets-v2/spread/download.test.ts +3 -1
  102. package/src/widgets-v2/spread/download.ts +5 -4
  103. package/src/widgets-v2/table/download.test.ts +5 -3
  104. package/src/widgets-v2/table/download.ts +4 -3
  105. package/src/widgets-v2/timeseries/download.test.ts +6 -4
  106. package/src/widgets-v2/timeseries/download.ts +5 -4
  107. package/src/widgets-v2/toolbox/toolbox.tsx +1 -1
  108. package/src/widgets-v2/wrapper/style.ts +38 -2
  109. package/src/widgets-v2/wrapper/widget-actions.tsx +2 -2
  110. package/src/widgets-v2/wrapper/widget-wrapper.test.tsx +32 -2
  111. package/src/widgets-v2/wrapper/widget-wrapper.tsx +58 -32
  112. package/dist/actions-iN1jwyxA.js +0 -1024
  113. package/dist/actions-iN1jwyxA.js.map +0 -1
  114. package/dist/category-DZt6yiST.js +0 -826
  115. package/dist/category-DZt6yiST.js.map +0 -1
  116. package/dist/download-C7he8mSh.js.map +0 -1
  117. package/dist/echart-BnJYXH7H.js.map +0 -1
  118. package/dist/formula-Cqj84ZGX.js.map +0 -1
  119. package/dist/markdown-CV_KP-at.js.map +0 -1
  120. package/dist/spread-C8T12Nfh.js.map +0 -1
  121. package/dist/table-CNQijNNB.js.map +0 -1
@@ -1,1024 +0,0 @@
1
- import { t as e } from "./tooltip-DJUGNZxY.js";
2
- import "./components-DKjBezcJ.js";
3
- import { S as t, T as n, i as r, n as i, p as a, r as o } from "./stores-BVFMfgyo.js";
4
- import "./zoom-toggle-KA63b6-J.js";
5
- import "./download-C7he8mSh.js";
6
- import { c as s } from "react/compiler-runtime";
7
- import { useEffect as c, useLayoutEffect as l, useRef as u, useState as d } from "react";
8
- import { Box as f, Dialog as p, DialogContent as m, DialogTitle as h, IconButton as g, InputAdornment as _, ListItemText as v, ListSubheader as y, Menu as b, MenuItem as x, SvgIcon as S, TextField as C, Typography as w, useMediaQuery as T, useTheme as E } from "@mui/material";
9
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
10
- import { Clear as A, Close as j, DragIndicator as M, Fullscreen as N, FullscreenExit as P, HighlightAlt as F, Lock as I, LockOpen as L, Percent as R, Search as z, StackedBarChart as B } from "@mui/icons-material";
11
- import { debounce as V } from "@carto/ps-utils";
12
- import { SortableContext as H, arrayMove as ee, sortableKeyboardCoordinates as te, useSortable as U, verticalListSortingStrategy as W } from "@dnd-kit/sortable";
13
- import { CSS as G } from "@dnd-kit/utilities";
14
- import { DndContext as ne, KeyboardSensor as re, PointerSensor as ie, closestCenter as ae, useSensor as K, useSensors as oe } from "@dnd-kit/core";
15
- import { createPortal as se } from "react-dom";
16
- //#region src/widgets-v2/actions/searcher/filter.ts
17
- function q(e, t) {
18
- if (!t) return e;
19
- let n = t.toLowerCase();
20
- return Array.isArray(e) ? e.map((e) => Array.isArray(e) ? e.filter((e) => {
21
- if (e == null) return !1;
22
- if (typeof e == "object" && "name" in e) {
23
- let t = e.name;
24
- return (t == null ? "" : J(t)).toLowerCase().includes(n);
25
- }
26
- return J(e).toLowerCase().includes(n);
27
- }) : e) : e;
28
- }
29
- function J(e) {
30
- return typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
31
- }
32
- //#endregion
33
- //#region src/widgets-v2/actions/searcher/labels.ts
34
- var Y = {
35
- toggle: "Search",
36
- placeholder: "Search…",
37
- clearAriaLabel: "Clear search",
38
- noResults: "No matches."
39
- }, X = {
40
- toggle: {
41
- p: .5,
42
- "& .MuiSvgIcon-root": { fontSize: 20 }
43
- },
44
- toggleActive: { background: (e) => e.palette.primary.relatedLight },
45
- input: {
46
- width: "100%",
47
- mb: 1
48
- }
49
- }, ce = {
50
- id: "searcher",
51
- type: "data",
52
- order: 20,
53
- disables: ["lock-selection"]
54
- };
55
- function le(r) {
56
- let a = s(20), { labels: o, icon: c, iconProps: l, initialEnabled: u } = r, d = c === void 0 ? z : c, f = u !== void 0 && u, p = n(), m;
57
- a[0] === o ? m = a[1] : (m = {
58
- ...Y,
59
- ...o
60
- }, a[0] = o, a[1] = m);
61
- let h = m, _ = t(p, ue), v;
62
- a[2] === _ ? v = a[3] : (v = (e) => q(e, _), a[2] = _, a[3] = v);
63
- let y = v, b;
64
- a[4] === f ? b = a[5] : (b = { initialEnabled: f }, a[4] = f, a[5] = b);
65
- let { enabled: x, toggle: S } = i(p, ce, y, b), C = x && X.toggleActive, w;
66
- a[6] === C ? w = a[7] : (w = {
67
- ...X.toggle,
68
- ...C
69
- }, a[6] = C, a[7] = w);
70
- let T;
71
- a[8] !== d || a[9] !== l ? (T = /* @__PURE__ */ O(d, {
72
- fontSize: "small",
73
- ...l
74
- }), a[8] = d, a[9] = l, a[10] = T) : T = a[10];
75
- let E;
76
- a[11] !== x || a[12] !== h.toggle || a[13] !== w || a[14] !== T || a[15] !== S ? (E = /* @__PURE__ */ O(g, {
77
- size: "small",
78
- "aria-label": h.toggle,
79
- "aria-pressed": x,
80
- onClick: S,
81
- sx: w,
82
- children: T
83
- }), a[11] = x, a[12] = h.toggle, a[13] = w, a[14] = T, a[15] = S, a[16] = E) : E = a[16];
84
- let D;
85
- return a[17] !== h.toggle || a[18] !== E ? (D = /* @__PURE__ */ O(e, {
86
- title: h.toggle,
87
- children: E
88
- }), a[17] = h.toggle, a[18] = E, a[19] = D) : D = a[19], D;
89
- }
90
- function ue(e) {
91
- return e.transformStates.searcher?.searchText ?? "";
92
- }
93
- function Z(e, t) {
94
- a(e).setState((e) => ({ transformStates: {
95
- ...e.transformStates,
96
- searcher: {
97
- enabled: e.transformStates.searcher?.enabled ?? !1,
98
- ...e.transformStates.searcher,
99
- searchText: t
100
- }
101
- } }));
102
- }
103
- //#endregion
104
- //#region src/widgets-v2/actions/searcher/searcher.tsx
105
- var de = 300;
106
- function fe(e) {
107
- let r = s(26), { labels: i, debounceMs: o } = e, c = o === void 0 ? de : o, l = n(), f;
108
- r[0] === i ? f = r[1] : (f = {
109
- ...Y,
110
- ...i
111
- }, r[0] = i, r[1] = f);
112
- let p = f, m = t(l, pe), h = u(null), v;
113
- r[2] === l ? v = r[3] : (v = () => a(l).getState().transformStates.searcher?.searchText ?? "", r[2] = l, r[3] = v);
114
- let [y, b] = d(v), x;
115
- r[4] === l ? x = r[5] : (x = (e) => Z(l, e), r[4] = l, r[5] = x);
116
- let S;
117
- r[6] !== c || r[7] !== x ? (S = V(x, c), r[6] = c, r[7] = x, r[8] = S) : S = r[8];
118
- let w = S, T;
119
- r[9] === w ? T = r[10] : (T = (e) => {
120
- let t = e.target.value;
121
- b(t), w(t);
122
- }, r[9] = w, r[10] = T);
123
- let E = T, D;
124
- r[11] !== w || r[12] !== l ? (D = () => {
125
- b(""), Z(l, ""), w(""), h.current?.focus();
126
- }, r[11] = w, r[12] = l, r[13] = D) : D = r[13];
127
- let k = D;
128
- if (!m) return null;
129
- let j;
130
- r[14] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ O(_, {
131
- position: "start",
132
- children: /* @__PURE__ */ O(z, { fontSize: "small" })
133
- }), r[14] = j) : j = r[14];
134
- let M;
135
- r[15] !== k || r[16] !== y || r[17] !== p.clearAriaLabel ? (M = y ? /* @__PURE__ */ O(_, {
136
- position: "end",
137
- children: /* @__PURE__ */ O(g, {
138
- size: "small",
139
- edge: "end",
140
- "aria-label": p.clearAriaLabel,
141
- onClick: k,
142
- children: /* @__PURE__ */ O(A, { fontSize: "small" })
143
- })
144
- }) : null, r[15] = k, r[16] = y, r[17] = p.clearAriaLabel, r[18] = M) : M = r[18];
145
- let N;
146
- r[19] === M ? N = r[20] : (N = {
147
- startAdornment: j,
148
- endAdornment: M
149
- }, r[19] = M, r[20] = N);
150
- let P;
151
- return r[21] !== E || r[22] !== y || r[23] !== p.placeholder || r[24] !== N ? (P = /* @__PURE__ */ O(C, {
152
- inputRef: h,
153
- size: "small",
154
- fullWidth: !0,
155
- variant: "filled",
156
- placeholder: p.placeholder,
157
- value: y,
158
- onChange: E,
159
- autoFocus: !0,
160
- "aria-label": p.placeholder,
161
- sx: X.input,
162
- InputProps: N
163
- }), r[21] = E, r[22] = y, r[23] = p.placeholder, r[24] = N, r[25] = P) : P = r[25], P;
164
- }
165
- function pe(e) {
166
- return e.transformStates.searcher?.enabled ?? !1;
167
- }
168
- //#endregion
169
- //#region src/widgets-v2/actions/stack-toggle/transforms.ts
170
- var Q = (e) => {
171
- if (typeof e != "object" || !e) return e;
172
- let t = e, n = Array.isArray(t.series) ? t.series : [], r = n.length === 0 ? [{ stack: "total" }] : n.map((e) => typeof e != "object" || !e ? e : {
173
- ...e,
174
- stack: "total"
175
- });
176
- return {
177
- ...t,
178
- series: r
179
- };
180
- }, me = {
181
- on: "Unstack series",
182
- off: "Stack series"
183
- }, he = {
184
- toggle: {
185
- p: .5,
186
- "& .MuiSvgIcon-root": { fontSize: 20 }
187
- },
188
- toggleActive: { background: (e) => e.palette.primary.relatedLight }
189
- }, ge = {
190
- id: "stack-toggle",
191
- type: "config",
192
- order: 30
193
- };
194
- function _e(t) {
195
- let r = s(18), { initialEnabled: a, labels: o, icon: c, iconProps: l } = t, u = a !== void 0 && a, d = c === void 0 ? B : c, f = n(), p;
196
- r[0] === o ? p = r[1] : (p = {
197
- ...me,
198
- ...o
199
- }, r[0] = o, r[1] = p);
200
- let m = p, h;
201
- r[2] === u ? h = r[3] : (h = { initialEnabled: u }, r[2] = u, r[3] = h);
202
- let { enabled: _, toggle: v } = i(f, ge, Q, h), y = _ ? m.on : m.off, b = _ && he.toggleActive, x;
203
- r[4] === b ? x = r[5] : (x = {
204
- ...he.toggle,
205
- ...b
206
- }, r[4] = b, r[5] = x);
207
- let S;
208
- r[6] !== d || r[7] !== l ? (S = /* @__PURE__ */ O(d, {
209
- fontSize: "small",
210
- ...l
211
- }), r[6] = d, r[7] = l, r[8] = S) : S = r[8];
212
- let C;
213
- r[9] !== _ || r[10] !== x || r[11] !== S || r[12] !== v || r[13] !== y ? (C = /* @__PURE__ */ O(g, {
214
- size: "small",
215
- "aria-label": y,
216
- "aria-pressed": _,
217
- onClick: v,
218
- sx: x,
219
- children: S
220
- }), r[9] = _, r[10] = x, r[11] = S, r[12] = v, r[13] = y, r[14] = C) : C = r[14];
221
- let w;
222
- return r[15] !== C || r[16] !== y ? (w = /* @__PURE__ */ O(e, {
223
- title: y,
224
- children: C
225
- }), r[15] = C, r[16] = y, r[17] = w) : w = r[17], w;
226
- }
227
- //#endregion
228
- //#region src/widgets-v2/actions/show-all/labels.ts
229
- var ve = { toggle: "Show less" }, ye = { toggle: {
230
- p: .5,
231
- "& .MuiSvgIcon-root": { fontSize: 20 }
232
- } }, be = "show-all";
233
- function xe(t) {
234
- let r = s(14), { labels: i, icon: a, iconProps: o } = t, c = a === void 0 ? j : a, l = n(), u;
235
- r[0] === i ? u = r[1] : (u = {
236
- ...ve,
237
- ...i
238
- }, r[0] = i, r[1] = u);
239
- let d = u, f;
240
- r[2] === l ? f = r[3] : (f = () => Se(l, !1), r[2] = l, r[3] = f);
241
- let p;
242
- r[4] !== c || r[5] !== o ? (p = /* @__PURE__ */ O(c, {
243
- fontSize: "small",
244
- ...o
245
- }), r[4] = c, r[5] = o, r[6] = p) : p = r[6];
246
- let m;
247
- r[7] !== d.toggle || r[8] !== f || r[9] !== p ? (m = /* @__PURE__ */ O(g, {
248
- size: "small",
249
- "aria-label": d.toggle,
250
- "aria-pressed": !0,
251
- onClick: f,
252
- sx: ye.toggle,
253
- children: p
254
- }), r[7] = d.toggle, r[8] = f, r[9] = p, r[10] = m) : m = r[10];
255
- let h;
256
- return r[11] !== d.toggle || r[12] !== m ? (h = /* @__PURE__ */ O(e, {
257
- title: d.toggle,
258
- children: m
259
- }), r[11] = d.toggle, r[12] = m, r[13] = h) : h = r[13], h;
260
- }
261
- function Se(e, t) {
262
- a(e).setState((e) => ({ transformStates: {
263
- ...e.transformStates,
264
- [be]: {
265
- ...e.transformStates[be],
266
- enabled: t
267
- }
268
- } }));
269
- }
270
- //#endregion
271
- //#region src/widgets-v2/actions/brush-toggle/transforms.ts
272
- var Ce = (e) => {
273
- if (typeof e != "object" || !e) return e;
274
- let t = e;
275
- return {
276
- ...t,
277
- brush: {
278
- toolbox: ["rect", "clear"],
279
- xAxisIndex: "all",
280
- brushLink: "all",
281
- outOfBrush: { colorAlpha: .15 }
282
- },
283
- toolbox: {
284
- ...t.toolbox ?? {},
285
- show: !1,
286
- feature: {
287
- ...t.toolbox?.feature ?? {},
288
- brush: { type: ["rect", "clear"] }
289
- }
290
- }
291
- };
292
- }, we = {
293
- on: "Disable brush selection",
294
- off: "Enable brush selection"
295
- }, Te = {
296
- toggle: {
297
- p: .5,
298
- "& .MuiSvgIcon-root": { fontSize: 20 }
299
- },
300
- toggleActive: { background: (e) => e.palette.primary.relatedLight }
301
- }, Ee = {
302
- id: "brush-toggle",
303
- type: "config",
304
- order: 25
305
- };
306
- function De(t) {
307
- let a = s(33), { initialEnabled: o, brushType: l, brushMode: u, selection: d, labels: f, icon: p, iconProps: m } = t, h = o !== void 0 && o, _ = l === void 0 ? "lineX" : l, v = u === void 0 ? "multiple" : u, y = p === void 0 ? F : p, b = n(), x;
308
- a[0] === f ? x = a[1] : (x = {
309
- ...we,
310
- ...f
311
- }, a[0] = f, a[1] = x);
312
- let S = x, C;
313
- a[2] === h ? C = a[3] : (C = { initialEnabled: h }, a[2] = h, a[3] = C);
314
- let { enabled: w, toggle: T } = i(b, Ee, Ce, C), E = r(b), D, k;
315
- a[4] !== v || a[5] !== _ || a[6] !== E || a[7] !== w ? (D = () => {
316
- if (!E) return;
317
- if (!w) {
318
- E.dispatchAction({ type: "takeGlobalCursor" }), E.dispatchAction({
319
- type: "brush",
320
- areas: []
321
- });
322
- return;
323
- }
324
- let e = () => {
325
- E.dispatchAction({
326
- type: "takeGlobalCursor",
327
- key: "brush",
328
- brushOption: {
329
- brushType: _,
330
- brushMode: v
331
- }
332
- });
333
- }, t = () => e();
334
- return E.on("finished", t), e(), () => {
335
- E.off("finished", t);
336
- };
337
- }, k = [
338
- E,
339
- w,
340
- _,
341
- v
342
- ], a[4] = v, a[5] = _, a[6] = E, a[7] = w, a[8] = D, a[9] = k) : (D = a[8], k = a[9]), c(D, k);
343
- let A;
344
- a[10] !== E || a[11] !== w || a[12] !== d?.length ? (A = () => {
345
- !E || !w || d?.length === 0 && E.dispatchAction({
346
- type: "brush",
347
- areas: []
348
- });
349
- }, a[10] = E, a[11] = w, a[12] = d?.length, a[13] = A) : A = a[13];
350
- let j;
351
- a[14] !== E || a[15] !== w || a[16] !== d ? (j = [
352
- E,
353
- w,
354
- d
355
- ], a[14] = E, a[15] = w, a[16] = d, a[17] = j) : j = a[17], c(A, j);
356
- let M = w ? S.on : S.off, N = w ? "active" : void 0, P = w && Te.toggleActive, I;
357
- a[18] === P ? I = a[19] : (I = {
358
- ...Te.toggle,
359
- ...P
360
- }, a[18] = P, a[19] = I);
361
- let L;
362
- a[20] !== y || a[21] !== m ? (L = /* @__PURE__ */ O(y, {
363
- fontSize: "small",
364
- ...m
365
- }), a[20] = y, a[21] = m, a[22] = L) : L = a[22];
366
- let R;
367
- a[23] !== w || a[24] !== N || a[25] !== I || a[26] !== L || a[27] !== T || a[28] !== M ? (R = /* @__PURE__ */ O(g, {
368
- size: "small",
369
- "aria-label": M,
370
- "aria-pressed": w,
371
- onClick: T,
372
- className: N,
373
- sx: I,
374
- children: L
375
- }), a[23] = w, a[24] = N, a[25] = I, a[26] = L, a[27] = T, a[28] = M, a[29] = R) : R = a[29];
376
- let z;
377
- return a[30] !== R || a[31] !== M ? (z = /* @__PURE__ */ O(e, {
378
- title: M,
379
- children: R
380
- }), a[30] = R, a[31] = M, a[32] = z) : z = a[32], z;
381
- }
382
- //#endregion
383
- //#region src/widgets-v2/actions/relative-data/transforms.ts
384
- function Oe(e) {
385
- return Array.isArray(e) ? e.every((e) => typeof e == "object" && !!e && "value" in e && typeof e.value == "number") : !1;
386
- }
387
- var ke = (e) => Array.isArray(e) ? e.map((e) => {
388
- if (!Oe(e)) return e;
389
- let t = e.reduce((e, t) => e + Math.abs(t.value), 0);
390
- return t <= 0 ? e : e.map((e) => ({
391
- ...e,
392
- value: e.value / t * 100
393
- }));
394
- }) : e;
395
- function Ae(e) {
396
- let t = new Intl.NumberFormat(e, {
397
- style: "percent",
398
- minimumFractionDigits: 0,
399
- maximumFractionDigits: 2
400
- });
401
- return (e) => typeof e != "number" || !Number.isFinite(e) ? String(e) : t.format(e / 100);
402
- }
403
- //#endregion
404
- //#region src/widgets-v2/actions/relative-data/labels.ts
405
- var je = {
406
- on: "Show absolute values",
407
- off: "Show relative values"
408
- }, Me = {
409
- toggle: {
410
- p: .5,
411
- "& .MuiSvgIcon-root": { fontSize: 20 }
412
- },
413
- toggleActive: { background: (e) => e.palette.primary.relatedLight }
414
- }, Ne = {
415
- id: "relative-data",
416
- type: "data",
417
- order: 15
418
- };
419
- function Pe(r) {
420
- let o = s(26), { initialEnabled: l, locale: u, labels: d, icon: f, iconProps: p, transform: m } = r, h = l !== void 0 && l, _ = f === void 0 ? R : f, v = n(), y;
421
- o[0] === d ? y = o[1] : (y = {
422
- ...je,
423
- ...d
424
- }, o[0] = d, o[1] = y);
425
- let b = y, x;
426
- o[2] === h ? x = o[3] : (x = { initialEnabled: h }, o[2] = h, o[3] = x);
427
- let { enabled: S, toggle: C } = i(v, Ne, m ?? ke, x), w;
428
- o[4] === u ? w = o[5] : (w = Ae(u), o[4] = u, o[5] = w);
429
- let T = w, E = t(v, Fe), D, k;
430
- o[6] !== S || o[7] !== v || o[8] !== T || o[9] !== E ? (D = () => {
431
- a(v).setState({ formatter: S ? T : E });
432
- }, k = [
433
- v,
434
- S,
435
- T,
436
- E
437
- ], o[6] = S, o[7] = v, o[8] = T, o[9] = E, o[10] = D, o[11] = k) : (D = o[10], k = o[11]), c(D, k);
438
- let A = S ? b.on : b.off, j = S && Me.toggleActive, M;
439
- o[12] === j ? M = o[13] : (M = {
440
- ...Me.toggle,
441
- ...j
442
- }, o[12] = j, o[13] = M);
443
- let N;
444
- o[14] !== _ || o[15] !== p ? (N = /* @__PURE__ */ O(_, {
445
- fontSize: "small",
446
- ...p
447
- }), o[14] = _, o[15] = p, o[16] = N) : N = o[16];
448
- let P;
449
- o[17] !== S || o[18] !== N || o[19] !== M || o[20] !== C || o[21] !== A ? (P = /* @__PURE__ */ O(g, {
450
- size: "small",
451
- "aria-label": A,
452
- "aria-pressed": S,
453
- onClick: C,
454
- sx: M,
455
- children: N
456
- }), o[17] = S, o[18] = N, o[19] = M, o[20] = C, o[21] = A, o[22] = P) : P = o[22];
457
- let F;
458
- return o[23] !== P || o[24] !== A ? (F = /* @__PURE__ */ O(e, {
459
- title: A,
460
- children: P
461
- }), o[23] = P, o[24] = A, o[25] = F) : F = o[25], F;
462
- }
463
- function Fe(e) {
464
- return e.rawFormatter;
465
- }
466
- //#endregion
467
- //#region src/widgets-v2/actions/fullscreen/labels.ts
468
- var Ie = {
469
- open: "Open in full screen",
470
- close: "Exit full screen"
471
- }, $ = {
472
- inlineSlot: {
473
- display: "flex",
474
- flexDirection: "column",
475
- flex: 1,
476
- minHeight: 0,
477
- gap: 1
478
- },
479
- trigger: {
480
- p: .5,
481
- "& .MuiSvgIcon-root": { fontSize: 20 }
482
- },
483
- triggerActive: { background: (e) => e.palette.primary.relatedLight },
484
- dialogPaper: {
485
- width: "auto",
486
- height: "auto",
487
- minWidth: "70vw",
488
- minHeight: "70vh",
489
- maxWidth: "90vw",
490
- maxHeight: "90vh"
491
- },
492
- dialogTitle: {
493
- display: "flex",
494
- alignItems: "center",
495
- justifyContent: "space-between",
496
- gap: 1,
497
- py: 3,
498
- pr: 3,
499
- pb: 2
500
- },
501
- dialogActions: {
502
- display: "flex",
503
- alignItems: "center",
504
- gap: .5,
505
- flexShrink: 0
506
- },
507
- titleText: {
508
- minWidth: 0,
509
- overflow: "hidden",
510
- textOverflow: "ellipsis",
511
- whiteSpace: "nowrap"
512
- },
513
- dialogContent: {
514
- display: "flex",
515
- flexDirection: "column",
516
- gap: 1,
517
- py: 3,
518
- px: 2.5,
519
- overflow: "auto",
520
- minHeight: 0
521
- }
522
- };
523
- //#endregion
524
- //#region src/widgets-v2/actions/fullscreen/fullscreen.tsx
525
- function Le(r) {
526
- let i = s(20), { labels: o, enterIcon: c, exitIcon: l, iconProps: u } = r, d = c === void 0 ? N : c, f = l === void 0 ? P : l, p = n(), m;
527
- i[0] === o ? m = i[1] : (m = {
528
- ...Ie,
529
- ...o
530
- }, i[0] = o, i[1] = m);
531
- let h = m, _ = t(p, Re), v;
532
- i[2] !== p || i[3] !== _ ? (v = () => {
533
- a(p).setState({ isFullScreen: !_ });
534
- }, i[2] = p, i[3] = _, i[4] = v) : v = i[4];
535
- let y = v, b = _ ? h.close : h.open, x = _ ? f : d, S = _ ? "active" : void 0, C = _ && $.triggerActive, w;
536
- i[5] === C ? w = i[6] : (w = {
537
- ...$.trigger,
538
- ...C
539
- }, i[5] = C, i[6] = w);
540
- let T;
541
- i[7] !== x || i[8] !== u ? (T = /* @__PURE__ */ O(x, {
542
- fontSize: "small",
543
- ...u
544
- }), i[7] = x, i[8] = u, i[9] = T) : T = i[9];
545
- let E;
546
- i[10] !== y || i[11] !== _ || i[12] !== S || i[13] !== w || i[14] !== T || i[15] !== b ? (E = /* @__PURE__ */ O(g, {
547
- size: "small",
548
- "aria-label": b,
549
- "aria-pressed": _,
550
- onClick: y,
551
- className: S,
552
- sx: w,
553
- children: T
554
- }), i[10] = y, i[11] = _, i[12] = S, i[13] = w, i[14] = T, i[15] = b, i[16] = E) : E = i[16];
555
- let D;
556
- return i[17] !== E || i[18] !== b ? (D = /* @__PURE__ */ O(e, {
557
- title: b,
558
- children: E
559
- }), i[17] = E, i[18] = b, i[19] = D) : D = i[19], D;
560
- }
561
- function Re(e) {
562
- return e.isFullScreen ?? !1;
563
- }
564
- function ze(r) {
565
- let i = s(52), { children: o, title: c, actions: u, paperSx: _, labels: v, closeIcon: y, iconProps: b } = r, x = y === void 0 ? j : y, S = n(), C;
566
- i[0] === v ? C = i[1] : (C = {
567
- ...Ie,
568
- ...v
569
- }, i[0] = v, i[1] = C);
570
- let A = C, M = t(S, Ve), N = E(), P;
571
- i[2] === N.breakpoints ? P = i[3] : (P = N.breakpoints.down("sm"), i[2] = N.breakpoints, i[3] = P);
572
- let F = T(P), [I, L] = d(null), [R, z] = d(null), [B] = d(Be), V;
573
- i[4] === S ? V = i[5] : (V = () => {
574
- a(S).setState({ isFullScreen: !1 });
575
- }, i[4] = S, i[5] = V);
576
- let H = V, ee, te;
577
- i[6] !== R || i[7] !== I || i[8] !== M || i[9] !== B ? (ee = () => {
578
- if (!B || !I) return;
579
- let e = M ? R : I;
580
- e && B.parentNode !== e && e.appendChild(B), M || Ue(I);
581
- }, te = [
582
- M,
583
- I,
584
- R,
585
- B
586
- ], i[6] = R, i[7] = I, i[8] = M, i[9] = B, i[10] = ee, i[11] = te) : (ee = i[10], te = i[11]), l(ee, te);
587
- let U = `widget-fullscreen-title-${S}`, W, G;
588
- if (i[12] !== o || i[13] !== M || i[14] !== B) {
589
- let e = o(M);
590
- i[17] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ O(f, {
591
- ref: L,
592
- sx: $.inlineSlot
593
- }), i[17] = W) : W = i[17], G = B ? se(e, B) : null, i[12] = o, i[13] = M, i[14] = B, i[15] = W, i[16] = G;
594
- } else W = i[15], G = i[16];
595
- let ne;
596
- i[18] !== F || i[19] !== _ ? (ne = F ? void 0 : { sx: He(_) }, i[18] = F, i[19] = _, i[20] = ne) : ne = i[20];
597
- let re;
598
- i[21] === c ? re = i[22] : (re = /* @__PURE__ */ O(w, {
599
- variant: "subtitle1",
600
- component: "span",
601
- sx: $.titleText,
602
- children: c
603
- }), i[21] = c, i[22] = re);
604
- let ie;
605
- i[23] !== x || i[24] !== b ? (ie = /* @__PURE__ */ O(x, {
606
- fontSize: "small",
607
- ...b
608
- }), i[23] = x, i[24] = b, i[25] = ie) : ie = i[25];
609
- let ae;
610
- i[26] !== A.close || i[27] !== H || i[28] !== ie ? (ae = /* @__PURE__ */ O(g, {
611
- size: "medium",
612
- "aria-label": A.close,
613
- onClick: H,
614
- children: ie
615
- }), i[26] = A.close, i[27] = H, i[28] = ie, i[29] = ae) : ae = i[29];
616
- let K;
617
- i[30] !== A.close || i[31] !== ae ? (K = /* @__PURE__ */ O(e, {
618
- title: A.close,
619
- children: ae
620
- }), i[30] = A.close, i[31] = ae, i[32] = K) : K = i[32];
621
- let oe;
622
- i[33] !== u || i[34] !== K ? (oe = /* @__PURE__ */ k(f, {
623
- sx: $.dialogActions,
624
- children: [u, K]
625
- }), i[33] = u, i[34] = K, i[35] = oe) : oe = i[35];
626
- let q;
627
- i[36] !== re || i[37] !== oe || i[38] !== U ? (q = /* @__PURE__ */ k(h, {
628
- id: U,
629
- component: "div",
630
- sx: $.dialogTitle,
631
- children: [re, oe]
632
- }), i[36] = re, i[37] = oe, i[38] = U, i[39] = q) : q = i[39];
633
- let J;
634
- i[40] === Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ O(m, {
635
- ref: z,
636
- sx: $.dialogContent
637
- }), i[40] = J) : J = i[40];
638
- let Y;
639
- i[41] !== F || i[42] !== H || i[43] !== M || i[44] !== q || i[45] !== ne || i[46] !== U ? (Y = /* @__PURE__ */ k(p, {
640
- open: M,
641
- onClose: H,
642
- fullScreen: F,
643
- PaperProps: ne,
644
- "aria-labelledby": U,
645
- children: [q, J]
646
- }), i[41] = F, i[42] = H, i[43] = M, i[44] = q, i[45] = ne, i[46] = U, i[47] = Y) : Y = i[47];
647
- let X;
648
- return i[48] !== Y || i[49] !== W || i[50] !== G ? (X = /* @__PURE__ */ k(D, { children: [
649
- W,
650
- G,
651
- Y
652
- ] }), i[48] = Y, i[49] = W, i[50] = G, i[51] = X) : X = i[51], X;
653
- }
654
- function Be() {
655
- if (typeof document > "u") return null;
656
- let e = document.createElement("div");
657
- return e.style.display = "contents", e;
658
- }
659
- function Ve(e) {
660
- return e.isFullScreen ?? !1;
661
- }
662
- function He(e) {
663
- let t = e ?? {};
664
- return {
665
- ...$.dialogPaper,
666
- ...t.width !== void 0 && { minWidth: 0 },
667
- ...t.height !== void 0 && { minHeight: 0 },
668
- ...t
669
- };
670
- }
671
- function Ue(e) {
672
- e.style.minHeight = "";
673
- let t = e.getBoundingClientRect().height;
674
- t > 0 && (e.style.minHeight = `${t}px`);
675
- }
676
- var We = {
677
- Trigger: Le,
678
- Slot: ze
679
- };
680
- //#endregion
681
- //#region src/widgets-v2/actions/lock-selection/transforms.ts
682
- function Ge(e, t) {
683
- if (t.length === 0 || !Array.isArray(e)) return e;
684
- let n = new Set(t);
685
- return e.map((e) => Array.isArray(e) ? e.filter((e) => {
686
- if (e == null) return !1;
687
- if (typeof e == "object" && "name" in e) {
688
- let t = e.name;
689
- return typeof t == "string" || typeof t == "number" ? n.has(t) : !1;
690
- }
691
- return !1;
692
- }) : e);
693
- }
694
- //#endregion
695
- //#region src/widgets-v2/actions/lock-selection/labels.ts
696
- var Ke = {
697
- lock: "Lock selection",
698
- unlock: "Unlock selection",
699
- disabled: "Select rows to lock"
700
- }, qe = {
701
- toggle: {
702
- p: .5,
703
- "& .MuiSvgIcon-root": { fontSize: 20 }
704
- },
705
- toggleActive: { background: (e) => e.palette.primary.relatedLight }
706
- }, Je = {
707
- id: "lock-selection",
708
- type: "data",
709
- order: 30
710
- };
711
- function Ye(t) {
712
- let r = s(28), { selection: i, lockedItems: a, onLockChange: l, labels: u, lockIcon: d, unlockIcon: f, iconProps: p, filterFn: m } = t, h = d === void 0 ? I : d, _ = f === void 0 ? L : f, v = m === void 0 ? Ge : m, y = n(), b;
713
- r[0] === u ? b = r[1] : (b = {
714
- ...Ke,
715
- ...u
716
- }, r[0] = u, r[1] = b);
717
- let x = b, S = a.length > 0, C = S || i.length > 0, w = Xe(a, v), T;
718
- r[2] === S ? T = r[3] : (T = { initialEnabled: S }, r[2] = S, r[3] = T);
719
- let { enabled: E, setEnabled: D } = o(y, w, T), k, A;
720
- r[4] !== E || r[5] !== S || r[6] !== D ? (k = () => {
721
- E !== S && D(S);
722
- }, A = [
723
- E,
724
- S,
725
- D
726
- ], r[4] = E, r[5] = S, r[6] = D, r[7] = k, r[8] = A) : (k = r[7], A = r[8]), c(k, A);
727
- let j;
728
- r[9] !== S || r[10] !== l || r[11] !== i ? (j = () => {
729
- l(S ? [] : [...i]);
730
- }, r[9] = S, r[10] = l, r[11] = i, r[12] = j) : j = r[12];
731
- let M = j, N = C ? S ? x.unlock : x.lock : x.disabled, P = S ? _ : h, F = !C, R = S && qe.toggleActive, z;
732
- r[13] === R ? z = r[14] : (z = {
733
- ...qe.toggle,
734
- ...R
735
- }, r[13] = R, r[14] = z);
736
- let B;
737
- r[15] !== P || r[16] !== p ? (B = /* @__PURE__ */ O(P, {
738
- fontSize: "small",
739
- ...p
740
- }), r[15] = P, r[16] = p, r[17] = B) : B = r[17];
741
- let V;
742
- r[18] !== M || r[19] !== S || r[20] !== z || r[21] !== B || r[22] !== F || r[23] !== N ? (V = /* @__PURE__ */ O("span", { children: /* @__PURE__ */ O(g, {
743
- size: "small",
744
- "aria-label": N,
745
- "aria-pressed": S,
746
- disabled: F,
747
- onClick: M,
748
- sx: z,
749
- children: B
750
- }) }), r[18] = M, r[19] = S, r[20] = z, r[21] = B, r[22] = F, r[23] = N, r[24] = V) : V = r[24];
751
- let H;
752
- return r[25] !== V || r[26] !== N ? (H = /* @__PURE__ */ O(e, {
753
- title: N,
754
- children: V
755
- }), r[25] = V, r[26] = N, r[27] = H) : H = r[27], H;
756
- }
757
- function Xe(e, t) {
758
- let n = s(6), r = u(t), i;
759
- n[0] === t ? i = n[1] : (i = () => {
760
- r.current = t;
761
- }, n[0] = t, n[1] = i), c(i);
762
- let a;
763
- n[2] === e ? a = n[3] : (a = (t) => r.current(t, e), n[2] = e, n[3] = a);
764
- let o = a, l;
765
- return n[4] === o ? l = n[5] : (l = [{
766
- descriptor: Je,
767
- fn: o
768
- }], n[4] = o, n[5] = l), l;
769
- }
770
- //#endregion
771
- //#region src/widgets-v2/actions/change-column/change-column-icon.tsx
772
- function Ze(e) {
773
- let t = s(3), n;
774
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ O("path", {
775
- fill: "currentColor",
776
- fillRule: "evenodd",
777
- 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",
778
- clipRule: "evenodd"
779
- }), t[0] = n) : n = t[0];
780
- let r;
781
- return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ O(S, {
782
- viewBox: "0 0 18 18",
783
- ...e,
784
- children: n
785
- }), t[1] = e, t[2] = r), r;
786
- }
787
- //#endregion
788
- //#region src/widgets-v2/actions/change-column/labels.ts
789
- var Qe = {
790
- trigger: "Change column order",
791
- title: "Column reorder",
792
- reset: "Reset to default"
793
- }, $e = {
794
- toggle: {
795
- p: .5,
796
- "& .MuiSvgIcon-root": { fontSize: 20 }
797
- },
798
- toggleActive: { background: (e) => e.palette.primary.relatedLight },
799
- menuPaper: { overflow: "hidden" },
800
- header: {
801
- color: "text.secondary",
802
- backgroundColor: "transparent",
803
- typography: "caption",
804
- px: 2,
805
- py: .75
806
- },
807
- item: {
808
- position: "relative",
809
- cursor: "grab",
810
- px: 2,
811
- touchAction: "none",
812
- "&:hover .change-column-drag-handle": { opacity: 1 },
813
- "&:focus-visible": {
814
- outline: "2px solid",
815
- outlineColor: "primary.main",
816
- outlineOffset: -2
817
- },
818
- "&:focus-visible .change-column-drag-handle": { opacity: 1 }
819
- },
820
- itemDragging: {
821
- opacity: .5,
822
- cursor: "grabbing"
823
- },
824
- dragHandle: {
825
- position: "absolute",
826
- left: 0,
827
- top: "50%",
828
- transform: "translateY(-50%)",
829
- color: "text.secondary",
830
- fontSize: 18,
831
- opacity: 0,
832
- transition: "opacity 0.1s",
833
- "@media (hover: none)": { opacity: 1 }
834
- },
835
- dragHandleVisible: { opacity: 1 }
836
- };
837
- //#endregion
838
- //#region src/widgets-v2/actions/change-column/sortable-column-item.tsx
839
- function et(e) {
840
- let t = s(24), { id: n, label: r, dragHandleIcon: i } = e, a = i === void 0 ? M : i, o;
841
- t[0] === n ? o = t[1] : (o = { id: n }, t[0] = n, t[1] = o);
842
- let { attributes: c, listeners: l, setNodeRef: u, transform: d, transition: f, isDragging: p } = U(o), m;
843
- t[2] === d ? m = t[3] : (m = G.Transform.toString(d ? {
844
- ...d,
845
- x: 0
846
- } : null), t[2] = d, t[3] = m);
847
- let h;
848
- t[4] !== m || t[5] !== f ? (h = {
849
- transform: m,
850
- transition: f
851
- }, t[4] = m, t[5] = f, t[6] = h) : h = t[6];
852
- let g = h, _ = p && $e.itemDragging, y;
853
- t[7] === _ ? y = t[8] : (y = {
854
- ...$e.item,
855
- ..._
856
- }, t[7] = _, t[8] = y);
857
- let b = p && $e.dragHandleVisible, S;
858
- t[9] === b ? S = t[10] : (S = {
859
- ...$e.dragHandle,
860
- ...b
861
- }, t[9] = b, t[10] = S);
862
- let C;
863
- t[11] !== a || t[12] !== S ? (C = /* @__PURE__ */ O(a, {
864
- className: "change-column-drag-handle",
865
- sx: S
866
- }), t[11] = a, t[12] = S, t[13] = C) : C = t[13];
867
- let w;
868
- t[14] === r ? w = t[15] : (w = /* @__PURE__ */ O(v, { children: r }), t[14] = r, t[15] = w);
869
- let T;
870
- return t[16] !== c || t[17] !== l || t[18] !== u || t[19] !== w || t[20] !== y || t[21] !== C || t[22] !== g ? (T = /* @__PURE__ */ k(x, {
871
- ref: u,
872
- style: g,
873
- ...c,
874
- ...l,
875
- disableGutters: !0,
876
- role: "menuitem",
877
- tabIndex: 0,
878
- sx: y,
879
- children: [C, w]
880
- }), t[16] = c, t[17] = l, t[18] = u, t[19] = w, t[20] = y, t[21] = C, t[22] = g, t[23] = T) : T = t[23], T;
881
- }
882
- //#endregion
883
- //#region src/widgets-v2/actions/change-column/change-column.tsx
884
- function tt(r) {
885
- let i = s(55), { columns: o, labels: c, icon: l, iconProps: u, dragHandleIcon: f } = r, p = l === void 0 ? Ze : l, m = n(), h;
886
- i[0] === c ? h = i[1] : (h = {
887
- ...Qe,
888
- ...c
889
- }, i[0] = c, i[1] = h);
890
- let _ = h, [v, x] = d(null), S = t(m, it), C;
891
- if (i[2] !== S || i[3] !== o) {
892
- bb0: {
893
- let e = o.map(rt);
894
- if (!S || S.length === 0) {
895
- C = e;
896
- break bb0;
897
- }
898
- let t = new Set(e), n = /* @__PURE__ */ new Set(), r = [];
899
- for (let e of S) t.has(e) && !n.has(e) && (r.push(e), n.add(e));
900
- for (let t of e) n.has(t) || r.push(t);
901
- C = r;
902
- }
903
- i[2] = S, i[3] = o, i[4] = C;
904
- } else C = i[4];
905
- let w = C, T;
906
- i[5] === o ? T = i[6] : (T = new Map(o.map(nt)), i[5] = o, i[6] = T);
907
- let E = T, A;
908
- if (i[7] !== E || i[8] !== w) {
909
- A = [];
910
- for (let e of w) {
911
- let t = E.get(e);
912
- t != null && A.push(t);
913
- }
914
- i[7] = E, i[8] = w, i[9] = A;
915
- } else A = i[9];
916
- let j = A, M;
917
- i[10] === Symbol.for("react.memo_cache_sentinel") ? (M = { coordinateGetter: te }, i[10] = M) : M = i[10];
918
- let N = oe(K(ie), K(re, M)), P;
919
- i[11] === Symbol.for("react.memo_cache_sentinel") ? (P = (e) => {
920
- e.stopPropagation(), x(e.currentTarget);
921
- }, i[11] = P) : P = i[11];
922
- let F = P, I;
923
- i[12] === Symbol.for("react.memo_cache_sentinel") ? (I = () => x(null), i[12] = I) : I = i[12];
924
- let L = I, R;
925
- i[13] !== m || i[14] !== w ? (R = (e) => {
926
- let { active: t, over: n } = e;
927
- if (!n || t.id === n.id) return;
928
- let r = w.indexOf(String(t.id)), i = w.indexOf(String(n.id));
929
- if (r === -1 || i === -1) return;
930
- let o = ee([...w], r, i);
931
- a(m).setState({ columnOrder: o });
932
- }, i[13] = m, i[14] = w, i[15] = R) : R = i[15];
933
- let z = R;
934
- if (o.length < 2) return null;
935
- let B = !!v, V = B ? "change-column-menu" : void 0, U = B ? "true" : void 0, G = B ? "active" : void 0, se = B && $e.toggleActive, q;
936
- i[16] === se ? q = i[17] : (q = {
937
- ...$e.toggle,
938
- ...se
939
- }, i[16] = se, i[17] = q);
940
- let J;
941
- i[18] !== p || i[19] !== u ? (J = /* @__PURE__ */ O(p, {
942
- fontSize: "small",
943
- ...u
944
- }), i[18] = p, i[19] = u, i[20] = J) : J = i[20];
945
- let Y;
946
- i[21] !== _.trigger || i[22] !== B || i[23] !== U || i[24] !== G || i[25] !== q || i[26] !== J || i[27] !== V ? (Y = /* @__PURE__ */ O(g, {
947
- size: "small",
948
- "aria-label": _.trigger,
949
- "aria-pressed": B,
950
- "aria-haspopup": "true",
951
- "aria-controls": V,
952
- "aria-expanded": U,
953
- onClick: F,
954
- className: G,
955
- sx: q,
956
- children: J
957
- }), i[21] = _.trigger, i[22] = B, i[23] = U, i[24] = G, i[25] = q, i[26] = J, i[27] = V, i[28] = Y) : Y = i[28];
958
- let X;
959
- i[29] !== _.trigger || i[30] !== Y ? (X = /* @__PURE__ */ O(e, {
960
- title: _.trigger,
961
- children: Y
962
- }), i[29] = _.trigger, i[30] = Y, i[31] = X) : X = i[31];
963
- let ce, le, ue;
964
- i[32] === Symbol.for("react.memo_cache_sentinel") ? (ce = {
965
- vertical: "bottom",
966
- horizontal: "right"
967
- }, le = {
968
- vertical: "top",
969
- horizontal: "right"
970
- }, ue = { paper: { sx: $e.menuPaper } }, i[32] = ce, i[33] = le, i[34] = ue) : (ce = i[32], le = i[33], ue = i[34]);
971
- let Z;
972
- i[35] === _.title ? Z = i[36] : (Z = /* @__PURE__ */ O(y, {
973
- disableSticky: !0,
974
- role: "presentation",
975
- sx: $e.header,
976
- children: _.title
977
- }), i[35] = _.title, i[36] = Z);
978
- let de;
979
- i[37] !== f || i[38] !== j ? (de = j.map((e) => /* @__PURE__ */ O(et, {
980
- id: e.id,
981
- label: e.label,
982
- dragHandleIcon: f
983
- }, e.id)), i[37] = f, i[38] = j, i[39] = de) : de = i[39];
984
- let fe;
985
- i[40] !== w || i[41] !== de ? (fe = /* @__PURE__ */ O(H, {
986
- items: w,
987
- strategy: W,
988
- children: de
989
- }), i[40] = w, i[41] = de, i[42] = fe) : fe = i[42];
990
- let pe;
991
- i[43] !== v || i[44] !== B || i[45] !== Z || i[46] !== fe ? (pe = /* @__PURE__ */ k(b, {
992
- id: "change-column-menu",
993
- anchorEl: v,
994
- open: B,
995
- onClose: L,
996
- anchorOrigin: ce,
997
- transformOrigin: le,
998
- slotProps: ue,
999
- children: [Z, fe]
1000
- }), i[43] = v, i[44] = B, i[45] = Z, i[46] = fe, i[47] = pe) : pe = i[47];
1001
- let Q;
1002
- i[48] !== z || i[49] !== N || i[50] !== pe ? (Q = /* @__PURE__ */ O(ne, {
1003
- sensors: N,
1004
- collisionDetection: ae,
1005
- onDragEnd: z,
1006
- autoScroll: !1,
1007
- children: pe
1008
- }), i[48] = z, i[49] = N, i[50] = pe, i[51] = Q) : Q = i[51];
1009
- let me;
1010
- return i[52] !== X || i[53] !== Q ? (me = /* @__PURE__ */ k(D, { children: [X, Q] }), i[52] = X, i[53] = Q, i[54] = me) : me = i[54], me;
1011
- }
1012
- function nt(e) {
1013
- return [e.id, e];
1014
- }
1015
- function rt(e) {
1016
- return e.id;
1017
- }
1018
- function it(e) {
1019
- return e.columnOrder;
1020
- }
1021
- //#endregion
1022
- export { le as C, q as E, fe as S, Y as T, Se as _, Ge as a, me as b, Pe as c, ke as d, De as f, xe as g, be as h, Ke as i, je as l, Ce as m, Qe as n, We as o, we as p, Ye as r, Ie as s, tt as t, Ae as u, ve as v, Z as w, Q as x, _e as y };
1023
-
1024
- //# sourceMappingURL=actions-iN1jwyxA.js.map