@mx-cartographer/experiences 7.0.22 → 7.0.23-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 +4 -0
- package/dist/goals/index.es.js +493 -494
- package/dist/trends/index.es.js +94 -98
- package/package.json +1 -1
package/dist/trends/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as f, Fragment as Fe } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { observer as M } from "mobx-react-lite";
|
|
4
|
-
import { Icon as
|
|
4
|
+
import { Icon as re, Text as X, CategoryIcon as Te, P as Y, H3 as De, ChevronRightIcon as Pe } from "@mxenabled/mxui";
|
|
5
5
|
import O from "@mui/material/Box";
|
|
6
6
|
import _ from "@mui/material/Stack";
|
|
7
7
|
import pe from "@mui/material/Button";
|
|
@@ -12,7 +12,7 @@ import { T as eo } from "../TrendsStore-WrHxzdbQ.mjs";
|
|
|
12
12
|
import { i as Ue, c as Xe, d as Ze, e as Qe, f as qe, h as Je, b as Le, g as xe, j as _e } from "../SpendingData-D5vsfYKo.mjs";
|
|
13
13
|
import et from "@mui/material/ToggleButton";
|
|
14
14
|
import tt from "@mui/material/ToggleButtonGroup";
|
|
15
|
-
import { u as R, k as F, e as H, a as P, f as
|
|
15
|
+
import { u as R, k as F, e as H, a as P, f as ae, c as ie, v as q, l as ve, p as nt, m as ot } from "../hooks-DkUqN6JE.mjs";
|
|
16
16
|
import { u as K } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
17
|
import { f as Z, D as B } from "../Dialog-CWW597AF.mjs";
|
|
18
18
|
import { DataGridPro as st } from "@mui/x-data-grid-pro";
|
|
@@ -52,7 +52,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
52
52
|
onChange: o,
|
|
53
53
|
orientation: "horizontal",
|
|
54
54
|
value: n,
|
|
55
|
-
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(et, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(
|
|
55
|
+
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(et, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(re, { name: "table_chart_view" }) : /* @__PURE__ */ e(re, { name: "format_list_bulleted" }) }, t))
|
|
56
56
|
}
|
|
57
57
|
), Oe = ({ selectedDateRange: n, selectedCategoryGuid: o }) => {
|
|
58
58
|
const { trends: t } = R(), { isMobile: s, isDesktop: a } = K(), { getCategoryName: h } = F(), l = i.useMemo(() => {
|
|
@@ -200,7 +200,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
200
200
|
isOpen: t,
|
|
201
201
|
onClose: s
|
|
202
202
|
}) => {
|
|
203
|
-
const { onEvent: a } = H(), { selectedAccountGuids: h } = P(), { common: l } = R(), { setFilter: c, sortedTransactions: d } =
|
|
203
|
+
const { onEvent: a } = H(), { selectedAccountGuids: h } = P(), { common: l } = R(), { setFilter: c, sortedTransactions: d } = ae(), [m, C] = i.useState(""), u = i.useMemo(
|
|
204
204
|
() => d.find((r) => r.guid === m),
|
|
205
205
|
[m, d]
|
|
206
206
|
);
|
|
@@ -229,9 +229,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
229
229
|
}
|
|
230
230
|
);
|
|
231
231
|
}, Wt = M(Nt), Ot = ({ onBackClick: n, sx: o }) => {
|
|
232
|
-
const { onEvent: t } = H(), { isDesktop: s, isTablet: a, isMobile: h } = K(), { visibleAccounts: l } =
|
|
232
|
+
const { onEvent: t } = H(), { isDesktop: s, isTablet: a, isMobile: h } = K(), { visibleAccounts: l } = ie(), { loadMonthlyCategoryTotals: c, monthlyCategoryTotals: d, getCategoryName: m } = F(), { sortedTransactions: C } = ae(), { selectedDateRange: u, setSelectedDateRange: b } = q(), { isCopyLoaded: r, isInitialized: g, selectedAccounts: T, setSelectedAccounts: p } = P(), { trends: E } = R(), [w, I] = i.useState(!1), [k, D] = i.useState(!1), [N, x] = i.useState("Chart"), [L, $] = i.useState(""), [z, ce] = i.useState(window.innerHeight), ee = z - (h ? 315 : 345);
|
|
233
233
|
i.useEffect(() => {
|
|
234
|
-
const S = () =>
|
|
234
|
+
const S = () => ce(window.innerHeight);
|
|
235
235
|
return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
|
|
236
236
|
}, []), i.useEffect(() => {
|
|
237
237
|
p(l);
|
|
@@ -264,9 +264,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
264
264
|
b({ start: W, end: G }), t(y.TRENDS_CLICK_TIME_WINDOW, {
|
|
265
265
|
time_period: ge + "M"
|
|
266
266
|
});
|
|
267
|
-
},
|
|
267
|
+
}, le = () => {
|
|
268
268
|
t(y.TRENDS_CLICK_FILTER);
|
|
269
|
-
},
|
|
269
|
+
}, se = (S) => {
|
|
270
270
|
$(S);
|
|
271
271
|
}, de = (S) => {
|
|
272
272
|
$(S), t(y.TRENDS_CLICK_LEGEND, { category: m(S) });
|
|
@@ -284,7 +284,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
284
284
|
calendarActions: { onRangeChanged: oe },
|
|
285
285
|
dateRange: u,
|
|
286
286
|
dateRangeVariant: "timeframebuttons",
|
|
287
|
-
onAccountsFilterClick:
|
|
287
|
+
onAccountsFilterClick: le,
|
|
288
288
|
onBackClick: n,
|
|
289
289
|
sx: o,
|
|
290
290
|
title: E.title,
|
|
@@ -317,7 +317,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
317
317
|
),
|
|
318
318
|
/* @__PURE__ */ f(_, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
319
319
|
/* @__PURE__ */ e(O, { flexGrow: 1, children: L && /* @__PURE__ */ f(pe, { onClick: () => $(""), sx: { p: 0, pr: 5 }, children: [
|
|
320
|
-
/* @__PURE__ */ e(
|
|
320
|
+
/* @__PURE__ */ e(re, { name: "arrow_back" }),
|
|
321
321
|
E.all_categories
|
|
322
322
|
] }) }),
|
|
323
323
|
/* @__PURE__ */ e(pe, { onClick: () => D(!0), sx: { px: 5 }, children: `${E.view_transactions} (${C.length})` })
|
|
@@ -339,7 +339,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
339
339
|
Ve,
|
|
340
340
|
{
|
|
341
341
|
monthlyCategoryTotals: d,
|
|
342
|
-
onClickRow:
|
|
342
|
+
onClickRow: se,
|
|
343
343
|
selectedCategory: L,
|
|
344
344
|
selectedDateRange: u
|
|
345
345
|
}
|
|
@@ -379,7 +379,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
379
379
|
}
|
|
380
380
|
);
|
|
381
381
|
}, Gt = M(Vt), Bt = ({ onPrimaryCtaClick: n, sx: o }) => {
|
|
382
|
-
const { visibleAccounts: t } =
|
|
382
|
+
const { visibleAccounts: t } = ie(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = F(), { isInitialized: h } = ve(), { trends: l } = R(), { isCopyLoaded: c, selectedAccounts: d, setSelectedAccounts: m } = P();
|
|
383
383
|
return i.useEffect(() => {
|
|
384
384
|
m(t);
|
|
385
385
|
}, [t]), i.useEffect(() => {
|
|
@@ -489,7 +489,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
489
489
|
] })
|
|
490
490
|
] });
|
|
491
491
|
}), Zn = M(({ onCtaClick: n }) => {
|
|
492
|
-
const { visibleAccounts: o } =
|
|
492
|
+
const { visibleAccounts: o } = ie(), { onEvent: t } = H(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: h } = F(), l = {
|
|
493
493
|
start: lt(/* @__PURE__ */ new Date(), 1),
|
|
494
494
|
end: /* @__PURE__ */ new Date()
|
|
495
495
|
}, { trends: c } = R(), { selectedAccounts: d, setSelectedAccounts: m, isInitialized: C } = P();
|
|
@@ -754,7 +754,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
754
754
|
}
|
|
755
755
|
) });
|
|
756
756
|
}), Xt = M(({ onClose: n }) => {
|
|
757
|
-
const o = Ne(), { onEvent: t } = H(), { common: s, trends: a } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: l } = q(), { sortedTransactions: c } =
|
|
757
|
+
const o = Ne(), { onEvent: t } = H(), { common: s, trends: a } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: l } = q(), { sortedTransactions: c } = ae(), [d, m] = i.useState(null);
|
|
758
758
|
if (!h)
|
|
759
759
|
return null;
|
|
760
760
|
const { guid: C, name: u, is_income: b, totalAmount: r } = h, g = b ? a.category_income : a.category_spending, T = Lt(C, o), p = b ? a.income_label : a.spending_label, E = ` ${h.transactions.length === 1 ? a.transaction : a.transactions} (${h.transactions.length})`, w = i.useMemo(
|
|
@@ -860,15 +860,15 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
860
860
|
}
|
|
861
861
|
);
|
|
862
862
|
}, Jt = M(qt), en = ({ onBackClick: n, onInsightCardClick: o, sx: t }) => {
|
|
863
|
-
const { onEvent: s } = H(), { config: a } = ot(), { isLargeDesktop: h, isDesktop: l, isMobile: c } = K(), { visibleAccounts: d } =
|
|
863
|
+
const { onEvent: s } = H(), { config: a } = ot(), { isLargeDesktop: h, isDesktop: l, isMobile: c } = K(), { visibleAccounts: d } = ie(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: u } = F(), { setFilter: b } = ae(), { selectedDateRange: r, setSelectedCategoryData: g, setSelectedDateRange: T } = q(), {
|
|
864
864
|
isCopyLoaded: p,
|
|
865
865
|
isInitialized: E,
|
|
866
866
|
selectedAccounts: w,
|
|
867
867
|
selectedAccountGuids: I,
|
|
868
868
|
setSelectedAccounts: k
|
|
869
|
-
} = P(), { trends: D } = R(), N = Ye(), x = l || h, [L, $] = i.useState(!1), [z,
|
|
869
|
+
} = P(), { trends: D } = R(), N = Ye(), x = l || h, [L, $] = i.useState(!1), [z, ce] = i.useState("Chart"), [J, ee] = i.useState(""), [te, ne] = i.useState(!1), [oe, le] = i.useState(window.innerHeight), se = oe - 208, de = oe - (N ? 494 : 266);
|
|
870
870
|
i.useEffect(() => {
|
|
871
|
-
const v = () =>
|
|
871
|
+
const v = () => le(window.innerHeight);
|
|
872
872
|
return window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
|
|
873
873
|
}, []), i.useEffect(() => {
|
|
874
874
|
k(d);
|
|
@@ -904,7 +904,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
904
904
|
}, ue = () => {
|
|
905
905
|
g(null), ne(!1);
|
|
906
906
|
}, me = (v, V) => {
|
|
907
|
-
|
|
907
|
+
ce(V ?? z), s(y.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
908
908
|
...A,
|
|
909
909
|
toggleView: V
|
|
910
910
|
});
|
|
@@ -923,10 +923,8 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
923
923
|
ee(v);
|
|
924
924
|
}, ge = () => {
|
|
925
925
|
ee(""), s(y.TRENDS_CLICK_ALL_CATEGORIES, A);
|
|
926
|
-
};
|
|
927
|
-
|
|
928
|
-
const Ge = a.show_connections_widget_in_master ? "buttons" : "no-buttons", Be = L && d.length === 0;
|
|
929
|
-
return /* @__PURE__ */ f(
|
|
926
|
+
}, Ge = a.show_connections_widget_in_master ? "buttons" : "no-buttons", Be = L && !d?.length;
|
|
927
|
+
return !p || !L ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
|
|
930
928
|
Ae,
|
|
931
929
|
{
|
|
932
930
|
accountOptions: d,
|
|
@@ -937,86 +935,84 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
937
935
|
onBackClick: n,
|
|
938
936
|
sx: t,
|
|
939
937
|
title: D.title,
|
|
940
|
-
children:
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
{
|
|
969
|
-
header: "",
|
|
970
|
-
icon: "",
|
|
971
|
-
onClick: () => {
|
|
972
|
-
},
|
|
973
|
-
primaryButton: D.empty_state_primary,
|
|
974
|
-
subText: D.empty_state_sub_text,
|
|
975
|
-
variant: Ge
|
|
976
|
-
}
|
|
977
|
-
),
|
|
978
|
-
/* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: J && /* @__PURE__ */ f(pe, { onClick: ge, sx: { p: 0, pr: 5 }, children: [
|
|
979
|
-
/* @__PURE__ */ e(se, { name: "arrow_back" }),
|
|
980
|
-
D.all_categories
|
|
981
|
-
] }) }) }),
|
|
982
|
-
/* @__PURE__ */ f(_, { flexDirection: x ? "row" : "column", gap: x ? 48 : 16, children: [
|
|
983
|
-
z === "Chart" && /* @__PURE__ */ f(Fe, { children: [
|
|
984
|
-
/* @__PURE__ */ e(O, { sx: { width: x ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
985
|
-
Jt,
|
|
938
|
+
children: Be ? /* @__PURE__ */ e(
|
|
939
|
+
vt,
|
|
940
|
+
{
|
|
941
|
+
header: D.zero_state_content_header,
|
|
942
|
+
icon: "",
|
|
943
|
+
onClick: () => {
|
|
944
|
+
},
|
|
945
|
+
primaryButton: D.empty_state_primary,
|
|
946
|
+
subText: D.empty_state_sub_text,
|
|
947
|
+
sx: { height: se },
|
|
948
|
+
variant: Ge
|
|
949
|
+
}
|
|
950
|
+
) : /* @__PURE__ */ f(
|
|
951
|
+
_,
|
|
952
|
+
{
|
|
953
|
+
sx: {
|
|
954
|
+
px: c ? 0 : 48
|
|
955
|
+
},
|
|
956
|
+
children: [
|
|
957
|
+
/* @__PURE__ */ f(
|
|
958
|
+
_,
|
|
959
|
+
{
|
|
960
|
+
flexDirection: "row",
|
|
961
|
+
justifyContent: "space-between",
|
|
962
|
+
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
963
|
+
children: [
|
|
964
|
+
/* @__PURE__ */ e(
|
|
965
|
+
Oe,
|
|
986
966
|
{
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
selectedDateRange: r,
|
|
990
|
-
totals: u
|
|
967
|
+
selectedCategoryGuid: J,
|
|
968
|
+
selectedDateRange: r
|
|
991
969
|
}
|
|
992
|
-
)
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
Ve,
|
|
970
|
+
),
|
|
971
|
+
/* @__PURE__ */ e(We, { onTabChange: me, selectedTab: z })
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
),
|
|
975
|
+
/* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: J && /* @__PURE__ */ f(pe, { onClick: ge, sx: { p: 0, pr: 5 }, children: [
|
|
976
|
+
/* @__PURE__ */ e(re, { name: "arrow_back" }),
|
|
977
|
+
D.all_categories
|
|
978
|
+
] }) }) }),
|
|
979
|
+
/* @__PURE__ */ f(_, { flexDirection: x ? "row" : "column", gap: x ? 48 : 16, children: [
|
|
980
|
+
z === "Chart" && /* @__PURE__ */ f(Fe, { children: [
|
|
981
|
+
/* @__PURE__ */ e(O, { sx: { width: x ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
982
|
+
Jt,
|
|
1006
983
|
{
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
selectedDateRange: r
|
|
984
|
+
availableHeight: se,
|
|
985
|
+
minHeight: 450,
|
|
986
|
+
selectedDateRange: r,
|
|
987
|
+
totals: u
|
|
1012
988
|
}
|
|
1013
|
-
) })
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
989
|
+
) }),
|
|
990
|
+
/* @__PURE__ */ f(_, { gap: 16, sx: { width: x ? "32%" : "100%" }, children: [
|
|
991
|
+
N && /* @__PURE__ */ e(Yt, { onInsightCardClick: o }),
|
|
992
|
+
/* @__PURE__ */ e(
|
|
993
|
+
Kt,
|
|
994
|
+
{
|
|
995
|
+
availableHeight: de,
|
|
996
|
+
onCategoryClick: he
|
|
997
|
+
}
|
|
998
|
+
)
|
|
999
|
+
] })
|
|
1000
|
+
] }),
|
|
1001
|
+
z === "Table" && /* @__PURE__ */ e(O, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1002
|
+
Ve,
|
|
1003
|
+
{
|
|
1004
|
+
height: "unset",
|
|
1005
|
+
monthlyCategoryTotals: u,
|
|
1006
|
+
onClickRow: G,
|
|
1007
|
+
selectedCategory: J,
|
|
1008
|
+
selectedDateRange: r
|
|
1009
|
+
}
|
|
1010
|
+
) })
|
|
1011
|
+
] }),
|
|
1012
|
+
te && /* @__PURE__ */ e(Xt, { onClose: ue })
|
|
1013
|
+
]
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
1020
1016
|
}
|
|
1021
1017
|
);
|
|
1022
1018
|
}, Qn = M(en);
|