@carto/ps-react-ui 5.6.1 → 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.
@@ -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 Z, useSortable as Q, verticalListSortingStrategy as ae } from "@dnd-kit/sortable";
14
- import { CSS as oe } from "@dnd-kit/utilities";
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(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 ? ne : l, b = r(), x;
512
- i[0] === c ? x = i[1] : (x = {
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
- ...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 = {
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[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: ee, toggle: te } = f(b, I, L), H, U;
531
- i[11] !== b || i[12] !== m || i[13] !== h || i[14] !== T ? (H = () => {
532
- T === void 0 && et(b, h, m);
533
- }, U = [
534
- b,
535
- T,
536
- h,
537
- m
538
- ], i[11] = b, i[12] = m, i[13] = h, i[14] = T, i[15] = H, i[16] = U) : (H = i[15], U = i[16]), y(H, U);
539
- let [W, G] = S(null), K;
540
- i[17] !== b || i[18] !== m || i[19] !== ee ? (K = (e) => {
541
- et(b, e, m), ee(!0), G(null);
542
- }, i[17] = b, i[18] = m, i[19] = ee, i[20] = K) : K = i[20];
543
- let q = K, J;
544
- i[21] === s ? J = i[22] : (J = We(s), i[21] = s, i[22] = J);
545
- let Y = J, X = n(b, Ze), re, ie;
546
- i[23] !== R || i[24] !== b || i[25] !== Y || i[26] !== X ? (re = () => {
547
- d(b).setState({ formatter: R ? Y : X });
548
- }, ie = [
549
- b,
550
- R,
551
- Y,
552
- X
553
- ], i[23] = R, i[24] = b, i[25] = Y, i[26] = X, i[27] = re, i[28] = ie) : (re = i[27], ie = i[28]), y(re, ie);
554
- let Z = R ? w.on : w.off, Q = R && Ke.toggleActive, ae;
555
- i[29] === Q ? ae = i[30] : (ae = {
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
- ...Q
558
- }, i[29] = Q, i[30] = ae);
559
- let oe;
560
- i[31] !== _ || i[32] !== u ? (oe = /* @__PURE__ */ z(_, {
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
- ...u
563
- }), i[31] = _, i[32] = u, i[33] = oe) : oe = i[33];
564
- let se;
565
- i[34] !== R || i[35] !== ae || i[36] !== oe || i[37] !== te || i[38] !== Z ? (se = /* @__PURE__ */ z(D, {
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": Z,
568
- "aria-pressed": R,
569
- onClick: te,
570
- sx: ae,
571
- children: oe
572
- }), i[34] = R, i[35] = ae, i[36] = oe, i[37] = te, i[38] = Z, i[39] = se) : se = i[39];
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[44] === Symbol.for("react.memo_cache_sentinel") ? (de = /* @__PURE__ */ z(V, {}), i[44] = de) : de = i[44];
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[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 = !!W, me;
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: he,
621
- transformOrigin: ge,
622
- children: _e
623
- }), i[59] = W, 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, {
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
- ce,
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 Z;
839
- i[42] !== h || i[43] !== X || i[44] !== ie ? (Z = /* @__PURE__ */ B(ut, {
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] = Z) : Z = i[45];
843
- let Q;
844
- i[46] !== k || i[47] !== j || i[48] !== y || i[49] !== G || i[50] !== Z || i[51] !== V ? (Q = /* @__PURE__ */ z(w, {
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: Z
851
- }), i[46] = k, i[47] = j, i[48] = y, i[49] = G, i[50] = Z, i[51] = V, i[52] = Q) : Q = i[52];
852
- let ae;
853
- return i[53] !== Q || i[54] !== W ? (ae = /* @__PURE__ */ B(R, { children: [W, Q] }), i[53] = Q, i[54] = W, i[55] = ae) : ae = i[55], ae;
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 } = Q(o), p;
1108
- t[2] === u ? p = t[3] : (p = oe.Transform.toString(u ? {
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: Z }, i[10] = E) : E = i[10];
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 Q;
1250
- i[40] !== b || i[41] !== X ? (Q = /* @__PURE__ */ z(re, {
1231
+ let Z;
1232
+ i[40] !== b || i[41] !== X ? (Z = /* @__PURE__ */ z(re, {
1251
1233
  items: b,
1252
- strategy: ae,
1234
+ strategy: oe,
1253
1235
  children: X
1254
- }), i[40] = b, i[41] = X, i[42] = Q) : Q = i[42];
1255
- let oe;
1256
- i[43] !== h || i[44] !== L || i[45] !== Y || i[46] !== Q ? (oe = /* @__PURE__ */ B(j, {
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, Q]
1265
- }), i[43] = h, i[44] = L, i[45] = Y, i[46] = Q, i[47] = oe) : oe = i[47];
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] !== oe ? ($ = /* @__PURE__ */ z(se, {
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: oe
1273
- }), i[48] = I, i[49] = O, i[50] = oe, i[51] = $) : $ = i[51];
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-5-dVhroJ.js.map
1271
+ //# sourceMappingURL=actions-BvFmh3M-.js.map