@mx-cartographer/experiences 9.7.158 → 9.7.160
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 +11 -0
- package/dist/common/components/ErrorBoundary.d.ts +1 -0
- package/dist/common/components/ErrorBoundary.es.js +1 -1
- package/dist/common/components/ErrorBoundary.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +39 -39
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +40 -35
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +73 -74
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +20 -21
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +36 -38
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +29 -30
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +60 -59
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +20 -20
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +36 -36
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +77 -76
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/useRequiredCopy.d.ts +3 -0
- package/dist/insights-v2/actionBlocks/useRequiredCopy.es.js +11 -0
- package/dist/insights-v2/actionBlocks/useRequiredCopy.es.js.map +1 -0
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +13 -12
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +6 -3
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +8 -3
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +33 -33
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.d.ts +2 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +8 -1
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +56 -42
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.d.ts +1 -0
- package/dist/insights-v2/mappings/blocks.es.js +190 -178
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
import { CategoryGuids as f } from "../../../core/constants/Category.es.js";
|
|
2
2
|
import { DEFAULT_INSTITUTION_LOGO_URL as h } from "../../../core/constants/InstitutionLogo.es.js";
|
|
3
3
|
import _ from "../../../common/utils/AccountDisplayName.es.js";
|
|
4
|
-
import { useAccountStore as y, useAppConfig as C, useCashflowStore as x
|
|
4
|
+
import { useAccountStore as y, useAppConfig as C, useCashflowStore as x } from "../../../common/context/hooks.es.js";
|
|
5
5
|
import { getAccountStartingBalance as R } from "../../../core/utils/AccountUtils.es.js";
|
|
6
6
|
import T from "../../../common/components/Loader.es.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import a from "../../components/CategoryTile.es.js";
|
|
8
|
+
import { useRequiredCopy as G } from "../useRequiredCopy.es.js";
|
|
9
9
|
import { ErrorCard as L } from "../../components/ErrorCard.es.js";
|
|
10
|
-
import { useRecurringExpensesLoadState as
|
|
11
|
-
import { foldOtherRows as r, getCaption as
|
|
12
|
-
import
|
|
13
|
-
import { observer as
|
|
14
|
-
import { InstitutionLogo as
|
|
10
|
+
import { useRecurringExpensesLoadState as E } from "../RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
11
|
+
import { foldOtherRows as r, getCaption as U } from "./layout.es.js";
|
|
12
|
+
import A from "./RemainingCashContent.es.js";
|
|
13
|
+
import { observer as I } from "mobx-react-lite";
|
|
14
|
+
import { InstitutionLogo as s } from "@mxenabled/mxui";
|
|
15
15
|
import { jsx as t } from "react/jsx-runtime";
|
|
16
|
-
var J =
|
|
17
|
-
const {
|
|
18
|
-
if (!e) return /* @__PURE__ */ t(E, {});
|
|
16
|
+
var O = (i) => i.insights_feed?.remaining_cash, J = I(function(w) {
|
|
17
|
+
const { config: m } = C(), { uiStore: n } = x(), { accountsLoaded: c } = y(), { failed: u, ready: p, retry: d } = E(), o = G(O);
|
|
19
18
|
if (u) return /* @__PURE__ */ t(L, { onRetry: d });
|
|
20
19
|
if (!p || !c) return /* @__PURE__ */ t(T, {});
|
|
21
|
-
const g = r(n.selectedCashAccounts.map((
|
|
22
|
-
amount: R(
|
|
23
|
-
key:
|
|
24
|
-
leading: /* @__PURE__ */ t(
|
|
20
|
+
const g = r(n.selectedCashAccounts.map((e) => ({
|
|
21
|
+
amount: R(e, m.display_available_balance_in_accounts),
|
|
22
|
+
key: e.guid,
|
|
23
|
+
leading: /* @__PURE__ */ t(s, {
|
|
25
24
|
alt: "",
|
|
26
|
-
institutionGuid:
|
|
25
|
+
institutionGuid: e.institution_guid ?? "",
|
|
27
26
|
size: 32
|
|
28
27
|
}),
|
|
29
|
-
name: _(
|
|
28
|
+
name: _(e)
|
|
30
29
|
})), {
|
|
31
|
-
multi:
|
|
32
|
-
one:
|
|
33
|
-
}, /* @__PURE__ */ t(
|
|
30
|
+
multi: o.other_accounts,
|
|
31
|
+
one: o.other_accounts_one
|
|
32
|
+
}, /* @__PURE__ */ t(s, {
|
|
34
33
|
alt: "",
|
|
35
34
|
institutionGuid: "",
|
|
36
35
|
logoUrl: h,
|
|
37
36
|
size: 32
|
|
38
|
-
})), l = r(n.expensesTilNextIncome.map((
|
|
39
|
-
amount:
|
|
40
|
-
key: `${
|
|
41
|
-
leading: /* @__PURE__ */ t(
|
|
42
|
-
categoryGuid:
|
|
37
|
+
})), l = r(n.expensesTilNextIncome.map((e) => ({
|
|
38
|
+
amount: e.amount,
|
|
39
|
+
key: `${e.repeatingTransactionGuid}-${e.expectedDate.getTime()}`,
|
|
40
|
+
leading: /* @__PURE__ */ t(a, {
|
|
41
|
+
categoryGuid: e.categoryGuid,
|
|
43
42
|
size: 32
|
|
44
43
|
}),
|
|
45
|
-
name:
|
|
44
|
+
name: e.name
|
|
46
45
|
})), {
|
|
47
|
-
multi:
|
|
48
|
-
one:
|
|
49
|
-
}, /* @__PURE__ */ t(
|
|
46
|
+
multi: o.other_expenses,
|
|
47
|
+
one: o.other_expenses_one
|
|
48
|
+
}, /* @__PURE__ */ t(a, {
|
|
50
49
|
categoryGuid: f.UNCATEGORIZED,
|
|
51
50
|
size: 32
|
|
52
51
|
}));
|
|
53
|
-
return /* @__PURE__ */ t(
|
|
52
|
+
return /* @__PURE__ */ t(A, {
|
|
54
53
|
accounts: {
|
|
55
|
-
header:
|
|
54
|
+
header: o.accounts_header,
|
|
56
55
|
rows: g
|
|
57
56
|
},
|
|
58
57
|
expenses: {
|
|
59
|
-
header:
|
|
58
|
+
header: o.recurring_expenses_header,
|
|
60
59
|
rows: l
|
|
61
60
|
},
|
|
62
61
|
summary: {
|
|
63
62
|
remaining: n.hasUpcomingPayday ? {
|
|
64
63
|
amount: n.remainingUntilPayday,
|
|
65
|
-
caption:
|
|
64
|
+
caption: U(o, n.daysUntilNextIncome)
|
|
66
65
|
} : void 0,
|
|
67
66
|
cashOnHand: n.selectedCashBalance,
|
|
68
|
-
cashOnHandLabel:
|
|
67
|
+
cashOnHandLabel: o.cash_on_hand,
|
|
69
68
|
upcomingExpenses: n.upcomingExpensesTotal,
|
|
70
|
-
upcomingExpensesLabel:
|
|
69
|
+
upcomingExpensesLabel: o.upcoming_expenses
|
|
71
70
|
}
|
|
72
71
|
});
|
|
73
72
|
});
|
|
74
73
|
export {
|
|
75
|
-
J as RemainingCashBlock
|
|
74
|
+
J as RemainingCashBlock,
|
|
75
|
+
O as selectRemainingCashCopy
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
//# sourceMappingURL=RemainingCashBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemainingCashBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.tsx"],"sourcesContent":["import { InstitutionLogo } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {
|
|
1
|
+
{"version":3,"file":"RemainingCashBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.tsx"],"sourcesContent":["import { InstitutionLogo } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Loader, useAccountStore, useAppConfig, useCashflowStore } from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport { CategoryGuids } from '../../../core/constants/Category'\nimport { DEFAULT_INSTITUTION_LOGO_URL } from '../../../core/constants/InstitutionLogo'\nimport { getAccountStartingBalance } from '../../../core/utils/AccountUtils'\nimport type { GlobalCopy } from '../../../core'\nimport CategoryTile from '../../components/CategoryTile'\nimport { ErrorCard } from '../../components/ErrorCard'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { useRecurringExpensesLoadState } from '../RecurringTransactionBlock'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\nimport { foldOtherRows, getCaption } from './layout'\nimport RemainingCashContent from './RemainingCashContent'\n\nexport const selectRemainingCashCopy = (copy: GlobalCopy) => copy.insights_feed?.remaining_cash\n\n/** Remaining Cash drawer: today's figures from CashflowStore, not the card's (see docs/action-blocks/remaining-cash-block.md). */\nexport const RemainingCashBlock = observer(function RemainingCashBlock(_props: ActionBlockProps) {\n const { config } = useAppConfig()\n const { uiStore } = useCashflowStore()\n const { accountsLoaded } = useAccountStore()\n const { failed, ready, retry } = useRecurringExpensesLoadState()\n const copy = useRequiredCopy(selectRemainingCashCopy)\n\n if (failed) return <ErrorCard onRetry={retry} />\n\n // `accountsLoaded` / `ready` cover another widget's request still in flight.\n if (!ready || !accountsLoaded) return <Loader />\n\n const accountRows = foldOtherRows(\n uiStore.selectedCashAccounts.map((account) => ({\n amount: getAccountStartingBalance(account, config.display_available_balance_in_accounts),\n key: account.guid,\n // Decorative: the row's visible name already says which account it is.\n leading: (\n <InstitutionLogo alt=\"\" institutionGuid={account.institution_guid ?? ''} size={32} />\n ),\n name: getAccountDisplayName(account),\n })),\n { multi: copy.other_accounts, one: copy.other_accounts_one },\n <InstitutionLogo alt=\"\" institutionGuid=\"\" logoUrl={DEFAULT_INSTITUTION_LOGO_URL} size={32} />,\n )\n const expenseRows = foldOtherRows(\n uiStore.expensesTilNextIncome.map((expense) => ({\n amount: expense.amount,\n key: `${expense.repeatingTransactionGuid}-${expense.expectedDate.getTime()}`,\n leading: <CategoryTile categoryGuid={expense.categoryGuid} size={32} />,\n name: expense.name,\n })),\n { multi: copy.other_expenses, one: copy.other_expenses_one },\n <CategoryTile categoryGuid={CategoryGuids.UNCATEGORIZED} size={32} />,\n )\n\n return (\n <RemainingCashContent\n accounts={{ header: copy.accounts_header, rows: accountRows }}\n expenses={{ header: copy.recurring_expenses_header, rows: expenseRows }}\n summary={{\n remaining: uiStore.hasUpcomingPayday\n ? {\n amount: uiStore.remainingUntilPayday,\n caption: getCaption(copy, uiStore.daysUntilNextIncome),\n }\n : undefined,\n cashOnHand: uiStore.selectedCashBalance,\n cashOnHandLabel: copy.cash_on_hand,\n upcomingExpenses: uiStore.upcomingExpensesTotal,\n upcomingExpensesLabel: copy.upcoming_expenses,\n }}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,IAAa,IAAA,CAA2B,MAAqB,EAAK,eAAe,gBAGpE,IAAqB,EAAS,SAA4B,GAA0B;AAC/F,QAAM,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,EAAE,SAAA,EAAA,IAAY,EAAiB,GAC/B,EAAE,gBAAA,EAAA,IAAmB,EAAgB,GACrC,EAAE,QAAA,GAAQ,OAAA,GAAO,OAAA,EAAA,IAAU,EAA8B,GACzD,IAAO,EAAgB,CAAuB;AAEpD,MAAI,EAAQ,QAAO,gBAAA,EAAC,GAAD,EAAW,SAAS,EAAQ,CAAA;AAG/C,MAAI,CAAC,KAAS,CAAC,EAAgB,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAE/C,QAAM,IAAc,EAClB,EAAQ,qBAAqB,IAAA,CAAK,OAAa;AAAA,IAC7C,QAAQ,EAA0B,GAAS,EAAO,qCAAqC;AAAA,IACvF,KAAK,EAAQ;AAAA,IAEb,SACE,gBAAA,EAAC,GAAD;AAAA,MAAiB,KAAI;AAAA,MAAG,iBAAiB,EAAQ,oBAAoB;AAAA,MAAI,MAAM;AAAA,IAAK,CAAA;AAAA,IAEtF,MAAM,EAAsB,CAAO;AAAA,EACrC,EAAE,GACF;AAAA,IAAE,OAAO,EAAK;AAAA,IAAgB,KAAK,EAAK;AAAA,EAAmB,GAC3D,gBAAA,EAAC,GAAD;AAAA,IAAiB,KAAI;AAAA,IAAG,iBAAgB;AAAA,IAAG,SAAS;AAAA,IAA8B,MAAM;AAAA,EAAK,CAAA,CAC/F,GACM,IAAc,EAClB,EAAQ,sBAAsB,IAAA,CAAK,OAAa;AAAA,IAC9C,QAAQ,EAAQ;AAAA,IAChB,KAAK,GAAG,EAAQ,wBAAA,IAA4B,EAAQ,aAAa,QAAQ,CAAA;AAAA,IACzE,SAAS,gBAAA,EAAC,GAAD;AAAA,MAAc,cAAc,EAAQ;AAAA,MAAc,MAAM;AAAA,IAAK,CAAA;AAAA,IACtE,MAAM,EAAQ;AAAA,EAChB,EAAE,GACF;AAAA,IAAE,OAAO,EAAK;AAAA,IAAgB,KAAK,EAAK;AAAA,EAAmB,GAC3D,gBAAA,EAAC,GAAD;AAAA,IAAc,cAAc,EAAc;AAAA,IAAe,MAAM;AAAA,EAAK,CAAA,CACtE;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,UAAU;AAAA,MAAE,QAAQ,EAAK;AAAA,MAAiB,MAAM;AAAA,IAAY;AAAA,IAC5D,UAAU;AAAA,MAAE,QAAQ,EAAK;AAAA,MAA2B,MAAM;AAAA,IAAY;AAAA,IACtE,SAAS;AAAA,MACP,WAAW,EAAQ,oBACf;AAAA,QACE,QAAQ,EAAQ;AAAA,QAChB,SAAS,EAAW,GAAM,EAAQ,mBAAmB;AAAA,MACvD,IACA;AAAA,MACJ,YAAY,EAAQ;AAAA,MACpB,iBAAiB,EAAK;AAAA,MACtB,kBAAkB,EAAQ;AAAA,MAC1B,uBAAuB,EAAK;AAAA,IAC9B;AAAA,EACD,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RemainingCashBlock } from './RemainingCashBlock';
|
|
1
|
+
export { RemainingCashBlock, selectRemainingCashCopy } from './RemainingCashBlock';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Beat } from '../../../core';
|
|
1
|
+
import { Beat, GlobalCopy } from '../../../core';
|
|
2
2
|
interface TransactionHistoryProp {
|
|
3
3
|
beat: Beat;
|
|
4
4
|
}
|
|
5
|
+
export declare const selectTransactionHistoryCopy: (copy: GlobalCopy) => import('../../../core').InsightsFeedCopy;
|
|
5
6
|
export declare const TransactionHistoryBlock: (({ beat }: TransactionHistoryProp) => import("react/jsx-runtime").JSX.Element) & {
|
|
6
7
|
displayName: string;
|
|
7
8
|
};
|
|
@@ -1,116 +1,116 @@
|
|
|
1
1
|
import { useGlobalCopyStore as yt, useInsightsV2Store as At } from "../../../common/context/hooks.es.js";
|
|
2
|
-
import { CURRENCY_FORMAT as Dt, formatCurrency as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { EmptyBarChart as Et } from "../../components/chartblocks/EmptyBarChart.es.js";
|
|
2
|
+
import { CURRENCY_FORMAT as Dt, formatCurrency as vt } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import Bt from "../../../common/components/drawer/Drawer.es.js";
|
|
4
|
+
import { BAR_ARIA_LABEL as St } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
5
|
+
import { BarChartV2 as Lt } from "../../components/chartblocks/BarchartV2.es.js";
|
|
6
|
+
import { EmptyBarChart as It } from "../../components/chartblocks/EmptyBarChart.es.js";
|
|
8
7
|
import { ANALYTICS_EVENTS_CONFIG as P } from "../../analytics/analyticsEventsConfig.es.js";
|
|
9
8
|
import { useAnalyticsEvent as Rt } from "../../analytics/useAnalyticsEvent.es.js";
|
|
10
|
-
import { DoubleBarChart as
|
|
11
|
-
import { toLegendItems as
|
|
12
|
-
import { getDefaultSelection as
|
|
13
|
-
import { useOpenedCta as
|
|
14
|
-
import { TransactionDrillDown as
|
|
15
|
-
import { useTransactionHistory as
|
|
16
|
-
import { TransactionDetailsBlock as
|
|
9
|
+
import { DoubleBarChart as Et } from "../../components/chartblocks/DoubleBarChart.es.js";
|
|
10
|
+
import { toLegendItems as xt } from "../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js";
|
|
11
|
+
import { getDefaultSelection as Ft, getDrillDownConfig as Ot, getFlattenedDataSeries as jt, resolveDrillDownSubHeader as Ht, splitProjectedTransaction as Gt, toStoreFilter as wt } from "./utils.es.js";
|
|
12
|
+
import { useOpenedCta as Nt } from "../useOpenedCta.es.js";
|
|
13
|
+
import { TransactionDrillDown as kt } from "./TransactionDrillDown.es.js";
|
|
14
|
+
import { useTransactionHistory as Mt } from "./useTransactionHistory.es.js";
|
|
15
|
+
import { TransactionDetailsBlock as Kt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
16
|
+
import { useRequiredCopy as Pt } from "../useRequiredCopy.es.js";
|
|
17
17
|
import { useLayoutEffect as Vt, useState as d } from "react";
|
|
18
18
|
import { observer as zt } from "mobx-react-lite";
|
|
19
|
-
import { Fragment as Yt, jsx as
|
|
20
|
-
import { useTheme as
|
|
21
|
-
var
|
|
22
|
-
const A =
|
|
23
|
-
slotData:
|
|
19
|
+
import { Fragment as Yt, jsx as l, jsxs as qt } from "react/jsx-runtime";
|
|
20
|
+
import { useTheme as Ut } from "@mui/material/styles";
|
|
21
|
+
var Wt = (a) => a.insights_feed, he = zt(({ beat: a }) => {
|
|
22
|
+
const A = Ut(), { actionDrawer: V, setActionContext: D } = At(), { insights_payload: v } = a, B = Nt(a), z = B?.variant, { top: e, filterMode: m, header: Y, colors: q, filterStrategy: U, tipSection: S, subTabAriaLabels: W, slotData: $, beatTransactions: J, averageFormat: Q, subTabs: X, boldLabel: Z } = Ot(z ?? ""), { instanceSlotData: o, beatTransactions: u, spendCategoryGuids: L, allAccountGuids: I, categoryName: tt, displayedDateRange: f, transactionStore: et } = Mt(a, {
|
|
23
|
+
slotData: $,
|
|
24
24
|
beatTransactions: J
|
|
25
|
-
},
|
|
25
|
+
}, B?.drilldown_data), { common: ot } = yt(), s = Pt(Wt), [at, R] = d(!1), [nt, st] = d(!1), E = Rt(), { dataSeries: p, chartData: g, comparisonBars: r } = jt({
|
|
26
26
|
data: o?.data_series,
|
|
27
|
-
ariaLabel: e === "doubleBar" ?
|
|
27
|
+
ariaLabel: e === "doubleBar" ? s?.general?.in_month_you_had_a_category_of_amount ?? "_1{month}, _2{category}: _3{amount}" : St,
|
|
28
28
|
top: e,
|
|
29
29
|
beatTransactions: u
|
|
30
|
-
}), c = e === "doubleBar",
|
|
31
|
-
chartTabCount:
|
|
32
|
-
comparisonTabCount:
|
|
30
|
+
}), c = e === "doubleBar", rt = e === "tabsOnly", i = c ? r : g, { chartBarIndex: x, subTabIndex: it } = Ft({
|
|
31
|
+
chartTabCount: g.length,
|
|
32
|
+
comparisonTabCount: r.length,
|
|
33
33
|
actionDrawer: V,
|
|
34
|
-
beatGuid:
|
|
35
|
-
}), [n, h] = d(x), [C, F] = d(it), [lt, ct] = d(
|
|
36
|
-
|
|
37
|
-
const T = (t) =>
|
|
38
|
-
beat:
|
|
34
|
+
beatGuid: a.guid
|
|
35
|
+
}), [n, h] = d(x), [C, F] = d(it), [lt, ct] = d(i.length);
|
|
36
|
+
i.length !== lt && (ct(i.length), h(x));
|
|
37
|
+
const T = (t) => U({
|
|
38
|
+
beat: a,
|
|
39
39
|
beatTransactions: u,
|
|
40
|
-
dataSeries:
|
|
41
|
-
comparisonBars:
|
|
40
|
+
dataSeries: p,
|
|
41
|
+
comparisonBars: r,
|
|
42
42
|
selectedIndex: t,
|
|
43
43
|
subIndex: C,
|
|
44
|
-
isLastTab: t ===
|
|
44
|
+
isLastTab: t === i.length - 1,
|
|
45
45
|
instanceSlotData: o,
|
|
46
46
|
spendCategoryGuids: L,
|
|
47
47
|
displayedDateRange: f
|
|
48
|
-
}), dt = u.map((t) => t.guid).join(","), mt = L.join(","), ut = I.join(","),
|
|
48
|
+
}), dt = u.map((t) => t.guid).join(","), mt = L.join(","), ut = I.join(","), pt = e === "list" || e === "tabsOnly" || e === "monthTabs" || p.length > 0, O = () => {
|
|
49
49
|
if (m !== "store") return;
|
|
50
|
-
const t =
|
|
50
|
+
const t = pt ? T(n) : {
|
|
51
51
|
accounts: [],
|
|
52
52
|
custom: () => !1
|
|
53
53
|
};
|
|
54
|
-
et.setFilter(
|
|
54
|
+
et.setFilter(wt(t, {
|
|
55
55
|
allAccountGuids: I,
|
|
56
56
|
displayedDateRange: f
|
|
57
57
|
}));
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
Vt(() => {
|
|
60
60
|
O();
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
a.guid,
|
|
63
63
|
n,
|
|
64
64
|
C,
|
|
65
65
|
m,
|
|
66
|
-
|
|
66
|
+
p.length,
|
|
67
67
|
o,
|
|
68
68
|
f,
|
|
69
69
|
mt,
|
|
70
70
|
ut,
|
|
71
71
|
dt,
|
|
72
72
|
e
|
|
73
|
-
])
|
|
74
|
-
const j = Ht(
|
|
75
|
-
title:
|
|
73
|
+
]);
|
|
74
|
+
const j = Ht(v), _ = Y?.({
|
|
75
|
+
title: v?.title,
|
|
76
76
|
subHeader: j,
|
|
77
77
|
categoryName: tt,
|
|
78
|
-
selectedDate:
|
|
78
|
+
selectedDate: g[n]?.date ?? void 0,
|
|
79
79
|
slotData: o
|
|
80
|
-
}),
|
|
81
|
-
heading:
|
|
80
|
+
}), H = q(A, o?.category_guid), [G, w] = o?.legends ?? [], gt = m === "local" ? (t) => T(t).custom ?? (() => !0) : void 0, { transactions: bt, projectedTransaction: y } = Gt(u), ft = m === "local" ? bt : void 0, N = s.general.projected_amount, ht = y && N && T(n).custom?.(y) ? {
|
|
81
|
+
heading: N,
|
|
82
82
|
transaction: y
|
|
83
|
-
} : void 0,
|
|
84
|
-
|
|
83
|
+
} : void 0, k = (t, b) => {
|
|
84
|
+
E(P.DRAWER_CHART_BAR_CLICKED), h(t), b !== void 0 && F(b);
|
|
85
85
|
}, Ct = (t) => {
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
...
|
|
89
|
-
value:
|
|
86
|
+
E(P.TAB_SELECTED), h(t);
|
|
87
|
+
}, M = c ? xt([{
|
|
88
|
+
...G,
|
|
89
|
+
value: r[n]?.main
|
|
90
90
|
}, {
|
|
91
91
|
...w,
|
|
92
|
-
value:
|
|
93
|
-
}]) : void 0, Tt =
|
|
92
|
+
value: r[n]?.comparison
|
|
93
|
+
}]) : void 0, Tt = W?.(s) ?? [], K = c ? (M ?? []).map((t, b) => ({
|
|
94
94
|
label: t.label,
|
|
95
95
|
ariaLabel: Tt[b]
|
|
96
|
-
})) :
|
|
96
|
+
})) : rt ? p.flatMap((t) => t.localized_label ? [{ label: t.localized_label }] : []) : X?.({
|
|
97
97
|
instanceSlotData: o,
|
|
98
|
-
copy:
|
|
99
|
-
}).map((t) => ({ label: t })) ?? [], _t = c || e === "singleBar" || e === "upcomingBill" ?
|
|
100
|
-
bars:
|
|
98
|
+
copy: s
|
|
99
|
+
}).map((t) => ({ label: t })) ?? [], _t = c || e === "singleBar" || e === "upcomingBill" ? i.length ? c ? /* @__PURE__ */ l(Et, {
|
|
100
|
+
bars: r,
|
|
101
101
|
boldLabel: Z,
|
|
102
|
-
colors:
|
|
102
|
+
colors: H,
|
|
103
103
|
legendPosition: "top",
|
|
104
|
-
legends:
|
|
105
|
-
onBarClick:
|
|
104
|
+
legends: M,
|
|
105
|
+
onBarClick: k,
|
|
106
106
|
selectedIndex: n
|
|
107
|
-
}) : /* @__PURE__ */
|
|
107
|
+
}) : /* @__PURE__ */ l(Lt, {
|
|
108
108
|
amounts: {
|
|
109
109
|
average: o?.average_amount,
|
|
110
|
-
formattedAverage:
|
|
110
|
+
formattedAverage: vt(o?.average_amount ?? 0, Q ?? Dt.cents)
|
|
111
111
|
},
|
|
112
|
-
color:
|
|
113
|
-
data:
|
|
112
|
+
color: H[0] ?? A.palette.primary.main,
|
|
113
|
+
data: g,
|
|
114
114
|
legendPosition: "top",
|
|
115
115
|
heightOverride: 172,
|
|
116
116
|
margin: {
|
|
@@ -119,12 +119,12 @@ var fe = zt(({ beat: r }) => {
|
|
|
119
119
|
left: 24,
|
|
120
120
|
right: 24
|
|
121
121
|
},
|
|
122
|
-
monthlyAmountLabel:
|
|
123
|
-
onBarClick:
|
|
122
|
+
monthlyAmountLabel: G?.label ?? s.general.monthly_amount,
|
|
123
|
+
onBarClick: k,
|
|
124
124
|
selectedTabIndex: n,
|
|
125
|
-
trendAmountLabel: w?.label ??
|
|
126
|
-
}) : /* @__PURE__ */
|
|
127
|
-
return /* @__PURE__ */
|
|
125
|
+
trendAmountLabel: w?.label ?? s.general.trend
|
|
126
|
+
}) : /* @__PURE__ */ l(It, {}) : null;
|
|
127
|
+
return /* @__PURE__ */ qt(Yt, { children: [/* @__PURE__ */ l(kt, {
|
|
128
128
|
baseTransactions: ft,
|
|
129
129
|
projectedRow: ht,
|
|
130
130
|
heading: _?.heading,
|
|
@@ -132,30 +132,31 @@ var fe = zt(({ beat: r }) => {
|
|
|
132
132
|
onSelectionChange: Ct,
|
|
133
133
|
selectedIndex: n,
|
|
134
134
|
subHeadingText: _?.subHeadingText,
|
|
135
|
-
tabs:
|
|
135
|
+
tabs: i,
|
|
136
136
|
top: _t,
|
|
137
137
|
...K.length > 0 && { subTabs: {
|
|
138
138
|
tabs: K,
|
|
139
139
|
selectedIndex: C,
|
|
140
140
|
onChange: F
|
|
141
141
|
} },
|
|
142
|
-
...S && { tipSection: !nt && (S(
|
|
143
|
-
transactionFilter:
|
|
142
|
+
...S && { tipSection: !nt && (S(st, s, j?.text, o) ?? !1) },
|
|
143
|
+
transactionFilter: gt,
|
|
144
144
|
onEachRowClick: (t) => {
|
|
145
|
-
D({ transaction_guid: t }),
|
|
145
|
+
D({ transaction_guid: t }), R(!0);
|
|
146
146
|
}
|
|
147
|
-
}), /* @__PURE__ */
|
|
147
|
+
}), /* @__PURE__ */ l(Bt, {
|
|
148
148
|
ariaLabelClose: ot.close_aria,
|
|
149
149
|
isOpen: at,
|
|
150
150
|
onClose: () => {
|
|
151
|
-
|
|
151
|
+
R(!1), D({ transaction_guid: void 0 }), O();
|
|
152
152
|
},
|
|
153
|
-
title:
|
|
154
|
-
children: /* @__PURE__ */
|
|
153
|
+
title: s.general.transaction_details_title,
|
|
154
|
+
children: /* @__PURE__ */ l(Kt, { beat: a })
|
|
155
155
|
})] });
|
|
156
156
|
});
|
|
157
157
|
export {
|
|
158
|
-
|
|
158
|
+
he as TransactionHistoryBlock,
|
|
159
|
+
Wt as selectTransactionHistoryCopy
|
|
159
160
|
};
|
|
160
161
|
|
|
161
162
|
//# sourceMappingURL=TransactionHistoryBlock.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n splitProjectedTransaction,\n toStoreFilter,\n} from './utils'\nimport { Drawer, useInsightsV2Store, useGlobalCopyStore } from '../../../common'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { useOpenedCta } from '../useOpenedCta'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per render.\n const openedCta = useOpenedCta(beat)\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n beatTransactions: resolveBeatTransactions,\n averageFormat,\n subTabs,\n boldLabel,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(\n beat,\n { slotData, beatTransactions: resolveBeatTransactions },\n openedCta?.drilldown_data,\n )\n\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n // After the hooks: a failed copy request leaves no `insights_feed`.\n if (!insightsCopy) return <BlockErrorMessage />\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n slotData: instanceSlotData,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n // Upcoming Bill appends a synthesized projected bill: it draws the last bar and its own labelled\n // row, but is never a plain list row or a CSV line.\n const { transactions: listTransactions, projectedTransaction } =\n splitProjectedTransaction(beatTransactions)\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? listTransactions : undefined\n\n const projectedHeading = insightsCopy.general.projected_amount\n const projectedRow =\n projectedTransaction &&\n projectedHeading &&\n resolveFilter(selectedIndex).custom?.(projectedTransaction)\n ? { heading: projectedHeading, transaction: projectedTransaction }\n : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n boldLabel={boldLabel}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n projectedRow={projectedRow}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IAAqB,GAKvB,IA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C,GAC3C,EAA4B,EAAI;AAAA,IAClC;AAAA,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, GlobalCopy, Transaction } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { DoubleBarChart } from '../../components/chartblocks/DoubleBarChart'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\nimport {\n COMPARISON_BAR_ARIA_LABEL,\n toLegendItems,\n} from '../../blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n splitProjectedTransaction,\n toStoreFilter,\n} from './utils'\nimport { Drawer, useInsightsV2Store, useGlobalCopyStore } from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { useOpenedCta } from '../useOpenedCta'\nimport { useRequiredCopy } from '../useRequiredCopy'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const selectTransactionHistoryCopy = (copy: GlobalCopy) => copy.insights_feed\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { insights_payload } = beat\n\n // The CTA that opened the drawer: its variant picks the view, and its drilldown_data feeds a\n // variant that reads its facts from the opener (Monthly Debt to Income). Only drilldown_data is passed\n // on: it is the payload's own object, stable across renders, while the opener may be rebuilt per render.\n const openedCta = useOpenedCta(beat)\n const dynamicCtaVariant = openedCta?.variant\n\n const {\n top,\n filterMode,\n header,\n colors,\n filterStrategy,\n tipSection,\n subTabAriaLabels,\n slotData,\n beatTransactions: resolveBeatTransactions,\n averageFormat,\n subTabs,\n boldLabel,\n } = getDrillDownConfig(dynamicCtaVariant ?? '')\n\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(\n beat,\n { slotData, beatTransactions: resolveBeatTransactions },\n openedCta?.drilldown_data,\n )\n\n const { common: commonCopy } = useGlobalCopyStore()\n const insightsCopy = useRequiredCopy(selectTransactionHistoryCopy)\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel:\n top === 'doubleBar'\n ? (insightsCopy?.general?.in_month_you_had_a_category_of_amount ??\n COMPARISON_BAR_ARIA_LABEL)\n : BAR_ARIA_LABEL,\n top,\n beatTransactions,\n })\n\n const isDoubleBar = top === 'doubleBar'\n const isTabsOnly = top === 'tabsOnly'\n // The drawer's columns (and tabs): the double bar's month pairs, or the single bar's bars.\n const bars = isDoubleBar ? comparisonBars : chartData\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n // The double-bar drawer's series tab (0 = main, e.g. Spend; 1 = comparison, e.g. Income).\n const [subIndex, setSubIndex] = useState(subTabIndex)\n\n // Bars built from the transaction store (Upcoming Bill's paid bills) can arrive after the drawer\n // opens: re-select the default when the bar count changes. Payload-built bars never change count.\n const [defaultedTabCount, setDefaultedTabCount] = useState(bars.length)\n if (bars.length !== defaultedTabCount) {\n setDefaultedTabCount(bars.length)\n setSelectedIndex(chartBarIndex)\n }\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n comparisonBars,\n selectedIndex: index,\n subIndex,\n isLastTab: index === bars.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Content keys for the effect deps: these arrays get a new identity every render (MEW-3732).\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applied on selection change and when the nested details drawer closes: AddMerchantBudgetAction\n // overwrites transactionStore.filter and never restores it. Chartless tops filter with no bars.\n const canApplyFilter =\n top === 'list' || top === 'tabsOnly' || top === 'monthTabs' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store') return\n // A chart drawer with no bars can name no rows: fail closed rather than keep the store's default\n // (every account) or a previous drawer's filter.\n const filter = canApplyFilter\n ? resolveFilter(selectedIndex)\n : { accounts: [], custom: () => false }\n transactionStore.setFilter(toStoreFilter(filter, { allAccountGuids, displayedDateRange }))\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n subIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n slotData: instanceSlotData,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n // `legends` is the block's additional_data ([0] main, [1] second series), as BarchartBlock reads it.\n const [mainLegend, comparisonLegend] = instanceSlotData?.legends ?? []\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n // Upcoming Bill appends a synthesized projected bill: it draws the last bar and its own labelled\n // row, but is never a plain list row or a CSV line.\n const { transactions: listTransactions, projectedTransaction } =\n splitProjectedTransaction(beatTransactions)\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? listTransactions : undefined\n\n const projectedHeading = insightsCopy.general.projected_amount\n const projectedRow =\n projectedTransaction &&\n projectedHeading &&\n resolveFilter(selectedIndex).custom?.(projectedTransaction)\n ? { heading: projectedHeading, transaction: projectedTransaction }\n : undefined\n\n // A chart bar click selects its column (and, on the double bar, its series); a month tab change\n // selects the month. MUI Tabs only fires onChange on real user selection, not on mount. The\n // series (Spend / Income) tab fires its own analytics via the shared SubTabs component.\n const selectBar = (index: number, seriesIndex?: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n if (seriesIndex !== undefined) setSubIndex(seriesIndex)\n }\n const selectMonth = (index: number) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }\n\n // Double bar: the Spend / Income labels come from copy (additional_data); the legend carries the\n // selected month's two totals, and its labels name the series tabs.\n const doubleBarLegends = isDoubleBar\n ? toLegendItems([\n { ...mainLegend, value: comparisonBars[selectedIndex]?.main },\n { ...comparisonLegend, value: comparisonBars[selectedIndex]?.comparison },\n ])\n : undefined\n\n // Legacy pulse named these tabs \"Spend transactions\" / \"Income transactions\" for screen readers.\n const seriesAriaLabels = subTabAriaLabels?.(insightsCopy) ?? []\n\n // The second tab row: the double bar's series, a tabs-only drawer's sides, or the variant's `subTabs`.\n const sideTabs = isDoubleBar\n ? (doubleBarLegends ?? []).map((legend, index) => ({\n label: legend.label,\n ariaLabel: seriesAriaLabels[index],\n }))\n : isTabsOnly\n ? dataSeries.flatMap((row) => (row.localized_label ? [{ label: row.localized_label }] : []))\n : (subTabs?.({ instanceSlotData, copy: insightsCopy }).map((label) => ({ label })) ?? [])\n\n const renderChart = () => {\n if (!bars.length) return <EmptyBarChart />\n\n return isDoubleBar ? (\n <DoubleBarChart\n bars={comparisonBars}\n boldLabel={boldLabel}\n colors={barColors}\n legendPosition=\"top\"\n legends={doubleBarLegends}\n onBarClick={selectBar}\n selectedIndex={selectedIndex}\n />\n ) : (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(\n instanceSlotData?.average_amount ?? 0,\n averageFormat ?? CURRENCY_FORMAT.cents,\n ),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n // Figma's chart drawer: 172px of bars under the 24px legend, 200px in all.\n heightOverride={172}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every\n // beat/variant. Remove this once the backend guarantees `legends` on the payload.\n monthlyAmountLabel={mainLegend?.label ?? insightsCopy.general.monthly_amount}\n onBarClick={selectBar}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={comparisonLegend?.label ?? insightsCopy.general.trend}\n />\n )\n }\n\n // `list` (Low Account Balance), `tabsOnly` (Non-Essential Category Summary) and `monthTabs`\n // (Monthly Subscription Aggregate) drawers have no chart above their transaction list.\n const chartTop =\n isDoubleBar || top === 'singleBar' || top === 'upcomingBill' ? renderChart() : null\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n projectedRow={projectedRow}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={selectMonth}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={bars}\n top={chartTop}\n {...(sideTabs.length > 0 && {\n subTabs: { tabs: sideTabs, selectedIndex: subIndex, onChange: setSubIndex },\n })}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n (tipSection(setCloseTipSection, insightsCopy, subHeader?.text, instanceSlotData) ??\n false),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,KAAA,CAAgC,MAAqB,EAAK,eAE1D,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GAEjB,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,GAAmB,GAExD,EAAE,kBAAA,EAAA,IAAqB,GA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,EACD,CAAA,GACD,gBAAA,EAAC,IAAD;AAAA,IACE,gBAAgB,GAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAA,MAAe;AACb,MAAA,EAA4B,EAAK,GAIjC,EAAiB,EAAE,kBAAkB,OAAU,CAAC,GAGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useGlobalCopyStore as t } from "../../common/context/hooks.es.js";
|
|
2
|
+
var i = (r) => {
|
|
3
|
+
const o = r(t());
|
|
4
|
+
if (o == null) throw new Error("Action block copy is missing: mount the block through ActionBlockLayer.");
|
|
5
|
+
return o;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
i as useRequiredCopy
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=useRequiredCopy.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRequiredCopy.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/useRequiredCopy.ts"],"sourcesContent":["import { useGlobalCopyStore } from '../../common'\nimport type { GlobalCopy } from '../../core'\n\n/** A block's copy section. ActionBlockLayer mounts the block only when it is present. */\nexport const useRequiredCopy = <T>(select: (copy: GlobalCopy) => T | null | undefined): T => {\n const section = select(useGlobalCopyStore())\n if (section == null) {\n throw new Error('Action block copy is missing: mount the block through ActionBlockLayer.')\n }\n return section\n}\n"],"mappings":";AAIA,IAAa,IAAA,CAAsB,MAA0D;AAC3F,QAAM,IAAU,EAAO,EAAmB,CAAC;AAC3C,MAAI,KAAW,KACb,OAAM,IAAI,MAAM,yEAAyE;AAE3F,SAAO;AACT"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
1
|
+
import { useGlobalCopyStore as b, useInsightsV2Store as g } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import { actionBlocksKey as h } from "../../../mappings/actionBlocksKey.es.js";
|
|
3
3
|
import { DoubleBarChart as C } from "../../../components/chartblocks/DoubleBarChart.es.js";
|
|
4
4
|
import { buildComparisonSeries as _, toLegendItems as B } from "./comparisonUtils.es.js";
|
|
5
5
|
import { getLayoutConfig as I } from "./layout.es.js";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
var N = ({ payload: { instance_slot:
|
|
9
|
-
const a =
|
|
10
|
-
return /* @__PURE__ */
|
|
6
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
7
|
+
import { useTheme as y } from "@mui/material/styles";
|
|
8
|
+
var N = ({ payload: { instance_slot: r, widget_type: t }, beatGuid: e = "" }) => {
|
|
9
|
+
const a = y(), { openActionDrawer: i } = g(), n = b().insights_feed?.general?.in_month_you_had_a_category_of_amount, { variant: s } = r, { series: l, additional_data: m } = r.data ?? {}, c = _(l, n), d = B(m), o = I(a, s), f = o?.color ?? [];
|
|
10
|
+
return /* @__PURE__ */ S(C, {
|
|
11
11
|
bars: c,
|
|
12
|
-
boldLabel:
|
|
12
|
+
boldLabel: o?.boldLabel,
|
|
13
|
+
plotSize: o?.plotSize,
|
|
13
14
|
colors: f,
|
|
14
|
-
isMini:
|
|
15
|
+
isMini: t === "mini",
|
|
15
16
|
legends: d,
|
|
16
|
-
onBarClick: (u,
|
|
17
|
-
if (
|
|
18
|
-
|
|
17
|
+
onBarClick: (u, p) => {
|
|
18
|
+
if (t !== "full") return !1;
|
|
19
|
+
i({
|
|
19
20
|
guid: e,
|
|
20
21
|
trigger: "chartBar",
|
|
21
22
|
context: {
|
|
22
23
|
chartBarIndex: u,
|
|
23
|
-
tabIndex:
|
|
24
|
+
tabIndex: p,
|
|
24
25
|
block: h.TRANSCATION_HISTORY_ACTION_BLOCK
|
|
25
26
|
}
|
|
26
27
|
});
|
package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleBarChartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../../../common'\nimport type { DrilldownPayload } from '../../../../core'\nimport type { BarChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { DoubleBarChart } from '../../../components/chartblocks/DoubleBarChart'\n\nimport type { BlockProps } from '../../types'\n\nimport { buildComparisonSeries, toLegendItems } from './comparisonUtils'\nimport { getLayoutConfig } from './layout'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\n\n/**\n * Card block for the double-bar chart. Mirrors BarchartBlock: it builds the shaped series\n * (buildComparisonSeries) and resolves the card palette (getLayoutConfig), then renders the reusable\n * DoubleBarChart and injects the card click behavior \\u2014 open the shared drawer scoped to this beat\n * (chartBarIndex = clicked column, tabIndex = clicked sub-series).\n */\nexport const DoubleBarChartBlock = ({\n payload: { instance_slot, widget_type },\n beatGuid = '',\n}: BlockProps) => {\n const theme = useTheme()\n const { openActionDrawer } = useInsightsV2Store()\n const ariaLabel =\n useGlobalCopyStore().insights_feed?.general?.in_month_you_had_a_category_of_amount\n const { variant } = instance_slot\n // The slots ditto fills on instance_slot.data, read as BarchartBlock reads them.\n const { series, additional_data } = (instance_slot.data ?? {}) as BarChartBlockData\n const bars = buildComparisonSeries(series, ariaLabel)\n const legendItems = toLegendItems(additional_data)\n // getLayoutConfig returns undefined for an unknown/unsupported variant; fall back to an empty\n // palette so an unregistered beat can't throw on mount.\n const layoutConfig = getLayoutConfig(theme, variant)\n const colors = layoutConfig?.color ?? []\n\n return (\n <DoubleBarChart\n bars={bars}\n boldLabel={layoutConfig?.boldLabel}\n colors={colors}\n isMini={widget_type === 'mini'}\n legends={legendItems}\n onBarClick={(columnIndex, subIndex) => {\n if (widget_type !== 'full') return false\n\n openActionDrawer({\n guid: beatGuid,\n trigger: 'chartBar',\n context: {\n chartBarIndex: columnIndex,\n tabIndex: subIndex,\n block: actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK,\n } satisfies DrilldownPayload,\n })\n }}\n />\n )\n}\n"],"mappings":";;;;;;;AAmBA,IAAa,IAAA,CAAuB,EAClC,SAAS,EAAE,eAAA,GAAe,aAAA,EAAA,GAC1B,UAAA,IAAW,GAAA,MACK;AAChB,QAAM,IAAQ,EAAS,GACjB,EAAE,kBAAA,EAAA,IAAqB,EAAmB,GAC1C,IACJ,EAAmB,EAAE,eAAe,SAAS,uCACzC,EAAE,SAAA,EAAA,IAAY,GAEd,EAAE,QAAA,GAAQ,iBAAA,EAAA,IAAqB,EAAc,QAAQ,CAAC,GACtD,IAAO,EAAsB,GAAQ,CAAS,GAC9C,IAAc,EAAc,CAAe,GAG3C,IAAe,EAAgB,GAAO,CAAO,GAC7C,IAAS,GAAc,SAAS,CAAC;AAEvC,SACE,gBAAA,EAAC,GAAD;AAAA,IACQ,MAAA;AAAA,IACN,WAAW,GAAc;AAAA,
|
|
1
|
+
{"version":3,"file":"DoubleBarChartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../../../common'\nimport type { DrilldownPayload } from '../../../../core'\nimport type { BarChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\nimport { DoubleBarChart } from '../../../components/chartblocks/DoubleBarChart'\n\nimport type { BlockProps } from '../../types'\n\nimport { buildComparisonSeries, toLegendItems } from './comparisonUtils'\nimport { getLayoutConfig } from './layout'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\n\n/**\n * Card block for the double-bar chart. Mirrors BarchartBlock: it builds the shaped series\n * (buildComparisonSeries) and resolves the card palette (getLayoutConfig), then renders the reusable\n * DoubleBarChart and injects the card click behavior \\u2014 open the shared drawer scoped to this beat\n * (chartBarIndex = clicked column, tabIndex = clicked sub-series).\n */\nexport const DoubleBarChartBlock = ({\n payload: { instance_slot, widget_type },\n beatGuid = '',\n}: BlockProps) => {\n const theme = useTheme()\n const { openActionDrawer } = useInsightsV2Store()\n const ariaLabel =\n useGlobalCopyStore().insights_feed?.general?.in_month_you_had_a_category_of_amount\n const { variant } = instance_slot\n // The slots ditto fills on instance_slot.data, read as BarchartBlock reads them.\n const { series, additional_data } = (instance_slot.data ?? {}) as BarChartBlockData\n const bars = buildComparisonSeries(series, ariaLabel)\n const legendItems = toLegendItems(additional_data)\n // getLayoutConfig returns undefined for an unknown/unsupported variant; fall back to an empty\n // palette so an unregistered beat can't throw on mount.\n const layoutConfig = getLayoutConfig(theme, variant)\n const colors = layoutConfig?.color ?? []\n\n return (\n <DoubleBarChart\n bars={bars}\n boldLabel={layoutConfig?.boldLabel}\n plotSize={layoutConfig?.plotSize}\n colors={colors}\n isMini={widget_type === 'mini'}\n legends={legendItems}\n onBarClick={(columnIndex, subIndex) => {\n if (widget_type !== 'full') return false\n\n openActionDrawer({\n guid: beatGuid,\n trigger: 'chartBar',\n context: {\n chartBarIndex: columnIndex,\n tabIndex: subIndex,\n block: actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK,\n } satisfies DrilldownPayload,\n })\n }}\n />\n )\n}\n"],"mappings":";;;;;;;AAmBA,IAAa,IAAA,CAAuB,EAClC,SAAS,EAAE,eAAA,GAAe,aAAA,EAAA,GAC1B,UAAA,IAAW,GAAA,MACK;AAChB,QAAM,IAAQ,EAAS,GACjB,EAAE,kBAAA,EAAA,IAAqB,EAAmB,GAC1C,IACJ,EAAmB,EAAE,eAAe,SAAS,uCACzC,EAAE,SAAA,EAAA,IAAY,GAEd,EAAE,QAAA,GAAQ,iBAAA,EAAA,IAAqB,EAAc,QAAQ,CAAC,GACtD,IAAO,EAAsB,GAAQ,CAAS,GAC9C,IAAc,EAAc,CAAe,GAG3C,IAAe,EAAgB,GAAO,CAAO,GAC7C,IAAS,GAAc,SAAS,CAAC;AAEvC,SACE,gBAAA,EAAC,GAAD;AAAA,IACQ,MAAA;AAAA,IACN,WAAW,GAAc;AAAA,IACzB,UAAU,GAAc;AAAA,IAChB,QAAA;AAAA,IACR,QAAQ,MAAgB;AAAA,IACxB,SAAS;AAAA,IACT,YAAA,CAAa,GAAa,MAAa;AACrC,UAAI,MAAgB,OAAQ,QAAO;AAEnC,MAAA,EAAiB;AAAA,QACf,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,UACP,eAAe;AAAA,UACf,UAAU;AAAA,UACV,OAAO,EAAgB;AAAA,QACzB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACD,CAAA;AAEL"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Theme } from '@mui/material/styles';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { PlotSize } from '../../../components/chartblocks/DoubleBarChart';
|
|
3
|
+
export interface DoubleBarLayoutConfig {
|
|
4
|
+
boldLabel?: boolean;
|
|
4
5
|
color: string[];
|
|
5
|
-
|
|
6
|
+
plotSize?: PlotSize;
|
|
7
|
+
}
|
|
8
|
+
export declare const getLayoutConfig: (theme: Theme, variant?: string | null) => DoubleBarLayoutConfig | undefined;
|
|
@@ -3,8 +3,13 @@ var c = (o) => ({
|
|
|
3
3
|
color: [o.palette.chart.chart2, o.palette.chart.chart1]
|
|
4
4
|
}), r = (o) => ({
|
|
5
5
|
boldLabel: !0,
|
|
6
|
-
color: [o.palette.chartMono.chartMono5, o.palette.chartMono.chartMono3]
|
|
7
|
-
|
|
6
|
+
color: [o.palette.chartMono.chartMono5, o.palette.chartMono.chartMono3],
|
|
7
|
+
plotSize: {
|
|
8
|
+
height: 144,
|
|
9
|
+
top: 14,
|
|
10
|
+
bottom: 6
|
|
11
|
+
}
|
|
12
|
+
}), e = (o, t) => {
|
|
8
13
|
const a = {
|
|
9
14
|
SpendToIncome: c(o),
|
|
10
15
|
spend_to_income: c(o),
|
|
@@ -18,7 +23,7 @@ var c = (o) => ({
|
|
|
18
23
|
return t && Object.hasOwn(a, t) ? a[t] : void 0;
|
|
19
24
|
};
|
|
20
25
|
export {
|
|
21
|
-
|
|
26
|
+
e as getLayoutConfig
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
//# sourceMappingURL=layout.es.js.map
|