@mx-cartographer/experiences 7.7.0-alpha.bb2 → 7.7.0-alpha.bb4
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.
|
@@ -54,7 +54,7 @@ class S {
|
|
|
54
54
|
onSelect = (t) => this.savedOnSelect(t);
|
|
55
55
|
setOnSelect = (t) => this.savedOnSelect = t;
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class G {
|
|
58
58
|
globalStore;
|
|
59
59
|
uiStore;
|
|
60
60
|
api = new c("/", "");
|
|
@@ -64,7 +64,7 @@ class $ {
|
|
|
64
64
|
dateRangeCategoryTotals = [];
|
|
65
65
|
monthlyCategoryTotals = [];
|
|
66
66
|
dateRangeTotalsLoaded = !1;
|
|
67
|
-
|
|
67
|
+
dateRangeTotalsLoading = !1;
|
|
68
68
|
monthlyTotalsLoaded = !1;
|
|
69
69
|
monthlyTotalsLoading = !1;
|
|
70
70
|
constructor(t) {
|
|
@@ -102,7 +102,7 @@ class $ {
|
|
|
102
102
|
this.monthlyCategoryTotals = t, this.monthlyTotalsLoading = !1, this.monthlyTotalsLoaded = !0;
|
|
103
103
|
};
|
|
104
104
|
setDateRangeCategoryTotals = (t) => {
|
|
105
|
-
this.dateRangeCategoryTotals = t, this.
|
|
105
|
+
this.dateRangeCategoryTotals = t, this.dateRangeTotalsLoading = !1, this.dateRangeTotalsLoaded = !0;
|
|
106
106
|
};
|
|
107
107
|
get trendsCategories() {
|
|
108
108
|
return this.detailedCategories.filter((t) => t.totalAmount !== 0).filter((t) => t.guid !== l.INVESTMENTS && t.guid !== l.TRANSFER);
|
|
@@ -127,8 +127,8 @@ class $ {
|
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
loadDateRangeCategoryTotals = async (t, e, a) => {
|
|
130
|
-
if (!this.
|
|
131
|
-
this.
|
|
130
|
+
if (!this.dateRangeTotalsLoading) {
|
|
131
|
+
this.dateRangeTotalsLoading = !0;
|
|
132
132
|
try {
|
|
133
133
|
const o = await this.api.getDateRangeCategoryTotals(
|
|
134
134
|
n(e),
|
|
@@ -153,7 +153,6 @@ class $ {
|
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
reloadCategoryTotals = async (t, e, a) => {
|
|
156
|
-
this.setIsLoadingCategoryTotals(!0);
|
|
157
156
|
try {
|
|
158
157
|
await this.loadMonthlyCategoryTotals(t, e, a), await this.loadDateRangeCategoryTotals(t, e, a);
|
|
159
158
|
} catch (o) {
|
|
@@ -167,9 +166,6 @@ class $ {
|
|
|
167
166
|
console.error(`Error occurred while removing category: ${e}`);
|
|
168
167
|
}
|
|
169
168
|
};
|
|
170
|
-
setIsLoadingCategoryTotals = (t) => {
|
|
171
|
-
this.isLoadingCategoryTotals = t;
|
|
172
|
-
};
|
|
173
169
|
updateCategory = async (t) => {
|
|
174
170
|
try {
|
|
175
171
|
await this.api.updateCategory(t), await this.loadCategories();
|
|
@@ -181,6 +177,6 @@ class $ {
|
|
|
181
177
|
getCategoryName = (t) => this.categories.find((a) => a.guid === t)?.name ?? p[t];
|
|
182
178
|
}
|
|
183
179
|
export {
|
|
184
|
-
|
|
180
|
+
G as C,
|
|
185
181
|
c as a
|
|
186
182
|
};
|
|
@@ -10,7 +10,7 @@ export declare class CategoryStore {
|
|
|
10
10
|
dateRangeCategoryTotals: DateRangeCategoryTotals[];
|
|
11
11
|
monthlyCategoryTotals: MonthlyCategoryTotals[];
|
|
12
12
|
dateRangeTotalsLoaded: boolean;
|
|
13
|
-
|
|
13
|
+
dateRangeTotalsLoading: boolean;
|
|
14
14
|
monthlyTotalsLoaded: boolean;
|
|
15
15
|
monthlyTotalsLoading: boolean;
|
|
16
16
|
constructor(globalStore: GlobalStore);
|
|
@@ -29,7 +29,6 @@ export declare class CategoryStore {
|
|
|
29
29
|
loadMonthlyCategoryTotals: (accounts?: Account[], startDate?: Date, endDate?: Date) => Promise<void>;
|
|
30
30
|
reloadCategoryTotals: (accounts: Account[], startDate: Date, endDate: Date) => Promise<void>;
|
|
31
31
|
removeCategory: (guid: string) => Promise<void>;
|
|
32
|
-
setIsLoadingCategoryTotals: (isLoading: boolean) => void;
|
|
33
32
|
updateCategory: (category: Category) => Promise<void>;
|
|
34
33
|
getCategoryName: (guid: string) => string;
|
|
35
34
|
}
|
package/dist/common/index.es.js
CHANGED
|
@@ -2,8 +2,8 @@ import { G as H } from "../useCombineEvents-CRwX-qWE.mjs";
|
|
|
2
2
|
import { A as zr, a as Yr, u as Qr, b as jr } from "../useCombineEvents-CRwX-qWE.mjs";
|
|
3
3
|
import { F as A, A as g } from "../Fetch-DecPFeGU.mjs";
|
|
4
4
|
import { B as Kr } from "../BeatApi-De2IaqH2.mjs";
|
|
5
|
-
import { C as gt } from "../CategoryStore-
|
|
6
|
-
import { a as Zr } from "../CategoryStore-
|
|
5
|
+
import { C as gt } from "../CategoryStore-B5k4Rzok.mjs";
|
|
6
|
+
import { a as Zr } from "../CategoryStore-B5k4Rzok.mjs";
|
|
7
7
|
import { N as mt } from "../NotificationStore-Ck2KdNmT.mjs";
|
|
8
8
|
import { a as ts } from "../NotificationStore-Ck2KdNmT.mjs";
|
|
9
9
|
import { T as _t } from "../User-Byn3qkWJ.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
3
|
import { observer as L } from "mobx-react-lite";
|
|
4
4
|
import { startOfMonth as nt } from "date-fns/startOfMonth";
|
|
5
5
|
import { endOfMonth as ot } from "date-fns/endOfMonth";
|
|
@@ -8,10 +8,10 @@ import _ from "@mui/material/Stack";
|
|
|
8
8
|
import R from "@mui/material/Tab";
|
|
9
9
|
import at from "@mui/material/Tabs";
|
|
10
10
|
import ht from "@mui/material/styles/useTheme";
|
|
11
|
-
import { g as it, a as
|
|
11
|
+
import { g as it, a as rt, S as $, b as Y } from "../SpendingLegend-BiYBGarP.mjs";
|
|
12
12
|
import { Text as S, Icon as ft } from "@mxenabled/mxui";
|
|
13
13
|
import { f as N } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
14
|
-
import { u as x, m as E, d as
|
|
14
|
+
import { u as x, m as E, d as st, b as F, L as lt, a as z, h as ct, g as bt, o as yt } from "../Loader-CTlCnT5j.mjs";
|
|
15
15
|
import { u as dt } from "../useWidgetLoadTimer-BLzUUy8f.mjs";
|
|
16
16
|
import { M as _t } from "../MiniWidgetContainer-Dw7fDSjS.mjs";
|
|
17
17
|
import { startOfToday as q } from "date-fns/startOfToday";
|
|
@@ -28,11 +28,11 @@ import { u as wt } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
|
28
28
|
import { D as Z } from "../Drawer-DV4NTsFg.mjs";
|
|
29
29
|
import { b as M } from "../Category-CevNQ03n.mjs";
|
|
30
30
|
import { A as tt, W as vt } from "../WidgetContainer-Dw95CQIX.mjs";
|
|
31
|
-
const O = ({ amount: n, label: d }) => /* @__PURE__ */
|
|
31
|
+
const O = ({ amount: n, label: d }) => /* @__PURE__ */ s(_, { direction: "column", children: [
|
|
32
32
|
/* @__PURE__ */ t(S, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
|
|
33
33
|
/* @__PURE__ */ t(S, { variant: "XSmall", children: N(n, "0,0") })
|
|
34
34
|
] }), It = () => {
|
|
35
|
-
const n = ht(), { goals: d, spending: o } = x(), { categories: a, dateRangeCategoryTotals: i } = E(), l =
|
|
35
|
+
const n = ht(), { goals: d, spending: o } = x(), { categories: a, dateRangeCategoryTotals: i } = E(), l = r.useMemo(
|
|
36
36
|
() => [
|
|
37
37
|
n.palette.chartMono.chartMono5,
|
|
38
38
|
n.palette.chartMono.chartMono4,
|
|
@@ -42,19 +42,19 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
42
42
|
n.palette.chartMono.chartMono6
|
|
43
43
|
],
|
|
44
44
|
[n]
|
|
45
|
-
), [e, c] =
|
|
45
|
+
), [e, c] = r.useState(""), [g, C] = r.useState(0), u = r.useMemo(
|
|
46
46
|
() => it(a, d, n, i),
|
|
47
47
|
[a, i]
|
|
48
|
-
), p =
|
|
49
|
-
() =>
|
|
48
|
+
), p = r.useMemo(
|
|
49
|
+
() => rt(a, i, l),
|
|
50
50
|
[a, i, l]
|
|
51
51
|
), w = (y, T) => {
|
|
52
52
|
C(T), c("");
|
|
53
53
|
}, f = (y) => {
|
|
54
54
|
c(e === y ? "" : y);
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ s(D, { width: "100%", children: [
|
|
57
|
+
/* @__PURE__ */ s(
|
|
58
58
|
at,
|
|
59
59
|
{
|
|
60
60
|
"aria-label": o.mini_title,
|
|
@@ -102,7 +102,7 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
102
102
|
hidden: g !== 0,
|
|
103
103
|
id: "spending-tabpanel",
|
|
104
104
|
role: "tabpanel",
|
|
105
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ s(_, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
106
106
|
/* @__PURE__ */ t(
|
|
107
107
|
$,
|
|
108
108
|
{
|
|
@@ -123,7 +123,7 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
123
123
|
hidden: g !== 1,
|
|
124
124
|
id: "income-tabpanel",
|
|
125
125
|
role: "tabpanel",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ s(_, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
|
|
127
127
|
/* @__PURE__ */ t(
|
|
128
128
|
$,
|
|
129
129
|
{
|
|
@@ -140,13 +140,13 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
140
140
|
)
|
|
141
141
|
] });
|
|
142
142
|
}, At = L(It), Et = ({ onPrimaryCtaClick: n, sx: d = {} }) => {
|
|
143
|
-
const { isAccountDataLoaded: o, loadAccountData: a } =
|
|
143
|
+
const { isAccountDataLoaded: o, loadAccountData: a } = st(), { dateRangeTotalsLoaded: i, categoriesLoaded: l, loadCategories: e, loadDateRangeCategoryTotals: c } = E(), { spending: g } = x(), { isInitialized: C, selectedAccounts: u } = F();
|
|
144
144
|
return dt({
|
|
145
145
|
widgetName: "SpendingMiniWidget",
|
|
146
146
|
isLoaded: i
|
|
147
|
-
}),
|
|
147
|
+
}), r.useEffect(() => {
|
|
148
148
|
o || a().finally(), l || e().finally();
|
|
149
|
-
}, []),
|
|
149
|
+
}, []), r.useEffect(() => {
|
|
150
150
|
c(
|
|
151
151
|
u,
|
|
152
152
|
nt(/* @__PURE__ */ new Date()),
|
|
@@ -170,10 +170,10 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
170
170
|
title: a
|
|
171
171
|
}) => {
|
|
172
172
|
const { spending: i } = x(), l = n.categoryData.find((e) => e.guid === o);
|
|
173
|
-
return /* @__PURE__ */
|
|
173
|
+
return /* @__PURE__ */ s(_, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
|
|
174
174
|
/* @__PURE__ */ t(S, { bold: !0, id: "spending-list-title", sx: { py: 12 }, children: `${a} ${i.by_category}` }),
|
|
175
175
|
/* @__PURE__ */ t(V, { "aria-hidden": "true" }),
|
|
176
|
-
/* @__PURE__ */ t(J, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ r
|
|
176
|
+
/* @__PURE__ */ t(J, { "aria-labelledby": "spending-list-title", children: n.categoryData.map((e) => /* @__PURE__ */ s(r.Fragment, { children: [
|
|
177
177
|
/* @__PURE__ */ t(
|
|
178
178
|
Q,
|
|
179
179
|
{
|
|
@@ -182,7 +182,7 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
182
182
|
sx: {
|
|
183
183
|
minHeight: 44
|
|
184
184
|
},
|
|
185
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ s(
|
|
186
186
|
xt,
|
|
187
187
|
{
|
|
188
188
|
"aria-expanded": l?.guid === e.guid,
|
|
@@ -200,7 +200,7 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
200
200
|
width: 8
|
|
201
201
|
}
|
|
202
202
|
),
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ s(
|
|
204
204
|
_,
|
|
205
205
|
{
|
|
206
206
|
alignItems: "center",
|
|
@@ -219,7 +219,7 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
219
219
|
}
|
|
220
220
|
),
|
|
221
221
|
/* @__PURE__ */ t(V, {}),
|
|
222
|
-
e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(Lt, { in: l?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */
|
|
222
|
+
e.categoryTotals && e.categoryTotals.length > 0 && /* @__PURE__ */ t(Lt, { in: l?.guid === e.guid, unmountOnExit: !0, children: /* @__PURE__ */ s(J, { children: [
|
|
223
223
|
l?.categoryTotals?.map((c) => /* @__PURE__ */ t(
|
|
224
224
|
Q,
|
|
225
225
|
{
|
|
@@ -228,8 +228,8 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
228
228
|
pr: 8,
|
|
229
229
|
py: 0
|
|
230
230
|
},
|
|
231
|
-
children: /* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ s(_, { direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
232
|
+
/* @__PURE__ */ s(S, { children: [
|
|
233
233
|
c.name,
|
|
234
234
|
" "
|
|
235
235
|
] }),
|
|
@@ -250,8 +250,8 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
250
250
|
selectedId: a,
|
|
251
251
|
title: i
|
|
252
252
|
}) => {
|
|
253
|
-
const { isDesktop: l, isMobile: e } = wt(), {
|
|
254
|
-
return /* @__PURE__ */
|
|
253
|
+
const { isDesktop: l, isMobile: e } = wt(), { categoriesLoading: c } = E(), { spending: g } = x();
|
|
254
|
+
return /* @__PURE__ */ s(
|
|
255
255
|
_,
|
|
256
256
|
{
|
|
257
257
|
alignItems: e ? "center" : "flex-start",
|
|
@@ -312,13 +312,13 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
312
312
|
sortedTransactions: p,
|
|
313
313
|
sortedTransactionsWithSplits: w,
|
|
314
314
|
tags: f
|
|
315
|
-
} = ct(), y = o?.master?.deep_link_params?.account_guids, T = o?.master?.deep_link_params?.view, [v, W] =
|
|
315
|
+
} = ct(), y = o?.master?.deep_link_params?.account_guids, T = o?.master?.deep_link_params?.view, [v, W] = r.useState(""), [b, k] = r.useState(T === "income" ? 1 : 0), [I, P] = r.useState(""), [gt, H] = r.useState(!1), B = r.useMemo(
|
|
316
316
|
() => it(a, l, n, i),
|
|
317
317
|
[a, i]
|
|
318
|
-
), K =
|
|
319
|
-
() =>
|
|
318
|
+
), K = r.useMemo(
|
|
319
|
+
() => rt(a, i, $t(n)),
|
|
320
320
|
[a, i]
|
|
321
|
-
), G =
|
|
321
|
+
), G = r.useMemo(
|
|
322
322
|
() => p.find((m) => m.guid === I),
|
|
323
323
|
[I, p]
|
|
324
324
|
), pt = (m, A) => {
|
|
@@ -352,8 +352,8 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
352
352
|
}, ut = () => {
|
|
353
353
|
Tt(w, f);
|
|
354
354
|
};
|
|
355
|
-
return /* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ s(D, { children: [
|
|
356
|
+
/* @__PURE__ */ s(at, { onChange: pt, value: b, variant: "fullWidth", children: [
|
|
357
357
|
/* @__PURE__ */ t(
|
|
358
358
|
R,
|
|
359
359
|
{
|
|
@@ -406,7 +406,7 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
406
406
|
isOpen: gt,
|
|
407
407
|
onClose: () => H(!1),
|
|
408
408
|
title: e.transactions_drawer_title,
|
|
409
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ s(_, { children: [
|
|
410
410
|
!d && p.length > 0 && /* @__PURE__ */ t(_, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
|
|
411
411
|
Ct,
|
|
412
412
|
{
|
|
@@ -432,13 +432,13 @@ const O = ({ amount: n, label: d }) => /* @__PURE__ */ r(_, { direction: "column
|
|
|
432
432
|
)
|
|
433
433
|
] });
|
|
434
434
|
}, kt = L(Ot), Bt = ({ onBackClick: n, sx: d = {} }) => {
|
|
435
|
-
const { isAccountDataLoaded: o, loadAccountData: a } =
|
|
435
|
+
const { isAccountDataLoaded: o, loadAccountData: a } = st(), { categoriesLoaded: i, dateRangeTotalsLoaded: l, loadCategories: e, loadDateRangeCategoryTotals: c } = E(), { isTransactionDataLoaded: g, loadTransactionData: C } = ct(), { spending: u } = x(), { displayedDateRange: p, isInitialized: w, setDisplayedDate: f, selectedAccounts: y } = F(), { onEvent: T } = bt(), { onLoad: v } = yt(), { clientConfig: W } = z(), b = W?.master?.deep_link_params?.date_range;
|
|
436
436
|
dt({
|
|
437
437
|
widgetName: "SpendingWidget",
|
|
438
438
|
isLoaded: l
|
|
439
|
-
}),
|
|
439
|
+
}), r.useEffect(() => {
|
|
440
440
|
b && Array.isArray(b) && b.length === 2 ? f(b[0], b[1]) : f(nt(q()), ot(q())), o || a().finally(), i || e().finally(), g || C().finally(), T(tt.SPENDING_VIEW);
|
|
441
|
-
}, []),
|
|
441
|
+
}, []), r.useEffect(() => {
|
|
442
442
|
c(
|
|
443
443
|
y,
|
|
444
444
|
p.start,
|