@mx-cartographer/experiences 7.0.0-alpha.mega1 → 7.0.0
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 +17 -0
- package/dist/{Account-DY6nxO7y.mjs → Account-BFol-JYA.mjs} +1 -1
- package/dist/{AccountDetailsContent-DvPs81kL.mjs → AccountDetailsContent-Do3z1FnQ.mjs} +8 -8
- package/dist/{AccountDetailsHeader-W2U7ZVm_.mjs → AccountDetailsHeader-DnEyQMpX.mjs} +12 -12
- package/dist/{AccountFields-DAVcbZy5.mjs → AccountFields-CeHZrIQe.mjs} +2 -2
- package/dist/{AccountListItem-DFlbdcmT.mjs → AccountListItem-C7JzYpqf.mjs} +3 -3
- package/dist/{AccountStore-CU7qV3vg.mjs → AccountStore-Cu3GoLh-.mjs} +1 -1
- package/dist/{Accounts-BLlrQA5m.mjs → Accounts-BuYXUMhP.mjs} +1 -1
- package/dist/{BudgetUtil-Ci1TN0J5.mjs → BudgetUtil-spowPvBM.mjs} +2 -2
- package/dist/{Category-5S6uwuXz.mjs → Category-CevNQ03n.mjs} +4 -4
- package/dist/{CategorySelectorDrawer-rHyHHYuh.mjs → CategorySelectorDrawer-Dyzb3UDU.mjs} +1 -1
- package/dist/{CategoryStore-B5EW6I1d.mjs → CategoryStore-BOyzQjQp.mjs} +2 -2
- package/dist/{CategoryUtil-DRyruNgi.mjs → CategoryUtil-BR3H5i6n.mjs} +1 -1
- package/dist/{ConnectDrawer-D9cR5phc.mjs → ConnectDrawer-WfKHsHSF.mjs} +1 -1
- package/dist/{ConnectionsDrawer-BzGqljSp.mjs → ConnectionsDrawer-Czp-E0-m.mjs} +2 -2
- package/dist/{CurrencyInput-D74cemI2.mjs → CurrencyInput-CSZjO22Z.mjs} +1 -1
- package/dist/{DebtsStore-S0l9kr0r.mjs → DebtsStore-D9holN8L.mjs} +1 -1
- package/dist/ExportCsvAction-dpvaZxbS.mjs +24 -0
- package/dist/{GoalStore-DioeeL-s.mjs → GoalStore-Drf76ell.mjs} +4 -4
- package/dist/{Help-DpYRO8oA.mjs → Help-DRUwVDvo.mjs} +1 -1
- package/dist/{LineChart-CcyX38kK.mjs → LineChart-CYiUS-px.mjs} +88 -85
- package/dist/{ListItemAction-BabpYivr.mjs → ListItemAction-BzmbPuNp.mjs} +1 -1
- package/dist/{ManageIncome-ndMuhJMG.mjs → ManageIncome-B6kmMN_z.mjs} +178 -186
- package/dist/{MicroWidgetContainer-CsvHLYKX.mjs → MicroWidgetContainer-DmYiksbT.mjs} +1 -1
- package/dist/{MiniWidgetContainer-BoOp-A05.mjs → MiniWidgetContainer-DqKQNubH.mjs} +1 -1
- package/dist/{NetWorthStore-PD-RUe09.mjs → NetWorthStore-BK1_NbXW.mjs} +2 -2
- package/dist/{Notification-AMGWM1Al.mjs → Notification-ByMBpJ5u.mjs} +33 -22
- package/dist/{NotificationSettings-VhHuMAFU.mjs → NotificationSettings-BznqGVQ2.mjs} +35 -34
- package/dist/{OriginalBalanceAction-D39mx6uE.mjs → OriginalBalanceAction-CSu5brQE.mjs} +3 -3
- package/dist/RecurringSettings-Be1dzkMz.mjs +57 -0
- package/dist/ResponsiveButton-DZFp78fJ.mjs +45 -0
- package/dist/{SettingsStore-CE7jDVFL.mjs → SettingsStore-B4gi6oOw.mjs} +1 -1
- package/dist/{SpendingData-BkrxzHdr.mjs → SpendingData-D5vsfYKo.mjs} +5 -5
- package/dist/{Transaction-CA0FW2Ij.mjs → Transaction-CyqrHmAA.mjs} +1 -1
- package/dist/{TransactionDetails-WBHFmbxL.mjs → TransactionDetails-D4B9DSWo.mjs} +421 -417
- package/dist/{TransactionStore-CeLdmVnC.mjs → TransactionStore-DSyXtPek.mjs} +8 -8
- package/dist/TrendsStore-DR8etTL2.mjs +547 -0
- package/dist/{ViewMoreMicroCard-CAPFNz-J.mjs → ViewMoreMicroCard-BZI5VMNW.mjs} +476 -468
- package/dist/{WidgetContainer-DWCusxYI.mjs → WidgetContainer-BG-fdDOf.mjs} +110 -104
- package/dist/accounts/index.es.js +12 -12
- package/dist/analytics/index.es.js +8 -8
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/index.es.js +7 -7
- package/dist/categories/index.es.js +2 -2
- package/dist/common/components/WidgetContainer.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +1 -0
- package/dist/common/components/index.d.ts +1 -0
- package/dist/common/components/listitems/ToggleButtonListItem.d.ts +2 -1
- package/dist/common/constants/Analytics.d.ts +16 -10
- package/dist/common/index.es.js +432 -469
- package/dist/dashboard/index.es.js +13 -13
- package/dist/debts/index.es.js +66 -66
- package/dist/{exportTransactionsToCSV-CmwsKl2D.mjs → exportTransactionsToCSV-BlVifaOG.mjs} +2 -2
- package/dist/finstrong/index.es.js +6 -6
- package/dist/goals/index.es.js +32 -32
- package/dist/help/index.es.js +3 -3
- package/dist/{hooks-30y_BLwc.mjs → hooks-02T565vf.mjs} +10 -10
- package/dist/investments/index.es.js +3 -3
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +1 -0
- package/dist/microinsights/components/microBeatCarousel/MicroBeatCarousel.d.ts +1 -0
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +7 -7
- package/dist/notifications/index.es.js +9 -9
- package/dist/recurringtransactions/index.es.js +8 -8
- package/dist/settings/index.es.js +25 -25
- package/dist/spending/index.es.js +13 -13
- package/dist/transactions/components/shared/TransactionList.d.ts +2 -0
- package/dist/transactions/components/transactionwidget/actions/ExportCsvAction.d.ts +5 -1
- package/dist/transactions/index.d.ts +1 -0
- package/dist/transactions/index.es.js +143 -141
- package/dist/trends/constants/TrendsWidget.d.ts +3 -0
- package/dist/trends/index.es.js +576 -635
- package/package.json +1 -1
- package/dist/RecurringSettings-D_HnMYZP.mjs +0 -57
- package/dist/TrendsStore-BHJUapXF.mjs +0 -487
- package/dist/index.d.ts +0 -0
- package/dist/trends/components/TransactionsList.d.ts +0 -7
@@ -3,50 +3,50 @@ import d from "react";
|
|
3
3
|
import { observer as b } from "mobx-react-lite";
|
4
4
|
import { useVirtualizer as ve } from "@tanstack/react-virtual";
|
5
5
|
import E from "@mui/material/Box";
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { MerchantLogo as
|
9
|
-
import
|
10
|
-
import
|
6
|
+
import ne from "@mui/material/Divider";
|
7
|
+
import ae from "@mui/material/List";
|
8
|
+
import { MerchantLogo as pe, Icon as f, Text as S, useTokens as J, CategoryIcon as Ce, CategoryIconVariants as we, IconWeight as L, P as ie, H1 as fe, TextField as ge } from "@mxenabled/mxui";
|
9
|
+
import H from "@mui/material/ListItemAvatar";
|
10
|
+
import $ from "@mui/material/ListItemText";
|
11
11
|
import C from "@mui/material/Stack";
|
12
|
-
import { T as Le, L as Re, O as g, C as ke, b as Pe } from "./Transaction-
|
13
|
-
import { G as Ge,
|
14
|
-
import { f as
|
12
|
+
import { T as Le, L as Re, O as g, C as ke, b as Pe } from "./Transaction-CyqrHmAA.mjs";
|
13
|
+
import { G as Ge, f as v, u as x, e as w, l as be, a as Me } from "./hooks-02T565vf.mjs";
|
14
|
+
import { f as Q } from "./NumberFormatting-CtWHhyBX.mjs";
|
15
15
|
import Ke from "@mui/icons-material/ReceiptOutlined";
|
16
|
-
import { fromUnixTime as
|
17
|
-
import { isSameDay as
|
16
|
+
import { fromUnixTime as Y } from "date-fns/fromUnixTime";
|
17
|
+
import { isSameDay as Ae } from "date-fns/isSameDay";
|
18
18
|
import { h as $e } from "./DateUtil-BcuH7ErC.mjs";
|
19
|
-
import { L as
|
20
|
-
import { A as
|
21
|
-
import
|
22
|
-
import
|
19
|
+
import { L as Ie } from "./Loader-Dp1P2gNw.mjs";
|
20
|
+
import { A as P } from "./WidgetContainer-BG-fdDOf.mjs";
|
21
|
+
import ee from "@mui/material/Paper";
|
22
|
+
import se from "@mui/material/Button";
|
23
23
|
import Fe from "@mui/material/FormGroup";
|
24
|
-
import
|
25
|
-
import
|
24
|
+
import Z from "@mui/material/IconButton";
|
25
|
+
import Ne from "@mui/material/TextField";
|
26
26
|
import He from "@mui/icons-material/FlagOutlined";
|
27
27
|
import ze from "@mui/material/ToggleButton";
|
28
|
-
import
|
29
|
-
import
|
30
|
-
import
|
31
|
-
import
|
32
|
-
import
|
33
|
-
import { a as
|
34
|
-
import { a as
|
35
|
-
import { b as
|
28
|
+
import xe from "@mui/material/styles/useTheme";
|
29
|
+
import V from "@mui/material/Avatar";
|
30
|
+
import z from "@mui/material/ListItem";
|
31
|
+
import B from "@mui/material/ListItemButton";
|
32
|
+
import U from "@mui/material/ListItemIcon";
|
33
|
+
import { a as Oe } from "./CategorySelectorDrawer-Dyzb3UDU.mjs";
|
34
|
+
import { a as X, f as Be, D as Ue } from "./Dialog-CWW597AF.mjs";
|
35
|
+
import { b as re } from "./Localization-2MODESHW.mjs";
|
36
36
|
import { getUnixTime as Xe } from "date-fns/getUnixTime";
|
37
|
-
import { D as
|
37
|
+
import { D as le } from "./Drawer-kEE73B87.mjs";
|
38
38
|
import Ve from "@mui/icons-material/HighlightOff";
|
39
39
|
import We from "@mui/icons-material/Search";
|
40
|
-
import
|
41
|
-
import
|
40
|
+
import he from "@mui/material/InputAdornment";
|
41
|
+
import oe from "@mui/icons-material/DeleteOutlined";
|
42
42
|
import Ye from "@mui/icons-material/Edit";
|
43
43
|
import je from "@mui/material/Checkbox";
|
44
|
-
import
|
45
|
-
import
|
44
|
+
import me from "@mui/icons-material/Cancel";
|
45
|
+
import ue from "@mui/material/Grid";
|
46
46
|
import qe from "@mui/icons-material/ChevronRight";
|
47
|
-
import { C as Ze } from "./CurrencyInput-
|
47
|
+
import { C as Ze } from "./CurrencyInput-CSZjO22Z.mjs";
|
48
48
|
import Je from "@mui/material/Switch";
|
49
|
-
var
|
49
|
+
var q = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(q || {}), te = /* @__PURE__ */ ((t) => (t[t.SplitTransaction = 0] = "SplitTransaction", t[t.HideTransaction = 1] = "HideTransaction", t[t.MerchantLogo = 2] = "MerchantLogo", t))(te || {});
|
50
50
|
const Qe = [
|
51
51
|
0,
|
52
52
|
1,
|
@@ -58,7 +58,7 @@ const Qe = [
|
|
58
58
|
1,
|
59
59
|
2
|
60
60
|
/* MerchantLogo */
|
61
|
-
],
|
61
|
+
], G = () => {
|
62
62
|
if (!d.useContext(Ge))
|
63
63
|
throw new Error("useTransactionsUiStore() must be used within the GlobalDataContext");
|
64
64
|
return v().uiStore;
|
@@ -67,8 +67,8 @@ function tt() {
|
|
67
67
|
return window.opener && window.opener.location ? window.opener.location.toString() : document.referrer;
|
68
68
|
}
|
69
69
|
function nt(t) {
|
70
|
-
const
|
71
|
-
return n && n.postMessage &&
|
70
|
+
const r = tt().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), n = window.parent || window.opener || !1;
|
71
|
+
return n && n.postMessage && r ? (n.postMessage(t, r), !0) : !1;
|
72
72
|
}
|
73
73
|
function at(t) {
|
74
74
|
return nt({
|
@@ -77,25 +77,25 @@ function at(t) {
|
|
77
77
|
type: "mx/moneyDashboard/insightOnTransaction"
|
78
78
|
});
|
79
79
|
}
|
80
|
-
const rt = ({ transaction: t, onClick:
|
81
|
-
const { associatedBeats: n } = v(), { expandedSplits: s } =
|
80
|
+
const rt = ({ transaction: t, onClick: r }) => {
|
81
|
+
const { associatedBeats: n } = v(), { expandedSplits: s } = G(), { transactions: o } = x(), { showInsights: a } = G(), i = t.transaction_type === Le.CREDIT, l = d.useMemo(() => n.find((_) => _.associated_transaction_guid === t.guid), [n, t]);
|
82
82
|
return (
|
83
83
|
//TODO: implement common/components/ListItemRow.tsx
|
84
84
|
/* @__PURE__ */ c(
|
85
85
|
Re,
|
86
86
|
{
|
87
87
|
clickEventName: g.ON_TRANSACTION_LIST_ITEM_CLICK,
|
88
|
-
onClick:
|
88
|
+
onClick: r ? () => r(t.guid) : void 0,
|
89
89
|
children: [
|
90
|
-
/* @__PURE__ */ e(
|
91
|
-
|
90
|
+
/* @__PURE__ */ e(H, { children: t.parent_guid && s.includes(t.parent_guid) ? /* @__PURE__ */ e(d.Fragment, {}) : /* @__PURE__ */ e(
|
91
|
+
pe,
|
92
92
|
{
|
93
93
|
categoryGuid: t.top_level_category_guid || "",
|
94
94
|
merchantGuid: t.merchant_guid || ""
|
95
95
|
}
|
96
96
|
) }),
|
97
97
|
/* @__PURE__ */ e(
|
98
|
-
|
98
|
+
$,
|
99
99
|
{
|
100
100
|
disableTypography: !0,
|
101
101
|
secondary: /* @__PURE__ */ c(C, { direction: "row", justifyContent: "space-between", children: [
|
@@ -103,10 +103,10 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
103
103
|
t.is_flagged && /* @__PURE__ */ e(f, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
|
104
104
|
t.is_hidden && /* @__PURE__ */ e(f, { name: "visibility_off", size: 16 }),
|
105
105
|
t.has_been_split && /* @__PURE__ */ e(f, { name: "call_split", size: 16 }),
|
106
|
-
/* @__PURE__ */ e(
|
106
|
+
/* @__PURE__ */ e(S, { variant: "XSmall", children: t.has_been_split ? o.split_transaction_category_label : t.category })
|
107
107
|
] }),
|
108
108
|
l && a && /* @__PURE__ */ e(
|
109
|
-
|
109
|
+
S,
|
110
110
|
{
|
111
111
|
bold: !0,
|
112
112
|
color: "action.active",
|
@@ -119,12 +119,12 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
119
119
|
)
|
120
120
|
] }),
|
121
121
|
children: /* @__PURE__ */ c(C, { direction: "row", justifyContent: "space-between", sx: { gap: 8 }, children: [
|
122
|
-
/* @__PURE__ */ c(
|
123
|
-
t.is_hidden &&
|
122
|
+
/* @__PURE__ */ c(S, { bold: !0, variant: "Body", children: [
|
123
|
+
t.is_hidden && o.hide_trnx_cancel_hidden_note,
|
124
124
|
t.payee || t.description || t.feed_description
|
125
125
|
] }),
|
126
126
|
/* @__PURE__ */ c(
|
127
|
-
|
127
|
+
S,
|
128
128
|
{
|
129
129
|
bold: !0,
|
130
130
|
color: i ? "success.main" : "text.primary",
|
@@ -132,7 +132,7 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
132
132
|
variant: "Body",
|
133
133
|
children: [
|
134
134
|
i ? "+" : "",
|
135
|
-
|
135
|
+
Q(t.amount, "0,0.00")
|
136
136
|
]
|
137
137
|
}
|
138
138
|
)
|
@@ -145,115 +145,119 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
145
145
|
);
|
146
146
|
}, ot = b(rt), it = ({
|
147
147
|
bgcolor: t = "background.default",
|
148
|
-
children:
|
149
|
-
}) => /* @__PURE__ */ e(E, { display: "inline-block", pb: 4, pl: 24, pt: 4, sx: { bgcolor: t }, children: /* @__PURE__ */ e(
|
150
|
-
const n =
|
148
|
+
children: r
|
149
|
+
}) => /* @__PURE__ */ e(E, { display: "inline-block", pb: 4, pl: 24, pt: 4, sx: { bgcolor: t }, children: /* @__PURE__ */ e(S, { bold: !0, variant: "XSmall", children: r }) }), st = ({ showIcon: t = !0, showSubtitle: r = !0 }) => {
|
150
|
+
const n = J(), { transactions: s } = x();
|
151
151
|
return /* @__PURE__ */ c(C, { alignItems: "center", gap: n.Spacing.Small, height: "auto", mt: n.Spacing.Large, children: [
|
152
152
|
t && /* @__PURE__ */ e(Ke, { color: "secondary", sx: { fontSize: 32 } }),
|
153
|
-
/* @__PURE__ */ e(
|
154
|
-
|
153
|
+
/* @__PURE__ */ e(S, { bold: !0, color: "secondary", variant: "Small", children: s.zero_state_no_transactions }),
|
154
|
+
r && /* @__PURE__ */ e(S, { color: "secondary", variant: "XSmall", children: s.zero_state_there_are_no_transactions })
|
155
155
|
] });
|
156
|
-
}, lt = b(st),
|
157
|
-
const n =
|
158
|
-
return !
|
159
|
-
}, ct = (t,
|
160
|
-
const n =
|
161
|
-
return
|
162
|
-
},
|
156
|
+
}, lt = b(st), Te = (t, r) => {
|
157
|
+
const n = Y(r[t].date), s = Y(r[t - 1]?.date);
|
158
|
+
return !Ae(n, s);
|
159
|
+
}, ct = (t, r) => {
|
160
|
+
const n = Y(r[t].date), s = Y(r[t + 1]?.date);
|
161
|
+
return Ae(n, s);
|
162
|
+
}, Se = 65, ye = 34, dt = ({
|
163
163
|
bgcolor: t,
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
164
|
+
filter: r,
|
165
|
+
height: n = "calc(100dvh - 36px)",
|
166
|
+
loader: s = /* @__PURE__ */ e(Ie, { label: "Loading", size: 40 }),
|
167
|
+
onClick: o,
|
168
|
+
showInsights: a = !1,
|
169
|
+
showLoader: i = !1,
|
170
|
+
showHiddenTransactions: l = !1,
|
171
|
+
width: _ = "100%",
|
172
|
+
zeroState: u = /* @__PURE__ */ e(lt, {})
|
172
173
|
}) => {
|
173
|
-
const { isLoading:
|
174
|
-
const
|
175
|
-
|
176
|
-
|
174
|
+
const { isLoading: m, sortedTransactions: p } = v(), h = d.useMemo(() => {
|
175
|
+
const N = r ? p.filter(r) : p;
|
176
|
+
return l ? N : N.filter((k) => !k.is_hidden);
|
177
|
+
}, [p, l]), { clearExpandedSplits: A, setShowInsights: T, toggleSplit: I } = G(), { onEvent: y } = w(), R = (N) => {
|
178
|
+
const k = h.find((W) => W.guid === N);
|
179
|
+
if (k?.has_been_split) {
|
180
|
+
I(k.guid);
|
177
181
|
return;
|
178
182
|
}
|
179
|
-
|
180
|
-
account_guid:
|
181
|
-
transaction_guid:
|
182
|
-
}),
|
183
|
-
},
|
184
|
-
count:
|
185
|
-
getScrollElement: () =>
|
186
|
-
estimateSize: (
|
183
|
+
y(P.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
|
184
|
+
account_guid: k?.account_guid,
|
185
|
+
transaction_guid: N
|
186
|
+
}), o?.(N);
|
187
|
+
}, M = d.useRef(null), K = ve({
|
188
|
+
count: h.length,
|
189
|
+
getScrollElement: () => M.current,
|
190
|
+
estimateSize: (N) => Se + (Te(N, h) ? ye : 0),
|
187
191
|
overscan: 5
|
188
192
|
});
|
189
|
-
return d.useEffect(() =>
|
193
|
+
return d.useEffect(() => K.measure(), [h]), d.useEffect(() => T(a), [a]), d.useEffect(() => () => A(), []), /* @__PURE__ */ e(ae, { sx: { width: _ }, children: /* @__PURE__ */ e(E, { height: n, overflow: "auto", ref: M, width: _, children: /* @__PURE__ */ c(
|
190
194
|
E,
|
191
195
|
{
|
192
196
|
height: (
|
193
197
|
// set the height to auto when there are no transactions so the zero state isn't set to 0
|
194
|
-
|
198
|
+
K.getVirtualItems().length === 0 ? "auto" : K.getTotalSize()
|
195
199
|
),
|
196
200
|
position: "relative",
|
197
201
|
width: "100%",
|
198
202
|
children: [
|
199
|
-
(
|
200
|
-
!
|
201
|
-
!
|
202
|
-
const
|
203
|
+
(m || i) && s,
|
204
|
+
!m && !i && K.getVirtualItems().length === 0 && u,
|
205
|
+
!m && !i && K.getVirtualItems().length > 0 && K.getVirtualItems().map((N) => {
|
206
|
+
const k = h[N.index], W = Te(N.index, h), ce = ct(N.index, h), de = Se + (W ? ye : 0);
|
203
207
|
return /* @__PURE__ */ c(
|
204
208
|
E,
|
205
209
|
{
|
206
210
|
sx: {
|
207
|
-
height:
|
211
|
+
height: de,
|
208
212
|
position: "absolute",
|
209
|
-
transform: `translateY(${
|
213
|
+
transform: `translateY(${N.start}px)`,
|
210
214
|
width: "100%"
|
211
215
|
},
|
212
216
|
children: [
|
213
|
-
|
214
|
-
/* @__PURE__ */ e(ot, { onClick:
|
215
|
-
/* @__PURE__ */ e(
|
217
|
+
W && /* @__PURE__ */ e(it, { bgcolor: t, children: $e(k.date) }),
|
218
|
+
/* @__PURE__ */ e(ot, { onClick: R, transaction: k }),
|
219
|
+
/* @__PURE__ */ e(ne, { sx: { ml: ce ? 24 : 0 } })
|
216
220
|
]
|
217
221
|
},
|
218
|
-
|
222
|
+
k.guid
|
219
223
|
);
|
220
224
|
})
|
221
225
|
]
|
222
226
|
}
|
223
227
|
) }) });
|
224
228
|
}, Mn = b(dt), _t = ({ transaction: t }) => {
|
225
|
-
const { addOrUpdateTransactionRule:
|
226
|
-
await n({ ...t, category_guid:
|
229
|
+
const { addOrUpdateTransactionRule: r, updateTransaction: n } = v(), { categories: s } = be(), { onEvent: o } = w(), { setShouldDisableDrawerScroll: a, updateManualTransaction: i } = G(), { transactions: l } = x(), [_, u] = d.useState(!1), [m, p] = d.useState(""), h = async (y) => {
|
230
|
+
await n({ ...t, category_guid: m }), y && await r(m, t), p(""), o(P.TRANSACTION_DETAILS_CLICK_CATEGORY, {
|
227
231
|
transaction_guid: t.guid
|
228
232
|
});
|
229
233
|
}, A = (y) => {
|
230
234
|
if (t.is_manual && !t.guid) {
|
231
|
-
const
|
235
|
+
const R = s.find((M) => M.guid === y);
|
232
236
|
i({
|
233
237
|
...t,
|
234
|
-
category:
|
238
|
+
category: R?.name,
|
235
239
|
category_guid: y,
|
236
|
-
top_level_category_guid:
|
240
|
+
top_level_category_guid: R?.parent_guid || y
|
237
241
|
});
|
238
242
|
} else
|
239
|
-
|
240
|
-
|
241
|
-
},
|
243
|
+
p(y);
|
244
|
+
T();
|
245
|
+
}, T = () => {
|
242
246
|
u(!1), a(!1);
|
243
247
|
}, I = d.useMemo(
|
244
|
-
() => s.find((y) => y.guid ===
|
245
|
-
[
|
248
|
+
() => s.find((y) => y.guid === m),
|
249
|
+
[m]
|
246
250
|
);
|
247
251
|
return /* @__PURE__ */ c(d.Fragment, { children: [
|
248
|
-
/* @__PURE__ */ e(
|
249
|
-
|
252
|
+
/* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
253
|
+
B,
|
250
254
|
{
|
251
255
|
onClick: () => {
|
252
|
-
|
256
|
+
o(g.ON_TRANSACTION_CATEGORY_CLICK), u(!0);
|
253
257
|
},
|
254
258
|
children: [
|
255
|
-
/* @__PURE__ */ e(
|
256
|
-
|
259
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(
|
260
|
+
Ce,
|
257
261
|
{
|
258
262
|
categoryGuid: t.top_level_category_guid,
|
259
263
|
size: 24,
|
@@ -262,43 +266,43 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
262
266
|
}
|
263
267
|
) }) }),
|
264
268
|
/* @__PURE__ */ e(
|
265
|
-
|
269
|
+
$,
|
266
270
|
{
|
267
271
|
primary: "Category",
|
268
272
|
primaryTypographyProps: { variant: "XSmall" },
|
269
|
-
secondary: /* @__PURE__ */ e(
|
273
|
+
secondary: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category ?? l.actions_select_a_category })
|
270
274
|
}
|
271
275
|
),
|
272
|
-
/* @__PURE__ */ e(
|
276
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: L.Dark }) })
|
273
277
|
]
|
274
278
|
}
|
275
279
|
) }),
|
276
280
|
/* @__PURE__ */ e(
|
277
|
-
|
281
|
+
Oe,
|
278
282
|
{
|
279
283
|
initialSelected: t.category_guid,
|
280
|
-
onClose:
|
284
|
+
onClose: T,
|
281
285
|
onSelect: A,
|
282
286
|
showDrawer: _,
|
283
287
|
title: l.actions_select_a_category
|
284
288
|
}
|
285
289
|
),
|
286
290
|
/* @__PURE__ */ e(
|
287
|
-
|
291
|
+
X,
|
288
292
|
{
|
289
293
|
copy: {
|
290
|
-
title:
|
294
|
+
title: re(
|
291
295
|
l.actions_apply_to_all_transaction_types,
|
292
296
|
t.description
|
293
297
|
)
|
294
298
|
},
|
295
|
-
isOpen: !!
|
296
|
-
onClose: () =>
|
297
|
-
onPrimaryAction: () =>
|
298
|
-
onSecondaryAction: () =>
|
299
|
+
isOpen: !!m,
|
300
|
+
onClose: () => p(""),
|
301
|
+
onPrimaryAction: () => h(!0),
|
302
|
+
onSecondaryAction: () => h(!1),
|
299
303
|
primaryText: l.actions_apply_to_all,
|
300
304
|
secondaryText: l.actions_this_time_only,
|
301
|
-
children: /* @__PURE__ */ e(
|
305
|
+
children: /* @__PURE__ */ e(ie, { variant: "Paragraph", children: re(
|
302
306
|
l.actions_all_past_and_future,
|
303
307
|
t.description,
|
304
308
|
I?.name
|
@@ -307,56 +311,56 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
307
311
|
)
|
308
312
|
] });
|
309
313
|
}, ut = ({ transaction: t }) => {
|
310
|
-
const
|
311
|
-
|
312
|
-
},
|
314
|
+
const r = J(), { onEvent: n } = w(), { updateTransaction: s } = v(), { updateManualTransaction: o } = G(), { common: a, transactions: i } = x(), [l, _] = d.useState(!1), [u, m] = d.useState(t.date), p = (A) => {
|
315
|
+
m(Xe(A));
|
316
|
+
}, h = async () => {
|
313
317
|
if (t.is_manual && !t.guid) {
|
314
|
-
|
318
|
+
o({ ...t, date: u }), _(!1);
|
315
319
|
return;
|
316
320
|
}
|
317
|
-
await s({ ...t, date: u }), n(
|
321
|
+
await s({ ...t, date: u }), n(P.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), _(!1);
|
318
322
|
};
|
319
323
|
return /* @__PURE__ */ c(E, { className: "mx-txn-date-action", children: [
|
320
|
-
/* @__PURE__ */ e(
|
321
|
-
|
324
|
+
/* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
325
|
+
B,
|
322
326
|
{
|
323
327
|
onClick: () => {
|
324
328
|
n(g.ON_TRANSACTION_DATE_CLICK), _(!0);
|
325
329
|
},
|
326
330
|
children: [
|
327
|
-
/* @__PURE__ */ e(
|
331
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "calendar_month", sx: { color: "text.primary" }, weight: L.Dark }) }) }),
|
328
332
|
/* @__PURE__ */ e(
|
329
|
-
|
333
|
+
$,
|
330
334
|
{
|
331
335
|
primary: i.date_title,
|
332
336
|
primaryTypographyProps: { variant: "XSmall" },
|
333
|
-
secondary: /* @__PURE__ */ e(
|
337
|
+
secondary: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: Be(Y(t.date), Ue.YEAR_MONTH_DAY) })
|
334
338
|
}
|
335
339
|
),
|
336
|
-
/* @__PURE__ */ e(
|
340
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: L.Dark }) })
|
337
341
|
]
|
338
342
|
}
|
339
343
|
) }),
|
340
344
|
/* @__PURE__ */ e(
|
341
|
-
|
345
|
+
le,
|
342
346
|
{
|
343
347
|
ariaLabelClose: a.close_aria,
|
344
348
|
isOpen: l,
|
345
349
|
onClose: () => _(!1),
|
346
|
-
onPrimaryAction:
|
350
|
+
onPrimaryAction: h,
|
347
351
|
primaryText: a.save_button,
|
348
352
|
secondaryText: a.cancel_button,
|
349
353
|
title: i.date_edit_title,
|
350
|
-
children: /* @__PURE__ */ e(C, { alignItems: "center", mt:
|
354
|
+
children: /* @__PURE__ */ e(C, { alignItems: "center", mt: r.Spacing.XXLarge, children: /* @__PURE__ */ e(
|
351
355
|
ke,
|
352
356
|
{
|
353
|
-
beginDate:
|
357
|
+
beginDate: Y(u),
|
354
358
|
copy: {
|
355
359
|
nextAria: i.date_next_aria,
|
356
360
|
prevAria: i.date_prev_aria,
|
357
361
|
today: a.date_range_picker.today
|
358
362
|
},
|
359
|
-
onDateSelected:
|
363
|
+
onDateSelected: p,
|
360
364
|
selectionType: Pe.Single
|
361
365
|
}
|
362
366
|
) })
|
@@ -364,31 +368,31 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
364
368
|
)
|
365
369
|
] });
|
366
370
|
}, mt = ({ transaction: t }) => {
|
367
|
-
const { onEvent:
|
368
|
-
await n(t.guid),
|
371
|
+
const { onEvent: r } = w(), { removeTransaction: n } = v(), { setShouldDisableDrawerScroll: s } = G(), { common: o, transactions: a } = x(), [i, l] = d.useState(!1), _ = async () => {
|
372
|
+
await n(t.guid), r(g.ON_TRANSACTION_DELETE_DELETED);
|
369
373
|
};
|
370
374
|
return /* @__PURE__ */ c(E, { className: "mx-txn-delete", children: [
|
371
|
-
t && /* @__PURE__ */ e(
|
372
|
-
|
375
|
+
t && /* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
376
|
+
B,
|
373
377
|
{
|
374
378
|
onClick: () => {
|
375
|
-
|
379
|
+
r(g.ON_TRANSACTION_DELETE_CLICK), s(!0), l(!0);
|
376
380
|
},
|
377
381
|
children: [
|
378
|
-
/* @__PURE__ */ e(
|
382
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { variant: "rounded", children: /* @__PURE__ */ e(oe, { color: "secondary", fontSize: "small" }) }) }),
|
379
383
|
/* @__PURE__ */ e(
|
380
|
-
|
384
|
+
$,
|
381
385
|
{
|
382
386
|
primary: a.manual_transaction_delete_title,
|
383
387
|
secondary: a.manual_transaction_delete_subtitle
|
384
388
|
}
|
385
389
|
),
|
386
|
-
/* @__PURE__ */ e(
|
390
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(oe, {}) })
|
387
391
|
]
|
388
392
|
}
|
389
393
|
) }),
|
390
394
|
/* @__PURE__ */ e(
|
391
|
-
|
395
|
+
X,
|
392
396
|
{
|
393
397
|
copy: { title: a.manual_transaction_delete_title },
|
394
398
|
isOpen: i,
|
@@ -396,35 +400,35 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
396
400
|
s(!1), l(!1);
|
397
401
|
},
|
398
402
|
onPrimaryAction: _,
|
399
|
-
onSecondaryAction: () =>
|
400
|
-
primaryText:
|
401
|
-
secondaryText:
|
402
|
-
children: /* @__PURE__ */ e(
|
403
|
+
onSecondaryAction: () => r(g.ON_TRANSACTION_DELETE_CANCEL),
|
404
|
+
primaryText: o.delete_button,
|
405
|
+
secondaryText: o.cancel_button,
|
406
|
+
children: /* @__PURE__ */ e(S, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: a.manual_transaction_delete_description })
|
403
407
|
}
|
404
408
|
)
|
405
409
|
] });
|
406
410
|
}, pt = b(mt), gt = ({ transaction: t }) => {
|
407
|
-
const { onEvent:
|
408
|
-
await n({ ...t, merchant_guid: "" }),
|
411
|
+
const { onEvent: r } = w(), { updateTransaction: n } = v(), { setShouldDisableDrawerScroll: s } = G(), { common: o, transactions: a } = x(), [i, l] = d.useState(!1), _ = async () => {
|
412
|
+
await n({ ...t, merchant_guid: "" }), r(P.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
|
409
413
|
transaction_guid: t.guid
|
410
414
|
});
|
411
415
|
};
|
412
416
|
return /* @__PURE__ */ c(E, { className: "mx-txn-delete-logo", children: [
|
413
|
-
t && /* @__PURE__ */ e(
|
414
|
-
|
417
|
+
t && /* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
418
|
+
B,
|
415
419
|
{
|
416
420
|
onClick: () => {
|
417
|
-
|
421
|
+
r(g.ON_TRANSACTION_DELETE_LOGO_CLICK), l(!0);
|
418
422
|
},
|
419
423
|
children: [
|
420
|
-
/* @__PURE__ */ e(
|
421
|
-
/* @__PURE__ */ e(
|
422
|
-
/* @__PURE__ */ e(
|
424
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "delete", sx: { color: "text.primary" }, weight: L.Dark }) }) }),
|
425
|
+
/* @__PURE__ */ e($, { primary: a.merchant_logo_title, secondary: a.merchant_logo_desc }),
|
426
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: L.Dark }) })
|
423
427
|
]
|
424
428
|
}
|
425
429
|
) }),
|
426
430
|
/* @__PURE__ */ c(
|
427
|
-
|
431
|
+
X,
|
428
432
|
{
|
429
433
|
copy: { title: a.merchant_logo_modal_title },
|
430
434
|
isOpen: i,
|
@@ -432,32 +436,32 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
432
436
|
s(!1), l(!1);
|
433
437
|
},
|
434
438
|
onPrimaryAction: _,
|
435
|
-
onSecondaryAction: () =>
|
436
|
-
primaryText:
|
437
|
-
secondaryText:
|
439
|
+
onSecondaryAction: () => r(g.ON_TRANSACTION_DELETE_LOGO_CANCEL),
|
440
|
+
primaryText: o.delete_button,
|
441
|
+
secondaryText: o.cancel_button,
|
438
442
|
title: a.merchant_logo_modal_title,
|
439
443
|
children: [
|
440
|
-
/* @__PURE__ */ e(
|
441
|
-
/* @__PURE__ */ e(
|
444
|
+
/* @__PURE__ */ e(S, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: a.merchant_logo_modal_desc }),
|
445
|
+
/* @__PURE__ */ e(S, { bold: !0, sx: { whiteSpace: "normal" }, variant: "Paragraph", children: ` ${a.merchant_logo_modal_desc_bold}` })
|
442
446
|
]
|
443
447
|
}
|
444
448
|
)
|
445
449
|
] });
|
446
450
|
}, ht = b(gt), Tt = ({ transaction: t }) => {
|
447
|
-
const { onEvent:
|
448
|
-
await n({ ...t, is_hidden: !t.is_hidden }),
|
451
|
+
const { onEvent: r } = w(), { updateTransaction: n } = v(), { setShouldDisableDrawerScroll: s } = G(), { common: o, transactions: a } = x(), [i, l] = d.useState(!1), _ = t.is_hidden, u = async () => {
|
452
|
+
await n({ ...t, is_hidden: !t.is_hidden }), r(
|
449
453
|
_ ? g.ON_TRANSACTION_UNHIDDEN : g.ON_TRANSACTION_HIDDEN
|
450
454
|
);
|
451
455
|
};
|
452
456
|
return /* @__PURE__ */ c(E, { className: "mx-txn-hide-transaction", children: [
|
453
|
-
t && /* @__PURE__ */ e(
|
454
|
-
|
457
|
+
t && /* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
458
|
+
B,
|
455
459
|
{
|
456
460
|
"aria-checked": _,
|
457
461
|
onClick: () => {
|
458
|
-
|
462
|
+
r(
|
459
463
|
_ ? g.ON_TRANSACTION_UNHIDE_CLICK : g.ON_TRANSACTION_HIDE_CLICK
|
460
|
-
),
|
464
|
+
), r(
|
461
465
|
_ ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
|
462
466
|
{
|
463
467
|
transaction_guid: t.guid
|
@@ -466,22 +470,22 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
466
470
|
},
|
467
471
|
role: "switch",
|
468
472
|
children: [
|
469
|
-
/* @__PURE__ */ e(
|
473
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: _ ? /* @__PURE__ */ e(
|
470
474
|
f,
|
471
475
|
{
|
472
476
|
name: "visibilityOff",
|
473
477
|
sx: { color: "text.primary" },
|
474
|
-
weight:
|
478
|
+
weight: L.Dark
|
475
479
|
}
|
476
|
-
) : /* @__PURE__ */ e(f, { name: "visibility", sx: { color: "text.primary" }, weight:
|
480
|
+
) : /* @__PURE__ */ e(f, { name: "visibility", sx: { color: "text.primary" }, weight: L.Dark }) }) }),
|
477
481
|
/* @__PURE__ */ e(
|
478
|
-
|
482
|
+
$,
|
479
483
|
{
|
480
484
|
primary: _ ? a.hide_trnx_subtitle_unhide_trnx : a.hide_trnx_subtitle_hide_trnx,
|
481
485
|
secondary: _ ? a.hide_trnx_desc_unhiding : a.hide_trnx_desc_hiding
|
482
486
|
}
|
483
487
|
),
|
484
|
-
/* @__PURE__ */ e(
|
488
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(
|
485
489
|
Je,
|
486
490
|
{
|
487
491
|
checked: _,
|
@@ -494,7 +498,7 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
494
498
|
}
|
495
499
|
) }),
|
496
500
|
/* @__PURE__ */ e(
|
497
|
-
|
501
|
+
X,
|
498
502
|
{
|
499
503
|
copy: {
|
500
504
|
title: _ ? a.hide_trnx_subtitle_unhide_trnx : a.hide_trnx_subtitle_hide_trnx
|
@@ -504,62 +508,62 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
504
508
|
s(!1), l(!1);
|
505
509
|
},
|
506
510
|
onPrimaryAction: u,
|
507
|
-
onSecondaryAction: () =>
|
511
|
+
onSecondaryAction: () => r(
|
508
512
|
_ ? g.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : g.ON_TRANSACTION_HIDE_CANCEL_CLICK
|
509
513
|
),
|
510
|
-
primaryText: _ ?
|
511
|
-
secondaryText:
|
512
|
-
children: /* @__PURE__ */ e(
|
514
|
+
primaryText: _ ? o.unhide_button : o.hide_button,
|
515
|
+
secondaryText: o.cancel_button,
|
516
|
+
children: /* @__PURE__ */ e(S, { truncate: !1, variant: "Paragraph", children: _ ? a.hide_trnx_desc_unhiding : a.hide_trnx_desc_hiding })
|
513
517
|
}
|
514
518
|
)
|
515
519
|
] });
|
516
|
-
}, St = b(Tt),
|
517
|
-
const { amount:
|
520
|
+
}, St = b(Tt), De = ({ transaction: t }) => {
|
521
|
+
const { amount: r, description: n, isIncome: s, merchant_guid: o, payee: a, top_level_category_guid: i } = t;
|
518
522
|
return /* @__PURE__ */ c(C, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
|
519
523
|
/* @__PURE__ */ e(
|
520
|
-
|
524
|
+
pe,
|
521
525
|
{
|
522
526
|
categoryGuid: i || "",
|
523
|
-
merchantGuid:
|
527
|
+
merchantGuid: o || "",
|
524
528
|
size: 64
|
525
529
|
}
|
526
530
|
),
|
527
531
|
/* @__PURE__ */ c(C, { overflow: "hidden'", children: [
|
528
|
-
/* @__PURE__ */ e(
|
529
|
-
/* @__PURE__ */ c(
|
532
|
+
/* @__PURE__ */ e(S, { bold: !0, mb: 4, truncate: !0, variant: "Body", children: n || a }),
|
533
|
+
/* @__PURE__ */ c(fe, { color: s ? "success.main" : "text.primary", truncate: !0, children: [
|
530
534
|
s ? "+" : "",
|
531
|
-
|
535
|
+
Q(r, "0,0.00")
|
532
536
|
] })
|
533
537
|
] })
|
534
538
|
] });
|
535
539
|
}, yt = ({ transaction: t }) => {
|
536
|
-
const { onEvent:
|
540
|
+
const { onEvent: r } = w(), { updateTransaction: n } = v(), { updateManualTransaction: s } = G(), { common: o, transactions: a } = x(), [i, l] = d.useState(!1), [_, u] = d.useState("");
|
537
541
|
d.useEffect(() => {
|
538
542
|
i && u(t.memo ? t.memo : "");
|
539
543
|
}, [i]);
|
540
|
-
const
|
544
|
+
const m = async () => {
|
541
545
|
if (t.is_manual && !t.guid) {
|
542
546
|
s({ ...t, memo: _ }), l(!1);
|
543
547
|
return;
|
544
548
|
}
|
545
|
-
await n({ ...t, memo: _ }),
|
549
|
+
await n({ ...t, memo: _ }), r(P.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), l(!1);
|
546
550
|
};
|
547
551
|
return /* @__PURE__ */ c("div", { className: "mx-txn-memo-action", children: [
|
548
|
-
/* @__PURE__ */ e(
|
549
|
-
|
552
|
+
/* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
553
|
+
B,
|
550
554
|
{
|
551
555
|
onClick: () => {
|
552
|
-
|
556
|
+
r(g.ON_TRANSACTION_MEMO_CLICK), l(!0);
|
553
557
|
},
|
554
558
|
children: [
|
555
|
-
/* @__PURE__ */ e(
|
559
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "article", sx: { color: "text.primary" }, weight: L.Dark }) }) }),
|
556
560
|
/* @__PURE__ */ e(
|
557
|
-
|
561
|
+
$,
|
558
562
|
{
|
559
563
|
primary: a.memo_title,
|
560
564
|
primaryTypographyProps: { variant: "XSmall" },
|
561
565
|
secondary: /* @__PURE__ */ e(
|
562
|
-
|
566
|
+
S,
|
563
567
|
{
|
564
568
|
bold: !0,
|
565
569
|
sx: { overflowWrap: "break-word", whiteSpace: "wrap" },
|
@@ -569,29 +573,29 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
569
573
|
)
|
570
574
|
}
|
571
575
|
),
|
572
|
-
/* @__PURE__ */ e(
|
576
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: L.Dark }) })
|
573
577
|
]
|
574
578
|
}
|
575
579
|
) }),
|
576
580
|
/* @__PURE__ */ c(
|
577
|
-
|
581
|
+
le,
|
578
582
|
{
|
579
|
-
ariaLabelClose:
|
583
|
+
ariaLabelClose: o.close_aria,
|
580
584
|
isOpen: i,
|
581
585
|
onClose: () => l(!1),
|
582
|
-
onPrimaryAction:
|
586
|
+
onPrimaryAction: m,
|
583
587
|
title: a.memo_title,
|
584
588
|
children: [
|
585
|
-
/* @__PURE__ */ e(
|
589
|
+
/* @__PURE__ */ e(De, { transaction: t }),
|
586
590
|
/* @__PURE__ */ e(
|
587
|
-
|
591
|
+
Ne,
|
588
592
|
{
|
589
593
|
"aria-label": a.memo_desc_aria,
|
590
594
|
focused: !0,
|
591
595
|
fullWidth: !0,
|
592
596
|
multiline: !0,
|
593
597
|
name: "memo",
|
594
|
-
onChange: (
|
598
|
+
onChange: (p) => u(p.target.value),
|
595
599
|
placeholder: a.memo_desc,
|
596
600
|
rows: 4,
|
597
601
|
sx: { px: 16 },
|
@@ -604,13 +608,13 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
604
608
|
] });
|
605
609
|
}, Ct = b(yt), ft = ({
|
606
610
|
index: t,
|
607
|
-
onDeleteRow:
|
611
|
+
onDeleteRow: r,
|
608
612
|
onCategoryChanged: n,
|
609
613
|
onUpdateAmount: s,
|
610
|
-
split:
|
614
|
+
split: o
|
611
615
|
}) => {
|
612
|
-
const a =
|
613
|
-
isNaN(Number(
|
616
|
+
const a = J(), { onEvent: i } = w(), { transactions: l } = x(), [_, u] = d.useState(`${o.amount}`), [m, p] = d.useState(!1), h = t === 0, A = (T) => {
|
617
|
+
isNaN(Number(T)) || (u(T), s(t, Number(T)));
|
614
618
|
};
|
615
619
|
return /* @__PURE__ */ c(
|
616
620
|
E,
|
@@ -620,19 +624,19 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
620
624
|
pb: a.Spacing.Tiny,
|
621
625
|
px: a.Spacing.XSmall,
|
622
626
|
children: [
|
623
|
-
/* @__PURE__ */ c(
|
624
|
-
/* @__PURE__ */ e(
|
627
|
+
/* @__PURE__ */ c(ue, { alignItems: h ? "center" : "start", container: !0, children: [
|
628
|
+
/* @__PURE__ */ e(ue, { item: !0, xs: 7, children: /* @__PURE__ */ c(C, { alignItems: "start", children: [
|
625
629
|
/* @__PURE__ */ e(
|
626
|
-
|
630
|
+
se,
|
627
631
|
{
|
628
632
|
endIcon: /* @__PURE__ */ e(qe, {}),
|
629
|
-
onClick: () =>
|
630
|
-
startIcon: /* @__PURE__ */ e(
|
633
|
+
onClick: () => p(!0),
|
634
|
+
startIcon: /* @__PURE__ */ e(Ce, { categoryGuid: o.top_level_category_guid }),
|
631
635
|
sx: { px: a.Spacing.Small, py: a.Spacing.XSmall },
|
632
|
-
children:
|
636
|
+
children: o.category
|
633
637
|
}
|
634
638
|
),
|
635
|
-
/* @__PURE__ */ e(E, { children: !
|
639
|
+
/* @__PURE__ */ e(E, { children: !o.category_guid && /* @__PURE__ */ c(
|
636
640
|
C,
|
637
641
|
{
|
638
642
|
color: "error.main",
|
@@ -640,13 +644,13 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
640
644
|
gap: a.Spacing.XSmall,
|
641
645
|
p: a.Spacing.Small,
|
642
646
|
children: [
|
643
|
-
/* @__PURE__ */ e(
|
644
|
-
/* @__PURE__ */ e(
|
647
|
+
/* @__PURE__ */ e(me, { sx: { fontSize: a.FontSize.Body } }),
|
648
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: l.split_transaction_errors_select_category })
|
645
649
|
]
|
646
650
|
}
|
647
651
|
) })
|
648
652
|
] }) }),
|
649
|
-
/* @__PURE__ */ e(
|
653
|
+
/* @__PURE__ */ e(ue, { item: !0, xs: 5, children: h ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(S, { children: Q(o.amount, "0,0.00") }) }) : /* @__PURE__ */ c(C, { alignItems: "start", children: [
|
650
654
|
/* @__PURE__ */ c(C, { alignItems: "start", direction: "row", gap: a.Spacing.XSmall, children: [
|
651
655
|
/* @__PURE__ */ e(
|
652
656
|
Ze,
|
@@ -665,15 +669,15 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
665
669
|
}
|
666
670
|
),
|
667
671
|
/* @__PURE__ */ e(
|
668
|
-
|
672
|
+
Z,
|
669
673
|
{
|
670
674
|
"aria-label": l.split_transaction_delete_split_btn,
|
671
675
|
color: "secondary",
|
672
676
|
onClick: () => {
|
673
|
-
i(g.ON_TRANSACTION_SPLIT_DELETE_CLICK),
|
677
|
+
i(g.ON_TRANSACTION_SPLIT_DELETE_CLICK), r(t);
|
674
678
|
},
|
675
679
|
sx: { w: 44, h: 44 },
|
676
|
-
children: /* @__PURE__ */ e(
|
680
|
+
children: /* @__PURE__ */ e(oe, {})
|
677
681
|
}
|
678
682
|
)
|
679
683
|
] }),
|
@@ -685,22 +689,22 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
685
689
|
gap: a.Spacing.XSmall,
|
686
690
|
py: a.Spacing.Small,
|
687
691
|
children: [
|
688
|
-
/* @__PURE__ */ e(
|
689
|
-
/* @__PURE__ */ e(
|
692
|
+
/* @__PURE__ */ e(me, { sx: { fontSize: a.FontSize.Body } }),
|
693
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: l.split_transaction_errors_enter_an_amount })
|
690
694
|
]
|
691
695
|
}
|
692
696
|
)
|
693
697
|
] }) })
|
694
698
|
] }),
|
695
699
|
/* @__PURE__ */ e(
|
696
|
-
|
700
|
+
Oe,
|
697
701
|
{
|
698
|
-
initialSelected:
|
699
|
-
onClose: () =>
|
700
|
-
onSelect: (
|
701
|
-
n(t,
|
702
|
+
initialSelected: o.category_guid,
|
703
|
+
onClose: () => p(!1),
|
704
|
+
onSelect: (T) => {
|
705
|
+
n(t, T), p(!1);
|
702
706
|
},
|
703
|
-
showDrawer:
|
707
|
+
showDrawer: m,
|
704
708
|
title: l.actions_select_a_category
|
705
709
|
}
|
706
710
|
)
|
@@ -709,31 +713,31 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
709
713
|
);
|
710
714
|
}, bt = b(ft), At = ({
|
711
715
|
onAddSplit: t,
|
712
|
-
onCategoryChanged:
|
716
|
+
onCategoryChanged: r,
|
713
717
|
onDeleteSplit: n,
|
714
718
|
onUpdateAmount: s,
|
715
|
-
splits:
|
719
|
+
splits: o,
|
716
720
|
transaction: a
|
717
721
|
}) => {
|
718
|
-
const i =
|
722
|
+
const i = J(), { transactions: l } = x(), { onEvent: _ } = w(), [u, m] = d.useState("");
|
719
723
|
return d.useEffect(() => {
|
720
|
-
|
721
|
-
|
724
|
+
m(o.length <= 1 ? l.split_transaction_errors_min_splits : ""), m(
|
725
|
+
o[0].amount < 0 ? re(
|
722
726
|
l.split_transaction_errors_totals_must_equal_amount,
|
723
|
-
|
727
|
+
Q(a.amount, "0,0.00")
|
724
728
|
) : ""
|
725
729
|
);
|
726
|
-
}, [
|
727
|
-
|
730
|
+
}, [o]), /* @__PURE__ */ c(E, { className: "mx-txn-split-manager", children: [
|
731
|
+
o.map((p, h) => /* @__PURE__ */ e(
|
728
732
|
bt,
|
729
733
|
{
|
730
|
-
index:
|
731
|
-
onCategoryChanged:
|
734
|
+
index: h,
|
735
|
+
onCategoryChanged: r,
|
732
736
|
onDeleteRow: n,
|
733
737
|
onUpdateAmount: s,
|
734
|
-
split:
|
738
|
+
split: p
|
735
739
|
},
|
736
|
-
|
740
|
+
h
|
737
741
|
)),
|
738
742
|
u && /* @__PURE__ */ c(
|
739
743
|
C,
|
@@ -743,13 +747,13 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
743
747
|
gap: i.Spacing.XSmall,
|
744
748
|
p: i.Spacing.Medium,
|
745
749
|
children: [
|
746
|
-
/* @__PURE__ */ e(
|
747
|
-
/* @__PURE__ */ e(
|
750
|
+
/* @__PURE__ */ e(me, { sx: { fontSize: i.FontSize.Body } }),
|
751
|
+
/* @__PURE__ */ e(S, { variant: "Small", children: u })
|
748
752
|
]
|
749
753
|
}
|
750
754
|
),
|
751
755
|
/* @__PURE__ */ e(E, { p: i.Spacing.Medium, children: /* @__PURE__ */ e(
|
752
|
-
|
756
|
+
se,
|
753
757
|
{
|
754
758
|
"aria-label": l.split_transaction_add_split_btn,
|
755
759
|
onClick: () => {
|
@@ -760,7 +764,7 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
760
764
|
) })
|
761
765
|
] });
|
762
766
|
}, It = b(At), Nt = ({ transaction: t }) => {
|
763
|
-
const { onEvent:
|
767
|
+
const { onEvent: r } = w(), { splitTransaction: n, unSplitTransaction: s } = v(), { common: o, transactions: a } = x(), { setShouldDisableDrawerScroll: i } = G(), { categories: l } = be(), _ = {
|
764
768
|
...t,
|
765
769
|
amount: t.amount - 1,
|
766
770
|
guid: "",
|
@@ -775,83 +779,83 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
775
779
|
has_been_split: !1,
|
776
780
|
parent_guid: t.guid,
|
777
781
|
top_level_category_guid: void 0
|
778
|
-
}, [
|
779
|
-
const O = [...
|
782
|
+
}, [m, p] = d.useState(!1), [h, A] = d.useState(!1), [T, I] = d.useState([]), y = () => {
|
783
|
+
const O = [...T];
|
780
784
|
O.push({ ...u }), O[0].amount -= 1, I(O);
|
781
|
-
},
|
785
|
+
}, R = (O) => {
|
782
786
|
if (O > 0) {
|
783
|
-
const
|
784
|
-
D.splice(O, 1), D[0].amount +=
|
787
|
+
const F = T[O], D = [...T];
|
788
|
+
D.splice(O, 1), D[0].amount += F.amount, I(D);
|
785
789
|
}
|
786
|
-
},
|
787
|
-
const D = [...
|
788
|
-
D[O].amount =
|
789
|
-
(
|
790
|
+
}, M = (O, F) => {
|
791
|
+
const D = [...T];
|
792
|
+
D[O].amount = F, D[0].amount = t.amount - D.reduce(
|
793
|
+
(j, _e, Ee) => j + (Ee !== 0 ? _e.amount : 0),
|
790
794
|
0
|
791
795
|
), I(D);
|
792
|
-
},
|
793
|
-
const D = [...
|
794
|
-
|
796
|
+
}, K = (O, F) => {
|
797
|
+
const D = [...T], j = l.find((_e) => _e.guid === F);
|
798
|
+
j && (D[O] = {
|
795
799
|
...D[O],
|
796
|
-
category_guid:
|
797
|
-
category:
|
798
|
-
top_level_category_guid:
|
800
|
+
category_guid: F,
|
801
|
+
category: j.name,
|
802
|
+
top_level_category_guid: j.parent_guid || F
|
799
803
|
}, I(D));
|
800
|
-
},
|
804
|
+
}, N = () => {
|
801
805
|
if (t.parent_guid || t.has_been_split) {
|
802
806
|
A(!0);
|
803
807
|
return;
|
804
808
|
}
|
805
|
-
I([{ ..._ }, { ...u }]),
|
809
|
+
I([{ ..._ }, { ...u }]), r(P.TRANSACTION_DETAILS_CLICK_SPLIT, {
|
806
810
|
transaction_guid: t.guid
|
807
|
-
}),
|
808
|
-
},
|
809
|
-
|
810
|
-
},
|
811
|
-
|
811
|
+
}), p(!0);
|
812
|
+
}, k = async () => {
|
813
|
+
r(g.ON_TRANSACTION_SPLIT_SAVE_CLICK), await n({ ...t, has_been_split: !0 }, T), p(!1);
|
814
|
+
}, W = async () => {
|
815
|
+
r(g.ON_TRANSACTION_SPLIT_CANCEL_CLICK), I([{ ..._ }, { ...u }]), p(!1);
|
812
816
|
}, ce = async () => {
|
813
|
-
|
817
|
+
r(P.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
|
814
818
|
transaction_guid: t.guid
|
815
819
|
});
|
816
820
|
const O = t.parent_guid ?? t.guid;
|
817
821
|
await s(O);
|
818
|
-
},
|
819
|
-
const O =
|
820
|
-
return O ||
|
821
|
-
}, [
|
822
|
+
}, de = d.useMemo(() => {
|
823
|
+
const O = T.some((D) => !D.category_guid), F = T.some((D) => D.amount <= 0);
|
824
|
+
return O || F;
|
825
|
+
}, [T]);
|
822
826
|
return /* @__PURE__ */ c(d.Fragment, { children: [
|
823
|
-
t && /* @__PURE__ */ e(
|
824
|
-
/* @__PURE__ */ e(
|
827
|
+
t && /* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(B, { onClick: N, children: [
|
828
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "call_split", sx: { color: "text.primary" }, weight: L.Dark }) }) }),
|
825
829
|
/* @__PURE__ */ e(
|
826
|
-
|
830
|
+
$,
|
827
831
|
{
|
828
832
|
primary: t.has_been_split || t.parent_guid ? a.split_transaction_unsplit_title : a.split_transaction_title,
|
829
833
|
secondary: t.has_been_split || t.parent_guid ? a.split_transaction_unsplit_subtitle : a.split_transaction_desc
|
830
834
|
}
|
831
835
|
),
|
832
|
-
/* @__PURE__ */ e(
|
836
|
+
/* @__PURE__ */ e(U, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(f, { name: "delete", weight: L.Dark }) : /* @__PURE__ */ e(f, { name: "chevron_right", weight: L.Dark }) })
|
833
837
|
] }) }),
|
834
838
|
/* @__PURE__ */ c(
|
835
|
-
|
839
|
+
le,
|
836
840
|
{
|
837
|
-
ariaLabelClose:
|
838
|
-
isOpen:
|
839
|
-
isPrimaryDisabled:
|
840
|
-
onClose:
|
841
|
-
onPrimaryAction:
|
842
|
-
primaryText:
|
843
|
-
secondaryText:
|
841
|
+
ariaLabelClose: o.close_aria,
|
842
|
+
isOpen: m,
|
843
|
+
isPrimaryDisabled: de,
|
844
|
+
onClose: W,
|
845
|
+
onPrimaryAction: k,
|
846
|
+
primaryText: o.save_button,
|
847
|
+
secondaryText: o.cancel_button,
|
844
848
|
title: a.split_transaction_title,
|
845
849
|
children: [
|
846
|
-
/* @__PURE__ */ e(
|
850
|
+
/* @__PURE__ */ e(De, { transaction: t }),
|
847
851
|
/* @__PURE__ */ e(
|
848
852
|
It,
|
849
853
|
{
|
850
854
|
onAddSplit: y,
|
851
|
-
onCategoryChanged:
|
852
|
-
onDeleteSplit:
|
853
|
-
onUpdateAmount:
|
854
|
-
splits:
|
855
|
+
onCategoryChanged: K,
|
856
|
+
onDeleteSplit: R,
|
857
|
+
onUpdateAmount: M,
|
858
|
+
splits: T,
|
855
859
|
transaction: t
|
856
860
|
}
|
857
861
|
)
|
@@ -859,20 +863,20 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
859
863
|
}
|
860
864
|
),
|
861
865
|
/* @__PURE__ */ e(
|
862
|
-
|
866
|
+
X,
|
863
867
|
{
|
864
868
|
copy: { title: a.split_transaction_unsplit_title },
|
865
|
-
isOpen:
|
869
|
+
isOpen: h,
|
866
870
|
onClose: () => {
|
867
871
|
i(!1), A(!1);
|
868
872
|
},
|
869
873
|
onPrimaryAction: ce,
|
870
874
|
onSecondaryAction: () => {
|
871
|
-
|
875
|
+
r(g.ON_TRANSACTION_UNSPLIT_CANCEL);
|
872
876
|
},
|
873
|
-
primaryText:
|
874
|
-
secondaryText:
|
875
|
-
children: /* @__PURE__ */ e(
|
877
|
+
primaryText: o.delete_button,
|
878
|
+
secondaryText: o.cancel_button,
|
879
|
+
children: /* @__PURE__ */ e(ie, { variant: "Paragraph", children: re(
|
876
880
|
a.split_transaction_unsplit_description,
|
877
881
|
t.description
|
878
882
|
) })
|
@@ -880,16 +884,16 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
880
884
|
)
|
881
885
|
] });
|
882
886
|
}, xt = b(Nt), Ot = () => {
|
883
|
-
const t =
|
887
|
+
const t = xe(), { onEvent: r } = w(), { addTag: n } = v(), { transactions: s } = x(), [o, a] = d.useState(!1), [i, l] = d.useState(""), [_, u] = d.useState(""), m = d.useRef(null);
|
884
888
|
d.useEffect(() => {
|
885
|
-
|
886
|
-
}, [
|
887
|
-
const
|
888
|
-
|
889
|
-
|
890
|
-
),
|
891
|
-
},
|
892
|
-
|
889
|
+
o && m?.current?.focus();
|
890
|
+
}, [o]);
|
891
|
+
const p = () => {
|
892
|
+
r(
|
893
|
+
o ? g.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : g.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
|
894
|
+
), o || l(""), a(!o);
|
895
|
+
}, h = async () => {
|
896
|
+
r(g.ON_TRANSACTION_TAGS_TAG_ADDED), await n(i), a(!1);
|
893
897
|
};
|
894
898
|
return d.useEffect(() => {
|
895
899
|
u(i.length > 40 ? s.tags_error_name_must_be_40_chars : "");
|
@@ -904,13 +908,13 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
904
908
|
px: 24,
|
905
909
|
py: 16,
|
906
910
|
children: [
|
907
|
-
/* @__PURE__ */ e(
|
911
|
+
/* @__PURE__ */ e(S, { bold: !0, children: s.tags_your_tags }),
|
908
912
|
/* @__PURE__ */ e(
|
909
|
-
|
913
|
+
se,
|
910
914
|
{
|
911
|
-
"aria-expanded":
|
915
|
+
"aria-expanded": o,
|
912
916
|
"aria-label": s.tags_add_tag_btn_aria,
|
913
|
-
onClick:
|
917
|
+
onClick: p,
|
914
918
|
children: s.tags_add_tag_btn
|
915
919
|
}
|
916
920
|
)
|
@@ -918,16 +922,16 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
918
922
|
}
|
919
923
|
),
|
920
924
|
/* @__PURE__ */ c(
|
921
|
-
|
925
|
+
X,
|
922
926
|
{
|
923
927
|
copy: { title: s.tags_add_tag_btn },
|
924
|
-
isOpen:
|
928
|
+
isOpen: o,
|
925
929
|
onClose: () => a(!1),
|
926
|
-
onPrimaryAction:
|
930
|
+
onPrimaryAction: h,
|
927
931
|
onSecondaryAction: () => a(!1),
|
928
932
|
children: [
|
929
933
|
/* @__PURE__ */ e(
|
930
|
-
|
934
|
+
ge,
|
931
935
|
{
|
932
936
|
"aria-label": s.tags_placeholder,
|
933
937
|
name: "add-tag",
|
@@ -937,90 +941,90 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
937
941
|
value: i
|
938
942
|
}
|
939
943
|
),
|
940
|
-
/* @__PURE__ */ e(
|
944
|
+
/* @__PURE__ */ e(ie, { id: "add-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: _ })
|
941
945
|
]
|
942
946
|
}
|
943
947
|
)
|
944
948
|
] });
|
945
|
-
}, Dt = b(Ot), Et = ({ onSearchValueChanged: t, searchValue:
|
946
|
-
const { common: n, transactions: s } =
|
947
|
-
|
949
|
+
}, Dt = b(Ot), Et = ({ onSearchValueChanged: t, searchValue: r }) => {
|
950
|
+
const { common: n, transactions: s } = x(), o = J(), a = /* @__PURE__ */ e(
|
951
|
+
Z,
|
948
952
|
{
|
949
953
|
"aria-label": s.tags_cancel_search || "Search",
|
950
954
|
onClick: () => t(""),
|
951
955
|
children: /* @__PURE__ */ e(Ve, {})
|
952
956
|
}
|
953
957
|
);
|
954
|
-
return /* @__PURE__ */ e(E, { className: "mx-txn-tag-manager-search", px:
|
955
|
-
|
958
|
+
return /* @__PURE__ */ e(E, { className: "mx-txn-tag-manager-search", px: o.Spacing.Large, py: o.Spacing.Medium, children: /* @__PURE__ */ e(
|
959
|
+
ge,
|
956
960
|
{
|
957
961
|
InputProps: {
|
958
|
-
startAdornment: /* @__PURE__ */ e(
|
959
|
-
endAdornment: /* @__PURE__ */ e(
|
962
|
+
startAdornment: /* @__PURE__ */ e(he, { position: "start", children: /* @__PURE__ */ e(We, { color: "disabled" }) }),
|
963
|
+
endAdornment: /* @__PURE__ */ e(he, { position: "end", sx: { padding: 0 }, children: r ? a : null })
|
960
964
|
},
|
961
965
|
"aria-label": n.search_aria,
|
962
966
|
name: "search",
|
963
967
|
onChange: (i) => t(i.target.value),
|
964
968
|
placeholder: n.search_placeholder,
|
965
969
|
sx: { bgcolor: "background.paper", width: "100%" },
|
966
|
-
value:
|
970
|
+
value: r
|
967
971
|
}
|
968
972
|
) });
|
969
|
-
}, vt = b(Et), wt = ({ onTagChecked: t, selectedTags:
|
970
|
-
const { onEvent: s } = w(), { removeTag:
|
971
|
-
s(g.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), n && await a({ ...n, name:
|
972
|
-
},
|
973
|
-
s(g.ON_TRANSACTION_TAGS_TAG_DELETED), await
|
973
|
+
}, vt = b(Et), wt = ({ onTagChecked: t, selectedTags: r, tag: n }) => {
|
974
|
+
const { onEvent: s } = w(), { removeTag: o, updateTag: a } = v(), { common: i, transactions: l } = x(), [_, u] = d.useState(!1), [m, p] = d.useState(!1), [h, A] = d.useState(""), [T, I] = d.useState(""), y = async () => {
|
975
|
+
s(g.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), n && await a({ ...n, name: h }), u(!1);
|
976
|
+
}, R = async () => {
|
977
|
+
s(g.ON_TRANSACTION_TAGS_TAG_DELETED), await o(n.guid), p(!1);
|
974
978
|
};
|
975
979
|
d.useEffect(() => {
|
976
|
-
I(
|
977
|
-
}, [
|
978
|
-
const
|
980
|
+
I(h.length > 40 ? l.tags_error_name_must_be_40_chars : "");
|
981
|
+
}, [h]);
|
982
|
+
const M = () => {
|
979
983
|
s(g.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), A(n.name), u(!0);
|
980
|
-
},
|
981
|
-
s(g.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK),
|
984
|
+
}, K = () => {
|
985
|
+
s(g.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), p(!0);
|
982
986
|
};
|
983
987
|
return /* @__PURE__ */ c(
|
984
|
-
|
988
|
+
z,
|
985
989
|
{
|
986
990
|
className: "mx-txn-transaction-manager-row",
|
987
991
|
disableGutters: !0,
|
988
992
|
disablePadding: !0,
|
989
993
|
secondaryAction: !n.is_default_tag && /* @__PURE__ */ c(C, { direction: "row", children: [
|
990
994
|
/* @__PURE__ */ e(
|
991
|
-
|
995
|
+
Z,
|
992
996
|
{
|
993
997
|
"aria-label": `Edit ${n.name} tag`,
|
994
998
|
color: "secondary",
|
995
|
-
onClick:
|
999
|
+
onClick: M,
|
996
1000
|
children: /* @__PURE__ */ e(Ye, { color: "secondary" })
|
997
1001
|
}
|
998
1002
|
),
|
999
1003
|
/* @__PURE__ */ e(
|
1000
|
-
|
1004
|
+
Z,
|
1001
1005
|
{
|
1002
1006
|
"aria-label": `Delete ${n.name} tag`,
|
1003
1007
|
color: "secondary",
|
1004
|
-
onClick:
|
1005
|
-
children: /* @__PURE__ */ e(
|
1008
|
+
onClick: K,
|
1009
|
+
children: /* @__PURE__ */ e(oe, { color: "secondary" })
|
1006
1010
|
}
|
1007
1011
|
)
|
1008
1012
|
] }),
|
1009
1013
|
children: [
|
1010
1014
|
/* @__PURE__ */ c(
|
1011
|
-
|
1015
|
+
B,
|
1012
1016
|
{
|
1013
|
-
"aria-checked":
|
1017
|
+
"aria-checked": r.includes(n.guid),
|
1014
1018
|
onClick: () => t(n.guid),
|
1015
1019
|
role: "checkbox",
|
1016
1020
|
children: [
|
1017
|
-
/* @__PURE__ */ e(
|
1018
|
-
/* @__PURE__ */ e(
|
1021
|
+
/* @__PURE__ */ e(U, { sx: { ml: 0 }, children: /* @__PURE__ */ e(je, { checked: r.includes(n.guid), edge: "start", tabIndex: -1 }) }),
|
1022
|
+
/* @__PURE__ */ e($, { children: n.name })
|
1019
1023
|
]
|
1020
1024
|
}
|
1021
1025
|
),
|
1022
1026
|
/* @__PURE__ */ c(
|
1023
|
-
|
1027
|
+
X,
|
1024
1028
|
{
|
1025
1029
|
copy: { title: "Update tag name" },
|
1026
1030
|
isOpen: _,
|
@@ -1029,98 +1033,98 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1029
1033
|
onSecondaryAction: () => u(!1),
|
1030
1034
|
children: [
|
1031
1035
|
/* @__PURE__ */ e(
|
1032
|
-
|
1036
|
+
ge,
|
1033
1037
|
{
|
1034
|
-
"aria-describedby":
|
1038
|
+
"aria-describedby": T ? "update-tag-error" : void 0,
|
1035
1039
|
"aria-label": l.tags_update_the_tag_name,
|
1036
1040
|
name: "update-tag",
|
1037
|
-
onChange: (
|
1041
|
+
onChange: (N) => A(N.target.value),
|
1038
1042
|
placeholder: "Tag name",
|
1039
1043
|
sx: { width: "100%" },
|
1040
|
-
value:
|
1044
|
+
value: h
|
1041
1045
|
}
|
1042
1046
|
),
|
1043
|
-
/* @__PURE__ */ e(
|
1047
|
+
/* @__PURE__ */ e(ie, { id: "update-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: T })
|
1044
1048
|
]
|
1045
1049
|
}
|
1046
1050
|
),
|
1047
1051
|
/* @__PURE__ */ e(
|
1048
|
-
|
1052
|
+
X,
|
1049
1053
|
{
|
1050
1054
|
copy: { title: l.tags_delete_title },
|
1051
|
-
isOpen:
|
1052
|
-
onClose: () =>
|
1053
|
-
onPrimaryAction:
|
1055
|
+
isOpen: m,
|
1056
|
+
onClose: () => p(!1),
|
1057
|
+
onPrimaryAction: R,
|
1054
1058
|
onSecondaryAction: () => s(g.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
|
1055
1059
|
primaryText: i.delete_button,
|
1056
1060
|
secondaryText: i.cancel_button,
|
1057
|
-
children: /* @__PURE__ */ e(
|
1061
|
+
children: /* @__PURE__ */ e(S, { truncate: !1, children: l.tags_deleting_this_tag_will_remove_it })
|
1058
1062
|
}
|
1059
1063
|
)
|
1060
1064
|
]
|
1061
1065
|
}
|
1062
1066
|
);
|
1063
|
-
}, Lt = b(wt), Rt = ({ selectedTags: t, onTagChecked:
|
1064
|
-
const { tags: n } = v(), [s,
|
1067
|
+
}, Lt = b(wt), Rt = ({ selectedTags: t, onTagChecked: r }) => {
|
1068
|
+
const { tags: n } = v(), [s, o] = d.useState(""), a = n.filter(
|
1065
1069
|
(i) => i.name.toLowerCase().includes(s.toLowerCase())
|
1066
1070
|
);
|
1067
1071
|
return /* @__PURE__ */ c("div", { className: "mx-txn-tag-manager", children: [
|
1068
1072
|
/* @__PURE__ */ e(
|
1069
1073
|
vt,
|
1070
1074
|
{
|
1071
|
-
onSearchValueChanged: (i) =>
|
1075
|
+
onSearchValueChanged: (i) => o(i),
|
1072
1076
|
searchValue: s
|
1073
1077
|
}
|
1074
1078
|
),
|
1075
1079
|
/* @__PURE__ */ e(Dt, {}),
|
1076
|
-
/* @__PURE__ */ e(
|
1077
|
-
/* @__PURE__ */ e(Lt, { onTagChecked:
|
1078
|
-
/* @__PURE__ */ e(
|
1080
|
+
/* @__PURE__ */ e(ee, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ae, { children: a.map((i) => /* @__PURE__ */ c(d.Fragment, { children: [
|
1081
|
+
/* @__PURE__ */ e(Lt, { onTagChecked: r, selectedTags: t, tag: i }),
|
1082
|
+
/* @__PURE__ */ e(ne, { sx: { ml: 24 } })
|
1079
1083
|
] }, i.guid)) }) })
|
1080
1084
|
] });
|
1081
1085
|
}, kt = b(Rt), Pt = ({ transaction: t }) => {
|
1082
|
-
const { onEvent:
|
1086
|
+
const { onEvent: r } = w(), { tags: n, updateTaggings: s, updateTransaction: o } = v(), { common: a, transactions: i } = x(), { updateManualTransaction: l } = G(), [_, u] = d.useState(!1), [m, p] = d.useState(t.tags);
|
1083
1087
|
d.useEffect(() => {
|
1084
|
-
|
1088
|
+
p(t.tags);
|
1085
1089
|
}, [_, t]);
|
1086
|
-
const
|
1087
|
-
const y = [...
|
1088
|
-
|
1090
|
+
const h = (I) => {
|
1091
|
+
const y = [...m], R = m.indexOf(I);
|
1092
|
+
R >= 0 ? y.splice(R, 1) : y.push(I), p(y);
|
1089
1093
|
}, A = async () => {
|
1090
1094
|
if (t.is_manual && !t.guid) {
|
1091
|
-
l({ ...t, tags:
|
1095
|
+
l({ ...t, tags: m }), u(!1);
|
1092
1096
|
return;
|
1093
1097
|
}
|
1094
|
-
await s(
|
1095
|
-
},
|
1098
|
+
await s(m, t.guid), await o({ ...t, tags: m }), r(P.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), u(!1);
|
1099
|
+
}, T = d.useMemo(
|
1096
1100
|
() => t.tags.map(
|
1097
|
-
(I, y,
|
1101
|
+
(I, y, R) => `${n.find((M) => M.guid === I)?.name}${y < R.length - 1 ? " / " : ""}`
|
1098
1102
|
),
|
1099
1103
|
[n, t]
|
1100
1104
|
);
|
1101
1105
|
return /* @__PURE__ */ c(d.Fragment, { children: [
|
1102
|
-
/* @__PURE__ */ e(
|
1103
|
-
|
1106
|
+
/* @__PURE__ */ e(z, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
1107
|
+
B,
|
1104
1108
|
{
|
1105
1109
|
onClick: () => {
|
1106
|
-
|
1110
|
+
r(g.ON_TRANSACTION_TAGS_CLICK), u(!0);
|
1107
1111
|
},
|
1108
1112
|
children: [
|
1109
|
-
/* @__PURE__ */ e(
|
1113
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(f, { name: "local_offer", sx: { color: "text.primary" }, weight: L.Dark }) }) }),
|
1110
1114
|
/* @__PURE__ */ e(
|
1111
|
-
|
1115
|
+
$,
|
1112
1116
|
{
|
1113
1117
|
primary: i.tags_title,
|
1114
1118
|
primaryTypographyProps: { variant: "XSmall" },
|
1115
|
-
secondary: /* @__PURE__ */ e(
|
1119
|
+
secondary: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.tags?.length > 0 ? T : i.tags_desc })
|
1116
1120
|
}
|
1117
1121
|
),
|
1118
|
-
/* @__PURE__ */ e(
|
1122
|
+
/* @__PURE__ */ e(U, { children: /* @__PURE__ */ e(f, { name: "chevron_right", weight: L.Dark }) })
|
1119
1123
|
]
|
1120
1124
|
}
|
1121
1125
|
) }),
|
1122
1126
|
/* @__PURE__ */ e(
|
1123
|
-
|
1127
|
+
le,
|
1124
1128
|
{
|
1125
1129
|
ariaLabelClose: a.close_aria,
|
1126
1130
|
isOpen: _,
|
@@ -1129,27 +1133,27 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1129
1133
|
primaryText: a.save_button,
|
1130
1134
|
secondaryText: a.cancel_button,
|
1131
1135
|
title: i.tags_title,
|
1132
|
-
children: /* @__PURE__ */ e(kt, { onTagChecked:
|
1136
|
+
children: /* @__PURE__ */ e(kt, { onTagChecked: h, selectedTags: m })
|
1133
1137
|
}
|
1134
1138
|
)
|
1135
1139
|
] });
|
1136
1140
|
}, Gt = b(Pt), Mt = ({ transaction: t }) => {
|
1137
|
-
const { updateTransaction:
|
1141
|
+
const { updateTransaction: r } = v(), { common: n, transactions: s } = x(), { onEvent: o } = w(), [a, i] = d.useState(!1), [l, _] = d.useState(""), u = d.useRef(null);
|
1138
1142
|
d.useEffect(() => {
|
1139
1143
|
a && (_(t.description), u?.current?.focus());
|
1140
1144
|
}, [a]);
|
1141
|
-
const
|
1142
|
-
|
1145
|
+
const m = async () => {
|
1146
|
+
o(P.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
|
1143
1147
|
transaction_guid: t.guid
|
1144
|
-
}), await
|
1148
|
+
}), await r({ ...t, description: l }), i(!1);
|
1145
1149
|
};
|
1146
1150
|
return /* @__PURE__ */ e(E, { className: "mx-txn-transaction-description", children: a ? /* @__PURE__ */ c(Fe, { row: !0, children: [
|
1147
1151
|
/* @__PURE__ */ e(
|
1148
|
-
|
1152
|
+
Ne,
|
1149
1153
|
{
|
1150
1154
|
"aria-label": s.description_add_a_subcategory,
|
1151
1155
|
name: "add-subcategory",
|
1152
|
-
onChange: (
|
1156
|
+
onChange: (p) => _(p.target.value),
|
1153
1157
|
ref: u,
|
1154
1158
|
sx: {
|
1155
1159
|
backgroundColor: "background.paper",
|
@@ -1161,23 +1165,23 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1161
1165
|
}
|
1162
1166
|
),
|
1163
1167
|
/* @__PURE__ */ e(
|
1164
|
-
|
1168
|
+
se,
|
1165
1169
|
{
|
1166
1170
|
disabled: !l,
|
1167
|
-
onClick:
|
1171
|
+
onClick: m,
|
1168
1172
|
sx: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 },
|
1169
1173
|
variant: "outlined",
|
1170
1174
|
children: n.save_button
|
1171
1175
|
}
|
1172
1176
|
)
|
1173
1177
|
] }) : /* @__PURE__ */ c(C, { alignItems: "center", direction: "row", gap: 4, children: [
|
1174
|
-
/* @__PURE__ */ e(
|
1178
|
+
/* @__PURE__ */ e(S, { bold: !0, children: t.description }),
|
1175
1179
|
/* @__PURE__ */ e(
|
1176
|
-
|
1180
|
+
Z,
|
1177
1181
|
{
|
1178
1182
|
"aria-label": s.description_edit_transaction_name,
|
1179
1183
|
onClick: () => {
|
1180
|
-
i(!0),
|
1184
|
+
i(!0), o(g.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK);
|
1181
1185
|
},
|
1182
1186
|
sx: { color: "action.active" },
|
1183
1187
|
children: /* @__PURE__ */ e(f, { name: "create", size: 22 })
|
@@ -1185,8 +1189,8 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1185
1189
|
)
|
1186
1190
|
] }) });
|
1187
1191
|
}, Kt = b(Mt), $t = ({ transaction: t }) => {
|
1188
|
-
const { updateTransaction:
|
1189
|
-
s(
|
1192
|
+
const { updateTransaction: r } = v(), { transactions: n } = x(), { onEvent: s } = w(), o = xe(), a = async () => {
|
1193
|
+
s(P.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await r({ ...t, is_flagged: !t.is_flagged });
|
1190
1194
|
};
|
1191
1195
|
return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
|
1192
1196
|
ze,
|
@@ -1198,18 +1202,18 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1198
1202
|
selected: t.is_flagged,
|
1199
1203
|
sx: {
|
1200
1204
|
borderRadius: 6,
|
1201
|
-
color:
|
1205
|
+
color: o.palette.secondary.main,
|
1202
1206
|
"&.Mui-selected": {
|
1203
|
-
color:
|
1204
|
-
backgroundColor:
|
1207
|
+
color: o.palette.common.white,
|
1208
|
+
backgroundColor: o.palette.warning.dark,
|
1205
1209
|
":hover": {
|
1206
|
-
color:
|
1207
|
-
backgroundColor:
|
1210
|
+
color: o.palette.common.white,
|
1211
|
+
backgroundColor: o.palette.warning.main
|
1208
1212
|
}
|
1209
1213
|
},
|
1210
1214
|
":hover": {
|
1211
|
-
color:
|
1212
|
-
backgroundColor:
|
1215
|
+
color: o.palette.warning.contrastText,
|
1216
|
+
backgroundColor: o.palette.warning.light
|
1213
1217
|
}
|
1214
1218
|
},
|
1215
1219
|
value: "flagged",
|
@@ -1218,17 +1222,17 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1218
1222
|
) });
|
1219
1223
|
}, Ft = b($t), Ht = ({
|
1220
1224
|
bottomActions: t = et,
|
1221
|
-
topActions:
|
1225
|
+
topActions: r = Qe,
|
1222
1226
|
transaction: n
|
1223
1227
|
}) => {
|
1224
|
-
const { isCopyLoaded: s } = Me(),
|
1228
|
+
const { isCopyLoaded: s } = Me(), o = n?.number && n.number.length > 4, { onEvent: a } = w();
|
1225
1229
|
return d.useEffect(
|
1226
|
-
() => a(
|
1230
|
+
() => a(P.TRANSACTION_DETAILS_VIEW, { transaction_guid: n.guid }),
|
1227
1231
|
[]
|
1228
1232
|
), s ? /* @__PURE__ */ e(E, { className: "mx-txn-transaction-details", width: "100%", children: n && /* @__PURE__ */ c(C, { children: [
|
1229
1233
|
/* @__PURE__ */ c(C, { gap: 12, p: 24, children: [
|
1230
|
-
/* @__PURE__ */ e(
|
1231
|
-
|
1234
|
+
/* @__PURE__ */ e(ee, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
|
1235
|
+
pe,
|
1232
1236
|
{
|
1233
1237
|
categoryGuid: n.top_level_category_guid || "",
|
1234
1238
|
merchantGuid: n.merchant_guid || "",
|
@@ -1237,39 +1241,39 @@ const rt = ({ transaction: t, onClick: o }) => {
|
|
1237
1241
|
) }),
|
1238
1242
|
/* @__PURE__ */ e(Kt, { transaction: n }),
|
1239
1243
|
/* @__PURE__ */ c(C, { direction: "row", justifyContent: "space-between", children: [
|
1240
|
-
/* @__PURE__ */ c(
|
1244
|
+
/* @__PURE__ */ c(fe, { color: n.isIncome ? "success.main" : "text.primary", children: [
|
1241
1245
|
n.isIncome ? "+" : "",
|
1242
|
-
|
1246
|
+
Q(n.amount, "0,0.00")
|
1243
1247
|
] }),
|
1244
1248
|
/* @__PURE__ */ e(Ft, { transaction: n })
|
1245
1249
|
] }),
|
1246
1250
|
/* @__PURE__ */ c(C, { bgcolor: "background.highlight", borderRadius: "12px", gap: 4, p: 8, children: [
|
1247
|
-
/* @__PURE__ */ e(
|
1248
|
-
${
|
1249
|
-
/* @__PURE__ */ e(
|
1251
|
+
/* @__PURE__ */ e(S, { bold: !0, children: `${n.account}
|
1252
|
+
${o ? n.number : "•".repeat(4).concat(n.number ?? "")}` }),
|
1253
|
+
/* @__PURE__ */ e(S, { bold: !0, color: "secondary", variant: "Tiny", children: n.feed_description })
|
1250
1254
|
] })
|
1251
1255
|
] }),
|
1252
|
-
/* @__PURE__ */ e(
|
1253
|
-
i ===
|
1254
|
-
i ===
|
1255
|
-
i ===
|
1256
|
-
i ===
|
1257
|
-
/* @__PURE__ */ e(
|
1256
|
+
/* @__PURE__ */ e(ee, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ae, { children: r.map((i, l) => /* @__PURE__ */ c(d.Fragment, { children: [
|
1257
|
+
i === q.Category && /* @__PURE__ */ e(_t, { transaction: n }),
|
1258
|
+
i === q.Date && /* @__PURE__ */ e(ut, { transaction: n }),
|
1259
|
+
i === q.Memo && /* @__PURE__ */ e(Ct, { transaction: n }),
|
1260
|
+
i === q.Tags && /* @__PURE__ */ e(Gt, { transaction: n }),
|
1261
|
+
/* @__PURE__ */ e(ne, { variant: l < r.length - 1 ? "inset" : "fullWidth" })
|
1258
1262
|
] }, i)) }) }),
|
1259
|
-
/* @__PURE__ */ e(
|
1260
|
-
/* @__PURE__ */ e(
|
1263
|
+
/* @__PURE__ */ e(S, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "Body", children: "Actions" }),
|
1264
|
+
/* @__PURE__ */ e(ee, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ c(ae, { children: [
|
1261
1265
|
t.map((i, l) => /* @__PURE__ */ c(d.Fragment, { children: [
|
1262
|
-
i ===
|
1263
|
-
i ===
|
1264
|
-
i ===
|
1265
|
-
/* @__PURE__ */ e(
|
1266
|
+
i === te.SplitTransaction && /* @__PURE__ */ e(xt, { transaction: n }),
|
1267
|
+
i === te.HideTransaction && /* @__PURE__ */ e(St, { transaction: n }),
|
1268
|
+
i === te.MerchantLogo && /* @__PURE__ */ e(ht, { transaction: n }),
|
1269
|
+
/* @__PURE__ */ e(ne, { variant: l < t.length - 1 ? "inset" : "fullWidth" })
|
1266
1270
|
] }, i)),
|
1267
1271
|
n.is_manual && !n.parent_guid && !n.has_been_split && /* @__PURE__ */ e(pt, { transaction: n })
|
1268
1272
|
] }) })
|
1269
|
-
] }) }) : /* @__PURE__ */ e(
|
1273
|
+
] }) }) : /* @__PURE__ */ e(Ie, {});
|
1270
1274
|
}, Kn = b(Ht);
|
1271
1275
|
export {
|
1272
|
-
|
1276
|
+
te as B,
|
1273
1277
|
_t as C,
|
1274
1278
|
ut as D,
|
1275
1279
|
Ct as M,
|
@@ -1278,6 +1282,6 @@ export {
|
|
1278
1282
|
Kn as a,
|
1279
1283
|
ot as b,
|
1280
1284
|
Gt as c,
|
1281
|
-
|
1282
|
-
|
1285
|
+
q as d,
|
1286
|
+
G as u
|
1283
1287
|
};
|