@mx-cartographer/experiences 7.13.21 → 7.13.22
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
CHANGED
|
@@ -13,31 +13,31 @@ import { u as R } from "./useAriaLive-MkYebyUR.mjs";
|
|
|
13
13
|
import { u as v } from "./hooks-BxkfR-Ff.mjs";
|
|
14
14
|
import { u as V } from "./useScreenSize-B6JyS_Lj.mjs";
|
|
15
15
|
import { f as b } from "./NumberFormatting-QCaNwbjv.mjs";
|
|
16
|
-
const D = 5, B = (i, l, g,
|
|
16
|
+
const D = 5, B = (i, l, g, m) => m.reduce((o, n) => {
|
|
17
17
|
const a = i.find((s) => s.guid === n.category_guid);
|
|
18
18
|
if (!a) return o;
|
|
19
19
|
const t = a.parent_guid ?? a.guid, r = i.find((s) => s.guid === t);
|
|
20
|
-
if (!r) return o;
|
|
21
|
-
const
|
|
20
|
+
if (!r || n.total <= 0) return o;
|
|
21
|
+
const c = {
|
|
22
22
|
guid: a.guid,
|
|
23
23
|
name: a.guid === t ? `${l.parent_category_totals_label_general} ${a.name}` : a.name,
|
|
24
24
|
color: _(r.guid, g),
|
|
25
25
|
amount: n.total
|
|
26
26
|
}, e = o.find((s) => s.guid === t);
|
|
27
|
-
return e ? (e.amount += n.total, e.categoryTotals?.push(
|
|
27
|
+
return e ? (e.amount += n.total, e.categoryTotals?.push(c)) : o.push({
|
|
28
28
|
guid: t,
|
|
29
29
|
name: r.name,
|
|
30
30
|
color: _(r.guid, g),
|
|
31
|
-
categoryTotals: [
|
|
31
|
+
categoryTotals: [c],
|
|
32
32
|
amount: n.total
|
|
33
33
|
}), o;
|
|
34
|
-
}, []), nt = (i, l, g,
|
|
35
|
-
const n = B(i, l, g,
|
|
34
|
+
}, []), nt = (i, l, g, m) => {
|
|
35
|
+
const n = B(i, l, g, m).filter(
|
|
36
36
|
(e) => e.guid !== p.INCOME && e.guid !== p.INVESTMENTS && e.guid !== p.TRANSFER && e.amount > 0
|
|
37
37
|
).sort((e, s) => s.amount - e.amount), a = n.reduce(
|
|
38
38
|
(e, s) => e + s.amount,
|
|
39
39
|
0
|
|
40
|
-
), t = n.length > D ? D : n.length, r = n.slice(0, t),
|
|
40
|
+
), t = n.length > D ? D : n.length, r = n.slice(0, t), c = r.map((e) => ({
|
|
41
41
|
id: e.guid,
|
|
42
42
|
color: _(e.guid, g),
|
|
43
43
|
label: e.name,
|
|
@@ -54,7 +54,7 @@ const D = 5, B = (i, l, g, c) => c.reduce((o, n) => {
|
|
|
54
54
|
name: l.saving_goal_other,
|
|
55
55
|
categoryTotals: e,
|
|
56
56
|
amount: s
|
|
57
|
-
}),
|
|
57
|
+
}), c.push({
|
|
58
58
|
id: "other",
|
|
59
59
|
color: g.palette.categories.others || "",
|
|
60
60
|
label: l.saving_goal_other,
|
|
@@ -63,15 +63,15 @@ const D = 5, B = (i, l, g, c) => c.reduce((o, n) => {
|
|
|
63
63
|
}
|
|
64
64
|
return {
|
|
65
65
|
categoryData: r,
|
|
66
|
-
donutData:
|
|
66
|
+
donutData: c,
|
|
67
67
|
totalAmount: a
|
|
68
68
|
};
|
|
69
69
|
}, et = (i, l, g) => {
|
|
70
|
-
const
|
|
70
|
+
const m = i.filter(
|
|
71
71
|
(t) => t.guid === p.INCOME || t.parent_guid === p.INCOME
|
|
72
|
-
), o = l.filter((t) =>
|
|
72
|
+
), o = l.filter((t) => m.some((r) => r.guid === t.category_guid)).sort((t, r) => t.total - r.total).map((t, r) => ({
|
|
73
73
|
guid: t.category_guid,
|
|
74
|
-
name: i.find((
|
|
74
|
+
name: i.find((c) => c.guid === t.category_guid)?.name,
|
|
75
75
|
color: g[r],
|
|
76
76
|
categoryTotals: [],
|
|
77
77
|
amount: Math.abs(t.total)
|
|
@@ -93,13 +93,13 @@ const D = 5, B = (i, l, g, c) => c.reduce((o, n) => {
|
|
|
93
93
|
data: i,
|
|
94
94
|
isIncome: l = !1,
|
|
95
95
|
onSelected: g,
|
|
96
|
-
onViewTransactions:
|
|
96
|
+
onViewTransactions: m,
|
|
97
97
|
selectedId: o,
|
|
98
98
|
size: n = 150,
|
|
99
99
|
totalLabel: a,
|
|
100
100
|
variant: t = "mini"
|
|
101
101
|
}) => {
|
|
102
|
-
const { spending: r } = v(),
|
|
102
|
+
const { spending: r } = v(), c = A(), { isTablet: e } = V(), { announce: s, ariaLive: C } = R(), u = T.useMemo(
|
|
103
103
|
() => o ? i.categoryData.find((x) => x.guid === o) : void 0,
|
|
104
104
|
[o]
|
|
105
105
|
);
|
|
@@ -109,8 +109,8 @@ const D = 5, B = (i, l, g, c) => c.reduce((o, n) => {
|
|
|
109
109
|
s(`${u.name}: ${x}`);
|
|
110
110
|
}
|
|
111
111
|
}, [u, s, t]);
|
|
112
|
-
const E = i.donutData.length > 0 ? i.donutData : [{ id: "0", color:
|
|
113
|
-
|
|
112
|
+
const E = i.donutData.length > 0 ? i.donutData : [{ id: "0", color: c.palette.divider, value: 100 }], I = () => {
|
|
113
|
+
m?.(o);
|
|
114
114
|
}, w = e ? 32 : 48;
|
|
115
115
|
return /* @__PURE__ */ f(N, { children: [
|
|
116
116
|
C,
|
|
@@ -161,7 +161,7 @@ const D = 5, B = (i, l, g, c) => c.reduce((o, n) => {
|
|
|
161
161
|
] }) }) })
|
|
162
162
|
] });
|
|
163
163
|
}, rt = k(P), at = ({ data: i, onSelected: l, selectedId: g }) => {
|
|
164
|
-
const
|
|
164
|
+
const m = (o, n) => {
|
|
165
165
|
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), l(n));
|
|
166
166
|
};
|
|
167
167
|
return /* @__PURE__ */ d(h, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: i.categoryData.map((o) => /* @__PURE__ */ f(
|
|
@@ -173,7 +173,7 @@ const D = 5, B = (i, l, g, c) => c.reduce((o, n) => {
|
|
|
173
173
|
direction: "row",
|
|
174
174
|
gap: 8,
|
|
175
175
|
onClick: () => l(o.guid),
|
|
176
|
-
onKeyDown: (n) =>
|
|
176
|
+
onKeyDown: (n) => m(n, o.guid),
|
|
177
177
|
role: "button",
|
|
178
178
|
sx: { cursor: "pointer" },
|
|
179
179
|
tabIndex: 0,
|
|
@@ -51,7 +51,7 @@ import { ChartsXAxis as Zn } from "@mui/x-charts/ChartsXAxis";
|
|
|
51
51
|
import { ChartsYAxis as Jn } from "@mui/x-charts/ChartsYAxis";
|
|
52
52
|
import { startOfMonth as Tt } from "date-fns/startOfMonth";
|
|
53
53
|
import { endOfMonth as At } from "date-fns/endOfMonth";
|
|
54
|
-
import { g as eo, S as to, b as no } from "../SpendingLegend-
|
|
54
|
+
import { g as eo, S as to, b as no } from "../SpendingLegend-BCnXkPCD.mjs";
|
|
55
55
|
import { formatISO as oo } from "date-fns/formatISO";
|
|
56
56
|
import { fromUnixTime as ro } from "date-fns/fromUnixTime";
|
|
57
57
|
import { startOfToday as st } from "date-fns/startOfToday";
|
|
@@ -8,7 +8,7 @@ import C from "@mui/material/Stack";
|
|
|
8
8
|
import N from "@mui/material/Tab";
|
|
9
9
|
import it from "@mui/material/Tabs";
|
|
10
10
|
import _t from "@mui/material/styles/useTheme";
|
|
11
|
-
import { g as rt, a as st, S as $, b as Y } from "../SpendingLegend-
|
|
11
|
+
import { g as rt, a as st, S as $, b as Y } from "../SpendingLegend-BCnXkPCD.mjs";
|
|
12
12
|
import { Text as T, Icon as bt } from "@mxenabled/mxui";
|
|
13
13
|
import { f as R } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
14
14
|
import { u as I, l as A, d as lt, b as V, a as F, h as ct, g as yt } from "../hooks-BxkfR-Ff.mjs";
|