@mx-cartographer/experiences 7.2.15-alpha-ram13-finstrong-testing → 7.2.15-alpha-ram15-finstrong-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.
@@ -116,8 +116,8 @@ class A {
116
116
  this.setIsLoadingCategoryTotals(!0);
117
117
  try {
118
118
  const a = await this.api.getDateRangeCategoryTotals(
119
- e ? r(e) : 17619552e5,
120
- o ? r(o) : 1764633599e3,
119
+ e ? r(e) : 1761955200,
120
+ o ? r(o) : 1764633599,
121
121
  t
122
122
  );
123
123
  console.log(e, o, "start date", "enddate"), console.log(JSON.parse(JSON.stringify(a)), "totals"), l(() => {
@@ -14,26 +14,23 @@ 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
16
  const T = 5, B = (r, l, g) => g.reduce((s, t) => {
17
- if (t.total > 0) {
18
- const n = r.find((e) => e.guid === t.category_guid);
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
- const a = {
23
- guid: n.guid,
24
- name: n.guid === u ? `General ${n.name}` : n.name,
25
- color: S(o.guid, l),
26
- amount: t.total
27
- }, c = s.find((e) => e.guid === u);
28
- c ? (c.amount += t.total, c.categoryTotals?.push(a)) : s.push({
29
- guid: u,
30
- name: o.name,
31
- color: S(o.guid, l),
32
- categoryTotals: [a],
33
- amount: t.total
34
- });
35
- }
36
- return s;
17
+ const n = r.find((e) => e.guid === t.category_guid);
18
+ if (!n) return s;
19
+ const u = n.parent_guid ?? n.guid, o = r.find((e) => e.guid === u);
20
+ if (!o) return s;
21
+ const a = {
22
+ guid: n.guid,
23
+ name: n.guid === u ? `General ${n.name}` : n.name,
24
+ color: S(o.guid, l),
25
+ amount: t.total
26
+ }, c = s.find((e) => e.guid === u);
27
+ return c ? (c.amount += t.total, c.categoryTotals?.push(a)) : s.push({
28
+ guid: u,
29
+ name: o.name,
30
+ color: S(o.guid, l),
31
+ categoryTotals: [a],
32
+ amount: t.total
33
+ }), s;
37
34
  }, []), to = (r, l, g, s) => {
38
35
  console.log(JSON.parse(JSON.stringify(s)), "daterangecategorytotals"), console.log(JSON.parse(JSON.stringify(r)), "categories");
39
36
  const t = B(r, g, s), n = t.filter(
@@ -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-B64CUGgx.mjs";
2
+ import { C as g } from "../CategoryStore-K8A4Mcfl.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-B64CUGgx.mjs";
6
- import { a as ds } from "../CategoryStore-B64CUGgx.mjs";
5
+ import { C as et } from "../CategoryStore-K8A4Mcfl.mjs";
6
+ import { a as ds } from "../CategoryStore-K8A4Mcfl.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";
@@ -49,7 +49,7 @@ import { ChartsXAxis as io } from "@mui/x-charts/ChartsXAxis";
49
49
  import { ChartsYAxis as so } from "@mui/x-charts/ChartsYAxis";
50
50
  import { ResponsiveChartContainer as co } from "@mui/x-charts/ResponsiveChartContainer";
51
51
  import { useSpring as lo, animated as lt } from "@react-spring/web";
52
- import { g as po, S as uo, b as _o } from "../SpendingLegend-CopEyF2t.mjs";
52
+ import { g as po, S as uo, b as _o } from "../SpendingLegend-CNmu1Tdv.mjs";
53
53
  import { endOfMonth as ho } from "date-fns/endOfMonth";
54
54
  import { formatISO as mo } from "date-fns/formatISO";
55
55
  import { fromUnixTime as go } from "date-fns/fromUnixTime";
@@ -5,13 +5,13 @@ import { startOfMonth as tt } from "date-fns/startOfMonth";
5
5
  import { endOfMonth as et } from "date-fns/endOfMonth";
6
6
  import T from "@mui/material/Box";
7
7
  import S from "@mui/material/Stack";
8
- import W from "@mui/material/Tab";
8
+ import N 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-CopEyF2t.mjs";
11
+ import { g as ot, a as at, S as R, b as U } from "../SpendingLegend-CNmu1Tdv.mjs";
12
12
  import { Text as y } from "@mxenabled/mxui";
13
- import { f as E } from "../NumberFormatting-Buh7u8Oi.mjs";
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";
13
+ import { f as W } from "../NumberFormatting-Buh7u8Oi.mjs";
14
+ import { u as w, b as $, m as j, d as it, a as rt, h as gt, g as pt } from "../hooks-C41HAxM5.mjs";
15
15
  import { L as z } from "../Loader-DUaFpDGv.mjs";
16
16
  import { M as ut } from "../MiniWidgetContainer-CmXpTylX.mjs";
17
17
  import { startOfToday as X } from "date-fns/startOfToday";
@@ -26,11 +26,11 @@ import { u as yt } from "../useScreenSize-B6JyS_Lj.mjs";
26
26
  import { D as J } from "../Drawer-BEtCk82g.mjs";
27
27
  import { b as L } from "../Category-CevNQ03n.mjs";
28
28
  import { A as Q, W as Ct } from "../WidgetContainer-6dsjtOVg.mjs";
29
- const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column", children: [
29
+ const O = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column", children: [
30
30
  /* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: s }),
31
- /* @__PURE__ */ t(y, { variant: "XSmall", children: E(n, "0,0") })
31
+ /* @__PURE__ */ t(y, { variant: "XSmall", children: W(n, "0,0") })
32
32
  ] }), St = () => {
33
- const n = dt(), { goals: s, spending: o } = w(), { selectedAccounts: i } = O(), {
33
+ const n = dt(), { goals: s, spending: o } = w(), { selectedAccounts: i } = $(), {
34
34
  categories: c,
35
35
  dateRangeCategoryTotals: r,
36
36
  dataRangeTotalsLoaded: e,
@@ -74,12 +74,12 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
74
74
  variant: "fullWidth",
75
75
  children: [
76
76
  /* @__PURE__ */ t(
77
- W,
77
+ N,
78
78
  {
79
79
  "aria-controls": "spending-tabpanel",
80
80
  id: "spending-tab",
81
81
  label: /* @__PURE__ */ t(
82
- R,
82
+ O,
83
83
  {
84
84
  amount: C.totalAmount,
85
85
  label: o.spend_tab_title
@@ -89,12 +89,12 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
89
89
  }
90
90
  ),
91
91
  /* @__PURE__ */ t(
92
- W,
92
+ N,
93
93
  {
94
94
  "aria-controls": "income-tabpanel",
95
95
  id: "income-tab",
96
96
  label: /* @__PURE__ */ t(
97
- R,
97
+ O,
98
98
  {
99
99
  amount: f.totalAmount,
100
100
  label: o.income_tab_title
@@ -115,7 +115,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
115
115
  role: "tabpanel",
116
116
  children: /* @__PURE__ */ d(S, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
117
117
  /* @__PURE__ */ t(
118
- N,
118
+ R,
119
119
  {
120
120
  data: C,
121
121
  onSelected: _,
@@ -136,7 +136,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
136
136
  role: "tabpanel",
137
137
  children: /* @__PURE__ */ d(S, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
138
138
  /* @__PURE__ */ t(
139
- N,
139
+ R,
140
140
  {
141
141
  data: f,
142
142
  isIncome: !0,
@@ -151,7 +151,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
151
151
  )
152
152
  ] }) : /* @__PURE__ */ t(z, { height: 250 });
153
153
  }, Mt = D(St), Tt = ({ onPrimaryCtaClick: n, sx: s = {} }) => {
154
- const { visibleAccounts: o } = it(), { spending: i } = w(), { isCopyLoaded: c, isInitialized: r, setSelectedAccounts: e } = O();
154
+ const { visibleAccounts: o } = it(), { spending: i } = w(), { isCopyLoaded: c, isInitialized: r, setSelectedAccounts: e } = $();
155
155
  return a.useEffect(() => {
156
156
  e(o);
157
157
  }, [o]), !c || !r ? /* @__PURE__ */ t(z, {}) : /* @__PURE__ */ t(
@@ -210,7 +210,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
210
210
  width: "100%",
211
211
  children: [
212
212
  /* @__PURE__ */ t(y, { bold: o === e.guid, children: e.name }),
213
- /* @__PURE__ */ t(y, { bold: o === e.guid, variant: "Body", children: E(e.amount, "0,0") })
213
+ /* @__PURE__ */ t(y, { bold: o === e.guid, variant: "Body", children: W(e.amount, "0,0") })
214
214
  ]
215
215
  }
216
216
  )
@@ -234,7 +234,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
234
234
  l.name,
235
235
  " "
236
236
  ] }),
237
- /* @__PURE__ */ t(y, { children: E(l.amount, "0,0") })
237
+ /* @__PURE__ */ t(y, { children: W(l.amount, "0,0") })
238
238
  ] })
239
239
  },
240
240
  l.guid
@@ -242,7 +242,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
242
242
  /* @__PURE__ */ t(B, {})
243
243
  ] }) })
244
244
  ] }, e.guid)) }),
245
- /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${c.total}: ${E(n.totalAmount, "0,0")}` })
245
+ /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${c.total}: ${W(n.totalAmount, "0,0")}` })
246
246
  ] });
247
247
  }, wt = D(Dt), xt = ({
248
248
  data: n,
@@ -263,7 +263,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
263
263
  px: 8,
264
264
  children: [
265
265
  l && /* @__PURE__ */ t(
266
- N,
266
+ R,
267
267
  {
268
268
  data: {
269
269
  categoryData: [],
@@ -279,7 +279,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
279
279
  }
280
280
  ),
281
281
  !l && /* @__PURE__ */ t(
282
- N,
282
+ R,
283
283
  {
284
284
  data: n,
285
285
  onSelected: s,
@@ -302,7 +302,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
302
302
  n.palette.chartMono.chartMono1,
303
303
  n.palette.chartMono.chartMono6
304
304
  ], Lt = () => {
305
- const n = mt(), { clientConfig: s } = rt(), { categories: o, dateRangeCategoryTotals: i, loadDateRangeCategoryTotals: c } = j(), { goals: r, spending: e } = w(), { displayedDateRange: l, selectedAccounts: u, selectedAccountGuids: m } = O(), { setFilter: p, sortedTransactions: h } = gt(), M = s?.master?.deep_link_params?.account_guids, C = s?.master?.deep_link_params?.view, [f, A] = a.useState(""), [_, x] = a.useState(C === "income" ? 1 : 0), [I, F] = a.useState(""), [st, V] = a.useState(!1);
305
+ const n = mt(), { clientConfig: s } = rt(), { categories: o, dateRangeCategoryTotals: i, loadDateRangeCategoryTotals: c } = j(), { goals: r, spending: e } = w(), { displayedDateRange: l, selectedAccounts: u, selectedAccountGuids: m } = $(), { setFilter: p, sortedTransactions: h } = gt(), M = s?.master?.deep_link_params?.account_guids, C = s?.master?.deep_link_params?.view, [f, A] = a.useState(""), [_, x] = a.useState(C === "income" ? 1 : 0), [I, F] = a.useState(""), [st, V] = a.useState(!1);
306
306
  a.useEffect(() => {
307
307
  c(
308
308
  u,
@@ -310,10 +310,12 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
310
310
  l.end
311
311
  ).finally();
312
312
  }, [u, l]);
313
- const $ = a.useMemo(
313
+ const E = a.useMemo(
314
314
  () => ot(o, r, n, i),
315
315
  [o, i]
316
- ), P = a.useMemo(
316
+ );
317
+ console.log(E, "spendingData");
318
+ const P = a.useMemo(
317
319
  () => at(o, i, vt(n)),
318
320
  [o, i]
319
321
  ), k = a.useMemo(
@@ -330,7 +332,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
330
332
  };
331
333
  if (_ === 0)
332
334
  if (g === "other") {
333
- const b = $.categoryData.find((G) => G.guid === "other");
335
+ const b = E.categoryData.find((G) => G.guid === "other");
334
336
  p({
335
337
  ...v,
336
338
  custom: (G) => !!b?.categoryTotals?.find((lt) => lt.guid === G.top_level_category_guid)
@@ -351,22 +353,22 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
351
353
  return /* @__PURE__ */ d(T, { children: [
352
354
  /* @__PURE__ */ d(nt, { onChange: ct, value: _, variant: "fullWidth", children: [
353
355
  /* @__PURE__ */ t(
354
- W,
356
+ N,
355
357
  {
356
358
  label: /* @__PURE__ */ t(
357
- R,
359
+ O,
358
360
  {
359
- amount: $.totalAmount,
361
+ amount: E.totalAmount,
360
362
  label: e.spend_tab_title
361
363
  }
362
364
  )
363
365
  }
364
366
  ),
365
367
  /* @__PURE__ */ t(
366
- W,
368
+ N,
367
369
  {
368
370
  label: /* @__PURE__ */ t(
369
- R,
371
+ O,
370
372
  {
371
373
  amount: P.totalAmount,
372
374
  label: e.income_tab_title
@@ -378,7 +380,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
378
380
  _ === 0 && /* @__PURE__ */ t(
379
381
  Z,
380
382
  {
381
- data: $,
383
+ data: E,
382
384
  onSelected: H,
383
385
  onViewTransactions: K,
384
386
  selectedId: f,
@@ -417,7 +419,7 @@ const R = ({ amount: n, label: s }) => /* @__PURE__ */ d(S, { direction: "column
417
419
  )
418
420
  ] });
419
421
  }, At = D(Lt), It = ({ onBackClick: n, sx: s = {} }) => {
420
- const { visibleAccounts: o } = it(), { spending: i } = w(), { isCopyLoaded: c, isInitialized: r, setDisplayedDate: e, setSelectedAccounts: l } = O(), { onEvent: u } = pt(), { clientConfig: m } = rt(), p = m?.master?.deep_link_params?.date_range, [h, M] = a.useState(!1);
422
+ const { visibleAccounts: o } = it(), { spending: i } = w(), { isCopyLoaded: c, isInitialized: r, setDisplayedDate: e, setSelectedAccounts: l } = $(), { onEvent: u } = pt(), { clientConfig: m } = rt(), p = m?.master?.deep_link_params?.date_range, [h, M] = a.useState(!1);
421
423
  a.useEffect(() => {
422
424
  l(o);
423
425
  }, [o]), a.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.2.15-alpha-ram13-finstrong-testing",
3
+ "version": "7.2.15-alpha-ram15-finstrong-testing",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",