@mx-cartographer/experiences 7.2.15-alpha-ram2-finstromg-testing → 7.2.15-alpha-ram3-finstromg-testing

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.
@@ -120,7 +120,7 @@ class G {
120
120
  r(o),
121
121
  t
122
122
  );
123
- l(() => {
123
+ console.log(e, o, "start date", "enddate"), console.log(a, "totals"), l(() => {
124
124
  this.dateRangeCategoryTotals = a, this.setIsLoadingCategoryTotals(!1), this.dataRangeTotalsLoaded = !0;
125
125
  });
126
126
  } catch (a) {
@@ -1,6 +1,6 @@
1
1
  import { b as S } from "./CategoryUtil-DUM8NuGO.mjs";
2
2
  import { b as p } from "./Category-CevNQ03n.mjs";
3
- import { jsxs as y, Fragment as v, jsx as m } from "react/jsx-runtime";
3
+ import { jsxs as y, Fragment as v, jsx as d } from "react/jsx-runtime";
4
4
  import x from "react";
5
5
  import { observer as w } from "mobx-react-lite";
6
6
  import f from "@mui/material/Stack";
@@ -13,75 +13,76 @@ import { u as j } from "./hooks-C41HAxM5.mjs";
13
13
  import { u as R } from "./useScreenSize-B6JyS_Lj.mjs";
14
14
  import { f as D } from "./NumberFormatting-Buh7u8Oi.mjs";
15
15
  import $ from "@mui/material/Box";
16
- const T = 5, B = (r, l, u) => u.reduce((g, t) => {
16
+ const T = 5, B = (r, l, g) => g.reduce((s, t) => {
17
17
  if (t.total > 0) {
18
18
  const n = r.find((e) => e.guid === t.category_guid);
19
- if (!n) return g;
20
- const s = n.parent_guid ?? n.guid, o = r.find((e) => e.guid === s);
21
- if (!o) return g;
19
+ if (!n) return s;
20
+ const u = n.parent_guid ?? n.guid, o = r.find((e) => e.guid === u);
21
+ if (!o) return s;
22
22
  const a = {
23
23
  guid: n.guid,
24
- name: n.guid === s ? `General ${n.name}` : n.name,
24
+ name: n.guid === u ? `General ${n.name}` : n.name,
25
25
  color: S(o.guid, l),
26
26
  amount: t.total
27
- }, c = g.find((e) => e.guid === s);
28
- c ? (c.amount += t.total, c.categoryTotals?.push(a)) : g.push({
29
- guid: s,
27
+ }, c = s.find((e) => e.guid === u);
28
+ c ? (c.amount += t.total, c.categoryTotals?.push(a)) : s.push({
29
+ guid: u,
30
30
  name: o.name,
31
31
  color: S(o.guid, l),
32
32
  categoryTotals: [a],
33
33
  amount: t.total
34
34
  });
35
35
  }
36
- return g;
37
- }, []), to = (r, l, u, g) => {
38
- const t = B(r, u, g), n = t.filter(
36
+ return s;
37
+ }, []), to = (r, l, g, s) => {
38
+ console.log(s, "daterangecategorytotals"), console.log(r, "categories");
39
+ const t = B(r, g, s), n = t.filter(
39
40
  (e) => e.guid !== p.INCOME && e.guid !== p.INVESTMENTS && e.guid !== p.TRANSFER
40
- ).sort((e, d) => d.amount - e.amount), s = n.reduce(
41
- (e, d) => e + d.amount,
41
+ ).sort((e, m) => m.amount - e.amount), u = n.reduce(
42
+ (e, m) => e + m.amount,
42
43
  0
43
44
  ), o = n.length > T ? T : n.length, a = n.slice(0, o), c = a.map((e) => ({
44
45
  id: e.guid,
45
- color: S(e.guid, u),
46
+ color: S(e.guid, g),
46
47
  label: e.name,
47
- value: e.amount / s * 100
48
+ value: e.amount / u * 100
48
49
  }));
49
50
  if (n.length > 5) {
50
- const e = n.slice(T, t.length), d = e.reduce(
51
+ const e = n.slice(T, t.length), m = e.reduce(
51
52
  (C, i) => C + i.amount,
52
53
  0
53
54
  );
54
55
  a.push({
55
56
  guid: "other",
56
- color: u.palette.categories.others || "",
57
+ color: g.palette.categories.others || "",
57
58
  name: l.saving_goal_other,
58
59
  categoryTotals: e,
59
- amount: d
60
+ amount: m
60
61
  }), c.push({
61
62
  id: "other",
62
- color: u.palette.categories.others || "",
63
+ color: g.palette.categories.others || "",
63
64
  label: l.saving_goal_other,
64
- value: d / s * 100
65
+ value: m / u * 100
65
66
  });
66
67
  }
67
68
  return {
68
69
  categoryData: a,
69
70
  donutData: c,
70
- totalAmount: s
71
+ totalAmount: u
71
72
  };
72
- }, no = (r, l, u) => {
73
- const g = r.filter(
73
+ }, no = (r, l, g) => {
74
+ const s = r.filter(
74
75
  (o) => o.guid === p.INCOME || o.parent_guid === p.INCOME
75
- ), t = l.filter((o) => g.some((a) => a.guid === o.category_guid)).sort((o, a) => o.total - a.total).map((o, a) => ({
76
+ ), t = l.filter((o) => s.some((a) => a.guid === o.category_guid)).sort((o, a) => o.total - a.total).map((o, a) => ({
76
77
  guid: o.category_guid,
77
78
  name: r.find((c) => c.guid === o.category_guid)?.name,
78
- color: u[a],
79
+ color: g[a],
79
80
  categoryTotals: [],
80
81
  amount: Math.abs(o.total)
81
82
  })), n = t.reduce(
82
83
  (o, a) => o + a.amount,
83
84
  0
84
- ), s = t.map((o) => ({
85
+ ), u = t.map((o) => ({
85
86
  id: o.guid,
86
87
  color: o.color,
87
88
  label: o.name,
@@ -89,35 +90,35 @@ const T = 5, B = (r, l, u) => u.reduce((g, t) => {
89
90
  }));
90
91
  return {
91
92
  categoryData: t,
92
- donutData: s,
93
+ donutData: u,
93
94
  totalAmount: n
94
95
  };
95
96
  }, H = ({
96
97
  data: r,
97
98
  isIncome: l = !1,
98
- onSelected: u,
99
- onViewTransactions: g,
99
+ onSelected: g,
100
+ onViewTransactions: s,
100
101
  selectedId: t,
101
102
  size: n = 150,
102
- totalLabel: s,
103
+ totalLabel: u,
103
104
  variant: o = "mini"
104
105
  }) => {
105
- const { spending: a } = j(), c = A(), { isTablet: e } = R(), { announce: d, ariaLive: C } = k(), i = x.useMemo(
106
+ const { spending: a } = j(), c = A(), { isTablet: e } = R(), { announce: m, ariaLive: C } = k(), i = x.useMemo(
106
107
  () => t ? r.categoryData.find((b) => b.guid === t) : void 0,
107
108
  [t]
108
109
  );
109
110
  x.useEffect(() => {
110
111
  if (i) {
111
112
  const b = D(i.amount, "0,0");
112
- d(`${i.name}: ${b}`);
113
+ m(`${i.name}: ${b}`);
113
114
  }
114
- }, [i, d]);
115
+ }, [i, m]);
115
116
  const _ = x.useMemo(() => r.donutData.length > 0 ? r.donutData : [{ id: "0", color: c.palette.divider, value: 100 }], [r, c]), E = () => {
116
- g?.(t);
117
+ s?.(t);
117
118
  }, I = e ? 32 : 48;
118
119
  return /* @__PURE__ */ y(v, { children: [
119
120
  C,
120
- /* @__PURE__ */ m(O, { data: _, onClick: u, selectedId: t, size: n, children: /* @__PURE__ */ m(f, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ y(f, { alignItems: "center", justifyContent: "center", minHeight: n, minWidth: n, children: [
121
+ /* @__PURE__ */ d(O, { data: _, onClick: g, selectedId: t, size: n, children: /* @__PURE__ */ d(f, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ y(f, { alignItems: "center", justifyContent: "center", minHeight: n, minWidth: n, children: [
121
122
  i && /* @__PURE__ */ y(
122
123
  f,
123
124
  {
@@ -127,7 +128,7 @@ const T = 5, B = (r, l, u) => u.reduce((g, t) => {
127
128
  mt: o === "mini" ? 0 : -16,
128
129
  sx: o === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
129
130
  children: [
130
- /* @__PURE__ */ m(
131
+ /* @__PURE__ */ d(
131
132
  M,
132
133
  {
133
134
  categoryGuid: l ? p.INCOME : i.guid,
@@ -135,22 +136,22 @@ const T = 5, B = (r, l, u) => u.reduce((g, t) => {
135
136
  variant: N.Transparent
136
137
  }
137
138
  ),
138
- /* @__PURE__ */ m(
139
+ /* @__PURE__ */ d(
139
140
  h,
140
141
  {
141
142
  color: "secondary",
142
143
  noWrap: !0,
143
144
  variant: o === "mini" ? "Tiny" : "Body",
144
- children: i ? i.name : s
145
+ children: i ? i.name : u
145
146
  }
146
147
  )
147
148
  ]
148
149
  }
149
150
  ),
150
- !i && o === "full" && /* @__PURE__ */ m(h, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: s }),
151
- /* @__PURE__ */ m(h, { variant: o === "mini" ? "H2" : "H1", children: i ? D(i.amount, "0,0") : D(r.totalAmount, "0,0") }),
152
- !i && o === "mini" && /* @__PURE__ */ m(h, { color: "secondary", noWrap: !0, variant: "Tiny", children: s }),
153
- o === "full" && /* @__PURE__ */ m(
151
+ !i && o === "full" && /* @__PURE__ */ d(h, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: u }),
152
+ /* @__PURE__ */ d(h, { variant: o === "mini" ? "H2" : "H1", children: i ? D(i.amount, "0,0") : D(r.totalAmount, "0,0") }),
153
+ !i && o === "mini" && /* @__PURE__ */ d(h, { color: "secondary", noWrap: !0, variant: "Tiny", children: u }),
154
+ o === "full" && /* @__PURE__ */ d(
154
155
  G,
155
156
  {
156
157
  "aria-label": `View ${i?.name || ""} Transactions`,
@@ -163,26 +164,26 @@ const T = 5, B = (r, l, u) => u.reduce((g, t) => {
163
164
  )
164
165
  ] }) }) })
165
166
  ] });
166
- }, eo = w(H), ro = ({ data: r, onSelected: l, selectedId: u }) => {
167
- const g = (t, n) => {
167
+ }, eo = w(H), ro = ({ data: r, onSelected: l, selectedId: g }) => {
168
+ const s = (t, n) => {
168
169
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), l(n));
169
170
  };
170
- return /* @__PURE__ */ m(f, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: r.categoryData.map((t) => /* @__PURE__ */ y(
171
+ return /* @__PURE__ */ d(f, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: r.categoryData.map((t) => /* @__PURE__ */ y(
171
172
  f,
172
173
  {
173
174
  alignItems: "center",
174
175
  "aria-label": t.name,
175
- "aria-pressed": t.guid === u,
176
+ "aria-pressed": t.guid === g,
176
177
  direction: "row",
177
178
  gap: 8,
178
179
  onClick: () => l(t.guid),
179
- onKeyDown: (n) => g(n, t.guid),
180
+ onKeyDown: (n) => s(n, t.guid),
180
181
  role: "button",
181
182
  sx: { cursor: "pointer" },
182
183
  tabIndex: 0,
183
184
  children: [
184
- /* @__PURE__ */ m($, { borderRadius: 4, height: 8, sx: { backgroundColor: t.color }, width: 8 }),
185
- /* @__PURE__ */ m(h, { bold: t.guid === u, variant: "XSmall", children: t.name })
185
+ /* @__PURE__ */ d($, { borderRadius: 4, height: 8, sx: { backgroundColor: t.color }, width: 8 }),
186
+ /* @__PURE__ */ d(h, { bold: t.guid === g, variant: "XSmall", children: t.name })
186
187
  ]
187
188
  },
188
189
  t.guid
@@ -1,5 +1,5 @@
1
1
  import { b as o, C as a, a as t, u as C } from "../CategorySelectorDrawer-ZO9N26Kx.mjs";
2
- import { C as g } from "../CategoryStore-C1IfDPCE.mjs";
2
+ import { C as g } from "../CategoryStore-CKS21I3F.mjs";
3
3
  export {
4
4
  o as CategoryRow,
5
5
  a as CategorySelector,
@@ -2,8 +2,8 @@ import { G as k } from "../useCombineEvents-BUDIR1ba.mjs";
2
2
  import { A as ss, a as rs, u as os, b as as } from "../useCombineEvents-BUDIR1ba.mjs";
3
3
  import { F as S, A as h } from "../Fetch-87LIQbEA.mjs";
4
4
  import { B as is } from "../BeatApi-DhJpgCLz.mjs";
5
- import { C as et } from "../CategoryStore-C1IfDPCE.mjs";
6
- import { a as ds } from "../CategoryStore-C1IfDPCE.mjs";
5
+ import { C as et } from "../CategoryStore-CKS21I3F.mjs";
6
+ import { a as ds } from "../CategoryStore-CKS21I3F.mjs";
7
7
  import { N as st } from "../NotificationStore-C6PH6MKm.mjs";
8
8
  import { a as us } from "../NotificationStore-C6PH6MKm.mjs";
9
9
  import { T as rt } from "../User-wXzDI4M8.mjs";
@@ -51,7 +51,7 @@ import { ResponsiveChartContainer as po } from "@mui/x-charts/ResponsiveChartCon
51
51
  import { useSpring as uo, animated as lt } from "@react-spring/web";
52
52
  import { startOfMonth as Lt } from "date-fns/startOfMonth";
53
53
  import { endOfMonth as Wt } from "date-fns/endOfMonth";
54
- import { g as _o, S as ho, b as mo } from "../SpendingLegend-CW8mIzqd.mjs";
54
+ import { g as _o, S as ho, b as mo } from "../SpendingLegend-Dnwcmcda.mjs";
55
55
  import { formatISO as go } from "date-fns/formatISO";
56
56
  import { fromUnixTime as yo } from "date-fns/fromUnixTime";
57
57
  import { startOfToday as dt } from "date-fns/startOfToday";
@@ -1688,8 +1688,8 @@ const B = {
1688
1688
  spending_vs_income: {
1689
1689
  main: g.standard_spend,
1690
1690
  comparison: g.income,
1691
- formattedMain: L(g.standard_spend, "0.0a"),
1692
- formattedComparison: L(g.income, "0.0a")
1691
+ formattedMain: L(Math.round(g.standard_spend / 100) * 100, "0.0a"),
1692
+ formattedComparison: L(Math.round(g.income / 100) * 100, "0.0a")
1693
1693
  },
1694
1694
  debt_payment_vs_income: {
1695
1695
  main: g.income,
@@ -1760,17 +1760,17 @@ const B = {
1760
1760
  sx: {
1761
1761
  width: 10,
1762
1762
  height: 10,
1763
- backgroundColor: "chartMono.chartMono3",
1763
+ backgroundColor: "chartMono.chartMono5",
1764
1764
  borderRadius: "2px"
1765
1765
  }
1766
1766
  }
1767
1767
  ),
1768
1768
  /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1769
1769
  /* @__PURE__ */ i(I, { variant: "subtitle2", children: [
1770
- a,
1770
+ s,
1771
1771
  " "
1772
1772
  ] }),
1773
- !h && l && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: l })
1773
+ !h && d && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: d })
1774
1774
  ] })
1775
1775
  ] }),
1776
1776
  /* @__PURE__ */ i(u, { alignItems: "center", direction: "row", spacing: 8, children: [
@@ -1780,30 +1780,30 @@ const B = {
1780
1780
  sx: {
1781
1781
  width: 10,
1782
1782
  height: 10,
1783
- backgroundColor: "chartMono.chartMono5",
1783
+ backgroundColor: "chartMono.chartMono3",
1784
1784
  borderRadius: "2px"
1785
1785
  }
1786
1786
  }
1787
1787
  ),
1788
1788
  /* @__PURE__ */ i(u, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1789
1789
  /* @__PURE__ */ i(I, { variant: "subtitle2", children: [
1790
- s,
1790
+ a,
1791
1791
  " "
1792
1792
  ] }),
1793
- !h && d && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: d })
1793
+ !h && l && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: l })
1794
1794
  ] })
1795
1795
  ] })
1796
1796
  ] }),
1797
1797
  /* @__PURE__ */ i(
1798
1798
  po,
1799
1799
  {
1800
- colors: [`${p.palette.chartMono.chartMono3}`, `${p.palette.chartMono.chartMono5}`],
1800
+ colors: [`${p.palette.chartMono.chartMono5}`, `${p.palette.chartMono.chartMono3}`],
1801
1801
  dataset: _,
1802
1802
  height: 240,
1803
1803
  margin: { top: 20, bottom: 30, right: 10, left: 42 },
1804
1804
  series: [
1805
- { dataKey: "main", type: "bar" },
1806
- { dataKey: "comparison", type: "bar" }
1805
+ { dataKey: "comparison", type: "bar" },
1806
+ { dataKey: "main", type: "bar" }
1807
1807
  ],
1808
1808
  xAxis: [b],
1809
1809
  yAxis: [D],
@@ -2033,7 +2033,9 @@ const B = {
2033
2033
  const f = m.useMemo(
2034
2034
  () => _o(d, c, t, l),
2035
2035
  [d, l]
2036
- ), w = (g) => {
2036
+ );
2037
+ console.log(f, "spendingData");
2038
+ const w = (g) => {
2037
2039
  b(_ === g ? "" : g);
2038
2040
  }, { totalSpending: y, totalIncome: D } = m.useMemo(() => r?.reduce(
2039
2041
  (g, { standard_spend: x = 0, income: M = 0 }) => ({
@@ -8,7 +8,7 @@ import S from "@mui/material/Stack";
8
8
  import W from "@mui/material/Tab";
9
9
  import nt from "@mui/material/Tabs";
10
10
  import dt from "@mui/material/styles/useTheme";
11
- import { g as ot, a as at, S as N, b as U } from "../SpendingLegend-CW8mIzqd.mjs";
11
+ import { g as ot, a as at, S as N, b as U } from "../SpendingLegend-Dnwcmcda.mjs";
12
12
  import { Text as y } from "@mxenabled/mxui";
13
13
  import { f as E } from "../NumberFormatting-Buh7u8Oi.mjs";
14
14
  import { u as w, b as O, m as j, d as it, a as rt, h as gt, g as pt } from "../hooks-C41HAxM5.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.2.15-alpha-ram2-finstromg-testing",
3
+ "version": "7.2.15-alpha-ram3-finstromg-testing",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",