@mx-cartographer/experiences 7.0.31 → 7.0.32-alpha-recurring-transactions-navigation-issue-ram1
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/recurringtransactions/index.es.js +369 -358
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsx as e, jsxs as o, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as Y } from "react/jsx-runtime";
|
|
2
2
|
import h from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { endOfMonth as
|
|
5
|
-
import { endOfToday as
|
|
6
|
-
import { startOfMonth as
|
|
7
|
-
import { startOfToday as
|
|
8
|
-
import { subDays as
|
|
9
|
-
import
|
|
3
|
+
import { observer as D } from "mobx-react-lite";
|
|
4
|
+
import { endOfMonth as B } from "date-fns/endOfMonth";
|
|
5
|
+
import { endOfToday as le } from "date-fns/endOfToday";
|
|
6
|
+
import { startOfMonth as W } from "date-fns/startOfMonth";
|
|
7
|
+
import { startOfToday as de } from "date-fns/startOfToday";
|
|
8
|
+
import { subDays as ue } from "date-fns/subDays";
|
|
9
|
+
import oe from "@mui/material/Skeleton";
|
|
10
10
|
import c from "@mui/material/Stack";
|
|
11
|
-
import { R as
|
|
11
|
+
import { R as ze } from "../RecurringSettings-ClbdFNWX.mjs";
|
|
12
12
|
import { M as An } from "../RecurringSettings-ClbdFNWX.mjs";
|
|
13
|
-
import { addMonths as
|
|
14
|
-
import { subMonths as
|
|
15
|
-
import { isBefore as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { Schedule as
|
|
21
|
-
import { Text as
|
|
22
|
-
import { getWeeksInMonth as
|
|
23
|
-
import
|
|
24
|
-
import { AdapterDateFns as
|
|
25
|
-
import { DateCalendar as
|
|
26
|
-
import { LocalizationProvider as
|
|
27
|
-
import { isSameDay as
|
|
28
|
-
import
|
|
29
|
-
import { PickersDay as
|
|
30
|
-
import { I as
|
|
31
|
-
import { u as
|
|
32
|
-
import { c as M, a as
|
|
33
|
-
import { T as
|
|
13
|
+
import { addMonths as Be } from "date-fns/addMonths";
|
|
14
|
+
import { subMonths as Ue } from "date-fns/subMonths";
|
|
15
|
+
import { isBefore as Fe } from "date-fns/isBefore";
|
|
16
|
+
import ae from "@mui/material/Unstable_Grid2";
|
|
17
|
+
import Te from "@mui/material/IconButton";
|
|
18
|
+
import De from "@mui/material/Tab";
|
|
19
|
+
import je from "@mui/material/Tabs";
|
|
20
|
+
import { Schedule as Ke, MonetizationOn as Ye, Cancel as Le, CheckCircle as Ae, ChevronLeft as Ve, ChevronRight as Xe, CurrencyExchange as Ze } from "@mxenabled/mx-icons";
|
|
21
|
+
import { Text as g, MerchantLogo as me, InstitutionLogo as qe, H3 as Je, P as se } from "@mxenabled/mxui";
|
|
22
|
+
import { getWeeksInMonth as Se } from "date-fns/getWeeksInMonth";
|
|
23
|
+
import pe from "@mui/material/styles/useTheme";
|
|
24
|
+
import { AdapterDateFns as Qe } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
25
|
+
import { DateCalendar as et } from "@mui/x-date-pickers/DateCalendar";
|
|
26
|
+
import { LocalizationProvider as tt } from "@mui/x-date-pickers/LocalizationProvider";
|
|
27
|
+
import { isSameDay as nt } from "date-fns/isSameDay";
|
|
28
|
+
import it from "@mui/material/Badge";
|
|
29
|
+
import { PickersDay as rt } from "@mui/x-date-pickers/PickersDay";
|
|
30
|
+
import { I as V } from "../IconBacking-B9oC6uL2.mjs";
|
|
31
|
+
import { u as S, a as X, i as v, f as Z, p as Ee, c as ge, g as he } from "../hooks-DlI63qSB.mjs";
|
|
32
|
+
import { c as M, a as T, g as Ie, f as ot } from "../RepeatingTransaction-BW4J-jeJ.mjs";
|
|
33
|
+
import { T as H } from "../RecurringTransactionsStore-D62XJtdL.mjs";
|
|
34
34
|
import { R as Gn } from "../RecurringTransactionsStore-D62XJtdL.mjs";
|
|
35
35
|
import { A as w, W as at } from "../WidgetContainer-CBpf3h1Y.mjs";
|
|
36
36
|
import st from "@mui/material/Button";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
37
|
+
import ce from "@mui/material/Divider";
|
|
38
|
+
import _e from "@mui/material/List";
|
|
39
|
+
import Ge from "@mui/material/ListItem";
|
|
40
40
|
import ct from "@mui/material/ListSubheader";
|
|
41
41
|
import lt from "@mui/material/ListItemAvatar";
|
|
42
42
|
import dt from "@mui/material/ListItemButton";
|
|
@@ -44,48 +44,48 @@ import ut from "@mui/material/ListItemText";
|
|
|
44
44
|
import { b as mt } from "../ManageIncome-Byw3lVtR.mjs";
|
|
45
45
|
import { c as On, M as kn, S as Wn } from "../ManageIncome-Byw3lVtR.mjs";
|
|
46
46
|
import { f as L } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
47
|
-
import { D as
|
|
48
|
-
import { b as
|
|
47
|
+
import { D as Ne } from "../Drawer-kEE73B87.mjs";
|
|
48
|
+
import { b as O } from "../Localization-2MODESHW.mjs";
|
|
49
49
|
import { f as A, D as E } from "../Dialog-CWW597AF.mjs";
|
|
50
|
-
import
|
|
51
|
-
import { S as
|
|
52
|
-
import { u as
|
|
53
|
-
import { L as
|
|
50
|
+
import k from "@mui/material/Box";
|
|
51
|
+
import { S as Oe } from "../StatusBar-BK_uYHAB.mjs";
|
|
52
|
+
import { u as fe } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
53
|
+
import { L as K } from "../Loader-DUaFpDGv.mjs";
|
|
54
54
|
import { M as pt } from "../MiniWidgetContainer-BzW7V_04.mjs";
|
|
55
55
|
import { u as gt } from "../useDimensions-27p2evRx.mjs";
|
|
56
56
|
import { M as ht } from "../MicroWidgetContainer-DPDsZIiS.mjs";
|
|
57
|
-
const
|
|
57
|
+
const q = {
|
|
58
58
|
gridRow: 1,
|
|
59
59
|
gridColumn: 1,
|
|
60
60
|
zIndex: 2
|
|
61
|
-
},
|
|
62
|
-
|
|
61
|
+
}, J = (t) => t ? { margin: "0 0 -6px -4px" } : void 0, xe = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(V, { size: n, sx: { ...J(t) }, children: /* @__PURE__ */ e(Ke, { color: "primary", filled: !0, sx: { fontSize: n, ...q } }) }), ye = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(V, { size: n, sx: { ...J(t) }, children: /* @__PURE__ */ e(
|
|
62
|
+
Ye,
|
|
63
63
|
{
|
|
64
64
|
filled: !0,
|
|
65
|
-
sx: { color: "categories.income", fontSize: n, ...
|
|
65
|
+
sx: { color: "categories.income", fontSize: n, ...q }
|
|
66
66
|
}
|
|
67
|
-
) }),
|
|
67
|
+
) }), Ce = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(V, { size: n, sx: { ...J(t) }, children: /* @__PURE__ */ e(Le, { color: "error", filled: !0, sx: { fontSize: n, ...q } }) }), be = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(V, { size: n, sx: { ...J(t) }, children: /* @__PURE__ */ e(Ae, { color: "success", filled: !0, sx: { fontSize: n, ...q } }) }), ft = D(
|
|
68
68
|
({ day: t, outsideCurrentMonth: n, ...i }) => {
|
|
69
|
-
const { recurring: a } =
|
|
69
|
+
const { recurring: a } = S(), { selectedAccountGuids: r } = X(), { recurrences: l, setSelectedDay: p } = v(), s = h.useMemo(
|
|
70
70
|
() => l.filter((d) => r.includes(d.accountGuid)),
|
|
71
71
|
[r, l]
|
|
72
72
|
).filter(
|
|
73
|
-
(d) =>
|
|
73
|
+
(d) => nt(d.occurredOnDate || d.expectedDate, t)
|
|
74
74
|
), m = s.some(
|
|
75
|
-
(d) => d.type !== M.Income && d.status ===
|
|
75
|
+
(d) => d.type !== M.Income && d.status === T.Upcoming
|
|
76
76
|
), f = s.some(
|
|
77
|
-
(d) => d.type !== M.Income && d.status ===
|
|
77
|
+
(d) => d.type !== M.Income && d.status === T.Missed
|
|
78
78
|
), x = s.some(
|
|
79
|
-
(d) => d.type !== M.Income && d.status ===
|
|
80
|
-
),
|
|
79
|
+
(d) => d.type !== M.Income && d.status === T.Paid
|
|
80
|
+
), C = s.some((d) => d.type === M.Income), y = (m ? 1 : 0) + (f ? 1 : 0) + (x ? 1 : 0) + (C ? 1 : 0);
|
|
81
81
|
return /* @__PURE__ */ e(
|
|
82
|
-
|
|
82
|
+
it,
|
|
83
83
|
{
|
|
84
|
-
badgeContent: s.length > 0 && /* @__PURE__ */ o(
|
|
85
|
-
f && /* @__PURE__ */ e(
|
|
86
|
-
x && /* @__PURE__ */ e(
|
|
87
|
-
m && /* @__PURE__ */ e(
|
|
88
|
-
|
|
84
|
+
badgeContent: s.length > 0 && /* @__PURE__ */ o(Y, { children: [
|
|
85
|
+
f && /* @__PURE__ */ e(Ce, { isOffset: !0 }),
|
|
86
|
+
x && /* @__PURE__ */ e(be, { isOffset: !0 }),
|
|
87
|
+
m && /* @__PURE__ */ e(xe, { isOffset: !0 }),
|
|
88
|
+
C && /* @__PURE__ */ e(ye, { isOffset: !0 })
|
|
89
89
|
] }),
|
|
90
90
|
overlap: "circular",
|
|
91
91
|
sx: {
|
|
@@ -96,15 +96,15 @@ const Z = {
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
children: /* @__PURE__ */ e(
|
|
99
|
-
|
|
99
|
+
rt,
|
|
100
100
|
{
|
|
101
101
|
"aria-label": `
|
|
102
102
|
${x && a.paid},
|
|
103
103
|
${f && a.missed},
|
|
104
104
|
${m && a.upcoming},
|
|
105
|
-
${
|
|
105
|
+
${C && a.income}`,
|
|
106
106
|
day: t,
|
|
107
|
-
onClick: () =>
|
|
107
|
+
onClick: () => p(t),
|
|
108
108
|
outsideCurrentMonth: n,
|
|
109
109
|
sx: {
|
|
110
110
|
"&.MuiPickersDay-root": {
|
|
@@ -119,11 +119,11 @@ const Z = {
|
|
|
119
119
|
}
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
),
|
|
122
|
+
), j = ({ icon: t, label: n }) => /* @__PURE__ */ o(c, { alignItems: "center", flexDirection: "row", sx: { gap: 6 }, children: [
|
|
123
123
|
/* @__PURE__ */ e(t, {}),
|
|
124
|
-
/* @__PURE__ */ e(
|
|
125
|
-
] }), xt =
|
|
126
|
-
const { recurring: t } =
|
|
124
|
+
/* @__PURE__ */ e(g, { variant: "XSmall", children: n })
|
|
125
|
+
] }), xt = D(() => {
|
|
126
|
+
const { recurring: t } = S();
|
|
127
127
|
return /* @__PURE__ */ o(
|
|
128
128
|
c,
|
|
129
129
|
{
|
|
@@ -134,26 +134,26 @@ const Z = {
|
|
|
134
134
|
justifyContent: "center",
|
|
135
135
|
mt: 12,
|
|
136
136
|
children: [
|
|
137
|
-
/* @__PURE__ */ e(
|
|
138
|
-
/* @__PURE__ */ e(
|
|
139
|
-
/* @__PURE__ */ e(
|
|
140
|
-
/* @__PURE__ */ e(
|
|
137
|
+
/* @__PURE__ */ e(j, { icon: xe, label: t.expense }),
|
|
138
|
+
/* @__PURE__ */ e(j, { icon: ye, label: t.income }),
|
|
139
|
+
/* @__PURE__ */ e(j, { icon: Ce, label: t.missed }),
|
|
140
|
+
/* @__PURE__ */ e(j, { icon: be, label: t.paid })
|
|
141
141
|
]
|
|
142
142
|
}
|
|
143
143
|
);
|
|
144
|
-
}),
|
|
145
|
-
const t =
|
|
146
|
-
|
|
147
|
-
),
|
|
148
|
-
l(
|
|
149
|
-
start:
|
|
150
|
-
end:
|
|
144
|
+
}), we = 58, ke = D(() => {
|
|
145
|
+
const t = pe(), { onEvent: n } = Z(), { selectedDay: i, setDateRange: a } = v(), [r, l] = h.useState(
|
|
146
|
+
Se(/* @__PURE__ */ new Date()) * H + we
|
|
147
|
+
), p = (s) => {
|
|
148
|
+
l(Se(s) * H + we), a({
|
|
149
|
+
start: W(s),
|
|
150
|
+
end: B(s)
|
|
151
151
|
}), n(w.RECURRING_TRANSACTIONS_CLICK_CALENDAR_RIGHT);
|
|
152
|
-
},
|
|
153
|
-
|
|
152
|
+
}, u = /* @__PURE__ */ e(
|
|
153
|
+
et,
|
|
154
154
|
{
|
|
155
|
-
minDate:
|
|
156
|
-
onMonthChange:
|
|
155
|
+
minDate: W(/* @__PURE__ */ new Date()),
|
|
156
|
+
onMonthChange: p,
|
|
157
157
|
showDaysOutsideCurrentMonth: !0,
|
|
158
158
|
slots: {
|
|
159
159
|
day: ft
|
|
@@ -184,11 +184,11 @@ const Z = {
|
|
|
184
184
|
minHeight: r
|
|
185
185
|
},
|
|
186
186
|
"&.MuiDateCalendar-root": {
|
|
187
|
-
minHeight: r +
|
|
187
|
+
minHeight: r + H
|
|
188
188
|
},
|
|
189
189
|
"& .MuiButtonBase-root, .MuiDayCalendar-weekDayLabel": {
|
|
190
|
-
height:
|
|
191
|
-
width:
|
|
190
|
+
height: H,
|
|
191
|
+
width: H,
|
|
192
192
|
margin: 0
|
|
193
193
|
},
|
|
194
194
|
"& .MuiDayCalendar-weekDayLabel": {
|
|
@@ -200,64 +200,64 @@ const Z = {
|
|
|
200
200
|
views: ["day"]
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
|
-
return /* @__PURE__ */ e(c, { justifyContent: "center", children: /* @__PURE__ */ o(
|
|
204
|
-
i &&
|
|
205
|
-
!i &&
|
|
203
|
+
return /* @__PURE__ */ e(c, { justifyContent: "center", children: /* @__PURE__ */ o(tt, { dateAdapter: Qe, children: [
|
|
204
|
+
i && u,
|
|
205
|
+
!i && u,
|
|
206
206
|
/* @__PURE__ */ e(xt, {})
|
|
207
207
|
] }) });
|
|
208
208
|
}), yt = (t) => {
|
|
209
209
|
if (t.type === M.Income)
|
|
210
|
-
return /* @__PURE__ */ e(
|
|
210
|
+
return /* @__PURE__ */ e(ye, {});
|
|
211
211
|
switch (t.status) {
|
|
212
|
-
case
|
|
213
|
-
return /* @__PURE__ */ e(
|
|
214
|
-
case
|
|
215
|
-
return /* @__PURE__ */ e(
|
|
212
|
+
case T.Missed:
|
|
213
|
+
return /* @__PURE__ */ e(Ce, {});
|
|
214
|
+
case T.Paid:
|
|
215
|
+
return /* @__PURE__ */ e(be, {});
|
|
216
216
|
default:
|
|
217
|
-
return /* @__PURE__ */ e(
|
|
217
|
+
return /* @__PURE__ */ e(xe, {});
|
|
218
218
|
}
|
|
219
219
|
}, Ct = (t, n) => {
|
|
220
220
|
switch (t.status) {
|
|
221
|
-
case
|
|
222
|
-
return t.expectedDate ?
|
|
221
|
+
case T.Paid:
|
|
222
|
+
return t.expectedDate ? O(
|
|
223
223
|
n.paid_on,
|
|
224
224
|
A(
|
|
225
225
|
t.occurredOnDate || t.expectedDate,
|
|
226
226
|
E.MONTH_DAY
|
|
227
227
|
)
|
|
228
228
|
) : n.paid;
|
|
229
|
-
case
|
|
230
|
-
return
|
|
229
|
+
case T.Missed:
|
|
230
|
+
return O(
|
|
231
231
|
n.missed_on,
|
|
232
232
|
A(t.expectedDate, E.MONTH_DAY)
|
|
233
233
|
);
|
|
234
|
-
case
|
|
235
|
-
return
|
|
234
|
+
case T.Upcoming:
|
|
235
|
+
return O(
|
|
236
236
|
n.upcoming_on,
|
|
237
237
|
A(t.expectedDate, E.MONTH_DAY)
|
|
238
238
|
);
|
|
239
239
|
default:
|
|
240
240
|
return n.unknown;
|
|
241
241
|
}
|
|
242
|
-
},
|
|
242
|
+
}, ve = ({
|
|
243
243
|
recurrence: t,
|
|
244
244
|
isMini: n = !1,
|
|
245
245
|
onRecurrenceClick: i = () => {
|
|
246
246
|
},
|
|
247
247
|
showOrdinal: a = !1
|
|
248
248
|
}) => {
|
|
249
|
-
const { recurring: r } =
|
|
250
|
-
() => l.find((
|
|
249
|
+
const { recurring: r } = S(), { repeatingTransactions: l } = v(), [p, u] = h.useState(!1), s = h.useMemo(
|
|
250
|
+
() => l.find((R) => R.guid === t.repeatingTransactionGuid),
|
|
251
251
|
[t, l]
|
|
252
|
-
), m = t.type === M.Income, f = t.status ===
|
|
252
|
+
), m = t.type === M.Income, f = t.status === T.Paid, x = t.status === T.Missed, C = t.status === T.Upcoming;
|
|
253
253
|
let y = r.paid?.toLowerCase();
|
|
254
|
-
return x ? y = r.missed?.toLowerCase() :
|
|
255
|
-
/* @__PURE__ */ o(
|
|
254
|
+
return x ? y = r.missed?.toLowerCase() : C && (y = a ? Ie(r, s || {}, !0) : Ie(r, s || {}, !1)), //TODO: implement common/components/ListItemRow.tsx
|
|
255
|
+
/* @__PURE__ */ o(Ge, { disableGutters: !0, disablePadding: !0, children: [
|
|
256
256
|
/* @__PURE__ */ o(dt, { onClick: () => {
|
|
257
|
-
|
|
257
|
+
u(!0), i(t);
|
|
258
258
|
}, children: [
|
|
259
259
|
/* @__PURE__ */ e(lt, { children: /* @__PURE__ */ e(
|
|
260
|
-
|
|
260
|
+
me,
|
|
261
261
|
{
|
|
262
262
|
categoryGuid: t.categoryGuid,
|
|
263
263
|
merchantGuid: t.merchantGuid
|
|
@@ -271,24 +271,24 @@ const Z = {
|
|
|
271
271
|
sx: { justifyContent: "space-between", textOverflow: "ellipsis", textWrap: "nowrap" },
|
|
272
272
|
children: [
|
|
273
273
|
/* @__PURE__ */ o(c, { direction: "column", width: "50%", children: [
|
|
274
|
-
/* @__PURE__ */ e(
|
|
274
|
+
/* @__PURE__ */ e(g, { bold: !0, variant: "body1", children: t.name }),
|
|
275
275
|
/* @__PURE__ */ e(c, { alignItems: "center", direction: "row", gap: 6, children: n ? /* @__PURE__ */ o(c, { direction: "row", gap: 4, children: [
|
|
276
276
|
yt(t),
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
] }) : /* @__PURE__ */ o(
|
|
277
|
+
/* @__PURE__ */ e(g, { variant: "caption", children: Ct(t, r) })
|
|
278
|
+
] }) : /* @__PURE__ */ o(Y, { children: [
|
|
279
279
|
t.institutionGuid && /* @__PURE__ */ e(
|
|
280
|
-
|
|
280
|
+
qe,
|
|
281
281
|
{
|
|
282
282
|
alt: t.institutionName,
|
|
283
283
|
institutionGuid: t.institutionGuid,
|
|
284
284
|
size: 12
|
|
285
285
|
}
|
|
286
286
|
),
|
|
287
|
-
/* @__PURE__ */ e(
|
|
287
|
+
/* @__PURE__ */ e(g, { sx: { maxWidth: 250 }, variant: "caption", children: t.institutionName })
|
|
288
288
|
] }) })
|
|
289
289
|
] }),
|
|
290
290
|
/* @__PURE__ */ o(c, { alignItems: "flex-end", width: "100%", children: [
|
|
291
|
-
/* @__PURE__ */ o(
|
|
291
|
+
/* @__PURE__ */ o(g, { bold: !0, color: m ? "success.main" : "text.primary", variant: "body1", children: [
|
|
292
292
|
m ? "+" : "",
|
|
293
293
|
L(t.amount, "0,0.00")
|
|
294
294
|
] }),
|
|
@@ -304,9 +304,9 @@ const Z = {
|
|
|
304
304
|
width: "100%"
|
|
305
305
|
},
|
|
306
306
|
children: [
|
|
307
|
-
f && /* @__PURE__ */ e(
|
|
308
|
-
x && /* @__PURE__ */ e(
|
|
309
|
-
/* @__PURE__ */ e(
|
|
307
|
+
f && /* @__PURE__ */ e(Ae, { color: "success", filled: !0, size: 12 }),
|
|
308
|
+
x && /* @__PURE__ */ e(Le, { color: "error", filled: !0, size: 12 }),
|
|
309
|
+
/* @__PURE__ */ e(g, { bold: !0, color: "text.secondary", variant: "caption", children: y })
|
|
310
310
|
]
|
|
311
311
|
}
|
|
312
312
|
)
|
|
@@ -316,23 +316,23 @@ const Z = {
|
|
|
316
316
|
) })
|
|
317
317
|
] }),
|
|
318
318
|
/* @__PURE__ */ e(
|
|
319
|
-
|
|
319
|
+
Ne,
|
|
320
320
|
{
|
|
321
321
|
ariaLabelClose: r.close_drawer_aria,
|
|
322
|
-
isOpen:
|
|
323
|
-
onClose: () =>
|
|
322
|
+
isOpen: p,
|
|
323
|
+
onClose: () => u(!1),
|
|
324
324
|
title: t.type === M.Income ? r.income_details : r.expense_details,
|
|
325
325
|
children: s && /* @__PURE__ */ e(
|
|
326
326
|
mt,
|
|
327
327
|
{
|
|
328
|
-
onDeleted: () =>
|
|
328
|
+
onDeleted: () => u(!1),
|
|
329
329
|
recurringTransaction: s
|
|
330
330
|
}
|
|
331
331
|
)
|
|
332
332
|
}
|
|
333
333
|
)
|
|
334
334
|
] });
|
|
335
|
-
},
|
|
335
|
+
}, z = D(
|
|
336
336
|
({
|
|
337
337
|
recurrences: t,
|
|
338
338
|
isMini: n = !1,
|
|
@@ -341,36 +341,36 @@ const Z = {
|
|
|
341
341
|
sx: r = {},
|
|
342
342
|
title: l
|
|
343
343
|
}) => {
|
|
344
|
-
const { recurring:
|
|
345
|
-
return /* @__PURE__ */ o(c, { sx: { gap: 8, mt: 4, ...r }, children: [
|
|
344
|
+
const { recurring: p } = S(), u = h.useMemo(() => ot(t), [t]);
|
|
345
|
+
return console.log(t, "recurrences"), console.log(u, "grouped recurrences"), /* @__PURE__ */ o(c, { sx: { gap: 8, mt: 4, ...r }, children: [
|
|
346
346
|
l && /* @__PURE__ */ o(
|
|
347
347
|
c,
|
|
348
348
|
{
|
|
349
349
|
sx: { alignItems: "top", direction: "row", justifyContent: "space-between", px: 24 },
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */ e(
|
|
352
|
-
i && /* @__PURE__ */ e(st, { onClick: i, sx: { mt: -12 }, variant: "text", children:
|
|
351
|
+
/* @__PURE__ */ e(g, { bold: !0, variant: "body1", children: l }),
|
|
352
|
+
i && /* @__PURE__ */ e(st, { onClick: i, sx: { mt: -12 }, variant: "text", children: p.reset })
|
|
353
353
|
]
|
|
354
354
|
}
|
|
355
355
|
),
|
|
356
|
-
t.length === 0 ? /* @__PURE__ */ e(
|
|
356
|
+
t.length === 0 ? /* @__PURE__ */ e(g, { fontStyle: "italic", sx: { py: 24, textAlign: "center" }, children: p.no_activities }) : /* @__PURE__ */ e(_e, { children: n ? t.map((s, m) => /* @__PURE__ */ o(h.Fragment, { children: [
|
|
357
357
|
/* @__PURE__ */ e(
|
|
358
|
-
|
|
358
|
+
ve,
|
|
359
359
|
{
|
|
360
360
|
isMini: n,
|
|
361
361
|
onRecurrenceClick: a,
|
|
362
362
|
recurrence: s
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
|
-
/* @__PURE__ */ e(
|
|
366
|
-
] }, `recurrence-${m}`)) :
|
|
367
|
-
/* @__PURE__ */ e(
|
|
368
|
-
|
|
365
|
+
/* @__PURE__ */ e(ce, { sx: { mx: 24 } })
|
|
366
|
+
] }, `recurrence-${m}`)) : u.map((s, m) => /* @__PURE__ */ o(h.Fragment, { children: [
|
|
367
|
+
/* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(
|
|
368
|
+
_e,
|
|
369
369
|
{
|
|
370
|
-
subheader: /* @__PURE__ */ e(ct, { sx: { bgcolor: "background.paper", ml: 8, pb: 4, pt: 12 }, children: /* @__PURE__ */ e(
|
|
370
|
+
subheader: /* @__PURE__ */ e(ct, { sx: { bgcolor: "background.paper", ml: 8, pb: 4, pt: 12 }, children: /* @__PURE__ */ e(g, { bold: !0, variant: "caption", children: A(s.date, E.DAY_OF_WEEK_MONTH_DAY) }) }),
|
|
371
371
|
sx: { width: "100%" },
|
|
372
372
|
children: s.recurrences.map((f, x) => /* @__PURE__ */ e(h.Fragment, { children: /* @__PURE__ */ e(
|
|
373
|
-
|
|
373
|
+
ve,
|
|
374
374
|
{
|
|
375
375
|
isMini: n,
|
|
376
376
|
onRecurrenceClick: a,
|
|
@@ -379,182 +379,192 @@ const Z = {
|
|
|
379
379
|
) }, `day-recurrence-${x}`))
|
|
380
380
|
}
|
|
381
381
|
) }, s.id),
|
|
382
|
-
/* @__PURE__ */ e(
|
|
382
|
+
/* @__PURE__ */ e(ce, { sx: { mx: 24 } })
|
|
383
383
|
] }, `recurrence-${m}`)) })
|
|
384
384
|
] });
|
|
385
385
|
}
|
|
386
|
-
),
|
|
387
|
-
({ expected: t, isExpense: n = !0, missed: i, paid: a, title: r, total: l, upcoming:
|
|
388
|
-
const
|
|
389
|
-
const x = [{ color:
|
|
390
|
-
return i && x.push({ color:
|
|
386
|
+
), Me = D(
|
|
387
|
+
({ expected: t, isExpense: n = !0, missed: i, paid: a, title: r, total: l, upcoming: p }) => {
|
|
388
|
+
const u = pe(), { isSmallMobile: s } = fe(), { recurring: m } = S(), f = h.useMemo(() => {
|
|
389
|
+
const x = [{ color: u.palette.success.main, percentage: `${a / t}` }];
|
|
390
|
+
return i && x.push({ color: u.palette.error.main, percentage: `${i / t}` }), x;
|
|
391
391
|
}, [a, t, i]);
|
|
392
|
-
return /* @__PURE__ */ o(c, {
|
|
392
|
+
return /* @__PURE__ */ o(c, { children: [
|
|
393
393
|
/* @__PURE__ */ o(c, { sx: { flexDirection: "row", justifyContent: "space-between", pb: 12 }, children: [
|
|
394
|
-
/* @__PURE__ */ e(
|
|
395
|
-
/* @__PURE__ */ e(
|
|
394
|
+
/* @__PURE__ */ e(g, { bold: !0, variant: "body1", children: `${r} (${l})` }),
|
|
395
|
+
/* @__PURE__ */ e(g, { bold: !0, color: n ? "text.primary" : "success.main", variant: "body1", children: `${n ? "-" : "+"}${L(t, "0,0.00")}` })
|
|
396
396
|
] }),
|
|
397
|
-
/* @__PURE__ */ e(
|
|
397
|
+
/* @__PURE__ */ e(Oe, { data: f, height: 12 }),
|
|
398
398
|
/* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 2, my: 8 }, children: [
|
|
399
|
-
/* @__PURE__ */ e(
|
|
400
|
-
!s && /* @__PURE__ */ e(
|
|
401
|
-
/* @__PURE__ */ e(
|
|
402
|
-
i !== void 0 && /* @__PURE__ */ o(
|
|
403
|
-
/* @__PURE__ */ e(
|
|
404
|
-
!s && /* @__PURE__ */ e(
|
|
405
|
-
/* @__PURE__ */ e(
|
|
399
|
+
/* @__PURE__ */ e(k, { sx: { bgcolor: "success.main", height: 8, mr: 8, width: 8 } }),
|
|
400
|
+
!s && /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: L(a, "0,0.00") }),
|
|
401
|
+
/* @__PURE__ */ e(g, { variant: "caption", children: m.paid?.toLowerCase() }),
|
|
402
|
+
i !== void 0 && /* @__PURE__ */ o(Y, { children: [
|
|
403
|
+
/* @__PURE__ */ e(k, { sx: { bgcolor: "error.main", height: 8, ml: 16, mr: 8, width: 8 } }),
|
|
404
|
+
!s && /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: L(i, "0,0.00") }),
|
|
405
|
+
/* @__PURE__ */ e(g, { variant: "caption", children: m.missed?.toLowerCase() })
|
|
406
406
|
] }),
|
|
407
|
-
/* @__PURE__ */ e(
|
|
408
|
-
!s && /* @__PURE__ */ e(
|
|
409
|
-
/* @__PURE__ */ e(
|
|
407
|
+
/* @__PURE__ */ e(k, { sx: { bgcolor: "divider", height: 8, ml: 16, mr: 8, width: 8 } }),
|
|
408
|
+
!s && /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: L(p, "0,0.00") }),
|
|
409
|
+
/* @__PURE__ */ e(g, { variant: "caption", children: m.upcoming })
|
|
410
410
|
] })
|
|
411
411
|
] });
|
|
412
412
|
}
|
|
413
|
-
), bt =
|
|
414
|
-
const { recurring: t } =
|
|
415
|
-
currentMonthExpenses:
|
|
416
|
-
currentMonthIncome:
|
|
413
|
+
), bt = D(() => {
|
|
414
|
+
const { recurring: t } = S(), { availableWidth: n } = Ee(), { isDesktop: i, isSmallMobile: a } = fe(n), { onEvent: r } = Z(), {
|
|
415
|
+
currentMonthExpenses: l,
|
|
416
|
+
currentMonthIncome: p,
|
|
417
417
|
dateRange: u,
|
|
418
|
-
expenseTotal:
|
|
419
|
-
incomeTotal:
|
|
420
|
-
missedExpenseTotal:
|
|
421
|
-
pastRecurrences:
|
|
422
|
-
paidExpenseTotal:
|
|
423
|
-
paidIncomeTotal:
|
|
424
|
-
selectedDay:
|
|
425
|
-
selectedDayRecurrences:
|
|
426
|
-
setDateRange:
|
|
427
|
-
upcomingExpenseTotal:
|
|
428
|
-
upcomingIncomeTotal:
|
|
429
|
-
upcomingRecurrences:
|
|
430
|
-
} = v(), [$,
|
|
431
|
-
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
transaction_guid:
|
|
418
|
+
expenseTotal: s,
|
|
419
|
+
incomeTotal: m,
|
|
420
|
+
missedExpenseTotal: f,
|
|
421
|
+
pastRecurrences: x,
|
|
422
|
+
paidExpenseTotal: C,
|
|
423
|
+
paidIncomeTotal: y,
|
|
424
|
+
selectedDay: d,
|
|
425
|
+
selectedDayRecurrences: R,
|
|
426
|
+
setDateRange: G,
|
|
427
|
+
upcomingExpenseTotal: Q,
|
|
428
|
+
upcomingIncomeTotal: ee,
|
|
429
|
+
upcomingRecurrences: U
|
|
430
|
+
} = v(), [$, te] = h.useState(0), I = Fe(u.start, /* @__PURE__ */ new Date()), ne = (b, re) => {
|
|
431
|
+
te(re);
|
|
432
|
+
}, _ = (b) => {
|
|
433
|
+
r(w.RECURRING_TRANSACTIONS_CLICK_UPCOMING, {
|
|
434
|
+
transaction_guid: b.transaction?.guid
|
|
435
435
|
});
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
transaction_guid:
|
|
436
|
+
}, F = (b) => {
|
|
437
|
+
r(w.RECURRING_TRANSACTIONS_CLICK_PAID, {
|
|
438
|
+
transaction_guid: b.transaction?.guid
|
|
439
439
|
});
|
|
440
|
-
},
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
start:
|
|
444
|
-
end:
|
|
440
|
+
}, ie = () => {
|
|
441
|
+
const b = Be(u.start, 1);
|
|
442
|
+
G({
|
|
443
|
+
start: W(b),
|
|
444
|
+
end: B(b)
|
|
445
445
|
});
|
|
446
|
-
},
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
start:
|
|
450
|
-
end:
|
|
446
|
+
}, P = () => {
|
|
447
|
+
const b = Ue(u.start, 1);
|
|
448
|
+
G({
|
|
449
|
+
start: W(b),
|
|
450
|
+
end: B(b)
|
|
451
451
|
});
|
|
452
452
|
};
|
|
453
|
-
return /* @__PURE__ */ o(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
453
|
+
return /* @__PURE__ */ o(
|
|
454
|
+
ae,
|
|
455
|
+
{
|
|
456
|
+
container: !0,
|
|
457
|
+
sx: {
|
|
458
|
+
pt: 16,
|
|
459
|
+
px: i ? 48 : 24
|
|
460
|
+
},
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ e(ae, { md: !0, sm: 12, width: "100%", children: /* @__PURE__ */ o(c, { sx: { gap: 16 }, children: [
|
|
463
|
+
/* @__PURE__ */ o(c, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
464
|
+
/* @__PURE__ */ e(Je, { children: O(
|
|
465
|
+
t.header_title,
|
|
466
|
+
A(u.start, E.MONTH_LONG)
|
|
467
|
+
) }),
|
|
468
|
+
!i && /* @__PURE__ */ o(c, { direction: "row", gap: 4, children: [
|
|
469
|
+
/* @__PURE__ */ e(
|
|
470
|
+
Te,
|
|
471
|
+
{
|
|
472
|
+
color: "primary",
|
|
473
|
+
disabled: I,
|
|
474
|
+
onClick: P,
|
|
475
|
+
children: /* @__PURE__ */ e(Ve, {})
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
/* @__PURE__ */ e(Te, { color: "primary", onClick: ie, children: /* @__PURE__ */ e(Xe, {}) })
|
|
479
|
+
] })
|
|
480
|
+
] }),
|
|
461
481
|
/* @__PURE__ */ e(
|
|
462
|
-
|
|
482
|
+
Me,
|
|
463
483
|
{
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
expected: s,
|
|
485
|
+
missed: f,
|
|
486
|
+
paid: C,
|
|
487
|
+
title: t.expenses,
|
|
488
|
+
total: l.length,
|
|
489
|
+
upcoming: Q
|
|
468
490
|
}
|
|
469
491
|
),
|
|
470
|
-
/* @__PURE__ */ e(be, { color: "primary", onClick: te, children: /* @__PURE__ */ e(Ve, {}) })
|
|
471
|
-
] })
|
|
472
|
-
] }),
|
|
473
|
-
/* @__PURE__ */ e(
|
|
474
|
-
we,
|
|
475
|
-
{
|
|
476
|
-
expected: g,
|
|
477
|
-
missed: m,
|
|
478
|
-
paid: x,
|
|
479
|
-
title: t.expenses,
|
|
480
|
-
total: r.length,
|
|
481
|
-
upcoming: W
|
|
482
|
-
}
|
|
483
|
-
),
|
|
484
|
-
/* @__PURE__ */ e(
|
|
485
|
-
we,
|
|
486
|
-
{
|
|
487
|
-
expected: s,
|
|
488
|
-
isExpense: !1,
|
|
489
|
-
paid: b,
|
|
490
|
-
title: t.deposits,
|
|
491
|
-
total: l.length,
|
|
492
|
-
upcoming: J
|
|
493
|
-
}
|
|
494
|
-
),
|
|
495
|
-
n && /* @__PURE__ */ e(
|
|
496
|
-
H,
|
|
497
|
-
{
|
|
498
|
-
onRecurrenceClick: U,
|
|
499
|
-
recurrences: B,
|
|
500
|
-
title: t.upcoming_activity
|
|
501
|
-
}
|
|
502
|
-
),
|
|
503
|
-
!n && /* @__PURE__ */ o(c, { children: [
|
|
504
|
-
/* @__PURE__ */ o(Fe, { onChange: I, value: $, variant: "fullWidth", children: [
|
|
505
492
|
/* @__PURE__ */ e(
|
|
506
|
-
|
|
493
|
+
Me,
|
|
494
|
+
{
|
|
495
|
+
expected: m,
|
|
496
|
+
isExpense: !1,
|
|
497
|
+
paid: y,
|
|
498
|
+
title: t.deposits,
|
|
499
|
+
total: p.length,
|
|
500
|
+
upcoming: ee
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
i && /* @__PURE__ */ e(
|
|
504
|
+
z,
|
|
507
505
|
{
|
|
508
|
-
|
|
506
|
+
onRecurrenceClick: _,
|
|
507
|
+
recurrences: U,
|
|
508
|
+
title: t.upcoming_activity
|
|
509
509
|
}
|
|
510
510
|
),
|
|
511
|
+
!i && /* @__PURE__ */ o(c, { children: [
|
|
512
|
+
/* @__PURE__ */ o(je, { onChange: ne, value: $, variant: "fullWidth", children: [
|
|
513
|
+
/* @__PURE__ */ e(
|
|
514
|
+
De,
|
|
515
|
+
{
|
|
516
|
+
label: /* @__PURE__ */ e(g, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: a ? t.upcoming : t.upcoming_activity })
|
|
517
|
+
}
|
|
518
|
+
),
|
|
519
|
+
/* @__PURE__ */ e(
|
|
520
|
+
De,
|
|
521
|
+
{
|
|
522
|
+
label: /* @__PURE__ */ e(g, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: a ? t.past : t.past_transactions })
|
|
523
|
+
}
|
|
524
|
+
)
|
|
525
|
+
] }),
|
|
526
|
+
$ === 0 && /* @__PURE__ */ e(
|
|
527
|
+
z,
|
|
528
|
+
{
|
|
529
|
+
onRecurrenceClick: _,
|
|
530
|
+
recurrences: U
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
$ === 1 && /* @__PURE__ */ e(
|
|
534
|
+
z,
|
|
535
|
+
{
|
|
536
|
+
onRecurrenceClick: F,
|
|
537
|
+
recurrences: x
|
|
538
|
+
}
|
|
539
|
+
)
|
|
540
|
+
] })
|
|
541
|
+
] }) }),
|
|
542
|
+
i && /* @__PURE__ */ e(ae, { sx: { minWidth: 450 }, xs: "auto", children: /* @__PURE__ */ o(c, { gap: 24, children: [
|
|
543
|
+
/* @__PURE__ */ e(ke, {}),
|
|
511
544
|
/* @__PURE__ */ e(
|
|
512
|
-
|
|
545
|
+
z,
|
|
513
546
|
{
|
|
514
|
-
|
|
547
|
+
onRecurrenceClick: F,
|
|
548
|
+
recurrences: R || x,
|
|
549
|
+
title: d ? O(
|
|
550
|
+
t.day_transactions,
|
|
551
|
+
A(d, E.MONTH_DAY)
|
|
552
|
+
) : t.past_transactions
|
|
515
553
|
}
|
|
516
554
|
)
|
|
517
|
-
] })
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
),
|
|
525
|
-
$ === 1 && /* @__PURE__ */ e(
|
|
526
|
-
H,
|
|
527
|
-
{
|
|
528
|
-
onRecurrenceClick: _,
|
|
529
|
-
recurrences: f
|
|
530
|
-
}
|
|
531
|
-
)
|
|
532
|
-
] })
|
|
533
|
-
] }) }),
|
|
534
|
-
n && /* @__PURE__ */ e(oe, { sx: { minWidth: 450 }, xs: "auto", children: /* @__PURE__ */ o(c, { gap: 24, children: [
|
|
535
|
-
/* @__PURE__ */ e(Ne, {}),
|
|
536
|
-
/* @__PURE__ */ e(
|
|
537
|
-
H,
|
|
538
|
-
{
|
|
539
|
-
onRecurrenceClick: _,
|
|
540
|
-
recurrences: d || f,
|
|
541
|
-
title: y ? N(
|
|
542
|
-
t.day_transactions,
|
|
543
|
-
A(y, E.MONTH_DAY)
|
|
544
|
-
) : t.past_transactions
|
|
545
|
-
}
|
|
546
|
-
)
|
|
547
|
-
] }) })
|
|
548
|
-
] });
|
|
549
|
-
}), _n = T(({ onBackClick: t, sx: n = {} }) => {
|
|
550
|
-
const { accounts: i } = pe(), { recurring: a } = D(), { isCopyLoaded: r, isInitialized: l, selectedAccountGuids: u, setSelectedAccounts: g } = V(), { isDataLoaded: s, loadRepeatingTransactions: m, setDateRange: f } = v(), { setFilter: x } = ge(), { onEvent: b } = X(), [y, d] = h.useState(!1);
|
|
555
|
+
] }) })
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}), _n = D(({ onBackClick: t, sx: n = {} }) => {
|
|
560
|
+
const { accounts: i } = ge(), { recurring: a } = S(), { isCopyLoaded: r, isInitialized: l, selectedAccountGuids: p, setSelectedAccounts: u } = X(), { isDataLoaded: s, loadRepeatingTransactions: m, setDateRange: f } = v(), { setFilter: x } = he(), { onEvent: C } = Z(), { isMobile: y } = fe(), [d, R] = h.useState(!1);
|
|
551
561
|
return h.useEffect(() => {
|
|
552
|
-
|
|
562
|
+
u(i);
|
|
553
563
|
}, [i]), h.useEffect(() => {
|
|
554
564
|
l && (x({
|
|
555
|
-
dateRange: { start: de(
|
|
556
|
-
accounts:
|
|
557
|
-
}), f({ start:
|
|
565
|
+
dateRange: { start: ue(de(), 90), end: le() },
|
|
566
|
+
accounts: p
|
|
567
|
+
}), f({ start: W(/* @__PURE__ */ new Date()), end: B(/* @__PURE__ */ new Date()) }), m().finally());
|
|
558
568
|
}, [l]), r ? /* @__PURE__ */ o(
|
|
559
569
|
at,
|
|
560
570
|
{
|
|
@@ -564,64 +574,65 @@ const Z = {
|
|
|
564
574
|
label: a.action_title,
|
|
565
575
|
iconName: "credit_card_gear",
|
|
566
576
|
onClick: () => {
|
|
567
|
-
|
|
577
|
+
R(!0), C(w.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
|
|
568
578
|
}
|
|
569
579
|
}
|
|
570
580
|
],
|
|
571
|
-
|
|
581
|
+
hasDivider: y,
|
|
582
|
+
onAccountsFilterClick: () => C(w.RECURRING_TRANSACTIONS_CLICK_FILTER),
|
|
572
583
|
onBackClick: t,
|
|
573
584
|
sx: n,
|
|
574
585
|
title: a.title,
|
|
575
586
|
children: [
|
|
576
587
|
l && s ? /* @__PURE__ */ e(bt, {}) : /* @__PURE__ */ o(c, { direction: "column", p: 48, spacing: 24, children: [
|
|
577
|
-
/* @__PURE__ */ e(
|
|
578
|
-
/* @__PURE__ */ e(
|
|
579
|
-
/* @__PURE__ */ e(
|
|
588
|
+
/* @__PURE__ */ e(oe, { height: 100, variant: "rounded", width: "100%" }),
|
|
589
|
+
/* @__PURE__ */ e(oe, { height: 100, variant: "rounded", width: "100%" }),
|
|
590
|
+
/* @__PURE__ */ e(oe, { height: 600, variant: "rounded", width: "100%" })
|
|
580
591
|
] }),
|
|
581
592
|
/* @__PURE__ */ e(
|
|
582
|
-
|
|
593
|
+
Ne,
|
|
583
594
|
{
|
|
584
595
|
ariaLabelClose: a.close_drawer_aria,
|
|
585
|
-
isOpen:
|
|
586
|
-
onClose: () =>
|
|
596
|
+
isOpen: d,
|
|
597
|
+
onClose: () => R(!1),
|
|
587
598
|
shouldShowHeaderBorders: !1,
|
|
588
599
|
title: a.action_title,
|
|
589
|
-
children: /* @__PURE__ */ e(
|
|
600
|
+
children: /* @__PURE__ */ e(ze, {})
|
|
590
601
|
}
|
|
591
602
|
)
|
|
592
603
|
]
|
|
593
604
|
}
|
|
594
|
-
) : /* @__PURE__ */ e(
|
|
595
|
-
}), Rt =
|
|
596
|
-
const { recurring: t } =
|
|
597
|
-
return /* @__PURE__ */ o(c, { flexDirection:
|
|
598
|
-
/* @__PURE__ */ e(
|
|
599
|
-
!
|
|
605
|
+
) : /* @__PURE__ */ e(K, {});
|
|
606
|
+
}), Rt = D(() => {
|
|
607
|
+
const { recurring: t } = S(), { availableWidth: n } = Ee(), { selectedDay: i, selectedDayRecurrences: a, setSelectedDay: r, upcomingRecurrences: l } = v(), p = n < 750;
|
|
608
|
+
return /* @__PURE__ */ o(c, { flexDirection: p ? "column" : "row", width: "100%", children: [
|
|
609
|
+
/* @__PURE__ */ e(ke, {}),
|
|
610
|
+
!p && /* @__PURE__ */ e(ce, { flexItem: !0, orientation: "vertical", sx: { my: 16, ml: 16 } }),
|
|
600
611
|
/* @__PURE__ */ e(
|
|
601
|
-
|
|
612
|
+
z,
|
|
602
613
|
{
|
|
603
614
|
isMini: !0,
|
|
604
615
|
onResetClick: i ? () => r(i) : void 0,
|
|
605
616
|
recurrences: a || l.slice(0, 5),
|
|
606
|
-
sx: { width:
|
|
607
|
-
title: i ?
|
|
617
|
+
sx: { width: p ? "100%" : "calc(100% - 336px)", mt: 12 },
|
|
618
|
+
title: i ? O(
|
|
608
619
|
t.day_transactions,
|
|
609
620
|
A(i, E.MONTH_DAY)
|
|
610
621
|
) : t.upcoming_activity
|
|
611
622
|
}
|
|
612
623
|
)
|
|
613
624
|
] });
|
|
614
|
-
}), wn =
|
|
625
|
+
}), wn = D(
|
|
615
626
|
({ onPrimaryCtaClick: t, sx: n }) => {
|
|
616
|
-
const { accounts: i } =
|
|
627
|
+
const { accounts: i } = ge(), { recurring: a } = S(), { setFilter: r } = he(), { isDataLoaded: l, loadRepeatingTransactions: p } = v(), { isCopyLoaded: u, isInitialized: s, setSelectedAccounts: m, selectedAccountGuids: f } = X();
|
|
617
628
|
return h.useEffect(() => {
|
|
618
629
|
s && m(i);
|
|
619
630
|
}, [s]), h.useEffect(() => {
|
|
620
631
|
f.length > 0 && (r({
|
|
621
|
-
dateRange: { start: de(
|
|
632
|
+
dateRange: { start: ue(de(), 90), end: le() },
|
|
622
633
|
accounts: f
|
|
623
|
-
}),
|
|
624
|
-
}, [f]), !
|
|
634
|
+
}), p().finally());
|
|
635
|
+
}, [f]), !u || !s ? /* @__PURE__ */ e(K, {}) : /* @__PURE__ */ e(
|
|
625
636
|
pt,
|
|
626
637
|
{
|
|
627
638
|
className: "mx-exp-recurring-transactions-miniwidget",
|
|
@@ -630,7 +641,7 @@ const Z = {
|
|
|
630
641
|
subTitle: a.sub_title,
|
|
631
642
|
sx: n,
|
|
632
643
|
title: a.mini_title,
|
|
633
|
-
children: l ? /* @__PURE__ */ e(Rt, {}) : /* @__PURE__ */ e(
|
|
644
|
+
children: l ? /* @__PURE__ */ e(Rt, {}) : /* @__PURE__ */ e(K, {})
|
|
634
645
|
}
|
|
635
646
|
);
|
|
636
647
|
}
|
|
@@ -638,7 +649,7 @@ const Z = {
|
|
|
638
649
|
upcomingRecurrences: t,
|
|
639
650
|
maxLogos: n = 3
|
|
640
651
|
}) => /* @__PURE__ */ e(c, { sx: { flexDirection: "row", gap: 4 }, children: t?.slice(0, n).map((i, a) => /* @__PURE__ */ e(
|
|
641
|
-
|
|
652
|
+
me,
|
|
642
653
|
{
|
|
643
654
|
categoryGuid: i.categoryGuid || "",
|
|
644
655
|
merchantGuid: i.merchantGuid || ""
|
|
@@ -651,14 +662,14 @@ const Z = {
|
|
|
651
662
|
}) => {
|
|
652
663
|
const a = (r) => r * (n / 2);
|
|
653
664
|
return /* @__PURE__ */ e(
|
|
654
|
-
|
|
665
|
+
k,
|
|
655
666
|
{
|
|
656
667
|
sx: {
|
|
657
668
|
position: "relative",
|
|
658
669
|
width: 64
|
|
659
670
|
},
|
|
660
671
|
children: t.map((r, l) => l < i ? /* @__PURE__ */ e(
|
|
661
|
-
|
|
672
|
+
k,
|
|
662
673
|
{
|
|
663
674
|
sx: {
|
|
664
675
|
borderRadius: "4px",
|
|
@@ -669,7 +680,7 @@ const Z = {
|
|
|
669
680
|
position: "absolute"
|
|
670
681
|
},
|
|
671
682
|
children: /* @__PURE__ */ e(
|
|
672
|
-
|
|
683
|
+
me,
|
|
673
684
|
{
|
|
674
685
|
categoryGuid: r.categoryGuid || "",
|
|
675
686
|
merchantGuid: r.merchantGuid || "",
|
|
@@ -689,7 +700,7 @@ const Z = {
|
|
|
689
700
|
label: r
|
|
690
701
|
}) => /* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
|
691
702
|
/* @__PURE__ */ e(
|
|
692
|
-
|
|
703
|
+
k,
|
|
693
704
|
{
|
|
694
705
|
sx: {
|
|
695
706
|
borderRadius: "2px",
|
|
@@ -700,99 +711,99 @@ const Z = {
|
|
|
700
711
|
}
|
|
701
712
|
),
|
|
702
713
|
/* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
|
|
703
|
-
!a && /* @__PURE__ */ e(
|
|
704
|
-
/* @__PURE__ */ e(
|
|
714
|
+
!a && /* @__PURE__ */ e(g, { bold: !0, variant: "caption", children: L(t, t === 0 || !i ? "0,0" : "0,0.00") }),
|
|
715
|
+
/* @__PURE__ */ e(g, { variant: "caption", children: r })
|
|
705
716
|
] })
|
|
706
|
-
] }), It =
|
|
707
|
-
const { recurring: t } =
|
|
717
|
+
] }), It = D(() => {
|
|
718
|
+
const { recurring: t } = S();
|
|
708
719
|
return /* @__PURE__ */ o(c, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
709
|
-
/* @__PURE__ */ e(
|
|
720
|
+
/* @__PURE__ */ e(Ze, { size: 32 }),
|
|
710
721
|
/* @__PURE__ */ o(c, { children: [
|
|
711
|
-
/* @__PURE__ */ e(
|
|
712
|
-
/* @__PURE__ */ e(
|
|
722
|
+
/* @__PURE__ */ e(se, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
|
|
723
|
+
/* @__PURE__ */ e(se, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
|
|
713
724
|
] })
|
|
714
725
|
] });
|
|
715
|
-
}), vn =
|
|
726
|
+
}), vn = D(
|
|
716
727
|
({ onCTAClick: t }) => {
|
|
717
|
-
const [n, i] = h.useState(!1), { onEvent: a } =
|
|
718
|
-
loadRepeatingTransactions:
|
|
728
|
+
const [n, i] = h.useState(!1), { onEvent: a } = Z(), r = pe(), { accounts: l } = ge(), [p, { width: u }] = gt(), { isCopyLoaded: s, isInitialized: m, selectedAccountGuids: f, setSelectedAccounts: x } = X(), {
|
|
729
|
+
loadRepeatingTransactions: C,
|
|
719
730
|
upcomingRecurrences: y,
|
|
720
731
|
expenseTotal: d,
|
|
721
|
-
missedExpenseTotal:
|
|
722
|
-
paidExpenseTotal:
|
|
723
|
-
repeatingTransactions:
|
|
724
|
-
setDateRange:
|
|
725
|
-
upcomingExpenseTotal:
|
|
726
|
-
isDataLoaded:
|
|
727
|
-
} = v(), { setFilter:
|
|
732
|
+
missedExpenseTotal: R,
|
|
733
|
+
paidExpenseTotal: G,
|
|
734
|
+
repeatingTransactions: Q,
|
|
735
|
+
setDateRange: ee,
|
|
736
|
+
upcomingExpenseTotal: U,
|
|
737
|
+
isDataLoaded: $
|
|
738
|
+
} = v(), { setFilter: te } = he(), { recurring: I, budgets: ne } = S();
|
|
728
739
|
h.useEffect(() => {
|
|
729
740
|
x(l);
|
|
730
741
|
}, [l]), h.useEffect(() => {
|
|
731
|
-
m && (
|
|
732
|
-
dateRange: { start: de(
|
|
742
|
+
m && (te({
|
|
743
|
+
dateRange: { start: ue(de(), 90), end: le() },
|
|
733
744
|
accounts: f
|
|
734
|
-
}),
|
|
745
|
+
}), ee({ start: W(/* @__PURE__ */ new Date()), end: B(/* @__PURE__ */ new Date()) }), C().finally(), i(!0));
|
|
735
746
|
}, [m]), h.useEffect(() => {
|
|
736
747
|
n && a(w.RECURRING_TRANSACTIONS_LOAD_WIDGET, {
|
|
737
748
|
state: y.length > 0 ? "default" : "zeroState"
|
|
738
749
|
});
|
|
739
750
|
}, [n]);
|
|
740
|
-
const _ =
|
|
741
|
-
const
|
|
742
|
-
{ color: r.palette.success.main, percentage: `${
|
|
751
|
+
const _ = u <= 288, F = u >= 450, ie = h.useMemo(() => {
|
|
752
|
+
const N = [
|
|
753
|
+
{ color: r.palette.success.main, percentage: `${G / d}` }
|
|
743
754
|
];
|
|
744
|
-
return
|
|
755
|
+
return R && N.push({
|
|
745
756
|
color: r.palette.error.main,
|
|
746
|
-
percentage: `${
|
|
747
|
-
}),
|
|
757
|
+
percentage: `${R / d}`
|
|
758
|
+
}), N;
|
|
748
759
|
}, [
|
|
749
|
-
|
|
760
|
+
G,
|
|
750
761
|
d,
|
|
751
|
-
|
|
762
|
+
R,
|
|
752
763
|
r.palette.success.main,
|
|
753
764
|
r.palette.error.main
|
|
754
|
-
]),
|
|
765
|
+
]), P = h.useMemo(() => L(d, d === 0 ? "0,0" : "0,0.00"), [d]), b = () => {
|
|
755
766
|
a(
|
|
756
767
|
y.length > 0 ? w.RECURRING_TRANSACTIONS_CLICK_GET_STARTED : w.RECURRING_TRANSACTIONS_CLICK_VIEW_ALL
|
|
757
768
|
), t();
|
|
758
769
|
};
|
|
759
|
-
if (!s || !n ||
|
|
760
|
-
const
|
|
770
|
+
if (!s || !n || !$) return /* @__PURE__ */ e(K, { height: 100 });
|
|
771
|
+
const re = 32, We = y.length > 0, $e = () => We ? _ ? /* @__PURE__ */ e(
|
|
761
772
|
Dt,
|
|
762
773
|
{
|
|
763
|
-
logoSize:
|
|
774
|
+
logoSize: re,
|
|
764
775
|
maxLogos: 3,
|
|
765
776
|
upcomingRecurrences: y.slice(0, 3)
|
|
766
777
|
}
|
|
767
|
-
) : /* @__PURE__ */ e(Tt, { maxLogos: 3, upcomingRecurrences: y.slice(0, 3) }) : /* @__PURE__ */ e(c, { sx: { width: _ ? 64 : 104 } }),
|
|
778
|
+
) : /* @__PURE__ */ e(Tt, { maxLogos: 3, upcomingRecurrences: y.slice(0, 3) }) : /* @__PURE__ */ e(c, { sx: { width: _ ? 64 : 104 } }), Pe = [
|
|
768
779
|
{
|
|
769
|
-
amount:
|
|
780
|
+
amount: G,
|
|
770
781
|
bgColor: "success.main",
|
|
771
782
|
label: I.paid
|
|
772
783
|
},
|
|
773
784
|
{
|
|
774
|
-
amount:
|
|
785
|
+
amount: R,
|
|
775
786
|
bgColor: "error.main",
|
|
776
787
|
label: I.missed
|
|
777
788
|
},
|
|
778
789
|
{
|
|
779
|
-
amount:
|
|
790
|
+
amount: U,
|
|
780
791
|
bgColor: "border.light",
|
|
781
792
|
label: I.upcoming
|
|
782
793
|
}
|
|
783
|
-
],
|
|
794
|
+
], Re = !Q?.length;
|
|
784
795
|
return /* @__PURE__ */ e(
|
|
785
796
|
ht,
|
|
786
797
|
{
|
|
787
798
|
className: "mx-recurring-transaction-microwidget",
|
|
788
|
-
ctaLabel:
|
|
789
|
-
onCTAClick:
|
|
799
|
+
ctaLabel: Re ? ne.get_started_cta : I.primary_cta,
|
|
800
|
+
onCTAClick: b,
|
|
790
801
|
title: I.recurring_expenses,
|
|
791
|
-
children:
|
|
802
|
+
children: Re ? /* @__PURE__ */ e(It, {}) : /* @__PURE__ */ o(Y, { children: [
|
|
792
803
|
/* @__PURE__ */ o(
|
|
793
804
|
c,
|
|
794
805
|
{
|
|
795
|
-
ref:
|
|
806
|
+
ref: p,
|
|
796
807
|
sx: {
|
|
797
808
|
flexDirection: "row",
|
|
798
809
|
justifyContent: "space-between"
|
|
@@ -802,7 +813,7 @@ const Z = {
|
|
|
802
813
|
c,
|
|
803
814
|
{
|
|
804
815
|
sx: [
|
|
805
|
-
|
|
816
|
+
P.length >= 10 && _ ? { flexDirection: "column" } : { flexDirection: "row", gap: 2 },
|
|
806
817
|
{
|
|
807
818
|
alignItems: "baseline",
|
|
808
819
|
overflow: "hidden",
|
|
@@ -812,15 +823,15 @@ const Z = {
|
|
|
812
823
|
],
|
|
813
824
|
children: [
|
|
814
825
|
/* @__PURE__ */ e(
|
|
815
|
-
|
|
826
|
+
g,
|
|
816
827
|
{
|
|
817
828
|
sx: { width: "100%" },
|
|
818
|
-
variant:
|
|
819
|
-
children:
|
|
829
|
+
variant: P.length >= 10 && _ ? "H3" : "H2",
|
|
830
|
+
children: P
|
|
820
831
|
}
|
|
821
832
|
),
|
|
822
833
|
/* @__PURE__ */ e(
|
|
823
|
-
|
|
834
|
+
se,
|
|
824
835
|
{
|
|
825
836
|
sx: {
|
|
826
837
|
pr: 12
|
|
@@ -832,12 +843,12 @@ const Z = {
|
|
|
832
843
|
]
|
|
833
844
|
}
|
|
834
845
|
),
|
|
835
|
-
|
|
846
|
+
$e()
|
|
836
847
|
]
|
|
837
848
|
}
|
|
838
849
|
),
|
|
839
850
|
/* @__PURE__ */ o(c, { sx: { pt: 12 }, children: [
|
|
840
|
-
/* @__PURE__ */ e(
|
|
851
|
+
/* @__PURE__ */ e(Oe, { data: ie }),
|
|
841
852
|
/* @__PURE__ */ e(
|
|
842
853
|
c,
|
|
843
854
|
{
|
|
@@ -847,16 +858,16 @@ const Z = {
|
|
|
847
858
|
gap: 16,
|
|
848
859
|
mt: 4
|
|
849
860
|
},
|
|
850
|
-
children:
|
|
861
|
+
children: Pe.map((N, He) => /* @__PURE__ */ e(
|
|
851
862
|
St,
|
|
852
863
|
{
|
|
853
|
-
amount:
|
|
854
|
-
bgcolor:
|
|
855
|
-
isLargeScreen:
|
|
864
|
+
amount: N.amount,
|
|
865
|
+
bgcolor: N.bgColor,
|
|
866
|
+
isLargeScreen: F,
|
|
856
867
|
isSmallScreen: _,
|
|
857
|
-
label:
|
|
868
|
+
label: N.label
|
|
858
869
|
},
|
|
859
|
-
`recurrence-legend-${
|
|
870
|
+
`recurrence-legend-${He}`
|
|
860
871
|
))
|
|
861
872
|
}
|
|
862
873
|
)
|
|
@@ -870,7 +881,7 @@ export {
|
|
|
870
881
|
On as AddRecurringTransactionDetails,
|
|
871
882
|
An as ManageExpenses,
|
|
872
883
|
kn as ManageIncome,
|
|
873
|
-
|
|
884
|
+
ze as RecurringSettings,
|
|
874
885
|
vn as RecurringTransactionsMicroWidget,
|
|
875
886
|
wn as RecurringTransactionsMiniWidget,
|
|
876
887
|
Gn as RecurringTransactionsStore,
|