@mx-cartographer/experiences 9.7.41 → 9.7.43
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 +19 -0
- package/dist/core/types/InsightsInstanceSlotData.d.ts +9 -1
- 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/ConnectWidgetActionBlock.es.js +20 -14
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js.map +1 -1
- 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/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.d.ts +5 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +21 -23
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +148 -82
- package/dist/insights-v2/components/CompactInsightCard.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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [9.7.43] - 10-26-2026
|
|
2
|
+
|
|
3
|
+
- **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.
|
|
4
|
+
- **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).
|
|
5
|
+
- **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.
|
|
6
|
+
- **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.
|
|
7
|
+
- **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.
|
|
8
|
+
|
|
9
|
+
## [9.7.42] - 10-26-2026
|
|
10
|
+
|
|
11
|
+
- **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)
|
|
12
|
+
- **ADDED** - `CompactInsightCard` gains the `linked_logos` visual (ditto layout variant): two institution logos overlapping with a decorative link badge, for Discovered Accounts V2's embedded card. The visual receives the slot's whole `data` beside `logo` (WEC-1980)
|
|
13
|
+
- **CHANGED** - `ConnectWidgetActionBlock` opens the Connect widget on the discovered institution (`current_institution_guid`) when the envelope's `drilldown_data.discovered_institution_guid` passes `isLogoGuid`, matching V1; otherwise it opens institution search as before (WEC-1980)
|
|
14
|
+
- **ADDED** - Mock payload `AccountSwitchBlockPayload.json` with the Discovered Accounts V2 envelopes per widget and variant, wrapped as beats in `AccountSwitchBlockBeats.ts` and shown in the `InsightsV2/Insights/ConnectDiscoveredAccountsV2` stories (full and mini per variant, micro, embedded `linked_logos`, notification). A fixture test renders every envelope and checks each CTA names a registered action block (WEC-1980)
|
|
15
|
+
- **FIXED** - Discovered Accounts V2's embedded card shows its "Connect Account(s)" link: tupac sends that CTA as `in_description_cta` only (no `primary_cta`), so `CompactInsightCard`'s `BEAT_CTA_CONFIG` now maps `ConnectDiscoveredAccountsV2` to it and opens `connect_widget_block` in the card's own `ActionBlockLayer`. Without the entry the card read `primary_cta` and drew no link in Transaction Details. The full and embedded fixtures are now the sand API responses (no `to_logo` for a user with no FI-managed account, drawn as the discovered logo alone); the Micro story renders through the micro carousel's `InsightCard` and the Notification story is dropped, as experiences does not render that surface (WEC-1980)
|
|
16
|
+
- **CHANGED** - Mock copy only: `GlobalCopy.json`'s `insights_feed.connection_details` carries V1's Learn More wording (the longer description, five benefits, the full shared-info paragraph and card text), mirroring the mrs_content change so the Connection Details drawer story matches Figma 1943:219219. The hand-built Discovered Accounts V2 fixtures use institution guids that have CDN logos (Chase, Gringotts) so their stories show brand logos; the sand envelopes keep their real guid (WEC-1980)
|
|
17
|
+
- **ADDED** - Exported type `AccountSwitchBlockV2Data` beside `AccountSwitchBlockData` in `InsightsInstanceSlotData.ts`: the Discovered Accounts V2 `instance_slot.data` slots (`from_logo`, `to_logo`, `logo`, each an optional `LogoRef`). `AccountSwitchBlock` and `CompactInsightCard`'s `linked_logos` read their logos through it instead of untyped `slot<LogoRef>()` lookups (WEC-1980)
|
|
18
|
+
- **CHANGED** - Discovered Accounts V2 guards its guids with the existing `isLogoGuid` instead of a separate `isInstitutionGuid`, which is removed from `LogoFromGuid`. `linked_logos` and `AccountSwitchBlock`'s V2 `from_logo` / `to_logo` render each logo through `LogoFromGuid` directly, which already draws nothing for a guid that is not a logo guid (WEC-1980)
|
|
19
|
+
|
|
1
20
|
## [9.7.41] - 10-26-2026
|
|
2
21
|
|
|
3
22
|
- **FIXED** - The neutral status pill on the Set Up Direct Deposit card (`direct_deposit_block`, `set_up_direct_deposit` and `detailed_neutral`) is `grey.100` in light mode and `grey.800` in dark mode, so `text.primary` reads on it in both. It was `grey.200` in both, which left the dark-mode label at about 1.4:1 contrast because the grey tokens do not change with the mode (WEC-2059)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataSeries, Legends } from '../../core';
|
|
1
|
+
import { DataSeries, Legends, LogoRef } from '../../core';
|
|
2
2
|
export interface InsightsInstanceSlotData extends Partial<BudgetBlockData>, Partial<DonutChartBlockData>, Partial<ImageBlockData>, Partial<AccountBlockData>, Partial<SaveExtraBlockData>, Partial<StepChartBlockData>, Partial<SVGImageBlockData>, Partial<AccountSwitchBlockData>, Partial<TransactionDetailsBlockData>, Partial<CreditUtilizationBlockData>, Partial<CommonProps> {
|
|
3
3
|
}
|
|
4
4
|
interface CommonProps {
|
|
@@ -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;
|
|
@@ -83,6 +86,11 @@ export interface AccountSwitchBlockData {
|
|
|
83
86
|
held_institution_guid: string;
|
|
84
87
|
held_institution_name: string;
|
|
85
88
|
}
|
|
89
|
+
export interface AccountSwitchBlockV2Data {
|
|
90
|
+
from_logo?: LogoRef;
|
|
91
|
+
to_logo?: LogoRef;
|
|
92
|
+
logo?: LogoRef;
|
|
93
|
+
}
|
|
86
94
|
export interface StepChartBlockData {
|
|
87
95
|
completed_steps: number;
|
|
88
96
|
label_1: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsInstanceSlotData.es.js","names":[],"sources":["../../../src/core/types/InsightsInstanceSlotData.ts"],"sourcesContent":["import type { DataSeries, Legends } 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// 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;
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { useAccountStore as
|
|
2
|
-
import
|
|
1
|
+
import { useAccountStore as f, useInsightsV2Store as a } from "../../common/context/hooks.es.js";
|
|
2
|
+
import m from "../../common/components/ConnectWidgetPanel.es.js";
|
|
3
3
|
import { ANALYTICS_EVENTS_CONFIG as p } from "../analytics/analyticsEventsConfig.es.js";
|
|
4
|
-
import { useAnalyticsEvent as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { useAnalyticsEvent as g } from "../analytics/useAnalyticsEvent.es.js";
|
|
5
|
+
import { isLogoGuid as l } from "../components/LogoFromGuid.es.js";
|
|
6
|
+
import { useEffect as c, useRef as u } from "react";
|
|
7
|
+
import { observer as _ } from "mobx-react-lite";
|
|
8
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
9
|
+
var D = _(function({ beat: r }) {
|
|
10
|
+
const { actionDrawer: i } = a(), { refreshAccounts: d } = f(), e = g(), t = i.isDrawerOpen && i.guid === r.guid, n = u(t);
|
|
10
11
|
c(() => {
|
|
11
|
-
n.current && !t &&
|
|
12
|
+
n.current && !t && d(), n.current = t;
|
|
12
13
|
}, [t]);
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
t && !
|
|
16
|
-
}, [t,
|
|
14
|
+
const s = u(!1);
|
|
15
|
+
c(() => {
|
|
16
|
+
t && !s.current && e(p.OPENED_CONNECT_DRAWER), s.current = t;
|
|
17
|
+
}, [t, e]);
|
|
18
|
+
const o = r.insights_payload?.drilldown_data?.discovered_institution_guid;
|
|
19
|
+
return /* @__PURE__ */ A(m, {
|
|
20
|
+
isActive: t,
|
|
21
|
+
loadWidgetProps: typeof o == "string" && l(o) ? { current_institution_guid: o } : void 0
|
|
22
|
+
});
|
|
17
23
|
});
|
|
18
24
|
export {
|
|
19
|
-
|
|
25
|
+
D as ConnectWidgetActionBlock
|
|
20
26
|
};
|
|
21
27
|
|
|
22
28
|
//# sourceMappingURL=ConnectWidgetActionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectWidgetActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ConnectWidgetActionBlock.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { ConnectWidgetPanel, useAccountStore, useInsightsV2Store } from '../../common'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../analytics'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `connect_widget_block` — opens MX's Connect widget itself via the shared\n * `ConnectWidgetPanel` (src/common): SSO url via ConnectStore and the\n * iframe-based `@mxenabled/web-widget-sdk` ConnectWidget, with loading/error\n * statuses.\n *\n * Renders the panel directly (not `ConnectDrawer`, which wraps it in its own\n * `Drawer`) — `ActionBlockLayer` already supplies the action drawer's chrome\n * (title from the CTA label, close button), so a second nested `Drawer` here\n * would produce two stacked drawers with two headers and two close buttons.\n *\n * `ActionBlockLayer` does not unmount a drawer-presentation block when the\n * drawer closes — it only toggles the `Drawer`'s `isOpen` — so the account\n * refresh (parity with `ConnectDrawer`'s own `onClose`) is driven by watching\n * this beat's `actionDrawer.isDrawerOpen` transition from true to false,\n * rather than an unmount effect, which would never fire.\n */\nexport const ConnectWidgetActionBlock = observer(function ConnectWidgetActionBlock({\n beat,\n}: ActionBlockProps) {\n const { actionDrawer } = useInsightsV2Store()\n const { refreshAccounts } = useAccountStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid === beat.guid\n const wasOpen = useRef(isCurrentBeatOpen)\n\n useEffect(() => {\n if (wasOpen.current && !isCurrentBeatOpen) {\n void refreshAccounts()\n }\n wasOpen.current = isCurrentBeatOpen\n }, [isCurrentBeatOpen])\n\n // OPENED_CONNECT_DRAWER: the drawer actually opened (any path — CTA or otherwise). Own ref +\n // effect, separate from the refresh logic above: this one is rising-edge, so its ref starts\n // `false` — the block's first render typically happens with the drawer already open (children\n // render on open), and that first open must fire too. Fires once per open, re-arms on close.\n // Pulse parity: ConnectDiscoveredAccounts/Beat.js onPrimaryCtaClick's `opened_connect_drawer`.\n const hasFiredOpen = useRef(false)\n\n useEffect(() => {\n if (isCurrentBeatOpen && !hasFiredOpen.current) {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.OPENED_CONNECT_DRAWER)\n }\n hasFiredOpen.current = isCurrentBeatOpen\n }, [isCurrentBeatOpen, fireAnalyticsEvent])\n\n return <ConnectWidgetPanel
|
|
1
|
+
{"version":3,"file":"ConnectWidgetActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ConnectWidgetActionBlock.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { ConnectWidgetPanel, useAccountStore, useInsightsV2Store } from '../../common'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../analytics'\nimport { isLogoGuid } from '../components/LogoFromGuid'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `connect_widget_block` — opens MX's Connect widget itself via the shared\n * `ConnectWidgetPanel` (src/common): SSO url via ConnectStore and the\n * iframe-based `@mxenabled/web-widget-sdk` ConnectWidget, with loading/error\n * statuses.\n *\n * Renders the panel directly (not `ConnectDrawer`, which wraps it in its own\n * `Drawer`) — `ActionBlockLayer` already supplies the action drawer's chrome\n * (title from the CTA label, close button), so a second nested `Drawer` here\n * would produce two stacked drawers with two headers and two close buttons.\n *\n * `ActionBlockLayer` does not unmount a drawer-presentation block when the\n * drawer closes — it only toggles the `Drawer`'s `isOpen` — so the account\n * refresh (parity with `ConnectDrawer`'s own `onClose`) is driven by watching\n * this beat's `actionDrawer.isDrawerOpen` transition from true to false,\n * rather than an unmount effect, which would never fire.\n */\nexport const ConnectWidgetActionBlock = observer(function ConnectWidgetActionBlock({\n beat,\n}: ActionBlockProps) {\n const { actionDrawer } = useInsightsV2Store()\n const { refreshAccounts } = useAccountStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid === beat.guid\n const wasOpen = useRef(isCurrentBeatOpen)\n\n useEffect(() => {\n if (wasOpen.current && !isCurrentBeatOpen) {\n void refreshAccounts()\n }\n wasOpen.current = isCurrentBeatOpen\n }, [isCurrentBeatOpen])\n\n // OPENED_CONNECT_DRAWER: the drawer actually opened (any path — CTA or otherwise). Own ref +\n // effect, separate from the refresh logic above: this one is rising-edge, so its ref starts\n // `false` — the block's first render typically happens with the drawer already open (children\n // render on open), and that first open must fire too. Fires once per open, re-arms on close.\n // Pulse parity: ConnectDiscoveredAccounts/Beat.js onPrimaryCtaClick's `opened_connect_drawer`.\n const hasFiredOpen = useRef(false)\n\n useEffect(() => {\n if (isCurrentBeatOpen && !hasFiredOpen.current) {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.OPENED_CONNECT_DRAWER)\n }\n hasFiredOpen.current = isCurrentBeatOpen\n }, [isCurrentBeatOpen, fireAnalyticsEvent])\n\n // V1 parity (pulse ConnectDiscoveredAccounts/Beat.js `current_institution_guid`): open the Connect\n // widget on the discovered institution. tupac's `drilldown_data` names it only while the account is\n // not yet connected; a missing or malformed guid opens institution search instead.\n const guid = beat.insights_payload?.drilldown_data?.discovered_institution_guid\n\n return (\n <ConnectWidgetPanel\n isActive={isCurrentBeatOpen}\n loadWidgetProps={\n typeof guid === 'string' && isLogoGuid(guid)\n ? { current_institution_guid: guid }\n : undefined\n }\n />\n )\n})\n"],"mappings":";;;;;;;;AAyBA,IAAa,IAA2B,EAAS,SAAkC,EACjF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,EAAE,iBAAA,EAAA,IAAoB,EAAgB,GACtC,IAAqB,EAAkB,GAEvC,IAAoB,EAAa,gBAAgB,EAAa,SAAS,EAAK,MAC5E,IAAU,EAAO,CAAiB;AAExC,EAAA,EAAA,MAAgB;AACd,IAAI,EAAQ,WAAW,CAAC,KACtB,EAAqB,GAEvB,EAAQ,UAAU;AAAA,EACpB,GAAG,CAAC,CAAiB,CAAC;AAOtB,QAAM,IAAe,EAAO,EAAK;AAEjC,EAAA,EAAA,MAAgB;AACd,IAAI,KAAqB,CAAC,EAAa,WACrC,EAAmB,EAAwB,qBAAqB,GAElE,EAAa,UAAU;AAAA,EACzB,GAAG,CAAC,GAAmB,CAAkB,CAAC;AAK1C,QAAM,IAAO,EAAK,kBAAkB,gBAAgB;AAEpD,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,UAAU;AAAA,IACV,iBACE,OAAO,KAAS,YAAY,EAAW,CAAI,IACvC,EAAE,0BAA0B,EAAK,IACjC;AAAA,EAEP,CAAA;AAEL,CAAC"}
|
|
@@ -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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"}
|