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