@mx-cartographer/experiences 7.2.15-alpha.sms3 → 7.2.15-alpha.sms4
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,
|
|
7
|
+
import { makeAutoObservable as y, runInAction as d } from "mobx";
|
|
8
8
|
import { endOfToday as D } from "date-fns/endOfToday";
|
|
9
|
-
import { formatISO as
|
|
9
|
+
import { formatISO as B } 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 Y } 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 F } 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 W } from "./Category-CevNQ03n.mjs";
|
|
19
|
+
import { f as z } from "./exportTransactionsToCSV-7bVS7KXf.mjs";
|
|
20
|
+
import { format as k } from "date-fns/format";
|
|
21
|
+
import { f as g, D as O, O as $ } from "./Dialog-CWW597AF.mjs";
|
|
22
|
+
import { endOfMonth as X } from "date-fns/endOfMonth";
|
|
23
23
|
import { B as f } from "./BeatApi-DhJpgCLz.mjs";
|
|
24
|
-
const
|
|
24
|
+
const j = ({
|
|
25
25
|
checked: l = !1,
|
|
26
26
|
label: t,
|
|
27
27
|
sx: a = {},
|
|
@@ -59,7 +59,7 @@ const Z = ({
|
|
|
59
59
|
) })
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
},
|
|
62
|
+
}, ft = j, x = {
|
|
63
63
|
ASC: "ASC",
|
|
64
64
|
DESC: "DESC",
|
|
65
65
|
DIRECTION: {
|
|
@@ -322,14 +322,14 @@ const Z = ({
|
|
|
322
322
|
category: o.TRANSACTIONS_WIDGET,
|
|
323
323
|
label: r.DELETE_TRANSACTION
|
|
324
324
|
}
|
|
325
|
-
},
|
|
325
|
+
}, Z = 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
|
+
}, q = (l, t, a, e = []) => {
|
|
333
333
|
const c = t.reduce((A, s) => ({ ...A, [s.guid]: s }), {}), _ = a.reduce((A, s) => ({ ...A, [s.guid]: s }), {}), i = e.reduce((A, s) => {
|
|
334
334
|
const { transaction_guid: N, tag_guid: I } = s;
|
|
335
335
|
if (!A[N])
|
|
@@ -351,20 +351,20 @@ const Z = ({
|
|
|
351
351
|
accountIsClosed: s?.is_closed,
|
|
352
352
|
accountIsHidden: s?.is_hidden,
|
|
353
353
|
category: N?.name || "Uncategorized",
|
|
354
|
-
isIncome: A.top_level_category_guid ===
|
|
354
|
+
isIncome: A.top_level_category_guid === W.INCOME,
|
|
355
355
|
isPending: A.feed_status === G.PENDING,
|
|
356
356
|
number: s?.account_number || "",
|
|
357
357
|
payee: A.description,
|
|
358
358
|
tags: I
|
|
359
359
|
};
|
|
360
360
|
});
|
|
361
|
-
},
|
|
362
|
-
const i =
|
|
361
|
+
}, J = "uncategorized", Q = (l, t, a, e, c, _) => {
|
|
362
|
+
const i = tt(l, c, _), A = at(i, a, e);
|
|
363
363
|
return t.forEach((s) => {
|
|
364
364
|
const N = A.findIndex((E) => E.guid === s), I = _.filter((E) => E.parent_guid === s);
|
|
365
365
|
A.splice(N + 1, 0, ...I);
|
|
366
366
|
}), A;
|
|
367
|
-
},
|
|
367
|
+
}, tt = (l, t, a) => {
|
|
368
368
|
const {
|
|
369
369
|
accounts: e = [],
|
|
370
370
|
dateRange: c = { start: R(b()), end: D() },
|
|
@@ -373,23 +373,23 @@ const Z = ({
|
|
|
373
373
|
showSplits: A = !1
|
|
374
374
|
} = l;
|
|
375
375
|
return a.filter((s) => A ? !s.has_been_split : !s.parent_guid).filter((s) => !!e.find((N) => N === s.account_guid)).filter((s) => s.date >= u(c.start) && s.date <= u(c.end)).filter(_).filter((s) => {
|
|
376
|
-
if (i ===
|
|
376
|
+
if (i === J && s.has_been_split)
|
|
377
377
|
return !1;
|
|
378
378
|
if (/^spl/i.test(i) && (s.has_been_split || s.parent_guid))
|
|
379
379
|
return !0;
|
|
380
380
|
const I = s.tags.some(
|
|
381
381
|
(M) => S(i, t.find((H) => H.guid === M)?.name)
|
|
382
382
|
), E = h(s.date);
|
|
383
|
-
return S(i, s.payee) || S(i, s.feed_description) || S(i, s.category) || S(i, g(E, O.MONTH)) || S(i, g(E, O.DAY)) || S(i, g(E, O.FULL_MONTH_DAY)) || S(i, g(E, O.MONTH_DAY_YEAR)) || S(i,
|
|
383
|
+
return S(i, s.payee) || S(i, s.feed_description) || S(i, s.category) || S(i, g(E, O.MONTH)) || S(i, g(E, O.DAY)) || S(i, g(E, O.FULL_MONTH_DAY)) || S(i, g(E, O.MONTH_DAY_YEAR)) || S(i, k(E, $)) || S(i, s.account) || S(i, `${s.amount}`) || S(i, s.memo) || I;
|
|
384
384
|
});
|
|
385
|
-
},
|
|
385
|
+
}, at = (l, t, a) => [...l].sort((e, c) => {
|
|
386
386
|
const _ = t, i = (e[_] || "") > (c[_] || "");
|
|
387
387
|
let A = i ? -1 : 1, s = i ? 1 : -1;
|
|
388
388
|
return (t === L.DATE || t === L.AMOUNT) && (A = i ? 1 : -1, s = i ? -1 : 1), a === x.ASC ? A : s;
|
|
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
|
+
}, et = {
|
|
393
393
|
account_guid: "",
|
|
394
394
|
amount: 0,
|
|
395
395
|
currency_code: "",
|
|
@@ -418,9 +418,9 @@ const Z = ({
|
|
|
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 = X(/* @__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 = et;
|
|
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 mt {
|
|
463
463
|
globalStore;
|
|
464
464
|
uiStore;
|
|
465
465
|
api = new p("/", "");
|
|
466
466
|
beatApi = new f("/", "");
|
|
467
467
|
associatedBeats = [];
|
|
468
|
-
cachedStartDate =
|
|
468
|
+
cachedStartDate = F(b(), 90);
|
|
469
469
|
filter = {};
|
|
470
470
|
isLoading = !0;
|
|
471
471
|
rawTransactions = [];
|
|
@@ -474,13 +474,13 @@ class yt {
|
|
|
474
474
|
taggings = [];
|
|
475
475
|
tags = [];
|
|
476
476
|
transactionRules = [];
|
|
477
|
-
onAnalyticEvent =
|
|
477
|
+
onAnalyticEvent = Z;
|
|
478
478
|
constructor(t) {
|
|
479
|
-
this.globalStore = t, this.uiStore = new
|
|
479
|
+
this.globalStore = t, this.uiStore = new it(), this.api = new p(
|
|
480
480
|
t.endpoint,
|
|
481
481
|
t.sessionToken,
|
|
482
482
|
t.onError
|
|
483
|
-
), this.beatApi = new f(t.endpoint, t.sessionToken, t.onError), y(this)
|
|
483
|
+
), this.beatApi = new f(t.endpoint, t.sessionToken, t.onError), y(this);
|
|
484
484
|
}
|
|
485
485
|
loadTransactionData = async ({
|
|
486
486
|
associatedBeats: t,
|
|
@@ -499,7 +499,7 @@ class yt {
|
|
|
499
499
|
});
|
|
500
500
|
};
|
|
501
501
|
get sortedTransactions() {
|
|
502
|
-
return
|
|
502
|
+
return Q(
|
|
503
503
|
this.filter,
|
|
504
504
|
this.uiStore.expandedSplits,
|
|
505
505
|
this.sortColumn,
|
|
@@ -509,7 +509,7 @@ class yt {
|
|
|
509
509
|
);
|
|
510
510
|
}
|
|
511
511
|
get sortedTransactionsWithSplits() {
|
|
512
|
-
return
|
|
512
|
+
return z(this.sortedTransactions, this.transactions);
|
|
513
513
|
}
|
|
514
514
|
get transactions() {
|
|
515
515
|
return this.augmentTransactions(this.rawTransactions);
|
|
@@ -545,7 +545,7 @@ class yt {
|
|
|
545
545
|
this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
|
-
augmentTransactions = (t) =>
|
|
548
|
+
augmentTransactions = (t) => q(
|
|
549
549
|
t,
|
|
550
550
|
this.globalStore.accountStore.visibleAccounts,
|
|
551
551
|
this.globalStore.categoryStore.categories,
|
|
@@ -553,7 +553,7 @@ class yt {
|
|
|
553
553
|
);
|
|
554
554
|
getTransactionData = () => ({});
|
|
555
555
|
loadAssociatedBeats = async (t, a) => {
|
|
556
|
-
const e = t ?
|
|
556
|
+
const e = t ? B(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
|
|
557
557
|
d(() => this.associatedBeats = c);
|
|
558
558
|
};
|
|
559
559
|
loadTags = async () => {
|
|
@@ -607,7 +607,7 @@ class yt {
|
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
609
|
setFilter = (t) => {
|
|
610
|
-
this.filter = t, t.dateRange &&
|
|
610
|
+
this.filter = t, t.dateRange && Y(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
|
|
611
611
|
t.dateRange && (this.cachedStartDate = t.dateRange.start);
|
|
612
612
|
});
|
|
613
613
|
};
|
|
@@ -671,7 +671,7 @@ class yt {
|
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
673
|
export {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
et as D,
|
|
675
|
+
ft as S,
|
|
676
|
+
mt as T
|
|
677
677
|
};
|
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-RGu9PZK8.mjs";
|
|
22
|
+
import { S as Js } from "../TransactionStore-RGu9PZK8.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";
|
|
@@ -1198,6 +1198,7 @@ class Je {
|
|
|
1198
1198
|
userStore;
|
|
1199
1199
|
// UI Stores
|
|
1200
1200
|
globalUiStore;
|
|
1201
|
+
listeners = [];
|
|
1201
1202
|
constructor(t = K, e = "/", r) {
|
|
1202
1203
|
this.appConfig = t, this.endpoint = e, this.sessionToken = t.options.session_token ?? "", this.onError = r, this.accountStore = new ft(this), this.appDataStore = new ie(this), this.analyticsStore = new ee(this), this.beatStore = new St(this), this.budgetsStore = new se(this), this.cashflowStore = new nt(this), this.categoryStore = new et(this), this.connectStore = new ce(this), this.copyStore = new te(this), this.debtsStore = new xt(this), this.finstrongStore = new Ct(this), this.goalStore = new it(this), this.helpStore = new ae(this), this.holdingStore = new ne(this), this.merchantStore = new Tt(this), this.netWorthStore = new Bt(this), this.notificationStore = new st(this), this.recurringTransactionsStore = new mt(this), this.settingsStore = new It(this), this.transactionStore = new at(this), this.trendsStore = new ct(this), this.userStore = new le(this), this.globalUiStore = new de(this), f(this);
|
|
1203
1204
|
}
|
|
@@ -1229,6 +1230,10 @@ class Je {
|
|
|
1229
1230
|
})
|
|
1230
1231
|
]), this.globalUiStore.setInitialized(!0);
|
|
1231
1232
|
};
|
|
1233
|
+
subscribe = (t) => (this.listeners = [...this.listeners, t], () => {
|
|
1234
|
+
this.listeners = this.listeners.filter((e) => e !== t);
|
|
1235
|
+
});
|
|
1236
|
+
getSnapshot = () => this;
|
|
1232
1237
|
}
|
|
1233
1238
|
export {
|
|
1234
1239
|
vs as ANALYTICS_EVENTS,
|
|
@@ -64,8 +64,11 @@ export declare class GlobalStore {
|
|
|
64
64
|
trendsStore: TrendsStore;
|
|
65
65
|
userStore: UserStore;
|
|
66
66
|
globalUiStore: GlobalUiStore;
|
|
67
|
+
listeners: any;
|
|
67
68
|
constructor(appConfig?: AppConfig, endpoint?: string, onError?: GlobalErrorHandler);
|
|
68
69
|
get isInitialized(): boolean;
|
|
69
70
|
loadData: ({ accounts, appData, associatedBeats, categories, institutions, transactionRules, transactions, userFeatures, }?: LoadDataProps) => Promise<void>;
|
|
71
|
+
subscribe: (listener: any) => () => void;
|
|
72
|
+
getSnapshot: () => this;
|
|
70
73
|
}
|
|
71
74
|
export {};
|
|
@@ -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-RGu9PZK8.mjs";
|
|
7
|
+
import { T as Ea } from "../TransactionStore-RGu9PZK8.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";
|