@mx-cartographer/experiences 9.7.175 → 9.7.176
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 +5 -1
- package/dist/goals/components/actions/AmountToSaveAction.es.js +20 -19
- package/dist/goals/components/actions/AmountToSaveAction.es.js.map +1 -1
- package/dist/goals/components/actions/ContributionAction.es.js +20 -19
- package/dist/goals/components/actions/ContributionAction.es.js.map +1 -1
- package/dist/goals/components/actions/MonthlyPaymentAction.es.js +3 -2
- package/dist/goals/components/actions/MonthlyPaymentAction.es.js.map +1 -1
- package/dist/goals/components/actions/OriginalBalanceAction.es.js +4 -3
- package/dist/goals/components/actions/OriginalBalanceAction.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
## [9.7.176] - 11-17-2026
|
|
2
|
+
|
|
3
|
+
- Disable contribution Save when amount exceeds the maximum (WELL-178)
|
|
4
|
+
|
|
1
5
|
## [9.7.175] - 11-17-2026
|
|
2
6
|
|
|
3
|
-
- Monthly Top Merchant Spending Top Merchants drawer (WEC-2331)
|
|
7
|
+
- **ADDED** - Monthly Top Merchant Spending Top Merchants drawer: the month's 10 ranked merchants, each opening its Merchant History (WEC-2331)
|
|
4
8
|
|
|
5
9
|
## [9.7.174] - 11-17-2026
|
|
6
10
|
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { TrackType as
|
|
3
|
-
import
|
|
4
|
-
import A from "../../../
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { useGlobalCopyStore as T, useGoalStore as f } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { TrackType as a } from "../../../core/types/Goal.es.js";
|
|
3
|
+
import "../../../core/constants/Numbers.es.js";
|
|
4
|
+
import { formatCurrency as A } from "../../../core/utils/NumberFormatting.es.js";
|
|
5
|
+
import S from "../../../common/components/CurrencyInput.es.js";
|
|
6
|
+
import { ListItemAction as N } from "../../../common/components/ListItemAction.es.js";
|
|
7
|
+
import b from "react";
|
|
8
|
+
import { observer as v } from "mobx-react-lite";
|
|
8
9
|
import { jsx as i } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
10
|
-
const { goals:
|
|
10
|
+
var K = v(({ goal: t }) => {
|
|
11
|
+
const { goals: r } = T(), { setAlert: u, setSelectedGoal: c, updateGoal: p, updateRetirementGoal: d } = f(), [e, n] = b.useState(t.amount), m = !t.guid, s = e < 0 || e > 9999999999e-2, _ = t.track_type === a.SAVINGS_TRACK && t.has_been_spent || t.track_type !== a.SAVINGS_TRACK && t.is_complete, l = async () => {
|
|
11
12
|
const o = {
|
|
12
13
|
...t,
|
|
13
14
|
amount: e
|
|
14
15
|
};
|
|
15
|
-
t.amount = e,
|
|
16
|
+
t.amount = e, m ? c(o) : (t.track_type !== a.RETIREMENT_TRACK ? await p(o) : await d(o), u(r.alert_goal_updated_amount));
|
|
16
17
|
}, y = () => {
|
|
17
18
|
setTimeout(() => {
|
|
18
19
|
n(t.amount);
|
|
19
20
|
}, 250);
|
|
20
21
|
};
|
|
21
|
-
return /* @__PURE__ */ i(
|
|
22
|
+
return /* @__PURE__ */ i(N, {
|
|
22
23
|
isDisabled: _,
|
|
23
|
-
isSaveDisabled:
|
|
24
|
-
label:
|
|
24
|
+
isSaveDisabled: s,
|
|
25
|
+
label: r.details_amount_to_save,
|
|
25
26
|
onCancel: y,
|
|
26
27
|
onSave: l,
|
|
27
|
-
primaryText:
|
|
28
|
-
secondaryText:
|
|
29
|
-
zeroStateText:
|
|
30
|
-
children: /* @__PURE__ */ i(
|
|
28
|
+
primaryText: r.details_amount_to_save,
|
|
29
|
+
secondaryText: A(t.amount, "0,0"),
|
|
30
|
+
zeroStateText: m && t.amount === 0 ? r.add_amount : void 0,
|
|
31
|
+
children: /* @__PURE__ */ i(S, {
|
|
31
32
|
amount: e,
|
|
32
33
|
autoFocus: !0,
|
|
33
|
-
error:
|
|
34
|
+
error: s,
|
|
34
35
|
fullWidth: !0,
|
|
35
36
|
minAmount: 0,
|
|
36
37
|
setAmount: (o) => n(isNaN(Number(o)) ? e : Number(o)),
|
|
@@ -39,7 +40,7 @@ var E = C(({ goal: t }) => {
|
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
K as AmountToSaveAction
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
//# sourceMappingURL=AmountToSaveAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountToSaveAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/AmountToSaveAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal, TrackType } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface AmountToSaveActionProps {\n goal: Goal\n}\n\nexport const AmountToSaveAction = observer(({ goal }: AmountToSaveActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal, updateRetirementGoal } = useGoalStore()\n\n const [amount, setAmount] = React.useState<number>(goal.amount)\n\n const isNew = !goal.guid\n const isInvalid = amount < 0 || amount >
|
|
1
|
+
{"version":3,"file":"AmountToSaveAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/AmountToSaveAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal, TrackType } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface AmountToSaveActionProps {\n goal: Goal\n}\n\nexport const AmountToSaveAction = observer(({ goal }: AmountToSaveActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal, updateRetirementGoal } = useGoalStore()\n\n const [amount, setAmount] = React.useState<number>(goal.amount)\n\n const isNew = !goal.guid\n const isInvalid = amount < 0 || amount > MAX_MONEY_INPUT\n const isDisabled =\n (goal.track_type === TrackType.SAVINGS_TRACK && goal.has_been_spent) ||\n (goal.track_type !== TrackType.SAVINGS_TRACK && goal.is_complete)\n\n const handleSave = async () => {\n const updatedGoal = { ...goal, amount }\n goal.amount = amount\n if (isNew) {\n setSelectedGoal(updatedGoal)\n } else {\n if (goal.track_type !== TrackType.RETIREMENT_TRACK) {\n await updateGoal(updatedGoal)\n } else {\n await updateRetirementGoal(updatedGoal)\n }\n\n setAlert(copy.alert_goal_updated_amount)\n }\n }\n\n const handleCancel = () => {\n setTimeout(() => {\n setAmount(goal.amount)\n }, 250)\n }\n\n return (\n <ListItemAction\n isDisabled={isDisabled}\n isSaveDisabled={isInvalid}\n label={copy.details_amount_to_save}\n onCancel={handleCancel}\n onSave={handleSave}\n primaryText={copy.details_amount_to_save}\n secondaryText={formatCurrency(goal.amount, '0,0')}\n zeroStateText={isNew && goal.amount === 0 ? copy.add_amount : undefined}\n >\n <CurrencyInput\n amount={amount}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(v) => setAmount(!isNaN(Number(v)) ? Number(v) : amount)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n )\n})\n"],"mappings":";;;;;;;;;AAYA,IAAa,IAAqB,EAAA,CAAU,EAAE,MAAA,EAAA,MAAoC;AAChF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,iBAAA,GAAiB,YAAA,GAAY,sBAAA,EAAA,IAAyB,EAAa,GAE/E,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAiB,EAAK,MAAM,GAExD,IAAQ,CAAC,EAAK,MACd,IAAY,IAAS,KAAK,IAAA,eAC1B,IACH,EAAK,eAAe,EAAU,iBAAiB,EAAK,kBACpD,EAAK,eAAe,EAAU,iBAAiB,EAAK,aAEjD,IAAa,YAAY;AAC7B,UAAM,IAAc;AAAA,MAAE,GAAG;AAAA,MAAM,QAAA;AAAA,IAAO;AACtC,IAAA,EAAK,SAAS,GACV,IACF,EAAgB,CAAW,KAEvB,EAAK,eAAe,EAAU,mBAChC,MAAM,EAAW,CAAW,IAE5B,MAAM,EAAqB,CAAW,GAGxC,EAAS,EAAK,yBAAyB;AAAA,EAE3C,GAEM,IAAA,MAAqB;AACzB,eAAA,MAAiB;AACf,MAAA,EAAU,EAAK,MAAM;AAAA,IACvB,GAAG,GAAG;AAAA,EACR;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACc,YAAA;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,aAAa,EAAK;AAAA,IAClB,eAAe,EAAe,EAAK,QAAQ,KAAK;AAAA,IAChD,eAAe,KAAS,EAAK,WAAW,IAAI,EAAK,aAAa;AAAA,IAE9D,UAAA,gBAAA,EAAC,GAAD;AAAA,MACU,QAAA;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAA,CAAY,MAAM,EAAW,MAAM,OAAO,CAAC,CAAC,IAAgB,IAAZ,OAAO,CAAC,CAAU;AAAA,MAClE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,IACxC,CAAA;AAAA,EACa,CAAA;AAEpB,CAAC"}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import { useGlobalCopyStore as d, useGoalStore as
|
|
1
|
+
import { useGlobalCopyStore as d, useGoalStore as p } from "../../../common/context/hooks.es.js";
|
|
2
2
|
import { TrackType as a } from "../../../core/types/Goal.es.js";
|
|
3
|
-
import
|
|
3
|
+
import "../../../core/constants/Numbers.es.js";
|
|
4
|
+
import { formatCurrency as b } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
5
|
import A from "../../../common/components/CurrencyInput.es.js";
|
|
5
6
|
import { ListItemAction as C } from "../../../common/components/ListItemAction.es.js";
|
|
6
7
|
import s from "react";
|
|
7
|
-
import { observer as
|
|
8
|
-
import
|
|
8
|
+
import { observer as T } from "mobx-react-lite";
|
|
9
|
+
import g from "@mui/material/Stack";
|
|
9
10
|
import { jsx as m } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
11
|
-
const { goals:
|
|
11
|
+
var G = T(({ trackType: e }) => {
|
|
12
|
+
const { goals: i } = d(), { setAlert: _, monthlyCashFlowProfile: r, updateMonthlyCashFlowProfile: f } = p(), n = s.useMemo(() => {
|
|
12
13
|
let o = 0;
|
|
13
14
|
return e === a.SAVINGS_TRACK ? o = r?.amount_allocated_for_savings_goals || 0 : e === a.DEBT_TRACK ? o = r?.amount_allocated_for_debt_goals || 0 : e === a.RETIREMENT_TRACK && (o = r?.amount_allocated_for_retirement_goals || 0), o;
|
|
14
15
|
}, [r]);
|
|
15
16
|
s.useEffect(() => {
|
|
16
|
-
|
|
17
|
+
l(n);
|
|
17
18
|
}, [n]);
|
|
18
|
-
const [t,
|
|
19
|
+
const [t, l] = s.useState(n), u = t < 0 || t > 9999999999e-2, c = async () => {
|
|
19
20
|
if (r) {
|
|
20
21
|
const o = { ...r };
|
|
21
|
-
e === a.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = t : e === a.DEBT_TRACK ? o.amount_allocated_for_debt_goals = t : e === a.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = t), await
|
|
22
|
+
e === a.SAVINGS_TRACK ? o.amount_allocated_for_savings_goals = t : e === a.DEBT_TRACK ? o.amount_allocated_for_debt_goals = t : e === a.RETIREMENT_TRACK && (o.amount_allocated_for_retirement_goals = t), await f(o), _(i.alert_contribution_updated);
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
return /* @__PURE__ */ m(
|
|
25
|
+
return /* @__PURE__ */ m(g, {
|
|
25
26
|
bgcolor: "background.paper",
|
|
26
27
|
children: /* @__PURE__ */ m(C, {
|
|
27
|
-
isSaveDisabled: !t || isNaN(t),
|
|
28
|
-
label:
|
|
29
|
-
onCancel: () =>
|
|
30
|
-
onSave:
|
|
31
|
-
primaryText:
|
|
32
|
-
secondaryText:
|
|
28
|
+
isSaveDisabled: !t || isNaN(t) || u,
|
|
29
|
+
label: i.contribution_label,
|
|
30
|
+
onCancel: () => l(n),
|
|
31
|
+
onSave: c,
|
|
32
|
+
primaryText: i.contribution_label,
|
|
33
|
+
secondaryText: b(n, "0,0.00"),
|
|
33
34
|
children: /* @__PURE__ */ m(A, {
|
|
34
35
|
amount: t,
|
|
35
36
|
autoFocus: !0,
|
|
36
|
-
error:
|
|
37
|
+
error: u,
|
|
37
38
|
fullWidth: !0,
|
|
38
39
|
minAmount: 0,
|
|
39
|
-
setAmount: (o) =>
|
|
40
|
+
setAmount: (o) => l(isNaN(Number(o)) ? t : Number(o)),
|
|
40
41
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
41
42
|
})
|
|
42
43
|
})
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
G as ContributionAction
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
//# sourceMappingURL=ContributionAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContributionAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/ContributionAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Stack from '@mui/material/Stack'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { TrackType } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface ContributionActionProps {\n trackType: TrackType\n}\n\nexport const ContributionAction = observer(({ trackType }: ContributionActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, monthlyCashFlowProfile, updateMonthlyCashFlowProfile } = useGoalStore()\n\n const contribution = React.useMemo(() => {\n let amount = 0\n if (trackType === TrackType.SAVINGS_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_savings_goals || 0\n } else if (trackType === TrackType.DEBT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_debt_goals || 0\n } else if (trackType === TrackType.RETIREMENT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_retirement_goals || 0\n }\n return amount\n }, [monthlyCashFlowProfile])\n\n React.useEffect(() => {\n setAmount(contribution)\n }, [contribution])\n\n const [amount, setAmount] = React.useState<number>(contribution)\n\n const isInvalid = amount < 0 || amount >
|
|
1
|
+
{"version":3,"file":"ContributionAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/ContributionAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Stack from '@mui/material/Stack'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { TrackType } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface ContributionActionProps {\n trackType: TrackType\n}\n\nexport const ContributionAction = observer(({ trackType }: ContributionActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, monthlyCashFlowProfile, updateMonthlyCashFlowProfile } = useGoalStore()\n\n const contribution = React.useMemo(() => {\n let amount = 0\n if (trackType === TrackType.SAVINGS_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_savings_goals || 0\n } else if (trackType === TrackType.DEBT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_debt_goals || 0\n } else if (trackType === TrackType.RETIREMENT_TRACK) {\n amount = monthlyCashFlowProfile?.amount_allocated_for_retirement_goals || 0\n }\n return amount\n }, [monthlyCashFlowProfile])\n\n React.useEffect(() => {\n setAmount(contribution)\n }, [contribution])\n\n const [amount, setAmount] = React.useState<number>(contribution)\n\n const isInvalid = amount < 0 || amount > MAX_MONEY_INPUT\n\n const handleSave = async () => {\n if (monthlyCashFlowProfile) {\n const updatedProfile = { ...monthlyCashFlowProfile }\n if (trackType === TrackType.SAVINGS_TRACK) {\n updatedProfile.amount_allocated_for_savings_goals = amount\n } else if (trackType === TrackType.DEBT_TRACK) {\n updatedProfile.amount_allocated_for_debt_goals = amount\n } else if (trackType === TrackType.RETIREMENT_TRACK) {\n updatedProfile.amount_allocated_for_retirement_goals = amount\n }\n\n await updateMonthlyCashFlowProfile(updatedProfile)\n setAlert(copy.alert_contribution_updated)\n }\n }\n\n return (\n <Stack bgcolor=\"background.paper\">\n <ListItemAction\n isSaveDisabled={!amount || isNaN(amount) || isInvalid}\n label={copy.contribution_label}\n onCancel={() => setAmount(contribution)}\n onSave={handleSave}\n primaryText={copy.contribution_label}\n secondaryText={formatCurrency(contribution, '0,0.00')}\n >\n <CurrencyInput\n amount={amount}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(value) => setAmount(!isNaN(Number(value)) ? Number(value) : amount)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;AAcA,IAAa,IAAqB,EAAA,CAAU,EAAE,WAAA,EAAA,MAAyC;AACrF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,wBAAA,GAAwB,8BAAA,EAAA,IAAiC,EAAa,GAElF,IAAe,EAAM,QAAA,MAAc;AACvC,QAAI,IAAS;AACb,WAAI,MAAc,EAAU,gBAC1B,IAAS,GAAwB,sCAAsC,IAC9D,MAAc,EAAU,aACjC,IAAS,GAAwB,mCAAmC,IAC3D,MAAc,EAAU,qBACjC,IAAS,GAAwB,yCAAyC,IAErE;AAAA,EACT,GAAG,CAAC,CAAsB,CAAC;AAE3B,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAA,EAAU,CAAY;AAAA,EACxB,GAAG,CAAC,CAAY,CAAC;AAEjB,QAAM,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAiB,CAAY,GAEzD,IAAY,IAAS,KAAK,IAAA,eAE1B,IAAa,YAAY;AAC7B,QAAI,GAAwB;AAC1B,YAAM,IAAiB,EAAE,GAAG,EAAuB;AACnD,MAAI,MAAc,EAAU,gBAC1B,EAAe,qCAAqC,IAC3C,MAAc,EAAU,aACjC,EAAe,kCAAkC,IACxC,MAAc,EAAU,qBACjC,EAAe,wCAAwC,IAGzD,MAAM,EAA6B,CAAc,GACjD,EAAS,EAAK,0BAA0B;AAAA,IAC1C;AAAA,EACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,SAAQ;AAAA,IACb,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,gBAAgB,CAAC,KAAU,MAAM,CAAM,KAAK;AAAA,MAC5C,OAAO,EAAK;AAAA,MACZ,UAAA,MAAgB,EAAU,CAAY;AAAA,MACtC,QAAQ;AAAA,MACR,aAAa,EAAK;AAAA,MAClB,eAAe,EAAe,GAAc,QAAQ;AAAA,MAEpD,UAAA,gBAAA,EAAC,GAAD;AAAA,QACU,QAAA;AAAA,QACR,WAAW;AAAA,QACX,OAAO;AAAA,QACP,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAA,CAAY,MAAU,EAAW,MAAM,OAAO,CAAK,CAAC,IAAoB,IAAhB,OAAO,CAAK,CAAU;AAAA,QAC9E,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,MACxC,CAAA;AAAA,IACa,CAAA;AAAA,EACX,CAAA;AAEX,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useGlobalCopyStore as c, useGoalStore as d } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import "../../../core/constants/Numbers.es.js";
|
|
2
3
|
import { formatCurrency as _ } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
4
|
import h from "../../../common/components/CurrencyInput.es.js";
|
|
4
5
|
import { ListItemAction as f } from "../../../common/components/ListItemAction.es.js";
|
|
5
6
|
import b from "react";
|
|
6
7
|
import { observer as S } from "mobx-react-lite";
|
|
7
8
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
+
var P = S(({ goal: t }) => {
|
|
9
10
|
const { goals: o } = c(), { setAlert: s, setSelectedGoal: y, updateGoal: i } = d(), [e, m] = b.useState(t.monthly_payment ?? 0), p = !t.guid, a = e < 0 || e > 9999999999e-2, l = async () => {
|
|
10
11
|
const n = {
|
|
11
12
|
...t,
|
|
@@ -41,7 +42,7 @@ var I = S(({ goal: t }) => {
|
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
P as MonthlyPaymentAction
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=MonthlyPaymentAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthlyPaymentAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/MonthlyPaymentAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface MonthlyPaymentActionProps {\n goal: Goal\n}\n\nexport const MonthlyPaymentAction = observer(({ goal }: MonthlyPaymentActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [payment, setPayment] = React.useState<number>(goal.monthly_payment ?? 0)\n\n const isNew = !goal.guid\n const isInvalid = payment < 0 || payment >
|
|
1
|
+
{"version":3,"file":"MonthlyPaymentAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/MonthlyPaymentAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface MonthlyPaymentActionProps {\n goal: Goal\n}\n\nexport const MonthlyPaymentAction = observer(({ goal }: MonthlyPaymentActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [payment, setPayment] = React.useState<number>(goal.monthly_payment ?? 0)\n\n const isNew = !goal.guid\n const isInvalid = payment < 0 || payment > MAX_MONEY_INPUT\n\n const handleSave = async () => {\n const updatedGoal = { ...goal, monthly_payment: payment }\n goal.monthly_payment = payment\n if (isNew) {\n setSelectedGoal(updatedGoal)\n } else {\n await updateGoal({ ...goal, monthly_payment: payment })\n setAlert(copy.alert_goal_updated_payment)\n }\n }\n\n const handleCancel = () => {\n setTimeout(() => {\n setPayment(goal.monthly_payment || 0)\n }, 250)\n }\n\n return (\n <ListItemAction\n isDisabled={goal.is_complete}\n isSaveDisabled={isInvalid}\n label={copy.details_monthly_payment}\n onCancel={handleCancel}\n onSave={handleSave}\n primaryText={copy.details_monthly_payment}\n secondaryText={formatCurrency(goal.monthly_payment, '0,0')}\n zeroStateText={!goal.monthly_payment ? copy.add_monthly_payment : undefined}\n >\n <CurrencyInput\n amount={payment}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(v) => setPayment(!isNaN(Number(v)) ? Number(v) : payment)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n )\n})\n"],"mappings":";;;;;;;;AAYA,IAAa,IAAuB,EAAA,CAAU,EAAE,MAAA,EAAA,MAAsC;AACpF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,iBAAA,GAAiB,YAAA,EAAA,IAAe,EAAa,GAEzD,CAAC,GAAS,CAAA,IAAc,EAAM,SAAiB,EAAK,mBAAmB,CAAC,GAExE,IAAQ,CAAC,EAAK,MACd,IAAY,IAAU,KAAK,IAAA,eAE3B,IAAa,YAAY;AAC7B,UAAM,IAAc;AAAA,MAAE,GAAG;AAAA,MAAM,iBAAiB;AAAA,IAAQ;AACxD,IAAA,EAAK,kBAAkB,GACnB,IACF,EAAgB,CAAW,KAE3B,MAAM,EAAW;AAAA,MAAE,GAAG;AAAA,MAAM,iBAAiB;AAAA,IAAQ,CAAC,GACtD,EAAS,EAAK,0BAA0B;AAAA,EAE5C,GAEM,IAAA,MAAqB;AACzB,eAAA,MAAiB;AACf,MAAA,EAAW,EAAK,mBAAmB,CAAC;AAAA,IACtC,GAAG,GAAG;AAAA,EACR;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,EAAK;AAAA,IACjB,gBAAgB;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,aAAa,EAAK;AAAA,IAClB,eAAe,EAAe,EAAK,iBAAiB,KAAK;AAAA,IACzD,eAAgB,EAAK,kBAA6C,SAA3B,EAAK;AAAA,IAE5C,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAA,CAAY,MAAM,EAAY,MAAM,OAAO,CAAC,CAAC,IAAgB,IAAZ,OAAO,CAAC,CAAW;AAAA,MACpE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,IACxC,CAAA;AAAA,EACa,CAAA;AAEpB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useGlobalCopyStore as p, useGoalStore as _ } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import "../../../core/constants/Numbers.es.js";
|
|
2
3
|
import { formatCurrency as b } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
4
|
import f from "../../../common/components/CurrencyInput.es.js";
|
|
4
5
|
import { ListItemAction as y } from "../../../common/components/ListItemAction.es.js";
|
|
5
6
|
import S from "react";
|
|
6
|
-
import { observer as
|
|
7
|
+
import { observer as N } from "mobx-react-lite";
|
|
7
8
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
+
var w = N(({ goal: t }) => {
|
|
9
10
|
const { goals: a } = p(), { setAlert: l, setSelectedGoal: s, updateGoal: m } = _(), [e, o] = S.useState(t.initial_amount), c = !t.guid, n = e < 0 || e > 9999999999e-2, u = async () => {
|
|
10
11
|
const i = {
|
|
11
12
|
...t,
|
|
@@ -41,7 +42,7 @@ var I = v(({ goal: t }) => {
|
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
w as OriginalBalanceAction
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=OriginalBalanceAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OriginalBalanceAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/OriginalBalanceAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface OriginalBalanceActionProps {\n goal: Goal\n}\n\nexport const OriginalBalanceAction = observer(({ goal }: OriginalBalanceActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [balance, setBalance] = React.useState<number>(goal.initial_amount)\n\n const isNew = !goal.guid\n const
|
|
1
|
+
{"version":3,"file":"OriginalBalanceAction.es.js","names":[],"sources":["../../../../src/goals/components/actions/OriginalBalanceAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { CurrencyInput, ListItemAction, useGlobalCopyStore, useGoalStore } from '../../../common'\nimport { Goal } from '../../../core'\nimport { MAX_MONEY_INPUT } from '../../../core/constants/Numbers'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\n\ninterface OriginalBalanceActionProps {\n goal: Goal\n}\n\nexport const OriginalBalanceAction = observer(({ goal }: OriginalBalanceActionProps) => {\n const { goals: copy } = useGlobalCopyStore()\n const { setAlert, setSelectedGoal, updateGoal } = useGoalStore()\n\n const [balance, setBalance] = React.useState<number>(goal.initial_amount)\n\n const isNew = !goal.guid\n const isInvalid = balance < 0 || balance > MAX_MONEY_INPUT\n\n const handleSave = async () => {\n const updatedGoal = { ...goal, initial_amount: balance }\n goal.initial_amount = balance\n if (isNew) {\n setSelectedGoal(updatedGoal)\n } else {\n await updateGoal({ ...goal, initial_amount: balance })\n setAlert(copy.alert_goal_updated_balance)\n }\n }\n\n const handleCancel = () => {\n setTimeout(() => {\n setBalance(goal.initial_amount)\n }, 250)\n }\n\n return (\n <ListItemAction\n isDisabled={goal.is_complete}\n isSaveDisabled={isInvalid}\n label={copy.details_original_balance}\n onCancel={handleCancel}\n onSave={handleSave}\n primaryText={copy.details_original_balance}\n secondaryText={formatCurrency(goal.initial_amount, '0,0')}\n zeroStateText={\n !goal.initial_amount && !goal.is_complete ? copy.add_original_balance : undefined\n }\n >\n <CurrencyInput\n amount={balance}\n autoFocus={true}\n error={isInvalid}\n fullWidth={true}\n minAmount={0}\n setAmount={(v) => setBalance(!isNaN(Number(v)) ? Number(v) : balance)}\n sx={{ '.MuiTypography-body1': { p: 0 } }}\n />\n </ListItemAction>\n )\n})\n"],"mappings":";;;;;;;;AAYA,IAAa,IAAwB,EAAA,CAAU,EAAE,MAAA,EAAA,MAAuC;AACtF,QAAM,EAAE,OAAO,EAAA,IAAS,EAAmB,GACrC,EAAE,UAAA,GAAU,iBAAA,GAAiB,YAAA,EAAA,IAAe,EAAa,GAEzD,CAAC,GAAS,CAAA,IAAc,EAAM,SAAiB,EAAK,cAAc,GAElE,IAAQ,CAAC,EAAK,MACd,IAAY,IAAU,KAAK,IAAA,eAE3B,IAAa,YAAY;AAC7B,UAAM,IAAc;AAAA,MAAE,GAAG;AAAA,MAAM,gBAAgB;AAAA,IAAQ;AACvD,IAAA,EAAK,iBAAiB,GAClB,IACF,EAAgB,CAAW,KAE3B,MAAM,EAAW;AAAA,MAAE,GAAG;AAAA,MAAM,gBAAgB;AAAA,IAAQ,CAAC,GACrD,EAAS,EAAK,0BAA0B;AAAA,EAE5C,GAEM,IAAA,MAAqB;AACzB,eAAA,MAAiB;AACf,MAAA,EAAW,EAAK,cAAc;AAAA,IAChC,GAAG,GAAG;AAAA,EACR;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,EAAK;AAAA,IACjB,gBAAgB;AAAA,IAChB,OAAO,EAAK;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,aAAa,EAAK;AAAA,IAClB,eAAe,EAAe,EAAK,gBAAgB,KAAK;AAAA,IACxD,eACE,CAAC,EAAK,kBAAkB,CAAC,EAAK,cAAc,EAAK,uBAAuB;AAAA,IAG1E,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAA,CAAY,MAAM,EAAY,MAAM,OAAO,CAAC,CAAC,IAAgB,IAAZ,OAAO,CAAC,CAAW;AAAA,MACpE,IAAI,EAAE,wBAAwB,EAAE,GAAG,EAAE,EAAE;AAAA,IACxC,CAAA;AAAA,EACa,CAAA;AAEpB,CAAC"}
|