@mx-cartographer/experiences 8.0.0-alpha.bb1 → 8.0.0-alpha.bb2
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/accounts/index.es.js +34 -32
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import d from "react";
|
|
3
3
|
import { observer as g } from "mobx-react-lite";
|
|
4
4
|
import { Text as v } from "@mxenabled/mxui";
|
|
5
5
|
import O from "@mui/material/Box";
|
|
6
6
|
import y from "@mui/material/Divider";
|
|
7
|
-
import
|
|
7
|
+
import W from "@mui/material/List";
|
|
8
8
|
import I from "@mui/material/ListSubheader";
|
|
9
9
|
import A from "@mui/system/Stack";
|
|
10
10
|
import { A as z } from "../AccountDetailsContent-CAM9y39M.mjs";
|
|
@@ -28,23 +28,23 @@ import l1 from "@mui/material/ListItem";
|
|
|
28
28
|
import { M as G } from "../MiniWidgetContainer-D0gfmbaF.mjs";
|
|
29
29
|
import { A as q1, a as J1 } from "../AccountStore-BgNOyMdp.mjs";
|
|
30
30
|
const n1 = () => {
|
|
31
|
-
const [
|
|
31
|
+
const [c, a] = d.useState(""), { accounts: n } = R(), { selectedAccounts: l } = w(), { setSelectedAccount: H, setSelectedMember: L } = P(), { members: u } = k(), { onEvent: p } = U(), m = [...new Set(l.map((t) => t.account_type))], r = l.find((t) => c === t.guid), s = d.useMemo(
|
|
32
32
|
() => l.filter((t) => t.is_hidden),
|
|
33
33
|
[l]
|
|
34
|
-
), h =
|
|
34
|
+
), h = d.useMemo(
|
|
35
35
|
() => l.filter((t) => t.is_closed),
|
|
36
36
|
[l]
|
|
37
37
|
), M = s.reduce(
|
|
38
38
|
(t, o) => (o.available_balance || o.balance || 0) + t,
|
|
39
39
|
0
|
|
40
40
|
), F = q(h, n);
|
|
41
|
-
|
|
41
|
+
d.useEffect(() => {
|
|
42
42
|
if (r) {
|
|
43
43
|
H(r);
|
|
44
44
|
const t = u.find((o) => o.guid === r?.member_guid) || {};
|
|
45
45
|
t && L(t);
|
|
46
46
|
}
|
|
47
|
-
}, [r,
|
|
47
|
+
}, [r, c]);
|
|
48
48
|
const V = (t) => {
|
|
49
49
|
a(t.guid), p(S.ACCOUNTS_CLICK_ACCOUNT, {
|
|
50
50
|
account_guid: t.guid,
|
|
@@ -53,7 +53,7 @@ const n1 = () => {
|
|
|
53
53
|
}, Z = (t) => {
|
|
54
54
|
const o = t === "hidden" ? s : h, B = t === "hidden" ? M : F, C = t === "hidden" ? n.account_hidden : n.account_closed;
|
|
55
55
|
return /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
56
|
-
|
|
56
|
+
W,
|
|
57
57
|
{
|
|
58
58
|
"aria-label": C,
|
|
59
59
|
subheader: /* @__PURE__ */ e(I, { component: "h2", sx: { backgroundColor: "transparent", px: 24 }, children: /* @__PURE__ */ i(
|
|
@@ -69,8 +69,8 @@ const n1 = () => {
|
|
|
69
69
|
}
|
|
70
70
|
) }),
|
|
71
71
|
children: /* @__PURE__ */ e(A, { children: o.map((f, x, K) => {
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */ i(
|
|
72
|
+
const E = x === K.length - 1;
|
|
73
|
+
return /* @__PURE__ */ i(d.Fragment, { children: [
|
|
74
74
|
/* @__PURE__ */ e(
|
|
75
75
|
D,
|
|
76
76
|
{
|
|
@@ -83,11 +83,11 @@ const n1 = () => {
|
|
|
83
83
|
y,
|
|
84
84
|
{
|
|
85
85
|
sx: {
|
|
86
|
-
mb:
|
|
87
|
-
ml:
|
|
86
|
+
mb: E ? 24 : 4,
|
|
87
|
+
ml: E ? 24 : 68
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
) : !
|
|
90
|
+
) : !E && /* @__PURE__ */ e(
|
|
91
91
|
y,
|
|
92
92
|
{
|
|
93
93
|
sx: {
|
|
@@ -110,7 +110,7 @@ const n1 = () => {
|
|
|
110
110
|
0
|
|
111
111
|
);
|
|
112
112
|
return o.length === 0 ? null : /* @__PURE__ */ e(
|
|
113
|
-
|
|
113
|
+
W,
|
|
114
114
|
{
|
|
115
115
|
"aria-label": n.account_type_accounts[o[0]?.account_type],
|
|
116
116
|
subheader: /* @__PURE__ */ e(I, { component: "h2", sx: { backgroundColor: "transparent", px: 24 }, children: /* @__PURE__ */ i(
|
|
@@ -127,7 +127,7 @@ const n1 = () => {
|
|
|
127
127
|
) }),
|
|
128
128
|
children: /* @__PURE__ */ e(A, { children: o.map((C) => {
|
|
129
129
|
const f = l.indexOf(C) === l.length - 1, x = o.indexOf(C) === o.length - 1;
|
|
130
|
-
return /* @__PURE__ */ i(
|
|
130
|
+
return /* @__PURE__ */ i(d.Fragment, { children: [
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
132
|
D,
|
|
133
133
|
{
|
|
@@ -157,7 +157,7 @@ const n1 = () => {
|
|
|
157
157
|
Q,
|
|
158
158
|
{
|
|
159
159
|
ariaLabelClose: n.close_account_details_aria,
|
|
160
|
-
isOpen: !!
|
|
160
|
+
isOpen: !!c,
|
|
161
161
|
onClose: () => a(""),
|
|
162
162
|
title: n.account_details,
|
|
163
163
|
children: [
|
|
@@ -168,9 +168,9 @@ const n1 = () => {
|
|
|
168
168
|
)
|
|
169
169
|
] });
|
|
170
170
|
}, i1 = g(n1), o1 = g(() => {
|
|
171
|
-
const { accounts:
|
|
171
|
+
const { accounts: c } = R(), { isDesktop: a } = $(), { selectedAccountGuids: n } = w(), { isAccountDataLoaded: l } = k();
|
|
172
172
|
return l ? /* @__PURE__ */ i(T, { sx: { px: a ? 24 : 12 }, children: [
|
|
173
|
-
n.length < 1 && /* @__PURE__ */ e(v, { display: "flex", justifyContent: "center", my: 24, children:
|
|
173
|
+
n.length < 1 && /* @__PURE__ */ e(v, { display: "flex", justifyContent: "center", my: 24, children: c.no_accounts }),
|
|
174
174
|
/* @__PURE__ */ e(i1, {})
|
|
175
175
|
] }) : /* @__PURE__ */ i(T, { gap: 24, children: [
|
|
176
176
|
/* @__PURE__ */ e(_, { height: 150, sx: { m: 24 }, variant: "rounded" }),
|
|
@@ -178,9 +178,11 @@ const n1 = () => {
|
|
|
178
178
|
/* @__PURE__ */ e(_, { height: 150, sx: { m: 24 }, variant: "rounded" }),
|
|
179
179
|
/* @__PURE__ */ e(_, { height: 150, sx: { m: 24 }, variant: "rounded" })
|
|
180
180
|
] });
|
|
181
|
-
}), C1 = ({ onBackClick:
|
|
182
|
-
const [n, l] =
|
|
183
|
-
|
|
181
|
+
}), C1 = ({ onBackClick: c, sx: a = {} }) => {
|
|
182
|
+
const [n, l] = d.useState(!1), [H, L] = d.useState(!1), { config: u } = J(), { detailedAccounts: p, isAccountDataLoaded: m, loadAccountData: r } = k(), { accounts: s, connect: h } = R(), { isInitialized: M, setSelectedAccounts: F } = w(), { onEvent: V } = U();
|
|
183
|
+
d.useEffect(() => {
|
|
184
|
+
m || r().finally();
|
|
185
|
+
}, []), d.useEffect(() => {
|
|
184
186
|
F(p);
|
|
185
187
|
}, [p]);
|
|
186
188
|
const Z = () => {
|
|
@@ -204,7 +206,7 @@ const n1 = () => {
|
|
|
204
206
|
accountOptions: p,
|
|
205
207
|
actions: o,
|
|
206
208
|
onAccountsFilterClick: () => V?.(S.ACCOUNTS_CLICK_FILTER),
|
|
207
|
-
onBackClick:
|
|
209
|
+
onBackClick: c,
|
|
208
210
|
sx: a,
|
|
209
211
|
title: s.title,
|
|
210
212
|
children: [
|
|
@@ -228,12 +230,12 @@ const n1 = () => {
|
|
|
228
230
|
]
|
|
229
231
|
}
|
|
230
232
|
);
|
|
231
|
-
}, D1 = g(C1), d1 = ({ onPrimaryCtaClick:
|
|
233
|
+
}, D1 = g(C1), d1 = ({ onPrimaryCtaClick: c, sx: a }) => {
|
|
232
234
|
const { visibleAccounts: n } = k(), { accounts: l } = R(), { isCopyLoaded: H, isInitialized: L, selectedAccounts: u, setSelectedAccounts: p } = w(), { isDesktop: m } = $();
|
|
233
|
-
|
|
235
|
+
d.useEffect(() => {
|
|
234
236
|
p(n);
|
|
235
237
|
}, [n]);
|
|
236
|
-
const r =
|
|
238
|
+
const r = d.useMemo(
|
|
237
239
|
() => t1(u, m ? 5 : 3),
|
|
238
240
|
[u, m]
|
|
239
241
|
);
|
|
@@ -241,15 +243,15 @@ const n1 = () => {
|
|
|
241
243
|
G,
|
|
242
244
|
{
|
|
243
245
|
className: "mx-exp-accounts-miniwidget",
|
|
244
|
-
onPrimaryCtaClick:
|
|
246
|
+
onPrimaryCtaClick: c,
|
|
245
247
|
primaryCtaLabel: l.primary_cta,
|
|
246
248
|
sx: a,
|
|
247
249
|
title: l.mini_title,
|
|
248
|
-
children: L ? /* @__PURE__ */ i(
|
|
250
|
+
children: L ? /* @__PURE__ */ i(W, { children: [
|
|
249
251
|
u.length === 0 && /* @__PURE__ */ e(l1, { sx: { justifyContent: "center" }, children: l.no_accounts }),
|
|
250
252
|
r.map((s, h) => {
|
|
251
253
|
const M = r.indexOf(s) === r.length - 1;
|
|
252
|
-
return /* @__PURE__ */ i(
|
|
254
|
+
return /* @__PURE__ */ i(d.Fragment, { children: [
|
|
253
255
|
/* @__PURE__ */ e(
|
|
254
256
|
D,
|
|
255
257
|
{
|
|
@@ -704,7 +706,7 @@ const n1 = () => {
|
|
|
704
706
|
]
|
|
705
707
|
}
|
|
706
708
|
), s1 = () => {
|
|
707
|
-
const { connect:
|
|
709
|
+
const { connect: c } = R();
|
|
708
710
|
return /* @__PURE__ */ i(T, { alignItems: "center", direction: "column", m: 24, children: [
|
|
709
711
|
/* @__PURE__ */ e(c1, {}),
|
|
710
712
|
/* @__PURE__ */ e(
|
|
@@ -716,17 +718,17 @@ const n1 = () => {
|
|
|
716
718
|
textAlign: "center"
|
|
717
719
|
},
|
|
718
720
|
variant: "Paragraph",
|
|
719
|
-
children:
|
|
721
|
+
children: c.mini_widget_content
|
|
720
722
|
}
|
|
721
723
|
)
|
|
722
724
|
] });
|
|
723
725
|
}, a1 = g(s1), r1 = ({
|
|
724
|
-
onPrimaryCtaClick:
|
|
726
|
+
onPrimaryCtaClick: c = () => {
|
|
725
727
|
},
|
|
726
728
|
sx: a
|
|
727
729
|
}) => {
|
|
728
|
-
const { isCopyLoaded: n } = w(), { connect: l } = R(), [H, L] =
|
|
729
|
-
L(!0),
|
|
730
|
+
const { isCopyLoaded: n } = w(), { connect: l } = R(), [H, L] = d.useState(!1), u = () => {
|
|
731
|
+
L(!0), c();
|
|
730
732
|
};
|
|
731
733
|
return n ? /* @__PURE__ */ i(
|
|
732
734
|
G,
|