@mx-cartographer/experiences 7.0.1 → 7.0.2-alpha.al0

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/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
+ ## [7.0.2] - 09-17-2025
2
+
3
+ - **ADDED** - Transactions widget supports account-specific requests
4
+
1
5
  ## [7.0.1] - 09-16-2025
2
6
 
3
7
  - **UPDATED** removed categories list and insights microcarousel from table view in 'TrendsWidget'
4
8
 
5
- ## [7.0.0] - 09-15-2025
9
+ ## [7.0.0] - 09-16-2025
6
10
 
7
11
  - **UPDATED** - Avoid-barrel implementation
8
12
 
@@ -28,9 +28,13 @@ export interface Banner {
28
28
  image_url?: string;
29
29
  redirect_url?: string;
30
30
  }
31
+ interface TransactionConfig {
32
+ selected_account_guid?: string;
33
+ }
31
34
  export interface ClientConfig {
32
35
  color_scheme?: 'light' | 'dark' | 'browser';
33
36
  master?: MasterConfig;
37
+ transactions?: TransactionConfig;
34
38
  [key: string]: any;
35
39
  }
36
40
  export interface MasterConfig {
@@ -143,3 +147,4 @@ export interface Options {
143
147
  subtype?: string;
144
148
  type?: string;
145
149
  }
150
+ export {};
@@ -1,58 +1,58 @@
1
- import { T as pa } from "../TransactionApi-DbbcjI2L.mjs";
2
- import { u as H, C as Me, D as ke, M as Le, c as Re, T as He, a as Be } from "../TransactionDetails-D4B9DSWo.mjs";
3
- import { B as ha, d as fa, b as Ca } from "../TransactionDetails-D4B9DSWo.mjs";
4
- import { T as E } from "../Transaction-CyqrHmAA.mjs";
5
- import { O as ba } from "../Transaction-CyqrHmAA.mjs";
6
- import { S as Z, D as Pe } from "../TransactionStore-DSyXtPek.mjs";
7
- import { T as Aa } from "../TransactionStore-DSyXtPek.mjs";
8
- import { e as $e } from "../exportTransactionsToCSV-BlVifaOG.mjs";
9
- import { E as xa } from "../ExportCsvAction-dpvaZxbS.mjs";
10
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
11
- import m from "react";
1
+ import { T as ha } from "../TransactionApi-DbbcjI2L.mjs";
2
+ import { u as B, C as Le, D as Re, M as He, c as Be, T as Pe, a as $e } from "../TransactionDetails-D4B9DSWo.mjs";
3
+ import { B as Ca, d as ya, b as ba } from "../TransactionDetails-D4B9DSWo.mjs";
4
+ import { T as M } from "../Transaction-CyqrHmAA.mjs";
5
+ import { O as Aa } from "../Transaction-CyqrHmAA.mjs";
6
+ import { S as ee, D as Ve } from "../TransactionStore-DSyXtPek.mjs";
7
+ import { T as xa } from "../TransactionStore-DSyXtPek.mjs";
8
+ import { e as We } from "../exportTransactionsToCSV-BlVifaOG.mjs";
9
+ import { E as Ia } from "../ExportCsvAction-dpvaZxbS.mjs";
10
+ import { jsxs as _, jsx as e } from "react/jsx-runtime";
11
+ import u from "react";
12
12
  import { observer as S } from "mobx-react-lite";
13
- import Ve from "@mui/material/Paper";
14
- import { DataGridPro as We } from "@mui/x-data-grid-pro";
13
+ import Ge from "@mui/material/Paper";
14
+ import { DataGridPro as Ue } from "@mui/x-data-grid-pro";
15
15
  import A from "@mui/material/Box";
16
- import { useTheme as Ge } from "@mui/material/styles";
17
- import { Text as f, Icon as R, MerchantLogo as Ue, TextField as ee, P as Fe } from "@mxenabled/mxui";
18
- import { f as B, u as x, a as z, c as oe, l as ze, k as Ke, e as qe, o as je } from "../hooks-02T565vf.mjs";
19
- import { fromUnixTime as Xe } from "date-fns/fromUnixTime";
20
- import { f as Ye, D as Je, a as re } from "../Dialog-CWW597AF.mjs";
16
+ import { useTheme as Fe } from "@mui/material/styles";
17
+ import { Text as C, Icon as H, MerchantLogo as ze, TextField as te, P as Ke } from "@mxenabled/mxui";
18
+ import { f as P, u as x, a as K, c as re, l as qe, k as je, e as Xe, o as Ye } from "../hooks-02T565vf.mjs";
19
+ import { fromUnixTime as Je } from "date-fns/fromUnixTime";
20
+ import { f as Qe, D as Ze, a as se } from "../Dialog-CWW597AF.mjs";
21
21
  import N from "@mui/material/Stack";
22
- import { f as se } from "../NumberFormatting-CtWHhyBX.mjs";
23
- import { L as K } from "../Loader-Dp1P2gNw.mjs";
24
- import { endOfMonth as Qe } from "date-fns/endOfMonth";
25
- import { getUnixTime as Ze } from "date-fns/getUnixTime";
26
- import { startOfMonth as et } from "date-fns/startOfMonth";
27
- import { startOfToday as F } from "date-fns/startOfToday";
28
- import tt from "@mui/material/styles/useTheme";
29
- import { j as at } from "../ConnectDrawer-WfKHsHSF.mjs";
30
- import nt from "@mui/material/Divider";
31
- import ot from "@mui/material/MenuItem";
32
- import rt from "@mui/material/RadioGroup";
33
- import st from "@mui/icons-material/ExpandMore";
34
- import { C as it } from "../CurrencyInput-CSZjO22Z.mjs";
35
- import { a as ct, u as lt } from "../CategorySelectorDrawer-Dyzb3UDU.mjs";
36
- import { b as te } from "../Localization-2MODESHW.mjs";
37
- import { A as T, W as dt } from "../WidgetContainer-BG-fdDOf.mjs";
38
- import { u as ut } from "../useScreenSize-B6JyS_Lj.mjs";
39
- import { S as mt } from "../SearchBox-B2_zLv8-.mjs";
40
- import { D as ae } from "../Drawer-kEE73B87.mjs";
41
- const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small", children: [
22
+ import { f as ie } from "../NumberFormatting-CtWHhyBX.mjs";
23
+ import { L as q } from "../Loader-Dp1P2gNw.mjs";
24
+ import { endOfMonth as et } from "date-fns/endOfMonth";
25
+ import { getUnixTime as tt } from "date-fns/getUnixTime";
26
+ import { startOfMonth as at } from "date-fns/startOfMonth";
27
+ import { startOfToday as z } from "date-fns/startOfToday";
28
+ import nt from "@mui/material/styles/useTheme";
29
+ import { j as ot } from "../ConnectDrawer-WfKHsHSF.mjs";
30
+ import rt from "@mui/material/Divider";
31
+ import st from "@mui/material/MenuItem";
32
+ import it from "@mui/material/RadioGroup";
33
+ import ct from "@mui/icons-material/ExpandMore";
34
+ import { C as lt } from "../CurrencyInput-CSZjO22Z.mjs";
35
+ import { a as dt, u as ut } from "../CategorySelectorDrawer-Dyzb3UDU.mjs";
36
+ import { b as ae } from "../Localization-2MODESHW.mjs";
37
+ import { A as T, W as mt } from "../WidgetContainer-BG-fdDOf.mjs";
38
+ import { u as _t } from "../useScreenSize-B6JyS_Lj.mjs";
39
+ import { S as pt } from "../SearchBox-B2_zLv8-.mjs";
40
+ import { D as ne } from "../Drawer-kEE73B87.mjs";
41
+ const gt = (t) => /* @__PURE__ */ _(C, { tabIndex: t.tabIndex, variant: "Small", children: [
42
42
  `${t.row.account}`,
43
43
  t.row.number && ` | ${t.row.number}`
44
- ] }), pt = (t) => {
45
- const { associatedBeats: r } = B(), { showInsights: n } = H(), { amount: a, transaction_type: s } = t.row, l = r.find((g) => g.associated_transaction_guid === t.row.guid), d = s === E.CREDIT;
46
- return /* @__PURE__ */ p(N, { alignItems: "flex-end", tabIndex: t.tabIndex, children: [
47
- /* @__PURE__ */ p(f, { color: d ? "success.main" : "text.primary", variant: "Small", children: [
44
+ ] }), ht = (t) => {
45
+ const { associatedBeats: r } = P(), { showInsights: n } = B(), { amount: a, transaction_type: i } = t.row, l = r.find((h) => h.associated_transaction_guid === t.row.guid), d = i === M.CREDIT;
46
+ return /* @__PURE__ */ _(N, { alignItems: "flex-end", tabIndex: t.tabIndex, children: [
47
+ /* @__PURE__ */ _(C, { color: d ? "success.main" : "text.primary", variant: "Small", children: [
48
48
  d ? "+" : "",
49
- se(a, "0,0.00")
49
+ ie(a, "0,0.00")
50
50
  ] }),
51
- l && n && /* @__PURE__ */ e(f, { bold: !0, color: "primary.light", variant: "XSmall", children: l.short_title })
51
+ l && n && /* @__PURE__ */ e(C, { bold: !0, color: "primary.light", variant: "XSmall", children: l.short_title })
52
52
  ] });
53
- }, gt = (t) => {
54
- const { transactions: r } = x(), [n, a] = m.useState(!1);
55
- return /* @__PURE__ */ p(
53
+ }, ft = (t) => {
54
+ const { transactions: r } = x(), [n, a] = u.useState(!1);
55
+ return /* @__PURE__ */ _(
56
56
  N,
57
57
  {
58
58
  alignItems: "center",
@@ -63,23 +63,23 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
63
63
  onMouseLeave: () => a(!1),
64
64
  width: "100%",
65
65
  children: [
66
- t.row.has_been_split && /* @__PURE__ */ e(R, { name: "call_split", size: 16 }),
67
- /* @__PURE__ */ e(f, { tabIndex: t.tabIndex, variant: "Small", children: t.row.has_been_split ? r.split_transaction_category_label : t.row.category }),
68
- !t.row.has_been_split && n && /* @__PURE__ */ e(R, { name: "edit", sx: { color: "action.active" } })
66
+ t.row.has_been_split && /* @__PURE__ */ e(H, { name: "call_split", size: 16 }),
67
+ /* @__PURE__ */ e(C, { tabIndex: t.tabIndex, variant: "Small", children: t.row.has_been_split ? r.split_transaction_category_label : t.row.category }),
68
+ !t.row.has_been_split && n && /* @__PURE__ */ e(H, { name: "edit", sx: { color: "action.active" } })
69
69
  ]
70
70
  }
71
71
  );
72
- }, ht = S(gt), ft = (t) => /* @__PURE__ */ e(f, { tabIndex: t.tabIndex, variant: "Small", children: Ye(Xe(t.row.date), Je.MONTH_DAY) }), Ct = (t) => {
73
- const r = Ge(), { transactions: n } = x(), { is_flagged: a, is_hidden: s, has_been_viewed: l, parent_guid: d } = t.row, _ = !l && !!!d;
74
- return /* @__PURE__ */ p(
72
+ }, Ct = S(ft), yt = (t) => /* @__PURE__ */ e(C, { tabIndex: t.tabIndex, variant: "Small", children: Qe(Je(t.row.date), Ze.MONTH_DAY) }), bt = (t) => {
73
+ const r = Fe(), { transactions: n } = x(), { is_flagged: a, is_hidden: i, has_been_viewed: l, parent_guid: d } = t.row, f = !l && !!!d;
74
+ return /* @__PURE__ */ _(
75
75
  A,
76
76
  {
77
- "aria-label": s ? n.is_hidden : n.is_flagged,
77
+ "aria-label": i ? n.is_hidden : n.is_flagged,
78
78
  tabIndex: t.tabIndex,
79
79
  children: [
80
- a && /* @__PURE__ */ e(R, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
81
- !a && s && /* @__PURE__ */ e(R, { name: "visibility_off", size: 16 }),
82
- _ && /* @__PURE__ */ e(
80
+ a && /* @__PURE__ */ e(H, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
81
+ !a && i && /* @__PURE__ */ e(H, { name: "visibility_off", size: 16 }),
82
+ f && /* @__PURE__ */ e(
83
83
  "svg",
84
84
  {
85
85
  "data-testid": "svg",
@@ -97,48 +97,48 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
97
97
  ]
98
98
  }
99
99
  );
100
- }, yt = S(Ct), O = (t) => /* @__PURE__ */ e(f, { fontWeight: 600, variant: "Small", children: t.colDef.headerName }), bt = (t) => /* @__PURE__ */ p(N, { alignItems: "center", direction: "row", gap: 8, children: [
100
+ }, Tt = S(bt), E = (t) => /* @__PURE__ */ e(C, { fontWeight: 600, variant: "Small", children: t.colDef.headerName }), At = (t) => /* @__PURE__ */ _(N, { alignItems: "center", direction: "row", gap: 8, children: [
101
101
  /* @__PURE__ */ e(
102
- Ue,
102
+ ze,
103
103
  {
104
104
  categoryGuid: t.row.top_level_category_guid || "",
105
105
  merchantGuid: t.row.merchant_guid || ""
106
106
  }
107
107
  ),
108
- /* @__PURE__ */ e(f, { tabIndex: t.tabIndex, variant: "Small", children: t.row.payee })
109
- ] }), Tt = ({
108
+ /* @__PURE__ */ e(C, { tabIndex: t.tabIndex, variant: "Small", children: t.row.payee })
109
+ ] }), St = ({
110
110
  height: t = "100dvh",
111
111
  onCategoryClick: r,
112
112
  onRowClick: n
113
113
  }) => {
114
- const { transactions: a } = x(), { isCopyLoaded: s } = z(), { isLoading: l, sortedTransactions: d } = B(), { clearExpandedSplits: g, toggleSplit: _ } = H();
115
- m.useEffect(() => () => g(), []);
116
- const h = m.useMemo(
117
- () => d.map((i) => ({
118
- id: i.guid,
114
+ const { transactions: a } = x(), { isCopyLoaded: i } = K(), { isLoading: l, sortedTransactions: d } = P(), { clearExpandedSplits: h, toggleSplit: f } = B();
115
+ u.useEffect(() => () => h(), []);
116
+ const m = u.useMemo(
117
+ () => d.map((s) => ({
118
+ id: s.guid,
119
119
  isHovering: !1,
120
- ...i
120
+ ...s
121
121
  })),
122
122
  [d]
123
- ), u = ({ row: { id: i, guid: w, has_been_split: I }, field: v }) => I ? _(i) : v === "category" ? r?.(w) : n?.(w);
124
- if (!s)
125
- return /* @__PURE__ */ e(K, {});
126
- const C = [
123
+ ), p = ({ row: { id: s, guid: w, has_been_split: O }, field: I }) => O ? f(s) : I === "category" ? r?.(w) : n?.(w);
124
+ if (!i)
125
+ return /* @__PURE__ */ e(q, {});
126
+ const g = [
127
127
  {
128
128
  field: "flag",
129
129
  headerName: "",
130
130
  minWidth: 32,
131
131
  width: 32,
132
132
  sortable: !1,
133
- renderCell: (i) => /* @__PURE__ */ e(yt, { ...i }),
133
+ renderCell: (s) => /* @__PURE__ */ e(Tt, { ...s }),
134
134
  renderHeader: () => /* @__PURE__ */ e("span", { "aria-label": a.transaction_status, role: "presentation" })
135
135
  },
136
136
  {
137
137
  field: "date",
138
138
  headerName: a.date_title,
139
139
  width: 103,
140
- renderHeader: O,
141
- renderCell: (i) => i.row.parent_guid ? null : /* @__PURE__ */ e(ft, { ...i }),
140
+ renderHeader: E,
141
+ renderCell: (s) => s.row.parent_guid ? null : /* @__PURE__ */ e(yt, { ...s }),
142
142
  sortingOrder: ["desc", "asc"]
143
143
  },
144
144
  {
@@ -146,49 +146,49 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
146
146
  field: "payee",
147
147
  headerName: a.payee_title,
148
148
  flex: 0.33,
149
- renderHeader: O,
150
- renderCell: bt,
149
+ renderHeader: E,
150
+ renderCell: At,
151
151
  sortingOrder: ["asc", "desc"]
152
152
  },
153
153
  {
154
154
  field: "category",
155
155
  headerName: a.category_title,
156
156
  flex: 0.25,
157
- renderHeader: O,
158
- renderCell: (i) => /* @__PURE__ */ e(ht, { ...i }),
157
+ renderHeader: E,
158
+ renderCell: (s) => /* @__PURE__ */ e(Ct, { ...s }),
159
159
  sortingOrder: ["asc", "desc"]
160
160
  },
161
161
  {
162
162
  field: "account",
163
163
  headerName: a.account_title,
164
164
  flex: 0.33,
165
- renderHeader: O,
166
- renderCell: (i) => i.row.parent_guid ? null : /* @__PURE__ */ e(_t, { ...i }),
165
+ renderHeader: E,
166
+ renderCell: (s) => s.row.parent_guid ? null : /* @__PURE__ */ e(gt, { ...s }),
167
167
  sortingOrder: ["asc", "desc"]
168
168
  },
169
169
  {
170
170
  field: "amount",
171
171
  headerName: a.amount_title,
172
172
  flex: 0.25,
173
- renderHeader: O,
174
- renderCell: pt,
173
+ renderHeader: E,
174
+ renderCell: ht,
175
175
  align: "right",
176
176
  headerAlign: "right",
177
177
  sortingOrder: ["asc", "desc"]
178
178
  }
179
179
  ];
180
- return /* @__PURE__ */ e(Ve, { sx: { height: t, px: 24, width: "100%", boxShadow: "none" }, children: /* @__PURE__ */ e(
181
- We,
180
+ return /* @__PURE__ */ e(Ge, { sx: { height: t, px: 24, width: "100%", boxShadow: "none" }, children: /* @__PURE__ */ e(
181
+ Ue,
182
182
  {
183
- columns: C,
183
+ columns: g,
184
184
  disableColumnFilter: !0,
185
185
  disableColumnMenu: !0,
186
- getCellClassName: (i) => i.row.parent_guid ? "split-row" : "",
186
+ getCellClassName: (s) => s.row.parent_guid ? "split-row" : "",
187
187
  hideFooter: !0,
188
188
  initialState: { sorting: { sortModel: [{ field: "date", sort: "desc" }] } },
189
189
  loading: l,
190
- onCellClick: u,
191
- rows: h,
190
+ onCellClick: p,
191
+ rows: m,
192
192
  slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
193
193
  sx: {
194
194
  "& .split-row": {
@@ -197,10 +197,10 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
197
197
  }
198
198
  }
199
199
  ) });
200
- }, At = S(Tt), St = ({ copy: t, isOpen: r, onClose: n, onPrimaryAction: a }) => {
201
- const { common: s, transactions: l } = x(), { isCopyLoaded: d } = z();
202
- return d ? /* @__PURE__ */ p(
203
- re,
200
+ }, xt = S(St), wt = ({ copy: t, isOpen: r, onClose: n, onPrimaryAction: a }) => {
201
+ const { common: i, transactions: l } = x(), { isCopyLoaded: d } = K();
202
+ return d ? /* @__PURE__ */ _(
203
+ se,
204
204
  {
205
205
  copy: {
206
206
  title: t.title
@@ -209,77 +209,77 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
209
209
  onClose: n,
210
210
  onPrimaryAction: a,
211
211
  primaryText: l.add_manual_account,
212
- secondaryText: s.cancel_button,
212
+ secondaryText: i.cancel_button,
213
213
  children: [
214
- /* @__PURE__ */ e(f, { component: "p", sx: { marginBottom: "20px" }, truncate: !1, children: l.add_account_modal_message }),
215
- /* @__PURE__ */ e(f, { component: "p", truncate: !1, children: l.add_account_modal_cta })
214
+ /* @__PURE__ */ e(C, { component: "p", sx: { marginBottom: "20px" }, truncate: !1, children: l.add_account_modal_message }),
215
+ /* @__PURE__ */ e(C, { component: "p", truncate: !1, children: l.add_account_modal_cta })
216
216
  ]
217
217
  }
218
- ) : /* @__PURE__ */ e(K, {});
219
- }, xt = S(St), wt = () => {
220
- const { visibleAccounts: t } = oe(), { common: r, transactions: n } = x(), { manualTransaction: a, setIsAmountValid: s, updateManualTransaction: l } = H(), [d, g] = m.useState(""), [_, h] = m.useState(""), u = m.useMemo(
218
+ ) : /* @__PURE__ */ e(q, {});
219
+ }, It = S(wt), vt = () => {
220
+ const { visibleAccounts: t } = re(), { common: r, transactions: n } = x(), { manualTransaction: a, setIsAmountValid: i, updateManualTransaction: l } = B(), [d, h] = u.useState(""), [f, m] = u.useState(""), p = u.useMemo(
221
221
  () => t.filter((o) => o.is_manual),
222
222
  [t]
223
223
  ).map((o) => ({
224
- label: `${o.name} | ${se(o.balance, "0,0.00")}`,
224
+ label: `${o.name} | ${ie(o.balance, "0,0.00")}`,
225
225
  value: o.guid
226
- })), C = {
226
+ })), g = {
227
227
  error_amount_is_invalid: r.currency_input.error_amount_is_invalid,
228
228
  error_amount_must_be_equal_to: r.currency_input.error_amount_must_be_equal_to,
229
229
  error_amount_must_be_less_than_or_equal_to: r.currency_input.error_amount_must_be_less_than_or_equal_to,
230
230
  enter_amount: r.currency_input.enter_amount
231
- }, i = (o) => {
232
- g(o), l({ ...a, amount: Number(o) });
233
- }, w = (o, P) => {
234
- l({ ...a, transaction_type: Number(P) });
231
+ }, s = (o) => {
232
+ h(o), l({ ...a, amount: Number(o) });
233
+ }, w = (o, $) => {
234
+ l({ ...a, transaction_type: Number($) });
235
+ }, O = (o) => {
236
+ m(o), l({ ...a, payee: o, description: o });
235
237
  }, I = (o) => {
236
- h(o), l({ ...a, payee: o, description: o });
237
- }, v = (o) => {
238
238
  l({ ...a, account_guid: o });
239
239
  };
240
- return /* @__PURE__ */ p(A, { className: "mx-txn-manual-transaction-details", children: [
241
- /* @__PURE__ */ p(N, { gap: 40, mx: 24, my: 32, children: [
242
- /* @__PURE__ */ p(
240
+ return /* @__PURE__ */ _(A, { className: "mx-txn-manual-transaction-details", children: [
241
+ /* @__PURE__ */ _(N, { gap: 40, mx: 24, my: 32, children: [
242
+ /* @__PURE__ */ _(
243
243
  N,
244
244
  {
245
245
  direction: "row",
246
246
  sx: { flexDirection: { xs: "column", sm: "row" }, gap: { xs: 40, sm: 8 } },
247
247
  children: [
248
248
  /* @__PURE__ */ e(
249
- it,
249
+ lt,
250
250
  {
251
251
  allowDecimals: !0,
252
252
  amount: d,
253
253
  ariaLabel: n.amount_title,
254
- copy: C,
254
+ copy: g,
255
255
  inputProps: {
256
256
  noValidate: !0
257
257
  },
258
258
  label: n.amount_title,
259
- setAmount: i,
260
- setHasValidInput: s,
259
+ setAmount: s,
260
+ setHasValidInput: i,
261
261
  sx: { bgcolor: "background.paper" },
262
262
  type: "number"
263
263
  }
264
264
  ),
265
- /* @__PURE__ */ e(rt, { name: "TransactionType", onChange: w, row: !0, children: /* @__PURE__ */ p(N, { alignItems: "center", direction: "row", children: [
265
+ /* @__PURE__ */ e(it, { name: "TransactionType", onChange: w, row: !0, children: /* @__PURE__ */ _(N, { alignItems: "center", direction: "row", children: [
266
266
  /* @__PURE__ */ e(
267
- Z,
267
+ ee,
268
268
  {
269
- checked: a.transaction_type === E.CREDIT,
269
+ checked: a.transaction_type === M.CREDIT,
270
270
  label: n.manual_transaction_credit_button_label,
271
271
  sx: { ml: { xs: 0, sm: 8 } },
272
272
  tooltip: n.manual_transaction_credit_button_tooltip,
273
- value: E.CREDIT
273
+ value: M.CREDIT
274
274
  }
275
275
  ),
276
276
  /* @__PURE__ */ e(
277
- Z,
277
+ ee,
278
278
  {
279
- checked: a.transaction_type === E.DEBIT,
279
+ checked: a.transaction_type === M.DEBIT,
280
280
  label: n.manual_transaction_debit_button_label,
281
281
  tooltip: n.manual_transaction_debit_button_tooltip,
282
- value: E.DEBIT
282
+ value: M.DEBIT
283
283
  }
284
284
  )
285
285
  ] }) })
@@ -287,208 +287,208 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
287
287
  }
288
288
  ),
289
289
  /* @__PURE__ */ e(
290
- ee,
290
+ te,
291
291
  {
292
292
  label: n.payee_title,
293
293
  name: "payee",
294
- onChange: (o) => I(o.target.value),
294
+ onChange: (o) => O(o.target.value),
295
295
  sx: { bgcolor: "background.paper" },
296
- value: _
296
+ value: f
297
297
  }
298
298
  ),
299
299
  /* @__PURE__ */ e(
300
- ee,
300
+ te,
301
301
  {
302
302
  InputLabelProps: { shrink: !0 },
303
- SelectProps: { defaultValue: -1, IconComponent: st },
303
+ SelectProps: { defaultValue: -1, IconComponent: ct },
304
304
  label: n.manual_transaction_select_an_account,
305
- onChange: (o) => v(o.target.value),
305
+ onChange: (o) => I(o.target.value),
306
306
  placeholder: n.manual_transaction_select,
307
307
  select: !0,
308
308
  sx: { bgcolor: "background.paper" },
309
- children: u.map((o) => /* @__PURE__ */ e(ot, { value: o.value, children: o.label }, o.value))
309
+ children: p.map((o) => /* @__PURE__ */ e(st, { value: o.value, children: o.label }, o.value))
310
310
  }
311
311
  )
312
312
  ] }),
313
- /* @__PURE__ */ e(nt, { light: !0 }),
314
- /* @__PURE__ */ p(A, { bgcolor: "background.paper", children: [
315
- /* @__PURE__ */ e(Me, { transaction: a }),
316
- /* @__PURE__ */ e(ke, { transaction: a }),
313
+ /* @__PURE__ */ e(rt, { light: !0 }),
314
+ /* @__PURE__ */ _(A, { bgcolor: "background.paper", children: [
317
315
  /* @__PURE__ */ e(Le, { transaction: a }),
318
- /* @__PURE__ */ e(Re, { transaction: a })
316
+ /* @__PURE__ */ e(Re, { transaction: a }),
317
+ /* @__PURE__ */ e(He, { transaction: a }),
318
+ /* @__PURE__ */ e(Be, { transaction: a })
319
319
  ] })
320
320
  ] });
321
- }, It = S(wt), vt = ({ onClose: t, transaction: r }) => {
322
- const { addOrUpdateTransactionRule: n, updateTransaction: a } = B(), { transactions: s } = x(), { categories: l } = ze(), [d, g] = m.useState(""), _ = m.useMemo(
323
- () => l.find((u) => u.guid === d),
321
+ }, Dt = S(vt), Nt = ({ onClose: t, transaction: r }) => {
322
+ const { addOrUpdateTransactionRule: n, updateTransaction: a } = P(), { transactions: i } = x(), { categories: l } = qe(), [d, h] = u.useState(""), f = u.useMemo(
323
+ () => l.find((p) => p.guid === d),
324
324
  [d]
325
- ), h = async (u) => {
326
- await a({ ...r, category_guid: d }), u && await n(d, r), g(""), t();
325
+ ), m = async (p) => {
326
+ await a({ ...r, category_guid: d }), p && await n(d, r), h(""), t();
327
327
  };
328
- return /* @__PURE__ */ p(A, { className: "mx-txn-edit-category-action", children: [
328
+ return /* @__PURE__ */ _(A, { className: "mx-txn-edit-category-action", children: [
329
329
  /* @__PURE__ */ e(
330
- ct,
330
+ dt,
331
331
  {
332
332
  initialSelected: r.category_guid,
333
333
  onClose: t,
334
- onSelect: (u) => g(u),
334
+ onSelect: (p) => h(p),
335
335
  showDrawer: !!r,
336
- title: s.actions_select_a_category
336
+ title: i.actions_select_a_category
337
337
  }
338
338
  ),
339
339
  /* @__PURE__ */ e(
340
- re,
340
+ se,
341
341
  {
342
342
  copy: {
343
- title: te(
344
- s.actions_apply_to_all_transaction_types,
343
+ title: ae(
344
+ i.actions_apply_to_all_transaction_types,
345
345
  r.description
346
346
  )
347
347
  },
348
348
  isOpen: !!d,
349
- onClose: () => h(!1),
350
- onPrimaryAction: () => h(!0),
351
- onSecondaryAction: () => h(!1),
352
- primaryText: s.actions_apply_to_all,
353
- secondaryText: s.actions_this_time_only,
354
- children: /* @__PURE__ */ e(Fe, { variant: "Paragraph", children: te(
355
- s.actions_all_past_and_future,
349
+ onClose: () => m(!1),
350
+ onPrimaryAction: () => m(!0),
351
+ onSecondaryAction: () => m(!1),
352
+ primaryText: i.actions_apply_to_all,
353
+ secondaryText: i.actions_this_time_only,
354
+ children: /* @__PURE__ */ e(Ke, { variant: "Paragraph", children: ae(
355
+ i.actions_all_past_and_future,
356
356
  r.description,
357
- _?.name
357
+ f?.name
358
358
  ) })
359
359
  }
360
360
  )
361
361
  ] });
362
- }, Dt = S(vt), ne = 120, Nt = ({
362
+ }, Ot = S(Nt), oe = 120, Et = ({
363
363
  onBackClick: t,
364
364
  height: r = "100dvh",
365
365
  showInsights: n = !1,
366
366
  sx: a = {}
367
367
  }) => {
368
- const { visibleAccounts: s, refreshAccounts: l } = oe(), { is_mobile_webview: d } = Ke(), { setSearchValue: g } = lt(), { onEvent: _ } = qe(), { common: h, transactions: u } = x(), {
369
- displayedDateRange: C,
370
- isCopyLoaded: i,
371
- isInitialized: w,
368
+ const { visibleAccounts: i, refreshAccounts: l } = re(), { is_mobile_webview: d, clientConfig: h } = je(), { setSearchValue: f } = ut(), { onEvent: m } = Xe(), { common: p, transactions: g } = x(), {
369
+ displayedDateRange: s,
370
+ isCopyLoaded: w,
371
+ isInitialized: O,
372
372
  selectedAccountGuids: I,
373
- setDisplayedDate: v,
374
- setSelectedAccounts: o
375
- } = z(), { isDesktop: P, isTablet: ie } = ut(), M = tt(), {
376
- addTransaction: ce,
377
- filter: q,
378
- loadAssociatedBeats: le,
379
- setFilter: $,
380
- sortedTransactionsWithSplits: de,
381
- tags: ue,
382
- transactions: me,
383
- updateTransaction: _e
384
- } = B(), {
385
- manualTransaction: k,
386
- isAmountValid: pe,
387
- searchValue: ge,
388
- setSearchValue: he,
389
- setShowInsights: fe,
390
- updateManualTransaction: Ce
391
- } = H(), { userProfile: ye } = je(), [V, y] = m.useState(""), [j, L] = m.useState(""), [be, W] = m.useState(!1), [Te, X] = m.useState(!1), [G, Ae] = m.useState(!1);
392
- m.useEffect(() => {
393
- const c = s.filter((D) => !D.is_hidden), J = et(F()), Q = Qe(F());
394
- o(c), v(J, Q), $({
373
+ setDisplayedDate: o,
374
+ setSelectedAccounts: $
375
+ } = K(), { isDesktop: ce, isTablet: le } = _t(), k = nt(), {
376
+ addTransaction: de,
377
+ filter: j,
378
+ loadAssociatedBeats: ue,
379
+ setFilter: V,
380
+ sortedTransactionsWithSplits: me,
381
+ tags: _e,
382
+ transactions: pe,
383
+ updateTransaction: ge
384
+ } = P(), {
385
+ manualTransaction: L,
386
+ isAmountValid: he,
387
+ searchValue: fe,
388
+ setSearchValue: Ce,
389
+ setShowInsights: ye,
390
+ updateManualTransaction: be
391
+ } = B(), { userProfile: Te } = Ye(), [W, y] = u.useState(""), [X, R] = u.useState(""), [Ae, G] = u.useState(!1), [Se, Y] = u.useState(!1), [U, xe] = u.useState(!1), v = h?.transactions?.selected_account_guid;
392
+ u.useEffect(() => {
393
+ const c = v ? [{ guid: v }] : i.filter((D) => !D.is_hidden), Q = at(z()), Z = et(z());
394
+ v || $(c), o(Q, Z), V({
395
395
  accounts: c.map((D) => D.guid),
396
396
  custom: (D) => !D.accountIsClosed && !D.accountIsHidden,
397
- dateRange: { start: J, end: Q }
398
- }), Ae(!0), _(T.TRANSACTIONS_VIEW);
399
- }, [s]), m.useEffect(() => {
400
- G && ($({
401
- ...q,
402
- accounts: I,
403
- dateRange: { start: C.start, end: C.end }
404
- }), le(C.start).finally());
405
- }, [G, C, I]), m.useEffect(() => {
406
- fe(n);
397
+ dateRange: { start: Q, end: Z }
398
+ }), xe(!0), m(T.TRANSACTIONS_VIEW);
399
+ }, [i]), u.useEffect(() => {
400
+ U && (V({
401
+ ...j,
402
+ accounts: v ? [v] : I,
403
+ dateRange: { start: s.start, end: s.end }
404
+ }), ue(s.start).finally());
405
+ }, [U, s, I]), u.useEffect(() => {
406
+ ye(n);
407
407
  }, [n]);
408
- const Se = m.useMemo(
409
- () => s.filter((c) => c.is_manual),
410
- [s]
411
- ), b = j ? me.find((c) => c.guid === j) : void 0, Y = pe && !!k.payee && !!k.account_guid && !!k.category_guid, xe = (c) => {
412
- v(c[0], c[1]);
413
- }, we = (c) => {
414
- he(c), $({
415
- ...q,
408
+ const we = u.useMemo(
409
+ () => i.filter((c) => c.is_manual),
410
+ [i]
411
+ ), b = X ? pe.find((c) => c.guid === X) : void 0, J = he && !!L.payee && !!L.account_guid && !!L.category_guid, Ie = (c) => {
412
+ o(c[0], c[1]);
413
+ }, ve = (c) => {
414
+ Ce(c), V({
415
+ ...j,
416
416
  searchTerm: c
417
- }), _(T.TRANSACTIONS_CLICK_SEARCH, { search_term: c });
418
- }, Ie = () => {
419
- $e(de, ue), _(T.TRANSACTIONS_CLICK_EXPORT);
420
- }, ve = () => {
421
- Se.length > 0 ? (Ce({
422
- ...Pe,
423
- date: Ze(F()),
424
- user_guid: ye?.user_guid || ""
417
+ }), m(T.TRANSACTIONS_CLICK_SEARCH, { search_term: c });
418
+ }, De = () => {
419
+ We(me, _e), m(T.TRANSACTIONS_CLICK_EXPORT);
420
+ }, Ne = () => {
421
+ we.length > 0 ? (be({
422
+ ...Ve,
423
+ date: tt(z()),
424
+ user_guid: Te?.user_guid || ""
425
425
  }), y(
426
426
  "addTransaction"
427
427
  /* AddTransaction */
428
- ), _(T.TRANSACTIONS_CLICK_ADD)) : (W(!0), _(T.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
429
- }, De = async () => {
430
- Y && await ce(k), y("");
431
- }, Ne = () => {
432
- W(!1), X(!0);
428
+ ), m(T.TRANSACTIONS_CLICK_ADD)) : (G(!0), m(T.TRANSACTIONS_ADD_MANUAL_ACCOUNT_MODAL));
433
429
  }, Oe = async () => {
434
- X(!1), await l();
435
- }, Ee = async () => {
436
- b && !b.has_been_viewed && await _e({ ...b, has_been_viewed: !0 }), y("");
430
+ J && await de(L), y("");
431
+ }, Ee = () => {
432
+ G(!1), Y(!0);
433
+ }, Me = async () => {
434
+ Y(!1), await l();
435
+ }, ke = async () => {
436
+ b && !b.has_been_viewed && await ge({ ...b, has_been_viewed: !0 }), y("");
437
437
  };
438
- if (!i || !w || !G)
439
- return /* @__PURE__ */ e(K, {});
440
- const U = [];
441
- return !d && (P || ie) && U.push({
438
+ if (!w || !O || !U)
439
+ return /* @__PURE__ */ e(q, {});
440
+ const F = [];
441
+ return !d && (ce || le) && F.push({
442
442
  iconName: "open_in_new",
443
- label: u.export_csv_btn,
444
- onClick: Ie
445
- }), U.push({
443
+ label: g.export_csv_btn,
444
+ onClick: De
445
+ }), F.push({
446
446
  iconName: "add",
447
- label: u.add_transaction_btn,
448
- onClick: ve
449
- }), /* @__PURE__ */ p(
450
- dt,
447
+ label: g.add_transaction_btn,
448
+ onClick: Ne
449
+ }), /* @__PURE__ */ _(
450
+ mt,
451
451
  {
452
- accountOptions: s,
453
- actions: U,
452
+ ...!v && { accountOptions: i },
453
+ actions: F,
454
454
  calendarActions: {
455
- onRangeChanged: xe
455
+ onRangeChanged: Ie
456
456
  },
457
- onAccountsFilterClick: () => _(T.ACCOUNTS_CLICK_FILTER),
457
+ onAccountsFilterClick: () => m(T.ACCOUNTS_CLICK_FILTER),
458
458
  onBackClick: t,
459
459
  sx: a,
460
- title: u.transactions_title,
460
+ title: g.transactions_title,
461
461
  children: [
462
462
  /* @__PURE__ */ e(A, { mt: 16, children: /* @__PURE__ */ e(
463
- mt,
463
+ pt,
464
464
  {
465
- onChange: we,
466
- placeholder: u.action_bar_search_placeholder,
467
- searchValue: ge
465
+ onChange: ve,
466
+ placeholder: g.action_bar_search_placeholder,
467
+ searchValue: fe
468
468
  }
469
469
  ) }),
470
470
  /* @__PURE__ */ e(
471
471
  A,
472
472
  {
473
473
  sx: {
474
- [M.breakpoints.down("md")]: { display: "none" },
475
- [M.breakpoints.up("md")]: { display: "block" }
474
+ [k.breakpoints.down("md")]: { display: "none" },
475
+ [k.breakpoints.up("md")]: { display: "block" }
476
476
  },
477
477
  children: /* @__PURE__ */ e(
478
- At,
478
+ xt,
479
479
  {
480
- height: `calc(${r} - ${ne}px)`,
480
+ height: `calc(${r} - ${oe}px)`,
481
481
  onCategoryClick: (c) => {
482
- L(c), y(
482
+ R(c), y(
483
483
  "category"
484
484
  /* Category */
485
485
  );
486
486
  },
487
487
  onRowClick: (c) => {
488
- L(c), y(
488
+ R(c), y(
489
489
  "transaction"
490
490
  /* Transaction */
491
- ), _(T.TRANSACTIONS_CLICK_DETAILS, { transaction_guid: c });
491
+ ), m(T.TRANSACTIONS_CLICK_DETAILS, { transaction_guid: c });
492
492
  }
493
493
  }
494
494
  )
@@ -498,15 +498,15 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
498
498
  A,
499
499
  {
500
500
  sx: {
501
- [M.breakpoints.down("md")]: { display: "block" },
502
- [M.breakpoints.up("md")]: { display: "none" }
501
+ [k.breakpoints.down("md")]: { display: "block" },
502
+ [k.breakpoints.up("md")]: { display: "none" }
503
503
  },
504
504
  children: /* @__PURE__ */ e(
505
- He,
505
+ Pe,
506
506
  {
507
- height: `calc(${r} - ${ne}px)`,
507
+ height: `calc(${r} - ${oe}px)`,
508
508
  onClick: (c) => {
509
- L(c), y(
509
+ R(c), y(
510
510
  "transaction"
511
511
  /* Transaction */
512
512
  );
@@ -518,72 +518,72 @@ const _t = (t) => /* @__PURE__ */ p(f, { tabIndex: t.tabIndex, variant: "Small",
518
518
  }
519
519
  ),
520
520
  /* @__PURE__ */ e(
521
- ae,
521
+ ne,
522
522
  {
523
- ariaLabelClose: h.close_aria,
524
- isOpen: V === "transaction" && !!b,
525
- onClose: Ee,
526
- title: u.details_title,
527
- children: b && /* @__PURE__ */ e(Be, { transaction: b })
523
+ ariaLabelClose: p.close_aria,
524
+ isOpen: W === "transaction" && !!b,
525
+ onClose: ke,
526
+ title: g.details_title,
527
+ children: b && /* @__PURE__ */ e($e, { transaction: b })
528
528
  }
529
529
  ),
530
- b && V === "category" && /* @__PURE__ */ e(
531
- Dt,
530
+ b && W === "category" && /* @__PURE__ */ e(
531
+ Ot,
532
532
  {
533
533
  onClose: () => {
534
- g(""), y(""), L("");
534
+ f(""), y(""), R("");
535
535
  },
536
536
  transaction: b
537
537
  }
538
538
  ),
539
539
  /* @__PURE__ */ e(
540
- ae,
540
+ ne,
541
541
  {
542
- ariaLabelClose: h.close_aria,
543
- isOpen: V === "addTransaction",
544
- isPrimaryDisabled: !Y,
542
+ ariaLabelClose: p.close_aria,
543
+ isOpen: W === "addTransaction",
544
+ isPrimaryDisabled: !J,
545
545
  onClose: () => y(""),
546
- onPrimaryAction: De,
547
- title: u.add_transaction_title,
548
- children: /* @__PURE__ */ e(It, {})
546
+ onPrimaryAction: Oe,
547
+ title: g.add_transaction_title,
548
+ children: /* @__PURE__ */ e(Dt, {})
549
549
  }
550
550
  ),
551
551
  /* @__PURE__ */ e(
552
- xt,
552
+ It,
553
553
  {
554
- copy: { title: u.add_manual_account },
555
- isOpen: be,
554
+ copy: { title: g.add_manual_account },
555
+ isOpen: Ae,
556
556
  onClose: () => {
557
- W(!1);
557
+ G(!1);
558
558
  },
559
- onPrimaryAction: Ne
559
+ onPrimaryAction: Ee
560
560
  }
561
561
  ),
562
562
  /* @__PURE__ */ e(
563
- at,
563
+ ot,
564
564
  {
565
- onClose: Oe,
566
- showConnectWidget: Te,
567
- title: u.add_manual_account
565
+ onClose: Me,
566
+ showConnectWidget: Se,
567
+ title: g.add_manual_account
568
568
  }
569
569
  )
570
570
  ]
571
571
  }
572
572
  );
573
- }, ua = S(Nt);
573
+ }, _a = S(Et);
574
574
  export {
575
- xt as AddAccountModal,
576
- ha as BottomActions,
577
- xa as ExportCsvAction,
578
- ba as TRANSACTION_EVENTS,
579
- fa as TopActions,
580
- pa as TransactionApi,
581
- Be as TransactionDetails,
582
- He as TransactionList,
583
- Ca as TransactionRow,
584
- Aa as TransactionStore,
585
- At as TransactionTable,
586
- ua as TransactionWidget,
587
- $e as exportTransactionsToCSV,
588
- H as useTransactionsUiStore
575
+ It as AddAccountModal,
576
+ Ca as BottomActions,
577
+ Ia as ExportCsvAction,
578
+ Aa as TRANSACTION_EVENTS,
579
+ ya as TopActions,
580
+ ha as TransactionApi,
581
+ $e as TransactionDetails,
582
+ Pe as TransactionList,
583
+ ba as TransactionRow,
584
+ xa as TransactionStore,
585
+ xt as TransactionTable,
586
+ _a as TransactionWidget,
587
+ We as exportTransactionsToCSV,
588
+ B as useTransactionsUiStore
589
589
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.1",
3
+ "version": "7.0.2-alpha.al0",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",