@mx-cartographer/experiences 7.0.2-alpha.al0 → 7.0.3

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.
@@ -1,5 +1,6 @@
1
1
  export interface RecurringCopy {
2
2
  account: string;
3
+ action_title: string;
3
4
  activity_payment_date: string;
4
5
  activity_schedule: string;
5
6
  add_expense: string;
@@ -71,6 +72,11 @@ export interface RecurringCopy {
71
72
  recurrence_day_label: string;
72
73
  recurrence_days_label: string;
73
74
  recurring_expenses: string;
75
+ recurring_setting_zero_state_expenses_description: string;
76
+ recurring_setting_zero_state_expenses_title: string;
77
+ recurring_setting_zero_state_income_description: string;
78
+ recurring_setting_zero_state_income_title: string;
79
+ recurring_income: string;
74
80
  reset: string;
75
81
  second_day_of_the_month: string;
76
82
  select_day_label: string;
@@ -30,7 +30,7 @@ import Ue from "@mui/material/AccordionSummary";
30
30
  import Ve from "@mui/material/CardHeader";
31
31
  import { u as Ye } from "../useDimensions-27p2evRx.mjs";
32
32
  import { C as qe } from "../ConnectionsDrawer-Czp-E0-m.mjs";
33
- import { R as Je } from "../RecurringSettings-Be1dzkMz.mjs";
33
+ import { R as Je } from "../RecurringSettings-Dqn4pjZ0.mjs";
34
34
  import Qe from "@mui/material/TextField";
35
35
  import { u as xe } from "../useScreenSize-B6JyS_Lj.mjs";
36
36
  import { a as Ze } from "../Dialog-CWW597AF.mjs";
@@ -1,3 +1,7 @@
1
- export declare const ManageIncome: (() => import("react/jsx-runtime").JSX.Element) & {
1
+ interface ManageIncomeProps {
2
+ forOverview?: boolean;
3
+ }
4
+ export declare const ManageIncome: (({ forOverview }: ManageIncomeProps) => import("react/jsx-runtime").JSX.Element) & {
2
5
  displayName: string;
3
6
  };
7
+ export {};
@@ -0,0 +1,7 @@
1
+ interface RecurringSettingsZeroStateProps {
2
+ zeroStateFor: 'expenses' | 'income';
3
+ }
4
+ export declare const RecurringSettingsZeroState: (({ zeroStateFor }: RecurringSettingsZeroStateProps) => import("react/jsx-runtime").JSX.Element) & {
5
+ displayName: string;
6
+ };
7
+ export {};
@@ -8,8 +8,8 @@ import { startOfToday as le } from "date-fns/startOfToday";
8
8
  import { subDays as de } from "date-fns/subDays";
9
9
  import re from "@mui/material/Skeleton";
10
10
  import c from "@mui/material/Stack";
11
- import { R as He } from "../RecurringSettings-Be1dzkMz.mjs";
12
- import { M as An } from "../RecurringSettings-Be1dzkMz.mjs";
11
+ import { R as He } from "../RecurringSettings-Dqn4pjZ0.mjs";
12
+ import { M as An } from "../RecurringSettings-Dqn4pjZ0.mjs";
13
13
  import { addMonths as ze } from "date-fns/addMonths";
14
14
  import { subMonths as Be } from "date-fns/subMonths";
15
15
  import { isBefore as Ue } from "date-fns/isBefore";
@@ -41,8 +41,8 @@ import ct from "@mui/material/ListSubheader";
41
41
  import lt from "@mui/material/ListItemAvatar";
42
42
  import dt from "@mui/material/ListItemButton";
43
43
  import ut from "@mui/material/ListItemText";
44
- import { a as mt } from "../ManageIncome-B6kmMN_z.mjs";
45
- import { b as On, M as kn, S as Wn } from "../ManageIncome-B6kmMN_z.mjs";
44
+ import { b as mt } from "../ManageIncome-BtKRPjvO.mjs";
45
+ import { c as On, M as kn, S as Wn } from "../ManageIncome-BtKRPjvO.mjs";
46
46
  import { f as L } from "../NumberFormatting-CtWHhyBX.mjs";
47
47
  import { D as Ae } from "../Drawer-kEE73B87.mjs";
48
48
  import { b as N } from "../Localization-2MODESHW.mjs";
@@ -561,8 +561,8 @@ const Z = {
561
561
  accountOptions: i,
562
562
  actions: [
563
563
  {
564
- label: a.settings,
565
- iconName: "settings",
564
+ label: a.action_title,
565
+ iconName: "credit_card",
566
566
  onClick: () => {
567
567
  d(!0), b(_.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
568
568
  }
@@ -585,7 +585,7 @@ const Z = {
585
585
  isOpen: y,
586
586
  onClose: () => d(!1),
587
587
  shouldShowHeaderBorders: !1,
588
- title: a.settings,
588
+ title: a.action_title,
589
589
  children: /* @__PURE__ */ e(He, {})
590
590
  }
591
591
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.2-alpha.al0",
3
+ "version": "7.0.3",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,527 +0,0 @@
1
- import { jsxs as i, jsx as e, Fragment as F } from "react/jsx-runtime";
2
- import u from "react";
3
- import { observer as D } from "mobx-react-lite";
4
- import O from "@mui/material/Divider";
5
- import j from "@mui/material/List";
6
- import K from "@mui/material/ListItem";
7
- import oe from "@mui/material/ListItemAvatar";
8
- import Q from "@mui/material/ListItemButton";
9
- import $ from "@mui/material/ListItemText";
10
- import y from "@mui/material/Stack";
11
- import { MerchantLogo as H, Text as w, H1 as ae, InstitutionLogo as ie, P as se, Icon as z } from "@mxenabled/mxui";
12
- import { F as s, S as T, D as G, g as J, R as A, e as ce } from "./RepeatingTransaction-BPWfaB3f.mjs";
13
- import { subDays as le } from "date-fns/subDays";
14
- import { startOfToday as P } from "date-fns/startOfToday";
15
- import { endOfMonth as de } from "date-fns/endOfMonth";
16
- import ue from "@mui/material/Button";
17
- import { Delete as _e } from "@mxenabled/mx-icons";
18
- import { T as X, a as me, u as ye, S as he, b as pe } from "./TransactionDetails-D4B9DSWo.mjs";
19
- import { getDayOfYear as fe } from "date-fns/getDayOfYear";
20
- import { setDayOfYear as ge } from "date-fns/setDayOfYear";
21
- import { AdapterDateFns as Ce } from "@mui/x-date-pickers/AdapterDateFnsV3";
22
- import { DatePicker as be } from "@mui/x-date-pickers";
23
- import { LocalizationProvider as ve } from "@mui/x-date-pickers/LocalizationProvider";
24
- import { u as x, h as N, e as q, a as we, f as Z, o as Se } from "./hooks-02T565vf.mjs";
25
- import { b as xe, f as V } from "./NumberFormatting-CtWHhyBX.mjs";
26
- import { D as L } from "./Drawer-kEE73B87.mjs";
27
- import { A as k } from "./WidgetContainer-BG-fdDOf.mjs";
28
- import { f as De, D as Ee, a as Ie } from "./Dialog-CWW597AF.mjs";
29
- import { formatISO as Ae } from "date-fns/formatISO";
30
- import { fromUnixTime as Oe } from "date-fns/fromUnixTime";
31
- import Le from "@mui/material/Box";
32
- import { S as Re } from "./SearchBox-B2_zLv8-.mjs";
33
- import { h as Te } from "./DateUtil-BcuH7ErC.mjs";
34
- import { b as B } from "./Category-CevNQ03n.mjs";
35
- import { T as ee } from "./Transaction-CyqrHmAA.mjs";
36
- const te = ({
37
- frequency: t,
38
- firstDay: n,
39
- secondDay: o,
40
- onFrequencyChange: c,
41
- onFirstDayChange: a,
42
- onSecondDayChange: l
43
- }) => {
44
- const { recurring: r } = x(), d = u.useMemo(
45
- () => [
46
- { id: s.EveryWeek, label: r.frequency_every_week },
47
- { id: s.EveryOtherWeek, label: r.frequency_every_other_week },
48
- { id: s.TwiceAMonth, label: r.frequency_twice_a_month },
49
- { id: s.EveryMonth, label: r.frequency_every_month },
50
- { id: s.EveryOtherMonth, label: r.frequency_every_other_month },
51
- { id: s.EveryQuarter, label: r.frequency_every_quarter },
52
- { id: s.EveryOtherQuarter, label: r.frequency_every_other_quarter },
53
- { id: s.EveryYear, label: r.frequency_every_year }
54
- ],
55
- [r]
56
- ), h = [
57
- { id: 0, label: r.weekday_sunday },
58
- { id: 1, label: r.weekday_monday },
59
- { id: 2, label: r.weekday_tuesday },
60
- { id: 3, label: r.weekday_wednesday },
61
- { id: 4, label: r.weekday_thursday },
62
- { id: 5, label: r.weekday_friday },
63
- { id: 6, label: r.weekday_saturday }
64
- ], p = [...Array(31).keys()].map((m) => ({
65
- id: m + 1,
66
- label: xe(m + 1)
67
- }));
68
- p[30].label += ` (${r.last_day_of_month})`;
69
- const C = p.slice(0, 15), S = p.slice(14), b = t === s.EveryWeek || t === s.EveryOtherWeek, f = t === s.TwiceAMonth || t === s.EveryMonth || t === s.EveryOtherMonth || t === s.EveryQuarter || t === s.EveryOtherQuarter, E = ge(P(), n), g = (m) => {
70
- m && a(fe(m));
71
- };
72
- return /* @__PURE__ */ i(y, { gap: 24, sx: { m: 24 }, children: [
73
- /* @__PURE__ */ e(
74
- T,
75
- {
76
- label: r.frequency,
77
- onChange: c,
78
- options: d,
79
- value: t
80
- }
81
- ),
82
- b && /* @__PURE__ */ e(
83
- T,
84
- {
85
- label: r.day_of_the_week,
86
- onChange: a,
87
- options: h,
88
- value: n
89
- }
90
- ),
91
- f && /* @__PURE__ */ e(
92
- T,
93
- {
94
- label: t === s.TwiceAMonth ? r.first_day_of_the_month : r.day_of_the_month,
95
- onChange: a,
96
- options: t === s.TwiceAMonth ? C : p,
97
- value: n
98
- }
99
- ),
100
- t === s.TwiceAMonth && /* @__PURE__ */ e(
101
- T,
102
- {
103
- label: r.second_day_of_the_month,
104
- onChange: l,
105
- options: S,
106
- value: o || 0
107
- }
108
- ),
109
- t === s.EveryYear && /* @__PURE__ */ e(ve, { dateAdapter: Ce, children: /* @__PURE__ */ e(
110
- be,
111
- {
112
- disablePast: !0,
113
- label: r.next_payment_date,
114
- onChange: g,
115
- value: E
116
- }
117
- ) })
118
- ] });
119
- }, ke = D(({ repeatingTransaction: t }) => {
120
- const { recurring: n } = x(), { updateRepeatingTransaction: o } = N(), { onEvent: c } = q(), [a, l] = u.useState(!1), [r, d] = u.useState(t.recurrence_type), [h, p] = u.useState(t.recurrence_day), [C, S] = u.useState(t.second_recurrence_day), b = async () => {
121
- await o({
122
- ...t,
123
- recurrence_type: r,
124
- recurrence_day: h,
125
- second_recurrence_day: C
126
- }), l(!1);
127
- }, f = () => {
128
- l(!0), c(k.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
129
- };
130
- return /* @__PURE__ */ i(F, { children: [
131
- /* @__PURE__ */ e(
132
- G,
133
- {
134
- iconName: "sync",
135
- label: n.activity_schedule,
136
- onClick: f,
137
- value: `${J(n, t, !0)}`
138
- }
139
- ),
140
- /* @__PURE__ */ e(
141
- L,
142
- {
143
- ariaLabelClose: n.close_drawer_aria,
144
- isOpen: a,
145
- onClose: () => l(!1),
146
- onPrimaryAction: b,
147
- title: n.payment_schedule,
148
- children: /* @__PURE__ */ e(
149
- te,
150
- {
151
- firstDay: h,
152
- frequency: r,
153
- onFirstDayChange: p,
154
- onFrequencyChange: d,
155
- onSecondDayChange: S,
156
- secondDay: C
157
- }
158
- )
159
- }
160
- )
161
- ] });
162
- }), Ne = D(
163
- ({ onDeleted: t, recurringTransaction: n }) => {
164
- const { recurring: o } = x(), { selectedAccountGuids: c } = we(), { onEvent: a } = q(), { deleteRepeatingTransaction: l } = N(), { setFilter: r, transactions: d } = Z(), { amount: h, description: p, merchant_guid: C } = n, [S, b] = u.useState(!1), [f, E] = u.useState("");
165
- u.useEffect(() => {
166
- r({
167
- accounts: c,
168
- dateRange: { start: le(P(), 90), end: de(P()) },
169
- custom: (_) => _.repeating_transaction_guid === n.guid
170
- });
171
- }, [n]);
172
- const g = u.useMemo(
173
- () => d.find((_) => _.guid === f),
174
- [f, d]
175
- ), m = n.repeating_transaction_type === A.Income, R = async () => {
176
- await l(n.guid), t();
177
- }, M = () => {
178
- b(!0), a(k.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
179
- };
180
- return /* @__PURE__ */ i(y, { bgcolor: "background.default", direction: "column", height: "100%", children: [
181
- /* @__PURE__ */ i(y, { direction: "column", m: 24, children: [
182
- /* @__PURE__ */ e(
183
- H,
184
- {
185
- categoryGuid: g?.category_guid || "",
186
- merchantGuid: C,
187
- size: 64,
188
- sx: { mb: 12 }
189
- }
190
- ),
191
- /* @__PURE__ */ e(w, { bold: !0, variant: "body1", children: p }),
192
- /* @__PURE__ */ i(ae, { color: m ? "success.main" : "text.primary", sx: { my: 4 }, children: [
193
- m ? "+" : "",
194
- V(h, "0,0.00")
195
- ] }),
196
- /* @__PURE__ */ e(w, { color: "text.secondary", variant: "body2", children: `${o.next_payment_date}: ${De(
197
- n.predicted_occurs_on,
198
- Ee.MONTH_DAY_YEAR
199
- )}` })
200
- ] }),
201
- /* @__PURE__ */ i(j, { sx: { bgcolor: "background.paper" }, children: [
202
- n.account && /* @__PURE__ */ i(F, { children: [
203
- /* @__PURE__ */ e(
204
- G,
205
- {
206
- iconName: "checkbook",
207
- label: o.account,
208
- value: n.account.institutionName || ""
209
- }
210
- ),
211
- /* @__PURE__ */ e(O, { variant: "inset" })
212
- ] }),
213
- g?.category && /* @__PURE__ */ i(F, { children: [
214
- /* @__PURE__ */ e(
215
- G,
216
- {
217
- iconName: "monetization_on",
218
- label: o.category,
219
- value: g.category
220
- }
221
- ),
222
- /* @__PURE__ */ e(O, { variant: "inset" })
223
- ] }),
224
- /* @__PURE__ */ e(ke, { repeatingTransaction: n }),
225
- /* @__PURE__ */ e(O, {})
226
- ] }),
227
- /* @__PURE__ */ e(
228
- ue,
229
- {
230
- color: "error",
231
- onClick: M,
232
- startIcon: /* @__PURE__ */ e(_e, {}),
233
- sx: { mx: 24, my: 16 },
234
- variant: "text",
235
- children: m ? o.delete_income_title : o.delete_expense_title
236
- }
237
- ),
238
- /* @__PURE__ */ e(w, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "Body", children: o.paid_transactions }),
239
- /* @__PURE__ */ e(X, { height: "30dvh", onClick: E }),
240
- /* @__PURE__ */ e(
241
- L,
242
- {
243
- ariaLabelClose: o.close_drawer_aria,
244
- isOpen: !!f && !!g,
245
- onClose: () => E(""),
246
- title: o.transaction_details_drawer_title,
247
- children: g && /* @__PURE__ */ e(me, { transaction: g })
248
- }
249
- ),
250
- /* @__PURE__ */ e(
251
- Ie,
252
- {
253
- copy: {
254
- title: m ? o.delete_income_title : o.delete_expense_title,
255
- close_aria: o.close_drawer_aria
256
- },
257
- isOpen: S,
258
- onClose: () => b(!1),
259
- onPrimaryAction: R,
260
- children: /* @__PURE__ */ e(w, { children: m ? o.delete_income_description : o.delete_expense_description })
261
- }
262
- )
263
- ] });
264
- }
265
- ), Me = D(
266
- ({ onClick: t = () => {
267
- }, repeatingTransaction: n }) => {
268
- const { recurring: o } = x(), [c, a] = u.useState(!1), l = u.useMemo(
269
- () => n.transactions.length === 0 ? "" : n.transactions[0].category_guid || "",
270
- [n]
271
- ), r = n.account?.institutionName || "", d = n.repeating_transaction_type === A.Income, h = J(o, n, !0);
272
- return /* @__PURE__ */ i(K, { disableGutters: !0, disablePadding: !0, children: [
273
- /* @__PURE__ */ i(Q, { onClick: () => {
274
- t(n), a(!0);
275
- }, children: [
276
- /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
277
- H,
278
- {
279
- categoryGuid: l,
280
- merchantGuid: n.merchant_guid
281
- }
282
- ) }),
283
- /* @__PURE__ */ e($, { children: /* @__PURE__ */ i(y, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
284
- /* @__PURE__ */ i(y, { direction: "column", sx: { width: "50%" }, children: [
285
- /* @__PURE__ */ e(w, { bold: !0, variant: "body1", children: n.description }),
286
- /* @__PURE__ */ i(y, { alignItems: "center", direction: "row", gap: 6, children: [
287
- n.account?.institution_guid && /* @__PURE__ */ e(
288
- ie,
289
- {
290
- alt: r,
291
- institutionGuid: n.account?.institution_guid,
292
- size: 12
293
- }
294
- ),
295
- /* @__PURE__ */ e(w, { variant: "caption", children: r })
296
- ] })
297
- ] }),
298
- /* @__PURE__ */ i(y, { alignItems: "flex-end", sx: { width: "50%" }, children: [
299
- /* @__PURE__ */ i(
300
- w,
301
- {
302
- bold: !0,
303
- color: d ? "success.main" : "text.primary",
304
- variant: "body1",
305
- children: [
306
- d ? "+" : "",
307
- V(n.amount, "0,0.00")
308
- ]
309
- }
310
- ),
311
- /* @__PURE__ */ e(
312
- y,
313
- {
314
- direction: "row",
315
- sx: {
316
- alignItems: "center",
317
- gap: 6,
318
- justifyContent: "flex-end",
319
- textTransform: "uppercase",
320
- width: "100%"
321
- },
322
- children: /* @__PURE__ */ e(w, { bold: !0, color: "text.secondary", variant: "caption", children: h })
323
- }
324
- )
325
- ] })
326
- ] }) })
327
- ] }),
328
- /* @__PURE__ */ e(
329
- L,
330
- {
331
- ariaLabelClose: o.close_drawer_aria,
332
- isOpen: c,
333
- onClose: () => a(!1),
334
- title: n.repeating_transaction_type === A.Income ? o.income_details : o.expense_details,
335
- children: /* @__PURE__ */ e(
336
- Ne,
337
- {
338
- onDeleted: () => a(!1),
339
- recurringTransaction: n
340
- }
341
- )
342
- }
343
- )
344
- ] });
345
- }
346
- ), Fe = D(
347
- ({
348
- bgcolor: t = "background.default",
349
- description: n,
350
- onSearch: o,
351
- onSelected: c
352
- }) => {
353
- const { recurring: a } = x(), { searchValue: l, setSearchValue: r } = ye();
354
- return /* @__PURE__ */ i(y, { sx: { bgcolor: t, gap: 16, pt: 8 }, children: [
355
- n && /* @__PURE__ */ e(se, { sx: { mx: 24 }, children: n }),
356
- /* @__PURE__ */ e(
357
- Re,
358
- {
359
- ariaLabel: a.select_transaction_search_aria,
360
- cancelAriaLabel: a.select_transaction_search_cancel_aria,
361
- onChange: (d) => {
362
- r(d), o(d);
363
- },
364
- placeholder: a.select_transaction_search_placeholder,
365
- searchValue: l
366
- }
367
- ),
368
- /* @__PURE__ */ e(X, { bgcolor: t, height: "auto", onClick: c, showLoader: !1 })
369
- ] });
370
- }
371
- ), Ge = D(
372
- ({
373
- bgcolor: t = "background.default",
374
- firstDay: n,
375
- secondDay: o,
376
- frequency: c,
377
- onFrequencyChange: a,
378
- onFirstDayChange: l,
379
- onSecondDayChange: r,
380
- transaction: d
381
- }) => {
382
- const { recurring: h } = x();
383
- return /* @__PURE__ */ i(y, { bgcolor: t, gap: 24, height: "100%", children: [
384
- /* @__PURE__ */ i(y, { children: [
385
- /* @__PURE__ */ e(he, { bgcolor: t, children: Te(d.date) }),
386
- /* @__PURE__ */ e(pe, { transaction: d })
387
- ] }),
388
- /* @__PURE__ */ e(w, { bold: !0, sx: { mx: 24 }, variant: "Body", children: h.payment_schedule }),
389
- /* @__PURE__ */ e(
390
- te,
391
- {
392
- firstDay: n,
393
- frequency: c,
394
- onFirstDayChange: l,
395
- onFrequencyChange: a,
396
- onSecondDayChange: r,
397
- secondDay: o
398
- }
399
- )
400
- ] });
401
- }
402
- ), Y = (t) => t.top_level_category_guid !== B.INCOME && t.transaction_type === ee.DEBIT, Pe = (t, n) => Y(t) ? t.payee?.toLowerCase().includes(n.toLowerCase()) || t.description.toLowerCase().includes(n.toLowerCase()) || t.feed_description.toLowerCase().includes(n.toLowerCase()) : !1, U = (t) => t.top_level_category_guid === B.INCOME || t.top_level_category_guid === B.TRANSFER && t.transaction_type === ee.CREDIT, Be = (t, n) => U(t) ? t.payee?.toLowerCase().includes(n.toLowerCase()) || t.description?.toLowerCase().includes(n.toLowerCase()) || t.feed_description?.toLowerCase().includes(n.toLowerCase()) : !1, Ye = D(
403
- ({
404
- isIncome: t = !1,
405
- label: n,
406
- onAddRecurringTransaction: o = () => null
407
- }) => {
408
- const { recurring: c } = x(), { filter: a, setFilter: l, transactions: r } = Z(), { addRepeatingTransaction: d } = N(), { user: h } = Se(), [p, C] = u.useState(!1), [S, b] = u.useState(""), [f, E] = u.useState(s.EveryMonth), [g, m] = u.useState(1), [R, M] = u.useState(15), _ = u.useMemo(
409
- () => r.find((v) => v.guid === S),
410
- [S, r]
411
- ), ne = () => {
412
- C(!0), l(t ? { ...a, custom: U } : { ...a, custom: Y });
413
- }, re = async () => {
414
- if (!_) {
415
- W();
416
- return;
417
- }
418
- o();
419
- const v = ce(f, Oe(_.date)), I = {
420
- account_guid: _.account_guid,
421
- amount: _.amount,
422
- created_by: 0,
423
- // User
424
- merchant_guid: _.merchant_guid,
425
- description: _.payee || _.description || _.feed_description,
426
- predicted_occurs_on: Ae(v, { representation: "date" }),
427
- recurrence_day: g,
428
- recurrence_type: f,
429
- repeating_transaction_type: t ? A.Income : A.Bill,
430
- second_recurrence_day: R,
431
- transaction_type: _.transaction_type,
432
- user_guid: h.guid
433
- };
434
- await d(I, _), W();
435
- }, W = () => {
436
- b(""), C(!1);
437
- };
438
- return /* @__PURE__ */ i(Le, { children: [
439
- /* @__PURE__ */ e(K, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ e(Q, { onClick: ne, children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ i(y, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
440
- /* @__PURE__ */ i(y, { alignItems: "center", direction: "row", gap: 8, children: [
441
- /* @__PURE__ */ e(z, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.main" } }),
442
- /* @__PURE__ */ e(w, { bold: !0, sx: { color: "primary.main" }, variant: "Body", children: n })
443
- ] }),
444
- /* @__PURE__ */ e(z, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
445
- ] }) }) }) }),
446
- /* @__PURE__ */ e(O, {}),
447
- /* @__PURE__ */ e(
448
- L,
449
- {
450
- ariaLabelClose: c.close_drawer_aria,
451
- isOpen: p,
452
- onClose: () => C(!1),
453
- title: n,
454
- children: /* @__PURE__ */ e(
455
- Fe,
456
- {
457
- description: t ? c.add_income_description : c.add_expense_description,
458
- onSearch: (v) => {
459
- l({
460
- ...a,
461
- custom: (I) => t ? v ? Be(I, v) : U(I) : v ? Pe(I, v) : Y(I)
462
- });
463
- },
464
- onSelected: (v) => b(v)
465
- }
466
- )
467
- }
468
- ),
469
- /* @__PURE__ */ e(
470
- L,
471
- {
472
- ariaLabelClose: c.close_drawer_aria,
473
- isOpen: !!S,
474
- onClose: () => b(""),
475
- onPrimaryAction: re,
476
- title: t ? c.income_details : c.expense_details,
477
- children: _ && /* @__PURE__ */ e(
478
- Ge,
479
- {
480
- firstDay: g,
481
- frequency: f,
482
- onFirstDayChange: m,
483
- onFrequencyChange: E,
484
- onSecondDayChange: M,
485
- secondDay: R,
486
- transaction: _
487
- }
488
- )
489
- }
490
- )
491
- ] });
492
- }
493
- ), wt = D(() => {
494
- const { recurring: t } = x(), { repeatingTransactions: n } = N(), { onEvent: o } = q(), c = (r) => {
495
- o(k.RECURRING_TRANSACTIONS_CLICK_INCOME, {
496
- repeating_transaction_guid: r.guid
497
- });
498
- }, a = () => {
499
- o(k.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
500
- }, l = n.filter(
501
- (r) => r.repeating_transaction_type === A.Income && (r.transactions.length > 0 || r.recurrence_type === s.EveryYear)
502
- );
503
- return /* @__PURE__ */ i(j, { sx: { bgcolor: "background.paper" }, children: [
504
- l.map((r, d) => /* @__PURE__ */ i(u.Fragment, { children: [
505
- /* @__PURE__ */ e(Me, { onClick: c, repeatingTransaction: r }),
506
- /* @__PURE__ */ e(O, { variant: d < l.length - 1 ? "inset" : "fullWidth" })
507
- ] }, r.guid)),
508
- /* @__PURE__ */ e(
509
- Ye,
510
- {
511
- isIncome: !0,
512
- label: t.add_income,
513
- onAddRecurringTransaction: a
514
- }
515
- )
516
- ] });
517
- });
518
- export {
519
- Ye as A,
520
- wt as M,
521
- Me as R,
522
- Fe as S,
523
- Ne as a,
524
- Ge as b,
525
- U as c,
526
- Be as i
527
- };
@@ -1,57 +0,0 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import p from "react";
3
- import { observer as d } from "mobx-react-lite";
4
- import R from "@mui/material/Box";
5
- import g from "@mui/material/Tab";
6
- import T from "@mui/material/Tabs";
7
- import b from "@mui/material/Divider";
8
- import f from "@mui/material/List";
9
- import { R as h, A as C, M as E } from "./ManageIncome-B6kmMN_z.mjs";
10
- import { u as l, h as S, e as u } from "./hooks-02T565vf.mjs";
11
- import { R as A, F as v } from "./RepeatingTransaction-BPWfaB3f.mjs";
12
- import { A as m } from "./WidgetContainer-BG-fdDOf.mjs";
13
- const x = d(() => {
14
- const { recurring: r } = l(), { repeatingTransactions: i } = S(), { onEvent: a } = u(), t = (e) => {
15
- a(m.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
16
- repeating_transaction_guid: e.guid
17
- });
18
- }, c = () => {
19
- a(m.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
20
- }, s = i.filter(
21
- (e) => e.repeating_transaction_type !== A.Income && (e.transactions.length > 0 || e.recurrence_type === v.EveryYear)
22
- );
23
- return /* @__PURE__ */ o(f, { sx: { bgcolor: "background.paper" }, children: [
24
- s.map((e, _) => /* @__PURE__ */ o(p.Fragment, { children: [
25
- /* @__PURE__ */ n(h, { onClick: t, repeatingTransaction: e }),
26
- /* @__PURE__ */ n(b, { variant: _ < s.length - 1 ? "inset" : "fullWidth" })
27
- ] }, e.guid)),
28
- /* @__PURE__ */ n(C, { label: r.add_expense, onAddRecurringTransaction: c })
29
- ] });
30
- }), O = d(() => {
31
- const [r, i] = p.useState(0), { onEvent: a } = u(), { recurring: t } = l();
32
- return /* @__PURE__ */ o(R, { bgcolor: "background.default", height: "100%", children: [
33
- /* @__PURE__ */ o(
34
- T,
35
- {
36
- onChange: (s, e) => {
37
- i(e), a(
38
- e === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
39
- );
40
- },
41
- sx: { bgcolor: "background.paper" },
42
- value: r,
43
- variant: "fullWidth",
44
- children: [
45
- /* @__PURE__ */ n(g, { label: t.manage_expenses }),
46
- /* @__PURE__ */ n(g, { label: t.manage_income })
47
- ]
48
- }
49
- ),
50
- r === 0 && /* @__PURE__ */ n(x, {}),
51
- r === 1 && /* @__PURE__ */ n(E, {})
52
- ] });
53
- });
54
- export {
55
- x as M,
56
- O as R
57
- };