@mx-cartographer/experiences 9.2.6 → 9.2.7
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/{UserStore-BceB3WHz.mjs → UserStore-CgsAunf1.mjs} +188 -167
- package/dist/UserStore-CgsAunf1.mjs.map +1 -0
- package/dist/common/index.es.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/stores/CategoryStore.d.ts +2 -0
- package/dist/spending/index.es.js +208 -184
- package/dist/spending/index.es.js.map +1 -1
- package/dist/trends/index.es.js +576 -574
- package/dist/trends/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/UserStore-BceB3WHz.mjs.map +0 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { endOfMonth as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useTheme as
|
|
11
|
-
import { g as
|
|
12
|
-
import { Text as
|
|
13
|
-
import { f as
|
|
14
|
-
import { u as
|
|
15
|
-
import { u as
|
|
16
|
-
import { L as
|
|
17
|
-
import { M as
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { observer as R } from "mobx-react-lite";
|
|
4
|
+
import { startOfMonth as it } from "date-fns/startOfMonth";
|
|
5
|
+
import { endOfMonth as rt } from "date-fns/endOfMonth";
|
|
6
|
+
import E from "@mui/material/Box";
|
|
7
|
+
import S from "@mui/material/Stack";
|
|
8
|
+
import G from "@mui/material/Tab";
|
|
9
|
+
import st from "@mui/material/Tabs";
|
|
10
|
+
import { useTheme as yt } from "@mui/material/styles";
|
|
11
|
+
import { g as lt, a as ct, S as F, b as q } from "../SpendingLegend-CxvNOg3c.mjs";
|
|
12
|
+
import { Text as D, Icon as bt } from "@mxenabled/mxui";
|
|
13
|
+
import { f as B } from "../NumberFormatting--XMeeBfr.mjs";
|
|
14
|
+
import { u as W, l as k, c as dt, a as P, i as H, g as gt, f as Ct } from "../hooks-97sNJ_lf.mjs";
|
|
15
|
+
import { u as pt } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
|
|
16
|
+
import { L as ut } from "../Loader-CxeBwuPG.mjs";
|
|
17
|
+
import { M as St } from "../MiniWidgetContainer-Bmv_WeUd.mjs";
|
|
18
18
|
import { startOfToday as J } from "date-fns/startOfToday";
|
|
19
|
-
import
|
|
20
|
-
import { useTheme as
|
|
21
|
-
import { e as
|
|
22
|
-
import { T as
|
|
23
|
-
import { T as
|
|
19
|
+
import Tt from "@mui/material/Button";
|
|
20
|
+
import { useTheme as Mt } from "@mui/material";
|
|
21
|
+
import { e as Dt } from "../TransactionUtils-BphBJBbU.mjs";
|
|
22
|
+
import { T as xt } from "../EmbeddedCard-CQEnrozC.mjs";
|
|
23
|
+
import { T as Lt } from "../TransactionDetails-CLc7oeHT.mjs";
|
|
24
24
|
import vt from "@mui/material/Collapse";
|
|
25
25
|
import wt from "@mui/material/Divider";
|
|
26
26
|
import Q from "@mui/material/List";
|
|
27
27
|
import X from "@mui/material/ListItem";
|
|
28
28
|
import Z from "@mui/material/ListItemButton";
|
|
29
|
-
import { u as
|
|
29
|
+
import { u as At } from "../useScreenSize-mWpmnh5w.mjs";
|
|
30
30
|
import { D as tt } from "../Drawer-DsnW2o0v.mjs";
|
|
31
|
-
import { C as
|
|
31
|
+
import { C as I } from "../Category-DEKZGLYe.mjs";
|
|
32
32
|
import { parseISO as et } from "date-fns/parseISO";
|
|
33
33
|
import { A as nt } from "../Analytics-D-jdcL72.mjs";
|
|
34
34
|
import { W as It } from "../WidgetContainer-DvKtBdhn.mjs";
|
|
35
|
-
const
|
|
36
|
-
/* @__PURE__ */ t(
|
|
37
|
-
/* @__PURE__ */ t(
|
|
38
|
-
] }),
|
|
39
|
-
const n =
|
|
35
|
+
const V = ({ amount: n, label: s, variant: o = "full" }) => /* @__PURE__ */ p(S, { direction: "column", children: [
|
|
36
|
+
/* @__PURE__ */ t(D, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: s }),
|
|
37
|
+
/* @__PURE__ */ t(D, { variant: "caption", children: B(n, o === "mini" ? "0,0" : "0,0.00") })
|
|
38
|
+
] }), Et = () => {
|
|
39
|
+
const n = yt(), { goals: s, spending: o } = W(), { categories: a, dateRangeCategoryTotals: i } = k(), g = r.useMemo(
|
|
40
40
|
() => [
|
|
41
41
|
n.palette.chartMono.chartMono5,
|
|
42
42
|
n.palette.chartMono.chartMono4,
|
|
@@ -46,72 +46,72 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
46
46
|
n.palette.chartMono.chartMono6
|
|
47
47
|
],
|
|
48
48
|
[n]
|
|
49
|
-
), [e,
|
|
50
|
-
() =>
|
|
49
|
+
), [e, l] = r.useState(""), [c, f] = r.useState(0), u = r.useMemo(
|
|
50
|
+
() => lt(a, s, n, i),
|
|
51
51
|
[a, i]
|
|
52
|
-
), h =
|
|
53
|
-
() =>
|
|
52
|
+
), h = r.useMemo(
|
|
53
|
+
() => ct(a, i, g),
|
|
54
54
|
[a, i, g]
|
|
55
|
-
),
|
|
56
|
-
f(
|
|
57
|
-
}, _ = (
|
|
58
|
-
|
|
55
|
+
), C = (y, L) => {
|
|
56
|
+
f(L), l("");
|
|
57
|
+
}, _ = (y) => {
|
|
58
|
+
l(e === y ? "" : y);
|
|
59
59
|
};
|
|
60
|
-
return /* @__PURE__ */ p(
|
|
60
|
+
return /* @__PURE__ */ p(E, { width: "100%", children: [
|
|
61
61
|
/* @__PURE__ */ p(
|
|
62
|
-
|
|
62
|
+
st,
|
|
63
63
|
{
|
|
64
64
|
"aria-label": o.mini_title,
|
|
65
|
-
onChange:
|
|
65
|
+
onChange: C,
|
|
66
66
|
sx: { touchAction: "manipulation" },
|
|
67
|
-
value:
|
|
67
|
+
value: c,
|
|
68
68
|
variant: "fullWidth",
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
|
-
|
|
71
|
+
G,
|
|
72
72
|
{
|
|
73
73
|
"aria-controls": "spending-tabpanel",
|
|
74
74
|
id: "spending-tab",
|
|
75
75
|
label: /* @__PURE__ */ t(
|
|
76
|
-
|
|
76
|
+
V,
|
|
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: c === 0 ? 0 : -1
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ t(
|
|
87
|
-
|
|
87
|
+
G,
|
|
88
88
|
{
|
|
89
89
|
"aria-controls": "income-tabpanel",
|
|
90
90
|
id: "income-tab",
|
|
91
91
|
label: /* @__PURE__ */ t(
|
|
92
|
-
|
|
92
|
+
V,
|
|
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: c === 1 ? 0 : -1
|
|
100
100
|
}
|
|
101
101
|
)
|
|
102
102
|
]
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
105
|
/* @__PURE__ */ t(
|
|
106
|
-
|
|
106
|
+
E,
|
|
107
107
|
{
|
|
108
108
|
"aria-labelledby": "spending-tab",
|
|
109
|
-
hidden:
|
|
109
|
+
hidden: c !== 0,
|
|
110
110
|
id: "spending-tabpanel",
|
|
111
111
|
role: "tabpanel",
|
|
112
|
-
children: /* @__PURE__ */ p(
|
|
112
|
+
children: /* @__PURE__ */ p(S, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
113
113
|
/* @__PURE__ */ t(
|
|
114
|
-
|
|
114
|
+
F,
|
|
115
115
|
{
|
|
116
116
|
data: u,
|
|
117
117
|
onSelected: _,
|
|
@@ -124,15 +124,15 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
126
|
/* @__PURE__ */ t(
|
|
127
|
-
|
|
127
|
+
E,
|
|
128
128
|
{
|
|
129
129
|
"aria-labelledby": "income-tab",
|
|
130
|
-
hidden:
|
|
130
|
+
hidden: c !== 1,
|
|
131
131
|
id: "income-tabpanel",
|
|
132
132
|
role: "tabpanel",
|
|
133
|
-
children: /* @__PURE__ */ p(
|
|
133
|
+
children: /* @__PURE__ */ p(S, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
134
134
|
/* @__PURE__ */ t(
|
|
135
|
-
|
|
135
|
+
F,
|
|
136
136
|
{
|
|
137
137
|
data: h,
|
|
138
138
|
isIncome: !0,
|
|
@@ -146,42 +146,42 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
] });
|
|
149
|
-
},
|
|
150
|
-
const { isAccountDataLoaded: o, loadAccountData: a } =
|
|
151
|
-
return
|
|
149
|
+
}, Rt = R(Et), Wt = ({ onPrimaryCtaClick: n, sx: s = {} }) => {
|
|
150
|
+
const { isAccountDataLoaded: o, loadAccountData: a } = dt(), { dateRangeTotalsLoaded: i, categoriesLoaded: g, loadCategories: e, loadDateRangeCategoryTotals: l } = k(), { spending: c } = W(), { isInitialized: f, selectedAccounts: u } = P();
|
|
151
|
+
return pt({
|
|
152
152
|
widgetName: "SpendingMiniWidget",
|
|
153
153
|
isLoaded: i
|
|
154
|
-
}),
|
|
154
|
+
}), r.useEffect(() => {
|
|
155
155
|
o || a().finally(), g || e().finally();
|
|
156
|
-
}, []),
|
|
157
|
-
!f || !o ||
|
|
156
|
+
}, []), r.useEffect(() => {
|
|
157
|
+
!f || !o || l(
|
|
158
158
|
u,
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
it(/* @__PURE__ */ new Date()),
|
|
160
|
+
rt(/* @__PURE__ */ new Date())
|
|
161
161
|
).finally();
|
|
162
|
-
}, [f, o, u]), !f || !o || !i ? /* @__PURE__ */ t(
|
|
163
|
-
|
|
162
|
+
}, [f, o, u]), !f || !o || !i ? /* @__PURE__ */ t(ut, {}) : /* @__PURE__ */ t(
|
|
163
|
+
St,
|
|
164
164
|
{
|
|
165
165
|
className: "mx-exp-spending-miniwidget",
|
|
166
166
|
onPrimaryCtaClick: n,
|
|
167
|
-
primaryCtaLabel:
|
|
168
|
-
primaryCtaLabelAria:
|
|
169
|
-
sx: { height: "100%", ...
|
|
170
|
-
title:
|
|
171
|
-
children: /* @__PURE__ */ t(
|
|
167
|
+
primaryCtaLabel: c.primary_cta,
|
|
168
|
+
primaryCtaLabelAria: c.primary_cta_aria,
|
|
169
|
+
sx: { height: "100%", ...s },
|
|
170
|
+
title: c.mini_title,
|
|
171
|
+
children: /* @__PURE__ */ t(Rt, {})
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
|
-
},
|
|
174
|
+
}, Se = R(Wt), Nt = ({
|
|
175
175
|
data: n,
|
|
176
|
-
onSelected:
|
|
176
|
+
onSelected: s,
|
|
177
177
|
selectedId: o = "",
|
|
178
178
|
title: a
|
|
179
179
|
}) => {
|
|
180
|
-
const { spending: i } =
|
|
181
|
-
return /* @__PURE__ */ p(
|
|
182
|
-
/* @__PURE__ */ t(
|
|
180
|
+
const { spending: i } = W(), g = n.categoryData.find((e) => e.guid === o);
|
|
181
|
+
return /* @__PURE__ */ p(S, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
182
|
+
/* @__PURE__ */ t(D, { 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(Q, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ p(
|
|
184
|
+
/* @__PURE__ */ t(Q, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ p(r.Fragment, { children: [
|
|
185
185
|
/* @__PURE__ */ t(
|
|
186
186
|
X,
|
|
187
187
|
{
|
|
@@ -197,11 +197,11 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
197
197
|
{
|
|
198
198
|
"aria-expanded": g?.guid === e.guid,
|
|
199
199
|
id: `spending-list-category-${e.guid}`,
|
|
200
|
-
onClick: () =>
|
|
200
|
+
onClick: () => s(e.guid),
|
|
201
201
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
202
202
|
children: [
|
|
203
203
|
/* @__PURE__ */ t(
|
|
204
|
-
|
|
204
|
+
E,
|
|
205
205
|
{
|
|
206
206
|
"aria-hidden": "true",
|
|
207
207
|
borderRadius: 4,
|
|
@@ -213,15 +213,15 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
213
213
|
}
|
|
214
214
|
),
|
|
215
215
|
/* @__PURE__ */ p(
|
|
216
|
-
|
|
216
|
+
S,
|
|
217
217
|
{
|
|
218
218
|
alignItems: "center",
|
|
219
219
|
direction: "row",
|
|
220
220
|
justifyContent: "space-between",
|
|
221
221
|
width: "100%",
|
|
222
222
|
children: [
|
|
223
|
-
/* @__PURE__ */ t(
|
|
224
|
-
/* @__PURE__ */ t(
|
|
223
|
+
/* @__PURE__ */ t(D, { bold: o === e.guid, children: e.name }),
|
|
224
|
+
/* @__PURE__ */ t(D, { bold: o === e.guid, variant: "body1", children: B(e.amount, "0,0.00") })
|
|
225
225
|
]
|
|
226
226
|
}
|
|
227
227
|
)
|
|
@@ -230,7 +230,7 @@ const G = ({ 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(Q, { sx: { borderBottom: 1, borderColor: "divider" }, children: g?.categoryTotals?.map((
|
|
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((l) => /* @__PURE__ */ t(
|
|
234
234
|
X,
|
|
235
235
|
{
|
|
236
236
|
sx: {
|
|
@@ -240,34 +240,34 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
240
240
|
children: /* @__PURE__ */ t(
|
|
241
241
|
Z,
|
|
242
242
|
{
|
|
243
|
-
id: `spending-list-subcategory-${
|
|
244
|
-
onClick: () =>
|
|
243
|
+
id: `spending-list-subcategory-${l.guid}`,
|
|
244
|
+
onClick: () => s(l.guid, !0),
|
|
245
245
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
246
|
-
children: /* @__PURE__ */ p(
|
|
247
|
-
/* @__PURE__ */ p(
|
|
248
|
-
|
|
246
|
+
children: /* @__PURE__ */ p(S, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
247
|
+
/* @__PURE__ */ p(D, { children: [
|
|
248
|
+
l.name,
|
|
249
249
|
" "
|
|
250
250
|
] }),
|
|
251
|
-
/* @__PURE__ */ t(
|
|
251
|
+
/* @__PURE__ */ t(D, { children: B(l.amount, "0,0.00") })
|
|
252
252
|
] })
|
|
253
253
|
}
|
|
254
254
|
)
|
|
255
255
|
},
|
|
256
|
-
|
|
256
|
+
l.guid
|
|
257
257
|
)) }) })
|
|
258
258
|
] }, e.guid)) }),
|
|
259
|
-
/* @__PURE__ */ t(
|
|
259
|
+
/* @__PURE__ */ t(D, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${B(n.totalAmount, "0,0.00")}` })
|
|
260
260
|
] });
|
|
261
|
-
},
|
|
261
|
+
}, $t = R(Nt), Ot = ({
|
|
262
262
|
data: n,
|
|
263
|
-
onSelected:
|
|
263
|
+
onSelected: s,
|
|
264
264
|
onViewTransactions: o,
|
|
265
265
|
selectedId: a,
|
|
266
266
|
title: i
|
|
267
267
|
}) => {
|
|
268
|
-
const { isDesktop: g, isMobile: e } =
|
|
268
|
+
const { isDesktop: g, isMobile: e } = At(), { dateRangeTotalsLoading: l } = k(), { spending: c } = W();
|
|
269
269
|
return /* @__PURE__ */ p(
|
|
270
|
-
|
|
270
|
+
S,
|
|
271
271
|
{
|
|
272
272
|
alignItems: e ? "center" : "flex-start",
|
|
273
273
|
direction: e ? "column" : "row",
|
|
@@ -276,8 +276,8 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
276
276
|
pt: 50,
|
|
277
277
|
px: 8,
|
|
278
278
|
children: [
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
l && /* @__PURE__ */ t(
|
|
280
|
+
F,
|
|
281
281
|
{
|
|
282
282
|
data: {
|
|
283
283
|
categoryData: [],
|
|
@@ -292,111 +292,111 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
292
292
|
variant: "full"
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
|
-
!
|
|
296
|
-
|
|
295
|
+
!l && /* @__PURE__ */ t(
|
|
296
|
+
F,
|
|
297
297
|
{
|
|
298
298
|
data: n,
|
|
299
299
|
onSelected: (h) => {
|
|
300
|
-
|
|
300
|
+
s(h), setTimeout(() => document.getElementById(`spending-list-category-${h}`)?.focus(), 0);
|
|
301
301
|
},
|
|
302
302
|
onViewTransactions: o,
|
|
303
303
|
selectedId: a,
|
|
304
304
|
size: g ? 400 : 300,
|
|
305
|
-
totalLabel:
|
|
305
|
+
totalLabel: c.total_amount,
|
|
306
306
|
variant: "full"
|
|
307
307
|
}
|
|
308
308
|
),
|
|
309
|
-
/* @__PURE__ */ t(
|
|
309
|
+
/* @__PURE__ */ t($t, { data: n, onSelected: s, selectedId: a, title: i })
|
|
310
310
|
]
|
|
311
311
|
}
|
|
312
312
|
);
|
|
313
|
-
}, ot =
|
|
313
|
+
}, ot = R(Ot), kt = (n) => [
|
|
314
314
|
n.palette.chartMono.chartMono5,
|
|
315
315
|
n.palette.chartMono.chartMono4,
|
|
316
316
|
n.palette.chartMono.chartMono3,
|
|
317
317
|
n.palette.chartMono.chartMono2,
|
|
318
318
|
n.palette.chartMono.chartMono1,
|
|
319
319
|
n.palette.chartMono.chartMono6
|
|
320
|
-
],
|
|
321
|
-
const n =
|
|
320
|
+
], jt = () => {
|
|
321
|
+
const n = Mt(), { is_mobile_webview: s } = H(), { clientConfig: o } = H(), { categories: a, dateRangeCategoryTotals: i } = k(), {
|
|
322
322
|
goals: g,
|
|
323
323
|
spending: e,
|
|
324
|
-
transactions:
|
|
325
|
-
} =
|
|
324
|
+
transactions: l
|
|
325
|
+
} = W(), { displayedDateRange: c, selectedAccountGuids: f } = P(), {
|
|
326
326
|
setFilter: u,
|
|
327
327
|
sortedTransactions: h,
|
|
328
|
-
sortedTransactionsWithSplits:
|
|
328
|
+
sortedTransactionsWithSplits: C,
|
|
329
329
|
tags: _
|
|
330
|
-
} =
|
|
331
|
-
() =>
|
|
330
|
+
} = gt(), y = o?.master?.deep_link_params?.account_guids, L = o?.master?.deep_link_params?.view, [T, N] = r.useState(""), [v, $] = r.useState(L === "income" ? 1 : 0), [O, j] = r.useState(""), [b, w] = r.useState(!1), x = r.useMemo(
|
|
331
|
+
() => lt(a, g, n, i),
|
|
332
332
|
[a, i]
|
|
333
|
-
),
|
|
334
|
-
() =>
|
|
333
|
+
), A = r.useMemo(
|
|
334
|
+
() => ct(a, i, kt(n)),
|
|
335
335
|
[a, i]
|
|
336
|
-
),
|
|
337
|
-
() => h.find((
|
|
338
|
-
[
|
|
339
|
-
),
|
|
340
|
-
|
|
341
|
-
}, U = (
|
|
342
|
-
|
|
343
|
-
},
|
|
336
|
+
), z = r.useMemo(
|
|
337
|
+
() => h.find((d) => d.guid === O),
|
|
338
|
+
[O, h]
|
|
339
|
+
), mt = (d, M) => {
|
|
340
|
+
$(M), N("");
|
|
341
|
+
}, U = (d, M = !1) => {
|
|
342
|
+
M ? ht(d) : N(T === d || d === "0" ? "" : d);
|
|
343
|
+
}, ht = (d) => {
|
|
344
344
|
u({
|
|
345
345
|
...{
|
|
346
|
-
accounts:
|
|
347
|
-
dateRange:
|
|
346
|
+
accounts: y || f,
|
|
347
|
+
dateRange: c
|
|
348
348
|
},
|
|
349
|
-
custom: (m) =>
|
|
349
|
+
custom: (m) => T === "other" ? m.top_level_category_guid === d : m.category_guid === d,
|
|
350
350
|
showSplits: !0
|
|
351
|
-
}),
|
|
352
|
-
}, Y = (
|
|
353
|
-
const
|
|
354
|
-
accounts:
|
|
355
|
-
dateRange:
|
|
351
|
+
}), w(!0);
|
|
352
|
+
}, Y = (d) => {
|
|
353
|
+
const M = {
|
|
354
|
+
accounts: y || f,
|
|
355
|
+
dateRange: c
|
|
356
356
|
};
|
|
357
357
|
if (v === 0)
|
|
358
|
-
if (
|
|
359
|
-
const m =
|
|
358
|
+
if (d === "other") {
|
|
359
|
+
const m = x.categoryData.find((K) => K.guid === "other");
|
|
360
360
|
u({
|
|
361
|
-
...
|
|
362
|
-
custom: (
|
|
361
|
+
...M,
|
|
362
|
+
custom: (K) => !!m?.categoryTotals?.find((_t) => _t.guid === K.top_level_category_guid)
|
|
363
363
|
});
|
|
364
364
|
} else
|
|
365
365
|
u({
|
|
366
|
-
...
|
|
367
|
-
custom: (m) =>
|
|
368
|
-
showSplits: !!
|
|
366
|
+
...M,
|
|
367
|
+
custom: (m) => d ? m.top_level_category_guid === d : m.top_level_category_guid !== I.INCOME && m.category_guid !== I.INCOME && m.top_level_category_guid !== I.INVESTMENTS && m.top_level_category_guid !== I.TRANSFER,
|
|
368
|
+
showSplits: !!d
|
|
369
369
|
});
|
|
370
370
|
else
|
|
371
371
|
u({
|
|
372
|
-
...
|
|
373
|
-
custom: (m) =>
|
|
372
|
+
...M,
|
|
373
|
+
custom: (m) => d ? m.category_guid === d : m.category_guid === I.INCOME || m.top_level_category_guid === I.INCOME
|
|
374
374
|
});
|
|
375
|
-
|
|
376
|
-
},
|
|
377
|
-
|
|
375
|
+
w(!0);
|
|
376
|
+
}, ft = () => {
|
|
377
|
+
Dt(C, _);
|
|
378
378
|
};
|
|
379
|
-
return /* @__PURE__ */ p(
|
|
380
|
-
/* @__PURE__ */ p(
|
|
379
|
+
return /* @__PURE__ */ p(E, { children: [
|
|
380
|
+
/* @__PURE__ */ p(st, { onChange: mt, value: v, variant: "fullWidth", children: [
|
|
381
381
|
/* @__PURE__ */ t(
|
|
382
|
-
|
|
382
|
+
G,
|
|
383
383
|
{
|
|
384
384
|
label: /* @__PURE__ */ t(
|
|
385
|
-
|
|
385
|
+
V,
|
|
386
386
|
{
|
|
387
|
-
amount:
|
|
387
|
+
amount: x.totalAmount,
|
|
388
388
|
label: e.spend_tab_title
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
/* @__PURE__ */ t(
|
|
394
|
-
|
|
394
|
+
G,
|
|
395
395
|
{
|
|
396
396
|
label: /* @__PURE__ */ t(
|
|
397
|
-
|
|
397
|
+
V,
|
|
398
398
|
{
|
|
399
|
-
amount:
|
|
399
|
+
amount: A.totalAmount,
|
|
400
400
|
label: e.income_tab_title
|
|
401
401
|
}
|
|
402
402
|
)
|
|
@@ -406,20 +406,20 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
406
406
|
v === 0 && /* @__PURE__ */ t(
|
|
407
407
|
ot,
|
|
408
408
|
{
|
|
409
|
-
data:
|
|
409
|
+
data: x,
|
|
410
410
|
onSelected: U,
|
|
411
411
|
onViewTransactions: Y,
|
|
412
|
-
selectedId:
|
|
412
|
+
selectedId: T,
|
|
413
413
|
title: e.spend_tab_title
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
416
|
v === 1 && /* @__PURE__ */ t(
|
|
417
417
|
ot,
|
|
418
418
|
{
|
|
419
|
-
data:
|
|
419
|
+
data: A,
|
|
420
420
|
onSelected: U,
|
|
421
421
|
onViewTransactions: Y,
|
|
422
|
-
selectedId:
|
|
422
|
+
selectedId: T,
|
|
423
423
|
title: e.income_tab_title
|
|
424
424
|
}
|
|
425
425
|
),
|
|
@@ -427,20 +427,20 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
427
427
|
tt,
|
|
428
428
|
{
|
|
429
429
|
ariaLabelClose: e.close_drawer_aria,
|
|
430
|
-
isOpen:
|
|
431
|
-
onClose: () =>
|
|
430
|
+
isOpen: b,
|
|
431
|
+
onClose: () => w(!1),
|
|
432
432
|
title: e.transactions_drawer_title,
|
|
433
|
-
children: /* @__PURE__ */ p(
|
|
434
|
-
!
|
|
435
|
-
|
|
433
|
+
children: /* @__PURE__ */ p(S, { children: [
|
|
434
|
+
!s && h.length > 0 && /* @__PURE__ */ t(S, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
|
|
435
|
+
Tt,
|
|
436
436
|
{
|
|
437
|
-
onClick:
|
|
437
|
+
onClick: ft,
|
|
438
438
|
startIcon: /* @__PURE__ */ t(bt, { name: "ios_share" }),
|
|
439
439
|
variant: "text",
|
|
440
|
-
children:
|
|
440
|
+
children: l.export_csv_btn
|
|
441
441
|
}
|
|
442
442
|
) }),
|
|
443
|
-
/* @__PURE__ */ t(
|
|
443
|
+
/* @__PURE__ */ t(xt, { onClick: j })
|
|
444
444
|
] })
|
|
445
445
|
}
|
|
446
446
|
),
|
|
@@ -448,46 +448,70 @@ const G = ({ amount: n, label: d, variant: o = "full" }) => /* @__PURE__ */ p(y,
|
|
|
448
448
|
tt,
|
|
449
449
|
{
|
|
450
450
|
ariaLabelClose: e.close_drawer_aria,
|
|
451
|
-
isOpen: !!
|
|
452
|
-
onClose: () =>
|
|
451
|
+
isOpen: !!z,
|
|
452
|
+
onClose: () => j(""),
|
|
453
453
|
title: e.transaction_details_drawer_title,
|
|
454
|
-
children:
|
|
454
|
+
children: z && /* @__PURE__ */ t(Lt, { transaction: z })
|
|
455
455
|
}
|
|
456
456
|
)
|
|
457
457
|
] });
|
|
458
|
-
}, Bt =
|
|
459
|
-
const { isAccountDataLoaded: a, loadAccountData: i } =
|
|
460
|
-
|
|
458
|
+
}, Bt = R(jt), at = (n, s, o) => `${n.getTime()}-${s.getTime()}-${[...o].sort().join(",")}`, Gt = ({ onBackClick: n, onMenuClick: s, sx: o = {} }) => {
|
|
459
|
+
const { isAccountDataLoaded: a, loadAccountData: i } = dt(), { categoriesLoaded: g, dateRangeTotalsLoaded: e, loadCategories: l, loadDateRangeCategoryTotals: c } = k(), { isTransactionDataLoaded: f, loadTransactionData: u } = gt(), { spending: h } = W(), {
|
|
460
|
+
displayedDateRange: C,
|
|
461
|
+
isInitialized: _,
|
|
462
|
+
setDisplayedDate: y,
|
|
463
|
+
selectedAccounts: L,
|
|
464
|
+
selectedAccountGuids: T
|
|
465
|
+
} = P(), { onEvent: N } = Ct(), { clientConfig: v } = H();
|
|
466
|
+
pt({
|
|
461
467
|
widgetName: "SpendingWidget",
|
|
462
468
|
isLoaded: e
|
|
463
|
-
})
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
_ && a &&
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
b(
|
|
469
|
+
});
|
|
470
|
+
const $ = r.useRef(null), O = r.useRef(!1);
|
|
471
|
+
r.useEffect(() => {
|
|
472
|
+
const b = v?.master?.deep_link_params, w = b?.date_range ? [et(b.date_range.from), et(b.date_range.to)] : [it(J()), rt(J())], x = w[0], A = w[1];
|
|
473
|
+
y(x, A), a || i().finally(), g || l().finally(), f || u().finally(), _ && a && ($.current = at(x, A, T), c(L, x, A).finally()), N(nt.SPENDING_VIEW);
|
|
474
|
+
}, []), r.useEffect(() => {
|
|
475
|
+
if (!O.current) {
|
|
476
|
+
O.current = !0;
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
if (!_ || !a) return;
|
|
480
|
+
const b = at(
|
|
481
|
+
C.start,
|
|
482
|
+
C.end,
|
|
483
|
+
T
|
|
484
|
+
);
|
|
485
|
+
$.current !== b && ($.current = b, c(
|
|
486
|
+
L,
|
|
487
|
+
C.start,
|
|
488
|
+
C.end
|
|
489
|
+
).finally());
|
|
490
|
+
}, [
|
|
491
|
+
C.start.getTime(),
|
|
492
|
+
C.end.getTime(),
|
|
493
|
+
_,
|
|
494
|
+
a,
|
|
495
|
+
T.join(",")
|
|
496
|
+
]);
|
|
497
|
+
const j = (b) => {
|
|
498
|
+
y(b[0], b[1]);
|
|
475
499
|
};
|
|
476
|
-
return !_ || !a || !e ? /* @__PURE__ */ t(
|
|
500
|
+
return !_ || !a || !e ? /* @__PURE__ */ t(ut, {}) : /* @__PURE__ */ t(
|
|
477
501
|
It,
|
|
478
502
|
{
|
|
479
|
-
calendarActions: { onRangeChanged:
|
|
480
|
-
onAccountsFilterClick: () =>
|
|
503
|
+
calendarActions: { onRangeChanged: j },
|
|
504
|
+
onAccountsFilterClick: () => N(nt.SPENDING_CLICK_FILTER),
|
|
481
505
|
onBackClick: n,
|
|
482
|
-
onMenuClick:
|
|
506
|
+
onMenuClick: s,
|
|
483
507
|
sx: o,
|
|
484
508
|
title: h.title,
|
|
485
|
-
children: /* @__PURE__ */ t(
|
|
509
|
+
children: /* @__PURE__ */ t(E, { width: "100%", children: /* @__PURE__ */ t(Bt, {}) })
|
|
486
510
|
}
|
|
487
511
|
);
|
|
488
|
-
},
|
|
512
|
+
}, Te = R(Gt);
|
|
489
513
|
export {
|
|
490
|
-
|
|
491
|
-
|
|
514
|
+
Se as SpendingMiniWidget,
|
|
515
|
+
Te as SpendingWidget
|
|
492
516
|
};
|
|
493
517
|
//# sourceMappingURL=index.es.js.map
|