@mx-cartographer/experiences 7.7.0-alpha.bb1 → 7.7.0-alpha.bb2

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.
@@ -9,16 +9,16 @@ import { endOfToday as f } from "date-fns/endOfToday";
9
9
  import { formatISO as K } from "date-fns/formatISO";
10
10
  import { getUnixTime as O } from "date-fns/getUnixTime";
11
11
  import { isBefore as V } from "date-fns/isBefore";
12
- import { startOfMonth as L } from "date-fns/startOfMonth";
12
+ import { startOfMonth as h } from "date-fns/startOfMonth";
13
13
  import { startOfToday as m } from "date-fns/startOfToday";
14
14
  import { subDays as v } from "date-fns/subDays";
15
15
  import { O as n, a as y, T as b } from "./User-Byn3qkWJ.mjs";
16
- import { T as h } from "./TransactionApi-CjBoLleL.mjs";
16
+ import { T as D } from "./TransactionApi-CjBoLleL.mjs";
17
17
  import { b as Y } from "./Category-CevNQ03n.mjs";
18
18
  import { f as F } from "./exportTransactionsToCSV-DgJVlkJP.mjs";
19
19
  import { format as W } from "date-fns/format";
20
20
  import { fromUnixTime as $ } from "date-fns/fromUnixTime";
21
- import { f as C, D as I, O as k } from "./Dialog-B4PI-_bL.mjs";
21
+ import { f as I, D as C, O as k } from "./Dialog-B4PI-_bL.mjs";
22
22
  import { endOfMonth as z } from "date-fns/endOfMonth";
23
23
  import { B as u } from "./BeatApi-De2IaqH2.mjs";
24
24
  const X = ({
@@ -322,7 +322,7 @@ const X = ({
322
322
  category: T.TRANSACTIONS_WIDGET,
323
323
  label: r.DELETE_TRANSACTION
324
324
  }
325
- }, j = async (l, t) => !t || !R[l] ? null : t.sendAnalyticEvent(R[l]), D = {
325
+ }, j = async (l, t) => !t || !R[l] ? null : t.sendAnalyticEvent(R[l]), L = {
326
326
  FLAG: "flag",
327
327
  DATE: "date",
328
328
  PAYEE: "payee",
@@ -331,20 +331,20 @@ const X = ({
331
331
  AMOUNT: "amount"
332
332
  }, Z = (l, t, a, e = []) => {
333
333
  const A = t.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), d = a.reduce((c, i) => ({ ...c, [i.guid]: i }), {}), s = e.reduce((c, i) => {
334
- const { transaction_guid: S, tag_guid: g } = i;
334
+ const { transaction_guid: S, tag_guid: N } = i;
335
335
  if (!c[S])
336
336
  return {
337
337
  ...c,
338
- [S]: [g]
338
+ [S]: [N]
339
339
  };
340
- const N = [...c[S], g];
340
+ const g = [...c[S], N];
341
341
  return {
342
342
  ...c,
343
- [S]: N
343
+ [S]: g
344
344
  };
345
345
  }, {});
346
346
  return l.map((c) => {
347
- const i = A[c.account_guid], S = c.category_guid ? d[c.category_guid] : null, g = s[c.guid] ?? [];
347
+ const i = A[c.account_guid], S = c.category_guid ? d[c.category_guid] : null, N = s[c.guid] ?? [];
348
348
  return {
349
349
  ...c,
350
350
  account: i?.user_name || "Unknown",
@@ -355,19 +355,19 @@ const X = ({
355
355
  isPending: c.feed_status === y.PENDING,
356
356
  number: i?.account_number || "",
357
357
  payee: c.description,
358
- tags: g
358
+ tags: N
359
359
  };
360
360
  });
361
361
  }, q = "uncategorized", J = (l, t, a, e, A, d) => {
362
362
  const s = Q(l, A, d), c = tt(s, a, e);
363
363
  return t.forEach((i) => {
364
- const S = c.findIndex((N) => N.guid === i), g = d.filter((N) => N.parent_guid === i);
365
- c.splice(S + 1, 0, ...g);
364
+ const S = c.findIndex((g) => g.guid === i), N = d.filter((g) => g.parent_guid === i);
365
+ c.splice(S + 1, 0, ...N);
366
366
  }), c;
367
367
  }, Q = (l, t, a) => {
368
368
  const {
369
369
  accounts: e = [],
370
- dateRange: A = { start: L(m()), end: f() },
370
+ dateRange: A = { start: h(m()), end: f() },
371
371
  custom: d = () => !0,
372
372
  searchTerm: s = "",
373
373
  showSplits: c = !1
@@ -377,15 +377,15 @@ const X = ({
377
377
  return !1;
378
378
  if (/^spl/i.test(s) && (i.has_been_split || i.parent_guid))
379
379
  return !0;
380
- const g = i.tags.some(
380
+ const N = i.tags.some(
381
381
  (w) => _(s, t.find((x) => x.guid === w)?.name)
382
- ), N = $(i.date);
383
- return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, C(N, I.MONTH)) || _(s, C(N, I.DAY)) || _(s, C(N, I.FULL_MONTH_DAY)) || _(s, C(N, I.MONTH_DAY_YEAR)) || _(s, W(N, k)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || g;
382
+ ), g = $(i.date);
383
+ return _(s, i.payee) || _(s, i.feed_description) || _(s, i.category) || _(s, I(g, C.MONTH)) || _(s, I(g, C.DAY)) || _(s, I(g, C.FULL_MONTH_DAY)) || _(s, I(g, C.MONTH_DAY_YEAR)) || _(s, W(g, k)) || _(s, i.account) || _(s, `${i.amount}`) || _(s, i.memo) || N;
384
384
  });
385
385
  }, tt = (l, t, a) => [...l].sort((e, A) => {
386
386
  const d = t, s = (e[d] || "") > (A[d] || "");
387
387
  let c = s ? -1 : 1, i = s ? 1 : -1;
388
- return (t === D.DATE || t === D.AMOUNT) && (c = s ? 1 : -1, i = s ? -1 : 1), a === G.ASC ? c : i;
388
+ return (t === L.DATE || t === L.AMOUNT) && (c = s ? 1 : -1, i = s ? -1 : 1), a === G.ASC ? c : i;
389
389
  }), _ = (l, t) => {
390
390
  const a = l.toLowerCase().split(" "), e = t?.toString().toLowerCase() ?? "";
391
391
  return a.every((A) => e.indexOf(A) > -1);
@@ -419,7 +419,7 @@ const X = ({
419
419
  tags: []
420
420
  };
421
421
  class et {
422
- beginDate = L(/* @__PURE__ */ new Date());
422
+ beginDate = h(/* @__PURE__ */ new Date());
423
423
  endDate = z(/* @__PURE__ */ new Date());
424
424
  expandedSplits = [];
425
425
  height = 550;
@@ -460,14 +460,14 @@ class et {
460
460
  class ft {
461
461
  globalStore;
462
462
  uiStore;
463
- api = new h("/", "");
463
+ api = new D("/", "");
464
464
  beatApi = new u("/", "");
465
465
  associatedBeats = [];
466
466
  associatedBeatsLoaded = !1;
467
467
  associatedBeatsLoading = !1;
468
468
  transactions = [];
469
469
  transactionsLoaded = !1;
470
- isLoading = !0;
470
+ transactionsLoading = !1;
471
471
  taggings = [];
472
472
  taggingsLoaded = !1;
473
473
  taggingsLoading = !1;
@@ -479,11 +479,12 @@ class ft {
479
479
  transactionRulesLoading = !1;
480
480
  cachedStartDate = v(m(), 90);
481
481
  filter = {};
482
- sortColumn = D.DATE;
482
+ isLoading = !0;
483
+ sortColumn = L.DATE;
483
484
  sortDirection = G.DESC;
484
485
  onAnalyticEvent = j;
485
486
  constructor(t) {
486
- this.globalStore = t, this.uiStore = new et(), this.api = new h(
487
+ this.globalStore = t, this.uiStore = new et(), this.api = new D(
487
488
  t.endpoint,
488
489
  t.sessionToken,
489
490
  t.onError
@@ -491,7 +492,7 @@ class ft {
491
492
  }
492
493
  loadTransactionData = async () => {
493
494
  this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.categoryStore.categoriesLoaded || await this.globalStore.categoryStore.loadCategories(), await Promise.all([
494
- this.loadAssociatedBeats(L(/* @__PURE__ */ new Date())),
495
+ this.loadAssociatedBeats(h(/* @__PURE__ */ new Date())),
495
496
  this.loadTags(),
496
497
  this.loadTaggings(),
497
498
  this.loadTransactionRules(),
@@ -536,7 +537,7 @@ class ft {
536
537
  this.transactionRules = t, this.transactionRulesLoading = !1, this.transactionRulesLoaded = !0;
537
538
  };
538
539
  setTransactions = (t) => {
539
- this.transactions = t, this.isLoading = !1, this.transactionsLoaded = !0;
540
+ this.transactions = t, this.transactionsLoading = !1, this.transactionsLoaded = !0;
540
541
  };
541
542
  addTag = async (t) => {
542
543
  await this.api.addTag({ name: t }), await this.loadTags();
@@ -609,8 +610,8 @@ class ft {
609
610
  this.setTransactionRules(t);
610
611
  };
611
612
  loadTransactions = async (t = this.cachedStartDate) => {
612
- if (!this.isLoading) {
613
- this.setIsLoading(!0), this.transactions = [];
613
+ if (!this.transactionsLoading) {
614
+ this.setIsLoading(!0), this.transactionsLoading = !0, this.transactions = [];
614
615
  try {
615
616
  const a = await this.api.getTransactionsByDateRange(
616
617
  O(t),
@@ -620,6 +621,7 @@ class ft {
620
621
  } catch (a) {
621
622
  console.error(`Error occurred while loading transactions: ${a}`);
622
623
  }
624
+ this.setIsLoading(!1);
623
625
  }
624
626
  };
625
627
  modifyTransactionByAccountGuid = (t, a) => {
@@ -19,8 +19,8 @@ import { u as yt, f as St } from "../Loader-CTlCnT5j.mjs";
19
19
  import { G as ws, C as Cs, L as xs, D as As, W as vs, d as Ds, a as Es, i as Ts, v as Bs, m as Is, x as Ns, y as Ms, g as ks, z as Ls, b as Os, l as $s, A as Ps, t as Rs, o as Us, c as Fs, r as Hs, n as Gs, B as Ws, j as qs, s as zs, h as Ys, w as Qs, p as js, q as Xs } from "../Loader-CTlCnT5j.mjs";
20
20
  import { R as Vs } from "../ResponsiveButton-DZFp78fJ.mjs";
21
21
  import { S as Js } from "../SearchBox-B2_zLv8-.mjs";
22
- import { T as bt } from "../TransactionStore-DcsITl72.mjs";
23
- import { S as eo } from "../TransactionStore-DcsITl72.mjs";
22
+ import { T as bt } from "../TransactionStore-CSROwR-X.mjs";
23
+ import { S as eo } from "../TransactionStore-CSROwR-X.mjs";
24
24
  import { T as so } from "../TabContentContainer-j01JYR_7.mjs";
25
25
  import { I as ao } from "../IconBacking-B9oC6uL2.mjs";
26
26
  import { D as no, F as co, c as lo, d as uo, R as ho, S as po } from "../RecurringTransactions-YQcbogIO.mjs";
@@ -3,8 +3,8 @@ import { u as P, C as Be, D as Pe, M as $e, c as Ve, T as We, a as Ge } from "..
3
3
  import { B as wa, d as Ia, b as va } from "../TransactionDetails-CvOJsYX6.mjs";
4
4
  import { T as O } from "../User-Byn3qkWJ.mjs";
5
5
  import { O as Na } from "../User-Byn3qkWJ.mjs";
6
- import { S as ae, D as Ue } from "../TransactionStore-DcsITl72.mjs";
7
- import { T as Oa } from "../TransactionStore-DcsITl72.mjs";
6
+ import { S as ae, D as Ue } from "../TransactionStore-CSROwR-X.mjs";
7
+ import { T as Oa } from "../TransactionStore-CSROwR-X.mjs";
8
8
  import { e as Fe } from "../exportTransactionsToCSV-DgJVlkJP.mjs";
9
9
  import { E as La } from "../ExportCsvAction-DhE9olsw.mjs";
10
10
  import { jsxs as p, jsx as e } from "react/jsx-runtime";
@@ -21,7 +21,7 @@ export declare class TransactionStore {
21
21
  associatedBeatsLoading: boolean;
22
22
  transactions: Transaction[];
23
23
  transactionsLoaded: boolean;
24
- isLoading: boolean;
24
+ transactionsLoading: boolean;
25
25
  taggings: Tagging[];
26
26
  taggingsLoaded: boolean;
27
27
  taggingsLoading: boolean;
@@ -33,6 +33,7 @@ export declare class TransactionStore {
33
33
  transactionRulesLoading: boolean;
34
34
  cachedStartDate: Date;
35
35
  filter: TransactionFilter;
36
+ isLoading: boolean;
36
37
  sortColumn: string;
37
38
  sortDirection: string;
38
39
  onAnalyticEvent: (event: string, session: import('../analytics').AnalyticSession | null) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.7.0-alpha.bb1",
3
+ "version": "7.7.0-alpha.bb2",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",