@mx-cartographer/insights-ui 1.8.0 → 1.8.1-alpha.mega2
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/index.es.js +57 -62
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -258,7 +258,7 @@ const Be = ({
|
|
|
258
258
|
height: d
|
|
259
259
|
}) => {
|
|
260
260
|
const [s, c] = v.useState(null), m = () => {
|
|
261
|
-
const
|
|
261
|
+
const u = document.getElementsByClassName("mx-mini-insight-card")[0].clientHeight, p = document.getElementsByClassName("mx-mini-insight-card-header")[0].clientHeight + document.getElementsByClassName("mx-mini-insight-card-content-body")[0].clientHeight, f = u - p - 24;
|
|
262
262
|
c(Math.floor(f / 20));
|
|
263
263
|
};
|
|
264
264
|
return v.useEffect(() => (m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m)), []), /* @__PURE__ */ t(
|
|
@@ -328,7 +328,7 @@ const Be = ({
|
|
|
328
328
|
tabIndex: o = 0,
|
|
329
329
|
...d
|
|
330
330
|
}) => {
|
|
331
|
-
const [s, c] = B(null), m = () => c(null),
|
|
331
|
+
const [s, c] = B(null), m = () => c(null), u = (f, g) => {
|
|
332
332
|
m(), n(f, g);
|
|
333
333
|
};
|
|
334
334
|
return /* @__PURE__ */ h(k, { children: [
|
|
@@ -366,7 +366,7 @@ const Be = ({
|
|
|
366
366
|
onClose: m,
|
|
367
367
|
open: !!s,
|
|
368
368
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
369
|
-
children: l.map(({ icon: f, key: g, text: S }, M) => /* @__PURE__ */ h(Ae, { onClick: () =>
|
|
369
|
+
children: l.map(({ icon: f, key: g, text: S }, M) => /* @__PURE__ */ h(Ae, { onClick: () => u(M, g), sx: { padding: 12 }, children: [
|
|
370
370
|
/* @__PURE__ */ t(J, { sx: { minWidth: "32px !important" }, children: f }),
|
|
371
371
|
/* @__PURE__ */ t(
|
|
372
372
|
T,
|
|
@@ -455,11 +455,10 @@ const Be = ({
|
|
|
455
455
|
...o
|
|
456
456
|
}) => {
|
|
457
457
|
const d = w(), s = G(null), { width: c } = ke({
|
|
458
|
-
width: a.width
|
|
459
|
-
from: { width: 0 }
|
|
458
|
+
width: a.width
|
|
460
459
|
});
|
|
461
460
|
ie(() => {
|
|
462
|
-
const
|
|
461
|
+
const p = new ResizeObserver(() => {
|
|
463
462
|
window.requestAnimationFrame(() => {
|
|
464
463
|
if (s.current) {
|
|
465
464
|
const { width: f } = s.current.getBoundingClientRect(), g = f / 2;
|
|
@@ -467,11 +466,11 @@ const Be = ({
|
|
|
467
466
|
}
|
|
468
467
|
});
|
|
469
468
|
});
|
|
470
|
-
return s.current &&
|
|
471
|
-
s.current &&
|
|
469
|
+
return s.current && p.observe(s.current), () => {
|
|
470
|
+
s.current && p.unobserve(s.current);
|
|
472
471
|
};
|
|
473
472
|
}, []);
|
|
474
|
-
const { ariaLabel: m, formattedAmount:
|
|
473
|
+
const { ariaLabel: m, formattedAmount: u } = r[l];
|
|
475
474
|
return /* @__PURE__ */ h("g", { "aria-label": m, ref: s, children: [
|
|
476
475
|
/* @__PURE__ */ t(O.rect, { ...o, fill: i[l], rx: 2, style: a }),
|
|
477
476
|
/* @__PURE__ */ t(
|
|
@@ -484,7 +483,7 @@ const Be = ({
|
|
|
484
483
|
transform: `translate(${c.get() / 2}, -8)`,
|
|
485
484
|
x: a.x,
|
|
486
485
|
y: a.y,
|
|
487
|
-
children:
|
|
486
|
+
children: u
|
|
488
487
|
}
|
|
489
488
|
)
|
|
490
489
|
] });
|
|
@@ -504,7 +503,7 @@ const Be = ({
|
|
|
504
503
|
selectedTabIndex: s,
|
|
505
504
|
onBarClick: c
|
|
506
505
|
}) => {
|
|
507
|
-
const m = w(), { containerRef:
|
|
506
|
+
const m = w(), { containerRef: u, height: p, width: f } = Se(), g = N(() => {
|
|
508
507
|
const H = `${r}80`;
|
|
509
508
|
return s === void 0 ? [...new Array(l.length - 1).fill(H), r] : l.map((L, Z) => Z === s ? r : H);
|
|
510
509
|
}, [r, l, s]), S = he(
|
|
@@ -529,10 +528,10 @@ const Be = ({
|
|
|
529
528
|
[l]
|
|
530
529
|
);
|
|
531
530
|
return /* @__PURE__ */ h(C, { alignItems: "center", sx: { mb: n ? 16 : 24, width: "100%" }, children: [
|
|
532
|
-
/* @__PURE__ */ t(E, { ref:
|
|
531
|
+
/* @__PURE__ */ t(E, { ref: u, sx: { height: 130, width: "100%", mb: 8 }, children: /* @__PURE__ */ h(
|
|
533
532
|
be,
|
|
534
533
|
{
|
|
535
|
-
height:
|
|
534
|
+
height: p,
|
|
536
535
|
margin: a,
|
|
537
536
|
series: M.series,
|
|
538
537
|
width: f,
|
|
@@ -657,21 +656,21 @@ const Be = ({
|
|
|
657
656
|
rightLowerText: s,
|
|
658
657
|
rightUpperText: c
|
|
659
658
|
}) => {
|
|
660
|
-
const m = o ? _ : $,
|
|
659
|
+
const m = o ? _ : $, u = G(null), { height: p, width: f } = oe(u);
|
|
661
660
|
return /* @__PURE__ */ h(
|
|
662
661
|
E,
|
|
663
662
|
{
|
|
664
663
|
alignItems: "center",
|
|
665
664
|
display: "flex",
|
|
666
665
|
justifyContent: "center",
|
|
667
|
-
ref:
|
|
666
|
+
ref: u,
|
|
668
667
|
sx: (g) => ({
|
|
669
668
|
backgroundColor: g.palette.grey[200],
|
|
670
669
|
padding: 16
|
|
671
670
|
}),
|
|
672
671
|
width: "100%",
|
|
673
672
|
children: [
|
|
674
|
-
/* @__PURE__ */ t(ae, { height:
|
|
673
|
+
/* @__PURE__ */ t(ae, { height: p, shouldRun: r.shouldRun, width: f }),
|
|
675
674
|
/* @__PURE__ */ h(
|
|
676
675
|
A,
|
|
677
676
|
{
|
|
@@ -863,8 +862,8 @@ const Be = ({
|
|
|
863
862
|
if (!a.current) return;
|
|
864
863
|
const d = a.current, s = d.querySelectorAll(".Overlay");
|
|
865
864
|
["brand100", "brand200", "brand300", "brand400", "brand500"].forEach((m) => {
|
|
866
|
-
const
|
|
867
|
-
ee(
|
|
865
|
+
const u = d.querySelectorAll(`.${m}`), p = m.replace("brand", "");
|
|
866
|
+
ee(u, o[p]);
|
|
868
867
|
}), ee(s, o[300]);
|
|
869
868
|
}, [o]), /* @__PURE__ */ t(
|
|
870
869
|
"div",
|
|
@@ -935,10 +934,10 @@ const Be = ({
|
|
|
935
934
|
if (a.current) {
|
|
936
935
|
const d = a.current, s = d.parentElement;
|
|
937
936
|
if (s) {
|
|
938
|
-
const m = Array.from(s.children).reduce((S, M) => M !== d ? S + M.clientHeight : S, 0),
|
|
937
|
+
const m = Array.from(s.children).reduce((S, M) => M !== d ? S + M.clientHeight : S, 0), p = s.clientHeight - m, f = parseInt(
|
|
939
938
|
window.getComputedStyle(d).lineHeight,
|
|
940
939
|
10
|
|
941
|
-
), g = Math.floor(
|
|
940
|
+
), g = Math.floor(p / f);
|
|
942
941
|
g !== l && n(g);
|
|
943
942
|
}
|
|
944
943
|
}
|
|
@@ -979,7 +978,7 @@ const Be = ({
|
|
|
979
978
|
hasFullWidthImage: c,
|
|
980
979
|
hasFooterButton: m = !1
|
|
981
980
|
}) => {
|
|
982
|
-
const
|
|
981
|
+
const u = () => a || !r.html_description ? null : s ? /* @__PURE__ */ t(p1, { content: r.html_description, isLoading: d }) : /* @__PURE__ */ t(
|
|
983
982
|
E1,
|
|
984
983
|
{
|
|
985
984
|
beat: r,
|
|
@@ -989,9 +988,9 @@ const Be = ({
|
|
|
989
988
|
}
|
|
990
989
|
);
|
|
991
990
|
return /* @__PURE__ */ h(k, { children: [
|
|
992
|
-
n === "top" &&
|
|
991
|
+
n === "top" && u(),
|
|
993
992
|
/* @__PURE__ */ t(C, { sx: { alignItems: "center", ...c && s && { mx: -16 } }, children: l }),
|
|
994
|
-
n === "bottom" &&
|
|
993
|
+
n === "bottom" && u(),
|
|
995
994
|
i && /* @__PURE__ */ t(
|
|
996
995
|
b,
|
|
997
996
|
{
|
|
@@ -1017,10 +1016,10 @@ const Be = ({
|
|
|
1017
1016
|
feedback: s,
|
|
1018
1017
|
header: c,
|
|
1019
1018
|
isError: m = !1,
|
|
1020
|
-
isLoading:
|
|
1021
|
-
isMini:
|
|
1019
|
+
isLoading: u = !1,
|
|
1020
|
+
isMini: p = !1
|
|
1022
1021
|
}) => /* @__PURE__ */ h(k, { children: [
|
|
1023
|
-
/* @__PURE__ */ t(c1, { ...c, isMini:
|
|
1022
|
+
/* @__PURE__ */ t(c1, { ...c, isMini: p, title: l.html_title }),
|
|
1024
1023
|
m ? /* @__PURE__ */ t(s1, { erroredText: d }) : /* @__PURE__ */ h(k, { children: [
|
|
1025
1024
|
/* @__PURE__ */ t(
|
|
1026
1025
|
u1,
|
|
@@ -1029,12 +1028,12 @@ const Be = ({
|
|
|
1029
1028
|
asteriskText: r,
|
|
1030
1029
|
beat: l,
|
|
1031
1030
|
hasFooterButton: !!n,
|
|
1032
|
-
isLoading:
|
|
1033
|
-
isMini:
|
|
1034
|
-
children:
|
|
1031
|
+
isLoading: u,
|
|
1032
|
+
isMini: p,
|
|
1033
|
+
children: u ? /* @__PURE__ */ t(m1, { altLoadingText: i }) : a
|
|
1035
1034
|
}
|
|
1036
1035
|
),
|
|
1037
|
-
!
|
|
1036
|
+
!p && n,
|
|
1038
1037
|
s
|
|
1039
1038
|
] })
|
|
1040
1039
|
] }), ft = ({
|
|
@@ -1131,8 +1130,8 @@ const Be = ({
|
|
|
1131
1130
|
setRefs: o
|
|
1132
1131
|
}) => /* @__PURE__ */ t(
|
|
1133
1132
|
({ elementTag: s, children: c, ...m }) => {
|
|
1134
|
-
const
|
|
1135
|
-
return v.createElement(
|
|
1133
|
+
const u = s;
|
|
1134
|
+
return v.createElement(u, m, c);
|
|
1136
1135
|
},
|
|
1137
1136
|
{
|
|
1138
1137
|
"aria-hidden": i,
|
|
@@ -1214,7 +1213,7 @@ const Be = ({
|
|
|
1214
1213
|
},
|
|
1215
1214
|
marginTop: 12,
|
|
1216
1215
|
width: "100%"
|
|
1217
|
-
}),
|
|
1216
|
+
}), u = X(K)({
|
|
1218
1217
|
backgroundColor: d.palette.action.active,
|
|
1219
1218
|
borderRadius: 4,
|
|
1220
1219
|
fontSize: 16,
|
|
@@ -1235,7 +1234,7 @@ const Be = ({
|
|
|
1235
1234
|
},
|
|
1236
1235
|
children: [
|
|
1237
1236
|
/* @__PURE__ */ t(
|
|
1238
|
-
|
|
1237
|
+
u,
|
|
1239
1238
|
{
|
|
1240
1239
|
className: "mx-insights-beat-feedback-submit-button",
|
|
1241
1240
|
"data-ui-test": "submit-button",
|
|
@@ -1322,7 +1321,7 @@ const Be = ({
|
|
|
1322
1321
|
const m = ze(Te)({
|
|
1323
1322
|
height: 93,
|
|
1324
1323
|
resize: "none"
|
|
1325
|
-
}),
|
|
1324
|
+
}), u = De();
|
|
1326
1325
|
return /* @__PURE__ */ h(
|
|
1327
1326
|
E,
|
|
1328
1327
|
{
|
|
@@ -1340,8 +1339,8 @@ const Be = ({
|
|
|
1340
1339
|
maxRows: 4,
|
|
1341
1340
|
minRows: 4,
|
|
1342
1341
|
name: "Feedback",
|
|
1343
|
-
onChange: (
|
|
1344
|
-
s(
|
|
1342
|
+
onChange: (p) => {
|
|
1343
|
+
s(p.target.value), c(p.target.value);
|
|
1345
1344
|
},
|
|
1346
1345
|
onClick: () => d(),
|
|
1347
1346
|
placeholder: n,
|
|
@@ -1356,7 +1355,7 @@ const Be = ({
|
|
|
1356
1355
|
x,
|
|
1357
1356
|
{
|
|
1358
1357
|
sx: {
|
|
1359
|
-
color: i &&
|
|
1358
|
+
color: i && u.palette.error.darker,
|
|
1360
1359
|
fontSize: 12,
|
|
1361
1360
|
p: "0px !important"
|
|
1362
1361
|
},
|
|
@@ -1379,13 +1378,14 @@ const bt = ({
|
|
|
1379
1378
|
data: a,
|
|
1380
1379
|
legendLabelAvg: o,
|
|
1381
1380
|
legendLabelMain: d,
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1381
|
+
margin: s,
|
|
1382
|
+
onBarClick: c,
|
|
1383
|
+
selectedTabIndex: m,
|
|
1384
|
+
...u
|
|
1385
1385
|
}) => /* @__PURE__ */ t(
|
|
1386
1386
|
D,
|
|
1387
1387
|
{
|
|
1388
|
-
...
|
|
1388
|
+
...u,
|
|
1389
1389
|
beat: r,
|
|
1390
1390
|
button: a.length ? /* @__PURE__ */ h(P, { spacing: 10, sx: { pt: 8 }, children: [
|
|
1391
1391
|
/* @__PURE__ */ t(
|
|
@@ -1412,17 +1412,12 @@ const bt = ({
|
|
|
1412
1412
|
amounts: i,
|
|
1413
1413
|
color: n,
|
|
1414
1414
|
data: a,
|
|
1415
|
-
isMini:
|
|
1415
|
+
isMini: u.isMini,
|
|
1416
1416
|
legendLabelAvg: o,
|
|
1417
1417
|
legendLabelMain: d,
|
|
1418
|
-
margin:
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
right: 2,
|
|
1422
|
-
top: 24
|
|
1423
|
-
},
|
|
1424
|
-
onBarClick: s,
|
|
1425
|
-
selectedTabIndex: c
|
|
1418
|
+
margin: s,
|
|
1419
|
+
onBarClick: c,
|
|
1420
|
+
selectedTabIndex: m
|
|
1426
1421
|
}
|
|
1427
1422
|
) : /* @__PURE__ */ t(H1, {})
|
|
1428
1423
|
}
|
|
@@ -1584,7 +1579,7 @@ const bt = ({
|
|
|
1584
1579
|
onClose: s,
|
|
1585
1580
|
sendResponseAnalytics: c,
|
|
1586
1581
|
upperDescription: m,
|
|
1587
|
-
upperList:
|
|
1582
|
+
upperList: u
|
|
1588
1583
|
}) => /* @__PURE__ */ t(
|
|
1589
1584
|
ue,
|
|
1590
1585
|
{
|
|
@@ -1617,7 +1612,7 @@ const bt = ({
|
|
|
1617
1612
|
/* @__PURE__ */ t(le, { sx: { p: "16px 24px 8px 24px", whiteSpace: "wrap" }, children: l }),
|
|
1618
1613
|
/* @__PURE__ */ h(C, { sx: { gap: 12, px: 24 }, children: [
|
|
1619
1614
|
/* @__PURE__ */ t(x, { color: "secondary", fontSize: 13, children: m }),
|
|
1620
|
-
/* @__PURE__ */ t(U, { children:
|
|
1615
|
+
/* @__PURE__ */ t(U, { children: u.map((p, f) => /* @__PURE__ */ h(
|
|
1621
1616
|
Q,
|
|
1622
1617
|
{
|
|
1623
1618
|
sx: {
|
|
@@ -1641,7 +1636,7 @@ const bt = ({
|
|
|
1641
1636
|
T,
|
|
1642
1637
|
{
|
|
1643
1638
|
disableTypography: !0,
|
|
1644
|
-
secondary:
|
|
1639
|
+
secondary: p,
|
|
1645
1640
|
sx: (g) => ({ color: g.palette.text.secondary, fontSize: 13 })
|
|
1646
1641
|
}
|
|
1647
1642
|
)
|
|
@@ -1654,7 +1649,7 @@ const bt = ({
|
|
|
1654
1649
|
/* @__PURE__ */ h(E, { children: [
|
|
1655
1650
|
/* @__PURE__ */ t(b, { bold: !0, fontSize: 15, sx: { p: "16px 24px 8px 24px" }, children: o }),
|
|
1656
1651
|
/* @__PURE__ */ t(x, { color: "secondary", fontSize: 13, sx: { mb: 16, mx: 24 }, children: a }),
|
|
1657
|
-
/* @__PURE__ */ t(U, { sx: { p: "16px 24px" }, children: d.map((
|
|
1652
|
+
/* @__PURE__ */ t(U, { sx: { p: "16px 24px" }, children: d.map((p, f) => /* @__PURE__ */ h(
|
|
1658
1653
|
Q,
|
|
1659
1654
|
{
|
|
1660
1655
|
sx: (g) => ({
|
|
@@ -1668,12 +1663,12 @@ const bt = ({
|
|
|
1668
1663
|
p: 16
|
|
1669
1664
|
}),
|
|
1670
1665
|
children: [
|
|
1671
|
-
/* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(y, { name:
|
|
1666
|
+
/* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(y, { name: p.icon_name, size: 24 }) }),
|
|
1672
1667
|
/* @__PURE__ */ t(
|
|
1673
1668
|
T,
|
|
1674
1669
|
{
|
|
1675
|
-
primary:
|
|
1676
|
-
secondary:
|
|
1670
|
+
primary: p.title,
|
|
1671
|
+
secondary: p.content,
|
|
1677
1672
|
sx: (g) => ({
|
|
1678
1673
|
"& > p": {
|
|
1679
1674
|
color: g.palette.text.secondary,
|
|
@@ -1936,8 +1931,8 @@ const bt = ({
|
|
|
1936
1931
|
isMini: s,
|
|
1937
1932
|
leftLowerText: c,
|
|
1938
1933
|
leftUpperText: m,
|
|
1939
|
-
rightLowerText:
|
|
1940
|
-
rightUpperText:
|
|
1934
|
+
rightLowerText: u,
|
|
1935
|
+
rightUpperText: p,
|
|
1941
1936
|
sourceAccountGuid: f
|
|
1942
1937
|
}) => /* @__PURE__ */ t(v.Fragment, { children: d ? /* @__PURE__ */ t(
|
|
1943
1938
|
de,
|
|
@@ -1949,8 +1944,8 @@ const bt = ({
|
|
|
1949
1944
|
isMini: s,
|
|
1950
1945
|
leftLowerText: c,
|
|
1951
1946
|
leftUpperText: m,
|
|
1952
|
-
rightLowerText:
|
|
1953
|
-
rightUpperText:
|
|
1947
|
+
rightLowerText: u,
|
|
1948
|
+
rightUpperText: p
|
|
1954
1949
|
}
|
|
1955
1950
|
) : /* @__PURE__ */ t(
|
|
1956
1951
|
V1,
|