@mx-cartographer/experiences 7.0.2-alpha.al0 → 7.0.3
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 +5 -0
- package/dist/ManageIncome-BtKRPjvO.mjs +574 -0
- package/dist/RecurringSettings-Dqn4pjZ0.mjs +81 -0
- package/dist/budgets/index.es.js +3 -3
- package/dist/cashflow/index.es.js +209 -209
- package/dist/common/types/localization/RecurringCopy.d.ts +6 -0
- package/dist/finstrong/index.es.js +1 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/ManageIncome.d.ts +5 -1
- package/dist/recurringtransactions/components/shared/recurringsettings/RecurringSettingsZeroState.d.ts +7 -0
- package/dist/recurringtransactions/index.es.js +7 -7
- package/package.json +1 -1
- package/dist/ManageIncome-B6kmMN_z.mjs +0 -527
- package/dist/RecurringSettings-Be1dzkMz.mjs +0 -57
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [7.0.3] - 09-12-2025
|
|
2
|
+
|
|
3
|
+
- **UPDATED** - `Recurring Setting` | design change in `ManageExpenses` and `ManageIncome`.
|
|
4
|
+
- **ADDED** - `Recurring Setting` | Zero state added for `ManageExpenses` and `ManageIncome`.
|
|
5
|
+
|
|
1
6
|
## [7.0.2] - 09-17-2025
|
|
2
7
|
|
|
3
8
|
- **ADDED** - Transactions widget supports account-specific requests
|
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { observer as A } from "mobx-react-lite";
|
|
4
|
+
import oe from "@mui/material/Box";
|
|
5
|
+
import L from "@mui/material/Divider";
|
|
6
|
+
import K from "@mui/material/List";
|
|
7
|
+
import y from "@mui/material/Stack";
|
|
8
|
+
import re from "@mui/material/ListItem";
|
|
9
|
+
import ae from "@mui/material/ListItemAvatar";
|
|
10
|
+
import ie from "@mui/material/ListItemButton";
|
|
11
|
+
import se from "@mui/material/ListItemText";
|
|
12
|
+
import { MerchantLogo as j, Text as x, H1 as ce, InstitutionLogo as de, P } from "@mxenabled/mxui";
|
|
13
|
+
import { F as l, S as N, D as Y, g as Q, R, e as le } from "./RepeatingTransaction-BPWfaB3f.mjs";
|
|
14
|
+
import { subDays as ue } from "date-fns/subDays";
|
|
15
|
+
import { startOfToday as U } from "date-fns/startOfToday";
|
|
16
|
+
import { endOfMonth as _e } from "date-fns/endOfMonth";
|
|
17
|
+
import $ from "@mui/material/Button";
|
|
18
|
+
import { Delete as me, Add as pe, ReceiptLong as ye } from "@mxenabled/mx-icons";
|
|
19
|
+
import { T as H, a as he, u as fe, S as ge, b as Ce } from "./TransactionDetails-D4B9DSWo.mjs";
|
|
20
|
+
import { getDayOfYear as be } from "date-fns/getDayOfYear";
|
|
21
|
+
import { setDayOfYear as Se } from "date-fns/setDayOfYear";
|
|
22
|
+
import { AdapterDateFns as ve } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
23
|
+
import { DatePicker as xe } from "@mui/x-date-pickers";
|
|
24
|
+
import { LocalizationProvider as we } from "@mui/x-date-pickers/LocalizationProvider";
|
|
25
|
+
import { u as w, h as M, e as F, a as Ae, f as X, o as De } from "./hooks-02T565vf.mjs";
|
|
26
|
+
import { b as Ie, f as Z } from "./NumberFormatting-CtWHhyBX.mjs";
|
|
27
|
+
import { D as O } from "./Drawer-kEE73B87.mjs";
|
|
28
|
+
import { A as T } from "./WidgetContainer-BG-fdDOf.mjs";
|
|
29
|
+
import { f as Ee, D as Re, a as Te } from "./Dialog-CWW597AF.mjs";
|
|
30
|
+
import { formatISO as Le } from "date-fns/formatISO";
|
|
31
|
+
import { fromUnixTime as Oe } from "date-fns/fromUnixTime";
|
|
32
|
+
import { S as ke } from "./SearchBox-B2_zLv8-.mjs";
|
|
33
|
+
import { h as Ne } from "./DateUtil-BcuH7ErC.mjs";
|
|
34
|
+
import { b as z } from "./Category-CevNQ03n.mjs";
|
|
35
|
+
import { T as J } from "./Transaction-CyqrHmAA.mjs";
|
|
36
|
+
const V = ({
|
|
37
|
+
frequency: n,
|
|
38
|
+
firstDay: t,
|
|
39
|
+
secondDay: r,
|
|
40
|
+
onFrequencyChange: a,
|
|
41
|
+
onFirstDayChange: s,
|
|
42
|
+
onSecondDayChange: d
|
|
43
|
+
}) => {
|
|
44
|
+
const { recurring: o } = w(), i = u.useMemo(
|
|
45
|
+
() => [
|
|
46
|
+
{ id: l.EveryWeek, label: o.frequency_every_week },
|
|
47
|
+
{ id: l.EveryOtherWeek, label: o.frequency_every_other_week },
|
|
48
|
+
{ id: l.TwiceAMonth, label: o.frequency_twice_a_month },
|
|
49
|
+
{ id: l.EveryMonth, label: o.frequency_every_month },
|
|
50
|
+
{ id: l.EveryOtherMonth, label: o.frequency_every_other_month },
|
|
51
|
+
{ id: l.EveryQuarter, label: o.frequency_every_quarter },
|
|
52
|
+
{ id: l.EveryOtherQuarter, label: o.frequency_every_other_quarter },
|
|
53
|
+
{ id: l.EveryYear, label: o.frequency_every_year }
|
|
54
|
+
],
|
|
55
|
+
[o]
|
|
56
|
+
), m = [
|
|
57
|
+
{ id: 0, label: o.weekday_sunday },
|
|
58
|
+
{ id: 1, label: o.weekday_monday },
|
|
59
|
+
{ id: 2, label: o.weekday_tuesday },
|
|
60
|
+
{ id: 3, label: o.weekday_wednesday },
|
|
61
|
+
{ id: 4, label: o.weekday_thursday },
|
|
62
|
+
{ id: 5, label: o.weekday_friday },
|
|
63
|
+
{ id: 6, label: o.weekday_saturday }
|
|
64
|
+
], h = [...Array(31).keys()].map((p) => ({
|
|
65
|
+
id: p + 1,
|
|
66
|
+
label: Ie(p + 1)
|
|
67
|
+
}));
|
|
68
|
+
h[30].label += ` (${o.last_day_of_month})`;
|
|
69
|
+
const C = h.slice(0, 15), v = h.slice(14), b = n === l.EveryWeek || n === l.EveryOtherWeek, f = n === l.TwiceAMonth || n === l.EveryMonth || n === l.EveryOtherMonth || n === l.EveryQuarter || n === l.EveryOtherQuarter, D = Se(U(), t), g = (p) => {
|
|
70
|
+
p && s(be(p));
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ c(y, { gap: 24, sx: { m: 24 }, children: [
|
|
73
|
+
/* @__PURE__ */ e(
|
|
74
|
+
N,
|
|
75
|
+
{
|
|
76
|
+
label: o.frequency,
|
|
77
|
+
onChange: a,
|
|
78
|
+
options: i,
|
|
79
|
+
value: n
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
b && /* @__PURE__ */ e(
|
|
83
|
+
N,
|
|
84
|
+
{
|
|
85
|
+
label: o.day_of_the_week,
|
|
86
|
+
onChange: s,
|
|
87
|
+
options: m,
|
|
88
|
+
value: t
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
f && /* @__PURE__ */ e(
|
|
92
|
+
N,
|
|
93
|
+
{
|
|
94
|
+
label: n === l.TwiceAMonth ? o.first_day_of_the_month : o.day_of_the_month,
|
|
95
|
+
onChange: s,
|
|
96
|
+
options: n === l.TwiceAMonth ? C : h,
|
|
97
|
+
value: t
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
n === l.TwiceAMonth && /* @__PURE__ */ e(
|
|
101
|
+
N,
|
|
102
|
+
{
|
|
103
|
+
label: o.second_day_of_the_month,
|
|
104
|
+
onChange: d,
|
|
105
|
+
options: v,
|
|
106
|
+
value: r || 0
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
n === l.EveryYear && /* @__PURE__ */ e(we, { dateAdapter: ve, children: /* @__PURE__ */ e(
|
|
110
|
+
xe,
|
|
111
|
+
{
|
|
112
|
+
disablePast: !0,
|
|
113
|
+
label: o.next_payment_date,
|
|
114
|
+
onChange: g,
|
|
115
|
+
value: D
|
|
116
|
+
}
|
|
117
|
+
) })
|
|
118
|
+
] });
|
|
119
|
+
}, Me = A(({ repeatingTransaction: n }) => {
|
|
120
|
+
const { recurring: t } = w(), { updateRepeatingTransaction: r } = M(), { onEvent: a } = F(), [s, d] = u.useState(!1), [o, i] = u.useState(n.recurrence_type), [m, h] = u.useState(n.recurrence_day), [C, v] = u.useState(n.second_recurrence_day), b = async () => {
|
|
121
|
+
await r({
|
|
122
|
+
...n,
|
|
123
|
+
recurrence_type: o,
|
|
124
|
+
recurrence_day: m,
|
|
125
|
+
second_recurrence_day: C
|
|
126
|
+
}), d(!1);
|
|
127
|
+
}, f = () => {
|
|
128
|
+
d(!0), a(T.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
|
|
129
|
+
};
|
|
130
|
+
return /* @__PURE__ */ c(E, { children: [
|
|
131
|
+
/* @__PURE__ */ e(
|
|
132
|
+
Y,
|
|
133
|
+
{
|
|
134
|
+
iconName: "sync",
|
|
135
|
+
label: t.activity_schedule,
|
|
136
|
+
onClick: f,
|
|
137
|
+
value: `${Q(t, n, !0)}`
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ e(
|
|
141
|
+
O,
|
|
142
|
+
{
|
|
143
|
+
ariaLabelClose: t.close_drawer_aria,
|
|
144
|
+
isOpen: s,
|
|
145
|
+
onClose: () => d(!1),
|
|
146
|
+
onPrimaryAction: b,
|
|
147
|
+
title: t.payment_schedule,
|
|
148
|
+
children: /* @__PURE__ */ e(
|
|
149
|
+
V,
|
|
150
|
+
{
|
|
151
|
+
firstDay: m,
|
|
152
|
+
frequency: o,
|
|
153
|
+
onFirstDayChange: h,
|
|
154
|
+
onFrequencyChange: i,
|
|
155
|
+
onSecondDayChange: v,
|
|
156
|
+
secondDay: C
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] });
|
|
162
|
+
}), Fe = A(
|
|
163
|
+
({ onDeleted: n, recurringTransaction: t }) => {
|
|
164
|
+
const { recurring: r } = w(), { selectedAccountGuids: a } = Ae(), { onEvent: s } = F(), { deleteRepeatingTransaction: d } = M(), { setFilter: o, transactions: i } = X(), { amount: m, description: h, merchant_guid: C } = t, [v, b] = u.useState(!1), [f, D] = u.useState("");
|
|
165
|
+
u.useEffect(() => {
|
|
166
|
+
o({
|
|
167
|
+
accounts: a,
|
|
168
|
+
dateRange: { start: ue(U(), 90), end: _e(U()) },
|
|
169
|
+
custom: (_) => _.repeating_transaction_guid === t.guid
|
|
170
|
+
});
|
|
171
|
+
}, [t]);
|
|
172
|
+
const g = u.useMemo(
|
|
173
|
+
() => i.find((_) => _.guid === f),
|
|
174
|
+
[f, i]
|
|
175
|
+
), p = t.repeating_transaction_type === R.Income, k = async () => {
|
|
176
|
+
await d(t.guid), n();
|
|
177
|
+
}, G = () => {
|
|
178
|
+
b(!0), s(T.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
|
|
179
|
+
};
|
|
180
|
+
return /* @__PURE__ */ c(y, { bgcolor: "background.default", direction: "column", height: "100%", children: [
|
|
181
|
+
/* @__PURE__ */ c(y, { direction: "column", m: 24, children: [
|
|
182
|
+
/* @__PURE__ */ e(
|
|
183
|
+
j,
|
|
184
|
+
{
|
|
185
|
+
categoryGuid: g?.category_guid || "",
|
|
186
|
+
merchantGuid: C,
|
|
187
|
+
size: 64,
|
|
188
|
+
sx: { mb: 12 }
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: h }),
|
|
192
|
+
/* @__PURE__ */ c(ce, { color: p ? "success.main" : "text.primary", sx: { my: 4 }, children: [
|
|
193
|
+
p ? "+" : "",
|
|
194
|
+
Z(m, "0,0.00")
|
|
195
|
+
] }),
|
|
196
|
+
/* @__PURE__ */ e(x, { color: "text.secondary", variant: "body2", children: `${r.next_payment_date}: ${Ee(
|
|
197
|
+
t.predicted_occurs_on,
|
|
198
|
+
Re.MONTH_DAY_YEAR
|
|
199
|
+
)}` })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ c(K, { sx: { bgcolor: "background.paper" }, children: [
|
|
202
|
+
t.account && /* @__PURE__ */ c(E, { children: [
|
|
203
|
+
/* @__PURE__ */ e(
|
|
204
|
+
Y,
|
|
205
|
+
{
|
|
206
|
+
iconName: "checkbook",
|
|
207
|
+
label: r.account,
|
|
208
|
+
value: t.account.institutionName || ""
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ e(L, { variant: "inset" })
|
|
212
|
+
] }),
|
|
213
|
+
g?.category && /* @__PURE__ */ c(E, { children: [
|
|
214
|
+
/* @__PURE__ */ e(
|
|
215
|
+
Y,
|
|
216
|
+
{
|
|
217
|
+
iconName: "monetization_on",
|
|
218
|
+
label: r.category,
|
|
219
|
+
value: g.category
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ e(L, { variant: "inset" })
|
|
223
|
+
] }),
|
|
224
|
+
/* @__PURE__ */ e(Me, { repeatingTransaction: t }),
|
|
225
|
+
/* @__PURE__ */ e(L, {})
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ e(
|
|
228
|
+
$,
|
|
229
|
+
{
|
|
230
|
+
color: "error",
|
|
231
|
+
onClick: G,
|
|
232
|
+
startIcon: /* @__PURE__ */ e(me, {}),
|
|
233
|
+
sx: { mx: 24, my: 16 },
|
|
234
|
+
variant: "text",
|
|
235
|
+
children: p ? r.delete_income_title : r.delete_expense_title
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ e(x, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "Body", children: r.paid_transactions }),
|
|
239
|
+
/* @__PURE__ */ e(H, { height: "30dvh", onClick: D }),
|
|
240
|
+
/* @__PURE__ */ e(
|
|
241
|
+
O,
|
|
242
|
+
{
|
|
243
|
+
ariaLabelClose: r.close_drawer_aria,
|
|
244
|
+
isOpen: !!f && !!g,
|
|
245
|
+
onClose: () => D(""),
|
|
246
|
+
title: r.transaction_details_drawer_title,
|
|
247
|
+
children: g && /* @__PURE__ */ e(he, { transaction: g })
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ e(
|
|
251
|
+
Te,
|
|
252
|
+
{
|
|
253
|
+
copy: {
|
|
254
|
+
title: p ? r.delete_income_title : r.delete_expense_title,
|
|
255
|
+
close_aria: r.close_drawer_aria
|
|
256
|
+
},
|
|
257
|
+
isOpen: v,
|
|
258
|
+
onClose: () => b(!1),
|
|
259
|
+
onPrimaryAction: k,
|
|
260
|
+
children: /* @__PURE__ */ e(x, { children: p ? r.delete_income_description : r.delete_expense_description })
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] });
|
|
264
|
+
}
|
|
265
|
+
), Ge = A(
|
|
266
|
+
({ onClick: n = () => {
|
|
267
|
+
}, repeatingTransaction: t }) => {
|
|
268
|
+
const { recurring: r } = w(), [a, s] = u.useState(!1), d = u.useMemo(
|
|
269
|
+
() => t.transactions.length === 0 ? "" : t.transactions[0].category_guid || "",
|
|
270
|
+
[t]
|
|
271
|
+
), o = t.account?.institutionName || "", i = t.repeating_transaction_type === R.Income, m = Q(r, t, !0);
|
|
272
|
+
return /* @__PURE__ */ c(re, { disableGutters: !0, disablePadding: !0, children: [
|
|
273
|
+
/* @__PURE__ */ c(ie, { onClick: () => {
|
|
274
|
+
n(t), s(!0);
|
|
275
|
+
}, children: [
|
|
276
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
277
|
+
j,
|
|
278
|
+
{
|
|
279
|
+
categoryGuid: d,
|
|
280
|
+
merchantGuid: t.merchant_guid
|
|
281
|
+
}
|
|
282
|
+
) }),
|
|
283
|
+
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(y, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
|
|
284
|
+
/* @__PURE__ */ c(y, { direction: "column", sx: { width: "50%" }, children: [
|
|
285
|
+
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.description }),
|
|
286
|
+
/* @__PURE__ */ c(y, { alignItems: "center", direction: "row", gap: 6, children: [
|
|
287
|
+
t.account?.institution_guid && /* @__PURE__ */ e(
|
|
288
|
+
de,
|
|
289
|
+
{
|
|
290
|
+
alt: o,
|
|
291
|
+
institutionGuid: t.account?.institution_guid,
|
|
292
|
+
size: 12
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
/* @__PURE__ */ e(x, { variant: "caption", children: o })
|
|
296
|
+
] })
|
|
297
|
+
] }),
|
|
298
|
+
/* @__PURE__ */ c(y, { alignItems: "flex-end", sx: { width: "50%" }, children: [
|
|
299
|
+
/* @__PURE__ */ c(
|
|
300
|
+
x,
|
|
301
|
+
{
|
|
302
|
+
bold: !0,
|
|
303
|
+
color: i ? "success.main" : "text.primary",
|
|
304
|
+
variant: "body1",
|
|
305
|
+
children: [
|
|
306
|
+
i ? "+" : "",
|
|
307
|
+
Z(t.amount, "0,0.00")
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
/* @__PURE__ */ e(
|
|
312
|
+
y,
|
|
313
|
+
{
|
|
314
|
+
direction: "row",
|
|
315
|
+
sx: {
|
|
316
|
+
alignItems: "center",
|
|
317
|
+
gap: 6,
|
|
318
|
+
justifyContent: "flex-end",
|
|
319
|
+
textTransform: "uppercase",
|
|
320
|
+
width: "100%"
|
|
321
|
+
},
|
|
322
|
+
children: /* @__PURE__ */ e(x, { bold: !0, color: "text.secondary", variant: "caption", children: m })
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
] })
|
|
326
|
+
] }) })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ e(
|
|
329
|
+
O,
|
|
330
|
+
{
|
|
331
|
+
ariaLabelClose: r.close_drawer_aria,
|
|
332
|
+
isOpen: a,
|
|
333
|
+
onClose: () => s(!1),
|
|
334
|
+
title: t.repeating_transaction_type === R.Income ? r.income_details : r.expense_details,
|
|
335
|
+
children: /* @__PURE__ */ e(
|
|
336
|
+
Fe,
|
|
337
|
+
{
|
|
338
|
+
onDeleted: () => s(!1),
|
|
339
|
+
recurringTransaction: t
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
] });
|
|
345
|
+
}
|
|
346
|
+
), Pe = A(
|
|
347
|
+
({
|
|
348
|
+
bgcolor: n = "background.default",
|
|
349
|
+
description: t,
|
|
350
|
+
onSearch: r,
|
|
351
|
+
onSelected: a
|
|
352
|
+
}) => {
|
|
353
|
+
const { recurring: s } = w(), { searchValue: d, setSearchValue: o } = fe();
|
|
354
|
+
return /* @__PURE__ */ c(y, { sx: { bgcolor: n, gap: 16, pt: 8 }, children: [
|
|
355
|
+
t && /* @__PURE__ */ e(P, { sx: { mx: 24 }, children: t }),
|
|
356
|
+
/* @__PURE__ */ e(
|
|
357
|
+
ke,
|
|
358
|
+
{
|
|
359
|
+
ariaLabel: s.select_transaction_search_aria,
|
|
360
|
+
cancelAriaLabel: s.select_transaction_search_cancel_aria,
|
|
361
|
+
onChange: (i) => {
|
|
362
|
+
o(i), r(i);
|
|
363
|
+
},
|
|
364
|
+
placeholder: s.select_transaction_search_placeholder,
|
|
365
|
+
searchValue: d
|
|
366
|
+
}
|
|
367
|
+
),
|
|
368
|
+
/* @__PURE__ */ e(H, { bgcolor: n, height: "auto", onClick: a, showLoader: !1 })
|
|
369
|
+
] });
|
|
370
|
+
}
|
|
371
|
+
), Ye = A(
|
|
372
|
+
({
|
|
373
|
+
bgcolor: n = "background.default",
|
|
374
|
+
firstDay: t,
|
|
375
|
+
secondDay: r,
|
|
376
|
+
frequency: a,
|
|
377
|
+
onFrequencyChange: s,
|
|
378
|
+
onFirstDayChange: d,
|
|
379
|
+
onSecondDayChange: o,
|
|
380
|
+
transaction: i
|
|
381
|
+
}) => {
|
|
382
|
+
const { recurring: m } = w();
|
|
383
|
+
return /* @__PURE__ */ c(y, { bgcolor: n, gap: 24, height: "100%", children: [
|
|
384
|
+
/* @__PURE__ */ c(y, { children: [
|
|
385
|
+
/* @__PURE__ */ e(ge, { bgcolor: n, children: Ne(i.date) }),
|
|
386
|
+
/* @__PURE__ */ e(Ce, { transaction: i })
|
|
387
|
+
] }),
|
|
388
|
+
/* @__PURE__ */ e(x, { bold: !0, sx: { mx: 24 }, variant: "Body", children: m.payment_schedule }),
|
|
389
|
+
/* @__PURE__ */ e(
|
|
390
|
+
V,
|
|
391
|
+
{
|
|
392
|
+
firstDay: t,
|
|
393
|
+
frequency: a,
|
|
394
|
+
onFirstDayChange: d,
|
|
395
|
+
onFrequencyChange: s,
|
|
396
|
+
onSecondDayChange: o,
|
|
397
|
+
secondDay: r
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
] });
|
|
401
|
+
}
|
|
402
|
+
), B = (n) => n.top_level_category_guid !== z.INCOME && n.transaction_type === J.DEBIT, Ue = (n, t) => B(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description.toLowerCase().includes(t.toLowerCase()) || n.feed_description.toLowerCase().includes(t.toLowerCase()) : !1, q = (n) => n.top_level_category_guid === z.INCOME || n.top_level_category_guid === z.TRANSFER && n.transaction_type === J.CREDIT, ze = (n, t) => q(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description?.toLowerCase().includes(t.toLowerCase()) || n.feed_description?.toLowerCase().includes(t.toLowerCase()) : !1, ee = A(
|
|
403
|
+
({
|
|
404
|
+
isIncome: n = !1,
|
|
405
|
+
label: t,
|
|
406
|
+
onAddRecurringTransaction: r = () => null
|
|
407
|
+
}) => {
|
|
408
|
+
const { recurring: a } = w(), { filter: s, setFilter: d, transactions: o } = X(), { addRepeatingTransaction: i } = M(), { user: m } = De(), [h, C] = u.useState(!1), [v, b] = u.useState(""), [f, D] = u.useState(l.EveryMonth), [g, p] = u.useState(1), [k, G] = u.useState(15), _ = u.useMemo(
|
|
409
|
+
() => o.find((S) => S.guid === v),
|
|
410
|
+
[v, o]
|
|
411
|
+
), te = () => {
|
|
412
|
+
C(!0), d(n ? { ...s, custom: q } : { ...s, custom: B });
|
|
413
|
+
}, ne = async () => {
|
|
414
|
+
if (!_) {
|
|
415
|
+
W();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
r();
|
|
419
|
+
const S = le(f, Oe(_.date)), I = {
|
|
420
|
+
account_guid: _.account_guid,
|
|
421
|
+
amount: _.amount,
|
|
422
|
+
created_by: 0,
|
|
423
|
+
// User
|
|
424
|
+
merchant_guid: _.merchant_guid,
|
|
425
|
+
description: _.payee || _.description || _.feed_description,
|
|
426
|
+
predicted_occurs_on: Le(S, { representation: "date" }),
|
|
427
|
+
recurrence_day: g,
|
|
428
|
+
recurrence_type: f,
|
|
429
|
+
repeating_transaction_type: n ? R.Income : R.Bill,
|
|
430
|
+
second_recurrence_day: k,
|
|
431
|
+
transaction_type: _.transaction_type,
|
|
432
|
+
user_guid: m.guid
|
|
433
|
+
};
|
|
434
|
+
await i(I, _), W();
|
|
435
|
+
}, W = () => {
|
|
436
|
+
b(""), C(!1);
|
|
437
|
+
};
|
|
438
|
+
return /* @__PURE__ */ c(E, { children: [
|
|
439
|
+
/* @__PURE__ */ e($, { onClick: te, startIcon: /* @__PURE__ */ e(pe, { size: 24 }), variant: "contained", children: t }),
|
|
440
|
+
/* @__PURE__ */ e(
|
|
441
|
+
O,
|
|
442
|
+
{
|
|
443
|
+
ariaLabelClose: a.close_drawer_aria,
|
|
444
|
+
isOpen: h,
|
|
445
|
+
onClose: () => C(!1),
|
|
446
|
+
title: t,
|
|
447
|
+
children: /* @__PURE__ */ e(
|
|
448
|
+
Pe,
|
|
449
|
+
{
|
|
450
|
+
description: n ? a.add_income_description : a.add_expense_description,
|
|
451
|
+
onSearch: (S) => {
|
|
452
|
+
d({
|
|
453
|
+
...s,
|
|
454
|
+
custom: (I) => n ? S ? ze(I, S) : q(I) : S ? Ue(I, S) : B(I)
|
|
455
|
+
});
|
|
456
|
+
},
|
|
457
|
+
onSelected: (S) => b(S)
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
}
|
|
461
|
+
),
|
|
462
|
+
/* @__PURE__ */ e(
|
|
463
|
+
O,
|
|
464
|
+
{
|
|
465
|
+
ariaLabelClose: a.close_drawer_aria,
|
|
466
|
+
isOpen: !!v,
|
|
467
|
+
onClose: () => b(""),
|
|
468
|
+
onPrimaryAction: ne,
|
|
469
|
+
title: n ? a.income_details : a.expense_details,
|
|
470
|
+
children: _ && /* @__PURE__ */ e(
|
|
471
|
+
Ye,
|
|
472
|
+
{
|
|
473
|
+
firstDay: g,
|
|
474
|
+
frequency: f,
|
|
475
|
+
onFirstDayChange: p,
|
|
476
|
+
onFrequencyChange: D,
|
|
477
|
+
onSecondDayChange: G,
|
|
478
|
+
secondDay: k,
|
|
479
|
+
transaction: _
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
] });
|
|
485
|
+
}
|
|
486
|
+
), Be = A(
|
|
487
|
+
({ zeroStateFor: n }) => {
|
|
488
|
+
const { recurring: t } = w(), { onEvent: r } = F(), a = n === "income", s = a ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title, d = a ? t.recurring_setting_zero_state_income_description : t.recurring_setting_zero_state_expenses_description, o = a ? t.add_income : t.add_expense;
|
|
489
|
+
return /* @__PURE__ */ c(y, { sx: { alignItems: "center", p: 24, pt: 48 }, children: [
|
|
490
|
+
/* @__PURE__ */ e(ye, { size: 48 }),
|
|
491
|
+
/* @__PURE__ */ e(P, { sx: { my: 8, fontWeight: 600 }, variant: "body1", children: s }),
|
|
492
|
+
/* @__PURE__ */ e(P, { color: "text.secondary", sx: { mb: 32 }, variant: "subtitle2", children: d }),
|
|
493
|
+
/* @__PURE__ */ e(
|
|
494
|
+
ee,
|
|
495
|
+
{
|
|
496
|
+
isIncome: a,
|
|
497
|
+
label: o,
|
|
498
|
+
onAddRecurringTransaction: () => {
|
|
499
|
+
r(
|
|
500
|
+
a ? T.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : T.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
)
|
|
505
|
+
] });
|
|
506
|
+
}
|
|
507
|
+
), wt = A(({ forOverview: n = !1 }) => {
|
|
508
|
+
const { recurring: t } = w(), { repeatingTransactions: r } = M(), { onEvent: a } = F(), s = (i) => {
|
|
509
|
+
a(T.RECURRING_TRANSACTIONS_CLICK_INCOME, {
|
|
510
|
+
repeating_transaction_guid: i.guid
|
|
511
|
+
});
|
|
512
|
+
}, d = () => {
|
|
513
|
+
a(T.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
|
|
514
|
+
}, o = r.filter(
|
|
515
|
+
(i) => i.repeating_transaction_type === R.Income && (i.transactions.length > 0 || i.recurrence_type === l.EveryYear)
|
|
516
|
+
);
|
|
517
|
+
return /* @__PURE__ */ e(E, { children: o.length !== 0 ? /* @__PURE__ */ c(E, { children: [
|
|
518
|
+
/* @__PURE__ */ e(
|
|
519
|
+
oe,
|
|
520
|
+
{
|
|
521
|
+
sx: {
|
|
522
|
+
height: n ? "calc(100% - 106px)" : "calc(100% - 126px)",
|
|
523
|
+
overflowY: "auto"
|
|
524
|
+
},
|
|
525
|
+
children: /* @__PURE__ */ e(K, { sx: { bgcolor: "background.paper" }, children: o.map((i, m) => /* @__PURE__ */ c(u.Fragment, { children: [
|
|
526
|
+
/* @__PURE__ */ e(Ge, { onClick: s, repeatingTransaction: i }),
|
|
527
|
+
/* @__PURE__ */ e(
|
|
528
|
+
L,
|
|
529
|
+
{
|
|
530
|
+
variant: m < o.length - 1 ? "inset" : "fullWidth"
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
] }, i.guid)) })
|
|
534
|
+
}
|
|
535
|
+
),
|
|
536
|
+
/* @__PURE__ */ e(L, {}),
|
|
537
|
+
/* @__PURE__ */ e(
|
|
538
|
+
y,
|
|
539
|
+
{
|
|
540
|
+
direction: "row",
|
|
541
|
+
sx: {
|
|
542
|
+
alignContent: "center",
|
|
543
|
+
bgcolor: "background.paper",
|
|
544
|
+
bottom: 0,
|
|
545
|
+
height: 68,
|
|
546
|
+
justifyContent: "flex-end",
|
|
547
|
+
position: "absolute",
|
|
548
|
+
px: 24,
|
|
549
|
+
py: 12,
|
|
550
|
+
width: "100%"
|
|
551
|
+
},
|
|
552
|
+
children: /* @__PURE__ */ e(
|
|
553
|
+
ee,
|
|
554
|
+
{
|
|
555
|
+
isIncome: !0,
|
|
556
|
+
label: t.add_income,
|
|
557
|
+
onAddRecurringTransaction: d
|
|
558
|
+
}
|
|
559
|
+
)
|
|
560
|
+
}
|
|
561
|
+
)
|
|
562
|
+
] }) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
|
|
563
|
+
});
|
|
564
|
+
export {
|
|
565
|
+
ee as A,
|
|
566
|
+
wt as M,
|
|
567
|
+
Ge as R,
|
|
568
|
+
Pe as S,
|
|
569
|
+
Be as a,
|
|
570
|
+
Fe as b,
|
|
571
|
+
Ye as c,
|
|
572
|
+
q as d,
|
|
573
|
+
ze as i
|
|
574
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as e, Fragment as g, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { observer as u } from "mobx-react-lite";
|
|
4
|
+
import h from "@mui/material/Box";
|
|
5
|
+
import p from "@mui/material/Tab";
|
|
6
|
+
import R from "@mui/material/Tabs";
|
|
7
|
+
import l from "@mui/material/Divider";
|
|
8
|
+
import T from "@mui/material/List";
|
|
9
|
+
import C from "@mui/material/Stack";
|
|
10
|
+
import { R as S, A as x, a as E, M as A } from "./ManageIncome-BtKRPjvO.mjs";
|
|
11
|
+
import { u as _, h as v, e as b } from "./hooks-02T565vf.mjs";
|
|
12
|
+
import { R as y, F as N } from "./RepeatingTransaction-BPWfaB3f.mjs";
|
|
13
|
+
import { A as d } from "./WidgetContainer-BG-fdDOf.mjs";
|
|
14
|
+
const I = u(() => {
|
|
15
|
+
const { recurring: n } = _(), { repeatingTransactions: s } = v(), { onEvent: t } = b(), o = (r) => {
|
|
16
|
+
t(d.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
|
|
17
|
+
repeating_transaction_guid: r.guid
|
|
18
|
+
});
|
|
19
|
+
}, c = () => {
|
|
20
|
+
t(d.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
|
|
21
|
+
}, a = s.filter(
|
|
22
|
+
(r) => r.repeating_transaction_type !== y.Income && (r.transactions.length > 0 || r.recurrence_type === N.EveryYear)
|
|
23
|
+
);
|
|
24
|
+
return /* @__PURE__ */ e(g, { children: a.length !== 0 ? /* @__PURE__ */ i(g, { children: [
|
|
25
|
+
/* @__PURE__ */ e(h, { sx: { height: "calc(100% - 126px)", overflowY: "auto" }, children: /* @__PURE__ */ e(T, { sx: { bgcolor: "background.paper" }, children: a.map((r, f) => /* @__PURE__ */ i(m.Fragment, { children: [
|
|
26
|
+
/* @__PURE__ */ e(S, { onClick: o, repeatingTransaction: r }),
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
l,
|
|
29
|
+
{
|
|
30
|
+
variant: f < a.length - 1 ? "inset" : "fullWidth"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }, r.guid)) }) }),
|
|
34
|
+
/* @__PURE__ */ e(l, {}),
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
C,
|
|
37
|
+
{
|
|
38
|
+
direction: "row",
|
|
39
|
+
sx: {
|
|
40
|
+
alignContent: "center",
|
|
41
|
+
bgcolor: "background.paper",
|
|
42
|
+
bottom: 0,
|
|
43
|
+
height: 68,
|
|
44
|
+
justifyContent: "flex-end",
|
|
45
|
+
position: "absolute",
|
|
46
|
+
px: 24,
|
|
47
|
+
py: 12,
|
|
48
|
+
width: "100%"
|
|
49
|
+
},
|
|
50
|
+
children: /* @__PURE__ */ e(x, { label: n.add_expense, onAddRecurringTransaction: c })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }) : /* @__PURE__ */ e(E, { zeroStateFor: "expenses" }) });
|
|
54
|
+
}), W = u(() => {
|
|
55
|
+
const [n, s] = m.useState(0), { onEvent: t } = b(), { recurring: o } = _();
|
|
56
|
+
return /* @__PURE__ */ i(h, { bgcolor: "background.default", height: "100%", children: [
|
|
57
|
+
/* @__PURE__ */ i(
|
|
58
|
+
R,
|
|
59
|
+
{
|
|
60
|
+
onChange: (a, r) => {
|
|
61
|
+
s(r), t(
|
|
62
|
+
r === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
sx: { bgcolor: "background.paper" },
|
|
66
|
+
value: n,
|
|
67
|
+
variant: "fullWidth",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ e(p, { label: o.expenses }),
|
|
70
|
+
/* @__PURE__ */ e(p, { label: o.income })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
n === 0 && /* @__PURE__ */ e(I, {}),
|
|
75
|
+
n === 1 && /* @__PURE__ */ e(A, {})
|
|
76
|
+
] });
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
I as M,
|
|
80
|
+
W as R
|
|
81
|
+
};
|
package/dist/budgets/index.es.js
CHANGED
|
@@ -46,7 +46,7 @@ import { u as Qe, b as et } from "../CategorySelectorDrawer-Dyzb3UDU.mjs";
|
|
|
46
46
|
import Te from "@mui/material/CardHeader";
|
|
47
47
|
import { subDays as tt } from "date-fns/subDays";
|
|
48
48
|
import nt from "@mui/material/IconButton";
|
|
49
|
-
import { M as ot } from "../ManageIncome-
|
|
49
|
+
import { M as ot } from "../ManageIncome-BtKRPjvO.mjs";
|
|
50
50
|
const ye = 5, at = 100, rt = 25, st = (t) => {
|
|
51
51
|
const o = (a) => {
|
|
52
52
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
@@ -942,9 +942,9 @@ const ht = ({
|
|
|
942
942
|
isOpen: f,
|
|
943
943
|
onClose: () => _(!1),
|
|
944
944
|
title: n.manage_income,
|
|
945
|
-
children: /* @__PURE__ */ d(b, { gap: 4, children: [
|
|
945
|
+
children: /* @__PURE__ */ d(b, { gap: 4, sx: { height: "100%" }, children: [
|
|
946
946
|
/* @__PURE__ */ e(p, { bold: !0, sx: { mt: 12, mx: 24 }, variant: "Small", children: s.income_title }),
|
|
947
|
-
/* @__PURE__ */ e(ot, {})
|
|
947
|
+
/* @__PURE__ */ e(ot, { forOverview: !0 })
|
|
948
948
|
] })
|
|
949
949
|
}
|
|
950
950
|
)
|