@mx-cartographer/experiences 7.2.30 → 7.3.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{Account-vp_TAbGt.mjs → Account-YwUMFz93.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-B6ZFRZ8l.mjs → AccountDetailsContent-BgCST7mK.mjs} +8 -8
  4. package/dist/AccountDetailsHeader-jAFWoHj7.mjs +87 -0
  5. package/dist/{AccountFields-DUToRRqW.mjs → AccountFields-DPxMPBF0.mjs} +2 -2
  6. package/dist/{AccountListItem-CeY_WIpj.mjs → AccountListItem-D6rWAreC.mjs} +4 -4
  7. package/dist/{AccountStore-BzqNrhw4.mjs → AccountStore-B5E98oM1.mjs} +2 -2
  8. package/dist/{Accounts-C1QxUB-e.mjs → Accounts-UIlYCmHb.mjs} +1 -1
  9. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-CXvenbdN.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-BXnLseqP.mjs → CategorySelectorDrawer-Buy70Y3V.mjs} +1 -1
  11. package/dist/{ConnectDrawer-Bw5s6Dw1.mjs → ConnectDrawer-CbxHKlRv.mjs} +1 -1
  12. package/dist/{ConnectionsDrawer-BDvVuJQf.mjs → ConnectionsDrawer-C6kanU7I.mjs} +2 -2
  13. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-lSC7oPDg.mjs} +1 -1
  14. package/dist/{DebtsStore-BD_XwsI7.mjs → DebtsStore-DgIcphe_.mjs} +1 -1
  15. package/dist/{ExportCsvAction-DTO_UotC.mjs → ExportCsvAction-DZ10CbWd.mjs} +3 -3
  16. package/dist/{GoalStore-BgFV554B.mjs → GoalStore-CAlmSu4U.mjs} +2 -2
  17. package/dist/{Help-B6dIcujh.mjs → Help-hi9I9EYP.mjs} +1 -1
  18. package/dist/{LineChart-4Zi8Z8PR.mjs → LineChart-eK4IQImU.mjs} +1 -1
  19. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BmL5buOf.mjs} +1 -1
  20. package/dist/{ManageIncome-CXeJPfjE.mjs → ManageIncome-Cypo9qY4.mjs} +4 -4
  21. package/dist/{MicroWidgetContainer-DpeqN9n3.mjs → MicroWidgetContainer-CFdMGJKg.mjs} +1 -1
  22. package/dist/{MiniWidgetContainer-D0gfmbaF.mjs → MiniWidgetContainer-BdgBvpga.mjs} +1 -1
  23. package/dist/{NetWorthStore-D1NiDUcc.mjs → NetWorthStore-CxqIxAgN.mjs} +2 -2
  24. package/dist/{NotificationSettings-CLAV8YEa.mjs → NotificationSettings-DxytNHlN.mjs} +3 -3
  25. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-V6FEoIDe.mjs} +3 -3
  26. package/dist/{RecurringSettings-D7476j-N.mjs → RecurringSettings-iIupYxJW.mjs} +3 -3
  27. package/dist/{TransactionDetails-Cscyr17P.mjs → TransactionDetails-BUoNbsu-.mjs} +5 -5
  28. package/dist/{TransactionStore-DCH-rl8p.mjs → TransactionStore-C1oyQCZK.mjs} +2 -2
  29. package/dist/TrendsStore-5PvDT_o6.mjs +182 -0
  30. package/dist/{User-BQUxBeZV.mjs → User-Bj34_i8g.mjs} +1 -1
  31. package/dist/{WidgetContainer-EbrN1oIo.mjs → WidgetContainer-BnTgAfQn.mjs} +2 -2
  32. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  33. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  34. package/dist/accounts/index.es.js +241 -205
  35. package/dist/analytics/index.es.js +2 -2
  36. package/dist/budgets/index.es.js +10 -10
  37. package/dist/cashflow/index.es.js +7 -7
  38. package/dist/categories/index.es.js +1 -1
  39. package/dist/common/components/charts/index.d.ts +0 -2
  40. package/dist/common/index.es.js +122 -125
  41. package/dist/dashboard/index.es.js +2 -2
  42. package/dist/debts/index.es.js +9 -9
  43. package/dist/{exportTransactionsToCSV-BwwmL4pM.mjs → exportTransactionsToCSV-B8qpk5MU.mjs} +1 -1
  44. package/dist/finstrong/index.es.js +6 -6
  45. package/dist/goals/index.es.js +12 -12
  46. package/dist/help/index.es.js +3 -3
  47. package/dist/{hooks-D6XlXHf4.mjs → hooks-Cy8JnjCg.mjs} +2 -2
  48. package/dist/investments/index.es.js +3 -3
  49. package/dist/merchants/index.es.js +1 -1
  50. package/dist/networth/index.es.js +14 -14
  51. package/dist/notifications/index.es.js +2 -2
  52. package/dist/recurringtransactions/index.es.js +8 -8
  53. package/dist/settings/index.es.js +6 -6
  54. package/dist/spending/index.es.js +4 -4
  55. package/dist/transactions/index.es.js +13 -13
  56. package/dist/trends/index.es.js +948 -583
  57. package/dist/{useAccountDisplayName-jS05A6-6.mjs → useAccountDisplayName-D6sQsNNQ.mjs} +2 -2
  58. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-BxytCjq5.mjs} +1 -1
  59. package/package.json +1 -1
  60. package/dist/AccountDetailsHeader-vPzGb1RZ.mjs +0 -120
  61. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
@@ -0,0 +1,182 @@
1
+ import { jsxs as d, jsx as l } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import S from "@mui/material/ListItem";
4
+ import R from "@mui/material/ListItemButton";
5
+ import f from "@mui/material/ListItemIcon";
6
+ import A from "@mui/material/ListItemText";
7
+ import h from "@mui/material/Stack";
8
+ import { Text as y } from "@mxenabled/mxui";
9
+ import { makeAutoObservable as N } from "mobx";
10
+ import { addSeconds as v } from "date-fns/addSeconds";
11
+ import { differenceInCalendarMonths as w } from "date-fns/differenceInCalendarMonths";
12
+ import { endOfMonth as D } from "date-fns/endOfMonth";
13
+ import { subMonths as I } from "date-fns/subMonths";
14
+ import { b as E, C as _, c as O } from "./Category-CevNQ03n.mjs";
15
+ import { f as L, D as T } from "./Dialog-CWW597AF.mjs";
16
+ const at = ({
17
+ onClick: e,
18
+ leftIcon: t,
19
+ rightIcon: o,
20
+ title: r,
21
+ subtitle: a,
22
+ rightContent: n,
23
+ titleBold: s = !0,
24
+ rightContentBold: m = !0
25
+ }) => {
26
+ const c = /* @__PURE__ */ d(x.Fragment, { children: [
27
+ t && /* @__PURE__ */ l(f, { sx: { ml: 0 }, children: t }),
28
+ /* @__PURE__ */ l(A, { children: /* @__PURE__ */ d(
29
+ h,
30
+ {
31
+ sx: {
32
+ alignItems: "center",
33
+ flexDirection: "row",
34
+ marginLeft: 12
35
+ },
36
+ children: [
37
+ /* @__PURE__ */ d(h, { sx: { flex: 1, minWidth: 0 }, children: [
38
+ /* @__PURE__ */ l(y, { bold: s, variant: "body1", children: r }),
39
+ a && /* @__PURE__ */ l(y, { variant: "caption", children: a })
40
+ ] }),
41
+ /* @__PURE__ */ d(h, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
42
+ n && /* @__PURE__ */ l(y, { bold: m, display: "flex", variant: "body1", children: n }),
43
+ o && /* @__PURE__ */ l(f, { children: o })
44
+ ] })
45
+ ]
46
+ }
47
+ ) })
48
+ ] });
49
+ return /* @__PURE__ */ l(S, { sx: { bgcolor: "background.paper" }, children: e ? /* @__PURE__ */ l(
50
+ R,
51
+ {
52
+ onClick: e,
53
+ sx: {
54
+ py: 14
55
+ },
56
+ children: c
57
+ }
58
+ ) : /* @__PURE__ */ l(
59
+ h,
60
+ {
61
+ sx: {
62
+ py: 14,
63
+ px: 24,
64
+ width: "100%",
65
+ flexDirection: "row",
66
+ alignItems: "center"
67
+ },
68
+ children: c
69
+ }
70
+ ) });
71
+ }, W = (e) => _[e] ?? _.default, F = (e) => O[e];
72
+ function G(e, t) {
73
+ const o = [], r = new Date(e);
74
+ for (; r <= t; ) {
75
+ const a = r.getFullYear(), n = String(r.getMonth() + 1).padStart(2, "0");
76
+ o.push(+`${a}${n}`), r.setMonth(r.getMonth() + 1);
77
+ }
78
+ return o;
79
+ }
80
+ const $ = (e) => e.reduce((o, r) => {
81
+ const a = {
82
+ top_level_category_guid: r.top_level_category_guid,
83
+ category_guid: r.category_guid,
84
+ amount: r.total,
85
+ year_month: r.year_month
86
+ }, { top_level_category_guid: n, category_guid: s } = a;
87
+ return o[s] || (o[s] = []), o[s].push(a), n !== s && (o[n] || (o[n] = []), o[n].push(a)), o;
88
+ }, {}), nt = (e, t, o) => {
89
+ const r = $(e), a = G(t, o);
90
+ return Object.entries(r).map(([s, m]) => {
91
+ const c = m[0].top_level_category_guid, b = a.map((i) => {
92
+ const g = m.filter((p) => p.year_month === i).reduce((p, M) => p + Math.abs(M.amount), 0), u = Number(String(i).slice(0, 4)), C = Number(String(i).slice(4));
93
+ return { x: new Date(u, C - 1), y: g };
94
+ }).sort((i, g) => i.x.getTime() - g.x.getTime());
95
+ return {
96
+ top_level_category_guid: c,
97
+ category_guid: s,
98
+ category_name: F(s),
99
+ category_color: W(c),
100
+ dataset: b
101
+ };
102
+ });
103
+ }, st = (e, t) => {
104
+ const o = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e, r = typeof t == "string" ? parseFloat(t.replace(/[^0-9.-]+/g, "")) : t;
105
+ return (o || 0) - (r || 0);
106
+ }, j = (e, t) => {
107
+ const o = e.subCategories.filter((n) => n.currentAmount !== 0), r = e.totalMonthlyAmounts.slice(-t), a = (n) => n.substring(0, 3) + " " + n.slice(-4);
108
+ return r.map((n) => {
109
+ const s = a(n.label), m = o.map((i) => {
110
+ const g = i.monthlyAmounts.slice(-t).find((u) => a(u.label) === s);
111
+ return {
112
+ label: i.name,
113
+ amount: Math.abs(g?.amount || 0),
114
+ header: s
115
+ };
116
+ }), c = e.monthlyAmounts.slice(-t).find((i) => a(i.label) === s);
117
+ return [{
118
+ label: e.name,
119
+ amount: Math.abs(c?.amount || 0),
120
+ header: s
121
+ }, ...m].sort((i, g) => g.amount - i.amount);
122
+ });
123
+ }, k = (e, t) => {
124
+ const o = e ? e.totalMonthlyAmounts.slice(-t).map((a) => ({
125
+ x: a.label.substring(0, 3),
126
+ y: Math.abs(a.amount)
127
+ })) : [], r = e ? j(e, t) : [];
128
+ return { monthlyAmounts: o, tooltipLabels: r };
129
+ }, H = (e) => e.slice().filter(
130
+ (t) => t.totalAmount !== 0 && t.isTransfer === !1 && t.guid !== E.INVESTMENTS
131
+ ).sort((t, o) => Math.abs(o.totalAmount) - Math.abs(t.totalAmount));
132
+ class it {
133
+ globalStore;
134
+ selectedCategoryData = null;
135
+ selectedDateRange;
136
+ visibleListLength = 5;
137
+ constructor(t) {
138
+ this.globalStore = t, this.selectedDateRange = {
139
+ start: v(D(I(/* @__PURE__ */ new Date(), 6)), 1),
140
+ end: D(/* @__PURE__ */ new Date())
141
+ }, N(this);
142
+ }
143
+ setSelectedCategoryData = (t) => {
144
+ this.selectedCategoryData = t;
145
+ };
146
+ setSelectedDateRange = (t) => {
147
+ this.selectedDateRange = t;
148
+ };
149
+ setVisibleListLength = (t) => {
150
+ this.visibleListLength = t;
151
+ };
152
+ get sortedDetailedCategoriesWithTransactions() {
153
+ return H(
154
+ this.globalStore.categoryStore.detailedCategoriesWithTransactions
155
+ );
156
+ }
157
+ get selectedDateRangeMonthCount() {
158
+ return w(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
159
+ }
160
+ get selectedDateRangeMonthRange() {
161
+ const t = L(this.selectedDateRange.start, T.MONTH_LONG), o = L(this.selectedDateRange.end, T.MONTH_LONG);
162
+ return `${t} - ${o}`;
163
+ }
164
+ get visibleCategories() {
165
+ return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
166
+ }
167
+ get collapsedCategories() {
168
+ return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
169
+ }
170
+ get categoryDetailsChartData() {
171
+ return k(
172
+ this.selectedCategoryData,
173
+ this.selectedDateRangeMonthCount
174
+ );
175
+ }
176
+ }
177
+ export {
178
+ at as L,
179
+ it as T,
180
+ st as a,
181
+ nt as g
182
+ };
@@ -22,7 +22,7 @@ import { isWithinInterval as Q } from "date-fns/isWithinInterval";
22
22
  import nn from "@mui/material/styles/useTheme";
23
23
  import k from "@mui/material/ListItem";
24
24
  import an from "@mui/material/ListItemButton";
25
- import { g as tn } from "./hooks-D6XlXHf4.mjs";
25
+ import { g as tn } from "./hooks-Cy8JnjCg.mjs";
26
26
  var on = /* @__PURE__ */ ((n) => (n[n.CREDIT = 1] = "CREDIT", n[n.DEBIT = 2] = "DEBIT", n))(on || {}), en = /* @__PURE__ */ ((n) => (n[n.POSTED = 1] = "POSTED", n[n.PENDING = 2] = "PENDING", n))(en || {});
27
27
  const rn = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
28
28
  const c = v(), l = cn(c);
@@ -13,7 +13,7 @@ import { ChevronLeft as le } from "@mxenabled/mx-icons";
13
13
  import { Icon as T, Text as X, DateRangePicker as J, H1 as Ce, H3 as de } from "@mxenabled/mxui";
14
14
  import { u as Te } from "./useDimensions-27p2evRx.mjs";
15
15
  import { L as Ie } from "./Loader-DUaFpDGv.mjs";
16
- import { g as Ee, b as Re, u as ge, a as Ae, W as Se } from "./hooks-D6XlXHf4.mjs";
16
+ import { g as Ee, b as Re, u as ge, a as Ae, W as Se } from "./hooks-Cy8JnjCg.mjs";
17
17
  import { u as ie } from "./useScreenSize-B6JyS_Lj.mjs";
18
18
  import { addMonths as Q } from "date-fns/addMonths";
19
19
  import { addDays as ue } from "date-fns/addDays";
@@ -37,7 +37,7 @@ import Ke from "@mui/material/ToggleButtonGroup";
37
37
  import Ge from "@mui/material/styles/useTheme";
38
38
  import { f as K, D as G, a as Me } from "./Dialog-CWW597AF.mjs";
39
39
  import { D as We } from "./Drawer-kEE73B87.mjs";
40
- import { k as ye, l as xe } from "./ConnectDrawer-Bw5s6Dw1.mjs";
40
+ import { k as ye, l as xe } from "./ConnectDrawer-CbxHKlRv.mjs";
41
41
  const ve = {
42
42
  ACCOUNTS_CLICK_ACCOUNT: "accounts_widget_click_account",
43
43
  ACCOUNTS_CLICK_CONNECT: "accounts_widget_click_connect_accounts",
@@ -1,4 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { MiniWidgetProps } from '../../../../common';
3
- declare const _default: React.FunctionComponent<MiniWidgetProps>;
3
+ interface AccountDetailsChartProps extends MiniWidgetProps {
4
+ ChartComponent?: React.ComponentType;
5
+ }
6
+ declare const _default: React.FunctionComponent<AccountDetailsChartProps>;
4
7
  export default _default;
@@ -1,7 +1,8 @@
1
1
  interface AccountDetailsHeaderProps {
2
+ ChartComponent?: React.ComponentType;
2
3
  customDetailsChart?: React.ReactElement;
3
4
  }
4
- declare const _default: (({ customDetailsChart }: AccountDetailsHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
5
+ declare const _default: (({ customDetailsChart, ChartComponent, }: AccountDetailsHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
5
6
  displayName: string;
6
7
  };
7
8
  export default _default;