@mx-cartographer/experiences 6.26.3-alpha.sms2 → 6.26.3-alpha.sms3

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.
package/dist/index.es.js CHANGED
@@ -5604,11 +5604,11 @@ class Dh {
5604
5604
  this.sortColumn,
5605
5605
  this.sortDirection,
5606
5606
  this.tags,
5607
- this.transactions
5607
+ this.rawTransactions
5608
5608
  );
5609
5609
  }
5610
5610
  get sortedTransactionsWithSplits() {
5611
- return mh(this.sortedTransactions, this.transactions);
5611
+ return mh(this.sortedTransactions, this.rawTransactions);
5612
5612
  }
5613
5613
  get transactions() {
5614
5614
  return this.augmentTransactions(this.rawTransactions);
@@ -5638,7 +5638,7 @@ class Dh {
5638
5638
  };
5639
5639
  addTransaction = async (n) => {
5640
5640
  const i = await this.api.addTransaction(n);
5641
- i && J(() => this.rawTransactions = [i, ...this.transactions]);
5641
+ i && J(() => this.rawTransactions = [i, ...this.rawTransactions]);
5642
5642
  };
5643
5643
  augmentTransactions = (n) => _h(
5644
5644
  n,
@@ -5683,7 +5683,7 @@ class Dh {
5683
5683
  });
5684
5684
  };
5685
5685
  modifyTransactionByAccountGuid = (n, i) => {
5686
- this.rawTransactions = this.transactions.map(
5686
+ this.rawTransactions = this.rawTransactions.map(
5687
5687
  (a) => a.account_guid === n ? { ...a, ...i } : a
5688
5688
  );
5689
5689
  };
@@ -5695,9 +5695,9 @@ class Dh {
5695
5695
  };
5696
5696
  removeTransaction = async (n) => {
5697
5697
  await this.api.removeTransaction(n);
5698
- const i = this.transactions.findIndex((a) => a.guid === n);
5698
+ const i = this.rawTransactions.findIndex((a) => a.guid === n);
5699
5699
  if (i >= 0) {
5700
- const a = [...this.transactions];
5700
+ const a = [...this.rawTransactions];
5701
5701
  a.splice(i, 1), J(() => this.rawTransactions = a);
5702
5702
  }
5703
5703
  };
@@ -5716,20 +5716,20 @@ class Dh {
5716
5716
  const c = await this.api.addTransaction(i[s]);
5717
5717
  o.push(c);
5718
5718
  }
5719
- const r = this.transactions.findIndex((s) => s.guid === n.guid);
5719
+ const r = this.rawTransactions.findIndex((s) => s.guid === n.guid);
5720
5720
  r >= 0 && J(
5721
5721
  () => this.rawTransactions = [
5722
- ...this.transactions.slice(0, r),
5722
+ ...this.rawTransactions.slice(0, r),
5723
5723
  a,
5724
- ...this.transactions.slice(r + 1),
5724
+ ...this.rawTransactions.slice(r + 1),
5725
5725
  ...o
5726
5726
  ]
5727
5727
  );
5728
5728
  };
5729
5729
  unSplitTransaction = async (n) => {
5730
- const i = this.transactions.filter((s) => s.parent_guid === n);
5730
+ const i = this.rawTransactions.filter((s) => s.parent_guid === n);
5731
5731
  await this.api.removeTransactionSplit(n);
5732
- const a = [...this.transactions];
5732
+ const a = [...this.rawTransactions];
5733
5733
  i.forEach((s) => {
5734
5734
  const c = a.findIndex((d) => d.guid === s.guid);
5735
5735
  c >= 0 && a.splice(c, 1);
@@ -5755,12 +5755,12 @@ class Dh {
5755
5755
  await this.api.updateTag(n), await this.loadTags();
5756
5756
  };
5757
5757
  updateTransaction = async (n) => {
5758
- const i = await this.api.updateTransaction(n), a = this.transactions.findIndex((o) => o.guid === n.guid);
5758
+ const i = await this.api.updateTransaction(n), a = this.rawTransactions.findIndex((o) => o.guid === n.guid);
5759
5759
  a >= 0 && J(
5760
5760
  () => this.rawTransactions = [
5761
- ...this.transactions.slice(0, a),
5761
+ ...this.rawTransactions.slice(0, a),
5762
5762
  i,
5763
- ...this.transactions.slice(a + 1)
5763
+ ...this.rawTransactions.slice(a + 1)
5764
5764
  ]
5765
5765
  );
5766
5766
  };
@@ -5877,54 +5877,52 @@ const Lh = ({ transaction: e, onClick: n }) => {
5877
5877
  width: c = "100%",
5878
5878
  zeroState: d = /* @__PURE__ */ t(kh, {})
5879
5879
  }) => {
5880
- const { isLoading: _, sortedTransactions: u, rawTransactions: h } = Me();
5881
- console.log("exp allTransactions", u), console.log("exp rawTransactions", h);
5882
- const m = g.useMemo(() => s ? u : u.filter((w) => !w.is_hidden), [u, _, s]), { clearExpandedSplits: p, setShowInsights: C, toggleSplit: E } = Ot(), { onEvent: y } = X(), S = (w) => {
5883
- const N = m.find((R) => R.guid === w);
5884
- if (N?.has_been_split) {
5885
- E(N.guid);
5880
+ const { isLoading: _, sortedTransactions: u } = Me(), h = g.useMemo(() => s ? u : u.filter((v) => !v.is_hidden), [u, s]), { clearExpandedSplits: m, setShowInsights: p, toggleSplit: C } = Ot(), { onEvent: E } = X(), y = (v) => {
5881
+ const w = h.find((N) => N.guid === v);
5882
+ if (w?.has_been_split) {
5883
+ C(w.guid);
5886
5884
  return;
5887
5885
  }
5888
- y(F.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
5889
- account_guid: N?.account_guid,
5890
- transaction_guid: w
5891
- }), a?.(w);
5892
- }, I = g.useRef(null), v = $s({
5893
- count: m.length,
5894
- getScrollElement: () => I.current,
5895
- estimateSize: (w) => kr + (Mr(w, m) ? Gr : 0),
5886
+ E(F.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
5887
+ account_guid: w?.account_guid,
5888
+ transaction_guid: v
5889
+ }), a?.(v);
5890
+ }, S = g.useRef(null), I = $s({
5891
+ count: h.length,
5892
+ getScrollElement: () => S.current,
5893
+ estimateSize: (v) => kr + (Mr(v, h) ? Gr : 0),
5896
5894
  overscan: 5
5897
5895
  });
5898
- return g.useEffect(() => v.measure(), [m]), g.useEffect(() => C(o), [o]), g.useEffect(() => () => p(), []), console.log("exp transactions", m), /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ t(O, { height: n, overflow: "auto", ref: I, width: c, children: /* @__PURE__ */ l(
5896
+ return g.useEffect(() => I.measure(), [h]), g.useEffect(() => p(o), [o]), g.useEffect(() => () => m(), []), console.log("exp transactions", h), /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ t(O, { height: n, overflow: "auto", ref: S, width: c, children: /* @__PURE__ */ l(
5899
5897
  O,
5900
5898
  {
5901
5899
  height: (
5902
5900
  // set the height to auto when there are no transactions so the zero state isn't set to 0
5903
- v.getVirtualItems().length === 0 ? "auto" : v.getTotalSize()
5901
+ I.getVirtualItems().length === 0 ? "auto" : I.getTotalSize()
5904
5902
  ),
5905
5903
  position: "relative",
5906
5904
  width: "100%",
5907
5905
  children: [
5908
5906
  (_ || r) && i,
5909
- !_ && !r && v.getVirtualItems().length === 0 && d,
5910
- !_ && !r && v.getVirtualItems().length > 0 && v.getVirtualItems().map((w) => {
5911
- const N = m[w.index], R = Mr(w.index, m), M = Gh(w.index, m), k = kr + (R ? Gr : 0);
5907
+ !_ && !r && I.getVirtualItems().length === 0 && d,
5908
+ !_ && !r && I.getVirtualItems().length > 0 && I.getVirtualItems().map((v) => {
5909
+ const w = h[v.index], N = Mr(v.index, h), R = Gh(v.index, h), M = kr + (N ? Gr : 0);
5912
5910
  return /* @__PURE__ */ l(
5913
5911
  O,
5914
5912
  {
5915
5913
  sx: {
5916
- height: k,
5914
+ height: M,
5917
5915
  position: "absolute",
5918
- transform: `translateY(${w.start}px)`,
5916
+ transform: `translateY(${v.start}px)`,
5919
5917
  width: "100%"
5920
5918
  },
5921
5919
  children: [
5922
- R && /* @__PURE__ */ t(Ta, { bgcolor: e, children: ba(N.date) }),
5923
- /* @__PURE__ */ t(Mo, { onClick: S, transaction: N }),
5924
- /* @__PURE__ */ t(P, { sx: { ml: M ? 24 : 0 } })
5920
+ N && /* @__PURE__ */ t(Ta, { bgcolor: e, children: ba(w.date) }),
5921
+ /* @__PURE__ */ t(Mo, { onClick: y, transaction: w }),
5922
+ /* @__PURE__ */ t(P, { sx: { ml: R ? 24 : 0 } })
5925
5923
  ]
5926
5924
  },
5927
- N.guid
5925
+ w.guid
5928
5926
  );
5929
5927
  })
5930
5928
  ]