@mx-cartographer/experiences 7.6.6 → 7.6.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/spending/index.es.js +124 -121
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,25 +2,25 @@ import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import a from "react";
|
|
3
3
|
import { observer as x } from "mobx-react-lite";
|
|
4
4
|
import { startOfMonth as it } from "date-fns/startOfMonth";
|
|
5
|
-
import { endOfMonth as
|
|
5
|
+
import { endOfMonth as st } from "date-fns/endOfMonth";
|
|
6
6
|
import M from "@mui/material/Box";
|
|
7
|
-
import
|
|
7
|
+
import y from "@mui/material/Stack";
|
|
8
8
|
import E from "@mui/material/Tab";
|
|
9
|
-
import
|
|
9
|
+
import rt from "@mui/material/Tabs";
|
|
10
10
|
import bt from "@mui/material/styles/useTheme";
|
|
11
11
|
import { g as ct, a as lt, S as W, b as Q } from "../SpendingLegend-CJFdclHt.mjs";
|
|
12
|
-
import { Text as
|
|
12
|
+
import { Text as S, Icon as _t } from "@mxenabled/mxui";
|
|
13
13
|
import { f as A } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
-
import { u as w, b as R, m as F, d as dt, a as V, h as
|
|
14
|
+
import { u as w, b as R, m as F, d as dt, a as V, h as yt, g as St } from "../hooks-ZMp65DFz.mjs";
|
|
15
15
|
import { u as gt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
16
16
|
import { L as P } from "../Loader-DUaFpDGv.mjs";
|
|
17
|
-
import { M as
|
|
17
|
+
import { M as Ct } from "../MiniWidgetContainer-98-hKFqm.mjs";
|
|
18
18
|
import { startOfToday as Z } from "date-fns/startOfToday";
|
|
19
19
|
import Tt from "@mui/material/Button";
|
|
20
20
|
import { useTheme as Mt } from "@mui/material";
|
|
21
21
|
import { e as xt } from "../exportTransactionsToCSV-CtfqJHuB.mjs";
|
|
22
|
-
import { T as wt, a as
|
|
23
|
-
import
|
|
22
|
+
import { T as wt, a as Dt } from "../TransactionDetails-vXstDuDk.mjs";
|
|
23
|
+
import vt from "@mui/material/Collapse";
|
|
24
24
|
import z from "@mui/material/Divider";
|
|
25
25
|
import tt from "@mui/material/List";
|
|
26
26
|
import et from "@mui/material/ListItem";
|
|
@@ -29,15 +29,15 @@ import { u as It } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
|
29
29
|
import { D as nt } from "../Drawer-DV4NTsFg.mjs";
|
|
30
30
|
import { b as L } from "../Category-CevNQ03n.mjs";
|
|
31
31
|
import { A as ot, W as At } from "../WidgetContainer-8RexRzms.mjs";
|
|
32
|
-
const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(
|
|
33
|
-
/* @__PURE__ */ t(
|
|
34
|
-
/* @__PURE__ */ t(
|
|
32
|
+
const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(y, { direction: "column", children: [
|
|
33
|
+
/* @__PURE__ */ t(S, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
|
|
34
|
+
/* @__PURE__ */ t(S, { variant: "XSmall", children: A(e, "0,0") })
|
|
35
35
|
] }), Et = () => {
|
|
36
|
-
const e = bt(), { goals: d, spending: o } = w(), { selectedAccounts:
|
|
36
|
+
const e = bt(), { goals: d, spending: o } = w(), { selectedAccounts: s } = R(), {
|
|
37
37
|
categories: i,
|
|
38
|
-
dateRangeCategoryTotals:
|
|
38
|
+
dateRangeCategoryTotals: r,
|
|
39
39
|
dataRangeTotalsLoaded: n,
|
|
40
|
-
loadDateRangeCategoryTotals:
|
|
40
|
+
loadDateRangeCategoryTotals: m
|
|
41
41
|
} = F();
|
|
42
42
|
gt({
|
|
43
43
|
widgetName: "SpendingMiniWidget",
|
|
@@ -55,30 +55,30 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
55
55
|
[e]
|
|
56
56
|
);
|
|
57
57
|
a.useEffect(() => {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
m(
|
|
59
|
+
s,
|
|
60
60
|
it(/* @__PURE__ */ new Date()),
|
|
61
|
-
|
|
61
|
+
st(/* @__PURE__ */ new Date())
|
|
62
62
|
).finally();
|
|
63
|
-
}, [
|
|
64
|
-
const [
|
|
65
|
-
() => ct(i, d, e,
|
|
66
|
-
[i,
|
|
63
|
+
}, [s]);
|
|
64
|
+
const [h, g] = a.useState(""), [p, D] = a.useState(0), _ = a.useMemo(
|
|
65
|
+
() => ct(i, d, e, r),
|
|
66
|
+
[i, r]
|
|
67
67
|
), f = a.useMemo(
|
|
68
|
-
() => lt(i,
|
|
69
|
-
[i,
|
|
70
|
-
),
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
g(
|
|
68
|
+
() => lt(i, r, c),
|
|
69
|
+
[i, r, c]
|
|
70
|
+
), $ = (T, O) => {
|
|
71
|
+
D(O), g("");
|
|
72
|
+
}, C = (T) => {
|
|
73
|
+
g(h === T ? "" : T);
|
|
74
74
|
};
|
|
75
75
|
return n ? /* @__PURE__ */ l(M, { width: "100%", children: [
|
|
76
76
|
/* @__PURE__ */ l(
|
|
77
|
-
|
|
77
|
+
rt,
|
|
78
78
|
{
|
|
79
79
|
"aria-label": o.mini_title,
|
|
80
|
-
onChange:
|
|
81
|
-
value:
|
|
80
|
+
onChange: $,
|
|
81
|
+
value: p,
|
|
82
82
|
variant: "fullWidth",
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ t(
|
|
@@ -93,7 +93,7 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
93
93
|
label: o.spend_tab_title
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
|
-
tabIndex:
|
|
96
|
+
tabIndex: p === 0 ? 0 : -1
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
99
|
/* @__PURE__ */ t(
|
|
@@ -108,7 +108,7 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
108
108
|
label: o.income_tab_title
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
|
-
tabIndex:
|
|
111
|
+
tabIndex: p === 1 ? 0 : -1
|
|
112
112
|
}
|
|
113
113
|
)
|
|
114
114
|
]
|
|
@@ -118,20 +118,20 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
118
118
|
M,
|
|
119
119
|
{
|
|
120
120
|
"aria-labelledby": "spending-tab",
|
|
121
|
-
hidden:
|
|
121
|
+
hidden: p !== 0,
|
|
122
122
|
id: "spending-tabpanel",
|
|
123
123
|
role: "tabpanel",
|
|
124
|
-
children: /* @__PURE__ */ l(
|
|
124
|
+
children: /* @__PURE__ */ l(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
125
125
|
/* @__PURE__ */ t(
|
|
126
126
|
W,
|
|
127
127
|
{
|
|
128
128
|
data: _,
|
|
129
|
-
onSelected:
|
|
130
|
-
selectedId:
|
|
129
|
+
onSelected: C,
|
|
130
|
+
selectedId: h,
|
|
131
131
|
totalLabel: o.total_spending
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
|
-
/* @__PURE__ */ t(Q, { data: _, onSelected:
|
|
134
|
+
/* @__PURE__ */ t(Q, { data: _, onSelected: C, selectedId: h })
|
|
135
135
|
] })
|
|
136
136
|
}
|
|
137
137
|
),
|
|
@@ -139,37 +139,37 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
139
139
|
M,
|
|
140
140
|
{
|
|
141
141
|
"aria-labelledby": "income-tab",
|
|
142
|
-
hidden:
|
|
142
|
+
hidden: p !== 1,
|
|
143
143
|
id: "income-tabpanel",
|
|
144
144
|
role: "tabpanel",
|
|
145
|
-
children: /* @__PURE__ */ l(
|
|
145
|
+
children: /* @__PURE__ */ l(y, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
146
146
|
/* @__PURE__ */ t(
|
|
147
147
|
W,
|
|
148
148
|
{
|
|
149
149
|
data: f,
|
|
150
150
|
isIncome: !0,
|
|
151
|
-
onSelected:
|
|
152
|
-
selectedId:
|
|
151
|
+
onSelected: C,
|
|
152
|
+
selectedId: h,
|
|
153
153
|
totalLabel: o.total_income
|
|
154
154
|
}
|
|
155
155
|
),
|
|
156
|
-
/* @__PURE__ */ t(Q, { data: f, onSelected:
|
|
156
|
+
/* @__PURE__ */ t(Q, { data: f, onSelected: C, selectedId: h })
|
|
157
157
|
] })
|
|
158
158
|
}
|
|
159
159
|
)
|
|
160
160
|
] }) : /* @__PURE__ */ t(P, { height: 250 });
|
|
161
161
|
}, Wt = x(Et), Nt = ({ onPrimaryCtaClick: e, sx: d = {} }) => {
|
|
162
|
-
const { visibleAccounts: o } = dt(), { spending:
|
|
162
|
+
const { visibleAccounts: o } = dt(), { spending: s } = w(), { isCopyLoaded: i, isInitialized: r, setSelectedAccounts: n } = R();
|
|
163
163
|
return a.useEffect(() => {
|
|
164
164
|
n(o);
|
|
165
|
-
}, [o]), !i || !
|
|
166
|
-
|
|
165
|
+
}, [o]), !i || !r ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
|
|
166
|
+
Ct,
|
|
167
167
|
{
|
|
168
168
|
className: "mx-exp-spending-miniwidget",
|
|
169
169
|
onPrimaryCtaClick: e,
|
|
170
|
-
primaryCtaLabel:
|
|
170
|
+
primaryCtaLabel: s.primary_cta,
|
|
171
171
|
sx: { height: "100%", ...d },
|
|
172
|
-
title:
|
|
172
|
+
title: s.mini_title,
|
|
173
173
|
children: /* @__PURE__ */ t(Wt, {})
|
|
174
174
|
}
|
|
175
175
|
);
|
|
@@ -177,13 +177,13 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
177
177
|
data: e,
|
|
178
178
|
onSelected: d,
|
|
179
179
|
selectedId: o = "",
|
|
180
|
-
title:
|
|
180
|
+
title: s
|
|
181
181
|
}) => {
|
|
182
|
-
const { spending: i } = w(),
|
|
183
|
-
return /* @__PURE__ */ l(
|
|
184
|
-
/* @__PURE__ */ t(
|
|
182
|
+
const { spending: i } = w(), r = e.categoryData.find((n) => n.guid === o);
|
|
183
|
+
return /* @__PURE__ */ l(y, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
184
|
+
/* @__PURE__ */ t(S, { bold: !0, id: "spending-list-title", sx: { py: 12 }, children: `${s} ${i.by_category}` }),
|
|
185
185
|
/* @__PURE__ */ t(z, { "aria-hidden": "true" }),
|
|
186
|
-
/* @__PURE__ */ t(tt, { children: e.categoryData.map((n) => /* @__PURE__ */ l(a.Fragment, { children: [
|
|
186
|
+
/* @__PURE__ */ t(tt, { "aria-labelledby": "spending-list-title", children: e.categoryData.map((n) => /* @__PURE__ */ l(a.Fragment, { children: [
|
|
187
187
|
/* @__PURE__ */ t(
|
|
188
188
|
et,
|
|
189
189
|
{
|
|
@@ -195,7 +195,8 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
195
195
|
children: /* @__PURE__ */ l(
|
|
196
196
|
Lt,
|
|
197
197
|
{
|
|
198
|
-
"aria-expanded":
|
|
198
|
+
"aria-expanded": r?.guid === n.guid,
|
|
199
|
+
id: `spending-list-category-${n.guid}`,
|
|
199
200
|
onClick: () => d(n.guid),
|
|
200
201
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
201
202
|
children: [
|
|
@@ -210,15 +211,15 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
210
211
|
}
|
|
211
212
|
),
|
|
212
213
|
/* @__PURE__ */ l(
|
|
213
|
-
|
|
214
|
+
y,
|
|
214
215
|
{
|
|
215
216
|
alignItems: "center",
|
|
216
217
|
direction: "row",
|
|
217
218
|
justifyContent: "space-between",
|
|
218
219
|
width: "100%",
|
|
219
220
|
children: [
|
|
220
|
-
/* @__PURE__ */ t(
|
|
221
|
-
/* @__PURE__ */ t(
|
|
221
|
+
/* @__PURE__ */ t(S, { bold: o === n.guid, children: n.name }),
|
|
222
|
+
/* @__PURE__ */ t(S, { bold: o === n.guid, variant: "Body", children: A(n.amount, "0,0") })
|
|
222
223
|
]
|
|
223
224
|
}
|
|
224
225
|
)
|
|
@@ -228,8 +229,8 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
228
229
|
}
|
|
229
230
|
),
|
|
230
231
|
/* @__PURE__ */ t(z, {}),
|
|
231
|
-
n.categoryTotals && n.categoryTotals.length > 0 && /* @__PURE__ */ t(
|
|
232
|
-
|
|
232
|
+
n.categoryTotals && n.categoryTotals.length > 0 && /* @__PURE__ */ t(vt, { in: r?.guid === n.guid, unmountOnExit: !0, children: /* @__PURE__ */ l(tt, { children: [
|
|
233
|
+
r?.categoryTotals?.map((m) => /* @__PURE__ */ t(
|
|
233
234
|
et,
|
|
234
235
|
{
|
|
235
236
|
sx: {
|
|
@@ -237,31 +238,31 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
237
238
|
pr: 8,
|
|
238
239
|
py: 0
|
|
239
240
|
},
|
|
240
|
-
children: /* @__PURE__ */ l(
|
|
241
|
-
/* @__PURE__ */ l(
|
|
242
|
-
|
|
241
|
+
children: /* @__PURE__ */ l(y, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
242
|
+
/* @__PURE__ */ l(S, { children: [
|
|
243
|
+
m.name,
|
|
243
244
|
" "
|
|
244
245
|
] }),
|
|
245
|
-
/* @__PURE__ */ t(
|
|
246
|
+
/* @__PURE__ */ t(S, { children: A(m.amount, "0,0") })
|
|
246
247
|
] })
|
|
247
248
|
},
|
|
248
|
-
|
|
249
|
+
m.guid
|
|
249
250
|
)),
|
|
250
251
|
/* @__PURE__ */ t(z, {})
|
|
251
252
|
] }) })
|
|
252
253
|
] }, n.guid)) }),
|
|
253
|
-
/* @__PURE__ */ t(
|
|
254
|
+
/* @__PURE__ */ t(S, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${A(e.totalAmount, "0,0")}` })
|
|
254
255
|
] });
|
|
255
|
-
},
|
|
256
|
+
}, $t = x(Rt), Ot = ({
|
|
256
257
|
data: e,
|
|
257
258
|
onSelected: d,
|
|
258
259
|
onViewTransactions: o,
|
|
259
|
-
selectedId:
|
|
260
|
+
selectedId: s,
|
|
260
261
|
title: i
|
|
261
262
|
}) => {
|
|
262
|
-
const { isDesktop:
|
|
263
|
+
const { isDesktop: r, isMobile: n } = It(), { isLoadingCategoryTotals: m } = F(), { spending: c } = w();
|
|
263
264
|
return /* @__PURE__ */ l(
|
|
264
|
-
|
|
265
|
+
y,
|
|
265
266
|
{
|
|
266
267
|
alignItems: n ? "center" : "flex-start",
|
|
267
268
|
direction: n ? "column" : "row",
|
|
@@ -270,7 +271,7 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
270
271
|
pt: 50,
|
|
271
272
|
px: 8,
|
|
272
273
|
children: [
|
|
273
|
-
|
|
274
|
+
m && /* @__PURE__ */ t(
|
|
274
275
|
W,
|
|
275
276
|
{
|
|
276
277
|
data: {
|
|
@@ -281,28 +282,30 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
281
282
|
onSelected: () => {
|
|
282
283
|
},
|
|
283
284
|
selectedId: "",
|
|
284
|
-
size:
|
|
285
|
+
size: r ? 400 : 300,
|
|
285
286
|
totalLabel: "Loading ...",
|
|
286
287
|
variant: "full"
|
|
287
288
|
}
|
|
288
289
|
),
|
|
289
|
-
!
|
|
290
|
+
!m && /* @__PURE__ */ t(
|
|
290
291
|
W,
|
|
291
292
|
{
|
|
292
293
|
data: e,
|
|
293
|
-
onSelected:
|
|
294
|
+
onSelected: (p) => {
|
|
295
|
+
d(p), setTimeout(() => document.getElementById(`spending-list-category-${p}`)?.focus(), 0);
|
|
296
|
+
},
|
|
294
297
|
onViewTransactions: o,
|
|
295
|
-
selectedId:
|
|
296
|
-
size:
|
|
298
|
+
selectedId: s,
|
|
299
|
+
size: r ? 400 : 300,
|
|
297
300
|
totalLabel: c.total_amount,
|
|
298
301
|
variant: "full"
|
|
299
302
|
}
|
|
300
303
|
),
|
|
301
|
-
/* @__PURE__ */ t(
|
|
304
|
+
/* @__PURE__ */ t($t, { data: e, onSelected: d, selectedId: s, title: i })
|
|
302
305
|
]
|
|
303
306
|
}
|
|
304
307
|
);
|
|
305
|
-
}, at = x(
|
|
308
|
+
}, at = x(Ot), kt = (e) => [
|
|
306
309
|
e.palette.chartMono.chartMono5,
|
|
307
310
|
e.palette.chartMono.chartMono4,
|
|
308
311
|
e.palette.chartMono.chartMono3,
|
|
@@ -311,72 +314,72 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
311
314
|
e.palette.chartMono.chartMono6
|
|
312
315
|
], Bt = () => {
|
|
313
316
|
const e = Mt(), { is_mobile_webview: d } = V(), { clientConfig: o } = V(), {
|
|
314
|
-
categories:
|
|
317
|
+
categories: s,
|
|
315
318
|
dateRangeCategoryTotals: i,
|
|
316
|
-
loadDateRangeCategoryTotals:
|
|
319
|
+
loadDateRangeCategoryTotals: r,
|
|
317
320
|
dataRangeTotalsLoaded: n
|
|
318
321
|
} = F(), {
|
|
319
|
-
goals:
|
|
322
|
+
goals: m,
|
|
320
323
|
spending: c,
|
|
321
|
-
transactions:
|
|
322
|
-
} = w(), { displayedDateRange: g, selectedAccounts:
|
|
324
|
+
transactions: h
|
|
325
|
+
} = w(), { displayedDateRange: g, selectedAccounts: p, selectedAccountGuids: D } = R(), {
|
|
323
326
|
setFilter: _,
|
|
324
327
|
sortedTransactions: f,
|
|
325
|
-
sortedTransactionsWithSplits:
|
|
326
|
-
tags:
|
|
327
|
-
} =
|
|
328
|
+
sortedTransactionsWithSplits: $,
|
|
329
|
+
tags: C
|
|
330
|
+
} = yt(), T = o?.master?.deep_link_params?.account_guids, O = o?.master?.deep_link_params?.view, [k, H] = a.useState(""), [I, pt] = a.useState(O === "income" ? 1 : 0), [K, U] = a.useState(""), [ut, X] = a.useState(!1);
|
|
328
331
|
gt({
|
|
329
332
|
widgetName: "SpendingWidget",
|
|
330
333
|
isLoaded: n
|
|
331
334
|
}), a.useEffect(() => {
|
|
332
|
-
|
|
333
|
-
|
|
335
|
+
r(
|
|
336
|
+
p,
|
|
334
337
|
g.start,
|
|
335
338
|
g.end
|
|
336
339
|
).finally();
|
|
337
|
-
}, [
|
|
340
|
+
}, [p, g]);
|
|
338
341
|
const B = a.useMemo(
|
|
339
|
-
() => ct(
|
|
340
|
-
[
|
|
342
|
+
() => ct(s, m, e, i),
|
|
343
|
+
[s, i]
|
|
341
344
|
), Y = a.useMemo(
|
|
342
|
-
() => lt(
|
|
343
|
-
[
|
|
345
|
+
() => lt(s, i, kt(e)),
|
|
346
|
+
[s, i]
|
|
344
347
|
), G = a.useMemo(
|
|
345
|
-
() => f.find((
|
|
348
|
+
() => f.find((u) => u.guid === K),
|
|
346
349
|
[K, f]
|
|
347
|
-
), mt = (
|
|
348
|
-
pt(
|
|
349
|
-
}, q = (
|
|
350
|
-
H(
|
|
351
|
-
}, J = (
|
|
352
|
-
const
|
|
353
|
-
accounts: T ||
|
|
350
|
+
), mt = (u, v) => {
|
|
351
|
+
pt(v), H("");
|
|
352
|
+
}, q = (u) => {
|
|
353
|
+
H(k === u || u === "0" ? "" : u);
|
|
354
|
+
}, J = (u) => {
|
|
355
|
+
const v = {
|
|
356
|
+
accounts: T || D,
|
|
354
357
|
dateRange: g
|
|
355
358
|
};
|
|
356
359
|
if (I === 0)
|
|
357
|
-
if (
|
|
360
|
+
if (u === "other") {
|
|
358
361
|
const b = B.categoryData.find((j) => j.guid === "other");
|
|
359
362
|
_({
|
|
360
|
-
...
|
|
363
|
+
...v,
|
|
361
364
|
custom: (j) => !!b?.categoryTotals?.find((ft) => ft.guid === j.top_level_category_guid)
|
|
362
365
|
});
|
|
363
366
|
} else
|
|
364
367
|
_({
|
|
365
|
-
...
|
|
366
|
-
custom: (b) =>
|
|
367
|
-
showSplits: !!
|
|
368
|
+
...v,
|
|
369
|
+
custom: (b) => u ? b.top_level_category_guid === u : b.top_level_category_guid !== L.INCOME && b.top_level_category_guid !== L.INVESTMENTS && b.top_level_category_guid !== L.TRANSFER,
|
|
370
|
+
showSplits: !!u
|
|
368
371
|
});
|
|
369
372
|
else
|
|
370
373
|
_({
|
|
371
|
-
...
|
|
372
|
-
custom: (b) =>
|
|
374
|
+
...v,
|
|
375
|
+
custom: (b) => u ? b.category_guid === u : b.category_guid === L.INCOME || b.top_level_category_guid === L.INCOME
|
|
373
376
|
});
|
|
374
377
|
X(!0);
|
|
375
378
|
}, ht = () => {
|
|
376
|
-
xt(
|
|
379
|
+
xt($, C);
|
|
377
380
|
};
|
|
378
381
|
return /* @__PURE__ */ l(M, { children: [
|
|
379
|
-
/* @__PURE__ */ l(
|
|
382
|
+
/* @__PURE__ */ l(rt, { onChange: mt, value: I, variant: "fullWidth", children: [
|
|
380
383
|
/* @__PURE__ */ t(
|
|
381
384
|
E,
|
|
382
385
|
{
|
|
@@ -408,7 +411,7 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
408
411
|
data: B,
|
|
409
412
|
onSelected: q,
|
|
410
413
|
onViewTransactions: J,
|
|
411
|
-
selectedId:
|
|
414
|
+
selectedId: k,
|
|
412
415
|
title: c.spend_tab_title
|
|
413
416
|
}
|
|
414
417
|
),
|
|
@@ -418,7 +421,7 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
418
421
|
data: Y,
|
|
419
422
|
onSelected: q,
|
|
420
423
|
onViewTransactions: J,
|
|
421
|
-
selectedId:
|
|
424
|
+
selectedId: k,
|
|
422
425
|
title: c.income_tab_title
|
|
423
426
|
}
|
|
424
427
|
),
|
|
@@ -429,14 +432,14 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
429
432
|
isOpen: ut,
|
|
430
433
|
onClose: () => X(!1),
|
|
431
434
|
title: c.transactions_drawer_title,
|
|
432
|
-
children: /* @__PURE__ */ l(
|
|
433
|
-
!d && f.length > 0 && /* @__PURE__ */ t(
|
|
435
|
+
children: /* @__PURE__ */ l(y, { children: [
|
|
436
|
+
!d && f.length > 0 && /* @__PURE__ */ t(y, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
|
|
434
437
|
Tt,
|
|
435
438
|
{
|
|
436
439
|
onClick: ht,
|
|
437
440
|
startIcon: /* @__PURE__ */ t(_t, { name: "ios_share" }),
|
|
438
441
|
variant: "text",
|
|
439
|
-
children:
|
|
442
|
+
children: h.export_csv_btn
|
|
440
443
|
}
|
|
441
444
|
) }),
|
|
442
445
|
/* @__PURE__ */ t(wt, { onClick: U })
|
|
@@ -450,21 +453,21 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
450
453
|
isOpen: !!G,
|
|
451
454
|
onClose: () => U(""),
|
|
452
455
|
title: c.transaction_details_drawer_title,
|
|
453
|
-
children: G && /* @__PURE__ */ t(
|
|
456
|
+
children: G && /* @__PURE__ */ t(Dt, { transaction: G })
|
|
454
457
|
}
|
|
455
458
|
)
|
|
456
459
|
] });
|
|
457
460
|
}, Gt = x(Bt), jt = ({ onBackClick: e, sx: d = {} }) => {
|
|
458
|
-
const { visibleAccounts: o } = dt(), { spending:
|
|
461
|
+
const { visibleAccounts: o } = dt(), { spending: s } = w(), { isCopyLoaded: i, isInitialized: r, setDisplayedDate: n, setSelectedAccounts: m } = R(), { onEvent: c } = St(), { clientConfig: h } = V(), g = h?.master?.deep_link_params?.date_range, [p, D] = a.useState(!1);
|
|
459
462
|
a.useEffect(() => {
|
|
460
|
-
|
|
463
|
+
m(o);
|
|
461
464
|
}, [o]), a.useEffect(() => {
|
|
462
|
-
g && Array.isArray(g) && g.length === 2 ? n(g[0], g[1]) : n(it(Z()),
|
|
465
|
+
g && Array.isArray(g) && g.length === 2 ? n(g[0], g[1]) : n(it(Z()), st(Z())), D(!0), c(ot.SPENDING_VIEW);
|
|
463
466
|
}, []);
|
|
464
467
|
const _ = (f) => {
|
|
465
468
|
n(f[0], f[1]);
|
|
466
469
|
};
|
|
467
|
-
return !i || !
|
|
470
|
+
return !i || !r || !p ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
|
|
468
471
|
At,
|
|
469
472
|
{
|
|
470
473
|
accountOptions: o,
|
|
@@ -472,12 +475,12 @@ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column
|
|
|
472
475
|
onAccountsFilterClick: () => c(ot.SPENDING_CLICK_FILTER),
|
|
473
476
|
onBackClick: e,
|
|
474
477
|
sx: d,
|
|
475
|
-
title:
|
|
478
|
+
title: s.title,
|
|
476
479
|
children: /* @__PURE__ */ t(M, { width: "100%", children: /* @__PURE__ */ t(Gt, {}) })
|
|
477
480
|
}
|
|
478
481
|
);
|
|
479
|
-
},
|
|
482
|
+
}, ye = x(jt);
|
|
480
483
|
export {
|
|
481
484
|
_e as SpendingMiniWidget,
|
|
482
|
-
|
|
485
|
+
ye as SpendingWidget
|
|
483
486
|
};
|