@mx-cartographer/experiences 7.0.41-alpha-networthwidget-testing-ram1 → 7.0.41-alpha-networthwidget-testing-ram2
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/networth/index.es.js +33 -29
- package/package.json +1 -1
|
@@ -41,12 +41,16 @@ const Oe = ({
|
|
|
41
41
|
onMouseLeave: a,
|
|
42
42
|
selectedData: o
|
|
43
43
|
}) => {
|
|
44
|
-
const { isMobile: s } = Z(), { availableWidth: c } = _e(), u = z(), C = c - 320
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
const { isMobile: s } = Z(), { availableWidth: c } = _e(), u = z(), C = c - 320;
|
|
45
|
+
console.log(t, "chartData in NetWorthChart");
|
|
46
|
+
const p = t.map((x) => ({
|
|
47
|
+
x: we(Se(x.x), be.MONTH_SHORT),
|
|
48
|
+
y: x.y
|
|
49
|
+
}));
|
|
50
|
+
console.log(p, "datasets in NetWorthChart");
|
|
51
|
+
const g = o ? { index: t.findIndex((x) => x.x === o.x) } : void 0, S = l ? { index: t.findIndex((x) => x.x === l.x) } : void 0, f = (x) => ({
|
|
52
|
+
fill: x === g?.index ? u.palette.success.main : "",
|
|
53
|
+
filter: x === S?.index ? `drop-shadow(0px 0px 10px ${u.palette.success.main})` : "none",
|
|
50
54
|
stroke: u.palette.success.main
|
|
51
55
|
});
|
|
52
56
|
return /* @__PURE__ */ e(
|
|
@@ -54,12 +58,12 @@ const Oe = ({
|
|
|
54
58
|
{
|
|
55
59
|
baseline: "min",
|
|
56
60
|
colors: [u.palette.success.main],
|
|
57
|
-
datasets: [
|
|
61
|
+
datasets: [p],
|
|
58
62
|
height: 350,
|
|
59
63
|
labels: [],
|
|
60
64
|
margin: { right: 20 },
|
|
61
65
|
markHandlers: { onMarkClick: i, onMouseEnter: n, onMouseLeave: a },
|
|
62
|
-
markStyles:
|
|
66
|
+
markStyles: f,
|
|
63
67
|
showArea: !0,
|
|
64
68
|
useCustomMark: !0,
|
|
65
69
|
valueFormatterString: "0,0.0a",
|
|
@@ -120,30 +124,30 @@ const Oe = ({
|
|
|
120
124
|
onMouseLeave: o,
|
|
121
125
|
selectedData: s
|
|
122
126
|
}) => {
|
|
123
|
-
const { net_worth: c } = T(), u = z(), C = (
|
|
124
|
-
const g =
|
|
127
|
+
const { net_worth: c } = T(), u = z(), C = (p) => {
|
|
128
|
+
const g = p.x === l?.x, S = p.x === s?.x, f = {
|
|
125
129
|
backgroundColor: "inherit",
|
|
126
130
|
borderBottom: "inherit",
|
|
127
131
|
color: "inherit"
|
|
128
132
|
};
|
|
129
|
-
return g && (
|
|
133
|
+
return g && (f.color = S ? "inherit" : f.color, f.backgroundColor = u.palette.action.hover), S && (f.backgroundColor = u.palette.primary.main, f.borderBottom = u.palette.border.light, f.color = u.palette.common.white), f;
|
|
130
134
|
};
|
|
131
135
|
return /* @__PURE__ */ r(h, { direction: "column", sx: { width: 320 }, children: [
|
|
132
136
|
/* @__PURE__ */ r(B, { children: [
|
|
133
137
|
/* @__PURE__ */ e(E, { sx: { backgroundColor: "transparent", mb: 8, mt: 12, px: 12 }, children: /* @__PURE__ */ e(m, { bold: !0, component: "h2", variant: "Body", children: c.monthly_totals }) }),
|
|
134
138
|
/* @__PURE__ */ e(W, {}),
|
|
135
|
-
t.map((
|
|
139
|
+
t.map((p, g) => /* @__PURE__ */ e(
|
|
136
140
|
je,
|
|
137
141
|
{
|
|
138
142
|
getStyles: C,
|
|
139
|
-
isHovered:
|
|
140
|
-
isSelected:
|
|
141
|
-
item:
|
|
143
|
+
isHovered: p.x === l?.x,
|
|
144
|
+
isSelected: p.x === s?.x,
|
|
145
|
+
item: p,
|
|
142
146
|
onItemClick: (S) => i(S, g),
|
|
143
147
|
onMouseEnter: () => a(g),
|
|
144
148
|
onMouseLeave: () => o()
|
|
145
149
|
},
|
|
146
|
-
|
|
150
|
+
p.x
|
|
147
151
|
))
|
|
148
152
|
] }),
|
|
149
153
|
/* @__PURE__ */ e(
|
|
@@ -204,11 +208,11 @@ const Oe = ({
|
|
|
204
208
|
/* @__PURE__ */ e(Ie, { sx: { color: "text.secondary" }, variant: "body2", children: t.zero_state_description })
|
|
205
209
|
] })
|
|
206
210
|
] }), At = w(({ onCTAClick: t }) => {
|
|
207
|
-
const [l, i] = d.useState(!1), { visibleAccounts: n } = J(), { onEvent: a } = Q(), { net_worth: o, common: s } = T(), { isInitialized: c, selectedAccounts: u, setSelectedAccounts: C } = P(), { loadChartData:
|
|
208
|
-
await g(u), await
|
|
211
|
+
const [l, i] = d.useState(!1), { visibleAccounts: n } = J(), { onEvent: a } = Q(), { net_worth: o, common: s } = T(), { isInitialized: c, selectedAccounts: u, setSelectedAccounts: C } = P(), { loadChartData: p, loadNetWorthData: g, netWorthData: S, selectedData: f } = ee(), x = async () => {
|
|
212
|
+
await g(u), await p(1), i(!0);
|
|
209
213
|
};
|
|
210
214
|
if (d.useEffect(() => C(n), [n]), d.useEffect(() => {
|
|
211
|
-
c &&
|
|
215
|
+
c && x().finally(), a(b.NET_WORTH_LOAD_WIDGET, {
|
|
212
216
|
state: n?.length ? "default" : "zeroState"
|
|
213
217
|
});
|
|
214
218
|
}, [c]), !l) return /* @__PURE__ */ e(O, { height: 100 });
|
|
@@ -227,9 +231,9 @@ const Oe = ({
|
|
|
227
231
|
children: S.accounts.length ? /* @__PURE__ */ e(
|
|
228
232
|
Ue,
|
|
229
233
|
{
|
|
230
|
-
amount:
|
|
234
|
+
amount: f?.y,
|
|
231
235
|
copy: o,
|
|
232
|
-
trendValue:
|
|
236
|
+
trendValue: f?.change
|
|
233
237
|
}
|
|
234
238
|
) : /* @__PURE__ */ e(Ve, { copy: o })
|
|
235
239
|
}
|
|
@@ -433,11 +437,11 @@ const Oe = ({
|
|
|
433
437
|
const { isCopyLoaded: l, isInitialized: i, selectedAccounts: n, setSelectedAccounts: a } = P(), { accounts: o, net_worth: s } = T(), { visibleAccounts: c } = J(), {
|
|
434
438
|
assetsLiabilities: u,
|
|
435
439
|
gainsLosses: C,
|
|
436
|
-
hoveredData:
|
|
440
|
+
hoveredData: p,
|
|
437
441
|
loadChartData: g,
|
|
438
442
|
loadNetWorthData: S,
|
|
439
|
-
netWorthChartData:
|
|
440
|
-
selectedData:
|
|
443
|
+
netWorthChartData: f,
|
|
444
|
+
selectedData: x,
|
|
441
445
|
setHoveredData: L,
|
|
442
446
|
setSelectedData: se
|
|
443
447
|
} = ee(), { isMobile: N } = Z(), { onEvent: D } = Q(), [ae, ce] = d.useState(!1), [A, le] = d.useState(6), [me, j] = d.useState(!1), [de, $] = d.useState(!1), [he, G] = d.useState(!1), ue = async () => {
|
|
@@ -464,13 +468,13 @@ const Oe = ({
|
|
|
464
468
|
const M = I[0], X = I[1];
|
|
465
469
|
M && X && le(Ee(X, M));
|
|
466
470
|
}, F = {
|
|
467
|
-
chartData:
|
|
468
|
-
hoveredData:
|
|
471
|
+
chartData: f,
|
|
472
|
+
hoveredData: p,
|
|
469
473
|
onButtonClick: ge,
|
|
470
474
|
onDataClick: pe,
|
|
471
475
|
onMouseEnter: fe,
|
|
472
476
|
onMouseLeave: xe,
|
|
473
|
-
selectedData:
|
|
477
|
+
selectedData: x
|
|
474
478
|
}, Ce = () => {
|
|
475
479
|
G(!0), D(b.ACCOUNTS_CLICK_CONNECT);
|
|
476
480
|
};
|
|
@@ -500,8 +504,8 @@ const Oe = ({
|
|
|
500
504
|
},
|
|
501
505
|
title: s.net_worth,
|
|
502
506
|
children: ae ? /* @__PURE__ */ r(v, { children: [
|
|
503
|
-
|
|
504
|
-
|
|
507
|
+
f.length ? /* @__PURE__ */ r(v, { children: [
|
|
508
|
+
x && /* @__PURE__ */ e(Ke, { hoveredData: p, selectedData: x }),
|
|
505
509
|
/* @__PURE__ */ r(
|
|
506
510
|
h,
|
|
507
511
|
{
|
package/package.json
CHANGED