@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega2
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 +50 -0
- package/dist/{Account-B4CDD-zq.mjs → Account-CvR2-dSR.mjs} +1 -1
- package/dist/AccountDetailsContent-CitErkuS.mjs +686 -0
- package/dist/{AccountDetailsHeader-DRjFuyJT.mjs → AccountDetailsHeader-BkG3MNYo.mjs} +19 -19
- package/dist/{AccountFields-Cl4KHoSj.mjs → AccountFields-zCMqet85.mjs} +10 -12
- package/dist/AccountListItem-DHrz8Mml.mjs +90 -0
- package/dist/{AccountStore-HbVblv86.mjs → AccountStore-LgfBcYMe.mjs} +101 -75
- package/dist/Accounts-Bzy1_REQ.mjs +9 -0
- package/dist/{BudgetUtil-Jv8h9H9l.mjs → BudgetUtil-BmZXkL0C.mjs} +32 -32
- package/dist/{CashflowStore-CA190BPF.mjs → CashflowStore-D9Dpuz7X.mjs} +25 -18
- package/dist/{Category-Ccoew_sA.mjs → Category-CevNQ03n.mjs} +2 -2
- package/dist/{CategorySelectorDrawer-Dl006GKy.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +27 -27
- package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
- package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
- package/dist/{ConnectDrawer-DVp54lUH.mjs → ConnectDrawer-BkvlItWx.mjs} +55 -56
- package/dist/{ConnectionsDrawer-Dsc04-4Z.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
- package/dist/CurrencyInput-itK0R3wV.mjs +85 -0
- package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CBdcsyuk.mjs} +1 -1
- package/dist/{DebtsStore-pL63fmdT.mjs → DebtsStore-Bq-aPy-5.mjs} +3 -3
- package/dist/{Dialog-CDV0kKxj.mjs → Dialog-BPTr3qHE.mjs} +24 -24
- package/dist/Drawer-By9V-B5L.mjs +178 -0
- package/dist/{ExportCsvAction-QhQK4_FU.mjs → ExportCsvAction-Cglo8Mca.mjs} +4 -4
- package/dist/{FinstrongStore-BGf36b0z.mjs → FinstrongStore-BIrX0Xg2.mjs} +56 -56
- package/dist/{GoalStore-C1-w3Y1E.mjs → GoalStore-1P19goZ7.mjs} +111 -151
- package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
- package/dist/{Help-c-zHlDbv.mjs → Help-DhcC-C05.mjs} +8 -8
- package/dist/{Help-DBfsTkAi.mjs → Help-Ea3BlXQp.mjs} +146 -125
- package/dist/{IconBacking-DgT8DCeh.mjs → IconBacking-B9oC6uL2.mjs} +11 -11
- package/dist/LineChart-BF4QA-Lx.mjs +580 -0
- package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-BxTkF6Tz.mjs} +2 -2
- package/dist/Loader-DUaFpDGv.mjs +24 -0
- package/dist/{ManageIncome-8EsStyIQ.mjs → ManageIncome-CaoQl609.mjs} +142 -142
- package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
- package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
- package/dist/{NetWorthStore-Bti6u-d9.mjs → NetWorthStore-rC0q7P7t.mjs} +4 -4
- package/dist/NotificationSettings-uzM8tCoH.mjs +674 -0
- package/dist/{NotificationStore-Ck2KdNmT.mjs → NotificationStore-CDX_kqHa.mjs} +14 -22
- package/dist/{OriginalBalanceAction-2Y_3U_mg.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +9 -9
- package/dist/{RecurringSettings-DAncu--R.mjs → RecurringSettings-B4ybrS0B.mjs} +17 -17
- package/dist/{RecurringTransactions-CxcSL1dY.mjs → RecurringTransactions-BqijW_8S.mjs} +79 -79
- package/dist/{RecurringTransactionsStore-CNFxyGB6.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +81 -91
- package/dist/{ResponsiveButton-Cn6-R7ue.mjs → ResponsiveButton-DZFp78fJ.mjs} +10 -10
- package/dist/SearchBox-B2_zLv8-.mjs +42 -0
- package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-krIRNwHK.mjs} +1 -1
- package/dist/{SingleSegmentDonut-7Uy6VEld.mjs → SingleSegmentDonut-BgbLgwHi.mjs} +6 -6
- package/dist/SpendingData-DQ1b9uqq.mjs +53 -0
- package/dist/{SpendingLegend-6FqtMcBV.mjs → SpendingLegend-CDO060GT.mjs} +65 -65
- package/dist/{StatusBar-CPfSXe80.mjs → StatusBar-BK_uYHAB.mjs} +6 -6
- package/dist/{TabContentContainer-CnMXkVqr.mjs → TabContentContainer-j01JYR_7.mjs} +8 -8
- 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-BklmOUSd.mjs → User-Cnlegl1N.mjs} +107 -107
- package/dist/{ViewMoreMicroCard-DAkyNRlD.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +211 -205
- package/dist/{WidgetContainer-CDh9fjpR.mjs → WidgetContainer-CoFDmQRE.mjs} +36 -36
- package/dist/accounts/index.es.js +200 -197
- package/dist/accounts/stores/AccountStore.d.ts +22 -25
- package/dist/accounts/utils/Accounts.d.ts +1 -2
- package/dist/analytics/index.es.js +27 -27
- package/dist/budgets/components/AddBudgets.d.ts +2 -1
- package/dist/budgets/index.es.js +703 -669
- package/dist/budgets/store/BudgetsStore.d.ts +0 -1
- package/dist/cashflow/index.es.js +420 -404
- package/dist/categories/index.es.js +2 -2
- package/dist/categories/stores/CategoryStore.d.ts +3 -6
- package/dist/categories/util/CategoryUtil.d.ts +2 -3
- package/dist/common/components/ErrorBoundary.d.ts +1 -1
- package/dist/common/components/Loader.d.ts +2 -1
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
- package/dist/common/components/barchart/Bar.d.ts +25 -0
- package/dist/common/components/barchart/BarChart.d.ts +34 -0
- package/dist/common/components/barchart/BarColumn.d.ts +37 -0
- package/dist/common/components/barchart/Legend.d.ts +8 -0
- package/dist/common/components/barchart/Util.d.ts +42 -0
- package/dist/common/components/barchart/index.d.ts +1 -0
- package/dist/common/components/charts/linechart/CustomMark.d.ts +1 -1
- 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/index.d.ts +1 -0
- package/dist/common/hooks/index.d.ts +2 -0
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/hooks/usePrevious.d.ts +2 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +712 -436
- 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 +3 -3
- 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/localization/TransactionsCopy.d.ts +1 -0
- package/dist/common/utils/Theme.d.ts +3 -1
- package/dist/dashboard/index.es.js +93 -91
- package/dist/debts/components/DebtsChart.d.ts +2 -1
- package/dist/debts/index.es.js +529 -527
- package/dist/{exportTransactionsToCSV-BgV_wTLT.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +3 -3
- package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
- package/dist/finstrong/index.es.js +876 -867
- package/dist/goals/index.es.js +526 -525
- package/dist/goals/stores/GoalStore.d.ts +4 -17
- package/dist/help/components/content/BottomImageContent.d.ts +1 -1
- package/dist/help/components/content/LeftImageContent.d.ts +1 -1
- package/dist/help/components/content/RightImageContent.d.ts +1 -1
- package/dist/help/components/content/TopImageContent.d.ts +1 -1
- package/dist/help/index.es.js +13 -9
- package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
- package/dist/investments/index.es.js +534 -531
- package/dist/investments/stores/HoldingStore.d.ts +0 -1
- package/dist/merchants/index.es.js +8 -8
- package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
- package/dist/microinsights/index.d.ts +1 -0
- package/dist/microinsights/index.es.js +101 -14
- package/dist/networth/components/NetWorthChange.d.ts +1 -3
- package/dist/networth/index.es.js +284 -285
- package/dist/notifications/index.es.js +95 -94
- package/dist/notifications/stores/NotificationStore.d.ts +1 -3
- package/dist/recurringtransactions/index.es.js +582 -562
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -4
- package/dist/settings/index.es.js +340 -337
- package/dist/spending/index.es.js +281 -268
- package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +7 -0
- package/dist/transactions/index.es.js +253 -255
- package/dist/transactions/stores/TransactionStore.d.ts +77 -21
- package/dist/transactions/stores/UiStore.d.ts +2 -0
- package/dist/trends/components/TrendsTable.d.ts +0 -2
- package/dist/trends/index.es.js +838 -793
- package/dist/trends/utils/TrendsData.d.ts +1 -0
- package/dist/{useAccountDisplayName-CcIp09Xc.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
- package/dist/{useCombineEvents-kNzLTWCp.mjs → useCombineEvents-CRwX-qWE.mjs} +2 -2
- package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
- package/dist/{useScreenSize-B5afALev.mjs → useScreenSize-B6JyS_Lj.mjs} +1 -1
- package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
- package/package.json +57 -52
- package/dist/AccountDetailsContent-adZTkM52.mjs +0 -683
- package/dist/AccountListItem-wgmlex-_.mjs +0 -90
- package/dist/Accounts-CRUehOiy.mjs +0 -27
- package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
- package/dist/CategoryUtil-DfVKKkRf.mjs +0 -80
- package/dist/CurrencyInput-D1cjbdCI.mjs +0 -85
- package/dist/Drawer-BF40nbsH.mjs +0 -163
- package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
- package/dist/LineChart-C1PxNf7P.mjs +0 -581
- package/dist/Loader-Ckqi9Rx6.mjs +0 -21
- package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +0 -45
- package/dist/MiniWidgetContainer-CKzf_Ira.mjs +0 -56
- package/dist/NotificationSettings-B74rQVYC.mjs +0 -672
- package/dist/SearchBox-B7km148n.mjs +0 -39
- package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
- package/dist/SpendingData-DPQ96k3x.mjs +0 -55
- package/dist/TransactionDetails-Bn0qY5Hw.mjs +0 -1336
- package/dist/TransactionStore-DbwAutwC.mjs +0 -671
- package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
- package/dist/common/components/SkeletonLoader.d.ts +0 -7
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +0 -3
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import x from "react";
|
|
3
|
+
import S from "@mui/material/ListItem";
|
|
4
|
+
import R from "@mui/material/ListItemButton";
|
|
5
|
+
import D from "@mui/material/ListItemIcon";
|
|
6
|
+
import A from "@mui/material/ListItemText";
|
|
7
|
+
import h from "@mui/material/Stack";
|
|
8
|
+
import { Text as b } from "@mxenabled/mxui";
|
|
9
|
+
import { makeAutoObservable as N } from "mobx";
|
|
10
|
+
import { addSeconds as v } from "date-fns/addSeconds";
|
|
11
|
+
import { differenceInCalendarMonths as w } from "date-fns/differenceInCalendarMonths";
|
|
12
|
+
import { endOfMonth as _ } from "date-fns/endOfMonth";
|
|
13
|
+
import { subMonths as I } from "date-fns/subMonths";
|
|
14
|
+
import { b as E, C, c as f } from "./Category-CevNQ03n.mjs";
|
|
15
|
+
import { f as L, a as M } from "./Dialog-BPTr3qHE.mjs";
|
|
16
|
+
const rt = ({
|
|
17
|
+
onClick: e,
|
|
18
|
+
leftIcon: t,
|
|
19
|
+
rightIcon: o,
|
|
20
|
+
title: r,
|
|
21
|
+
subtitle: n,
|
|
22
|
+
rightContent: a,
|
|
23
|
+
titleBold: i = !0,
|
|
24
|
+
rightContentBold: c = !0
|
|
25
|
+
}) => {
|
|
26
|
+
const g = /* @__PURE__ */ u(x.Fragment, { children: [
|
|
27
|
+
t && /* @__PURE__ */ l(D, { sx: { ml: 0 }, children: t }),
|
|
28
|
+
/* @__PURE__ */ l(A, { children: /* @__PURE__ */ u(
|
|
29
|
+
h,
|
|
30
|
+
{
|
|
31
|
+
sx: {
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
marginLeft: 12
|
|
35
|
+
},
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ u(h, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
38
|
+
/* @__PURE__ */ l(b, { bold: i, variant: "body1", children: r }),
|
|
39
|
+
n && /* @__PURE__ */ l(b, { variant: "caption", children: n })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ u(h, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
|
|
42
|
+
a && /* @__PURE__ */ l(b, { bold: c, display: "flex", variant: "body1", children: a }),
|
|
43
|
+
o && /* @__PURE__ */ l(D, { children: o })
|
|
44
|
+
] })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
] });
|
|
49
|
+
return /* @__PURE__ */ l(S, { sx: { bgcolor: "background.paper" }, children: e ? /* @__PURE__ */ l(
|
|
50
|
+
R,
|
|
51
|
+
{
|
|
52
|
+
onClick: e,
|
|
53
|
+
sx: {
|
|
54
|
+
py: 14
|
|
55
|
+
},
|
|
56
|
+
children: g
|
|
57
|
+
}
|
|
58
|
+
) : /* @__PURE__ */ l(
|
|
59
|
+
h,
|
|
60
|
+
{
|
|
61
|
+
sx: {
|
|
62
|
+
py: 14,
|
|
63
|
+
px: 24,
|
|
64
|
+
width: "100%",
|
|
65
|
+
flexDirection: "row",
|
|
66
|
+
alignItems: "center"
|
|
67
|
+
},
|
|
68
|
+
children: g
|
|
69
|
+
}
|
|
70
|
+
) });
|
|
71
|
+
}, O = (e) => C[e] ?? C.default, W = (e) => f[e];
|
|
72
|
+
function F(e, t) {
|
|
73
|
+
const o = [], r = new Date(e);
|
|
74
|
+
for (; r <= t; ) {
|
|
75
|
+
const n = r.getFullYear(), a = String(r.getMonth() + 1).padStart(2, "0");
|
|
76
|
+
o.push(+`${n}${a}`), r.setMonth(r.getMonth() + 1);
|
|
77
|
+
}
|
|
78
|
+
return o;
|
|
79
|
+
}
|
|
80
|
+
const G = (e) => e.reduce((t, o) => {
|
|
81
|
+
const r = {
|
|
82
|
+
top_level_category_guid: o.top_level_category_guid,
|
|
83
|
+
category_guid: o.category_guid,
|
|
84
|
+
amount: o.total,
|
|
85
|
+
year_month: o.year_month
|
|
86
|
+
}, { top_level_category_guid: n, category_guid: a } = r;
|
|
87
|
+
return t[a] || (t[a] = []), t[a].push(r), n !== a && (t[n] || (t[n] = []), t[n].push(r)), t;
|
|
88
|
+
}, {}), at = (e, t, o) => {
|
|
89
|
+
const r = G(e), n = F(t, o);
|
|
90
|
+
return Object.entries(r).map(([a, i]) => {
|
|
91
|
+
const c = i[0].top_level_category_guid, g = n.map((m) => {
|
|
92
|
+
const s = i.filter((y) => y.year_month === m).reduce((y, T) => y + Math.abs(T.amount), 0), d = Number(String(m).slice(0, 4)), p = Number(String(m).slice(4));
|
|
93
|
+
return { x: new Date(d, p - 1), y: s };
|
|
94
|
+
}).sort((m, s) => m.x.getTime() - s.x.getTime());
|
|
95
|
+
return {
|
|
96
|
+
top_level_category_guid: c,
|
|
97
|
+
category_guid: a,
|
|
98
|
+
category_name: W(a),
|
|
99
|
+
category_color: O(c),
|
|
100
|
+
dataset: g
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
}, nt = (e, t) => {
|
|
104
|
+
const o = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e, r = typeof t == "string" ? parseFloat(t.replace(/[^0-9.-]+/g, "")) : t;
|
|
105
|
+
return (o || 0) - (r || 0);
|
|
106
|
+
}, st = (e, t) => {
|
|
107
|
+
const o = f[e] || "", r = f[t] || "";
|
|
108
|
+
return o.localeCompare(r);
|
|
109
|
+
}, $ = (e, t) => {
|
|
110
|
+
const o = e.subCategories.filter((a) => a.currentAmount !== 0), r = e.totalMonthlyAmounts.slice(-t), n = (a) => a.substring(0, 3) + " " + a.slice(-4);
|
|
111
|
+
return r.map((a) => {
|
|
112
|
+
const i = n(a.label), c = o.map((s) => {
|
|
113
|
+
const d = s.monthlyAmounts.slice(-t).find((p) => n(p.label) === i);
|
|
114
|
+
return {
|
|
115
|
+
label: s.name,
|
|
116
|
+
amount: Math.abs(d?.amount || 0),
|
|
117
|
+
header: i
|
|
118
|
+
};
|
|
119
|
+
}), g = e.monthlyAmounts.slice(-t).find((s) => n(s.label) === i);
|
|
120
|
+
return [{
|
|
121
|
+
label: e.name,
|
|
122
|
+
amount: Math.abs(g?.amount || 0),
|
|
123
|
+
header: i
|
|
124
|
+
}, ...c].sort((s, d) => d.amount - s.amount);
|
|
125
|
+
});
|
|
126
|
+
}, j = (e, t) => {
|
|
127
|
+
const o = e ? e.totalMonthlyAmounts.slice(-t).map((n) => ({
|
|
128
|
+
x: n.label.substring(0, 3),
|
|
129
|
+
y: Math.abs(n.amount)
|
|
130
|
+
})) : [], r = e ? $(e, t) : [];
|
|
131
|
+
return { monthlyAmounts: o, tooltipLabels: r };
|
|
132
|
+
}, k = (e) => e.slice().filter(
|
|
133
|
+
(t) => t.totalAmount !== 0 && !t.isTransfer && t.guid !== E.INVESTMENTS
|
|
134
|
+
).sort((t, o) => Math.abs(o.totalAmount) - Math.abs(t.totalAmount));
|
|
135
|
+
class it {
|
|
136
|
+
globalStore;
|
|
137
|
+
selectedCategoryData = null;
|
|
138
|
+
selectedDateRange;
|
|
139
|
+
visibleListLength = 5;
|
|
140
|
+
constructor(t) {
|
|
141
|
+
this.globalStore = t, this.selectedDateRange = {
|
|
142
|
+
start: v(_(I(/* @__PURE__ */ new Date(), 6)), 1),
|
|
143
|
+
end: _(/* @__PURE__ */ new Date())
|
|
144
|
+
}, N(this);
|
|
145
|
+
}
|
|
146
|
+
setSelectedCategoryData = (t) => {
|
|
147
|
+
this.selectedCategoryData = t;
|
|
148
|
+
};
|
|
149
|
+
setSelectedDateRange = (t) => {
|
|
150
|
+
this.selectedDateRange = t;
|
|
151
|
+
};
|
|
152
|
+
setVisibleListLength = (t) => {
|
|
153
|
+
this.visibleListLength = t;
|
|
154
|
+
};
|
|
155
|
+
get sortedDetailedCategoriesWithTransactions() {
|
|
156
|
+
return k(
|
|
157
|
+
this.globalStore.categoryStore.detailedCategoriesWithTransactions
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
get selectedDateRangeMonthCount() {
|
|
161
|
+
return w(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
162
|
+
}
|
|
163
|
+
get selectedDateRangeMonthRange() {
|
|
164
|
+
const t = L(this.selectedDateRange.start, M.MONTH_LONG), o = L(this.selectedDateRange.end, M.MONTH_LONG);
|
|
165
|
+
return `${t} - ${o}`;
|
|
166
|
+
}
|
|
167
|
+
get visibleCategories() {
|
|
168
|
+
return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
|
|
169
|
+
}
|
|
170
|
+
get collapsedCategories() {
|
|
171
|
+
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
172
|
+
}
|
|
173
|
+
get categoryDetailsChartData() {
|
|
174
|
+
return j(
|
|
175
|
+
this.selectedCategoryData,
|
|
176
|
+
this.selectedDateRangeMonthCount
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
rt as L,
|
|
182
|
+
it as T,
|
|
183
|
+
nt as a,
|
|
184
|
+
st as c,
|
|
185
|
+
at as g
|
|
186
|
+
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import A from "react";
|
|
3
|
-
import { css as
|
|
3
|
+
import { css as p } from "@mxenabled/cssinjs";
|
|
4
4
|
import { addDays as b } from "date-fns/addDays";
|
|
5
|
-
import { addMonths as
|
|
6
|
-
import { eachDayOfInterval as
|
|
7
|
-
import { eachWeekOfInterval as
|
|
8
|
-
import { endOfMonth as
|
|
9
|
-
import { format as
|
|
10
|
-
import { isBefore as
|
|
11
|
-
import { isSameMonth as
|
|
12
|
-
import { startOfMonth as
|
|
5
|
+
import { addMonths as B } from "date-fns/addMonths";
|
|
6
|
+
import { eachDayOfInterval as P } from "date-fns/eachDayOfInterval";
|
|
7
|
+
import { eachWeekOfInterval as $ } from "date-fns/eachWeekOfInterval";
|
|
8
|
+
import { endOfMonth as U } from "date-fns/endOfMonth";
|
|
9
|
+
import { format as y } from "date-fns/format";
|
|
10
|
+
import { isBefore as j } from "date-fns/isBefore";
|
|
11
|
+
import { isSameMonth as W } from "date-fns/isSameMonth";
|
|
12
|
+
import { startOfMonth as V } from "date-fns/startOfMonth";
|
|
13
13
|
import { startOfToday as f } from "date-fns/startOfToday";
|
|
14
|
-
import { subMonths as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { H2 as
|
|
18
|
-
import { ChevronLeft as
|
|
19
|
-
import { f as
|
|
14
|
+
import { subMonths as F } from "date-fns/subMonths";
|
|
15
|
+
import E from "@mui/material/Button";
|
|
16
|
+
import Y from "@mui/material/Paper";
|
|
17
|
+
import { useTokens as v, H2 as z, Text as G } from "@mxenabled/mxui";
|
|
18
|
+
import { ChevronLeft as X, ChevronRight as Z } from "@mxenabled/mx-icons";
|
|
19
|
+
import { f as q, a as J } from "./Dialog-BPTr3qHE.mjs";
|
|
20
20
|
import { isSameDay as T } from "date-fns/isSameDay";
|
|
21
|
-
import { isWithinInterval as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import { g as
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ e(
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
/* @__PURE__ */ e(
|
|
21
|
+
import { isWithinInterval as Q } from "date-fns/isWithinInterval";
|
|
22
|
+
import nn from "@mui/material/styles/useTheme";
|
|
23
|
+
import k from "@mui/material/ListItem";
|
|
24
|
+
import an from "@mui/material/ListItemButton";
|
|
25
|
+
import { g as tn } from "./hooks-ZMp65DFz.mjs";
|
|
26
|
+
var on = /* @__PURE__ */ ((n) => (n[n.CREDIT = 1] = "CREDIT", n[n.DEBIT = 2] = "DEBIT", n))(on || {}), en = /* @__PURE__ */ ((n) => (n[n.POSTED = 1] = "POSTED", n[n.PENDING = 2] = "PENDING", n))(en || {});
|
|
27
|
+
const rn = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
|
|
28
|
+
const c = v(), l = cn(c);
|
|
29
|
+
return /* @__PURE__ */ h("div", { className: `mx-cmn-calendar-header ${l}`, children: [
|
|
30
|
+
/* @__PURE__ */ e(z, { className: "mx-cmn-calendar-header-title", variant: "H3", children: q(a, J.MONTH_YEAR) }),
|
|
31
|
+
/* @__PURE__ */ h("div", { className: "mx-cmn-calendar-header-button-container", children: [
|
|
32
|
+
/* @__PURE__ */ e(E, { "aria-label": n.prevAria, onClick: r, children: /* @__PURE__ */ e(X, { size: 24 }) }),
|
|
33
|
+
/* @__PURE__ */ e(E, { "aria-label": n.nextAria, onClick: o, children: /* @__PURE__ */ e(Z, { size: 24 }) })
|
|
34
34
|
] })
|
|
35
35
|
] });
|
|
36
|
-
},
|
|
36
|
+
}, cn = (n) => p({
|
|
37
37
|
alignItems: "center",
|
|
38
38
|
display: "flex",
|
|
39
|
-
marginBottom:
|
|
40
|
-
marginRight: -
|
|
41
|
-
paddingLeft:
|
|
39
|
+
marginBottom: n.Spacing.Medium,
|
|
40
|
+
marginRight: -n.Spacing.Medium,
|
|
41
|
+
paddingLeft: n.Spacing.XSmall,
|
|
42
42
|
"& .mx-cmn-calendar-header-title": {
|
|
43
43
|
flexGrow: 1
|
|
44
44
|
},
|
|
@@ -46,44 +46,44 @@ const on = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
|
|
|
46
46
|
display: "flex",
|
|
47
47
|
gap: 4
|
|
48
48
|
}
|
|
49
|
-
}),
|
|
50
|
-
const
|
|
49
|
+
}), sn = ({ beginDate: n, date: a, endDate: o, isInMonth: r, onClick: c }) => {
|
|
50
|
+
const l = nn(), S = Tn(l), g = n && o && Q(a, { start: n, end: o }) && !T(a, n) && !T(a, o), s = n && o && T(n, a) && !T(n, o), N = o && n && T(o, a) && !T(n, o), i = n && T(n, a) || o && T(o, a), C = T(a, f());
|
|
51
51
|
return /* @__PURE__ */ e(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
54
|
className: `
|
|
55
55
|
mx-cmn-calendar-day
|
|
56
|
-
${
|
|
56
|
+
${S}
|
|
57
57
|
${r ? "" : "mx-cmn-out-of-month"}
|
|
58
|
-
${
|
|
58
|
+
${g ? "mx-cmn-date-interval" : ""}
|
|
59
59
|
`,
|
|
60
60
|
children: /* @__PURE__ */ e(
|
|
61
|
-
|
|
61
|
+
E,
|
|
62
62
|
{
|
|
63
63
|
className: `
|
|
64
64
|
mx-cmn-calendar-day-button
|
|
65
|
-
${
|
|
66
|
-
${
|
|
65
|
+
${s ? "mx-cmn-range-start" : ""}
|
|
66
|
+
${N ? "mx-cmn-range-end" : ""}
|
|
67
67
|
`,
|
|
68
|
-
color:
|
|
69
|
-
onClick: () =>
|
|
70
|
-
variant:
|
|
68
|
+
color: i ? "primary" : "secondary",
|
|
69
|
+
onClick: () => c(a),
|
|
70
|
+
variant: i ? "contained" : "text",
|
|
71
71
|
children: /* @__PURE__ */ e(
|
|
72
|
-
|
|
72
|
+
G,
|
|
73
73
|
{
|
|
74
74
|
className: `
|
|
75
75
|
mx-cmn-calendar-day-text
|
|
76
|
-
${
|
|
77
|
-
${
|
|
78
|
-
variant: "
|
|
79
|
-
children:
|
|
76
|
+
${i ? "mx-cmn-day-selected" : ""}
|
|
77
|
+
${C ? "mx-cmn-today" : ""}`,
|
|
78
|
+
variant: "Small",
|
|
79
|
+
children: y(a, "d")
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
},
|
|
86
|
+
}, Tn = (n) => p({
|
|
87
87
|
height: I,
|
|
88
88
|
width: I,
|
|
89
89
|
display: "flex",
|
|
@@ -128,72 +128,72 @@ const on = ({ copy: n, date: a, onNextClick: o, onPreviousClick: r }) => {
|
|
|
128
128
|
paddingBottom: 5
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
}),
|
|
132
|
-
var
|
|
133
|
-
const
|
|
131
|
+
}), ln = 340, I = 44;
|
|
132
|
+
var Cn = /* @__PURE__ */ ((n) => (n.None = "None", n.Single = "Single", n.Range = "Range", n))(Cn || {});
|
|
133
|
+
const Nn = ({
|
|
134
134
|
copy: n,
|
|
135
135
|
beginDate: a = void 0,
|
|
136
136
|
endDate: o = void 0,
|
|
137
137
|
onDateSelected: r,
|
|
138
|
-
onRangeSelected:
|
|
139
|
-
selectionType:
|
|
138
|
+
onRangeSelected: c,
|
|
139
|
+
selectionType: l = "Single"
|
|
140
140
|
/* Single */
|
|
141
141
|
}) => {
|
|
142
|
-
const
|
|
142
|
+
const S = v(), g = mn(S), [s, N] = A.useState(f), [i, C] = A.useState(a), [R, _] = A.useState(o);
|
|
143
143
|
A.useEffect(() => {
|
|
144
|
-
|
|
144
|
+
C(a), _(o), a && N(a);
|
|
145
145
|
}, [a, o]);
|
|
146
|
-
const
|
|
147
|
-
const t =
|
|
146
|
+
const D = A.useMemo(() => {
|
|
147
|
+
const t = $({ start: V(s), end: U(s) }), m = [];
|
|
148
148
|
for (let d = 0; d < t.length; d++) {
|
|
149
|
-
const
|
|
150
|
-
for (let
|
|
151
|
-
x.push(
|
|
152
|
-
|
|
149
|
+
const O = t[d], u = P({ start: O, end: b(O, 6) }), x = [];
|
|
150
|
+
for (let L = 0; L < u.length; L++)
|
|
151
|
+
x.push(u[L]);
|
|
152
|
+
m.push(x);
|
|
153
153
|
}
|
|
154
|
-
return
|
|
155
|
-
}, [
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
158
|
-
|
|
154
|
+
return m;
|
|
155
|
+
}, [s]), K = (t) => {
|
|
156
|
+
if (l !== "None") {
|
|
157
|
+
if (l === "Single") {
|
|
158
|
+
C(t), r?.(t);
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
!
|
|
161
|
+
!i || R ? (C(t), _(void 0)) : j(t, i) ? (_(i), C(t), c?.(t, i)) : (_(t), c?.(i, t));
|
|
162
162
|
}
|
|
163
|
-
}, G = () => {
|
|
164
|
-
const t = f();
|
|
165
|
-
N(t), C !== "None" && (s(t), C === "Single" ? r?.(t) : (m(t), i?.(t, t)));
|
|
166
|
-
}, K = () => {
|
|
167
|
-
N(w(c, 1));
|
|
168
163
|
}, M = () => {
|
|
169
|
-
|
|
164
|
+
const t = f();
|
|
165
|
+
N(t), l !== "None" && (C(t), l === "Single" ? r?.(t) : (_(t), c?.(t, t)));
|
|
166
|
+
}, w = () => {
|
|
167
|
+
N(B(s, 1));
|
|
168
|
+
}, H = () => {
|
|
169
|
+
N(F(s, 1));
|
|
170
170
|
};
|
|
171
|
-
return /* @__PURE__ */ e("div", { className: `mx-cmn-calendar ${
|
|
171
|
+
return /* @__PURE__ */ e("div", { className: `mx-cmn-calendar ${g}`, children: /* @__PURE__ */ h(Y, { sx: { boxShadow: "none" }, children: [
|
|
172
172
|
/* @__PURE__ */ e(
|
|
173
|
-
|
|
173
|
+
rn,
|
|
174
174
|
{
|
|
175
175
|
copy: n,
|
|
176
|
-
date:
|
|
177
|
-
onNextClick:
|
|
178
|
-
onPreviousClick:
|
|
176
|
+
date: s,
|
|
177
|
+
onNextClick: w,
|
|
178
|
+
onPreviousClick: H
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
/* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-row", children:
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
/* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-row", children: D[0].map((t, m) => /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-header-cell", children: /* @__PURE__ */ e(G, { bold: !0, variant: "Small", children: y(t, "EEEEE") }) }, m)) }),
|
|
182
|
+
D.map((t, m) => /* @__PURE__ */ e("div", { className: "mx-cmn-calendar-week", children: t.map((d, O) => /* @__PURE__ */ e(
|
|
183
|
+
sn,
|
|
184
184
|
{
|
|
185
|
-
beginDate:
|
|
185
|
+
beginDate: i,
|
|
186
186
|
date: d,
|
|
187
|
-
endDate:
|
|
188
|
-
isInMonth:
|
|
189
|
-
onClick:
|
|
187
|
+
endDate: R,
|
|
188
|
+
isInMonth: W(d, s),
|
|
189
|
+
onClick: K
|
|
190
190
|
},
|
|
191
|
-
|
|
192
|
-
)) }, `w-${
|
|
193
|
-
/* @__PURE__ */ e("div", { className: "mx-cmn-calendar-today-container", children: /* @__PURE__ */ e(
|
|
191
|
+
O
|
|
192
|
+
)) }, `w-${m}`)),
|
|
193
|
+
/* @__PURE__ */ e("div", { className: "mx-cmn-calendar-today-container", children: /* @__PURE__ */ e(E, { onClick: M, size: "small", variant: "text", children: n.today }) })
|
|
194
194
|
] }) });
|
|
195
|
-
},
|
|
196
|
-
width:
|
|
195
|
+
}, mn = (n) => p({
|
|
196
|
+
width: ln,
|
|
197
197
|
"& .MuiPaper-root": {
|
|
198
198
|
paddingLeft: 24,
|
|
199
199
|
paddingRight: 24,
|
|
@@ -224,7 +224,7 @@ const bn = ({
|
|
|
224
224
|
},
|
|
225
225
|
"& .mx-cmn-calendar-today-container": {
|
|
226
226
|
display: "block",
|
|
227
|
-
marginTop:
|
|
227
|
+
marginTop: n.Spacing.Medium,
|
|
228
228
|
textAlign: "center",
|
|
229
229
|
width: "100%",
|
|
230
230
|
"& > .MuiButton-root": {
|
|
@@ -233,23 +233,23 @@ const bn = ({
|
|
|
233
233
|
marginRight: "auto"
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
}),
|
|
236
|
+
}), Bn = Nn, Pn = ({
|
|
237
237
|
children: n,
|
|
238
238
|
clickEventName: a,
|
|
239
239
|
onClick: o,
|
|
240
240
|
sx: r = {}
|
|
241
241
|
}) => {
|
|
242
|
-
const { onEvent:
|
|
243
|
-
return o ? /* @__PURE__ */ e(
|
|
244
|
-
|
|
242
|
+
const { onEvent: c } = tn();
|
|
243
|
+
return o ? /* @__PURE__ */ e(k, { sx: { bgcolor: "background.paper", ...r }, children: /* @__PURE__ */ e(
|
|
244
|
+
an,
|
|
245
245
|
{
|
|
246
246
|
onClick: () => {
|
|
247
|
-
a &&
|
|
247
|
+
a && c(a), o();
|
|
248
248
|
},
|
|
249
249
|
children: n
|
|
250
250
|
}
|
|
251
251
|
) }) : /* @__PURE__ */ e(
|
|
252
|
-
|
|
252
|
+
k,
|
|
253
253
|
{
|
|
254
254
|
disableGutters: !1,
|
|
255
255
|
disablePadding: !1,
|
|
@@ -257,7 +257,7 @@ const bn = ({
|
|
|
257
257
|
children: n
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
|
-
},
|
|
260
|
+
}, $n = {
|
|
261
261
|
ON_TRANSACTION_CATEGORY_CLICK: "onTransactionCategoryClick",
|
|
262
262
|
ON_TRANSACTION_CATEGORY_CHANGED: "onTransactionCategoryChanged",
|
|
263
263
|
ON_TRANSACTION_MANUAL_ADD_CLICK: "onTransactionManualAddClick",
|
|
@@ -301,13 +301,13 @@ const bn = ({
|
|
|
301
301
|
ON_TRANSACTION_UNHIDE_CANCEL_CLICK: "onTransactionUnHideCancelClick",
|
|
302
302
|
ON_TRANSACTION_UNSPLIT: "onTransactionUnsplit",
|
|
303
303
|
ON_TRANSACTION_UNSPLIT_CANCEL: "onTransactionUnsplitCancel"
|
|
304
|
-
},
|
|
304
|
+
}, Un = (n, a) => !!n.find((o) => o.feature_name === a)?.is_enabled;
|
|
305
305
|
export {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
306
|
+
Bn as C,
|
|
307
|
+
Pn as L,
|
|
308
|
+
$n as O,
|
|
309
|
+
on as T,
|
|
310
|
+
en as a,
|
|
311
|
+
Cn as b,
|
|
312
|
+
Un as i
|
|
313
313
|
};
|