@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1
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 +178 -1
- package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
- package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
- package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
- package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
- package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
- package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
- package/dist/Accounts-Bzy1_REQ.mjs +9 -0
- package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
- package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
- package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-BmZXkL0C.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
- package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
- package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
- package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
- package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
- package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.mjs} +2 -2
- package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
- package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
- package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-Bq-aPy-5.mjs} +1 -1
- package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
- package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
- package/dist/Drawer-By9V-B5L.mjs +178 -0
- package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
- package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
- package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
- package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
- package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-1P19goZ7.mjs} +112 -152
- package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
- package/dist/LineChart-KpPw1phO.mjs +580 -0
- package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
- package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
- package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
- package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
- package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
- package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
- package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
- package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
- package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
- package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
- package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
- package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
- package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
- package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
- package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
- package/dist/SpendingLegend-CDO060GT.mjs +193 -0
- package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
- package/dist/TransactionApi-CjBoLleL.mjs +86 -0
- package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
- package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
- package/dist/TrendsStore-yO7qYv97.mjs +186 -0
- package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
- package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.mjs} +4 -4
- package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
- package/dist/accounts/index.es.js +245 -235
- package/dist/accounts/stores/AccountStore.d.ts +24 -25
- package/dist/accounts/utils/Accounts.d.ts +1 -2
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +611 -580
- package/dist/budgets/store/BudgetsStore.d.ts +0 -1
- package/dist/cashflow/index.es.js +187 -180
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +2 -5
- package/dist/categories/util/CategoryUtil.d.ts +2 -3
- package/dist/common/components/Select.d.ts +4 -2
- package/dist/common/components/charts/LineChart.d.ts +12 -2
- package/dist/common/components/charts/index.d.ts +0 -3
- package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
- package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
- package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
- package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Footer.d.ts +17 -0
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +397 -387
- package/dist/common/stores/AppDataStore.d.ts +1 -3
- package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
- package/dist/common/stores/GlobalStore.d.ts +10 -4
- package/dist/common/stores/GlobalUiStore.d.ts +2 -3
- package/dist/common/stores/UserStore.d.ts +2 -3
- package/dist/common/types/Account.d.ts +6 -9
- package/dist/common/types/Finstrong.d.ts +54 -0
- package/dist/common/types/Global.d.ts +1 -0
- package/dist/common/types/Widgets.d.ts +1 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
- package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
- package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
- package/dist/dashboard/index.es.js +90 -88
- package/dist/debts/index.es.js +458 -448
- package/dist/exportTransactionsToCSV-DuAaI5XA.mjs +48 -0
- package/dist/finstrong/FinstrongWidget.d.ts +1 -1
- package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
- package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
- package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
- package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
- package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
- package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
- package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
- package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
- package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
- package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
- package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
- package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
- package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
- package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
- package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
- package/dist/finstrong/components/ProgressBar.d.ts +15 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
- package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
- package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
- package/dist/finstrong/components/StatusChip.d.ts +5 -0
- package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
- package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
- package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
- package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
- package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
- package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +24 -0
- package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
- package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
- package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
- package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
- package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
- package/dist/finstrong/constants/index.d.ts +9 -0
- package/dist/finstrong/index.es.js +3190 -1073
- package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
- package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
- package/dist/goals/index.es.js +302 -291
- package/dist/goals/stores/GoalStore.d.ts +4 -17
- package/dist/help/index.es.js +13 -9
- package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
- package/dist/insights/index.es.js +1 -1
- package/dist/investments/index.es.js +108 -104
- package/dist/investments/stores/HoldingStore.d.ts +0 -1
- package/dist/merchants/index.es.js +2 -2
- package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
- package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
- package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
- package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
- package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
- package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
- package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
- package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
- package/dist/microinsights/carousel/BeatList.d.ts +10 -0
- package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
- package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
- package/dist/microinsights/constants/App.d.ts +0 -1
- package/dist/microinsights/index.d.ts +4 -3
- package/dist/microinsights/index.es.js +101 -14
- package/dist/microinsights/interfaces.d.ts +0 -6
- package/dist/networth/index.es.js +197 -190
- package/dist/notifications/index.es.js +25 -25
- package/dist/notifications/stores/NotificationStore.d.ts +1 -3
- package/dist/recurringtransactions/index.es.js +395 -351
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
- package/dist/settings/index.es.js +307 -298
- package/dist/spending/index.es.js +299 -438
- package/dist/spending/utils/SpendingData.d.ts +2 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
- package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
- package/dist/transactions/index.es.js +115 -112
- package/dist/transactions/stores/TransactionStore.d.ts +77 -21
- package/dist/trends/components/TrendsTable.d.ts +0 -2
- package/dist/trends/index.es.js +1025 -604
- package/dist/trends/utils/TrendsData.d.ts +1 -0
- package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
- package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
- package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
- package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
- package/package.json +4 -4
- package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
- package/dist/Accounts-BRf_YeTf.mjs +0 -27
- package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
- package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
- package/dist/Drawer-kEE73B87.mjs +0 -113
- package/dist/FinstrongStore-F2c607dj.mjs +0 -101
- package/dist/LineChart-D4GI7nVh.mjs +0 -541
- package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
- package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
- package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
- package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
- package/dist/TransactionStore-ai3uII_r.mjs +0 -690
- package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
- package/dist/common/components/SkeletonLoader.d.ts +0 -7
- package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
- package/dist/finstrong/utils/Finstrong.d.ts +0 -6
- package/dist/useAriaLive-B3_pRUio.mjs +0 -35
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeAutoObservable as c, observable as f, runInAction as h } from "mobx";
|
|
2
2
|
import { fromUnixTime as o, isSameDay as d } from "date-fns";
|
|
3
|
-
import { F as l, A as a } from "./Fetch-
|
|
3
|
+
import { F as l, A as a } from "./Fetch-DecPFeGU.mjs";
|
|
4
4
|
class s {
|
|
5
5
|
fetchInstance;
|
|
6
6
|
constructor(t, i, n) {
|
|
@@ -33,7 +33,7 @@ class A {
|
|
|
33
33
|
api = new s("/", "");
|
|
34
34
|
isLoading = !0;
|
|
35
35
|
notifications = [];
|
|
36
|
-
|
|
36
|
+
recentNotifications = [];
|
|
37
37
|
constructor(t) {
|
|
38
38
|
this.globalStore = t, this.api = new s(
|
|
39
39
|
t.endpoint,
|
|
@@ -45,27 +45,19 @@ class A {
|
|
|
45
45
|
get newNotifications() {
|
|
46
46
|
return this.recentNotifications.filter((t) => !t.has_been_viewed);
|
|
47
47
|
}
|
|
48
|
-
get recentNotifications() {
|
|
49
|
-
return u(this.notifications);
|
|
50
|
-
}
|
|
51
|
-
setNotifications = (t) => {
|
|
52
|
-
this.notifications = t, this.notificationsLoaded = !0;
|
|
53
|
-
};
|
|
54
48
|
loadNotifications = async () => {
|
|
55
|
-
this.isLoading = !0;
|
|
56
49
|
try {
|
|
50
|
+
this.isLoading = !0;
|
|
57
51
|
const t = await this.api.getNotifications();
|
|
58
|
-
this.setNotifications(t);
|
|
59
|
-
} catch (t) {
|
|
60
|
-
console.error(`Error occurred while loading notifications: ${t}`);
|
|
61
|
-
} finally {
|
|
62
52
|
h(() => {
|
|
63
|
-
this.isLoading = !1;
|
|
53
|
+
this.notifications = t, this.recentNotifications = u(t), this.isLoading = !1;
|
|
64
54
|
});
|
|
55
|
+
} catch (t) {
|
|
56
|
+
console.error(`Error occurred while loading notifications: ${t}`);
|
|
65
57
|
}
|
|
66
58
|
};
|
|
67
59
|
markAllAsViewed = async () => {
|
|
68
|
-
this.notifications.forEach((t) => t.has_been_viewed = !0), await this.api.markAllAsViewed()
|
|
60
|
+
this.notifications.forEach((t) => t.has_been_viewed = !0), await this.api.markAllAsViewed();
|
|
69
61
|
};
|
|
70
62
|
updateNotification = async (t) => {
|
|
71
63
|
t.has_been_viewed = !0, await this.api.updateNotification(t);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import o from "numeral";
|
|
2
2
|
import { g as a } from "./Localization-2MODESHW.mjs";
|
|
3
|
-
const
|
|
3
|
+
const D = 9999999999e-2;
|
|
4
4
|
var c = /* @__PURE__ */ ((t) => (t.CAD = "CAD", t.USD = "USD", t))(c || {});
|
|
5
|
-
const
|
|
5
|
+
const h = (t, r, e) => {
|
|
6
6
|
const s = [], l = (r - t) / (e - 1);
|
|
7
7
|
for (let n = 0; n < e; n++) {
|
|
8
8
|
const i = t + n * l;
|
|
9
9
|
s.push(i);
|
|
10
10
|
}
|
|
11
|
-
return s[e - 1] = r, s;
|
|
12
|
-
},
|
|
11
|
+
return s[e - 1] = r, s.map(Math.round);
|
|
12
|
+
}, w = (t, r, e) => {
|
|
13
13
|
switch (a()) {
|
|
14
14
|
case "fr-ca":
|
|
15
15
|
return o(t).format(`${r} $`, e);
|
|
16
16
|
default:
|
|
17
17
|
return o(t).format(`$${r}`, e);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, $ = () => {
|
|
20
20
|
switch (a()) {
|
|
21
21
|
case "fr-ca":
|
|
22
22
|
return c.CAD;
|
|
@@ -38,11 +38,11 @@ const w = (t, r, e) => {
|
|
|
38
38
|
};
|
|
39
39
|
export {
|
|
40
40
|
c as C,
|
|
41
|
-
|
|
41
|
+
D as M,
|
|
42
42
|
N as a,
|
|
43
43
|
P as b,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
h as c,
|
|
45
|
+
w as f,
|
|
46
|
+
$ as g,
|
|
47
47
|
f as i
|
|
48
48
|
};
|
|
@@ -2,10 +2,10 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import _ from "react";
|
|
3
3
|
import { observer as p } from "mobx-react-lite";
|
|
4
4
|
import v from "@mui/material/TextField";
|
|
5
|
-
import { L as y } from "./ListItemAction-
|
|
6
|
-
import { u as h, l as b } from "./hooks-
|
|
7
|
-
import { a as T, f as S } from "./NumberFormatting-
|
|
8
|
-
import { C as f } from "./CurrencyInput-
|
|
5
|
+
import { L as y } from "./ListItemAction-BxTkF6Tz.mjs";
|
|
6
|
+
import { u as h, l as b } from "./hooks-ZMp65DFz.mjs";
|
|
7
|
+
import { a as T, f as S } from "./NumberFormatting-DjTD0t3W.mjs";
|
|
8
|
+
import { C as f } from "./CurrencyInput-itK0R3wV.mjs";
|
|
9
9
|
const F = p(({ goal: e }) => {
|
|
10
10
|
const { goals: a } = h(), { setAlert: r, setSelectedGoal: l, updateGoal: m } = b(), [t, s] = _.useState(e.interest_rate ?? 0), c = !e.guid, i = t < 0, d = async () => {
|
|
11
11
|
const n = { ...e, interest_rate: t };
|
|
@@ -7,10 +7,10 @@ import b from "@mui/material/Tabs";
|
|
|
7
7
|
import d from "@mui/material/Divider";
|
|
8
8
|
import R from "@mui/material/List";
|
|
9
9
|
import T from "@mui/material/Stack";
|
|
10
|
-
import { R as C, A as S, a as E, M as v } from "./ManageIncome-
|
|
11
|
-
import { u as _, j as A, g as f } from "./hooks-
|
|
12
|
-
import { R as y, F as N } from "./RecurringTransactions-
|
|
13
|
-
import { A as m } from "./WidgetContainer-
|
|
10
|
+
import { R as C, A as S, a as E, M as v } from "./ManageIncome-CaoQl609.mjs";
|
|
11
|
+
import { u as _, j as A, g as f } from "./hooks-ZMp65DFz.mjs";
|
|
12
|
+
import { R as y, F as N } from "./RecurringTransactions-BqijW_8S.mjs";
|
|
13
|
+
import { A as m } from "./WidgetContainer-CoFDmQRE.mjs";
|
|
14
14
|
const I = h(() => {
|
|
15
15
|
const { recurring: g } = _(), { repeatingTransactions: n } = A(), { onEvent: o } = f(), l = (r) => {
|
|
16
16
|
o(m.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
|
|
@@ -17,7 +17,7 @@ import { formatISO as H } from "date-fns/formatISO";
|
|
|
17
17
|
import { fromUnixTime as V } from "date-fns/fromUnixTime";
|
|
18
18
|
import { getUnixTime as y } from "date-fns/getUnixTime";
|
|
19
19
|
import { isAfter as h } from "date-fns/isAfter";
|
|
20
|
-
import { isBefore as
|
|
20
|
+
import { isBefore as u } from "date-fns/isBefore";
|
|
21
21
|
import { isSameDay as X } from "date-fns/isSameDay";
|
|
22
22
|
import { nextDay as E } from "date-fns/nextDay";
|
|
23
23
|
import { parseISO as J } from "date-fns/parseISO";
|
|
@@ -29,9 +29,9 @@ import { subQuarters as N } from "date-fns/subQuarters";
|
|
|
29
29
|
import { subYears as T } from "date-fns/subYears";
|
|
30
30
|
import { lastDayOfMonth as q } from "date-fns/lastDayOfMonth";
|
|
31
31
|
import { setDayOfYear as F } from "date-fns/setDayOfYear";
|
|
32
|
-
import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-
|
|
33
|
-
import { b as W } from "./NumberFormatting-
|
|
34
|
-
import { f as v,
|
|
32
|
+
import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-CBdcsyuk.mjs";
|
|
33
|
+
import { b as W } from "./NumberFormatting-DjTD0t3W.mjs";
|
|
34
|
+
import { f as v, a as k } from "./Dialog-BPTr3qHE.mjs";
|
|
35
35
|
import { b as l } from "./Localization-2MODESHW.mjs";
|
|
36
36
|
var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), p = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(p || {}), O = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(O || {}), Y = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(Y || {});
|
|
37
37
|
const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
@@ -51,22 +51,23 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
|
51
51
|
o,
|
|
52
52
|
/* @__PURE__ */ d(C, { children: /* @__PURE__ */ d(I, { name: "chevron_right", size: 24 }) })
|
|
53
53
|
] }) }) : /* @__PURE__ */ d(w, { disableGutters: !1, disablePadding: !1, children: o });
|
|
54
|
-
}, Fe = se, Re = ({ label: e, onChange: a, options: t, value: n }) => /* @__PURE__ */ d(
|
|
54
|
+
}, Fe = se, Re = ({ label: e, onChange: a, options: t, value: n, ...o }) => /* @__PURE__ */ d(
|
|
55
55
|
j,
|
|
56
56
|
{
|
|
57
57
|
InputLabelProps: { shrink: !0 },
|
|
58
58
|
SelectProps: {
|
|
59
|
-
IconComponent: (
|
|
59
|
+
IconComponent: (c) => /* @__PURE__ */ d(z, { size: 20, sx: { mr: 4 }, ...c })
|
|
60
60
|
},
|
|
61
61
|
defaultValue: 0,
|
|
62
62
|
label: e,
|
|
63
|
-
onChange: (
|
|
64
|
-
a(Number(
|
|
63
|
+
onChange: (c) => {
|
|
64
|
+
a(Number(c.target.value));
|
|
65
65
|
},
|
|
66
66
|
select: !0,
|
|
67
67
|
value: n,
|
|
68
68
|
variant: "outlined",
|
|
69
|
-
|
|
69
|
+
...o,
|
|
70
|
+
children: t.map((c) => /* @__PURE__ */ d($, { value: c.id, children: c.label }, c.id))
|
|
70
71
|
}
|
|
71
72
|
), ce = (e) => {
|
|
72
73
|
if (!e) return "";
|
|
@@ -93,93 +94,93 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
|
93
94
|
status: p.Upcoming,
|
|
94
95
|
type: e.repeating_transaction_type === Y.Income ? O.Income : O.Expense,
|
|
95
96
|
transaction: void 0
|
|
96
|
-
},
|
|
97
|
+
}, c = a.start, i = a.end;
|
|
97
98
|
switch (e.recurrence_type) {
|
|
98
99
|
case s.EveryWeek:
|
|
99
|
-
t.push(...ue(r,
|
|
100
|
+
t.push(...ue(r, c, i));
|
|
100
101
|
break;
|
|
101
102
|
case s.EveryOtherWeek:
|
|
102
|
-
t.push(...de(r,
|
|
103
|
+
t.push(...de(r, c, i));
|
|
103
104
|
break;
|
|
104
105
|
case s.TwiceAMonth:
|
|
105
|
-
t.push(...me(r,
|
|
106
|
+
t.push(...me(r, c, i));
|
|
106
107
|
break;
|
|
107
108
|
case s.EveryMonth:
|
|
108
|
-
t.push(...le(r,
|
|
109
|
+
t.push(...le(r, c, i));
|
|
109
110
|
break;
|
|
110
111
|
case s.EveryOtherMonth:
|
|
111
|
-
t.push(...he(r,
|
|
112
|
+
t.push(...he(r, c, i));
|
|
112
113
|
break;
|
|
113
114
|
case s.EveryQuarter:
|
|
114
|
-
t.push(...fe(r,
|
|
115
|
+
t.push(...fe(r, c, i));
|
|
115
116
|
break;
|
|
116
117
|
case s.EveryOtherQuarter:
|
|
117
|
-
t.push(...pe(r,
|
|
118
|
+
t.push(...pe(r, c, i));
|
|
118
119
|
break;
|
|
119
120
|
case s.EveryYear:
|
|
120
|
-
t.push(...ye(r,
|
|
121
|
+
t.push(...ye(r, c, i));
|
|
121
122
|
break;
|
|
122
123
|
}
|
|
123
124
|
for (const m of t) {
|
|
124
125
|
const _ = e.transactions.find(
|
|
125
126
|
(x) => x.repeating_transaction_guid === e.guid && x.date > y(D(m.expectedDate, 5)) && x.date < y(Q(m.expectedDate, 5))
|
|
126
127
|
);
|
|
127
|
-
_ ? (m.transaction = _, m.status = p.Paid, m.occurredOnDate = V(_.date)) :
|
|
128
|
+
_ ? (m.transaction = _, m.status = p.Paid, m.occurredOnDate = V(_.date)) : u(m.expectedDate, D(b(), 3)) && (m.status = p.Missed);
|
|
128
129
|
}
|
|
129
130
|
return t;
|
|
130
131
|
}, ue = (e, a, t) => {
|
|
131
132
|
const n = [];
|
|
132
133
|
let o = E(a, e.recurrenceDay);
|
|
133
|
-
for (;
|
|
134
|
+
for (; u(o, t); )
|
|
134
135
|
n.push({ ...e, expectedDate: o }), o = E(o, e.recurrenceDay);
|
|
135
136
|
return n;
|
|
136
137
|
}, de = (e, a, t) => {
|
|
137
138
|
const n = [], o = e.expectedDate;
|
|
138
|
-
if (
|
|
139
|
+
if (u(o, t)) {
|
|
139
140
|
let r = D(o, 14);
|
|
140
141
|
for (; h(r, a) || X(r, a); )
|
|
141
142
|
n.push({ ...e, expectedDate: r }), r = D(r, 14);
|
|
142
|
-
for (r = o; h(r, a) &&
|
|
143
|
+
for (r = o; h(r, a) && u(r, t); )
|
|
143
144
|
n.push({ ...e, expectedDate: r }), r = Q(r, 14);
|
|
144
145
|
}
|
|
145
146
|
return n;
|
|
146
147
|
}, me = (e, a, t) => {
|
|
147
148
|
const n = [];
|
|
148
149
|
let o = g(a, e.recurrenceDay);
|
|
149
|
-
for (;
|
|
150
|
+
for (; u(o, t); )
|
|
150
151
|
n.push({ ...e, expectedDate: o }), o = f(o, 1);
|
|
151
152
|
let r = e.secondRecurrenceDay && e.secondRecurrenceDay < 28 ? g(a, e.secondRecurrenceDay) : q(a);
|
|
152
|
-
for (;
|
|
153
|
+
for (; u(r, t); )
|
|
153
154
|
n.push({ ...e, expectedDate: r }), r = f(r, 1);
|
|
154
155
|
return n;
|
|
155
156
|
}, le = (e, a, t) => {
|
|
156
157
|
const n = [];
|
|
157
158
|
let o = g(a, e.recurrenceDay);
|
|
158
|
-
for (n.push({ ...e, expectedDate: o }), o = f(o, 1);
|
|
159
|
+
for (n.push({ ...e, expectedDate: o }), o = f(o, 1); u(o, t); )
|
|
159
160
|
n.push({ ...e, expectedDate: o }), o = f(o, 1);
|
|
160
161
|
return n;
|
|
161
162
|
}, he = (e, a, t) => {
|
|
162
163
|
const n = [], o = e.expectedDate;
|
|
163
|
-
let r =
|
|
164
|
-
for (;
|
|
164
|
+
let r = u(o, t) ? o : Z(o, 2);
|
|
165
|
+
for (; u(r, t); )
|
|
165
166
|
h(r, a) && n.push({ ...e, expectedDate: r }), r = f(r, 2);
|
|
166
167
|
return n;
|
|
167
168
|
}, fe = (e, a, t) => {
|
|
168
169
|
const n = [], o = e.expectedDate;
|
|
169
|
-
let r =
|
|
170
|
-
for (;
|
|
170
|
+
let r = u(o, t) ? o : N(o, 1);
|
|
171
|
+
for (; u(r, t); )
|
|
171
172
|
h(r, a) && n.push({ ...e, expectedDate: r }), r = A(r, 1);
|
|
172
173
|
return n;
|
|
173
174
|
}, pe = (e, a, t) => {
|
|
174
175
|
const n = [], o = e.expectedDate;
|
|
175
|
-
let r =
|
|
176
|
-
for (;
|
|
176
|
+
let r = u(o, t) ? o : N(o, 2);
|
|
177
|
+
for (; u(r, t); )
|
|
177
178
|
h(r, a) && n.push({ ...e, expectedDate: r }), r = A(r, 2);
|
|
178
179
|
return n;
|
|
179
180
|
}, ye = (e, a, t) => {
|
|
180
181
|
const n = [], o = e.expectedDate;
|
|
181
|
-
let r =
|
|
182
|
-
for (;
|
|
182
|
+
let r = u(o, t) ? o : T(o, 1);
|
|
183
|
+
for (; u(r, t); )
|
|
183
184
|
h(r, a) && n.push({ ...e, expectedDate: r }), r = K(r, 1);
|
|
184
185
|
return n;
|
|
185
186
|
}, et = (e, a) => {
|
|
@@ -195,11 +196,11 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
|
195
196
|
const n = [];
|
|
196
197
|
for (const o of a) {
|
|
197
198
|
const r = t.filter(
|
|
198
|
-
(
|
|
199
|
+
(c) => c.repeating_transaction_guid === o.guid
|
|
199
200
|
);
|
|
200
201
|
t.length > 0 && n.push({
|
|
201
202
|
...o,
|
|
202
|
-
account: e.find((
|
|
203
|
+
account: e.find((c) => c.guid === o.account_guid),
|
|
203
204
|
transactions: r
|
|
204
205
|
});
|
|
205
206
|
}
|
|
@@ -214,41 +215,41 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
|
214
215
|
recurrences: [t]
|
|
215
216
|
}), a;
|
|
216
217
|
}, []), ot = (e, a, t) => {
|
|
217
|
-
const n = E(b(), a.recurrence_day), o = F(b(), a.recurrence_day), r = W(a.recurrence_day),
|
|
218
|
-
let
|
|
218
|
+
const n = E(b(), a.recurrence_day), o = F(b(), a.recurrence_day), r = W(a.recurrence_day), c = a.second_recurrence_day ? W(a.second_recurrence_day) : "";
|
|
219
|
+
let i = t ? l(e.monthly_ordinal, r) : e.monthly;
|
|
219
220
|
switch (a.recurrence_type) {
|
|
220
221
|
case s.EveryQuarter:
|
|
221
|
-
|
|
222
|
+
i = t ? l(e.quarterly_ordinal, r) : e.quarterly;
|
|
222
223
|
break;
|
|
223
224
|
case s.EveryWeek:
|
|
224
|
-
|
|
225
|
+
i = t ? l(
|
|
225
226
|
e.weekly_ordinal,
|
|
226
227
|
v(n, k.DAY_OF_WEEK)
|
|
227
228
|
) : e.weekly;
|
|
228
229
|
break;
|
|
229
230
|
case s.EveryYear:
|
|
230
|
-
|
|
231
|
+
i = t ? l(
|
|
231
232
|
e.anually_ordinal,
|
|
232
233
|
v(o, k.MONTH_DAY)
|
|
233
234
|
) : e.anually;
|
|
234
235
|
break;
|
|
235
236
|
case s.EveryOtherWeek:
|
|
236
|
-
|
|
237
|
+
i = t ? l(
|
|
237
238
|
e.every_other_week_ordinal,
|
|
238
239
|
v(n, k.DAY_OF_WEEK)
|
|
239
240
|
) : e.every_other_week;
|
|
240
241
|
break;
|
|
241
242
|
case s.EveryOtherMonth:
|
|
242
|
-
|
|
243
|
+
i = t ? l(e.every_other_month_ordinal, r) : e.every_other_month;
|
|
243
244
|
break;
|
|
244
245
|
case s.EveryOtherQuarter:
|
|
245
|
-
|
|
246
|
+
i = t ? l(e.every_other_quarter_ordinal, r) : e.every_other_quarter;
|
|
246
247
|
break;
|
|
247
248
|
case s.TwiceAMonth:
|
|
248
|
-
|
|
249
|
+
i = t ? l(e.twice_a_month_ordinal, r, c) : e.twice_a_month;
|
|
249
250
|
break;
|
|
250
251
|
}
|
|
251
|
-
return
|
|
252
|
+
return i;
|
|
252
253
|
}, at = (e, a) => {
|
|
253
254
|
let t = a;
|
|
254
255
|
switch (e) {
|
|
@@ -281,10 +282,10 @@ export {
|
|
|
281
282
|
s as F,
|
|
282
283
|
Y as R,
|
|
283
284
|
Re as S,
|
|
284
|
-
|
|
285
|
+
p as a,
|
|
285
286
|
et as b,
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
O as c,
|
|
288
|
+
tt as d,
|
|
288
289
|
at as e,
|
|
289
290
|
rt as f,
|
|
290
291
|
ot as g
|
package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { makeAutoObservable as
|
|
2
|
-
import { endOfMonth as
|
|
1
|
+
import { makeAutoObservable as f, runInAction as i } from "mobx";
|
|
2
|
+
import { endOfMonth as R } from "date-fns/endOfMonth";
|
|
3
3
|
import { isAfter as p } from "date-fns/isAfter";
|
|
4
4
|
import { isBefore as I } from "date-fns/isBefore";
|
|
5
5
|
import { isSameDay as g } from "date-fns/isSameDay";
|
|
6
6
|
import { isWithinInterval as m } from "date-fns/isWithinInterval";
|
|
7
7
|
import { startOfMonth as S } from "date-fns/startOfMonth";
|
|
8
|
-
import { startOfToday as
|
|
8
|
+
import { startOfToday as c } from "date-fns/startOfToday";
|
|
9
9
|
import { subDays as y } from "date-fns/subDays";
|
|
10
|
-
import { F as x, A as
|
|
11
|
-
import {
|
|
10
|
+
import { F as x, A as o } from "./Fetch-DecPFeGU.mjs";
|
|
11
|
+
import { b as E, a, c as d, d as u } from "./RecurringTransactions-BqijW_8S.mjs";
|
|
12
12
|
var A = /* @__PURE__ */ ((r) => (r.Small = "small", r.Medium = "medium", r.Large = "large", r))(A || {});
|
|
13
13
|
const U = 44;
|
|
14
14
|
class h {
|
|
@@ -16,42 +16,36 @@ class h {
|
|
|
16
16
|
constructor(e, t, n) {
|
|
17
17
|
this.fetchInstance = new x(e, t, void 0, n);
|
|
18
18
|
}
|
|
19
|
-
addRepeatingTransaction = async (e) => this.fetchInstance.post(
|
|
20
|
-
getRepeatingTransactions = async () => this.fetchInstance.get(
|
|
19
|
+
addRepeatingTransaction = async (e) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, e).then((t) => t.repeating_transaction);
|
|
20
|
+
getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((e) => e.repeating_transactions);
|
|
21
21
|
updateRepeatingTransaction = async (e) => this.fetchInstance.put(
|
|
22
|
-
`${
|
|
22
|
+
`${o.REPEATING_TRANSACTIONS}/${e.guid}`,
|
|
23
23
|
e
|
|
24
24
|
).then((t) => t.repeating_transaction);
|
|
25
|
-
deleteRepeatingTransaction = async (e) => this.fetchInstance.delete(`${
|
|
25
|
+
deleteRepeatingTransaction = async (e) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${e}`).then((t) => t);
|
|
26
26
|
}
|
|
27
27
|
const l = (r, e) => m(e.expectedDate, r), s = (r, e) => r + e.amount;
|
|
28
28
|
class C {
|
|
29
29
|
globalStore;
|
|
30
30
|
api = new h("/", "");
|
|
31
|
+
transactions = [];
|
|
31
32
|
repeatingTransactions = [];
|
|
32
|
-
isDataLoaded = !1;
|
|
33
33
|
selectedDay;
|
|
34
|
-
dateRange = { start: S(
|
|
34
|
+
dateRange = { start: S(c()), end: R(c()) };
|
|
35
|
+
isDataLoaded = !1;
|
|
35
36
|
constructor(e) {
|
|
36
37
|
this.globalStore = e, this.api = new h(
|
|
37
38
|
e.endpoint,
|
|
38
39
|
e.sessionToken,
|
|
39
40
|
e.onError
|
|
40
|
-
),
|
|
41
|
-
}
|
|
42
|
-
get detailedRepeatingTransactions() {
|
|
43
|
-
return u(
|
|
44
|
-
this.globalStore.accountStore.visibleAccounts,
|
|
45
|
-
this.repeatingTransactions,
|
|
46
|
-
this.globalStore.transactionStore.transactions
|
|
47
|
-
);
|
|
41
|
+
), f(this);
|
|
48
42
|
}
|
|
49
43
|
/**
|
|
50
44
|
* Returns all recurrences built from repeating transactions and filtered by accounts.
|
|
51
45
|
*/
|
|
52
46
|
get recurrences() {
|
|
53
47
|
const e = this.globalStore.accountStore.visibleAccounts;
|
|
54
|
-
return E(this.
|
|
48
|
+
return E(this.repeatingTransactions, this.dateRange).filter((t) => e.some((n) => n.guid === t.accountGuid && !n.is_excluded_from_accounts)).filter((t) => m(t.expectedDate, this.dateRange));
|
|
55
49
|
}
|
|
56
50
|
/**
|
|
57
51
|
* Returns all recurrences that have occurred in the past, including those that are paid or missed
|
|
@@ -67,7 +61,7 @@ class C {
|
|
|
67
61
|
*/
|
|
68
62
|
get upcomingRecurrences() {
|
|
69
63
|
return this.recurrences.filter(
|
|
70
|
-
(e) => p(e.expectedDate, y(
|
|
64
|
+
(e) => p(e.expectedDate, y(c(), 3)) && I(e.expectedDate, this.dateRange.end) && e.status === a.Upcoming
|
|
71
65
|
);
|
|
72
66
|
}
|
|
73
67
|
/**
|
|
@@ -103,7 +97,7 @@ class C {
|
|
|
103
97
|
);
|
|
104
98
|
}
|
|
105
99
|
get nextIncomeRecurrence() {
|
|
106
|
-
return this.upcomingIncome.find((e) => p(e.expectedDate,
|
|
100
|
+
return this.upcomingIncome.find((e) => p(e.expectedDate, c()));
|
|
107
101
|
}
|
|
108
102
|
/**
|
|
109
103
|
* Returns the expense recurrences for the current month.
|
|
@@ -171,9 +165,6 @@ class C {
|
|
|
171
165
|
(e) => this.selectedDay && g(e.occurredOnDate || e.expectedDate, this.selectedDay)
|
|
172
166
|
);
|
|
173
167
|
}
|
|
174
|
-
setRepeatingTransactions = (e) => {
|
|
175
|
-
this.repeatingTransactions = e, this.isDataLoaded = !0;
|
|
176
|
-
};
|
|
177
168
|
/**
|
|
178
169
|
* Set the date range for filtering recurrences.
|
|
179
170
|
* @param dateRange - The date range to set.
|
|
@@ -192,7 +183,13 @@ class C {
|
|
|
192
183
|
loadRepeatingTransactions = async () => {
|
|
193
184
|
try {
|
|
194
185
|
const e = await this.api.getRepeatingTransactions();
|
|
195
|
-
|
|
186
|
+
i(() => {
|
|
187
|
+
this.repeatingTransactions = u(
|
|
188
|
+
this.globalStore.accountStore.visibleAccounts,
|
|
189
|
+
e,
|
|
190
|
+
this.globalStore.transactionStore.transactions
|
|
191
|
+
), this.isDataLoaded = !0;
|
|
192
|
+
});
|
|
196
193
|
} catch (e) {
|
|
197
194
|
console.error(`Error occurred while getting repeating transactions: ${e}`);
|
|
198
195
|
}
|
|
@@ -208,7 +205,7 @@ class C {
|
|
|
208
205
|
await this.globalStore.transactionStore.updateTransaction({
|
|
209
206
|
...t,
|
|
210
207
|
repeating_transaction_guid: n.guid
|
|
211
|
-
}),
|
|
208
|
+
}), i(() => {
|
|
212
209
|
this.repeatingTransactions = [
|
|
213
210
|
...this.repeatingTransactions,
|
|
214
211
|
...u(
|
|
@@ -228,7 +225,7 @@ class C {
|
|
|
228
225
|
*/
|
|
229
226
|
deleteRepeatingTransaction = async (e) => {
|
|
230
227
|
try {
|
|
231
|
-
await this.api.deleteRepeatingTransaction(e),
|
|
228
|
+
await this.api.deleteRepeatingTransaction(e), i(() => {
|
|
232
229
|
this.repeatingTransactions = [
|
|
233
230
|
...this.repeatingTransactions.filter((t) => t.guid !== e)
|
|
234
231
|
];
|
|
@@ -247,7 +244,7 @@ class C {
|
|
|
247
244
|
(T) => T.guid === t.guid
|
|
248
245
|
);
|
|
249
246
|
if (n < 0) return;
|
|
250
|
-
|
|
247
|
+
i(() => {
|
|
251
248
|
this.repeatingTransactions = [
|
|
252
249
|
...this.repeatingTransactions.slice(0, n),
|
|
253
250
|
...u(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeAutoObservable as N, runInAction as l } from "mobx";
|
|
2
|
-
import { F as D, A as r } from "./Fetch-
|
|
3
|
-
import { B as f, A as n, I as i } from "./ToggleListItem-
|
|
4
|
-
import { T as m } from "./TransactionApi-
|
|
2
|
+
import { F as D, A as r } from "./Fetch-DecPFeGU.mjs";
|
|
3
|
+
import { B as f, A as n, I as i } from "./ToggleListItem-ciFTiqRS.mjs";
|
|
4
|
+
import { T as m } from "./TransactionApi-CjBoLleL.mjs";
|
|
5
5
|
class y {
|
|
6
6
|
fetchInstance;
|
|
7
7
|
constructor(e, t, o) {
|
|
@@ -3,9 +3,9 @@ import { isBefore as d } from "date-fns/isBefore";
|
|
|
3
3
|
import { startOfMonth as _ } from "date-fns/startOfMonth";
|
|
4
4
|
import { subMonths as y } from "date-fns/subMonths";
|
|
5
5
|
import { endOfMonth as M } from "date-fns/endOfMonth";
|
|
6
|
-
import { b as
|
|
7
|
-
import { f as m,
|
|
8
|
-
const i = (e) => (e.top_level_category_guid ===
|
|
6
|
+
import { b as a, P as l } from "./Category-CevNQ03n.mjs";
|
|
7
|
+
import { f as m, a as T } from "./Dialog-BPTr3qHE.mjs";
|
|
8
|
+
const i = (e) => (e.top_level_category_guid === a.INCOME || e.category_guid === a.INCOME) && !h(e), C = (e) => !i(e) && !f(e), p = (e) => l.includes(e.top_level_category_guid) || l.includes(e.category_guid), f = (e) => e.top_level_category_guid === a.TRANSFER || e.category_guid === a.TRANSFER, h = (e) => e.top_level_category_guid === a.INVESTMENTS || e.category_guid === a.INVESTMENTS, N = (e) => !i(e) && !p(e) && !f(e) && !h(e), w = (e) => e.filter((r) => r.category_guid === r.top_level_category_guid), F = (e, r) => {
|
|
9
9
|
if (r === 0) return 0;
|
|
10
10
|
const o = (e - r) / r;
|
|
11
11
|
return isNaN(o) ? 0 : o;
|
|
@@ -16,7 +16,7 @@ const i = (e) => (e.top_level_category_guid === n.INCOME || e.category_guid ===
|
|
|
16
16
|
for (; d(t, s); )
|
|
17
17
|
o.push({
|
|
18
18
|
x: m(t, T.MONTH_SHORT),
|
|
19
|
-
y: e.filter((
|
|
19
|
+
y: e.filter((n) => n.year === t.getFullYear() && n.month === t.getMonth() + 1).reduce((n, c) => n + c.total, 0)
|
|
20
20
|
}), t = u(t, 1);
|
|
21
21
|
return o;
|
|
22
22
|
}, b = (e, r) => {
|
|
@@ -30,26 +30,24 @@ const i = (e) => (e.top_level_category_guid === n.INCOME || e.category_guid ===
|
|
|
30
30
|
return g(o, r);
|
|
31
31
|
}, H = (e) => {
|
|
32
32
|
const r = [], o = e.filter(
|
|
33
|
-
(
|
|
33
|
+
(n) => n.top_level_category_guid !== a.INCOME && n.top_level_category_guid !== a.TRANSFER && n.total > 0
|
|
34
34
|
);
|
|
35
35
|
let t = _(y(/* @__PURE__ */ new Date(), 5));
|
|
36
36
|
const s = M(/* @__PURE__ */ new Date());
|
|
37
37
|
for (; d(t, s); )
|
|
38
38
|
r.push({
|
|
39
39
|
x: m(t, T.MONTH_SHORT),
|
|
40
|
-
y: o.filter((
|
|
40
|
+
y: o.filter((n) => n.year === t.getFullYear() && n.month === t.getMonth() + 1).reduce((n, c) => n + c.total, 0)
|
|
41
41
|
}), t = u(t, 1);
|
|
42
42
|
return r;
|
|
43
43
|
};
|
|
44
44
|
export {
|
|
45
45
|
A as a,
|
|
46
46
|
x as b,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
w as c,
|
|
48
|
+
i as d,
|
|
49
|
+
H as e,
|
|
50
|
+
F as f,
|
|
51
51
|
b as g,
|
|
52
|
-
|
|
53
|
-
h as i,
|
|
54
|
-
F as j
|
|
52
|
+
C as i
|
|
55
53
|
};
|