@mx-cartographer/experiences 7.12.16 → 7.13.0
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 +8 -0
- package/dist/{AccountDetailsHeader-DkBNsLsI.mjs → AccountDetailsHeader-D9gbTbUt.mjs} +31 -31
- package/dist/{AccountFields-DeZSQOuM.mjs → AccountFields-CxqONzjY.mjs} +7 -7
- package/dist/AccountListItem-LcJVJysf.mjs +90 -0
- package/dist/{AccountStore-Brc0MNSF.mjs → AccountStore-BNlTuxWN.mjs} +12 -6
- package/dist/Accounts-o7ohkngR.mjs +27 -0
- package/dist/{BudgetUtil--_QXyszn.mjs → BudgetUtil-CLhRnCoX.mjs} +75 -75
- package/dist/{CashflowStore-DEdQJU5i.mjs → CashflowStore-D3MKniVM.mjs} +11 -11
- package/dist/{CategorySelectorDrawer-wfUTIbLR.mjs → CategorySelectorDrawer-DYHNBd2v.mjs} +31 -31
- package/dist/{ConnectDrawer-CioFo6Wy.mjs → ConnectDrawer-C0wjwcJt.mjs} +1 -1
- package/dist/{ConnectionsDrawer-DqhSaMrJ.mjs → ConnectionsDrawer-IA7vnv1J.mjs} +1 -1
- package/dist/{Drawer-DV4NTsFg.mjs → Drawer-Bbe4AMB1.mjs} +5 -5
- package/dist/{GoalStore-0bd-Upkc.mjs → GoalStore-DB58sKTC.mjs} +8 -8
- package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
- package/dist/{Help-CDu1Fvrc.mjs → Help-CpLfyvPv.mjs} +24 -24
- package/dist/{LineChart-B1qbKR8q.mjs → LineChart-DBSlRSEm.mjs} +102 -102
- package/dist/{ManageIncome-BnWWjP2g.mjs → ManageIncome-QvqN555q.mjs} +62 -62
- package/dist/{MiniWidgetContainer-Cu72GNsE.mjs → MiniWidgetContainer-xLWSV6Wz.mjs} +13 -13
- package/dist/{NetWorthStore-DP78lgZ0.mjs → NetWorthStore-BqZ44-4M.mjs} +1 -1
- package/dist/{NotificationSettings-BH2yOwTB.mjs → NotificationSettings-DU3vJh5J.mjs} +139 -139
- package/dist/{OriginalBalanceAction-BM6rT_Cn.mjs → OriginalBalanceAction-DjpvVVFz.mjs} +6 -6
- package/dist/{RecurringSettings-BmXtfHtK.mjs → RecurringSettings-DdOcok2e.mjs} +2 -2
- package/dist/{RecurringTransactions-CYNpe_RS.mjs → RecurringTransactions-BOzBqfdg.mjs} +11 -11
- package/dist/{RecurringTransactionsStore-BD-OfVZ-.mjs → RecurringTransactionsStore-CcfPS0d3.mjs} +1 -1
- package/dist/{SpendingLegend-Bq6aXMNh.mjs → SpendingLegend-CJjjTGBw.mjs} +76 -76
- package/dist/{StatusIndicator-BV3oFzxo.mjs → StatusIndicator-CIKUOoN_.mjs} +53 -53
- package/dist/{TransactionDetails-DYlTwSDt.mjs → TransactionDetails-BpcWeXNU.mjs} +350 -350
- package/dist/{WidgetContainer-B0ncgABX.mjs → WidgetContainer-D_iaToWJ.mjs} +12 -12
- package/dist/accounts/index.es.js +107 -107
- package/dist/accounts/utils/Accounts.d.ts +1 -1
- package/dist/analytics/index.es.js +18 -18
- package/dist/budgets/index.es.js +182 -182
- package/dist/cashflow/index.es.js +223 -223
- package/dist/categories/index.es.js +1 -1
- package/dist/common/index.es.js +54 -64
- package/dist/dashboard/index.es.js +9 -9
- package/dist/debts/index.es.js +469 -469
- package/dist/finstrong/index.es.js +68 -68
- package/dist/goals/index.es.js +437 -437
- package/dist/help/index.es.js +2 -2
- package/dist/insights/index.es.js +159 -159
- package/dist/investments/index.es.js +292 -292
- package/dist/merchants/index.es.js +12 -12
- package/dist/networth/index.es.js +175 -168
- package/dist/notifications/index.es.js +13 -13
- package/dist/recurringtransactions/index.es.js +69 -69
- package/dist/settings/index.es.js +187 -187
- package/dist/spending/index.es.js +58 -58
- package/dist/transactions/index.es.js +70 -70
- package/dist/trends/index.es.js +15 -15
- package/package.json +1 -1
- package/dist/AccountListItem-BIVhda6q.mjs +0 -90
- package/dist/Accounts-M-LTzStv.mjs +0 -27
- package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import k from "react";
|
|
3
3
|
import { css as R } from "@mxenabled/cssinjs";
|
|
4
4
|
import { addDays as G } from "date-fns/addDays";
|
|
@@ -12,10 +12,10 @@ import { isSameMonth as K } from "date-fns/isSameMonth";
|
|
|
12
12
|
import { startOfMonth as Q } from "date-fns/startOfMonth";
|
|
13
13
|
import { startOfToday as I } from "date-fns/startOfToday";
|
|
14
14
|
import { subMonths as U } from "date-fns/subMonths";
|
|
15
|
-
import
|
|
15
|
+
import C from "@mui/material/Button";
|
|
16
16
|
import V from "@mui/material/Paper";
|
|
17
17
|
import { H2 as X, Text as z, H3 as tt, P as et } from "@mxenabled/mxui";
|
|
18
|
-
import { ChevronLeft as nt, ChevronRight as
|
|
18
|
+
import { ChevronLeft as nt, ChevronRight as ot, Icon as rt } from "@mxenabled/mx-icons";
|
|
19
19
|
import { f as at, D as it } from "./DateFormats-BMpMrZpW.mjs";
|
|
20
20
|
import { isSameDay as f } from "date-fns/isSameDay";
|
|
21
21
|
import { isWithinInterval as st } from "date-fns/isWithinInterval";
|
|
@@ -33,24 +33,24 @@ import { b as T } from "./Category-CevNQ03n.mjs";
|
|
|
33
33
|
import { b as j } from "./Localization-CPkpIwIx.mjs";
|
|
34
34
|
import { f as O } from "./NumberFormatting-QCaNwbjv.mjs";
|
|
35
35
|
const W = (t, n) => t.find((e) => e.guid === n), xt = (t, n) => t.find((e) => e.guid === n), yt = (t, n) => {
|
|
36
|
-
const e = t.find((
|
|
36
|
+
const e = t.find((o) => o.subCategories.find((a) => a.guid === n));
|
|
37
37
|
if (e)
|
|
38
|
-
return e.subCategories.find((
|
|
38
|
+
return e.subCategories.find((o) => o.guid === n);
|
|
39
39
|
}, ce = (t, n) => {
|
|
40
40
|
const e = [];
|
|
41
|
-
for (const
|
|
42
|
-
const a = W(t,
|
|
41
|
+
for (const o of n) {
|
|
42
|
+
const a = W(t, o.category_guid);
|
|
43
43
|
if (!a) continue;
|
|
44
44
|
const s = a.parent_guid ?? a.guid, d = W(t, s);
|
|
45
45
|
if (!d) continue;
|
|
46
46
|
const i = {
|
|
47
|
-
amount:
|
|
47
|
+
amount: o.total,
|
|
48
48
|
category: a,
|
|
49
49
|
guid: a.guid,
|
|
50
50
|
subCategoryTotals: []
|
|
51
51
|
}, l = e.find((m) => m.guid === s);
|
|
52
|
-
l ? (l.amount +=
|
|
53
|
-
amount:
|
|
52
|
+
l ? (l.amount += o.total, l.subCategoryTotals.push(i)) : e.push({
|
|
53
|
+
amount: o.total,
|
|
54
54
|
category: d,
|
|
55
55
|
guid: s,
|
|
56
56
|
subCategoryTotals: [i]
|
|
@@ -58,18 +58,18 @@ const W = (t, n) => t.find((e) => e.guid === n), xt = (t, n) => t.find((e) => e.
|
|
|
58
58
|
}
|
|
59
59
|
return e;
|
|
60
60
|
}, le = (t, n) => {
|
|
61
|
-
const e = t.find((
|
|
61
|
+
const e = t.find((o) => o.guid === n);
|
|
62
62
|
return e ? e.guid === T.INCOME || e.parent_guid === T.INCOME : !1;
|
|
63
|
-
},
|
|
64
|
-
const a =
|
|
63
|
+
}, bt = ({ copy: t, date: n, onNextClick: e, onPreviousClick: o }) => {
|
|
64
|
+
const a = Ct();
|
|
65
65
|
return /* @__PURE__ */ h("div", { className: `mx-cmn-calendar-header ${a}`, children: [
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ r(X, { className: "mx-cmn-calendar-header-title", variant: "h3", children: at(n, it.MONTH_YEAR) }),
|
|
67
67
|
/* @__PURE__ */ h("div", { className: "mx-cmn-calendar-header-button-container", children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ r(C, { "aria-label": t.prevAria, onClick: o, children: /* @__PURE__ */ r(nt, { size: 24 }) }),
|
|
69
|
+
/* @__PURE__ */ r(C, { "aria-label": t.nextAria, onClick: e, children: /* @__PURE__ */ r(ot, { size: 24 }) })
|
|
70
70
|
] })
|
|
71
71
|
] });
|
|
72
|
-
},
|
|
72
|
+
}, Ct = () => R({
|
|
73
73
|
alignItems: "center",
|
|
74
74
|
display: "flex",
|
|
75
75
|
marginBottom: 16,
|
|
@@ -82,19 +82,19 @@ const W = (t, n) => t.find((e) => e.guid === n), xt = (t, n) => t.find((e) => e.
|
|
|
82
82
|
display: "flex",
|
|
83
83
|
gap: 4
|
|
84
84
|
}
|
|
85
|
-
}), vt = ({ beginDate: t, date: n, endDate: e, isInMonth:
|
|
85
|
+
}), vt = ({ beginDate: t, date: n, endDate: e, isInMonth: o, onClick: a }) => {
|
|
86
86
|
const s = ct(), d = kt(s), i = t && e && st(n, { start: t, end: e }) && !f(n, t) && !f(n, e), l = t && e && f(t, n) && !f(t, e), m = e && t && f(e, n) && !f(t, e), u = t && f(t, n) || e && f(e, n), p = f(n, I());
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ r(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
90
|
className: `
|
|
91
91
|
mx-cmn-calendar-day
|
|
92
92
|
${d}
|
|
93
|
-
${
|
|
93
|
+
${o ? "" : "mx-cmn-out-of-month"}
|
|
94
94
|
${i ? "mx-cmn-date-interval" : ""}
|
|
95
95
|
`,
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
-
|
|
96
|
+
children: /* @__PURE__ */ r(
|
|
97
|
+
C,
|
|
98
98
|
{
|
|
99
99
|
className: `
|
|
100
100
|
mx-cmn-calendar-day-button
|
|
@@ -104,14 +104,14 @@ const W = (t, n) => t.find((e) => e.guid === n), xt = (t, n) => t.find((e) => e.
|
|
|
104
104
|
color: u ? "primary" : "secondary",
|
|
105
105
|
onClick: () => a(n),
|
|
106
106
|
variant: u ? "contained" : "text",
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ r(
|
|
108
108
|
z,
|
|
109
109
|
{
|
|
110
110
|
className: `
|
|
111
111
|
mx-cmn-calendar-day-text
|
|
112
112
|
${u ? "mx-cmn-day-selected" : ""}
|
|
113
113
|
${p ? "mx-cmn-today" : ""}`,
|
|
114
|
-
variant: "
|
|
114
|
+
variant: "body2",
|
|
115
115
|
children: L(n, "d")
|
|
116
116
|
}
|
|
117
117
|
)
|
|
@@ -165,48 +165,48 @@ const W = (t, n) => t.find((e) => e.guid === n), xt = (t, n) => t.find((e) => e.
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}), Bt = 340, B = 44;
|
|
168
|
-
var
|
|
169
|
-
const
|
|
168
|
+
var wt = /* @__PURE__ */ ((t) => (t.None = "None", t.Single = "Single", t.Range = "Range", t))(wt || {});
|
|
169
|
+
const _t = ({
|
|
170
170
|
copy: t,
|
|
171
171
|
beginDate: n = void 0,
|
|
172
172
|
endDate: e = void 0,
|
|
173
|
-
onDateSelected:
|
|
173
|
+
onDateSelected: o,
|
|
174
174
|
onRangeSelected: a,
|
|
175
175
|
selectionType: s = "Single"
|
|
176
176
|
/* Single */
|
|
177
177
|
}) => {
|
|
178
|
-
const d =
|
|
178
|
+
const d = St(), [i, l] = k.useState(I), [m, u] = k.useState(n), [p, g] = k.useState(e);
|
|
179
179
|
k.useEffect(() => {
|
|
180
180
|
u(n), g(e), n && l(n);
|
|
181
181
|
}, [n, e]);
|
|
182
182
|
const v = k.useMemo(() => {
|
|
183
183
|
const c = Z({ start: Q(i), end: q(i) }), y = [];
|
|
184
|
-
for (let
|
|
185
|
-
const
|
|
184
|
+
for (let b = 0; b < c.length; b++) {
|
|
185
|
+
const w = c[b], $ = Y({ start: w, end: G(w, 6) }), A = [];
|
|
186
186
|
for (let M = 0; M < $.length; M++)
|
|
187
187
|
A.push($[M]);
|
|
188
188
|
y.push(A);
|
|
189
189
|
}
|
|
190
190
|
return y;
|
|
191
|
-
}, [i]),
|
|
191
|
+
}, [i]), _ = (c) => {
|
|
192
192
|
if (s !== "None") {
|
|
193
193
|
if (s === "Single") {
|
|
194
|
-
u(c),
|
|
194
|
+
u(c), o?.(c);
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
!m || p ? (u(c), g(void 0)) : J(c, m) ? (g(m), u(c), a?.(c, m)) : (g(c), a?.(m, c));
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, S = () => {
|
|
200
200
|
const c = I();
|
|
201
|
-
l(c), s !== "None" && (u(c), s === "Single" ?
|
|
201
|
+
l(c), s !== "None" && (u(c), s === "Single" ? o?.(c) : (g(c), a?.(c, c)));
|
|
202
202
|
}, N = () => {
|
|
203
203
|
l(P(i, 1));
|
|
204
204
|
}, x = () => {
|
|
205
205
|
l(U(i, 1));
|
|
206
206
|
};
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
|
|
207
|
+
return /* @__PURE__ */ r("div", { className: `mx-cmn-calendar ${d}`, children: /* @__PURE__ */ h(V, { sx: { boxShadow: "none" }, children: [
|
|
208
|
+
/* @__PURE__ */ r(
|
|
209
|
+
bt,
|
|
210
210
|
{
|
|
211
211
|
copy: t,
|
|
212
212
|
date: i,
|
|
@@ -214,21 +214,21 @@ const wt = ({
|
|
|
214
214
|
onPreviousClick: x
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
v.map((c, y) => /* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ r("div", { className: "mx-cmn-calendar-header-row", children: v[0].map((c, y) => /* @__PURE__ */ r("div", { className: "mx-cmn-calendar-header-cell", children: /* @__PURE__ */ r(z, { bold: !0, variant: "body2", children: L(c, "EEEEE") }) }, y)) }),
|
|
218
|
+
v.map((c, y) => /* @__PURE__ */ r("div", { className: "mx-cmn-calendar-week", children: c.map((b, w) => /* @__PURE__ */ r(
|
|
219
219
|
vt,
|
|
220
220
|
{
|
|
221
221
|
beginDate: m,
|
|
222
|
-
date:
|
|
222
|
+
date: b,
|
|
223
223
|
endDate: p,
|
|
224
|
-
isInMonth: K(
|
|
225
|
-
onClick:
|
|
224
|
+
isInMonth: K(b, i),
|
|
225
|
+
onClick: _
|
|
226
226
|
},
|
|
227
|
-
|
|
227
|
+
w
|
|
228
228
|
)) }, `w-${y}`)),
|
|
229
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ r("div", { className: "mx-cmn-calendar-today-container", children: /* @__PURE__ */ r(C, { onClick: S, size: "small", variant: "text", children: t.today }) })
|
|
230
230
|
] }) });
|
|
231
|
-
},
|
|
231
|
+
}, St = () => R({
|
|
232
232
|
width: Bt,
|
|
233
233
|
"& .MuiPaper-root": {
|
|
234
234
|
paddingLeft: 24,
|
|
@@ -269,11 +269,11 @@ const wt = ({
|
|
|
269
269
|
marginRight: "auto"
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
}), de =
|
|
272
|
+
}), de = _t, Nt = ({
|
|
273
273
|
closeAriaLabel: t,
|
|
274
274
|
content: n,
|
|
275
275
|
inputLabel: e,
|
|
276
|
-
inputValue:
|
|
276
|
+
inputValue: o,
|
|
277
277
|
isOpen: a,
|
|
278
278
|
handleInputChange: s,
|
|
279
279
|
handleModalClose: d,
|
|
@@ -285,8 +285,8 @@ const wt = ({
|
|
|
285
285
|
secondaryText: g,
|
|
286
286
|
title: v
|
|
287
287
|
}) => {
|
|
288
|
-
const
|
|
289
|
-
return /* @__PURE__ */
|
|
288
|
+
const _ = parseFloat(o ?? "0"), S = o !== "" && o !== "0" && !isNaN(_), { isSmallMobile: N } = pt();
|
|
289
|
+
return /* @__PURE__ */ r(
|
|
290
290
|
lt,
|
|
291
291
|
{
|
|
292
292
|
"aria-label": v,
|
|
@@ -299,7 +299,7 @@ const wt = ({
|
|
|
299
299
|
"& .MuiDialogContent-root": { p: 0 },
|
|
300
300
|
...N && { "& .MuiDialog-paper": { minWidth: "100%" } }
|
|
301
301
|
},
|
|
302
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ r(mt, { children: /* @__PURE__ */ h(
|
|
303
303
|
"form",
|
|
304
304
|
{
|
|
305
305
|
onSubmit: (x) => {
|
|
@@ -320,26 +320,26 @@ const wt = ({
|
|
|
320
320
|
pt: 24
|
|
321
321
|
},
|
|
322
322
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ r(tt, { id: "modal-title", children: v }),
|
|
324
|
+
/* @__PURE__ */ r(
|
|
325
325
|
ut,
|
|
326
326
|
{
|
|
327
327
|
"aria-label": t,
|
|
328
328
|
onClick: d,
|
|
329
329
|
sx: { minHeight: 24, position: "absolute", right: 8, top: 18 },
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ r(rt, { name: "close", sx: { color: "action.active" } })
|
|
331
331
|
}
|
|
332
332
|
)
|
|
333
333
|
]
|
|
334
334
|
}
|
|
335
335
|
),
|
|
336
336
|
/* @__PURE__ */ h(E, { sx: { gap: 24, px: 24 }, children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
e && /* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ r(et, { variant: "subtitle1", children: n }),
|
|
338
|
+
e && /* @__PURE__ */ r(
|
|
339
339
|
ft,
|
|
340
340
|
{
|
|
341
341
|
InputProps: {
|
|
342
|
-
startAdornment: /* @__PURE__ */
|
|
342
|
+
startAdornment: /* @__PURE__ */ r(gt, { position: "start", children: "$" })
|
|
343
343
|
},
|
|
344
344
|
autoFocus: !0,
|
|
345
345
|
inputMode: "decimal",
|
|
@@ -353,7 +353,7 @@ const wt = ({
|
|
|
353
353
|
/^\d*\.?\d*$/.test(x) && s?.(x);
|
|
354
354
|
},
|
|
355
355
|
type: "text",
|
|
356
|
-
value:
|
|
356
|
+
value: o
|
|
357
357
|
}
|
|
358
358
|
)
|
|
359
359
|
] }),
|
|
@@ -367,8 +367,8 @@ const wt = ({
|
|
|
367
367
|
">:not(style)~:not(style)": { ml: 0 }
|
|
368
368
|
},
|
|
369
369
|
children: [
|
|
370
|
-
g && /* @__PURE__ */
|
|
371
|
-
|
|
370
|
+
g && /* @__PURE__ */ r(
|
|
371
|
+
C,
|
|
372
372
|
{
|
|
373
373
|
"aria-label": g,
|
|
374
374
|
color: p,
|
|
@@ -376,12 +376,12 @@ const wt = ({
|
|
|
376
376
|
children: g
|
|
377
377
|
}
|
|
378
378
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
|
|
379
|
+
/* @__PURE__ */ r(
|
|
380
|
+
C,
|
|
381
381
|
{
|
|
382
382
|
"aria-label": u,
|
|
383
383
|
color: m,
|
|
384
|
-
disabled: e ? !
|
|
384
|
+
disabled: e ? !S : !1,
|
|
385
385
|
onClick: i,
|
|
386
386
|
variant: "contained",
|
|
387
387
|
children: u
|
|
@@ -406,10 +406,10 @@ const wt = ({
|
|
|
406
406
|
}, ge = () => {
|
|
407
407
|
const { detailedBudgets: t } = ht();
|
|
408
408
|
return t.map((e) => {
|
|
409
|
-
const
|
|
410
|
-
return e.amount -
|
|
411
|
-
}).reduce((e,
|
|
412
|
-
}, fe = (t, n, e,
|
|
409
|
+
const o = e.transaction_total;
|
|
410
|
+
return e.amount - o;
|
|
411
|
+
}).reduce((e, o) => e + o, 0);
|
|
412
|
+
}, fe = (t, n, e, o) => {
|
|
413
413
|
const a = [];
|
|
414
414
|
for (const s of t) {
|
|
415
415
|
const d = xt(n, s.category_guid);
|
|
@@ -417,7 +417,7 @@ const wt = ({
|
|
|
417
417
|
const i = d.totalAmount, l = H(s.amount, i), m = s.amount - i;
|
|
418
418
|
a.push({
|
|
419
419
|
...s,
|
|
420
|
-
budgetColors: D(l,
|
|
420
|
+
budgetColors: D(l, o),
|
|
421
421
|
category: d,
|
|
422
422
|
description: j(
|
|
423
423
|
m < 0 ? e.budget_remaining_over : e.budget_remaining_left,
|
|
@@ -436,7 +436,7 @@ const wt = ({
|
|
|
436
436
|
const m = s.amount - i, u = H(s.amount, i);
|
|
437
437
|
l && l.subBudgets.push({
|
|
438
438
|
...s,
|
|
439
|
-
budgetColors: D(u,
|
|
439
|
+
budgetColors: D(u, o),
|
|
440
440
|
category: d,
|
|
441
441
|
description: j(
|
|
442
442
|
m < 0 ? e.budget_remaining_over : e.budget_remaining_left,
|
|
@@ -449,22 +449,22 @@ const wt = ({
|
|
|
449
449
|
}
|
|
450
450
|
return a;
|
|
451
451
|
}, F = (t, n) => t.find((e) => e.guid === n), pe = (t, n, e) => {
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
return F(
|
|
452
|
+
const o = F(t, e);
|
|
453
|
+
if (o)
|
|
454
|
+
return F(o.subBudgets, n);
|
|
455
455
|
}, he = (t, n) => {
|
|
456
|
-
const e = Math.max(0, n - t),
|
|
456
|
+
const e = Math.max(0, n - t), o = n > 0 ? Math.min(100, t / n * 100) : 0;
|
|
457
457
|
let a = "success";
|
|
458
|
-
return
|
|
458
|
+
return o >= 100 ? a = "error" : o >= 50 && (a = "warning"), {
|
|
459
459
|
remainingAmount: e,
|
|
460
|
-
spentPercentage:
|
|
460
|
+
spentPercentage: o,
|
|
461
461
|
iconColor: a
|
|
462
462
|
};
|
|
463
463
|
};
|
|
464
464
|
export {
|
|
465
465
|
me as C,
|
|
466
466
|
de as a,
|
|
467
|
-
|
|
467
|
+
wt as b,
|
|
468
468
|
pe as c,
|
|
469
469
|
fe as d,
|
|
470
470
|
W as e,
|
|
@@ -7,8 +7,8 @@ import { Text as a, Icon as d, IconWeight as u } from "@mxenabled/mxui";
|
|
|
7
7
|
import { makeAutoObservable as c } from "mobx";
|
|
8
8
|
import { addDays as x } from "date-fns/addDays";
|
|
9
9
|
import { differenceInDays as g } from "date-fns/differenceInDays";
|
|
10
|
-
import { endOfMonth as
|
|
11
|
-
import { isBefore as
|
|
10
|
+
import { endOfMonth as I } from "date-fns/endOfMonth";
|
|
11
|
+
import { isBefore as S } from "date-fns/isBefore";
|
|
12
12
|
import { startOfToday as s } from "date-fns/startOfToday";
|
|
13
13
|
const b = ({
|
|
14
14
|
body: o,
|
|
@@ -21,8 +21,8 @@ const b = ({
|
|
|
21
21
|
{
|
|
22
22
|
open: i,
|
|
23
23
|
title: /* @__PURE__ */ m(f, { gap: 2, p: 12, sx: { textOverflow: "none" }, children: [
|
|
24
|
-
/* @__PURE__ */ t(a, { bold: !0, variant: "
|
|
25
|
-
/* @__PURE__ */ t(a, { sx: { whiteSpace: "unset" }, variant: "
|
|
24
|
+
/* @__PURE__ */ t(a, { bold: !0, variant: "body1", children: n }),
|
|
25
|
+
/* @__PURE__ */ t(a, { sx: { whiteSpace: "unset" }, variant: "body2", children: o })
|
|
26
26
|
] }),
|
|
27
27
|
children: /* @__PURE__ */ t(
|
|
28
28
|
p,
|
|
@@ -48,8 +48,8 @@ const b = ({
|
|
|
48
48
|
)
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
-
},
|
|
52
|
-
class
|
|
51
|
+
}, N = b;
|
|
52
|
+
class y {
|
|
53
53
|
// Cashflow is hard-coded to display 30 days starting from today
|
|
54
54
|
dateRange = { start: s(), end: x(s(), 30) };
|
|
55
55
|
isDirty = !1;
|
|
@@ -67,7 +67,7 @@ class w {
|
|
|
67
67
|
// if there is no income activity
|
|
68
68
|
get expensesTilNextIncome() {
|
|
69
69
|
return this.upcomingExpenses.filter(
|
|
70
|
-
(e) =>
|
|
70
|
+
(e) => S(e.expectedDate, this.nextIncome?.expectedDate || I(/* @__PURE__ */ new Date()))
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
setNextIncome = (e) => {
|
|
@@ -78,11 +78,11 @@ class w {
|
|
|
78
78
|
};
|
|
79
79
|
setSelectedCashAccounts = (e) => this.selectedCashAccounts = e;
|
|
80
80
|
}
|
|
81
|
-
class
|
|
81
|
+
class P {
|
|
82
82
|
globalStore;
|
|
83
83
|
uiStore;
|
|
84
84
|
constructor(e) {
|
|
85
|
-
this.globalStore = e, this.uiStore = new
|
|
85
|
+
this.globalStore = e, this.uiStore = new y(), c(this);
|
|
86
86
|
}
|
|
87
87
|
completeOnboarding = async () => {
|
|
88
88
|
const e = {
|
|
@@ -93,6 +93,6 @@ class N {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
P as C,
|
|
97
|
+
N as I
|
|
98
98
|
};
|
|
@@ -12,19 +12,19 @@ import N from "@mui/material/ListItemButton";
|
|
|
12
12
|
import M from "@mui/material/ListItemIcon";
|
|
13
13
|
import G from "@mui/material/ListItemText";
|
|
14
14
|
import { CheckCircle as j, Edit as X, Delete as z, ExpandMore as q } from "@mxenabled/mx-icons";
|
|
15
|
-
import { Text as
|
|
15
|
+
import { Text as v, TextField as H, CategoryIcon as J } from "@mxenabled/mxui";
|
|
16
16
|
import Q from "@mui/material/Collapse";
|
|
17
17
|
import Z from "@mui/material/DialogContent";
|
|
18
18
|
import { b as g } from "./Localization-CPkpIwIx.mjs";
|
|
19
19
|
import { D as ee } from "./Dialog-Ck34yr-d.mjs";
|
|
20
20
|
import te from "@mui/material/Box";
|
|
21
21
|
import oe from "@mui/material/Chip";
|
|
22
|
-
import
|
|
22
|
+
import B from "@mui/material/IconButton";
|
|
23
23
|
import { u as ae } from "./useAriaLive-MkYebyUR.mjs";
|
|
24
24
|
import { S as re } from "./SearchBox-B7km148n.mjs";
|
|
25
25
|
import { L as P } from "./Loader-D3rjKx72.mjs";
|
|
26
|
-
import { D as ne } from "./Drawer-
|
|
27
|
-
const
|
|
26
|
+
import { D as ne } from "./Drawer-Bbe4AMB1.mjs";
|
|
27
|
+
const y = () => {
|
|
28
28
|
if (!E.useContext(V))
|
|
29
29
|
throw new Error("useCategoryUiStore() must be used within the GlobalDataContext");
|
|
30
30
|
return f().uiStore;
|
|
@@ -49,9 +49,9 @@ const se = ({
|
|
|
49
49
|
isOpen: l,
|
|
50
50
|
type: i
|
|
51
51
|
}) => {
|
|
52
|
-
const [a, c] = E.useState(e), { categories: r } = S(), { setShouldDisableDrawerScroll: n } =
|
|
52
|
+
const [a, c] = E.useState(e), { categories: r } = S(), { setShouldDisableDrawerScroll: n } = y();
|
|
53
53
|
let d = "", m = [];
|
|
54
|
-
const u = i === "delete", h = e.length > 50 ? `${e.slice(0, 50)}...` : e,
|
|
54
|
+
const u = i === "delete", h = e.length > 50 ? `${e.slice(0, 50)}...` : e, b = i === "edit" ? g(r.edit_subcategory_aria, h) : r.add_subcategory_aria;
|
|
55
55
|
switch (i) {
|
|
56
56
|
case "add":
|
|
57
57
|
d = r.add_subcategory_title;
|
|
@@ -62,7 +62,7 @@ const se = ({
|
|
|
62
62
|
case "delete":
|
|
63
63
|
d = r.delete_subcategory_heading, m = g(
|
|
64
64
|
r.all_transactions_in_this_subcategory,
|
|
65
|
-
/* @__PURE__ */ t(
|
|
65
|
+
/* @__PURE__ */ t(v, { bold: !0, children: g(r.all_parent_category, h) })
|
|
66
66
|
);
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
@@ -80,14 +80,14 @@ const se = ({
|
|
|
80
80
|
onPrimaryAction: () => {
|
|
81
81
|
n(!1), o(a);
|
|
82
82
|
},
|
|
83
|
-
children: /* @__PURE__ */ t(Z, { children: u ? /* @__PURE__ */ t(
|
|
83
|
+
children: /* @__PURE__ */ t(Z, { children: u ? /* @__PURE__ */ t(v, { children: m }) : /* @__PURE__ */ t(
|
|
84
84
|
H,
|
|
85
85
|
{
|
|
86
86
|
inputProps: {
|
|
87
|
-
"aria-label":
|
|
87
|
+
"aria-label": b,
|
|
88
88
|
maxLength: 50
|
|
89
89
|
},
|
|
90
|
-
label:
|
|
90
|
+
label: b,
|
|
91
91
|
name: "modify-subcategory",
|
|
92
92
|
onChange: (D) => c(D.target.value),
|
|
93
93
|
placeholder: r.input_placeholder,
|
|
@@ -98,7 +98,7 @@ const se = ({
|
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
}, R = p(se), ie = ({ announce: e, parentCategory: s }) => {
|
|
101
|
-
const [o, l] = E.useState(!1), { addCategory: i } = f(), { categories: a } = S(), { onEvent: c } = A(), { setShouldDisableDrawerScroll: r } =
|
|
101
|
+
const [o, l] = E.useState(!1), { addCategory: i } = f(), { categories: a } = S(), { onEvent: c } = A(), { setShouldDisableDrawerScroll: r } = y(), n = async (u) => {
|
|
102
102
|
await i(u.trim(), s.guid), e(g(a.add_subcategory_announcement, u)), c(C.ON_SUBCATEGORY_ADDED), l(!1);
|
|
103
103
|
}, d = async () => {
|
|
104
104
|
c(C.ON_SUBCATEGORY_ADD_CLICK), r(!0), l(!0);
|
|
@@ -110,7 +110,7 @@ const se = ({
|
|
|
110
110
|
G,
|
|
111
111
|
{
|
|
112
112
|
primary: a.add_subcategory_button,
|
|
113
|
-
primaryTypographyProps: { color: "primary", fontWeight: "normal", variant: "
|
|
113
|
+
primaryTypographyProps: { color: "primary", fontWeight: "normal", variant: "body1" }
|
|
114
114
|
}
|
|
115
115
|
) }),
|
|
116
116
|
o && /* @__PURE__ */ t(
|
|
@@ -179,7 +179,7 @@ const se = ({
|
|
|
179
179
|
showSelected: r,
|
|
180
180
|
unselectable: n,
|
|
181
181
|
unselectableText: d
|
|
182
|
-
} =
|
|
182
|
+
} = y(), { categories: m } = S(), { onEvent: u } = A(), [h, b] = E.useState(!1), [D, O] = E.useState(!1), T = !!o.revision, w = o.guid === i, I = !n.some(($) => $ === o.guid);
|
|
183
183
|
return /* @__PURE__ */ _(
|
|
184
184
|
x,
|
|
185
185
|
{
|
|
@@ -194,7 +194,7 @@ const se = ({
|
|
|
194
194
|
"aria-pressed": w,
|
|
195
195
|
color: "secondary",
|
|
196
196
|
onClick: () => {
|
|
197
|
-
|
|
197
|
+
I && (a(o.guid), l(o.guid), u(C.ON_CATEGORY_SELECTED));
|
|
198
198
|
},
|
|
199
199
|
sx: { height: 44 },
|
|
200
200
|
children: [
|
|
@@ -202,27 +202,27 @@ const se = ({
|
|
|
202
202
|
G,
|
|
203
203
|
{
|
|
204
204
|
primary: o.name,
|
|
205
|
-
primaryTypographyProps: { fontWeight: "normal", variant: "
|
|
205
|
+
primaryTypographyProps: { fontWeight: "normal", variant: "body1" }
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
208
|
r && w && /* @__PURE__ */ t(j, { fontSize: "small" }),
|
|
209
|
-
!
|
|
209
|
+
!I && /* @__PURE__ */ t(oe, { label: d })
|
|
210
210
|
]
|
|
211
211
|
}
|
|
212
212
|
),
|
|
213
213
|
T && /* @__PURE__ */ _(te, { className: "mx-cat-subcategory-edit-container", sx: { marginRight: 24 }, children: [
|
|
214
214
|
/* @__PURE__ */ t(
|
|
215
|
-
|
|
215
|
+
B,
|
|
216
216
|
{
|
|
217
217
|
"aria-label": g(m.edit_subcategory_title, o.name),
|
|
218
218
|
onClick: () => {
|
|
219
|
-
|
|
219
|
+
b(!0), c(!0), u(C.ON_SUBCATEGORY_EDIT_CLICK);
|
|
220
220
|
},
|
|
221
221
|
children: /* @__PURE__ */ t(X, { color: "secondary" })
|
|
222
222
|
}
|
|
223
223
|
),
|
|
224
224
|
/* @__PURE__ */ t(
|
|
225
|
-
|
|
225
|
+
B,
|
|
226
226
|
{
|
|
227
227
|
"aria-label": g(m.delete_subcategory_aria, o.name),
|
|
228
228
|
edge: "end",
|
|
@@ -247,7 +247,7 @@ const se = ({
|
|
|
247
247
|
de,
|
|
248
248
|
{
|
|
249
249
|
announce: e,
|
|
250
|
-
setShowRename:
|
|
250
|
+
setShowRename: b,
|
|
251
251
|
showRename: h,
|
|
252
252
|
subCategory: o
|
|
253
253
|
}
|
|
@@ -256,7 +256,7 @@ const se = ({
|
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
258
|
}, ge = p(Ce), _e = ({ categories: e, parentCategory: s }) => {
|
|
259
|
-
const { expandedGuid: o, searchValue: l } =
|
|
259
|
+
const { expandedGuid: o, searchValue: l } = y(), { announce: i, ariaLive: a } = ae(), c = s.guid === o, r = !!l;
|
|
260
260
|
return /* @__PURE__ */ _(
|
|
261
261
|
Q,
|
|
262
262
|
{
|
|
@@ -292,7 +292,7 @@ const se = ({
|
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}, Ee = p(_e), pe = ({ category: e, subCategories: s }) => {
|
|
295
|
-
const { expandedGuid: o, searchValue: l, setExpandedGuid: i } =
|
|
295
|
+
const { expandedGuid: o, searchValue: l, setExpandedGuid: i } = y(), { onEvent: a } = A(), c = e.guid === o, r = () => {
|
|
296
296
|
const n = e.guid !== o ? e.guid : null;
|
|
297
297
|
i(n), a(n ? C.ON_CATEGORY_EXPANDED : C.ON_CATEGORY_COLLAPSED);
|
|
298
298
|
};
|
|
@@ -311,7 +311,7 @@ const se = ({
|
|
|
311
311
|
G,
|
|
312
312
|
{
|
|
313
313
|
primary: e.name,
|
|
314
|
-
primaryTypographyProps: { fontWeight: "normal", variant: "
|
|
314
|
+
primaryTypographyProps: { fontWeight: "normal", variant: "body1" }
|
|
315
315
|
}
|
|
316
316
|
),
|
|
317
317
|
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
|
@@ -331,7 +331,7 @@ const se = ({
|
|
|
331
331
|
/* @__PURE__ */ t(Ee, { categories: s, parentCategory: e })
|
|
332
332
|
] });
|
|
333
333
|
}, he = p(pe), Se = () => {
|
|
334
|
-
const { categories: e } = f(), { searchValue: s } =
|
|
334
|
+
const { categories: e } = f(), { searchValue: s } = y(), { categories: o } = S(), i = ((a, c = "") => a.reduce((r, n) => {
|
|
335
335
|
if (n.parent_guid === null) {
|
|
336
336
|
const m = [
|
|
337
337
|
{
|
|
@@ -356,7 +356,7 @@ const se = ({
|
|
|
356
356
|
},
|
|
357
357
|
a.category.guid
|
|
358
358
|
)) }) });
|
|
359
|
-
},
|
|
359
|
+
}, be = p(Se), ye = ({
|
|
360
360
|
initialSelected: e,
|
|
361
361
|
onSelect: s = void 0,
|
|
362
362
|
showSelected: o = !0,
|
|
@@ -368,16 +368,16 @@ const se = ({
|
|
|
368
368
|
setOnSelect: m,
|
|
369
369
|
setSearchValue: u,
|
|
370
370
|
setSelectedGuid: h,
|
|
371
|
-
setShowSelected:
|
|
371
|
+
setShowSelected: b,
|
|
372
372
|
setUnselectable: D,
|
|
373
373
|
setUnselectableText: O
|
|
374
|
-
} =
|
|
374
|
+
} = y();
|
|
375
375
|
return E.useEffect(() => {
|
|
376
376
|
s && m(s);
|
|
377
377
|
}), E.useEffect(() => {
|
|
378
378
|
a.length || c();
|
|
379
379
|
}, []), E.useEffect(() => {
|
|
380
|
-
e && h(e),
|
|
380
|
+
e && h(e), b(o), D(l), O(i);
|
|
381
381
|
}, [e, o, l, i]), n ? /* @__PURE__ */ _(K, { className: "mx-cat-category-selector", sx: { width: "100%" }, children: [
|
|
382
382
|
/* @__PURE__ */ t(
|
|
383
383
|
re,
|
|
@@ -389,9 +389,9 @@ const se = ({
|
|
|
389
389
|
searchValue: d
|
|
390
390
|
}
|
|
391
391
|
),
|
|
392
|
-
/* @__PURE__ */ t(
|
|
392
|
+
/* @__PURE__ */ t(be, {})
|
|
393
393
|
] }) : /* @__PURE__ */ t(P, {});
|
|
394
|
-
}, De = p(
|
|
394
|
+
}, De = p(ye), fe = ({
|
|
395
395
|
id: e,
|
|
396
396
|
onClose: s,
|
|
397
397
|
title: o,
|
|
@@ -416,5 +416,5 @@ export {
|
|
|
416
416
|
De as C,
|
|
417
417
|
Je as a,
|
|
418
418
|
he as b,
|
|
419
|
-
|
|
419
|
+
y as u
|
|
420
420
|
};
|
|
@@ -6,7 +6,7 @@ import { ConnectWidget as x } from "@mxenabled/web-widget-sdk";
|
|
|
6
6
|
import { b as a, a as c } from "./Connect-eYIWqCEr.mjs";
|
|
7
7
|
import { M as i } from "./Accounts-CseLC3lL.mjs";
|
|
8
8
|
import { d as D, e as L, u as w } from "./hooks-BxkfR-Ff.mjs";
|
|
9
|
-
import { D as y } from "./Drawer-
|
|
9
|
+
import { D as y } from "./Drawer-Bbe4AMB1.mjs";
|
|
10
10
|
const I = ({
|
|
11
11
|
loadWidgetProps: l,
|
|
12
12
|
onClose: m,
|