@mx-cartographer/experiences 7.2.15-alpha.sms5 → 7.2.15-alpha.sms6

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, autorun as B } from "mobx";
8
8
  import { endOfToday as D } from "date-fns/endOfToday";
9
- import { formatISO as B } from "date-fns/formatISO";
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 Y } from "date-fns/isBefore";
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 F } from "date-fns/subDays";
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 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";
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 j = ({
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
- }, ft = j, x = {
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
- }, Z = async (l, t) => !t || !m[l] ? null : t.sendAnalyticEvent(m[l]), L = {
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
- }, q = (l, t, a, e = []) => {
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 === W.INCOME,
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
- }, J = "uncategorized", Q = (l, t, a, e, c, _) => {
362
- const s = tt(l, c, _), A = at(s, a, e);
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
- }, tt = (l, t, a) => {
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 === J && i.has_been_split)
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, k(E, $)) || S(s, i.account) || S(s, `${i.amount}`) || S(s, i.memo) || I;
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
- }, at = (l, t, a) => [...l].sort((e, c) => {
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
- }, et = {
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 st {
421
+ class it {
422
422
  beginDate = R(/* @__PURE__ */ new Date());
423
- endDate = X(/* @__PURE__ */ new Date());
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 = et;
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 mt {
462
+ class yt {
463
463
  globalStore;
464
464
  uiStore;
465
465
  api = new p("/", "");
466
466
  beatApi = new f("/", "");
467
467
  associatedBeats = [];
468
- cachedStartDate = F(b(), 90);
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 = Z;
478
+ onAnalyticEvent = q;
479
479
  constructor(t) {
480
- this.globalStore = t, this.uiStore = new st(), this.api = new p(
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,11 @@ 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 = () => this;
505
+ getSnapshot = () => {
506
+ B(() => this.transactions);
507
+ };
506
508
  get sortedTransactions() {
507
- return Q(
509
+ return tt(
508
510
  this.filter,
509
511
  this.uiStore.expandedSplits,
510
512
  this.sortColumn,
@@ -514,7 +516,7 @@ class mt {
514
516
  );
515
517
  }
516
518
  get sortedTransactionsWithSplits() {
517
- return z(this.sortedTransactions, this.transactions);
519
+ return k(this.sortedTransactions, this.transactions);
518
520
  }
519
521
  get transactions() {
520
522
  return this.augmentTransactions(this.rawTransactions);
@@ -550,7 +552,7 @@ class mt {
550
552
  this.globalStore.accountStore.updateAccountBalance(a.account_guid, e);
551
553
  }
552
554
  };
553
- augmentTransactions = (t) => q(
555
+ augmentTransactions = (t) => J(
554
556
  t,
555
557
  this.globalStore.accountStore.visibleAccounts,
556
558
  this.globalStore.categoryStore.categories,
@@ -558,7 +560,7 @@ class mt {
558
560
  );
559
561
  getTransactionData = () => ({});
560
562
  loadAssociatedBeats = async (t, a) => {
561
- const e = t ? B(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
563
+ const e = t ? Y(t, { representation: "date" }) : void 0, c = a ?? await this.beatApi.getBeatsWithAssociatedTransaction(e);
562
564
  d(() => this.associatedBeats = c);
563
565
  };
564
566
  loadTags = async () => {
@@ -612,7 +614,7 @@ class mt {
612
614
  }
613
615
  };
614
616
  setFilter = (t) => {
615
- this.filter = t, t.dateRange && Y(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
617
+ this.filter = t, t.dateRange && F(t.dateRange.start, this.cachedStartDate) && this.loadTransactions(t.dateRange.start, D()).then(() => {
616
618
  t.dateRange && (this.cachedStartDate = t.dateRange.start);
617
619
  });
618
620
  };
@@ -676,7 +678,7 @@ class mt {
676
678
  };
677
679
  }
678
680
  export {
679
- et as D,
680
- ft as S,
681
- mt as T
681
+ st as D,
682
+ mt as S,
683
+ yt as T
682
684
  };
@@ -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-DPdMpf5m.mjs";
22
- import { S as Js } from "../TransactionStore-DPdMpf5m.mjs";
21
+ import { T as at } from "../TransactionStore-DULGYXzv.mjs";
22
+ import { S as Js } from "../TransactionStore-DULGYXzv.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-DPdMpf5m.mjs";
7
- import { T as Ea } from "../TransactionStore-DPdMpf5m.mjs";
6
+ import { S as ae, D as Fe } from "../TransactionStore-DULGYXzv.mjs";
7
+ import { T as Ea } from "../TransactionStore-DULGYXzv.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: () => this;
40
+ getSnapshot: () => void;
41
41
  get sortedTransactions(): Transaction[];
42
42
  get sortedTransactionsWithSplits(): Transaction[];
43
43
  get transactions(): Transaction[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.2.15-alpha.sms5",
3
+ "version": "7.2.15-alpha.sms6",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",