@mx-cartographer/experiences 7.0.55-alpha.mega1 → 7.0.55-alpha.mega3
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/budgets/index.es.js +81 -81
- package/package.json +1 -1
package/dist/budgets/index.es.js
CHANGED
@@ -6,8 +6,8 @@ import { startOfMonth as q } from "date-fns/startOfMonth";
|
|
6
6
|
import F from "@mui/material/Box";
|
7
7
|
import S from "@mui/material/Stack";
|
8
8
|
import Q from "@mui/material/styles/useTheme";
|
9
|
-
import { Text as y, CategoryIcon as
|
10
|
-
import
|
9
|
+
import { Text as y, CategoryIcon as W, Icon as N, H1 as ze, H3 as xe } from "@mxenabled/mxui";
|
10
|
+
import H from "@mui/material/List";
|
11
11
|
import { u as w, i as D, j as ee, m as j, p as te, g as X, b as ne, h as oe, a as Ue, d as ve } from "../hooks-CE2TKk4a.mjs";
|
12
12
|
import { f as T } from "../NumberFormatting-CtWHhyBX.mjs";
|
13
13
|
import Ae from "@mui/material/Button";
|
@@ -19,9 +19,9 @@ import Y from "@mui/material/ListItemText";
|
|
19
19
|
import { b as M } from "../Localization-2MODESHW.mjs";
|
20
20
|
import { D as k } from "../Drawer-kEE73B87.mjs";
|
21
21
|
import Fe from "@mui/material/ListItemSecondaryAction";
|
22
|
-
import { C as
|
22
|
+
import { C as We } from "../CurrencyInput-CRtdzs3o.mjs";
|
23
23
|
import { a as $ } from "../Dialog-CWW597AF.mjs";
|
24
|
-
import { C as
|
24
|
+
import { C as He } from "../ConnectionsDrawer-CU3E2RLw.mjs";
|
25
25
|
import * as O from "d3";
|
26
26
|
import Xe from "@mui/material/Tooltip";
|
27
27
|
import { u as se } from "../useScreenSize-B6JyS_Lj.mjs";
|
@@ -73,7 +73,7 @@ const it = I(() => {
|
|
73
73
|
}, [o, i]);
|
74
74
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
75
75
|
/* @__PURE__ */ e(K, { children: /* @__PURE__ */ m(V, { children: [
|
76
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(
|
76
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(W, { categoryGuid: t.guid, variant: "filled" }) }),
|
77
77
|
/* @__PURE__ */ e(Y, { primary: t.name, secondary: s })
|
78
78
|
] }) }),
|
79
79
|
/* @__PURE__ */ e(ae, {})
|
@@ -99,7 +99,7 @@ const it = I(() => {
|
|
99
99
|
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: o.recalculate_description_top }),
|
100
100
|
/* @__PURE__ */ e(y, { variant: "ParagraphSmall", children: o.recalculate_description_bottom })
|
101
101
|
] }),
|
102
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
102
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(H, { children: d.map((u) => /* @__PURE__ */ e(ct, { category: u }, u.guid)) }) })
|
103
103
|
] })
|
104
104
|
}
|
105
105
|
)
|
@@ -119,7 +119,7 @@ const it = I(() => {
|
|
119
119
|
/* @__PURE__ */ e(y, { children: M(s.add_description_bottom, o) })
|
120
120
|
] }),
|
121
121
|
/* @__PURE__ */ e(
|
122
|
-
|
122
|
+
We,
|
123
123
|
{
|
124
124
|
amount: t,
|
125
125
|
autoFocus: !0,
|
@@ -136,7 +136,7 @@ const it = I(() => {
|
|
136
136
|
);
|
137
137
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
138
138
|
/* @__PURE__ */ e(K, { children: /* @__PURE__ */ m(V, { onClick: () => n(!0), children: [
|
139
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(
|
139
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(W, { categoryGuid: t.guid }) }),
|
140
140
|
/* @__PURE__ */ e(
|
141
141
|
Y,
|
142
142
|
{
|
@@ -165,7 +165,7 @@ const it = I(() => {
|
|
165
165
|
};
|
166
166
|
return /* @__PURE__ */ m(S, { children: [
|
167
167
|
/* @__PURE__ */ e(it, {}),
|
168
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
|
168
|
+
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(H, { children: a.map((r) => /* @__PURE__ */ e(
|
169
169
|
dt,
|
170
170
|
{
|
171
171
|
category: r,
|
@@ -224,8 +224,8 @@ const it = I(() => {
|
|
224
224
|
const a = Math.PI * J ** 2 * t, n = i < 400 || o < 300, r = n ? 40 : 20, c = Math.max(100, i - r), d = Math.max(100, o - r), g = c * d;
|
225
225
|
let u = J;
|
226
226
|
if (a < g) {
|
227
|
-
const
|
228
|
-
u = Math.min(Ee,
|
227
|
+
const _ = Math.sqrt(g / (t * Math.PI)), p = Math.min(c, d) / 4;
|
228
|
+
u = Math.min(Ee, _, p);
|
229
229
|
}
|
230
230
|
return n && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
231
231
|
}, _t = (t, o, i, s, a) => {
|
@@ -274,16 +274,16 @@ function Bt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
274
274
|
budgetColors: { background: c, text: d },
|
275
275
|
category: { icon: g, name: u },
|
276
276
|
guid: h,
|
277
|
-
description:
|
277
|
+
description: _,
|
278
278
|
radius: p,
|
279
279
|
x: b,
|
280
280
|
y: B
|
281
|
-
} = t,
|
282
|
-
let C =
|
281
|
+
} = t, f = n < 400 ? -8 : -12;
|
282
|
+
let C = f, v = f;
|
283
283
|
p > P ? (C = -14, v = -45) : p > ue && (v = -32);
|
284
284
|
let A = 32;
|
285
285
|
p <= P && (A = n < 400 ? 16 : 24);
|
286
|
-
const x = `${t.category.name}: ${
|
286
|
+
const x = `${t.category.name}: ${_}`, E = {
|
287
287
|
modifiers: [
|
288
288
|
{
|
289
289
|
name: "offset",
|
@@ -336,7 +336,7 @@ function Bt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
336
336
|
sx: { fill: d },
|
337
337
|
variant: "Body",
|
338
338
|
y: p <= P ? 12 : 24,
|
339
|
-
children: p <= P ?
|
339
|
+
children: p <= P ? _.split(" ")[0] : _
|
340
340
|
}
|
341
341
|
),
|
342
342
|
p <= P && p > ue && /* @__PURE__ */ e(
|
@@ -347,7 +347,7 @@ function Bt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
347
347
|
sx: { fill: d },
|
348
348
|
variant: "XSmall",
|
349
349
|
y: 28,
|
350
|
-
children:
|
350
|
+
children: _.split(" ")[1]
|
351
351
|
}
|
352
352
|
),
|
353
353
|
/* @__PURE__ */ e(St, { bubble: r })
|
@@ -364,20 +364,20 @@ const xt = ({
|
|
364
364
|
}
|
365
365
|
}) => {
|
366
366
|
const [a, n] = l.useState([]), r = l.useRef(null), c = l.useRef(!1), { detailedBudgets: d } = D(), g = l.useCallback(() => {
|
367
|
-
const u = r.current, h = ht(d),
|
367
|
+
const u = r.current, h = ht(d), _ = h.nodes();
|
368
368
|
if (u) {
|
369
369
|
const p = u.nodes(), b = new Map(p.map((B) => [B.guid, B]));
|
370
|
-
|
371
|
-
const
|
372
|
-
|
373
|
-
vx:
|
374
|
-
vy:
|
375
|
-
x:
|
376
|
-
y:
|
370
|
+
_.forEach((B) => {
|
371
|
+
const f = b.get(B.guid);
|
372
|
+
f && Object.assign(B, {
|
373
|
+
vx: f.vx,
|
374
|
+
vy: f.vy,
|
375
|
+
x: f.x,
|
376
|
+
y: f.y
|
377
377
|
});
|
378
378
|
});
|
379
379
|
}
|
380
|
-
r.current = h, c.current = !1, n(
|
380
|
+
r.current = h, c.current = !1, n(_);
|
381
381
|
}, [d]);
|
382
382
|
return l.useEffect(() => {
|
383
383
|
g();
|
@@ -386,7 +386,7 @@ const xt = ({
|
|
386
386
|
}, []), l.useEffect(() => {
|
387
387
|
const u = r.current;
|
388
388
|
if (!u) return;
|
389
|
-
const h = u.nodes(),
|
389
|
+
const h = u.nodes(), _ = o > 0 && o < 450 || t > 0 && t < 300, p = yt(h, d, _, t, o);
|
390
390
|
u.nodes(p), pt(u, t, o), i && setTimeout(() => {
|
391
391
|
gt(u);
|
392
392
|
}, 0), n([...p]);
|
@@ -396,19 +396,19 @@ const xt = ({
|
|
396
396
|
onConnectAccountsClick: o,
|
397
397
|
createBudgetOnClick: i
|
398
398
|
}) => {
|
399
|
-
const { recalculateBudgets: s } = D(), { spendCategories: a } = j(), { budgets: n } = w(), { availableWidth: r } = te(), {
|
399
|
+
const { recalculateBudgets: s } = D(), { spendCategories: a } = j(), { budgets: n } = w(), { availableWidth: r } = te(), { isMobile: c } = se(r), d = c, [g, u] = l.useState(!1), [h, _] = l.useState(!1), [p, b] = l.useState(!1), B = l.useMemo(() => [...a.filter((C) => C.totalAverageAmount > 0)], [a]), f = async () => {
|
400
400
|
b(!0);
|
401
401
|
const { data: C, isSuccess: v } = await s(B);
|
402
|
-
b(!1), v ? (C.length === 0 &&
|
402
|
+
b(!1), v ? (C.length === 0 && _(!0), u(!1)) : u(!0);
|
403
403
|
};
|
404
|
-
return p ? /* @__PURE__ */ e(G, {}) :
|
404
|
+
return p ? /* @__PURE__ */ e(G, {}) : g ? /* @__PURE__ */ e(
|
405
405
|
de,
|
406
406
|
{
|
407
407
|
header: n.autogenerate_budgets_error_header,
|
408
408
|
icon: "error",
|
409
409
|
iconColor: "#4D4D4D",
|
410
410
|
onClick: (C) => {
|
411
|
-
C === "primary" ?
|
411
|
+
C === "primary" ? f() : i();
|
412
412
|
},
|
413
413
|
primaryButton: n.autogenerate_budgets_error_primary_button,
|
414
414
|
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
@@ -422,7 +422,7 @@ const xt = ({
|
|
422
422
|
...d && { mt: 0, svg: { height: 32, width: 32 } }
|
423
423
|
}
|
424
424
|
}
|
425
|
-
) : /* @__PURE__ */ e(je, { children:
|
425
|
+
) : /* @__PURE__ */ e(je, { children: h ? /* @__PURE__ */ e(
|
426
426
|
de,
|
427
427
|
{
|
428
428
|
header: n.zero_state_generate_budgets_header,
|
@@ -454,7 +454,7 @@ const xt = ({
|
|
454
454
|
icon: "bubble_chart",
|
455
455
|
iconColor: "#1A1A1A",
|
456
456
|
onClick: (C) => {
|
457
|
-
C === "primary" ?
|
457
|
+
C === "primary" ? f() : i();
|
458
458
|
},
|
459
459
|
primaryButton: n.empty_state_primary_button,
|
460
460
|
secondaryButton: t ? void 0 : n.empty_state_secondary_button,
|
@@ -483,7 +483,7 @@ const xt = ({
|
|
483
483
|
shouldShowZeroState: a,
|
484
484
|
unavailableWidth: n = 24
|
485
485
|
}) => {
|
486
|
-
const { onEvent: r } = X(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: d } = j(), { isInitialized: g } = ne(), { accounts: u } = w(), { availableWidth: h } = te(), { isMobile:
|
486
|
+
const { onEvent: r } = X(), { setSelectedBudget: c } = D(), { isLoadingCategoryTotals: d } = j(), { isInitialized: g } = ne(), { accounts: u } = w(), { availableWidth: h } = te(), { isMobile: _ } = se(), [p, b] = l.useState(!1), B = l.useMemo(() => h - n, [h]), f = (v) => {
|
487
487
|
c(v), r(L.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
488
488
|
budget_category: v.category.name,
|
489
489
|
click_type: "bubble"
|
@@ -491,7 +491,7 @@ const xt = ({
|
|
491
491
|
}, C = () => {
|
492
492
|
b(!0), r(L.ACCOUNTS_CLICK_CONNECT);
|
493
493
|
};
|
494
|
-
return d ? /* @__PURE__ */ e(S, { alignItems: "center", height: o, justifyContent: "center", width: Math.abs(B), children: /* @__PURE__ */ e(G, {}) }) : /* @__PURE__ */ m(F, { ml: a ||
|
494
|
+
return d ? /* @__PURE__ */ e(S, { alignItems: "center", height: o, justifyContent: "center", width: Math.abs(B), children: /* @__PURE__ */ e(G, {}) }) : /* @__PURE__ */ m(F, { ml: a || _ ? 0 : 24, sx: { alignSelf: "center" }, children: [
|
495
495
|
a || !g ? /* @__PURE__ */ e(
|
496
496
|
At,
|
497
497
|
{
|
@@ -504,12 +504,12 @@ const xt = ({
|
|
504
504
|
{
|
505
505
|
height: o,
|
506
506
|
isDraggable: i,
|
507
|
-
onClick:
|
507
|
+
onClick: f,
|
508
508
|
width: B
|
509
509
|
}
|
510
510
|
),
|
511
511
|
/* @__PURE__ */ e(
|
512
|
-
|
512
|
+
He,
|
513
513
|
{
|
514
514
|
onClose: () => b(!1),
|
515
515
|
showConnectionsWidget: p,
|
@@ -548,13 +548,13 @@ const xt = ({
|
|
548
548
|
] })
|
549
549
|
] });
|
550
550
|
}, wt = (t) => {
|
551
|
-
const o = Q(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: n, setTheme: r } = D(), { budgets: c, common: d } = w(), { isCopyLoaded: g, isInitialized: u, selectedAccounts: h } = ne(), { reloadCategoryTotals:
|
552
|
-
|
553
|
-
}, v = () =>
|
551
|
+
const o = Q(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: n, setTheme: r } = D(), { budgets: c, common: d } = w(), { isCopyLoaded: g, isInitialized: u, selectedAccounts: h } = ne(), { reloadCategoryTotals: _ } = j(), p = Ve(), b = s.length === 0, [B, f] = l.useState(!1), C = () => {
|
552
|
+
f(!0), i(L.BUDGETS_CLICK_ADD);
|
553
|
+
}, v = () => f(!1);
|
554
554
|
return l.useEffect(() => {
|
555
555
|
r(o);
|
556
556
|
}, [o]), l.useEffect(() => {
|
557
|
-
u && !a &&
|
557
|
+
u && !a && _(h, q(/* @__PURE__ */ new Date()), me(/* @__PURE__ */ new Date())).then(
|
558
558
|
() => {
|
559
559
|
n().finally();
|
560
560
|
}
|
@@ -582,7 +582,7 @@ const xt = ({
|
|
582
582
|
{
|
583
583
|
ariaLabelClose: d.close_aria,
|
584
584
|
isOpen: B,
|
585
|
-
onClose: () =>
|
585
|
+
onClose: () => f(!1),
|
586
586
|
title: c.add_new_title,
|
587
587
|
children: /* @__PURE__ */ e(Ie, { onRecalculateBudgets: v })
|
588
588
|
}
|
@@ -605,7 +605,7 @@ const xt = ({
|
|
605
605
|
}
|
606
606
|
];
|
607
607
|
return /* @__PURE__ */ e(pe, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(he, { children: /* @__PURE__ */ m(S, { alignItems: "center", gap: 16, children: [
|
608
|
-
/* @__PURE__ */ e(
|
608
|
+
/* @__PURE__ */ e(W, { categoryGuid: a, size: 56 }),
|
609
609
|
/* @__PURE__ */ e(ze, { children: `${T(r, "0,0")} / ${T(o, "0,0")}` }),
|
610
610
|
/* @__PURE__ */ e(y, { bold: !0, variant: "XSmall", children: s }),
|
611
611
|
/* @__PURE__ */ e(ge, { data: c, height: 10 })
|
@@ -626,7 +626,7 @@ const xt = ({
|
|
626
626
|
transaction_total: n
|
627
627
|
} = t, { setSelectedSubBudget: r } = D();
|
628
628
|
return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ m(V, { onClick: () => r(t), children: [
|
629
|
-
/* @__PURE__ */ e(re, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(we, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(
|
629
|
+
/* @__PURE__ */ e(re, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(we, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(W, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
630
630
|
/* @__PURE__ */ e(
|
631
631
|
Y,
|
632
632
|
{
|
@@ -639,16 +639,16 @@ const xt = ({
|
|
639
639
|
)
|
640
640
|
] }) });
|
641
641
|
}), Et = I(({ category: t, parentBudget: o }) => {
|
642
|
-
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } = nt(), { addBudget: r } = D(), [c, d] = l.useState(!1), [g, u] = l.useState(!1), [h,
|
642
|
+
const { budgets: i, common: s } = w(), { setExpandedGuid: a, setOnSelect: n } = nt(), { addBudget: r } = D(), [c, d] = l.useState(!1), [g, u] = l.useState(!1), [h, _] = l.useState(""), [p, b] = l.useState(void 0);
|
643
643
|
l.useEffect(() => {
|
644
644
|
n((C) => {
|
645
645
|
const v = t.subCategories.find((A) => A.guid === C);
|
646
|
-
v && (b(v),
|
646
|
+
v && (b(v), _(`${v.currentAmount === 0 ? "" : v.currentAmount}`), u(!0));
|
647
647
|
});
|
648
648
|
}, []);
|
649
649
|
const B = () => {
|
650
650
|
a(t.guid), d(!0);
|
651
|
-
},
|
651
|
+
}, f = async () => {
|
652
652
|
p && Number(h) > 0 && (await r(p, Number(h), o.guid), u(!1), d(!1), b(void 0));
|
653
653
|
};
|
654
654
|
return /* @__PURE__ */ m(F, { children: [
|
@@ -667,7 +667,7 @@ const xt = ({
|
|
667
667
|
isOpen: c,
|
668
668
|
onClose: () => d(!1),
|
669
669
|
title: i.add_sub_budget_title,
|
670
|
-
children: /* @__PURE__ */ e(
|
670
|
+
children: /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(ot, { category: t, subCategories: t.subCategories }) })
|
671
671
|
}
|
672
672
|
),
|
673
673
|
/* @__PURE__ */ e(
|
@@ -677,23 +677,23 @@ const xt = ({
|
|
677
677
|
disablePrimaryButton: Number(h) <= 0,
|
678
678
|
isOpen: g,
|
679
679
|
onClose: () => u(!1),
|
680
|
-
onPrimaryAction:
|
680
|
+
onPrimaryAction: f,
|
681
681
|
primaryText: i.add_save_button,
|
682
682
|
children: /* @__PURE__ */ e(
|
683
683
|
ie,
|
684
684
|
{
|
685
685
|
amount: h,
|
686
686
|
categoryName: p?.name || "",
|
687
|
-
onAmountChanged:
|
687
|
+
onAmountChanged: _
|
688
688
|
}
|
689
689
|
)
|
690
690
|
}
|
691
691
|
)
|
692
692
|
] });
|
693
693
|
}), Ot = I(({ budget: t }) => {
|
694
|
-
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: c, updateBudget: d } = D(), { filter: g, setFilter: u } = oe(), [h,
|
694
|
+
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = w(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: c, updateBudget: d } = D(), { filter: g, setFilter: u } = oe(), [h, _] = l.useState(!1), [p, b] = l.useState(!1), [B, f] = l.useState("");
|
695
695
|
l.useEffect(() => {
|
696
|
-
r && (
|
696
|
+
r && (f(`${r.amount}`), u({
|
697
697
|
...g,
|
698
698
|
custom: (x) => x.category_guid === r.category_guid
|
699
699
|
}));
|
@@ -712,7 +712,7 @@ const xt = ({
|
|
712
712
|
}), c(void 0);
|
713
713
|
};
|
714
714
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
715
|
-
/* @__PURE__ */ m(
|
715
|
+
/* @__PURE__ */ m(H, { sx: { bgcolor: "background.paper" }, children: [
|
716
716
|
i.length === 0 ? /* @__PURE__ */ e(Dt, {}) : i.map((x) => /* @__PURE__ */ m(l.Fragment, { children: [
|
717
717
|
/* @__PURE__ */ e(It, { budget: x }),
|
718
718
|
/* @__PURE__ */ e(ae, {})
|
@@ -725,7 +725,7 @@ const xt = ({
|
|
725
725
|
ariaLabelClose: a.close_aria,
|
726
726
|
isOpen: !!r,
|
727
727
|
onClose: A,
|
728
|
-
onPrimaryAction: () =>
|
728
|
+
onPrimaryAction: () => _(!0),
|
729
729
|
onSecondaryAction: () => b(!0),
|
730
730
|
primaryText: s.details_edit_button,
|
731
731
|
secondaryText: s.details_delete_button,
|
@@ -743,7 +743,7 @@ const xt = ({
|
|
743
743
|
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
744
744
|
disablePrimaryButton: Number(B) <= 0,
|
745
745
|
isOpen: h,
|
746
|
-
onClose: () =>
|
746
|
+
onClose: () => _(!1),
|
747
747
|
onPrimaryAction: C,
|
748
748
|
primaryText: s.edit_save_button,
|
749
749
|
children: /* @__PURE__ */ e(
|
@@ -751,7 +751,7 @@ const xt = ({
|
|
751
751
|
{
|
752
752
|
amount: B,
|
753
753
|
categoryName: r.category.name,
|
754
|
-
onAmountChanged:
|
754
|
+
onAmountChanged: f
|
755
755
|
}
|
756
756
|
)
|
757
757
|
}
|
@@ -776,7 +776,7 @@ const xt = ({
|
|
776
776
|
sortedTransactions: g,
|
777
777
|
sortedTransactionsWithSplits: u,
|
778
778
|
tags: h
|
779
|
-
} = oe(), [
|
779
|
+
} = oe(), [_, p] = l.useState(0), [b, B] = l.useState(""), f = l.useMemo(
|
780
780
|
() => g.find((x) => x.guid === b),
|
781
781
|
[b, g]
|
782
782
|
), C = (x, E) => {
|
@@ -793,7 +793,7 @@ const xt = ({
|
|
793
793
|
onChange: C,
|
794
794
|
sx: { width: "100%" },
|
795
795
|
textColor: "primary",
|
796
|
-
value:
|
796
|
+
value: _,
|
797
797
|
variant: "fullWidth",
|
798
798
|
children: [
|
799
799
|
/* @__PURE__ */ e(ye, { label: s.details_transactions_tab }),
|
@@ -801,7 +801,7 @@ const xt = ({
|
|
801
801
|
]
|
802
802
|
}
|
803
803
|
),
|
804
|
-
|
804
|
+
_ === 0 && /* @__PURE__ */ m(S, { children: [
|
805
805
|
A && /* @__PURE__ */ e(S, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
806
806
|
Ae,
|
807
807
|
{
|
@@ -813,15 +813,15 @@ const xt = ({
|
|
813
813
|
) }),
|
814
814
|
/* @__PURE__ */ e(Te, { height: "100%", onClick: B })
|
815
815
|
] }),
|
816
|
-
|
816
|
+
_ === 1 && /* @__PURE__ */ e(Ot, { budget: t }),
|
817
817
|
/* @__PURE__ */ e(
|
818
818
|
k,
|
819
819
|
{
|
820
820
|
ariaLabelClose: a.close_aria,
|
821
|
-
isOpen: !!
|
821
|
+
isOpen: !!f,
|
822
822
|
onClose: () => B(""),
|
823
823
|
title: s.details_transaction_drawer,
|
824
|
-
children:
|
824
|
+
children: f && /* @__PURE__ */ e(tt, { transaction: f })
|
825
825
|
}
|
826
826
|
)
|
827
827
|
] })
|
@@ -835,9 +835,9 @@ const xt = ({
|
|
835
835
|
setAlert: c,
|
836
836
|
setSelectedBudget: d,
|
837
837
|
updateBudget: g
|
838
|
-
} = D(), { setFilter: u } = oe(), [h,
|
838
|
+
} = D(), { setFilter: u } = oe(), [h, _] = l.useState(!1), [p, b] = l.useState(!1), [B, f] = l.useState(!1), [C, v] = l.useState("");
|
839
839
|
l.useEffect(() => {
|
840
|
-
n && !r && (v(`${n.amount}`),
|
840
|
+
n && !r && (v(`${n.amount}`), _(!0), u({
|
841
841
|
accounts: t,
|
842
842
|
dateRange: s,
|
843
843
|
custom: (R) => R.category_guid === n.category_guid || R.top_level_category_guid === n.category_guid,
|
@@ -851,9 +851,9 @@ const xt = ({
|
|
851
851
|
percentage: n.category.totalAmount / Number(C) * 100
|
852
852
|
}), c(M(o.alert_budget_updated, n.category.name)));
|
853
853
|
}, x = async () => {
|
854
|
-
n && (await a(n.guid), c(M(o.alert_budget_deleted, n.category.name))),
|
854
|
+
n && (await a(n.guid), c(M(o.alert_budget_deleted, n.category.name))), f(!1), E();
|
855
855
|
}, E = () => {
|
856
|
-
|
856
|
+
_(!1), setTimeout(() => {
|
857
857
|
d(void 0);
|
858
858
|
}, 250);
|
859
859
|
};
|
@@ -866,7 +866,7 @@ const xt = ({
|
|
866
866
|
isOpen: h,
|
867
867
|
onClose: E,
|
868
868
|
onPrimaryAction: () => b(!0),
|
869
|
-
onSecondaryAction: () =>
|
869
|
+
onSecondaryAction: () => f(!0),
|
870
870
|
primaryText: o.details_edit_button,
|
871
871
|
secondaryColor: "error",
|
872
872
|
secondaryText: o.details_delete_button,
|
@@ -898,7 +898,7 @@ const xt = ({
|
|
898
898
|
{
|
899
899
|
copy: { close_aria: i.close_aria, title: o.delete_title },
|
900
900
|
isOpen: B,
|
901
|
-
onClose: () =>
|
901
|
+
onClose: () => f(!1),
|
902
902
|
onPrimaryAction: x,
|
903
903
|
primaryColor: "error",
|
904
904
|
primaryText: o.details_delete_button,
|
@@ -918,7 +918,7 @@ const xt = ({
|
|
918
918
|
transaction_total: g
|
919
919
|
} = t;
|
920
920
|
return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ m(V, { onClick: () => o?.(t), children: [
|
921
|
-
/* @__PURE__ */ e(re, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(we, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(
|
921
|
+
/* @__PURE__ */ e(re, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(we, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(W, { categoryGuid: n, variant: "basic" }) }) }),
|
922
922
|
/* @__PURE__ */ e(
|
923
923
|
Y,
|
924
924
|
{
|
@@ -945,13 +945,13 @@ const xt = ({
|
|
945
945
|
};
|
946
946
|
return /* @__PURE__ */ m(pe, { elevation: 2, children: [
|
947
947
|
/* @__PURE__ */ e(De, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(xe, { children: o.budget_categories_title }) }),
|
948
|
-
/* @__PURE__ */ e(he, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(
|
948
|
+
/* @__PURE__ */ e(he, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(H, { children: i.map((n) => /* @__PURE__ */ m(l.Fragment, { children: [
|
949
949
|
/* @__PURE__ */ e(Lt, { budget: n, onClick: a }),
|
950
950
|
/* @__PURE__ */ e(ae, {})
|
951
951
|
] }, n.guid)) }) })
|
952
952
|
] });
|
953
953
|
}), Nt = I(() => {
|
954
|
-
const t = Q(), { onEvent: o } = X(), { visibleAccounts: i } = ve(), { budgets: s, common: a, recurring: n } = w(), { incomeCategories: r, spendCategories: c } = j(), { detailedBudgets: d, totalBudgeted: g } = D(), { incomeTotal: u } = ee(), { setFilter: h } = oe(), [
|
954
|
+
const t = Q(), { onEvent: o } = X(), { visibleAccounts: i } = ve(), { budgets: s, common: a, recurring: n } = w(), { incomeCategories: r, spendCategories: c } = j(), { detailedBudgets: d, totalBudgeted: g } = D(), { incomeTotal: u } = ee(), { setFilter: h } = oe(), [_, p] = l.useState(!1), [b, B] = l.useMemo(() => {
|
955
955
|
const A = c.reduce((z, ce) => z + ce.totalAmount, 0);
|
956
956
|
let x = A / g;
|
957
957
|
x > 1 && (x = 1);
|
@@ -964,7 +964,7 @@ const xt = ({
|
|
964
964
|
}
|
965
965
|
];
|
966
966
|
return [A, R];
|
967
|
-
}, [d, c]), [
|
967
|
+
}, [d, c]), [f, C] = l.useMemo(() => {
|
968
968
|
const A = Math.abs(
|
969
969
|
r.reduce((R, z) => R + z.totalAmount, 0)
|
970
970
|
);
|
@@ -1014,7 +1014,7 @@ const xt = ({
|
|
1014
1014
|
/* @__PURE__ */ e(ge, { data: C, height: 16 }),
|
1015
1015
|
/* @__PURE__ */ e(y, { variant: "Small", children: M(
|
1016
1016
|
s.income_description,
|
1017
|
-
T(
|
1017
|
+
T(f, "0,0"),
|
1018
1018
|
T(u, "0,0")
|
1019
1019
|
) })
|
1020
1020
|
] })
|
@@ -1023,7 +1023,7 @@ const xt = ({
|
|
1023
1023
|
k,
|
1024
1024
|
{
|
1025
1025
|
ariaLabelClose: a.close_aria,
|
1026
|
-
isOpen:
|
1026
|
+
isOpen: _,
|
1027
1027
|
onClose: () => p(!1),
|
1028
1028
|
title: n.manage_income,
|
1029
1029
|
children: /* @__PURE__ */ e(st, { forOverview: !0 })
|
@@ -1032,24 +1032,24 @@ const xt = ({
|
|
1032
1032
|
] });
|
1033
1033
|
}), Be = 480, Rn = I(({ onBackClick: t, sx: o }) => {
|
1034
1034
|
const i = Q(), { onEvent: s } = X(), { visibleAccounts: a } = ve(), { budgets: n, common: r } = w(), { isCopyLoaded: c, isInitialized: d, selectedAccounts: g, setDisplayedDate: u, setSelectedAccounts: h } = ne(), {
|
1035
|
-
alert:
|
1035
|
+
alert: _,
|
1036
1036
|
dateRange: p,
|
1037
1037
|
isDataLoaded: b,
|
1038
1038
|
loadBudgetData: B,
|
1039
|
-
setDateRange:
|
1039
|
+
setDateRange: f,
|
1040
1040
|
setAlert: C,
|
1041
1041
|
setTheme: v,
|
1042
1042
|
detailedBudgets: A
|
1043
1043
|
} = D(), { loadRepeatingTransactions: x, setDateRange: E } = ee(), { reloadCategoryTotals: R } = j(), { isSmallTablet: z, isMobile: ce, isSmallMobile: Le } = se(), U = z || ce || Le, [ke, le] = l.useState(!1);
|
1044
|
-
l.useEffect(() => (v(i), h(a),
|
1045
|
-
|
1044
|
+
l.useEffect(() => (v(i), h(a), f({ start: q(Z()), end: me(Z()) }), s(L.BUDGETS_VIEW), () => {
|
1045
|
+
f({ start: q(Z()), end: me(Z()) });
|
1046
1046
|
}), []), l.useEffect(() => {
|
1047
1047
|
h(a);
|
1048
1048
|
}, [a]), l.useEffect(() => {
|
1049
1049
|
d && (u(p.start, p.end), R(g, p.start, p.end).finally(), E(p), b || (x().finally(), B().finally()));
|
1050
1050
|
}, [d, g, p]);
|
1051
1051
|
const Ne = (_e) => {
|
1052
|
-
|
1052
|
+
f({ start: _e[0] || /* @__PURE__ */ new Date(), end: _e[1] || /* @__PURE__ */ new Date() });
|
1053
1053
|
}, Pe = () => {
|
1054
1054
|
s(L.BUDGETS_CLICK_FILTER);
|
1055
1055
|
}, fe = () => {
|
@@ -1132,7 +1132,7 @@ const xt = ({
|
|
1132
1132
|
onClose: () => {
|
1133
1133
|
C("");
|
1134
1134
|
},
|
1135
|
-
open: !!
|
1135
|
+
open: !!_,
|
1136
1136
|
children: /* @__PURE__ */ e(
|
1137
1137
|
qe,
|
1138
1138
|
{
|
@@ -1141,7 +1141,7 @@ const xt = ({
|
|
1141
1141
|
},
|
1142
1142
|
severity: "success",
|
1143
1143
|
variant: "filled",
|
1144
|
-
children:
|
1144
|
+
children: _
|
1145
1145
|
}
|
1146
1146
|
)
|
1147
1147
|
}
|