@carto/ps-react-ui 5.6.0 → 5.7.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-5-dVhroJ.js → actions-BvFmh3M-.js} +119 -137
- package/dist/actions-BvFmh3M-.js.map +1 -0
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +7 -1
- package/dist/types/widgets-v2/wrapper/collapsed-context.d.ts +7 -0
- package/dist/widgets-v2/actions.js +1 -1
- package/dist/widgets-v2.js +222 -216
- package/dist/widgets-v2.js.map +1 -1
- package/package.json +1 -1
- package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +14 -0
- package/src/widgets-v2/actions/relative-data/relative-data.tsx +43 -32
- package/src/widgets-v2/toolbox/toolbox.test.tsx +28 -0
- package/src/widgets-v2/toolbox/toolbox.tsx +9 -0
- package/src/widgets-v2/wrapper/collapsed-context.ts +12 -0
- package/src/widgets-v2/wrapper/widget-wrapper.tsx +6 -1
- package/dist/actions-5-dVhroJ.js.map +0 -1
|
@@ -10,8 +10,8 @@ import { Box as C, Dialog as w, DialogContent as T, DialogTitle as E, IconButton
|
|
|
10
10
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
11
11
|
import { ArrowDropDown as V, Clear as ee, Close as te, DragIndicator as H, Fullscreen as U, FullscreenExit as W, HighlightAlt as G, Lock as K, LockOpen as q, Percent as ne, Search as J, StackedBarChart as Y } from "@mui/icons-material";
|
|
12
12
|
import { debounce as X } from "@carto/ps-utils";
|
|
13
|
-
import { SortableContext as re, arrayMove as ie, sortableKeyboardCoordinates as
|
|
14
|
-
import { CSS as
|
|
13
|
+
import { SortableContext as re, arrayMove as ie, sortableKeyboardCoordinates as ae, useSortable as Z, verticalListSortingStrategy as oe } from "@dnd-kit/sortable";
|
|
14
|
+
import { CSS as Q } from "@dnd-kit/utilities";
|
|
15
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
16
|
//#region src/widgets-v2/provider/widget-provider.tsx
|
|
17
17
|
function $(e) {
|
|
@@ -508,128 +508,110 @@ var Ge = {
|
|
|
508
508
|
order: 15
|
|
509
509
|
}, Ye = (e) => e;
|
|
510
510
|
function Xe(t) {
|
|
511
|
-
let i = v(
|
|
512
|
-
i[0] ===
|
|
511
|
+
let i = v(54), { initialEnabled: a, scale: o, scaleMenu: s, locale: c, labels: l, icon: u, iconProps: p, transform: m } = t, h = a !== void 0 && a, _ = o === void 0 ? "max" : o, b = s === void 0 || s, x = u === void 0 ? ne : u, w = r(), T;
|
|
512
|
+
i[0] === l ? T = i[1] : (T = {
|
|
513
513
|
...Ge,
|
|
514
|
-
...
|
|
515
|
-
}, i[0] =
|
|
516
|
-
let
|
|
517
|
-
i[2] ===
|
|
514
|
+
...l
|
|
515
|
+
}, i[0] = l, i[1] = T);
|
|
516
|
+
let E = T, O = n(w, Qe), A = O ?? _, N = m ?? Ue, P;
|
|
517
|
+
i[2] === N ? P = i[3] : (P = {
|
|
518
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
519
|
fn: N
|
|
525
|
-
}, i[
|
|
526
|
-
let F;
|
|
527
|
-
i[
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
520
|
+
}, i[2] = N, i[3] = P);
|
|
521
|
+
let F = A === "total" ? g : Ye, I;
|
|
522
|
+
i[4] === F ? I = i[5] : (I = {
|
|
523
|
+
descriptor: Je,
|
|
524
|
+
fn: F
|
|
525
|
+
}, i[4] = F, i[5] = I);
|
|
526
|
+
let L;
|
|
527
|
+
i[6] !== P || i[7] !== I ? (L = [P, I], i[6] = P, i[7] = I, i[8] = L) : L = i[8];
|
|
528
|
+
let ee = L, te;
|
|
529
|
+
i[9] === h ? te = i[10] : (te = { initialEnabled: h }, i[9] = h, i[10] = te);
|
|
530
|
+
let { enabled: H, setEnabled: U, toggle: W } = f(w, ee, te), G, K;
|
|
531
|
+
i[11] !== w || i[12] !== h || i[13] !== _ || i[14] !== O ? (G = () => {
|
|
532
|
+
O === void 0 && et(w, _, h);
|
|
533
|
+
}, K = [
|
|
534
|
+
w,
|
|
535
|
+
O,
|
|
536
|
+
_,
|
|
537
|
+
h
|
|
538
|
+
], i[11] = w, i[12] = h, i[13] = _, i[14] = O, i[15] = G, i[16] = K) : (G = i[15], K = i[16]), y(G, K);
|
|
539
|
+
let [q, J] = S(null), Y;
|
|
540
|
+
i[17] !== w || i[18] !== h || i[19] !== U ? (Y = (e) => {
|
|
541
|
+
et(w, e, h), U(!0), J(null);
|
|
542
|
+
}, i[17] = w, i[18] = h, i[19] = U, i[20] = Y) : Y = i[20];
|
|
543
|
+
let X = Y, re;
|
|
544
|
+
i[21] === c ? re = i[22] : (re = We(c), i[21] = c, i[22] = re);
|
|
545
|
+
let ie = re, ae = n(w, Ze), Z, oe;
|
|
546
|
+
i[23] !== H || i[24] !== w || i[25] !== ie || i[26] !== ae ? (Z = () => {
|
|
547
|
+
d(w).setState({ formatter: H ? ie : ae });
|
|
548
|
+
}, oe = [
|
|
549
|
+
w,
|
|
550
|
+
H,
|
|
551
|
+
ie,
|
|
552
|
+
ae
|
|
553
|
+
], i[23] = H, i[24] = w, i[25] = ie, i[26] = ae, i[27] = Z, i[28] = oe) : (Z = i[27], oe = i[28]), y(Z, oe);
|
|
554
|
+
let Q = H ? E.on : E.off, se = H && Ke.toggleActive, ce;
|
|
555
|
+
i[29] === se ? ce = i[30] : (ce = {
|
|
556
556
|
...Ke.toggle,
|
|
557
|
-
...
|
|
558
|
-
}, i[29] =
|
|
559
|
-
let
|
|
560
|
-
i[31] !==
|
|
557
|
+
...se
|
|
558
|
+
}, i[29] = se, i[30] = ce);
|
|
559
|
+
let le;
|
|
560
|
+
i[31] !== x || i[32] !== p ? (le = /* @__PURE__ */ z(x, {
|
|
561
561
|
fontSize: "small",
|
|
562
|
-
...
|
|
563
|
-
}), i[31] =
|
|
564
|
-
let
|
|
565
|
-
i[34] !==
|
|
562
|
+
...p
|
|
563
|
+
}), i[31] = x, i[32] = p, i[33] = le) : le = i[33];
|
|
564
|
+
let ue;
|
|
565
|
+
i[34] !== H || i[35] !== ce || i[36] !== le || i[37] !== W || i[38] !== Q ? (ue = /* @__PURE__ */ z(D, {
|
|
566
566
|
size: "small",
|
|
567
|
-
"aria-label":
|
|
568
|
-
"aria-pressed":
|
|
569
|
-
onClick:
|
|
570
|
-
sx:
|
|
571
|
-
children:
|
|
572
|
-
}), i[34] =
|
|
573
|
-
let ce;
|
|
574
|
-
i[40] !== se || i[41] !== Z ? (ce = /* @__PURE__ */ z(e, {
|
|
575
|
-
title: Z,
|
|
576
|
-
children: se
|
|
577
|
-
}), i[40] = se, i[41] = Z, i[42] = ce) : ce = i[42];
|
|
578
|
-
let le = W ? "true" : void 0, ue;
|
|
579
|
-
i[43] === Symbol.for("react.memo_cache_sentinel") ? (ue = (e) => G(e.currentTarget), i[43] = ue) : ue = i[43];
|
|
567
|
+
"aria-label": Q,
|
|
568
|
+
"aria-pressed": H,
|
|
569
|
+
onClick: W,
|
|
570
|
+
sx: ce,
|
|
571
|
+
children: le
|
|
572
|
+
}), i[34] = H, i[35] = ce, i[36] = le, i[37] = W, i[38] = Q, i[39] = ue) : ue = i[39];
|
|
580
573
|
let de;
|
|
581
|
-
i[
|
|
574
|
+
i[40] !== ue || i[41] !== Q ? (de = /* @__PURE__ */ z(e, {
|
|
575
|
+
title: Q,
|
|
576
|
+
children: ue
|
|
577
|
+
}), i[40] = ue, i[41] = Q, i[42] = de) : de = i[42];
|
|
582
578
|
let fe;
|
|
583
|
-
i[
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
i[51] === Symbol.for("react.memo_cache_sentinel") ? (me = () => G(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] !== q ? (_e = $e.map((e) => /* @__PURE__ */ z(M, {
|
|
609
|
-
selected: e === E,
|
|
610
|
-
onClick: () => q(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] = q, i[58] = _e) : _e = i[58];
|
|
613
|
-
let ve;
|
|
614
|
-
i[59] !== W || i[60] !== pe || i[61] !== _e ? (ve = /* @__PURE__ */ z(j, {
|
|
615
|
-
anchorEl: W,
|
|
616
|
-
open: pe,
|
|
617
|
-
onClose: me,
|
|
579
|
+
i[43] !== E.scaleMax || i[44] !== E.scaleMenu || i[45] !== E.scaleTotal || i[46] !== q || i[47] !== A || i[48] !== b || i[49] !== X ? (fe = b ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(e, {
|
|
580
|
+
title: E.scaleMenu,
|
|
581
|
+
children: /* @__PURE__ */ z(D, {
|
|
582
|
+
size: "small",
|
|
583
|
+
"aria-label": E.scaleMenu,
|
|
584
|
+
"aria-haspopup": "true",
|
|
585
|
+
"aria-expanded": q ? "true" : void 0,
|
|
586
|
+
onClick: (e) => J(e.currentTarget),
|
|
587
|
+
sx: Ke.arrow,
|
|
588
|
+
children: /* @__PURE__ */ z(V, {})
|
|
589
|
+
})
|
|
590
|
+
}), /* @__PURE__ */ z(j, {
|
|
591
|
+
anchorEl: q,
|
|
592
|
+
open: !!q,
|
|
593
|
+
onClose: () => J(null),
|
|
618
594
|
variant: "menu",
|
|
619
595
|
elevation: 8,
|
|
620
|
-
anchorOrigin:
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
596
|
+
anchorOrigin: {
|
|
597
|
+
vertical: "bottom",
|
|
598
|
+
horizontal: "right"
|
|
599
|
+
},
|
|
600
|
+
transformOrigin: {
|
|
601
|
+
vertical: "top",
|
|
602
|
+
horizontal: "right"
|
|
603
|
+
},
|
|
604
|
+
children: $e.map((e) => /* @__PURE__ */ z(M, {
|
|
605
|
+
selected: e === A,
|
|
606
|
+
onClick: () => X(e),
|
|
607
|
+
children: /* @__PURE__ */ z(k, { children: e === "max" ? E.scaleMax : E.scaleTotal })
|
|
608
|
+
}, e))
|
|
609
|
+
})] }) : null, i[43] = E.scaleMax, i[44] = E.scaleMenu, i[45] = E.scaleTotal, i[46] = q, i[47] = A, i[48] = b, i[49] = X, i[50] = fe) : fe = i[50];
|
|
610
|
+
let $;
|
|
611
|
+
return i[51] !== de || i[52] !== fe ? ($ = /* @__PURE__ */ B(C, {
|
|
626
612
|
sx: Ke.group,
|
|
627
|
-
children: [
|
|
628
|
-
|
|
629
|
-
$,
|
|
630
|
-
ve
|
|
631
|
-
]
|
|
632
|
-
}), i[63] = ce, i[64] = $, i[65] = ve, i[66] = ye) : ye = i[66], ye;
|
|
613
|
+
children: [de, fe]
|
|
614
|
+
}), i[51] = de, i[52] = fe, i[53] = $) : $ = i[53], $;
|
|
633
615
|
}
|
|
634
616
|
function Ze(e) {
|
|
635
617
|
return e.rawFormatter;
|
|
@@ -835,22 +817,22 @@ function ct(t) {
|
|
|
835
817
|
sx: nt.dialogContent,
|
|
836
818
|
children: re
|
|
837
819
|
}), i[40] = re, i[41] = ie);
|
|
838
|
-
let
|
|
839
|
-
i[42] !== h || i[43] !== X || i[44] !== ie ? (
|
|
820
|
+
let ae;
|
|
821
|
+
i[42] !== h || i[43] !== X || i[44] !== ie ? (ae = /* @__PURE__ */ B(ut, {
|
|
840
822
|
sourceId: h,
|
|
841
823
|
children: [X, ie]
|
|
842
|
-
}), i[42] = h, i[43] = X, i[44] = ie, i[45] =
|
|
843
|
-
let
|
|
844
|
-
i[46] !== k || i[47] !== j || i[48] !== y || i[49] !== G || i[50] !==
|
|
824
|
+
}), i[42] = h, i[43] = X, i[44] = ie, i[45] = ae) : ae = i[45];
|
|
825
|
+
let Z;
|
|
826
|
+
i[46] !== k || i[47] !== j || i[48] !== y || i[49] !== G || i[50] !== ae || i[51] !== V ? (Z = /* @__PURE__ */ z(w, {
|
|
845
827
|
open: y,
|
|
846
828
|
onClose: j,
|
|
847
829
|
fullScreen: k,
|
|
848
830
|
PaperProps: G,
|
|
849
831
|
"aria-labelledby": V,
|
|
850
|
-
children:
|
|
851
|
-
}), i[46] = k, i[47] = j, i[48] = y, i[49] = G, i[50] =
|
|
852
|
-
let
|
|
853
|
-
return i[53] !==
|
|
832
|
+
children: ae
|
|
833
|
+
}), i[46] = k, i[47] = j, i[48] = y, i[49] = G, i[50] = ae, i[51] = V, i[52] = Z) : Z = i[52];
|
|
834
|
+
let oe;
|
|
835
|
+
return i[53] !== Z || i[54] !== W ? (oe = /* @__PURE__ */ B(R, { children: [W, Z] }), i[53] = Z, i[54] = W, i[55] = oe) : oe = i[55], oe;
|
|
854
836
|
}
|
|
855
837
|
function lt(e) {
|
|
856
838
|
return e.isFullScreen ?? !1;
|
|
@@ -1104,8 +1086,8 @@ var Tt = {
|
|
|
1104
1086
|
function Dt(e) {
|
|
1105
1087
|
let t = v(24), { id: n, label: r, dragHandleIcon: i } = e, a = i === void 0 ? H : i, o;
|
|
1106
1088
|
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 } =
|
|
1108
|
-
t[2] === u ? p = t[3] : (p =
|
|
1089
|
+
let { attributes: s, listeners: c, setNodeRef: l, transform: u, transition: d, isDragging: f } = Z(o), p;
|
|
1090
|
+
t[2] === u ? p = t[3] : (p = Q.Transform.toString(u ? {
|
|
1109
1091
|
...u,
|
|
1110
1092
|
x: 0
|
|
1111
1093
|
} : null), t[2] = u, t[3] = p);
|
|
@@ -1179,7 +1161,7 @@ function Ot(t) {
|
|
|
1179
1161
|
i[7] = C, i[8] = b, i[9] = w;
|
|
1180
1162
|
} else w = i[9];
|
|
1181
1163
|
let T = w, E;
|
|
1182
|
-
i[10] === Symbol.for("react.memo_cache_sentinel") ? (E = { coordinateGetter:
|
|
1164
|
+
i[10] === Symbol.for("react.memo_cache_sentinel") ? (E = { coordinateGetter: ae }, i[10] = E) : E = i[10];
|
|
1183
1165
|
let O = fe(de(le), de(ce, E)), k;
|
|
1184
1166
|
i[11] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => {
|
|
1185
1167
|
e.stopPropagation(), g(e.currentTarget);
|
|
@@ -1246,14 +1228,14 @@ function Ot(t) {
|
|
|
1246
1228
|
label: e.label,
|
|
1247
1229
|
dragHandleIcon: l
|
|
1248
1230
|
}, e.id)), i[37] = l, i[38] = T, i[39] = X) : X = i[39];
|
|
1249
|
-
let
|
|
1250
|
-
i[40] !== b || i[41] !== X ? (
|
|
1231
|
+
let Z;
|
|
1232
|
+
i[40] !== b || i[41] !== X ? (Z = /* @__PURE__ */ z(re, {
|
|
1251
1233
|
items: b,
|
|
1252
|
-
strategy:
|
|
1234
|
+
strategy: oe,
|
|
1253
1235
|
children: X
|
|
1254
|
-
}), i[40] = b, i[41] = X, i[42] =
|
|
1255
|
-
let
|
|
1256
|
-
i[43] !== h || i[44] !== L || i[45] !== Y || i[46] !==
|
|
1236
|
+
}), i[40] = b, i[41] = X, i[42] = Z) : Z = i[42];
|
|
1237
|
+
let Q;
|
|
1238
|
+
i[43] !== h || i[44] !== L || i[45] !== Y || i[46] !== Z ? (Q = /* @__PURE__ */ B(j, {
|
|
1257
1239
|
id: "change-column-menu",
|
|
1258
1240
|
anchorEl: h,
|
|
1259
1241
|
open: L,
|
|
@@ -1261,16 +1243,16 @@ function Ot(t) {
|
|
|
1261
1243
|
anchorOrigin: q,
|
|
1262
1244
|
transformOrigin: ne,
|
|
1263
1245
|
slotProps: J,
|
|
1264
|
-
children: [Y,
|
|
1265
|
-
}), i[43] = h, i[44] = L, i[45] = Y, i[46] =
|
|
1246
|
+
children: [Y, Z]
|
|
1247
|
+
}), i[43] = h, i[44] = L, i[45] = Y, i[46] = Z, i[47] = Q) : Q = i[47];
|
|
1266
1248
|
let $;
|
|
1267
|
-
i[48] !== I || i[49] !== O || i[50] !==
|
|
1249
|
+
i[48] !== I || i[49] !== O || i[50] !== Q ? ($ = /* @__PURE__ */ z(se, {
|
|
1268
1250
|
sensors: O,
|
|
1269
1251
|
collisionDetection: ue,
|
|
1270
1252
|
onDragEnd: I,
|
|
1271
1253
|
autoScroll: !1,
|
|
1272
|
-
children:
|
|
1273
|
-
}), i[48] = I, i[49] = O, i[50] =
|
|
1254
|
+
children: Q
|
|
1255
|
+
}), i[48] = I, i[49] = O, i[50] = Q, i[51] = $) : $ = i[51];
|
|
1274
1256
|
let pe;
|
|
1275
1257
|
return i[52] !== K || i[53] !== $ ? (pe = /* @__PURE__ */ B(R, { children: [K, $] }), i[52] = K, i[53] = $, i[54] = pe) : pe = i[54], pe;
|
|
1276
1258
|
}
|
|
@@ -1286,4 +1268,4 @@ function jt(e) {
|
|
|
1286
1268
|
//#endregion
|
|
1287
1269
|
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
1270
|
|
|
1289
|
-
//# sourceMappingURL=actions-
|
|
1271
|
+
//# sourceMappingURL=actions-BvFmh3M-.js.map
|