@mx-cartographer/experiences 9.7.134 → 9.7.136
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 +10 -0
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +8 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +82 -89
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +62 -63
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +153 -134
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +3 -2
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +75 -75
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [9.7.136] - 11-11-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - On the micro card, an `ICO-` row logo naming an mx-icons icon (e.g. Debt vs. Income's `note_stack`, Cash Back's `celebration`) now sits on the micro card's tinted icon tile, as in Figma: the icon's colour at 15% (no colour uses `primary.main`, an unknown colour fails closed to the error tint). Entity logos and every non-micro logo are unchanged (WEC-2288)
|
|
4
|
+
- **CHANGED** - Storybook: Save An Extra $100 V2's micro card shows the checking account's institution logo (WEC-2288)
|
|
5
|
+
|
|
6
|
+
## [9.7.135] - 11-11-2026
|
|
7
|
+
|
|
8
|
+
- **ADDED** - Insights 2.0 Monthly Savings to Income Comparison: `DoubleBarChartBlock` renders the `savings_to_income` layout variant (Savings vs Income, chartMono palette), and the `savings_to_income` drawer matches Figma 1243:73833: 6 month tabs from the opening CTA's `drilldown_data` (the card's 4 months until a beat carries them), the "Financial experts suggest saving 20%" tip above the Savings / Income tabs and the Transactions heading above the list. Drawer series from tupac !4066 and ditto !125; tip copy (`savings_to_income_tip_message`, `savings_to_income_tip_percentage`, optional) from mrs_content !506 (WEC-2229)
|
|
9
|
+
- **CHANGED** - The Savings vs. Income drawer title copy key is renamed `monthly_savings_to_income_drawer_title` → `savings_to_income_drawer_title` (a required field on the exported `TransactionHistoryBlock` copy type; paired mrs_content !501, published), and its Savings tab reads the new optional `general.savings_transactions` accessible name (already in mrs_content) (WEC-2229)
|
|
10
|
+
|
|
1
11
|
## [9.7.134] - 11-11-2026
|
|
2
12
|
|
|
3
13
|
- **ADDED** - Insights 2.0 merchant quiz block and merchant spending drawer, with a zero state and loading state (MEW2-3474)
|
|
@@ -44,6 +44,7 @@ interface GeneralInsightsFeedCopy {
|
|
|
44
44
|
in_month_you_had_a_category_of_amount?: string;
|
|
45
45
|
income_transactions?: string;
|
|
46
46
|
spend_transactions?: string;
|
|
47
|
+
savings_transactions?: string;
|
|
47
48
|
/** Subscription status CTA words: the ✓ / ✗ status and Undo. */
|
|
48
49
|
confirmed?: string;
|
|
49
50
|
incorrect?: string;
|
|
@@ -118,7 +119,7 @@ export interface TransactionHistoryBlock {
|
|
|
118
119
|
upcoming_bill_drawer_title: string;
|
|
119
120
|
monthly_spend_to_income_drawer_title: string;
|
|
120
121
|
monthly_debt_to_income_drawer_title: string;
|
|
121
|
-
|
|
122
|
+
savings_to_income_drawer_title: string;
|
|
122
123
|
cost_living_to_income_drawer_title: string;
|
|
123
124
|
non_essential_category_summary_drawer_title: string;
|
|
124
125
|
monthly_deposit_summary_drawer_title: string;
|
|
@@ -132,6 +133,12 @@ export interface TransactionHistoryBlock {
|
|
|
132
133
|
*/
|
|
133
134
|
monthly_debt_to_income_tip_message?: string;
|
|
134
135
|
monthly_debt_to_income_tip_limit?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The Savings vs. Income drawer's tip: `_1{tip}` the bold tip title and `_2{percentage}` the bold
|
|
138
|
+
* percentage (`savings_to_income_tip_percentage`, "20%"). Optional: without both, no tip.
|
|
139
|
+
*/
|
|
140
|
+
savings_to_income_tip_message?: string;
|
|
141
|
+
savings_to_income_tip_percentage?: string;
|
|
135
142
|
}
|
|
136
143
|
export interface TransactionListBlockCopy {
|
|
137
144
|
deposit_history_drawer_title?: string;
|
|
@@ -25,9 +25,8 @@ interface TransactionDrillDownProps {
|
|
|
25
25
|
transaction: Transaction;
|
|
26
26
|
};
|
|
27
27
|
hideListHeader?: boolean;
|
|
28
|
-
tipAboveSubTabs?: boolean;
|
|
29
28
|
}
|
|
30
|
-
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, projectedRow, hideListHeader,
|
|
29
|
+
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, projectedRow, hideListHeader, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
31
30
|
displayName: string;
|
|
32
31
|
};
|
|
33
32
|
export default TransactionDrillDown;
|
|
@@ -1,148 +1,141 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { exportTransactionsToCSV as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { TipSection as
|
|
8
|
-
import { SubTabs as
|
|
1
|
+
import { useGlobalCopyStore as G, useGlobalUiStore as N, useTransactionStore as U } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { exportTransactionsToCSV as j } from "../../../core/utils/TransactionUtils.es.js";
|
|
3
|
+
import z from "../../../common/components/Loader.es.js";
|
|
4
|
+
import O from "../../../transactions/components/shared/transactionlist/TransactionRow.es.js";
|
|
5
|
+
import V from "../../../common/components/SubheaderRow.es.js";
|
|
6
|
+
import q from "../../../transactions/components/shared/TransactionList.es.js";
|
|
7
|
+
import { TipSection as J } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
|
|
8
|
+
import { SubTabs as K, subTabPanelProps as M } from "../../components/SubTabs.es.js";
|
|
9
9
|
import "react";
|
|
10
|
-
import { observer as
|
|
11
|
-
import
|
|
12
|
-
import { H3 as
|
|
13
|
-
import
|
|
14
|
-
import { Icon as
|
|
10
|
+
import { observer as Q } from "mobx-react-lite";
|
|
11
|
+
import f from "@mui/material/Stack";
|
|
12
|
+
import { H3 as X, Text as h } from "@mxenabled/mxui";
|
|
13
|
+
import Y from "@mui/material/Button";
|
|
14
|
+
import { Icon as Z } from "@mxenabled/mx-icons";
|
|
15
15
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
16
16
|
import t from "@mui/material/Box";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
var
|
|
17
|
+
import F from "@mui/material/Tab";
|
|
18
|
+
import H from "@mui/material/Tabs";
|
|
19
|
+
var rr = {
|
|
20
20
|
color: "primary",
|
|
21
21
|
name: "tips_and_updates",
|
|
22
22
|
size: 20
|
|
23
|
-
}, S = "transaction-drill-down-panel",
|
|
24
|
-
const { transactions:
|
|
25
|
-
if (!
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
},
|
|
23
|
+
}, S = "transaction-drill-down-panel", C = (x) => `transaction-details-tab-${x}`, D = "transaction-drill-down-series", _r = Q(function({ ariaLabel: I, heading: e, subHeadingText: l, icon: w, tabs: u, selectedIndex: s, top: v, onSelectionChange: B, transactionFilter: T, tipSection: _, onEachRowClick: k, baseTransactions: P, subTabs: g, projectedRow: c, hideListHeader: d = !1 }) {
|
|
24
|
+
const { transactions: m } = G(), { isCopyLoaded: W } = N(), { sortedTransactionsWithSplits: L, tags: $, detailedTransactions: A } = U();
|
|
25
|
+
if (!W) return /* @__PURE__ */ r(z, {});
|
|
26
|
+
const p = !!u?.length, a = g?.tabs.length ? g : void 0, R = I ?? m.transactions_title, E = (n, i) => {
|
|
27
|
+
B?.(i);
|
|
28
|
+
}, y = T ? (P ?? A).filter(T(s)) : void 0, b = y ?? L;
|
|
29
29
|
return /* @__PURE__ */ o(t, {
|
|
30
30
|
sx: {
|
|
31
31
|
bgcolor: "background.paper",
|
|
32
32
|
width: "100%"
|
|
33
33
|
},
|
|
34
|
-
children: [
|
|
35
|
-
"aria-label":
|
|
36
|
-
onChange:
|
|
34
|
+
children: [p && /* @__PURE__ */ r(H, {
|
|
35
|
+
"aria-label": R,
|
|
36
|
+
onChange: E,
|
|
37
37
|
sx: { mb: 0 },
|
|
38
|
-
value:
|
|
38
|
+
value: s,
|
|
39
39
|
variant: "fullWidth",
|
|
40
|
-
children:
|
|
40
|
+
children: u.map((n, i) => /* @__PURE__ */ r(F, {
|
|
41
41
|
"aria-controls": S,
|
|
42
|
-
"aria-label":
|
|
43
|
-
id:
|
|
44
|
-
label:
|
|
42
|
+
"aria-label": n.ariaLabel,
|
|
43
|
+
id: C(i),
|
|
44
|
+
label: n.label,
|
|
45
45
|
sx: {
|
|
46
46
|
minWidth: "auto",
|
|
47
47
|
px: 0
|
|
48
48
|
}
|
|
49
|
-
}, `${
|
|
49
|
+
}, `${n.label}-${i}`))
|
|
50
50
|
}), /* @__PURE__ */ o(t, {
|
|
51
|
-
"aria-labelledby":
|
|
51
|
+
"aria-labelledby": p ? C(s) : void 0,
|
|
52
52
|
id: S,
|
|
53
|
-
role:
|
|
53
|
+
role: p ? "tabpanel" : void 0,
|
|
54
54
|
children: [
|
|
55
|
-
(
|
|
55
|
+
(e || l) && /* @__PURE__ */ o(f, {
|
|
56
56
|
sx: {
|
|
57
57
|
gap: 4,
|
|
58
58
|
pt: 16,
|
|
59
59
|
px: 24
|
|
60
60
|
},
|
|
61
|
-
children: [
|
|
61
|
+
children: [e && /* @__PURE__ */ r(X, { children: e }), l && /* @__PURE__ */ o(f, {
|
|
62
62
|
sx: {
|
|
63
63
|
alignItems: "center",
|
|
64
64
|
flexDirection: "row",
|
|
65
65
|
gap: 8
|
|
66
66
|
},
|
|
67
|
-
children: [
|
|
67
|
+
children: [w, /* @__PURE__ */ r(h, {
|
|
68
68
|
color: "text.secondary",
|
|
69
69
|
sx: { letterSpacing: "0.52px" },
|
|
70
70
|
textTransform: "uppercase",
|
|
71
71
|
variant: "body2",
|
|
72
|
-
children:
|
|
72
|
+
children: l
|
|
73
73
|
})]
|
|
74
74
|
})]
|
|
75
75
|
}),
|
|
76
76
|
/* @__PURE__ */ r(t, {
|
|
77
77
|
sx: {
|
|
78
|
-
pb:
|
|
78
|
+
pb: v ? 16 : 0,
|
|
79
79
|
pt: 16
|
|
80
80
|
},
|
|
81
|
-
children:
|
|
81
|
+
children: v
|
|
82
82
|
}),
|
|
83
|
-
|
|
84
|
-
icon:
|
|
85
|
-
...
|
|
83
|
+
_ && /* @__PURE__ */ r(J, {
|
|
84
|
+
icon: rr,
|
|
85
|
+
..._
|
|
86
86
|
}),
|
|
87
|
-
|
|
88
|
-
...
|
|
89
|
-
id:
|
|
87
|
+
a && /* @__PURE__ */ r(K, {
|
|
88
|
+
...a,
|
|
89
|
+
id: D
|
|
90
90
|
}),
|
|
91
91
|
/* @__PURE__ */ o(t, {
|
|
92
|
-
...
|
|
93
|
-
children: [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
92
|
+
...a && M(D, a.selectedIndex),
|
|
93
|
+
children: [(!d || b.length > 0) && /* @__PURE__ */ o(f, {
|
|
94
|
+
sx: {
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
borderBottomColor: "divider",
|
|
97
|
+
borderBottomStyle: "solid",
|
|
98
|
+
borderBottomWidth: 1,
|
|
99
|
+
flexDirection: "row",
|
|
100
|
+
justifyContent: d ? "flex-end" : "space-between",
|
|
101
|
+
pb: 4,
|
|
102
|
+
pt: 16,
|
|
103
|
+
px: 24
|
|
104
|
+
},
|
|
105
|
+
children: [!d && /* @__PURE__ */ r(h, {
|
|
106
|
+
bold: !0,
|
|
107
|
+
variant: "body1",
|
|
108
|
+
children: m.transactions_title
|
|
109
|
+
}), b.length > 0 && /* @__PURE__ */ r(Y, {
|
|
110
|
+
onClick: () => {
|
|
111
|
+
j(b, $);
|
|
109
112
|
},
|
|
110
|
-
|
|
113
|
+
startIcon: /* @__PURE__ */ r(Z, { name: "ios_share" }),
|
|
114
|
+
sx: { height: 28 },
|
|
115
|
+
children: /* @__PURE__ */ r(h, {
|
|
111
116
|
bold: !0,
|
|
112
|
-
variant: "
|
|
113
|
-
children:
|
|
114
|
-
}), b.length > 0 && /* @__PURE__ */ r(F, {
|
|
115
|
-
onClick: () => {
|
|
116
|
-
V(b, E);
|
|
117
|
-
},
|
|
118
|
-
startIcon: /* @__PURE__ */ r(H, { name: "ios_share" }),
|
|
119
|
-
sx: { height: 28 },
|
|
120
|
-
children: /* @__PURE__ */ r(x, {
|
|
121
|
-
bold: !0,
|
|
122
|
-
variant: "body2",
|
|
123
|
-
children: p.export_csv_btn
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
}),
|
|
127
|
-
d ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(K, { children: d.heading }), /* @__PURE__ */ r(J, {
|
|
128
|
-
component: "div",
|
|
129
|
-
transaction: d.transaction
|
|
130
|
-
})] }) : /* @__PURE__ */ r(t, {
|
|
131
|
-
sx: { bgcolor: "background.default" },
|
|
132
|
-
children: /* @__PURE__ */ r(M, {
|
|
133
|
-
transaction: C,
|
|
134
|
-
onClick: L
|
|
117
|
+
variant: "body2",
|
|
118
|
+
children: m.export_csv_btn
|
|
135
119
|
})
|
|
120
|
+
})]
|
|
121
|
+
}), c ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(V, { children: c.heading }), /* @__PURE__ */ r(O, {
|
|
122
|
+
component: "div",
|
|
123
|
+
transaction: c.transaction
|
|
124
|
+
})] }) : /* @__PURE__ */ r(t, {
|
|
125
|
+
sx: { bgcolor: "background.default" },
|
|
126
|
+
children: /* @__PURE__ */ r(q, {
|
|
127
|
+
transaction: y,
|
|
128
|
+
onClick: k
|
|
136
129
|
})
|
|
137
|
-
]
|
|
130
|
+
})]
|
|
138
131
|
})
|
|
139
132
|
]
|
|
140
133
|
})]
|
|
141
134
|
});
|
|
142
135
|
});
|
|
143
136
|
export {
|
|
144
|
-
|
|
145
|
-
|
|
137
|
+
_r as TransactionDrillDown,
|
|
138
|
+
_r as default
|
|
146
139
|
};
|
|
147
140
|
|
|
148
141
|
//# sourceMappingURL=TransactionDrillDown.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionIcon,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { Loader, useGlobalCopyStore, useGlobalUiStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport { TransactionList, TransactionRow } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\n// Every Figma drawer tip draws this icon; the shared TipSection keeps its lightbulb for V1 insights.\nconst DRAWER_TIP_ICON: TipSectionIcon = { color: 'primary', name: 'tips_and_updates', size: 20 }\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n // Shown instead of the list: one inert row under its own heading (Upcoming Bill's projected bill,\n // headed \"Projected amount\", as legacy pulse shows it). Not exported to CSV.\n projectedRow?: { heading: string; transaction: Transaction }\n // Drops the Transactions heading above the list; the CSV export, when there is one, stays.\n hideListHeader?: boolean\n // Draws the tip between the chart and the sub-tabs (Debt vs. Income) instead of under the sub-tabs.\n tipAboveSubTabs?: boolean\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n projectedRow,\n hideListHeader = false,\n tipAboveSubTabs = false,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n if (!isCopyLoaded) return <Loader />\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n // The title sits 16px below the tab bar, as in every Figma chart drawer; the theme's 8px\n // gap under Tabs would make it 24.\n sx={{ mb: 0 }}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n textTransform=\"uppercase\"\n variant=\"body2\"\n >\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n {/* Figma's chart drawer pads the chart 16px above and below. */}\n <Box sx={{ pb: top ? 16 : 0, pt: 16 }}>{top}</Box>\n\n {tipAboveSubTabs && tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n {/* TODO: need to use a nseperate compnent from insight-v2, for now using insights-shared component which will be shifted under insights-v2 in future */}\n {!tipAboveSubTabs && tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {(!hideListHeader || exportTransactions.length > 0) && (\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n // Without the heading, the export keeps its place on the right.\n justifyContent: hideListHeader ? 'flex-end' : 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n {!hideListHeader && (\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n )}\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n )}\n\n {projectedRow ? (\n <Box>\n <SubheaderRow>{projectedRow.heading}</SubheaderRow>\n <TransactionRow component=\"div\" transaction={projectedRow.transaction} />\n </Box>\n ) : (\n // The list's scroll box is taller than its rows; Figma fills the space below the last\n // row with background.default, and each row paints its own paper.\n <Box sx={{ bgcolor: 'background.default' }}>\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\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AS,qBAAqB;AAAA,cACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,gBAAiB,aAAa;AAAA,gBAAsB,SAAS;AAAA,cAAiB,CAAA;AAAA,YAC3E,CAAA;AAAA,UAEJ;AAAA;MACF;AAAA,IACF,CAAA,CAAA;AAAA;AAET,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionDrillDown.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport Tab from '@mui/material/Tab'\nimport Tabs from '@mui/material/Tabs'\nimport { observer } from 'mobx-react-lite'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, Text } from '@mxenabled/mxui'\n\nimport {\n TipSection,\n type TipSectionIcon,\n type TipSectionProps,\n} from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { Loader, useGlobalCopyStore, useGlobalUiStore, useTransactionStore } from '../../../common'\nimport type { Transaction } from '../../../core'\nimport { exportTransactionsToCSV } from '../../../core/utils/TransactionUtils'\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport { TransactionList, TransactionRow } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\n// Every Figma drawer tip draws this icon; the shared TipSection keeps its lightbulb for V1 insights.\nconst DRAWER_TIP_ICON: TipSectionIcon = { color: 'primary', name: 'tips_and_updates', size: 20 }\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\nconst SUB_TABS_ID = 'transaction-drill-down-series'\n\ninterface TransactionDrillDownProps {\n ariaLabel?: string\n heading?: string\n subHeadingText?: string\n icon?: React.ReactNode\n tabs?: TabItem[]\n selectedIndex: number\n top: React.ReactNode\n tipSection?: TipSectionProps | false\n onSelectionChange?: (selectedIndex: number) => void\n onEachRowClick?: (guid: string) => void\n transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean\n baseTransactions?: Transaction[]\n // A second row of tabs between the chart and the list (the double-bar drawer's main / comparison\n // series, e.g. Spend / Income). Omitted for every single-series drawer.\n subTabs?: Omit<SubTabsProps, 'id'>\n // Shown instead of the list: one inert row under its own heading (Upcoming Bill's projected bill,\n // headed \"Projected amount\", as legacy pulse shows it). Not exported to CSV.\n projectedRow?: { heading: string; transaction: Transaction }\n // Drops the Transactions heading above the list; the CSV export, when there is one, stays.\n hideListHeader?: boolean\n}\n\nexport const TransactionDrillDown = observer(function TransactionDrillDown({\n ariaLabel,\n heading,\n subHeadingText,\n icon,\n tabs,\n selectedIndex,\n top,\n onSelectionChange,\n transactionFilter,\n tipSection,\n onEachRowClick,\n baseTransactions,\n subTabs,\n projectedRow,\n hideListHeader = false,\n}: TransactionDrillDownProps) {\n const { transactions: transactionsCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { sortedTransactionsWithSplits, tags, detailedTransactions } = useTransactionStore()\n\n if (!isCopyLoaded) return <Loader />\n\n const hasTabs = !!tabs?.length\n // Only a non-empty row gets the tabs and their panel.\n const seriesTabs = subTabs?.tabs.length ? subTabs : undefined\n const tablistLabel = ariaLabel ?? transactionsCopy.transactions_title\n\n const handlePrimaryChange = (_event: React.SyntheticEvent, newValue: number) => {\n onSelectionChange?.(newValue)\n }\n\n const filteredTransactions = transactionFilter\n ? (baseTransactions ?? detailedTransactions).filter(transactionFilter(selectedIndex))\n : undefined\n\n const exportTransactions = filteredTransactions ?? sortedTransactionsWithSplits\n\n return (\n <Box sx={{ bgcolor: 'background.paper', width: '100%' }}>\n {hasTabs && (\n <Tabs\n aria-label={tablistLabel}\n onChange={handlePrimaryChange}\n // The title sits 16px below the tab bar, as in every Figma chart drawer; the theme's 8px\n // gap under Tabs would make it 24.\n sx={{ mb: 0 }}\n value={selectedIndex}\n variant=\"fullWidth\"\n >\n {tabs!.map((tab, index) => (\n <Tab\n aria-controls={PANEL_ID}\n aria-label={tab.ariaLabel}\n id={tabId(index)}\n key={`${tab.label}-${index}`}\n label={tab.label}\n sx={{ minWidth: 'auto', px: 0 }}\n />\n ))}\n </Tabs>\n )}\n\n <Box\n aria-labelledby={hasTabs ? tabId(selectedIndex) : undefined}\n id={PANEL_ID}\n role={hasTabs ? 'tabpanel' : undefined}\n >\n {(heading || subHeadingText) && (\n <Stack sx={{ gap: 4, pt: 16, px: 24 }}>\n {heading && <H3>{heading}</H3>}\n {subHeadingText && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {icon}\n <Text\n color=\"text.secondary\"\n sx={{ letterSpacing: '0.52px' }}\n textTransform=\"uppercase\"\n variant=\"body2\"\n >\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n {/* Figma's chart drawer pads the chart 16px above and below. */}\n <Box sx={{ pb: top ? 16 : 0, pt: 16 }}>{top}</Box>\n\n {/* Every Figma chart drawer puts the tip under the chart, above any sub-tabs. */}\n {tipSection && <TipSection icon={DRAWER_TIP_ICON} {...tipSection} />}\n\n {seriesTabs && <SubTabs {...seriesTabs} id={SUB_TABS_ID} />}\n\n {/* The content the sub-tabs control, as the month tabs' panel above. */}\n <Box {...(seriesTabs && subTabPanelProps(SUB_TABS_ID, seriesTabs.selectedIndex))}>\n {(!hideListHeader || exportTransactions.length > 0) && (\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n // Without the heading, the export keeps its place on the right.\n justifyContent: hideListHeader ? 'flex-end' : 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n {!hideListHeader && (\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\n )}\n {exportTransactions.length > 0 && (\n <Button\n onClick={() => {\n exportTransactionsToCSV(exportTransactions, tags)\n }}\n startIcon={<Icon name=\"ios_share\" />}\n sx={{ height: 28 }}\n >\n <Text bold={true} variant=\"body2\">\n {transactionsCopy.export_csv_btn}\n </Text>\n </Button>\n )}\n </Stack>\n )}\n\n {projectedRow ? (\n <Box>\n <SubheaderRow>{projectedRow.heading}</SubheaderRow>\n <TransactionRow component=\"div\" transaction={projectedRow.transaction} />\n </Box>\n ) : (\n // The list's scroll box is taller than its rows; Figma fills the space below the last\n // row with background.default, and each row paints its own paper.\n <Box sx={{ bgcolor: 'background.default' }}>\n <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,IAAM,KAAkC;AAAA,EAAE,OAAO;AAAA,EAAW,MAAM;AAAA,EAAoB,MAAM;AAAG,GAEzF,IAAW,gCACX,IAAA,CAAS,MAAkB,2BAA2B,CAAA,IACtD,IAAc,iCAyBP,KAAuB,EAAS,SAA8B,EACzE,WAAA,GACA,SAAA,GACA,gBAAA,GACA,MAAA,GACA,MAAA,GACA,eAAA,GACA,KAAA,GACA,mBAAA,GACA,mBAAA,GACA,YAAA,GACA,gBAAA,GACA,kBAAA,GACA,SAAA,GACA,cAAA,GACA,gBAAA,IAAiB,GAAA,GACW;AAC5B,QAAM,EAAE,cAAc,EAAA,IAAqB,EAAmB,GACxD,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,8BAAA,GAA8B,MAAA,GAAM,sBAAA,EAAA,IAAyB,EAAoB;AAEzF,MAAI,CAAC,EAAc,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAEnC,QAAM,IAAU,CAAC,CAAC,GAAM,QAElB,IAAa,GAAS,KAAK,SAAS,IAAU,QAC9C,IAAe,KAAa,EAAiB,oBAE7C,IAAA,CAAuB,GAA8B,MAAqB;AAC9E,IAAA,IAAoB,CAAQ;AAAA,EAC9B,GAEM,IAAuB,KACx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,CAEL;AAAA,UAGR,CAAA,GAAA,IACC,gBAAA,EAAC,GAAD,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD,EAAA,UAAe,EAAa,QAAsB,CAAA,GAClD,gBAAA,EAAC,GAAD;AAAA,YAAgB,WAAU;AAAA,YAAM,aAAa,EAAa;AAAA,UAAc,CAAA,CACrE,EAAA,CAAA,IAIL,gBAAA,EAAC,GAAD;AAAA,YAAK,IAAI,EAAE,SAAS,qBAAqB;AAAA,YACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,cAAiB,aAAa;AAAA,cAAsB,SAAS;AAAA,YAAiB,CAAA;AAAA,UAC3E,CAAA,CAEJ;AAAA;MACF;AAAA,IACF,CAAA,CAAA;AAAA;AAET,CAAC"}
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { CURRENCY_FORMAT as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { BAR_ARIA_LABEL as
|
|
6
|
-
import { BarChartV2 as
|
|
7
|
-
import { EmptyBarChart as
|
|
1
|
+
import { useGlobalCopyStore as At, useGlobalUiStore as Dt, useInsightsV2Store as Bt } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { CURRENCY_FORMAT as St, formatCurrency as vt } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import Lt from "../../../common/components/drawer/Drawer.es.js";
|
|
4
|
+
import It from "../../../common/components/Loader.es.js";
|
|
5
|
+
import { BAR_ARIA_LABEL as Et } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
6
|
+
import { BarChartV2 as Rt } from "../../components/chartblocks/BarchartV2.es.js";
|
|
7
|
+
import { EmptyBarChart as xt } from "../../components/chartblocks/EmptyBarChart.es.js";
|
|
8
8
|
import { ANALYTICS_EVENTS_CONFIG as V } from "../../analytics/analyticsEventsConfig.es.js";
|
|
9
|
-
import { useAnalyticsEvent as
|
|
10
|
-
import { DoubleBarChart as
|
|
11
|
-
import { toLegendItems as
|
|
12
|
-
import { getDefaultSelection as
|
|
13
|
-
import { getDynamicCtaBasedOnTriggers as
|
|
14
|
-
import { TransactionDrillDown as
|
|
15
|
-
import { useTransactionHistory as
|
|
16
|
-
import { TransactionDetailsBlock as
|
|
17
|
-
import { useLayoutEffect as
|
|
18
|
-
import { observer as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { useTheme as
|
|
21
|
-
var _e =
|
|
22
|
-
const D =
|
|
9
|
+
import { useAnalyticsEvent as Ft } from "../../analytics/useAnalyticsEvent.es.js";
|
|
10
|
+
import { DoubleBarChart as Ot } from "../../components/chartblocks/DoubleBarChart.es.js";
|
|
11
|
+
import { toLegendItems as jt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
|
|
12
|
+
import { getDefaultSelection as Gt, getDrillDownConfig as Ht, getFlattenedDataSeries as wt, resolveDrillDownSubHeader as Nt, splitProjectedTransaction as kt, toStoreFilter as Mt } from "./utils.es.js";
|
|
13
|
+
import { getDynamicCtaBasedOnTriggers as Kt } from "../util.es.js";
|
|
14
|
+
import { TransactionDrillDown as Pt } from "./TransactionDrillDown.es.js";
|
|
15
|
+
import { useTransactionHistory as Vt } from "./useTransactionHistory.es.js";
|
|
16
|
+
import { TransactionDetailsBlock as zt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
17
|
+
import { useLayoutEffect as Ut, useState as m } from "react";
|
|
18
|
+
import { observer as Yt } from "mobx-react-lite";
|
|
19
|
+
import { Fragment as Wt, jsx as r, jsxs as $t } from "react/jsx-runtime";
|
|
20
|
+
import { useTheme as qt } from "@mui/material/styles";
|
|
21
|
+
var _e = Yt(({ beat: s }) => {
|
|
22
|
+
const D = qt(), { actionDrawer: B, setActionContext: S } = Bt(), { insights_payload: c } = s, v = Kt(B, c?.primary_cta, c?.secondary_cta, c?.in_description_cta), z = v?.variant, { top: e, filterMode: u, header: U, colors: Y, filterStrategy: W, tipSection: L, subTabAriaLabels: $, slotData: q, beatTransactions: J, hideListHeader: Q, averageFormat: X, subTabs: Z } = Ht(z ?? ""), { instanceSlotData: o, beatTransactions: g, spendCategoryGuids: I, allAccountGuids: E, categoryName: tt, displayedDateRange: h, transactionStore: et } = Vt(s, {
|
|
23
23
|
slotData: q,
|
|
24
24
|
beatTransactions: J
|
|
25
|
-
},
|
|
25
|
+
}, v?.drilldown_data), { common: ot, insights_feed: n } = At(), { isCopyLoaded: at } = Dt(), [nt, R] = m(!1), [rt, st] = m(!1), x = Ft(), { dataSeries: p, chartData: b, comparisonBars: i } = wt({
|
|
26
26
|
data: o?.data_series,
|
|
27
|
-
ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" :
|
|
27
|
+
ariaLabel: e === "doubleBar" ? n?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : Et,
|
|
28
28
|
top: e,
|
|
29
29
|
beatTransactions: g
|
|
30
|
-
}), d = e === "doubleBar",
|
|
30
|
+
}), d = e === "doubleBar", it = e === "tabsOnly", l = d ? i : b, { chartBarIndex: F, subTabIndex: lt } = Gt({
|
|
31
31
|
chartTabCount: b.length,
|
|
32
32
|
comparisonTabCount: i.length,
|
|
33
|
-
actionDrawer:
|
|
33
|
+
actionDrawer: B,
|
|
34
34
|
beatGuid: s.guid
|
|
35
|
-
}), [a,
|
|
36
|
-
l.length !==
|
|
37
|
-
const
|
|
35
|
+
}), [a, _] = m(F), [C, O] = m(lt), [ct, dt] = m(l.length);
|
|
36
|
+
l.length !== ct && (dt(l.length), _(F));
|
|
37
|
+
const T = (t) => W({
|
|
38
38
|
beat: s,
|
|
39
39
|
beatTransactions: g,
|
|
40
40
|
dataSeries: p,
|
|
41
41
|
comparisonBars: i,
|
|
42
42
|
selectedIndex: t,
|
|
43
|
-
subIndex:
|
|
43
|
+
subIndex: C,
|
|
44
44
|
isLastTab: t === l.length - 1,
|
|
45
45
|
instanceSlotData: o,
|
|
46
46
|
spendCategoryGuids: I,
|
|
47
47
|
displayedDateRange: h
|
|
48
|
-
}),
|
|
48
|
+
}), mt = g.map((t) => t.guid).join(","), ut = I.join(","), gt = E.join(","), pt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, j = () => {
|
|
49
49
|
if (u !== "store") return;
|
|
50
|
-
const t =
|
|
50
|
+
const t = pt ? T(a) : {
|
|
51
51
|
accounts: [],
|
|
52
52
|
custom: () => !1
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
et.setFilter(Mt(t, {
|
|
55
55
|
allAccountGuids: E,
|
|
56
56
|
displayedDateRange: h
|
|
57
57
|
}));
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
Ut(() => {
|
|
60
60
|
j();
|
|
61
61
|
}, [
|
|
62
62
|
s.guid,
|
|
63
63
|
a,
|
|
64
|
-
|
|
64
|
+
C,
|
|
65
65
|
u,
|
|
66
66
|
p.length,
|
|
67
67
|
o,
|
|
68
68
|
h,
|
|
69
|
-
gt,
|
|
70
|
-
pt,
|
|
71
69
|
ut,
|
|
70
|
+
gt,
|
|
71
|
+
mt,
|
|
72
72
|
e
|
|
73
73
|
]);
|
|
74
|
-
const G =
|
|
74
|
+
const G = Nt(c), y = U?.({
|
|
75
75
|
title: c?.title,
|
|
76
76
|
subHeader: G,
|
|
77
|
-
categoryName:
|
|
77
|
+
categoryName: tt,
|
|
78
78
|
selectedDate: b[a]?.date ?? void 0
|
|
79
79
|
}), H = Y(D, o?.category_guid);
|
|
80
|
-
if (!
|
|
81
|
-
const [w, N] = o?.legends ?? [],
|
|
80
|
+
if (!at) return /* @__PURE__ */ r(It, {});
|
|
81
|
+
const [w, N] = o?.legends ?? [], bt = u === "local" ? (t) => T(t).custom ?? (() => !0) : void 0, { transactions: ft, projectedTransaction: A } = kt(g), ht = u === "local" ? ft : void 0, k = n.general.projected_amount, _t = A && k && T(a).custom?.(A) ? {
|
|
82
82
|
heading: k,
|
|
83
83
|
transaction: A
|
|
84
84
|
} : void 0, M = (t, f) => {
|
|
85
|
-
x(V.DRAWER_CHART_BAR_CLICKED),
|
|
85
|
+
x(V.DRAWER_CHART_BAR_CLICKED), _(t), f !== void 0 && O(f);
|
|
86
86
|
}, Ct = (t) => {
|
|
87
|
-
x(V.TAB_SELECTED),
|
|
88
|
-
}, K = d ?
|
|
87
|
+
x(V.TAB_SELECTED), _(t);
|
|
88
|
+
}, K = d ? jt([{
|
|
89
89
|
...w,
|
|
90
90
|
value: i[a]?.main
|
|
91
91
|
}, {
|
|
92
92
|
...N,
|
|
93
93
|
value: i[a]?.comparison
|
|
94
|
-
}]) : void 0,
|
|
94
|
+
}]) : void 0, Tt = $?.(n) ?? [], P = d ? (K ?? []).map((t, f) => ({
|
|
95
95
|
label: t.label,
|
|
96
|
-
ariaLabel:
|
|
97
|
-
})) :
|
|
96
|
+
ariaLabel: Tt[f]
|
|
97
|
+
})) : it ? p.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : Z?.({
|
|
98
98
|
instanceSlotData: o,
|
|
99
99
|
copy: n
|
|
100
|
-
}).map((t) => ({ label: t })) ?? [],
|
|
100
|
+
}).map((t) => ({ label: t })) ?? [], yt = d || e === "singleBar" || e === "upcomingBill" ? l.length ? d ? /* @__PURE__ */ r(Ot, {
|
|
101
101
|
bars: i,
|
|
102
102
|
colors: H,
|
|
103
103
|
legendPosition: "top",
|
|
104
104
|
legends: K,
|
|
105
105
|
onBarClick: M,
|
|
106
106
|
selectedIndex: a
|
|
107
|
-
}) : /* @__PURE__ */ r(
|
|
107
|
+
}) : /* @__PURE__ */ r(Rt, {
|
|
108
108
|
amounts: {
|
|
109
109
|
average: o?.average_amount,
|
|
110
|
-
formattedAverage:
|
|
110
|
+
formattedAverage: vt(o?.average_amount ?? 0, X ?? St.cents)
|
|
111
111
|
},
|
|
112
112
|
color: H[0] ?? D.palette.primary.main,
|
|
113
113
|
data: b,
|
|
@@ -123,11 +123,10 @@ var _e = Wt(({ beat: s }) => {
|
|
|
123
123
|
onBarClick: M,
|
|
124
124
|
selectedTabIndex: a,
|
|
125
125
|
trendAmountLabel: N?.label ?? n.general.trend
|
|
126
|
-
}) : /* @__PURE__ */ r(
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
baseTransactions:
|
|
126
|
+
}) : /* @__PURE__ */ r(xt, {}) : null;
|
|
127
|
+
return /* @__PURE__ */ $t(Wt, { children: [/* @__PURE__ */ r(Pt, {
|
|
128
|
+
baseTransactions: ht,
|
|
129
129
|
hideListHeader: Q,
|
|
130
|
-
tipAboveSubTabs: X,
|
|
131
130
|
projectedRow: _t,
|
|
132
131
|
heading: y?.heading,
|
|
133
132
|
icon: y?.icon,
|
|
@@ -135,25 +134,25 @@ var _e = Wt(({ beat: s }) => {
|
|
|
135
134
|
selectedIndex: a,
|
|
136
135
|
subHeadingText: y?.subHeadingText,
|
|
137
136
|
tabs: l,
|
|
138
|
-
top:
|
|
137
|
+
top: yt,
|
|
139
138
|
...P.length > 0 && { subTabs: {
|
|
140
139
|
tabs: P,
|
|
141
|
-
selectedIndex:
|
|
140
|
+
selectedIndex: C,
|
|
142
141
|
onChange: O
|
|
143
142
|
} },
|
|
144
|
-
...L && { tipSection: !
|
|
145
|
-
transactionFilter:
|
|
143
|
+
...L && { tipSection: !rt && (L(st, n, G?.text, o) ?? !1) },
|
|
144
|
+
transactionFilter: bt,
|
|
146
145
|
onEachRowClick: (t) => {
|
|
147
|
-
|
|
146
|
+
S({ transaction_guid: t }), R(!0);
|
|
148
147
|
}
|
|
149
|
-
}), /* @__PURE__ */ r(
|
|
150
|
-
ariaLabelClose:
|
|
151
|
-
isOpen:
|
|
148
|
+
}), /* @__PURE__ */ r(Lt, {
|
|
149
|
+
ariaLabelClose: ot.close_aria,
|
|
150
|
+
isOpen: nt,
|
|
152
151
|
onClose: () => {
|
|
153
|
-
R(!1),
|
|
152
|
+
R(!1), S({ transaction_guid: void 0 }), j();
|
|
154
153
|
},
|
|
155
154
|
title: n.general.transaction_details_title,
|
|
156
|
-
children: /* @__PURE__ */ r(
|
|
155
|
+
children: /* @__PURE__ */ r(zt, { beat: s })
|
|
157
156
|
})] });
|
|
158
157
|
});
|
|
159
158
|
export {
|