@mx-cartographer/experiences 7.0.25-alpha-recurring-transactions-css-bug-ram4 → 7.0.25-alpha-recurring-transactions-css-bug-ram6
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/dist/recurringtransactions/index.es.js +297 -292
- package/package.json +1 -1
|
@@ -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
3
|
import { observer as T } from "mobx-react-lite";
|
|
4
|
-
import { endOfMonth as
|
|
5
|
-
import { endOfToday as
|
|
6
|
-
import { startOfMonth as
|
|
7
|
-
import { startOfToday as
|
|
8
|
-
import { subDays as
|
|
9
|
-
import
|
|
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-Dj29piAQ.mjs";
|
|
12
12
|
import { M as An } from "../RecurringSettings-Dj29piAQ.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 D, a as
|
|
32
|
-
import { c as M, a as R, g 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 Re from "@mui/material/IconButton";
|
|
18
|
+
import Te from "@mui/material/Tab";
|
|
19
|
+
import je from "@mui/material/Tabs";
|
|
20
|
+
import { Schedule as Ke, MonetizationOn as Ye, Cancel as Me, CheckCircle as Le, 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 De } 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 D, a as X, h as v, e as Z, p as Ae, c as ge, f as he } from "../hooks-DkUqN6JE.mjs";
|
|
32
|
+
import { c as M, a as R, g as Se, 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 as at } from "../WidgetContainer-CdBs9WOZ.mjs";
|
|
36
36
|
import st from "@mui/material/Button";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
37
|
+
import ce from "@mui/material/Divider";
|
|
38
|
+
import Ie from "@mui/material/List";
|
|
39
|
+
import Ee 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-DbsiKUoO.mjs";
|
|
45
45
|
import { c as On, M as kn, S as Wn } from "../ManageIncome-DbsiKUoO.mjs";
|
|
46
46
|
import { f as L } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
47
|
-
import { D as
|
|
48
|
-
import { b as
|
|
47
|
+
import { D as Ge } 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 Ne } from "../StatusBar-BK_uYHAB.mjs";
|
|
52
|
+
import { u as Oe } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
53
|
+
import { L as K } from "../Loader-DUaFpDGv.mjs";
|
|
54
54
|
import { M as pt } from "../MiniWidgetContainer-CTyjmE1h.mjs";
|
|
55
55
|
import { u as gt } from "../useDimensions-27p2evRx.mjs";
|
|
56
56
|
import { M as ht } from "../MicroWidgetContainer-Dxz8uBN9.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, fe = ({ 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 } }) }), xe = ({ 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
|
+
) }), ye = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(V, { size: n, sx: { ...J(t) }, children: /* @__PURE__ */ e(Me, { color: "error", filled: !0, sx: { fontSize: n, ...q } }) }), Ce = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(V, { size: n, sx: { ...J(t) }, children: /* @__PURE__ */ e(Le, { color: "success", filled: !0, sx: { fontSize: n, ...q } }) }), ft = T(
|
|
68
68
|
({ day: t, outsideCurrentMonth: n, ...i }) => {
|
|
69
|
-
const { recurring: a } = D(), { selectedAccountGuids: r } =
|
|
69
|
+
const { recurring: a } = D(), { 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
75
|
(d) => d.type !== M.Income && d.status === R.Upcoming
|
|
76
76
|
), f = s.some(
|
|
77
77
|
(d) => d.type !== M.Income && d.status === R.Missed
|
|
78
78
|
), x = s.some(
|
|
79
79
|
(d) => d.type !== M.Income && d.status === R.Paid
|
|
80
|
-
),
|
|
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(ye, { isOffset: !0 }),
|
|
86
|
+
x && /* @__PURE__ */ e(Ce, { isOffset: !0 }),
|
|
87
|
+
m && /* @__PURE__ */ e(fe, { isOffset: !0 }),
|
|
88
|
+
C && /* @__PURE__ */ e(xe, { 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,9 +119,9 @@ 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(
|
|
124
|
+
/* @__PURE__ */ e(g, { variant: "XSmall", children: n })
|
|
125
125
|
] }), xt = T(() => {
|
|
126
126
|
const { recurring: t } = D();
|
|
127
127
|
return /* @__PURE__ */ o(
|
|
@@ -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: fe, label: t.expense }),
|
|
138
|
+
/* @__PURE__ */ e(j, { icon: xe, label: t.income }),
|
|
139
|
+
/* @__PURE__ */ e(j, { icon: ye, label: t.missed }),
|
|
140
|
+
/* @__PURE__ */ e(j, { icon: Ce, 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 = T(() => {
|
|
145
|
+
const t = pe(), { onEvent: n } = Z(), { selectedDay: i, setDateRange: a } = v(), [r, l] = h.useState(
|
|
146
|
+
De(/* @__PURE__ */ new Date()) * H + we
|
|
147
|
+
), p = (s) => {
|
|
148
|
+
l(De(s) * H + we), a({
|
|
149
|
+
start: W(s),
|
|
150
|
+
end: B(s)
|
|
151
151
|
}), n(_.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,26 +200,26 @@ 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(xe, {});
|
|
211
211
|
switch (t.status) {
|
|
212
212
|
case R.Missed:
|
|
213
|
-
return /* @__PURE__ */ e(xe, {});
|
|
214
|
-
case R.Paid:
|
|
215
213
|
return /* @__PURE__ */ e(ye, {});
|
|
214
|
+
case R.Paid:
|
|
215
|
+
return /* @__PURE__ */ e(Ce, {});
|
|
216
216
|
default:
|
|
217
|
-
return /* @__PURE__ */ e(
|
|
217
|
+
return /* @__PURE__ */ e(fe, {});
|
|
218
218
|
}
|
|
219
219
|
}, Ct = (t, n) => {
|
|
220
220
|
switch (t.status) {
|
|
221
221
|
case R.Paid:
|
|
222
|
-
return t.expectedDate ?
|
|
222
|
+
return t.expectedDate ? O(
|
|
223
223
|
n.paid_on,
|
|
224
224
|
A(
|
|
225
225
|
t.occurredOnDate || t.expectedDate,
|
|
@@ -227,37 +227,37 @@ const Z = {
|
|
|
227
227
|
)
|
|
228
228
|
) : n.paid;
|
|
229
229
|
case R.Missed:
|
|
230
|
-
return
|
|
230
|
+
return O(
|
|
231
231
|
n.missed_on,
|
|
232
232
|
A(t.expectedDate, E.MONTH_DAY)
|
|
233
233
|
);
|
|
234
234
|
case R.Upcoming:
|
|
235
|
-
return
|
|
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
|
+
}, _e = ({
|
|
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 } = D(), { repeatingTransactions: l } = v(), [
|
|
249
|
+
const { recurring: r } = D(), { repeatingTransactions: l } = v(), [p, u] = h.useState(!1), s = h.useMemo(
|
|
250
250
|
() => l.find((S) => S.guid === t.repeatingTransactionGuid),
|
|
251
251
|
[t, l]
|
|
252
|
-
), m = t.type === M.Income, f = t.status === R.Paid, x = t.status === R.Missed,
|
|
252
|
+
), m = t.type === M.Income, f = t.status === R.Paid, x = t.status === R.Missed, C = t.status === R.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 ? Se(r, s || {}, !0) : Se(r, s || {}, !1)), //TODO: implement common/components/ListItemRow.tsx
|
|
255
|
+
/* @__PURE__ */ o(Ee, { 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(Le, { color: "success", filled: !0, size: 12 }),
|
|
308
|
+
x && /* @__PURE__ */ e(Me, { 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
|
+
Ge,
|
|
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 = T(
|
|
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:
|
|
344
|
+
const { recurring: p } = D(), u = h.useMemo(() => ot(t), [t]);
|
|
345
345
|
return /* @__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(Ie, { children: n ? t.map((s, m) => /* @__PURE__ */ o(h.Fragment, { children: [
|
|
357
357
|
/* @__PURE__ */ e(
|
|
358
|
-
|
|
358
|
+
_e,
|
|
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(Ee, { children: /* @__PURE__ */ e(
|
|
368
|
+
Ie,
|
|
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
|
+
_e,
|
|
374
374
|
{
|
|
375
375
|
isMini: n,
|
|
376
376
|
onRecurrenceClick: a,
|
|
@@ -379,173 +379,178 @@ 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
|
+
), ve = T(
|
|
387
|
+
({ expected: t, isExpense: n = !0, missed: i, paid: a, title: r, total: l, upcoming: p }) => {
|
|
388
|
+
const u = pe(), { isSmallMobile: s } = Oe(), { recurring: m } = D(), 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(Ne, { 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
413
|
), bt = T(() => {
|
|
414
|
-
const { recurring: t } = D(), {
|
|
415
|
-
currentMonthExpenses:
|
|
416
|
-
currentMonthIncome:
|
|
414
|
+
const { recurring: t } = D(), { availableWidth: n } = Ae(), { isDesktop: i, isSmallMobile: a } = Oe(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: S,
|
|
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
|
+
}, w = (b) => {
|
|
433
|
+
r(_.RECURRING_TRANSACTIONS_CLICK_UPCOMING, {
|
|
434
|
+
transaction_guid: b.transaction?.guid
|
|
435
435
|
});
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
transaction_guid:
|
|
436
|
+
}, F = (b) => {
|
|
437
|
+
r(_.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
453
|
return /* @__PURE__ */ o(
|
|
454
|
-
|
|
454
|
+
ae,
|
|
455
455
|
{
|
|
456
456
|
container: !0,
|
|
457
|
-
sx: {
|
|
457
|
+
sx: {
|
|
458
|
+
pt: 16,
|
|
459
|
+
pl: i ? 48 : 24,
|
|
460
|
+
pr: i ? 24 : 16,
|
|
461
|
+
spacing: 24
|
|
462
|
+
},
|
|
458
463
|
children: [
|
|
459
|
-
/* @__PURE__ */ e(
|
|
464
|
+
/* @__PURE__ */ e(ae, { md: !0, sm: 12, width: "100%", children: /* @__PURE__ */ o(c, { sx: { gap: 16 }, children: [
|
|
460
465
|
/* @__PURE__ */ o(c, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
461
|
-
/* @__PURE__ */ e(
|
|
466
|
+
/* @__PURE__ */ e(Je, { children: O(
|
|
462
467
|
t.header_title,
|
|
463
468
|
A(u.start, E.MONTH_LONG)
|
|
464
469
|
) }),
|
|
465
|
-
!
|
|
470
|
+
!i && /* @__PURE__ */ o(c, { direction: "row", gap: 4, children: [
|
|
466
471
|
/* @__PURE__ */ e(
|
|
467
|
-
|
|
472
|
+
Re,
|
|
468
473
|
{
|
|
469
474
|
color: "primary",
|
|
470
|
-
disabled:
|
|
471
|
-
onClick:
|
|
472
|
-
children: /* @__PURE__ */ e(
|
|
475
|
+
disabled: I,
|
|
476
|
+
onClick: P,
|
|
477
|
+
children: /* @__PURE__ */ e(Ve, {})
|
|
473
478
|
}
|
|
474
479
|
),
|
|
475
|
-
/* @__PURE__ */ e(
|
|
480
|
+
/* @__PURE__ */ e(Re, { color: "primary", onClick: ie, children: /* @__PURE__ */ e(Xe, {}) })
|
|
476
481
|
] })
|
|
477
482
|
] }),
|
|
478
483
|
/* @__PURE__ */ e(
|
|
479
|
-
|
|
484
|
+
ve,
|
|
480
485
|
{
|
|
481
|
-
expected:
|
|
482
|
-
missed:
|
|
483
|
-
paid:
|
|
486
|
+
expected: s,
|
|
487
|
+
missed: f,
|
|
488
|
+
paid: C,
|
|
484
489
|
title: t.expenses,
|
|
485
|
-
total:
|
|
486
|
-
upcoming:
|
|
490
|
+
total: l.length,
|
|
491
|
+
upcoming: Q
|
|
487
492
|
}
|
|
488
493
|
),
|
|
489
494
|
/* @__PURE__ */ e(
|
|
490
|
-
|
|
495
|
+
ve,
|
|
491
496
|
{
|
|
492
|
-
expected:
|
|
497
|
+
expected: m,
|
|
493
498
|
isExpense: !1,
|
|
494
|
-
paid:
|
|
499
|
+
paid: y,
|
|
495
500
|
title: t.deposits,
|
|
496
|
-
total:
|
|
497
|
-
upcoming:
|
|
501
|
+
total: p.length,
|
|
502
|
+
upcoming: ee
|
|
498
503
|
}
|
|
499
504
|
),
|
|
500
|
-
|
|
501
|
-
|
|
505
|
+
i && /* @__PURE__ */ e(
|
|
506
|
+
z,
|
|
502
507
|
{
|
|
503
|
-
onRecurrenceClick:
|
|
504
|
-
recurrences:
|
|
508
|
+
onRecurrenceClick: w,
|
|
509
|
+
recurrences: U,
|
|
505
510
|
title: t.upcoming_activity
|
|
506
511
|
}
|
|
507
512
|
),
|
|
508
|
-
!
|
|
509
|
-
/* @__PURE__ */ o(
|
|
513
|
+
!i && /* @__PURE__ */ o(c, { children: [
|
|
514
|
+
/* @__PURE__ */ o(je, { onChange: ne, value: $, variant: "fullWidth", children: [
|
|
510
515
|
/* @__PURE__ */ e(
|
|
511
|
-
|
|
516
|
+
Te,
|
|
512
517
|
{
|
|
513
|
-
label: /* @__PURE__ */ e(
|
|
518
|
+
label: /* @__PURE__ */ e(g, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: a ? t.upcoming : t.upcoming_activity })
|
|
514
519
|
}
|
|
515
520
|
),
|
|
516
521
|
/* @__PURE__ */ e(
|
|
517
|
-
|
|
522
|
+
Te,
|
|
518
523
|
{
|
|
519
|
-
label: /* @__PURE__ */ e(
|
|
524
|
+
label: /* @__PURE__ */ e(g, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: a ? t.past : t.past_transactions })
|
|
520
525
|
}
|
|
521
526
|
)
|
|
522
527
|
] }),
|
|
523
528
|
$ === 0 && /* @__PURE__ */ e(
|
|
524
|
-
|
|
529
|
+
z,
|
|
525
530
|
{
|
|
526
|
-
onRecurrenceClick:
|
|
527
|
-
recurrences:
|
|
531
|
+
onRecurrenceClick: w,
|
|
532
|
+
recurrences: U
|
|
528
533
|
}
|
|
529
534
|
),
|
|
530
535
|
$ === 1 && /* @__PURE__ */ e(
|
|
531
|
-
|
|
536
|
+
z,
|
|
532
537
|
{
|
|
533
|
-
onRecurrenceClick:
|
|
534
|
-
recurrences:
|
|
538
|
+
onRecurrenceClick: F,
|
|
539
|
+
recurrences: x
|
|
535
540
|
}
|
|
536
541
|
)
|
|
537
542
|
] })
|
|
538
543
|
] }) }),
|
|
539
|
-
|
|
540
|
-
/* @__PURE__ */ e(
|
|
544
|
+
i && /* @__PURE__ */ e(ae, { sx: { minWidth: 450 }, xs: "auto", children: /* @__PURE__ */ o(c, { gap: 24, children: [
|
|
545
|
+
/* @__PURE__ */ e(ke, {}),
|
|
541
546
|
/* @__PURE__ */ e(
|
|
542
|
-
|
|
547
|
+
z,
|
|
543
548
|
{
|
|
544
|
-
onRecurrenceClick:
|
|
545
|
-
recurrences:
|
|
546
|
-
title:
|
|
549
|
+
onRecurrenceClick: F,
|
|
550
|
+
recurrences: S || x,
|
|
551
|
+
title: d ? O(
|
|
547
552
|
t.day_transactions,
|
|
548
|
-
A(
|
|
553
|
+
A(d, E.MONTH_DAY)
|
|
549
554
|
) : t.past_transactions
|
|
550
555
|
}
|
|
551
556
|
)
|
|
@@ -554,14 +559,14 @@ const Z = {
|
|
|
554
559
|
}
|
|
555
560
|
);
|
|
556
561
|
}), wn = T(({ onBackClick: t, sx: n = {} }) => {
|
|
557
|
-
const { accounts: i } =
|
|
562
|
+
const { accounts: i } = ge(), { recurring: a } = D(), { isCopyLoaded: r, isInitialized: l, selectedAccountGuids: p, setSelectedAccounts: u } = X(), { isDataLoaded: s, loadRepeatingTransactions: m, setDateRange: f } = v(), { setFilter: x } = he(), { onEvent: C } = Z(), [y, d] = h.useState(!1);
|
|
558
563
|
return h.useEffect(() => {
|
|
559
|
-
|
|
564
|
+
u(i);
|
|
560
565
|
}, [i]), h.useEffect(() => {
|
|
561
566
|
l && (x({
|
|
562
|
-
dateRange: { start: de(
|
|
563
|
-
accounts:
|
|
564
|
-
}), f({ start:
|
|
567
|
+
dateRange: { start: ue(de(), 90), end: le() },
|
|
568
|
+
accounts: p
|
|
569
|
+
}), f({ start: W(/* @__PURE__ */ new Date()), end: B(/* @__PURE__ */ new Date()) }), m().finally());
|
|
565
570
|
}, [l]), r ? /* @__PURE__ */ o(
|
|
566
571
|
at,
|
|
567
572
|
{
|
|
@@ -571,47 +576,47 @@ const Z = {
|
|
|
571
576
|
label: a.action_title,
|
|
572
577
|
iconName: "credit_card",
|
|
573
578
|
onClick: () => {
|
|
574
|
-
d(!0),
|
|
579
|
+
d(!0), C(_.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
|
|
575
580
|
}
|
|
576
581
|
}
|
|
577
582
|
],
|
|
578
|
-
onAccountsFilterClick: () =>
|
|
583
|
+
onAccountsFilterClick: () => C(_.RECURRING_TRANSACTIONS_CLICK_FILTER),
|
|
579
584
|
onBackClick: t,
|
|
580
585
|
sx: n,
|
|
581
586
|
title: a.title,
|
|
582
587
|
children: [
|
|
583
588
|
l && s ? /* @__PURE__ */ e(bt, {}) : /* @__PURE__ */ o(c, { direction: "column", p: 48, spacing: 24, children: [
|
|
584
|
-
/* @__PURE__ */ e(
|
|
585
|
-
/* @__PURE__ */ e(
|
|
586
|
-
/* @__PURE__ */ e(
|
|
589
|
+
/* @__PURE__ */ e(oe, { height: 100, variant: "rounded", width: "100%" }),
|
|
590
|
+
/* @__PURE__ */ e(oe, { height: 100, variant: "rounded", width: "100%" }),
|
|
591
|
+
/* @__PURE__ */ e(oe, { height: 600, variant: "rounded", width: "100%" })
|
|
587
592
|
] }),
|
|
588
593
|
/* @__PURE__ */ e(
|
|
589
|
-
|
|
594
|
+
Ge,
|
|
590
595
|
{
|
|
591
596
|
ariaLabelClose: a.close_drawer_aria,
|
|
592
597
|
isOpen: y,
|
|
593
598
|
onClose: () => d(!1),
|
|
594
599
|
shouldShowHeaderBorders: !1,
|
|
595
600
|
title: a.action_title,
|
|
596
|
-
children: /* @__PURE__ */ e(
|
|
601
|
+
children: /* @__PURE__ */ e(ze, {})
|
|
597
602
|
}
|
|
598
603
|
)
|
|
599
604
|
]
|
|
600
605
|
}
|
|
601
|
-
) : /* @__PURE__ */ e(
|
|
606
|
+
) : /* @__PURE__ */ e(K, {});
|
|
602
607
|
}), Rt = T(() => {
|
|
603
|
-
const { recurring: t } = D(), { availableWidth: n } =
|
|
604
|
-
return /* @__PURE__ */ o(c, { flexDirection:
|
|
605
|
-
/* @__PURE__ */ e(
|
|
606
|
-
!
|
|
608
|
+
const { recurring: t } = D(), { availableWidth: n } = Ae(), { selectedDay: i, selectedDayRecurrences: a, setSelectedDay: r, upcomingRecurrences: l } = v(), p = n < 750;
|
|
609
|
+
return /* @__PURE__ */ o(c, { flexDirection: p ? "column" : "row", width: "100%", children: [
|
|
610
|
+
/* @__PURE__ */ e(ke, {}),
|
|
611
|
+
!p && /* @__PURE__ */ e(ce, { flexItem: !0, orientation: "vertical", sx: { my: 16, ml: 16 } }),
|
|
607
612
|
/* @__PURE__ */ e(
|
|
608
|
-
|
|
613
|
+
z,
|
|
609
614
|
{
|
|
610
615
|
isMini: !0,
|
|
611
616
|
onResetClick: i ? () => r(i) : void 0,
|
|
612
617
|
recurrences: a || l.slice(0, 5),
|
|
613
|
-
sx: { width:
|
|
614
|
-
title: i ?
|
|
618
|
+
sx: { width: p ? "100%" : "calc(100% - 336px)", mt: 12 },
|
|
619
|
+
title: i ? O(
|
|
615
620
|
t.day_transactions,
|
|
616
621
|
A(i, E.MONTH_DAY)
|
|
617
622
|
) : t.upcoming_activity
|
|
@@ -620,15 +625,15 @@ const Z = {
|
|
|
620
625
|
] });
|
|
621
626
|
}), _n = T(
|
|
622
627
|
({ onPrimaryCtaClick: t, sx: n }) => {
|
|
623
|
-
const { accounts: i } =
|
|
628
|
+
const { accounts: i } = ge(), { recurring: a } = D(), { setFilter: r } = he(), { isDataLoaded: l, loadRepeatingTransactions: p } = v(), { isCopyLoaded: u, isInitialized: s, setSelectedAccounts: m, selectedAccountGuids: f } = X();
|
|
624
629
|
return h.useEffect(() => {
|
|
625
630
|
s && m(i);
|
|
626
631
|
}, [s]), h.useEffect(() => {
|
|
627
632
|
f.length > 0 && (r({
|
|
628
|
-
dateRange: { start: de(
|
|
633
|
+
dateRange: { start: ue(de(), 90), end: le() },
|
|
629
634
|
accounts: f
|
|
630
|
-
}),
|
|
631
|
-
}, [f]), !
|
|
635
|
+
}), p().finally());
|
|
636
|
+
}, [f]), !u || !s ? /* @__PURE__ */ e(K, {}) : /* @__PURE__ */ e(
|
|
632
637
|
pt,
|
|
633
638
|
{
|
|
634
639
|
className: "mx-exp-recurring-transactions-miniwidget",
|
|
@@ -637,7 +642,7 @@ const Z = {
|
|
|
637
642
|
subTitle: a.sub_title,
|
|
638
643
|
sx: n,
|
|
639
644
|
title: a.mini_title,
|
|
640
|
-
children: l ? /* @__PURE__ */ e(Rt, {}) : /* @__PURE__ */ e(
|
|
645
|
+
children: l ? /* @__PURE__ */ e(Rt, {}) : /* @__PURE__ */ e(K, {})
|
|
641
646
|
}
|
|
642
647
|
);
|
|
643
648
|
}
|
|
@@ -645,7 +650,7 @@ const Z = {
|
|
|
645
650
|
upcomingRecurrences: t,
|
|
646
651
|
maxLogos: n = 3
|
|
647
652
|
}) => /* @__PURE__ */ e(c, { sx: { flexDirection: "row", gap: 4 }, children: t?.slice(0, n).map((i, a) => /* @__PURE__ */ e(
|
|
648
|
-
|
|
653
|
+
me,
|
|
649
654
|
{
|
|
650
655
|
categoryGuid: i.categoryGuid || "",
|
|
651
656
|
merchantGuid: i.merchantGuid || ""
|
|
@@ -658,14 +663,14 @@ const Z = {
|
|
|
658
663
|
}) => {
|
|
659
664
|
const a = (r) => r * (n / 2);
|
|
660
665
|
return /* @__PURE__ */ e(
|
|
661
|
-
|
|
666
|
+
k,
|
|
662
667
|
{
|
|
663
668
|
sx: {
|
|
664
669
|
position: "relative",
|
|
665
670
|
width: 64
|
|
666
671
|
},
|
|
667
672
|
children: t.map((r, l) => l < i ? /* @__PURE__ */ e(
|
|
668
|
-
|
|
673
|
+
k,
|
|
669
674
|
{
|
|
670
675
|
sx: {
|
|
671
676
|
borderRadius: "4px",
|
|
@@ -676,7 +681,7 @@ const Z = {
|
|
|
676
681
|
position: "absolute"
|
|
677
682
|
},
|
|
678
683
|
children: /* @__PURE__ */ e(
|
|
679
|
-
|
|
684
|
+
me,
|
|
680
685
|
{
|
|
681
686
|
categoryGuid: r.categoryGuid || "",
|
|
682
687
|
merchantGuid: r.merchantGuid || "",
|
|
@@ -696,7 +701,7 @@ const Z = {
|
|
|
696
701
|
label: r
|
|
697
702
|
}) => /* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
|
698
703
|
/* @__PURE__ */ e(
|
|
699
|
-
|
|
704
|
+
k,
|
|
700
705
|
{
|
|
701
706
|
sx: {
|
|
702
707
|
borderRadius: "2px",
|
|
@@ -707,73 +712,73 @@ const Z = {
|
|
|
707
712
|
}
|
|
708
713
|
),
|
|
709
714
|
/* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
|
|
710
|
-
!a && /* @__PURE__ */ e(
|
|
711
|
-
/* @__PURE__ */ e(
|
|
715
|
+
!a && /* @__PURE__ */ e(g, { bold: !0, variant: "caption", children: L(t, t === 0 || !i ? "0,0" : "0,0.00") }),
|
|
716
|
+
/* @__PURE__ */ e(g, { variant: "caption", children: r })
|
|
712
717
|
] })
|
|
713
718
|
] }), It = T(() => {
|
|
714
719
|
const { recurring: t } = D();
|
|
715
720
|
return /* @__PURE__ */ o(c, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
716
|
-
/* @__PURE__ */ e(
|
|
721
|
+
/* @__PURE__ */ e(Ze, { size: 32 }),
|
|
717
722
|
/* @__PURE__ */ o(c, { children: [
|
|
718
|
-
/* @__PURE__ */ e(
|
|
719
|
-
/* @__PURE__ */ e(
|
|
723
|
+
/* @__PURE__ */ e(se, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
|
|
724
|
+
/* @__PURE__ */ e(se, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
|
|
720
725
|
] })
|
|
721
726
|
] });
|
|
722
727
|
}), vn = T(
|
|
723
728
|
({ onCTAClick: t }) => {
|
|
724
|
-
const [n, i] = h.useState(!1), { onEvent: a } =
|
|
725
|
-
loadRepeatingTransactions:
|
|
729
|
+
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(), {
|
|
730
|
+
loadRepeatingTransactions: C,
|
|
726
731
|
upcomingRecurrences: y,
|
|
727
732
|
expenseTotal: d,
|
|
728
733
|
missedExpenseTotal: S,
|
|
729
|
-
paidExpenseTotal:
|
|
730
|
-
repeatingTransactions:
|
|
731
|
-
setDateRange:
|
|
732
|
-
upcomingExpenseTotal:
|
|
733
|
-
isDataLoaded:
|
|
734
|
-
} = v(), { setFilter:
|
|
734
|
+
paidExpenseTotal: G,
|
|
735
|
+
repeatingTransactions: Q,
|
|
736
|
+
setDateRange: ee,
|
|
737
|
+
upcomingExpenseTotal: U,
|
|
738
|
+
isDataLoaded: $
|
|
739
|
+
} = v(), { setFilter: te } = he(), { recurring: I, budgets: ne } = D();
|
|
735
740
|
h.useEffect(() => {
|
|
736
741
|
x(l);
|
|
737
742
|
}, [l]), h.useEffect(() => {
|
|
738
|
-
m && (
|
|
739
|
-
dateRange: { start: de(
|
|
743
|
+
m && (te({
|
|
744
|
+
dateRange: { start: ue(de(), 90), end: le() },
|
|
740
745
|
accounts: f
|
|
741
|
-
}),
|
|
746
|
+
}), ee({ start: W(/* @__PURE__ */ new Date()), end: B(/* @__PURE__ */ new Date()) }), C().finally(), i(!0));
|
|
742
747
|
}, [m]), h.useEffect(() => {
|
|
743
748
|
n && a(_.RECURRING_TRANSACTIONS_LOAD_WIDGET, {
|
|
744
749
|
state: y.length > 0 ? "default" : "zeroState"
|
|
745
750
|
});
|
|
746
751
|
}, [n]);
|
|
747
|
-
const w =
|
|
748
|
-
const
|
|
749
|
-
{ color: r.palette.success.main, percentage: `${
|
|
752
|
+
const w = u <= 288, F = u >= 450, ie = h.useMemo(() => {
|
|
753
|
+
const N = [
|
|
754
|
+
{ color: r.palette.success.main, percentage: `${G / d}` }
|
|
750
755
|
];
|
|
751
|
-
return S &&
|
|
756
|
+
return S && N.push({
|
|
752
757
|
color: r.palette.error.main,
|
|
753
758
|
percentage: `${S / d}`
|
|
754
|
-
}),
|
|
759
|
+
}), N;
|
|
755
760
|
}, [
|
|
756
|
-
|
|
761
|
+
G,
|
|
757
762
|
d,
|
|
758
763
|
S,
|
|
759
764
|
r.palette.success.main,
|
|
760
765
|
r.palette.error.main
|
|
761
|
-
]),
|
|
766
|
+
]), P = h.useMemo(() => L(d, d === 0 ? "0,0" : "0,0.00"), [d]), b = () => {
|
|
762
767
|
a(
|
|
763
768
|
y.length > 0 ? _.RECURRING_TRANSACTIONS_CLICK_GET_STARTED : _.RECURRING_TRANSACTIONS_CLICK_VIEW_ALL
|
|
764
769
|
), t();
|
|
765
770
|
};
|
|
766
|
-
if (!s || !n ||
|
|
767
|
-
const
|
|
771
|
+
if (!s || !n || !$) return /* @__PURE__ */ e(K, { height: 100 });
|
|
772
|
+
const re = 32, We = y.length > 0, $e = () => We ? w ? /* @__PURE__ */ e(
|
|
768
773
|
Dt,
|
|
769
774
|
{
|
|
770
|
-
logoSize:
|
|
775
|
+
logoSize: re,
|
|
771
776
|
maxLogos: 3,
|
|
772
777
|
upcomingRecurrences: y.slice(0, 3)
|
|
773
778
|
}
|
|
774
|
-
) : /* @__PURE__ */ e(Tt, { maxLogos: 3, upcomingRecurrences: y.slice(0, 3) }) : /* @__PURE__ */ e(c, { sx: { width: w ? 64 : 104 } }),
|
|
779
|
+
) : /* @__PURE__ */ e(Tt, { maxLogos: 3, upcomingRecurrences: y.slice(0, 3) }) : /* @__PURE__ */ e(c, { sx: { width: w ? 64 : 104 } }), Pe = [
|
|
775
780
|
{
|
|
776
|
-
amount:
|
|
781
|
+
amount: G,
|
|
777
782
|
bgColor: "success.main",
|
|
778
783
|
label: I.paid
|
|
779
784
|
},
|
|
@@ -783,23 +788,23 @@ const Z = {
|
|
|
783
788
|
label: I.missed
|
|
784
789
|
},
|
|
785
790
|
{
|
|
786
|
-
amount:
|
|
791
|
+
amount: U,
|
|
787
792
|
bgColor: "border.light",
|
|
788
793
|
label: I.upcoming
|
|
789
794
|
}
|
|
790
|
-
],
|
|
795
|
+
], be = !Q?.length;
|
|
791
796
|
return /* @__PURE__ */ e(
|
|
792
797
|
ht,
|
|
793
798
|
{
|
|
794
799
|
className: "mx-recurring-transaction-microwidget",
|
|
795
|
-
ctaLabel:
|
|
796
|
-
onCTAClick:
|
|
800
|
+
ctaLabel: be ? ne.get_started_cta : I.primary_cta,
|
|
801
|
+
onCTAClick: b,
|
|
797
802
|
title: I.recurring_expenses,
|
|
798
|
-
children:
|
|
803
|
+
children: be ? /* @__PURE__ */ e(It, {}) : /* @__PURE__ */ o(Y, { children: [
|
|
799
804
|
/* @__PURE__ */ o(
|
|
800
805
|
c,
|
|
801
806
|
{
|
|
802
|
-
ref:
|
|
807
|
+
ref: p,
|
|
803
808
|
sx: {
|
|
804
809
|
flexDirection: "row",
|
|
805
810
|
justifyContent: "space-between"
|
|
@@ -809,7 +814,7 @@ const Z = {
|
|
|
809
814
|
c,
|
|
810
815
|
{
|
|
811
816
|
sx: [
|
|
812
|
-
|
|
817
|
+
P.length >= 10 && w ? { flexDirection: "column" } : { flexDirection: "row", gap: 2 },
|
|
813
818
|
{
|
|
814
819
|
alignItems: "baseline",
|
|
815
820
|
overflow: "hidden",
|
|
@@ -819,15 +824,15 @@ const Z = {
|
|
|
819
824
|
],
|
|
820
825
|
children: [
|
|
821
826
|
/* @__PURE__ */ e(
|
|
822
|
-
|
|
827
|
+
g,
|
|
823
828
|
{
|
|
824
829
|
sx: { width: "100%" },
|
|
825
|
-
variant:
|
|
826
|
-
children:
|
|
830
|
+
variant: P.length >= 10 && w ? "H3" : "H2",
|
|
831
|
+
children: P
|
|
827
832
|
}
|
|
828
833
|
),
|
|
829
834
|
/* @__PURE__ */ e(
|
|
830
|
-
|
|
835
|
+
se,
|
|
831
836
|
{
|
|
832
837
|
sx: {
|
|
833
838
|
pr: 12
|
|
@@ -839,12 +844,12 @@ const Z = {
|
|
|
839
844
|
]
|
|
840
845
|
}
|
|
841
846
|
),
|
|
842
|
-
|
|
847
|
+
$e()
|
|
843
848
|
]
|
|
844
849
|
}
|
|
845
850
|
),
|
|
846
851
|
/* @__PURE__ */ o(c, { sx: { pt: 12 }, children: [
|
|
847
|
-
/* @__PURE__ */ e(
|
|
852
|
+
/* @__PURE__ */ e(Ne, { data: ie }),
|
|
848
853
|
/* @__PURE__ */ e(
|
|
849
854
|
c,
|
|
850
855
|
{
|
|
@@ -854,16 +859,16 @@ const Z = {
|
|
|
854
859
|
gap: 16,
|
|
855
860
|
mt: 4
|
|
856
861
|
},
|
|
857
|
-
children:
|
|
862
|
+
children: Pe.map((N, He) => /* @__PURE__ */ e(
|
|
858
863
|
St,
|
|
859
864
|
{
|
|
860
|
-
amount:
|
|
861
|
-
bgcolor:
|
|
862
|
-
isLargeScreen:
|
|
865
|
+
amount: N.amount,
|
|
866
|
+
bgcolor: N.bgColor,
|
|
867
|
+
isLargeScreen: F,
|
|
863
868
|
isSmallScreen: w,
|
|
864
|
-
label:
|
|
869
|
+
label: N.label
|
|
865
870
|
},
|
|
866
|
-
`recurrence-legend-${
|
|
871
|
+
`recurrence-legend-${He}`
|
|
867
872
|
))
|
|
868
873
|
}
|
|
869
874
|
)
|
|
@@ -877,7 +882,7 @@ export {
|
|
|
877
882
|
On as AddRecurringTransactionDetails,
|
|
878
883
|
An as ManageExpenses,
|
|
879
884
|
kn as ManageIncome,
|
|
880
|
-
|
|
885
|
+
ze as RecurringSettings,
|
|
881
886
|
vn as RecurringTransactionsMicroWidget,
|
|
882
887
|
_n as RecurringTransactionsMiniWidget,
|
|
883
888
|
Gn as RecurringTransactionsStore,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-cartographer/experiences",
|
|
3
|
-
"version": "7.0.25-alpha-recurring-transactions-css-bug-
|
|
3
|
+
"version": "7.0.25-alpha-recurring-transactions-css-bug-ram6",
|
|
4
4
|
"description": "Library containing experience widgets",
|
|
5
5
|
"author": "MX",
|
|
6
6
|
"license": "MIT",
|