@mx-cartographer/experiences 9.4.59 → 9.4.60
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 +34 -1
- package/dist/core/api/BeatApi.d.ts +6 -0
- package/dist/core/api/BeatApi.es.js +1 -1
- package/dist/core/api/BeatApi.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.d.ts +7 -0
- package/dist/core/stores/CategoryStore.es.js +18 -7
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/types/Beat.d.ts +6 -0
- package/dist/core/types/Beat.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +127 -5
- package/dist/core/types/InsightsInstanceSlotData.d.ts +1 -13
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/index.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.d.ts +31 -0
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +22 -0
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.d.ts +10 -9
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +7 -7
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/beatActions.d.ts +7 -0
- package/dist/insights-v2/beatActions.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +8 -8
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.d.ts +30 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +67 -24
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/index.d.ts +1 -1
- package/dist/insights-v2/components/BadgedTile.d.ts +22 -0
- package/dist/insights-v2/components/BadgedTile.es.js +46 -0
- package/dist/insights-v2/components/BadgedTile.es.js.map +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +113 -92
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.d.ts +31 -0
- package/dist/insights-v2/components/CompactInsightCard.es.js +129 -0
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -0
- package/dist/insights-v2/components/Footer.d.ts +1 -4
- package/dist/insights-v2/components/Footer.es.js +30 -21
- package/dist/insights-v2/components/Footer.es.js.map +1 -1
- package/dist/insights-v2/components/Header.es.js +10 -10
- package/dist/insights-v2/components/Header.es.js.map +1 -1
- package/dist/insights-v2/components/InsightErrorCard.d.ts +19 -0
- package/dist/insights-v2/components/InsightErrorCard.es.js +45 -0
- package/dist/insights-v2/components/InsightErrorCard.es.js.map +1 -0
- package/dist/insights-v2/components/InsightTransactionRow.es.js +19 -15
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/LogoFromGuid.d.ts +26 -0
- package/dist/insights-v2/components/LogoFromGuid.es.js +48 -0
- package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -0
- package/dist/insights-v2/components/StatusBadge.d.ts +16 -0
- package/dist/insights-v2/components/StatusBadge.es.js +29 -0
- package/dist/insights-v2/components/StatusBadge.es.js.map +1 -0
- package/dist/insights-v2/components/StatusPill.d.ts +11 -2
- package/dist/insights-v2/components/StatusPill.es.js +25 -13
- package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
- package/dist/insights-v2/components/SubHeader.es.js +7 -5
- package/dist/insights-v2/components/SubHeader.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +11 -11
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/EntityLogo.d.ts +26 -0
- package/dist/insights-v2/components/shared/EntityLogo.es.js +33 -0
- package/dist/insights-v2/components/shared/EntityLogo.es.js.map +1 -0
- package/dist/insights-v2/index.d.ts +6 -0
- package/dist/insights-v2/index.es.js +95 -81
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +2 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +50 -44
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/insights-v2/resolveInsightRender.d.ts +30 -0
- package/dist/insights-v2/resolveInsightRender.es.js +10 -0
- package/dist/insights-v2/resolveInsightRender.es.js.map +1 -0
- package/dist/microinsights/cards/InsightCard.es.js +83 -39
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/carousel/BeatList.es.js +24 -24
- package/dist/microinsights/carousel/BeatList.es.js.map +1 -1
- package/dist/notifications/components/NotificationBadge.es.js +12 -10
- package/dist/notifications/components/NotificationBadge.es.js.map +1 -1
- package/dist/notifications/components/NotificationCard.es.js +27 -18
- package/dist/notifications/components/NotificationCard.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +7 -0
- package/dist/transactions/components/shared/TransactionDetails.es.js +159 -143
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionInsightTag.d.ts +26 -0
- package/dist/transactions/components/shared/TransactionInsightTag.es.js +53 -0
- package/dist/transactions/components/shared/TransactionInsightTag.es.js.map +1 -0
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +30 -39
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/AmountCell.es.js +15 -15
- package/dist/transactions/components/shared/transactiontable/cells/AmountCell.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { postInsightOnTransaction as c } from "../../../common/utils/PostMessage.es.js";
|
|
2
|
+
import p from "../../../insights-v2/components/StatusPill.es.js";
|
|
3
|
+
import { resolveInsightRender as g } from "../../../insights-v2/resolveInsightRender.es.js";
|
|
4
|
+
import { Text as u } from "@mxenabled/mxui";
|
|
5
|
+
import { Lightbulb as d } from "@mxenabled/mx-icons";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
var o = {
|
|
8
|
+
bgcolor: "primary.lighter",
|
|
9
|
+
borderColor: "primary.lighter",
|
|
10
|
+
textColor: "primary.darker"
|
|
11
|
+
}, v = ({ beat: r, legacyBold: e = !0, legacyColor: a = "action.active", legacyTruncate: s = !0 }) => {
|
|
12
|
+
const l = g(r), n = (t) => {
|
|
13
|
+
t.stopPropagation(), t.preventDefault(), c(r.guid);
|
|
14
|
+
};
|
|
15
|
+
if (l === "error") return null;
|
|
16
|
+
if (l === "v2") {
|
|
17
|
+
const t = r.insights_payload?.pill?.text;
|
|
18
|
+
return t ? /* @__PURE__ */ i(p, {
|
|
19
|
+
bgcolor: o.bgcolor,
|
|
20
|
+
borderColor: o.borderColor,
|
|
21
|
+
"data-testid": "transaction-insight-pill",
|
|
22
|
+
icon: /* @__PURE__ */ i(d, {
|
|
23
|
+
size: 12,
|
|
24
|
+
sx: { color: o.textColor }
|
|
25
|
+
}),
|
|
26
|
+
label: t,
|
|
27
|
+
labelColor: o.textColor,
|
|
28
|
+
labelVariant: "caption",
|
|
29
|
+
onClick: n,
|
|
30
|
+
sx: {
|
|
31
|
+
cursor: "pointer",
|
|
32
|
+
gap: 4,
|
|
33
|
+
minHeight: 18,
|
|
34
|
+
px: 8,
|
|
35
|
+
py: 1
|
|
36
|
+
}
|
|
37
|
+
}) : null;
|
|
38
|
+
}
|
|
39
|
+
return r.short_title ? /* @__PURE__ */ i(u, {
|
|
40
|
+
bold: e,
|
|
41
|
+
color: a,
|
|
42
|
+
"data-testid": "transaction-insight-caption",
|
|
43
|
+
onClick: n,
|
|
44
|
+
truncate: s,
|
|
45
|
+
variant: "caption",
|
|
46
|
+
children: r.short_title
|
|
47
|
+
}) : null;
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
v as default
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=TransactionInsightTag.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionInsightTag.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionInsightTag.tsx"],"sourcesContent":["import type { SyntheticEvent } from 'react'\n\nimport { Lightbulb } from '@mxenabled/mx-icons'\nimport { Text } from '@mxenabled/mxui'\n\nimport { postInsightOnTransaction } from '../../../common/utils/PostMessage'\nimport type { Beat } from '../../../core'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks`, whose chart blocks\n// reach back into transactions code (see the circular-import note in `actionBlocksKey.ts`).\nimport StatusPill from '../../../insights-v2/components/StatusPill'\nimport { resolveInsightRender } from '../../../insights-v2/resolveInsightRender'\n\n/** Figma 1941:111883 \"Inline Insight\": `primary.lighter` surface, 12px radius, lightbulb + caption. */\nconst PILL_TOKENS = {\n bgcolor: 'primary.lighter',\n borderColor: 'primary.lighter',\n textColor: 'primary.darker',\n} as const\n\nexport interface TransactionInsightTagProps {\n /** The beat matched to the row by `associated_transaction_guid`. */\n beat: Beat\n /** Caption color for the legacy branch (the two surfaces use different tokens). */\n legacyColor?: string\n /** Whether the legacy caption is bold (the list row is, the table cell is). */\n legacyBold?: boolean\n /** Truncate the legacy caption (the list row does; the table cell wraps its own column). */\n legacyTruncate?: boolean\n}\n\n/**\n * The transaction row's insight tag, shared by the list row and the table's amount cell so the two\n * cannot drift (`insights_v2.2.md` §10.1). Three-way branch on the matched beat:\n *\n * - `v2` → `insights_payload.pill.text` drawn as a `StatusPill`; nothing when the envelope has\n * no `pill` (the insight tags no row).\n * - `error` → nothing. A flagged beat with no envelope must never fall back to `short_title`: that\n * caption is filled from the same V2 copy block and would hide the failure.\n * - `legacy` → `short_title` as the plain caption, exactly as before.\n *\n * On tap both branches post `mx/moneyDashboard/insightOnTransaction` with the beat guid, as today.\n * The caller keeps the `showInsights` gate.\n */\nconst TransactionInsightTag = ({\n beat,\n legacyBold = true,\n legacyColor = 'action.active',\n legacyTruncate = true,\n}: TransactionInsightTagProps) => {\n const render = resolveInsightRender(beat)\n\n const handleClick = (event: SyntheticEvent) => {\n event.stopPropagation()\n event.preventDefault()\n postInsightOnTransaction(beat.guid)\n }\n\n if (render === 'error') return null\n\n if (render === 'v2') {\n const text = beat.insights_payload?.pill?.text\n if (!text) return null\n\n return (\n <StatusPill\n bgcolor={PILL_TOKENS.bgcolor}\n borderColor={PILL_TOKENS.borderColor}\n data-testid=\"transaction-insight-pill\"\n icon={<Lightbulb size={12} sx={{ color: PILL_TOKENS.textColor }} />}\n label={text}\n labelColor={PILL_TOKENS.textColor}\n labelVariant=\"caption\"\n onClick={handleClick}\n sx={{ cursor: 'pointer', gap: 4, minHeight: 18, px: 8, py: 1 }}\n />\n )\n }\n\n if (!beat.short_title) return null\n\n return (\n <Text\n bold={legacyBold}\n color={legacyColor}\n data-testid=\"transaction-insight-caption\"\n onClick={handleClick}\n truncate={legacyTruncate}\n variant=\"caption\"\n >\n {beat.short_title}\n </Text>\n )\n}\n\nexport default TransactionInsightTag\n"],"mappings":";;;;;;AAaA,IAAM,IAAc;AAAA,EAClB,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AACb,GA0BM,IAAA,CAAyB,EAC7B,MAAA,GACA,YAAA,IAAa,IACb,aAAA,IAAc,iBACd,gBAAA,IAAiB,GAAA,MACe;AAChC,QAAM,IAAS,EAAqB,CAAI,GAElC,IAAA,CAAe,MAA0B;AAC7C,IAAA,EAAM,gBAAgB,GACtB,EAAM,eAAe,GACrB,EAAyB,EAAK,IAAI;AAAA,EACpC;AAEA,MAAI,MAAW,QAAS,QAAO;AAE/B,MAAI,MAAW,MAAM;AACnB,UAAM,IAAO,EAAK,kBAAkB,MAAM;AAC1C,WAAK,IAGH,gBAAA,EAAC,GAAD;AAAA,MACE,SAAS,EAAY;AAAA,MACrB,aAAa,EAAY;AAAA,MACzB,eAAY;AAAA,MACZ,MAAM,gBAAA,EAAC,GAAD;AAAA,QAAW,MAAM;AAAA,QAAI,IAAI,EAAE,OAAO,EAAY,UAAU;AAAA,MAAI,CAAA;AAAA,MAClE,OAAO;AAAA,MACP,YAAY,EAAY;AAAA,MACxB,cAAa;AAAA,MACb,SAAS;AAAA,MACT,IAAI;AAAA,QAAE,QAAQ;AAAA,QAAW,KAAK;AAAA,QAAG,WAAW;AAAA,QAAI,IAAI;AAAA,QAAG,IAAI;AAAA,MAAE;AAAA,IAC9D,CAAA,IAbe;AAAA,EAepB;AAEA,SAAK,EAAK,cAGR,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,IACP,eAAY;AAAA,IACZ,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAQ;AAAA,IAEP,UAAA,EAAK;AAAA,EACF,CAAA,IAZsB;AAchC"}
|
|
@@ -1,91 +1,82 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
1
|
+
import { useGlobalCopyStore as C, useTransactionStore as v } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import { TransactionType as w } from "../../../../core/types/Transaction.es.js";
|
|
3
3
|
import { formatCurrency as S } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
-
import { isTransferTransaction as
|
|
5
|
-
import { ListItemWrapper as
|
|
4
|
+
import { isTransferTransaction as N } from "../../../../core/utils/TransactionUtils.es.js";
|
|
5
|
+
import { ListItemWrapper as k } from "../../../../common/components/ListItemWrapper.es.js";
|
|
6
6
|
import { useTransactionsUiStore as f } from "../../../context/hooks.es.js";
|
|
7
7
|
import { ON_CLICK_EVENTS as L } from "../../../constants/OnClickEvents.es.js";
|
|
8
|
-
import
|
|
8
|
+
import E from "../TransactionInsightTag.es.js";
|
|
9
9
|
import _ from "react";
|
|
10
10
|
import { observer as R } from "mobx-react-lite";
|
|
11
|
-
import
|
|
12
|
-
import { Icon as
|
|
13
|
-
import { jsx as
|
|
11
|
+
import n from "@mui/material/Stack";
|
|
12
|
+
import { Icon as a, MerchantLogo as j, Text as d } from "@mxenabled/mxui";
|
|
13
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
14
14
|
import { useTheme as M } from "@mui/material/styles";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
var
|
|
18
|
-
const g = M().palette.mode === "dark", { associatedBeats:
|
|
15
|
+
import z from "@mui/material/ListItemAvatar";
|
|
16
|
+
import A from "@mui/material/ListItemText";
|
|
17
|
+
var G = ({ transaction: e, onClick: m, component: c }) => {
|
|
18
|
+
const g = M().palette.mode === "dark", { associatedBeats: p } = v(), { expandedSplits: h } = f(), { transactions: T } = C(), { showInsights: y } = f(), l = e.transaction_type === w.CREDIT, b = N(e) && !!e.institutionName, u = _.useMemo(() => p.find((i) => i.associated_transaction_guid === e.guid), [p, e]), x = (i, o) => {
|
|
19
19
|
const s = [];
|
|
20
|
-
return
|
|
20
|
+
return i.is_flagged && s.push(/* @__PURE__ */ r(a, {
|
|
21
21
|
fill: !0,
|
|
22
22
|
name: "flag",
|
|
23
23
|
size: 16,
|
|
24
24
|
sx: { color: o ? "primary.main" : "warning.dark" }
|
|
25
|
-
}, "flag")),
|
|
25
|
+
}, "flag")), i.is_hidden && s.push(/* @__PURE__ */ r(a, {
|
|
26
26
|
name: "visibility_off",
|
|
27
27
|
size: 16
|
|
28
|
-
}, "hidden")),
|
|
28
|
+
}, "hidden")), i.has_been_split && s.push(/* @__PURE__ */ r(a, {
|
|
29
29
|
name: "call_split",
|
|
30
30
|
size: 16
|
|
31
31
|
}, "split")), s;
|
|
32
|
-
},
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
}, I = (i, o) => i.is_hidden ? o.is_excluded : i.has_been_split ? o.split_transaction_category_label : i.category || "";
|
|
33
|
+
return /* @__PURE__ */ t(k, {
|
|
34
34
|
clickEventName: L.ON_TRANSACTION_LIST_ITEM_CLICK,
|
|
35
|
-
...
|
|
35
|
+
...c && { component: c },
|
|
36
36
|
onClick: m ? () => m(e.guid) : void 0,
|
|
37
37
|
sx: e.is_hidden ? {
|
|
38
38
|
backgroundColor: "grey.50",
|
|
39
39
|
color: "text.secondary"
|
|
40
40
|
} : void 0,
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ r(z, { children: e.parent_guid && h.includes(e.parent_guid) ? /* @__PURE__ */ r(_.Fragment, {}) : /* @__PURE__ */ r(j, {
|
|
42
42
|
categoryGuid: e.top_level_category_guid || "",
|
|
43
43
|
merchantGuid: e.merchant_guid || ""
|
|
44
|
-
}) }), /* @__PURE__ */
|
|
44
|
+
}) }), /* @__PURE__ */ r(A, {
|
|
45
45
|
disableTypography: !0,
|
|
46
|
-
secondary: /* @__PURE__ */
|
|
46
|
+
secondary: /* @__PURE__ */ t(n, {
|
|
47
47
|
direction: "row",
|
|
48
48
|
justifyContent: "space-between",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ t(n, {
|
|
50
50
|
alignItems: "center",
|
|
51
51
|
direction: "row",
|
|
52
52
|
gap: 4,
|
|
53
|
-
children: [
|
|
53
|
+
children: [x(e, g), /* @__PURE__ */ r(d, {
|
|
54
54
|
truncate: !0,
|
|
55
55
|
variant: "caption",
|
|
56
|
-
children:
|
|
56
|
+
children: I(e, T)
|
|
57
57
|
})]
|
|
58
|
-
}),
|
|
59
|
-
bold: !0,
|
|
60
|
-
color: "action.active",
|
|
61
|
-
onClick: (r) => {
|
|
62
|
-
r.stopPropagation(), r.preventDefault(), E(a.guid);
|
|
63
|
-
},
|
|
64
|
-
truncate: !0,
|
|
65
|
-
variant: "caption",
|
|
66
|
-
children: a.short_title
|
|
67
|
-
})]
|
|
58
|
+
}), u && y && /* @__PURE__ */ r(E, { beat: u })]
|
|
68
59
|
}),
|
|
69
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ t(n, {
|
|
70
61
|
direction: "row",
|
|
71
62
|
justifyContent: "space-between",
|
|
72
63
|
sx: { gap: 8 },
|
|
73
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ r(d, {
|
|
74
65
|
bold: !0,
|
|
75
66
|
truncate: !0,
|
|
76
67
|
variant: "body1",
|
|
77
68
|
children: b ? e.institutionName : e.payee || e.description || e.feed_description
|
|
78
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ t(d, {
|
|
79
70
|
bold: !0,
|
|
80
|
-
color:
|
|
71
|
+
color: l ? "success.main" : "text.primary",
|
|
81
72
|
sx: { flexShrink: 0 },
|
|
82
73
|
variant: "body1",
|
|
83
|
-
children: [
|
|
74
|
+
children: [l ? "+" : "", S(e.amount, "0,0.00")]
|
|
84
75
|
})]
|
|
85
76
|
})
|
|
86
77
|
})]
|
|
87
78
|
});
|
|
88
|
-
}, $ = R(
|
|
79
|
+
}, $ = R(G);
|
|
89
80
|
export {
|
|
90
81
|
$ as default
|
|
91
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionRow.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactionlist/TransactionRow.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Icon, MerchantLogo, Text } from '@mxenabled/mxui'\n\nimport { ListItemWrapper, useGlobalCopyStore, useTransactionStore } from '../../../../common'\nimport { Transaction, TransactionType } from '../../../../core'\nimport { isTransferTransaction } from '../../../../core/utils/TransactionUtils'\n\nimport
|
|
1
|
+
{"version":3,"file":"TransactionRow.es.js","names":[],"sources":["../../../../../src/transactions/components/shared/transactionlist/TransactionRow.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemText from '@mui/material/ListItemText'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Icon, MerchantLogo, Text } from '@mxenabled/mxui'\n\nimport { ListItemWrapper, useGlobalCopyStore, useTransactionStore } from '../../../../common'\nimport { Transaction, TransactionType } from '../../../../core'\nimport { isTransferTransaction } from '../../../../core/utils/TransactionUtils'\n\nimport TransactionInsightTag from '../TransactionInsightTag'\n\nimport { ON_CLICK_EVENTS } from '../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../context/hooks'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\ninterface TransactionRowProps {\n component?: React.ElementType\n onClick?: (guid: string) => void\n transaction: Transaction\n}\n\nconst TransactionRow: React.FC<TransactionRowProps> = ({ transaction, onClick, component }) => {\n const theme = useTheme()\n const isDarkMode = theme.palette.mode === 'dark'\n\n const { associatedBeats } = useTransactionStore()\n const { expandedSplits } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n const { showInsights } = useTransactionsUiStore()\n\n const isCredit = transaction.transaction_type === TransactionType.CREDIT\n\n const showInstitution = isTransferTransaction(transaction) && Boolean(transaction.institutionName)\n\n const beat = React.useMemo(() => {\n return associatedBeats.find((beat) => beat.associated_transaction_guid === transaction.guid)\n }, [associatedBeats, transaction])\n\n const getTransactionStatusIcons = (\n transaction: Transaction,\n isDarkMode: boolean,\n ): React.ReactNode[] => {\n const icons: React.ReactNode[] = []\n\n if (transaction.is_flagged) {\n icons.push(\n <Icon\n fill={true}\n key=\"flag\"\n name=\"flag\"\n size={16}\n sx={{ color: isDarkMode ? 'primary.main' : 'warning.dark' }}\n />,\n )\n }\n\n if (transaction.is_hidden) {\n icons.push(<Icon key=\"hidden\" name=\"visibility_off\" size={16} />)\n }\n\n if (transaction.has_been_split) {\n icons.push(<Icon key=\"split\" name=\"call_split\" size={16} />)\n }\n\n return icons\n }\n\n const getTransactionCategoryText = (transaction: Transaction, copy: any): string => {\n if (transaction.is_hidden) {\n return copy.is_excluded\n }\n\n if (transaction.has_been_split) {\n return copy.split_transaction_category_label\n }\n\n return transaction.category || ''\n }\n\n return (\n //TODO: implement common/components/ListItemRow.tsx\n <ListItemWrapper\n clickEventName={ON_CLICK_EVENTS.ON_TRANSACTION_LIST_ITEM_CLICK}\n {...(component && { component })}\n onClick={onClick ? () => onClick(transaction.guid) : undefined}\n sx={\n transaction.is_hidden ? { backgroundColor: 'grey.50', color: 'text.secondary' } : undefined\n }\n >\n <ListItemAvatar>\n {transaction.parent_guid && expandedSplits.includes(transaction.parent_guid) ? (\n <React.Fragment />\n ) : (\n <MerchantLogo\n categoryGuid={transaction.top_level_category_guid || ''}\n merchantGuid={transaction.merchant_guid || ''}\n />\n )}\n </ListItemAvatar>\n <ListItemText\n disableTypography={true}\n secondary={\n <Stack direction=\"row\" justifyContent=\"space-between\">\n <Stack alignItems=\"center\" direction=\"row\" gap={4}>\n {getTransactionStatusIcons(transaction, isDarkMode)}\n <Text truncate={true} variant=\"caption\">\n {getTransactionCategoryText(transaction, copy)}\n </Text>\n </Stack>\n {beat && showInsights && <TransactionInsightTag beat={beat} />}\n </Stack>\n }\n >\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ gap: 8 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {showInstitution\n ? transaction.institutionName\n : transaction.payee || transaction.description || transaction.feed_description}\n </Text>\n <Text\n bold={true}\n color={isCredit ? 'success.main' : 'text.primary'}\n sx={{ flexShrink: 0 }}\n variant=\"body1\"\n >\n {isCredit ? '+' : ''}\n {formatCurrency(transaction.amount, '0,0.00')}\n </Text>\n </Stack>\n </ListItemText>\n </ListItemWrapper>\n )\n}\n\nexport default observer(TransactionRow)\n"],"mappings":";;;;;;;;;;;;;;;;AA0BA,IAAM,IAAA,CAAiD,EAAE,aAAA,GAAa,SAAA,GAAS,WAAA,EAA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CACxC;AAAA,QACD,CAAA,CAAA;AAAA;IACK,CAAA,CACC;AAAA;AAErB,GAEA,IAAe,EAAS,CAAc"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useTransactionStore as
|
|
2
|
-
import { TransactionType as
|
|
3
|
-
import { formatCurrency as
|
|
4
|
-
import { useTransactionsUiStore as
|
|
1
|
+
import { useTransactionStore as m } from "../../../../../common/context/hooks.es.js";
|
|
2
|
+
import { TransactionType as d } from "../../../../../core/types/Transaction.es.js";
|
|
3
|
+
import { formatCurrency as l } from "../../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { useTransactionsUiStore as f } from "../../../../context/hooks.es.js";
|
|
5
|
+
import p from "../../TransactionInsightTag.es.js";
|
|
5
6
|
import u from "@mui/material/Stack";
|
|
6
|
-
import { Text as
|
|
7
|
-
import { jsx as
|
|
7
|
+
import { Text as g } from "@mxenabled/mxui";
|
|
8
|
+
import { jsx as T, jsxs as a } from "react/jsx-runtime";
|
|
8
9
|
var _ = (t) => {
|
|
9
|
-
const { associatedBeats:
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
const { associatedBeats: n } = m(), { showInsights: i } = f(), { amount: s, transaction_type: e } = t.row, r = n.find((c) => c.associated_transaction_guid === t.row.guid), o = e === d.CREDIT;
|
|
11
|
+
return /* @__PURE__ */ a(u, {
|
|
11
12
|
alignItems: "flex-end",
|
|
12
13
|
tabIndex: t.tabIndex,
|
|
13
|
-
children: [/* @__PURE__ */
|
|
14
|
+
children: [/* @__PURE__ */ a(g, {
|
|
14
15
|
bold: o,
|
|
15
16
|
color: o ? "success.main" : "text.primary",
|
|
16
17
|
variant: "body2",
|
|
17
|
-
children: [o ? "+" : "",
|
|
18
|
-
}), r &&
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
children: r.short_title
|
|
18
|
+
children: [o ? "+" : "", l(s, "0,0.00")]
|
|
19
|
+
}), r && i && /* @__PURE__ */ T(p, {
|
|
20
|
+
beat: r,
|
|
21
|
+
legacyColor: "primary.light",
|
|
22
|
+
legacyTruncate: !1
|
|
23
23
|
})]
|
|
24
24
|
});
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountCell.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiontable/cells/AmountCell.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { GridCellParams } from '@mui/x-data-grid'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { useTransactionStore } from '../../../../../common'\nimport { TransactionType } from '../../../../../core'\n\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { formatCurrency } from '../../../../../core/utils/NumberFormatting'\n\nconst AmountCell = (params: GridCellParams) => {\n const { associatedBeats } = useTransactionStore()\n const { showInsights } = useTransactionsUiStore()\n\n const { amount, transaction_type } = params.row\n const beat = associatedBeats.find((beat) => beat.associated_transaction_guid === params.row.guid)\n\n const isCredit = transaction_type === TransactionType.CREDIT\n\n return (\n <Stack alignItems=\"flex-end\" tabIndex={params.tabIndex}>\n <Text bold={isCredit} color={isCredit ? 'success.main' : 'text.primary'} variant=\"body2\">\n {isCredit ? '+' : ''}\n {formatCurrency(amount, '0,0.00')}\n </Text>\n {beat && showInsights && (\n <
|
|
1
|
+
{"version":3,"file":"AmountCell.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiontable/cells/AmountCell.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { GridCellParams } from '@mui/x-data-grid'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { useTransactionStore } from '../../../../../common'\nimport { TransactionType } from '../../../../../core'\n\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { formatCurrency } from '../../../../../core/utils/NumberFormatting'\nimport TransactionInsightTag from '../../TransactionInsightTag'\n\nconst AmountCell = (params: GridCellParams) => {\n const { associatedBeats } = useTransactionStore()\n const { showInsights } = useTransactionsUiStore()\n\n const { amount, transaction_type } = params.row\n const beat = associatedBeats.find((beat) => beat.associated_transaction_guid === params.row.guid)\n\n const isCredit = transaction_type === TransactionType.CREDIT\n\n return (\n <Stack alignItems=\"flex-end\" tabIndex={params.tabIndex}>\n <Text bold={isCredit} color={isCredit ? 'success.main' : 'text.primary'} variant=\"body2\">\n {isCredit ? '+' : ''}\n {formatCurrency(amount, '0,0.00')}\n </Text>\n {beat && showInsights && (\n <TransactionInsightTag beat={beat} legacyColor=\"primary.light\" legacyTruncate={false} />\n )}\n </Stack>\n )\n}\n\nexport default AmountCell\n"],"mappings":";;;;;;;;AAaA,IAAM,IAAA,CAAc,MAA2B;AAC7C,QAAM,EAAE,iBAAA,EAAA,IAAoB,EAAoB,GAC1C,EAAE,cAAA,EAAA,IAAiB,EAAuB,GAE1C,EAAE,QAAA,GAAQ,kBAAA,EAAA,IAAqB,EAAO,KACtC,IAAO,EAAgB,KAAA,CAAM,MAAS,EAAK,gCAAgC,EAAO,IAAI,IAAI,GAE1F,IAAW,MAAqB,EAAgB;AAEtD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,YAAW;AAAA,IAAW,UAAU,EAAO;AAAA,IAA9C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAM,MAAM;AAAA,MAAU,OAAO,IAAW,iBAAiB;AAAA,MAAgB,SAAQ;AAAA,MAAjF,UAAA,CACG,IAAW,MAAM,IACjB,EAAe,GAAQ,QAAQ,CAC5B;AAAA,IACL,CAAA,GAAA,KAAQ,KACP,gBAAA,EAAC,GAAD;AAAA,MAA6B,MAAA;AAAA,MAAM,aAAY;AAAA,MAAgB,gBAAgB;AAAA,IAAQ,CAAA,CAEpF;AAAA;AAEX"}
|