@mx-cartographer/experiences 9.7.122 → 9.7.124
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 +9 -0
- package/dist/common/components/WidgetContainer.es.js +29 -29
- package/dist/common/components/WidgetContainer.es.js.map +1 -1
- package/dist/common/components/drawer/Header.es.js +1 -1
- package/dist/common/components/drawer/Header.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +66 -62
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +86 -85
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +5 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +137 -107
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +4 -2
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +17 -13
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +7 -7
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +6 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +31 -31
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/dist/settings/NotificationSettingsWidget.es.js +1 -1
- package/dist/settings/NotificationSettingsWidget.es.js.map +1 -1
- package/dist/trends/TrendsFullWidget.es.js +18 -18
- package/dist/trends/TrendsFullWidget.es.js.map +1 -1
- package/dist/trends/TrendsWidget.es.js +1 -1
- package/dist/trends/TrendsWidget.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [9.7.124] - 11-07-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Monthly Debt to Income Comparison on Insights 2.0: the `debt_to_income` double-bar palette (Debt chart5, Income chart1; replaces the unused legacy `DebtToIncome` key) shared by the card and its drawer, and the Debt vs. Income drawer (`debt_to_income`, titled by the existing `monthly_debt_to_income_drawer_title`): 6 month tabs, the 30% tip above the Debt / Income tabs, and that month's transactions. The drawer reads its series and legend labels only from the `drilldown_data` of the CTA that opened it and shows no bars or rows without it; no tip until the copy service carries `monthly_debt_to_income_tip_message` / `_tip_limit` (WEC-2254)
|
|
4
|
+
- **ADDED** - Monthly Debt to Income Comparison V2 Storybook QA page (`InsightsV2/Insights/MonthlyDebtToIncomeComparisonV2`): full, mini, micro and the drill-down for Below 30% and Above 30% (WEC-2254)
|
|
5
|
+
|
|
6
|
+
## [9.7.123] - 11-06-2026
|
|
7
|
+
|
|
8
|
+
- **CHANGED** - Back buttons now use the arrow_back_ios_new icon on every screen (WELL-154)
|
|
9
|
+
|
|
1
10
|
## [9.7.122] - 11-06-2026
|
|
2
11
|
|
|
3
12
|
- **FIXED** - A micro status icon whose colour is `primary.main` or a chart colour (`chart.chart1`–`chart.chart7`) draws its tile and glyph in that colour instead of the error red: Weekly New Merchants' money bag (chart-2) and Savings Account Balances Summary's bar chart (primary). Status colours and the error fallback are unchanged, and no other beat sends these colours (WEC-2236)
|
|
@@ -12,15 +12,15 @@ import i from "@mui/material/Stack";
|
|
|
12
12
|
import { Icon as l, Text as de } from "@mxenabled/mxui";
|
|
13
13
|
import le from "@mui/material/Button";
|
|
14
14
|
import ce from "@mui/material/Paper";
|
|
15
|
-
import {
|
|
15
|
+
import { ArrowBackIosNew as fe } from "@mxenabled/mx-icons";
|
|
16
16
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
17
17
|
import f from "@mui/material/IconButton";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
18
|
+
import pe from "@mui/material/Card";
|
|
19
|
+
import he from "@mui/material/CardContent";
|
|
20
20
|
import ge from "@mui/material/Divider";
|
|
21
|
-
var De = me(({ actions:
|
|
22
|
-
const [
|
|
23
|
-
n && (n(),
|
|
21
|
+
var De = me(({ actions: I, allowedAccountTypes: y, calendarActions: p, children: _, className: E = "mx-cmn-widget", dateRange: W, dateRangeVariant: A, hasDivider: B = !1, onAccountsFilterClick: R, onBackClick: n, onMenuClick: h, showAccountFilter: k = !0, slotComponent: t, sx: z = {}, title: H = "" }) => {
|
|
22
|
+
const [L, { height: T, width: g }] = S(), [D, { height: u, width: x }] = S(), { onEvent: N } = $(), { sendHostMessage: C } = re(), { actionsFlex: P, containerSquareCorners: j, headerHeadingLevel: G, headerPaddingBottom: F, headerPaddingTop: V, headerPaddingX: q, iconSize: a, isCompact: r, isDesktop: s, isViewportAbove900: K, slotSx: Y } = oe(g), { isCopyLoaded: M } = te(), { common: U } = ee(), { config: { display_widget_headings: X } } = Z(), J = () => {
|
|
23
|
+
n && (n(), N(ie.WIDGET_BACK_CLICK));
|
|
24
24
|
};
|
|
25
25
|
if (d.useEffect(() => {
|
|
26
26
|
C("widget_size_changed", {
|
|
@@ -32,9 +32,9 @@ var De = me(({ actions: y, allowedAccountTypes: I, calendarActions: h, children:
|
|
|
32
32
|
x,
|
|
33
33
|
C
|
|
34
34
|
]), !M) return /* @__PURE__ */ e(se, {});
|
|
35
|
-
const O = () =>
|
|
35
|
+
const O = () => h && r && !K ? /* @__PURE__ */ e(f, {
|
|
36
36
|
color: "primary",
|
|
37
|
-
onClick:
|
|
37
|
+
onClick: h,
|
|
38
38
|
sx: { p: 10 },
|
|
39
39
|
children: /* @__PURE__ */ e(l, {
|
|
40
40
|
name: "menu_open",
|
|
@@ -47,29 +47,29 @@ var De = me(({ actions: y, allowedAccountTypes: I, calendarActions: h, children:
|
|
|
47
47
|
onClick: J,
|
|
48
48
|
sx: { p: 10 },
|
|
49
49
|
children: /* @__PURE__ */ e(fe, { size: 24 })
|
|
50
|
-
}) : null, b =
|
|
50
|
+
}) : null, b = p && /* @__PURE__ */ e(i, {
|
|
51
51
|
alignItems: "center",
|
|
52
52
|
sx: Y,
|
|
53
53
|
children: /* @__PURE__ */ e(ae, {
|
|
54
|
-
calendarActions:
|
|
54
|
+
calendarActions: p,
|
|
55
55
|
dateRange: W,
|
|
56
|
-
dateRangeVariant:
|
|
56
|
+
dateRangeVariant: A
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
return /* @__PURE__ */ e(ce, {
|
|
60
60
|
className: E,
|
|
61
61
|
elevation: 1,
|
|
62
|
-
ref:
|
|
63
|
-
square:
|
|
62
|
+
ref: L,
|
|
63
|
+
square: j,
|
|
64
64
|
sx: {
|
|
65
65
|
borderBottomLeftRadius: 0,
|
|
66
66
|
borderBottomRightRadius: 0,
|
|
67
67
|
margin: 0,
|
|
68
68
|
overflowY: "auto",
|
|
69
69
|
height: "100%",
|
|
70
|
-
...
|
|
70
|
+
...z
|
|
71
71
|
},
|
|
72
|
-
children: /* @__PURE__ */ c(
|
|
72
|
+
children: /* @__PURE__ */ c(pe, { children: [
|
|
73
73
|
/* @__PURE__ */ c(i, {
|
|
74
74
|
alignItems: "center",
|
|
75
75
|
alignSelf: "stretch",
|
|
@@ -89,7 +89,7 @@ var De = me(({ actions: y, allowedAccountTypes: I, calendarActions: h, children:
|
|
|
89
89
|
children: X && /* @__PURE__ */ e(de, {
|
|
90
90
|
sx: { width: "100%" },
|
|
91
91
|
truncate: !0,
|
|
92
|
-
variant:
|
|
92
|
+
variant: G,
|
|
93
93
|
children: H
|
|
94
94
|
})
|
|
95
95
|
}),
|
|
@@ -99,27 +99,27 @@ var De = me(({ actions: y, allowedAccountTypes: I, calendarActions: h, children:
|
|
|
99
99
|
direction: "row",
|
|
100
100
|
justifyContent: "flex-end",
|
|
101
101
|
sx: {
|
|
102
|
-
flex:
|
|
102
|
+
flex: P,
|
|
103
103
|
flexShrink: 0
|
|
104
104
|
},
|
|
105
|
-
children: [
|
|
106
|
-
allowedAccountTypes:
|
|
105
|
+
children: [k && /* @__PURE__ */ e(ne, {
|
|
106
|
+
allowedAccountTypes: y,
|
|
107
107
|
isDesktop: s,
|
|
108
|
-
onAccountFilterClick:
|
|
109
|
-
}),
|
|
108
|
+
onAccountFilterClick: R
|
|
109
|
+
}), I?.map((m) => {
|
|
110
110
|
if (d.isValidElement(m)) return d.cloneElement(m, { isDesktop: s });
|
|
111
|
-
const { iconName: o, onClick:
|
|
111
|
+
const { iconName: o, onClick: w, label: v } = m;
|
|
112
112
|
return s ? /* @__PURE__ */ e(le, {
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: w,
|
|
114
114
|
startIcon: /* @__PURE__ */ e(l, {
|
|
115
115
|
name: o,
|
|
116
116
|
size: a
|
|
117
117
|
}),
|
|
118
|
-
children:
|
|
118
|
+
children: v
|
|
119
119
|
}, o) : /* @__PURE__ */ e(f, {
|
|
120
|
-
"aria-label":
|
|
120
|
+
"aria-label": v,
|
|
121
121
|
color: "primary",
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: w,
|
|
123
123
|
children: /* @__PURE__ */ e(l, {
|
|
124
124
|
name: o,
|
|
125
125
|
size: a
|
|
@@ -130,12 +130,12 @@ var De = me(({ actions: y, allowedAccountTypes: I, calendarActions: h, children:
|
|
|
130
130
|
]
|
|
131
131
|
}),
|
|
132
132
|
r && (t || b),
|
|
133
|
-
r &&
|
|
134
|
-
/* @__PURE__ */ e(
|
|
133
|
+
r && B && /* @__PURE__ */ e(ge, {}),
|
|
134
|
+
/* @__PURE__ */ e(he, {
|
|
135
135
|
ref: D,
|
|
136
136
|
sx: { p: 0 },
|
|
137
137
|
children: /* @__PURE__ */ e(Q, {
|
|
138
|
-
availableHeight:
|
|
138
|
+
availableHeight: T,
|
|
139
139
|
availableWidth: g,
|
|
140
140
|
children: _
|
|
141
141
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetContainer.es.js","names":[],"sources":["../../../src/common/components/WidgetContainer.tsx"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport CardContent from '@mui/material/CardContent'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { ChevronLeft } from '@mxenabled/mx-icons'\nimport { Icon, Text } from '@mxenabled/mxui'\n\nimport { ANALYTICS_EVENTS, useEvent, useHostMessage } from '../../common'\nimport { AccountType } from '../../core'\nimport {\n useAppConfig,\n useGlobalCopyStore,\n useGlobalUiStore,\n WidgetContainerProvider,\n} from '../context'\nimport { useWidgetHeaderStyles } from '../hooks'\nimport { useDimensions } from '../hooks/useDimensions'\n\nimport { CalendarActions } from './daterangeselector/DateRangeSelector'\nimport { GlobalAccountFilter } from './GlobalAccountFilter'\nimport { WidgetDateRangeSelector } from './WidgetDateRangeSelector'\nimport Loader from './Loader'\n\ntype Action = {\n label: string\n iconName: string\n onClick: () => void\n}\n\ninterface WidgetContainerProps {\n allowedAccountTypes?: AccountType[] | undefined\n actions?: (Action | React.JSX.Element)[]\n calendarActions?: CalendarActions\n className?: string\n dateRange?: { start: Date; end: Date }\n dateRangeVariant?: 'outlined' | 'text' | 'readonly' | 'timeframebuttons' | 'timeframetabs'\n hasDivider?: boolean\n onBackClick?: () => void\n onMenuClick?: () => void\n onAccountsFilterClick?: () => void\n showAccountFilter?: boolean\n slotComponent?: React.ReactElement\n sx?: SxProps\n title?: string\n}\n\nexport const WidgetContainer: React.FC<PropsWithChildren<WidgetContainerProps>> = observer(\n ({\n actions,\n allowedAccountTypes,\n calendarActions,\n children,\n className = 'mx-cmn-widget',\n dateRange,\n dateRangeVariant,\n hasDivider = false,\n onAccountsFilterClick,\n onBackClick,\n onMenuClick,\n showAccountFilter = true,\n slotComponent,\n sx = {},\n title = '',\n }) => {\n const [containerRef, { height, width }] = useDimensions()\n const [contentRef, { height: contentHeight, width: contentWidth }] = useDimensions()\n const { onEvent } = useEvent()\n const { sendHostMessage } = useHostMessage()\n\n const {\n actionsFlex,\n containerSquareCorners,\n headerHeadingLevel,\n headerPaddingBottom,\n headerPaddingTop,\n headerPaddingX,\n iconSize,\n isCompact,\n isDesktop,\n isViewportAbove900,\n slotSx,\n } = useWidgetHeaderStyles(width)\n const { isCopyLoaded } = useGlobalUiStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const {\n config: { display_widget_headings: showTitle },\n } = useAppConfig()\n\n const handleBackClick = () => {\n if (onBackClick) {\n onBackClick()\n onEvent(ANALYTICS_EVENTS.WIDGET_BACK_CLICK)\n }\n }\n\n React.useEffect(() => {\n sendHostMessage('widget_size_changed', { height: contentHeight, width: contentWidth })\n }, [contentHeight, contentWidth, sendHostMessage])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const getNavButton = () => {\n if (onMenuClick && isCompact && !isViewportAbove900) {\n return (\n <IconButton color=\"primary\" onClick={onMenuClick} sx={{ p: 10 }}>\n <Icon name=\"menu_open\" size={iconSize} sx={{ transform: 'rotate(180deg)' }} />\n </IconButton>\n )\n }\n\n if (onBackClick) {\n return (\n <IconButton\n aria-label={commonCopy.back_to_dashboard}\n color=\"primary\"\n onClick={handleBackClick}\n sx={{ p: 10 }}\n >\n <ChevronLeft size={24} />\n </IconButton>\n )\n }\n\n return null\n }\n\n const defaultSlotComponent = calendarActions && (\n <Stack alignItems=\"center\" sx={slotSx}>\n <WidgetDateRangeSelector\n calendarActions={calendarActions}\n dateRange={dateRange}\n dateRangeVariant={dateRangeVariant}\n />\n </Stack>\n )\n\n return (\n <Paper\n className={className}\n elevation={1}\n ref={containerRef}\n square={containerSquareCorners}\n sx={{\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n margin: 0,\n overflowY: 'auto',\n height: '100%',\n ...sx,\n }}\n >\n <Card>\n <Stack\n alignItems=\"center\"\n alignSelf=\"stretch\"\n direction=\"row\"\n justifyContent=\"space-between\"\n sx={{\n pb: headerPaddingBottom,\n pt: headerPaddingTop,\n px: headerPaddingX,\n }}\n >\n {getNavButton()}\n <Stack alignItems=\"flex-start\" minWidth={0} sx={{ flex: 1 }}>\n {showTitle && (\n <Text sx={{ width: '100%' }} truncate={true} variant={headerHeadingLevel}>\n {title}\n </Text>\n )}\n </Stack>\n {!isCompact && (slotComponent ? slotComponent : defaultSlotComponent)}\n <Stack\n alignItems=\"center\"\n direction=\"row\"\n justifyContent=\"flex-end\"\n sx={{ flex: actionsFlex, flexShrink: 0 }}\n >\n {showAccountFilter && (\n <GlobalAccountFilter\n allowedAccountTypes={allowedAccountTypes}\n isDesktop={isDesktop}\n onAccountFilterClick={onAccountsFilterClick}\n />\n )}\n {actions?.map((action) => {\n if (React.isValidElement(action))\n return React.cloneElement(action, { isDesktop } as Partial<unknown>)\n const { iconName, onClick, label } = action as Action\n return isDesktop ? (\n <Button\n key={iconName}\n onClick={onClick}\n startIcon={<Icon name={iconName} size={iconSize} />}\n >\n {label}\n </Button>\n ) : (\n <IconButton aria-label={label} color=\"primary\" key={iconName} onClick={onClick}>\n <Icon name={iconName} size={iconSize} />\n </IconButton>\n )\n })}\n </Stack>\n </Stack>\n {isCompact && (slotComponent ? slotComponent : defaultSlotComponent)}\n {isCompact && hasDivider && <Divider />}\n <CardContent ref={contentRef} sx={{ p: 0 }}>\n <WidgetContainerProvider availableHeight={height} availableWidth={width}>\n {children}\n </WidgetContainerProvider>\n </CardContent>\n </Card>\n </Paper>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDA,IAAa,KAAqE,GAAA,CAC/E,EACC,SAAA,GACA,qBAAA,GACA,iBAAA,GACA,UAAA,GACA,WAAA,IAAY,iBACZ,WAAA,GACA,kBAAA,GACA,YAAA,IAAa,IACb,uBAAA,GACA,aAAA,GACA,aAAA,GACA,mBAAA,IAAoB,IACpB,eAAA,GACA,IAAA,IAAK,CAAC,GACN,OAAA,IAAQ,GAAA,MACJ;AACJ,QAAM,CAAC,GAAc,EAAE,QAAA,GAAQ,OAAA,EAAA,CAAA,IAAW,EAAc,GAClD,CAAC,GAAY,EAAE,QAAQ,GAAe,OAAO,EAAA,CAAA,IAAkB,EAAc,GAC7E,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,iBAAA,EAAA,IAAoB,GAAe,GAErC,EACJ,aAAA,GACA,wBAAA,GACA,oBAAA,GACA,qBAAA,GACA,kBAAA,GACA,gBAAA,GACA,UAAA,GACA,WAAA,GACA,WAAA,GACA,oBAAA,GACA,QAAA,EAAA,IACE,GAAsB,CAAK,GACzB,EAAE,cAAA,EAAA,IAAiB,GAAiB,GACpC,EAAE,QAAQ,EAAA,IAAe,GAAmB,GAC5C,EACJ,QAAQ,EAAE,yBAAyB,EAAA,EAAA,IACjC,EAAa,GAEX,IAAA,MAAwB;AAC5B,IAAI,MACF,EAAY,GACZ,EAAQ,GAAiB,iBAAiB;AAAA,EAE9C;AAMA,MAJA,EAAM,UAAA,MAAgB;AACpB,IAAA,EAAgB,uBAAuB;AAAA,MAAE,QAAQ;AAAA,MAAe,OAAO;AAAA,IAAa,CAAC;AAAA,EACvF,GAAG;AAAA,IAAC;AAAA,IAAe;AAAA,IAAc;AAAA,EAAe,CAAC,GAE7C,CAAC,EACH,QAAO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,KAAc,gBAAA,EAAC,IAAD,CAAU,CAAA;AAAA,MACtC,gBAAA,EAAC,IAAD;AAAA,QAAa,KAAK;AAAA,QAAY,IAAI,EAAE,GAAG,EAAE;AAAA,QACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAyB,iBAAiB;AAAA,UAAQ,gBAAgB;AAAA,UAC/D,UAAA;AAAA,QACsB,CAAA;AAAA,MACd,CAAA;AAAA,IACT,EAAA,CAAA;AAAA,EACD,CAAA;AAEX,CACF"}
|
|
1
|
+
{"version":3,"file":"WidgetContainer.es.js","names":[],"sources":["../../../src/common/components/WidgetContainer.tsx"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport CardContent from '@mui/material/CardContent'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Paper from '@mui/material/Paper'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { ArrowBackIosNew } from '@mxenabled/mx-icons'\nimport { Icon, Text } from '@mxenabled/mxui'\n\nimport { ANALYTICS_EVENTS, useEvent, useHostMessage } from '../../common'\nimport { AccountType } from '../../core'\nimport {\n useAppConfig,\n useGlobalCopyStore,\n useGlobalUiStore,\n WidgetContainerProvider,\n} from '../context'\nimport { useWidgetHeaderStyles } from '../hooks'\nimport { useDimensions } from '../hooks/useDimensions'\n\nimport { CalendarActions } from './daterangeselector/DateRangeSelector'\nimport { GlobalAccountFilter } from './GlobalAccountFilter'\nimport { WidgetDateRangeSelector } from './WidgetDateRangeSelector'\nimport Loader from './Loader'\n\ntype Action = {\n label: string\n iconName: string\n onClick: () => void\n}\n\ninterface WidgetContainerProps {\n allowedAccountTypes?: AccountType[] | undefined\n actions?: (Action | React.JSX.Element)[]\n calendarActions?: CalendarActions\n className?: string\n dateRange?: { start: Date; end: Date }\n dateRangeVariant?: 'outlined' | 'text' | 'readonly' | 'timeframebuttons' | 'timeframetabs'\n hasDivider?: boolean\n onBackClick?: () => void\n onMenuClick?: () => void\n onAccountsFilterClick?: () => void\n showAccountFilter?: boolean\n slotComponent?: React.ReactElement\n sx?: SxProps\n title?: string\n}\n\nexport const WidgetContainer: React.FC<PropsWithChildren<WidgetContainerProps>> = observer(\n ({\n actions,\n allowedAccountTypes,\n calendarActions,\n children,\n className = 'mx-cmn-widget',\n dateRange,\n dateRangeVariant,\n hasDivider = false,\n onAccountsFilterClick,\n onBackClick,\n onMenuClick,\n showAccountFilter = true,\n slotComponent,\n sx = {},\n title = '',\n }) => {\n const [containerRef, { height, width }] = useDimensions()\n const [contentRef, { height: contentHeight, width: contentWidth }] = useDimensions()\n const { onEvent } = useEvent()\n const { sendHostMessage } = useHostMessage()\n\n const {\n actionsFlex,\n containerSquareCorners,\n headerHeadingLevel,\n headerPaddingBottom,\n headerPaddingTop,\n headerPaddingX,\n iconSize,\n isCompact,\n isDesktop,\n isViewportAbove900,\n slotSx,\n } = useWidgetHeaderStyles(width)\n const { isCopyLoaded } = useGlobalUiStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const {\n config: { display_widget_headings: showTitle },\n } = useAppConfig()\n\n const handleBackClick = () => {\n if (onBackClick) {\n onBackClick()\n onEvent(ANALYTICS_EVENTS.WIDGET_BACK_CLICK)\n }\n }\n\n React.useEffect(() => {\n sendHostMessage('widget_size_changed', { height: contentHeight, width: contentWidth })\n }, [contentHeight, contentWidth, sendHostMessage])\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n const getNavButton = () => {\n if (onMenuClick && isCompact && !isViewportAbove900) {\n return (\n <IconButton color=\"primary\" onClick={onMenuClick} sx={{ p: 10 }}>\n <Icon name=\"menu_open\" size={iconSize} sx={{ transform: 'rotate(180deg)' }} />\n </IconButton>\n )\n }\n\n if (onBackClick) {\n return (\n <IconButton\n aria-label={commonCopy.back_to_dashboard}\n color=\"primary\"\n onClick={handleBackClick}\n sx={{ p: 10 }}\n >\n <ArrowBackIosNew size={24} />\n </IconButton>\n )\n }\n\n return null\n }\n\n const defaultSlotComponent = calendarActions && (\n <Stack alignItems=\"center\" sx={slotSx}>\n <WidgetDateRangeSelector\n calendarActions={calendarActions}\n dateRange={dateRange}\n dateRangeVariant={dateRangeVariant}\n />\n </Stack>\n )\n\n return (\n <Paper\n className={className}\n elevation={1}\n ref={containerRef}\n square={containerSquareCorners}\n sx={{\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n margin: 0,\n overflowY: 'auto',\n height: '100%',\n ...sx,\n }}\n >\n <Card>\n <Stack\n alignItems=\"center\"\n alignSelf=\"stretch\"\n direction=\"row\"\n justifyContent=\"space-between\"\n sx={{\n pb: headerPaddingBottom,\n pt: headerPaddingTop,\n px: headerPaddingX,\n }}\n >\n {getNavButton()}\n <Stack alignItems=\"flex-start\" minWidth={0} sx={{ flex: 1 }}>\n {showTitle && (\n <Text sx={{ width: '100%' }} truncate={true} variant={headerHeadingLevel}>\n {title}\n </Text>\n )}\n </Stack>\n {!isCompact && (slotComponent ? slotComponent : defaultSlotComponent)}\n <Stack\n alignItems=\"center\"\n direction=\"row\"\n justifyContent=\"flex-end\"\n sx={{ flex: actionsFlex, flexShrink: 0 }}\n >\n {showAccountFilter && (\n <GlobalAccountFilter\n allowedAccountTypes={allowedAccountTypes}\n isDesktop={isDesktop}\n onAccountFilterClick={onAccountsFilterClick}\n />\n )}\n {actions?.map((action) => {\n if (React.isValidElement(action))\n return React.cloneElement(action, { isDesktop } as Partial<unknown>)\n const { iconName, onClick, label } = action as Action\n return isDesktop ? (\n <Button\n key={iconName}\n onClick={onClick}\n startIcon={<Icon name={iconName} size={iconSize} />}\n >\n {label}\n </Button>\n ) : (\n <IconButton aria-label={label} color=\"primary\" key={iconName} onClick={onClick}>\n <Icon name={iconName} size={iconSize} />\n </IconButton>\n )\n })}\n </Stack>\n </Stack>\n {isCompact && (slotComponent ? slotComponent : defaultSlotComponent)}\n {isCompact && hasDivider && <Divider />}\n <CardContent ref={contentRef} sx={{ p: 0 }}>\n <WidgetContainerProvider availableHeight={height} availableWidth={width}>\n {children}\n </WidgetContainerProvider>\n </CardContent>\n </Card>\n </Paper>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDA,IAAa,KAAqE,GAAA,CAC/E,EACC,SAAA,GACA,qBAAA,GACA,iBAAA,GACA,UAAA,GACA,WAAA,IAAY,iBACZ,WAAA,GACA,kBAAA,GACA,YAAA,IAAa,IACb,uBAAA,GACA,aAAA,GACA,aAAA,GACA,mBAAA,IAAoB,IACpB,eAAA,GACA,IAAA,IAAK,CAAC,GACN,OAAA,IAAQ,GAAA,MACJ;AACJ,QAAM,CAAC,GAAc,EAAE,QAAA,GAAQ,OAAA,EAAA,CAAA,IAAW,EAAc,GAClD,CAAC,GAAY,EAAE,QAAQ,GAAe,OAAO,EAAA,CAAA,IAAkB,EAAc,GAC7E,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,iBAAA,EAAA,IAAoB,GAAe,GAErC,EACJ,aAAA,GACA,wBAAA,GACA,oBAAA,GACA,qBAAA,GACA,kBAAA,GACA,gBAAA,GACA,UAAA,GACA,WAAA,GACA,WAAA,GACA,oBAAA,GACA,QAAA,EAAA,IACE,GAAsB,CAAK,GACzB,EAAE,cAAA,EAAA,IAAiB,GAAiB,GACpC,EAAE,QAAQ,EAAA,IAAe,GAAmB,GAC5C,EACJ,QAAQ,EAAE,yBAAyB,EAAA,EAAA,IACjC,EAAa,GAEX,IAAA,MAAwB;AAC5B,IAAI,MACF,EAAY,GACZ,EAAQ,GAAiB,iBAAiB;AAAA,EAE9C;AAMA,MAJA,EAAM,UAAA,MAAgB;AACpB,IAAA,EAAgB,uBAAuB;AAAA,MAAE,QAAQ;AAAA,MAAe,OAAO;AAAA,IAAa,CAAC;AAAA,EACvF,GAAG;AAAA,IAAC;AAAA,IAAe;AAAA,IAAc;AAAA,EAAe,CAAC,GAE7C,CAAC,EACH,QAAO,gBAAA,EAA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AAA,EAAC,IAAD,CAAU,CAAA;AAAA,MACtC,gBAAA,EAAC,IAAD;AAAA,QAAa,KAAK;AAAA,QAAY,IAAI,EAAE,GAAG,EAAE;AAAA,QACvC,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAyB,iBAAiB;AAAA,UAAQ,gBAAgB;AAAA,UAC/D,UAAA;AAAA,QACsB,CAAA;AAAA,MACd,CAAA;AAAA,IACT,EAAA,CAAA;AAAA,EACD,CAAA;AAEX,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import s from "@mui/material/Stack";
|
|
3
3
|
import { H2 as x } from "@mxenabled/mxui";
|
|
4
|
-
import {
|
|
4
|
+
import { ArrowBackIosNew as m, Close as b } from "@mxenabled/mx-icons";
|
|
5
5
|
import { jsx as r, jsxs as f } from "react/jsx-runtime";
|
|
6
6
|
import i from "@mui/material/Box";
|
|
7
7
|
import u from "@mui/material/IconButton";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.es.js","names":[],"sources":["../../../../src/common/components/drawer/Header.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport IconButton from '@mui/material/IconButton'\n\nimport {
|
|
1
|
+
{"version":3,"file":"Header.es.js","names":[],"sources":["../../../../src/common/components/drawer/Header.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport IconButton from '@mui/material/IconButton'\n\nimport { ArrowBackIosNew, Close } from '@mxenabled/mx-icons'\n\nimport { H2 } from '@mxenabled/mxui'\n\n/** `back` (default): an arrow on the left. `close`: an X on the right, as Figma's Budget Details. */\nexport type DrawerHeaderAction = 'back' | 'close'\n\ninterface DrawerHeaderProps {\n action?: DrawerHeaderAction\n ariaLabelClose: string\n onClose: () => void\n shouldShowBorders: boolean\n shouldShowShadow?: boolean\n title: string\n}\n\nconst DrawerHeader: React.FC<DrawerHeaderProps> = ({\n action = 'back',\n ariaLabelClose,\n onClose,\n shouldShowBorders,\n shouldShowShadow,\n title,\n}) => {\n const isBack = action === 'back'\n const button = (\n <IconButton\n aria-label={ariaLabelClose}\n autoFocus={true}\n color={isBack ? 'primary' : 'default'}\n onClick={onClose}\n >\n {isBack ? (\n <ArrowBackIosNew color=\"primary\" sx={{ fontSize: 22 }} />\n ) : (\n <Close sx={{ color: 'action.active', fontSize: 22 }} />\n )}\n </IconButton>\n )\n // Keeps the title centred opposite the button.\n const spacer = <Box width=\"44px\" />\n\n return (\n <Stack\n aria-labelledby={`${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`}\n direction=\"row\"\n sx={{\n alignItems: 'center',\n backgroundColor: 'background.paper',\n ...(shouldShowBorders && {\n borderBottom: 1,\n borderColor: 'divider',\n }),\n ...(shouldShowShadow && {\n boxShadow: '0px 2px 8px 0px #6A73811F',\n }),\n padding: '8px 8px 8px 8px',\n }}\n >\n {isBack ? button : spacer}\n <Box\n sx={{\n flexGrow: 1,\n margin: 'auto',\n textAlign: 'center',\n }}\n >\n <H2\n bold={true}\n id={`${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`}\n variant=\"body1\"\n >\n {title}\n </H2>\n </Box>\n {isBack ? spacer : button}\n </Stack>\n )\n}\n\nexport default DrawerHeader\n"],"mappings":";;;;;;;AAsBA,IAAM,IAAA,CAA6C,EACjD,QAAA,IAAS,QACT,gBAAA,GACA,SAAA,GACA,mBAAA,GACA,kBAAA,GACA,OAAA,EAAA,MACI;AACJ,QAAM,IAAS,MAAW,QACpB,IACJ,gBAAA,EAAC,GAAD;AAAA,IACE,cAAY;AAAA,IACZ,WAAW;AAAA,IACX,OAAO,IAAS,YAAY;AAAA,IAC5B,SAAS;AAAA,IAER,UAAA,IACC,gBAAA,EAAC,GAAD;AAAA,MAAiB,OAAM;AAAA,MAAU,IAAI,EAAE,UAAU,GAAG;AAAA,IAAI,CAAA,IAExD,gBAAA,EAAC,GAAD,EAAO,IAAI;AAAA,MAAE,OAAO;AAAA,MAAiB,UAAU;AAAA,IAAG,EAAI,CAAA;AAAA,EAE9C,CAAA,GAGR,IAAS,gBAAA,EAAC,GAAD,EAAK,OAAM,OAAQ,CAAA;AAElC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,mBAAiB,GAAG,GAAO,QAAQ,QAAQ,GAAG,EAAE,YAAY,CAAA;AAAA,IAC5D,WAAU;AAAA,IACV,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,GAAI,KAAqB;AAAA,QACvB,cAAc;AAAA,QACd,aAAa;AAAA,MACf;AAAA,MACA,GAAI,KAAoB,EACtB,WAAW,4BACb;AAAA,MACA,SAAS;AAAA,IACX;AAAA,IAdF,UAAA;AAAA,MAgBG,IAAS,IAAS;AAAA,MACnB,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,WAAW;AAAA,QACb;AAAA,QAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,UACE,MAAM;AAAA,UACN,IAAI,GAAG,GAAO,QAAQ,QAAQ,GAAG,EAAE,YAAY,CAAA;AAAA,UAC/C,SAAQ;AAAA,UAEP,UAAA;AAAA,QACC,CAAA;AAAA,MACD,CAAA;AAAA,MACJ,IAAS,IAAS;AAAA,IACd;AAAA;AAEX"}
|
|
@@ -132,6 +132,13 @@ export interface TransactionHistoryBlock {
|
|
|
132
132
|
* 5.7.29), the drawer shows no tip.
|
|
133
133
|
*/
|
|
134
134
|
upcoming_bill_tip_message?: string;
|
|
135
|
+
/**
|
|
136
|
+
* The Debt vs. Income drawer's tip: `_1{tip}` the bold tip title and `_2{limit}` the bold limit
|
|
137
|
+
* (`monthly_debt_to_income_tip_limit`, "less than 30%"). Optional: without both, the drawer shows no
|
|
138
|
+
* tip.
|
|
139
|
+
*/
|
|
140
|
+
monthly_debt_to_income_tip_message?: string;
|
|
141
|
+
monthly_debt_to_income_tip_limit?: string;
|
|
135
142
|
}
|
|
136
143
|
export interface TransactionListBlockCopy {
|
|
137
144
|
deposit_history_drawer_title?: string;
|
|
@@ -25,8 +25,9 @@ interface TransactionDrillDownProps {
|
|
|
25
25
|
transaction: Transaction;
|
|
26
26
|
};
|
|
27
27
|
hideListHeader?: boolean;
|
|
28
|
+
tipAboveSubTabs?: boolean;
|
|
28
29
|
}
|
|
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) & {
|
|
30
|
+
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, projectedRow, hideListHeader, tipAboveSubTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
30
31
|
displayName: string;
|
|
31
32
|
};
|
|
32
33
|
export default TransactionDrillDown;
|
|
@@ -1,133 +1,137 @@
|
|
|
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 j, useGlobalUiStore as z, useTransactionStore as O } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { exportTransactionsToCSV as V } from "../../../core/utils/TransactionUtils.es.js";
|
|
3
|
+
import q from "../../../common/components/Loader.es.js";
|
|
4
|
+
import J from "../../../transactions/components/shared/transactionlist/TransactionRow.es.js";
|
|
5
|
+
import K from "../../../common/components/SubheaderRow.es.js";
|
|
6
|
+
import M from "../../../transactions/components/shared/TransactionList.es.js";
|
|
7
|
+
import { TipSection as D } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
|
|
8
|
+
import { SubTabs as Q, subTabPanelProps as X } 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 Y } from "mobx-react-lite";
|
|
11
|
+
import h from "@mui/material/Stack";
|
|
12
|
+
import { H3 as Z, Text as x } from "@mxenabled/mxui";
|
|
13
|
+
import F from "@mui/material/Button";
|
|
14
|
+
import { Icon as H } 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 rr from "@mui/material/Tab";
|
|
18
|
+
import or from "@mui/material/Tabs";
|
|
19
|
+
var I = {
|
|
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", w = (u) => `transaction-details-tab-${u}`, B = "transaction-drill-down-series", gr = Y(function({ ariaLabel: k, heading: l, subHeadingText: s, icon: P, tabs: v, selectedIndex: c, top: T, onSelectionChange: W, transactionFilter: _, tipSection: a, onEachRowClick: L, baseTransactions: $, subTabs: g, projectedRow: d, hideListHeader: m = !1, tipAboveSubTabs: y = !1 }) {
|
|
24
|
+
const { transactions: p } = j(), { isCopyLoaded: R } = z(), { sortedTransactionsWithSplits: A, tags: E, detailedTransactions: G } = O();
|
|
25
|
+
if (!R) return /* @__PURE__ */ r(q, {});
|
|
26
|
+
const f = !!v?.length, n = g?.tabs.length ? g : void 0, N = k ?? p.transactions_title, U = (i, e) => {
|
|
27
|
+
W?.(e);
|
|
28
|
+
}, C = _ ? ($ ?? G).filter(_(c)) : void 0, b = C ?? A;
|
|
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: [f && /* @__PURE__ */ r(or, {
|
|
35
|
+
"aria-label": N,
|
|
36
|
+
onChange: U,
|
|
37
37
|
sx: { mb: 0 },
|
|
38
|
-
value:
|
|
38
|
+
value: c,
|
|
39
39
|
variant: "fullWidth",
|
|
40
|
-
children:
|
|
40
|
+
children: v.map((i, e) => /* @__PURE__ */ r(rr, {
|
|
41
41
|
"aria-controls": S,
|
|
42
|
-
"aria-label":
|
|
43
|
-
id:
|
|
44
|
-
label:
|
|
42
|
+
"aria-label": i.ariaLabel,
|
|
43
|
+
id: w(e),
|
|
44
|
+
label: i.label,
|
|
45
45
|
sx: {
|
|
46
46
|
minWidth: "auto",
|
|
47
47
|
px: 0
|
|
48
48
|
}
|
|
49
|
-
}, `${
|
|
49
|
+
}, `${i.label}-${e}`))
|
|
50
50
|
}), /* @__PURE__ */ o(t, {
|
|
51
|
-
"aria-labelledby":
|
|
51
|
+
"aria-labelledby": f ? w(c) : void 0,
|
|
52
52
|
id: S,
|
|
53
|
-
role:
|
|
53
|
+
role: f ? "tabpanel" : void 0,
|
|
54
54
|
children: [
|
|
55
|
-
(
|
|
55
|
+
(l || s) && /* @__PURE__ */ o(h, {
|
|
56
56
|
sx: {
|
|
57
57
|
gap: 4,
|
|
58
58
|
pt: 16,
|
|
59
59
|
px: 24
|
|
60
60
|
},
|
|
61
|
-
children: [
|
|
61
|
+
children: [l && /* @__PURE__ */ r(Z, { children: l }), s && /* @__PURE__ */ o(h, {
|
|
62
62
|
sx: {
|
|
63
63
|
alignItems: "center",
|
|
64
64
|
flexDirection: "row",
|
|
65
65
|
gap: 8
|
|
66
66
|
},
|
|
67
|
-
children: [
|
|
67
|
+
children: [P, /* @__PURE__ */ r(x, {
|
|
68
68
|
color: "text.secondary",
|
|
69
69
|
sx: { letterSpacing: "0.52px" },
|
|
70
70
|
textTransform: "uppercase",
|
|
71
71
|
variant: "body2",
|
|
72
|
-
children:
|
|
72
|
+
children: s
|
|
73
73
|
})]
|
|
74
74
|
})]
|
|
75
75
|
}),
|
|
76
76
|
/* @__PURE__ */ r(t, {
|
|
77
77
|
sx: {
|
|
78
|
-
pb:
|
|
78
|
+
pb: T ? 16 : 0,
|
|
79
79
|
pt: 16
|
|
80
80
|
},
|
|
81
|
-
children:
|
|
81
|
+
children: T
|
|
82
82
|
}),
|
|
83
|
-
a && /* @__PURE__ */ r(
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
y && a && /* @__PURE__ */ r(D, {
|
|
84
|
+
icon: I,
|
|
85
|
+
...a
|
|
86
|
+
}),
|
|
87
|
+
n && /* @__PURE__ */ r(Q, {
|
|
88
|
+
...n,
|
|
89
|
+
id: B
|
|
86
90
|
}),
|
|
87
91
|
/* @__PURE__ */ o(t, {
|
|
88
|
-
...
|
|
92
|
+
...n && X(B, n.selectedIndex),
|
|
89
93
|
children: [
|
|
90
|
-
|
|
91
|
-
icon:
|
|
92
|
-
...
|
|
94
|
+
!y && a && /* @__PURE__ */ r(D, {
|
|
95
|
+
icon: I,
|
|
96
|
+
...a
|
|
93
97
|
}),
|
|
94
|
-
(!
|
|
98
|
+
(!m || b.length > 0) && /* @__PURE__ */ o(h, {
|
|
95
99
|
sx: {
|
|
96
100
|
alignItems: "center",
|
|
97
101
|
borderBottomColor: "divider",
|
|
98
102
|
borderBottomStyle: "solid",
|
|
99
103
|
borderBottomWidth: 1,
|
|
100
104
|
flexDirection: "row",
|
|
101
|
-
justifyContent:
|
|
105
|
+
justifyContent: m ? "flex-end" : "space-between",
|
|
102
106
|
pb: 4,
|
|
103
107
|
pt: 16,
|
|
104
108
|
px: 24
|
|
105
109
|
},
|
|
106
|
-
children: [!
|
|
110
|
+
children: [!m && /* @__PURE__ */ r(x, {
|
|
107
111
|
bold: !0,
|
|
108
112
|
variant: "body1",
|
|
109
|
-
children:
|
|
110
|
-
}), b.length > 0 && /* @__PURE__ */ r(
|
|
113
|
+
children: p.transactions_title
|
|
114
|
+
}), b.length > 0 && /* @__PURE__ */ r(F, {
|
|
111
115
|
onClick: () => {
|
|
112
|
-
|
|
116
|
+
V(b, E);
|
|
113
117
|
},
|
|
114
|
-
startIcon: /* @__PURE__ */ r(
|
|
118
|
+
startIcon: /* @__PURE__ */ r(H, { name: "ios_share" }),
|
|
115
119
|
sx: { height: 28 },
|
|
116
|
-
children: /* @__PURE__ */ r(
|
|
120
|
+
children: /* @__PURE__ */ r(x, {
|
|
117
121
|
bold: !0,
|
|
118
122
|
variant: "body2",
|
|
119
|
-
children:
|
|
123
|
+
children: p.export_csv_btn
|
|
120
124
|
})
|
|
121
125
|
})]
|
|
122
126
|
}),
|
|
123
|
-
|
|
127
|
+
d ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ r(K, { children: d.heading }), /* @__PURE__ */ r(J, {
|
|
124
128
|
component: "div",
|
|
125
|
-
transaction:
|
|
129
|
+
transaction: d.transaction
|
|
126
130
|
})] }) : /* @__PURE__ */ r(t, {
|
|
127
131
|
sx: { bgcolor: "background.default" },
|
|
128
|
-
children: /* @__PURE__ */ r(
|
|
129
|
-
transaction:
|
|
130
|
-
onClick:
|
|
132
|
+
children: /* @__PURE__ */ r(M, {
|
|
133
|
+
transaction: C,
|
|
134
|
+
onClick: L
|
|
131
135
|
})
|
|
132
136
|
})
|
|
133
137
|
]
|
|
@@ -137,8 +141,8 @@ var rr = {
|
|
|
137
141
|
});
|
|
138
142
|
});
|
|
139
143
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
gr as TransactionDrillDown,
|
|
145
|
+
gr as default
|
|
142
146
|
};
|
|
143
147
|
|
|
144
148
|
//# 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}\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 {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 {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\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,KACxB,KAAoB,GAAsB,OAAO,EAAkB,CAAa,CAAC,IAClF,QAEE,IAAqB,KAAwB;AAEnD,SACE,gBAAA,EAAC,GAAD;AAAA,I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D,EAAA,UAAe,EAAa,QAAsB,CAAA,GAClD,gBAAA,EAAC,GAAD;AAAA,cAAgB,WAAU;AAAA,cAAM,aAAa,EAAa;AAAA,YAAc,CAAA,CACrE,EAAA,CAAA,IAIL,gBAAA,EAAC,GAAD;AAAA,cAAK,IAAI,EAAE,SAAS,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 // 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\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAkC;AAAA,EAAE,OAAO;AAAA,EAAW,MAAM;AAAA,EAAoB,MAAM;AAAG,GAEzF,IAAW,gCACX,IAAA,CAAS,MAAkB,2BAA2B,CAAA,IACtD,IAAc,iCA2BP,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,IACjB,iBAAA,IAAkB,GAAA,GACU;AAC5B,Q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