@mx-cartographer/experiences 7.0.21-alpha-spending-mini-widget-ram1 → 7.0.22-alpha.san1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-
|
|
1
|
+
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-DFAY0tA8.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as AppStore,
|
|
4
4
|
e as BeatCard,
|
|
@@ -4,21 +4,21 @@ import { observer as x } from "mobx-react-lite";
|
|
|
4
4
|
import { startOfMonth as nt } from "date-fns/startOfMonth";
|
|
5
5
|
import { endOfMonth as ot } from "date-fns/endOfMonth";
|
|
6
6
|
import D from "@mui/material/Box";
|
|
7
|
-
import
|
|
7
|
+
import C from "@mui/material/Stack";
|
|
8
8
|
import N from "@mui/material/Tab";
|
|
9
9
|
import at from "@mui/material/Tabs";
|
|
10
10
|
import mt from "@mui/material/styles/useTheme";
|
|
11
11
|
import { b as V } from "../CategoryUtil-BR3H5i6n.mjs";
|
|
12
12
|
import { b } from "../Category-CevNQ03n.mjs";
|
|
13
|
-
import { Text as
|
|
13
|
+
import { Text as f, CategoryIcon as ht, CategoryIconVariants as ft } from "@mxenabled/mxui";
|
|
14
14
|
import { f as A } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
15
15
|
import yt from "@mui/material/Button";
|
|
16
16
|
import { useTheme as it } from "@mui/material";
|
|
17
|
-
import { u as w, a as
|
|
18
|
-
import { u as
|
|
19
|
-
import { D as
|
|
17
|
+
import { u as w, a as R, k as z, c as rt, m as st, f as Ct, e as _t } from "../hooks-DkUqN6JE.mjs";
|
|
18
|
+
import { u as ct } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
19
|
+
import { D as bt } from "../Donut-1UMNcG67.mjs";
|
|
20
20
|
import { L as F } from "../Loader-DUaFpDGv.mjs";
|
|
21
|
-
import { M as
|
|
21
|
+
import { M as St } from "../MiniWidgetContainer-CTyjmE1h.mjs";
|
|
22
22
|
import { startOfToday as U } from "date-fns/startOfToday";
|
|
23
23
|
import { T as Tt, a as Mt } from "../TransactionDetails-C-z3HGTT.mjs";
|
|
24
24
|
import Dt from "@mui/material/Collapse";
|
|
@@ -28,29 +28,29 @@ import J from "@mui/material/ListItem";
|
|
|
28
28
|
import xt from "@mui/material/ListItemButton";
|
|
29
29
|
import { D as Q } from "../Drawer-kEE73B87.mjs";
|
|
30
30
|
import { A as Z, W as wt } from "../WidgetContainer-CdBs9WOZ.mjs";
|
|
31
|
-
const j = 5, vt = (n,
|
|
32
|
-
if (
|
|
33
|
-
const a = n.find((s) => s.guid ===
|
|
31
|
+
const j = 5, vt = (n, l, r) => r.reduce((i, c) => {
|
|
32
|
+
if (c.total > 0) {
|
|
33
|
+
const a = n.find((s) => s.guid === c.category_guid);
|
|
34
34
|
if (!a) return i;
|
|
35
35
|
const o = a.parent_guid ?? a.guid, e = n.find((s) => s.guid === o);
|
|
36
36
|
if (!e) return i;
|
|
37
37
|
const d = {
|
|
38
38
|
guid: a.guid,
|
|
39
39
|
name: a.guid === o ? `General ${a.name}` : a.name,
|
|
40
|
-
color: V(e.guid,
|
|
41
|
-
amount:
|
|
40
|
+
color: V(e.guid, l),
|
|
41
|
+
amount: c.total
|
|
42
42
|
}, u = i.find((s) => s.guid === o);
|
|
43
|
-
u ? (u.amount +=
|
|
43
|
+
u ? (u.amount += c.total, u.categoryTotals?.push(d)) : i.push({
|
|
44
44
|
guid: o,
|
|
45
45
|
name: e.name,
|
|
46
|
-
color: V(e.guid,
|
|
46
|
+
color: V(e.guid, l),
|
|
47
47
|
categoryTotals: [d],
|
|
48
|
-
amount:
|
|
48
|
+
amount: c.total
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
return i;
|
|
52
|
-
}, []),
|
|
53
|
-
const
|
|
52
|
+
}, []), lt = (n, l, r, i) => {
|
|
53
|
+
const c = vt(n, r, i), a = c.filter(
|
|
54
54
|
(s) => s.guid !== b.INCOME && s.guid !== b.INVESTMENTS && s.guid !== b.TRANSFER
|
|
55
55
|
).sort((s, g) => g.amount - s.amount), o = a.reduce(
|
|
56
56
|
(s, g) => s + g.amount,
|
|
@@ -62,20 +62,20 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
62
62
|
value: s.amount / o * 100
|
|
63
63
|
}));
|
|
64
64
|
if (a.length > 5) {
|
|
65
|
-
const s = a.slice(j,
|
|
66
|
-
(S,
|
|
65
|
+
const s = a.slice(j, c.length), g = s.reduce(
|
|
66
|
+
(S, _) => S + _.amount,
|
|
67
67
|
0
|
|
68
68
|
);
|
|
69
69
|
d.push({
|
|
70
70
|
guid: "other",
|
|
71
71
|
color: r.palette.categories.others || "",
|
|
72
|
-
name:
|
|
72
|
+
name: l.saving_goal_other,
|
|
73
73
|
categoryTotals: s,
|
|
74
74
|
amount: g
|
|
75
75
|
}), u.push({
|
|
76
76
|
id: "other",
|
|
77
77
|
color: r.palette.categories.others || "",
|
|
78
|
-
label:
|
|
78
|
+
label: l.saving_goal_other,
|
|
79
79
|
value: g / o * 100
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -84,51 +84,51 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
84
84
|
donutData: u,
|
|
85
85
|
totalAmount: o
|
|
86
86
|
};
|
|
87
|
-
}, dt = (n,
|
|
87
|
+
}, dt = (n, l, r) => {
|
|
88
88
|
const i = n.filter(
|
|
89
89
|
(e) => e.guid === b.INCOME || e.parent_guid === b.INCOME
|
|
90
|
-
),
|
|
90
|
+
), c = l.filter((e) => i.some((d) => d.guid === e.category_guid)).sort((e, d) => e.total - d.total).map((e, d) => ({
|
|
91
91
|
guid: e.category_guid,
|
|
92
92
|
name: n.find((u) => u.guid === e.category_guid)?.name,
|
|
93
93
|
color: r[d],
|
|
94
94
|
categoryTotals: [],
|
|
95
95
|
amount: Math.abs(e.total)
|
|
96
|
-
})), a =
|
|
96
|
+
})), a = c.reduce(
|
|
97
97
|
(e, d) => e + d.amount,
|
|
98
98
|
0
|
|
99
|
-
), o =
|
|
99
|
+
), o = c.map((e) => ({
|
|
100
100
|
id: e.guid,
|
|
101
101
|
color: e.color,
|
|
102
102
|
label: e.name,
|
|
103
103
|
value: e.amount / a * 100
|
|
104
104
|
}));
|
|
105
105
|
return {
|
|
106
|
-
categoryData:
|
|
106
|
+
categoryData: c,
|
|
107
107
|
donutData: o,
|
|
108
108
|
totalAmount: a
|
|
109
109
|
};
|
|
110
|
-
},
|
|
111
|
-
/* @__PURE__ */ t(
|
|
112
|
-
/* @__PURE__ */ t(
|
|
110
|
+
}, W = ({ amount: n, label: l }) => /* @__PURE__ */ m(C, { direction: "column", children: [
|
|
111
|
+
/* @__PURE__ */ t(f, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: l }),
|
|
112
|
+
/* @__PURE__ */ t(f, { variant: "XSmall", children: A(n, "0,0") })
|
|
113
113
|
] }), At = ({
|
|
114
114
|
data: n,
|
|
115
|
-
isIncome:
|
|
115
|
+
isIncome: l = !1,
|
|
116
116
|
onSelected: r,
|
|
117
117
|
onViewTransactions: i,
|
|
118
|
-
selectedId:
|
|
118
|
+
selectedId: c,
|
|
119
119
|
size: a = 150,
|
|
120
120
|
totalLabel: o,
|
|
121
121
|
variant: e = "mini"
|
|
122
122
|
}) => {
|
|
123
|
-
const { spending: d } = w(), u = it(), { isTablet: s } =
|
|
124
|
-
() =>
|
|
125
|
-
[
|
|
126
|
-
), S = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]),
|
|
127
|
-
i?.(
|
|
128
|
-
},
|
|
129
|
-
return
|
|
123
|
+
const { spending: d } = w(), u = it(), { isTablet: s } = ct(), g = p.useMemo(
|
|
124
|
+
() => c ? n.categoryData.find((v) => v.guid === c) : void 0,
|
|
125
|
+
[c]
|
|
126
|
+
), S = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]), _ = () => {
|
|
127
|
+
i?.(c);
|
|
128
|
+
}, y = s ? 32 : 48;
|
|
129
|
+
return /* @__PURE__ */ t(bt, { data: S, onClick: r, selectedId: c, size: a, children: /* @__PURE__ */ t(C, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ m(C, { alignItems: "center", justifyContent: "center", minHeight: a, minWidth: a, children: [
|
|
130
130
|
g && /* @__PURE__ */ m(
|
|
131
|
-
|
|
131
|
+
C,
|
|
132
132
|
{
|
|
133
133
|
alignItems: "center",
|
|
134
134
|
gap: e === "mini" ? 0 : 8,
|
|
@@ -139,50 +139,50 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
139
139
|
/* @__PURE__ */ t(
|
|
140
140
|
ht,
|
|
141
141
|
{
|
|
142
|
-
categoryGuid:
|
|
143
|
-
size: e === "mini" ? 24 :
|
|
142
|
+
categoryGuid: l ? b.INCOME : g.guid,
|
|
143
|
+
size: e === "mini" ? 24 : y,
|
|
144
144
|
variant: ft.Transparent
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
/* @__PURE__ */ t(
|
|
147
|
+
/* @__PURE__ */ t(f, { color: "secondary", noWrap: !0, variant: e === "mini" ? "Tiny" : "Body", children: g ? g.name : o })
|
|
148
148
|
]
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
!g && e === "full" && /* @__PURE__ */ t(
|
|
152
|
-
/* @__PURE__ */ t(
|
|
153
|
-
!g && e === "mini" && /* @__PURE__ */ t(
|
|
151
|
+
!g && e === "full" && /* @__PURE__ */ t(f, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: o }),
|
|
152
|
+
/* @__PURE__ */ t(f, { variant: e === "mini" ? "H2" : "H1", children: g ? A(g.amount, "0,0") : A(n.totalAmount, "0,0") }),
|
|
153
|
+
!g && e === "mini" && /* @__PURE__ */ t(f, { color: "secondary", noWrap: !0, variant: "Tiny", children: o }),
|
|
154
154
|
e === "full" && /* @__PURE__ */ t(
|
|
155
155
|
yt,
|
|
156
156
|
{
|
|
157
157
|
"aria-label": `View ${g?.name || ""} Transactions`,
|
|
158
158
|
disabled: n.categoryData.length === 0,
|
|
159
|
-
onClick:
|
|
159
|
+
onClick: _,
|
|
160
160
|
sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
|
|
161
161
|
variant: "text",
|
|
162
162
|
children: d.view_transactions
|
|
163
163
|
}
|
|
164
164
|
)
|
|
165
165
|
] }) }) });
|
|
166
|
-
},
|
|
167
|
-
|
|
166
|
+
}, O = x(At), tt = ({ data: n, onSelected: l, selectedId: r }) => /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: n.categoryData.map((i) => /* @__PURE__ */ m(
|
|
167
|
+
C,
|
|
168
168
|
{
|
|
169
169
|
alignItems: "center",
|
|
170
170
|
"aria-label": i.name,
|
|
171
171
|
"aria-selected": i.guid === r,
|
|
172
172
|
direction: "row",
|
|
173
173
|
gap: 8,
|
|
174
|
-
onClick: () =>
|
|
174
|
+
onClick: () => l(i.guid),
|
|
175
175
|
role: "button",
|
|
176
176
|
sx: { cursor: "pointer" },
|
|
177
177
|
children: [
|
|
178
178
|
/* @__PURE__ */ t(D, { borderRadius: 4, height: 8, sx: { backgroundColor: i.color }, width: 8 }),
|
|
179
|
-
/* @__PURE__ */ t(
|
|
179
|
+
/* @__PURE__ */ t(f, { bold: i.guid === r, variant: "XSmall", children: i.name })
|
|
180
180
|
]
|
|
181
181
|
},
|
|
182
182
|
i.guid
|
|
183
183
|
)) }), Et = () => {
|
|
184
|
-
const n = mt(), { goals:
|
|
185
|
-
categories:
|
|
184
|
+
const n = mt(), { goals: l, spending: r } = w(), { selectedAccounts: i } = R(), {
|
|
185
|
+
categories: c,
|
|
186
186
|
dateRangeCategoryTotals: a,
|
|
187
187
|
dataRangeTotalsLoaded: o,
|
|
188
188
|
loadDateRangeCategoryTotals: e
|
|
@@ -204,26 +204,26 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
204
204
|
ot(/* @__PURE__ */ new Date())
|
|
205
205
|
).finally();
|
|
206
206
|
}, [i]);
|
|
207
|
-
const [u, s] = p.useState(""), [g, S] = p.useState(0),
|
|
208
|
-
() =>
|
|
209
|
-
[
|
|
210
|
-
),
|
|
211
|
-
() => dt(
|
|
212
|
-
[
|
|
207
|
+
const [u, s] = p.useState(""), [g, S] = p.useState(0), _ = p.useMemo(
|
|
208
|
+
() => lt(c, l, n, a),
|
|
209
|
+
[c, a]
|
|
210
|
+
), y = p.useMemo(
|
|
211
|
+
() => dt(c, a, d),
|
|
212
|
+
[c, a, d]
|
|
213
213
|
), v = (E, L) => {
|
|
214
214
|
S(L), s("");
|
|
215
215
|
}, M = (E) => {
|
|
216
216
|
s(u === E ? "" : E);
|
|
217
217
|
};
|
|
218
|
-
return o ?
|
|
218
|
+
return o ? /* @__PURE__ */ m(D, { width: "100%", children: [
|
|
219
219
|
/* @__PURE__ */ m(at, { onChange: v, value: g, variant: "fullWidth", children: [
|
|
220
220
|
/* @__PURE__ */ t(
|
|
221
221
|
N,
|
|
222
222
|
{
|
|
223
223
|
label: /* @__PURE__ */ t(
|
|
224
|
-
|
|
224
|
+
W,
|
|
225
225
|
{
|
|
226
|
-
amount:
|
|
226
|
+
amount: _.totalAmount,
|
|
227
227
|
label: r.spend_tab_title
|
|
228
228
|
}
|
|
229
229
|
)
|
|
@@ -233,20 +233,20 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
233
233
|
N,
|
|
234
234
|
{
|
|
235
235
|
label: /* @__PURE__ */ t(
|
|
236
|
-
|
|
236
|
+
W,
|
|
237
237
|
{
|
|
238
|
-
amount:
|
|
238
|
+
amount: y.totalAmount,
|
|
239
239
|
label: r.income_tab_title
|
|
240
240
|
}
|
|
241
241
|
)
|
|
242
242
|
}
|
|
243
243
|
)
|
|
244
244
|
] }),
|
|
245
|
-
g === 0 && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ m(
|
|
245
|
+
g === 0 && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ m(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
246
246
|
/* @__PURE__ */ t(
|
|
247
|
-
|
|
247
|
+
O,
|
|
248
248
|
{
|
|
249
|
-
data:
|
|
249
|
+
data: _,
|
|
250
250
|
onSelected: M,
|
|
251
251
|
selectedId: u,
|
|
252
252
|
totalLabel: r.total_spending
|
|
@@ -255,50 +255,50 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
255
255
|
/* @__PURE__ */ t(
|
|
256
256
|
tt,
|
|
257
257
|
{
|
|
258
|
-
data:
|
|
258
|
+
data: _,
|
|
259
259
|
onSelected: M,
|
|
260
260
|
selectedId: u
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
] }) }),
|
|
264
|
-
g === 1 && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ m(
|
|
264
|
+
g === 1 && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ m(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
265
265
|
/* @__PURE__ */ t(
|
|
266
|
-
|
|
266
|
+
O,
|
|
267
267
|
{
|
|
268
|
-
data:
|
|
268
|
+
data: y,
|
|
269
269
|
isIncome: !0,
|
|
270
270
|
onSelected: M,
|
|
271
271
|
selectedId: u,
|
|
272
272
|
totalLabel: r.total_income
|
|
273
273
|
}
|
|
274
274
|
),
|
|
275
|
-
/* @__PURE__ */ t(tt, { data:
|
|
275
|
+
/* @__PURE__ */ t(tt, { data: y, onSelected: M, selectedId: u })
|
|
276
276
|
] }) })
|
|
277
|
-
] })
|
|
278
|
-
}, It = x(Et), Lt = ({ onPrimaryCtaClick: n, sx:
|
|
279
|
-
const { visibleAccounts: r } = rt(), { spending: i } = w(), { isCopyLoaded:
|
|
277
|
+
] }) : /* @__PURE__ */ t(F, { height: 250 });
|
|
278
|
+
}, It = x(Et), Lt = ({ onPrimaryCtaClick: n, sx: l = {} }) => {
|
|
279
|
+
const { visibleAccounts: r } = rt(), { spending: i } = w(), { isCopyLoaded: c, isInitialized: a, setSelectedAccounts: o } = R();
|
|
280
280
|
return p.useEffect(() => {
|
|
281
281
|
o(r);
|
|
282
|
-
}, [r]), !
|
|
283
|
-
|
|
282
|
+
}, [r]), !c || !a ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
|
|
283
|
+
St,
|
|
284
284
|
{
|
|
285
285
|
className: "mx-exp-spending-miniwidget",
|
|
286
286
|
onPrimaryCtaClick: n,
|
|
287
287
|
primaryCtaLabel: i.primary_cta,
|
|
288
|
-
sx:
|
|
288
|
+
sx: l,
|
|
289
289
|
title: i.mini_title,
|
|
290
290
|
children: /* @__PURE__ */ t(It, {})
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}, he = x(Lt), Nt = ({
|
|
294
294
|
data: n,
|
|
295
|
-
onSelected:
|
|
295
|
+
onSelected: l,
|
|
296
296
|
selectedId: r = "",
|
|
297
297
|
title: i
|
|
298
298
|
}) => {
|
|
299
|
-
const { spending:
|
|
300
|
-
return /* @__PURE__ */ m(
|
|
301
|
-
/* @__PURE__ */ t(
|
|
299
|
+
const { spending: c } = w(), a = n.categoryData.find((o) => o.guid === r);
|
|
300
|
+
return /* @__PURE__ */ m(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
301
|
+
/* @__PURE__ */ t(f, { bold: !0, sx: { py: 12 }, children: `${i} ${c.by_category}` }),
|
|
302
302
|
/* @__PURE__ */ t(B, { "aria-hidden": "true" }),
|
|
303
303
|
/* @__PURE__ */ t(q, { children: n.categoryData.map((o) => /* @__PURE__ */ m(p.Fragment, { children: [
|
|
304
304
|
/* @__PURE__ */ t(
|
|
@@ -313,7 +313,7 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
313
313
|
xt,
|
|
314
314
|
{
|
|
315
315
|
"aria-expanded": a?.guid === o.guid,
|
|
316
|
-
onClick: () =>
|
|
316
|
+
onClick: () => l(o.guid),
|
|
317
317
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
318
318
|
children: [
|
|
319
319
|
/* @__PURE__ */ t(
|
|
@@ -327,15 +327,15 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
327
327
|
}
|
|
328
328
|
),
|
|
329
329
|
/* @__PURE__ */ m(
|
|
330
|
-
|
|
330
|
+
C,
|
|
331
331
|
{
|
|
332
332
|
alignItems: "center",
|
|
333
333
|
direction: "row",
|
|
334
334
|
justifyContent: "space-between",
|
|
335
335
|
width: "100%",
|
|
336
336
|
children: [
|
|
337
|
-
/* @__PURE__ */ t(
|
|
338
|
-
/* @__PURE__ */ t(
|
|
337
|
+
/* @__PURE__ */ t(f, { bold: r === o.guid, children: o.name }),
|
|
338
|
+
/* @__PURE__ */ t(f, { bold: r === o.guid, variant: "Body", children: A(o.amount, "0,0") })
|
|
339
339
|
]
|
|
340
340
|
}
|
|
341
341
|
)
|
|
@@ -354,12 +354,12 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
354
354
|
pr: 8,
|
|
355
355
|
py: 0
|
|
356
356
|
},
|
|
357
|
-
children: /* @__PURE__ */ m(
|
|
358
|
-
/* @__PURE__ */ m(
|
|
357
|
+
children: /* @__PURE__ */ m(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
358
|
+
/* @__PURE__ */ m(f, { children: [
|
|
359
359
|
e.name,
|
|
360
360
|
" "
|
|
361
361
|
] }),
|
|
362
|
-
/* @__PURE__ */ t(
|
|
362
|
+
/* @__PURE__ */ t(f, { children: A(e.amount, "0,0") })
|
|
363
363
|
] })
|
|
364
364
|
},
|
|
365
365
|
e.guid
|
|
@@ -367,18 +367,18 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
367
367
|
/* @__PURE__ */ t(B, {})
|
|
368
368
|
] }) })
|
|
369
369
|
] }, o.guid)) }),
|
|
370
|
-
/* @__PURE__ */ t(
|
|
370
|
+
/* @__PURE__ */ t(f, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${c.total}: ${A(n.totalAmount, "0,0")}` })
|
|
371
371
|
] });
|
|
372
|
-
},
|
|
372
|
+
}, Wt = x(Nt), Ot = ({
|
|
373
373
|
data: n,
|
|
374
|
-
onSelected:
|
|
374
|
+
onSelected: l,
|
|
375
375
|
onViewTransactions: r,
|
|
376
376
|
selectedId: i,
|
|
377
|
-
title:
|
|
377
|
+
title: c
|
|
378
378
|
}) => {
|
|
379
|
-
const { isDesktop: a, isMobile: o } =
|
|
379
|
+
const { isDesktop: a, isMobile: o } = ct(), { isLoadingCategoryTotals: e } = z(), { spending: d } = w();
|
|
380
380
|
return /* @__PURE__ */ m(
|
|
381
|
-
|
|
381
|
+
C,
|
|
382
382
|
{
|
|
383
383
|
alignItems: o ? "center" : "flex-start",
|
|
384
384
|
direction: o ? "column" : "row",
|
|
@@ -388,7 +388,7 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
388
388
|
px: 8,
|
|
389
389
|
children: [
|
|
390
390
|
e && /* @__PURE__ */ t(
|
|
391
|
-
|
|
391
|
+
O,
|
|
392
392
|
{
|
|
393
393
|
data: {
|
|
394
394
|
categoryData: [],
|
|
@@ -404,10 +404,10 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
406
|
!e && /* @__PURE__ */ t(
|
|
407
|
-
|
|
407
|
+
O,
|
|
408
408
|
{
|
|
409
409
|
data: n,
|
|
410
|
-
onSelected:
|
|
410
|
+
onSelected: l,
|
|
411
411
|
onViewTransactions: r,
|
|
412
412
|
selectedId: i,
|
|
413
413
|
size: a ? 400 : 300,
|
|
@@ -415,11 +415,11 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
415
415
|
variant: "full"
|
|
416
416
|
}
|
|
417
417
|
),
|
|
418
|
-
/* @__PURE__ */ t(
|
|
418
|
+
/* @__PURE__ */ t(Wt, { data: n, onSelected: l, selectedId: i, title: c })
|
|
419
419
|
]
|
|
420
420
|
}
|
|
421
421
|
);
|
|
422
|
-
}, et = x(
|
|
422
|
+
}, et = x(Ot), Rt = (n) => [
|
|
423
423
|
n.palette.chartMono.chartMono5,
|
|
424
424
|
n.palette.chartMono.chartMono4,
|
|
425
425
|
n.palette.chartMono.chartMono3,
|
|
@@ -427,34 +427,34 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
427
427
|
n.palette.chartMono.chartMono1,
|
|
428
428
|
n.palette.chartMono.chartMono6
|
|
429
429
|
], kt = () => {
|
|
430
|
-
const n = it(), { clientConfig:
|
|
430
|
+
const n = it(), { clientConfig: l } = st(), { categories: r, dateRangeCategoryTotals: i, loadDateRangeCategoryTotals: c } = z(), { goals: a, spending: o } = w(), { displayedDateRange: e, selectedAccounts: d, selectedAccountGuids: u } = R(), { setFilter: s, sortedTransactions: g } = Ct(), S = l?.master?.deep_link_params?.account_guids, _ = l?.master?.deep_link_params?.view, [y, v] = p.useState(""), [M, E] = p.useState(_ === "income" ? 1 : 0), [L, H] = p.useState(""), [gt, P] = p.useState(!1);
|
|
431
431
|
p.useEffect(() => {
|
|
432
|
-
|
|
432
|
+
c(
|
|
433
433
|
d,
|
|
434
434
|
e.start,
|
|
435
435
|
e.end
|
|
436
436
|
).finally();
|
|
437
437
|
}, [d, e]);
|
|
438
438
|
const k = p.useMemo(
|
|
439
|
-
() =>
|
|
439
|
+
() => lt(r, a, n, i),
|
|
440
440
|
[r, i]
|
|
441
441
|
), X = p.useMemo(
|
|
442
|
-
() => dt(r, i,
|
|
442
|
+
() => dt(r, i, Rt(n)),
|
|
443
443
|
[r, i]
|
|
444
444
|
), G = p.useMemo(
|
|
445
|
-
() => g.find((
|
|
445
|
+
() => g.find((h) => h.guid === L),
|
|
446
446
|
[L, g]
|
|
447
|
-
), ut = (
|
|
447
|
+
), ut = (h, I) => {
|
|
448
448
|
E(I), v("");
|
|
449
|
-
}, Y = (
|
|
450
|
-
v(
|
|
451
|
-
}, K = (
|
|
449
|
+
}, Y = (h) => {
|
|
450
|
+
v(y === h || h === "0" ? "" : h);
|
|
451
|
+
}, K = (h) => {
|
|
452
452
|
const I = {
|
|
453
453
|
accounts: S || u,
|
|
454
454
|
dateRange: e
|
|
455
455
|
};
|
|
456
456
|
if (M === 0)
|
|
457
|
-
if (
|
|
457
|
+
if (h === "other") {
|
|
458
458
|
const T = k.categoryData.find(($) => $.guid === "other");
|
|
459
459
|
s({
|
|
460
460
|
...I,
|
|
@@ -463,13 +463,13 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
463
463
|
} else
|
|
464
464
|
s({
|
|
465
465
|
...I,
|
|
466
|
-
custom: (T) =>
|
|
467
|
-
showSplits: !!
|
|
466
|
+
custom: (T) => h ? T.top_level_category_guid === h : T.top_level_category_guid !== b.INCOME && T.top_level_category_guid !== b.INVESTMENTS && T.top_level_category_guid !== b.TRANSFER,
|
|
467
|
+
showSplits: !!h
|
|
468
468
|
});
|
|
469
469
|
else
|
|
470
470
|
s({
|
|
471
471
|
...I,
|
|
472
|
-
custom: (T) =>
|
|
472
|
+
custom: (T) => h ? T.category_guid === h : T.category_guid === b.INCOME || T.top_level_category_guid === b.INCOME
|
|
473
473
|
});
|
|
474
474
|
P(!0);
|
|
475
475
|
};
|
|
@@ -479,7 +479,7 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
479
479
|
N,
|
|
480
480
|
{
|
|
481
481
|
label: /* @__PURE__ */ t(
|
|
482
|
-
|
|
482
|
+
W,
|
|
483
483
|
{
|
|
484
484
|
amount: k.totalAmount,
|
|
485
485
|
label: o.spend_tab_title
|
|
@@ -491,7 +491,7 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
491
491
|
N,
|
|
492
492
|
{
|
|
493
493
|
label: /* @__PURE__ */ t(
|
|
494
|
-
|
|
494
|
+
W,
|
|
495
495
|
{
|
|
496
496
|
amount: X.totalAmount,
|
|
497
497
|
label: o.income_tab_title
|
|
@@ -506,7 +506,7 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
506
506
|
data: k,
|
|
507
507
|
onSelected: Y,
|
|
508
508
|
onViewTransactions: K,
|
|
509
|
-
selectedId:
|
|
509
|
+
selectedId: y,
|
|
510
510
|
title: o.spend_tab_title
|
|
511
511
|
}
|
|
512
512
|
),
|
|
@@ -516,7 +516,7 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
516
516
|
data: X,
|
|
517
517
|
onSelected: Y,
|
|
518
518
|
onViewTransactions: K,
|
|
519
|
-
selectedId:
|
|
519
|
+
selectedId: y,
|
|
520
520
|
title: o.income_tab_title
|
|
521
521
|
}
|
|
522
522
|
),
|
|
@@ -541,24 +541,24 @@ const j = 5, vt = (n, c, r) => r.reduce((i, l) => {
|
|
|
541
541
|
}
|
|
542
542
|
)
|
|
543
543
|
] });
|
|
544
|
-
}, Gt = x(kt), $t = ({ onBackClick: n, sx:
|
|
545
|
-
const { visibleAccounts: r } = rt(), { spending: i } = w(), { isCopyLoaded:
|
|
544
|
+
}, Gt = x(kt), $t = ({ onBackClick: n, sx: l = {} }) => {
|
|
545
|
+
const { visibleAccounts: r } = rt(), { spending: i } = w(), { isCopyLoaded: c, isInitialized: a, setDisplayedDate: o, setSelectedAccounts: e } = R(), { onEvent: d } = _t(), { clientConfig: u } = st(), s = u?.master?.deep_link_params?.date_range, [g, S] = p.useState(!1);
|
|
546
546
|
p.useEffect(() => {
|
|
547
547
|
e(r);
|
|
548
548
|
}, [r]), p.useEffect(() => {
|
|
549
549
|
s && Array.isArray(s) && s.length === 2 ? o(s[0], s[1]) : o(nt(U()), ot(U())), S(!0), d(Z.SPENDING_VIEW);
|
|
550
550
|
}, []);
|
|
551
|
-
const
|
|
552
|
-
o(
|
|
551
|
+
const _ = (y) => {
|
|
552
|
+
o(y[0], y[1]);
|
|
553
553
|
};
|
|
554
|
-
return !
|
|
554
|
+
return !c || !a || !g ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
|
|
555
555
|
wt,
|
|
556
556
|
{
|
|
557
557
|
accountOptions: r,
|
|
558
|
-
calendarActions: { onRangeChanged:
|
|
558
|
+
calendarActions: { onRangeChanged: _ },
|
|
559
559
|
onAccountsFilterClick: () => d(Z.SPENDING_CLICK_FILTER),
|
|
560
560
|
onBackClick: n,
|
|
561
|
-
sx:
|
|
561
|
+
sx: l,
|
|
562
562
|
title: i.title,
|
|
563
563
|
children: /* @__PURE__ */ t(D, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Gt, {}) })
|
|
564
564
|
}
|
package/dist/trends/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ import { C as rt } from "../CurrencyText-YUhH2caW.mjs";
|
|
|
20
20
|
import { c as Me } from "../Category-CevNQ03n.mjs";
|
|
21
21
|
import { b as at } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { H as be } from "../HeaderCell-DjuifqHJ.mjs";
|
|
23
|
-
import { T as A, b as it } from "../ViewMoreMicroCard-
|
|
23
|
+
import { T as A, b as it } from "../ViewMoreMicroCard-DFAY0tA8.mjs";
|
|
24
24
|
import { A as y, W as Ae } from "../WidgetContainer-CdBs9WOZ.mjs";
|
|
25
25
|
import { a as Re, T as ke } from "../TransactionDetails-C-z3HGTT.mjs";
|
|
26
26
|
import { D as fe } from "../Drawer-kEE73B87.mjs";
|
|
@@ -856,7 +856,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
856
856
|
showXAxisTicks: !0,
|
|
857
857
|
showYAxis: !0,
|
|
858
858
|
showYAxisTicks: !0,
|
|
859
|
-
valueFormatterString: "
|
|
859
|
+
valueFormatterString: "0a"
|
|
860
860
|
}
|
|
861
861
|
);
|
|
862
862
|
}, Jt = M(qt), en = ({ onBackClick: n, onInsightCardClick: o, sx: t }) => {
|