@mx-cartographer/experiences 7.3.0 → 7.3.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/CHANGELOG.md +4 -0
- package/dist/{ExportCsvAction-DZ10CbWd.mjs → ExportCsvAction-DNSgmdyv.mjs} +1 -1
- package/dist/{TransactionStore-C1oyQCZK.mjs → TransactionStore-CtGTg0XS.mjs} +1 -1
- package/dist/budgets/index.es.js +1 -1
- package/dist/common/index.es.js +2 -2
- package/dist/exportTransactionsToCSV-C4PkIYP6.mjs +48 -0
- package/dist/spending/index.es.js +330 -307
- package/dist/transactions/index.es.js +4 -4
- package/dist/trends/index.es.js +1 -1
- package/package.json +2 -2
- package/dist/exportTransactionsToCSV-B8qpk5MU.mjs +0 -48
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { observer as c } from "mobx-react-lite";
|
|
3
3
|
import { Icon as i } from "@mxenabled/mxui";
|
|
4
|
-
import { e as p } from "./exportTransactionsToCSV-
|
|
4
|
+
import { e as p } from "./exportTransactionsToCSV-C4PkIYP6.mjs";
|
|
5
5
|
import { O as m } from "./User-Bj34_i8g.mjs";
|
|
6
6
|
import { R as x } from "./ResponsiveButton-DZFp78fJ.mjs";
|
|
7
7
|
import { g as _, h as C, u as l } from "./hooks-Cy8JnjCg.mjs";
|
|
@@ -16,7 +16,7 @@ import { subDays as F } from "date-fns/subDays";
|
|
|
16
16
|
import { O as n, a as G, T as w } from "./User-Bj34_i8g.mjs";
|
|
17
17
|
import { T as p } from "./TransactionApi-CjBoLleL.mjs";
|
|
18
18
|
import { b as W } from "./Category-CevNQ03n.mjs";
|
|
19
|
-
import { f as z } from "./exportTransactionsToCSV-
|
|
19
|
+
import { f as z } from "./exportTransactionsToCSV-C4PkIYP6.mjs";
|
|
20
20
|
import { format as k } from "date-fns/format";
|
|
21
21
|
import { f as g, D as O, O as $ } from "./Dialog-CWW597AF.mjs";
|
|
22
22
|
import { endOfMonth as X } from "date-fns/endOfMonth";
|
package/dist/budgets/index.es.js
CHANGED
|
@@ -37,7 +37,7 @@ import et from "@mui/material/Alert";
|
|
|
37
37
|
import tt from "@mui/material/Snackbar";
|
|
38
38
|
import Ce from "@mui/material/Tab";
|
|
39
39
|
import nt from "@mui/material/Tabs";
|
|
40
|
-
import { e as ot } from "../exportTransactionsToCSV-
|
|
40
|
+
import { e as ot } from "../exportTransactionsToCSV-C4PkIYP6.mjs";
|
|
41
41
|
import { T as De, a as at } from "../TransactionDetails-BUoNbsu-.mjs";
|
|
42
42
|
import fe from "@mui/material/Card";
|
|
43
43
|
import be from "@mui/material/CardContent";
|
package/dist/common/index.es.js
CHANGED
|
@@ -18,8 +18,8 @@ import { C as Qs } from "../CurrencyInput-lSC7oPDg.mjs";
|
|
|
18
18
|
import { L as Xs } from "../Loader-DUaFpDGv.mjs";
|
|
19
19
|
import { R as Ks } from "../ResponsiveButton-DZFp78fJ.mjs";
|
|
20
20
|
import { S as Zs } from "../SearchBox-B2_zLv8-.mjs";
|
|
21
|
-
import { T as at } from "../TransactionStore-
|
|
22
|
-
import { S as tr } from "../TransactionStore-
|
|
21
|
+
import { T as at } from "../TransactionStore-CtGTg0XS.mjs";
|
|
22
|
+
import { S as tr } from "../TransactionStore-CtGTg0XS.mjs";
|
|
23
23
|
import { T as sr } from "../TabContentContainer-j01JYR_7.mjs";
|
|
24
24
|
import { I as or } from "../IconBacking-B9oC6uL2.mjs";
|
|
25
25
|
import { D as nr, F as ir, a as cr, c as dr, R as lr, S as ur } from "../RecurringTransactions-ej39mgA6.mjs";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { fromUnixTime as d } from "date-fns/fromUnixTime";
|
|
2
|
+
import { c as u } from "./Category-CevNQ03n.mjs";
|
|
3
|
+
import { f as p, D as g } from "./Dialog-CWW597AF.mjs";
|
|
4
|
+
import { T as m } from "./User-Bj34_i8g.mjs";
|
|
5
|
+
function f(t) {
|
|
6
|
+
return new Set(
|
|
7
|
+
t.filter((n) => n.parent_guid !== void 0).map((n) => n.parent_guid)
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
function T(t) {
|
|
11
|
+
return t.reduce((n, e) => (e.parent_guid && (n[e.parent_guid] || (n[e.parent_guid] = []), n[e.parent_guid].push(e)), n), {});
|
|
12
|
+
}
|
|
13
|
+
function j(t, n) {
|
|
14
|
+
const e = f(n), o = T(n), r = /* @__PURE__ */ new Set(), a = [];
|
|
15
|
+
for (const i of t)
|
|
16
|
+
e.has(i.guid) ? (o[i.guid] ?? []).slice().sort((s, c) => Math.abs(c.amount) - Math.abs(s.amount)).forEach((s) => {
|
|
17
|
+
r.has(s.guid) || (a.push(s), r.add(s.guid));
|
|
18
|
+
}) : r.has(i.guid) || (a.push(i), r.add(i.guid));
|
|
19
|
+
return a;
|
|
20
|
+
}
|
|
21
|
+
const A = (t, n) => {
|
|
22
|
+
const e = _(l(t, n)), o = new Blob([e], { type: "text/csv;charset=utf-8;" }), r = document.createElement("a");
|
|
23
|
+
r.href = URL.createObjectURL(o), r.setAttribute("download", "transactions.csv"), document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(r.href);
|
|
24
|
+
}, l = (t, n) => t.map((e) => ({
|
|
25
|
+
Date: p(d(e.date), g.YEAR_MONTH_DAY),
|
|
26
|
+
Description: y(e),
|
|
27
|
+
"Original Description": e.feed_description,
|
|
28
|
+
Amount: `${e.amount}`,
|
|
29
|
+
Type: e.transaction_type === m.CREDIT ? "Credit" : "Debit",
|
|
30
|
+
"Parent Category": u[e.top_level_category_guid || ""],
|
|
31
|
+
Category: e.category,
|
|
32
|
+
Account: e.account,
|
|
33
|
+
Tags: C(e, n),
|
|
34
|
+
Memo: e.memo,
|
|
35
|
+
Pending: e.isPending ? "TRUE" : "FALSE"
|
|
36
|
+
})), h = (t) => t ? /[,"\n\r]/.test(t) ? `"${t.replace(/"/g, '""')}"` : t : "", _ = (t) => {
|
|
37
|
+
const n = Object.keys(t[0]).join(",").concat(`\r
|
|
38
|
+
`), e = t.map((o) => Object.values(o).map(h).join(",")).join(`\r
|
|
39
|
+
`);
|
|
40
|
+
return n + e;
|
|
41
|
+
}, y = (t) => {
|
|
42
|
+
let n = t.parent_guid ? "Split: " : "";
|
|
43
|
+
return n += t.is_hidden ? "(Excluded) " : "", n += t.description, n;
|
|
44
|
+
}, C = (t, n) => t.tags.map((e) => n.filter((r) => r.guid === e)[0]?.name ?? "").join(" ");
|
|
45
|
+
export {
|
|
46
|
+
A as e,
|
|
47
|
+
j as f
|
|
48
|
+
};
|
|
@@ -1,80 +1,81 @@
|
|
|
1
|
-
import { jsxs as h, jsx as t, Fragment as
|
|
1
|
+
import { jsxs as h, jsx as t, Fragment as St } from "react/jsx-runtime";
|
|
2
2
|
import p from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { endOfMonth as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { b as
|
|
3
|
+
import { observer as v } from "mobx-react-lite";
|
|
4
|
+
import { startOfMonth as st } from "date-fns/startOfMonth";
|
|
5
|
+
import { endOfMonth as ct } from "date-fns/endOfMonth";
|
|
6
|
+
import D from "@mui/material/Box";
|
|
7
|
+
import f from "@mui/material/Stack";
|
|
8
|
+
import N from "@mui/material/Tab";
|
|
9
|
+
import lt from "@mui/material/Tabs";
|
|
10
|
+
import Tt from "@mui/material/styles/useTheme";
|
|
11
|
+
import { b as F } from "../CategoryUtil-BR3H5i6n.mjs";
|
|
12
12
|
import { b as _ } from "../Category-CevNQ03n.mjs";
|
|
13
|
-
import { Text as
|
|
14
|
-
import { f as
|
|
15
|
-
import { c as
|
|
16
|
-
import
|
|
17
|
-
import { useTheme as
|
|
18
|
-
import { u as
|
|
19
|
-
import { u as
|
|
20
|
-
import { D as
|
|
21
|
-
import { L as
|
|
22
|
-
import { M as
|
|
23
|
-
import { startOfToday as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
import { Text as C, CategoryIcon as Mt, CategoryIconVariants as xt, Icon as Dt } from "@mxenabled/mxui";
|
|
14
|
+
import { f as w } from "../NumberFormatting-Buh7u8Oi.mjs";
|
|
15
|
+
import { c as wt, T as vt, a as It } from "../TransactionDetails-BUoNbsu-.mjs";
|
|
16
|
+
import dt from "@mui/material/Button";
|
|
17
|
+
import { useTheme as gt } from "@mui/material";
|
|
18
|
+
import { u as I, b as k, m as P, d as ut, n as Et, a as H, h as At, g as Lt } from "../hooks-Cy8JnjCg.mjs";
|
|
19
|
+
import { u as pt } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
20
|
+
import { D as Nt } from "../Donut-oaQFlbit.mjs";
|
|
21
|
+
import { L as K } from "../Loader-DUaFpDGv.mjs";
|
|
22
|
+
import { M as Wt } from "../MiniWidgetContainer-BdgBvpga.mjs";
|
|
23
|
+
import { startOfToday as tt } from "date-fns/startOfToday";
|
|
24
|
+
import { e as Ot } from "../exportTransactionsToCSV-C4PkIYP6.mjs";
|
|
25
|
+
import kt from "@mui/material/Collapse";
|
|
26
|
+
import V from "@mui/material/Divider";
|
|
27
|
+
import et from "@mui/material/List";
|
|
28
|
+
import nt from "@mui/material/ListItem";
|
|
29
|
+
import Rt from "@mui/material/ListItemButton";
|
|
30
|
+
import { D as ot } from "../Drawer-kEE73B87.mjs";
|
|
31
|
+
import { A as at, W as $t } from "../WidgetContainer-BnTgAfQn.mjs";
|
|
32
|
+
const z = 5, Gt = (n, d, s) => s.reduce((l, e) => {
|
|
33
|
+
if (e.total > 0) {
|
|
34
|
+
const a = n.find((r) => r.guid === e.category_guid);
|
|
34
35
|
if (!a) return l;
|
|
35
|
-
const i = a.parent_guid ?? a.guid,
|
|
36
|
-
if (!
|
|
36
|
+
const i = a.parent_guid ?? a.guid, o = n.find((r) => r.guid === i);
|
|
37
|
+
if (!o) return l;
|
|
37
38
|
const c = {
|
|
38
39
|
guid: a.guid,
|
|
39
40
|
name: a.guid === i ? `General ${a.name}` : a.name,
|
|
40
|
-
color:
|
|
41
|
-
amount:
|
|
42
|
-
}, u = l.find((
|
|
43
|
-
u ? (u.amount +=
|
|
41
|
+
color: F(o.guid, d),
|
|
42
|
+
amount: e.total
|
|
43
|
+
}, u = l.find((r) => r.guid === i);
|
|
44
|
+
u ? (u.amount += e.total, u.categoryTotals?.push(c)) : l.push({
|
|
44
45
|
guid: i,
|
|
45
|
-
name:
|
|
46
|
-
color:
|
|
46
|
+
name: o.name,
|
|
47
|
+
color: F(o.guid, d),
|
|
47
48
|
categoryTotals: [c],
|
|
48
|
-
amount:
|
|
49
|
+
amount: e.total
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
return l;
|
|
52
|
-
}, []),
|
|
53
|
-
const
|
|
54
|
-
(
|
|
55
|
-
).sort((
|
|
56
|
-
(
|
|
53
|
+
}, []), mt = (n, d, s, l) => {
|
|
54
|
+
const e = Gt(n, s, l), a = e.filter(
|
|
55
|
+
(r) => r.guid !== _.INCOME && r.guid !== _.INVESTMENTS && r.guid !== _.TRANSFER
|
|
56
|
+
).sort((r, m) => m.amount - r.amount), i = a.reduce(
|
|
57
|
+
(r, m) => r + m.amount,
|
|
57
58
|
0
|
|
58
|
-
),
|
|
59
|
-
id:
|
|
60
|
-
color:
|
|
61
|
-
label:
|
|
62
|
-
value:
|
|
59
|
+
), o = a.length > z ? z : a.length, c = a.slice(0, o), u = c.map((r) => ({
|
|
60
|
+
id: r.guid,
|
|
61
|
+
color: F(r.guid, s),
|
|
62
|
+
label: r.name,
|
|
63
|
+
value: r.amount / i * 100
|
|
63
64
|
}));
|
|
64
65
|
if (a.length > 5) {
|
|
65
|
-
const
|
|
66
|
-
(
|
|
66
|
+
const r = a.slice(z, e.length), m = r.reduce(
|
|
67
|
+
(M, g) => M + g.amount,
|
|
67
68
|
0
|
|
68
69
|
);
|
|
69
70
|
c.push({
|
|
70
71
|
guid: "other",
|
|
71
|
-
color:
|
|
72
|
+
color: s.palette.categories.others || "",
|
|
72
73
|
name: d.saving_goal_other,
|
|
73
|
-
categoryTotals:
|
|
74
|
+
categoryTotals: r,
|
|
74
75
|
amount: m
|
|
75
76
|
}), u.push({
|
|
76
77
|
id: "other",
|
|
77
|
-
color:
|
|
78
|
+
color: s.palette.categories.others || "",
|
|
78
79
|
label: d.saving_goal_other,
|
|
79
80
|
value: m / i * 100
|
|
80
81
|
});
|
|
@@ -84,96 +85,96 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
84
85
|
donutData: u,
|
|
85
86
|
totalAmount: i
|
|
86
87
|
};
|
|
87
|
-
},
|
|
88
|
-
const l =
|
|
89
|
-
(
|
|
90
|
-
),
|
|
91
|
-
guid:
|
|
92
|
-
name:
|
|
93
|
-
color:
|
|
88
|
+
}, ht = (n, d, s) => {
|
|
89
|
+
const l = n.filter(
|
|
90
|
+
(o) => o.guid === _.INCOME || o.parent_guid === _.INCOME
|
|
91
|
+
), e = d.filter((o) => l.some((c) => c.guid === o.category_guid)).sort((o, c) => o.total - c.total).map((o, c) => ({
|
|
92
|
+
guid: o.category_guid,
|
|
93
|
+
name: n.find((u) => u.guid === o.category_guid)?.name,
|
|
94
|
+
color: s[c],
|
|
94
95
|
categoryTotals: [],
|
|
95
|
-
amount: Math.abs(
|
|
96
|
-
})), a =
|
|
97
|
-
(
|
|
96
|
+
amount: Math.abs(o.total)
|
|
97
|
+
})), a = e.reduce(
|
|
98
|
+
(o, c) => o + c.amount,
|
|
98
99
|
0
|
|
99
|
-
), i =
|
|
100
|
-
id:
|
|
101
|
-
color:
|
|
102
|
-
label:
|
|
103
|
-
value:
|
|
100
|
+
), i = e.map((o) => ({
|
|
101
|
+
id: o.guid,
|
|
102
|
+
color: o.color,
|
|
103
|
+
label: o.name,
|
|
104
|
+
value: o.amount / a * 100
|
|
104
105
|
}));
|
|
105
106
|
return {
|
|
106
|
-
categoryData:
|
|
107
|
+
categoryData: e,
|
|
107
108
|
donutData: i,
|
|
108
109
|
totalAmount: a
|
|
109
110
|
};
|
|
110
|
-
},
|
|
111
|
-
/* @__PURE__ */ t(
|
|
112
|
-
/* @__PURE__ */ t(
|
|
113
|
-
] }),
|
|
114
|
-
data:
|
|
111
|
+
}, W = ({ amount: n, label: d }) => /* @__PURE__ */ h(f, { direction: "column", children: [
|
|
112
|
+
/* @__PURE__ */ t(C, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
|
|
113
|
+
/* @__PURE__ */ t(C, { variant: "XSmall", children: w(n, "0,0") })
|
|
114
|
+
] }), jt = ({
|
|
115
|
+
data: n,
|
|
115
116
|
isIncome: d = !1,
|
|
116
|
-
onSelected:
|
|
117
|
+
onSelected: s,
|
|
117
118
|
onViewTransactions: l,
|
|
118
|
-
selectedId:
|
|
119
|
+
selectedId: e,
|
|
119
120
|
size: a = 150,
|
|
120
121
|
totalLabel: i,
|
|
121
|
-
variant:
|
|
122
|
+
variant: o = "mini"
|
|
122
123
|
}) => {
|
|
123
|
-
const { spending: c } =
|
|
124
|
-
() =>
|
|
125
|
-
[
|
|
124
|
+
const { spending: c } = I(), u = gt(), { isTablet: r } = pt(), { announce: m, ariaLive: M } = wt(), g = p.useMemo(
|
|
125
|
+
() => e ? n.categoryData.find((S) => S.guid === e) : void 0,
|
|
126
|
+
[e]
|
|
126
127
|
);
|
|
127
128
|
p.useEffect(() => {
|
|
128
129
|
if (g) {
|
|
129
|
-
const
|
|
130
|
-
m(`${g.name}: ${
|
|
130
|
+
const S = w(g.amount, "0,0");
|
|
131
|
+
m(`${g.name}: ${S}`);
|
|
131
132
|
}
|
|
132
133
|
}, [g, m]);
|
|
133
|
-
const
|
|
134
|
-
l?.(
|
|
135
|
-
},
|
|
136
|
-
return /* @__PURE__ */ h(
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */ t(
|
|
134
|
+
const b = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]), E = () => {
|
|
135
|
+
l?.(e);
|
|
136
|
+
}, x = r ? 32 : 48;
|
|
137
|
+
return /* @__PURE__ */ h(St, { children: [
|
|
138
|
+
M,
|
|
139
|
+
/* @__PURE__ */ t(Nt, { data: b, onClick: s, selectedId: e, size: a, children: /* @__PURE__ */ t(f, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(f, { alignItems: "center", justifyContent: "center", minHeight: a, minWidth: a, children: [
|
|
139
140
|
g && /* @__PURE__ */ h(
|
|
140
|
-
|
|
141
|
+
f,
|
|
141
142
|
{
|
|
142
143
|
alignItems: "center",
|
|
143
|
-
gap:
|
|
144
|
-
mb:
|
|
145
|
-
mt:
|
|
146
|
-
sx:
|
|
144
|
+
gap: o === "mini" ? 0 : 8,
|
|
145
|
+
mb: o === "mini" ? 0 : 8,
|
|
146
|
+
mt: o === "mini" ? 0 : -16,
|
|
147
|
+
sx: o === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
|
|
147
148
|
children: [
|
|
148
149
|
/* @__PURE__ */ t(
|
|
149
|
-
|
|
150
|
+
Mt,
|
|
150
151
|
{
|
|
151
152
|
categoryGuid: d ? _.INCOME : g.guid,
|
|
152
|
-
size:
|
|
153
|
-
variant:
|
|
153
|
+
size: o === "mini" ? 24 : x,
|
|
154
|
+
variant: xt.Transparent
|
|
154
155
|
}
|
|
155
156
|
),
|
|
156
157
|
/* @__PURE__ */ t(
|
|
157
|
-
|
|
158
|
+
C,
|
|
158
159
|
{
|
|
159
160
|
color: "secondary",
|
|
160
161
|
noWrap: !0,
|
|
161
|
-
variant:
|
|
162
|
+
variant: o === "mini" ? "Tiny" : "Body",
|
|
162
163
|
children: g ? g.name : i
|
|
163
164
|
}
|
|
164
165
|
)
|
|
165
166
|
]
|
|
166
167
|
}
|
|
167
168
|
),
|
|
168
|
-
!g &&
|
|
169
|
-
/* @__PURE__ */ t(
|
|
170
|
-
!g &&
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
!g && o === "full" && /* @__PURE__ */ t(C, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: i }),
|
|
170
|
+
/* @__PURE__ */ t(C, { variant: o === "mini" ? "H2" : "H1", children: g ? w(g.amount, "0,0") : w(n.totalAmount, "0,0") }),
|
|
171
|
+
!g && o === "mini" && /* @__PURE__ */ t(C, { color: "secondary", noWrap: !0, variant: "Tiny", children: i }),
|
|
172
|
+
o === "full" && /* @__PURE__ */ t(
|
|
173
|
+
dt,
|
|
173
174
|
{
|
|
174
175
|
"aria-label": `View ${g?.name || ""} Transactions`,
|
|
175
|
-
disabled:
|
|
176
|
-
onClick:
|
|
176
|
+
disabled: n.categoryData.length === 0,
|
|
177
|
+
onClick: E,
|
|
177
178
|
sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
|
|
178
179
|
variant: "text",
|
|
179
180
|
children: c.view_transactions
|
|
@@ -181,99 +182,99 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
181
182
|
)
|
|
182
183
|
] }) }) })
|
|
183
184
|
] });
|
|
184
|
-
},
|
|
185
|
-
const l = (
|
|
186
|
-
(
|
|
185
|
+
}, O = v(jt), it = ({ data: n, onSelected: d, selectedId: s }) => {
|
|
186
|
+
const l = (e, a) => {
|
|
187
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), d(a));
|
|
187
188
|
};
|
|
188
|
-
return /* @__PURE__ */ t(
|
|
189
|
-
|
|
189
|
+
return /* @__PURE__ */ t(f, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: n.categoryData.map((e) => /* @__PURE__ */ h(
|
|
190
|
+
f,
|
|
190
191
|
{
|
|
191
192
|
alignItems: "center",
|
|
192
|
-
"aria-label":
|
|
193
|
-
"aria-pressed":
|
|
193
|
+
"aria-label": e.name,
|
|
194
|
+
"aria-pressed": e.guid === s,
|
|
194
195
|
direction: "row",
|
|
195
196
|
gap: 8,
|
|
196
|
-
onClick: () => d(
|
|
197
|
-
onKeyDown: (a) => l(a,
|
|
197
|
+
onClick: () => d(e.guid),
|
|
198
|
+
onKeyDown: (a) => l(a, e.guid),
|
|
198
199
|
role: "button",
|
|
199
200
|
sx: { cursor: "pointer" },
|
|
200
201
|
tabIndex: 0,
|
|
201
202
|
children: [
|
|
202
|
-
/* @__PURE__ */ t(
|
|
203
|
-
/* @__PURE__ */ t(
|
|
203
|
+
/* @__PURE__ */ t(D, { borderRadius: 4, height: 8, sx: { backgroundColor: e.color }, width: 8 }),
|
|
204
|
+
/* @__PURE__ */ t(C, { bold: e.guid === s, variant: "XSmall", children: e.name })
|
|
204
205
|
]
|
|
205
206
|
},
|
|
206
|
-
|
|
207
|
+
e.guid
|
|
207
208
|
)) });
|
|
208
|
-
},
|
|
209
|
-
const
|
|
210
|
-
categories:
|
|
209
|
+
}, Bt = () => {
|
|
210
|
+
const n = Tt(), { goals: d, spending: s } = I(), { selectedAccounts: l } = k(), {
|
|
211
|
+
categories: e,
|
|
211
212
|
dateRangeCategoryTotals: a,
|
|
212
213
|
dataRangeTotalsLoaded: i,
|
|
213
|
-
loadDateRangeCategoryTotals:
|
|
214
|
-
} =
|
|
214
|
+
loadDateRangeCategoryTotals: o
|
|
215
|
+
} = P(), c = p.useMemo(
|
|
215
216
|
() => [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
n.palette.chartMono.chartMono5,
|
|
218
|
+
n.palette.chartMono.chartMono4,
|
|
219
|
+
n.palette.chartMono.chartMono3,
|
|
220
|
+
n.palette.chartMono.chartMono2,
|
|
221
|
+
n.palette.chartMono.chartMono1,
|
|
222
|
+
n.palette.chartMono.chartMono6
|
|
222
223
|
],
|
|
223
|
-
[
|
|
224
|
+
[n]
|
|
224
225
|
);
|
|
225
226
|
p.useEffect(() => {
|
|
226
|
-
|
|
227
|
+
o(
|
|
227
228
|
l,
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
st(/* @__PURE__ */ new Date()),
|
|
230
|
+
ct(/* @__PURE__ */ new Date())
|
|
230
231
|
).finally();
|
|
231
232
|
}, [l]);
|
|
232
|
-
const [u,
|
|
233
|
-
() =>
|
|
234
|
-
[
|
|
235
|
-
),
|
|
236
|
-
() =>
|
|
237
|
-
[
|
|
238
|
-
),
|
|
239
|
-
|
|
240
|
-
},
|
|
241
|
-
|
|
233
|
+
const [u, r] = p.useState(""), [m, M] = p.useState(0), g = p.useMemo(
|
|
234
|
+
() => mt(e, d, n, a),
|
|
235
|
+
[e, a]
|
|
236
|
+
), b = p.useMemo(
|
|
237
|
+
() => ht(e, a, c),
|
|
238
|
+
[e, a, c]
|
|
239
|
+
), E = (S, R) => {
|
|
240
|
+
M(R), r("");
|
|
241
|
+
}, x = (S) => {
|
|
242
|
+
r(u === S ? "" : S);
|
|
242
243
|
};
|
|
243
|
-
return i ? /* @__PURE__ */ h(
|
|
244
|
+
return i ? /* @__PURE__ */ h(D, { width: "100%", children: [
|
|
244
245
|
/* @__PURE__ */ h(
|
|
245
|
-
|
|
246
|
+
lt,
|
|
246
247
|
{
|
|
247
|
-
"aria-label":
|
|
248
|
-
onChange:
|
|
248
|
+
"aria-label": s.mini_title,
|
|
249
|
+
onChange: E,
|
|
249
250
|
value: m,
|
|
250
251
|
variant: "fullWidth",
|
|
251
252
|
children: [
|
|
252
253
|
/* @__PURE__ */ t(
|
|
253
|
-
|
|
254
|
+
N,
|
|
254
255
|
{
|
|
255
256
|
"aria-controls": "spending-tabpanel",
|
|
256
257
|
id: "spending-tab",
|
|
257
258
|
label: /* @__PURE__ */ t(
|
|
258
|
-
|
|
259
|
+
W,
|
|
259
260
|
{
|
|
260
261
|
amount: g.totalAmount,
|
|
261
|
-
label:
|
|
262
|
+
label: s.spend_tab_title
|
|
262
263
|
}
|
|
263
264
|
),
|
|
264
265
|
tabIndex: m === 0 ? 0 : -1
|
|
265
266
|
}
|
|
266
267
|
),
|
|
267
268
|
/* @__PURE__ */ t(
|
|
268
|
-
|
|
269
|
+
N,
|
|
269
270
|
{
|
|
270
271
|
"aria-controls": "income-tabpanel",
|
|
271
272
|
id: "income-tab",
|
|
272
273
|
label: /* @__PURE__ */ t(
|
|
273
|
-
|
|
274
|
+
W,
|
|
274
275
|
{
|
|
275
|
-
amount:
|
|
276
|
-
label:
|
|
276
|
+
amount: b.totalAmount,
|
|
277
|
+
label: s.income_tab_title
|
|
277
278
|
}
|
|
278
279
|
),
|
|
279
280
|
tabIndex: m === 1 ? 0 : -1
|
|
@@ -283,77 +284,77 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
283
284
|
}
|
|
284
285
|
),
|
|
285
286
|
/* @__PURE__ */ t(
|
|
286
|
-
|
|
287
|
+
D,
|
|
287
288
|
{
|
|
288
289
|
"aria-labelledby": "spending-tab",
|
|
289
290
|
hidden: m !== 0,
|
|
290
291
|
id: "spending-tabpanel",
|
|
291
292
|
role: "tabpanel",
|
|
292
|
-
children: /* @__PURE__ */ h(
|
|
293
|
+
children: /* @__PURE__ */ h(f, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
293
294
|
/* @__PURE__ */ t(
|
|
294
|
-
|
|
295
|
+
O,
|
|
295
296
|
{
|
|
296
297
|
data: g,
|
|
297
|
-
onSelected:
|
|
298
|
+
onSelected: x,
|
|
298
299
|
selectedId: u,
|
|
299
|
-
totalLabel:
|
|
300
|
+
totalLabel: s.total_spending
|
|
300
301
|
}
|
|
301
302
|
),
|
|
302
|
-
/* @__PURE__ */ t(
|
|
303
|
+
/* @__PURE__ */ t(it, { data: g, onSelected: x, selectedId: u })
|
|
303
304
|
] })
|
|
304
305
|
}
|
|
305
306
|
),
|
|
306
307
|
/* @__PURE__ */ t(
|
|
307
|
-
|
|
308
|
+
D,
|
|
308
309
|
{
|
|
309
310
|
"aria-labelledby": "income-tab",
|
|
310
311
|
hidden: m !== 1,
|
|
311
312
|
id: "income-tabpanel",
|
|
312
313
|
role: "tabpanel",
|
|
313
|
-
children: /* @__PURE__ */ h(
|
|
314
|
+
children: /* @__PURE__ */ h(f, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
314
315
|
/* @__PURE__ */ t(
|
|
315
|
-
|
|
316
|
+
O,
|
|
316
317
|
{
|
|
317
|
-
data:
|
|
318
|
+
data: b,
|
|
318
319
|
isIncome: !0,
|
|
319
|
-
onSelected:
|
|
320
|
+
onSelected: x,
|
|
320
321
|
selectedId: u,
|
|
321
|
-
totalLabel:
|
|
322
|
+
totalLabel: s.total_income
|
|
322
323
|
}
|
|
323
324
|
),
|
|
324
|
-
/* @__PURE__ */ t(
|
|
325
|
+
/* @__PURE__ */ t(it, { data: b, onSelected: x, selectedId: u })
|
|
325
326
|
] })
|
|
326
327
|
}
|
|
327
328
|
)
|
|
328
|
-
] }) : /* @__PURE__ */ t(
|
|
329
|
-
},
|
|
330
|
-
const { visibleAccounts:
|
|
329
|
+
] }) : /* @__PURE__ */ t(K, { height: 250 });
|
|
330
|
+
}, Vt = v(Bt), zt = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
|
|
331
|
+
const { visibleAccounts: s } = ut(), { spending: l } = I(), { isCopyLoaded: e, isInitialized: a, setSelectedAccounts: i } = k();
|
|
331
332
|
return p.useEffect(() => {
|
|
332
|
-
i(
|
|
333
|
-
}, [
|
|
334
|
-
|
|
333
|
+
i(s);
|
|
334
|
+
}, [s]), !e || !a ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ t(
|
|
335
|
+
Wt,
|
|
335
336
|
{
|
|
336
337
|
className: "mx-exp-spending-miniwidget",
|
|
337
|
-
onPrimaryCtaClick:
|
|
338
|
+
onPrimaryCtaClick: n,
|
|
338
339
|
primaryCtaLabel: l.primary_cta,
|
|
339
340
|
sx: d,
|
|
340
341
|
title: l.mini_title,
|
|
341
|
-
children: /* @__PURE__ */ t(
|
|
342
|
+
children: /* @__PURE__ */ t(Vt, {})
|
|
342
343
|
}
|
|
343
344
|
);
|
|
344
|
-
},
|
|
345
|
-
data:
|
|
345
|
+
}, ve = v(zt), Ft = ({
|
|
346
|
+
data: n,
|
|
346
347
|
onSelected: d,
|
|
347
|
-
selectedId:
|
|
348
|
+
selectedId: s = "",
|
|
348
349
|
title: l
|
|
349
350
|
}) => {
|
|
350
|
-
const { spending:
|
|
351
|
-
return /* @__PURE__ */ h(
|
|
352
|
-
/* @__PURE__ */ t(
|
|
353
|
-
/* @__PURE__ */ t(
|
|
354
|
-
/* @__PURE__ */ t(
|
|
351
|
+
const { spending: e } = I(), a = n.categoryData.find((i) => i.guid === s);
|
|
352
|
+
return /* @__PURE__ */ h(f, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
353
|
+
/* @__PURE__ */ t(C, { bold: !0, sx: { py: 12 }, children: `${l} ${e.by_category}` }),
|
|
354
|
+
/* @__PURE__ */ t(V, { "aria-hidden": "true" }),
|
|
355
|
+
/* @__PURE__ */ t(et, { children: n.categoryData.map((i) => /* @__PURE__ */ h(p.Fragment, { children: [
|
|
355
356
|
/* @__PURE__ */ t(
|
|
356
|
-
|
|
357
|
+
nt,
|
|
357
358
|
{
|
|
358
359
|
disableGutters: !0,
|
|
359
360
|
disablePadding: !0,
|
|
@@ -361,14 +362,14 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
361
362
|
minHeight: 44
|
|
362
363
|
},
|
|
363
364
|
children: /* @__PURE__ */ h(
|
|
364
|
-
|
|
365
|
+
Rt,
|
|
365
366
|
{
|
|
366
367
|
"aria-expanded": a?.guid === i.guid,
|
|
367
368
|
onClick: () => d(i.guid),
|
|
368
369
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
369
370
|
children: [
|
|
370
371
|
/* @__PURE__ */ t(
|
|
371
|
-
|
|
372
|
+
D,
|
|
372
373
|
{
|
|
373
374
|
borderRadius: 4,
|
|
374
375
|
flexShrink: 0,
|
|
@@ -378,15 +379,15 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
378
379
|
}
|
|
379
380
|
),
|
|
380
381
|
/* @__PURE__ */ h(
|
|
381
|
-
|
|
382
|
+
f,
|
|
382
383
|
{
|
|
383
384
|
alignItems: "center",
|
|
384
385
|
direction: "row",
|
|
385
386
|
justifyContent: "space-between",
|
|
386
387
|
width: "100%",
|
|
387
388
|
children: [
|
|
388
|
-
/* @__PURE__ */ t(
|
|
389
|
-
/* @__PURE__ */ t(
|
|
389
|
+
/* @__PURE__ */ t(C, { bold: s === i.guid, children: i.name }),
|
|
390
|
+
/* @__PURE__ */ t(C, { bold: s === i.guid, variant: "Body", children: w(i.amount, "0,0") })
|
|
390
391
|
]
|
|
391
392
|
}
|
|
392
393
|
)
|
|
@@ -395,41 +396,41 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
395
396
|
)
|
|
396
397
|
}
|
|
397
398
|
),
|
|
398
|
-
/* @__PURE__ */ t(
|
|
399
|
-
i.categoryTotals && i.categoryTotals.length > 0 && /* @__PURE__ */ t(
|
|
400
|
-
a?.categoryTotals?.map((
|
|
401
|
-
|
|
399
|
+
/* @__PURE__ */ t(V, {}),
|
|
400
|
+
i.categoryTotals && i.categoryTotals.length > 0 && /* @__PURE__ */ t(kt, { in: a?.guid === i.guid, unmountOnExit: !0, children: /* @__PURE__ */ h(et, { children: [
|
|
401
|
+
a?.categoryTotals?.map((o) => /* @__PURE__ */ t(
|
|
402
|
+
nt,
|
|
402
403
|
{
|
|
403
404
|
sx: {
|
|
404
405
|
pl: 24,
|
|
405
406
|
pr: 8,
|
|
406
407
|
py: 0
|
|
407
408
|
},
|
|
408
|
-
children: /* @__PURE__ */ h(
|
|
409
|
-
/* @__PURE__ */ h(
|
|
410
|
-
|
|
409
|
+
children: /* @__PURE__ */ h(f, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
410
|
+
/* @__PURE__ */ h(C, { children: [
|
|
411
|
+
o.name,
|
|
411
412
|
" "
|
|
412
413
|
] }),
|
|
413
|
-
/* @__PURE__ */ t(
|
|
414
|
+
/* @__PURE__ */ t(C, { children: w(o.amount, "0,0") })
|
|
414
415
|
] })
|
|
415
416
|
},
|
|
416
|
-
|
|
417
|
+
o.guid
|
|
417
418
|
)),
|
|
418
|
-
/* @__PURE__ */ t(
|
|
419
|
+
/* @__PURE__ */ t(V, {})
|
|
419
420
|
] }) })
|
|
420
421
|
] }, i.guid)) }),
|
|
421
|
-
/* @__PURE__ */ t(
|
|
422
|
+
/* @__PURE__ */ t(C, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${e.total}: ${w(n.totalAmount, "0,0")}` })
|
|
422
423
|
] });
|
|
423
|
-
},
|
|
424
|
-
data:
|
|
424
|
+
}, Ht = v(Ft), Pt = ({
|
|
425
|
+
data: n,
|
|
425
426
|
onSelected: d,
|
|
426
|
-
onViewTransactions:
|
|
427
|
+
onViewTransactions: s,
|
|
427
428
|
selectedId: l,
|
|
428
|
-
title:
|
|
429
|
+
title: e
|
|
429
430
|
}) => {
|
|
430
|
-
const { isDesktop: a, isMobile: i } =
|
|
431
|
+
const { isDesktop: a, isMobile: i } = pt(), { isLoadingCategoryTotals: o } = P(), { spending: c } = I();
|
|
431
432
|
return /* @__PURE__ */ h(
|
|
432
|
-
|
|
433
|
+
f,
|
|
433
434
|
{
|
|
434
435
|
alignItems: i ? "center" : "flex-start",
|
|
435
436
|
direction: i ? "column" : "row",
|
|
@@ -438,8 +439,8 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
438
439
|
pt: 50,
|
|
439
440
|
px: 8,
|
|
440
441
|
children: [
|
|
441
|
-
|
|
442
|
-
|
|
442
|
+
o && /* @__PURE__ */ t(
|
|
443
|
+
O,
|
|
443
444
|
{
|
|
444
445
|
data: {
|
|
445
446
|
categoryData: [],
|
|
@@ -454,170 +455,192 @@ const j = 5, Lt = (o, d, r) => r.reduce((l, n) => {
|
|
|
454
455
|
variant: "full"
|
|
455
456
|
}
|
|
456
457
|
),
|
|
457
|
-
!
|
|
458
|
-
|
|
458
|
+
!o && /* @__PURE__ */ t(
|
|
459
|
+
O,
|
|
459
460
|
{
|
|
460
|
-
data:
|
|
461
|
+
data: n,
|
|
461
462
|
onSelected: d,
|
|
462
|
-
onViewTransactions:
|
|
463
|
+
onViewTransactions: s,
|
|
463
464
|
selectedId: l,
|
|
464
465
|
size: a ? 400 : 300,
|
|
465
466
|
totalLabel: c.total_amount,
|
|
466
467
|
variant: "full"
|
|
467
468
|
}
|
|
468
469
|
),
|
|
469
|
-
/* @__PURE__ */ t(
|
|
470
|
+
/* @__PURE__ */ t(Ht, { data: n, onSelected: d, selectedId: l, title: e })
|
|
470
471
|
]
|
|
471
472
|
}
|
|
472
473
|
);
|
|
473
|
-
},
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
],
|
|
481
|
-
const
|
|
474
|
+
}, rt = v(Pt), Kt = (n) => [
|
|
475
|
+
n.palette.chartMono.chartMono5,
|
|
476
|
+
n.palette.chartMono.chartMono4,
|
|
477
|
+
n.palette.chartMono.chartMono3,
|
|
478
|
+
n.palette.chartMono.chartMono2,
|
|
479
|
+
n.palette.chartMono.chartMono1,
|
|
480
|
+
n.palette.chartMono.chartMono6
|
|
481
|
+
], Xt = () => {
|
|
482
|
+
const n = gt(), { onLoad: d } = Et(), { is_mobile_webview: s } = H(), { clientConfig: l } = H(), { categories: e, dateRangeCategoryTotals: a, loadDateRangeCategoryTotals: i } = P(), {
|
|
483
|
+
goals: o,
|
|
484
|
+
spending: c,
|
|
485
|
+
transactions: u
|
|
486
|
+
} = I(), { displayedDateRange: r, selectedAccounts: m, selectedAccountGuids: M } = k(), {
|
|
487
|
+
setFilter: g,
|
|
488
|
+
sortedTransactions: b,
|
|
489
|
+
sortedTransactionsWithSplits: E,
|
|
490
|
+
tags: x
|
|
491
|
+
} = At(), S = l?.master?.deep_link_params?.account_guids, R = l?.master?.deep_link_params?.view, [$, X] = p.useState(""), [L, ft] = p.useState(R === "income" ? 1 : 0), [Y, U] = p.useState(""), [yt, q] = p.useState(!1);
|
|
482
492
|
p.useEffect(() => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
493
|
+
i(
|
|
494
|
+
m,
|
|
495
|
+
r.start,
|
|
496
|
+
r.end
|
|
487
497
|
).finally(() => {
|
|
488
498
|
d?.("SpendingWidget");
|
|
489
499
|
});
|
|
490
|
-
}, [
|
|
491
|
-
const
|
|
492
|
-
() =>
|
|
493
|
-
[
|
|
494
|
-
),
|
|
495
|
-
() =>
|
|
496
|
-
[
|
|
497
|
-
),
|
|
498
|
-
() =>
|
|
499
|
-
[
|
|
500
|
-
),
|
|
501
|
-
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
},
|
|
500
|
+
}, [m, r]);
|
|
501
|
+
const G = p.useMemo(
|
|
502
|
+
() => mt(e, o, n, a),
|
|
503
|
+
[e, a]
|
|
504
|
+
), J = p.useMemo(
|
|
505
|
+
() => ht(e, a, Kt(n)),
|
|
506
|
+
[e, a]
|
|
507
|
+
), j = p.useMemo(
|
|
508
|
+
() => b.find((y) => y.guid === Y),
|
|
509
|
+
[Y, b]
|
|
510
|
+
), Ct = (y, A) => {
|
|
511
|
+
ft(A), X("");
|
|
512
|
+
}, Q = (y) => {
|
|
513
|
+
X($ === y || y === "0" ? "" : y);
|
|
514
|
+
}, Z = (y) => {
|
|
505
515
|
const A = {
|
|
506
|
-
accounts:
|
|
507
|
-
dateRange:
|
|
516
|
+
accounts: S || M,
|
|
517
|
+
dateRange: r
|
|
508
518
|
};
|
|
509
|
-
if (
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
|
|
519
|
+
if (L === 0)
|
|
520
|
+
if (y === "other") {
|
|
521
|
+
const T = G.categoryData.find((B) => B.guid === "other");
|
|
522
|
+
g({
|
|
513
523
|
...A,
|
|
514
|
-
custom: (
|
|
524
|
+
custom: (B) => !!T?.categoryTotals?.find((_t) => _t.guid === B.top_level_category_guid)
|
|
515
525
|
});
|
|
516
526
|
} else
|
|
517
|
-
|
|
527
|
+
g({
|
|
518
528
|
...A,
|
|
519
|
-
custom: (
|
|
520
|
-
showSplits: !!
|
|
529
|
+
custom: (T) => y ? T.top_level_category_guid === y : T.top_level_category_guid !== _.INCOME && T.top_level_category_guid !== _.INVESTMENTS && T.top_level_category_guid !== _.TRANSFER,
|
|
530
|
+
showSplits: !!y
|
|
521
531
|
});
|
|
522
532
|
else
|
|
523
|
-
|
|
533
|
+
g({
|
|
524
534
|
...A,
|
|
525
|
-
custom: (
|
|
535
|
+
custom: (T) => y ? T.category_guid === y : T.category_guid === _.INCOME || T.top_level_category_guid === _.INCOME
|
|
526
536
|
});
|
|
527
|
-
|
|
537
|
+
q(!0);
|
|
538
|
+
}, bt = () => {
|
|
539
|
+
Ot(E, x);
|
|
528
540
|
};
|
|
529
|
-
return /* @__PURE__ */ h(
|
|
530
|
-
/* @__PURE__ */ h(
|
|
541
|
+
return /* @__PURE__ */ h(D, { children: [
|
|
542
|
+
/* @__PURE__ */ h(lt, { onChange: Ct, value: L, variant: "fullWidth", children: [
|
|
531
543
|
/* @__PURE__ */ t(
|
|
532
|
-
|
|
544
|
+
N,
|
|
533
545
|
{
|
|
534
546
|
label: /* @__PURE__ */ t(
|
|
535
|
-
|
|
547
|
+
W,
|
|
536
548
|
{
|
|
537
|
-
amount:
|
|
538
|
-
label:
|
|
549
|
+
amount: G.totalAmount,
|
|
550
|
+
label: c.spend_tab_title
|
|
539
551
|
}
|
|
540
552
|
)
|
|
541
553
|
}
|
|
542
554
|
),
|
|
543
555
|
/* @__PURE__ */ t(
|
|
544
|
-
|
|
556
|
+
N,
|
|
545
557
|
{
|
|
546
558
|
label: /* @__PURE__ */ t(
|
|
547
|
-
|
|
559
|
+
W,
|
|
548
560
|
{
|
|
549
|
-
amount:
|
|
550
|
-
label:
|
|
561
|
+
amount: J.totalAmount,
|
|
562
|
+
label: c.income_tab_title
|
|
551
563
|
}
|
|
552
564
|
)
|
|
553
565
|
}
|
|
554
566
|
)
|
|
555
567
|
] }),
|
|
556
|
-
|
|
557
|
-
|
|
568
|
+
L === 0 && /* @__PURE__ */ t(
|
|
569
|
+
rt,
|
|
558
570
|
{
|
|
559
|
-
data:
|
|
560
|
-
onSelected:
|
|
561
|
-
onViewTransactions:
|
|
562
|
-
selectedId:
|
|
563
|
-
title:
|
|
571
|
+
data: G,
|
|
572
|
+
onSelected: Q,
|
|
573
|
+
onViewTransactions: Z,
|
|
574
|
+
selectedId: $,
|
|
575
|
+
title: c.spend_tab_title
|
|
564
576
|
}
|
|
565
577
|
),
|
|
566
|
-
|
|
567
|
-
|
|
578
|
+
L === 1 && /* @__PURE__ */ t(
|
|
579
|
+
rt,
|
|
568
580
|
{
|
|
569
|
-
data:
|
|
570
|
-
onSelected:
|
|
571
|
-
onViewTransactions:
|
|
572
|
-
selectedId:
|
|
573
|
-
title:
|
|
581
|
+
data: J,
|
|
582
|
+
onSelected: Q,
|
|
583
|
+
onViewTransactions: Z,
|
|
584
|
+
selectedId: $,
|
|
585
|
+
title: c.income_tab_title
|
|
574
586
|
}
|
|
575
587
|
),
|
|
576
588
|
/* @__PURE__ */ t(
|
|
577
|
-
|
|
589
|
+
ot,
|
|
578
590
|
{
|
|
579
|
-
ariaLabelClose:
|
|
580
|
-
isOpen:
|
|
581
|
-
onClose: () =>
|
|
582
|
-
title:
|
|
583
|
-
children: /* @__PURE__ */
|
|
591
|
+
ariaLabelClose: c.close_drawer_aria,
|
|
592
|
+
isOpen: yt,
|
|
593
|
+
onClose: () => q(!1),
|
|
594
|
+
title: c.transactions_drawer_title,
|
|
595
|
+
children: /* @__PURE__ */ h(f, { children: [
|
|
596
|
+
!s && b.length > 0 && /* @__PURE__ */ t(f, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
|
|
597
|
+
dt,
|
|
598
|
+
{
|
|
599
|
+
onClick: bt,
|
|
600
|
+
startIcon: /* @__PURE__ */ t(Dt, { name: "ios_share" }),
|
|
601
|
+
variant: "text",
|
|
602
|
+
children: u.export_csv_btn
|
|
603
|
+
}
|
|
604
|
+
) }),
|
|
605
|
+
/* @__PURE__ */ t(vt, { onClick: U })
|
|
606
|
+
] })
|
|
584
607
|
}
|
|
585
608
|
),
|
|
586
609
|
/* @__PURE__ */ t(
|
|
587
|
-
|
|
610
|
+
ot,
|
|
588
611
|
{
|
|
589
|
-
ariaLabelClose:
|
|
590
|
-
isOpen:
|
|
591
|
-
onClose: () =>
|
|
592
|
-
title:
|
|
593
|
-
children:
|
|
612
|
+
ariaLabelClose: c.close_drawer_aria,
|
|
613
|
+
isOpen: !!j,
|
|
614
|
+
onClose: () => U(""),
|
|
615
|
+
title: c.transaction_details_drawer_title,
|
|
616
|
+
children: j && /* @__PURE__ */ t(It, { transaction: j })
|
|
594
617
|
}
|
|
595
618
|
)
|
|
596
619
|
] });
|
|
597
|
-
},
|
|
598
|
-
const { visibleAccounts:
|
|
620
|
+
}, Yt = v(Xt), Ut = ({ onBackClick: n, sx: d = {} }) => {
|
|
621
|
+
const { visibleAccounts: s } = ut(), { spending: l } = I(), { isCopyLoaded: e, isInitialized: a, setDisplayedDate: i, setSelectedAccounts: o } = k(), { onEvent: c } = Lt(), { clientConfig: u } = H(), r = u?.master?.deep_link_params?.date_range, [m, M] = p.useState(!1);
|
|
599
622
|
p.useEffect(() => {
|
|
600
|
-
|
|
601
|
-
}, [
|
|
602
|
-
|
|
623
|
+
o(s);
|
|
624
|
+
}, [s]), p.useEffect(() => {
|
|
625
|
+
r && Array.isArray(r) && r.length === 2 ? i(r[0], r[1]) : i(st(tt()), ct(tt())), M(!0), c(at.SPENDING_VIEW);
|
|
603
626
|
}, []);
|
|
604
|
-
const g = (
|
|
605
|
-
i(
|
|
627
|
+
const g = (b) => {
|
|
628
|
+
i(b[0], b[1]);
|
|
606
629
|
};
|
|
607
|
-
return !
|
|
608
|
-
|
|
630
|
+
return !e || !a || !m ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ t(
|
|
631
|
+
$t,
|
|
609
632
|
{
|
|
610
|
-
accountOptions:
|
|
633
|
+
accountOptions: s,
|
|
611
634
|
calendarActions: { onRangeChanged: g },
|
|
612
|
-
onAccountsFilterClick: () => c(
|
|
613
|
-
onBackClick:
|
|
635
|
+
onAccountsFilterClick: () => c(at.SPENDING_CLICK_FILTER),
|
|
636
|
+
onBackClick: n,
|
|
614
637
|
sx: d,
|
|
615
638
|
title: l.title,
|
|
616
|
-
children: /* @__PURE__ */ t(
|
|
639
|
+
children: /* @__PURE__ */ t(D, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Yt, {}) })
|
|
617
640
|
}
|
|
618
641
|
);
|
|
619
|
-
},
|
|
642
|
+
}, Ie = v(Ut);
|
|
620
643
|
export {
|
|
621
|
-
|
|
622
|
-
|
|
644
|
+
ve as SpendingMiniWidget,
|
|
645
|
+
Ie as SpendingWidget
|
|
623
646
|
};
|
|
@@ -3,10 +3,10 @@ import { u as P, C as Pe, D as $e, M as Ve, d as We, c as Ge, T as Ue, a as Fe }
|
|
|
3
3
|
import { B as Sa, e as xa, b as wa } from "../TransactionDetails-BUoNbsu-.mjs";
|
|
4
4
|
import { T as M } from "../User-Bj34_i8g.mjs";
|
|
5
5
|
import { O as va } from "../User-Bj34_i8g.mjs";
|
|
6
|
-
import { S as ae, D as ze } from "../TransactionStore-
|
|
7
|
-
import { T as Na } from "../TransactionStore-
|
|
8
|
-
import { e as Ke } from "../exportTransactionsToCSV-
|
|
9
|
-
import { E as Oa } from "../ExportCsvAction-
|
|
6
|
+
import { S as ae, D as ze } from "../TransactionStore-CtGTg0XS.mjs";
|
|
7
|
+
import { T as Na } from "../TransactionStore-CtGTg0XS.mjs";
|
|
8
|
+
import { e as Ke } from "../exportTransactionsToCSV-C4PkIYP6.mjs";
|
|
9
|
+
import { E as Oa } from "../ExportCsvAction-DNSgmdyv.mjs";
|
|
10
10
|
import { jsxs as _, jsx as e } from "react/jsx-runtime";
|
|
11
11
|
import u from "react";
|
|
12
12
|
import { observer as x } from "mobx-react-lite";
|
package/dist/trends/index.es.js
CHANGED
|
@@ -48,7 +48,7 @@ import Ut from "@mui/material/ListItemText";
|
|
|
48
48
|
import qe from "@mui/material/styles/useTheme";
|
|
49
49
|
import Xt from "@mui/material/Paper";
|
|
50
50
|
import { b as Zt } from "../CategoryUtil-BR3H5i6n.mjs";
|
|
51
|
-
import { E as qt } from "../ExportCsvAction-
|
|
51
|
+
import { E as qt } from "../ExportCsvAction-DNSgmdyv.mjs";
|
|
52
52
|
import { u as Qt } from "../useInsightsEnabled-BxytCjq5.mjs";
|
|
53
53
|
import { E as Jt } from "../EmptyState-DA_lfRBv.mjs";
|
|
54
54
|
import { l as eo } from "../ConnectDrawer-CbxHKlRv.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-cartographer/experiences",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "Library containing experience widgets",
|
|
5
5
|
"author": "MX",
|
|
6
6
|
"license": "MIT",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"@mui/x-date-pickers-pro": "^7.29.4",
|
|
187
187
|
"@mxenabled/cssinjs": "^0.6.0",
|
|
188
188
|
"@mxenabled/mx-icons": "^1.5.1",
|
|
189
|
-
"@mxenabled/mxui": "^1.5.
|
|
189
|
+
"@mxenabled/mxui": "^1.5.8",
|
|
190
190
|
"@mxenabled/web-widget-sdk": "^0.0.13",
|
|
191
191
|
"@tanstack/react-virtual": "^3.13.2",
|
|
192
192
|
"bowser": "^2.11.0",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { fromUnixTime as d } from "date-fns/fromUnixTime";
|
|
2
|
-
import { c as u } from "./Category-CevNQ03n.mjs";
|
|
3
|
-
import { f as p, D as g } from "./Dialog-CWW597AF.mjs";
|
|
4
|
-
import { T as m } from "./User-Bj34_i8g.mjs";
|
|
5
|
-
function f(e) {
|
|
6
|
-
return new Set(
|
|
7
|
-
e.filter((n) => n.parent_guid !== void 0).map((n) => n.parent_guid)
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
function T(e) {
|
|
11
|
-
return e.reduce((n, t) => (t.parent_guid && (n[t.parent_guid] || (n[t.parent_guid] = []), n[t.parent_guid].push(t)), n), {});
|
|
12
|
-
}
|
|
13
|
-
function A(e, n) {
|
|
14
|
-
const t = f(n), r = T(n), o = /* @__PURE__ */ new Set(), a = [];
|
|
15
|
-
for (const i of e)
|
|
16
|
-
t.has(i.guid) ? (r[i.guid] ?? []).slice().sort((s, c) => Math.abs(c.amount) - Math.abs(s.amount)).forEach((s) => {
|
|
17
|
-
o.has(s.guid) || (a.push(s), o.add(s.guid));
|
|
18
|
-
}) : o.has(i.guid) || (a.push(i), o.add(i.guid));
|
|
19
|
-
return a;
|
|
20
|
-
}
|
|
21
|
-
const j = (e, n) => {
|
|
22
|
-
const t = _(h(e, n)), r = encodeURIComponent(t), o = document.createElement("a");
|
|
23
|
-
o.href = `data:attachment/csv;charset=utf-8,${r}`, o.download = "transactions.csv", document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
24
|
-
}, h = (e, n) => e.map((t) => ({
|
|
25
|
-
Date: p(d(t.date), g.YEAR_MONTH_DAY),
|
|
26
|
-
Description: C(t),
|
|
27
|
-
"Original Description": t.feed_description,
|
|
28
|
-
Amount: `${t.amount}`,
|
|
29
|
-
Type: t.transaction_type === m.CREDIT ? "Credit" : "Debit",
|
|
30
|
-
"Parent Category": u[t.top_level_category_guid || ""],
|
|
31
|
-
Category: t.category,
|
|
32
|
-
Account: t.account,
|
|
33
|
-
Tags: y(t, n),
|
|
34
|
-
Memo: t.memo,
|
|
35
|
-
Pending: t.isPending ? "TRUE" : "FALSE"
|
|
36
|
-
})), l = (e) => e ? /[,"\n\r]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e : "", _ = (e) => {
|
|
37
|
-
const n = Object.keys(e[0]).join(",").concat(`\r
|
|
38
|
-
`), t = e.map((r) => Object.values(r).map(l).join(",")).join(`\r
|
|
39
|
-
`);
|
|
40
|
-
return n + t;
|
|
41
|
-
}, C = (e) => {
|
|
42
|
-
let n = e.parent_guid ? "Split: " : "";
|
|
43
|
-
return n += e.is_hidden ? "(Excluded) " : "", n += e.description, n;
|
|
44
|
-
}, y = (e, n) => e.tags.map((t) => n.filter((o) => o.guid === t)[0]?.name ?? "").join(" ");
|
|
45
|
-
export {
|
|
46
|
-
j as e,
|
|
47
|
-
A as f
|
|
48
|
-
};
|