@mx-cartographer/experiences 9.7.42 → 9.7.44
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 +12 -0
- package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.es.js +3 -3
- package/dist/accounts/index.es.js +4 -4
- package/dist/core/types/InsightsInstanceSlotData.d.ts +3 -0
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +3 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +32 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/index.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/layout.d.ts +3 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/layout.es.js +10 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js +20 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +85 -75
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +115 -93
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +66 -44
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +49 -44
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +4 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +4 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.d.ts +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +19 -19
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.d.ts +8 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js +47 -31
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/comparisonUtils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -5
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js +10 -6
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/SubTabs.d.ts +22 -0
- package/dist/insights-v2/components/SubTabs.es.js +38 -0
- package/dist/insights-v2/components/SubTabs.es.js.map +1 -0
- package/dist/insights-v2/components/chartblocks/ChartLegend.es.js +14 -18
- package/dist/insights-v2/components/chartblocks/ChartLegend.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.d.ts +5 -3
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js +108 -104
- package/dist/insights-v2/components/chartblocks/DoubleBarChart.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +73 -66
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [9.7.44] - 10-26-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - `account_details_block` action block: the accounts widget's account details (header with trend chart, Transactions / Account Details tabs, connection status, actions) in the action drawer for the beat's primary account, titled from `accounts.account_details`. An account the store cannot resolve shows the error message rather than an earlier selection. Missing Interest Rate fixture, stories, tests and `docs/action-blocks/account-details-block.md` (MEW2-2633)
|
|
4
|
+
|
|
5
|
+
## [9.7.43] - 10-26-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - Monthly Spend to Income Comparison on Insights 2.0 (WEC-2101, Figma 1941:137446). `DoubleBarChartBlock` reads ditto's `instance_slot.data` slots only, as `BarchartBlock` does — `series` (the stored data_series, a Spend and an Income row per month) and `additional_data` (the legend, `{ label, value, value_type }`); a legend item with no `value` shows its label alone, never $0.00. The `DoubleBarChart` stories now feed `instance_slot.data`. `layout.ts` gains ditto's `spend_to_income` variant (the existing spend-to-income palette, now matched with `Object.hasOwn`). The drawer's double-bar view is built: `TransactionHistoryBlock` `monthly_spend_to_income` entry (`top: 'doubleBar'`) with one tab per month (`getDefaultSelection` counts the comparison columns), Spend / Income sub-tabs between the chart and the list (`TransactionDrillDown` `subTabs`), the selected month's totals in the legend, and `comparisonGuidsStrategy` — the selected month's spend or income transactions by the bar's stored guids, failing closed when the bar names none. `buildComparisonSeries` carries each bar's `mainGuids` / `comparisonGuids` and `DoubleBarChart` takes a `selectedIndex` and a `legendPosition` (as `BarChartV2`: below the chart on the card, above it in the drawer). `DoubleBarChart` stories per state from tupac's envelopes.
|
|
8
|
+
- **CHANGED** - `DoubleBarChart` shows its legend on mini too (the Figma mini card carries it), and the shared chart `Legend` reads "Label: $X" without the stray space before the colon (also CreditUtilization's legend).
|
|
9
|
+
- **CHANGED** - Spend vs. Income drawer parity with pulse: the Spend / Income tabs fire pulse's `Transactions Filter` / "<Template> - Transactions Filtered By Type" event (not "Month Tab Selected") and are named "Spend transactions" / "Income transactions"; the double-bar bars (card and drawer) are labelled from `insights_feed.general.in_month_you_had_a_category_of_amount` ("In March, you had a spend of $1,500.00") instead of the unlocalized month-and-amount label.
|
|
10
|
+
- **ADDED** - `SubTabs` (`insights-v2/components`): the drill-down drawers' second tab row (e.g. Spend / Income) as one shared component — controlled, per-tab screen-reader names, and it fires pulse's `Transactions Filter` / "Transactions Filtered By Type" event itself. `TransactionDrillDown` takes it as a single `subTabs` prop (replacing `subTabs` / `selectedSubIndex` / `onSubSelectionChange`), ready for the remaining double-bar and deposit-summary drawers.
|
|
11
|
+
- **CHANGED** - `SubTabs` wires each tab to the content it controls: tab `id` + `aria-controls`, and `subTabPanelProps(id, selectedIndex)` gives the panel `role="tabpanel"` / `aria-labelledby` the selected tab. `SubTabs` takes a required `id`; `TransactionDrillDown` owns it and makes the transaction list (tip, header and rows) the Spend / Income tabs' panel, as its month tabs already do.
|
|
12
|
+
|
|
1
13
|
## [9.7.42] - 10-26-2026
|
|
2
14
|
|
|
3
15
|
- **CHANGED** - `AccountSwitchBlock` reads only the Insights 2.0 envelope's `instance_slot.data` (`from_logo`, `to_logo`, each `{ guid, alt }`) and renders the same `TransferLogoCard`, each logo through `LogoFromGuid`, which draws nothing for a missing slot or a guid that fails `isLogoGuid`. The flat `instance_slot_data` fallback is removed: tupac never sends it on an Insights 2.0 envelope, and the V1 Discovered Accounts and Switch Direct Deposit cards render through the legacy `insights` components, not this block. The block's stories move to the `data` shape (WEC-1980)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useGlobalCopyStore as e } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import c from "../../../../common/components/drawer/Drawer.es.js";
|
|
3
3
|
import l from "../../../../trends/components/TrendsChart.es.js";
|
|
4
|
-
import s from "./
|
|
5
|
-
import i from "./
|
|
4
|
+
import s from "./AccountDetailsHeader.es.js";
|
|
5
|
+
import i from "./AccountDetailsContent.es.js";
|
|
6
6
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
7
7
|
var _ = ({ isOpen: r, onClose: a }) => {
|
|
8
8
|
const { accounts: t } = e();
|
|
@@ -11,7 +11,7 @@ var _ = ({ isOpen: r, onClose: a }) => {
|
|
|
11
11
|
isOpen: r,
|
|
12
12
|
onClose: a,
|
|
13
13
|
title: t.account_details,
|
|
14
|
-
children: [/* @__PURE__ */ o(
|
|
14
|
+
children: [/* @__PURE__ */ o(s, { ChartComponent: l }), /* @__PURE__ */ o(i, {})]
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
@@ -3,16 +3,16 @@ import { useAccountUiStore as i } from "./hooks/useUiStore.es.js";
|
|
|
3
3
|
import { FieldType as r } from "./constants/Accounts.es.js";
|
|
4
4
|
import { getAccountBalanceDetails as a, getAccountDetailFields as m } from "./utils/AccountFields.es.js";
|
|
5
5
|
import { useGetMergeableAccounts as s } from "./hooks/useGetMergeableAccounts.es.js";
|
|
6
|
-
import l from "./components/detailsdrawer/Accounts/
|
|
7
|
-
import p from "./components/detailsdrawer/Accounts/
|
|
6
|
+
import l from "./components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
7
|
+
import p from "./components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
8
8
|
import g from "./components/detailsdrawer/Accounts/AccountDetailsDrawer.es.js";
|
|
9
9
|
import M from "./AccountsWidget.es.js";
|
|
10
10
|
import C from "./AccountsMiniWidget.es.js";
|
|
11
11
|
import b from "./ConnectMiniWidget.es.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
p as AccountDetailsContent,
|
|
14
14
|
g as AccountDetailsDrawer,
|
|
15
|
-
|
|
15
|
+
l as AccountDetailsHeader,
|
|
16
16
|
C as AccountsMiniWidget,
|
|
17
17
|
M as AccountsWidget,
|
|
18
18
|
b as ConnectMiniWidget,
|
|
@@ -37,10 +37,13 @@ export interface DataSet extends DataSeries {
|
|
|
37
37
|
ariaLabelComparison: string;
|
|
38
38
|
ariaLabelMain: string;
|
|
39
39
|
comparison: number;
|
|
40
|
+
comparisonGuids?: string[];
|
|
41
|
+
date?: string;
|
|
40
42
|
formattedComparison: string;
|
|
41
43
|
formattedMain: string;
|
|
42
44
|
label: string;
|
|
43
45
|
main: number;
|
|
46
|
+
mainGuids?: string[];
|
|
44
47
|
}
|
|
45
48
|
export interface ImageBlockData {
|
|
46
49
|
image: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsInstanceSlotData.es.js","names":[],"sources":["../../../src/core/types/InsightsInstanceSlotData.ts"],"sourcesContent":["import type { DataSeries, Legends, LogoRef } from '../../core'\n\nexport interface InsightsInstanceSlotData\n extends\n Partial<BudgetBlockData>,\n Partial<DonutChartBlockData>,\n Partial<ImageBlockData>,\n Partial<AccountBlockData>,\n Partial<SaveExtraBlockData>,\n Partial<StepChartBlockData>,\n Partial<SVGImageBlockData>,\n Partial<AccountSwitchBlockData>,\n Partial<TransactionDetailsBlockData>,\n Partial<CreditUtilizationBlockData>,\n Partial<CommonProps> {}\n\n//when any of the type is used more than one times, we can use the common props\ninterface CommonProps {\n amount?: number\n ariaLabel?: string\n date?: string\n legends?: Legends[]\n category_guid?: string\n data_series?: DataSeries | DataSet[]\n transaction_guids?: string[]\n account_guids?: string[]\n primary_transaction_guid?: string\n}\n\n//BarChart Block: `instance_slot.data` (Insights 2.0)\nexport interface BarChartBlockData {\n series?: DataSeries\n category_guid?: string\n average_amount?: number\n /** [0] monthly amount, [1] trend. */\n additional_data?: Legends[]\n}\n\n//DonutChart Block\ninterface Main {\n value: string\n value_type: string\n label: string\n}\nexport interface DonutChartBlockData {\n main: Main\n}\n\n//DoubleBarChart Block\n// TODO : This has to be revisited again to update the below types based on API response once we have the final shape of the data_series for double bar chart from BE\nexport interface LegendProps extends Legends {\n amount: number\n formattedAmount: string\n label: string\n color?: string\n}\n\nexport interface DataSet extends DataSeries {\n ariaLabelComparison: string\n ariaLabelMain: string\n comparison: number\n formattedComparison: string\n formattedMain: string\n label: string\n main: number\n}\n\n//DoubleProgressBar Block\n\n//Image Block\nexport interface ImageBlockData {\n image: string\n}\n\n//Account Block\nexport interface AccountBlockData {\n sub_text: string\n institution_guid?: string\n institution_name?: string\n icon_name?: string\n /** Header bar text (standard card), or the colored category strip label (deposit cards). */\n header_text?: string\n // Deposit variants (Unified Deposit, Unified Deposit Emergency Fund, Savings Account Deposit)\n /** Merchant guid — renders a real merchant logo in the deposit card when present. */\n merchant_guid?: string\n /** Merchant display name — logo alt text and the payer line under the amount. */\n merchant_name?: string\n /** Secondary label beside the amount, e.g. `On {date}, you saved` or `Balance as of MM/DD/YY`. */\n label?: string\n}\n\nexport interface SaveExtraBlockData {\n /** Styled segments `[lead-in, amount digits, trailing copy]`, e.g. `['Save an extra', '100', 'to help your funds grow']`. */\n primary_text?: string[]\n /** Styled segments `[projected balance, caption]`, e.g. `['$8,313.87', 'After payday & projected expenses']`. */\n secondary_text?: string[]\n /** MakeTransfer drilldown: available balance (both variants). */\n available_balance?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: average monthly spend. */\n avg_monthly_spend?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: how long the balance lasts, overlaid on the timeline SVG (e.g. \"2 months, 11 days\"). */\n time_period?: string\n /** SAVE_AN_EXTRA_100: upcoming expenses (the \"Expenses\" figure). */\n upcoming_expenses?: number\n /** SAVE_AN_EXTRA_100: total remaining after expenses. */\n total_remaining?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: date for the \"Your available balances as of {date}\" line. */\n date?: string\n}\n\n// AccountSwitch Block. State comes from `instance_slot.variant`, not a data flag.\nexport interface AccountSwitchBlockData {\n discovered_institution_guid: string\n discovered_institution_name: string\n held_institution_guid: string\n held_institution_name: string\n}\n\n// AccountSwitch Block: `instance_slot.data` (Insights 2.0, Discovered Accounts V2). Each slot is\n// optional: tupac omits `to_logo` when the user holds no FI-managed account. `logo` is the compact\n// card's (micro, notification) discovered institution.\nexport interface AccountSwitchBlockV2Data {\n from_logo?: LogoRef\n to_logo?: LogoRef\n logo?: LogoRef\n}\n\n// StepChart Block\nexport interface StepChartBlockData {\n completed_steps: number\n label_1: string\n label_2?: string\n}\n\n//Budgets Blocks\nexport enum BudgetTierType {\n LOW_BUDGET_TIER = 'LOW',\n MEDIUM_BUDGET_TIER = 'MEDIUM',\n OFF_TRACK_BUDGET_TIER = 'OFF_TRACK',\n}\n\nexport type BudgetTierValue = `${BudgetTierType}`\n\nexport interface BudgetLocalizedPayload {\n primary_text?: string\n amount_left_label?: string\n spent_label?: string\n budgeted_label?: string\n}\n\nexport interface BudgetBlockData {\n budget_percent: number\n budget_tier: BudgetTierValue\n category_guid?: string\n merchant_guid?: string\n spent_amount: number\n budgeted_amount: number\n localized_payload: BudgetLocalizedPayload\n}\n\nexport interface SVGImageBlockData {\n isCIBC?: boolean\n}\n\n// TransactionDetails Action Block\n// The drawer's subject is `InsightsPayload.primary_transaction_guid`; only action configuration\n// lives here.\nexport interface TransactionDetailsBlockData {\n /** `TopActions` member names, e.g. `['Category', 'Date', 'Memo']`. Omit for the defaults. */\n top_actions?: string[]\n /** `BottomActions` member names, e.g. `['MerchantBudget', 'HideTransaction']`. Omit for defaults. */\n bottom_actions?: string[]\n}\n\n// Credit Utilization action block. The per-card rows are the beat's `data_series` table\n// (`guid`, `label`, `amount`, `total_amount`, `percentage`), carried on `CommonProps.data_series`.\nexport interface CreditUtilizationBlockData {\n accounts_balance_sum?: number\n accounts_credit_limit_sum?: number\n credit_utilization_percentage?: number\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InsightsInstanceSlotData.es.js","names":[],"sources":["../../../src/core/types/InsightsInstanceSlotData.ts"],"sourcesContent":["import type { DataSeries, Legends, LogoRef } from '../../core'\n\nexport interface InsightsInstanceSlotData\n extends\n Partial<BudgetBlockData>,\n Partial<DonutChartBlockData>,\n Partial<ImageBlockData>,\n Partial<AccountBlockData>,\n Partial<SaveExtraBlockData>,\n Partial<StepChartBlockData>,\n Partial<SVGImageBlockData>,\n Partial<AccountSwitchBlockData>,\n Partial<TransactionDetailsBlockData>,\n Partial<CreditUtilizationBlockData>,\n Partial<CommonProps> {}\n\n//when any of the type is used more than one times, we can use the common props\ninterface CommonProps {\n amount?: number\n ariaLabel?: string\n date?: string\n legends?: Legends[]\n category_guid?: string\n data_series?: DataSeries | DataSet[]\n transaction_guids?: string[]\n account_guids?: string[]\n primary_transaction_guid?: string\n}\n\n//BarChart Block: `instance_slot.data` (Insights 2.0)\nexport interface BarChartBlockData {\n series?: DataSeries\n category_guid?: string\n average_amount?: number\n /** [0] monthly amount, [1] trend. */\n additional_data?: Legends[]\n}\n\n//DonutChart Block\ninterface Main {\n value: string\n value_type: string\n label: string\n}\nexport interface DonutChartBlockData {\n main: Main\n}\n\n//DoubleBarChart Block\n// TODO : This has to be revisited again to update the below types based on API response once we have the final shape of the data_series for double bar chart from BE\nexport interface LegendProps extends Legends {\n amount: number\n formattedAmount: string\n label: string\n color?: string\n}\n\nexport interface DataSet extends DataSeries {\n ariaLabelComparison: string\n ariaLabelMain: string\n comparison: number\n // The comparison bar's transaction guids (data_series aggregated_guids), for the drawer filter.\n comparisonGuids?: string[]\n // The month's 'yyyy-MM-dd' date (the main row's).\n date?: string\n formattedComparison: string\n formattedMain: string\n label: string\n main: number\n // The main bar's transaction guids (data_series aggregated_guids), for the drawer filter.\n mainGuids?: string[]\n}\n\n//DoubleProgressBar Block\n\n//Image Block\nexport interface ImageBlockData {\n image: string\n}\n\n//Account Block\nexport interface AccountBlockData {\n sub_text: string\n institution_guid?: string\n institution_name?: string\n icon_name?: string\n /** Header bar text (standard card), or the colored category strip label (deposit cards). */\n header_text?: string\n // Deposit variants (Unified Deposit, Unified Deposit Emergency Fund, Savings Account Deposit)\n /** Merchant guid — renders a real merchant logo in the deposit card when present. */\n merchant_guid?: string\n /** Merchant display name — logo alt text and the payer line under the amount. */\n merchant_name?: string\n /** Secondary label beside the amount, e.g. `On {date}, you saved` or `Balance as of MM/DD/YY`. */\n label?: string\n}\n\nexport interface SaveExtraBlockData {\n /** Styled segments `[lead-in, amount digits, trailing copy]`, e.g. `['Save an extra', '100', 'to help your funds grow']`. */\n primary_text?: string[]\n /** Styled segments `[projected balance, caption]`, e.g. `['$8,313.87', 'After payday & projected expenses']`. */\n secondary_text?: string[]\n /** MakeTransfer drilldown: available balance (both variants). */\n available_balance?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: average monthly spend. */\n avg_monthly_spend?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: how long the balance lasts, overlaid on the timeline SVG (e.g. \"2 months, 11 days\"). */\n time_period?: string\n /** SAVE_AN_EXTRA_100: upcoming expenses (the \"Expenses\" figure). */\n upcoming_expenses?: number\n /** SAVE_AN_EXTRA_100: total remaining after expenses. */\n total_remaining?: number\n /** SAVE_ENOUGH_TO_LIVE_ON: date for the \"Your available balances as of {date}\" line. */\n date?: string\n}\n\n// AccountSwitch Block. State comes from `instance_slot.variant`, not a data flag.\nexport interface AccountSwitchBlockData {\n discovered_institution_guid: string\n discovered_institution_name: string\n held_institution_guid: string\n held_institution_name: string\n}\n\n// AccountSwitch Block: `instance_slot.data` (Insights 2.0, Discovered Accounts V2). Each slot is\n// optional: tupac omits `to_logo` when the user holds no FI-managed account. `logo` is the compact\n// card's (micro, notification) discovered institution.\nexport interface AccountSwitchBlockV2Data {\n from_logo?: LogoRef\n to_logo?: LogoRef\n logo?: LogoRef\n}\n\n// StepChart Block\nexport interface StepChartBlockData {\n completed_steps: number\n label_1: string\n label_2?: string\n}\n\n//Budgets Blocks\nexport enum BudgetTierType {\n LOW_BUDGET_TIER = 'LOW',\n MEDIUM_BUDGET_TIER = 'MEDIUM',\n OFF_TRACK_BUDGET_TIER = 'OFF_TRACK',\n}\n\nexport type BudgetTierValue = `${BudgetTierType}`\n\nexport interface BudgetLocalizedPayload {\n primary_text?: string\n amount_left_label?: string\n spent_label?: string\n budgeted_label?: string\n}\n\nexport interface BudgetBlockData {\n budget_percent: number\n budget_tier: BudgetTierValue\n category_guid?: string\n merchant_guid?: string\n spent_amount: number\n budgeted_amount: number\n localized_payload: BudgetLocalizedPayload\n}\n\nexport interface SVGImageBlockData {\n isCIBC?: boolean\n}\n\n// TransactionDetails Action Block\n// The drawer's subject is `InsightsPayload.primary_transaction_guid`; only action configuration\n// lives here.\nexport interface TransactionDetailsBlockData {\n /** `TopActions` member names, e.g. `['Category', 'Date', 'Memo']`. Omit for the defaults. */\n top_actions?: string[]\n /** `BottomActions` member names, e.g. `['MerchantBudget', 'HideTransaction']`. Omit for defaults. */\n bottom_actions?: string[]\n}\n\n// Credit Utilization action block. The per-card rows are the beat's `data_series` table\n// (`guid`, `label`, `amount`, `total_amount`, `percentage`), carried on `CommonProps.data_series`.\nexport interface CreditUtilizationBlockData {\n accounts_balance_sum?: number\n accounts_credit_limit_sum?: number\n credit_utilization_percentage?: number\n}\n"],"mappings":"AA6IA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,kBAAA,OACA,EAAA,qBAAA,UACA,EAAA,wBAAA;AACF,GAAA,CAAA,CAAA"}
|
|
@@ -26,6 +26,9 @@ interface GeneralInsightsFeedCopy {
|
|
|
26
26
|
/** `_1{institution}` — the alt text of an institution's logo, e.g. "Chase Institution Logo". */
|
|
27
27
|
institution_Logo?: string;
|
|
28
28
|
weekly_no_spending_component_alt_text?: DynamicKeyValue;
|
|
29
|
+
in_month_you_had_a_category_of_amount?: string;
|
|
30
|
+
income_transactions?: string;
|
|
31
|
+
spend_transactions?: string;
|
|
29
32
|
}
|
|
30
33
|
interface SettingsMenuCopy {
|
|
31
34
|
close: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionBlockProps } from '../../mappings/blocks';
|
|
2
|
+
/**
|
|
3
|
+
* Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,
|
|
4
|
+
* name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,
|
|
5
|
+
* actions) for the beat's account. Those components read the account store's selection, so the
|
|
6
|
+
* beat's account is selected here first and nothing renders until the selection matches and the
|
|
7
|
+
* members and institutions are in (the connection section reads the member's status): a guid the
|
|
8
|
+
* store cannot resolve shows the error message, never the previously selected account.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AccountDetailsBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useAccountStore as b, useGlobalCopyStore as S, useGlobalStore as A } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import r from "../../../common/components/Loader.es.js";
|
|
3
|
+
import g from "../../../trends/components/TrendsChart.es.js";
|
|
4
|
+
import x from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
5
|
+
import { resolveAccount as C } from "./layout.es.js";
|
|
6
|
+
import h from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
7
|
+
import { useEffect as _ } from "react";
|
|
8
|
+
import { observer as k } from "mobx-react-lite";
|
|
9
|
+
import n from "@mui/material/Stack";
|
|
10
|
+
import { Text as D } from "@mxenabled/mxui";
|
|
11
|
+
import { jsx as e, jsxs as L } from "react/jsx-runtime";
|
|
12
|
+
var w = k(function({ beat: i }) {
|
|
13
|
+
const { copyStore: m } = A(), { common: s } = S(), { accounts: u, accountsLoaded: d, institutionsLoaded: a, members: c, membersLoaded: f, uiStore: t } = b(), o = C(i, u), l = !!o && t.selectedAccount.guid === o.guid;
|
|
14
|
+
return _(() => {
|
|
15
|
+
o && (t.setSelectedAccount(o), t.setSelectedMember(c.find((p) => p.guid === o.member_guid) ?? {}));
|
|
16
|
+
}, [
|
|
17
|
+
o,
|
|
18
|
+
c,
|
|
19
|
+
t
|
|
20
|
+
]), m.isInitialized ? o ? !l || !f || !a ? /* @__PURE__ */ e(r, {}) : /* @__PURE__ */ L(n, {
|
|
21
|
+
sx: { bgcolor: "background.default" },
|
|
22
|
+
children: [/* @__PURE__ */ e(x, { ChartComponent: g }), /* @__PURE__ */ e(h, {})]
|
|
23
|
+
}) : d ? /* @__PURE__ */ e(n, {
|
|
24
|
+
sx: { p: 24 },
|
|
25
|
+
children: /* @__PURE__ */ e(D, { children: s.error_message })
|
|
26
|
+
}) : /* @__PURE__ */ e(r, {}) : /* @__PURE__ */ e(r, {});
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
w as AccountDetailsBlock
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=AccountDetailsBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport AccountDetailsContent from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent'\nimport AccountDetailsHeader from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport { Loader, useAccountStore, useGlobalCopyStore, useGlobalStore } from '../../../common'\nimport type { Member } from '../../../core'\nimport TrendsChart from '../../../trends/components/TrendsChart'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { resolveAccount } from './layout'\n\n/**\n * Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,\n * name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,\n * actions) for the beat's account. Those components read the account store's selection, so the\n * beat's account is selected here first and nothing renders until the selection matches and the\n * members and institutions are in (the connection section reads the member's status): a guid the\n * store cannot resolve shows the error message, never the previously selected account.\n */\nexport const AccountDetailsBlock = observer(function AccountDetailsBlock({\n beat,\n}: ActionBlockProps) {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const { accounts, accountsLoaded, institutionsLoaded, members, membersLoaded, uiStore } =\n useAccountStore()\n const account = resolveAccount(beat, accounts)\n const isSelected = !!account && uiStore.selectedAccount.guid === account.guid\n\n useEffect(() => {\n if (!account) return\n\n uiStore.setSelectedAccount(account)\n uiStore.setSelectedMember(\n members.find((member) => member.guid === account.member_guid) ?? ({} as Member),\n )\n }, [account, members, uiStore])\n\n if (!copyStore.isInitialized) return <Loader />\n\n if (!account) {\n if (!accountsLoaded) return <Loader />\n\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy.error_message}</Text>\n </Stack>\n )\n }\n\n if (!isSelected || !membersLoaded || !institutionsLoaded) return <Loader />\n\n return (\n <Stack sx={{ bgcolor: 'background.default' }}>\n <AccountDetailsHeader ChartComponent={TrendsChart} />\n <AccountDetailsContent />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,IAAsB,EAAS,SAA6B,EACvE,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,UAAA,GAAU,gBAAA,GAAgB,oBAAA,GAAoB,SAAA,GAAS,eAAA,GAAe,SAAA,EAAA,IAC5E,EAAgB,GACZ,IAAU,EAAe,GAAM,CAAQ,GACvC,IAAa,CAAC,CAAC,KAAW,EAAQ,gBAAgB,SAAS,EAAQ;AAWzE,SATA,EAAA,MAAgB;AACd,IAAK,MAEL,EAAQ,mBAAmB,CAAO,GAClC,EAAQ,kBACN,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAQ,WAAW,KAAM,CAAC,CACrE;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAS;AAAA,IAAS;AAAA,EAAO,CAAC,GAEzB,EAAU,gBAEV,IAUD,CAAC,KAAc,CAAC,KAAiB,CAAC,IAA2B,gBAAA,EAAC,GAAD,CAAS,CAAA,IAGxE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,SAAS,qBAAqB;AAAA,IAA3C,UAAA,CACE,gBAAA,EAAC,GAAD,EAAsB,gBAAgB,EAAc,CAAA,GACpD,gBAAA,EAAC,GAAD,CAAwB,CAAA,CACnB;AAAA,OAfF,IAGH,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,EAAW,cAAoB,CAAA;AAAA,EACjC,CAAA,IALmB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAHF,gBAAA,EAAC,GAAD,CAAS,CAAA;AAoBhD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var n = (r, c) => {
|
|
2
|
+
if (r.primary_account) return r.primary_account;
|
|
3
|
+
const i = r.primary_account_guid ?? r.insights_payload?.primary_account_guid;
|
|
4
|
+
return i ? c.find((u) => u.guid === i) : void 0;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
n as resolveAccount
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/layout.ts"],"sourcesContent":["import type { Account, Beat } from '../../../core'\n\n/** The beat's account: from the beat when the host attached it, else the loaded accounts. */\nexport const resolveAccount = (beat: Beat, accounts: Account[]): Account | undefined => {\n if (beat.primary_account) return beat.primary_account\n\n const guid = beat.primary_account_guid ?? beat.insights_payload?.primary_account_guid\n\n return guid ? accounts.find((account) => account.guid === guid) : undefined\n}\n"],"mappings":"AAGA,IAAa,IAAA,CAAkB,GAAY,MAA6C;AACtF,MAAI,EAAK,gBAAiB,QAAO,EAAK;AAEtC,QAAM,IAAO,EAAK,wBAAwB,EAAK,kBAAkB;AAEjE,SAAO,IAAO,EAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,CAAI,IAAI;AACpE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useAccountStore as a } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { useEffect as c } from "react";
|
|
3
|
+
var u = () => {
|
|
4
|
+
const { accountsLoaded: o, institutionsLoaded: t, loadAccounts: e, loadInstitutions: s, loadMembers: i, membersLoaded: r } = a();
|
|
5
|
+
c(() => {
|
|
6
|
+
o || e(), r || i(), t || s();
|
|
7
|
+
}, [
|
|
8
|
+
o,
|
|
9
|
+
t,
|
|
10
|
+
e,
|
|
11
|
+
s,
|
|
12
|
+
i,
|
|
13
|
+
r
|
|
14
|
+
]);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
u as useAccountDetailsPrepare
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=useAccountDetailsPrepare.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountDetailsPrepare.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nimport { useAccountStore } from '../../../common'\n\n/** Loads accounts, members and institutions once per open: the header names the institution and the connection section reads the member. */\nexport const useAccountDetailsPrepare = () => {\n const {\n accountsLoaded,\n institutionsLoaded,\n loadAccounts,\n loadInstitutions,\n loadMembers,\n membersLoaded,\n } = useAccountStore()\n\n useEffect(() => {\n if (!accountsLoaded) void loadAccounts()\n if (!membersLoaded) void loadMembers()\n if (!institutionsLoaded) void loadInstitutions()\n }, [\n accountsLoaded,\n institutionsLoaded,\n loadAccounts,\n loadInstitutions,\n loadMembers,\n membersLoaded,\n ])\n}\n"],"mappings":";;AAKA,IAAa,IAAA,MAAiC;AAC5C,QAAM,EACJ,gBAAA,GACA,oBAAA,GACA,cAAA,GACA,kBAAA,GACA,aAAA,GACA,eAAA,EAAA,IACE,EAAgB;AAEpB,EAAA,EAAA,MAAgB;AACd,IAAK,KAAgB,EAAkB,GAClC,KAAe,EAAiB,GAChC,KAAoB,EAAsB;AAAA,EACjD,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TipSectionProps } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection';
|
|
3
3
|
import { Transaction } from '../../../core';
|
|
4
|
+
import { SubTabsProps } from '../../components/SubTabs';
|
|
4
5
|
interface TabItem {
|
|
5
6
|
label: string;
|
|
6
7
|
ariaLabel?: string;
|
|
@@ -18,8 +19,9 @@ interface TransactionDrillDownProps {
|
|
|
18
19
|
onEachRowClick?: (guid: string) => void;
|
|
19
20
|
transactionFilter?: (selectedIndex: number) => (transaction: Transaction) => boolean;
|
|
20
21
|
baseTransactions?: Transaction[];
|
|
22
|
+
subTabs?: Omit<SubTabsProps, 'id'>;
|
|
21
23
|
}
|
|
22
|
-
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
24
|
+
export declare const TransactionDrillDown: (({ ariaLabel, heading, subHeadingText, icon, tabs, selectedIndex, top, onSelectionChange, transactionFilter, tipSection, onEachRowClick, baseTransactions, subTabs, }: TransactionDrillDownProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
23
25
|
displayName: string;
|
|
24
26
|
};
|
|
25
27
|
export default TransactionDrillDown;
|
|
@@ -1,113 +1,123 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { exportTransactionsToCSV as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TipSection as
|
|
1
|
+
import { useGlobalCopyStore as A, useGlobalUiStore as G, useTransactionStore as U } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { exportTransactionsToCSV as E } from "../../../core/utils/TransactionUtils.es.js";
|
|
3
|
+
import N from "../../../common/components/Loader.es.js";
|
|
4
|
+
import R from "../../../transactions/components/shared/TransactionList.es.js";
|
|
5
|
+
import { TipSection as V } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
|
|
6
|
+
import { SubTabs as q, subTabPanelProps as z } from "../../components/SubTabs.es.js";
|
|
6
7
|
import "react";
|
|
7
|
-
import { observer as
|
|
8
|
-
import
|
|
9
|
-
import { H3 as
|
|
10
|
-
import
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
var
|
|
17
|
-
const { transactions:
|
|
18
|
-
if (!
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
return /* @__PURE__ */
|
|
8
|
+
import { observer as J } from "mobx-react-lite";
|
|
9
|
+
import m from "@mui/material/Stack";
|
|
10
|
+
import { H3 as K, Text as p } from "@mxenabled/mxui";
|
|
11
|
+
import M from "@mui/material/Button";
|
|
12
|
+
import { Icon as O } from "@mxenabled/mx-icons";
|
|
13
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
14
|
+
import n from "@mui/material/Box";
|
|
15
|
+
import Q from "@mui/material/Tab";
|
|
16
|
+
import X from "@mui/material/Tabs";
|
|
17
|
+
var y = "transaction-drill-down-panel", C = (b) => `transaction-details-tab-${b}`, S = "transaction-drill-down-series", br = J(function({ ariaLabel: _, heading: e, subHeadingText: s, icon: g, tabs: f, selectedIndex: l, top: w, onSelectionChange: D, transactionFilter: h, tipSection: v, onEachRowClick: B, baseTransactions: I, subTabs: x }) {
|
|
18
|
+
const { transactions: c } = A(), { isCopyLoaded: L } = G(), { sortedTransactionsWithSplits: k, tags: P, detailedTransactions: W } = U();
|
|
19
|
+
if (!L) return /* @__PURE__ */ r(N, {});
|
|
20
|
+
const d = !!f?.length, t = x?.tabs.length ? x : void 0, $ = _ ?? c.transactions_title, j = (a, i) => {
|
|
21
|
+
D?.(i);
|
|
22
|
+
}, T = h ? (I ?? W).filter(h(l)) : void 0, u = T ?? k;
|
|
23
|
+
return /* @__PURE__ */ o(n, {
|
|
23
24
|
sx: {
|
|
24
25
|
bgcolor: "background.paper",
|
|
25
26
|
width: "100%"
|
|
26
27
|
},
|
|
27
|
-
children: [
|
|
28
|
-
"aria-label":
|
|
29
|
-
onChange:
|
|
30
|
-
value:
|
|
28
|
+
children: [d && /* @__PURE__ */ r(X, {
|
|
29
|
+
"aria-label": $,
|
|
30
|
+
onChange: j,
|
|
31
|
+
value: l,
|
|
31
32
|
variant: "fullWidth",
|
|
32
|
-
children:
|
|
33
|
-
"aria-controls":
|
|
34
|
-
"aria-label":
|
|
35
|
-
id:
|
|
36
|
-
label:
|
|
33
|
+
children: f.map((a, i) => /* @__PURE__ */ r(Q, {
|
|
34
|
+
"aria-controls": y,
|
|
35
|
+
"aria-label": a.ariaLabel,
|
|
36
|
+
id: C(i),
|
|
37
|
+
label: a.label,
|
|
37
38
|
sx: {
|
|
38
39
|
minWidth: "auto",
|
|
39
40
|
px: 0
|
|
40
41
|
}
|
|
41
|
-
}, `${
|
|
42
|
-
}), /* @__PURE__ */
|
|
43
|
-
"aria-labelledby":
|
|
44
|
-
id:
|
|
45
|
-
role:
|
|
42
|
+
}, `${a.label}-${i}`))
|
|
43
|
+
}), /* @__PURE__ */ o(n, {
|
|
44
|
+
"aria-labelledby": d ? C(l) : void 0,
|
|
45
|
+
id: y,
|
|
46
|
+
role: d ? "tabpanel" : void 0,
|
|
46
47
|
children: [
|
|
47
|
-
(
|
|
48
|
+
(e || s) && /* @__PURE__ */ o(m, {
|
|
48
49
|
sx: {
|
|
49
50
|
gap: 4,
|
|
50
51
|
pt: 16,
|
|
51
52
|
px: 24
|
|
52
53
|
},
|
|
53
|
-
children: [
|
|
54
|
+
children: [e && /* @__PURE__ */ r(K, { children: e }), s && /* @__PURE__ */ o(m, {
|
|
54
55
|
sx: {
|
|
55
56
|
alignItems: "center",
|
|
56
57
|
flexDirection: "row",
|
|
57
58
|
gap: 8
|
|
58
59
|
},
|
|
59
|
-
children: [
|
|
60
|
+
children: [g, /* @__PURE__ */ r(p, {
|
|
60
61
|
textTransform: "uppercase",
|
|
61
62
|
variant: "body2",
|
|
62
|
-
children:
|
|
63
|
+
children: s
|
|
63
64
|
})]
|
|
64
65
|
})]
|
|
65
66
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ r(n, {
|
|
67
68
|
sx: { pt: 16 },
|
|
68
|
-
children:
|
|
69
|
+
children: w
|
|
69
70
|
}),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
borderBottomColor: "divider",
|
|
75
|
-
borderBottomStyle: "solid",
|
|
76
|
-
borderBottomWidth: 1,
|
|
77
|
-
flexDirection: "row",
|
|
78
|
-
justifyContent: "space-between",
|
|
79
|
-
pb: 4,
|
|
80
|
-
pt: 16,
|
|
81
|
-
px: 24
|
|
82
|
-
},
|
|
83
|
-
children: [/* @__PURE__ */ o(m, {
|
|
84
|
-
bold: !0,
|
|
85
|
-
variant: "body1",
|
|
86
|
-
children: l.transactions_title
|
|
87
|
-
}), u.length > 0 && /* @__PURE__ */ o(V, {
|
|
88
|
-
onClick: () => {
|
|
89
|
-
P(u, B);
|
|
90
|
-
},
|
|
91
|
-
startIcon: /* @__PURE__ */ o(q, { name: "ios_share" }),
|
|
92
|
-
sx: { height: 28 },
|
|
93
|
-
children: /* @__PURE__ */ o(m, {
|
|
94
|
-
bold: !0,
|
|
95
|
-
variant: "body2",
|
|
96
|
-
children: l.export_csv_btn
|
|
97
|
-
})
|
|
98
|
-
})]
|
|
71
|
+
t && /* @__PURE__ */ r(q, {
|
|
72
|
+
...t,
|
|
73
|
+
id: S
|
|
99
74
|
}),
|
|
100
|
-
/* @__PURE__ */ o(
|
|
101
|
-
|
|
102
|
-
|
|
75
|
+
/* @__PURE__ */ o(n, {
|
|
76
|
+
...t && z(S, t.selectedIndex),
|
|
77
|
+
children: [
|
|
78
|
+
v && /* @__PURE__ */ r(V, { ...v }),
|
|
79
|
+
/* @__PURE__ */ o(m, {
|
|
80
|
+
sx: {
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
borderBottomColor: "divider",
|
|
83
|
+
borderBottomStyle: "solid",
|
|
84
|
+
borderBottomWidth: 1,
|
|
85
|
+
flexDirection: "row",
|
|
86
|
+
justifyContent: "space-between",
|
|
87
|
+
pb: 4,
|
|
88
|
+
pt: 16,
|
|
89
|
+
px: 24
|
|
90
|
+
},
|
|
91
|
+
children: [/* @__PURE__ */ r(p, {
|
|
92
|
+
bold: !0,
|
|
93
|
+
variant: "body1",
|
|
94
|
+
children: c.transactions_title
|
|
95
|
+
}), u.length > 0 && /* @__PURE__ */ r(M, {
|
|
96
|
+
onClick: () => {
|
|
97
|
+
E(u, P);
|
|
98
|
+
},
|
|
99
|
+
startIcon: /* @__PURE__ */ r(O, { name: "ios_share" }),
|
|
100
|
+
sx: { height: 28 },
|
|
101
|
+
children: /* @__PURE__ */ r(p, {
|
|
102
|
+
bold: !0,
|
|
103
|
+
variant: "body2",
|
|
104
|
+
children: c.export_csv_btn
|
|
105
|
+
})
|
|
106
|
+
})]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ r(R, {
|
|
109
|
+
transaction: T,
|
|
110
|
+
onClick: B
|
|
111
|
+
})
|
|
112
|
+
]
|
|
103
113
|
})
|
|
104
114
|
]
|
|
105
115
|
})]
|
|
106
116
|
});
|
|
107
117
|
});
|
|
108
118
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
br as TransactionDrillDown,
|
|
120
|
+
br as default
|
|
111
121
|
};
|
|
112
122
|
|
|
113
123
|
//# 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 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 { TransactionList } from '../../../transactions'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\n\nconst PANEL_ID = 'transaction-drill-down-panel'\nconst tabId = (index: number) => `transaction-details-tab-${index}`\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}\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}: 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 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 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 textTransform=\"uppercase\" variant=\"body2\">\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n <Box sx={{ pt: 16 }}>{top}</Box>\n\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
|
|
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 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 { TransactionList } from '../../../transactions'\nimport { SubTabs, subTabPanelProps, type SubTabsProps } from '../../components/SubTabs'\n\ninterface TabItem {\n label: string\n ariaLabel?: string\n}\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}\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}: 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 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 textTransform=\"uppercase\" variant=\"body2\">\n {subHeadingText}\n </Text>\n </Stack>\n )}\n </Stack>\n )}\n\n <Box sx={{ 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 {...tipSection} />}\n\n <Stack\n sx={{\n alignItems: 'center',\n borderBottomColor: 'divider',\n borderBottomStyle: 'solid',\n borderBottomWidth: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n pb: 4,\n pt: 16,\n px: 24,\n }}\n >\n <Text bold={true} variant=\"body1\">\n {transactionsCopy.transactions_title}\n </Text>\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 <TransactionList transaction={filteredTransactions} onClick={onEachRowClick} />\n </Box>\n </Box>\n </Box>\n )\n})\n\nexport default TransactionDrillDown\n"],"mappings":"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"}
|