@mx-cartographer/experiences 8.1.10 → 8.1.12
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [8.1.12] - 05-06-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Spendng Donut initializing with mismatched date range category totals
|
|
4
|
+
|
|
5
|
+
## [8.1.11] - 05-05-2026
|
|
6
|
+
|
|
7
|
+
- **FIXED** - Spending chart crash on chart color index overflow
|
|
8
|
+
|
|
1
9
|
## [8.1.10] - 05-05-2026
|
|
2
10
|
|
|
3
11
|
- **UPDATED** - Error component UI and no network fallback
|
|
@@ -13,72 +13,72 @@ import { u as R } from "./useAriaLive-MkYebyUR.mjs";
|
|
|
13
13
|
import { u as v } from "./hooks-RzCoiTd0.mjs";
|
|
14
14
|
import { u as V } from "./useScreenSize-CeFhWTt_.mjs";
|
|
15
15
|
import { f as b } from "./NumberFormatting-CyrvFgfd.mjs";
|
|
16
|
-
const D = 5, B = (i, l,
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
19
|
-
const t =
|
|
20
|
-
if (!
|
|
16
|
+
const D = 5, B = (i, l, s, m) => m.reduce((o, n) => {
|
|
17
|
+
const r = i.find((u) => u.guid === n.category_guid);
|
|
18
|
+
if (!r) return o;
|
|
19
|
+
const t = r.parent_guid ?? r.guid, a = i.find((u) => u.guid === t);
|
|
20
|
+
if (!a || n.total <= 0) return o;
|
|
21
21
|
const c = {
|
|
22
|
-
guid:
|
|
23
|
-
name:
|
|
24
|
-
color: _(
|
|
22
|
+
guid: r.guid,
|
|
23
|
+
name: r.guid === t ? `${l.parent_category_totals_label_general} ${r.name}` : r.name,
|
|
24
|
+
color: _(a.guid, s),
|
|
25
25
|
amount: n.total
|
|
26
|
-
}, e = o.find((
|
|
26
|
+
}, e = o.find((u) => u.guid === t);
|
|
27
27
|
return e ? (e.amount += n.total, e.categoryTotals?.push(c)) : o.push({
|
|
28
28
|
guid: t,
|
|
29
|
-
name:
|
|
30
|
-
color: _(
|
|
29
|
+
name: a.name,
|
|
30
|
+
color: _(a.guid, s),
|
|
31
31
|
categoryTotals: [c],
|
|
32
32
|
amount: n.total
|
|
33
33
|
}), o;
|
|
34
|
-
}, []), nt = (i, l,
|
|
35
|
-
const n = B(i, l,
|
|
34
|
+
}, []), nt = (i, l, s, m) => {
|
|
35
|
+
const n = B(i, l, s, m).filter(
|
|
36
36
|
(e) => e.guid !== p.INCOME && e.guid !== p.INVESTMENTS && e.guid !== p.TRANSFER && e.amount > 0
|
|
37
|
-
).sort((e,
|
|
38
|
-
(e,
|
|
37
|
+
).sort((e, u) => u.amount - e.amount), r = n.reduce(
|
|
38
|
+
(e, u) => e + u.amount,
|
|
39
39
|
0
|
|
40
|
-
), t = n.length > D ? D : n.length,
|
|
40
|
+
), t = n.length > D ? D : n.length, a = n.slice(0, t), c = a.map((e) => ({
|
|
41
41
|
id: e.guid,
|
|
42
|
-
color: _(e.guid,
|
|
42
|
+
color: _(e.guid, s),
|
|
43
43
|
label: e.name,
|
|
44
|
-
value: e.amount /
|
|
44
|
+
value: e.amount / r * 100
|
|
45
45
|
}));
|
|
46
46
|
if (n.length > 5) {
|
|
47
|
-
const e = n.slice(D),
|
|
48
|
-
(C,
|
|
47
|
+
const e = n.slice(D), u = e.reduce(
|
|
48
|
+
(C, g) => C + g.amount,
|
|
49
49
|
0
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
a.push({
|
|
52
52
|
guid: "other",
|
|
53
|
-
color:
|
|
53
|
+
color: s.palette.categories.others || "",
|
|
54
54
|
name: l.saving_goal_other,
|
|
55
55
|
categoryTotals: e,
|
|
56
|
-
amount:
|
|
56
|
+
amount: u
|
|
57
57
|
}), c.push({
|
|
58
58
|
id: "other",
|
|
59
|
-
color:
|
|
59
|
+
color: s.palette.categories.others || "",
|
|
60
60
|
label: l.saving_goal_other,
|
|
61
|
-
value:
|
|
61
|
+
value: u / r * 100
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
return {
|
|
65
|
-
categoryData:
|
|
65
|
+
categoryData: a,
|
|
66
66
|
donutData: c,
|
|
67
|
-
totalAmount:
|
|
67
|
+
totalAmount: r
|
|
68
68
|
};
|
|
69
|
-
}, et = (i, l,
|
|
69
|
+
}, et = (i, l, s) => {
|
|
70
70
|
const m = i.filter(
|
|
71
71
|
(t) => t.guid === p.INCOME || t.parent_guid === p.INCOME
|
|
72
|
-
), o = l.filter((t) => m.some((
|
|
72
|
+
), o = l.filter((t) => m.some((a) => a.guid === t.category_guid)).sort((t, a) => t.total - a.total).map((t, a) => ({
|
|
73
73
|
guid: t.category_guid,
|
|
74
74
|
name: i.find((c) => c.guid === t.category_guid)?.name,
|
|
75
|
-
color:
|
|
75
|
+
color: s[a % s.length],
|
|
76
76
|
categoryTotals: [],
|
|
77
77
|
amount: Math.abs(t.total)
|
|
78
78
|
})), n = o.reduce(
|
|
79
|
-
(t,
|
|
79
|
+
(t, a) => t + a.amount,
|
|
80
80
|
0
|
|
81
|
-
),
|
|
81
|
+
), r = o.map((t) => ({
|
|
82
82
|
id: t.guid,
|
|
83
83
|
color: t.color,
|
|
84
84
|
label: t.name,
|
|
@@ -86,36 +86,36 @@ const D = 5, B = (i, l, g, m) => m.reduce((o, n) => {
|
|
|
86
86
|
}));
|
|
87
87
|
return {
|
|
88
88
|
categoryData: o,
|
|
89
|
-
donutData:
|
|
89
|
+
donutData: r,
|
|
90
90
|
totalAmount: n
|
|
91
91
|
};
|
|
92
92
|
}, P = ({
|
|
93
93
|
data: i,
|
|
94
94
|
isIncome: l = !1,
|
|
95
|
-
onSelected:
|
|
95
|
+
onSelected: s,
|
|
96
96
|
onViewTransactions: m,
|
|
97
97
|
selectedId: o,
|
|
98
98
|
size: n = 150,
|
|
99
|
-
totalLabel:
|
|
99
|
+
totalLabel: r,
|
|
100
100
|
variant: t = "mini"
|
|
101
101
|
}) => {
|
|
102
|
-
const { spending:
|
|
102
|
+
const { spending: a } = v(), c = M(), { isTablet: e } = V(), { announce: u, ariaLive: C } = R(), g = T.useMemo(
|
|
103
103
|
() => o ? i.categoryData.find((x) => x.guid === o) : void 0,
|
|
104
104
|
[o]
|
|
105
105
|
);
|
|
106
106
|
T.useEffect(() => {
|
|
107
|
-
if (
|
|
108
|
-
const x = b(
|
|
109
|
-
|
|
107
|
+
if (g) {
|
|
108
|
+
const x = b(g.amount, t === "mini" ? "0,0" : "0,0.00");
|
|
109
|
+
u(`${g.name}: ${x}`);
|
|
110
110
|
}
|
|
111
|
-
}, [
|
|
111
|
+
}, [g, u, t]);
|
|
112
112
|
const E = i.donutData.length > 0 ? i.donutData : [{ id: "0", color: c.palette.divider, value: 100 }], I = () => {
|
|
113
113
|
m?.(o);
|
|
114
114
|
}, w = e ? 32 : 48;
|
|
115
115
|
return /* @__PURE__ */ f(N, { children: [
|
|
116
116
|
C,
|
|
117
|
-
/* @__PURE__ */ d(j, { data: E, onClick:
|
|
118
|
-
|
|
117
|
+
/* @__PURE__ */ d(j, { data: E, onClick: s, selectedId: o, size: n, children: /* @__PURE__ */ d(h, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ f(h, { alignItems: "center", justifyContent: "center", minHeight: n, minWidth: n, children: [
|
|
118
|
+
g && /* @__PURE__ */ f(
|
|
119
119
|
h,
|
|
120
120
|
{
|
|
121
121
|
alignItems: "center",
|
|
@@ -127,7 +127,7 @@ const D = 5, B = (i, l, g, m) => m.reduce((o, n) => {
|
|
|
127
127
|
/* @__PURE__ */ d(S, { "aria-hidden": "true", role: "presentation", children: /* @__PURE__ */ d(
|
|
128
128
|
G,
|
|
129
129
|
{
|
|
130
|
-
categoryGuid: l ? p.INCOME :
|
|
130
|
+
categoryGuid: l ? p.INCOME : g.guid,
|
|
131
131
|
size: t === "mini" ? 24 : w,
|
|
132
132
|
variant: O.Transparent
|
|
133
133
|
}
|
|
@@ -138,29 +138,29 @@ const D = 5, B = (i, l, g, m) => m.reduce((o, n) => {
|
|
|
138
138
|
color: "text.secondary",
|
|
139
139
|
noWrap: !0,
|
|
140
140
|
variant: t === "mini" ? "tiny" : "body1",
|
|
141
|
-
children:
|
|
141
|
+
children: g ? g.name : r
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
!
|
|
148
|
-
/* @__PURE__ */ d($, { variant: t === "mini" ? "h2" : "h1", children:
|
|
149
|
-
!
|
|
147
|
+
!g && t === "full" && /* @__PURE__ */ d(y, { bold: !0, color: "text.secondary", sx: { mb: { xs: 4, xl: 8 } }, children: r }),
|
|
148
|
+
/* @__PURE__ */ d($, { variant: t === "mini" ? "h2" : "h1", children: g ? b(g.amount, t === "mini" ? "0,0" : "0,0.00") : b(i.totalAmount, t === "mini" ? "0,0" : "0,0.00") }),
|
|
149
|
+
!g && t === "mini" && /* @__PURE__ */ d(y, { color: "text.secondary", noWrap: !0, variant: "tiny", children: r }),
|
|
150
150
|
t === "full" && /* @__PURE__ */ d(
|
|
151
151
|
A,
|
|
152
152
|
{
|
|
153
|
-
"aria-label": `View ${
|
|
153
|
+
"aria-label": `View ${g?.name || ""} Transactions`,
|
|
154
154
|
disabled: i.categoryData.length === 0,
|
|
155
155
|
onClick: I,
|
|
156
156
|
sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
|
|
157
157
|
variant: "text",
|
|
158
|
-
children:
|
|
158
|
+
children: a.view_transactions
|
|
159
159
|
}
|
|
160
160
|
)
|
|
161
161
|
] }) }) })
|
|
162
162
|
] });
|
|
163
|
-
},
|
|
163
|
+
}, at = k(P), rt = ({ data: i, onSelected: l, selectedId: s }) => {
|
|
164
164
|
const m = (o, n) => {
|
|
165
165
|
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), l(n));
|
|
166
166
|
};
|
|
@@ -169,7 +169,7 @@ const D = 5, B = (i, l, g, m) => m.reduce((o, n) => {
|
|
|
169
169
|
{
|
|
170
170
|
alignItems: "center",
|
|
171
171
|
"aria-label": o.name,
|
|
172
|
-
"aria-pressed": o.guid ===
|
|
172
|
+
"aria-pressed": o.guid === s,
|
|
173
173
|
direction: "row",
|
|
174
174
|
gap: 8,
|
|
175
175
|
onClick: () => l(o.guid),
|
|
@@ -179,15 +179,15 @@ const D = 5, B = (i, l, g, m) => m.reduce((o, n) => {
|
|
|
179
179
|
tabIndex: 0,
|
|
180
180
|
children: [
|
|
181
181
|
/* @__PURE__ */ d(S, { borderRadius: 4, height: 8, sx: { backgroundColor: o.color }, width: 8 }),
|
|
182
|
-
/* @__PURE__ */ d(y, { bold: o.guid ===
|
|
182
|
+
/* @__PURE__ */ d(y, { bold: o.guid === s, variant: "caption", children: o.name })
|
|
183
183
|
]
|
|
184
184
|
},
|
|
185
185
|
o.guid
|
|
186
186
|
)) });
|
|
187
187
|
};
|
|
188
188
|
export {
|
|
189
|
-
|
|
189
|
+
at as S,
|
|
190
190
|
et as a,
|
|
191
|
-
|
|
191
|
+
rt as b,
|
|
192
192
|
nt as g
|
|
193
193
|
};
|
|
@@ -51,7 +51,7 @@ import { ChartsXAxis as Zn } from "@mui/x-charts/ChartsXAxis";
|
|
|
51
51
|
import { ChartsYAxis as Jn } from "@mui/x-charts/ChartsYAxis";
|
|
52
52
|
import { startOfMonth as Dt } from "date-fns/startOfMonth";
|
|
53
53
|
import { endOfMonth as It } from "date-fns/endOfMonth";
|
|
54
|
-
import { g as eo, S as to, b as no } from "../SpendingLegend-
|
|
54
|
+
import { g as eo, S as to, b as no } from "../SpendingLegend-BS8mHUbu.mjs";
|
|
55
55
|
import { formatISO as oo } from "date-fns/formatISO";
|
|
56
56
|
import { fromUnixTime as ro } from "date-fns/fromUnixTime";
|
|
57
57
|
import { startOfToday as st } from "date-fns/startOfToday";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import c from "react";
|
|
3
3
|
import { observer as I } from "mobx-react-lite";
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { endOfMonth as
|
|
4
|
+
import { startOfMonth as at } from "date-fns/startOfMonth";
|
|
5
|
+
import { endOfMonth as it } from "date-fns/endOfMonth";
|
|
6
6
|
import L from "@mui/material/Box";
|
|
7
7
|
import y from "@mui/material/Stack";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import $ from "@mui/material/Tab";
|
|
9
|
+
import rt from "@mui/material/Tabs";
|
|
10
10
|
import _t from "@mui/material/styles/useTheme";
|
|
11
|
-
import { g as
|
|
11
|
+
import { g as st, a as lt, S as B, b as q } from "../SpendingLegend-BS8mHUbu.mjs";
|
|
12
12
|
import { Text as T, Icon as bt } from "@mxenabled/mxui";
|
|
13
|
-
import { f as
|
|
14
|
-
import { u as A, l as
|
|
15
|
-
import { u as
|
|
16
|
-
import { L as
|
|
13
|
+
import { f as k } from "../NumberFormatting-CyrvFgfd.mjs";
|
|
14
|
+
import { u as A, l as R, d as ct, b as P, a as H, h as dt, g as yt } from "../hooks-RzCoiTd0.mjs";
|
|
15
|
+
import { u as gt } from "../useWidgetLoadTimer-BZjr-BiE.mjs";
|
|
16
|
+
import { L as pt } from "../Loader-CxeBwuPG.mjs";
|
|
17
17
|
import { M as Ct } from "../MiniWidgetContainer-BOv3n4iw.mjs";
|
|
18
|
-
import { startOfToday as
|
|
18
|
+
import { startOfToday as J } from "date-fns/startOfToday";
|
|
19
19
|
import St from "@mui/material/Button";
|
|
20
20
|
import { useTheme as Tt } from "@mui/material";
|
|
21
21
|
import { e as Mt } from "../exportTransactionsToCSV-CSvbZrvL.mjs";
|
|
@@ -23,20 +23,20 @@ import { T as Dt } from "../EmbeddedCard-B9JoBaan.mjs";
|
|
|
23
23
|
import { T as xt } from "../TransactionDetails-C_skrQk8.mjs";
|
|
24
24
|
import vt from "@mui/material/Collapse";
|
|
25
25
|
import wt from "@mui/material/Divider";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
26
|
+
import Q from "@mui/material/List";
|
|
27
|
+
import X from "@mui/material/ListItem";
|
|
28
|
+
import Z from "@mui/material/ListItemButton";
|
|
29
29
|
import { u as Lt } from "../useScreenSize-CeFhWTt_.mjs";
|
|
30
|
-
import { D as
|
|
30
|
+
import { D as tt } from "../Drawer-XPaLYjiO.mjs";
|
|
31
31
|
import { b as w } from "../Category-Ccoew_sA.mjs";
|
|
32
|
-
import { parseISO as
|
|
33
|
-
import { A as
|
|
32
|
+
import { parseISO as et } from "date-fns/parseISO";
|
|
33
|
+
import { A as nt } from "../Analytics-CzGzz_sE.mjs";
|
|
34
34
|
import { W as It } from "../WidgetContainer-BPJoDkhL.mjs";
|
|
35
|
-
const
|
|
35
|
+
const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y, { direction: "column", children: [
|
|
36
36
|
/* @__PURE__ */ t(T, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: d }),
|
|
37
|
-
/* @__PURE__ */ t(T, { variant: "caption", children:
|
|
37
|
+
/* @__PURE__ */ t(T, { variant: "caption", children: k(n, o === "mini" ? "0,0" : "0,0.00") })
|
|
38
38
|
] }), At = () => {
|
|
39
|
-
const n = _t(), { goals: d, spending: o } = A(), { categories: a, dateRangeCategoryTotals: i } =
|
|
39
|
+
const n = _t(), { goals: d, spending: o } = A(), { categories: a, dateRangeCategoryTotals: i } = R(), g = c.useMemo(
|
|
40
40
|
() => [
|
|
41
41
|
n.palette.chartMono.chartMono5,
|
|
42
42
|
n.palette.chartMono.chartMono4,
|
|
@@ -46,57 +46,57 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
46
46
|
n.palette.chartMono.chartMono6
|
|
47
47
|
],
|
|
48
48
|
[n]
|
|
49
|
-
), [e, r] =
|
|
50
|
-
() =>
|
|
49
|
+
), [e, r] = c.useState(""), [s, b] = c.useState(0), u = c.useMemo(
|
|
50
|
+
() => st(a, d, n, i),
|
|
51
51
|
[a, i]
|
|
52
|
-
), h =
|
|
53
|
-
() =>
|
|
52
|
+
), h = c.useMemo(
|
|
53
|
+
() => lt(a, i, g),
|
|
54
54
|
[a, i, g]
|
|
55
|
-
), M = (
|
|
56
|
-
b(
|
|
57
|
-
},
|
|
58
|
-
r(e ===
|
|
55
|
+
), M = (_, D) => {
|
|
56
|
+
b(D), r("");
|
|
57
|
+
}, f = (_) => {
|
|
58
|
+
r(e === _ ? "" : _);
|
|
59
59
|
};
|
|
60
60
|
return /* @__PURE__ */ p(L, { width: "100%", children: [
|
|
61
61
|
/* @__PURE__ */ p(
|
|
62
|
-
|
|
62
|
+
rt,
|
|
63
63
|
{
|
|
64
64
|
"aria-label": o.mini_title,
|
|
65
65
|
onChange: M,
|
|
66
66
|
sx: { touchAction: "manipulation" },
|
|
67
|
-
value:
|
|
67
|
+
value: s,
|
|
68
68
|
variant: "fullWidth",
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
|
-
|
|
71
|
+
$,
|
|
72
72
|
{
|
|
73
73
|
"aria-controls": "spending-tabpanel",
|
|
74
74
|
id: "spending-tab",
|
|
75
75
|
label: /* @__PURE__ */ t(
|
|
76
|
-
|
|
76
|
+
G,
|
|
77
77
|
{
|
|
78
78
|
amount: u.totalAmount,
|
|
79
79
|
label: o.spend_tab_title,
|
|
80
80
|
variant: "mini"
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
tabIndex:
|
|
83
|
+
tabIndex: s === 0 ? 0 : -1
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ t(
|
|
87
|
-
|
|
87
|
+
$,
|
|
88
88
|
{
|
|
89
89
|
"aria-controls": "income-tabpanel",
|
|
90
90
|
id: "income-tab",
|
|
91
91
|
label: /* @__PURE__ */ t(
|
|
92
|
-
|
|
92
|
+
G,
|
|
93
93
|
{
|
|
94
94
|
amount: h.totalAmount,
|
|
95
95
|
label: o.income_tab_title,
|
|
96
96
|
variant: "mini"
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
tabIndex:
|
|
99
|
+
tabIndex: s === 1 ? 0 : -1
|
|
100
100
|
}
|
|
101
101
|
)
|
|
102
102
|
]
|
|
@@ -106,20 +106,20 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
106
106
|
L,
|
|
107
107
|
{
|
|
108
108
|
"aria-labelledby": "spending-tab",
|
|
109
|
-
hidden:
|
|
109
|
+
hidden: s !== 0,
|
|
110
110
|
id: "spending-tabpanel",
|
|
111
111
|
role: "tabpanel",
|
|
112
112
|
children: /* @__PURE__ */ p(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
113
113
|
/* @__PURE__ */ t(
|
|
114
|
-
|
|
114
|
+
B,
|
|
115
115
|
{
|
|
116
116
|
data: u,
|
|
117
|
-
onSelected:
|
|
117
|
+
onSelected: f,
|
|
118
118
|
selectedId: e,
|
|
119
119
|
totalLabel: o.total_spending
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */ t(
|
|
122
|
+
/* @__PURE__ */ t(q, { data: u, onSelected: f, selectedId: e })
|
|
123
123
|
] })
|
|
124
124
|
}
|
|
125
125
|
),
|
|
@@ -127,50 +127,50 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
127
127
|
L,
|
|
128
128
|
{
|
|
129
129
|
"aria-labelledby": "income-tab",
|
|
130
|
-
hidden:
|
|
130
|
+
hidden: s !== 1,
|
|
131
131
|
id: "income-tabpanel",
|
|
132
132
|
role: "tabpanel",
|
|
133
133
|
children: /* @__PURE__ */ p(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
134
134
|
/* @__PURE__ */ t(
|
|
135
|
-
|
|
135
|
+
B,
|
|
136
136
|
{
|
|
137
137
|
data: h,
|
|
138
138
|
isIncome: !0,
|
|
139
|
-
onSelected:
|
|
139
|
+
onSelected: f,
|
|
140
140
|
selectedId: e,
|
|
141
141
|
totalLabel: o.total_income
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
|
-
/* @__PURE__ */ t(
|
|
144
|
+
/* @__PURE__ */ t(q, { data: h, onSelected: f, selectedId: e })
|
|
145
145
|
] })
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
] });
|
|
149
149
|
}, Et = I(At), Wt = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
|
|
150
|
-
const { isAccountDataLoaded: o, loadAccountData: a } =
|
|
151
|
-
return
|
|
150
|
+
const { isAccountDataLoaded: o, loadAccountData: a } = ct(), { dateRangeTotalsLoaded: i, categoriesLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: r } = R(), { spending: s } = A(), { isInitialized: b, selectedAccounts: u } = P();
|
|
151
|
+
return gt({
|
|
152
152
|
widgetName: "SpendingMiniWidget",
|
|
153
153
|
isLoaded: i
|
|
154
|
-
}),
|
|
154
|
+
}), c.useEffect(() => {
|
|
155
155
|
o || a().finally(), g || e().finally();
|
|
156
|
-
}, []),
|
|
156
|
+
}, []), c.useEffect(() => {
|
|
157
157
|
r(
|
|
158
158
|
u,
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
at(/* @__PURE__ */ new Date()),
|
|
160
|
+
it(/* @__PURE__ */ new Date())
|
|
161
161
|
).finally();
|
|
162
162
|
}, [u]), b ? /* @__PURE__ */ t(
|
|
163
163
|
Ct,
|
|
164
164
|
{
|
|
165
165
|
className: "mx-exp-spending-miniwidget",
|
|
166
166
|
onPrimaryCtaClick: n,
|
|
167
|
-
primaryCtaLabel:
|
|
168
|
-
primaryCtaLabelAria:
|
|
167
|
+
primaryCtaLabel: s.primary_cta,
|
|
168
|
+
primaryCtaLabelAria: s.primary_cta_aria,
|
|
169
169
|
sx: { height: "100%", ...d },
|
|
170
|
-
title:
|
|
170
|
+
title: s.mini_title,
|
|
171
171
|
children: /* @__PURE__ */ t(Et, {})
|
|
172
172
|
}
|
|
173
|
-
) : /* @__PURE__ */ t(
|
|
173
|
+
) : /* @__PURE__ */ t(pt, {});
|
|
174
174
|
}, Ce = I(Wt), Rt = ({
|
|
175
175
|
data: n,
|
|
176
176
|
onSelected: d,
|
|
@@ -181,9 +181,9 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
181
181
|
return /* @__PURE__ */ p(y, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
182
182
|
/* @__PURE__ */ t(T, { bold: !0, id: "spending-list-title", sx: { py: 12 }, variant: "h3", children: `${a} ${i.by_category}` }),
|
|
183
183
|
/* @__PURE__ */ t(wt, { "aria-hidden": "true" }),
|
|
184
|
-
/* @__PURE__ */ t(
|
|
184
|
+
/* @__PURE__ */ t(Q, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ p(c.Fragment, { children: [
|
|
185
185
|
/* @__PURE__ */ t(
|
|
186
|
-
|
|
186
|
+
X,
|
|
187
187
|
{
|
|
188
188
|
disableGutters: !0,
|
|
189
189
|
disablePadding: !0,
|
|
@@ -193,7 +193,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
193
193
|
minHeight: 44
|
|
194
194
|
},
|
|
195
195
|
children: /* @__PURE__ */ p(
|
|
196
|
-
|
|
196
|
+
Z,
|
|
197
197
|
{
|
|
198
198
|
"aria-expanded": g?.guid === e.guid,
|
|
199
199
|
id: `spending-list-category-${e.guid}`,
|
|
@@ -221,7 +221,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
221
221
|
width: "100%",
|
|
222
222
|
children: [
|
|
223
223
|
/* @__PURE__ */ t(T, { bold: o === e.guid, children: e.name }),
|
|
224
|
-
/* @__PURE__ */ t(T, { bold: o === e.guid, variant: "body1", children:
|
|
224
|
+
/* @__PURE__ */ t(T, { bold: o === e.guid, variant: "body1", children: k(e.amount, "0,0.00") })
|
|
225
225
|
]
|
|
226
226
|
}
|
|
227
227
|
)
|
|
@@ -230,15 +230,15 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
230
230
|
)
|
|
231
231
|
}
|
|
232
232
|
),
|
|
233
|
-
e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(vt, { in: g?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ t(
|
|
234
|
-
|
|
233
|
+
e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(vt, { in: g?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ t(Q, { sx: { borderBottom: 1, borderColor: "divider" }, children: g?.categoryTotals?.map((r) => /* @__PURE__ */ t(
|
|
234
|
+
X,
|
|
235
235
|
{
|
|
236
236
|
sx: {
|
|
237
237
|
pl: 12,
|
|
238
238
|
py: 0
|
|
239
239
|
},
|
|
240
240
|
children: /* @__PURE__ */ t(
|
|
241
|
-
|
|
241
|
+
Z,
|
|
242
242
|
{
|
|
243
243
|
id: `spending-list-subcategory-${r.guid}`,
|
|
244
244
|
onClick: () => d(r.guid, !0),
|
|
@@ -248,7 +248,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
248
248
|
r.name,
|
|
249
249
|
" "
|
|
250
250
|
] }),
|
|
251
|
-
/* @__PURE__ */ t(T, { children:
|
|
251
|
+
/* @__PURE__ */ t(T, { children: k(r.amount, "0,0.00") })
|
|
252
252
|
] })
|
|
253
253
|
}
|
|
254
254
|
)
|
|
@@ -256,7 +256,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
256
256
|
r.guid
|
|
257
257
|
)) }) })
|
|
258
258
|
] }, e.guid)) }),
|
|
259
|
-
/* @__PURE__ */ t(T, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${
|
|
259
|
+
/* @__PURE__ */ t(T, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${k(n.totalAmount, "0,0.00")}` })
|
|
260
260
|
] });
|
|
261
261
|
}, Nt = I(Rt), Ot = ({
|
|
262
262
|
data: n,
|
|
@@ -265,7 +265,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
265
265
|
selectedId: a,
|
|
266
266
|
title: i
|
|
267
267
|
}) => {
|
|
268
|
-
const { isDesktop: g, isMobile: e } = Lt(), { dateRangeTotalsLoading: r } =
|
|
268
|
+
const { isDesktop: g, isMobile: e } = Lt(), { dateRangeTotalsLoading: r } = R(), { spending: s } = A();
|
|
269
269
|
return /* @__PURE__ */ p(
|
|
270
270
|
y,
|
|
271
271
|
{
|
|
@@ -277,7 +277,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
277
277
|
px: 8,
|
|
278
278
|
children: [
|
|
279
279
|
r && /* @__PURE__ */ t(
|
|
280
|
-
|
|
280
|
+
B,
|
|
281
281
|
{
|
|
282
282
|
data: {
|
|
283
283
|
categoryData: [],
|
|
@@ -293,7 +293,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
295
|
!r && /* @__PURE__ */ t(
|
|
296
|
-
|
|
296
|
+
B,
|
|
297
297
|
{
|
|
298
298
|
data: n,
|
|
299
299
|
onSelected: (h) => {
|
|
@@ -302,7 +302,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
302
302
|
onViewTransactions: o,
|
|
303
303
|
selectedId: a,
|
|
304
304
|
size: g ? 400 : 300,
|
|
305
|
-
totalLabel:
|
|
305
|
+
totalLabel: s.total_amount,
|
|
306
306
|
variant: "full"
|
|
307
307
|
}
|
|
308
308
|
),
|
|
@@ -310,7 +310,7 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
310
310
|
]
|
|
311
311
|
}
|
|
312
312
|
);
|
|
313
|
-
},
|
|
313
|
+
}, ot = I(Ot), kt = (n) => [
|
|
314
314
|
n.palette.chartMono.chartMono5,
|
|
315
315
|
n.palette.chartMono.chartMono4,
|
|
316
316
|
n.palette.chartMono.chartMono3,
|
|
@@ -318,85 +318,85 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
318
318
|
n.palette.chartMono.chartMono1,
|
|
319
319
|
n.palette.chartMono.chartMono6
|
|
320
320
|
], $t = () => {
|
|
321
|
-
const n = Tt(), { is_mobile_webview: d } =
|
|
321
|
+
const n = Tt(), { is_mobile_webview: d } = H(), { clientConfig: o } = H(), { categories: a, dateRangeCategoryTotals: i } = R(), {
|
|
322
322
|
goals: g,
|
|
323
323
|
spending: e,
|
|
324
324
|
transactions: r
|
|
325
|
-
} = A(), { displayedDateRange:
|
|
325
|
+
} = A(), { displayedDateRange: s, selectedAccountGuids: b } = P(), {
|
|
326
326
|
setFilter: u,
|
|
327
327
|
sortedTransactions: h,
|
|
328
328
|
sortedTransactionsWithSplits: M,
|
|
329
|
-
tags:
|
|
330
|
-
} =
|
|
331
|
-
() =>
|
|
329
|
+
tags: f
|
|
330
|
+
} = dt(), _ = o?.master?.deep_link_params?.account_guids, D = o?.master?.deep_link_params?.view, [x, N] = c.useState(""), [v, C] = c.useState(D === "income" ? 1 : 0), [E, W] = c.useState(""), [O, j] = c.useState(!1), F = c.useMemo(
|
|
331
|
+
() => st(a, g, n, i),
|
|
332
332
|
[a, i]
|
|
333
|
-
),
|
|
334
|
-
() =>
|
|
333
|
+
), K = c.useMemo(
|
|
334
|
+
() => lt(a, i, kt(n)),
|
|
335
335
|
[a, i]
|
|
336
|
-
),
|
|
337
|
-
() => h.find((
|
|
336
|
+
), V = c.useMemo(
|
|
337
|
+
() => h.find((l) => l.guid === E),
|
|
338
338
|
[E, h]
|
|
339
|
-
), ut = (
|
|
340
|
-
C(S),
|
|
341
|
-
},
|
|
342
|
-
S ? mt(
|
|
343
|
-
}, mt = (
|
|
339
|
+
), ut = (l, S) => {
|
|
340
|
+
C(S), N("");
|
|
341
|
+
}, U = (l, S = !1) => {
|
|
342
|
+
S ? mt(l) : N(x === l || l === "0" ? "" : l);
|
|
343
|
+
}, mt = (l) => {
|
|
344
344
|
u({
|
|
345
345
|
...{
|
|
346
|
-
accounts:
|
|
347
|
-
dateRange:
|
|
346
|
+
accounts: _ || b,
|
|
347
|
+
dateRange: s
|
|
348
348
|
},
|
|
349
|
-
custom: (m) =>
|
|
349
|
+
custom: (m) => x === "other" ? m.top_level_category_guid === l : m.category_guid === l,
|
|
350
350
|
showSplits: !0
|
|
351
|
-
}),
|
|
352
|
-
},
|
|
351
|
+
}), j(!0);
|
|
352
|
+
}, Y = (l) => {
|
|
353
353
|
const S = {
|
|
354
|
-
accounts:
|
|
355
|
-
dateRange:
|
|
354
|
+
accounts: _ || b,
|
|
355
|
+
dateRange: s
|
|
356
356
|
};
|
|
357
357
|
if (v === 0)
|
|
358
|
-
if (
|
|
359
|
-
const m =
|
|
358
|
+
if (l === "other") {
|
|
359
|
+
const m = F.categoryData.find((z) => z.guid === "other");
|
|
360
360
|
u({
|
|
361
361
|
...S,
|
|
362
|
-
custom: (
|
|
362
|
+
custom: (z) => !!m?.categoryTotals?.find((ft) => ft.guid === z.top_level_category_guid)
|
|
363
363
|
});
|
|
364
364
|
} else
|
|
365
365
|
u({
|
|
366
366
|
...S,
|
|
367
|
-
custom: (m) =>
|
|
368
|
-
showSplits: !!
|
|
367
|
+
custom: (m) => l ? m.top_level_category_guid === l : m.top_level_category_guid !== w.INCOME && m.category_guid !== w.INCOME && m.top_level_category_guid !== w.INVESTMENTS && m.top_level_category_guid !== w.TRANSFER,
|
|
368
|
+
showSplits: !!l
|
|
369
369
|
});
|
|
370
370
|
else
|
|
371
371
|
u({
|
|
372
372
|
...S,
|
|
373
|
-
custom: (m) =>
|
|
373
|
+
custom: (m) => l ? m.category_guid === l : m.category_guid === w.INCOME || m.top_level_category_guid === w.INCOME
|
|
374
374
|
});
|
|
375
|
-
|
|
375
|
+
j(!0);
|
|
376
376
|
}, ht = () => {
|
|
377
|
-
Mt(M,
|
|
377
|
+
Mt(M, f);
|
|
378
378
|
};
|
|
379
379
|
return /* @__PURE__ */ p(L, { children: [
|
|
380
|
-
/* @__PURE__ */ p(
|
|
380
|
+
/* @__PURE__ */ p(rt, { onChange: ut, value: v, variant: "fullWidth", children: [
|
|
381
381
|
/* @__PURE__ */ t(
|
|
382
|
-
|
|
382
|
+
$,
|
|
383
383
|
{
|
|
384
384
|
label: /* @__PURE__ */ t(
|
|
385
|
-
|
|
385
|
+
G,
|
|
386
386
|
{
|
|
387
|
-
amount:
|
|
387
|
+
amount: F.totalAmount,
|
|
388
388
|
label: e.spend_tab_title
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
/* @__PURE__ */ t(
|
|
394
|
-
|
|
394
|
+
$,
|
|
395
395
|
{
|
|
396
396
|
label: /* @__PURE__ */ t(
|
|
397
|
-
|
|
397
|
+
G,
|
|
398
398
|
{
|
|
399
|
-
amount:
|
|
399
|
+
amount: K.totalAmount,
|
|
400
400
|
label: e.income_tab_title
|
|
401
401
|
}
|
|
402
402
|
)
|
|
@@ -404,31 +404,31 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
404
404
|
)
|
|
405
405
|
] }),
|
|
406
406
|
v === 0 && /* @__PURE__ */ t(
|
|
407
|
-
|
|
407
|
+
ot,
|
|
408
408
|
{
|
|
409
|
-
data:
|
|
410
|
-
onSelected:
|
|
411
|
-
onViewTransactions:
|
|
412
|
-
selectedId:
|
|
409
|
+
data: F,
|
|
410
|
+
onSelected: U,
|
|
411
|
+
onViewTransactions: Y,
|
|
412
|
+
selectedId: x,
|
|
413
413
|
title: e.spend_tab_title
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
416
|
v === 1 && /* @__PURE__ */ t(
|
|
417
|
-
|
|
417
|
+
ot,
|
|
418
418
|
{
|
|
419
|
-
data:
|
|
420
|
-
onSelected:
|
|
421
|
-
onViewTransactions:
|
|
422
|
-
selectedId:
|
|
419
|
+
data: K,
|
|
420
|
+
onSelected: U,
|
|
421
|
+
onViewTransactions: Y,
|
|
422
|
+
selectedId: x,
|
|
423
423
|
title: e.income_tab_title
|
|
424
424
|
}
|
|
425
425
|
),
|
|
426
426
|
/* @__PURE__ */ t(
|
|
427
|
-
|
|
427
|
+
tt,
|
|
428
428
|
{
|
|
429
429
|
ariaLabelClose: e.close_drawer_aria,
|
|
430
|
-
isOpen:
|
|
431
|
-
onClose: () =>
|
|
430
|
+
isOpen: O,
|
|
431
|
+
onClose: () => j(!1),
|
|
432
432
|
title: e.transactions_drawer_title,
|
|
433
433
|
children: /* @__PURE__ */ p(y, { children: [
|
|
434
434
|
!d && h.length > 0 && /* @__PURE__ */ t(y, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
|
|
@@ -440,51 +440,51 @@ const $ = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
440
440
|
children: r.export_csv_btn
|
|
441
441
|
}
|
|
442
442
|
) }),
|
|
443
|
-
/* @__PURE__ */ t(Dt, { onClick:
|
|
443
|
+
/* @__PURE__ */ t(Dt, { onClick: W })
|
|
444
444
|
] })
|
|
445
445
|
}
|
|
446
446
|
),
|
|
447
447
|
/* @__PURE__ */ t(
|
|
448
|
-
|
|
448
|
+
tt,
|
|
449
449
|
{
|
|
450
450
|
ariaLabelClose: e.close_drawer_aria,
|
|
451
|
-
isOpen: !!
|
|
452
|
-
onClose: () =>
|
|
451
|
+
isOpen: !!V,
|
|
452
|
+
onClose: () => W(""),
|
|
453
453
|
title: e.transaction_details_drawer_title,
|
|
454
|
-
children:
|
|
454
|
+
children: V && /* @__PURE__ */ t(xt, { transaction: V })
|
|
455
455
|
}
|
|
456
456
|
)
|
|
457
457
|
] });
|
|
458
458
|
}, Bt = I($t), Gt = ({ onBackClick: n, onMenuClick: d, sx: o = {} }) => {
|
|
459
|
-
const { isAccountDataLoaded: a, loadAccountData: i } =
|
|
460
|
-
|
|
459
|
+
const { isAccountDataLoaded: a, loadAccountData: i } = ct(), { categoriesLoaded: g, dateRangeTotalsLoaded: e, loadCategories: r, loadDateRangeCategoryTotals: s } = R(), { isTransactionDataLoaded: b, loadTransactionData: u } = dt(), { spending: h } = A(), { displayedDateRange: M, isInitialized: f, setDisplayedDate: _, selectedAccounts: D } = P(), { onEvent: x } = yt(), { clientConfig: N } = H();
|
|
460
|
+
gt({
|
|
461
461
|
widgetName: "SpendingWidget",
|
|
462
462
|
isLoaded: e
|
|
463
|
-
}),
|
|
464
|
-
const C =
|
|
465
|
-
|
|
466
|
-
}, []),
|
|
467
|
-
|
|
468
|
-
|
|
463
|
+
}), c.useEffect(() => {
|
|
464
|
+
const C = N?.master?.deep_link_params, E = C?.date_range ? [et(C.date_range.from), et(C.date_range.to)] : [at(J()), it(J())], W = E[0], O = E[1];
|
|
465
|
+
_(W, O), a || i().finally(), g || r().finally(), b || u().finally(), f && s(D, W, O).finally(), x(nt.SPENDING_VIEW);
|
|
466
|
+
}, []), c.useEffect(() => {
|
|
467
|
+
f && s(
|
|
468
|
+
D,
|
|
469
469
|
M.start,
|
|
470
470
|
M.end
|
|
471
471
|
).finally();
|
|
472
|
-
}, [M,
|
|
472
|
+
}, [M, f, D]);
|
|
473
473
|
const v = (C) => {
|
|
474
|
-
|
|
474
|
+
_(C[0], C[1]);
|
|
475
475
|
};
|
|
476
|
-
return
|
|
476
|
+
return f ? /* @__PURE__ */ t(
|
|
477
477
|
It,
|
|
478
478
|
{
|
|
479
479
|
calendarActions: { onRangeChanged: v },
|
|
480
|
-
onAccountsFilterClick: () =>
|
|
480
|
+
onAccountsFilterClick: () => x(nt.SPENDING_CLICK_FILTER),
|
|
481
481
|
onBackClick: n,
|
|
482
482
|
onMenuClick: d,
|
|
483
483
|
sx: o,
|
|
484
484
|
title: h.title,
|
|
485
485
|
children: /* @__PURE__ */ t(L, { width: "100%", children: /* @__PURE__ */ t(Bt, {}) })
|
|
486
486
|
}
|
|
487
|
-
) : /* @__PURE__ */ t(
|
|
487
|
+
) : /* @__PURE__ */ t(pt, {});
|
|
488
488
|
}, Se = I(Gt);
|
|
489
489
|
export {
|
|
490
490
|
Ce as SpendingMiniWidget,
|