@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,384 +1,215 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { endOfMonth as
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import { observer as x } from "mobx-react-lite";
|
|
4
|
+
import { startOfMonth as it } from "date-fns/startOfMonth";
|
|
5
|
+
import { endOfMonth as rt } from "date-fns/endOfMonth";
|
|
6
|
+
import M from "@mui/material/Box";
|
|
7
7
|
import C from "@mui/material/Stack";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { b as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { u as
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import { A as
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color: V(e.guid, c),
|
|
48
|
-
categoryTotals: [d],
|
|
49
|
-
amount: a.total
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return l;
|
|
53
|
-
}, []), ct = (n, c, r, l) => {
|
|
54
|
-
const a = Et(n, r, l), i = a.filter(
|
|
55
|
-
(s) => s.guid !== S.INCOME && s.guid !== S.INVESTMENTS && s.guid !== S.TRANSFER
|
|
56
|
-
).sort((s, m) => m.amount - s.amount), o = i.reduce(
|
|
57
|
-
(s, m) => s + m.amount,
|
|
58
|
-
0
|
|
59
|
-
), e = i.length > j ? j : i.length, d = i.slice(0, e), u = d.map((s) => ({
|
|
60
|
-
id: s.guid,
|
|
61
|
-
color: V(s.guid, r),
|
|
62
|
-
label: s.name,
|
|
63
|
-
value: s.amount / o * 100
|
|
64
|
-
}));
|
|
65
|
-
if (i.length > 5) {
|
|
66
|
-
const s = i.slice(j, a.length), m = s.reduce(
|
|
67
|
-
(T, g) => T + g.amount,
|
|
68
|
-
0
|
|
69
|
-
);
|
|
70
|
-
d.push({
|
|
71
|
-
guid: "other",
|
|
72
|
-
color: r.palette.categories.others || "",
|
|
73
|
-
name: c.saving_goal_other,
|
|
74
|
-
categoryTotals: s,
|
|
75
|
-
amount: m
|
|
76
|
-
}), u.push({
|
|
77
|
-
id: "other",
|
|
78
|
-
color: r.palette.categories.others || "",
|
|
79
|
-
label: c.saving_goal_other,
|
|
80
|
-
value: m / o * 100
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
categoryData: d,
|
|
85
|
-
donutData: u,
|
|
86
|
-
totalAmount: o
|
|
87
|
-
};
|
|
88
|
-
}, dt = (n, c, r) => {
|
|
89
|
-
const l = n.filter(
|
|
90
|
-
(e) => e.guid === S.INCOME || e.parent_guid === S.INCOME
|
|
91
|
-
), a = c.filter((e) => l.some((d) => d.guid === e.category_guid)).sort((e, d) => e.total - d.total).map((e, d) => ({
|
|
92
|
-
guid: e.category_guid,
|
|
93
|
-
name: n.find((u) => u.guid === e.category_guid)?.name,
|
|
94
|
-
color: r[d],
|
|
95
|
-
categoryTotals: [],
|
|
96
|
-
amount: Math.abs(e.total)
|
|
97
|
-
})), i = a.reduce(
|
|
98
|
-
(e, d) => e + d.amount,
|
|
99
|
-
0
|
|
100
|
-
), o = a.map((e) => ({
|
|
101
|
-
id: e.guid,
|
|
102
|
-
color: e.color,
|
|
103
|
-
label: e.name,
|
|
104
|
-
value: e.amount / i * 100
|
|
105
|
-
}));
|
|
106
|
-
return {
|
|
107
|
-
categoryData: a,
|
|
108
|
-
donutData: o,
|
|
109
|
-
totalAmount: i
|
|
110
|
-
};
|
|
111
|
-
}, W = ({ amount: n, label: c }) => /* @__PURE__ */ h(C, { direction: "column", children: [
|
|
112
|
-
/* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: c }),
|
|
113
|
-
/* @__PURE__ */ t(y, { variant: "XSmall", children: w(n, "0,0") })
|
|
114
|
-
] }), At = ({
|
|
115
|
-
data: n,
|
|
116
|
-
isIncome: c = !1,
|
|
117
|
-
onSelected: r,
|
|
118
|
-
onViewTransactions: l,
|
|
119
|
-
selectedId: a,
|
|
120
|
-
size: i = 150,
|
|
121
|
-
totalLabel: o,
|
|
122
|
-
variant: e = "mini"
|
|
123
|
-
}) => {
|
|
124
|
-
const { spending: d } = I(), u = it(), { isTablet: s } = lt(), { announce: m, ariaLive: T } = bt(), g = p.useMemo(
|
|
125
|
-
() => a ? n.categoryData.find((D) => D.guid === a) : void 0,
|
|
126
|
-
[a]
|
|
127
|
-
);
|
|
128
|
-
p.useEffect(() => {
|
|
129
|
-
if (g) {
|
|
130
|
-
const D = w(g.amount, "0,0");
|
|
131
|
-
m(`${g.name}: ${D}`);
|
|
132
|
-
}
|
|
133
|
-
}, [g, m]);
|
|
134
|
-
const b = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]), E = () => {
|
|
135
|
-
l?.(a);
|
|
136
|
-
}, _ = s ? 32 : 48;
|
|
137
|
-
return /* @__PURE__ */ h(mt, { children: [
|
|
138
|
-
T,
|
|
139
|
-
/* @__PURE__ */ t(Tt, { data: b, onClick: r, selectedId: a, size: i, children: /* @__PURE__ */ t(C, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(C, { alignItems: "center", justifyContent: "center", minHeight: i, minWidth: i, children: [
|
|
140
|
-
g && /* @__PURE__ */ h(
|
|
141
|
-
C,
|
|
142
|
-
{
|
|
143
|
-
alignItems: "center",
|
|
144
|
-
gap: e === "mini" ? 0 : 8,
|
|
145
|
-
mb: e === "mini" ? 0 : 8,
|
|
146
|
-
mt: e === "mini" ? 0 : -16,
|
|
147
|
-
sx: e === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ t(
|
|
150
|
-
ft,
|
|
151
|
-
{
|
|
152
|
-
categoryGuid: c ? S.INCOME : g.guid,
|
|
153
|
-
size: e === "mini" ? 24 : _,
|
|
154
|
-
variant: yt.Transparent
|
|
155
|
-
}
|
|
156
|
-
),
|
|
157
|
-
/* @__PURE__ */ t(
|
|
158
|
-
y,
|
|
159
|
-
{
|
|
160
|
-
color: "secondary",
|
|
161
|
-
noWrap: !0,
|
|
162
|
-
variant: e === "mini" ? "Tiny" : "Body",
|
|
163
|
-
children: g ? g.name : o
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
),
|
|
169
|
-
!g && e === "full" && /* @__PURE__ */ t(y, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: o }),
|
|
170
|
-
/* @__PURE__ */ t(y, { variant: e === "mini" ? "H2" : "H1", children: g ? w(g.amount, "0,0") : w(n.totalAmount, "0,0") }),
|
|
171
|
-
!g && e === "mini" && /* @__PURE__ */ t(y, { color: "secondary", noWrap: !0, variant: "Tiny", children: o }),
|
|
172
|
-
e === "full" && /* @__PURE__ */ t(
|
|
173
|
-
Ct,
|
|
174
|
-
{
|
|
175
|
-
"aria-label": `View ${g?.name || ""} Transactions`,
|
|
176
|
-
disabled: n.categoryData.length === 0,
|
|
177
|
-
onClick: E,
|
|
178
|
-
sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
|
|
179
|
-
variant: "text",
|
|
180
|
-
children: d.view_transactions
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
] }) }) })
|
|
184
|
-
] });
|
|
185
|
-
}, O = v(At), tt = ({ data: n, onSelected: c, selectedId: r }) => {
|
|
186
|
-
const l = (a, i) => {
|
|
187
|
-
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), c(i));
|
|
188
|
-
};
|
|
189
|
-
return /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: n.categoryData.map((a) => /* @__PURE__ */ h(
|
|
190
|
-
C,
|
|
191
|
-
{
|
|
192
|
-
alignItems: "center",
|
|
193
|
-
"aria-label": a.name,
|
|
194
|
-
"aria-pressed": a.guid === r,
|
|
195
|
-
direction: "row",
|
|
196
|
-
gap: 8,
|
|
197
|
-
onClick: () => c(a.guid),
|
|
198
|
-
onKeyDown: (i) => l(i, a.guid),
|
|
199
|
-
role: "button",
|
|
200
|
-
sx: { cursor: "pointer" },
|
|
201
|
-
tabIndex: 0,
|
|
202
|
-
children: [
|
|
203
|
-
/* @__PURE__ */ t(x, { borderRadius: 4, height: 8, sx: { backgroundColor: a.color }, width: 8 }),
|
|
204
|
-
/* @__PURE__ */ t(y, { bold: a.guid === r, variant: "XSmall", children: a.name })
|
|
205
|
-
]
|
|
206
|
-
},
|
|
207
|
-
a.guid
|
|
208
|
-
)) });
|
|
209
|
-
}, Lt = () => {
|
|
210
|
-
const n = ht(), { goals: c, spending: r } = I(), { selectedAccounts: l } = R(), {
|
|
211
|
-
categories: a,
|
|
212
|
-
dateRangeCategoryTotals: i,
|
|
213
|
-
dataRangeTotalsLoaded: o,
|
|
214
|
-
loadDateRangeCategoryTotals: e
|
|
215
|
-
} = z(), d = p.useMemo(
|
|
8
|
+
import E from "@mui/material/Tab";
|
|
9
|
+
import st from "@mui/material/Tabs";
|
|
10
|
+
import bt from "@mui/material/styles/useTheme";
|
|
11
|
+
import { g as ct, a as lt, S as W, b as Q } from "../SpendingLegend-CDO060GT.mjs";
|
|
12
|
+
import { Text as y, Icon as _t } from "@mxenabled/mxui";
|
|
13
|
+
import { f as A } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
+
import { u as w, b as R, m as F, d as dt, a as V, h as Ct, g as yt } from "../hooks-ZMp65DFz.mjs";
|
|
15
|
+
import { u as gt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
|
|
16
|
+
import { L as P } from "../Loader-DUaFpDGv.mjs";
|
|
17
|
+
import { M as St } from "../MiniWidgetContainer-Bg02sF1Y.mjs";
|
|
18
|
+
import { startOfToday as Z } from "date-fns/startOfToday";
|
|
19
|
+
import Tt from "@mui/material/Button";
|
|
20
|
+
import { useTheme as Mt } from "@mui/material";
|
|
21
|
+
import { e as xt } from "../exportTransactionsToCSV-DuAaI5XA.mjs";
|
|
22
|
+
import { T as wt, a as vt } from "../TransactionDetails-m5PddMQn.mjs";
|
|
23
|
+
import Dt from "@mui/material/Collapse";
|
|
24
|
+
import z from "@mui/material/Divider";
|
|
25
|
+
import tt from "@mui/material/List";
|
|
26
|
+
import et from "@mui/material/ListItem";
|
|
27
|
+
import Lt from "@mui/material/ListItemButton";
|
|
28
|
+
import { u as It } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
29
|
+
import { D as nt } from "../Drawer-By9V-B5L.mjs";
|
|
30
|
+
import { b as L } from "../Category-CevNQ03n.mjs";
|
|
31
|
+
import { A as ot, W as At } from "../WidgetContainer-CoFDmQRE.mjs";
|
|
32
|
+
const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column", children: [
|
|
33
|
+
/* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
|
|
34
|
+
/* @__PURE__ */ t(y, { variant: "XSmall", children: A(e, "0,0") })
|
|
35
|
+
] }), Et = () => {
|
|
36
|
+
const e = bt(), { goals: d, spending: o } = w(), { selectedAccounts: r } = R(), {
|
|
37
|
+
categories: i,
|
|
38
|
+
dateRangeCategoryTotals: s,
|
|
39
|
+
dataRangeTotalsLoaded: n,
|
|
40
|
+
loadDateRangeCategoryTotals: u
|
|
41
|
+
} = F();
|
|
42
|
+
gt({
|
|
43
|
+
widgetName: "SpendingMiniWidget",
|
|
44
|
+
isLoaded: n
|
|
45
|
+
});
|
|
46
|
+
const c = a.useMemo(
|
|
216
47
|
() => [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
48
|
+
e.palette.chartMono.chartMono5,
|
|
49
|
+
e.palette.chartMono.chartMono4,
|
|
50
|
+
e.palette.chartMono.chartMono3,
|
|
51
|
+
e.palette.chartMono.chartMono2,
|
|
52
|
+
e.palette.chartMono.chartMono1,
|
|
53
|
+
e.palette.chartMono.chartMono6
|
|
223
54
|
],
|
|
224
|
-
[
|
|
55
|
+
[e]
|
|
225
56
|
);
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
57
|
+
a.useEffect(() => {
|
|
58
|
+
u(
|
|
59
|
+
r,
|
|
60
|
+
it(/* @__PURE__ */ new Date()),
|
|
61
|
+
rt(/* @__PURE__ */ new Date())
|
|
231
62
|
).finally();
|
|
232
|
-
}, [
|
|
233
|
-
const [
|
|
234
|
-
() => ct(
|
|
235
|
-
[
|
|
236
|
-
),
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
|
|
63
|
+
}, [r]);
|
|
64
|
+
const [m, g] = a.useState(""), [h, v] = a.useState(0), _ = a.useMemo(
|
|
65
|
+
() => ct(i, d, e, s),
|
|
66
|
+
[i, s]
|
|
67
|
+
), f = a.useMemo(
|
|
68
|
+
() => lt(i, s, c),
|
|
69
|
+
[i, s, c]
|
|
70
|
+
), O = (T, k) => {
|
|
71
|
+
v(k), g("");
|
|
72
|
+
}, S = (T) => {
|
|
73
|
+
g(m === T ? "" : T);
|
|
243
74
|
};
|
|
244
|
-
return
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
|
|
75
|
+
return n ? /* @__PURE__ */ l(M, { width: "100%", children: [
|
|
76
|
+
/* @__PURE__ */ l(
|
|
77
|
+
st,
|
|
247
78
|
{
|
|
248
|
-
"aria-label":
|
|
249
|
-
onChange:
|
|
250
|
-
value:
|
|
79
|
+
"aria-label": o.mini_title,
|
|
80
|
+
onChange: O,
|
|
81
|
+
value: h,
|
|
251
82
|
variant: "fullWidth",
|
|
252
83
|
children: [
|
|
253
84
|
/* @__PURE__ */ t(
|
|
254
|
-
|
|
85
|
+
E,
|
|
255
86
|
{
|
|
256
87
|
"aria-controls": "spending-tabpanel",
|
|
257
88
|
id: "spending-tab",
|
|
258
89
|
label: /* @__PURE__ */ t(
|
|
259
|
-
|
|
90
|
+
N,
|
|
260
91
|
{
|
|
261
|
-
amount:
|
|
262
|
-
label:
|
|
92
|
+
amount: _.totalAmount,
|
|
93
|
+
label: o.spend_tab_title
|
|
263
94
|
}
|
|
264
95
|
),
|
|
265
|
-
tabIndex:
|
|
96
|
+
tabIndex: h === 0 ? 0 : -1
|
|
266
97
|
}
|
|
267
98
|
),
|
|
268
99
|
/* @__PURE__ */ t(
|
|
269
|
-
|
|
100
|
+
E,
|
|
270
101
|
{
|
|
271
102
|
"aria-controls": "income-tabpanel",
|
|
272
103
|
id: "income-tab",
|
|
273
104
|
label: /* @__PURE__ */ t(
|
|
274
|
-
|
|
105
|
+
N,
|
|
275
106
|
{
|
|
276
|
-
amount:
|
|
277
|
-
label:
|
|
107
|
+
amount: f.totalAmount,
|
|
108
|
+
label: o.income_tab_title
|
|
278
109
|
}
|
|
279
110
|
),
|
|
280
|
-
tabIndex:
|
|
111
|
+
tabIndex: h === 1 ? 0 : -1
|
|
281
112
|
}
|
|
282
113
|
)
|
|
283
114
|
]
|
|
284
115
|
}
|
|
285
116
|
),
|
|
286
117
|
/* @__PURE__ */ t(
|
|
287
|
-
|
|
118
|
+
M,
|
|
288
119
|
{
|
|
289
120
|
"aria-labelledby": "spending-tab",
|
|
290
|
-
hidden:
|
|
121
|
+
hidden: h !== 0,
|
|
291
122
|
id: "spending-tabpanel",
|
|
292
123
|
role: "tabpanel",
|
|
293
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ l(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
294
125
|
/* @__PURE__ */ t(
|
|
295
|
-
|
|
126
|
+
W,
|
|
296
127
|
{
|
|
297
|
-
data:
|
|
298
|
-
onSelected:
|
|
299
|
-
selectedId:
|
|
300
|
-
totalLabel:
|
|
128
|
+
data: _,
|
|
129
|
+
onSelected: S,
|
|
130
|
+
selectedId: m,
|
|
131
|
+
totalLabel: o.total_spending
|
|
301
132
|
}
|
|
302
133
|
),
|
|
303
|
-
/* @__PURE__ */ t(
|
|
134
|
+
/* @__PURE__ */ t(Q, { data: _, onSelected: S, selectedId: m })
|
|
304
135
|
] })
|
|
305
136
|
}
|
|
306
137
|
),
|
|
307
138
|
/* @__PURE__ */ t(
|
|
308
|
-
|
|
139
|
+
M,
|
|
309
140
|
{
|
|
310
141
|
"aria-labelledby": "income-tab",
|
|
311
|
-
hidden:
|
|
142
|
+
hidden: h !== 1,
|
|
312
143
|
id: "income-tabpanel",
|
|
313
144
|
role: "tabpanel",
|
|
314
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ l(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
315
146
|
/* @__PURE__ */ t(
|
|
316
|
-
|
|
147
|
+
W,
|
|
317
148
|
{
|
|
318
|
-
data:
|
|
149
|
+
data: f,
|
|
319
150
|
isIncome: !0,
|
|
320
|
-
onSelected:
|
|
321
|
-
selectedId:
|
|
322
|
-
totalLabel:
|
|
151
|
+
onSelected: S,
|
|
152
|
+
selectedId: m,
|
|
153
|
+
totalLabel: o.total_income
|
|
323
154
|
}
|
|
324
155
|
),
|
|
325
|
-
/* @__PURE__ */ t(
|
|
156
|
+
/* @__PURE__ */ t(Q, { data: f, onSelected: S, selectedId: m })
|
|
326
157
|
] })
|
|
327
158
|
}
|
|
328
159
|
)
|
|
329
|
-
] }) : /* @__PURE__ */ t(
|
|
330
|
-
},
|
|
331
|
-
const { visibleAccounts:
|
|
332
|
-
return
|
|
333
|
-
o
|
|
334
|
-
}, [
|
|
335
|
-
|
|
160
|
+
] }) : /* @__PURE__ */ t(P, { height: 250 });
|
|
161
|
+
}, Wt = x(Et), Nt = ({ onPrimaryCtaClick: e, sx: d = {} }) => {
|
|
162
|
+
const { visibleAccounts: o } = dt(), { spending: r } = w(), { isCopyLoaded: i, isInitialized: s, setSelectedAccounts: n } = R();
|
|
163
|
+
return a.useEffect(() => {
|
|
164
|
+
n(o);
|
|
165
|
+
}, [o]), !i || !s ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
|
|
166
|
+
St,
|
|
336
167
|
{
|
|
337
168
|
className: "mx-exp-spending-miniwidget",
|
|
338
|
-
onPrimaryCtaClick:
|
|
339
|
-
primaryCtaLabel:
|
|
340
|
-
sx:
|
|
341
|
-
title:
|
|
342
|
-
children: /* @__PURE__ */ t(
|
|
169
|
+
onPrimaryCtaClick: e,
|
|
170
|
+
primaryCtaLabel: r.primary_cta,
|
|
171
|
+
sx: { height: "100%", ...d },
|
|
172
|
+
title: r.mini_title,
|
|
173
|
+
children: /* @__PURE__ */ t(Wt, {})
|
|
343
174
|
}
|
|
344
175
|
);
|
|
345
|
-
},
|
|
346
|
-
data:
|
|
347
|
-
onSelected:
|
|
348
|
-
selectedId:
|
|
349
|
-
title:
|
|
176
|
+
}, _e = x(Nt), Rt = ({
|
|
177
|
+
data: e,
|
|
178
|
+
onSelected: d,
|
|
179
|
+
selectedId: o = "",
|
|
180
|
+
title: r
|
|
350
181
|
}) => {
|
|
351
|
-
const { spending:
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${
|
|
354
|
-
/* @__PURE__ */ t(
|
|
355
|
-
/* @__PURE__ */ t(
|
|
182
|
+
const { spending: i } = w(), s = e.categoryData.find((n) => n.guid === o);
|
|
183
|
+
return /* @__PURE__ */ l(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
184
|
+
/* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${r} ${i.by_category}` }),
|
|
185
|
+
/* @__PURE__ */ t(z, { "aria-hidden": "true" }),
|
|
186
|
+
/* @__PURE__ */ t(tt, { children: e.categoryData.map((n) => /* @__PURE__ */ l(a.Fragment, { children: [
|
|
356
187
|
/* @__PURE__ */ t(
|
|
357
|
-
|
|
188
|
+
et,
|
|
358
189
|
{
|
|
359
190
|
disableGutters: !0,
|
|
360
191
|
disablePadding: !0,
|
|
361
192
|
sx: {
|
|
362
193
|
minHeight: 44
|
|
363
194
|
},
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
-
|
|
195
|
+
children: /* @__PURE__ */ l(
|
|
196
|
+
Lt,
|
|
366
197
|
{
|
|
367
|
-
"aria-expanded":
|
|
368
|
-
onClick: () =>
|
|
198
|
+
"aria-expanded": s?.guid === n.guid,
|
|
199
|
+
onClick: () => d(n.guid),
|
|
369
200
|
sx: { minHeight: 44, px: 8, py: 0 },
|
|
370
201
|
children: [
|
|
371
202
|
/* @__PURE__ */ t(
|
|
372
|
-
|
|
203
|
+
M,
|
|
373
204
|
{
|
|
374
205
|
borderRadius: 4,
|
|
375
206
|
flexShrink: 0,
|
|
376
207
|
height: 8,
|
|
377
|
-
sx: { backgroundColor:
|
|
208
|
+
sx: { backgroundColor: n.color, mr: 8 },
|
|
378
209
|
width: 8
|
|
379
210
|
}
|
|
380
211
|
),
|
|
381
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ l(
|
|
382
213
|
C,
|
|
383
214
|
{
|
|
384
215
|
alignItems: "center",
|
|
@@ -386,8 +217,8 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
386
217
|
justifyContent: "space-between",
|
|
387
218
|
width: "100%",
|
|
388
219
|
children: [
|
|
389
|
-
/* @__PURE__ */ t(y, { bold:
|
|
390
|
-
/* @__PURE__ */ t(y, { bold:
|
|
220
|
+
/* @__PURE__ */ t(y, { bold: o === n.guid, children: n.name }),
|
|
221
|
+
/* @__PURE__ */ t(y, { bold: o === n.guid, variant: "Body", children: A(n.amount, "0,0") })
|
|
391
222
|
]
|
|
392
223
|
}
|
|
393
224
|
)
|
|
@@ -396,51 +227,51 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
396
227
|
)
|
|
397
228
|
}
|
|
398
229
|
),
|
|
399
|
-
/* @__PURE__ */ t(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
230
|
+
/* @__PURE__ */ t(z, {}),
|
|
231
|
+
n.categoryTotals && n.categoryTotals.length > 0 && /* @__PURE__ */ t(Dt, { in: s?.guid === n.guid, unmountOnExit: !0, children: /* @__PURE__ */ l(tt, { children: [
|
|
232
|
+
s?.categoryTotals?.map((u) => /* @__PURE__ */ t(
|
|
233
|
+
et,
|
|
403
234
|
{
|
|
404
235
|
sx: {
|
|
405
236
|
pl: 24,
|
|
406
237
|
pr: 8,
|
|
407
238
|
py: 0
|
|
408
239
|
},
|
|
409
|
-
children: /* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
|
|
240
|
+
children: /* @__PURE__ */ l(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
241
|
+
/* @__PURE__ */ l(y, { children: [
|
|
242
|
+
u.name,
|
|
412
243
|
" "
|
|
413
244
|
] }),
|
|
414
|
-
/* @__PURE__ */ t(y, { children:
|
|
245
|
+
/* @__PURE__ */ t(y, { children: A(u.amount, "0,0") })
|
|
415
246
|
] })
|
|
416
247
|
},
|
|
417
|
-
|
|
248
|
+
u.guid
|
|
418
249
|
)),
|
|
419
|
-
/* @__PURE__ */ t(
|
|
250
|
+
/* @__PURE__ */ t(z, {})
|
|
420
251
|
] }) })
|
|
421
|
-
] },
|
|
422
|
-
/* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${
|
|
252
|
+
] }, n.guid)) }),
|
|
253
|
+
/* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${A(e.totalAmount, "0,0")}` })
|
|
423
254
|
] });
|
|
424
|
-
},
|
|
425
|
-
data:
|
|
426
|
-
onSelected:
|
|
427
|
-
onViewTransactions:
|
|
428
|
-
selectedId:
|
|
429
|
-
title:
|
|
255
|
+
}, Ot = x(Rt), kt = ({
|
|
256
|
+
data: e,
|
|
257
|
+
onSelected: d,
|
|
258
|
+
onViewTransactions: o,
|
|
259
|
+
selectedId: r,
|
|
260
|
+
title: i
|
|
430
261
|
}) => {
|
|
431
|
-
const { isDesktop:
|
|
432
|
-
return /* @__PURE__ */
|
|
262
|
+
const { isDesktop: s, isMobile: n } = It(), { isLoadingCategoryTotals: u } = F(), { spending: c } = w();
|
|
263
|
+
return /* @__PURE__ */ l(
|
|
433
264
|
C,
|
|
434
265
|
{
|
|
435
|
-
alignItems:
|
|
436
|
-
direction:
|
|
266
|
+
alignItems: n ? "center" : "flex-start",
|
|
267
|
+
direction: n ? "column" : "row",
|
|
437
268
|
gap: { xs: 16, md: 64, xl: 100 },
|
|
438
269
|
justifyContent: "center",
|
|
439
270
|
pt: 50,
|
|
440
271
|
px: 8,
|
|
441
272
|
children: [
|
|
442
|
-
|
|
443
|
-
|
|
273
|
+
u && /* @__PURE__ */ t(
|
|
274
|
+
W,
|
|
444
275
|
{
|
|
445
276
|
data: {
|
|
446
277
|
categoryData: [],
|
|
@@ -450,173 +281,203 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
|
|
|
450
281
|
onSelected: () => {
|
|
451
282
|
},
|
|
452
283
|
selectedId: "",
|
|
453
|
-
size:
|
|
284
|
+
size: s ? 400 : 300,
|
|
454
285
|
totalLabel: "Loading ...",
|
|
455
286
|
variant: "full"
|
|
456
287
|
}
|
|
457
288
|
),
|
|
458
|
-
!
|
|
459
|
-
|
|
289
|
+
!u && /* @__PURE__ */ t(
|
|
290
|
+
W,
|
|
460
291
|
{
|
|
461
|
-
data:
|
|
462
|
-
onSelected:
|
|
463
|
-
onViewTransactions:
|
|
464
|
-
selectedId:
|
|
465
|
-
size:
|
|
466
|
-
totalLabel:
|
|
292
|
+
data: e,
|
|
293
|
+
onSelected: d,
|
|
294
|
+
onViewTransactions: o,
|
|
295
|
+
selectedId: r,
|
|
296
|
+
size: s ? 400 : 300,
|
|
297
|
+
totalLabel: c.total_amount,
|
|
467
298
|
variant: "full"
|
|
468
299
|
}
|
|
469
300
|
),
|
|
470
|
-
/* @__PURE__ */ t(
|
|
301
|
+
/* @__PURE__ */ t(Ot, { data: e, onSelected: d, selectedId: r, title: i })
|
|
471
302
|
]
|
|
472
303
|
}
|
|
473
304
|
);
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
],
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
305
|
+
}, at = x(kt), $t = (e) => [
|
|
306
|
+
e.palette.chartMono.chartMono5,
|
|
307
|
+
e.palette.chartMono.chartMono4,
|
|
308
|
+
e.palette.chartMono.chartMono3,
|
|
309
|
+
e.palette.chartMono.chartMono2,
|
|
310
|
+
e.palette.chartMono.chartMono1,
|
|
311
|
+
e.palette.chartMono.chartMono6
|
|
312
|
+
], Bt = () => {
|
|
313
|
+
const e = Mt(), { is_mobile_webview: d } = V(), { clientConfig: o } = V(), {
|
|
314
|
+
categories: r,
|
|
315
|
+
dateRangeCategoryTotals: i,
|
|
316
|
+
loadDateRangeCategoryTotals: s,
|
|
317
|
+
dataRangeTotalsLoaded: n
|
|
318
|
+
} = F(), {
|
|
319
|
+
goals: u,
|
|
320
|
+
spending: c,
|
|
321
|
+
transactions: m
|
|
322
|
+
} = w(), { displayedDateRange: g, selectedAccounts: h, selectedAccountGuids: v } = R(), {
|
|
323
|
+
setFilter: _,
|
|
324
|
+
sortedTransactions: f,
|
|
325
|
+
sortedTransactionsWithSplits: O,
|
|
326
|
+
tags: S
|
|
327
|
+
} = Ct(), T = o?.master?.deep_link_params?.account_guids, k = o?.master?.deep_link_params?.view, [$, H] = a.useState(""), [I, pt] = a.useState(k === "income" ? 1 : 0), [K, U] = a.useState(""), [ut, X] = a.useState(!1);
|
|
328
|
+
gt({
|
|
329
|
+
widgetName: "SpendingWidget",
|
|
330
|
+
isLoaded: n
|
|
331
|
+
}), a.useEffect(() => {
|
|
332
|
+
s(
|
|
333
|
+
h,
|
|
334
|
+
g.start,
|
|
335
|
+
g.end
|
|
488
336
|
).finally();
|
|
489
|
-
}, [
|
|
490
|
-
const
|
|
491
|
-
() => ct(r,
|
|
492
|
-
[r,
|
|
493
|
-
),
|
|
494
|
-
() =>
|
|
495
|
-
[r,
|
|
496
|
-
),
|
|
497
|
-
() =>
|
|
498
|
-
[
|
|
499
|
-
),
|
|
500
|
-
D
|
|
501
|
-
},
|
|
502
|
-
|
|
503
|
-
},
|
|
504
|
-
const
|
|
505
|
-
accounts: T ||
|
|
506
|
-
dateRange:
|
|
337
|
+
}, [h, g]);
|
|
338
|
+
const B = a.useMemo(
|
|
339
|
+
() => ct(r, u, e, i),
|
|
340
|
+
[r, i]
|
|
341
|
+
), Y = a.useMemo(
|
|
342
|
+
() => lt(r, i, $t(e)),
|
|
343
|
+
[r, i]
|
|
344
|
+
), G = a.useMemo(
|
|
345
|
+
() => f.find((p) => p.guid === K),
|
|
346
|
+
[K, f]
|
|
347
|
+
), mt = (p, D) => {
|
|
348
|
+
pt(D), H("");
|
|
349
|
+
}, q = (p) => {
|
|
350
|
+
H($ === p || p === "0" ? "" : p);
|
|
351
|
+
}, J = (p) => {
|
|
352
|
+
const D = {
|
|
353
|
+
accounts: T || v,
|
|
354
|
+
dateRange: g
|
|
507
355
|
};
|
|
508
|
-
if (
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
...
|
|
513
|
-
custom: (
|
|
356
|
+
if (I === 0)
|
|
357
|
+
if (p === "other") {
|
|
358
|
+
const b = B.categoryData.find((j) => j.guid === "other");
|
|
359
|
+
_({
|
|
360
|
+
...D,
|
|
361
|
+
custom: (j) => !!b?.categoryTotals?.find((ft) => ft.guid === j.top_level_category_guid)
|
|
514
362
|
});
|
|
515
363
|
} else
|
|
516
|
-
|
|
517
|
-
...
|
|
518
|
-
custom: (
|
|
519
|
-
showSplits: !!
|
|
364
|
+
_({
|
|
365
|
+
...D,
|
|
366
|
+
custom: (b) => p ? b.top_level_category_guid === p : b.top_level_category_guid !== L.INCOME && b.top_level_category_guid !== L.INVESTMENTS && b.top_level_category_guid !== L.TRANSFER,
|
|
367
|
+
showSplits: !!p
|
|
520
368
|
});
|
|
521
369
|
else
|
|
522
|
-
|
|
523
|
-
...
|
|
524
|
-
custom: (
|
|
370
|
+
_({
|
|
371
|
+
...D,
|
|
372
|
+
custom: (b) => p ? b.category_guid === p : b.category_guid === L.INCOME || b.top_level_category_guid === L.INCOME
|
|
525
373
|
});
|
|
526
|
-
|
|
374
|
+
X(!0);
|
|
375
|
+
}, ht = () => {
|
|
376
|
+
xt(O, S);
|
|
527
377
|
};
|
|
528
|
-
return /* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ l(M, { children: [
|
|
379
|
+
/* @__PURE__ */ l(st, { onChange: mt, value: I, variant: "fullWidth", children: [
|
|
530
380
|
/* @__PURE__ */ t(
|
|
531
|
-
|
|
381
|
+
E,
|
|
532
382
|
{
|
|
533
383
|
label: /* @__PURE__ */ t(
|
|
534
|
-
|
|
384
|
+
N,
|
|
535
385
|
{
|
|
536
|
-
amount:
|
|
537
|
-
label:
|
|
386
|
+
amount: B.totalAmount,
|
|
387
|
+
label: c.spend_tab_title
|
|
538
388
|
}
|
|
539
389
|
)
|
|
540
390
|
}
|
|
541
391
|
),
|
|
542
392
|
/* @__PURE__ */ t(
|
|
543
|
-
|
|
393
|
+
E,
|
|
544
394
|
{
|
|
545
395
|
label: /* @__PURE__ */ t(
|
|
546
|
-
|
|
396
|
+
N,
|
|
547
397
|
{
|
|
548
|
-
amount:
|
|
549
|
-
label:
|
|
398
|
+
amount: Y.totalAmount,
|
|
399
|
+
label: c.income_tab_title
|
|
550
400
|
}
|
|
551
401
|
)
|
|
552
402
|
}
|
|
553
403
|
)
|
|
554
404
|
] }),
|
|
555
|
-
|
|
556
|
-
|
|
405
|
+
I === 0 && /* @__PURE__ */ t(
|
|
406
|
+
at,
|
|
557
407
|
{
|
|
558
|
-
data:
|
|
559
|
-
onSelected:
|
|
560
|
-
onViewTransactions:
|
|
561
|
-
selectedId:
|
|
562
|
-
title:
|
|
408
|
+
data: B,
|
|
409
|
+
onSelected: q,
|
|
410
|
+
onViewTransactions: J,
|
|
411
|
+
selectedId: $,
|
|
412
|
+
title: c.spend_tab_title
|
|
563
413
|
}
|
|
564
414
|
),
|
|
565
|
-
|
|
566
|
-
|
|
415
|
+
I === 1 && /* @__PURE__ */ t(
|
|
416
|
+
at,
|
|
567
417
|
{
|
|
568
|
-
data:
|
|
569
|
-
onSelected:
|
|
570
|
-
onViewTransactions:
|
|
571
|
-
selectedId:
|
|
572
|
-
title:
|
|
418
|
+
data: Y,
|
|
419
|
+
onSelected: q,
|
|
420
|
+
onViewTransactions: J,
|
|
421
|
+
selectedId: $,
|
|
422
|
+
title: c.income_tab_title
|
|
573
423
|
}
|
|
574
424
|
),
|
|
575
425
|
/* @__PURE__ */ t(
|
|
576
|
-
|
|
426
|
+
nt,
|
|
577
427
|
{
|
|
578
|
-
ariaLabelClose:
|
|
579
|
-
isOpen:
|
|
580
|
-
onClose: () =>
|
|
581
|
-
title:
|
|
582
|
-
children: /* @__PURE__ */
|
|
428
|
+
ariaLabelClose: c.close_drawer_aria,
|
|
429
|
+
isOpen: ut,
|
|
430
|
+
onClose: () => X(!1),
|
|
431
|
+
title: c.transactions_drawer_title,
|
|
432
|
+
children: /* @__PURE__ */ l(C, { children: [
|
|
433
|
+
!d && f.length > 0 && /* @__PURE__ */ t(C, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
|
|
434
|
+
Tt,
|
|
435
|
+
{
|
|
436
|
+
onClick: ht,
|
|
437
|
+
startIcon: /* @__PURE__ */ t(_t, { name: "ios_share" }),
|
|
438
|
+
variant: "text",
|
|
439
|
+
children: m.export_csv_btn
|
|
440
|
+
}
|
|
441
|
+
) }),
|
|
442
|
+
/* @__PURE__ */ t(wt, { onClick: U })
|
|
443
|
+
] })
|
|
583
444
|
}
|
|
584
445
|
),
|
|
585
446
|
/* @__PURE__ */ t(
|
|
586
|
-
|
|
447
|
+
nt,
|
|
587
448
|
{
|
|
588
|
-
ariaLabelClose:
|
|
589
|
-
isOpen:
|
|
590
|
-
onClose: () =>
|
|
591
|
-
title:
|
|
592
|
-
children:
|
|
449
|
+
ariaLabelClose: c.close_drawer_aria,
|
|
450
|
+
isOpen: !!G,
|
|
451
|
+
onClose: () => U(""),
|
|
452
|
+
title: c.transaction_details_drawer_title,
|
|
453
|
+
children: G && /* @__PURE__ */ t(vt, { transaction: G })
|
|
593
454
|
}
|
|
594
455
|
)
|
|
595
456
|
] });
|
|
596
|
-
},
|
|
597
|
-
const { visibleAccounts:
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}, [
|
|
601
|
-
|
|
457
|
+
}, Gt = x(Bt), jt = ({ onBackClick: e, sx: d = {} }) => {
|
|
458
|
+
const { visibleAccounts: o } = dt(), { spending: r } = w(), { isCopyLoaded: i, isInitialized: s, setDisplayedDate: n, setSelectedAccounts: u } = R(), { onEvent: c } = yt(), { clientConfig: m } = V(), g = m?.master?.deep_link_params?.date_range, [h, v] = a.useState(!1);
|
|
459
|
+
a.useEffect(() => {
|
|
460
|
+
u(o);
|
|
461
|
+
}, [o]), a.useEffect(() => {
|
|
462
|
+
g && Array.isArray(g) && g.length === 2 ? n(g[0], g[1]) : n(it(Z()), rt(Z())), v(!0), c(ot.SPENDING_VIEW);
|
|
602
463
|
}, []);
|
|
603
|
-
const
|
|
604
|
-
|
|
464
|
+
const _ = (f) => {
|
|
465
|
+
n(f[0], f[1]);
|
|
605
466
|
};
|
|
606
|
-
return !
|
|
607
|
-
|
|
467
|
+
return !i || !s || !h ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
|
|
468
|
+
At,
|
|
608
469
|
{
|
|
609
|
-
accountOptions:
|
|
610
|
-
calendarActions: { onRangeChanged:
|
|
611
|
-
onAccountsFilterClick: () =>
|
|
612
|
-
onBackClick:
|
|
613
|
-
sx:
|
|
614
|
-
title:
|
|
615
|
-
children: /* @__PURE__ */ t(
|
|
470
|
+
accountOptions: o,
|
|
471
|
+
calendarActions: { onRangeChanged: _ },
|
|
472
|
+
onAccountsFilterClick: () => c(ot.SPENDING_CLICK_FILTER),
|
|
473
|
+
onBackClick: e,
|
|
474
|
+
sx: d,
|
|
475
|
+
title: r.title,
|
|
476
|
+
children: /* @__PURE__ */ t(M, { width: "100%", children: /* @__PURE__ */ t(Gt, {}) })
|
|
616
477
|
}
|
|
617
478
|
);
|
|
618
|
-
}, Ce =
|
|
479
|
+
}, Ce = x(jt);
|
|
619
480
|
export {
|
|
620
|
-
|
|
481
|
+
_e as SpendingMiniWidget,
|
|
621
482
|
Ce as SpendingWidget
|
|
622
483
|
};
|