@mx-cartographer/experiences 7.0.11 → 7.0.12

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
@@ -1,3 +1,7 @@
1
+ ## [7.0.12] - 09-19-2025
2
+
3
+ - **FIXED** - `Retirement Goal` Projection month and year issue fixed for new Goal add scenario
4
+
1
5
  ## [7.0.11] - 09-19-2025
2
6
 
3
7
  - **FIXED** - Graphs from preventing scroll Gesture
@@ -1,41 +1,41 @@
1
1
  import { jsxs as g, jsx as _ } from "react/jsx-runtime";
2
2
  import u from "react";
3
- import p from "@mui/material/Button";
4
- import T from "@mui/material/Card";
5
- import I from "@mui/material/CardContent";
6
- import N from "@mui/material/CardHeader";
7
- import O from "@mui/material/Stack";
8
- import { AccountBalance as w, ChevronRight as S } from "@mxenabled/mx-icons";
3
+ import T from "@mui/material/Button";
4
+ import I from "@mui/material/Card";
5
+ import N from "@mui/material/CardContent";
6
+ import O from "@mui/material/CardHeader";
7
+ import S from "@mui/material/Stack";
8
+ import { AccountBalance as w, ChevronRight as L } from "@mxenabled/mx-icons";
9
9
  import { Text as A } from "@mxenabled/mxui";
10
- import { h as L } from "./ConnectDrawer-BA9H_xx8.mjs";
11
- import { m as b } from "./hooks-DkUqN6JE.mjs";
12
- import { makeAutoObservable as y, runInAction as c } from "mobx";
13
- import { F as D, A as i } from "./Fetch-CkFKy79O.mjs";
14
- import { fromUnixTime as C } from "date-fns/fromUnixTime";
15
- import { addYears as v } from "date-fns/addYears";
16
- import { getUnixTime as x } from "date-fns/getUnixTime";
17
- import { b as m } from "./Localization-2MODESHW.mjs";
18
- import { a as K } from "./NumberFormatting-CtWHhyBX.mjs";
19
- import { f as F, D as B } from "./Dialog-CWW597AF.mjs";
10
+ import { h as b } from "./ConnectDrawer-BA9H_xx8.mjs";
11
+ import { m as y } from "./hooks-DkUqN6JE.mjs";
12
+ import { makeAutoObservable as D, runInAction as c } from "mobx";
13
+ import { F as v, A as i } from "./Fetch-CkFKy79O.mjs";
14
+ import { fromUnixTime as G } from "date-fns/fromUnixTime";
15
+ import { addYears as x } from "date-fns/addYears";
16
+ import { getUnixTime as K } from "date-fns/getUnixTime";
17
+ import { b as E } from "./Localization-2MODESHW.mjs";
18
+ import { a as F } from "./NumberFormatting-CtWHhyBX.mjs";
19
+ import { f as B, D as U } from "./Dialog-CWW597AF.mjs";
20
20
  const at = ({ description: e, label: t, title: o }) => {
21
- const { config: r } = b(), [n, s] = u.useState(!1);
21
+ const { config: r } = y(), [n, s] = u.useState(!1);
22
22
  if (r.show_connections_widget_in_master)
23
23
  return /* @__PURE__ */ g(u.Fragment, { children: [
24
- /* @__PURE__ */ g(T, { sx: { m: 24 }, children: [
24
+ /* @__PURE__ */ g(I, { sx: { m: 24 }, children: [
25
25
  /* @__PURE__ */ _(
26
- N,
26
+ O,
27
27
  {
28
28
  avatar: /* @__PURE__ */ _(w, {}),
29
29
  sx: { ".MuiCardHeader-avatar": { mr: 8 } },
30
30
  title: /* @__PURE__ */ _(A, { bold: !0, variant: "Body", children: o })
31
31
  }
32
32
  ),
33
- /* @__PURE__ */ _(I, { sx: { ":last-child": { pb: 4 }, ml: 28, py: 0 }, children: /* @__PURE__ */ g(O, { alignItems: "flex-start", spacing: 2, children: [
33
+ /* @__PURE__ */ _(N, { sx: { ":last-child": { pb: 4 }, ml: 28, py: 0 }, children: /* @__PURE__ */ g(S, { alignItems: "flex-start", spacing: 2, children: [
34
34
  /* @__PURE__ */ _(A, { color: "text.secondary", sx: { textWrap: "wrap" }, variant: "ParagraphSmall", children: e }),
35
35
  /* @__PURE__ */ _(
36
- p,
36
+ T,
37
37
  {
38
- endIcon: /* @__PURE__ */ _(S, {}),
38
+ endIcon: /* @__PURE__ */ _(L, {}),
39
39
  onClick: () => s(!0),
40
40
  sx: {
41
41
  pl: 0,
@@ -50,7 +50,7 @@ const at = ({ description: e, label: t, title: o }) => {
50
50
  ] }) })
51
51
  ] }),
52
52
  /* @__PURE__ */ _(
53
- L,
53
+ b,
54
54
  {
55
55
  onClose: () => s(!1),
56
56
  showConnectWidget: n,
@@ -59,11 +59,11 @@ const at = ({ description: e, label: t, title: o }) => {
59
59
  )
60
60
  ] });
61
61
  };
62
- var a = /* @__PURE__ */ ((e) => (e[e.DEBT_TRACK = 1] = "DEBT_TRACK", e[e.SAVINGS_TRACK = 2] = "SAVINGS_TRACK", e[e.RETIREMENT_TRACK = 3] = "RETIREMENT_TRACK", e[e.EMERGENCY_FUND_TRACK = 4] = "EMERGENCY_FUND_TRACK", e))(a || {}), U = /* @__PURE__ */ ((e) => (e[e.SAVE_AMOUNT = 1] = "SAVE_AMOUNT", e[e.KEEP_BALANCE_BELOW = 2] = "KEEP_BALANCE_BELOW", e[e.KEEP_BALANCE_ABOVE = 3] = "KEEP_BALANCE_ABOVE", e[e.ACTION = 4] = "ACTION", e))(U || {}), l = /* @__PURE__ */ ((e) => (e[e.AUTOMOBILE = 1] = "AUTOMOBILE", e[e.COLLEGE = 2] = "COLLEGE", e[e.HOUSE = 3] = "HOUSE", e[e.RECREATIONAL_VEHICLE = 4] = "RECREATIONAL_VEHICLE", e[e.VACATION = 5] = "VACATION", e[e.ELECTRONIC = 6] = "ELECTRONIC", e[e.OTHER = 7] = "OTHER", e[e.RETIREMENT = 8] = "RETIREMENT", e[e.EMERGENCY_FUND = 9] = "EMERGENCY_FUND", e[e.SETUP_BUDGETS = 10] = "SETUP_BUDGETS", e[e.START_MONEY_MANAGEMENT = 11] = "START_MONEY_MANAGEMENT", e[e.CREDIT_CARD = 12] = "CREDIT_CARD", e[e.LINE_OF_CREDIT = 13] = "LINE_OF_CREDIT", e[e.LOANS = 14] = "LOANS", e))(l || {});
62
+ var a = /* @__PURE__ */ ((e) => (e[e.DEBT_TRACK = 1] = "DEBT_TRACK", e[e.SAVINGS_TRACK = 2] = "SAVINGS_TRACK", e[e.RETIREMENT_TRACK = 3] = "RETIREMENT_TRACK", e[e.EMERGENCY_FUND_TRACK = 4] = "EMERGENCY_FUND_TRACK", e))(a || {}), $ = /* @__PURE__ */ ((e) => (e[e.SAVE_AMOUNT = 1] = "SAVE_AMOUNT", e[e.KEEP_BALANCE_BELOW = 2] = "KEEP_BALANCE_BELOW", e[e.KEEP_BALANCE_ABOVE = 3] = "KEEP_BALANCE_ABOVE", e[e.ACTION = 4] = "ACTION", e))($ || {}), l = /* @__PURE__ */ ((e) => (e[e.AUTOMOBILE = 1] = "AUTOMOBILE", e[e.COLLEGE = 2] = "COLLEGE", e[e.HOUSE = 3] = "HOUSE", e[e.RECREATIONAL_VEHICLE = 4] = "RECREATIONAL_VEHICLE", e[e.VACATION = 5] = "VACATION", e[e.ELECTRONIC = 6] = "ELECTRONIC", e[e.OTHER = 7] = "OTHER", e[e.RETIREMENT = 8] = "RETIREMENT", e[e.EMERGENCY_FUND = 9] = "EMERGENCY_FUND", e[e.SETUP_BUDGETS = 10] = "SETUP_BUDGETS", e[e.START_MONEY_MANAGEMENT = 11] = "START_MONEY_MANAGEMENT", e[e.CREDIT_CARD = 12] = "CREDIT_CARD", e[e.LINE_OF_CREDIT = 13] = "LINE_OF_CREDIT", e[e.LOANS = 14] = "LOANS", e))(l || {});
63
63
  class R {
64
64
  fetchInstance;
65
65
  constructor(t, o) {
66
- this.fetchInstance = new D(t, o);
66
+ this.fetchInstance = new v(t, o);
67
67
  }
68
68
  addGoal = async (t) => this.fetchInstance.post(i.GOALS, t).then((o) => o.goal);
69
69
  addRetirementGoal = async (t) => this.fetchInstance.post(i.RETIREMENT_GOALS, t).then((o) => o.retirement_goal);
@@ -91,19 +91,19 @@ function it(e, t) {
91
91
  style: "percent",
92
92
  minimumFractionDigits: 0,
93
93
  maximumFractionDigits: 0
94
- }, E = t.is_complete ? t.completed_at : t.projected_to_complete_at, d = E ? C(E) : /* @__PURE__ */ new Date(), G = m(
94
+ }, d = t.is_complete ? t.completed_at : t.projected_to_complete_at, m = d ? G(d) : /* @__PURE__ */ new Date(), f = E(
95
95
  e.goal_percentage,
96
- K(r, h)
97
- ), f = m(
96
+ F(r, h)
97
+ ), p = E(
98
98
  t.is_complete ? e.completed_label : e.goal_projection,
99
- F(d, B.MONTH_SHORT_YEAR)
99
+ B(m, U.MONTH_SHORT_YEAR)
100
100
  );
101
101
  return {
102
102
  backgroundColor: n,
103
103
  color: s,
104
104
  percentage: r,
105
- percentageText: G,
106
- projectedText: f
105
+ percentageText: f,
106
+ projectedText: p
107
107
  };
108
108
  }
109
109
  function st(e) {
@@ -162,15 +162,15 @@ function st(e) {
162
162
  const ct = (e, t) => {
163
163
  switch (e) {
164
164
  case a.DEBT_TRACK:
165
- return m(t.zero_state_ongoing, "debt");
165
+ return E(t.zero_state_ongoing, "debt");
166
166
  case a.SAVINGS_TRACK:
167
- return m(t.zero_state_ongoing, "saving");
167
+ return E(t.zero_state_ongoing, "saving");
168
168
  default:
169
- return m(t.zero_state_ongoing, "retirement");
169
+ return E(t.zero_state_ongoing, "retirement");
170
170
  }
171
- }, $ = (e, t) => {
172
- const o = C(t), r = v(o, e);
173
- return x(r);
171
+ }, C = (e, t) => {
172
+ const o = G(t), r = x(o, e);
173
+ return K(r);
174
174
  };
175
175
  class lt {
176
176
  globalStore;
@@ -183,7 +183,7 @@ class lt {
183
183
  monthlyCashFlowProfile = void 0;
184
184
  goalsLoaded = !1;
185
185
  constructor(t) {
186
- this.globalStore = t, this.api = new R(t.endpoint, t.sessionToken), y(this);
186
+ this.globalStore = t, this.api = new R(t.endpoint, t.sessionToken), D(this);
187
187
  }
188
188
  get orderedGoals() {
189
189
  return this.goals.slice().sort((t, o) => t.position - o.position);
@@ -223,13 +223,13 @@ class lt {
223
223
  addRetirementGoal = async (t) => {
224
224
  const o = this.globalStore.copyStore.copy.goals;
225
225
  try {
226
- const r = await this.api.addRetirementGoal(t), n = [];
227
- for (const s of this.newRetirementGoalAccounts) {
228
- const h = await this.api.addRetirementGoalAccount({
229
- ...s,
226
+ const r = await this.api.addRetirementGoal(t), n = [], s = this.globalStore.userStore.user.birthday;
227
+ for (const h of this.newRetirementGoalAccounts) {
228
+ const d = await this.api.addRetirementGoalAccount({
229
+ ...h,
230
230
  retirement_goal_guid: r.guid
231
231
  });
232
- n.push(h);
232
+ n.push(d);
233
233
  }
234
234
  this.setNewRetirementGoalAccounts([]), c(() => {
235
235
  this.goals = [
@@ -238,7 +238,8 @@ class lt {
238
238
  ...r,
239
239
  amount: r.target_amount,
240
240
  name: o.retirement,
241
- track_type: a.RETIREMENT_TRACK
241
+ track_type: a.RETIREMENT_TRACK,
242
+ projected_to_complete_at: r.retirement_age && s ? C(r.retirement_age, s) : void 0
242
243
  }
243
244
  ], this.retirementGoalAccounts = [...this.retirementGoalAccounts, ...n];
244
245
  });
@@ -259,18 +260,18 @@ class lt {
259
260
  loadGoals = async () => {
260
261
  const t = this.globalStore.copyStore.copy.goals;
261
262
  try {
262
- const o = await this.api.getGoals(), r = await this.api.getRetirementGoals(), n = await this.api.getRetirementGoalAccounts(), s = await this.api.getMonthlyCashFlowProfile(), h = this.globalStore.userStore.user.birthday, E = [
263
+ const o = await this.api.getGoals(), r = await this.api.getRetirementGoals(), n = await this.api.getRetirementGoalAccounts(), s = await this.api.getMonthlyCashFlowProfile(), h = this.globalStore.userStore.user.birthday, d = [
263
264
  ...o,
264
- ...r.map((d) => ({
265
- ...d,
266
- amount: d.target_amount,
265
+ ...r.map((m) => ({
266
+ ...m,
267
+ amount: m.target_amount,
267
268
  name: t.retirement,
268
269
  track_type: a.RETIREMENT_TRACK,
269
- projected_to_complete_at: d.retirement_age && h ? $(d.retirement_age, h) : void 0
270
+ projected_to_complete_at: m.retirement_age && h ? C(m.retirement_age, h) : void 0
270
271
  }))
271
272
  ];
272
273
  c(() => {
273
- this.goals = E, this.retirementGoalAccounts = n, this.monthlyCashFlowProfile = s, this.goalsLoaded = !0;
274
+ this.goals = d, this.retirementGoalAccounts = n, this.monthlyCashFlowProfile = s, this.goalsLoaded = !0;
274
275
  });
275
276
  } catch (o) {
276
277
  console.error(`Error occured while getting goals: ${o}`);
@@ -353,7 +354,7 @@ class lt {
353
354
  }
354
355
  export {
355
356
  at as C,
356
- U as G,
357
+ $ as G,
357
358
  l as M,
358
359
  a as T,
359
360
  ct as a,
@@ -25,8 +25,8 @@ import { I as ea } from "../IconBacking-B9oC6uL2.mjs";
25
25
  import { D as aa, F as ra, a as oa, c as na, R as ia, S as ca } from "../RepeatingTransaction-BW4J-jeJ.mjs";
26
26
  import { C as nt } from "../CashflowStore-D9Dpuz7X.mjs";
27
27
  import { I as la } from "../CashflowStore-D9Dpuz7X.mjs";
28
- import { d as it } from "../GoalStore-BH5TWxYr.mjs";
29
- import { C as ha, G as ga, M as pa, T as ma } from "../GoalStore-BH5TWxYr.mjs";
28
+ import { d as it } from "../GoalStore-DLzTboF9.mjs";
29
+ import { C as ha, G as ga, M as pa, T as ma } from "../GoalStore-DLzTboF9.mjs";
30
30
  import { C as ya } from "../CurrencyText-YUhH2caW.mjs";
31
31
  import { E as Sa } from "../EmptyState-Dcb-o2tl.mjs";
32
32
  import { L as wa } from "../ListItemAction-DNZZ5fSa.mjs";
@@ -1,5 +1,5 @@
1
- import { g as fe, T as m, a as Oe, M as J, C as ye, b as Le, G as pe } from "../GoalStore-BH5TWxYr.mjs";
2
- import { c as Hn, d as Xn } from "../GoalStore-BH5TWxYr.mjs";
1
+ import { g as fe, T as m, a as Oe, M as J, C as ye, b as Le, G as pe } from "../GoalStore-DLzTboF9.mjs";
2
+ import { c as Hn, d as Xn } from "../GoalStore-DLzTboF9.mjs";
3
3
  import { jsxs as i, jsx as e, Fragment as U } from "react/jsx-runtime";
4
4
  import y from "react";
5
5
  import { observer as D } from "mobx-react-lite";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.11",
3
+ "version": "7.0.12",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",