@mx-cartographer/experiences 7.2.15-alpha.sms5 → 7.2.15-alpha.sms7
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.
|
@@ -4,24 +4,24 @@ import U from "@mui/material/FormControlLabel";
|
|
|
4
4
|
import K from "@mui/material/Radio";
|
|
5
5
|
import V from "@mui/material/styles/useTheme";
|
|
6
6
|
import v from "@mui/material/Tooltip";
|
|
7
|
-
import { makeAutoObservable as y, runInAction as d } from "mobx";
|
|
7
|
+
import { makeAutoObservable as y, runInAction as d, reaction as B } from "mobx";
|
|
8
8
|
import { endOfToday as D } from "date-fns/endOfToday";
|
|
9
|
-
import { formatISO as
|
|
9
|
+
import { formatISO as Y } from "date-fns/formatISO";
|
|
10
10
|
import { fromUnixTime as h } from "date-fns/fromUnixTime";
|
|
11
11
|
import { getUnixTime as u } from "date-fns/getUnixTime";
|
|
12
|
-
import { isBefore as
|
|
12
|
+
import { isBefore as F } from "date-fns/isBefore";
|
|
13
13
|
import { startOfMonth as R } from "date-fns/startOfMonth";
|
|
14
14
|
import { startOfToday as b } from "date-fns/startOfToday";
|
|
15
|
-
import { subDays as
|
|
15
|
+
import { subDays as W } from "date-fns/subDays";
|
|
16
16
|
import { O as n, a as G, T as w } from "./User-BQUxBeZV.mjs";
|
|
17
17
|
import { T as p } from "./TransactionApi-B3Tksf7L.mjs";
|
|
18
|
-
import { b as
|
|
19
|
-
import { f as
|
|
20
|
-
import { format as
|
|
21
|
-
import { f as g, D as O, O as
|
|
22
|
-
import { endOfMonth as
|
|
18
|
+
import { b as z } from "./Category-CevNQ03n.mjs";
|
|
19
|
+
import { f as k } from "./exportTransactionsToCSV-7bVS7KXf.mjs";
|
|
20
|
+
import { format as $ } from "date-fns/format";
|
|
21
|
+
import { f as g, D as O, O as X } from "./Dialog-CWW597AF.mjs";
|
|
22
|
+
import { endOfMonth as j } from "date-fns/endOfMonth";
|
|
23
23
|
import { B as f } from "./BeatApi-DhJpgCLz.mjs";
|
|
24
|
-
const
|
|
24
|
+
const Z = ({
|
|
25
25
|
checked: l = !1,
|
|
26
26
|
label: t,
|
|
27
27
|
sx: a = {},
|
|
@@ -59,7 +59,7 @@ const j = ({
|
|
|
59
59
|
) })
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
},
|
|
62
|
+
}, mt = Z, x = {
|
|
63
63
|
ASC: "ASC",
|
|
64
64
|
DESC: "DESC",
|
|
65
65
|
DIRECTION: {
|
|
@@ -322,14 +322,14 @@ const j = ({
|
|
|
322
322
|
category: o.TRANSACTIONS_WIDGET,
|
|
323
323
|
label: r.DELETE_TRANSACTION
|
|
324
324
|
}
|
|
325
|
-
},
|
|
325
|
+
}, q = async (l, t) => !t || !m[l] ? null : t.sendAnalyticEvent(m[l]), L = {
|
|
326
326
|
FLAG: "flag",
|
|
327
327
|
DATE: "date",
|
|
328
328
|
PAYEE: "payee",
|
|
329
329
|
CATEGORY: "category",
|
|
330
330
|
ACCOUNT: "account",
|
|
331
331
|
AMOUNT: "amount"
|
|
332
|
-
},
|
|
332
|
+
}, J = (l, t, a, e = []) => {
|
|
333
333
|
const c = t.reduce((A, i) => ({ ...A, [i.guid]: i }), {}), _ = a.reduce((A, i) => ({ ...A, [i.guid]: i }), {}), s = e.reduce((A, i) => {
|
|
334
334
|
const { transaction_guid: N, tag_guid: I } = i;
|
|
335
335
|
if (!A[N])
|
|
@@ -351,20 +351,20 @@ const j = ({
|
|
|
351
351
|
accountIsClosed: i?.is_closed,
|
|
352
352
|
accountIsHidden: i?.is_hidden,
|
|
353
353
|
category: N?.name || "Uncategorized",
|
|
354
|
-
isIncome: A.top_level_category_guid ===
|
|
354
|
+
isIncome: A.top_level_category_guid === z.INCOME,
|
|
355
355
|
isPending: A.feed_status === G.PENDING,
|
|
356
356
|
number: i?.account_number || "",
|
|
357
357
|
payee: A.description,
|
|
358
358
|
tags: I
|
|
359
359
|
};
|
|
360
360
|
});
|
|
361
|
-
},
|
|
362
|
-
const s =
|
|
361
|
+
}, Q = "uncategorized", tt = (l, t, a, e, c, _) => {
|
|
362
|
+
const s = at(l, c, _), A = et(s, a, e);
|
|
363
363
|
return t.forEach((i) => {
|
|
364
364
|
const N = A.findIndex((E) => E.guid === i), I = _.filter((E) => E.parent_guid === i);
|
|
365
365
|
A.splice(N + 1, 0, ...I);
|
|
366
366
|
}), A;
|
|
367
|
-
},
|
|
367
|
+
}, at = (l, t, a) => {
|
|
368
368
|
const {
|
|
369
369
|
accounts: e = [],
|
|
370
370
|
dateRange: c = { start: R(b()), end: D() },
|
|
@@ -373,23 +373,23 @@ const j = ({
|
|
|
373
373
|
showSplits: A = !1
|
|
374
374
|
} = l;
|
|
375
375
|
return a.filter((i) => A ? !i.has_been_split : !i.parent_guid).filter((i) => !!e.find((N) => N === i.account_guid)).filter((i) => i.date >= u(c.start) && i.date <= u(c.end)).filter(_).filter((i) => {
|
|
376
|
-
if (s ===
|
|
376
|
+
if (s === Q && i.has_been_split)
|
|
377
377
|
return !1;
|
|
378
378
|
if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
|
|
379
379
|
return !0;
|
|
380
380
|
const I = i.tags.some(
|
|
381
381
|
(M) => S(s, t.find((H) => H.guid === M)?.name)
|
|
382
382
|
), E = h(i.date);
|
|
383
|
-
return S(s, i.payee) || S(s, i.feed_description) || S(s, i.category) || S(s, g(E, O.MONTH)) || S(s, g(E, O.DAY)) || S(s, g(E, O.FULL_MONTH_DAY)) || S(s, g(E, O.MONTH_DAY_YEAR)) || S(s,
|
|
383
|
+
return S(s, i.payee) || S(s, i.feed_description) || S(s, i.category) || S(s, g(E, O.MONTH)) || S(s, g(E, O.DAY)) || S(s, g(E, O.FULL_MONTH_DAY)) || S(s, g(E, O.MONTH_DAY_YEAR)) || S(s, $(E, X)) || S(s, i.account) || S(s, `${i.amount}`) || S(s, i.memo) || I;
|
|
384
384
|
});
|
|
385
|
-
},
|
|
385
|
+
}, et = (l, t, a) => [...l].sort((e, c) => {
|
|
386
386
|
const _ = t, s = (e[_] || "") > (c[_] || "");
|
|
387
387
|
let A = s ? -1 : 1, i = s ? 1 : -1;
|
|
388
388
|
return (t === L.DATE || t === L.AMOUNT) && (A = s ? 1 : -1, i = s ? -1 : 1), a === x.ASC ? A : i;
|
|
389
389
|
}), S = (l, t) => {
|
|
390
390
|
const a = l.toLowerCase().split(" "), e = t?.toString().toLowerCase() ?? "";
|
|
391
391
|
return a.every((c) => e.indexOf(c) > -1);
|
|
392
|
-
},
|
|
392
|
+
}, st = {
|
|
393
393
|
account_guid: "",
|
|
394
394
|
amount: 0,
|
|
395
395
|
currency_code: "",
|
|
@@ -418,9 +418,9 @@ const j = ({
|
|
|
418
418
|
memo: void 0,
|
|
419
419
|
tags: []
|
|
420
420
|
};
|
|
421
|
-
class
|
|
421
|
+
class it {
|
|
422
422
|
beginDate = R(/* @__PURE__ */ new Date());
|
|
423
|
-
endDate =
|
|
423
|
+
endDate = j(/* @__PURE__ */ new Date());
|
|
424
424
|
expandedSplits = [];
|
|
425
425
|
isInitialized = !1;
|
|
426
426
|
height = 550;
|
|
@@ -428,7 +428,7 @@ class st {
|
|
|
428
428
|
shouldDisableDrawerScroll = !1;
|
|
429
429
|
searchValue = "";
|
|
430
430
|
selectedAccountGuids = [];
|
|
431
|
-
manualTransaction =
|
|
431
|
+
manualTransaction = st;
|
|
432
432
|
isAmountValid = !1;
|
|
433
433
|
showInsights = !1;
|
|
434
434
|
constructor() {
|
|
@@ -459,13 +459,13 @@ class st {
|
|
|
459
459
|
this.manualTransaction = t;
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
class
|
|
462
|
+
class yt {
|
|
463
463
|
globalStore;
|
|
464
464
|
uiStore;
|
|
465
465
|
api = new p("/", "");
|
|
466
466
|
beatApi = new f("/", "");
|
|
467
467
|
associatedBeats = [];
|
|
468
|
-
cachedStartDate =
|
|
468
|
+
cachedStartDate = W(b(), 90);
|
|
469
469
|
filter = {};
|
|
470
470
|
isLoading = !0;
|
|
471
471
|
rawTransactions = [];
|
|
@@ -475,9 +475,9 @@ class mt {
|
|
|
475
475
|
tags = [];
|
|
476
476
|
transactionRules = [];
|
|
477
477
|
listeners = [];
|
|
478
|
-
onAnalyticEvent =
|
|
478
|
+
onAnalyticEvent = q;
|
|
479
479
|
constructor(t) {
|
|
480
|
-
this.globalStore = t, this.uiStore = new
|
|
480
|
+
this.globalStore = t, this.uiStore = new it(), this.api = new p(
|
|
481
481
|
t.endpoint,
|
|
482
482
|
t.sessionToken,
|
|
483
483
|
t.onError
|
|
@@ -502,9 +502,14 @@ class mt {
|
|
|
502
502
|
subscribe = (t) => (this.listeners = [...this.listeners, t], () => {
|
|
503
503
|
this.listeners = this.listeners.filter((a) => a !== t);
|
|
504
504
|
});
|
|
505
|
-
getSnapshot = () =>
|
|
505
|
+
getSnapshot = () => {
|
|
506
|
+
B(
|
|
507
|
+
() => this.transactions,
|
|
508
|
+
(t) => t
|
|
509
|
+
);
|
|
510
|
+
};
|
|
506
511
|
get sortedTransactions() {
|
|
507
|
-
return
|
|
512
|
+
return tt(
|
|
508
513
|
this.filter,
|
|
509
514
|
this.uiStore.expandedSplits,
|
|
510
515
|
this.sortColumn,
|
|
@@ -514,7 +519,7 @@ class mt {
|
|
|
514
519
|
);
|
|
515
520
|
}
|
|
516
521
|
get sortedTransactionsWithSplits() {
|
|
517
|
-
return
|
|
522
|
+
return k(this.sortedTransactions, this.transactions);
|
|
518
523
|
}
|
|
519
524
|
get transactions() {
|
|
520
525
|
return this.augmentTransactions(this.rawTransactions);
|
|
@@ -550,7 +555,7 @@ class mt {
|
|
|
550
555
|
this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
|
|
551
556
|
}
|
|
552
557
|
};
|
|
553
|
-
augmentTransactions = (t) =>
|
|
558
|
+
augmentTransactions = (t) => J(
|
|
554
559
|
t,
|
|
555
560
|
this.globalStore.accountStore.visibleAccounts,
|
|
556
561
|
this.globalStore.categoryStore.categories,
|
|
@@ -558,7 +563,7 @@ class mt {
|
|
|
558
563
|
);
|
|
559
564
|
getTransactionData = () => ({});
|
|
560
565
|
loadAssociatedBeats = async (t, a) => {
|
|
561
|
-
const e = t ?
|
|
566
|
+
const e = t ? Y(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
|
|
562
567
|
d(() => this.associatedBeats = c);
|
|
563
568
|
};
|
|
564
569
|
loadTags = async () => {
|
|
@@ -612,7 +617,7 @@ class mt {
|
|
|
612
617
|
}
|
|
613
618
|
};
|
|
614
619
|
setFilter = (t) => {
|
|
615
|
-
this.filter = t, t.dateRange &&
|
|
620
|
+
this.filter = t, t.dateRange && F(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
|
|
616
621
|
t.dateRange && (this.cachedStartDate = t.dateRange.start);
|
|
617
622
|
});
|
|
618
623
|
};
|
|
@@ -676,7 +681,7 @@ class mt {
|
|
|
676
681
|
};
|
|
677
682
|
}
|
|
678
683
|
export {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
684
|
+
st as D,
|
|
685
|
+
mt as S,
|
|
686
|
+
yt as T
|
|
682
687
|
};
|
package/dist/common/index.es.js
CHANGED
|
@@ -18,8 +18,8 @@ import { C as Ys } from "../CurrencyInput-DUsQbkXb.mjs";
|
|
|
18
18
|
import { L as zs } from "../Loader-DUaFpDGv.mjs";
|
|
19
19
|
import { R as js } from "../ResponsiveButton-DZFp78fJ.mjs";
|
|
20
20
|
import { S as Vs } from "../SearchBox-B2_zLv8-.mjs";
|
|
21
|
-
import { T as at } from "../TransactionStore-
|
|
22
|
-
import { S as Js } from "../TransactionStore-
|
|
21
|
+
import { T as at } from "../TransactionStore-bphuV3xu.mjs";
|
|
22
|
+
import { S as Js } from "../TransactionStore-bphuV3xu.mjs";
|
|
23
23
|
import { T as er } from "../TabContentContainer-j01JYR_7.mjs";
|
|
24
24
|
import { I as rr } from "../IconBacking-B9oC6uL2.mjs";
|
|
25
25
|
import { D as ar, F as nr, a as ir, c as cr, R as dr, S as lr } from "../RecurringTransactions-ej39mgA6.mjs";
|
|
@@ -3,8 +3,8 @@ import { u as P, C as Pe, D as $e, M as Ve, c as We, T as Ge, a as Ue } from "..
|
|
|
3
3
|
import { B as xa, d as wa, b as Ia } from "../TransactionDetails-BqCr2FTh.mjs";
|
|
4
4
|
import { T as M } from "../User-BQUxBeZV.mjs";
|
|
5
5
|
import { O as Da } from "../User-BQUxBeZV.mjs";
|
|
6
|
-
import { S as ae, D as Fe } from "../TransactionStore-
|
|
7
|
-
import { T as Ea } from "../TransactionStore-
|
|
6
|
+
import { S as ae, D as Fe } from "../TransactionStore-bphuV3xu.mjs";
|
|
7
|
+
import { T as Ea } from "../TransactionStore-bphuV3xu.mjs";
|
|
8
8
|
import { e as ze } from "../exportTransactionsToCSV-7bVS7KXf.mjs";
|
|
9
9
|
import { E as Ma } from "../ExportCsvAction-sX8Rg4Ov.mjs";
|
|
10
10
|
import { jsxs as _, jsx as e } from "react/jsx-runtime";
|
|
@@ -37,7 +37,7 @@ export declare class TransactionStore {
|
|
|
37
37
|
transactions?: Transaction[];
|
|
38
38
|
}) => Promise<void>;
|
|
39
39
|
subscribe: (listener: any) => () => void;
|
|
40
|
-
getSnapshot: () =>
|
|
40
|
+
getSnapshot: () => void;
|
|
41
41
|
get sortedTransactions(): Transaction[];
|
|
42
42
|
get sortedTransactionsWithSplits(): Transaction[];
|
|
43
43
|
get transactions(): Transaction[];
|